Skip to content

Instantly share code, notes, and snippets.

@andymason
Created October 5, 2015 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andymason/78a4141a3b57e110ba53 to your computer and use it in GitHub Desktop.
Save andymason/78a4141a3b57e110ba53 to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
/**
* @license almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/almond for details
*/
/*!
* jQuery JavaScript Library v1.11.2
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2014-12-17T15:27Z
*/
/*!
* Sizzle CSS Selector Engine v2.2.0-pre
* http://sizzlejs.com/
*
* Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2014-12-16
*/
/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js*/
/*!
* VERSION: 1.15.1
* DATE: 2015-01-20
* UPDATES AND DOCS AT: http://greensock.com
*
* Includes all of the following: TweenLite, TweenMax, TimelineLite, TimelineMax, EasePack, CSSPlugin, RoundPropsPlugin, BezierPlugin, AttrPlugin, DirectionalRotationPlugin
*
* @license Copyright (c) 2008-2015, GreenSock. All rights reserved.
* This work is subject to the terms at http://greensock.com/standard-license or for
* Club GreenSock members, the software agreement that was issued with your membership.
*
* @author: Jack Doyle, jack@greensock.com
**/
/*!
* mustache.js - Logic-less {{mustache}} templates with JavaScript
* http://github.com/janl/mustache.js
*/
/*!
* howler.js v1.1.25
* howlerjs.com
*
* (c) 2013-2014, James Simpson of GoldFire Studios
* goldfirestudios.com
*
* MIT License
*/
/*!
* VERSION: beta 0.6.3
* DATE: 2014-12-31
* UPDATES AND DOCS AT: http://www.greensock.com
*
* @license Copyright (c) 2008-2015, GreenSock. All rights reserved.
* This work is subject to the terms at http://greensock.com/standard-license or for
* Club GreenSock members, the software agreement that was issued with your membership.
*
* @author: Jack Doyle, jack@greensock.com
*/
/**
* @license RequireJS text 2.0.14 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/requirejs/text for details
*/
/*
Copyright (c) 2011 Juan Mellado
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.
*/
/* Copyright (c) 2013, Brandon Jones, Colin MacKenzie IV. 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.
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 THE COPYRIGHT HOLDER OR CONTRIBUTORS 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. */
/**
* dat-gui JavaScript Controller Library
* http://code.google.com/p/dat-gui
*
* Copyright 2011 Data Arts Team, Google Creative Lab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
function trace_init(e) {
trace_initiated = !0;
if (trace_showTraces) try {
console.log("")
} catch (t) {
trace_showTraces = !1;
if (trace_divListFallback) {
var n = document.createElement("div");
document.body.appendChild(n), n.id = "divListContainer", n.style.position = "absolute", n.style.top = "0px", n.style.left = "0px", n.style.height = "100%", n.style.width = "700px", n.style.background = "#000000", n.style.color = "#FFFFFF", n.style.fontSize = "10px";
var r = document.createElement("ul");
n.appendChild(r), r.style.height = "100%", r.style.width = "100%", r.style.overflow = "scroll";
var i = document.createElement("div");
n.appendChild(i), addListener(i, "click", trace_toggleDivList, !1), i.style.position = "absolute", i.style.top = "0px", i.style.left = "100%", i.style.color = "#000000", i.style.padding = "5px", i.style.padding = "5px", i.style.background = "#FFFFFF", i.style.fontWeight = "bold", i.innerHTML = "TOGGLE<br/>TRACE", trace_divListContainer = n, trace_divList = r
}
} else trace_divListFallback = !1
}
function trace_toggleDivList(e) {
trace_divListVisible = !trace_divListVisible, divListContainer.style.left = trace_divListVisible ? "0px" : "-700px"
}
function trace(e) {
trace_initiated || trace_init();
if (trace_showTraces) console.log(e);
else if (trace_divListFallback) {
var t = document.createElement("li");
t.innerHTML = String(e), trace_divList.appendChild(t)
}
}
var requirejs, require, define;
(function(e) {
function h(e, t) {
return f.call(e, t)
}
function p(e, t) {
var n, r, i, s, o, a, f, l, h, p, d, v = t && t.split("/"),
m = u.map,
g = m && m["*"] || {};
if (e && e.charAt(0) === ".")
if (t) {
e = e.split("/"), o = e.length - 1, u.nodeIdCompat && c.test(e[o]) && (e[o] = e[o].replace(c, "")), e = v.slice(0, v.length - 1).concat(e);
for (h = 0; h < e.length; h += 1) {
d = e[h];
if (d === ".") e.splice(h, 1), h -= 1;
else if (d === "..") {
if (h === 1 && (e[2] === ".." || e[0] === "..")) break;
h > 0 && (e.splice(h - 1, 2), h -= 2)
}
}
e = e.join("/")
} else e.indexOf("./") === 0 && (e = e.substring(2));
if ((v || g) && m) {
n = e.split("/");
for (h = n.length; h > 0; h -= 1) {
r = n.slice(0, h).join("/");
if (v)
for (p = v.length; p > 0; p -= 1) {
i = m[v.slice(0, p).join("/")];
if (i) {
i = i[r];
if (i) {
s = i, a = h;
break
}
}
}
if (s) break;
!f && g && g[r] && (f = g[r], l = h)
}!s && f && (s = f, a = l), s && (n.splice(0, a, s), e = n.join("/"))
}
return e
}
function d(t, r) {
return function() {
var i = l.call(arguments, 0);
return typeof i[0] != "string" && i.length === 1 && i.push(null), n.apply(e, i.concat([t, r]))
}
}
function v(e) {
return function(t) {
return p(t, e)
}
}
function m(e) {
return function(t) {
s[e] = t
}
}
function g(n) {
if (h(o, n)) {
var r = o[n];
delete o[n], a[n] = !0, t.apply(e, r)
}
if (!h(s, n) && !h(a, n)) throw new Error("No " + n);
return s[n]
}
function y(e) {
var t, n = e ? e.indexOf("!") : -1;
return n > -1 && (t = e.substring(0, n), e = e.substring(n + 1, e.length)), [t, e]
}
function b(e) {
return function() {
return u && u.config && u.config[e] || {}
}
}
var t, n, r, i, s = {},
o = {},
u = {},
a = {},
f = Object.prototype.hasOwnProperty,
l = [].slice,
c = /\.js$/;
r = function(e, t) {
var n, r = y(e),
i = r[0];
return e = r[1], i && (i = p(i, t), n = g(i)), i ? n && n.normalize ? e = n.normalize(e, v(t)) : e = p(e, t) : (e = p(e, t), r = y(e), i = r[0], e = r[1], i && (n = g(i))), {
f: i ? i + "!" + e : e,
n: e,
pr: i,
p: n
}
}, i = {
require: function(e) {
return d(e)
},
exports: function(e) {
var t = s[e];
return typeof t != "undefined" ? t : s[e] = {}
},
module: function(e) {
return {
id: e,
uri: "",
exports: s[e],
config: b(e)
}
}
}, t = function(t, n, u, f) {
var l, c, p, v, y, b = [],
w = typeof u,
E;
f = f || t;
if (w === "undefined" || w === "function") {
n = !n.length && u.length ? ["require", "exports", "module"] : n;
for (y = 0; y < n.length; y += 1) {
v = r(n[y], f), c = v.f;
if (c === "require") b[y] = i.require(t);
else if (c === "exports") b[y] = i.exports(t), E = !0;
else if (c === "module") l = b[y] = i.module(t);
else if (h(s, c) || h(o, c) || h(a, c)) b[y] = g(c);
else {
if (!v.p) throw new Error(t + " missing " + c);
v.p.load(v.n, d(f, !0), m(c), {}), b[y] = s[c]
}
}
p = u ? u.apply(s[t], b) : undefined;
if (t)
if (l && l.exports !== e && l.exports !== s[t]) s[t] = l.exports;
else if (p !== e || !E) s[t] = p
} else t && (s[t] = u)
}, requirejs = require = n = function(s, o, a, f, l) {
if (typeof s == "string") return i[s] ? i[s](o) : g(r(s, o).f);
if (!s.splice) {
u = s, u.deps && n(u.deps, u.callback);
if (!o) return;
o.splice ? (s = o, o = a, a = null) : s = e
}
return o = o || function() {}, typeof a == "function" && (a = f, f = l), f ? t(e, s, o, a) : setTimeout(function() {
t(e, s, o, a)
}, 4), n
}, n.config = function(e) {
return n(e)
}, requirejs._defined = s, define = function(e, t, n) {
if (typeof e != "string") throw new Error("See almond README: incorrect module build, no module name");
t.splice || (n = t, t = []), !h(s, e) && !h(o, e) && (o[e] = [e, t, n])
}, define.amd = {
jQuery: !0
}
})(), define("../bower_components/almond/almond", function() {}),
function(e, t) {
typeof module == "object" && typeof module.exports == "object" ? module.exports = e.document ? t(e, !0) : function(e) {
if (!e.document) throw new Error("jQuery requires a window with a document");
return t(e)
} : t(e)
}(typeof window != "undefined" ? window : this, function(e, t) {
function g(e) {
var t = e.length,
n = h.type(e);
return n === "function" || h.isWindow(e) ? !1 : e.nodeType === 1 && t ? !0 : n === "array" || t === 0 || typeof t == "number" && t > 0 && t - 1 in e
}
function S(e, t, n) {
if (h.isFunction(t)) return h.grep(e, function(e, r) {
return !!t.call(e, r, e) !== n
});
if (t.nodeType) return h.grep(e, function(e) {
return e === t !== n
});
if (typeof t == "string") {
if (E.test(t)) return h.filter(t, e, n);
t = h.filter(t, e)
}
return h.grep(e, function(e) {
return h.inArray(e, t) >= 0 !== n
})
}
function A(e, t) {
do e = e[t]; while (e && e.nodeType !== 1);
return e
}
function _(e) {
var t = M[e] = {};
return h.each(e.match(O) || [], function(e, n) {
t[n] = !0
}), t
}
function P() {
T.addEventListener ? (T.removeEventListener("DOMContentLoaded", H, !1), e.removeEventListener("load", H, !1)) : (T.detachEvent("onreadystatechange", H), e.detachEvent("onload", H))
}
function H() {
if (T.addEventListener || event.type === "load" || T.readyState === "complete") P(), h.ready()
}
function q(e, t, n) {
if (n === undefined && e.nodeType === 1) {
var r = "data-" + t.replace(I, "-$1").toLowerCase();
n = e.getAttribute(r);
if (typeof n == "string") {
try {
n = n === "true" ? !0 : n === "false" ? !1 : n === "null" ? null : +n + "" === n ? +n : F.test(n) ? h.parseJSON(n) : n
} catch (i) {}
h.data(e, t, n)
} else n = undefined
}
return n
}
function R(e) {
var t;
for (t in e) {
if (t === "data" && h.isEmptyObject(e[t])) continue;
if (t !== "toJSON") return !1
}
return !0
}
function U(e, t, r, i) {
if (!h.acceptData(e)) return;
var s, o, u = h.expando,
a = e.nodeType,
f = a ? h.cache : e,
l = a ? e[u] : e[u] && u;
if ((!l || !f[l] || !i && !f[l].data) && r === undefined && typeof t == "string") return;
l || (a ? l = e[u] = n.pop() || h.guid++ : l = u), f[l] || (f[l] = a ? {} : {
toJSON: h.noop
});
if (typeof t == "object" || typeof t == "function") i ? f[l] = h.extend(f[l], t) : f[l].data = h.extend(f[l].data, t);
return o = f[l], i || (o.data || (o.data = {}), o = o.data), r !== undefined && (o[h.camelCase(t)] = r), typeof t == "string" ? (s = o[t], s == null && (s = o[h.camelCase(t)])) : s = o, s
}
function z(e, t, n) {
if (!h.acceptData(e)) return;
var r, i, s = e.nodeType,
o = s ? h.cache : e,
u = s ? e[h.expando] : h.expando;
if (!o[u]) return;
if (t) {
r = n ? o[u] : o[u].data;
if (r) {
h.isArray(t) ? t = t.concat(h.map(t, h.camelCase)) : t in r ? t = [t] : (t = h.camelCase(t), t in r ? t = [t] : t = t.split(" ")), i = t.length;
while (i--) delete r[t[i]];
if (n ? !R(r) : !h.isEmptyObject(r)) return
}
}
if (!n) {
delete o[u].data;
if (!R(o[u])) return
}
s ? h.cleanData([e], !0) : l.deleteExpando || o != o.window ? delete o[u] : o[u] = null
}
function et() {
return !0
}
function tt() {
return !1
}
function nt() {
try {
return T.activeElement
} catch (e) {}
}
function rt(e) {
var t = it.split("|"),
n = e.createDocumentFragment();
if (n.createElement)
while (t.length) n.createElement(t.pop());
return n
}
function wt(e, t) {
var n, r, i = 0,
s = typeof e.getElementsByTagName !== B ? e.getElementsByTagName(t || "*") : typeof e.querySelectorAll !== B ? e.querySelectorAll(t || "*") : undefined;
if (!s)
for (s = [], n = e.childNodes || e;
(r = n[i]) != null; i++) !t || h.nodeName(r, t) ? s.push(r) : h.merge(s, wt(r, t));
return t === undefined || t && h.nodeName(e, t) ? h.merge([e], s) : s
}
function Et(e) {
J.test(e.type) && (e.defaultChecked = e.checked)
}
function St(e, t) {
return h.nodeName(e, "table") && h.nodeName(t.nodeType !== 11 ? t : t.firstChild, "tr") ? e.getElementsByTagName("tbody")[0] || e.appendChild(e.ownerDocument.createElement("tbody")) : e
}
function xt(e) {
return e.type = (h.find.attr(e, "type") !== null) + "/" + e.type, e
}
function Tt(e) {
var t = vt.exec(e.type);
return t ? e.type = t[1] : e.removeAttribute("type"), e
}
function Nt(e, t) {
var n, r = 0;
for (;
(n = e[r]) != null; r++) h._data(n, "globalEval", !t || h._data(t[r], "globalEval"))
}
function Ct(e, t) {
if (t.nodeType !== 1 || !h.hasData(e)) return;
var n, r, i, s = h._data(e),
o = h._data(t, s),
u = s.events;
if (u) {
delete o.handle, o.events = {};
for (n in u)
for (r = 0, i = u[n].length; r < i; r++) h.event.add(t, n, u[n][r])
}
o.data && (o.data = h.extend({}, o.data))
}
function kt(e, t) {
var n, r, i;
if (t.nodeType !== 1) return;
n = t.nodeName.toLowerCase();
if (!l.noCloneEvent && t[h.expando]) {
i = h._data(t);
for (r in i.events) h.removeEvent(t, r, i.handle);
t.removeAttribute(h.expando)
}
if (n === "script" && t.text !== e.text) xt(t).text = e.text, Tt(t);
else if (n === "object") t.parentNode && (t.outerHTML = e.outerHTML), l.html5Clone && e.innerHTML && !h.trim(t.innerHTML) && (t.innerHTML = e.innerHTML);
else if (n === "input" && J.test(e.type)) t.defaultChecked = t.checked = e.checked, t.value !== e.value && (t.value = e.value);
else if (n === "option") t.defaultSelected = t.selected = e.defaultSelected;
else if (n === "input" || n === "textarea") t.defaultValue = e.defaultValue
}
function Ot(t, n) {
var r, i = h(n.createElement(t)).appendTo(n.body),
s = e.getDefaultComputedStyle && (r = e.getDefaultComputedStyle(i[0])) ? r.display : h.css(i[0], "display");
return i.detach(), s
}
function Mt(e) {
var t = T,
n = At[e];
if (!n) {
n = Ot(e, t);
if (n === "none" || !n) Lt = (Lt || h("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement), t = (Lt[0].contentWindow || Lt[0].contentDocument).document, t.write(), t.close(), n = Ot(e, t), Lt.detach();
At[e] = n
}
return n
}
function jt(e, t) {
return {
get: function() {
var n = e();
if (n == null) return;
if (n) {
delete this.get;
return
}
return (this.get = t).apply(this, arguments)
}
}
}
function Vt(e, t) {
if (t in e) return t;
var n = t.charAt(0).toUpperCase() + t.slice(1),
r = t,
i = Xt.length;
while (i--) {
t = Xt[i] + n;
if (t in e) return t
}
return r
}
function $t(e, t) {
var n, r, i, s = [],
o = 0,
u = e.length;
for (; o < u; o++) {
r = e[o];
if (!r.style) continue;
s[o] = h._data(r, "olddisplay"), n = r.style.display, t ? (!s[o] && n === "none" && (r.style.display = ""), r.style.display === "" && V(r) && (s[o] = h._data(r, "olddisplay", Mt(r.nodeName)))) : (i = V(r), (n && n !== "none" || !i) && h._data(r, "olddisplay", i ? n : h.css(r, "display")))
}
for (o = 0; o < u; o++) {
r = e[o];
if (!r.style) continue;
if (!t || r.style.display === "none" || r.style.display === "") r.style.display = t ? s[o] || "" : "none"
}
return e
}
function Jt(e, t, n) {
var r = Rt.exec(t);
return r ? Math.max(0, r[1] - (n || 0)) + (r[2] || "px") : t
}
function Kt(e, t, n, r, i) {
var s = n === (r ? "border" : "content") ? 4 : t === "width" ? 1 : 0,
o = 0;
for (; s < 4; s += 2) n === "margin" && (o += h.css(e, n + X[s], !0, i)), r ? (n === "content" && (o -= h.css(e, "padding" + X[s], !0, i)), n !== "margin" && (o -= h.css(e, "border" + X[s] + "Width", !0, i))) : (o += h.css(e, "padding" + X[s], !0, i), n !== "padding" && (o += h.css(e, "border" + X[s] + "Width", !0, i)));
return o
}
function Qt(e, t, n) {
var r = !0,
i = t === "width" ? e.offsetWidth : e.offsetHeight,
s = Pt(e),
o = l.boxSizing && h.css(e, "boxSizing", !1, s) === "border-box";
if (i <= 0 || i == null) {
i = Ht(e, t, s);
if (i < 0 || i == null) i = e.style[t];
if (Dt.test(i)) return i;
r = o && (l.boxSizingReliable() || i === e.style[t]), i = parseFloat(i) || 0
}
return i + Kt(e, t, n || (o ? "border" : "content"), r, s) + "px"
}
function Gt(e, t, n, r, i) {
return new Gt.prototype.init(e, t, n, r, i)
}
function on() {
return setTimeout(function() {
Yt = undefined
}), Yt = h.now()
}
function un(e, t) {
var n, r = {
height: e
},
i = 0;
t = t ? 1 : 0;
for (; i < 4; i += 2 - t) n = X[i], r["margin" + n] = r["padding" + n] = e;
return t && (r.opacity = r.width = e), r
}
function an(e, t, n) {
var r, i = (sn[t] || []).concat(sn["*"]),
s = 0,
o = i.length;
for (; s < o; s++)
if (r = i[s].call(n, t, e)) return r
}
function fn(e, t, n) {
var r, i, s, o, u, a, f, c, p = this,
d = {},
v = e.style,
m = e.nodeType && V(e),
g = h._data(e, "fxshow");
n.queue || (u = h._queueHooks(e, "fx"), u.unqueued == null && (u.unqueued = 0, a = u.empty.fire, u.empty.fire = function() {
u.unqueued || a()
}), u.unqueued++, p.always(function() {
p.always(function() {
u.unqueued--, h.queue(e, "fx").length || u.empty.fire()
})
})), e.nodeType === 1 && ("height" in t || "width" in t) && (n.overflow = [v.overflow, v.overflowX, v.overflowY], f = h.css(e, "display"), c = f === "none" ? h._data(e, "olddisplay") || Mt(e.nodeName) : f, c === "inline" && h.css(e, "float") === "none" && (!l.inlineBlockNeedsLayout || Mt(e.nodeName) === "inline" ? v.display = "inline-block" : v.zoom = 1)), n.overflow && (v.overflow = "hidden", l.shrinkWrapBlocks() || p.always(function() {
v.overflow = n.overflow[0], v.overflowX = n.overflow[1], v.overflowY = n.overflow[2]
}));
for (r in t) {
i = t[r];
if (en.exec(i)) {
delete t[r], s = s || i === "toggle";
if (i === (m ? "hide" : "show")) {
if (i !== "show" || !g || g[r] === undefined) continue;
m = !0
}
d[r] = g && g[r] || h.style(e, r)
} else f = undefined
}
if (!h.isEmptyObject(d)) {
g ? "hidden" in g && (m = g.hidden) : g = h._data(e, "fxshow", {}), s && (g.hidden = !m), m ? h(e).show() : p.done(function() {
h(e).hide()
}), p.done(function() {
var t;
h._removeData(e, "fxshow");
for (t in d) h.style(e, t, d[t])
});
for (r in d) o = an(m ? g[r] : 0, r, p), r in g || (g[r] = o.start, m && (o.end = o.start, o.start = r === "width" || r === "height" ? 1 : 0))
} else(f === "none" ? Mt(e.nodeName) : f) === "inline" && (v.display = f)
}
function ln(e, t) {
var n, r, i, s, o;
for (n in e) {
r = h.camelCase(n), i = t[r], s = e[n], h.isArray(s) && (i = s[1], s = e[n] = s[0]), n !== r && (e[r] = s, delete e[n]), o = h.cssHooks[r];
if (o && "expand" in o) {
s = o.expand(s), delete e[r];
for (n in s) n in e || (e[n] = s[n], t[n] = i)
} else t[r] = i
}
}
function cn(e, t, n) {
var r, i, s = 0,
o = rn.length,
u = h.Deferred().always(function() {
delete a.elem
}),
a = function() {
if (i) return !1;
var t = Yt || on(),
n = Math.max(0, f.startTime + f.duration - t),
r = n / f.duration || 0,
s = 1 - r,
o = 0,
a = f.tweens.length;
for (; o < a; o++) f.tweens[o].run(s);
return u.notifyWith(e, [f, s, n]), s < 1 && a ? n : (u.resolveWith(e, [f]), !1)
},
f = u.promise({
elem: e,
props: h.extend({}, t),
opts: h.extend(!0, {
specialEasing: {}
}, n),
originalProperties: t,
originalOptions: n,
startTime: Yt || on(),
duration: n.duration,
tweens: [],
createTween: function(t, n) {
var r = h.Tween(e, f.opts, t, n, f.opts.specialEasing[t] || f.opts.easing);
return f.tweens.push(r), r
},
stop: function(t) {
var n = 0,
r = t ? f.tweens.length : 0;
if (i) return this;
i = !0;
for (; n < r; n++) f.tweens[n].run(1);
return t ? u.resolveWith(e, [f, t]) : u.rejectWith(e, [f, t]), this
}
}),
l = f.props;
ln(l, f.opts.specialEasing);
for (; s < o; s++) {
r = rn[s].call(f, e, l, f.opts);
if (r) return r
}
return h.map(l, an, f), h.isFunction(f.opts.start) && f.opts.start.call(e, f), h.fx.timer(h.extend(a, {
elem: e,
anim: f,
queue: f.opts.queue
})), f.progress(f.opts.progress).done(f.opts.done, f.opts.complete).fail(f.opts.fail).always(f.opts.always)
}
function Fn(e) {
return function(t, n) {
typeof t != "string" && (n = t, t = "*");
var r, i = 0,
s = t.toLowerCase().match(O) || [];
if (h.isFunction(n))
while (r = s[i++]) r.charAt(0) === "+" ? (r = r.slice(1) || "*", (e[r] = e[r] || []).unshift(n)) : (e[r] = e[r] || []).push(n)
}
}
function In(e, t, n, r) {
function o(u) {
var a;
return i[u] = !0, h.each(e[u] || [], function(e, u) {
var f = u(t, n, r);
if (typeof f == "string" && !s && !i[f]) return t.dataTypes.unshift(f), o(f), !1;
if (s) return !(a = f)
}), a
}
var i = {},
s = e === Hn;
return o(t.dataTypes[0]) || !i["*"] && o("*")
}
function qn(e, t) {
var n, r, i = h.ajaxSettings.flatOptions || {};
for (r in t) t[r] !== undefined && ((i[r] ? e : n || (n = {}))[r] = t[r]);
return n && h.extend(!0, e, n), e
}
function Rn(e, t, n) {
var r, i, s, o, u = e.contents,
a = e.dataTypes;
while (a[0] === "*") a.shift(), i === undefined && (i = e.mimeType || t.getResponseHeader("Content-Type"));
if (i)
for (o in u)
if (u[o] && u[o].test(i)) {
a.unshift(o);
break
}
if (a[0] in n) s = a[0];
else {
for (o in n) {
if (!a[0] || e.converters[o + " " + a[0]]) {
s = o;
break
}
r || (r = o)
}
s = s || r
}
if (s) return s !== a[0] && a.unshift(s), n[s]
}
function Un(e, t, n, r) {
var i, s, o, u, a, f = {},
l = e.dataTypes.slice();
if (l[1])
for (o in e.converters) f[o.toLowerCase()] = e.converters[o];
s = l.shift();
while (s) {
e.responseFields[s] && (n[e.responseFields[s]] = t), !a && r && e.dataFilter && (t = e.dataFilter(t, e.dataType)), a = s, s = l.shift();
if (s)
if (s === "*") s = a;
else if (a !== "*" && a !== s) {
o = f[a + " " + s] || f["* " + s];
if (!o)
for (i in f) {
u = i.split(" ");
if (u[1] === s) {
o = f[a + " " + u[0]] || f["* " + u[0]];
if (o) {
o === !0 ? o = f[i] : f[i] !== !0 && (s = u[0], l.unshift(u[1]));
break
}
}
}
if (o !== !0)
if (o && e["throws"]) t = o(t);
else try {
t = o(t)
} catch (c) {
return {
state: "parsererror",
error: o ? c : "No conversion from " + a + " to " + s
}
}
}
}
return {
state: "success",
data: t
}
}
function Jn(e, t, n, r) {
var i;
if (h.isArray(t)) h.each(t, function(t, i) {
n || Wn.test(e) ? r(e, i) : Jn(e + "[" + (typeof i == "object" ? t : "") + "]", i, n, r)
});
else if (!n && h.type(t) === "object")
for (i in t) Jn(e + "[" + i + "]", t[i], n, r);
else r(e, t)
}
function Yn() {
try {
return new e.XMLHttpRequest
} catch (t) {}
}
function Zn() {
try {
return new e.ActiveXObject("Microsoft.XMLHTTP")
} catch (t) {}
}
function ir(e) {
return h.isWindow(e) ? e : e.nodeType === 9 ? e.defaultView || e.parentWindow : !1
}
var n = [],
r = n.slice,
i = n.concat,
s = n.push,
o = n.indexOf,
u = {},
a = u.toString,
f = u.hasOwnProperty,
l = {},
c = "1.11.2",
h = function(e, t) {
return new h.fn.init(e, t)
},
p = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
d = /^-ms-/,
v = /-([\da-z])/gi,
m = function(e, t) {
return t.toUpperCase()
};
h.fn = h.prototype = {
jquery: c,
constructor: h,
selector: "",
length: 0,
toArray: function() {
return r.call(this)
},
get: function(e) {
return e != null ? e < 0 ? this[e + this.length] : this[e] : r.call(this)
},
pushStack: function(e) {
var t = h.merge(this.constructor(), e);
return t.prevObject = this, t.context = this.context, t
},
each: function(e, t) {
return h.each(this, e, t)
},
map: function(e) {
return this.pushStack(h.map(this, function(t, n) {
return e.call(t, n, t)
}))
},
slice: function() {
return this.pushStack(r.apply(this, arguments))
},
first: function() {
return this.eq(0)
},
last: function() {
return this.eq(-1)
},
eq: function(e) {
var t = this.length,
n = +e + (e < 0 ? t : 0);
return this.pushStack(n >= 0 && n < t ? [this[n]] : [])
},
end: function() {
return this.prevObject || this.constructor(null)
},
push: s,
sort: n.sort,
splice: n.splice
}, h.extend = h.fn.extend = function() {
var e, t, n, r, i, s, o = arguments[0] || {},
u = 1,
a = arguments.length,
f = !1;
typeof o == "boolean" && (f = o, o = arguments[u] || {}, u++), typeof o != "object" && !h.isFunction(o) && (o = {}), u === a && (o = this, u--);
for (; u < a; u++)
if ((i = arguments[u]) != null)
for (r in i) {
e = o[r], n = i[r];
if (o === n) continue;
f && n && (h.isPlainObject(n) || (t = h.isArray(n))) ? (t ? (t = !1, s = e && h.isArray(e) ? e : []) : s = e && h.isPlainObject(e) ? e : {}, o[r] = h.extend(f, s, n)) : n !== undefined && (o[r] = n)
}
return o
}, h.extend({
expando: "jQuery" + (c + Math.random()).replace(/\D/g, ""),
isReady: !0,
error: function(e) {
throw new Error(e)
},
noop: function() {},
isFunction: function(e) {
return h.type(e) === "function"
},
isArray: Array.isArray || function(e) {
return h.type(e) === "array"
},
isWindow: function(e) {
return e != null && e == e.window
},
isNumeric: function(e) {
return !h.isArray(e) && e - parseFloat(e) + 1 >= 0
},
isEmptyObject: function(e) {
var t;
for (t in e) return !1;
return !0
},
isPlainObject: function(e) {
var t;
if (!e || h.type(e) !== "object" || e.nodeType || h.isWindow(e)) return !1;
try {
if (e.constructor && !f.call(e, "constructor") && !f.call(e.constructor.prototype, "isPrototypeOf")) return !1
} catch (n) {
return !1
}
if (l.ownLast)
for (t in e) return f.call(e, t);
for (t in e);
return t === undefined || f.call(e, t)
},
type: function(e) {
return e == null ? e + "" : typeof e == "object" || typeof e == "function" ? u[a.call(e)] || "object" : typeof e
},
globalEval: function(t) {
t && h.trim(t) && (e.execScript || function(t) {
e.eval.call(e, t)
})(t)
},
camelCase: function(e) {
return e.replace(d, "ms-").replace(v, m)
},
nodeName: function(e, t) {
return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase()
},
each: function(e, t, n) {
var r, i = 0,
s = e.length,
o = g(e);
if (n)
if (o)
for (; i < s; i++) {
r = t.apply(e[i], n);
if (r === !1) break
} else
for (i in e) {
r = t.apply(e[i], n);
if (r === !1) break
} else if (o)
for (; i < s; i++) {
r = t.call(e[i], i, e[i]);
if (r === !1) break
} else
for (i in e) {
r = t.call(e[i], i, e[i]);
if (r === !1) break
}
return e
},
trim: function(e) {
return e == null ? "" : (e + "").replace(p, "")
},
makeArray: function(e, t) {
var n = t || [];
return e != null && (g(Object(e)) ? h.merge(n, typeof e == "string" ? [e] : e) : s.call(n, e)), n
},
inArray: function(e, t, n) {
var r;
if (t) {
if (o) return o.call(t, e, n);
r = t.length, n = n ? n < 0 ? Math.max(0, r + n) : n : 0;
for (; n < r; n++)
if (n in t && t[n] === e) return n
}
return -1
},
merge: function(e, t) {
var n = +t.length,
r = 0,
i = e.length;
while (r < n) e[i++] = t[r++];
if (n !== n)
while (t[r] !== undefined) e[i++] = t[r++];
return e.length = i, e
},
grep: function(e, t, n) {
var r, i = [],
s = 0,
o = e.length,
u = !n;
for (; s < o; s++) r = !t(e[s], s), r !== u && i.push(e[s]);
return i
},
map: function(e, t, n) {
var r, s = 0,
o = e.length,
u = g(e),
a = [];
if (u)
for (; s < o; s++) r = t(e[s], s, n), r != null && a.push(r);
else
for (s in e) r = t(e[s], s, n), r != null && a.push(r);
return i.apply([], a)
},
guid: 1,
proxy: function(e, t) {
var n, i, s;
return typeof t == "string" && (s = e[t], t = e, e = s), h.isFunction(e) ? (n = r.call(arguments, 2), i = function() {
return e.apply(t || this, n.concat(r.call(arguments)))
}, i.guid = e.guid = e.guid || h.guid++, i) : undefined
},
now: function() {
return +(new Date)
},
support: l
}), h.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(e, t) {
u["[object " + t + "]"] = t.toLowerCase()
});
var y = function(e) {
function ot(e, t, r, i) {
var s, u, f, l, c, d, g, y, S, x;
(t ? t.ownerDocument || t : E) !== p && h(t), t = t || p, r = r || [], l = t.nodeType;
if (typeof e != "string" || !e || l !== 1 && l !== 9 && l !== 11) return r;
if (!i && v) {
if (l !== 11 && (s = Z.exec(e)))
if (f = s[1]) {
if (l === 9) {
u = t.getElementById(f);
if (!u || !u.parentNode) return r;
if (u.id === f) return r.push(u), r
} else if (t.ownerDocument && (u = t.ownerDocument.getElementById(f)) && b(t, u) && u.id === f) return r.push(u), r
} else {
if (s[2]) return D.apply(r, t.getElementsByTagName(e)), r;
if ((f = s[3]) && n.getElementsByClassName) return D.apply(r, t.getElementsByClassName(f)), r
}
if (n.qsa && (!m || !m.test(e))) {
y = g = w, S = t, x = l !== 1 && e;
if (l === 1 && t.nodeName.toLowerCase() !== "object") {
d = o(e), (g = t.getAttribute("id")) ? y = g.replace(tt, "\\$&") : t.setAttribute("id", y), y = "[id='" + y + "'] ", c = d.length;
while (c--) d[c] = y + gt(d[c]);
S = et.test(e) && vt(t.parentNode) || t, x = d.join(",")
}
if (x) try {
return D.apply(r, S.querySelectorAll(x)), r
} catch (T) {} finally {
g || t.removeAttribute("id")
}
}
}
return a(e.replace(z, "$1"), t, r, i)
}
function ut() {
function t(n, i) {
return e.push(n + " ") > r.cacheLength && delete t[e.shift()], t[n + " "] = i
}
var e = [];
return t
}
function at(e) {
return e[w] = !0, e
}
function ft(e) {
var t = p.createElement("div");
try {
return !!e(t)
} catch (n) {
return !1
} finally {
t.parentNode && t.parentNode.removeChild(t), t = null
}
}
function lt(e, t) {
var n = e.split("|"),
i = e.length;
while (i--) r.attrHandle[n[i]] = t
}
function ct(e, t) {
var n = t && e,
r = n && e.nodeType === 1 && t.nodeType === 1 && (~t.sourceIndex || L) - (~e.sourceIndex || L);
if (r) return r;
if (n)
while (n = n.nextSibling)
if (n === t) return -1;
return e ? 1 : -1
}
function ht(e) {
return function(t) {
var n = t.nodeName.toLowerCase();
return n === "input" && t.type === e
}
}
function pt(e) {
return function(t) {
var n = t.nodeName.toLowerCase();
return (n === "input" || n === "button") && t.type === e
}
}
function dt(e) {
return at(function(t) {
return t = +t, at(function(n, r) {
var i, s = e([], n.length, t),
o = s.length;
while (o--) n[i = s[o]] && (n[i] = !(r[i] = n[i]))
})
})
}
function vt(e) {
return e && typeof e.getElementsByTagName != "undefined" && e
}
function mt() {}
function gt(e) {
var t = 0,
n = e.length,
r = "";
for (; t < n; t++) r += e[t].value;
return r
}
function yt(e, t, n) {
var r = t.dir,
i = n && r === "parentNode",
s = x++;
return t.first ? function(t, n, s) {
while (t = t[r])
if (t.nodeType === 1 || i) return e(t, n, s)
} : function(t, n, o) {
var u, a, f = [S, s];
if (o) {
while (t = t[r])
if (t.nodeType === 1 || i)
if (e(t, n, o)) return !0
} else
while (t = t[r])
if (t.nodeType === 1 || i) {
a = t[w] || (t[w] = {});
if ((u = a[r]) && u[0] === S && u[1] === s) return f[2] = u[2];
a[r] = f;
if (f[2] = e(t, n, o)) return !0
}
}
}
function bt(e) {
return e.length > 1 ? function(t, n, r) {
var i = e.length;
while (i--)
if (!e[i](t, n, r)) return !1;
return !0
} : e[0]
}
function wt(e, t, n) {
var r = 0,
i = t.length;
for (; r < i; r++) ot(e, t[r], n);
return n
}
function Et(e, t, n, r, i) {
var s, o = [],
u = 0,
a = e.length,
f = t != null;
for (; u < a; u++)
if (s = e[u])
if (!n || n(s, r, i)) o.push(s), f && t.push(u);
return o
}
function St(e, t, n, r, i, s) {
return r && !r[w] && (r = St(r)), i && !i[w] && (i = St(i, s)), at(function(s, o, u, a) {
var f, l, c, h = [],
p = [],
d = o.length,
v = s || wt(t || "*", u.nodeType ? [u] : u, []),
m = e && (s || !t) ? Et(v, h, e, u, a) : v,
g = n ? i || (s ? e : d || r) ? [] : o : m;
n && n(m, g, u, a);
if (r) {
f = Et(g, p), r(f, [], u, a), l = f.length;
while (l--)
if (c = f[l]) g[p[l]] = !(m[p[l]] = c)
}
if (s) {
if (i || e) {
if (i) {
f = [], l = g.length;
while (l--)(c = g[l]) && f.push(m[l] = c);
i(null, g = [], f, a)
}
l = g.length;
while (l--)(c = g[l]) && (f = i ? H(s, c) : h[l]) > -1 && (s[f] = !(o[f] = c))
}
} else g = Et(g === o ? g.splice(d, g.length) : g), i ? i(null, o, g, a) : D.apply(o, g)
})
}
function xt(e) {
var t, n, i, s = e.length,
o = r.relative[e[0].type],
u = o || r.relative[" "],
a = o ? 1 : 0,
l = yt(function(e) {
return e === t
}, u, !0),
c = yt(function(e) {
return H(t, e) > -1
}, u, !0),
h = [
function(e, n, r) {
var i = !o && (r || n !== f) || ((t = n).nodeType ? l(e, n, r) : c(e, n, r));
return t = null, i
}
];
for (; a < s; a++)
if (n = r.relative[e[a].type]) h = [yt(bt(h), n)];
else {
n = r.filter[e[a].type].apply(null, e[a].matches);
if (n[w]) {
i = ++a;
for (; i < s; i++)
if (r.relative[e[i].type]) break;
return St(a > 1 && bt(h), a > 1 && gt(e.slice(0, a - 1).concat({
value: e[a - 2].type === " " ? "*" : ""
})).replace(z, "$1"), n, a < i && xt(e.slice(a, i)), i < s && xt(e = e.slice(i)), i < s && gt(e))
}
h.push(n)
}
return bt(h)
}
function Tt(e, t) {
var n = t.length > 0,
i = e.length > 0,
s = function(s, o, u, a, l) {
var c, h, d, v = 0,
m = "0",
g = s && [],
y = [],
b = f,
w = s || i && r.find.TAG("*", l),
E = S += b == null ? 1 : Math.random() || .1,
x = w.length;
l && (f = o !== p && o);
for (; m !== x && (c = w[m]) != null; m++) {
if (i && c) {
h = 0;
while (d = e[h++])
if (d(c, o, u)) {
a.push(c);
break
}
l && (S = E)
}
n && ((c = !d && c) && v--, s && g.push(c))
}
v += m;
if (n && m !== v) {
h = 0;
while (d = t[h++]) d(g, y, o, u);
if (s) {
if (v > 0)
while (m--) !g[m] && !y[m] && (y[m] = M.call(a));
y = Et(y)
}
D.apply(a, y), l && !s && y.length > 0 && v + t.length > 1 && ot.uniqueSort(a)
}
return l && (S = E, f = b), g
};
return n ? at(s) : s
}
var t, n, r, i, s, o, u, a, f, l, c, h, p, d, v, m, g, y, b, w = "sizzle" + 1 * new Date,
E = e.document,
S = 0,
x = 0,
T = ut(),
N = ut(),
C = ut(),
k = function(e, t) {
return e === t && (c = !0), 0
},
L = 1 << 31,
A = {}.hasOwnProperty,
O = [],
M = O.pop,
_ = O.push,
D = O.push,
P = O.slice,
H = function(e, t) {
var n = 0,
r = e.length;
for (; n < r; n++)
if (e[n] === t) return n;
return -1
},
B = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
j = "[\\x20\\t\\r\\n\\f]",
F = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
I = F.replace("w", "w#"),
q = "\\[" + j + "*(" + F + ")(?:" + j + "*([*^$|!~]?=)" + j + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + I + "))|)" + j + "*\\]",
R = ":(" + F + ")(?:\\((" + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + "((?:\\\\.|[^\\\\()[\\]]|" + q + ")*)|" + ".*" + ")\\)|)",
U = new RegExp(j + "+", "g"),
z = new RegExp("^" + j + "+|((?:^|[^\\\\])(?:\\\\.)*)" + j + "+$", "g"),
W = new RegExp("^" + j + "*," + j + "*"),
X = new RegExp("^" + j + "*([>+~]|" + j + ")" + j + "*"),
V = new RegExp("=" + j + "*([^\\]'\"]*?)" + j + "*\\]", "g"),
$ = new RegExp(R),
J = new RegExp("^" + I + "$"),
K = {
ID: new RegExp("^#(" + F + ")"),
CLASS: new RegExp("^\\.(" + F + ")"),
TAG: new RegExp("^(" + F.replace("w", "w*") + ")"),
ATTR: new RegExp("^" + q),
PSEUDO: new RegExp("^" + R),
CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + j + "*(even|odd|(([+-]|)(\\d*)n|)" + j + "*(?:([+-]|)" + j + "*(\\d+)|))" + j + "*\\)|)", "i"),
bool: new RegExp("^(?:" + B + ")$", "i"),
needsContext: new RegExp("^" + j + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + j + "*((?:-\\d)?\\d*)" + j + "*\\)|)(?=[^-]|$)", "i")
},
Q = /^(?:input|select|textarea|button)$/i,
G = /^h\d$/i,
Y = /^[^{]+\{\s*\[native \w/,
Z = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
et = /[+~]/,
tt = /'|\\/g,
nt = new RegExp("\\\\([\\da-f]{1,6}" + j + "?|(" + j + ")|.)", "ig"),
rt = function(e, t, n) {
var r = "0x" + t - 65536;
return r !== r || n ? t : r < 0 ? String.fromCharCode(r + 65536) : String.fromCharCode(r >> 10 | 55296, r & 1023 | 56320)
},
it = function() {
h()
};
try {
D.apply(O = P.call(E.childNodes), E.childNodes), O[E.childNodes.length].nodeType
} catch (st) {
D = {
apply: O.length ? function(e, t) {
_.apply(e, P.call(t))
} : function(e, t) {
var n = e.length,
r = 0;
while (e[n++] = t[r++]);
e.length = n - 1
}
}
}
n = ot.support = {}, s = ot.isXML = function(e) {
var t = e && (e.ownerDocument || e).documentElement;
return t ? t.nodeName !== "HTML" : !1
}, h = ot.setDocument = function(e) {
var t, i, o = e ? e.ownerDocument || e : E;
if (o === p || o.nodeType !== 9 || !o.documentElement) return p;
p = o, d = o.documentElement, i = o.defaultView, i && i !== i.top && (i.addEventListener ? i.addEventListener("unload", it, !1) : i.attachEvent && i.attachEvent("onunload", it)), v = !s(o), n.attributes = ft(function(e) {
return e.className = "i", !e.getAttribute("className")
}), n.getElementsByTagName = ft(function(e) {
return e.appendChild(o.createComment("")), !e.getElementsByTagName("*").length
}), n.getElementsByClassName = Y.test(o.getElementsByClassName), n.getById = ft(function(e) {
return d.appendChild(e).id = w, !o.getElementsByName || !o.getElementsByName(w).length
}), n.getById ? (r.find.ID = function(e, t) {
if (typeof t.getElementById != "undefined" && v) {
var n = t.getElementById(e);
return n && n.parentNode ? [n] : []
}
}, r.filter.ID = function(e) {
var t = e.replace(nt, rt);
return function(e) {
return e.getAttribute("id") === t
}
}) : (delete r.find.ID, r.filter.ID = function(e) {
var t = e.replace(nt, rt);
return function(e) {
var n = typeof e.getAttributeNode != "undefined" && e.getAttributeNode("id");
return n && n.value === t
}
}), r.find.TAG = n.getElementsByTagName ? function(e, t) {
if (typeof t.getElementsByTagName != "undefined") return t.getElementsByTagName(e);
if (n.qsa) return t.querySelectorAll(e)
} : function(e, t) {
var n, r = [],
i = 0,
s = t.getElementsByTagName(e);
if (e === "*") {
while (n = s[i++]) n.nodeType === 1 && r.push(n);
return r
}
return s
}, r.find.CLASS = n.getElementsByClassName && function(e, t) {
if (v) return t.getElementsByClassName(e)
}, g = [], m = [];
if (n.qsa = Y.test(o.querySelectorAll)) ft(function(e) {
d.appendChild(e).innerHTML = "<a id='" + w + "'></a>" + "<select id='" + w + "-\f]' msallowcapture=''>" + "<option selected=''></option></select>", e.querySelectorAll("[msallowcapture^='']").length && m.push("[*^$]=" + j + "*(?:''|\"\")"), e.querySelectorAll("[selected]").length || m.push("\\[" + j + "*(?:value|" + B + ")"), e.querySelectorAll("[id~=" + w + "-]").length || m.push("~="), e.querySelectorAll(":checked").length || m.push(":checked"), e.querySelectorAll("a#" + w + "+*").length || m.push(".#.+[+~]")
}), ft(function(e) {
var t = o.createElement("input");
t.setAttribute("type", "hidden"), e.appendChild(t).setAttribute("name", "D"), e.querySelectorAll("[name=d]").length && m.push("name" + j + "*[*^$|!~]?="), e.querySelectorAll(":enabled").length || m.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"), m.push(",.*:")
});
return (n.matchesSelector = Y.test(y = d.matches || d.webkitMatchesSelector || d.mozMatchesSelector || d.oMatchesSelector || d.msMatchesSelector)) && ft(function(e) {
n.disconnectedMatch = y.call(e, "div"), y.call(e, "[s!='']:x"), g.push("!=", R)
}), m = m.length && new RegExp(m.join("|")), g = g.length && new RegExp(g.join("|")), t = Y.test(d.compareDocumentPosition), b = t || Y.test(d.contains) ? function(e, t) {
var n = e.nodeType === 9 ? e.documentElement : e,
r = t && t.parentNode;
return e === r || !!r && r.nodeType === 1 && !!(n.contains ? n.contains(r) : e.compareDocumentPosition && e.compareDocumentPosition(r) & 16)
} : function(e, t) {
if (t)
while (t = t.parentNode)
if (t === e) return !0;
return !1
}, k = t ? function(e, t) {
if (e === t) return c = !0, 0;
var r = !e.compareDocumentPosition - !t.compareDocumentPosition;
return r ? r : (r = (e.ownerDocument || e) === (t.ownerDocument || t) ? e.compareDocumentPosition(t) : 1, r & 1 || !n.sortDetached && t.compareDocumentPosition(e) === r ? e === o || e.ownerDocument === E && b(E, e) ? -1 : t === o || t.ownerDocument === E && b(E, t) ? 1 : l ? H(l, e) - H(l, t) : 0 : r & 4 ? -1 : 1)
} : function(e, t) {
if (e === t) return c = !0, 0;
var n, r = 0,
i = e.parentNode,
s = t.parentNode,
u = [e],
a = [t];
if (!i || !s) return e === o ? -1 : t === o ? 1 : i ? -1 : s ? 1 : l ? H(l, e) - H(l, t) : 0;
if (i === s) return ct(e, t);
n = e;
while (n = n.parentNode) u.unshift(n);
n = t;
while (n = n.parentNode) a.unshift(n);
while (u[r] === a[r]) r++;
return r ? ct(u[r], a[r]) : u[r] === E ? -1 : a[r] === E ? 1 : 0
}, o
}, ot.matches = function(e, t) {
return ot(e, null, null, t)
}, ot.matchesSelector = function(e, t) {
(e.ownerDocument || e) !== p && h(e), t = t.replace(V, "='$1']");
if (n.matchesSelector && v && (!g || !g.test(t)) && (!m || !m.test(t))) try {
var r = y.call(e, t);
if (r || n.disconnectedMatch || e.document && e.document.nodeType !== 11) return r
} catch (i) {}
return ot(t, p, null, [e]).length > 0
}, ot.contains = function(e, t) {
return (e.ownerDocument || e) !== p && h(e), b(e, t)
}, ot.attr = function(e, t) {
(e.ownerDocument || e) !== p && h(e);
var i = r.attrHandle[t.toLowerCase()],
s = i && A.call(r.attrHandle, t.toLowerCase()) ? i(e, t, !v) : undefined;
return s !== undefined ? s : n.attributes || !v ? e.getAttribute(t) : (s = e.getAttributeNode(t)) && s.specified ? s.value : null
}, ot.error = function(e) {
throw new Error("Syntax error, unrecognized expression: " + e)
}, ot.uniqueSort = function(e) {
var t, r = [],
i = 0,
s = 0;
c = !n.detectDuplicates, l = !n.sortStable && e.slice(0), e.sort(k);
if (c) {
while (t = e[s++]) t === e[s] && (i = r.push(s));
while (i--) e.splice(r[i], 1)
}
return l = null, e
}, i = ot.getText = function(e) {
var t, n = "",
r = 0,
s = e.nodeType;
if (!s)
while (t = e[r++]) n += i(t);
else if (s === 1 || s === 9 || s === 11) {
if (typeof e.textContent == "string") return e.textContent;
for (e = e.firstChild; e; e = e.nextSibling) n += i(e)
} else if (s === 3 || s === 4) return e.nodeValue;
return n
}, r = ot.selectors = {
cacheLength: 50,
createPseudo: at,
match: K,
attrHandle: {},
find: {},
relative: {
">": {
dir: "parentNode",
first: !0
},
" ": {
dir: "parentNode"
},
"+": {
dir: "previousSibling",
first: !0
},
"~": {
dir: "previousSibling"
}
},
preFilter: {
ATTR: function(e) {
return e[1] = e[1].replace(nt, rt), e[3] = (e[3] || e[4] || e[5] || "").replace(nt, rt), e[2] === "~=" && (e[3] = " " + e[3] + " "), e.slice(0, 4)
},
CHILD: function(e) {
return e[1] = e[1].toLowerCase(), e[1].slice(0, 3) === "nth" ? (e[3] || ot.error(e[0]), e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * (e[3] === "even" || e[3] === "odd")), e[5] = +(e[7] + e[8] || e[3] === "odd")) : e[3] && ot.error(e[0]), e
},
PSEUDO: function(e) {
var t, n = !e[6] && e[2];
return K.CHILD.test(e[0]) ? null : (e[3] ? e[2] = e[4] || e[5] || "" : n && $.test(n) && (t = o(n, !0)) && (t = n.indexOf(")", n.length - t) - n.length) && (e[0] = e[0].slice(0, t), e[2] = n.slice(0, t)), e.slice(0, 3))
}
},
filter: {
TAG: function(e) {
var t = e.replace(nt, rt).toLowerCase();
return e === "*" ? function() {
return !0
} : function(e) {
return e.nodeName && e.nodeName.toLowerCase() === t
}
},
CLASS: function(e) {
var t = T[e + " "];
return t || (t = new RegExp("(^|" + j + ")" + e + "(" + j + "|$)")) && T(e, function(e) {
return t.test(typeof e.className == "string" && e.className || typeof e.getAttribute != "undefined" && e.getAttribute("class") || "")
})
},
ATTR: function(e, t, n) {
return function(r) {
var i = ot.attr(r, e);
return i == null ? t === "!=" : t ? (i += "", t === "=" ? i === n : t === "!=" ? i !== n : t === "^=" ? n && i.indexOf(n) === 0 : t === "*=" ? n && i.indexOf(n) > -1 : t === "$=" ? n && i.slice(-n.length) === n : t === "~=" ? (" " + i.replace(U, " ") + " ").indexOf(n) > -1 : t === "|=" ? i === n || i.slice(0, n.length + 1) === n + "-" : !1) : !0
}
},
CHILD: function(e, t, n, r, i) {
var s = e.slice(0, 3) !== "nth",
o = e.slice(-4) !== "last",
u = t === "of-type";
return r === 1 && i === 0 ? function(e) {
return !!e.parentNode
} : function(t, n, a) {
var f, l, c, h, p, d, v = s !== o ? "nextSibling" : "previousSibling",
m = t.parentNode,
g = u && t.nodeName.toLowerCase(),
y = !a && !u;
if (m) {
if (s) {
while (v) {
c = t;
while (c = c[v])
if (u ? c.nodeName.toLowerCase() === g : c.nodeType === 1) return !1;
d = v = e === "only" && !d && "nextSibling"
}
return !0
}
d = [o ? m.firstChild : m.lastChild];
if (o && y) {
l = m[w] || (m[w] = {}), f = l[e] || [], p = f[0] === S && f[1], h = f[0] === S && f[2], c = p && m.childNodes[p];
while (c = ++p && c && c[v] || (h = p = 0) || d.pop())
if (c.nodeType === 1 && ++h && c === t) {
l[e] = [S, p, h];
break
}
} else if (y && (f = (t[w] || (t[w] = {}))[e]) && f[0] === S) h = f[1];
else
while (c = ++p && c && c[v] || (h = p = 0) || d.pop())
if ((u ? c.nodeName.toLowerCase() === g : c.nodeType === 1) && ++h) {
y && ((c[w] || (c[w] = {}))[e] = [S, h]);
if (c === t) break
} return h -= i, h === r || h % r === 0 && h / r >= 0
}
}
},
PSEUDO: function(e, t) {
var n, i = r.pseudos[e] || r.setFilters[e.toLowerCase()] || ot.error("unsupported pseudo: " + e);
return i[w] ? i(t) : i.length > 1 ? (n = [e, e, "", t], r.setFilters.hasOwnProperty(e.toLowerCase()) ? at(function(e, n) {
var r, s = i(e, t),
o = s.length;
while (o--) r = H(e, s[o]), e[r] = !(n[r] = s[o])
}) : function(e) {
return i(e, 0, n)
}) : i
}
},
pseudos: {
not: at(function(e) {
var t = [],
n = [],
r = u(e.replace(z, "$1"));
return r[w] ? at(function(e, t, n, i) {
var s, o = r(e, null, i, []),
u = e.length;
while (u--)
if (s = o[u]) e[u] = !(t[u] = s)
}) : function(e, i, s) {
return t[0] = e, r(t, null, s, n), t[0] = null, !n.pop()
}
}),
has: at(function(e) {
return function(t) {
return ot(e, t).length > 0
}
}),
contains: at(function(e) {
return e = e.replace(nt, rt),
function(t) {
return (t.textContent || t.innerText || i(t)).indexOf(e) > -1
}
}),
lang: at(function(e) {
return J.test(e || "") || ot.error("unsupported lang: " + e), e = e.replace(nt, rt).toLowerCase(),
function(t) {
var n;
do
if (n = v ? t.lang : t.getAttribute("xml:lang") || t.getAttribute("lang")) return n = n.toLowerCase(), n === e || n.indexOf(e + "-") === 0;
while ((t = t.parentNode) && t.nodeType === 1);
return !1
}
}),
target: function(t) {
var n = e.location && e.location.hash;
return n && n.slice(1) === t.id
},
root: function(e) {
return e === d
},
focus: function(e) {
return e === p.activeElement && (!p.hasFocus || p.hasFocus()) && !!(e.type || e.href || ~e.tabIndex)
},
enabled: function(e) {
return e.disabled === !1
},
disabled: function(e) {
return e.disabled === !0
},
checked: function(e) {
var t = e.nodeName.toLowerCase();
return t === "input" && !!e.checked || t === "option" && !!e.selected
},
selected: function(e) {
return e.parentNode && e.parentNode.selectedIndex, e.selected === !0
},
empty: function(e) {
for (e = e.firstChild; e; e = e.nextSibling)
if (e.nodeType < 6) return !1;
return !0
},
parent: function(e) {
return !r.pseudos.empty(e)
},
header: function(e) {
return G.test(e.nodeName)
},
input: function(e) {
return Q.test(e.nodeName)
},
button: function(e) {
var t = e.nodeName.toLowerCase();
return t === "input" && e.type === "button" || t === "button"
},
text: function(e) {
var t;
return e.nodeName.toLowerCase() === "input" && e.type === "text" && ((t = e.getAttribute("type")) == null || t.toLowerCase() === "text")
},
first: dt(function() {
return [0]
}),
last: dt(function(e, t) {
return [t - 1]
}),
eq: dt(function(e, t, n) {
return [n < 0 ? n + t : n]
}),
even: dt(function(e, t) {
var n = 0;
for (; n < t; n += 2) e.push(n);
return e
}),
odd: dt(function(e, t) {
var n = 1;
for (; n < t; n += 2) e.push(n);
return e
}),
lt: dt(function(e, t, n) {
var r = n < 0 ? n + t : n;
for (; --r >= 0;) e.push(r);
return e
}),
gt: dt(function(e, t, n) {
var r = n < 0 ? n + t : n;
for (; ++r < t;) e.push(r);
return e
})
}
}, r.pseudos.nth = r.pseudos.eq;
for (t in {
radio: !0,
checkbox: !0,
file: !0,
password: !0,
image: !0
}) r.pseudos[t] = ht(t);
for (t in {
submit: !0,
reset: !0
}) r.pseudos[t] = pt(t);
return mt.prototype = r.filters = r.pseudos, r.setFilters = new mt, o = ot.tokenize = function(e, t) {
var n, i, s, o, u, a, f, l = N[e + " "];
if (l) return t ? 0 : l.slice(0);
u = e, a = [], f = r.preFilter;
while (u) {
if (!n || (i = W.exec(u))) i && (u = u.slice(i[0].length) || u), a.push(s = []);
n = !1;
if (i = X.exec(u)) n = i.shift(), s.push({
value: n,
type: i[0].replace(z, " ")
}), u = u.slice(n.length);
for (o in r.filter)(i = K[o].exec(u)) && (!f[o] || (i = f[o](i))) && (n = i.shift(), s.push({
value: n,
type: o,
matches: i
}), u = u.slice(n.length));
if (!n) break
}
return t ? u.length : u ? ot.error(e) : N(e, a).slice(0)
}, u = ot.compile = function(e, t) {
var n, r = [],
i = [],
s = C[e + " "];
if (!s) {
t || (t = o(e)), n = t.length;
while (n--) s = xt(t[n]), s[w] ? r.push(s) : i.push(s);
s = C(e, Tt(i, r)), s.selector = e
}
return s
}, a = ot.select = function(e, t, i, s) {
var a, f, l, c, h, p = typeof e == "function" && e,
d = !s && o(e = p.selector || e);
i = i || [];
if (d.length === 1) {
f = d[0] = d[0].slice(0);
if (f.length > 2 && (l = f[0]).type === "ID" && n.getById && t.nodeType === 9 && v && r.relative[f[1].type]) {
t = (r.find.ID(l.matches[0].replace(nt, rt), t) || [])[0];
if (!t) return i;
p && (t = t.parentNode), e = e.slice(f.shift().value.length)
}
a = K.needsContext.test(e) ? 0 : f.length;
while (a--) {
l = f[a];
if (r.relative[c = l.type]) break;
if (h = r.find[c])
if (s = h(l.matches[0].replace(nt, rt), et.test(f[0].type) && vt(t.parentNode) || t)) {
f.splice(a, 1), e = s.length && gt(f);
if (!e) return D.apply(i, s), i;
break
}
}
}
return (p || u(e, d))(s, t, !v, i, et.test(e) && vt(t.parentNode) || t), i
}, n.sortStable = w.split("").sort(k).join("") === w, n.detectDuplicates = !!c, h(), n.sortDetached = ft(function(e) {
return e.compareDocumentPosition(p.createElement("div")) & 1
}), ft(function(e) {
return e.innerHTML = "<a href='#'></a>", e.firstChild.getAttribute("href") === "#"
}) || lt("type|href|height|width", function(e, t, n) {
if (!n) return e.getAttribute(t, t.toLowerCase() === "type" ? 1 : 2)
}), (!n.attributes || !ft(function(e) {
return e.innerHTML = "<input/>", e.firstChild.setAttribute("value", ""), e.firstChild.getAttribute("value") === ""
})) && lt("value", function(e, t, n) {
if (!n && e.nodeName.toLowerCase() === "input") return e.defaultValue
}), ft(function(e) {
return e.getAttribute("disabled") == null
}) || lt(B, function(e, t, n) {
var r;
if (!n) return e[t] === !0 ? t.toLowerCase() : (r = e.getAttributeNode(t)) && r.specified ? r.value : null
}), ot
}(e);
h.find = y, h.expr = y.selectors, h.expr[":"] = h.expr.pseudos, h.unique = y.uniqueSort, h.text = y.getText, h.isXMLDoc = y.isXML, h.contains = y.contains;
var b = h.expr.match.needsContext,
w = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
E = /^.[^:#\[\.,]*$/;
h.filter = function(e, t, n) {
var r = t[0];
return n && (e = ":not(" + e + ")"), t.length === 1 && r.nodeType === 1 ? h.find.matchesSelector(r, e) ? [r] : [] : h.find.matches(e, h.grep(t, function(e) {
return e.nodeType === 1
}))
}, h.fn.extend({
find: function(e) {
var t, n = [],
r = this,
i = r.length;
if (typeof e != "string") return this.pushStack(h(e).filter(function() {
for (t = 0; t < i; t++)
if (h.contains(r[t], this)) return !0
}));
for (t = 0; t < i; t++) h.find(e, r[t], n);
return n = this.pushStack(i > 1 ? h.unique(n) : n), n.selector = this.selector ? this.selector + " " + e : e, n
},
filter: function(e) {
return this.pushStack(S(this, e || [], !1))
},
not: function(e) {
return this.pushStack(S(this, e || [], !0))
},
is: function(e) {
return !!S(this, typeof e == "string" && b.test(e) ? h(e) : e || [], !1).length
}
});
var x, T = e.document,
N = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
C = h.fn.init = function(e, t) {
var n, r;
if (!e) return this;
if (typeof e == "string") {
e.charAt(0) === "<" && e.charAt(e.length - 1) === ">" && e.length >= 3 ? n = [null, e, null] : n = N.exec(e);
if (n && (n[1] || !t)) {
if (n[1]) {
t = t instanceof h ? t[0] : t, h.merge(this, h.parseHTML(n[1], t && t.nodeType ? t.ownerDocument || t : T, !0));
if (w.test(n[1]) && h.isPlainObject(t))
for (n in t) h.isFunction(this[n]) ? this[n](t[n]) : this.attr(n, t[n]);
return this
}
r = T.getElementById(n[2]);
if (r && r.parentNode) {
if (r.id !== n[2]) return x.find(e);
this.length = 1, this[0] = r
}
return this.context = T, this.selector = e, this
}
return !t || t.jquery ? (t || x).find(e) : this.constructor(t).find(e)
}
return e.nodeType ? (this.context = this[0] = e, this.length = 1, this) : h.isFunction(e) ? typeof x.ready != "undefined" ? x.ready(e) : e(h) : (e.selector !== undefined && (this.selector = e.selector, this.context = e.context), h.makeArray(e, this))
};
C.prototype = h.fn, x = h(T);
var k = /^(?:parents|prev(?:Until|All))/,
L = {
children: !0,
contents: !0,
next: !0,
prev: !0
};
h.extend({
dir: function(e, t, n) {
var r = [],
i = e[t];
while (i && i.nodeType !== 9 && (n === undefined || i.nodeType !== 1 || !h(i).is(n))) i.nodeType === 1 && r.push(i), i = i[t];
return r
},
sibling: function(e, t) {
var n = [];
for (; e; e = e.nextSibling) e.nodeType === 1 && e !== t && n.push(e);
return n
}
}), h.fn.extend({
has: function(e) {
var t, n = h(e, this),
r = n.length;
return this.filter(function() {
for (t = 0; t < r; t++)
if (h.contains(this, n[t])) return !0
})
},
closest: function(e, t) {
var n, r = 0,
i = this.length,
s = [],
o = b.test(e) || typeof e != "string" ? h(e, t || this.context) : 0;
for (; r < i; r++)
for (n = this[r]; n && n !== t; n = n.parentNode)
if (n.nodeType < 11 && (o ? o.index(n) > -1 : n.nodeType === 1 && h.find.matchesSelector(n, e))) {
s.push(n);
break
}
return this.pushStack(s.length > 1 ? h.unique(s) : s)
},
index: function(e) {
return e ? typeof e == "string" ? h.inArray(this[0], h(e)) : h.inArray(e.jquery ? e[0] : e, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1
},
add: function(e, t) {
return this.pushStack(h.unique(h.merge(this.get(), h(e, t))))
},
addBack: function(e) {
return this.add(e == null ? this.prevObject : this.prevObject.filter(e))
}
}), h.each({
parent: function(e) {
var t = e.parentNode;
return t && t.nodeType !== 11 ? t : null
},
parents: function(e) {
return h.dir(e, "parentNode")
},
parentsUntil: function(e, t, n) {
return h.dir(e, "parentNode", n)
},
next: function(e) {
return A(e, "nextSibling")
},
prev: function(e) {
return A(e, "previousSibling")
},
nextAll: function(e) {
return h.dir(e, "nextSibling")
},
prevAll: function(e) {
return h.dir(e, "previousSibling")
},
nextUntil: function(e, t, n) {
return h.dir(e, "nextSibling", n)
},
prevUntil: function(e, t, n) {
return h.dir(e, "previousSibling", n)
},
siblings: function(e) {
return h.sibling((e.parentNode || {}).firstChild, e)
},
children: function(e) {
return h.sibling(e.firstChild)
},
contents: function(e) {
return h.nodeName(e, "iframe") ? e.contentDocument || e.contentWindow.document : h.merge([], e.childNodes)
}
}, function(e, t) {
h.fn[e] = function(n, r) {
var i = h.map(this, t, n);
return e.slice(-5) !== "Until" && (r = n), r && typeof r == "string" && (i = h.filter(r, i)), this.length > 1 && (L[e] || (i = h.unique(i)), k.test(e) && (i = i.reverse())), this.pushStack(i)
}
});
var O = /\S+/g,
M = {};
h.Callbacks = function(e) {
e = typeof e == "string" ? M[e] || _(e) : h.extend({}, e);
var t, n, r, i, s, o, u = [],
a = !e.once && [],
f = function(c) {
n = e.memory && c, r = !0, s = o || 0, o = 0, i = u.length, t = !0;
for (; u && s < i; s++)
if (u[s].apply(c[0], c[1]) === !1 && e.stopOnFalse) {
n = !1;
break
}
t = !1, u && (a ? a.length && f(a.shift()) : n ? u = [] : l.disable())
},
l = {
add: function() {
if (u) {
var r = u.length;
(function s(t) {
h.each(t, function(t, n) {
var r = h.type(n);
r === "function" ? (!e.unique || !l.has(n)) && u.push(n) : n && n.length && r !== "string" && s(n)
})
})(arguments), t ? i = u.length : n && (o = r, f(n))
}
return this
},
remove: function() {
return u && h.each(arguments, function(e, n) {
var r;
while ((r = h.inArray(n, u, r)) > -1) u.splice(r, 1), t && (r <= i && i--, r <= s && s--)
}), this
},
has: function(e) {
return e ? h.inArray(e, u) > -1 : !!u && !!u.length
},
empty: function() {
return u = [], i = 0, this
},
disable: function() {
return u = a = n = undefined, this
},
disabled: function() {
return !u
},
lock: function() {
return a = undefined, n || l.disable(), this
},
locked: function() {
return !a
},
fireWith: function(e, n) {
return u && (!r || a) && (n = n || [], n = [e, n.slice ? n.slice() : n], t ? a.push(n) : f(n)), this
},
fire: function() {
return l.fireWith(this, arguments), this
},
fired: function() {
return !!r
}
};
return l
}, h.extend({
Deferred: function(e) {
var t = [
["resolve", "done", h.Callbacks("once memory"), "resolved"],
["reject", "fail", h.Callbacks("once memory"), "rejected"],
["notify", "progress", h.Callbacks("memory")]
],
n = "pending",
r = {
state: function() {
return n
},
always: function() {
return i.done(arguments).fail(arguments), this
},
then: function() {
var e = arguments;
return h.Deferred(function(n) {
h.each(t, function(t, s) {
var o = h.isFunction(e[t]) && e[t];
i[s[1]](function() {
var e = o && o.apply(this, arguments);
e && h.isFunction(e.promise) ? e.promise().done(n.resolve).fail(n.reject).progress(n.notify) : n[s[0] + "With"](this === r ? n.promise() : this, o ? [e] : arguments)
})
}), e = null
}).promise()
},
promise: function(e) {
return e != null ? h.extend(e, r) : r
}
},
i = {};
return r.pipe = r.then, h.each(t, function(e, s) {
var o = s[2],
u = s[3];
r[s[1]] = o.add, u && o.add(function() {
n = u
}, t[e ^ 1][2].disable, t[2][2].lock), i[s[0]] = function() {
return i[s[0] + "With"](this === i ? r : this, arguments), this
}, i[s[0] + "With"] = o.fireWith
}), r.promise(i), e && e.call(i, i), i
},
when: function(e) {
var t = 0,
n = r.call(arguments),
i = n.length,
s = i !== 1 || e && h.isFunction(e.promise) ? i : 0,
o = s === 1 ? e : h.Deferred(),
u = function(e, t, n) {
return function(i) {
t[e] = this, n[e] = arguments.length > 1 ? r.call(arguments) : i, n === a ? o.notifyWith(t, n) : --s || o.resolveWith(t, n)
}
},
a, f, l;
if (i > 1) {
a = new Array(i), f = new Array(i), l = new Array(i);
for (; t < i; t++) n[t] && h.isFunction(n[t].promise) ? n[t].promise().done(u(t, l, n)).fail(o.reject).progress(u(t, f, a)) : --s
}
return s || o.resolveWith(l, n), o.promise()
}
});
var D;
h.fn.ready = function(e) {
return h.ready.promise().done(e), this
}, h.extend({
isReady: !1,
readyWait: 1,
holdReady: function(e) {
e ? h.readyWait++ : h.ready(!0)
},
ready: function(e) {
if (e === !0 ? --h.readyWait : h.isReady) return;
if (!T.body) return setTimeout(h.ready);
h.isReady = !0;
if (e !== !0 && --h.readyWait > 0) return;
D.resolveWith(T, [h]), h.fn.triggerHandler && (h(T).triggerHandler("ready"), h(T).off("ready"))
}
}), h.ready.promise = function(t) {
if (!D) {
D = h.Deferred();
if (T.readyState === "complete") setTimeout(h.ready);
else if (T.addEventListener) T.addEventListener("DOMContentLoaded", H, !1), e.addEventListener("load", H, !1);
else {
T.attachEvent("onreadystatechange", H), e.attachEvent("onload", H);
var n = !1;
try {
n = e.frameElement == null && T.documentElement
} catch (r) {}
n && n.doScroll && function i() {
if (!h.isReady) {
try {
n.doScroll("left")
} catch (e) {
return setTimeout(i, 50)
}
P(), h.ready()
}
}()
}
}
return D.promise(t)
};
var B = typeof undefined,
j;
for (j in h(l)) break;
l.ownLast = j !== "0", l.inlineBlockNeedsLayout = !1, h(function() {
var e, t, n, r;
n = T.getElementsByTagName("body")[0];
if (!n || !n.style) return;
t = T.createElement("div"), r = T.createElement("div"), r.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", n.appendChild(r).appendChild(t), typeof t.style.zoom !== B && (t.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1", l.inlineBlockNeedsLayout = e = t.offsetWidth === 3, e && (n.style.zoom = 1)), n.removeChild(r)
}),
function() {
var e = T.createElement("div");
if (l.deleteExpando == null) {
l.deleteExpando = !0;
try {
delete e.test
} catch (t) {
l.deleteExpando = !1
}
}
e = null
}(), h.acceptData = function(e) {
var t = h.noData[(e.nodeName + " ").toLowerCase()],
n = +e.nodeType || 1;
return n !== 1 && n !== 9 ? !1 : !t || t !== !0 && e.getAttribute("classid") === t
};
var F = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
I = /([A-Z])/g;
h.extend({
cache: {},
noData: {
"applet ": !0,
"embed ": !0,
"object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
},
hasData: function(e) {
return e = e.nodeType ? h.cache[e[h.expando]] : e[h.expando], !!e && !R(e)
},
data: function(e, t, n) {
return U(e, t, n)
},
removeData: function(e, t) {
return z(e, t)
},
_data: function(e, t, n) {
return U(e, t, n, !0)
},
_removeData: function(e, t) {
return z(e, t, !0)
}
}), h.fn.extend({
data: function(e, t) {
var n, r, i, s = this[0],
o = s && s.attributes;
if (e === undefined) {
if (this.length) {
i = h.data(s);
if (s.nodeType === 1 && !h._data(s, "parsedAttrs")) {
n = o.length;
while (n--) o[n] && (r = o[n].name, r.indexOf("data-") === 0 && (r = h.camelCase(r.slice(5)), q(s, r, i[r])));
h._data(s, "parsedAttrs", !0)
}
}
return i
}
return typeof e == "object" ? this.each(function() {
h.data(this, e)
}) : arguments.length > 1 ? this.each(function() {
h.data(this, e, t)
}) : s ? q(s, e, h.data(s, e)) : undefined
},
removeData: function(e) {
return this.each(function() {
h.removeData(this, e)
})
}
}), h.extend({
queue: function(e, t, n) {
var r;
if (e) return t = (t || "fx") + "queue", r = h._data(e, t), n && (!r || h.isArray(n) ? r = h._data(e, t, h.makeArray(n)) : r.push(n)), r || []
},
dequeue: function(e, t) {
t = t || "fx";
var n = h.queue(e, t),
r = n.length,
i = n.shift(),
s = h._queueHooks(e, t),
o = function() {
h.dequeue(e, t)
};
i === "inprogress" && (i = n.shift(), r--), i && (t === "fx" && n.unshift("inprogress"), delete s.stop, i.call(e, o, s)), !r && s && s.empty.fire()
},
_queueHooks: function(e, t) {
var n = t + "queueHooks";
return h._data(e, n) || h._data(e, n, {
empty: h.Callbacks("once memory").add(function() {
h._removeData(e, t + "queue"), h._removeData(e, n)
})
})
}
}), h.fn.extend({
queue: function(e, t) {
var n = 2;
return typeof e != "string" && (t = e, e = "fx", n--), arguments.length < n ? h.queue(this[0], e) : t === undefined ? this : this.each(function() {
var n = h.queue(this, e, t);
h._queueHooks(this, e), e === "fx" && n[0] !== "inprogress" && h.dequeue(this, e)
})
},
dequeue: function(e) {
return this.each(function() {
h.dequeue(this, e)
})
},
clearQueue: function(e) {
return this.queue(e || "fx", [])
},
promise: function(e, t) {
var n, r = 1,
i = h.Deferred(),
s = this,
o = this.length,
u = function() {
--r || i.resolveWith(s, [s])
};
typeof e != "string" && (t = e, e = undefined), e = e || "fx";
while (o--) n = h._data(s[o], e + "queueHooks"), n && n.empty && (r++, n.empty.add(u));
return u(), i.promise(t)
}
});
var W = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
X = ["Top", "Right", "Bottom", "Left"],
V = function(e, t) {
return e = t || e, h.css(e, "display") === "none" || !h.contains(e.ownerDocument, e)
},
$ = h.access = function(e, t, n, r, i, s, o) {
var u = 0,
a = e.length,
f = n == null;
if (h.type(n) === "object") {
i = !0;
for (u in n) h.access(e, t, u, n[u], !0, s, o)
} else if (r !== undefined) {
i = !0, h.isFunction(r) || (o = !0), f && (o ? (t.call(e, r), t = null) : (f = t, t = function(e, t, n) {
return f.call(h(e), n)
}));
if (t)
for (; u < a; u++) t(e[u], n, o ? r : r.call(e[u], u, t(e[u], n)))
}
return i ? e : f ? t.call(e) : a ? t(e[0], n) : s
},
J = /^(?:checkbox|radio)$/i;
(function() {
var e = T.createElement("input"),
t = T.createElement("div"),
n = T.createDocumentFragment();
t.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", l.leadingWhitespace = t.firstChild.nodeType === 3, l.tbody = !t.getElementsByTagName("tbody").length, l.htmlSerialize = !!t.getElementsByTagName("link").length, l.html5Clone = T.createElement("nav").cloneNode(!0).outerHTML !== "<:nav></:nav>", e.type = "checkbox", e.checked = !0, n.appendChild(e), l.appendChecked = e.checked, t.innerHTML = "<textarea>x</textarea>", l.noCloneChecked = !!t.cloneNode(!0).lastChild.defaultValue, n.appendChild(t), t.innerHTML = "<input type='radio' checked='checked' name='t'/>", l.checkClone = t.cloneNode(!0).cloneNode(!0).lastChild.checked, l.noCloneEvent = !0, t.attachEvent && (t.attachEvent("onclick", function() {
l.noCloneEvent = !1
}), t.cloneNode(!0).click());
if (l.deleteExpando == null) {
l.deleteExpando = !0;
try {
delete t.test
} catch (r) {
l.deleteExpando = !1
}
}
})(),
function() {
var t, n, r = T.createElement("div");
for (t in {
submit: !0,
change: !0,
focusin: !0
}) n = "on" + t, (l[t + "Bubbles"] = n in e) || (r.setAttribute(n, "t"), l[t + "Bubbles"] = r.attributes[n].expando === !1);
r = null
}();
var K = /^(?:input|select|textarea)$/i,
Q = /^key/,
G = /^(?:mouse|pointer|contextmenu)|click/,
Y = /^(?:focusinfocus|focusoutblur)$/,
Z = /^([^.]*)(?:\.(.+)|)$/;
h.event = {
global: {},
add: function(e, t, n, r, i) {
var s, o, u, a, f, l, c, p, d, v, m, g = h._data(e);
if (!g) return;
n.handler && (a = n, n = a.handler, i = a.selector), n.guid || (n.guid = h.guid++), (o = g.events) || (o = g.events = {}), (l = g.handle) || (l = g.handle = function(e) {
return typeof h === B || !!e && h.event.triggered === e.type ? undefined : h.event.dispatch.apply(l.elem, arguments)
}, l.elem = e), t = (t || "").match(O) || [""], u = t.length;
while (u--) {
s = Z.exec(t[u]) || [], d = m = s[1], v = (s[2] || "").split(".").sort();
if (!d) continue;
f = h.event.special[d] || {}, d = (i ? f.delegateType : f.bindType) || d, f = h.event.special[d] || {}, c = h.extend({
type: d,
origType: m,
data: r,
handler: n,
guid: n.guid,
selector: i,
needsContext: i && h.expr.match.needsContext.test(i),
namespace: v.join(".")
}, a);
if (!(p = o[d])) {
p = o[d] = [], p.delegateCount = 0;
if (!f.setup || f.setup.call(e, r, v, l) === !1) e.addEventListener ? e.addEventListener(d, l, !1) : e.attachEvent && e.attachEvent("on" + d, l)
}
f.add && (f.add.call(e, c), c.handler.guid || (c.handler.guid = n.guid)), i ? p.splice(p.delegateCount++, 0, c) : p.push(c), h.event.global[d] = !0
}
e = null
},
remove: function(e, t, n, r, i) {
var s, o, u, a, f, l, c, p, d, v, m, g = h.hasData(e) && h._data(e);
if (!g || !(l = g.events)) return;
t = (t || "").match(O) || [""], f = t.length;
while (f--) {
u = Z.exec(t[f]) || [], d = m = u[1], v = (u[2] || "").split(".").sort();
if (!d) {
for (d in l) h.event.remove(e, d + t[f], n, r, !0);
continue
}
c = h.event.special[d] || {}, d = (r ? c.delegateType : c.bindType) || d, p = l[d] || [], u = u[2] && new RegExp("(^|\\.)" + v.join("\\.(?:.*\\.|)") + "(\\.|$)"), a = s = p.length;
while (s--) o = p[s], (i || m === o.origType) && (!n || n.guid === o.guid) && (!u || u.test(o.namespace)) && (!r || r === o.selector || r === "**" && o.selector) && (p.splice(s, 1), o.selector && p.delegateCount--, c.remove && c.remove.call(e, o));
a && !p.length && ((!c.teardown || c.teardown.call(e, v, g.handle) === !1) && h.removeEvent(e, d, g.handle), delete l[d])
}
h.isEmptyObject(l) && (delete g.handle, h._removeData(e, "events"))
},
trigger: function(t, n, r, i) {
var s, o, u, a, l, c, p, d = [r || T],
v = f.call(t, "type") ? t.type : t,
m = f.call(t, "namespace") ? t.namespace.split(".") : [];
u = c = r = r || T;
if (r.nodeType === 3 || r.nodeType === 8) return;
if (Y.test(v + h.event.triggered)) return;
v.indexOf(".") >= 0 && (m = v.split("."), v = m.shift(), m.sort()), o = v.indexOf(":") < 0 && "on" + v, t = t[h.expando] ? t : new h.Event(v, typeof t == "object" && t), t.isTrigger = i ? 2 : 3, t.namespace = m.join("."), t.namespace_re = t.namespace ? new RegExp("(^|\\.)" + m.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, t.result = undefined, t.target || (t.target = r), n = n == null ? [t] : h.makeArray(n, [t]), l = h.event.special[v] || {};
if (!i && l.trigger && l.trigger.apply(r, n) === !1) return;
if (!i && !l.noBubble && !h.isWindow(r)) {
a = l.delegateType || v, Y.test(a + v) || (u = u.parentNode);
for (; u; u = u.parentNode) d.push(u), c = u;
c === (r.ownerDocument || T) && d.push(c.defaultView || c.parentWindow || e)
}
p = 0;
while ((u = d[p++]) && !t.isPropagationStopped()) t.type = p > 1 ? a : l.bindType || v, s = (h._data(u, "events") || {})[t.type] && h._data(u, "handle"), s && s.apply(u, n), s = o && u[o], s && s.apply && h.acceptData(u) && (t.result = s.apply(u, n), t.result === !1 && t.preventDefault());
t.type = v;
if (!i && !t.isDefaultPrevented() && (!l._default || l._default.apply(d.pop(), n) === !1) && h.acceptData(r) && o && r[v] && !h.isWindow(r)) {
c = r[o], c && (r[o] = null), h.event.triggered = v;
try {
r[v]()
} catch (g) {}
h.event.triggered = undefined, c && (r[o] = c)
}
return t.result
},
dispatch: function(e) {
e = h.event.fix(e);
var t, n, i, s, o, u = [],
a = r.call(arguments),
f = (h._data(this, "events") || {})[e.type] || [],
l = h.event.special[e.type] || {};
a[0] = e, e.delegateTarget = this;
if (l.preDispatch && l.preDispatch.call(this, e) === !1) return;
u = h.event.handlers.call(this, e, f), t = 0;
while ((s = u[t++]) && !e.isPropagationStopped()) {
e.currentTarget = s.elem, o = 0;
while ((i = s.handlers[o++]) && !e.isImmediatePropagationStopped())
if (!e.namespace_re || e.namespace_re.test(i.namespace)) e.handleObj = i, e.data = i.data, n = ((h.event.special[i.origType] || {}).handle || i.handler).apply(s.elem, a), n !== undefined && (e.result = n) === !1 && (e.preventDefault(), e.stopPropagation())
}
return l.postDispatch && l.postDispatch.call(this, e), e.result
},
handlers: function(e, t) {
var n, r, i, s, o = [],
u = t.delegateCount,
a = e.target;
if (u && a.nodeType && (!e.button || e.type !== "click"))
for (; a != this; a = a.parentNode || this)
if (a.nodeType === 1 && (a.disabled !== !0 || e.type !== "click")) {
i = [];
for (s = 0; s < u; s++) r = t[s], n = r.selector + " ", i[n] === undefined && (i[n] = r.needsContext ? h(n, this).index(a) >= 0 : h.find(n, this, null, [a]).length), i[n] && i.push(r);
i.length && o.push({
elem: a,
handlers: i
})
}
return u < t.length && o.push({
elem: this,
handlers: t.slice(u)
}), o
},
fix: function(e) {
if (e[h.expando]) return e;
var t, n, r, i = e.type,
s = e,
o = this.fixHooks[i];
o || (this.fixHooks[i] = o = G.test(i) ? this.mouseHooks : Q.test(i) ? this.keyHooks : {}), r = o.props ? this.props.concat(o.props) : this.props, e = new h.Event(s), t = r.length;
while (t--) n = r[t], e[n] = s[n];
return e.target || (e.target = s.srcElement || T), e.target.nodeType === 3 && (e.target = e.target.parentNode), e.metaKey = !!e.metaKey, o.filter ? o.filter(e, s) : e
},
props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
fixHooks: {},
keyHooks: {
props: "char charCode key keyCode".split(" "),
filter: function(e, t) {
return e.which == null && (e.which = t.charCode != null ? t.charCode : t.keyCode), e
}
},
mouseHooks: {
props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
filter: function(e, t) {
var n, r, i, s = t.button,
o = t.fromElement;
return e.pageX == null && t.clientX != null && (r = e.target.ownerDocument || T, i = r.documentElement, n = r.body, e.pageX = t.clientX + (i && i.scrollLeft || n && n.scrollLeft || 0) - (i && i.clientLeft || n && n.clientLeft || 0), e.pageY = t.clientY + (i && i.scrollTop || n && n.scrollTop || 0) - (i && i.clientTop || n && n.clientTop || 0)), !e.relatedTarget && o && (e.relatedTarget = o === e.target ? t.toElement : o), !e.which && s !== undefined && (e.which = s & 1 ? 1 : s & 2 ? 3 : s & 4 ? 2 : 0), e
}
},
special: {
load: {
noBubble: !0
},
focus: {
trigger: function() {
if (this !== nt() && this.focus) try {
return this.focus(), !1
} catch (e) {}
},
delegateType: "focusin"
},
blur: {
trigger: function() {
if (this === nt() && this.blur) return this.blur(), !1
},
delegateType: "focusout"
},
click: {
trigger: function() {
if (h.nodeName(this, "input") && this.type === "checkbox" && this.click) return this.click(), !1
},
_default: function(e) {
return h.nodeName(e.target, "a")
}
},
beforeunload: {
postDispatch: function(e) {
e.result !== undefined && e.originalEvent && (e.originalEvent.returnValue = e.result)
}
}
},
simulate: function(e, t, n, r) {
var i = h.extend(new h.Event, n, {
type: e,
isSimulated: !0,
originalEvent: {}
});
r ? h.event.trigger(i, null, t) : h.event.dispatch.call(t, i), i.isDefaultPrevented() && n.preventDefault()
}
}, h.removeEvent = T.removeEventListener ? function(e, t, n) {
e.removeEventListener && e.removeEventListener(t, n, !1)
} : function(e, t, n) {
var r = "on" + t;
e.detachEvent && (typeof e[r] === B && (e[r] = null), e.detachEvent(r, n))
}, h.Event = function(e, t) {
if (!(this instanceof h.Event)) return new h.Event(e, t);
e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || e.defaultPrevented === undefined && e.returnValue === !1 ? et : tt) : this.type = e, t && h.extend(this, t), this.timeStamp = e && e.timeStamp || h.now(), this[h.expando] = !0
}, h.Event.prototype = {
isDefaultPrevented: tt,
isPropagationStopped: tt,
isImmediatePropagationStopped: tt,
preventDefault: function() {
var e = this.originalEvent;
this.isDefaultPrevented = et;
if (!e) return;
e.preventDefault ? e.preventDefault() : e.returnValue = !1
},
stopPropagation: function() {
var e = this.originalEvent;
this.isPropagationStopped = et;
if (!e) return;
e.stopPropagation && e.stopPropagation(), e.cancelBubble = !0
},
stopImmediatePropagation: function() {
var e = this.originalEvent;
this.isImmediatePropagationStopped = et, e && e.stopImmediatePropagation && e.stopImmediatePropagation(), this.stopPropagation()
}
}, h.each({
mouseenter: "mouseover",
mouseleave: "mouseout",
pointerenter: "pointerover",
pointerleave: "pointerout"
}, function(e, t) {
h.event.special[e] = {
delegateType: t,
bindType: t,
handle: function(e) {
var n, r = this,
i = e.relatedTarget,
s = e.handleObj;
if (!i || i !== r && !h.contains(r, i)) e.type = s.origType, n = s.handler.apply(this, arguments), e.type = t;
return n
}
}
}), l.submitBubbles || (h.event.special.submit = {
setup: function() {
if (h.nodeName(this, "form")) return !1;
h.event.add(this, "click._submit keypress._submit", function(e) {
var t = e.target,
n = h.nodeName(t, "input") || h.nodeName(t, "button") ? t.form : undefined;
n && !h._data(n, "submitBubbles") && (h.event.add(n, "submit._submit", function(e) {
e._submit_bubble = !0
}), h._data(n, "submitBubbles", !0))
})
},
postDispatch: function(e) {
e._submit_bubble && (delete e._submit_bubble, this.parentNode && !e.isTrigger && h.event.simulate("submit", this.parentNode, e, !0))
},
teardown: function() {
if (h.nodeName(this, "form")) return !1;
h.event.remove(this, "._submit")
}
}), l.changeBubbles || (h.event.special.change = {
setup: function() {
if (K.test(this.nodeName)) {
if (this.type === "checkbox" || this.type === "radio") h.event.add(this, "propertychange._change", function(e) {
e.originalEvent.propertyName === "checked" && (this._just_changed = !0)
}), h.event.add(this, "click._change", function(e) {
this._just_changed && !e.isTrigger && (this._just_changed = !1), h.event.simulate("change", this, e, !0)
});
return !1
}
h.event.add(this, "beforeactivate._change", function(e) {
var t = e.target;
K.test(t.nodeName) && !h._data(t, "changeBubbles") && (h.event.add(t, "change._change", function(e) {
this.parentNode && !e.isSimulated && !e.isTrigger && h.event.simulate("change", this.parentNode, e, !0)
}), h._data(t, "changeBubbles", !0))
})
},
handle: function(e) {
var t = e.target;
if (this !== t || e.isSimulated || e.isTrigger || t.type !== "radio" && t.type !== "checkbox") return e.handleObj.handler.apply(this, arguments)
},
teardown: function() {
return h.event.remove(this, "._change"), !K.test(this.nodeName)
}
}), l.focusinBubbles || h.each({
focus: "focusin",
blur: "focusout"
}, function(e, t) {
var n = function(e) {
h.event.simulate(t, e.target, h.event.fix(e), !0)
};
h.event.special[t] = {
setup: function() {
var r = this.ownerDocument || this,
i = h._data(r, t);
i || r.addEventListener(e, n, !0), h._data(r, t, (i || 0) + 1)
},
teardown: function() {
var r = this.ownerDocument || this,
i = h._data(r, t) - 1;
i ? h._data(r, t, i) : (r.removeEventListener(e, n, !0), h._removeData(r, t))
}
}
}), h.fn.extend({
on: function(e, t, n, r, i) {
var s, o;
if (typeof e == "object") {
typeof t != "string" && (n = n || t, t = undefined);
for (s in e) this.on(s, t, n, e[s], i);
return this
}
n == null && r == null ? (r = t, n = t = undefined) : r == null && (typeof t == "string" ? (r = n, n = undefined) : (r = n, n = t, t = undefined));
if (r === !1) r = tt;
else if (!r) return this;
return i === 1 && (o = r, r = function(e) {
return h().off(e), o.apply(this, arguments)
}, r.guid = o.guid || (o.guid = h.guid++)), this.each(function() {
h.event.add(this, e, r, n, t)
})
},
one: function(e, t, n, r) {
return this.on(e, t, n, r, 1)
},
off: function(e, t, n) {
var r, i;
if (e && e.preventDefault && e.handleObj) return r = e.handleObj, h(e.delegateTarget).off(r.namespace ? r.origType + "." + r.namespace : r.origType, r.selector, r.handler), this;
if (typeof e == "object") {
for (i in e) this.off(i, t, e[i]);
return this
}
if (t === !1 || typeof t == "function") n = t, t = undefined;
return n === !1 && (n = tt), this.each(function() {
h.event.remove(this, e, n, t)
})
},
trigger: function(e, t) {
return this.each(function() {
h.event.trigger(e, t, this)
})
},
triggerHandler: function(e, t) {
var n = this[0];
if (n) return h.event.trigger(e, t, n, !0)
}
});
var it = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
st = / jQuery\d+="(?:null|\d+)"/g,
ot = new RegExp("<(?:" + it + ")[\\s/>]", "i"),
ut = /^\s+/,
at = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
ft = /<([\w:]+)/,
lt = /<tbody/i,
ct = /<|&#?\w+;/,
ht = /<(?:script|style|link)/i,
pt = /checked\s*(?:[^=]|=\s*.checked.)/i,
dt = /^$|\/(?:java|ecma)script/i,
vt = /^true\/(.*)/,
mt = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
gt = {
option: [1, "<select multiple='multiple'>", "</select>"],
legend: [1, "<fieldset>", "</fieldset>"],
area: [1, "<map>", "</map>"],
param: [1, "<object>", "</object>"],
thead: [1, "<table>", "</table>"],
tr: [2, "<table><tbody>", "</tbody></table>"],
col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
_default: l.htmlSerialize ? [0, "", ""] : [1, "X<div>", "</div>"]
},
yt = rt(T),
bt = yt.appendChild(T.createElement("div"));
gt.optgroup = gt.option, gt.tbody = gt.tfoot = gt.colgroup = gt.caption = gt.thead, gt.th = gt.td, h.extend({
clone: function(e, t, n) {
var r, i, s, o, u, a = h.contains(e.ownerDocument, e);
l.html5Clone || h.isXMLDoc(e) || !ot.test("<" + e.nodeName + ">") ? s = e.cloneNode(!0) : (bt.innerHTML = e.outerHTML, bt.removeChild(s = bt.firstChild));
if ((!l.noCloneEvent || !l.noCloneChecked) && (e.nodeType === 1 || e.nodeType === 11) && !h.isXMLDoc(e)) {
r = wt(s), u = wt(e);
for (o = 0;
(i = u[o]) != null; ++o) r[o] && kt(i, r[o])
}
if (t)
if (n) {
u = u || wt(e), r = r || wt(s);
for (o = 0;
(i = u[o]) != null; o++) Ct(i, r[o])
} else Ct(e, s);
return r = wt(s, "script"), r.length > 0 && Nt(r, !a && wt(e, "script")), r = u = i = null, s
},
buildFragment: function(e, t, n, r) {
var i, s, o, u, a, f, c, p = e.length,
d = rt(t),
v = [],
m = 0;
for (; m < p; m++) {
s = e[m];
if (s || s === 0)
if (h.type(s) === "object") h.merge(v, s.nodeType ? [s] : s);
else if (!ct.test(s)) v.push(t.createTextNode(s));
else {
u = u || d.appendChild(t.createElement("div")), a = (ft.exec(s) || ["", ""])[1].toLowerCase(), c = gt[a] || gt._default, u.innerHTML = c[1] + s.replace(at, "<$1></$2>") + c[2], i = c[0];
while (i--) u = u.lastChild;
!l.leadingWhitespace && ut.test(s) && v.push(t.createTextNode(ut.exec(s)[0]));
if (!l.tbody) {
s = a === "table" && !lt.test(s) ? u.firstChild : c[1] === "<table>" && !lt.test(s) ? u : 0, i = s && s.childNodes.length;
while (i--) h.nodeName(f = s.childNodes[i], "tbody") && !f.childNodes.length && s.removeChild(f)
}
h.merge(v, u.childNodes), u.textContent = "";
while (u.firstChild) u.removeChild(u.firstChild);
u = d.lastChild
}
}
u && d.removeChild(u), l.appendChecked || h.grep(wt(v, "input"), Et), m = 0;
while (s = v[m++]) {
if (r && h.inArray(s, r) !== -1) continue;
o = h.contains(s.ownerDocument, s), u = wt(d.appendChild(s), "script"), o && Nt(u);
if (n) {
i = 0;
while (s = u[i++]) dt.test(s.type || "") && n.push(s)
}
}
return u = null, d
},
cleanData: function(e, t) {
var r, i, s, o, u = 0,
a = h.expando,
f = h.cache,
c = l.deleteExpando,
p = h.event.special;
for (;
(r = e[u]) != null; u++)
if (t || h.acceptData(r)) {
s = r[a], o = s && f[s];
if (o) {
if (o.events)
for (i in o.events) p[i] ? h.event.remove(r, i) : h.removeEvent(r, i, o.handle);
f[s] && (delete f[s], c ? delete r[a] : typeof r.removeAttribute !== B ? r.removeAttribute(a) : r[a] = null, n.push(s))
}
}
}
}), h.fn.extend({
text: function(e) {
return $(this, function(e) {
return e === undefined ? h.text(this) : this.empty().append((this[0] && this[0].ownerDocument || T).createTextNode(e))
}, null, e, arguments.length)
},
append: function() {
return this.domManip(arguments, function(e) {
if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
var t = St(this, e);
t.appendChild(e)
}
})
},
prepend: function() {
return this.domManip(arguments, function(e) {
if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
var t = St(this, e);
t.insertBefore(e, t.firstChild)
}
})
},
before: function() {
return this.domManip(arguments, function(e) {
this.parentNode && this.parentNode.insertBefore(e, this)
})
},
after: function() {
return this.domManip(arguments, function(e) {
this.parentNode && this.parentNode.insertBefore(e, this.nextSibling)
})
},
remove: function(e, t) {
var n, r = e ? h.filter(e, this) : this,
i = 0;
for (;
(n = r[i]) != null; i++) !t && n.nodeType === 1 && h.cleanData(wt(n)), n.parentNode && (t && h.contains(n.ownerDocument, n) && Nt(wt(n, "script")), n.parentNode.removeChild(n));
return this
},
empty: function() {
var e, t = 0;
for (;
(e = this[t]) != null; t++) {
e.nodeType === 1 && h.cleanData(wt(e, !1));
while (e.firstChild) e.removeChild(e.firstChild);
e.options && h.nodeName(e, "select") && (e.options.length = 0)
}
return this
},
clone: function(e, t) {
return e = e == null ? !1 : e, t = t == null ? e : t, this.map(function() {
return h.clone(this, e, t)
})
},
html: function(e) {
return $(this, function(e) {
var t = this[0] || {},
n = 0,
r = this.length;
if (e === undefined) return t.nodeType === 1 ? t.innerHTML.replace(st, "") : undefined;
if (typeof e == "string" && !ht.test(e) && (l.htmlSerialize || !ot.test(e)) && (l.leadingWhitespace || !ut.test(e)) && !gt[(ft.exec(e) || ["", ""])[1].toLowerCase()]) {
e = e.replace(at, "<$1></$2>");
try {
for (; n < r; n++) t = this[n] || {}, t.nodeType === 1 && (h.cleanData(wt(t, !1)), t.innerHTML = e);
t = 0
} catch (i) {}
}
t && this.empty().append(e)
}, null, e, arguments.length)
},
replaceWith: function() {
var e = arguments[0];
return this.domManip(arguments, function(t) {
e = this.parentNode, h.cleanData(wt(this)), e && e.replaceChild(t, this)
}), e && (e.length || e.nodeType) ? this : this.remove()
},
detach: function(e) {
return this.remove(e, !0)
},
domManip: function(e, t) {
e = i.apply([], e);
var n, r, s, o, u, a, f = 0,
c = this.length,
p = this,
d = c - 1,
v = e[0],
m = h.isFunction(v);
if (m || c > 1 && typeof v == "string" && !l.checkClone && pt.test(v)) return this.each(function(n) {
var r = p.eq(n);
m && (e[0] = v.call(this, n, r.html())), r.domManip(e, t)
});
if (c) {
a = h.buildFragment(e, this[0].ownerDocument, !1, this), n = a.firstChild, a.childNodes.length === 1 && (a = n);
if (n) {
o = h.map(wt(a, "script"), xt), s = o.length;
for (; f < c; f++) r = a, f !== d && (r = h.clone(r, !0, !0), s && h.merge(o, wt(r, "script"))), t.call(this[f], r, f);
if (s) {
u = o[o.length - 1].ownerDocument, h.map(o, Tt);
for (f = 0; f < s; f++) r = o[f], dt.test(r.type || "") && !h._data(r, "globalEval") && h.contains(u, r) && (r.src ? h._evalUrl && h._evalUrl(r.src) : h.globalEval((r.text || r.textContent || r.innerHTML || "").replace(mt, "")))
}
a = n = null
}
}
return this
}
}), h.each({
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
}, function(e, t) {
h.fn[e] = function(e) {
var n, r = 0,
i = [],
o = h(e),
u = o.length - 1;
for (; r <= u; r++) n = r === u ? this : this.clone(!0), h(o[r])[t](n), s.apply(i, n.get());
return this.pushStack(i)
}
});
var Lt, At = {};
(function() {
var e;
l.shrinkWrapBlocks = function() {
if (e != null) return e;
e = !1;
var t, n, r;
n = T.getElementsByTagName("body")[0];
if (!n || !n.style) return;
return t = T.createElement("div"), r = T.createElement("div"), r.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", n.appendChild(r).appendChild(t), typeof t.style.zoom !== B && (t.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1", t.appendChild(T.createElement("div")).style.width = "5px", e = t.offsetWidth !== 3), n.removeChild(r), e
}
})();
var _t = /^margin/,
Dt = new RegExp("^(" + W + ")(?!px)[a-z%]+$", "i"),
Pt, Ht, Bt = /^(top|right|bottom|left)$/;
e.getComputedStyle ? (Pt = function(t) {
return t.ownerDocument.defaultView.opener ? t.ownerDocument.defaultView.getComputedStyle(t, null) : e.getComputedStyle(t, null)
}, Ht = function(e, t, n) {
var r, i, s, o, u = e.style;
return n = n || Pt(e), o = n ? n.getPropertyValue(t) || n[t] : undefined, n && (o === "" && !h.contains(e.ownerDocument, e) && (o = h.style(e, t)), Dt.test(o) && _t.test(t) && (r = u.width, i = u.minWidth, s = u.maxWidth, u.minWidth = u.maxWidth = u.width = o, o = n.width, u.width = r, u.minWidth = i, u.maxWidth = s)), o === undefined ? o : o + ""
}) : T.documentElement.currentStyle && (Pt = function(e) {
return e.currentStyle
}, Ht = function(e, t, n) {
var r, i, s, o, u = e.style;
return n = n || Pt(e), o = n ? n[t] : undefined, o == null && u && u[t] && (o = u[t]), Dt.test(o) && !Bt.test(t) && (r = u.left, i = e.runtimeStyle, s = i && i.left, s && (i.left = e.currentStyle.left), u.left = t === "fontSize" ? "1em" : o, o = u.pixelLeft + "px", u.left = r, s && (i.left = s)), o === undefined ? o : o + "" || "auto"
}),
function() {
function a() {
var t, n, r, a;
n = T.getElementsByTagName("body")[0];
if (!n || !n.style) return;
t = T.createElement("div"), r = T.createElement("div"), r.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", n.appendChild(r).appendChild(t), t.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute", i = s = !1, u = !0, e.getComputedStyle && (i = (e.getComputedStyle(t, null) || {}).top !== "1%", s = (e.getComputedStyle(t, null) || {
width: "4px"
}).width === "4px", a = t.appendChild(T.createElement("div")), a.style.cssText = t.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0", a.style.marginRight = a.style.width = "0", t.style.width = "1px", u = !parseFloat((e.getComputedStyle(a, null) || {}).marginRight), t.removeChild(a)), t.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", a = t.getElementsByTagName("td"), a[0].style.cssText = "margin:0;border:0;padding:0;display:none", o = a[0].offsetHeight === 0, o && (a[0].style.display = "", a[1].style.display = "none", o = a[0].offsetHeight === 0), n.removeChild(r)
}
var t, n, r, i, s, o, u;
t = T.createElement("div"), t.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", r = t.getElementsByTagName("a")[0], n = r && r.style;
if (!n) return;
n.cssText = "float:left;opacity:.5", l.opacity = n.opacity === "0.5", l.cssFloat = !!n.cssFloat, t.style.backgroundClip = "content-box", t.cloneNode(!0).style.backgroundClip = "", l.clearCloneStyle = t.style.backgroundClip === "content-box", l.boxSizing = n.boxSizing === "" || n.MozBoxSizing === "" || n.WebkitBoxSizing === "", h.extend(l, {
reliableHiddenOffsets: function() {
return o == null && a(), o
},
boxSizingReliable: function() {
return s == null && a(), s
},
pixelPosition: function() {
return i == null && a(), i
},
reliableMarginRight: function() {
return u == null && a(), u
}
})
}(), h.swap = function(e, t, n, r) {
var i, s, o = {};
for (s in t) o[s] = e.style[s], e.style[s] = t[s];
i = n.apply(e, r || []);
for (s in t) e.style[s] = o[s];
return i
};
var Ft = /alpha\([^)]*\)/i,
It = /opacity\s*=\s*([^)]*)/,
qt = /^(none|table(?!-c[ea]).+)/,
Rt = new RegExp("^(" + W + ")(.*)$", "i"),
Ut = new RegExp("^([+-])=(" + W + ")", "i"),
zt = {
position: "absolute",
visibility: "hidden",
display: "block"
},
Wt = {
letterSpacing: "0",
fontWeight: "400"
},
Xt = ["Webkit", "O", "Moz", "ms"];
h.extend({
cssHooks: {
opacity: {
get: function(e, t) {
if (t) {
var n = Ht(e, "opacity");
return n === "" ? "1" : n
}
}
}
},
cssNumber: {
columnCount: !0,
fillOpacity: !0,
flexGrow: !0,
flexShrink: !0,
fontWeight: !0,
lineHeight: !0,
opacity: !0,
order: !0,
orphans: !0,
widows: !0,
zIndex: !0,
zoom: !0
},
cssProps: {
"float": l.cssFloat ? "cssFloat" : "styleFloat"
},
style: function(e, t, n, r) {
if (!e || e.nodeType === 3 || e.nodeType === 8 || !e.style) return;
var i, s, o, u = h.camelCase(t),
a = e.style;
t = h.cssProps[u] || (h.cssProps[u] = Vt(a, u)), o = h.cssHooks[t] || h.cssHooks[u];
if (n === undefined) return o && "get" in o && (i = o.get(e, !1, r)) !== undefined ? i : a[t];
s = typeof n, s === "string" && (i = Ut.exec(n)) && (n = (i[1] + 1) * i[2] + parseFloat(h.css(e, t)), s = "number");
if (n == null || n !== n) return;
s === "number" && !h.cssNumber[u] && (n += "px"), !l.clearCloneStyle && n === "" && t.indexOf("background") === 0 && (a[t] = "inherit");
if (!o || !("set" in o) || (n = o.set(e, n, r)) !== undefined) try {
a[t] = n
} catch (f) {}
},
css: function(e, t, n, r) {
var i, s, o, u = h.camelCase(t);
return t = h.cssProps[u] || (h.cssProps[u] = Vt(e.style, u)), o = h.cssHooks[t] || h.cssHooks[u], o && "get" in o && (s = o.get(e, !0, n)), s === undefined && (s = Ht(e, t, r)), s === "normal" && t in Wt && (s = Wt[t]), n === "" || n ? (i = parseFloat(s), n === !0 || h.isNumeric(i) ? i || 0 : s) : s
}
}), h.each(["height", "width"], function(e, t) {
h.cssHooks[t] = {
get: function(e, n, r) {
if (n) return qt.test(h.css(e, "display")) && e.offsetWidth === 0 ? h.swap(e, zt, function() {
return Qt(e, t, r)
}) : Qt(e, t, r)
},
set: function(e, n, r) {
var i = r && Pt(e);
return Jt(e, n, r ? Kt(e, t, r, l.boxSizing && h.css(e, "boxSizing", !1, i) === "border-box", i) : 0)
}
}
}), l.opacity || (h.cssHooks.opacity = {
get: function(e, t) {
return It.test((t && e.currentStyle ? e.currentStyle.filter : e.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : t ? "1" : ""
},
set: function(e, t) {
var n = e.style,
r = e.currentStyle,
i = h.isNumeric(t) ? "alpha(opacity=" + t * 100 + ")" : "",
s = r && r.filter || n.filter || "";
n.zoom = 1;
if ((t >= 1 || t === "") && h.trim(s.replace(Ft, "")) === "" && n.removeAttribute) {
n.removeAttribute("filter");
if (t === "" || r && !r.filter) return
}
n.filter = Ft.test(s) ? s.replace(Ft, i) : s + " " + i
}
}), h.cssHooks.marginRight = jt(l.reliableMarginRight, function(e, t) {
if (t) return h.swap(e, {
display: "inline-block"
}, Ht, [e, "marginRight"])
}), h.each({
margin: "",
padding: "",
border: "Width"
}, function(e, t) {
h.cssHooks[e + t] = {
expand: function(n) {
var r = 0,
i = {},
s = typeof n == "string" ? n.split(" ") : [n];
for (; r < 4; r++) i[e + X[r] + t] = s[r] || s[r - 2] || s[0];
return i
}
}, _t.test(e) || (h.cssHooks[e + t].set = Jt)
}), h.fn.extend({
css: function(e, t) {
return $(this, function(e, t, n) {
var r, i, s = {},
o = 0;
if (h.isArray(t)) {
r = Pt(e), i = t.length;
for (; o < i; o++) s[t[o]] = h.css(e, t[o], !1, r);
return s
}
return n !== undefined ? h.style(e, t, n) : h.css(e, t)
}, e, t, arguments.length > 1)
},
show: function() {
return $t(this, !0)
},
hide: function() {
return $t(this)
},
toggle: function(e) {
return typeof e == "boolean" ? e ? this.show() : this.hide() : this.each(function() {
V(this) ? h(this).show() : h(this).hide()
})
}
}), h.Tween = Gt, Gt.prototype = {
constructor: Gt,
init: function(e, t, n, r, i, s) {
this.elem = e, this.prop = n, this.easing = i || "swing", this.options = t, this.start = this.now = this.cur(), this.end = r, this.unit = s || (h.cssNumber[n] ? "" : "px")
},
cur: function() {
var e = Gt.propHooks[this.prop];
return e && e.get ? e.get(this) : Gt.propHooks._default.get(this)
},
run: function(e) {
var t, n = Gt.propHooks[this.prop];
return this.options.duration ? this.pos = t = h.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration) : this.pos = t = 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) : Gt.propHooks._default.set(this), this
}
}, Gt.prototype.init.prototype = Gt.prototype, Gt.propHooks = {
_default: {
get: function(e) {
var t;
return e.elem[e.prop] == null || !!e.elem.style && e.elem.style[e.prop] != null ? (t = h.css(e.elem, e.prop, ""), !t || t === "auto" ? 0 : t) : e.elem[e.prop]
},
set: function(e) {
h.fx.step[e.prop] ? h.fx.step[e.prop](e) : e.elem.style && (e.elem.style[h.cssProps[e.prop]] != null || h.cssHooks[e.prop]) ? h.style(e.elem, e.prop, e.now + e.unit) : e.elem[e.prop] = e.now
}
}
}, Gt.propHooks.scrollTop = Gt.propHooks.scrollLeft = {
set: function(e) {
e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now)
}
}, h.easing = {
linear: function(e) {
return e
},
swing: function(e) {
return .5 - Math.cos(e * Math.PI) / 2
}
}, h.fx = Gt.prototype.init, h.fx.step = {};
var Yt, Zt, en = /^(?:toggle|show|hide)$/,
tn = new RegExp("^(?:([+-])=|)(" + W + ")([a-z%]*)$", "i"),
nn = /queueHooks$/,
rn = [fn],
sn = {
"*": [
function(e, t) {
var n = this.createTween(e, t),
r = n.cur(),
i = tn.exec(t),
s = i && i[3] || (h.cssNumber[e] ? "" : "px"),
o = (h.cssNumber[e] || s !== "px" && +r) && tn.exec(h.css(n.elem, e)),
u = 1,
a = 20;
if (o && o[3] !== s) {
s = s || o[3], i = i || [], o = +r || 1;
do u = u || ".5", o /= u, h.style(n.elem, e, o + s); while (u !== (u = n.cur() / r) && u !== 1 && --a)
}
return i && (o = n.start = +o || +r || 0, n.unit = s, n.end = i[1] ? o + (i[1] + 1) * i[2] : +i[2]), n
}
]
};
h.Animation = h.extend(cn, {
tweener: function(e, t) {
h.isFunction(e) ? (t = e, e = ["*"]) : e = e.split(" ");
var n, r = 0,
i = e.length;
for (; r < i; r++) n = e[r], sn[n] = sn[n] || [], sn[n].unshift(t)
},
prefilter: function(e, t) {
t ? rn.unshift(e) : rn.push(e)
}
}), h.speed = function(e, t, n) {
var r = e && typeof e == "object" ? h.extend({}, e) : {
complete: n || !n && t || h.isFunction(e) && e,
duration: e,
easing: n && t || t && !h.isFunction(t) && t
};
r.duration = h.fx.off ? 0 : typeof r.duration == "number" ? r.duration : r.duration in h.fx.speeds ? h.fx.speeds[r.duration] : h.fx.speeds._default;
if (r.queue == null || r.queue === !0) r.queue = "fx";
return r.old = r.complete, r.complete = function() {
h.isFunction(r.old) && r.old.call(this), r.queue && h.dequeue(this, r.queue)
}, r
}, h.fn.extend({
fadeTo: function(e, t, n, r) {
return this.filter(V).css("opacity", 0).show().end().animate({
opacity: t
}, e, n, r)
},
animate: function(e, t, n, r) {
var i = h.isEmptyObject(e),
s = h.speed(t, n, r),
o = function() {
var t = cn(this, h.extend({}, e), s);
(i || h._data(this, "finish")) && t.stop(!0)
};
return o.finish = o, i || s.queue === !1 ? this.each(o) : this.queue(s.queue, o)
},
stop: function(e, t, n) {
var r = function(e) {
var t = e.stop;
delete e.stop, t(n)
};
return typeof e != "string" && (n = t, t = e, e = undefined), t && e !== !1 && this.queue(e || "fx", []), this.each(function() {
var t = !0,
i = e != null && e + "queueHooks",
s = h.timers,
o = h._data(this);
if (i) o[i] && o[i].stop && r(o[i]);
else
for (i in o) o[i] && o[i].stop && nn.test(i) && r(o[i]);
for (i = s.length; i--;) s[i].elem === this && (e == null || s[i].queue === e) && (s[i].anim.stop(n), t = !1, s.splice(i, 1));
(t || !n) && h.dequeue(this, e)
})
},
finish: function(e) {
return e !== !1 && (e = e || "fx"), this.each(function() {
var t, n = h._data(this),
r = n[e + "queue"],
i = n[e + "queueHooks"],
s = h.timers,
o = r ? r.length : 0;
n.finish = !0, h.queue(this, e, []), i && i.stop && i.stop.call(this, !0);
for (t = s.length; t--;) s[t].elem === this && s[t].queue === e && (s[t].anim.stop(!0), s.splice(t, 1));
for (t = 0; t < o; t++) r[t] && r[t].finish && r[t].finish.call(this);
delete n.finish
})
}
}), h.each(["toggle", "show", "hide"], function(e, t) {
var n = h.fn[t];
h.fn[t] = function(e, r, i) {
return e == null || typeof e == "boolean" ? n.apply(this, arguments) : this.animate(un(t, !0), e, r, i)
}
}), h.each({
slideDown: un("show"),
slideUp: un("hide"),
slideToggle: un("toggle"),
fadeIn: {
opacity: "show"
},
fadeOut: {
opacity: "hide"
},
fadeToggle: {
opacity: "toggle"
}
}, function(e, t) {
h.fn[e] = function(e, n, r) {
return this.animate(t, e, n, r)
}
}), h.timers = [], h.fx.tick = function() {
var e, t = h.timers,
n = 0;
Yt = h.now();
for (; n < t.length; n++) e = t[n], !e() && t[n] === e && t.splice(n--, 1);
t.length || h.fx.stop(), Yt = undefined
}, h.fx.timer = function(e) {
h.timers.push(e), e() ? h.fx.start() : h.timers.pop()
}, h.fx.interval = 13, h.fx.start = function() {
Zt || (Zt = setInterval(h.fx.tick, h.fx.interval))
}, h.fx.stop = function() {
clearInterval(Zt), Zt = null
}, h.fx.speeds = {
slow: 600,
fast: 200,
_default: 400
}, h.fn.delay = function(e, t) {
return e = h.fx ? h.fx.speeds[e] || e : e, t = t || "fx", this.queue(t, function(t, n) {
var r = setTimeout(t, e);
n.stop = function() {
clearTimeout(r)
}
})
},
function() {
var e, t, n, r, i;
t = T.createElement("div"), t.setAttribute("className", "t"), t.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", r = t.getElementsByTagName("a")[0], n = T.createElement("select"), i = n.appendChild(T.createElement("option")), e = t.getElementsByTagName("input")[0], r.style.cssText = "top:1px", l.getSetAttribute = t.className !== "t", l.style = /top/.test(r.getAttribute("style")), l.hrefNormalized = r.getAttribute("href") === "/a", l.checkOn = !!e.value, l.optSelected = i.selected, l.enctype = !!T.createElement("form").enctype, n.disabled = !0, l.optDisabled = !i.disabled, e = T.createElement("input"), e.setAttribute("value", ""), l.input = e.getAttribute("value") === "", e.value = "t", e.setAttribute("type", "radio"), l.radioValue = e.value === "t"
}();
var hn = /\r/g;
h.fn.extend({
val: function(e) {
var t, n, r, i = this[0];
if (!arguments.length) {
if (i) return t = h.valHooks[i.type] || h.valHooks[i.nodeName.toLowerCase()], t && "get" in t && (n = t.get(i, "value")) !== undefined ? n : (n = i.value, typeof n == "string" ? n.replace(hn, "") : n == null ? "" : n);
return
}
return r = h.isFunction(e), this.each(function(n) {
var i;
if (this.nodeType !== 1) return;
r ? i = e.call(this, n, h(this).val()) : i = e, i == null ? i = "" : typeof i == "number" ? i += "" : h.isArray(i) && (i = h.map(i, function(e) {
return e == null ? "" : e + ""
})), t = h.valHooks[this.type] || h.valHooks[this.nodeName.toLowerCase()];
if (!t || !("set" in t) || t.set(this, i, "value") === undefined) this.value = i
})
}
}), h.extend({
valHooks: {
option: {
get: function(e) {
var t = h.find.attr(e, "value");
return t != null ? t : h.trim(h.text(e))
}
},
select: {
get: function(e) {
var t, n, r = e.options,
i = e.selectedIndex,
s = e.type === "select-one" || i < 0,
o = s ? null : [],
u = s ? i + 1 : r.length,
a = i < 0 ? u : s ? i : 0;
for (; a < u; a++) {
n = r[a];
if ((n.selected || a === i) && (l.optDisabled ? !n.disabled : n.getAttribute("disabled") === null) && (!n.parentNode.disabled || !h.nodeName(n.parentNode, "optgroup"))) {
t = h(n).val();
if (s) return t;
o.push(t)
}
}
return o
},
set: function(e, t) {
var n, r, i = e.options,
s = h.makeArray(t),
o = i.length;
while (o--) {
r = i[o];
if (h.inArray(h.valHooks.option.get(r), s) >= 0) try {
r.selected = n = !0
} catch (u) {
r.scrollHeight
} else r.selected = !1
}
return n || (e.selectedIndex = -1), i
}
}
}
}), h.each(["radio", "checkbox"], function() {
h.valHooks[this] = {
set: function(e, t) {
if (h.isArray(t)) return e.checked = h.inArray(h(e).val(), t) >= 0
}
}, l.checkOn || (h.valHooks[this].get = function(e) {
return e.getAttribute("value") === null ? "on" : e.value
})
});
var pn, dn, vn = h.expr.attrHandle,
mn = /^(?:checked|selected)$/i,
gn = l.getSetAttribute,
yn = l.input;
h.fn.extend({
attr: function(e, t) {
return $(this, h.attr, e, t, arguments.length > 1)
},
removeAttr: function(e) {
return this.each(function() {
h.removeAttr(this, e)
})
}
}), h.extend({
attr: function(e, t, n) {
var r, i, s = e.nodeType;
if (!e || s === 3 || s === 8 || s === 2) return;
if (typeof e.getAttribute === B) return h.prop(e, t, n);
if (s !== 1 || !h.isXMLDoc(e)) t = t.toLowerCase(), r = h.attrHooks[t] || (h.expr.match.bool.test(t) ? dn : pn);
if (n === undefined) return r && "get" in r && (i = r.get(e, t)) !== null ? i : (i = h.find.attr(e, t), i == null ? undefined : i);
if (n !== null) return r && "set" in r && (i = r.set(e, n, t)) !== undefined ? i : (e.setAttribute(t, n + ""), n);
h.removeAttr(e, t)
},
removeAttr: function(e, t) {
var n, r, i = 0,
s = t && t.match(O);
if (s && e.nodeType === 1)
while (n = s[i++]) r = h.propFix[n] || n, h.expr.match.bool.test(n) ? yn && gn || !mn.test(n) ? e[r] = !1 : e[h.camelCase("default-" + n)] = e[r] = !1 : h.attr(e, n, ""), e.removeAttribute(gn ? n : r)
},
attrHooks: {
type: {
set: function(e, t) {
if (!l.radioValue && t === "radio" && h.nodeName(e, "input")) {
var n = e.value;
return e.setAttribute("type", t), n && (e.value = n), t
}
}
}
}
}), dn = {
set: function(e, t, n) {
return t === !1 ? h.removeAttr(e, n) : yn && gn || !mn.test(n) ? e.setAttribute(!gn && h.propFix[n] || n, n) : e[h.camelCase("default-" + n)] = e[n] = !0, n
}
}, h.each(h.expr.match.bool.source.match(/\w+/g), function(e, t) {
var n = vn[t] || h.find.attr;
vn[t] = yn && gn || !mn.test(t) ? function(e, t, r) {
var i, s;
return r || (s = vn[t], vn[t] = i, i = n(e, t, r) != null ? t.toLowerCase() : null, vn[t] = s), i
} : function(e, t, n) {
if (!n) return e[h.camelCase("default-" + t)] ? t.toLowerCase() : null
}
});
if (!yn || !gn) h.attrHooks.value = {
set: function(e, t, n) {
if (!h.nodeName(e, "input")) return pn && pn.set(e, t, n);
e.defaultValue = t
}
};
gn || (pn = {
set: function(e, t, n) {
var r = e.getAttributeNode(n);
r || e.setAttributeNode(r = e.ownerDocument.createAttribute(n)), r.value = t += "";
if (n === "value" || t === e.getAttribute(n)) return t
}
}, vn.id = vn.name = vn.coords = function(e, t, n) {
var r;
if (!n) return (r = e.getAttributeNode(t)) && r.value !== "" ? r.value : null
}, h.valHooks.button = {
get: function(e, t) {
var n = e.getAttributeNode(t);
if (n && n.specified) return n.value
},
set: pn.set
}, h.attrHooks.contenteditable = {
set: function(e, t, n) {
pn.set(e, t === "" ? !1 : t, n)
}
}, h.each(["width", "height"], function(e, t) {
h.attrHooks[t] = {
set: function(e, n) {
if (n === "") return e.setAttribute(t, "auto"), n
}
}
})), l.style || (h.attrHooks.style = {
get: function(e) {
return e.style.cssText || undefined
},
set: function(e, t) {
return e.style.cssText = t + ""
}
});
var bn = /^(?:input|select|textarea|button|object)$/i,
wn = /^(?:a|area)$/i;
h.fn.extend({
prop: function(e, t) {
return $(this, h.prop, e, t, arguments.length > 1)
},
removeProp: function(e) {
return e = h.propFix[e] || e, this.each(function() {
try {
this[e] = undefined, delete this[e]
} catch (t) {}
})
}
}), h.extend({
propFix: {
"for": "htmlFor",
"class": "className"
},
prop: function(e, t, n) {
var r, i, s, o = e.nodeType;
if (!e || o === 3 || o === 8 || o === 2) return;
return s = o !== 1 || !h.isXMLDoc(e), s && (t = h.propFix[t] || t, i = h.propHooks[t]), n !== undefined ? i && "set" in i && (r = i.set(e, n, t)) !== undefined ? r : e[t] = n : i && "get" in i && (r = i.get(e, t)) !== null ? r : e[t]
},
propHooks: {
tabIndex: {
get: function(e) {
var t = h.find.attr(e, "tabindex");
return t ? parseInt(t, 10) : bn.test(e.nodeName) || wn.test(e.nodeName) && e.href ? 0 : -1
}
}
}
}), l.hrefNormalized || h.each(["href", "src"], function(e, t) {
h.propHooks[t] = {
get: function(e) {
return e.getAttribute(t, 4)
}
}
}), l.optSelected || (h.propHooks.selected = {
get: function(e) {
var t = e.parentNode;
return t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex), null
}
}), h.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() {
h.propFix[this.toLowerCase()] = this
}), l.enctype || (h.propFix.enctype = "encoding");
var En = /[\t\r\n\f]/g;
h.fn.extend({
addClass: function(e) {
var t, n, r, i, s, o, u = 0,
a = this.length,
f = typeof e == "string" && e;
if (h.isFunction(e)) return this.each(function(t) {
h(this).addClass(e.call(this, t, this.className))
});
if (f) {
t = (e || "").match(O) || [];
for (; u < a; u++) {
n = this[u], r = n.nodeType === 1 && (n.className ? (" " + n.className + " ").replace(En, " ") : " ");
if (r) {
s = 0;
while (i = t[s++]) r.indexOf(" " + i + " ") < 0 && (r += i + " ");
o = h.trim(r), n.className !== o && (n.className = o)
}
}
}
return this
},
removeClass: function(e) {
var t, n, r, i, s, o, u = 0,
a = this.length,
f = arguments.length === 0 || typeof e == "string" && e;
if (h.isFunction(e)) return this.each(function(t) {
h(this).removeClass(e.call(this, t, this.className))
});
if (f) {
t = (e || "").match(O) || [];
for (; u < a; u++) {
n = this[u], r = n.nodeType === 1 && (n.className ? (" " + n.className + " ").replace(En, " ") : "");
if (r) {
s = 0;
while (i = t[s++])
while (r.indexOf(" " + i + " ") >= 0) r = r.replace(" " + i + " ", " ");
o = e ? h.trim(r) : "", n.className !== o && (n.className = o)
}
}
}
return this
},
toggleClass: function(e, t) {
var n = typeof e;
return typeof t == "boolean" && n === "string" ? t ? this.addClass(e) : this.removeClass(e) : h.isFunction(e) ? this.each(function(n) {
h(this).toggleClass(e.call(this, n, this.className, t), t)
}) : this.each(function() {
if (n === "string") {
var t, r = 0,
i = h(this),
s = e.match(O) || [];
while (t = s[r++]) i.hasClass(t) ? i.removeClass(t) : i.addClass(t)
} else if (n === B || n === "boolean") this.className && h._data(this, "__className__", this.className), this.className = this.className || e === !1 ? "" : h._data(this, "__className__") || ""
})
},
hasClass: function(e) {
var t = " " + e + " ",
n = 0,
r = this.length;
for (; n < r; n++)
if (this[n].nodeType === 1 && (" " + this[n].className + " ").replace(En, " ").indexOf(t) >= 0) return !0;
return !1
}
}), h.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) {
h.fn[t] = function(e, n) {
return arguments.length > 0 ? this.on(t, null, e, n) : this.trigger(t)
}
}), h.fn.extend({
hover: function(e, t) {
return this.mouseenter(e).mouseleave(t || e)
},
bind: function(e, t, n) {
return this.on(e, null, t, n)
},
unbind: function(e, t) {
return this.off(e, null, t)
},
delegate: function(e, t, n, r) {
return this.on(t, e, n, r)
},
undelegate: function(e, t, n) {
return arguments.length === 1 ? this.off(e, "**") : this.off(t, e || "**", n)
}
});
var Sn = h.now(),
xn = /\?/,
Tn = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
h.parseJSON = function(t) {
if (e.JSON && e.JSON.parse) return e.JSON.parse(t + "");
var n, r = null,
i = h.trim(t + "");
return i && !h.trim(i.replace(Tn, function(e, t, i, s) {
return n && t && (r = 0), r === 0 ? e : (n = i || t, r += !s - !i, "")
})) ? Function("return " + i)() : h.error("Invalid JSON: " + t)
}, h.parseXML = function(t) {
var n, r;
if (!t || typeof t != "string") return null;
try {
e.DOMParser ? (r = new DOMParser, n = r.parseFromString(t, "text/xml")) : (n = new ActiveXObject("Microsoft.XMLDOM"), n.async = "false", n.loadXML(t))
} catch (i) {
n = undefined
}
return (!n || !n.documentElement || n.getElementsByTagName("parsererror").length) && h.error("Invalid XML: " + t), n
};
var Nn, Cn, kn = /#.*$/,
Ln = /([?&])_=[^&]*/,
An = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg,
On = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
Mn = /^(?:GET|HEAD)$/,
_n = /^\/\//,
Dn = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
Pn = {},
Hn = {},
Bn = "*/".concat("*");
try {
Cn = location.href
} catch (jn) {
Cn = T.createElement("a"), Cn.href = "", Cn = Cn.href
}
Nn = Dn.exec(Cn.toLowerCase()) || [], h.extend({
active: 0,
lastModified: {},
etag: {},
ajaxSettings: {
url: Cn,
type: "GET",
isLocal: On.test(Nn[1]),
global: !0,
processData: !0,
async: !0,
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
accepts: {
"*": Bn,
text: "text/plain",
html: "text/html",
xml: "application/xml, text/xml",
json: "application/json, text/javascript"
},
contents: {
xml: /xml/,
html: /html/,
json: /json/
},
responseFields: {
xml: "responseXML",
text: "responseText",
json: "responseJSON"
},
converters: {
"* text": String,
"text html": !0,
"text json": h.parseJSON,
"text xml": h.parseXML
},
flatOptions: {
url: !0,
context: !0
}
},
ajaxSetup: function(e, t) {
return t ? qn(qn(e, h.ajaxSettings), t) : qn(h.ajaxSettings, e)
},
ajaxPrefilter: Fn(Pn),
ajaxTransport: Fn(Hn),
ajax: function(e, t) {
function x(e, t, n, r) {
var f, g, y, w, S, x = t;
if (b === 2) return;
b = 2, o && clearTimeout(o), a = undefined, s = r || "", E.readyState = e > 0 ? 4 : 0, f = e >= 200 && e < 300 || e === 304, n && (w = Rn(l, E, n)), w = Un(l, w, E, f);
if (f) l.ifModified && (S = E.getResponseHeader("Last-Modified"), S && (h.lastModified[i] = S), S = E.getResponseHeader("etag"), S && (h.etag[i] = S)), e === 204 || l.type === "HEAD" ? x = "nocontent" : e === 304 ? x = "notmodified" : (x = w.state, g = w.data, y = w.error, f = !y);
else {
y = x;
if (e || !x) x = "error", e < 0 && (e = 0)
}
E.status = e, E.statusText = (t || x) + "", f ? d.resolveWith(c, [g, x, E]) : d.rejectWith(c, [E, x, y]), E.statusCode(m), m = undefined, u && p.trigger(f ? "ajaxSuccess" : "ajaxError", [E, l, f ? g : y]), v.fireWith(c, [E, x]), u && (p.trigger("ajaxComplete", [E, l]), --h.active || h.event.trigger("ajaxStop"))
}
typeof e == "object" && (t = e, e = undefined), t = t || {};
var n, r, i, s, o, u, a, f, l = h.ajaxSetup({}, t),
c = l.context || l,
p = l.context && (c.nodeType || c.jquery) ? h(c) : h.event,
d = h.Deferred(),
v = h.Callbacks("once memory"),
m = l.statusCode || {},
g = {},
y = {},
b = 0,
w = "canceled",
E = {
readyState: 0,
getResponseHeader: function(e) {
var t;
if (b === 2) {
if (!f) {
f = {};
while (t = An.exec(s)) f[t[1].toLowerCase()] = t[2]
}
t = f[e.toLowerCase()]
}
return t == null ? null : t
},
getAllResponseHeaders: function() {
return b === 2 ? s : null
},
setRequestHeader: function(e, t) {
var n = e.toLowerCase();
return b || (e = y[n] = y[n] || e, g[e] = t), this
},
overrideMimeType: function(e) {
return b || (l.mimeType = e), this
},
statusCode: function(e) {
var t;
if (e)
if (b < 2)
for (t in e) m[t] = [m[t], e[t]];
else E.always(e[E.status]);
return this
},
abort: function(e) {
var t = e || w;
return a && a.abort(t), x(0, t), this
}
};
d.promise(E).complete = v.add, E.success = E.done, E.error = E.fail, l.url = ((e || l.url || Cn) + "").replace(kn, "").replace(_n, Nn[1] + "//"), l.type = t.method || t.type || l.method || l.type, l.dataTypes = h.trim(l.dataType || "*").toLowerCase().match(O) || [""], l.crossDomain == null && (n = Dn.exec(l.url.toLowerCase()), l.crossDomain = !(!n || n[1] === Nn[1] && n[2] === Nn[2] && (n[3] || (n[1] === "http:" ? "80" : "443")) === (Nn[3] || (Nn[1] === "http:" ? "80" : "443")))), l.data && l.processData && typeof l.data != "string" && (l.data = h.param(l.data, l.traditional)), In(Pn, l, t, E);
if (b === 2) return E;
u = h.event && l.global, u && h.active++ === 0 && h.event.trigger("ajaxStart"), l.type = l.type.toUpperCase(), l.hasContent = !Mn.test(l.type), i = l.url, l.hasContent || (l.data && (i = l.url += (xn.test(i) ? "&" : "?") + l.data, delete l.data), l.cache === !1 && (l.url = Ln.test(i) ? i.replace(Ln, "$1_=" + Sn++) : i + (xn.test(i) ? "&" : "?") + "_=" + Sn++)), l.ifModified && (h.lastModified[i] && E.setRequestHeader("If-Modified-Since", h.lastModified[i]), h.etag[i] && E.setRequestHeader("If-None-Match", h.etag[i])), (l.data && l.hasContent && l.contentType !== !1 || t.contentType) && E.setRequestHeader("Content-Type", l.contentType), E.setRequestHeader("Accept", l.dataTypes[0] && l.accepts[l.dataTypes[0]] ? l.accepts[l.dataTypes[0]] + (l.dataTypes[0] !== "*" ? ", " + Bn + "; q=0.01" : "") : l.accepts["*"]);
for (r in l.headers) E.setRequestHeader(r, l.headers[r]);
if (!l.beforeSend || l.beforeSend.call(c, E, l) !== !1 && b !== 2) {
w = "abort";
for (r in {
success: 1,
error: 1,
complete: 1
}) E[r](l[r]);
a = In(Hn, l, t, E);
if (!a) x(-1, "No Transport");
else {
E.readyState = 1, u && p.trigger("ajaxSend", [E, l]), l.async && l.timeout > 0 && (o = setTimeout(function() {
E.abort("timeout")
}, l.timeout));
try {
b = 1, a.send(g, x)
} catch (S) {
if (!(b < 2)) throw S;
x(-1, S)
}
}
return E
}
return E.abort()
},
getJSON: function(e, t, n) {
return h.get(e, t, n, "json")
},
getScript: function(e, t) {
return h.get(e, undefined, t, "script")
}
}), h.each(["get", "post"], function(e, t) {
h[t] = function(e, n, r, i) {
return h.isFunction(n) && (i = i || r, r = n, n = undefined), h.ajax({
url: e,
type: t,
dataType: i,
data: n,
success: r
})
}
}), h._evalUrl = function(e) {
return h.ajax({
url: e,
type: "GET",
dataType: "script",
async: !1,
global: !1,
"throws": !0
})
}, h.fn.extend({
wrapAll: function(e) {
if (h.isFunction(e)) return this.each(function(t) {
h(this).wrapAll(e.call(this, t))
});
if (this[0]) {
var t = h(e, this[0].ownerDocument).eq(0).clone(!0);
this[0].parentNode && t.insertBefore(this[0]), t.map(function() {
var e = this;
while (e.firstChild && e.firstChild.nodeType === 1) e = e.firstChild;
return e
}).append(this)
}
return this
},
wrapInner: function(e) {
return h.isFunction(e) ? this.each(function(t) {
h(this).wrapInner(e.call(this, t))
}) : this.each(function() {
var t = h(this),
n = t.contents();
n.length ? n.wrapAll(e) : t.append(e)
})
},
wrap: function(e) {
var t = h.isFunction(e);
return this.each(function(n) {
h(this).wrapAll(t ? e.call(this, n) : e)
})
},
unwrap: function() {
return this.parent().each(function() {
h.nodeName(this, "body") || h(this).replaceWith(this.childNodes)
}).end()
}
}), h.expr.filters.hidden = function(e) {
return e.offsetWidth <= 0 && e.offsetHeight <= 0 || !l.reliableHiddenOffsets() && (e.style && e.style.display || h.css(e, "display")) === "none"
}, h.expr.filters.visible = function(e) {
return !h.expr.filters.hidden(e)
};
var zn = /%20/g,
Wn = /\[\]$/,
Xn = /\r?\n/g,
Vn = /^(?:submit|button|image|reset|file)$/i,
$n = /^(?:input|select|textarea|keygen)/i;
h.param = function(e, t) {
var n, r = [],
i = function(e, t) {
t = h.isFunction(t) ? t() : t == null ? "" : t, r[r.length] = encodeURIComponent(e) + "=" + encodeURIComponent(t)
};
t === undefined && (t = h.ajaxSettings && h.ajaxSettings.traditional);
if (h.isArray(e) || e.jquery && !h.isPlainObject(e)) h.each(e, function() {
i(this.name, this.value)
});
else
for (n in e) Jn(n, e[n], t, i);
return r.join("&").replace(zn, "+")
}, h.fn.extend({
serialize: function() {
return h.param(this.serializeArray())
},
serializeArray: function() {
return this.map(function() {
var e = h.prop(this, "elements");
return e ? h.makeArray(e) : this
}).filter(function() {
var e = this.type;
return this.name && !h(this).is(":disabled") && $n.test(this.nodeName) && !Vn.test(e) && (this.checked || !J.test(e))
}).map(function(e, t) {
var n = h(this).val();
return n == null ? null : h.isArray(n) ? h.map(n, function(e) {
return {
name: t.name,
value: e.replace(Xn, "\r\n")
}
}) : {
name: t.name,
value: n.replace(Xn, "\r\n")
}
}).get()
}
}), h.ajaxSettings.xhr = e.ActiveXObject !== undefined ? function() {
return !this.isLocal && /^(get|post|head|put|delete|options)$/i.test(this.type) && Yn() || Zn()
} : Yn;
var Kn = 0,
Qn = {},
Gn = h.ajaxSettings.xhr();
e.attachEvent && e.attachEvent("onunload", function() {
for (var e in Qn) Qn[e](undefined, !0)
}), l.cors = !!Gn && "withCredentials" in Gn, Gn = l.ajax = !!Gn, Gn && h.ajaxTransport(function(e) {
if (!e.crossDomain || l.cors) {
var t;
return {
send: function(n, r) {
var i, s = e.xhr(),
o = ++Kn;
s.open(e.type, e.url, e.async, e.username, e.password);
if (e.xhrFields)
for (i in e.xhrFields) s[i] = e.xhrFields[i];
e.mimeType && s.overrideMimeType && s.overrideMimeType(e.mimeType), !e.crossDomain && !n["X-Requested-With"] && (n["X-Requested-With"] = "XMLHttpRequest");
for (i in n) n[i] !== undefined && s.setRequestHeader(i, n[i] + "");
s.send(e.hasContent && e.data || null), t = function(n, i) {
var u, a, f;
if (t && (i || s.readyState === 4)) {
delete Qn[o], t = undefined, s.onreadystatechange = h.noop;
if (i) s.readyState !== 4 && s.abort();
else {
f = {}, u = s.status, typeof s.responseText == "string" && (f.text = s.responseText);
try {
a = s.statusText
} catch (l) {
a = ""
}!u && e.isLocal && !e.crossDomain ? u = f.text ? 200 : 404 : u === 1223 && (u = 204)
}
}
f && r(u, a, f, s.getAllResponseHeaders())
}, e.async ? s.readyState === 4 ? setTimeout(t) : s.onreadystatechange = Qn[o] = t : t()
},
abort: function() {
t && t(undefined, !0)
}
}
}
}), h.ajaxSetup({
accepts: {
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
},
contents: {
script: /(?:java|ecma)script/
},
converters: {
"text script": function(e) {
return h.globalEval(e), e
}
}
}), h.ajaxPrefilter("script", function(e) {
e.cache === undefined && (e.cache = !1), e.crossDomain && (e.type = "GET", e.global = !1)
}), h.ajaxTransport("script", function(e) {
if (e.crossDomain) {
var t, n = T.head || h("head")[0] || T.documentElement;
return {
send: function(r, i) {
t = T.createElement("script"), t.async = !0, e.scriptCharset && (t.charset = e.scriptCharset), t.src = e.url, t.onload = t.onreadystatechange = function(e, n) {
if (n || !t.readyState || /loaded|complete/.test(t.readyState)) t.onload = t.onreadystatechange = null, t.parentNode && t.parentNode.removeChild(t), t = null, n || i(200, "success")
}, n.insertBefore(t, n.firstChild)
},
abort: function() {
t && t.onload(undefined, !0)
}
}
}
});
var er = [],
tr = /(=)\?(?=&|$)|\?\?/;
h.ajaxSetup({
jsonp: "callback",
jsonpCallback: function() {
var e = er.pop() || h.expando + "_" + Sn++;
return this[e] = !0, e
}
}), h.ajaxPrefilter("json jsonp", function(t, n, r) {
var i, s, o, u = t.jsonp !== !1 && (tr.test(t.url) ? "url" : typeof t.data == "string" && !(t.contentType || "").indexOf("application/x-www-form-urlencoded") && tr.test(t.data) && "data");
if (u || t.dataTypes[0] === "jsonp") return i = t.jsonpCallback = h.isFunction(t.jsonpCallback) ? t.jsonpCallback() : t.jsonpCallback, u ? t[u] = t[u].replace(tr, "$1" + i) : t.jsonp !== !1 && (t.url += (xn.test(t.url) ? "&" : "?") + t.jsonp + "=" + i), t.converters["script json"] = function() {
return o || h.error(i + " was not called"), o[0]
}, t.dataTypes[0] = "json", s = e[i], e[i] = function() {
o = arguments
}, r.always(function() {
e[i] = s, t[i] && (t.jsonpCallback = n.jsonpCallback, er.push(i)), o && h.isFunction(s) && s(o[0]), o = s = undefined
}), "script"
}), h.parseHTML = function(e, t, n) {
if (!e || typeof e != "string") return null;
typeof t == "boolean" && (n = t, t = !1), t = t || T;
var r = w.exec(e),
i = !n && [];
return r ? [t.createElement(r[1])] : (r = h.buildFragment([e], t, i), i && i.length && h(i).remove(), h.merge([], r.childNodes))
};
var nr = h.fn.load;
h.fn.load = function(e, t, n) {
if (typeof e != "string" && nr) return nr.apply(this, arguments);
var r, i, s, o = this,
u = e.indexOf(" ");
return u >= 0 && (r = h.trim(e.slice(u, e.length)), e = e.slice(0, u)), h.isFunction(t) ? (n = t, t = undefined) : t && typeof t == "object" && (s = "POST"), o.length > 0 && h.ajax({
url: e,
type: s,
dataType: "html",
data: t
}).done(function(e) {
i = arguments, o.html(r ? h("<div>").append(h.parseHTML(e)).find(r) : e)
}).complete(n && function(e, t) {
o.each(n, i || [e.responseText, t, e])
}), this
}, h.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(e, t) {
h.fn[t] = function(e) {
return this.on(t, e)
}
}), h.expr.filters.animated = function(e) {
return h.grep(h.timers, function(t) {
return e === t.elem
}).length
};
var rr = e.document.documentElement;
h.offset = {
setOffset: function(e, t, n) {
var r, i, s, o, u, a, f, l = h.css(e, "position"),
c = h(e),
p = {};
l === "static" && (e.style.position = "relative"), u = c.offset(), s = h.css(e, "top"), a = h.css(e, "left"), f = (l === "absolute" || l === "fixed") && h.inArray("auto", [s, a]) > -1, f ? (r = c.position(), o = r.top, i = r.left) : (o = parseFloat(s) || 0, i = parseFloat(a) || 0), h.isFunction(t) && (t = t.call(e, n, u)), t.top != null && (p.top = t.top - u.top + o), t.left != null && (p.left = t.left - u.left + i), "using" in t ? t.using.call(e, p) : c.css(p)
}
}, h.fn.extend({
offset: function(e) {
if (arguments.length) return e === undefined ? this : this.each(function(t) {
h.offset.setOffset(this, e, t)
});
var t, n, r = {
top: 0,
left: 0
},
i = this[0],
s = i && i.ownerDocument;
if (!s) return;
return t = s.documentElement, h.contains(t, i) ? (typeof i.getBoundingClientRect !== B && (r = i.getBoundingClientRect()), n = ir(s), {
top: r.top + (n.pageYOffset || t.scrollTop) - (t.clientTop || 0),
left: r.left + (n.pageXOffset || t.scrollLeft) - (t.clientLeft || 0)
}) : r
},
position: function() {
if (!this[0]) return;
var e, t, n = {
top: 0,
left: 0
},
r = this[0];
return h.css(r, "position") === "fixed" ? t = r.getBoundingClientRect() : (e = this.offsetParent(), t = this.offset(), h.nodeName(e[0], "html") || (n = e.offset()), n.top += h.css(e[0], "borderTopWidth", !0), n.left += h.css(e[0], "borderLeftWidth", !0)), {
top: t.top - n.top - h.css(r, "marginTop", !0),
left: t.left - n.left - h.css(r, "marginLeft", !0)
}
},
offsetParent: function() {
return this.map(function() {
var e = this.offsetParent || rr;
while (e && !h.nodeName(e, "html") && h.css(e, "position") === "static") e = e.offsetParent;
return e || rr
})
}
}), h.each({
scrollLeft: "pageXOffset",
scrollTop: "pageYOffset"
}, function(e, t) {
var n = /Y/.test(t);
h.fn[e] = function(r) {
return $(this, function(e, r, i) {
var s = ir(e);
if (i === undefined) return s ? t in s ? s[t] : s.document.documentElement[r] : e[r];
s ? s.scrollTo(n ? h(s).scrollLeft() : i, n ? i : h(s).scrollTop()) : e[r] = i
}, e, r, arguments.length, null)
}
}), h.each(["top", "left"], function(e, t) {
h.cssHooks[t] = jt(l.pixelPosition, function(e, n) {
if (n) return n = Ht(e, t), Dt.test(n) ? h(e).position()[t] + "px" : n
})
}), h.each({
Height: "height",
Width: "width"
}, function(e, t) {
h.each({
padding: "inner" + e,
content: t,
"": "outer" + e
}, function(n, r) {
h.fn[r] = function(r, i) {
var s = arguments.length && (n || typeof r != "boolean"),
o = n || (r === !0 || i === !0 ? "margin" : "border");
return $(this, function(t, n, r) {
var i;
return h.isWindow(t) ? t.document.documentElement["client" + e] : t.nodeType === 9 ? (i = t.documentElement, Math.max(t.body["scroll" + e], i["scroll" + e], t.body["offset" + e], i["offset" + e], i["client" + e])) : r === undefined ? h.css(t, n, o) : h.style(t, n, r, o)
}, t, s ? r : undefined, s, null)
}
})
}), h.fn.size = function() {
return this.length
}, h.fn.andSelf = h.fn.addBack, typeof define == "function" && define.amd && define("jquery", [], function() {
return h
});
var sr = e.jQuery,
or = e.$;
return h.noConflict = function(t) {
return e.$ === h && (e.$ = or), t && e.jQuery === h && (e.jQuery = sr), h
}, typeof t === B && (e.jQuery = e.$ = h), h
});
var THREE = {
REVISION: "71"
};
typeof module == "object" && (module.exports = THREE), Math.sign === undefined && (Math.sign = function(e) {
return e < 0 ? -1 : e > 0 ? 1 : +e
}), THREE.log = function() {
console.log.apply(console, arguments)
}, THREE.warn = function() {
console.warn.apply(console, arguments)
}, THREE.error = function() {
console.error.apply(console, arguments)
}, THREE.MOUSE = {
LEFT: 0,
MIDDLE: 1,
RIGHT: 2
}, THREE.CullFaceNone = 0, THREE.CullFaceBack = 1, THREE.CullFaceFront = 2, THREE.CullFaceFrontBack = 3, THREE.FrontFaceDirectionCW = 0, THREE.FrontFaceDirectionCCW = 1, THREE.BasicShadowMap = 0, THREE.PCFShadowMap = 1, THREE.PCFSoftShadowMap = 2, THREE.FrontSide = 0, THREE.BackSide = 1, THREE.DoubleSide = 2, THREE.NoShading = 0, THREE.FlatShading = 1, THREE.SmoothShading = 2, THREE.NoColors = 0, THREE.FaceColors = 1, THREE.VertexColors = 2, THREE.NoBlending = 0, THREE.NormalBlending = 1, THREE.AdditiveBlending = 2, THREE.SubtractiveBlending = 3, THREE.MultiplyBlending = 4, THREE.CustomBlending = 5, THREE.AddEquation = 100, THREE.SubtractEquation = 101, THREE.ReverseSubtractEquation = 102, THREE.MinEquation = 103, THREE.MaxEquation = 104, THREE.ZeroFactor = 200, THREE.OneFactor = 201, THREE.SrcColorFactor = 202, THREE.OneMinusSrcColorFactor = 203, THREE.SrcAlphaFactor = 204, THREE.OneMinusSrcAlphaFactor = 205, THREE.DstAlphaFactor = 206, THREE.OneMinusDstAlphaFactor = 207, THREE.DstColorFactor = 208, THREE.OneMinusDstColorFactor = 209, THREE.SrcAlphaSaturateFactor = 210, THREE.MultiplyOperation = 0, THREE.MixOperation = 1, THREE.AddOperation = 2, THREE.UVMapping = 300, THREE.CubeReflectionMapping = 301, THREE.CubeRefractionMapping = 302, THREE.EquirectangularReflectionMapping = 303, THREE.EquirectangularRefractionMapping = 304, THREE.SphericalReflectionMapping = 305, THREE.RepeatWrapping = 1e3, THREE.ClampToEdgeWrapping = 1001, THREE.MirroredRepeatWrapping = 1002, THREE.NearestFilter = 1003, THREE.NearestMipMapNearestFilter = 1004, THREE.NearestMipMapLinearFilter = 1005, THREE.LinearFilter = 1006, THREE.LinearMipMapNearestFilter = 1007, THREE.LinearMipMapLinearFilter = 1008, THREE.UnsignedByteType = 1009, THREE.ByteType = 1010, THREE.ShortType = 1011, THREE.UnsignedShortType = 1012, THREE.IntType = 1013, THREE.UnsignedIntType = 1014, THREE.FloatType = 1015, THREE.HalfFloatType = 1025, THREE.UnsignedShort4444Type = 1016, THREE.UnsignedShort5551Type = 1017, THREE.UnsignedShort565Type = 1018, THREE.AlphaFormat = 1019, THREE.RGBFormat = 1020, THREE.RGBAFormat = 1021, THREE.LuminanceFormat = 1022, THREE.LuminanceAlphaFormat = 1023, THREE.RGBEFormat = THREE.RGBAFormat, THREE.RGB_S3TC_DXT1_Format = 2001, THREE.RGBA_S3TC_DXT1_Format = 2002, THREE.RGBA_S3TC_DXT3_Format = 2003, THREE.RGBA_S3TC_DXT5_Format = 2004, THREE.RGB_PVRTC_4BPPV1_Format = 2100, THREE.RGB_PVRTC_2BPPV1_Format = 2101, THREE.RGBA_PVRTC_4BPPV1_Format = 2102, THREE.RGBA_PVRTC_2BPPV1_Format = 2103, THREE.Projector = function() {
THREE.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."), this.projectVector = function(e, t) {
THREE.warn("THREE.Projector: .projectVector() is now vector.project()."), e.project(t)
}, this.unprojectVector = function(e, t) {
THREE.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."), e.unproject(t)
}, this.pickingRay = function(e, t) {
THREE.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
}
}, THREE.CanvasRenderer = function() {
THREE.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"), this.domElement = document.createElement("canvas"), this.clear = function() {}, this.render = function() {}, this.setClearColor = function() {}, this.setSize = function() {}
};
var empties = ["ImmediateRenderObject", "LineBasicMaterial", "LineDashedMaterial", "MeshLambertMaterial", "MeshPhongMaterial", "MeshDepthMaterial", "MeshNormalMaterial", "MeshFaceMaterial", "PointCloudMaterial", "ShaderMaterial", "RawShaderMaterial", "SpriteMaterial", "CompressedTexture", "DataTexture", "Fog", "FogExp2", "WebGLRenderTargetCube", "Bone", "Skeleton", "SkinnedMesh", "MorphAnimMesh", "LOD", "Sprite", "LensFlare", "Light", "AmbientLight", "AreaLight", "DirectionalLight", "HemisphereLight", "PointLight", "SpotLight", "LensFlarePlugin", "ShadowMapPlugin", "BinaryTextureLoader", "CompressedTextureLoader", "PointCloud", "SpritePlugin", "CubeCamera", "MeshBasicMaterial"];
for (var e = 0; e < empties.length; e++) THREE[empties[e]] = function() {};
THREE.Color = function(e) {
return arguments.length === 3 ? this.setRGB(arguments[0], arguments[1], arguments[2]) : this.set(e)
}, THREE.Color.prototype = {
constructor: THREE.Color,
r: 1,
g: 1,
b: 1,
set: function(e) {
return e instanceof THREE.Color ? this.copy(e) : typeof e == "number" ? this.setHex(e) : typeof e == "string" && this.setStyle(e), this
},
setHex: function(e) {
return e = Math.floor(e), this.r = (e >> 16 & 255) / 255, this.g = (e >> 8 & 255) / 255, this.b = (e & 255) / 255, this
},
setRGB: function(e, t, n) {
return this.r = e, this.g = t, this.b = n, this
},
setHSL: function(e, t, n) {
if (t === 0) this.r = this.g = this.b = n;
else {
var r = function(e, t, n) {
return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * 6 * n : n < .5 ? t : n < 2 / 3 ? e + (t - e) * 6 * (2 / 3 - n) : e
},
i = n <= .5 ? n * (1 + t) : n + t - n * t,
s = 2 * n - i;
this.r = r(s, i, e + 1 / 3), this.g = r(s, i, e), this.b = r(s, i, e - 1 / 3)
}
return this
},
setStyle: function(e) {
if (/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.test(e)) {
var t = /^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.exec(e);
return this.r = Math.min(255, parseInt(t[1], 10)) / 255, this.g = Math.min(255, parseInt(t[2], 10)) / 255, this.b = Math.min(255, parseInt(t[3], 10)) / 255, this
}
if (/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.test(e)) {
var t = /^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.exec(e);
return this.r = Math.min(100, parseInt(t[1], 10)) / 100, this.g = Math.min(100, parseInt(t[2], 10)) / 100, this.b = Math.min(100, parseInt(t[3], 10)) / 100, this
}
if (/^\#([0-9a-f]{6})$/i.test(e)) {
var t = /^\#([0-9a-f]{6})$/i.exec(e);
return this.setHex(parseInt(t[1], 16)), this
}
if (/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.test(e)) {
var t = /^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(e);
return this.setHex(parseInt(t[1] + t[1] + t[2] + t[2] + t[3] + t[3], 16)), this
}
if (/^(\w+)$/i.test(e)) return this.setHex(THREE.ColorKeywords[e]), this
},
copy: function(e) {
return this.r = e.r, this.g = e.g, this.b = e.b, this
},
copyGammaToLinear: function(e, t) {
return t === undefined && (t = 2), this.r = Math.pow(e.r, t), this.g = Math.pow(e.g, t), this.b = Math.pow(e.b, t), this
},
copyLinearToGamma: function(e, t) {
t === undefined && (t = 2);
var n = t > 0 ? 1 / t : 1;
return this.r = Math.pow(e.r, n), this.g = Math.pow(e.g, n), this.b = Math.pow(e.b, n), this
},
convertGammaToLinear: function() {
var e = this.r,
t = this.g,
n = this.b;
return this.r = e * e, this.g = t * t, this.b = n * n, this
},
convertLinearToGamma: function() {
return this.r = Math.sqrt(this.r), this.g = Math.sqrt(this.g), this.b = Math.sqrt(this.b), this
},
getHex: function() {
return this.r * 255 << 16 ^ this.g * 255 << 8 ^ this.b * 255 << 0
},
getHexString: function() {
return ("000000" + this.getHex().toString(16)).slice(-6)
},
getHSL: function(e) {
var t = e || {
h: 0,
s: 0,
l: 0
},
n = this.r,
r = this.g,
i = this.b,
s = Math.max(n, r, i),
o = Math.min(n, r, i),
u, a, f = (o + s) / 2;
if (o === s) u = 0, a = 0;
else {
var l = s - o;
a = f <= .5 ? l / (s + o) : l / (2 - s - o);
switch (s) {
case n:
u = (r - i) / l + (r < i ? 6 : 0);
break;
case r:
u = (i - n) / l + 2;
break;
case i:
u = (n - r) / l + 4
}
u /= 6
}
return t.h = u, t.s = a, t.l = f, t
},
getStyle: function() {
return "rgb(" + (this.r * 255 | 0) + "," + (this.g * 255 | 0) + "," + (this.b * 255 | 0) + ")"
},
offsetHSL: function(e, t, n) {
var r = this.getHSL();
return r.h += e, r.s += t, r.l += n, this.setHSL(r.h, r.s, r.l), this
},
add: function(e) {
return this.r += e.r, this.g += e.g, this.b += e.b, this
},
addColors: function(e, t) {
return this.r = e.r + t.r, this.g = e.g + t.g, this.b = e.b + t.b, this
},
addScalar: function(e) {
return this.r += e, this.g += e, this.b += e, this
},
multiply: function(e) {
return this.r *= e.r, this.g *= e.g, this.b *= e.b, this
},
multiplyScalar: function(e) {
return this.r *= e, this.g *= e, this.b *= e, this
},
lerp: function(e, t) {
return this.r += (e.r - this.r) * t, this.g += (e.g - this.g) * t, this.b += (e.b - this.b) * t, this
},
equals: function(e) {
return e.r === this.r && e.g === this.g && e.b === this.b
},
fromArray: function(e) {
return this.r = e[0], this.g = e[1], this.b = e[2], this
},
toArray: function(e, t) {
return e === undefined && (e = []), t === undefined && (t = 0), e[t] = this.r, e[t + 1] = this.g, e[t + 2] = this.b, e
},
clone: function() {
return (new THREE.Color).setRGB(this.r, this.g, this.b)
}
}, THREE.ColorKeywords = {
aliceblue: 15792383,
antiquewhite: 16444375,
aqua: 65535,
aquamarine: 8388564,
azure: 15794175,
beige: 16119260,
bisque: 16770244,
black: 0,
blanchedalmond: 16772045,
blue: 255,
blueviolet: 9055202,
brown: 10824234,
burlywood: 14596231,
cadetblue: 6266528,
chartreuse: 8388352,
chocolate: 13789470,
coral: 16744272,
cornflowerblue: 6591981,
cornsilk: 16775388,
crimson: 14423100,
cyan: 65535,
darkblue: 139,
darkcyan: 35723,
darkgoldenrod: 12092939,
darkgray: 11119017,
darkgreen: 25600,
darkgrey: 11119017,
darkkhaki: 12433259,
darkmagenta: 9109643,
darkolivegreen: 5597999,
darkorange: 16747520,
darkorchid: 10040012,
darkred: 9109504,
darksalmon: 15308410,
darkseagreen: 9419919,
darkslateblue: 4734347,
darkslategray: 3100495,
darkslategrey: 3100495,
darkturquoise: 52945,
darkviolet: 9699539,
deeppink: 16716947,
deepskyblue: 49151,
dimgray: 6908265,
dimgrey: 6908265,
dodgerblue: 2003199,
firebrick: 11674146,
floralwhite: 16775920,
forestgreen: 2263842,
fuchsia: 16711935,
gainsboro: 14474460,
ghostwhite: 16316671,
gold: 16766720,
goldenrod: 14329120,
gray: 8421504,
green: 32768,
greenyellow: 11403055,
grey: 8421504,
honeydew: 15794160,
hotpink: 16738740,
indianred: 13458524,
indigo: 4915330,
ivory: 16777200,
khaki: 15787660,
lavender: 15132410,
lavenderblush: 16773365,
lawngreen: 8190976,
lemonchiffon: 16775885,
lightblue: 11393254,
lightcoral: 15761536,
lightcyan: 14745599,
lightgoldenrodyellow: 16448210,
lightgray: 13882323,
lightgreen: 9498256,
lightgrey: 13882323,
lightpink: 16758465,
lightsalmon: 16752762,
lightseagreen: 2142890,
lightskyblue: 8900346,
lightslategray: 7833753,
lightslategrey: 7833753,
lightsteelblue: 11584734,
lightyellow: 16777184,
lime: 65280,
limegreen: 3329330,
linen: 16445670,
magenta: 16711935,
maroon: 8388608,
mediumaquamarine: 6737322,
mediumblue: 205,
mediumorchid: 12211667,
mediumpurple: 9662683,
mediumseagreen: 3978097,
mediumslateblue: 8087790,
mediumspringgreen: 64154,
mediumturquoise: 4772300,
mediumvioletred: 13047173,
midnightblue: 1644912,
mintcream: 16121850,
mistyrose: 16770273,
moccasin: 16770229,
navajowhite: 16768685,
navy: 128,
oldlace: 16643558,
olive: 8421376,
olivedrab: 7048739,
orange: 16753920,
orangered: 16729344,
orchid: 14315734,
palegoldenrod: 15657130,
palegreen: 10025880,
paleturquoise: 11529966,
palevioletred: 14381203,
papayawhip: 16773077,
peachpuff: 16767673,
peru: 13468991,
pink: 16761035,
plum: 14524637,
powderblue: 11591910,
purple: 8388736,
red: 16711680,
rosybrown: 12357519,
royalblue: 4286945,
saddlebrown: 9127187,
salmon: 16416882,
sandybrown: 16032864,
seagreen: 3050327,
seashell: 16774638,
sienna: 10506797,
silver: 12632256,
skyblue: 8900331,
slateblue: 6970061,
slategray: 7372944,
slategrey: 7372944,
snow: 16775930,
springgreen: 65407,
steelblue: 4620980,
tan: 13808780,
teal: 32896,
thistle: 14204888,
tomato: 16737095,
turquoise: 4251856,
violet: 15631086,
wheat: 16113331,
white: 16777215,
whitesmoke: 16119285,
yellow: 16776960,
yellowgreen: 10145074
}, THREE.Quaternion = function(e, t, n, r) {
this._x = e || 0, this._y = t || 0, this._z = n || 0, this._w = r !== undefined ? r : 1
}, THREE.Quaternion.prototype = {
constructor: THREE.Quaternion,
_x: 0,
_y: 0,
_z: 0,
_w: 0,
get x() {
return this._x
},
set x(e) {
this._x = e, this.onChangeCallback()
},
get y() {
return this._y
},
set y(e) {
this._y = e, this.onChangeCallback()
},
get z() {
return this._z
},
set z(e) {
this._z = e, this.onChangeCallback()
},
get w() {
return this._w
},
set w(e) {
this._w = e, this.onChangeCallback()
},
set: function(e, t, n, r) {
return this._x = e, this._y = t, this._z = n, this._w = r, this.onChangeCallback(), this
},
copy: function(e) {
return this._x = e.x, this._y = e.y, this._z = e.z, this._w = e.w, this.onChangeCallback(), this
},
setFromEuler: function(e, t) {
if (e instanceof THREE.Euler == 0) throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
var n = Math.cos(e._x / 2),
r = Math.cos(e._y / 2),
i = Math.cos(e._z / 2),
s = Math.sin(e._x / 2),
o = Math.sin(e._y / 2),
u = Math.sin(e._z / 2);
return e.order === "XYZ" ? (this._x = s * r * i + n * o * u, this._y = n * o * i - s * r * u, this._z = n * r * u + s * o * i, this._w = n * r * i - s * o * u) : e.order === "YXZ" ? (this._x = s * r * i + n * o * u, this._y = n * o * i - s * r * u, this._z = n * r * u - s * o * i, this._w = n * r * i + s * o * u) : e.order === "ZXY" ? (this._x = s * r * i - n * o * u, this._y = n * o * i + s * r * u, this._z = n * r * u + s * o * i, this._w = n * r * i - s * o * u) : e.order === "ZYX" ? (this._x = s * r * i - n * o * u, this._y = n * o * i + s * r * u, this._z = n * r * u - s * o * i, this._w = n * r * i + s * o * u) : e.order === "YZX" ? (this._x = s * r * i + n * o * u, this._y = n * o * i + s * r * u, this._z = n * r * u - s * o * i, this._w = n * r * i - s * o * u) : e.order === "XZY" && (this._x = s * r * i - n * o * u, this._y = n * o * i - s * r * u, this._z = n * r * u + s * o * i, this._w = n * r * i + s * o * u), t !== !1 && this.onChangeCallback(), this
},
setFromAxisAngle: function(e, t) {
var n = t / 2,
r = Math.sin(n);
return this._x = e.x * r, this._y = e.y * r, this._z = e.z * r, this._w = Math.cos(n), this.onChangeCallback(), this
},
setFromRotationMatrix: function(e) {
var t = e.elements,
n = t[0],
r = t[4],
i = t[8],
s = t[1],
o = t[5],
u = t[9],
a = t[2],
f = t[6],
l = t[10],
c = n + o + l,
h;
return c > 0 ? (h = .5 / Math.sqrt(c + 1), this._w = .25 / h, this._x = (f - u) * h, this._y = (i - a) * h, this._z = (s - r) * h) : n > o && n > l ? (h = 2 * Math.sqrt(1 + n - o - l), this._w = (f - u) / h, this._x = .25 * h, this._y = (r + s) / h, this._z = (i + a) / h) : o > l ? (h = 2 * Math.sqrt(1 + o - n - l), this._w = (i - a) / h, this._x = (r + s) / h, this._y = .25 * h, this._z = (u + f) / h) : (h = 2 * Math.sqrt(1 + l - n - o), this._w = (s - r) / h, this._x = (i + a) / h, this._y = (u + f) / h, this._z = .25 * h), this.onChangeCallback(), this
},
setFromUnitVectors: function() {
var e, t, n = 1e-6;
return function(i, s) {
return e === undefined && (e = new THREE.Vector3), t = i.dot(s) + 1, t < n ? (t = 0, Math.abs(i.x) > Math.abs(i.z) ? e.set(-i.y, i.x, 0) : e.set(0, -i.z, i.y)) : e.crossVectors(i, s), this._x = e.x, this._y = e.y, this._z = e.z, this._w = t, this.normalize(), this
}
}(),
inverse: function() {
return this.conjugate().normalize(), this
},
conjugate: function() {
return this._x *= -1, this._y *= -1, this._z *= -1, this.onChangeCallback(), this
},
dot: function(e) {
return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
},
lengthSq: function() {
return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
},
length: function() {
return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
},
normalize: function() {
var e = this.length();
return e === 0 ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (e = 1 / e, this._x = this._x * e, this._y = this._y * e, this._z = this._z * e, this._w = this._w * e), this.onChangeCallback(), this
},
multiply: function(e, t) {
return t !== undefined ? (THREE.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."), this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
},
multiplyQuaternions: function(e, t) {
var n = e._x,
r = e._y,
i = e._z,
s = e._w,
o = t._x,
u = t._y,
a = t._z,
f = t._w;
return this._x = n * f + s * o + r * a - i * u, this._y = r * f + s * u + i * o - n * a, this._z = i * f + s * a + n * u - r * o, this._w = s * f - n * o - r * u - i * a, this.onChangeCallback(), this
},
multiplyVector3: function(e) {
return THREE.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."), e.applyQuaternion(this)
},
slerp: function(e, t) {
if (t === 0) return this;
if (t === 1) return this.copy(e);
var n = this._x,
r = this._y,
i = this._z,
s = this._w,
o = s * e._w + n * e._x + r * e._y + i * e._z;
o < 0 ? (this._w = -e._w, this._x = -e._x, this._y = -e._y, this._z = -e._z, o = -o) : this.copy(e);
if (o >= 1) return this._w = s, this._x = n, this._y = r, this._z = i, this;
var u = Math.acos(o),
a = Math.sqrt(1 - o * o);
if (Math.abs(a) < .001) return this._w = .5 * (s + this._w), this._x = .5 * (n + this._x), this._y = .5 * (r + this._y), this._z = .5 * (i + this._z), this;
var f = Math.sin((1 - t) * u) / a,
l = Math.sin(t * u) / a;
return this._w = s * f + this._w * l, this._x = n * f + this._x * l, this._y = r * f + this._y * l, this._z = i * f + this._z * l, this.onChangeCallback(), this
},
equals: function(e) {
return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
},
fromArray: function(e, t) {
return t === undefined && (t = 0), this._x = e[t], this._y = e[t + 1], this._z = e[t + 2], this._w = e[t + 3], this.onChangeCallback(), this
},
toArray: function(e, t) {
return e === undefined && (e = []), t === undefined && (t = 0), e[t] = this._x, e[t + 1] = this._y, e[t + 2] = this._z, e[t + 3] = this._w, e
},
onChange: function(e) {
return this.onChangeCallback = e, this
},
onChangeCallback: function() {},
clone: function() {
return new THREE.Quaternion(this._x, this._y, this._z, this._w)
}
}, THREE.Quaternion.slerp = function(e, t, n, r) {
return n.copy(e).slerp(t, r)
}, THREE.Vector2 = function(e, t) {
this.x = e || 0, this.y = t || 0
}, THREE.Vector2.prototype = {
constructor: THREE.Vector2,
set: function(e, t) {
return this.x = e, this.y = t, this
},
setX: function(e) {
return this.x = e, this
},
setY: function(e) {
return this.y = e, this
},
setComponent: function(e, t) {
switch (e) {
case 0:
this.x = t;
break;
case 1:
this.y = t;
break;
default:
throw new Error("index is out of range: " + e)
}
},
getComponent: function(e) {
switch (e) {
case 0:
return this.x;
case 1:
return this.y;
default:
throw new Error("index is out of range: " + e)
}
},
copy: function(e) {
return this.x = e.x, this.y = e.y, this
},
add: function(e, t) {
return t !== undefined ? (THREE.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t)) : (this.x += e.x, this.y += e.y, this)
},
addScalar: function(e) {
return this.x += e, this.y += e, this
},
addVectors: function(e, t) {
return this.x = e.x + t.x, this.y = e.y + t.y, this
},
sub: function(e, t) {
return t !== undefined ? (THREE.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t)) : (this.x -= e.x, this.y -= e.y, this)
},
subScalar: function(e) {
return this.x -= e, this.y -= e, this
},
subVectors: function(e, t) {
return this.x = e.x - t.x, this.y = e.y - t.y, this
},
multiply: function(e) {
return this.x *= e.x, this.y *= e.y, this
},
multiplyScalar: function(e) {
return this.x *= e, this.y *= e, this
},
divide: function(e) {
return this.x /= e.x, this.y /= e.y, this
},
divideScalar: function(e) {
if (e !== 0) {
var t = 1 / e;
this.x *= t, this.y *= t
} else this.x = 0, this.y = 0;
return this
},
min: function(e) {
return this.x > e.x && (this.x = e.x), this.y > e.y && (this.y = e.y), this
},
max: function(e) {
return this.x < e.x && (this.x = e.x), this.y < e.y && (this.y = e.y), this
},
clamp: function(e, t) {
return this.x < e.x ? this.x = e.x : this.x > t.x && (this.x = t.x), this.y < e.y ? this.y = e.y : this.y > t.y && (this.y = t.y), this
},
clampScalar: function() {
var e, t;
return function(n, r) {
return e === undefined && (e = new THREE.Vector2, t = new THREE.Vector2), e.set(n, n), t.set(r, r), this.clamp(e, t)
}
}(),
floor: function() {
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this
},
ceil: function() {
return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this
},
round: function() {
return this.x = Math.round(this.x), this.y = Math.round(this.y), this
},
roundToZero: function() {
return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y), this
},
negate: function() {
return this.x = -this.x, this.y = -this.y, this
},
dot: function(e) {
return this.x * e.x + this.y * e.y
},
lengthSq: function() {
return this.x * this.x + this.y * this.y
},
length: function() {
return Math.sqrt(this.x * this.x + this.y * this.y)
},
normalize: function() {
return this.divideScalar(this.length())
},
distanceTo: function(e) {
return Math.sqrt(this.distanceToSquared(e))
},
distanceToSquared: function(e) {
var t = this.x - e.x,
n = this.y - e.y;
return t * t + n * n
},
setLength: function(e) {
var t = this.length();
return t !== 0 && e !== t && this.multiplyScalar(e / t), this
},
lerp: function(e, t) {
return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this
},
lerpVectors: function(e, t, n) {
return this.subVectors(t, e).multiplyScalar(n).add(e), this
},
equals: function(e) {
return e.x === this.x && e.y === this.y
},
fromArray: function(e, t) {
return t === undefined && (t = 0), this.x = e[t], this.y = e[t + 1], this
},
toArray: function(e, t) {
return e === undefined && (e = []), t === undefined && (t = 0), e[t] = this.x, e[t + 1] = this.y, e
},
fromAttribute: function(e, t, n) {
return n === undefined && (n = 0), t = t * e.itemSize + n, this.x = e.array[t], this.y = e.array[t + 1], this
},
clone: function() {
return new THREE.Vector2(this.x, this.y)
}
}, THREE.Vector3 = function(e, t, n) {
this.x = e || 0, this.y = t || 0, this.z = n || 0
}, THREE.Vector3.prototype = {
constructor: THREE.Vector3,
set: function(e, t, n) {
return this.x = e, this.y = t, this.z = n, this
},
setX: function(e) {
return this.x = e, this
},
setY: function(e) {
return this.y = e, this
},
setZ: function(e) {
return this.z = e, this
},
setComponent: function(e, t) {
switch (e) {
case 0:
this.x = t;
break;
case 1:
this.y = t;
break;
case 2:
this.z = t;
break;
default:
throw new Error("index is out of range: " + e)
}
},
getComponent: function(e) {
switch (e) {
case 0:
return this.x;
case 1:
return this.y;
case 2:
return this.z;
default:
throw new Error("index is out of range: " + e)
}
},
copy: function(e) {
return this.x = e.x, this.y = e.y, this.z = e.z, this
},
add: function(e, t) {
return t !== undefined ? (THREE.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t)) : (this.x += e.x, this.y += e.y, this.z += e.z, this)
},
addScalar: function(e) {
return this.x += e, this.y += e, this.z += e, this
},
addVectors: function(e, t) {
return this.x = e.x + t.x, this.y = e.y + t.y, this.z = e.z + t.z, this
},
sub: function(e, t) {
return t !== undefined ? (THREE.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t)) : (this.x -= e.x, this.y -= e.y, this.z -= e.z, this)
},
subScalar: function(e) {
return this.x -= e, this.y -= e, this.z -= e, this
},
subVectors: function(e, t) {
return this.x = e.x - t.x, this.y = e.y - t.y, this.z = e.z - t.z, this
},
multiply: function(e, t) {
return t !== undefined ? (THREE.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."), this.multiplyVectors(e, t)) : (this.x *= e.x, this.y *= e.y, this.z *= e.z, this)
},
multiplyScalar: function(e) {
return this.x *= e, this.y *= e, this.z *= e, this
},
multiplyVectors: function(e, t) {
return this.x = e.x * t.x, this.y = e.y * t.y, this.z = e.z * t.z, this
},
applyEuler: function() {
var e;
return function(t) {
return t instanceof THREE.Euler == 0 && THREE.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order."), e === undefined && (e = new THREE.Quaternion), this.applyQuaternion(e.setFromEuler(t)), this
}
}(),
applyAxisAngle: function() {
var e;
return function(t, n) {
return e === undefined && (e = new THREE.Quaternion), this.applyQuaternion(e.setFromAxisAngle(t, n)), this
}
}(),
applyMatrix3: function(e) {
var t = this.x,
n = this.y,
r = this.z,
i = e.elements;
return this.x = i[0] * t + i[3] * n + i[6] * r, this.y = i[1] * t + i[4] * n + i[7] * r, this.z = i[2] * t + i[5] * n + i[8] * r, this
},
applyMatrix4: function(e) {
var t = this.x,
n = this.y,
r = this.z,
i = e.elements;
return this.x = i[0] * t + i[4] * n + i[8] * r + i[12], this.y = i[1] * t + i[5] * n + i[9] * r + i[13], this.z = i[2] * t + i[6] * n + i[10] * r + i[14], this
},
applyProjection: function(e) {
var t = this.x,
n = this.y,
r = this.z,
i = e.elements,
s = 1 / (i[3] * t + i[7] * n + i[11] * r + i[15]);
return this.x = (i[0] * t + i[4] * n + i[8] * r + i[12]) * s, this.y = (i[1] * t + i[5] * n + i[9] * r + i[13]) * s, this.z = (i[2] * t + i[6] * n + i[10] * r + i[14]) * s, this
},
applyQuaternion: function(e) {
var t = this.x,
n = this.y,
r = this.z,
i = e.x,
s = e.y,
o = e.z,
u = e.w,
a = u * t + s * r - o * n,
f = u * n + o * t - i * r,
l = u * r + i * n - s * t,
c = -i * t - s * n - o * r;
return this.x = a * u + c * -i + f * -o - l * -s, this.y = f * u + c * -s + l * -i - a * -o, this.z = l * u + c * -o + a * -s - f * -i, this
},
project: function() {
var e;
return function(t) {
return e === undefined && (e = new THREE.Matrix4), e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)), this.applyProjection(e)
}
}(),
unproject: function() {
var e;
return function(t) {
return e === undefined && (e = new THREE.Matrix4), e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)), this.applyProjection(e)
}
}(),
transformDirection: function(e) {
var t = this.x,
n = this.y,
r = this.z,
i = e.elements;
return this.x = i[0] * t + i[4] * n + i[8] * r, this.y = i[1] * t + i[5] * n + i[9] * r, this.z = i[2] * t + i[6] * n + i[10] * r, this.normalize(), this
},
divide: function(e) {
return this.x /= e.x, this.y /= e.y, this.z /= e.z, this
},
divideScalar: function(e) {
if (e !== 0) {
var t = 1 / e;
this.x *= t, this.y *= t, this.z *= t
} else this.x = 0, this.y = 0, this.z = 0;
return this
},
min: function(e) {
return this.x > e.x && (this.x = e.x), this.y > e.y && (this.y = e.y), this.z > e.z && (this.z = e.z), this
},
max: function(e) {
return this.x < e.x && (this.x = e.x), this.y < e.y && (this.y = e.y), this.z < e.z && (this.z = e.z), this
},
clamp: function(e, t) {
return this.x < e.x ? this.x = e.x : this.x > t.x && (this.x = t.x), this.y < e.y ? this.y = e.y : this.y > t.y && (this.y = t.y), this.z < e.z ? this.z = e.z : this.z > t.z && (this.z = t.z), this
},
clampScalar: function() {
var e, t;
return function(n, r) {
return e === undefined && (e = new THREE.Vector3, t = new THREE.Vector3), e.set(n, n, n), t.set(r, r, r), this.clamp(e, t)
}
}(),
floor: function() {
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this
},
ceil: function() {
return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this
},
round: function() {
return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this
},
roundToZero: function() {
return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y), this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z), this
},
negate: function() {
return this.x = -this.x, this.y = -this.y, this.z = -this.z, this
},
dot: function(e) {
return this.x * e.x + this.y * e.y + this.z * e.z
},
lengthSq: function() {
return this.x * this.x + this.y * this.y + this.z * this.z
},
length: function() {
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
},
lengthManhattan: function() {
return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
},
normalize: function() {
return this.divideScalar(this.length())
},
setLength: function(e) {
var t = this.length();
return t !== 0 && e !== t && this.multiplyScalar(e / t), this
},
lerp: function(e, t) {
return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this.z += (e.z - this.z) * t, this
},
lerpVectors: function(e, t, n) {
return this.subVectors(t, e).multiplyScalar(n).add(e), this
},
cross: function(e, t) {
if (t !== undefined) return THREE.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."), this.crossVectors(e, t);
var n = this.x,
r = this.y,
i = this.z;
return this.x = r * e.z - i * e.y, this.y = i * e.x - n * e.z, this.z = n * e.y - r * e.x, this
},
crossVectors: function(e, t) {
var n = e.x,
r = e.y,
i = e.z,
s = t.x,
o = t.y,
u = t.z;
return this.x = r * u - i * o, this.y = i * s - n * u, this.z = n * o - r * s, this
},
projectOnVector: function() {
var e, t;
return function(n) {
return e === undefined && (e = new THREE.Vector3), e.copy(n).normalize(), t = this.dot(e), this.copy(e).multiplyScalar(t)
}
}(),
projectOnPlane: function() {
var e;
return function(t) {
return e === undefined && (e = new THREE.Vector3), e.copy(this).projectOnVector(t), this.sub(e)
}
}(),
reflect: function() {
var e;
return function(t) {
return e === undefined && (e = new THREE.Vector3), this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
}
}(),
angleTo: function(e) {
var t = this.dot(e) / (this.length() * e.length());
return Math.acos(THREE.Math.clamp(t, -1, 1))
},
distanceTo: function(e) {
return Math.sqrt(this.distanceToSquared(e))
},
distanceToSquared: function(e) {
var t = this.x - e.x,
n = this.y - e.y,
r = this.z - e.z;
return t * t + n * n + r * r
},
setEulerFromRotationMatrix: function(e, t) {
THREE.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
},
setEulerFromQuaternion: function(e, t) {
THREE.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
},
getPositionFromMatrix: function(e) {
return THREE.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."), this.setFromMatrixPosition(e)
},
getScaleFromMatrix: function(e) {
return THREE.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."), this.setFromMatrixScale(e)
},
getColumnFromMatrix: function(e, t) {
return THREE.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."), this.setFromMatrixColumn(e, t)
},
setFromMatrixPosition: function(e) {
return this.x = e.elements[12], this.y = e.elements[13], this.z = e.elements[14], this
},
setFromMatrixScale: function(e) {
var t = this.set(e.elements[0], e.elements[1], e.elements[2]).length(),
n = this.set(e.elements[4], e.elements[5], e.elements[6]).length(),
r = this.set(e.elements[8], e.elements[9], e.elements[10]).length();
return this.x = t, this.y = n, this.z = r, this
},
setFromMatrixColumn: function(e, t) {
var n = e * 4,
r = t.elements;
return this.x = r[n], this.y = r[n + 1], this.z = r[n + 2], this
},
equals: function(e) {
return e.x === this.x && e.y === this.y && e.z === this.z
},
fromArray: function(e, t) {
return t === undefined && (t = 0), this.x = e[t], this.y = e[t + 1], this.z = e[t + 2], this
},
toArray: function(e, t) {
return e === undefined && (e = []), t === undefined && (t = 0), e[t] = this.x, e[t + 1] = this.y, e[t + 2] = this.z, e
},
fromAttribute: function(e, t, n) {
return n === undefined && (n = 0), t = t * e.itemSize + n, this.x = e.array[t], this.y = e.array[t + 1], this.z = e.array[t + 2], this
},
clone: function() {
return new THREE.Vector3(this.x, this.y, this.z)
}
}, THREE.Vector4 = function(e, t, n, r) {
this.x = e || 0, this.y = t || 0, this.z = n || 0, this.w = r !== undefined ? r : 1
}, THREE.Vector4.prototype = {
constructor: THREE.Vector4,
set: function(e, t, n, r) {
return this.x = e, this.y = t, this.z = n, this.w = r, this
},
setX: function(e) {
return this.x = e, this
},
setY: function(e) {
return this.y = e, this
},
setZ: function(e) {
return this.z = e, this
},
setW: function(e) {
return this.w = e, this
},
setComponent: function(e, t) {
switch (e) {
case 0:
this.x = t;
break;
case 1:
this.y = t;
break;
case 2:
this.z = t;
break;
case 3:
this.w = t;
break;
default:
throw new Error("index is out of range: " + e)
}
},
getComponent: function(e) {
switch (e) {
case 0:
return this.x;
case 1:
return this.y;
case 2:
return this.z;
case 3:
return this.w;
default:
throw new Error("index is out of range: " + e)
}
},
copy: function(e) {
return this.x = e.x, this.y = e.y, this.z = e.z, this.w = e.w !== undefined ? e.w : 1, this
},
add: function(e, t) {
return t !== undefined ? (THREE.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t)) : (this.x += e.x, this.y += e.y, this.z += e.z, this.w += e.w, this)
},
addScalar: function(e) {
return this.x += e, this.y += e, this.z += e, this.w += e, this
},
addVectors: function(e, t) {
return this.x = e.x + t.x, this.y = e.y + t.y, this.z = e.z + t.z, this.w = e.w + t.w, this
},
sub: function(e, t) {
return t !== undefined ? (THREE.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t)) : (this.x -= e.x, this.y -= e.y, this.z -= e.z, this.w -= e.w, this)
},
subScalar: function(e) {
return this.x -= e, this.y -= e, this.z -= e, this.w -= e, this
},
subVectors: function(e, t) {
return this.x = e.x - t.x, this.y = e.y - t.y, this.z = e.z - t.z, this.w = e.w - t.w, this
},
multiplyScalar: function(e) {
return this.x *= e, this.y *= e, this.z *= e, this.w *= e, this
},
applyMatrix4: function(e) {
var t = this.x,
n = this.y,
r = this.z,
i = this.w,
s = e.elements;
return this.x = s[0] * t + s[4] * n + s[8] * r + s[12] * i, this.y = s[1] * t + s[5] * n + s[9] * r + s[13] * i, this.z = s[2] * t + s[6] * n + s[10] * r + s[14] * i, this.w = s[3] * t + s[7] * n + s[11] * r + s[15] * i, this
},
divideScalar: function(e) {
if (e !== 0) {
var t = 1 / e;
this.x *= t, this.y *= t, this.z *= t, this.w *= t
} else this.x = 0, this.y = 0, this.z = 0, this.w = 1;
return this
},
setAxisAngleFromQuaternion: function(e) {
this.w = 2 * Math.acos(e.w);
var t = Math.sqrt(1 - e.w * e.w);
return t < 1e-4 ? (this.x = 1, this.y = 0, this.z = 0) : (this.x = e.x / t, this.y = e.y / t, this.z = e.z / t), this
},
setAxisAngleFromRotationMatrix: function(e) {
var t, n, r, i, s = .01,
o = .1,
u = e.elements,
a = u[0],
f = u[4],
l = u[8],
c = u[1],
h = u[5],
p = u[9],
d = u[2],
v = u[6],
m = u[10];
if (Math.abs(f - c) < s && Math.abs(l - d) < s && Math.abs(p - v) < s) {
if (Math.abs(f + c) < o && Math.abs(l + d) < o && Math.abs(p + v) < o && Math.abs(a + h + m - 3) < o) return this.set(1, 0, 0, 0), this;
t = Math.PI;
var g = (a + 1) / 2,
y = (h + 1) / 2,
b = (m + 1) / 2,
w = (f + c) / 4,
E = (l + d) / 4,
S = (p + v) / 4;
return g > y && g > b ? g < s ? (n = 0, r = .707106781, i = .707106781) : (n = Math.sqrt(g), r = w / n, i = E / n) : y > b ? y < s ? (n = .707106781, r = 0, i = .707106781) : (r = Math.sqrt(y), n = w / r, i = S / r) : b < s ? (n = .707106781, r = .707106781, i = 0) : (i = Math.sqrt(b), n = E / i, r = S / i), this.set(n, r, i, t), this
}
var x = Math.sqrt((v - p) * (v - p) + (l - d) * (l - d) + (c - f) * (c - f));
return Math.abs(x) < .001 && (x = 1), this.x = (v - p) / x, this.y = (l - d) / x, this.z = (c - f) / x, this.w = Math.acos((a + h + m - 1) / 2), this
},
min: function(e) {
return this.x > e.x && (this.x = e.x), this.y > e.y && (this.y = e.y), this.z > e.z && (this.z = e.z), this.w > e.w && (this.w = e.w), this
},
max: function(e) {
return this.x < e.x && (this.x = e.x), this.y < e.y && (this.y = e.y), this.z < e.z && (this.z = e.z), this.w < e.w && (this.w = e.w), this
},
clamp: function(e, t) {
return this.x < e.x ? this.x = e.x : this.x > t.x && (this.x = t.x), this.y < e.y ? this.y = e.y : this.y > t.y && (this.y = t.y), this.z < e.z ? this.z = e.z : this.z > t.z && (this.z = t.z), this.w < e.w ? this.w = e.w : this.w > t.w && (this.w = t.w), this
},
clampScalar: function() {
var e, t;
return function(n, r) {
return e === undefined && (e = new THREE.Vector4, t = new THREE.Vector4), e.set(n, n, n, n), t.set(r, r, r, r), this.clamp(e, t)
}
}(),
floor: function() {
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this.w = Math.floor(this.w), this
},
ceil: function() {
return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this.w = Math.ceil(this.w), this
},
round: function() {
return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this.w = Math.round(this.w), this
},
roundToZero: function() {
return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y), this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z), this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w), this
},
negate: function() {
return this.x = -this.x, this.y = -this.y, this.z = -this.z, this.w = -this.w, this
},
dot: function(e) {
return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
},
lengthSq: function() {
return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
},
length: function() {
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
},
lengthManhattan: function() {
return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
},
normalize: function() {
return this.divideScalar(this.length())
},
setLength: function(e) {
var t = this.length();
return t !== 0 && e !== t && this.multiplyScalar(e / t), this
},
lerp: function(e, t) {
return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this.z += (e.z - this.z) * t, this.w += (e.w - this.w) * t, this
},
lerpVectors: function(e, t, n) {
return this.subVectors(t, e).multiplyScalar(n).add(e), this
},
equals: function(e) {
return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
},
fromArray: function(e, t) {
return t === undefined && (t = 0), this.x = e[t], this.y = e[t + 1], this.z = e[t + 2], this.w = e[t + 3], this
},
toArray: function(e, t) {
return e === undefined && (e = []), t === undefined && (t = 0), e[t] = this.x, e[t + 1] = this.y, e[t + 2] = this.z, e[t + 3] = this.w, e
},
fromAttribute: function(e, t, n) {
return n === undefined && (n = 0), t = t * e.itemSize + n, this.x = e.array[t], this.y = e.array[t + 1], this.z = e.array[t + 2], this.w = e.array[t + 3], this
},
clone: function() {
return new THREE.Vector4(this.x, this.y, this.z, this.w)
}
}, THREE.Euler = function(e, t, n, r) {
this._x = e || 0, this._y = t || 0, this._z = n || 0, this._order = r || THREE.Euler.DefaultOrder
}, THREE.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"], THREE.Euler.DefaultOrder = "XYZ", THREE.Euler.prototype = {
constructor: THREE.Euler,
_x: 0,
_y: 0,
_z: 0,
_order: THREE.Euler.DefaultOrder,
get x() {
return this._x
},
set x(e) {
this._x = e, this.onChangeCallback()
},
get y() {
return this._y
},
set y(e) {
this._y = e, this.onChangeCallback()
},
get z() {
return this._z
},
set z(e) {
this._z = e, this.onChangeCallback()
},
get order() {
return this._order
},
set order(e) {
this._order = e, this.onChangeCallback()
},
set: function(e, t, n, r) {
return this._x = e, this._y = t, this._z = n, this._order = r || this._order, this.onChangeCallback(), this
},
copy: function(e) {
return this._x = e._x, this._y = e._y, this._z = e._z, this._order = e._order, this.onChangeCallback(), this
},
setFromRotationMatrix: function(e, t, n) {
var r = THREE.Math.clamp,
i = e.elements,
s = i[0],
o = i[4],
u = i[8],
a = i[1],
f = i[5],
l = i[9],
c = i[2],
h = i[6],
p = i[10];
return t = t || this._order, t === "XYZ" ? (this._y = Math.asin(r(u, -1, 1)), Math.abs(u) < .99999 ? (this._x = Math.atan2(-l, p), this._z = Math.atan2(-o, s)) : (this._x = Math.atan2(h, f), this._z = 0)) : t === "YXZ" ? (this._x = Math.asin(-r(l, -1, 1)), Math.abs(l) < .99999 ? (this._y = Math.atan2(u, p), this._z = Math.atan2(a, f)) : (this._y = Math.atan2(-c, s), this._z = 0)) : t === "ZXY" ? (this._x = Math.asin(r(h, -1, 1)), Math.abs(h) < .99999 ? (this._y = Math.atan2(-c, p), this._z = Math.atan2(-o, f)) : (this._y = 0, this._z = Math.atan2(a, s))) : t === "ZYX" ? (this._y = Math.asin(-r(c, -1, 1)), Math.abs(c) < .99999 ? (this._x = Math.atan2(h, p), this._z = Math.atan2(a, s)) : (this._x = 0, this._z = Math.atan2(-o, f))) : t === "YZX" ? (this._z = Math.asin(r(a, -1, 1)), Math.abs(a) < .99999 ? (this._x = Math.atan2(-l, f), this._y = Math.atan2(-c, s)) : (this._x = 0, this._y = Math.atan2(u, p))) : t === "XZY" ? (this._z = Math.asin(-r(o, -1, 1)), Math.abs(o) < .99999 ? (this._x = Math.atan2(h, f), this._y = Math.atan2(u, s)) : (this._x = Math.atan2(-l, p), this._y = 0)) : THREE.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t), this._order = t, n !== !1 && this.onChangeCallback(), this
},
setFromQuaternion: function() {
var e;
return function(t, n, r) {
return e === undefined && (e = new THREE.Matrix4), e.makeRotationFromQuaternion(t), this.setFromRotationMatrix(e, n, r), this
}
}(),
setFromVector3: function(e, t) {
return this.set(e.x, e.y, e.z, t || this._order)
},
reorder: function() {
var e = new THREE.Quaternion;
return function(t) {
e.setFromEuler(this), this.setFromQuaternion(e, t)
}
}(),
equals: function(e) {
return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
},
fromArray: function(e) {
return this._x = e[0], this._y = e[1], this._z = e[2], e[3] !== undefined && (this._order = e[3]), this.onChangeCallback(), this
},
toArray: function(e, t) {
return e === undefined && (e = []), t === undefined && (t = 0), e[t] = this._x, e[t + 1] = this._y, e[t + 2] = this._z, e[t + 3] = this._order, e
},
toVector3: function(e) {
return e ? e.set(this._x, this._y, this._z) : new THREE.Vector3(this._x, this._y, this._z)
},
onChange: function(e) {
return this.onChangeCallback = e, this
},
onChangeCallback: function() {},
clone: function() {
return new THREE.Euler(this._x, this._y, this._z, this._order)
}
}, THREE.Line3 = function(e, t) {
this.start = e !== undefined ? e : new THREE.Vector3, this.end = t !== undefined ? t : new THREE.Vector3
}, THREE.Line3.prototype = {
constructor: THREE.Line3,
set: function(e, t) {
return this.start.copy(e), this.end.copy(t), this
},
copy: function(e) {
return this.start.copy(e.start), this.end.copy(e.end), this
},
center: function(e) {
var t = e || new THREE.Vector3;
return t.addVectors(this.start, this.end).multiplyScalar(.5)
},
delta: function(e) {
var t = e || new THREE.Vector3;
return t.subVectors(this.end, this.start)
},
distanceSq: function() {
return this.start.distanceToSquared(this.end)
},
distance: function() {
return this.start.distanceTo(this.end)
},
at: function(e, t) {
var n = t || new THREE.Vector3;
return this.delta(n).multiplyScalar(e).add(this.start)
},
closestPointToPointParameter: function() {
var e = new THREE.Vector3,
t = new THREE.Vector3;
return function(n, r) {
e.subVectors(n, this.start), t.subVectors(this.end, this.start);
var i = t.dot(t),
s = t.dot(e),
o = s / i;
return r && (o = THREE.Math.clamp(o, 0, 1)), o
}
}(),
closestPointToPoint: function(e, t, n) {
var r = this.closestPointToPointParameter(e, t),
i = n || new THREE.Vector3;
return this.delta(i).multiplyScalar(r).add(this.start)
},
applyMatrix4: function(e) {
return this.start.applyMatrix4(e), this.end.applyMatrix4(e), this
},
equals: function(e) {
return e.start.equals(this.start) && e.end.equals(this.end)
},
clone: function() {
return (new THREE.Line3).copy(this)
}
}, THREE.Box2 = function(e, t) {
this.min = e !== undefined ? e : new THREE.Vector2(Infinity, Infinity), this.max = t !== undefined ? t : new THREE.Vector2(-Infinity, -Infinity)
}, THREE.Box2.prototype = {
constructor: THREE.Box2,
set: function(e, t) {
return this.min.copy(e), this.max.copy(t), this
},
setFromPoints: function(e) {
this.makeEmpty();
for (var t = 0, n = e.length; t < n; t++) this.expandByPoint(e[t]);
return this
},
setFromCenterAndSize: function() {
var e = new THREE.Vector2;
return function(t, n) {
var r = e.copy(n).multiplyScalar(.5);
return this.min.copy(t).sub(r), this.max.copy(t).add(r), this
}
}(),
copy: function(e) {
return this.min.copy(e.min), this.max.copy(e.max), this
},
makeEmpty: function() {
return this.min.x = this.min.y = Infinity, this.max.x = this.max.y = -Infinity, this
},
empty: function() {
return this.max.x < this.min.x || this.max.y < this.min.y
},
center: function(e) {
var t = e || new THREE.Vector2;
return t.addVectors(this.min, this.max).multiplyScalar(.5)
},
size: function(e) {
var t = e || new THREE.Vector2;
return t.subVectors(this.max, this.min)
},
expandByPoint: function(e) {
return this.min.min(e), this.max.max(e), this
},
expandByVector: function(e) {
return this.min.sub(e), this.max.add(e), this
},
expandByScalar: function(e) {
return this.min.addScalar(-e), this.max.addScalar(e), this
},
containsPoint: function(e) {
return e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y ? !1 : !0
},
containsBox: function(e) {
return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y ? !0 : !1
},
getParameter: function(e, t) {
var n = t || new THREE.Vector2;
return n.set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y))
},
isIntersectionBox: function(e) {
return e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y ? !1 : !0
},
clampPoint: function(e, t) {
var n = t || new THREE.Vector2;
return n.copy(e).clamp(this.min, this.max)
},
distanceToPoint: function() {
var e = new THREE.Vector2;
return function(t) {
var n = e.copy(t).clamp(this.min, this.max);
return n.sub(t).length()
}
}(),
intersect: function(e) {
return this.min.max(e.min), this.max.min(e.max), this
},
union: function(e) {
return this.min.min(e.min), this.max.max(e.max), this
},
translate: function(e) {
return this.min.add(e), this.max.add(e), this
},
equals: function(e) {
return e.min.equals(this.min) && e.max.equals(this.max)
},
clone: function() {
return (new THREE.Box2).copy(this)
}
}, THREE.Box3 = function(e, t) {
this.min = e !== undefined ? e : new THREE.Vector3(Infinity, Infinity, Infinity), this.max = t !== undefined ? t : new THREE.Vector3(-Infinity, -Infinity, -Infinity)
}, THREE.Box3.prototype = {
constructor: THREE.Box3,
set: function(e, t) {
return this.min.copy(e), this.max.copy(t), this
},
setFromPoints: function(e) {
this.makeEmpty();
for (var t = 0, n = e.length; t < n; t++) this.expandByPoint(e[t]);
return this
},
setFromCenterAndSize: function() {
var e = new THREE.Vector3;
return function(t, n) {
var r = e.copy(n).multiplyScalar(.5);
return this.min.copy(t).sub(r), this.max.copy(t).add(r), this
}
}(),
setFromObject: function() {
var e = new THREE.Vector3;
return function(t) {
var n = this;
return t.updateMatrixWorld(!0), this.makeEmpty(), t.traverse(function(t) {
var r = t.geometry;
if (r !== undefined)
if (r instanceof THREE.Geometry) {
var i = r.vertices;
for (var s = 0, o = i.length; s < o; s++) e.copy(i[s]), e.applyMatrix4(t.matrixWorld), n.expandByPoint(e)
} else if (r instanceof THREE.BufferGeometry && r.attributes.position !== undefined) {
var u = r.attributes.position.array;
for (var s = 0, o = u.length; s < o; s += 3) e.set(u[s], u[s + 1], u[s + 2]), e.applyMatrix4(t.matrixWorld), n.expandByPoint(e)
}
}), this
}
}(),
copy: function(e) {
return this.min.copy(e.min), this.max.copy(e.max), this
},
makeEmpty: function() {
return this.min.x = this.min.y = this.min.z = Infinity, this.max.x = this.max.y = this.max.z = -Infinity, this
},
empty: function() {
return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
},
center: function(e) {
var t = e || new THREE.Vector3;
return t.addVectors(this.min, this.max).multiplyScalar(.5)
},
size: function(e) {
var t = e || new THREE.Vector3;
return t.subVectors(this.max, this.min)
},
expandByPoint: function(e) {
return this.min.min(e), this.max.max(e), this
},
expandByVector: function(e) {
return this.min.sub(e), this.max.add(e), this
},
expandByScalar: function(e) {
return this.min.addScalar(-e), this.max.addScalar(e), this
},
containsPoint: function(e) {
return e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y || e.z < this.min.z || e.z > this.max.z ? !1 : !0
},
containsBox: function(e) {
return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y && this.min.z <= e.min.z && e.max.z <= this.max.z ? !0 : !1
},
getParameter: function(e, t) {
var n = t || new THREE.Vector3;
return n.set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y), (e.z - this.min.z) / (this.max.z - this.min.z))
},
isIntersectionBox: function(e) {
return e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y || e.max.z < this.min.z || e.min.z > this.max.z ? !1 : !0
},
clampPoint: function(e, t) {
var n = t || new THREE.Vector3;
return n.copy(e).clamp(this.min, this.max)
},
distanceToPoint: function() {
var e = new THREE.Vector3;
return function(t) {
var n = e.copy(t).clamp(this.min, this.max);
return n.sub(t).length()
}
}(),
getBoundingSphere: function() {
var e = new THREE.Vector3;
return function(t) {
var n = t || new THREE.Sphere;
return n.center = this.center(), n.radius = this.size(e).length() * .5, n
}
}(),
intersect: function(e) {
return this.min.max(e.min), this.max.min(e.max), this
},
union: function(e) {
return this.min.min(e.min), this.max.max(e.max), this
},
applyMatrix4: function() {
var e = [new THREE.Vector3, new THREE.Vector3, new THREE.Vector3, new THREE.Vector3, new THREE.Vector3, new THREE.Vector3, new THREE.Vector3, new THREE.Vector3];
return function(t) {
return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t), e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t), e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t), e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t), e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t), e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t), e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t), e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t), this.makeEmpty(), this.setFromPoints(e), this
}
}(),
translate: function(e) {
return this.min.add(e), this.max.add(e), this
},
equals: function(e) {
return e.min.equals(this.min) && e.max.equals(this.max)
},
clone: function() {
return (new THREE.Box3).copy(this)
}
}, THREE.Matrix3 = function() {
this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]), arguments.length > 0 && THREE.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
}, THREE.Matrix3.prototype = {
constructor: THREE.Matrix3,
set: function(e, t, n, r, i, s, o, u, a) {
var f = this.elements;
return f[0] = e, f[3] = t, f[6] = n, f[1] = r, f[4] = i, f[7] = s, f[2] = o, f[5] = u, f[8] = a, this
},
identity: function() {
return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this
},
copy: function(e) {
var t = e.elements;
return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]), this
},
multiplyVector3: function(e) {
return THREE.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."), e.applyMatrix3(this)
},
multiplyVector3Array: function(e) {
return THREE.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."), this.applyToVector3Array(e)
},
applyToVector3Array: function() {
var e = new THREE.Vector3;
return function(t, n, r) {
n === undefined && (n = 0), r === undefined && (r = t.length);
for (var i = 0, s = n; i < r; i += 3, s += 3) e.x = t[s], e.y = t[s + 1], e.z = t[s + 2], e.applyMatrix3(this), t[s] = e.x, t[s + 1] = e.y, t[s + 2] = e.z;
return t
}
}(),
multiplyScalar: function(e) {
var t = this.elements;
return t[0] *= e, t[3] *= e, t[6] *= e, t[1] *= e, t[4] *= e, t[7] *= e, t[2] *= e, t[5] *= e, t[8] *= e, this
},
determinant: function() {
var e = this.elements,
t = e[0],
n = e[1],
r = e[2],
i = e[3],
s = e[4],
o = e[5],
u = e[6],
a = e[7],
f = e[8];
return t * s * f - t * o * a - n * i * f + n * o * u + r * i * a - r * s * u
},
getInverse: function(e, t) {
var n = e.elements,
r = this.elements;
r[0] = n[10] * n[5] - n[6] * n[9], r[1] = -n[10] * n[1] + n[2] * n[9], r[2] = n[6] * n[1] - n[2] * n[5], r[3] = -n[10] * n[4] + n[6] * n[8], r[4] = n[10] * n[0] - n[2] * n[8], r[5] = -n[6] * n[0] + n[2] * n[4], r[6] = n[9] * n[4] - n[5] * n[8], r[7] = -n[9] * n[0] + n[1] * n[8], r[8] = n[5] * n[0] - n[1] * n[4];
var i = n[0] * r[0] + n[1] * r[3] + n[2] * r[6];
if (i === 0) {
var s = "Matrix3.getInverse(): can't invert matrix, determinant is 0";
if (t || !1) throw new Error(s);
return THREE.warn(s), this.identity(), this
}
return this.multiplyScalar(1 / i), this
},
transpose: function() {
var e, t = this.elements;
return e = t[1], t[1] = t[3], t[3] = e, e = t[2], t[2] = t[6], t[6] = e, e = t[5], t[5] = t[7], t[7] = e, this
},
flattenToArrayOffset: function(e, t) {
var n = this.elements;
return e[t] = n[0], e[t + 1] = n[1], e[t + 2] = n[2], e[t + 3] = n[3], e[t + 4] = n[4], e[t + 5] = n[5], e[t + 6] = n[6], e[t + 7] = n[7], e[t + 8] = n[8], e
},
getNormalMatrix: function(e) {
return this.getInverse(e).transpose(), this
},
transposeIntoArray: function(e) {
var t = this.elements;
return e[0] = t[0], e[1] = t[3], e[2] = t[6], e[3] = t[1], e[4] = t[4], e[5] = t[7], e[6] = t[2], e[7] = t[5], e[8] = t[8], this
},
fromArray: function(e) {
return this.elements.set(e), this
},
toArray: function() {
var e = this.elements;
return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
},
clone: function() {
return (new THREE.Matrix3).fromArray(this.elements)
}
}, THREE.Matrix4 = function() {
this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]), arguments.length > 0 && THREE.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
}, THREE.Matrix4.prototype = {
constructor: THREE.Matrix4,
set: function(e, t, n, r, i, s, o, u, a, f, l, c, h, p, d, v) {
var m = this.elements;
return m[0] = e, m[4] = t, m[8] = n, m[12] = r, m[1] = i, m[5] = s, m[9] = o, m[13] = u, m[2] = a, m[6] = f, m[10] = l, m[14] = c, m[3] = h, m[7] = p, m[11] = d, m[15] = v, this
},
identity: function() {
return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
},
copy: function(e) {
return this.elements.set(e.elements), this
},
extractPosition: function(e) {
return THREE.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."), this.copyPosition(e)
},
copyPosition: function(e) {
var t = this.elements,
n = e.elements;
return t[12] = n[12], t[13] = n[13], t[14] = n[14], this
},
extractBasis: function(e, t, n) {
var r = this.elements;
return e.set(r[0], r[1], r[2]), t.set(r[4], r[5], r[6]), n.set(r[8], r[9], r[10]), this
},
makeBasis: function(e, t, n) {
return this.set(e.x, t.x, n.x, 0, e.y, t.y, n.y, 0, e.z, t.z, n.z, 0, 0, 0, 0, 1), this
},
extractRotation: function() {
var e = new THREE.Vector3;
return function(t) {
var n = this.elements,
r = t.elements,
i = 1 / e.set(r[0], r[1], r[2]).length(),
s = 1 / e.set(r[4], r[5], r[6]).length(),
o = 1 / e.set(r[8], r[9], r[10]).length();
return n[0] = r[0] * i, n[1] = r[1] * i, n[2] = r[2] * i, n[4] = r[4] * s, n[5] = r[5] * s, n[6] = r[6] * s, n[8] = r[8] * o, n[9] = r[9] * o, n[10] = r[10] * o, this
}
}(),
makeRotationFromEuler: function(e) {
e instanceof THREE.Euler == 0 && THREE.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
var t = this.elements,
n = e.x,
r = e.y,
i = e.z,
s = Math.cos(n),
o = Math.sin(n),
u = Math.cos(r),
a = Math.sin(r),
f = Math.cos(i),
l = Math.sin(i);
if (e.order === "XYZ") {
var c = s * f,
h = s * l,
p = o * f,
d = o * l;
t[0] = u * f, t[4] = -u * l, t[8] = a, t[1] = h + p * a, t[5] = c - d * a, t[9] = -o * u, t[2] = d - c * a, t[6] = p + h * a, t[10] = s * u
} else if (e.order === "YXZ") {
var v = u * f,
m = u * l,
g = a * f,
y = a * l;
t[0] = v + y * o, t[4] = g * o - m, t[8] = s * a, t[1] = s * l, t[5] = s * f, t[9] = -o, t[2] = m * o - g, t[6] = y + v * o, t[10] = s * u
} else if (e.order === "ZXY") {
var v = u * f,
m = u * l,
g = a * f,
y = a * l;
t[0] = v - y * o, t[4] = -s * l, t[8] = g + m * o, t[1] = m + g * o, t[5] = s * f, t[9] = y - v * o, t[2] = -s * a, t[6] = o, t[10] = s * u
} else if (e.order === "ZYX") {
var c = s * f,
h = s * l,
p = o * f,
d = o * l;
t[0] = u * f, t[4] = p * a - h, t[8] = c * a + d, t[1] = u * l, t[5] = d * a + c, t[9] = h * a - p, t[2] = -a, t[6] = o * u, t[10] = s * u
} else if (e.order === "YZX") {
var b = s * u,
w = s * a,
E = o * u,
S = o * a;
t[0] = u * f, t[4] = S - b * l, t[8] = E * l + w, t[1] = l, t[5] = s * f, t[9] = -o * f, t[2] = -a * f, t[6] = w * l + E, t[10] = b - S * l
} else if (e.order === "XZY") {
var b = s * u,
w = s * a,
E = o * u,
S = o * a;
t[0] = u * f, t[4] = -l, t[8] = a * f, t[1] = b * l + S, t[5] = s * f, t[9] = w * l - E, t[2] = E * l - w, t[6] = o * f, t[10] = S * l + b
}
return t[3] = 0, t[7] = 0, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this
},
setRotationFromQuaternion: function(e) {
return THREE.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."), this.makeRotationFromQuaternion(e)
},
makeRotationFromQuaternion: function(e) {
var t = this.elements,
n = e.x,
r = e.y,
i = e.z,
s = e.w,
o = n + n,
u = r + r,
a = i + i,
f = n * o,
l = n * u,
c = n * a,
h = r * u,
p = r * a,
d = i * a,
v = s * o,
m = s * u,
g = s * a;
return t[0] = 1 - (h + d), t[4] = l - g, t[8] = c + m, t[1] = l + g, t[5] = 1 - (f + d), t[9] = p - v, t[2] = c - m, t[6] = p + v, t[10] = 1 - (f + h), t[3] = 0, t[7] = 0, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this
},
lookAt: function() {
var e = new THREE.Vector3,
t = new THREE.Vector3,
n = new THREE.Vector3;
return function(r, i, s) {
var o = this.elements;
return n.subVectors(r, i).normalize(), n.length() === 0 && (n.z = 1), e.crossVectors(s, n).normalize(), e.length() === 0 && (n.x += 1e-4, e.crossVectors(s, n).normalize()), t.crossVectors(n, e), o[0] = e.x, o[4] = t.x, o[8] = n.x, o[1] = e.y, o[5] = t.y, o[9] = n.y, o[2] = e.z, o[6] = t.z, o[10] = n.z, this
}
}(),
multiply: function(e, t) {
return t !== undefined ? (THREE.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."), this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
},
multiplyMatrices: function(e, t) {
var n = e.elements,
r = t.elements,
i = this.elements,
s = n[0],
o = n[4],
u = n[8],
a = n[12],
f = n[1],
l = n[5],
c = n[9],
h = n[13],
p = n[2],
d = n[6],
v = n[10],
m = n[14],
g = n[3],
y = n[7],
b = n[11],
w = n[15],
E = r[0],
S = r[4],
x = r[8],
T = r[12],
N = r[1],
C = r[5],
k = r[9],
L = r[13],
A = r[2],
O = r[6],
M = r[10],
_ = r[14],
D = r[3],
P = r[7],
H = r[11],
B = r[15];
return i[0] = s * E + o * N + u * A + a * D, i[4] = s * S + o * C + u * O + a * P, i[8] = s * x + o * k + u * M + a * H, i[12] = s * T + o * L + u * _ + a * B, i[1] = f * E + l * N + c * A + h * D, i[5] = f * S + l * C + c * O + h * P, i[9] = f * x + l * k + c * M + h * H, i[13] = f * T + l * L + c * _ + h * B, i[2] = p * E + d * N + v * A + m * D, i[6] = p * S + d * C + v * O + m * P, i[10] = p * x + d * k + v * M + m * H, i[14] = p * T + d * L + v * _ + m * B, i[3] = g * E + y * N + b * A + w * D, i[7] = g * S + y * C + b * O + w * P, i[11] = g * x + y * k + b * M + w * H, i[15] = g * T + y * L + b * _ + w * B, this
},
multiplyToArray: function(e, t, n) {
var r = this.elements;
return this.multiplyMatrices(e, t), n[0] = r[0], n[1] = r[1], n[2] = r[2], n[3] = r[3], n[4] = r[4], n[5] = r[5], n[6] = r[6], n[7] = r[7], n[8] = r[8], n[9] = r[9], n[10] = r[10], n[11] = r[11], n[12] = r[12], n[13] = r[13], n[14] = r[14], n[15] = r[15], this
},
multiplyScalar: function(e) {
var t = this.elements;
return t[0] *= e, t[4] *= e, t[8] *= e, t[12] *= e, t[1] *= e, t[5] *= e, t[9] *= e, t[13] *= e, t[2] *= e, t[6] *= e, t[10] *= e, t[14] *= e, t[3] *= e, t[7] *= e, t[11] *= e, t[15] *= e, this
},
multiplyVector3: function(e) {
return THREE.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."), e.applyProjection(this)
},
multiplyVector4: function(e) {
return THREE.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."), e.applyMatrix4(this)
},
multiplyVector3Array: function(e) {
return THREE.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."), this.applyToVector3Array(e)
},
applyToVector3Array: function() {
var e = new THREE.Vector3;
return function(t, n, r) {
n === undefined && (n = 0), r === undefined && (r = t.length);
for (var i = 0, s = n; i < r; i += 3, s += 3) e.x = t[s], e.y = t[s + 1], e.z = t[s + 2], e.applyMatrix4(this), t[s] = e.x, t[s + 1] = e.y, t[s + 2] = e.z;
return t
}
}(),
rotateAxis: function(e) {
THREE.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."), e.transformDirection(this)
},
crossVector: function(e) {
return THREE.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."), e.applyMatrix4(this)
},
determinant: function() {
var e = this.elements,
t = e[0],
n = e[4],
r = e[8],
i = e[12],
s = e[1],
o = e[5],
u = e[9],
a = e[13],
f = e[2],
l = e[6],
c = e[10],
h = e[14],
p = e[3],
d = e[7],
v = e[11],
m = e[15];
return p * (+i * u * l - r * a * l - i * o * c + n * a * c + r * o * h - n * u * h) + d * (+t * u * h - t * a * c + i * s * c - r * s * h + r * a * f - i * u * f) + v * (+t * a * l - t * o * h - i * s * l + n * s * h + i * o * f - n * a * f) + m * (-r * o * f - t * u * l + t * o * c + r * s * l - n * s * c + n * u * f)
},
transpose: function() {
var e = this.elements,
t;
return t = e[1], e[1] = e[4], e[4] = t, t = e[2], e[2] = e[8], e[8] = t, t = e[6], e[6] = e[9], e[9] = t, t = e[3], e[3] = e[12], e[12] = t, t = e[7], e[7] = e[13], e[13] = t, t = e[11], e[11] = e[14], e[14] = t, this
},
flattenToArrayOffset: function(e, t) {
var n = this.elements;
return e[t] = n[0], e[t + 1] = n[1], e[t + 2] = n[2], e[t + 3] = n[3], e[t + 4] = n[4], e[t + 5] = n[5], e[t + 6] = n[6], e[t + 7] = n[7], e[t + 8] = n[8], e[t + 9] = n[9], e[t + 10] = n[10], e[t + 11] = n[11], e[t + 12] = n[12], e[t + 13] = n[13], e[t + 14] = n[14], e[t + 15] = n[15], e
},
getPosition: function() {
var e = new THREE.Vector3;
return function() {
THREE.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");
var t = this.elements;
return e.set(t[12], t[13], t[14])
}
}(),
setPosition: function(e) {
var t = this.elements;
return t[12] = e.x, t[13] = e.y, t[14] = e.z, this
},
getInverse: function(e, t) {
var n = this.elements,
r = e.elements,
i = r[0],
s = r[4],
o = r[8],
u = r[12],
a = r[1],
f = r[5],
l = r[9],
c = r[13],
h = r[2],
p = r[6],
d = r[10],
v = r[14],
m = r[3],
g = r[7],
y = r[11],
b = r[15];
n[0] = l * v * g - c * d * g + c * p * y - f * v * y - l * p * b + f * d * b, n[4] = u * d * g - o * v * g - u * p * y + s * v * y + o * p * b - s * d * b, n[8] = o * c * g - u * l * g + u * f * y - s * c * y - o * f * b + s * l * b, n[12] = u * l * p - o * c * p - u * f * d + s * c * d + o * f * v - s * l * v, n[1] = c * d * m - l * v * m - c * h * y + a * v * y + l * h * b - a * d * b, n[5] = o * v * m - u * d * m + u * h * y - i * v * y - o * h * b + i * d * b, n[9] = u * l * m - o * c * m - u * a * y + i * c * y + o * a * b - i * l * b, n[13] = o * c * h - u * l * h + u * a * d - i * c * d - o * a * v + i * l * v, n[2] = f * v * m - c * p * m + c * h * g - a * v * g - f * h * b + a * p * b, n[6] = u * p * m - s * v * m - u * h * g + i * v * g + s * h * b - i * p * b, n[10] = s * c * m - u * f * m + u * a * g - i * c * g - s * a * b + i * f * b, n[14] = u * f * h - s * c * h - u * a * p + i * c * p + s * a * v - i * f * v, n[3] = l * p * m - f * d * m - l * h * g + a * d * g + f * h * y - a * p * y, n[7] = s * d * m - o * p * m + o * h * g - i * d * g - s * h * y + i * p * y, n[11] = o * f * m - s * l * m - o * a * g + i * l * g + s * a * y - i * f * y, n[15] = s * l * h - o * f * h + o * a * p - i * l * p - s * a * d + i * f * d;
var w = i * n[0] + a * n[4] + h * n[8] + m * n[12];
if (w == 0) {
var E = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
if (t || !1) throw new Error(E);
return THREE.warn(E), this.identity(), this
}
return this.multiplyScalar(1 / w), this
},
translate: function(e) {
THREE.error("THREE.Matrix4: .translate() has been removed.")
},
rotateX: function(e) {
THREE.error("THREE.Matrix4: .rotateX() has been removed.")
},
rotateY: function(e) {
THREE.error("THREE.Matrix4: .rotateY() has been removed.")
},
rotateZ: function(e) {
THREE.error("THREE.Matrix4: .rotateZ() has been removed.")
},
rotateByAxis: function(e, t) {
THREE.error("THREE.Matrix4: .rotateByAxis() has been removed.")
},
scale: function(e) {
var t = this.elements,
n = e.x,
r = e.y,
i = e.z;
return t[0] *= n, t[4] *= r, t[8] *= i, t[1] *= n, t[5] *= r, t[9] *= i, t[2] *= n, t[6] *= r, t[10] *= i, t[3] *= n, t[7] *= r, t[11] *= i, this
},
getMaxScaleOnAxis: function() {
var e = this.elements,
t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2],
n = e[4] * e[4] + e[5] * e[5] + e[6] * e[6],
r = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
return Math.sqrt(Math.max(t, Math.max(n, r)))
},
makeTranslation: function(e, t, n) {
return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, n, 0, 0, 0, 1), this
},
makeRotationX: function(e) {
var t = Math.cos(e),
n = Math.sin(e);
return this.set(1, 0, 0, 0, 0, t, -n, 0, 0, n, t, 0, 0, 0, 0, 1), this
},
makeRotationY: function(e) {
var t = Math.cos(e),
n = Math.sin(e);
return this.set(t, 0, n, 0, 0, 1, 0, 0, -n, 0, t, 0, 0, 0, 0, 1), this
},
makeRotationZ: function(e) {
var t = Math.cos(e),
n = Math.sin(e);
return this.set(t, -n, 0, 0, n, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
},
makeRotationAxis: function(e, t) {
var n = Math.cos(t),
r = Math.sin(t),
i = 1 - n,
s = e.x,
o = e.y,
u = e.z,
a = i * s,
f = i * o;
return this.set(a * s + n, a * o - r * u, a * u + r * o, 0, a * o + r * u, f * o + n, f * u - r * s, 0, a * u - r * o, f * u + r * s, i * u * u + n, 0, 0, 0, 0, 1), this
},
makeScale: function(e, t, n) {
return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, n, 0, 0, 0, 0, 1), this
},
compose: function(e, t, n) {
return this.makeRotationFromQuaternion(t), this.scale(n), this.setPosition(e), this
},
decompose: function() {
var e = new THREE.Vector3,
t = new THREE.Matrix4;
return function(n, r, i) {
var s = this.elements,
o = e.set(s[0], s[1], s[2]).length(),
u = e.set(s[4], s[5], s[6]).length(),
a = e.set(s[8], s[9], s[10]).length(),
f = this.determinant();
f < 0 && (o = -o), n.x = s[12], n.y = s[13], n.z = s[14], t.elements.set(this.elements);
var l = 1 / o,
c = 1 / u,
h = 1 / a;
return t.elements[0] *= l, t.elements[1] *= l, t.elements[2] *= l, t.elements[4] *= c, t.elements[5] *= c, t.elements[6] *= c, t.elements[8] *= h, t.elements[9] *= h, t.elements[10] *= h, r.setFromRotationMatrix(t), i.x = o, i.y = u, i.z = a, this
}
}(),
makeFrustum: function(e, t, n, r, i, s) {
var o = this.elements,
u = 2 * i / (t - e),
a = 2 * i / (r - n),
f = (t + e) / (t - e),
l = (r + n) / (r - n),
c = -(s + i) / (s - i),
h = -2 * s * i / (s - i);
return o[0] = u, o[4] = 0, o[8] = f, o[12] = 0, o[1] = 0, o[5] = a, o[9] = l, o[13] = 0, o[2] = 0, o[6] = 0, o[10] = c, o[14] = h, o[3] = 0, o[7] = 0, o[11] = -1, o[15] = 0, this
},
makePerspective: function(e, t, n, r) {
var i = n * Math.tan(THREE.Math.degToRad(e * .5)),
s = -i,
o = s * t,
u = i * t;
return this.makeFrustum(o, u, s, i, n, r)
},
makeOrthographic: function(e, t, n, r, i, s) {
var o = this.elements,
u = t - e,
a = n - r,
f = s - i,
l = (t + e) / u,
c = (n + r) / a,
h = (s + i) / f;
return o[0] = 2 / u, o[4] = 0, o[8] = 0, o[12] = -l, o[1] = 0, o[5] = 2 / a, o[9] = 0, o[13] = -c, o[2] = 0, o[6] = 0, o[10] = -2 / f, o[14] = -h, o[3] = 0, o[7] = 0, o[11] = 0, o[15] = 1, this
},
fromArray: function(e) {
return this.elements.set(e), this
},
toArray: function() {
var e = this.elements;
return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8], e[9], e[10], e[11], e[12], e[13], e[14], e[15]]
},
clone: function() {
return (new THREE.Matrix4).fromArray(this.elements)
}
}, THREE.Ray = function(e, t) {
this.origin = e !== undefined ? e : new THREE.Vector3, this.direction = t !== undefined ? t : new THREE.Vector3
}, THREE.Ray.prototype = {
constructor: THREE.Ray,
set: function(e, t) {
return this.origin.copy(e), this.direction.copy(t), this
},
copy: function(e) {
return this.origin.copy(e.origin), this.direction.copy(e.direction), this
},
at: function(e, t) {
var n = t || new THREE.Vector3;
return n.copy(this.direction).multiplyScalar(e).add(this.origin)
},
recast: function() {
var e = new THREE.Vector3;
return function(t) {
return this.origin.copy(this.at(t, e)), this
}
}(),
closestPointToPoint: function(e, t) {
var n = t || new THREE.Vector3;
n.subVectors(e, this.origin);
var r = n.dot(this.direction);
return r < 0 ? n.copy(this.origin) : n.copy(this.direction).multiplyScalar(r).add(this.origin)
},
distanceToPoint: function() {
var e = new THREE.Vector3;
return function(t) {
var n = e.subVectors(t, this.origin).dot(this.direction);
return n < 0 ? this.origin.distanceTo(t) : (e.copy(this.direction).multiplyScalar(n).add(this.origin), e.distanceTo(t))
}
}(),
distanceSqToSegment: function() {
var e = new THREE.Vector3,
t = new THREE.Vector3,
n = new THREE.Vector3;
return function(r, i, s, o) {
e.copy(r).add(i).multiplyScalar(.5), t.copy(i).sub(r).normalize(), n.copy(this.origin).sub(e);
var u = r.distanceTo(i) * .5,
a = -this.direction.dot(t),
f = n.dot(this.direction),
l = -n.dot(t),
c = n.lengthSq(),
h = Math.abs(1 - a * a),
p, d, v, m;
if (h > 0) {
p = a * l - f, d = a * f - l, m = u * h;
if (p >= 0)
if (d >= -m)
if (d <= m) {
var g = 1 / h;
p *= g, d *= g, v = p * (p + a * d + 2 * f) + d * (a * p + d + 2 * l) + c
} else d = u, p = Math.max(0, -(a * d + f)), v = -p * p + d * (d + 2 * l) + c;
else d = -u, p = Math.max(0, -(a * d + f)), v = -p * p + d * (d + 2 * l) + c;
else d <= -m ? (p = Math.max(0, -(-a * u + f)), d = p > 0 ? -u : Math.min(Math.max(-u, -l), u), v = -p * p + d * (d + 2 * l) + c) : d <= m ? (p = 0, d = Math.min(Math.max(-u, -l), u), v = d * (d + 2 * l) + c) : (p = Math.max(0, -(a * u + f)), d = p > 0 ? u : Math.min(Math.max(-u, -l), u), v = -p * p + d * (d + 2 * l) + c)
} else d = a > 0 ? -u : u, p = Math.max(0, -(a * d + f)), v = -p * p + d * (d + 2 * l) + c;
return s && s.copy(this.direction).multiplyScalar(p).add(this.origin), o && o.copy(t).multiplyScalar(d).add(e), v
}
}(),
isIntersectionSphere: function(e) {
return this.distanceToPoint(e.center) <= e.radius
},
intersectSphere: function() {
var e = new THREE.Vector3;
return function(t, n) {
e.subVectors(t.center, this.origin);
var r = e.dot(this.direction),
i = e.dot(e) - r * r,
s = t.radius * t.radius;
if (i > s) return null;
var o = Math.sqrt(s - i),
u = r - o,
a = r + o;
return u < 0 && a < 0 ? null : u < 0 ? this.at(a, n) : this.at(u, n)
}
}(),
isIntersectionPlane: function(e) {
var t = e.distanceToPoint(this.origin);
if (t === 0) return !0;
var n = e.normal.dot(this.direction);
return n * t < 0 ? !0 : !1
},
distanceToPlane: function(e) {
var t = e.normal.dot(this.direction);
if (t == 0) return e.distanceToPoint(this.origin) == 0 ? 0 : null;
var n = -(this.origin.dot(e.normal) + e.constant) / t;
return n >= 0 ? n : null
},
intersectPlane: function(e, t) {
var n = this.distanceToPlane(e);
return n === null ? null : this.at(n, t)
},
isIntersectionBox: function() {
var e = new THREE.Vector3;
return function(t) {
return this.intersectBox(t, e) !== null
}
}(),
intersectBox: function(e, t) {
var n, r, i, s, o, u, a = 1 / this.direction.x,
f = 1 / this.direction.y,
l = 1 / this.direction.z,
c = this.origin;
a >= 0 ? (n = (e.min.x - c.x) * a, r = (e.max.x - c.x) * a) : (n = (e.max.x - c.x) * a, r = (e.min.x - c.x) * a), f >= 0 ? (i = (e.min.y - c.y) * f, s = (e.max.y - c.y) * f) : (i = (e.max.y - c.y) * f, s = (e.min.y - c.y) * f);
if (n > s || i > r) return null;
if (i > n || n !== n) n = i;
if (s < r || r !== r) r = s;
l >= 0 ? (o = (e.min.z - c.z) * l, u = (e.max.z - c.z) * l) : (o = (e.max.z - c.z) * l, u = (e.min.z - c.z) * l);
if (n > u || o > r) return null;
if (o > n || n !== n) n = o;
if (u < r || r !== r) r = u;
return r < 0 ? null : this.at(n >= 0 ? n : r, t)
},
intersectTriangle: function() {
var e = new THREE.Vector3,
t = new THREE.Vector3,
n = new THREE.Vector3,
r = new THREE.Vector3;
return function(i, s, o, u, a) {
t.subVectors(s, i), n.subVectors(o, i), r.crossVectors(t, n);
var f = this.direction.dot(r),
l;
if (f > 0) {
if (u) return null;
l = 1
} else {
if (!(f < 0)) return null;
l = -1, f = -f
}
e.subVectors(this.origin, i);
var c = l * this.direction.dot(n.crossVectors(e, n));
if (c < 0) return null;
var h = l * this.direction.dot(t.cross(e));
if (h < 0) return null;
if (c + h > f) return null;
var p = -l * e.dot(r);
return p < 0 ? null : this.at(p / f, a)
}
}(),
applyMatrix4: function(e) {
return this.direction.add(this.origin).applyMatrix4(e), this.origin.applyMatrix4(e), this.direction.sub(this.origin), this.direction.normalize(), this
},
equals: function(e) {
return e.origin.equals(this.origin) && e.direction.equals(this.direction)
},
clone: function() {
return (new THREE.Ray).copy(this)
}
}, THREE.Sphere = function(e, t) {
this.center = e !== undefined ? e : new THREE.Vector3, this.radius = t !== undefined ? t : 0
}, THREE.Sphere.prototype = {
constructor: THREE.Sphere,
set: function(e, t) {
return this.center.copy(e), this.radius = t, this
},
setFromPoints: function() {
var e = new THREE.Box3;
return function(t, n) {
var r = this.center;
n !== undefined ? r.copy(n) : e.setFromPoints(t).center(r);
var i = 0;
for (var s = 0, o = t.length; s < o; s++) i = Math.max(i, r.distanceToSquared(t[s]));
return this.radius = Math.sqrt(i), this
}
}(),
copy: function(e) {
return this.center.copy(e.center), this.radius = e.radius, this
},
empty: function() {
return this.radius <= 0
},
containsPoint: function(e) {
return e.distanceToSquared(this.center) <= this.radius * this.radius
},
distanceToPoint: function(e) {
return e.distanceTo(this.center) - this.radius
},
intersectsSphere: function(e) {
var t = this.radius + e.radius;
return e.center.distanceToSquared(this.center) <= t * t
},
clampPoint: function(e, t) {
var n = this.center.distanceToSquared(e),
r = t || new THREE.Vector3;
return r.copy(e), n > this.radius * this.radius && (r.sub(this.center).normalize(), r.multiplyScalar(this.radius).add(this.center)), r
},
getBoundingBox: function(e) {
var t = e || new THREE.Box3;
return t.set(this.center, this.center), t.expandByScalar(this.radius), t
},
applyMatrix4: function(e) {
return this.center.applyMatrix4(e), this.radius = this.radius * e.getMaxScaleOnAxis(), this
},
translate: function(e) {
return this.center.add(e), this
},
equals: function(e) {
return e.center.equals(this.center) && e.radius === this.radius
},
clone: function() {
return (new THREE.Sphere).copy(this)
}
}, THREE.Frustum = function(e, t, n, r, i, s) {
this.planes = [e !== undefined ? e : new THREE.Plane, t !== undefined ? t : new THREE.Plane, n !== undefined ? n : new THREE.Plane, r !== undefined ? r : new THREE.Plane, i !== undefined ? i : new THREE.Plane, s !== undefined ? s : new THREE.Plane]
}, THREE.Frustum.prototype = {
constructor: THREE.Frustum,
set: function(e, t, n, r, i, s) {
var o = this.planes;
return o[0].copy(e), o[1].copy(t), o[2].copy(n), o[3].copy(r), o[4].copy(i), o[5].copy(s), this
},
copy: function(e) {
var t = this.planes;
for (var n = 0; n < 6; n++) t[n].copy(e.planes[n]);
return this
},
setFromMatrix: function(e) {
var t = this.planes,
n = e.elements,
r = n[0],
i = n[1],
s = n[2],
o = n[3],
u = n[4],
a = n[5],
f = n[6],
l = n[7],
c = n[8],
h = n[9],
p = n[10],
d = n[11],
v = n[12],
m = n[13],
g = n[14],
y = n[15];
return t[0].setComponents(o - r, l - u, d - c, y - v).normalize(), t[1].setComponents(o + r, l + u, d + c, y + v).normalize(), t[2].setComponents(o + i, l + a, d + h, y + m).normalize(), t[3].setComponents(o - i, l - a, d - h, y - m).normalize(), t[4].setComponents(o - s, l - f, d - p, y - g).normalize(), t[5].setComponents(o + s, l + f, d + p, y + g).normalize(), this
},
intersectsObject: function() {
var e = new THREE.Sphere;
return function(t) {
var n = t.geometry;
return n.boundingSphere === null && n.computeBoundingSphere(), e.copy(n.boundingSphere), e.applyMatrix4(t.matrixWorld), this.intersectsSphere(e)
}
}(),
intersectsSphere: function(e) {
var t = this.planes,
n = e.center,
r = -e.radius;
for (var i = 0; i < 6; i++) {
var s = t[i].distanceToPoint(n);
if (s < r) return !1
}
return !0
},
intersectsBox: function() {
var e = new THREE.Vector3,
t = new THREE.Vector3;
return function(n) {
var r = this.planes;
for (var i = 0; i < 6; i++) {
var s = r[i];
e.x = s.normal.x > 0 ? n.min.x : n.max.x, t.x = s.normal.x > 0 ? n.max.x : n.min.x, e.y = s.normal.y > 0 ? n.min.y : n.max.y, t.y = s.normal.y > 0 ? n.max.y : n.min.y, e.z = s.normal.z > 0 ? n.min.z : n.max.z, t.z = s.normal.z > 0 ? n.max.z : n.min.z;
var o = s.distanceToPoint(e),
u = s.distanceToPoint(t);
if (o < 0 && u < 0) return !1
}
return !0
}
}(),
containsPoint: function(e) {
var t = this.planes;
for (var n = 0; n < 6; n++)
if (t[n].distanceToPoint(e) < 0) return !1;
return !0
},
clone: function() {
return (new THREE.Frustum).copy(this)
}
}, THREE.Plane = function(e, t) {
this.normal = e !== undefined ? e : new THREE.Vector3(1, 0, 0), this.constant = t !== undefined ? t : 0
}, THREE.Plane.prototype = {
constructor: THREE.Plane,
set: function(e, t) {
return this.normal.copy(e), this.constant = t, this
},
setComponents: function(e, t, n, r) {
return this.normal.set(e, t, n), this.constant = r, this
},
setFromNormalAndCoplanarPoint: function(e, t) {
return this.normal.copy(e), this.constant = -t.dot(this.normal), this
},
setFromCoplanarPoints: function() {
var e = new THREE.Vector3,
t = new THREE.Vector3;
return function(n, r, i) {
var s = e.subVectors(i, r).cross(t.subVectors(n, r)).normalize();
return this.setFromNormalAndCoplanarPoint(s, n), this
}
}(),
copy: function(e) {
return this.normal.copy(e.normal), this.constant = e.constant, this
},
normalize: function() {
var e = 1 / this.normal.length();
return this.normal.multiplyScalar(e), this.constant *= e, this
},
negate: function() {
return this.constant *= -1, this.normal.negate(), this
},
distanceToPoint: function(e) {
return this.normal.dot(e) + this.constant
},
distanceToSphere: function(e) {
return this.distanceToPoint(e.center) - e.radius
},
projectPoint: function(e, t) {
return this.orthoPoint(e, t).sub(e).negate()
},
orthoPoint: function(e, t) {
var n = this.distanceToPoint(e),
r = t || new THREE.Vector3;
return r.copy(this.normal).multiplyScalar(n)
},
isIntersectionLine: function(e) {
var t = this.distanceToPoint(e.start),
n = this.distanceToPoint(e.end);
return t < 0 && n > 0 || n < 0 && t > 0
},
intersectLine: function() {
var e = new THREE.Vector3;
return function(t, n) {
var r = n || new THREE.Vector3,
i = t.delta(e),
s = this.normal.dot(i);
if (s == 0) return this.distanceToPoint(t.start) == 0 ? r.copy(t.start) : undefined;
var o = -(t.start.dot(this.normal) + this.constant) / s;
return o < 0 || o > 1 ? undefined : r.copy(i).multiplyScalar(o).add(t.start)
}
}(),
coplanarPoint: function(e) {
var t = e || new THREE.Vector3;
return t.copy(this.normal).multiplyScalar(-this.constant)
},
applyMatrix4: function() {
var e = new THREE.Vector3,
t = new THREE.Vector3,
n = new THREE.Matrix3;
return function(r, i) {
var s = i || n.getNormalMatrix(r),
o = e.copy(this.normal).applyMatrix3(s),
u = this.coplanarPoint(t);
return u.applyMatrix4(r), this.setFromNormalAndCoplanarPoint(o, u), this
}
}(),
translate: function(e) {
return this.constant = this.constant - e.dot(this.normal), this
},
equals: function(e) {
return e.normal.equals(this.normal) && e.constant == this.constant
},
clone: function() {
return (new THREE.Plane).copy(this)
}
}, THREE.Math = {
generateUUID: function() {
var e = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
t = new Array(36),
n = 0,
r;
return function() {
for (var i = 0; i < 36; i++) i == 8 || i == 13 || i == 18 || i == 23 ? t[i] = "-" : i == 14 ? t[i] = "4" : (n <= 2 && (n = 33554432 + Math.random() * 16777216 | 0), r = n & 15, n >>= 4, t[i] = e[i == 19 ? r & 3 | 8 : r]);
return t.join("")
}
}(),
clamp: function(e, t, n) {
return e < t ? t : e > n ? n : e
},
clampBottom: function(e, t) {
return e < t ? t : e
},
mapLinear: function(e, t, n, r, i) {
return r + (e - t) * (i - r) / (n - t)
},
smoothstep: function(e, t, n) {
return e <= t ? 0 : e >= n ? 1 : (e = (e - t) / (n - t), e * e * (3 - 2 * e))
},
smootherstep: function(e, t, n) {
return e <= t ? 0 : e >= n ? 1 : (e = (e - t) / (n - t), e * e * e * (e * (e * 6 - 15) + 10))
},
random16: function() {
return (65280 * Math.random() + 255 * Math.random()) / 65535
},
randInt: function(e, t) {
return Math.floor(this.randFloat(e, t))
},
randFloat: function(e, t) {
return e + Math.random() * (t - e)
},
randFloatSpread: function(e) {
return e * (.5 - Math.random())
},
degToRad: function() {
var e = Math.PI / 180;
return function(t) {
return t * e
}
}(),
radToDeg: function() {
var e = 180 / Math.PI;
return function(t) {
return t * e
}
}(),
isPowerOfTwo: function(e) {
return (e & e - 1) === 0 && e !== 0
},
nextPowerOfTwo: function(e) {
return e--, e |= e >> 1, e |= e >> 2, e |= e >> 4, e |= e >> 8, e |= e >> 16, e++, e
}
}, THREE.Spline = function(e) {
function h(e, t, n, r, i, s, o) {
var u = (n - e) * .5,
a = (r - t) * .5;
return (2 * (t - n) + u + a) * o + (-3 * (t - n) - 2 * u - a) * s + u * i + t
}
this.points = e;
var t = [],
n = {
x: 0,
y: 0,
z: 0
},
r, i, s, o, u, a, f, l, c;
this.initFromArray = function(e) {
this.points = [];
for (var t = 0; t < e.length; t++) this.points[t] = {
x: e[t][0],
y: e[t][1],
z: e[t][2]
}
}, this.getPoint = function(e) {
return r = (this.points.length - 1) * e, i = Math.floor(r), s = r - i, t[0] = i === 0 ? i : i - 1, t[1] = i, t[2] = i > this.points.length - 2 ? this.points.length - 1 : i + 1, t[3] = i > this.points.length - 3 ? this.points.length - 1 : i + 2, a = this.points[t[0]], f = this.points[t[1]], l = this.points[t[2]], c = this.points[t[3]], o = s * s, u = s * o, n.x = h(a.x, f.x, l.x, c.x, s, o, u), n.y = h(a.y, f.y, l.y, c.y, s, o, u), n.z = h(a.z, f.z, l.z, c.z, s, o, u), n
}, this.getControlPointsArray = function() {
var e, t, n = this.points.length,
r = [];
for (e = 0; e < n; e++) t = this.points[e], r[e] = [t.x, t.y, t.z];
return r
}, this.getLength = function(e) {
var t, n, r, i, s = 0,
o = 0,
u = 0,
a = new THREE.Vector3,
f = new THREE.Vector3,
l = [],
c = 0;
l[0] = 0, e || (e = 100), r = this.points.length * e, a.copy(this.points[0]);
for (t = 1; t < r; t++) n = t / r, i = this.getPoint(n), f.copy(i), c += f.distanceTo(a), a.copy(i), s = (this.points.length - 1) * n, o = Math.floor(s), o != u && (l[o] = c, u = o);
return l[l.length] = c, {
chunks: l,
total: c
}
}, this.reparametrizeByArcLength = function(e) {
var t, n, r, i, s, o, u, a, f = [],
l = new THREE.Vector3,
c = this.getLength();
f.push(l.copy(this.points[0]).clone());
for (t = 1; t < this.points.length; t++) {
o = c.chunks[t] - c.chunks[t - 1], u = Math.ceil(e * o / c.total), i = (t - 1) / (this.points.length - 1), s = t / (this.points.length - 1);
for (n = 1; n < u - 1; n++) r = i + n * (1 / u) * (s - i), a = this.getPoint(r), f.push(l.copy(a).clone());
f.push(l.copy(this.points[t]).clone())
}
this.points = f
}
}, THREE.Triangle = function(e, t, n) {
this.a = e !== undefined ? e : new THREE.Vector3, this.b = t !== undefined ? t : new THREE.Vector3, this.c = n !== undefined ? n : new THREE.Vector3
}, THREE.Triangle.normal = function() {
var e = new THREE.Vector3;
return function(t, n, r, i) {
var s = i || new THREE.Vector3;
s.subVectors(r, n), e.subVectors(t, n), s.cross(e);
var o = s.lengthSq();
return o > 0 ? s.multiplyScalar(1 / Math.sqrt(o)) : s.set(0, 0, 0)
}
}(), THREE.Triangle.barycoordFromPoint = function() {
var e = new THREE.Vector3,
t = new THREE.Vector3,
n = new THREE.Vector3;
return function(r, i, s, o, u) {
e.subVectors(o, i), t.subVectors(s, i), n.subVectors(r, i);
var a = e.dot(e),
f = e.dot(t),
l = e.dot(n),
c = t.dot(t),
h = t.dot(n),
p = a * c - f * f,
d = u || new THREE.Vector3;
if (p == 0) return d.set(-2, -1, -1);
var v = 1 / p,
m = (c * l - f * h) * v,
g = (a * h - f * l) * v;
return d.set(1 - m - g, g, m)
}
}(), THREE.Triangle.containsPoint = function() {
var e = new THREE.Vector3;
return function(t, n, r, i) {
var s = THREE.Triangle.barycoordFromPoint(t, n, r, i, e);
return s.x >= 0 && s.y >= 0 && s.x + s.y <= 1
}
}(), THREE.Triangle.prototype = {
constructor: THREE.Triangle,
set: function(e, t, n) {
return this.a.copy(e), this.b.copy(t), this.c.copy(n), this
},
setFromPointsAndIndices: function(e, t, n, r) {
return this.a.copy(e[t]), this.b.copy(e[n]), this.c.copy(e[r]), this
},
copy: function(e) {
return this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this
},
area: function() {
var e = new THREE.Vector3,
t = new THREE.Vector3;
return function() {
return e.subVectors(this.c, this.b), t.subVectors(this.a, this.b), e.cross(t).length() * .5
}
}(),
midpoint: function(e) {
var t = e || new THREE.Vector3;
return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
},
normal: function(e) {
return THREE.Triangle.normal(this.a, this.b, this.c, e)
},
plane: function(e) {
var t = e || new THREE.Plane;
return t.setFromCoplanarPoints(this.a, this.b, this.c)
},
barycoordFromPoint: function(e, t) {
return THREE.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
},
containsPoint: function(e) {
return THREE.Triangle.containsPoint(e, this.a, this.b, this.c)
},
equals: function(e) {
return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
},
clone: function() {
return (new THREE.Triangle).copy(this)
}
}, THREE.Clock = function(e) {
this.autoStart = e !== undefined ? e : !0, this.startTime = 0, this.oldTime = 0, this.elapsedTime = 0, this.running = !1
}, THREE.Clock.prototype = {
constructor: THREE.Clock,
start: function() {
this.startTime = self.performance !== undefined && self.performance.now !== undefined ? self.performance.now() : Date.now(), this.oldTime = this.startTime, this.running = !0
},
stop: function() {
this.getElapsedTime(), this.running = !1
},
getElapsedTime: function() {
return this.getDelta(), this.elapsedTime
},
getDelta: function() {
var e = 0;
this.autoStart && !this.running && this.start();
if (this.running) {
var t = self.performance !== undefined && self.performance.now !== undefined ? self.performance.now() : Date.now();
e = .001 * (t - this.oldTime), this.oldTime = t, this.elapsedTime += e
}
return e
}
}, THREE.EventDispatcher = function() {}, THREE.EventDispatcher.prototype = {
constructor: THREE.EventDispatcher,
apply: function(e) {
e.addEventListener = THREE.EventDispatcher.prototype.addEventListener, e.hasEventListener = THREE.EventDispatcher.prototype.hasEventListener, e.removeEventListener = THREE.EventDispatcher.prototype.removeEventListener, e.dispatchEvent = THREE.EventDispatcher.prototype.dispatchEvent
},
addEventListener: function(e, t) {
this._listeners === undefined && (this._listeners = {});
var n = this._listeners;
n[e] === undefined && (n[e] = []), n[e].indexOf(t) === -1 && n[e].push(t)
},
hasEventListener: function(e, t) {
if (this._listeners === undefined) return !1;
var n = this._listeners;
return n[e] !== undefined && n[e].indexOf(t) !== -1 ? !0 : !1
},
removeEventListener: function(e, t) {
if (this._listeners === undefined) return;
var n = this._listeners,
r = n[e];
if (r !== undefined) {
var i = r.indexOf(t);
i !== -1 && r.splice(i, 1)
}
},
dispatchEvent: function(e) {
if (this._listeners === undefined) return;
var t = this._listeners,
n = t[e.type];
if (n !== undefined) {
e.target = this;
var r = [],
i = n.length;
for (var s = 0; s < i; s++) r[s] = n[s];
for (var s = 0; s < i; s++) r[s].call(this, e)
}
}
},
function(e) {
e.Raycaster = function(t, n, r, i) {
this.ray = new e.Ray(t, n), this.near = r || 0, this.far = i || Infinity, this.params = {
Sprite: {},
Mesh: {},
PointCloud: {
threshold: 1
},
LOD: {},
Line: {}
}
};
var t = function(e, t) {
return e.distance - t.distance
},
n = function(e, t, r, i) {
e.raycast(t, r);
if (i === !0) {
var s = e.children;
for (var o = 0, u = s.length; o < u; o++) n(s[o], t, r, !0)
}
};
e.Raycaster.prototype = {
constructor: e.Raycaster,
precision: 1e-4,
linePrecision: 1,
set: function(e, t) {
this.ray.set(e, t)
},
setFromCamera: function(t, n) {
n instanceof e.PerspectiveCamera ? (this.ray.origin.copy(n.position), this.ray.direction.set(t.x, t.y, .5).unproject(n).sub(n.position).normalize()) : n instanceof e.OrthographicCamera ? (this.ray.origin.set(t.x, t.y, -1).unproject(n), this.ray.direction.set(0, 0, -1).transformDirection(n.matrixWorld)) : e.error("THREE.Raycaster: Unsupported camera type.")
},
intersectObject: function(e, r) {
var i = [];
return n(e, this, i, r), i.sort(t), i
},
intersectObjects: function(r, i) {
var s = [];
if (r instanceof Array == 0) return e.warn("THREE.Raycaster.intersectObjects: objects is not an Array."), s;
for (var o = 0, u = r.length; o < u; o++) n(r[o], this, s, i);
return s.sort(t), s
}
}
}(THREE), THREE.Object3D = function() {
Object.defineProperty(this, "id", {
value: THREE.Object3DIdCount++
}), this.uuid = THREE.Math.generateUUID(), this.name = "", this.type = "Object3D", this.parent = undefined, this.children = [], this.up = THREE.Object3D.DefaultUp.clone();
var e = new THREE.Vector3,
t = new THREE.Euler,
n = new THREE.Quaternion,
r = new THREE.Vector3(1, 1, 1),
i = function() {
n.setFromEuler(t, !1)
},
s = function() {
t.setFromQuaternion(n, undefined, !1)
};
t.onChange(i), n.onChange(s), Object.defineProperties(this, {
position: {
enumerable: !0,
value: e
},
rotation: {
enumerable: !0,
value: t
},
quaternion: {
enumerable: !0,
value: n
},
scale: {
enumerable: !0,
value: r
}
}), this.rotationAutoUpdate = !0, this.matrix = new THREE.Matrix4, this.matrixWorld = new THREE.Matrix4, this.matrixAutoUpdate = !0, this.matrixWorldNeedsUpdate = !1, this.visible = !0, this.castShadow = !1, this.receiveShadow = !1, this.frustumCulled = !0, this.renderOrder = 0, this.userData = {}
}, THREE.Object3D.DefaultUp = new THREE.Vector3(0, 1, 0), THREE.Object3D.prototype = {
constructor: THREE.Object3D,
get eulerOrder() {
return THREE.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order."), this.rotation.order
},
set eulerOrder(e) {
THREE.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order."), this.rotation.order = e
},
get useQuaternion() {
THREE.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
},
set useQuaternion(e) {
THREE.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
},
applyMatrix: function(e) {
this.matrix.multiplyMatrices(e, this.matrix), this.matrix.decompose(this.position, this.quaternion, this.scale)
},
setRotationFromAxisAngle: function(e, t) {
this.quaternion.setFromAxisAngle(e, t)
},
setRotationFromEuler: function(e) {
this.quaternion.setFromEuler(e, !0)
},
setRotationFromMatrix: function(e) {
this.quaternion.setFromRotationMatrix(e)
},
setRotationFromQuaternion: function(e) {
this.quaternion.copy(e)
},
rotateOnAxis: function() {
var e = new THREE.Quaternion;
return function(t, n) {
return e.setFromAxisAngle(t, n), this.quaternion.multiply(e), this
}
}(),
rotateX: function() {
var e = new THREE.Vector3(1, 0, 0);
return function(t) {
return this.rotateOnAxis(e, t)
}
}(),
rotateY: function() {
var e = new THREE.Vector3(0, 1, 0);
return function(t) {
return this.rotateOnAxis(e, t)
}
}(),
rotateZ: function() {
var e = new THREE.Vector3(0, 0, 1);
return function(t) {
return this.rotateOnAxis(e, t)
}
}(),
translateOnAxis: function() {
var e = new THREE.Vector3;
return function(t, n) {
return e.copy(t).applyQuaternion(this.quaternion), this.position.add(e.multiplyScalar(n)), this
}
}(),
translate: function(e, t) {
return THREE.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."), this.translateOnAxis(t, e)
},
translateX: function() {
var e = new THREE.Vector3(1, 0, 0);
return function(t) {
return this.translateOnAxis(e, t)
}
}(),
translateY: function() {
var e = new THREE.Vector3(0, 1, 0);
return function(t) {
return this.translateOnAxis(e, t)
}
}(),
translateZ: function() {
var e = new THREE.Vector3(0, 0, 1);
return function(t) {
return this.translateOnAxis(e, t)
}
}(),
localToWorld: function(e) {
return e.applyMatrix4(this.matrixWorld)
},
worldToLocal: function() {
var e = new THREE.Matrix4;
return function(t) {
return t.applyMatrix4(e.getInverse(this.matrixWorld))
}
}(),
lookAt: function() {
var e = new THREE.Matrix4;
return function(t) {
e.lookAt(t, this.position, this.up), this.quaternion.setFromRotationMatrix(e)
}
}(),
add: function(e) {
if (arguments.length > 1) {
for (var t = 0; t < arguments.length; t++) this.add(arguments[t]);
return this
}
return e === this ? (THREE.error("THREE.Object3D.add: object can't be added as a child of itself.", e), this) : (e instanceof THREE.Object3D ? (e.parent !== undefined && e.parent.remove(e), e.parent = this, e.dispatchEvent({
type: "added"
}), this.children.push(e)) : THREE.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e), this)
},
remove: function(e) {
if (arguments.length > 1)
for (var t = 0; t < arguments.length; t++) this.remove(arguments[t]);
var n = this.children.indexOf(e);
n !== -1 && (e.parent = undefined, e.dispatchEvent({
type: "removed"
}), this.children.splice(n, 1))
},
getChildByName: function(e) {
return THREE.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."), this.getObjectByName(e)
},
getObjectById: function(e) {
return this.getObjectByProperty("id", e)
},
getObjectByName: function(e) {
return this.getObjectByProperty("name", e)
},
getObjectByProperty: function(e, t) {
if (this[e] === t) return this;
for (var n = 0, r = this.children.length; n < r; n++) {
var i = this.children[n],
s = i.getObjectByProperty(e, t);
if (s !== undefined) return s
}
return undefined
},
getWorldPosition: function(e) {
var t = e || new THREE.Vector3;
return this.updateMatrixWorld(!0), t.setFromMatrixPosition(this.matrixWorld)
},
getWorldQuaternion: function() {
var e = new THREE.Vector3,
t = new THREE.Vector3;
return function(n) {
var r = n || new THREE.Quaternion;
return this.updateMatrixWorld(!0), this.matrixWorld.decompose(e, r, t), r
}
}(),
getWorldRotation: function() {
var e = new THREE.Quaternion;
return function(t) {
var n = t || new THREE.Euler;
return this.getWorldQuaternion(e), n.setFromQuaternion(e, this.rotation.order, !1)
}
}(),
getWorldScale: function() {
var e = new THREE.Vector3,
t = new THREE.Quaternion;
return function(n) {
var r = n || new THREE.Vector3;
return this.updateMatrixWorld(!0), this.matrixWorld.decompose(e, t, r), r
}
}(),
getWorldDirection: function() {
var e = new THREE.Quaternion;
return function(t) {
var n = t || new THREE.Vector3;
return this.getWorldQuaternion(e), n.set(0, 0, 1).applyQuaternion(e)
}
}(),
raycast: function() {},
traverse: function(e) {
e(this);
for (var t = 0, n = this.children.length; t < n; t++) this.children[t].traverse(e)
},
traverseVisible: function(e) {
if (this.visible === !1) return;
e(this);
for (var t = 0, n = this.children.length; t < n; t++) this.children[t].traverseVisible(e)
},
traverseAncestors: function(e) {
this.parent && (e(this.parent), this.parent.traverseAncestors(e))
},
updateMatrix: function() {
this.matrix.compose(this.position, this.quaternion, this.scale), this.matrixWorldNeedsUpdate = !0
},
updateMatrixWorld: function(e) {
this.matrixAutoUpdate === !0 && this.updateMatrix();
if (this.matrixWorldNeedsUpdate === !0 || e === !0) this.parent === undefined ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix), this.matrixWorldNeedsUpdate = !1, e = !0;
for (var t = 0, n = this.children.length; t < n; t++) this.children[t].updateMatrixWorld(e)
},
toJSON: function() {
var e = {
metadata: {
version: 4.3,
type: "Object",
generator: "ObjectExporter"
}
},
t = {},
n = function(n) {
e.geometries === undefined && (e.geometries = []);
if (t[n.uuid] === undefined) {
var r = n.toJSON();
delete r.metadata, t[n.uuid] = r, e.geometries.push(r)
}
return n.uuid
},
r = {},
i = function(t) {
e.materials === undefined && (e.materials = []);
if (r[t.uuid] === undefined) {
var n = t.toJSON();
delete n.metadata, r[t.uuid] = n, e.materials.push(n)
}
return t.uuid
},
s = function(e) {
var t = {};
t.uuid = e.uuid, t.type = e.type, e.name !== "" && (t.name = e.name), JSON.stringify(e.userData) !== "{}" && (t.userData = e.userData), e.visible !== !0 && (t.visible = e.visible), e instanceof THREE.PerspectiveCamera ? (t.fov = e.fov, t.aspect = e.aspect, t.near = e.near, t.far = e.far) : e instanceof THREE.OrthographicCamera ? (t.left = e.left, t.right = e.right, t.top = e.top, t.bottom = e.bottom, t.near = e.near, t.far = e.far) : e instanceof THREE.AmbientLight ? t.color = e.color.getHex() : e instanceof THREE.DirectionalLight ? (t.color = e.color.getHex(), t.intensity = e.intensity) : e instanceof THREE.PointLight ? (t.color = e.color.getHex(), t.intensity = e.intensity, t.distance = e.distance, t.decay = e.decay) : e instanceof THREE.SpotLight ? (t.color = e.color.getHex(), t.intensity = e.intensity, t.distance = e.distance, t.angle = e.angle, t.exponent = e.exponent, t.decay = e.decay) : e instanceof THREE.HemisphereLight ? (t.color = e.color.getHex(), t.groundColor = e.groundColor.getHex()) : e instanceof THREE.Mesh || e instanceof THREE.Line || e instanceof THREE.PointCloud ? (t.geometry = n(e.geometry), t.material = i(e.material), e instanceof THREE.Line && (t.mode = e.mode)) : e instanceof THREE.Sprite && (t.material = i(e.material)), t.matrix = e.matrix.toArray();
if (e.children.length > 0) {
t.children = [];
for (var r = 0; r < e.children.length; r++) t.children.push(s(e.children[r]))
}
return t
};
return e.object = s(this), e
},
clone: function(e, t) {
e === undefined && (e = new THREE.Object3D), t === undefined && (t = !0), e.name = this.name, e.up.copy(this.up), e.position.copy(this.position), e.quaternion.copy(this.quaternion), e.scale.copy(this.scale), e.rotationAutoUpdate = this.rotationAutoUpdate, e.matrix.copy(this.matrix), e.matrixWorld.copy(this.matrixWorld), e.matrixAutoUpdate = this.matrixAutoUpdate, e.matrixWorldNeedsUpdate = this.matrixWorldNeedsUpdate, e.visible = this.visible, e.castShadow = this.castShadow, e.receiveShadow = this.receiveShadow, e.frustumCulled = this.frustumCulled, e.userData = JSON.parse(JSON.stringify(this.userData));
if (t === !0)
for (var n = 0; n < this.children.length; n++) {
var r = this.children[n];
e.add(r.clone())
}
return e
}
}, THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype), THREE.Object3DIdCount = 0, THREE.Face3 = function(e, t, n, r, i, s) {
this.a = e, this.b = t, this.c = n, this.normal = r instanceof THREE.Vector3 ? r : new THREE.Vector3, this.vertexNormals = r instanceof Array ? r : [], this.color = i instanceof THREE.Color ? i : new THREE.Color, this.vertexColors = i instanceof Array ? i : [], this.vertexTangents = [], this.materialIndex = s !== undefined ? s : 0
}, THREE.Face3.prototype = {
constructor: THREE.Face3,
clone: function() {
var e = new THREE.Face3(this.a, this.b, this.c);
e.normal.copy(this.normal), e.color.copy(this.color), e.materialIndex = this.materialIndex;
for (var t = 0, n = this.vertexNormals.length; t < n; t++) e.vertexNormals[t] = this.vertexNormals[t].clone();
for (var t = 0, n = this.vertexColors.length; t < n; t++) e.vertexColors[t] = this.vertexColors[t].clone();
for (var t = 0, n = this.vertexTangents.length; t < n; t++) e.vertexTangents[t] = this.vertexTangents[t].clone();
return e
}
}, THREE.Face4 = function(e, t, n, r, i, s, o) {
return THREE.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."), new THREE.Face3(e, t, n, i, s, o)
}, THREE.BufferAttribute = function(e, t) {
this.array = e, this.itemSize = t, this.needsUpdate = !1
}, THREE.BufferAttribute.prototype = {
constructor: THREE.BufferAttribute,
get length() {
return this.array.length
},
copyAt: function(e, t, n) {
e *= this.itemSize, n *= t.itemSize;
for (var r = 0, i = this.itemSize; r < i; r++) this.array[e + r] = t.array[n + r];
return this
},
set: function(e, t) {
return t === undefined && (t = 0), this.array.set(e, t), this
},
setX: function(e, t) {
return this.array[e * this.itemSize] = t, this
},
setY: function(e, t) {
return this.array[e * this.itemSize + 1] = t, this
},
setZ: function(e, t) {
return this.array[e * this.itemSize + 2] = t, this
},
setXY: function(e, t, n) {
return e *= this.itemSize, this.array[e] = t, this.array[e + 1] = n, this
},
setXYZ: function(e, t, n, r) {
return e *= this.itemSize, this.array[e] = t, this.array[e + 1] = n, this.array[e + 2] = r, this
},
setXYZW: function(e, t, n, r, i) {
return e *= this.itemSize, this.array[e] = t, this.array[e + 1] = n, this.array[e + 2] = r, this.array[e + 3] = i, this
},
clone: function() {
return new THREE.BufferAttribute(new this.array.constructor(this.array), this.itemSize)
}
}, THREE.Int8Attribute = function(e, t) {
return THREE.warn("THREE.Int8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."), new THREE.BufferAttribute(e, t)
}, THREE.Uint8Attribute = function(e, t) {
return THREE.warn("THREE.Uint8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."), new THREE.BufferAttribute(e, t)
}, THREE.Uint8ClampedAttribute = function(e, t) {
return THREE.warn("THREE.Uint8ClampedAttribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."), new THREE.BufferAttribute(e, t)
}, THREE.Int16Attribute = function(e, t) {
return THREE.warn("THREE.Int16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."), new THREE.BufferAttribute(e, t)
}, THREE.Uint16Attribute = function(e, t) {
return THREE.warn("THREE.Uint16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."), new THREE.BufferAttribute(e, t)
}, THREE.Int32Attribute = function(e, t) {
return THREE.warn("THREE.Int32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."), new THREE.BufferAttribute(e, t)
}, THREE.Uint32Attribute = function(e, t) {
return THREE.warn("THREE.Uint32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."), new THREE.BufferAttribute(e, t)
}, THREE.Float32Attribute = function(e, t) {
return THREE.warn("THREE.Float32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."), new THREE.BufferAttribute(e, t)
}, THREE.Float64Attribute = function(e, t) {
return THREE.warn("THREE.Float64Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."), new THREE.BufferAttribute(e, t)
}, THREE.DynamicBufferAttribute = function(e, t) {
THREE.BufferAttribute.call(this, e, t), this.updateRange = {
offset: 0,
count: -1
}
}, THREE.DynamicBufferAttribute.prototype = Object.create(THREE.BufferAttribute.prototype), THREE.DynamicBufferAttribute.prototype.constructor = THREE.DynamicBufferAttribute, THREE.DynamicBufferAttribute.prototype.clone = function() {
return new THREE.DynamicBufferAttribute(new this.array.constructor(this.array), this.itemSize)
}, THREE.BufferGeometry = function() {
Object.defineProperty(this, "id", {
value: THREE.GeometryIdCount++
}), this.uuid = THREE.Math.generateUUID(), this.name = "", this.type = "BufferGeometry", this.attributes = {}, this.attributesKeys = [], this.drawcalls = [], this.offsets = this.drawcalls, this.boundingBox = null, this.boundingSphere = null
}, THREE.BufferGeometry.prototype = {
constructor: THREE.BufferGeometry,
addAttribute: function(e, t) {
if (t instanceof THREE.BufferAttribute == 0) {
THREE.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."), this.attributes[e] = {
array: arguments[1],
itemSize: arguments[2]
};
return
}
this.attributes[e] = t, this.attributesKeys = Object.keys(this.attributes)
},
getAttribute: function(e) {
return this.attributes[e]
},
addDrawCall: function(e, t, n) {
this.drawcalls.push({
start: e,
count: t,
index: n !== undefined ? n : 0
})
},
applyMatrix: function(e) {
var t = this.attributes.position;
t !== undefined && (e.applyToVector3Array(t.array), t.needsUpdate = !0);
var n = this.attributes.normal;
if (n !== undefined) {
var r = (new THREE.Matrix3).getNormalMatrix(e);
r.applyToVector3Array(n.array), n.needsUpdate = !0
}
this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere()
},
center: function() {
this.computeBoundingBox();
var e = this.boundingBox.center().negate();
return this.applyMatrix((new THREE.Matrix4).setPosition(e)), e
},
fromGeometry: function(e, t) {
t = t || {
vertexColors: THREE.NoColors
};
var n = e.vertices,
r = e.faces,
i = e.faceVertexUvs,
s = t.vertexColors,
o = i[0].length > 0,
u = r[0].vertexNormals.length == 3,
a = new Float32Array(r.length * 3 * 3);
this.addAttribute("position", new THREE.BufferAttribute(a, 3));
var f = new Float32Array(r.length * 3 * 3);
this.addAttribute("normal", new THREE.BufferAttribute(f, 3));
if (s !== THREE.NoColors) {
var l = new Float32Array(r.length * 3 * 3);
this.addAttribute("color", new THREE.BufferAttribute(l, 3))
}
if (o === !0) {
var c = new Float32Array(r.length * 3 * 2);
this.addAttribute("uv", new THREE.BufferAttribute(c, 2))
}
for (var h = 0, p = 0, d = 0; h < r.length; h++, p += 6, d += 9) {
var v = r[h],
m = n[v.a],
g = n[v.b],
y = n[v.c];
a[d] = m.x, a[d + 1] = m.y, a[d + 2] = m.z, a[d + 3] = g.x, a[d + 4] = g.y, a[d + 5] = g.z, a[d + 6] = y.x, a[d + 7] = y.y, a[d + 8] = y.z;
if (u === !0) {
var b = v.vertexNormals[0],
w = v.vertexNormals[1],
E = v.vertexNormals[2];
f[d] = b.x, f[d + 1] = b.y, f[d + 2] = b.z, f[d + 3] = w.x, f[d + 4] = w.y, f[d + 5] = w.z, f[d + 6] = E.x, f[d + 7] = E.y, f[d + 8] = E.z
} else {
var S = v.normal;
f[d] = S.x, f[d + 1] = S.y, f[d + 2] = S.z, f[d + 3] = S.x, f[d + 4] = S.y, f[d + 5] = S.z, f[d + 6] = S.x, f[d + 7] = S.y, f[d + 8] = S.z
}
if (s === THREE.FaceColors) {
var x = v.color;
l[d] = x.r, l[d + 1] = x.g, l[d + 2] = x.b, l[d + 3] = x.r, l[d + 4] = x.g, l[d + 5] = x.b, l[d + 6] = x.r, l[d + 7] = x.g, l[d + 8] = x.b
} else if (s === THREE.VertexColors) {
var T = v.vertexColors[0],
N = v.vertexColors[1],
C = v.vertexColors[2];
l[d] = T.r, l[d + 1] = T.g, l[d + 2] = T.b, l[d + 3] = N.r, l[d + 4] = N.g, l[d + 5] = N.b, l[d + 6] = C.r, l[d + 7] = C.g, l[d + 8] = C.b
}
if (o === !0) {
var k = i[0][h][0],
L = i[0][h][1],
A = i[0][h][2];
c[p] = k.x, c[p + 1] = k.y, c[p + 2] = L.x, c[p + 3] = L.y, c[p + 4] = A.x, c[p + 5] = A.y
}
}
return this.computeBoundingSphere(), this
},
computeBoundingBox: function() {
var e = new THREE.Vector3;
return function() {
this.boundingBox === null && (this.boundingBox = new THREE.Box3);
var t = this.attributes.position.array;
if (t) {
var n = this.boundingBox;
n.makeEmpty();
for (var r = 0, i = t.length; r < i; r += 3) e.set(t[r], t[r + 1], t[r + 2]), n.expandByPoint(e)
}
if (t === undefined || t.length === 0) this.boundingBox.min.set(0, 0, 0), this.boundingBox.max.set(0, 0, 0);
(isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) && THREE.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')
}
}(),
computeBoundingSphere: function() {
var e = new THREE.Box3,
t = new THREE.Vector3;
return function() {
this.boundingSphere === null && (this.boundingSphere = new THREE.Sphere);
var n = this.attributes.position.array;
if (n) {
e.makeEmpty();
var r = this.boundingSphere.center;
for (var i = 0, s = n.length; i < s; i += 3) t.set(n[i], n[i + 1], n[i + 2]), e.expandByPoint(t);
e.center(r);
var o = 0;
for (var i = 0, s = n.length; i < s; i += 3) t.set(n[i], n[i + 1], n[i + 2]), o = Math.max(o, r.distanceToSquared(t));
this.boundingSphere.radius = Math.sqrt(o), isNaN(this.boundingSphere.radius) && THREE.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')
}
}
}(),
computeFaceNormals: function() {},
computeVertexNormals: function() {
var e = this.attributes;
if (e.position) {
var t = e.position.array;
if (e.normal === undefined) this.addAttribute("normal", new THREE.BufferAttribute(new Float32Array(t.length), 3));
else {
var n = e.normal.array;
for (var r = 0, i = n.length; r < i; r++) n[r] = 0
}
var n = e.normal.array,
s, o, u, a = new THREE.Vector3,
f = new THREE.Vector3,
l = new THREE.Vector3,
c = new THREE.Vector3,
h = new THREE.Vector3;
if (e.index) {
var p = e.index.array,
d = this.offsets.length > 0 ? this.offsets : [{
start: 0,
count: p.length,
index: 0
}];
for (var v = 0, m = d.length; v < m; ++v) {
var g = d[v].start,
y = d[v].count,
b = d[v].index;
for (var r = g, i = g + y; r < i; r += 3) s = (b + p[r]) * 3, o = (b + p[r + 1]) * 3, u = (b + p[r + 2]) * 3, a.fromArray(t, s), f.fromArray(t, o), l.fromArray(t, u), c.subVectors(l, f), h.subVectors(a, f), c.cross(h), n[s] += c.x, n[s + 1] += c.y, n[s + 2] += c.z, n[o] += c.x, n[o + 1] += c.y, n[o + 2] += c.z, n[u] += c.x, n[u + 1] += c.y, n[u + 2] += c.z
}
} else
for (var r = 0, i = t.length; r < i; r += 9) a.fromArray(t, r), f.fromArray(t, r + 3), l.fromArray(t, r + 6), c.subVectors(l, f), h.subVectors(a, f), c.cross(h), n[r] = c.x, n[r + 1] = c.y, n[r + 2] = c.z, n[r + 3] = c.x, n[r + 4] = c.y, n[r + 5] = c.z, n[r + 6] = c.x, n[r + 7] = c.y, n[r + 8] = c.z;
this.normalizeNormals(), e.normal.needsUpdate = !0
}
},
computeTangents: function() {
function L(e, n, i) {
f.fromArray(t, e * 3), l.fromArray(t, n * 3), c.fromArray(t, i * 3), h.fromArray(r, e * 2), p.fromArray(r, n * 2), d.fromArray(r, i * 2), v = l.x - f.x, m = c.x - f.x, g = l.y - f.y, y = c.y - f.y, b = l.z - f.z, w = c.z - f.z, E = p.x - h.x, S = d.x - h.x, x = p.y - h.y, T = d.y - h.y, N = 1 / (E * T - S * x), C.set((T * v - x * m) * N, (T * g - x * y) * N, (T * b - x * w) * N), k.set((E * m - S * v) * N, (E * y - S * g) * N, (E * w - S * b) * N), o[e].add(C), o[n].add(C), o[i].add(C), u[e].add(k), u[n].add(k), u[i].add(k)
}
function $(e) {
U.fromArray(n, e * 3), z.copy(U), X = o[e], q.copy(X), q.sub(U.multiplyScalar(U.dot(X))).normalize(), R.crossVectors(z, X), V = R.dot(u[e]), W = V < 0 ? -1 : 1, s[e * 4] = q.x, s[e * 4 + 1] = q.y, s[e * 4 + 2] = q.z, s[e * 4 + 3] = W
}
if (this.attributes.index === undefined || this.attributes.position === undefined || this.attributes.normal === undefined || this.attributes.uv === undefined) {
THREE.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");
return
}
var e = this.attributes.index.array,
t = this.attributes.position.array,
n = this.attributes.normal.array,
r = this.attributes.uv.array,
i = t.length / 3;
this.attributes.tangent === undefined && this.addAttribute("tangent", new THREE.BufferAttribute(new Float32Array(4 * i), 4));
var s = this.attributes.tangent.array,
o = [],
u = [];
for (var a = 0; a < i; a++) o[a] = new THREE.Vector3, u[a] = new THREE.Vector3;
var f = new THREE.Vector3,
l = new THREE.Vector3,
c = new THREE.Vector3,
h = new THREE.Vector2,
p = new THREE.Vector2,
d = new THREE.Vector2,
v, m, g, y, b, w, E, S, x, T, N, C = new THREE.Vector3,
k = new THREE.Vector3,
A, O, M, _, D, P, H;
this.drawcalls.length === 0 && this.addDrawCall(0, e.length, 0);
var B = this.drawcalls;
for (M = 0, _ = B.length; M < _; ++M) {
var j = B[M].start,
F = B[M].count,
I = B[M].index;
for (A = j, O = j + F; A < O; A += 3) D = I + e[A], P = I + e[A + 1], H = I + e[A + 2], L(D, P, H)
}
var q = new THREE.Vector3,
R = new THREE.Vector3,
U = new THREE.Vector3,
z = new THREE.Vector3,
W, X, V;
for (M = 0, _ = B.length; M < _; ++M) {
var j = B[M].start,
F = B[M].count,
I = B[M].index;
for (A = j, O = j + F; A < O; A += 3) D = I + e[A], P = I + e[A + 1], H = I + e[A + 2], $(D), $(P), $(H)
}
},
computeOffsets: function(e) {
e === undefined && (e = 65535);
var t = this.attributes.index.array,
n = this.attributes.position.array,
r = t.length / 3,
i = new Uint16Array(t.length),
s = 0,
o = 0,
u = [{
start: 0,
count: 0,
index: 0
}],
a = u[0],
f = 0,
l = 0,
c = new Int32Array(6),
h = new Int32Array(n.length),
p = new Int32Array(n.length);
for (var d = 0; d < n.length; d++) h[d] = -1, p[d] = -1;
for (var v = 0; v < r; v++) {
l = 0;
for (var m = 0; m < 3; m++) {
var g = t[v * 3 + m];
h[g] == -1 ? (c[m * 2] = g, c[m * 2 + 1] = -1, l++) : h[g] < a.index ? (c[m * 2] = g, c[m * 2 + 1] = -1, f++) : (c[m * 2] = g, c[m * 2 + 1] = h[g])
}
var y = o + l;
if (y > a.index + e) {
var b = {
start: s,
count: 0,
index: o
};
u.push(b), a = b;
for (var w = 0; w < 6; w += 2) {
var E = c[w + 1];
E > -1 && E < a.index && (c[w + 1] = -1)
}
}
for (var w = 0; w < 6; w += 2) {
var g = c[w],
E = c[w + 1];
E === -1 && (E = o++), h[g] = E, p[E] = g, i[s++] = E - a.index, a.count++
}
}
return this.reorderBuffers(i, p, o), this.offsets = u, this.drawcalls = u, u
},
merge: function(e, t) {
if (e instanceof THREE.BufferGeometry == 0) {
THREE.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
return
}
t === undefined && (t = 0);
var n = this.attributes;
for (var r in n) {
if (e.attributes[r] === undefined) continue;
var i = n[r],
s = i.array,
o = e.attributes[r],
u = o.array,
a = o.itemSize;
for (var f = 0, l = a * t; f < u.length; f++, l++) s[l] = u[f]
}
return this
},
normalizeNormals: function() {
var e = this.attributes.normal.array,
t, n, r, i;
for (var s = 0, o = e.length; s < o; s += 3) t = e[s], n = e[s + 1], r = e[s + 2], i = 1 / Math.sqrt(t * t + n * n + r * r), e[s] *= i, e[s + 1] *= i, e[s + 2] *= i
},
reorderBuffers: function(e, t, n) {
var r = {};
for (var i in this.attributes) {
if (i == "index") continue;
var s = this.attributes[i].array;
r[i] = new s.constructor(this.attributes[i].itemSize * n)
}
for (var o = 0; o < n; o++) {
var u = t[o];
for (var i in this.attributes) {
if (i == "index") continue;
var a = this.attributes[i].array,
f = this.attributes[i].itemSize,
l = r[i];
for (var c = 0; c < f; c++) l[o * f + c] = a[u * f + c]
}
}
this.attributes.index.array = e;
for (var i in this.attributes) {
if (i == "index") continue;
this.attributes[i].array = r[i], this.attributes[i].numItems = this.attributes[i].itemSize * n
}
},
toJSON: function() {
var e = {
metadata: {
version: 4,
type: "BufferGeometry",
generator: "BufferGeometryExporter"
},
uuid: this.uuid,
type: this.type,
data: {
attributes: {}
}
},
t = this.attributes,
n = this.offsets,
r = this.boundingSphere;
for (var i in t) {
var s = t[i],
o = Array.prototype.slice.call(s.array);
e.data.attributes[i] = {
itemSize: s.itemSize,
type: s.array.constructor.name,
array: o
}
}
return n.length > 0 && (e.data.offsets = JSON.parse(JSON.stringify(n))), r !== null && (e.data.boundingSphere = {
center: r.center.toArray(),
radius: r.radius
}), e
},
clone: function() {
var e = new THREE.BufferGeometry;
for (var t in this.attributes) {
var n = this.attributes[t];
e.addAttribute(t, n.clone())
}
for (var r = 0, i = this.offsets.length; r < i; r++) {
var s = this.offsets[r];
e.offsets.push({
start: s.start,
index: s.index,
count: s.count
})
}
return e
},
dispose: function() {
this.dispatchEvent({
type: "dispose"
})
}
}, THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype), THREE.Geometry = function() {
Object.defineProperty(this, "id", {
value: THREE.GeometryIdCount++
}), this.uuid = THREE.Math.generateUUID(), this.name = "", this.type = "Geometry", this.vertices = [], this.colors = [], this.faces = [], this.faceVertexUvs = [
[]
], this.morphTargets = [], this.morphColors = [], this.morphNormals = [], this.skinWeights = [], this.skinIndices = [], this.lineDistances = [], this.boundingBox = null, this.boundingSphere = null, this.hasTangents = !1, this.dynamic = !0, this.verticesNeedUpdate = !1, this.elementsNeedUpdate = !1, this.uvsNeedUpdate = !1, this.normalsNeedUpdate = !1, this.tangentsNeedUpdate = !1, this.colorsNeedUpdate = !1, this.lineDistancesNeedUpdate = !1, this.groupsNeedUpdate = !1
}, THREE.Geometry.prototype = {
constructor: THREE.Geometry,
applyMatrix: function(e) {
var t = (new THREE.Matrix3).getNormalMatrix(e);
for (var n = 0, r = this.vertices.length; n < r; n++) {
var i = this.vertices[n];
i.applyMatrix4(e)
}
for (var n = 0, r = this.faces.length; n < r; n++) {
var s = this.faces[n];
s.normal.applyMatrix3(t).normalize();
for (var o = 0, u = s.vertexNormals.length; o < u; o++) s.vertexNormals[o].applyMatrix3(t).normalize()
}
this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this.verticesNeedUpdate = !0, this.normalsNeedUpdate = !0
},
fromBufferGeometry: function(e) {
var t = this,
n = e.attributes,
r = n.position.array,
i = n.index !== undefined ? n.index.array : undefined,
s = n.normal !== undefined ? n.normal.array : undefined,
o = n.color !== undefined ? n.color.array : undefined,
u = n.uv !== undefined ? n.uv.array : undefined,
a = [],
f = [];
for (var l = 0, c = 0; l < r.length; l += 3, c += 2) t.vertices.push(new THREE.Vector3(r[l], r[l + 1], r[l + 2])), s !== undefined && a.push(new THREE.Vector3(s[l], s[l + 1], s[l + 2])), o !== undefined && t.colors.push(new THREE.Color(o[l], o[l + 1], o[l + 2])), u !== undefined && f.push(new THREE.Vector2(u[c], u[c + 1]));
var h = function(e, n, r) {
var i = s !== undefined ? [a[e].clone(), a[n].clone(), a[r].clone()] : [],
l = o !== undefined ? [t.colors[e].clone(), t.colors[n].clone(), t.colors[r].clone()] : [];
t.faces.push(new THREE.Face3(e, n, r, i, l)), u !== undefined && t.faceVertexUvs[0].push([f[e].clone(), f[n].clone(), f[r].clone()])
};
if (i !== undefined) {
var p = e.drawcalls;
if (p.length > 0)
for (var l = 0; l < p.length; l++) {
var d = p[l],
v = d.start,
m = d.count,
g = d.index;
for (var c = v, y = v + m; c < y; c += 3) h(g + i[c], g + i[c + 1], g + i[c + 2])
} else
for (var l = 0; l < i.length; l += 3) h(i[l], i[l + 1], i[l + 2])
} else
for (var l = 0; l < r.length / 3; l += 3) h(l, l + 1, l + 2);
return this.computeFaceNormals(), e.boundingBox !== null && (this.boundingBox = e.boundingBox.clone()), e.boundingSphere !== null && (this.boundingSphere = e.boundingSphere.clone()), this
},
center: function() {
this.computeBoundingBox();
var e = this.boundingBox.center().negate();
return this.applyMatrix((new THREE.Matrix4).setPosition(e)), e
},
computeFaceNormals: function() {
var e = new THREE.Vector3,
t = new THREE.Vector3;
for (var n = 0, r = this.faces.length; n < r; n++) {
var i = this.faces[n],
s = this.vertices[i.a],
o = this.vertices[i.b],
u = this.vertices[i.c];
e.subVectors(u, o), t.subVectors(s, o), e.cross(t), e.normalize(), i.normal.copy(e)
}
},
computeVertexNormals: function(e) {
var t, n, r, i, s, o;
o = new Array(this.vertices.length);
for (t = 0, n = this.vertices.length; t < n; t++) o[t] = new THREE.Vector3;
if (e) {
var u, a, f, l = new THREE.Vector3,
c = new THREE.Vector3;
for (r = 0, i = this.faces.length; r < i; r++) s = this.faces[r], u = this.vertices[s.a], a = this.vertices[s.b], f = this.vertices[s.c], l.subVectors(f, a), c.subVectors(u, a), l.cross(c), o[s.a].add(l), o[s.b].add(l), o[s.c].add(l)
} else
for (r = 0, i = this.faces.length; r < i; r++) s = this.faces[r], o[s.a].add(s.normal), o[s.b].add(s.normal), o[s.c].add(s.normal);
for (t = 0, n = this.vertices.length; t < n; t++) o[t].normalize();
for (r = 0, i = this.faces.length; r < i; r++) s = this.faces[r], s.vertexNormals[0] = o[s.a].clone(), s.vertexNormals[1] = o[s.b].clone(), s.vertexNormals[2] = o[s.c].clone()
},
computeMorphNormals: function() {
var e, t, n, r, i;
for (n = 0, r = this.faces.length; n < r; n++) {
i = this.faces[n], i.__originalFaceNormal ? i.__originalFaceNormal.copy(i.normal) : i.__originalFaceNormal = i.normal.clone(), i.__originalVertexNormals || (i.__originalVertexNormals = []);
for (e = 0, t = i.vertexNormals.length; e < t; e++) i.__originalVertexNormals[e] ? i.__originalVertexNormals[e].copy(i.vertexNormals[e]) : i.__originalVertexNormals[e] = i.vertexNormals[e].clone()
}
var s = new THREE.Geometry;
s.faces = this.faces;
for (e = 0, t = this.morphTargets.length; e < t; e++) {
if (!this.morphNormals[e]) {
this.morphNormals[e] = {}, this.morphNormals[e].faceNormals = [], this.morphNormals[e].vertexNormals = [];
var o = this.morphNormals[e].faceNormals,
u = this.morphNormals[e].vertexNormals,
a, f;
for (n = 0, r = this.faces.length; n < r; n++) a = new THREE.Vector3, f = {
a: new THREE.Vector3,
b: new THREE.Vector3,
c: new THREE.Vector3
}, o.push(a), u.push(f)
}
var l = this.morphNormals[e];
s.vertices = this.morphTargets[e].vertices, s.computeFaceNormals(), s.computeVertexNormals();
var a, f;
for (n = 0, r = this.faces.length; n < r; n++) i = this.faces[n], a = l.faceNormals[n], f = l.vertexNormals[n], a.copy(i.normal), f.a.copy(i.vertexNormals[0]), f.b.copy(i.vertexNormals[1]), f.c.copy(i.vertexNormals[2])
}
for (n = 0, r = this.faces.length; n < r; n++) i = this.faces[n], i.normal = i.__originalFaceNormal, i.vertexNormals = i.__originalVertexNormals
},
computeTangents: function() {
function H(e, t, n, r, i, s, o) {
a = e.vertices[t], f = e.vertices[n], l = e.vertices[r], c = u[i], h = u[s], p = u[o], d = f.x - a.x, v = l.x - a.x, m = f.y - a.y, g = l.y - a.y, y = f.z - a.z, b = l.z - a.z, w = h.x - c.x, E = p.x - c.x, S = h.y - c.y, x = p.y - c.y, T = 1 / (w * x - E * S), A.set((x * d - S * v) * T, (x * m - S * g) * T, (x * y - S * b) * T), O.set((w * v - E * d) * T, (w * g - E * m) * T, (w * b - E * y) * T), k[t].add(A), k[n].add(A), k[r].add(A), L[t].add(O), L[n].add(O), L[r].add(O)
}
var e, t, n, r, i, s, o, u, a, f, l, c, h, p, d, v, m, g, y, b, w, E, S, x, T, N, C, k = [],
L = [],
A = new THREE.Vector3,
O = new THREE.Vector3,
M = new THREE.Vector3,
_ = new THREE.Vector3,
D = new THREE.Vector3,
P;
for (n = 0, r = this.vertices.length; n < r; n++) k[n] = new THREE.Vector3, L[n] = new THREE.Vector3;
for (e = 0, t = this.faces.length; e < t; e++) o = this.faces[e], u = this.faceVertexUvs[0][e], H(this, o.a, o.b, o.c, 0, 1, 2);
var B = ["a", "b", "c", "d"];
for (e = 0, t = this.faces.length; e < t; e++) {
o = this.faces[e];
for (i = 0; i < Math.min(o.vertexNormals.length, 3); i++) D.copy(o.vertexNormals[i]), s = o[B[i]], N = k[s], M.copy(N), M.sub(D.multiplyScalar(D.dot(N))).normalize(), _.crossVectors(o.vertexNormals[i], N), C = _.dot(L[s]), P = C < 0 ? -1 : 1, o.vertexTangents[i] = new THREE.Vector4(M.x, M.y, M.z, P)
}
this.hasTangents = !0
},
computeLineDistances: function() {
var e = 0,
t = this.vertices;
for (var n = 0, r = t.length; n < r; n++) n > 0 && (e += t[n].distanceTo(t[n - 1])), this.lineDistances[n] = e
},
computeBoundingBox: function() {
this.boundingBox === null && (this.boundingBox = new THREE.Box3), this.boundingBox.setFromPoints(this.vertices)
},
computeBoundingSphere: function() {
this.boundingSphere === null && (this.boundingSphere = new THREE.Sphere), this.boundingSphere.setFromPoints(this.vertices)
},
merge: function(e, t, n) {
if (e instanceof THREE.Geometry == 0) {
THREE.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
return
}
var r, i = this.vertices.length,
s = this.vertices,
o = e.vertices,
u = this.faces,
a = e.faces,
f = this.faceVertexUvs[0],
l = e.faceVertexUvs[0];
n === undefined && (n = 0), t !== undefined && (r = (new THREE.Matrix3).getNormalMatrix(t));
for (var c = 0, h = o.length; c < h; c++) {
var p = o[c],
d = p.clone();
t !== undefined && d.applyMatrix4(t), s.push(d)
}
for (c = 0, h = a.length; c < h; c++) {
var v = a[c],
m, g, y, b = v.vertexNormals,
w = v.vertexColors;
m = new THREE.Face3(v.a + i, v.b + i, v.c + i), m.normal.copy(v.normal), r !== undefined && m.normal.applyMatrix3(r).normalize();
for (var E = 0, S = b.length; E < S; E++) g = b[E].clone(), r !== undefined && g.applyMatrix3(r).normalize(), m.vertexNormals.push(g);
m.color.copy(v.color);
for (var E = 0, S = w.length; E < S; E++) y = w[E], m.vertexColors.push(y.clone());
m.materialIndex = v.materialIndex + n, u.push(m)
}
for (c = 0, h = l.length; c < h; c++) {
var x = l[c],
T = [];
if (x === undefined) continue;
for (var E = 0, S = x.length; E < S; E++) T.push(x[E].clone());
f.push(T)
}
},
mergeMesh: function(e) {
if (e instanceof THREE.Mesh == 0) {
THREE.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e);
return
}
e.matrixAutoUpdate && e.updateMatrix(), this.merge(e.geometry, e.matrix)
},
mergeVertices: function() {
var e = {},
t = [],
n = [],
r, i, s = 4,
o = Math.pow(10, s),
u, a, f, l, c, h;
for (u = 0, a = this.vertices.length; u < a; u++) r = this.vertices[u], i = Math.round(r.x * o) + "_" + Math.round(r.y * o) + "_" + Math.round(r.z * o), e[i] === undefined ? (e[i] = u, t.push(this.vertices[u]), n[u] = t.length - 1) : n[u] = n[e[i]];
var p = [];
for (u = 0, a = this.faces.length; u < a; u++) {
f = this.faces[u], f.a = n[f.a], f.b = n[f.b], f.c = n[f.c], l = [f.a, f.b, f.c];
var d = -1;
for (var v = 0; v < 3; v++)
if (l[v] == l[(v + 1) % 3]) {
d = v, p.push(u);
break
}
}
for (u = p.length - 1; u >= 0; u--) {
var m = p[u];
this.faces.splice(m, 1);
for (c = 0, h = this.faceVertexUvs.length; c < h; c++) this.faceVertexUvs[c].splice(m, 1)
}
var g = this.vertices.length - t.length;
return this.vertices = t, g
},
toJSON: function() {
function N(e, t, n) {
return n ? e | 1 << t : e & ~(1 << t)
}
function C(e) {
var t = e.x.toString() + e.y.toString() + e.z.toString();
return a[t] !== undefined ? a[t] : (a[t] = u.length / 3, u.push(e.x, e.y, e.z), a[t])
}
function k(e) {
var t = e.r.toString() + e.g.toString() + e.b.toString();
return l[t] !== undefined ? l[t] : (l[t] = f.length, f.push(e.getHex()), l[t])
}
function L(e) {
var t = e.x.toString() + e.y.toString();
return h[t] !== undefined ? h[t] : (h[t] = c.length / 2, c.push(e.x, e.y), h[t])
}
var e = {
metadata: {
version: 4,
type: "BufferGeometry",
generator: "BufferGeometryExporter"
},
uuid: this.uuid,
type: this.type
};
this.name !== "" && (e.name = this.name);
if (this.parameters !== undefined) {
var t = this.parameters;
for (var n in t) t[n] !== undefined && (e[n] = t[n]);
return e
}
var r = [];
for (var i = 0; i < this.vertices.length; i++) {
var s = this.vertices[i];
r.push(s.x, s.y, s.z)
}
var o = [],
u = [],
a = {},
f = [],
l = {},
c = [],
h = {};
for (var i = 0; i < this.faces.length; i++) {
var p = this.faces[i],
d = !1,
v = !1,
m = this.faceVertexUvs[0][i] !== undefined,
g = p.normal.length() > 0,
y = p.vertexNormals.length > 0,
b = p.color.r !== 1 || p.color.g !== 1 || p.color.b !== 1,
w = p.vertexColors.length > 0,
E = 0;
E = N(E, 0, 0), E = N(E, 1, d), E = N(E, 2, v), E = N(E, 3, m), E = N(E, 4, g), E = N(E, 5, y), E = N(E, 6, b), E = N(E, 7, w), o.push(E), o.push(p.a, p.b, p.c);
if (m) {
var S = this.faceVertexUvs[0][i];
o.push(L(S[0]), L(S[1]), L(S[2]))
}
g && o.push(C(p.normal));
if (y) {
var x = p.vertexNormals;
o.push(C(x[0]), C(x[1]), C(x[2]))
}
b && o.push(k(p.color));
if (w) {
var T = p.vertexColors;
o.push(k(T[0]), k(T[1]), k(T[2]))
}
}
return e.data = {}, e.data.vertices = r, e.data.normals = u, f.length > 0 && (e.data.colors = f), c.length > 0 && (e.data.uvs = [c]), e.data.faces = o, e
},
clone: function() {
var e = new THREE.Geometry,
t = this.vertices;
for (var n = 0, r = t.length; n < r; n++) e.vertices.push(t[n].clone());
var i = this.faces;
for (var n = 0, r = i.length; n < r; n++) e.faces.push(i[n].clone());
for (var n = 0, r = this.faceVertexUvs.length; n < r; n++) {
var s = this.faceVertexUvs[n];
e.faceVertexUvs[n] === undefined && (e.faceVertexUvs[n] = []);
for (var o = 0, u = s.length; o < u; o++) {
var a = s[o],
f = [];
for (var l = 0, c = a.length; l < c; l++) {
var h = a[l];
f.push(h.clone())
}
e.faceVertexUvs[n].push(f)
}
}
return e
},
dispose: function() {
this.dispatchEvent({
type: "dispose"
})
}
}, THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype), THREE.GeometryIdCount = 0, THREE.Camera = function() {
THREE.Object3D.call(this), this.type = "Camera", this.matrixWorldInverse = new THREE.Matrix4, this.projectionMatrix = new THREE.Matrix4
}, THREE.Camera.prototype = Object.create(THREE.Object3D.prototype), THREE.Camera.prototype.constructor = THREE.Camera, THREE.Camera.prototype.getWorldDirection = function() {
var e = new THREE.Quaternion;
return function(t) {
var n = t || new THREE.Vector3;
return this.getWorldQuaternion(e), n.set(0, 0, -1).applyQuaternion(e)
}
}(), THREE.Camera.prototype.lookAt = function() {
var e = new THREE.Matrix4;
return function(t) {
e.lookAt(this.position, t, this.up), this.quaternion.setFromRotationMatrix(e)
}
}(), THREE.Camera.prototype.clone = function(e) {
return e === undefined && (e = new THREE.Camera), THREE.Object3D.prototype.clone.call(this, e), e.matrixWorldInverse.copy(this.matrixWorldInverse), e.projectionMatrix.copy(this.projectionMatrix), e
}, THREE.OrthographicCamera = function(e, t, n, r, i, s) {
THREE.Camera.call(this), this.type = "OrthographicCamera", this.zoom = 1, this.left = e, this.right = t, this.top = n, this.bottom = r, this.near = i !== undefined ? i : .1, this.far = s !== undefined ? s : 2e3, this.updateProjectionMatrix()
}, THREE.OrthographicCamera.prototype = Object.create(THREE.Camera.prototype), THREE.OrthographicCamera.prototype.constructor = THREE.OrthographicCamera, THREE.OrthographicCamera.prototype.updateProjectionMatrix = function() {
var e = (this.right - this.left) / (2 * this.zoom),
t = (this.top - this.bottom) / (2 * this.zoom),
n = (this.right + this.left) / 2,
r = (this.top + this.bottom) / 2;
this.projectionMatrix.makeOrthographic(n - e, n + e, r + t, r - t, this.near, this.far)
}, THREE.OrthographicCamera.prototype.clone = function() {
var e = new THREE.OrthographicCamera;
return THREE.Camera.prototype.clone.call(this, e), e.zoom = this.zoom, e.left = this.left, e.right = this.right, e.top = this.top, e.bottom = this.bottom, e.near = this.near, e.far = this.far, e.projectionMatrix.copy(this.projectionMatrix), e
}, THREE.PerspectiveCamera = function(e, t, n, r) {
THREE.Camera.call(this), this.type = "PerspectiveCamera", this.zoom = 1, this.fov = e !== undefined ? e : 50, this.aspect = t !== undefined ? t : 1, this.near = n !== undefined ? n : .1, this.far = r !== undefined ? r : 2e3, this.updateProjectionMatrix()
}, THREE.PerspectiveCamera.prototype = Object.create(THREE.Camera.prototype), THREE.PerspectiveCamera.prototype.constructor = THREE.PerspectiveCamera, THREE.PerspectiveCamera.prototype.setLens = function(e, t) {
t === undefined && (t = 24), this.fov = 2 * THREE.Math.radToDeg(Math.atan(t / (e * 2))), this.updateProjectionMatrix()
}, THREE.PerspectiveCamera.prototype.setViewOffset = function(e, t, n, r, i, s) {
this.fullWidth = e, this.fullHeight = t, this.x = n, this.y = r, this.width = i, this.height = s, this.updateProjectionMatrix()
}, THREE.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
var e = THREE.Math.radToDeg(2 * Math.atan(Math.tan(THREE.Math.degToRad(this.fov) * .5) / this.zoom));
if (this.fullWidth) {
var t = this.fullWidth / this.fullHeight,
n = Math.tan(THREE.Math.degToRad(e * .5)) * this.near,
r = -n,
i = t * r,
s = t * n,
o = Math.abs(s - i),
u = Math.abs(n - r);
this.projectionMatrix.makeFrustum(i + this.x * o / this.fullWidth, i + (this.x + this.width) * o / this.fullWidth, n - (this.y + this.height) * u / this.fullHeight, n - this.y * u / this.fullHeight, this.near, this.far)
} else this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
}, THREE.PerspectiveCamera.prototype.clone = function() {
var e = new THREE.PerspectiveCamera;
return THREE.Camera.prototype.clone.call(this, e), e.zoom = this.zoom, e.fov = this.fov, e.aspect = this.aspect, e.near = this.near, e.far = this.far, e.projectionMatrix.copy(this.projectionMatrix), e
}, THREE.Cache = {
files: {},
add: function(e, t) {
this.files[e] = t
},
get: function(e) {
return this.files[e]
},
remove: function(e) {
delete this.files[e]
},
clear: function() {
this.files = {}
}
}, THREE.Loader = function(e) {
this.showStatus = e, this.statusDomElement = e ? THREE.Loader.prototype.addStatusElement() : null, this.imageLoader = new THREE.ImageLoader, this.onLoadStart = function() {}, this.onLoadProgress = function() {}, this.onLoadComplete = function() {}
}, THREE.Loader.prototype = {
constructor: THREE.Loader,
crossOrigin: undefined,
addStatusElement: function() {
var e = document.createElement("div");
return e.style.position = "absolute", e.style.right = "0px", e.style.top = "0px", e.style.fontSize = "0.8em", e.style.textAlign = "left", e.style.background = "rgba(0,0,0,0.25)", e.style.color = "#fff", e.style.width = "120px", e.style.padding = "0.5em 0.5em 0.5em 0.5em", e.style.zIndex = 1e3, e.innerHTML = "Loading ...", e
},
updateProgress: function(e) {
var t = "Loaded ";
e.total ? t += (100 * e.loaded / e.total).toFixed(0) + "%" : t += (e.loaded / 1024).toFixed(2) + " KB", this.statusDomElement.innerHTML = t
},
extractUrlBase: function(e) {
var t = e.split("/");
return t.length === 1 ? "./" : (t.pop(), t.join("/") + "/")
},
initMaterials: function(e, t) {
var n = [];
for (var r = 0; r < e.length; ++r) n[r] = this.createMaterial(e[r], t);
return n
},
needsTangents: function(e) {
for (var t = 0, n = e.length; t < n; t++) {
var r = e[t];
if (r instanceof THREE.ShaderMaterial) return !0
}
return !1
},
createMaterial: function(e, t) {
function r(e) {
var t = Math.log(e) / Math.LN2;
return Math.pow(2, Math.round(t))
}
function i(e, i, s, o, u, a, f) {
var l = t + s,
c, h = THREE.Loader.Handlers.get(l);
h !== null ? c = h.load(l) : (c = new THREE.Texture, h = n.imageLoader, h.crossOrigin = n.crossOrigin, h.load(l, function(e) {
if (THREE.Math.isPowerOfTwo(e.width) === !1 || THREE.Math.isPowerOfTwo(e.height) === !1) {
var t = r(e.width),
n = r(e.height),
i = document.createElement("canvas");
i.width = t, i.height = n;
var s = i.getContext("2d");
s.drawImage(e, 0, 0, t, n), c.image = i
} else c.image = e;
c.needsUpdate = !0
})), c.sourceFile = s, o && (c.repeat.set(o[0], o[1]), o[0] !== 1 && (c.wrapS = THREE.RepeatWrapping), o[1] !== 1 && (c.wrapT = THREE.RepeatWrapping)), u && c.offset.set(u[0], u[1]);
if (a) {
var p = {
repeat: THREE.RepeatWrapping,
mirror: THREE.MirroredRepeatWrapping
};
p[a[0]] !== undefined && (c.wrapS = p[a[0]]), p[a[1]] !== undefined && (c.wrapT = p[a[1]])
}
f && (c.anisotropy = f), e[i] = c
}
function s(e) {
return (e[0] * 255 << 16) + (e[1] * 255 << 8) + e[2] * 255
}
var n = this,
o = "MeshLambertMaterial",
u = {
color: 15658734,
opacity: 1,
map: null,
lightMap: null,
normalMap: null,
bumpMap: null,
wireframe: !1
};
if (e.shading) {
var a = e.shading.toLowerCase();
a === "phong" ? o = "MeshPhongMaterial" : a === "basic" && (o = "MeshBasicMaterial")
}
e.blending !== undefined && THREE[e.blending] !== undefined && (u.blending = THREE[e.blending]), e.transparent !== undefined && (u.transparent = e.transparent), e.opacity !== undefined && e.opacity < 1 && (u.transparent = !0), e.depthTest !== undefined && (u.depthTest = e.depthTest), e.depthWrite !== undefined && (u.depthWrite = e.depthWrite), e.visible !== undefined && (u.visible = e.visible), e.flipSided !== undefined && (u.side = THREE.BackSide), e.doubleSided !== undefined && (u.side = THREE.DoubleSide), e.wireframe !== undefined && (u.wireframe = e.wireframe), e.vertexColors !== undefined && (e.vertexColors === "face" ? u.vertexColors = THREE.FaceColors : e.vertexColors && (u.vertexColors = THREE.VertexColors)), e.colorDiffuse ? u.color = s(e.colorDiffuse) : e.DbgColor && (u.color = e.DbgColor), e.colorSpecular && (u.specular = s(e.colorSpecular)), e.colorEmissive && (u.emissive = s(e.colorEmissive)), e.transparency !== undefined && (console.warn("THREE.Loader: transparency has been renamed to opacity"), e.opacity = e.transparency), e.opacity !== undefined && (u.opacity = e.opacity), e.specularCoef && (u.shininess = e.specularCoef), e.mapDiffuse && t && i(u, "map", e.mapDiffuse, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy), e.mapLight && t && i(u, "lightMap", e.mapLight, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy), e.mapBump && t && i(u, "bumpMap", e.mapBump, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy), e.mapNormal && t && i(u, "normalMap", e.mapNormal, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy), e.mapSpecular && t && i(u, "specularMap", e.mapSpecular, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy), e.mapAlpha && t && i(u, "alphaMap", e.mapAlpha, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy), e.mapBumpScale && (u.bumpScale = e.mapBumpScale), e.mapNormalFactor && (u.normalScale = new THREE.Vector2(e.mapNormalFactor, e.mapNormalFactor));
var f = new THREE[o](u);
return e.DbgName !== undefined && (f.name = e.DbgName), f
}
}, THREE.Loader.Handlers = {
handlers: [],
add: function(e, t) {
this.handlers.push(e, t)
},
get: function(e) {
for (var t = 0, n = this.handlers.length; t < n; t += 2) {
var r = this.handlers[t],
i = this.handlers[t + 1];
if (r.test(e)) return i
}
return null
}
}, THREE.ImageLoader = function(e) {
this.manager = e !== undefined ? e : THREE.DefaultLoadingManager
}, THREE.ImageLoader.prototype = {
constructor: THREE.ImageLoader,
load: function(e, t, n, r) {
var i = this,
s = THREE.Cache.get(e);
if (s !== undefined) {
t(s);
return
}
var o = document.createElement("img");
return o.addEventListener("load", function(n) {
THREE.Cache.add(e, this), t && t(this), i.manager.itemEnd(e)
}, !1), n !== undefined && o.addEventListener("progress", function(e) {
n(e)
}, !1), r !== undefined && o.addEventListener("error", function(e) {
r(e)
}, !1), this.crossOrigin !== undefined && (o.crossOrigin = this.crossOrigin), o.src = e, i.manager.itemStart(e), o
},
setCrossOrigin: function(e) {
this.crossOrigin = e
}
}, THREE.LoadingManager = function(e, t, n) {
var r = this,
i = 0,
s = 0;
this.onLoad = e, this.onProgress = t, this.onError = n, this.itemStart = function(e) {
s++
}, this.itemEnd = function(e) {
i++, r.onProgress !== undefined && r.onProgress(e, i, s), i === s && r.onLoad !== undefined && r.onLoad()
}
}, THREE.DefaultLoadingManager = new THREE.LoadingManager, THREE.Material = function() {
Object.defineProperty(this, "id", {
value: THREE.MaterialIdCount++
}), this.uuid = THREE.Math.generateUUID(), this.name = "", this.type = "Material", this.side = THREE.FrontSide, this.opacity = 1, this.transparent = !1, this.blending = THREE.NormalBlending, this.blendSrc = THREE.SrcAlphaFactor, this.blendDst = THREE.OneMinusSrcAlphaFactor, this.blendEquation = THREE.AddEquation, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.depthTest = !0, this.depthWrite = !0, this.colorWrite = !0, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.alphaTest = 0, this.overdraw = 0, this.visible = !0, this._needsUpdate = !0
}, THREE.Material.prototype = {
constructor: THREE.Material,
get needsUpdate() {
return this._needsUpdate
},
set needsUpdate(e) {
e === !0 && this.update(), this._needsUpdate = e
},
setValues: function(e) {
if (e === undefined) return;
for (var t in e) {
var n = e[t];
if (n === undefined) {
THREE.warn("THREE.Material: '" + t + "' parameter is undefined.");
continue
}
if (t in this) {
var r = this[t];
r instanceof THREE.Color ? r.set(n) : r instanceof THREE.Vector3 && n instanceof THREE.Vector3 ? r.copy(n) : t == "overdraw" ? this[t] = Number(n) : this[t] = n
}
}
},
toJSON: function() {
var e = {
metadata: {
version: 4.2,
type: "material",
generator: "MaterialExporter"
},
uuid: this.uuid,
type: this.type
};
return this.name !== "" && (e.name = this.name), this instanceof THREE.MeshBasicMaterial ? (e.color = this.color.getHex(), this.vertexColors !== THREE.NoColors && (e.vertexColors = this.vertexColors), this.blending !== THREE.NormalBlending && (e.blending = this.blending), this.side !== THREE.FrontSide && (e.side = this.side)) : this instanceof THREE.MeshLambertMaterial ? (e.color = this.color.getHex(), e.emissive = this.emissive.getHex(), this.vertexColors !== THREE.NoColors && (e.vertexColors = this.vertexColors), this.shading !== THREE.SmoothShading && (e.shading = this.shading), this.blending !== THREE.NormalBlending && (e.blending = this.blending), this.side !== THREE.FrontSide && (e.side = this.side)) : this instanceof THREE.MeshPhongMaterial ? (e.color = this.color.getHex(), e.emissive = this.emissive.getHex(), e.specular = this.specular.getHex(), e.shininess = this.shininess, this.vertexColors !== THREE.NoColors && (e.vertexColors = this.vertexColors), this.shading !== THREE.SmoothShading && (e.shading = this.shading), this.blending !== THREE.NormalBlending && (e.blending = this.blending), this.side !== THREE.FrontSide && (e.side = this.side)) : this instanceof THREE.MeshNormalMaterial ? (this.blending !== THREE.NormalBlending && (e.blending = this.blending), this.side !== THREE.FrontSide && (e.side = this.side)) : this instanceof THREE.MeshDepthMaterial ? (this.blending !== THREE.NormalBlending && (e.blending = this.blending), this.side !== THREE.FrontSide && (e.side = this.side)) : this instanceof THREE.PointCloudMaterial ? (e.size = this.size, e.sizeAttenuation = this.sizeAttenuation, e.color = this.color.getHex(), this.vertexColors !== THREE.NoColors && (e.vertexColors = this.vertexColors), this.blending !== THREE.NormalBlending && (e.blending = this.blending)) : this instanceof THREE.ShaderMaterial ? (e.uniforms = this.uniforms, e.vertexShader = this.vertexShader, e.fragmentShader = this.fragmentShader) : this instanceof THREE.SpriteMaterial && (e.color = this.color.getHex()), this.opacity < 1 && (e.opacity = this.opacity), this.transparent !== !1 && (e.transparent = this.transparent), this.wireframe !== !1 && (e.wireframe = this.wireframe), e
},
clone: function(e) {
return e === undefined && (e = new THREE.Material), e.name = this.name, e.side = this.side, e.opacity = this.opacity, e.transparent = this.transparent, e.blending = this.blending, e.blendSrc = this.blendSrc, e.blendDst = this.blendDst, e.blendEquation = this.blendEquation, e.blendSrcAlpha = this.blendSrcAlpha, e.blendDstAlpha = this.blendDstAlpha, e.blendEquationAlpha = this.blendEquationAlpha, e.depthTest = this.depthTest, e.depthWrite = this.depthWrite, e.polygonOffset = this.polygonOffset, e.polygonOffsetFactor = this.polygonOffsetFactor, e.polygonOffsetUnits = this.polygonOffsetUnits, e.alphaTest = this.alphaTest, e.overdraw = this.overdraw, e.visible = this.visible, e
},
update: function() {
this.dispatchEvent({
type: "update"
})
},
dispose: function() {
this.dispatchEvent({
type: "dispose"
})
}
}, THREE.EventDispatcher.prototype.apply(THREE.Material.prototype), THREE.MaterialIdCount = 0, THREE.ShaderMaterial = function(e) {
THREE.Material.call(this), this.type = "ShaderMaterial", this.defines = {}, this.uniforms = {}, this.attributes = null, this.vertexShader = "void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}", this.fragmentShader = "void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}", this.shading = THREE.SmoothShading, this.linewidth = 1, this.wireframe = !1, this.wireframeLinewidth = 1, this.fog = !1, this.lights = !1, this.vertexColors = THREE.NoColors, this.skinning = !1, this.morphTargets = !1, this.morphNormals = !1, this.defaultAttributeValues = {
color: [1, 1, 1],
uv: [0, 0],
uv2: [0, 0]
}, this.index0AttributeName = undefined, this.setValues(e)
}, THREE.ShaderMaterial.prototype = Object.create(THREE.Material.prototype), THREE.ShaderMaterial.prototype.constructor = THREE.ShaderMaterial, THREE.ShaderMaterial.prototype.clone = function(e) {
return e === undefined && (e = new THREE.ShaderMaterial), THREE.Material.prototype.clone.call(this, e), e.fragmentShader = this.fragmentShader, e.vertexShader = this.vertexShader, e.uniforms = THREE.UniformsUtils.clone(this.uniforms), e.attributes = this.attributes, e.defines = this.defines, e.shading = this.shading, e.wireframe = this.wireframe, e.wireframeLinewidth = this.wireframeLinewidth, e.fog = this.fog, e.lights = this.lights, e.vertexColors = this.vertexColors, e.skinning = this.skinning, e.morphTargets = this.morphTargets, e.morphNormals = this.morphNormals, e
}, THREE.RawShaderMaterial = function(e) {
THREE.ShaderMaterial.call(this, e), this.type = "RawShaderMaterial"
}, THREE.RawShaderMaterial.prototype = Object.create(THREE.ShaderMaterial.prototype), THREE.RawShaderMaterial.prototype.constructor = THREE.RawShaderMaterial, THREE.RawShaderMaterial.prototype.clone = function() {
var e = new THREE.RawShaderMaterial;
return THREE.ShaderMaterial.prototype.clone.call(this, e), e
}, THREE.Texture = function(e, t, n, r, i, s, o, u, a) {
Object.defineProperty(this, "id", {
value: THREE.TextureIdCount++
}), this.uuid = THREE.Math.generateUUID(), this.name = "", this.sourceFile = "", this.image = e !== undefined ? e : THREE.Texture.DEFAULT_IMAGE, this.mipmaps = [], this.mapping = t !== undefined ? t : THREE.Texture.DEFAULT_MAPPING, this.wrapS = n !== undefined ? n : THREE.ClampToEdgeWrapping, this.wrapT = r !== undefined ? r : THREE.ClampToEdgeWrapping, this.magFilter = i !== undefined ? i : THREE.LinearFilter, this.minFilter = s !== undefined ? s : THREE.LinearMipMapLinearFilter, this.anisotropy = a !== undefined ? a : 1, this.format = o !== undefined ? o : THREE.RGBAFormat, this.type = u !== undefined ? u : THREE.UnsignedByteType, this.offset = new THREE.Vector2(0, 0), this.repeat = new THREE.Vector2(1, 1), this.generateMipmaps = !0, this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this._needsUpdate = !1, this.onUpdate = null
}, THREE.Texture.DEFAULT_IMAGE = undefined, THREE.Texture.DEFAULT_MAPPING = THREE.UVMapping, THREE.Texture.prototype = {
constructor: THREE.Texture,
get needsUpdate() {
return this._needsUpdate
},
set needsUpdate(e) {
e === !0 && this.update(), this._needsUpdate = e
},
clone: function(e) {
return e === undefined && (e = new THREE.Texture), e.image = this.image, e.mipmaps = this.mipmaps.slice(0), e.mapping = this.mapping, e.wrapS = this.wrapS, e.wrapT = this.wrapT, e.magFilter = this.magFilter, e.minFilter = this.minFilter, e.anisotropy = this.anisotropy, e.format = this.format, e.type = this.type, e.offset.copy(this.offset), e.repeat.copy(this.repeat), e.generateMipmaps = this.generateMipmaps, e.premultiplyAlpha = this.premultiplyAlpha, e.flipY = this.flipY, e.unpackAlignment = this.unpackAlignment, e
},
update: function() {
this.dispatchEvent({
type: "update"
})
},
dispose: function() {
this.dispatchEvent({
type: "dispose"
})
}
}, THREE.EventDispatcher.prototype.apply(THREE.Texture.prototype), THREE.TextureIdCount = 0, THREE.CubeTexture = function(e, t, n, r, i, s, o, u, a) {
t = t !== undefined ? t : THREE.CubeReflectionMapping, THREE.Texture.call(this, e, t, n, r, i, s, o, u, a), this.images = e
}, THREE.CubeTexture.prototype = Object.create(THREE.Texture.prototype), THREE.CubeTexture.prototype.constructor = THREE.CubeTexture, THREE.CubeTexture.clone = function(e) {
return e === undefined && (e = new THREE.CubeTexture), THREE.Texture.prototype.clone.call(this, e), e.images = this.images, e
}, THREE.VideoTexture = function(e, t, n, r, i, s, o, u, a) {
THREE.Texture.call(this, e, t, n, r, i, s, o, u, a), this.generateMipmaps = !1;
var f = this,
l = function() {
requestAnimationFrame(l), e.readyState === e.HAVE_ENOUGH_DATA && (f.needsUpdate = !0)
};
l()
}, THREE.VideoTexture.prototype = Object.create(THREE.Texture.prototype), THREE.VideoTexture.prototype.constructor = THREE.VideoTexture, THREE.Group = function() {
THREE.Object3D.call(this), this.type = "Group"
}, THREE.Group.prototype = Object.create(THREE.Object3D.prototype), THREE.Group.prototype.constructor = THREE.Group, THREE.Line = function(e, t, n) {
THREE.Object3D.call(this), this.type = "Line", this.geometry = e !== undefined ? e : new THREE.Geometry, this.material = t !== undefined ? t : new THREE.LineBasicMaterial({
color: Math.random() * 16777215
}), this.mode = n !== undefined ? n : THREE.LineStrip
}, THREE.LineStrip = 0, THREE.LinePieces = 1, THREE.Line.prototype = Object.create(THREE.Object3D.prototype), THREE.Line.prototype.constructor = THREE.Line, THREE.Line.prototype.raycast = function() {
var e = new THREE.Matrix4,
t = new THREE.Ray,
n = new THREE.Sphere;
return function(r, i) {
var s = r.linePrecision,
o = s * s,
u = this.geometry;
u.boundingSphere === null && u.computeBoundingSphere(), n.copy(u.boundingSphere), n.applyMatrix4(this.matrixWorld);
if (r.ray.isIntersectionSphere(n) === !1) return;
e.getInverse(this.matrixWorld), t.copy(r.ray).applyMatrix4(e);
var a = new THREE.Vector3,
f = new THREE.Vector3,
l = new THREE.Vector3,
c = new THREE.Vector3,
h = this.mode === THREE.LineStrip ? 1 : 2;
if (u instanceof THREE.BufferGeometry) {
var p = u.attributes;
if (p.index !== undefined) {
var d = p.index.array,
v = p.position.array,
m = u.offsets;
m.length === 0 && (m = [{
start: 0,
count: d.length,
index: 0
}]);
for (var g = 0; g < m.length; g++) {
var y = m[g].start,
b = m[g].count,
w = m[g].index;
for (var E = y; E < y + b - 1; E += h) {
var S = w + d[E],
x = w + d[E + 1];
a.fromArray(v, S * 3), f.fromArray(v, x * 3);
var T = t.distanceSqToSegment(a, f, c, l);
if (T > o) continue;
var N = t.origin.distanceTo(c);
if (N < r.near || N > r.far) continue;
i.push({
distance: N,
point: l.clone().applyMatrix4(this.matrixWorld),
index: E,
offsetIndex: g,
face: null,
faceIndex: null,
object: this
})
}
}
} else {
var v = p.position.array;
for (var E = 0; E < v.length / 3 - 1; E += h) {
a.fromArray(v, 3 * E), f.fromArray(v, 3 * E + 3);
var T = t.distanceSqToSegment(a, f, c, l);
if (T > o) continue;
var N = t.origin.distanceTo(c);
if (N < r.near || N > r.far) continue;
i.push({
distance: N,
point: l.clone().applyMatrix4(this.matrixWorld),
index: E,
face: null,
faceIndex: null,
object: this
})
}
}
} else if (u instanceof THREE.Geometry) {
var C = u.vertices,
k = C.length;
for (var E = 0; E < k - 1; E += h) {
var T = t.distanceSqToSegment(C[E], C[E + 1], c, l);
if (T > o) continue;
var N = t.origin.distanceTo(c);
if (N < r.near || N > r.far) continue;
i.push({
distance: N,
point: l.clone().applyMatrix4(this.matrixWorld),
index: E,
face: null,
faceIndex: null,
object: this
})
}
}
}
}(), THREE.Line.prototype.clone = function(e) {
return e === undefined && (e = new THREE.Line(this.geometry, this.material, this.mode)), THREE.Object3D.prototype.clone.call(this, e), e
}, THREE.Mesh = function(e, t) {
THREE.Object3D.call(this), this.type = "Mesh", this.geometry = e !== undefined ? e : new THREE.Geometry, this.material = t !== undefined ? t : new THREE.MeshBasicMaterial({
color: Math.random() * 16777215
}), this.updateMorphTargets()
}, THREE.Mesh.prototype = Object.create(THREE.Object3D.prototype), THREE.Mesh.prototype.constructor = THREE.Mesh, THREE.Mesh.prototype.updateMorphTargets = function() {
if (this.geometry.morphTargets !== undefined && this.geometry.morphTargets.length > 0) {
this.morphTargetBase = -1, this.morphTargetForcedOrder = [], this.morphTargetInfluences = [], this.morphTargetDictionary = {};
for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++) this.morphTargetInfluences.push(0), this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
}
}, THREE.Mesh.prototype.getMorphTargetIndexByName = function(e) {
return this.morphTargetDictionary[e] !== undefined ? this.morphTargetDictionary[e] : (THREE.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."), 0)
}, THREE.Mesh.prototype.raycast = function() {
var e = new THREE.Matrix4,
t = new THREE.Ray,
n = new THREE.Sphere,
r = new THREE.Vector3,
i = new THREE.Vector3,
s = new THREE.Vector3;
return function(o, u) {
var a = this.geometry;
a.boundingSphere === null && a.computeBoundingSphere(), n.copy(a.boundingSphere), n.applyMatrix4(this.matrixWorld);
if (o.ray.isIntersectionSphere(n) === !1) return;
e.getInverse(this.matrixWorld), t.copy(o.ray).applyMatrix4(e);
if (a.boundingBox !== null && t.isIntersectionBox(a.boundingBox) === !1) return;
if (a instanceof THREE.BufferGeometry) {
var f = this.material;
if (f === undefined) return;
var l = a.attributes,
c, h, p, d = o.precision;
if (l.index !== undefined) {
var v = l.index.array,
m = l.position.array,
g = a.offsets;
g.length === 0 && (g = [{
start: 0,
count: v.length,
index: 0
}]);
for (var y = 0, b = g.length; y < b; ++y) {
var w = g[y].start,
E = g[y].count,
S = g[y].index;
for (var x = w, T = w + E; x < T; x += 3) {
c = S + v[x], h = S + v[x + 1], p = S + v[x + 2], r.fromArray(m, c * 3), i.fromArray(m, h * 3), s.fromArray(m, p * 3);
if (f.side === THREE.BackSide) var N = t.intersectTriangle(s, i, r, !0);
else var N = t.intersectTriangle(r, i, s, f.side !== THREE.DoubleSide);
if (N === null) continue;
N.applyMatrix4(this.matrixWorld);
var C = o.ray.origin.distanceTo(N);
if (C < d || C < o.near || C > o.far) continue;
u.push({
distance: C,
point: N,
face: new THREE.Face3(c, h, p, THREE.Triangle.normal(r, i, s)),
faceIndex: null,
object: this
})
}
}
} else {
var m = l.position.array;
for (var x = 0, k = 0, T = m.length; x < T; x += 3, k += 9) {
c = x, h = x + 1, p = x + 2, r.fromArray(m, k), i.fromArray(m, k + 3), s.fromArray(m, k + 6);
if (f.side === THREE.BackSide) var N = t.intersectTriangle(s, i, r, !0);
else var N = t.intersectTriangle(r, i, s, f.side !== THREE.DoubleSide);
if (N === null) continue;
N.applyMatrix4(this.matrixWorld);
var C = o.ray.origin.distanceTo(N);
if (C < d || C < o.near || C > o.far) continue;
u.push({
distance: C,
point: N,
face: new THREE.Face3(c, h, p, THREE.Triangle.normal(r, i, s)),
faceIndex: null,
object: this
})
}
}
} else if (a instanceof THREE.Geometry) {
var L = this.material instanceof THREE.MeshFaceMaterial,
A = L === !0 ? this.material.materials : null,
c, h, p, d = o.precision,
O = a.vertices;
for (var M = 0, _ = a.faces.length; M < _; M++) {
var D = a.faces[M],
f = L === !0 ? A[D.materialIndex] : this.material;
if (f === undefined) continue;
c = O[D.a], h = O[D.b], p = O[D.c];
if (f.morphTargets === !0) {
var P = a.morphTargets,
H = this.morphTargetInfluences;
r.set(0, 0, 0), i.set(0, 0, 0), s.set(0, 0, 0);
for (var B = 0, j = P.length; B < j; B++) {
var F = H[B];
if (F === 0) continue;
var I = P[B].vertices;
r.x += (I[D.a].x - c.x) * F, r.y += (I[D.a].y - c.y) * F, r.z += (I[D.a].z - c.z) * F, i.x += (I[D.b].x - h.x) * F, i.y += (I[D.b].y - h.y) * F, i.z += (I[D.b].z - h.z) * F, s.x += (I[D.c].x - p.x) * F, s.y += (I[D.c].y - p.y) * F, s.z += (I[D.c].z - p.z) * F
}
r.add(c), i.add(h), s.add(p), c = r, h = i, p = s
}
if (f.side === THREE.BackSide) var N = t.intersectTriangle(p, h, c, !0);
else var N = t.intersectTriangle(c, h, p, f.side !== THREE.DoubleSide);
if (N === null) continue;
N.applyMatrix4(this.matrixWorld);
var C = o.ray.origin.distanceTo(N);
if (C < d || C < o.near || C > o.far) continue;
u.push({
distance: C,
point: N,
face: D,
faceIndex: M,
object: this
})
}
}
}
}(), THREE.Mesh.prototype.clone = function(e, t) {
return e === undefined && (e = new THREE.Mesh(this.geometry, this.material)), THREE.Object3D.prototype.clone.call(this, e, t), e
}, THREE.Scene = function() {
THREE.Object3D.call(this), this.type = "Scene", this.fog = null, this.overrideMaterial = null, this.autoUpdate = !0
}, THREE.Scene.prototype = Object.create(THREE.Object3D.prototype), THREE.Scene.prototype.constructor = THREE.Scene, THREE.Scene.prototype.clone = function(e) {
return e === undefined && (e = new THREE.Scene), THREE.Object3D.prototype.clone.call(this, e), this.fog !== null && (e.fog = this.fog.clone()), this.overrideMaterial !== null && (e.overrideMaterial = this.overrideMaterial.clone()), e.autoUpdate = this.autoUpdate, e.matrixAutoUpdate = this.matrixAutoUpdate, e
}, THREE.ShaderChunk = {}, THREE.ShaderChunk.common = "#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n\nfloat square( in float a ) { return a*a; }\nvec2 square( in vec2 a ) { return vec2( a.x*a.x, a.y*a.y ); }\nvec3 square( in vec3 a ) { return vec3( a.x*a.x, a.y*a.y, a.z*a.z ); }\nvec4 square( in vec4 a ) { return vec4( a.x*a.x, a.y*a.y, a.z*a.z, a.w*a.w ); }\nfloat saturate( in float a ) { return clamp( a, 0.0, 1.0 ); }\nvec2 saturate( in vec2 a ) { return clamp( a, 0.0, 1.0 ); }\nvec3 saturate( in vec3 a ) { return clamp( a, 0.0, 1.0 ); }\nvec4 saturate( in vec4 a ) { return clamp( a, 0.0, 1.0 ); }\nfloat average( in float a ) { return a; }\nfloat average( in vec2 a ) { return ( a.x + a.y) * 0.5; }\nfloat average( in vec3 a ) { return ( a.x + a.y + a.z) / 3.0; }\nfloat average( in vec4 a ) { return ( a.x + a.y + a.z + a.w) * 0.25; }\nfloat whiteCompliment( in float a ) { return saturate( 1.0 - a ); }\nvec2 whiteCompliment( in vec2 a ) { return saturate( vec2(1.0) - a ); }\nvec3 whiteCompliment( in vec3 a ) { return saturate( vec3(1.0) - a ); }\nvec4 whiteCompliment( in vec4 a ) { return saturate( vec4(1.0) - a ); }\nvec3 transformDirection( in vec3 normal, in mat4 matrix ) {\n return normalize( ( matrix * vec4( normal, 0.0 ) ).xyz );\n}\n// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\nvec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {\n return normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal) {\n float distance = dot( planeNormal, point-pointOnPlane );\n return point - distance * planeNormal;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n return sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n return pointOnLine + lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) );\n}\nfloat calcLightAttenuation( float lightDistance, float cutoffDistance, float decayExponent ) {\n if ( decayExponent > 0.0 ) {\n return pow( saturate( 1.0 - lightDistance / cutoffDistance ), decayExponent );\n }\n return 1.0;\n}\n\nvec3 inputToLinear( in vec3 a ) {\n#ifdef GAMMA_INPUT\n return pow( a, vec3( float( GAMMA_FACTOR ) ) );\n#else\n return a;\n#endif\n}\nvec3 linearToOutput( in vec3 a ) {\n#ifdef GAMMA_OUTPUT\n return pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );\n#else\n return a;\n#endif\n}\n", THREE.UniformsUtils = {
merge: function(e) {
var t = {};
for (var n = 0; n < e.length; n++) {
var r = this.clone(e[n]);
for (var i in r) t[i] = r[i]
}
return t
},
clone: function(e) {
var t = {};
for (var n in e) {
t[n] = {};
for (var r in e[n]) {
var i = e[n][r];
i instanceof THREE.Color || i instanceof THREE.Vector2 || i instanceof THREE.Vector3 || i instanceof THREE.Vector4 || i instanceof THREE.Matrix3 || i instanceof THREE.Matrix4 || i instanceof THREE.Texture ? t[n][r] = i.clone() : i instanceof Array ? t[n][r] = i.slice() : t[n][r] = i
}
}
return t
}
}, THREE.UniformsLib = {
common: {
diffuse: {
type: "c",
value: new THREE.Color(15658734)
},
opacity: {
type: "f",
value: 1
},
map: {
type: "t",
value: null
},
offsetRepeat: {
type: "v4",
value: new THREE.Vector4(0, 0, 1, 1)
},
lightMap: {
type: "t",
value: null
},
specularMap: {
type: "t",
value: null
},
alphaMap: {
type: "t",
value: null
},
envMap: {
type: "t",
value: null
},
flipEnvMap: {
type: "f",
value: -1
},
reflectivity: {
type: "f",
value: 1
},
refractionRatio: {
type: "f",
value: .98
},
morphTargetInfluences: {
type: "f",
value: 0
}
},
bump: {
bumpMap: {
type: "t",
value: null
},
bumpScale: {
type: "f",
value: 1
}
},
normalmap: {
normalMap: {
type: "t",
value: null
},
normalScale: {
type: "v2",
value: new THREE.Vector2(1, 1)
}
},
fog: {
fogDensity: {
type: "f",
value: 25e-5
},
fogNear: {
type: "f",
value: 1
},
fogFar: {
type: "f",
value: 2e3
},
fogColor: {
type: "c",
value: new THREE.Color(16777215)
}
},
lights: {
ambientLightColor: {
type: "fv",
value: []
},
directionalLightDirection: {
type: "fv",
value: []
},
directionalLightColor: {
type: "fv",
value: []
},
hemisphereLightDirection: {
type: "fv",
value: []
},
hemisphereLightSkyColor: {
type: "fv",
value: []
},
hemisphereLightGroundColor: {
type: "fv",
value: []
},
pointLightColor: {
type: "fv",
value: []
},
pointLightPosition: {
type: "fv",
value: []
},
pointLightDistance: {
type: "fv1",
value: []
},
pointLightDecay: {
type: "fv1",
value: []
},
spotLightColor: {
type: "fv",
value: []
},
spotLightPosition: {
type: "fv",
value: []
},
spotLightDirection: {
type: "fv",
value: []
},
spotLightDistance: {
type: "fv1",
value: []
},
spotLightAngleCos: {
type: "fv1",
value: []
},
spotLightExponent: {
type: "fv1",
value: []
},
spotLightDecay: {
type: "fv1",
value: []
}
},
particle: {
psColor: {
type: "c",
value: new THREE.Color(15658734)
},
opacity: {
type: "f",
value: 1
},
size: {
type: "f",
value: 1
},
scale: {
type: "f",
value: 1
},
map: {
type: "t",
value: null
},
offsetRepeat: {
type: "v4",
value: new THREE.Vector4(0, 0, 1, 1)
},
fogDensity: {
type: "f",
value: 25e-5
},
fogNear: {
type: "f",
value: 1
},
fogFar: {
type: "f",
value: 2e3
},
fogColor: {
type: "c",
value: new THREE.Color(16777215)
}
},
shadowmap: {
shadowMap: {
type: "tv",
value: []
},
shadowMapSize: {
type: "v2v",
value: []
},
shadowBias: {
type: "fv1",
value: []
},
shadowDarkness: {
type: "fv1",
value: []
},
shadowMatrix: {
type: "m4v",
value: []
}
}
}, THREE.ShaderLib = {
basic: {
uniforms: THREE.UniformsUtils.merge([THREE.UniformsLib.common, THREE.UniformsLib.fog, THREE.UniformsLib.shadowmap]),
vertexShader: [THREE.ShaderChunk.common, THREE.ShaderChunk.map_pars_vertex, THREE.ShaderChunk.lightmap_pars_vertex, THREE.ShaderChunk.envmap_pars_vertex, THREE.ShaderChunk.color_pars_vertex, THREE.ShaderChunk.morphtarget_pars_vertex, THREE.ShaderChunk.skinning_pars_vertex, THREE.ShaderChunk.shadowmap_pars_vertex, THREE.ShaderChunk.logdepthbuf_pars_vertex, "void main() {", THREE.ShaderChunk.map_vertex, THREE.ShaderChunk.lightmap_vertex, THREE.ShaderChunk.color_vertex, THREE.ShaderChunk.skinbase_vertex, " #ifdef USE_ENVMAP", THREE.ShaderChunk.morphnormal_vertex, THREE.ShaderChunk.skinnormal_vertex, THREE.ShaderChunk.defaultnormal_vertex, " #endif", THREE.ShaderChunk.morphtarget_vertex, THREE.ShaderChunk.skinning_vertex, THREE.ShaderChunk.default_vertex, THREE.ShaderChunk.logdepthbuf_vertex, THREE.ShaderChunk.worldpos_vertex, THREE.ShaderChunk.envmap_vertex, THREE.ShaderChunk.shadowmap_vertex, "}"].join("\n"),
fragmentShader: ["uniform vec3 diffuse;", "uniform float opacity;", THREE.ShaderChunk.common, THREE.ShaderChunk.color_pars_fragment, THREE.ShaderChunk.map_pars_fragment, THREE.ShaderChunk.alphamap_pars_fragment, THREE.ShaderChunk.lightmap_pars_fragment, THREE.ShaderChunk.envmap_pars_fragment, THREE.ShaderChunk.fog_pars_fragment, THREE.ShaderChunk.shadowmap_pars_fragment, THREE.ShaderChunk.specularmap_pars_fragment, THREE.ShaderChunk.logdepthbuf_pars_fragment, "void main() {", " vec3 outgoingLight = vec3( 0.0 );", " vec4 diffuseColor = vec4( diffuse, opacity );", THREE.ShaderChunk.logdepthbuf_fragment, THREE.ShaderChunk.map_fragment, THREE.ShaderChunk.color_fragment, THREE.ShaderChunk.alphamap_fragment, THREE.ShaderChunk.alphatest_fragment, THREE.ShaderChunk.specularmap_fragment, " outgoingLight = diffuseColor.rgb;", THREE.ShaderChunk.lightmap_fragment, THREE.ShaderChunk.envmap_fragment, THREE.ShaderChunk.shadowmap_fragment, THREE.ShaderChunk.linear_to_gamma_fragment, THREE.ShaderChunk.fog_fragment, " gl_FragColor = vec4( outgoingLight, diffuseColor.a );", "}"].join("\n")
},
lambert: {
uniforms: THREE.UniformsUtils.merge([THREE.UniformsLib.common, THREE.UniformsLib.fog, THREE.UniformsLib.lights, THREE.UniformsLib.shadowmap, {
emissive: {
type: "c",
value: new THREE.Color(0)
},
wrapRGB: {
type: "v3",
value: new THREE.Vector3(1, 1, 1)
}
}]),
vertexShader: ["#define LAMBERT", "varying vec3 vLightFront;", "#ifdef DOUBLE_SIDED", " varying vec3 vLightBack;", "#endif", THREE.ShaderChunk.common, THREE.ShaderChunk.map_pars_vertex, THREE.ShaderChunk.lightmap_pars_vertex, THREE.ShaderChunk.envmap_pars_vertex, THREE.ShaderChunk.lights_lambert_pars_vertex, THREE.ShaderChunk.color_pars_vertex, THREE.ShaderChunk.morphtarget_pars_vertex, THREE.ShaderChunk.skinning_pars_vertex, THREE.ShaderChunk.shadowmap_pars_vertex, THREE.ShaderChunk.logdepthbuf_pars_vertex, "void main() {", THREE.ShaderChunk.map_vertex, THREE.ShaderChunk.lightmap_vertex, THREE.ShaderChunk.color_vertex, THREE.ShaderChunk.morphnormal_vertex, THREE.ShaderChunk.skinbase_vertex, THREE.ShaderChunk.skinnormal_vertex, THREE.ShaderChunk.defaultnormal_vertex, THREE.ShaderChunk.morphtarget_vertex, THREE.ShaderChunk.skinning_vertex, THREE.ShaderChunk.default_vertex, THREE.ShaderChunk.logdepthbuf_vertex, THREE.ShaderChunk.worldpos_vertex, THREE.ShaderChunk.envmap_vertex, THREE.ShaderChunk.lights_lambert_vertex, THREE.ShaderChunk.shadowmap_vertex, "}"].join("\n"),
fragmentShader: ["uniform vec3 diffuse;", "uniform vec3 emissive;", "uniform float opacity;", "varying vec3 vLightFront;", "#ifdef DOUBLE_SIDED", " varying vec3 vLightBack;", "#endif", THREE.ShaderChunk.common, THREE.ShaderChunk.color_pars_fragment, THREE.ShaderChunk.map_pars_fragment, THREE.ShaderChunk.alphamap_pars_fragment, THREE.ShaderChunk.lightmap_pars_fragment, THREE.ShaderChunk.envmap_pars_fragment, THREE.ShaderChunk.fog_pars_fragment, THREE.ShaderChunk.shadowmap_pars_fragment, THREE.ShaderChunk.specularmap_pars_fragment, THREE.ShaderChunk.logdepthbuf_pars_fragment, "void main() {", " vec3 outgoingLight = vec3( 0.0 );", " vec4 diffuseColor = vec4( diffuse, opacity );", THREE.ShaderChunk.logdepthbuf_fragment, THREE.ShaderChunk.map_fragment, THREE.ShaderChunk.color_fragment, THREE.ShaderChunk.alphamap_fragment, THREE.ShaderChunk.alphatest_fragment, THREE.ShaderChunk.specularmap_fragment, " #ifdef DOUBLE_SIDED", " if ( gl_FrontFacing )", " outgoingLight += diffuseColor.rgb * vLightFront + emissive;", " else", " outgoingLight += diffuseColor.rgb * vLightBack + emissive;", " #else", " outgoingLight += diffuseColor.rgb * vLightFront + emissive;", " #endif", THREE.ShaderChunk.lightmap_fragment, THREE.ShaderChunk.envmap_fragment, THREE.ShaderChunk.shadowmap_fragment, THREE.ShaderChunk.linear_to_gamma_fragment, THREE.ShaderChunk.fog_fragment, " gl_FragColor = vec4( outgoingLight, diffuseColor.a );", "}"].join("\n")
},
phong: {
uniforms: THREE.UniformsUtils.merge([THREE.UniformsLib.common, THREE.UniformsLib.bump, THREE.UniformsLib.normalmap, THREE.UniformsLib.fog, THREE.UniformsLib.lights, THREE.UniformsLib.shadowmap, {
emissive: {
type: "c",
value: new THREE.Color(0)
},
specular: {
type: "c",
value: new THREE.Color(1118481)
},
shininess: {
type: "f",
value: 30
},
wrapRGB: {
type: "v3",
value: new THREE.Vector3(1, 1, 1)
}
}]),
vertexShader: ["#define PHONG", "varying vec3 vViewPosition;", "#ifndef FLAT_SHADED", " varying vec3 vNormal;", "#endif", THREE.ShaderChunk.common, THREE.ShaderChunk.map_pars_vertex, THREE.ShaderChunk.lightmap_pars_vertex, THREE.ShaderChunk.envmap_pars_vertex, THREE.ShaderChunk.lights_phong_pars_vertex, THREE.ShaderChunk.color_pars_vertex, THREE.ShaderChunk.morphtarget_pars_vertex, THREE.ShaderChunk.skinning_pars_vertex, THREE.ShaderChunk.shadowmap_pars_vertex, THREE.ShaderChunk.logdepthbuf_pars_vertex, "void main() {", THREE.ShaderChunk.map_vertex, THREE.ShaderChunk.lightmap_vertex, THREE.ShaderChunk.color_vertex, THREE.ShaderChunk.morphnormal_vertex, THREE.ShaderChunk.skinbase_vertex, THREE.ShaderChunk.skinnormal_vertex, THREE.ShaderChunk.defaultnormal_vertex, "#ifndef FLAT_SHADED", " vNormal = normalize( transformedNormal );", "#endif", THREE.ShaderChunk.morphtarget_vertex, THREE.ShaderChunk.skinning_vertex, THREE.ShaderChunk.default_vertex, THREE.ShaderChunk.logdepthbuf_vertex, " vViewPosition = -mvPosition.xyz;", THREE.ShaderChunk.worldpos_vertex, THREE.ShaderChunk.envmap_vertex, THREE.ShaderChunk.lights_phong_vertex, THREE.ShaderChunk.shadowmap_vertex, "}"].join("\n"),
fragmentShader: ["#define PHONG", "uniform vec3 diffuse;", "uniform vec3 emissive;", "uniform vec3 specular;", "uniform float shininess;", "uniform float opacity;", THREE.ShaderChunk.common, THREE.ShaderChunk.color_pars_fragment, THREE.ShaderChunk.map_pars_fragment, THREE.ShaderChunk.alphamap_pars_fragment, THREE.ShaderChunk.lightmap_pars_fragment, THREE.ShaderChunk.envmap_pars_fragment, THREE.ShaderChunk.fog_pars_fragment, THREE.ShaderChunk.lights_phong_pars_fragment, THREE.ShaderChunk.shadowmap_pars_fragment, THREE.ShaderChunk.bumpmap_pars_fragment, THREE.ShaderChunk.normalmap_pars_fragment, THREE.ShaderChunk.specularmap_pars_fragment, THREE.ShaderChunk.logdepthbuf_pars_fragment, "void main() {", " vec3 outgoingLight = vec3( 0.0 );", " vec4 diffuseColor = vec4( diffuse, opacity );", THREE.ShaderChunk.logdepthbuf_fragment, THREE.ShaderChunk.map_fragment, THREE.ShaderChunk.color_fragment, THREE.ShaderChunk.alphamap_fragment, THREE.ShaderChunk.alphatest_fragment, THREE.ShaderChunk.specularmap_fragment, THREE.ShaderChunk.lights_phong_fragment, THREE.ShaderChunk.lightmap_fragment, THREE.ShaderChunk.envmap_fragment, THREE.ShaderChunk.shadowmap_fragment, THREE.ShaderChunk.linear_to_gamma_fragment, THREE.ShaderChunk.fog_fragment, " gl_FragColor = vec4( outgoingLight, diffuseColor.a );", "}"].join("\n")
},
particle_basic: {
uniforms: THREE.UniformsUtils.merge([THREE.UniformsLib.particle, THREE.UniformsLib.shadowmap]),
vertexShader: ["uniform float size;", "uniform float scale;", THREE.ShaderChunk.common, THREE.ShaderChunk.color_pars_vertex, THREE.ShaderChunk.shadowmap_pars_vertex, THREE.ShaderChunk.logdepthbuf_pars_vertex, "void main() {", THREE.ShaderChunk.color_vertex, " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );", " #ifdef USE_SIZEATTENUATION", " gl_PointSize = size * ( scale / length( mvPosition.xyz ) );", " #else", " gl_PointSize = size;", " #endif", " gl_Position = projectionMatrix * mvPosition;", THREE.ShaderChunk.logdepthbuf_vertex, THREE.ShaderChunk.worldpos_vertex, THREE.ShaderChunk.shadowmap_vertex, "}"].join("\n"),
fragmentShader: ["uniform vec3 psColor;", "uniform float opacity;", THREE.ShaderChunk.common, THREE.ShaderChunk.color_pars_fragment, THREE.ShaderChunk.map_particle_pars_fragment, THREE.ShaderChunk.fog_pars_fragment, THREE.ShaderChunk.shadowmap_pars_fragment, THREE.ShaderChunk.logdepthbuf_pars_fragment, "void main() {", " vec3 outgoingLight = vec3( 0.0 );", " vec4 diffuseColor = vec4( psColor, opacity );", THREE.ShaderChunk.logdepthbuf_fragment, THREE.ShaderChunk.map_particle_fragment, THREE.ShaderChunk.color_fragment, THREE.ShaderChunk.alphatest_fragment, " outgoingLight = diffuseColor.rgb;", THREE.ShaderChunk.shadowmap_fragment, THREE.ShaderChunk.fog_fragment, " gl_FragColor = vec4( outgoingLight, diffuseColor.a );", "}"].join("\n")
},
dashed: {
uniforms: THREE.UniformsUtils.merge([THREE.UniformsLib.common, THREE.UniformsLib.fog, {
scale: {
type: "f",
value: 1
},
dashSize: {
type: "f",
value: 1
},
totalSize: {
type: "f",
value: 2
}
}]),
vertexShader: ["uniform float scale;", "attribute float lineDistance;", "varying float vLineDistance;", THREE.ShaderChunk.common, THREE.ShaderChunk.color_pars_vertex, THREE.ShaderChunk.logdepthbuf_pars_vertex, "void main() {", THREE.ShaderChunk.color_vertex, " vLineDistance = scale * lineDistance;", " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );", " gl_Position = projectionMatrix * mvPosition;", THREE.ShaderChunk.logdepthbuf_vertex, "}"].join("\n"),
fragmentShader: ["uniform vec3 diffuse;", "uniform float opacity;", "uniform float dashSize;", "uniform float totalSize;", "varying float vLineDistance;", THREE.ShaderChunk.common, THREE.ShaderChunk.color_pars_fragment, THREE.ShaderChunk.fog_pars_fragment, THREE.ShaderChunk.logdepthbuf_pars_fragment, "void main() {", " if ( mod( vLineDistance, totalSize ) > dashSize ) {", " discard;", " }", " vec3 outgoingLight = vec3( 0.0 );", " vec4 diffuseColor = vec4( diffuse, opacity );", THREE.ShaderChunk.logdepthbuf_fragment, THREE.ShaderChunk.color_fragment, " outgoingLight = diffuseColor.rgb;", THREE.ShaderChunk.fog_fragment, " gl_FragColor = vec4( outgoingLight, diffuseColor.a );", "}"].join("\n")
},
depth: {
uniforms: {
mNear: {
type: "f",
value: 1
},
mFar: {
type: "f",
value: 2e3
},
opacity: {
type: "f",
value: 1
}
},
vertexShader: [THREE.ShaderChunk.common, THREE.ShaderChunk.morphtarget_pars_vertex, THREE.ShaderChunk.logdepthbuf_pars_vertex, "void main() {", THREE.ShaderChunk.morphtarget_vertex, THREE.ShaderChunk.default_vertex, THREE.ShaderChunk.logdepthbuf_vertex, "}"].join("\n"),
fragmentShader: ["uniform float mNear;", "uniform float mFar;", "uniform float opacity;", THREE.ShaderChunk.common, THREE.ShaderChunk.logdepthbuf_pars_fragment, "void main() {", THREE.ShaderChunk.logdepthbuf_fragment, " #ifdef USE_LOGDEPTHBUF_EXT", " float depth = gl_FragDepthEXT / gl_FragCoord.w;", " #else", " float depth = gl_FragCoord.z / gl_FragCoord.w;", " #endif", " float color = 1.0 - smoothstep( mNear, mFar, depth );", " gl_FragColor = vec4( vec3( color ), opacity );", "}"].join("\n")
},
normal: {
uniforms: {
opacity: {
type: "f",
value: 1
}
},
vertexShader: ["varying vec3 vNormal;", THREE.ShaderChunk.common, THREE.ShaderChunk.morphtarget_pars_vertex, THREE.ShaderChunk.logdepthbuf_pars_vertex, "void main() {", " vNormal = normalize( normalMatrix * normal );", THREE.ShaderChunk.morphtarget_vertex, THREE.ShaderChunk.default_vertex, THREE.ShaderChunk.logdepthbuf_vertex, "}"].join("\n"),
fragmentShader: ["uniform float opacity;", "varying vec3 vNormal;", THREE.ShaderChunk.common, THREE.ShaderChunk.logdepthbuf_pars_fragment, "void main() {", " gl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );", THREE.ShaderChunk.logdepthbuf_fragment, "}"].join("\n")
},
cube: {
uniforms: {
tCube: {
type: "t",
value: null
},
tFlip: {
type: "f",
value: -1
}
},
vertexShader: ["varying vec3 vWorldPosition;", THREE.ShaderChunk.common, THREE.ShaderChunk.logdepthbuf_pars_vertex, "void main() {", " vWorldPosition = transformDirection( position, modelMatrix );", " gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", THREE.ShaderChunk.logdepthbuf_vertex, "}"].join("\n"),
fragmentShader: ["uniform samplerCube tCube;", "uniform float tFlip;", "varying vec3 vWorldPosition;", THREE.ShaderChunk.common, THREE.ShaderChunk.logdepthbuf_pars_fragment, "void main() {", " gl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );", THREE.ShaderChunk.logdepthbuf_fragment, "}"].join("\n")
},
equirect: {
uniforms: {
tEquirect: {
type: "t",
value: null
},
tFlip: {
type: "f",
value: -1
}
},
vertexShader: ["varying vec3 vWorldPosition;", THREE.ShaderChunk.common, THREE.ShaderChunk.logdepthbuf_pars_vertex, "void main() {", " vWorldPosition = transformDirection( position, modelMatrix );", " gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", THREE.ShaderChunk.logdepthbuf_vertex, "}"].join("\n"),
fragmentShader: ["uniform sampler2D tEquirect;", "uniform float tFlip;", "varying vec3 vWorldPosition;", THREE.ShaderChunk.common, THREE.ShaderChunk.logdepthbuf_pars_fragment, "void main() {", "vec3 direction = normalize( vWorldPosition );", "vec2 sampleUV;", "sampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );", "sampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;", "gl_FragColor = texture2D( tEquirect, sampleUV );", THREE.ShaderChunk.logdepthbuf_fragment, "}"].join("\n")
},
depthRGBA: {
uniforms: {},
vertexShader: [THREE.ShaderChunk.common, THREE.ShaderChunk.morphtarget_pars_vertex, THREE.ShaderChunk.skinning_pars_vertex, THREE.ShaderChunk.logdepthbuf_pars_vertex, "void main() {", THREE.ShaderChunk.skinbase_vertex, THREE.ShaderChunk.morphtarget_vertex, THREE.ShaderChunk.skinning_vertex, THREE.ShaderChunk.default_vertex, THREE.ShaderChunk.logdepthbuf_vertex, "}"].join("\n"),
fragmentShader: [THREE.ShaderChunk.common, THREE.ShaderChunk.logdepthbuf_pars_fragment, "vec4 pack_depth( const in float depth ) {", " const vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );", " const vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );", " vec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );", " res -= res.xxyz * bit_mask;", " return res;", "}", "void main() {", THREE.ShaderChunk.logdepthbuf_fragment, " #ifdef USE_LOGDEPTHBUF_EXT", " gl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );", " #else", " gl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );", " #endif", "}"].join("\n")
}
}, THREE.WebGLRenderer = function(e) {
function ct(e) {
e.__webglVertexBuffer = R.createBuffer(), e.__webglNormalBuffer = R.createBuffer(), e.__webglTangentBuffer = R.createBuffer(), e.__webglColorBuffer = R.createBuffer(), e.__webglUVBuffer = R.createBuffer(), e.__webglUV2Buffer = R.createBuffer(), e.__webglSkinIndicesBuffer = R.createBuffer(), e.__webglSkinWeightsBuffer = R.createBuffer(), e.__webglFaceBuffer = R.createBuffer(), e.__webglLineBuffer = R.createBuffer();
var t = e.numMorphTargets;
if (t) {
e.__webglMorphTargetsBuffers = [];
for (var n = 0, r = t; n < r; n++) e.__webglMorphTargetsBuffers.push(R.createBuffer())
}
var i = e.numMorphNormals;
if (i) {
e.__webglMorphNormalsBuffers = [];
for (var n = 0, r = i; n < r; n++) e.__webglMorphNormalsBuffers.push(R.createBuffer())
}
E.info.memory.geometries++
}
function St(e) {
var t = e.geometry,
n = e.material,
r = t.vertices.length;
if (n.attributes) {
t.__webglCustomAttributesList === undefined && (t.__webglCustomAttributesList = []);
for (var i in n.attributes) {
var s = n.attributes[i];
if (!s.__webglInitialized || s.createUniqueBuffers) {
s.__webglInitialized = !0;
var o = 1;
s.type === "v2" ? o = 2 : s.type === "v3" ? o = 3 : s.type === "v4" ? o = 4 : s.type === "c" && (o = 3), s.size = o, s.array = new Float32Array(r * o), s.buffer = R.createBuffer(), s.buffer.belongsToAttribute = i, s.needsUpdate = !0
}
t.__webglCustomAttributesList.push(s)
}
}
}
function xt(e, t) {
var n = t.geometry,
r = e.faces3,
i = r.length * 3,
s = r.length * 1,
o = r.length * 3,
u = Tt(t, e);
e.__vertexArray = new Float32Array(i * 3), e.__normalArray = new Float32Array(i * 3), e.__colorArray = new Float32Array(i * 3), e.__uvArray = new Float32Array(i * 2), n.faceVertexUvs.length > 1 && (e.__uv2Array = new Float32Array(i * 2)), n.hasTangents && (e.__tangentArray = new Float32Array(i * 4)), t.geometry.skinWeights.length && t.geometry.skinIndices.length && (e.__skinIndexArray = new Float32Array(i * 4), e.__skinWeightArray = new Float32Array(i * 4));
var a = X.get("OES_element_index_uint") !== null && s > 21845 ? Uint32Array : Uint16Array;
e.__typeArray = a, e.__faceArray = new a(s * 3), e.__lineArray = new a(o * 2);
var f = e.numMorphTargets;
if (f) {
e.__morphTargetsArrays = [];
for (var l = 0, c = f; l < c; l++) e.__morphTargetsArrays.push(new Float32Array(i * 3))
}
var h = e.numMorphNormals;
if (h) {
e.__morphNormalsArrays = [];
for (var l = 0, c = h; l < c; l++) e.__morphNormalsArrays.push(new Float32Array(i * 3))
}
e.__webglFaceCount = s * 3, e.__webglLineCount = o * 2;
if (u.attributes) {
e.__webglCustomAttributesList === undefined && (e.__webglCustomAttributesList = []);
for (var p in u.attributes) {
var d = u.attributes[p],
v = {};
for (var m in d) v[m] = d[m];
if (!v.__webglInitialized || v.createUniqueBuffers) {
v.__webglInitialized = !0;
var g = 1;
v.type === "v2" ? g = 2 : v.type === "v3" ? g = 3 : v.type === "v4" ? g = 4 : v.type === "c" && (g = 3), v.size = g, v.array = new Float32Array(i * g), v.buffer = R.createBuffer(), v.buffer.belongsToAttribute = p, d.needsUpdate = !0, v.__original = d
}
e.__webglCustomAttributesList.push(v)
}
}
e.__inittedArrays = !0
}
function Tt(e, t) {
return e.material instanceof THREE.MeshFaceMaterial ? e.material.materials[t.materialIndex] : e.material
}
function Nt(e) {
return e instanceof THREE.MeshPhongMaterial == 0 && e.shading === THREE.FlatShading
}
function Ct(e, t, n, r, i) {
if (!e.__inittedArrays) return;
var s = Nt(i),
o, u, a, f, l, c, h, p, d, v, m, g, y, b, w, E, S, x, T, N, C, k, L, A, O, M, _, D, P, H, B, j, F, I, q, U, z, W, X, V, $ = 0,
J = 0,
K = 0,
Q = 0,
G = 0,
Y = 0,
Z = 0,
et = 0,
tt = 0,
nt = 0,
rt = 0,
it = 0,
st, ot = e.__vertexArray,
ut = e.__uvArray,
at = e.__uv2Array,
ft = e.__normalArray,
lt = e.__tangentArray,
ct = e.__colorArray,
ht = e.__skinIndexArray,
pt = e.__skinWeightArray,
dt = e.__morphTargetsArrays,
vt = e.__morphNormalsArrays,
mt = e.__webglCustomAttributesList,
gt, yt = e.__faceArray,
bt = e.__lineArray,
wt = t.geometry,
Et = wt.verticesNeedUpdate,
St = wt.elementsNeedUpdate,
xt = wt.uvsNeedUpdate,
Tt = wt.normalsNeedUpdate,
Ct = wt.tangentsNeedUpdate,
kt = wt.colorsNeedUpdate,
Lt = wt.morphTargetsNeedUpdate,
At = wt.vertices,
Ot = e.faces3,
Mt = wt.faces,
_t = wt.faceVertexUvs[0],
Dt = wt.faceVertexUvs[1],
Pt = wt.skinIndices,
Ht = wt.skinWeights,
Bt = wt.morphTargets,
jt = wt.morphNormals;
if (Et) {
for (o = 0, u = Ot.length; o < u; o++) f = Mt[Ot[o]], g = At[f.a], y = At[f.b], b = At[f.c], ot[J] = g.x, ot[J + 1] = g.y, ot[J + 2] = g.z, ot[J + 3] = y.x, ot[J + 4] = y.y, ot[J + 5] = y.z, ot[J + 6] = b.x, ot[J + 7] = b.y, ot[J + 8] = b.z, J += 9;
R.bindBuffer(R.ARRAY_BUFFER, e.__webglVertexBuffer), R.bufferData(R.ARRAY_BUFFER, ot, n)
}
if (Lt)
for (q = 0, U = Bt.length; q < U; q++) {
rt = 0;
for (o = 0, u = Ot.length; o < u; o++) X = Ot[o], f = Mt[X], g = Bt[q].vertices[f.a], y = Bt[q].vertices[f.b], b = Bt[q].vertices[f.c], z = dt[q], z[rt] = g.x, z[rt + 1] = g.y, z[rt + 2] = g.z, z[rt + 3] = y.x, z[rt + 4] = y.y, z[rt + 5] = y.z, z[rt + 6] = b.x, z[rt + 7] = b.y, z[rt + 8] = b.z, i.morphNormals && (s ? (x = jt[q].faceNormals[X], T = x, N = x) : (V = jt[q].vertexNormals[X], x = V.a, T = V.b, N = V.c), W = vt[q], W[rt] = x.x, W[rt + 1] = x.y, W[rt + 2] = x.z, W[rt + 3] = T.x, W[rt + 4] = T.y, W[rt + 5] = T.z, W[rt + 6] = N.x, W[rt + 7] = N.y, W[rt + 8] = N.z), rt += 9;
R.bindBuffer(R.ARRAY_BUFFER, e.__webglMorphTargetsBuffers[q]), R.bufferData(R.ARRAY_BUFFER, dt[q], n), i.morphNormals && (R.bindBuffer(R.ARRAY_BUFFER, e.__webglMorphNormalsBuffers[q]), R.bufferData(R.ARRAY_BUFFER, vt[q], n))
}
if (Ht.length) {
for (o = 0, u = Ot.length; o < u; o++) f = Mt[Ot[o]], A = Ht[f.a], O = Ht[f.b], M = Ht[f.c], pt[nt] = A.x, pt[nt + 1] = A.y, pt[nt + 2] = A.z, pt[nt + 3] = A.w, pt[nt + 4] = O.x, pt[nt + 5] = O.y, pt[nt + 6] = O.z, pt[nt + 7] = O.w, pt[nt + 8] = M.x, pt[nt + 9] = M.y, pt[nt + 10] = M.z, pt[nt + 11] = M.w, _ = Pt[f.a], D = Pt[f.b], P = Pt[f.c], ht[nt] = _.x, ht[nt + 1] = _.y, ht[nt + 2] = _.z, ht[nt + 3] = _.w, ht[nt + 4] = D.x, ht[nt + 5] = D.y, ht[nt + 6] = D.z, ht[nt + 7] = D.w, ht[nt + 8] = P.x, ht[nt + 9] = P.y, ht[nt + 10] = P.z, ht[nt + 11] = P.w, nt += 12;
nt > 0 && (R.bindBuffer(R.ARRAY_BUFFER, e.__webglSkinIndicesBuffer), R.bufferData(R.ARRAY_BUFFER, ht, n), R.bindBuffer(R.ARRAY_BUFFER, e.__webglSkinWeightsBuffer), R.bufferData(R.ARRAY_BUFFER, pt, n))
}
if (kt) {
for (o = 0, u = Ot.length; o < u; o++) f = Mt[Ot[o]], h = f.vertexColors, p = f.color, h.length === 3 && i.vertexColors === THREE.VertexColors ? (C = h[0], k = h[1], L = h[2]) : (C = p, k = p, L = p), ct[tt] = C.r, ct[tt + 1] = C.g, ct[tt + 2] = C.b, ct[tt + 3] = k.r, ct[tt + 4] = k.g, ct[tt + 5] = k.b, ct[tt + 6] = L.r, ct[tt + 7] = L.g, ct[tt + 8] = L.b, tt += 9;
tt > 0 && (R.bindBuffer(R.ARRAY_BUFFER, e.__webglColorBuffer), R.bufferData(R.ARRAY_BUFFER, ct, n))
}
if (Ct && wt.hasTangents) {
for (o = 0, u = Ot.length; o < u; o++) f = Mt[Ot[o]], d = f.vertexTangents, w = d[0], E = d[1], S = d[2], lt[Z] = w.x, lt[Z + 1] = w.y, lt[Z + 2] = w.z, lt[Z + 3] = w.w, lt[Z + 4] = E.x, lt[Z + 5] = E.y, lt[Z + 6] = E.z, lt[Z + 7] = E.w, lt[Z + 8] = S.x, lt[Z + 9] = S.y, lt[Z + 10] = S.z, lt[Z + 11] = S.w, Z += 12;
R.bindBuffer(R.ARRAY_BUFFER, e.__webglTangentBuffer), R.bufferData(R.ARRAY_BUFFER, lt, n)
}
if (Tt) {
for (o = 0, u = Ot.length; o < u; o++) {
f = Mt[Ot[o]], l = f.vertexNormals, c = f.normal;
if (l.length === 3 && s === !1)
for (H = 0; H < 3; H++) j = l[H], ft[Y] = j.x, ft[Y + 1] = j.y, ft[Y + 2] = j.z, Y += 3;
else
for (H = 0; H < 3; H++) ft[Y] = c.x, ft[Y + 1] = c.y, ft[Y + 2] = c.z, Y += 3
}
R.bindBuffer(R.ARRAY_BUFFER, e.__webglNormalBuffer), R.bufferData(R.ARRAY_BUFFER, ft, n)
}
if (xt && _t) {
for (o = 0, u = Ot.length; o < u; o++) {
a = Ot[o], v = _t[a];
if (v === undefined) continue;
for (H = 0; H < 3; H++) F = v[H], ut[K] = F.x, ut[K + 1] = F.y, K += 2
}
K > 0 && (R.bindBuffer(R.ARRAY_BUFFER, e.__webglUVBuffer), R.bufferData(R.ARRAY_BUFFER, ut, n))
}
if (xt && Dt) {
for (o = 0, u = Ot.length; o < u; o++) {
a = Ot[o], m = Dt[a];
if (m === undefined) continue;
for (H = 0; H < 3; H++) I = m[H], at[Q] = I.x, at[Q + 1] = I.y, Q += 2
}
Q > 0 && (R.bindBuffer(R.ARRAY_BUFFER, e.__webglUV2Buffer), R.bufferData(R.ARRAY_BUFFER, at, n))
}
if (St) {
for (o = 0, u = Ot.length; o < u; o++) yt[G] = $, yt[G + 1] = $ + 1, yt[G + 2] = $ + 2, G += 3, bt[et] = $, bt[et + 1] = $ + 1, bt[et + 2] = $, bt[et + 3] = $ + 2, bt[et + 4] = $ + 1, bt[et + 5] = $ + 2, et += 6, $ += 3;
R.bindBuffer(R.ELEMENT_ARRAY_BUFFER, e.__webglFaceBuffer), R.bufferData(R.ELEMENT_ARRAY_BUFFER, yt, n), R.bindBuffer(R.ELEMENT_ARRAY_BUFFER, e.__webglLineBuffer), R.bufferData(R.ELEMENT_ARRAY_BUFFER, bt, n)
}
if (mt)
for (H = 0, B = mt.length; H < B; H++) {
gt = mt[H];
if (!gt.__original.needsUpdate) continue;
it = 0;
if (gt.size === 1) {
if (gt.boundTo === undefined || gt.boundTo === "vertices")
for (o = 0, u = Ot.length; o < u; o++) f = Mt[Ot[o]], gt.array[it] = gt.value[f.a], gt.array[it + 1] = gt.value[f.b], gt.array[it + 2] = gt.value[f.c], it += 3;
else if (gt.boundTo === "faces")
for (o = 0, u = Ot.length; o < u; o++) st = gt.value[Ot[o]], gt.array[it] = st, gt.array[it + 1] = st, gt.array[it + 2] = st, it += 3
} else if (gt.size === 2) {
if (gt.boundTo === undefined || gt.boundTo === "vertices")
for (o = 0, u = Ot.length; o < u; o++) f = Mt[Ot[o]], g = gt.value[f.a], y = gt.value[f.b], b = gt.value[f.c], gt.array[it] = g.x, gt.array[it + 1] = g.y, gt.array[it + 2] = y.x, gt.array[it + 3] = y.y, gt.array[it + 4] = b.x, gt.array[it + 5] = b.y, it += 6;
else if (gt.boundTo === "faces")
for (o = 0, u = Ot.length; o < u; o++) st = gt.value[Ot[o]], g = st, y = st, b = st, gt.array[it] = g.x, gt.array[it + 1] = g.y, gt.array[it + 2] = y.x, gt.array[it + 3] = y.y, gt.array[it + 4] = b.x, gt.array[it + 5] = b.y, it += 6
} else if (gt.size === 3) {
var Ft;
gt.type === "c" ? Ft = ["r", "g", "b"] : Ft = ["x", "y", "z"];
if (gt.boundTo === undefined || gt.boundTo === "vertices")
for (o = 0, u = Ot.length; o < u; o++) f = Mt[Ot[o]], g = gt.value[f.a], y = gt.value[f.b], b = gt.value[f.c], gt.array[it] = g[Ft[0]], gt.array[it + 1] = g[Ft[1]], gt.array[it + 2] = g[Ft[2]], gt.array[it + 3] = y[Ft[0]], gt.array[it + 4] = y[Ft[1]], gt.array[it + 5] = y[Ft[2]], gt.array[it + 6] = b[Ft[0]], gt.array[it + 7] = b[Ft[1]], gt.array[it + 8] = b[Ft[2]], it += 9;
else if (gt.boundTo === "faces")
for (o = 0, u = Ot.length; o < u; o++) st = gt.value[Ot[o]], g = st, y = st, b = st, gt.array[it] = g[Ft[0]], gt.array[it + 1] = g[Ft[1]], gt.array[it + 2] = g[Ft[2]], gt.array[it + 3] = y[Ft[0]], gt.array[it + 4] = y[Ft[1]], gt.array[it + 5] = y[Ft[2]], gt.array[it + 6] = b[Ft[0]], gt.array[it + 7] = b[Ft[1]], gt.array[it + 8] = b[Ft[2]], it += 9;
else if (gt.boundTo === "faceVertices")
for (o = 0, u = Ot.length; o < u; o++) st = gt.value[Ot[o]], g = st[0], y = st[1], b = st[2], gt.array[it] = g[Ft[0]], gt.array[it + 1] = g[Ft[1]], gt.array[it + 2] = g[Ft[2]], gt.array[it + 3] = y[Ft[0]], gt.array[it + 4] = y[Ft[1]], gt.array[it + 5] = y[Ft[2]], gt.array[it + 6] = b[Ft[0]], gt.array[it + 7] = b[Ft[1]], gt.array[it + 8] = b[Ft[2]], it += 9
} else if (gt.size === 4)
if (gt.boundTo === undefined || gt.boundTo === "vertices")
for (o = 0, u = Ot.length; o < u; o++) f = Mt[Ot[o]], g = gt.value[f.a], y = gt.value[f.b], b = gt.value[f.c], gt.array[it] = g.x, gt.array[it + 1] = g.y, gt.array[it + 2] = g.z, gt.array[it + 3] = g.w, gt.array[it + 4] = y.x, gt.array[it + 5] = y.y, gt.array[it + 6] = y.z, gt.array[it + 7] = y.w, gt.array[it + 8] = b.x, gt.array[it + 9] = b.y, gt.array[it + 10] = b.z, gt.array[it + 11] = b.w, it += 12;
else if (gt.boundTo === "faces")
for (o = 0, u = Ot.length; o < u; o++) st = gt.value[Ot[o]], g = st, y = st, b = st, gt.array[it] = g.x, gt.array[it + 1] = g.y, gt.array[it + 2] = g.z, gt.array[it + 3] = g.w, gt.array[it + 4] = y.x, gt.array[it + 5] = y.y, gt.array[it + 6] = y.z, gt.array[it + 7] = y.w, gt.array[it + 8] = b.x, gt.array[it + 9] = b.y, gt.array[it + 10] = b.z, gt.array[it + 11] = b.w, it += 12;
else if (gt.boundTo === "faceVertices")
for (o = 0, u = Ot.length; o < u; o++) st = gt.value[Ot[o]], g = st[0], y = st[1], b = st[2], gt.array[it] = g.x, gt.array[it + 1] = g.y, gt.array[it + 2] = g.z, gt.array[it + 3] = g.w, gt.array[it + 4] = y.x, gt.array[it + 5] = y.y, gt.array[it + 6] = y.z, gt.array[it + 7] = y.w, gt.array[it + 8] = b.x, gt.array[it + 9] = b.y, gt.array[it + 10] = b.z, gt.array[it + 11] = b.w, it += 12;
R.bindBuffer(R.ARRAY_BUFFER, gt.buffer), R.bufferData(R.ARRAY_BUFFER, gt.array, n)
}
r && (delete e.__inittedArrays, delete e.__colorArray, delete e.__normalArray, delete e.__tangentArray, delete e.__uvArray, delete e.__uv2Array, delete e.__faceArray, delete e.__vertexArray, delete e.__lineArray, delete e.__skinIndexArray, delete e.__skinWeightArray)
}
function kt(e, t, n, r) {
var i = n.attributes,
s = t.attributes,
o = t.attributesKeys;
for (var u = 0, a = o.length; u < a; u++) {
var f = o[u],
l = s[f];
if (l >= 0) {
var c = i[f];
if (c !== undefined) {
var h = c.itemSize;
R.bindBuffer(R.ARRAY_BUFFER, c.buffer), W.enableAttribute(l), R.vertexAttribPointer(l, h, R.FLOAT, !1, 0, r * h * 4)
} else e.defaultAttributeValues !== undefined && (e.defaultAttributeValues[f].length === 2 ? R.vertexAttrib2fv(l, e.defaultAttributeValues[f]) : e.defaultAttributeValues[f].length === 3 && R.vertexAttrib3fv(l, e.defaultAttributeValues[f]))
}
}
W.disableUnusedAttributes()
}
function Lt(e, t, n) {
var r = e.program.attributes;
n.morphTargetBase !== -1 && r.position >= 0 ? (R.bindBuffer(R.ARRAY_BUFFER, t.__webglMorphTargetsBuffers[n.morphTargetBase]), W.enableAttribute(r.position), R.vertexAttribPointer(r.position, 3, R.FLOAT, !1, 0, 0)) : r.position >= 0 && (R.bindBuffer(R.ARRAY_BUFFER, t.__webglVertexBuffer), W.enableAttribute(r.position), R.vertexAttribPointer(r.position, 3, R.FLOAT, !1, 0, 0));
if (n.morphTargetForcedOrder.length) {
var i = 0,
s = n.morphTargetForcedOrder,
o = n.morphTargetInfluences,
u;
while (i < e.numSupportedMorphTargets && i < s.length) u = r["morphTarget" + i], u >= 0 && (R.bindBuffer(R.ARRAY_BUFFER, t.__webglMorphTargetsBuffers[s[i]]), W.enableAttribute(u), R.vertexAttribPointer(u, 3, R.FLOAT, !1, 0, 0)), u = r["morphNormal" + i], u >= 0 && e.morphNormals && (R.bindBuffer(R.ARRAY_BUFFER, t.__webglMorphNormalsBuffers[s[i]]), W.enableAttribute(u), R.vertexAttribPointer(u, 3, R.FLOAT, !1, 0, 0)), n.__webglMorphTargetInfluences[i] = o[s[i]], i++
} else {
var a = [],
o = n.morphTargetInfluences,
f = n.geometry.morphTargets;
o.length > f.length && (console.warn("THREE.WebGLRenderer: Influences array is bigger than morphTargets array."), o.length = f.length);
for (var l = 0, c = o.length; l < c; l++) {
var h = o[l];
a.push([h, l])
}
a.length > e.numSupportedMorphTargets ? (a.sort(Mt), a.length = e.numSupportedMorphTargets) : a.length > e.numSupportedMorphNormals ? a.sort(Mt) : a.length === 0 && a.push([0, 0]);
var u;
for (var i = 0, p = e.numSupportedMorphTargets; i < p; i++)
if (a[i]) {
var d = a[i][1];
u = r["morphTarget" + i], u >= 0 && (R.bindBuffer(R.ARRAY_BUFFER, t.__webglMorphTargetsBuffers[d]), W.enableAttribute(u), R.vertexAttribPointer(u, 3, R.FLOAT, !1, 0, 0)), u = r["morphNormal" + i], u >= 0 && e.morphNormals && (R.bindBuffer(R.ARRAY_BUFFER, t.__webglMorphNormalsBuffers[d]), W.enableAttribute(u), R.vertexAttribPointer(u, 3, R.FLOAT, !1, 0, 0)), n.__webglMorphTargetInfluences[i] = o[d]
} else n.__webglMorphTargetInfluences[i] = 0
}
e.program.uniforms.morphTargetInfluences !== null && R.uniform1fv(e.program.uniforms.morphTargetInfluences, n.__webglMorphTargetInfluences)
}
function At(e, t) {
return e.object.renderOrder !== t.object.renderOrder ? e.object.renderOrder - t.object.renderOrder : e.material.id !== t.material.id ? e.material.id - t.material.id : e.z !== t.z ? e.z - t.z : e.id - t.id
}
function Ot(e, t) {
return e.object.renderOrder !== t.object.renderOrder ? e.object.renderOrder - t.object.renderOrder : e.z !== t.z ? t.z - e.z : e.id - t.id
}
function Mt(e, t) {
return t[0] - e[0]
}
function _t(e) {
if (e.visible === !1) return;
if (!(e instanceof THREE.Scene || e instanceof THREE.Group)) {
Ht(e);
var t = v[e.id];
if (t && (e.frustumCulled === !1 || H.intersectsObject(e) === !0))
for (var n = 0, r = t.length; n < r; n++) {
var i = t[n];
Pt(i), i.render = !0, E.sortObjects === !0 && (j.setFromMatrixPosition(e.matrixWorld), j.applyProjection(B), i.z = j.z)
}
}
for (var n = 0, r = e.children.length; n < r; n++) _t(e.children[n])
}
function Dt(e, t, n, r, i) {
var s;
for (var o = 0, u = e.length; o < u; o++) {
var a = e[o],
f = a.object,
l = a.buffer;
an(f, t);
if (i) s = i;
else {
s = a.material;
if (!s) continue;
Jt(s)
}
E.setMaterialFaces(s), l instanceof THREE.BufferGeometry ? E.renderBufferDirect(t, n, r, s, l, f) : E.renderBuffer(t, n, r, s, l, f)
}
}
function Pt(e) {
var t = e.object,
n = e.buffer,
r = t.geometry,
i = t.material;
if (i instanceof THREE.MeshFaceMaterial) {
var s = r instanceof THREE.BufferGeometry ? 0 : n.materialIndex;
i = i.materials[s], e.material = i, i.transparent ? y.push(e) : g.push(e)
} else i && (e.material = i, i.transparent ? y.push(e) : g.push(e))
}
function Ht(e) {
e.__webglInit === undefined && (e.__webglInit = !0, e._modelViewMatrix = new THREE.Matrix4, e._normalMatrix = new THREE.Matrix3, e.addEventListener("removed", ht));
var t = e.geometry;
t !== undefined && t.__webglInit === undefined && (t.__webglInit = !0, t.addEventListener("dispose", pt), t instanceof THREE.BufferGeometry ? E.info.memory.geometries++ : e instanceof THREE.Mesh && It(e, t));
if (e.__webglActive === undefined) {
e.__webglActive = !0;
if (e instanceof THREE.Mesh)
if (t instanceof THREE.BufferGeometry) qt(v, t, e);
else if (t instanceof THREE.Geometry) {
var n = Bt[t.id];
for (var r = 0, i = n.length; r < i; r++) qt(v, n[r], e)
}
}
}
function Ft(e, t) {
var n = X.get("OES_element_index_uint") ? 4294967296 : 65535,
r, i = {},
s = e.morphTargets.length,
o = e.morphNormals.length,
u, a = {},
f = [];
for (var l = 0, c = e.faces.length; l < c; l++) {
var h = e.faces[l],
p = t ? h.materialIndex : 0;
p in i || (i[p] = {
hash: p,
counter: 0
}), r = i[p].hash + "_" + i[p].counter, r in a || (u = {
id: jt++,
faces3: [],
materialIndex: p,
vertices: 0,
numMorphTargets: s,
numMorphNormals: o
}, a[r] = u, f.push(u)), a[r].vertices + 3 > n && (i[p].counter += 1, r = i[p].hash + "_" + i[p].counter, r in a || (u = {
id: jt++,
faces3: [],
materialIndex: p,
vertices: 0,
numMorphTargets: s,
numMorphNormals: o
}, a[r] = u, f.push(u))), a[r].faces3.push(l), a[r].vertices += 3
}
return f
}
function It(e, t) {
var n = e.material,
r = !1;
if (Bt[t.id] === undefined || t.groupsNeedUpdate === !0) delete v[e.id], Bt[t.id] = Ft(t, n instanceof THREE.MeshFaceMaterial), t.groupsNeedUpdate = !1;
var i = Bt[t.id];
for (var s = 0, o = i.length; s < o; s++) {
var u = i[s];
u.__webglVertexBuffer === undefined ? (ct(u), xt(u, e), t.verticesNeedUpdate = !0, t.morphTargetsNeedUpdate = !0, t.elementsNeedUpdate = !0, t.uvsNeedUpdate = !0, t.normalsNeedUpdate = !0, t.tangentsNeedUpdate = !0, t.colorsNeedUpdate = !0, r = !0) : r = !1, (r || e.__webglActive === undefined) && qt(v, u, e)
}
e.__webglActive = !0
}
function qt(e, t, n) {
var r = n.id;
e[r] = e[r] || [], e[r].push({
id: r,
buffer: t,
object: n,
material: null,
z: 0
})
}
function Rt(e) {
var t = e.geometry;
if (t instanceof THREE.BufferGeometry) {
var n = t.attributes,
r = t.attributesKeys;
for (var i = 0, s = r.length; i < s; i++) {
var o = r[i],
u = n[o],
a = o === "index" ? R.ELEMENT_ARRAY_BUFFER : R.ARRAY_BUFFER;
u.buffer === undefined ? (u.buffer = R.createBuffer(), R.bindBuffer(a, u.buffer), R.bufferData(a, u.array, u instanceof THREE.DynamicBufferAttribute ? R.DYNAMIC_DRAW : R.STATIC_DRAW), u.needsUpdate = !1) : u.needsUpdate === !0 && (R.bindBuffer(a, u.buffer), u.updateRange === undefined || u.updateRange.count === -1 ? R.bufferSubData(a, 0, u.array) : u.updateRange.count === 0 ? console.error("THREE.WebGLRenderer.updateObject: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually.") : (R.bufferSubData(a, u.updateRange.offset * u.array.BYTES_PER_ELEMENT, u.array.subarray(u.updateRange.offset, u.updateRange.offset + u.updateRange.count)), u.updateRange.count = 0), u.needsUpdate = !1)
}
} else if (e instanceof THREE.Mesh) {
t.groupsNeedUpdate === !0 && It(e, t);
var f = Bt[t.id];
for (var i = 0, l = f.length; i < l; i++) {
var c = f[i],
h = Tt(e, c),
p = h.attributes && Ut(h);
(t.verticesNeedUpdate || t.morphTargetsNeedUpdate || t.elementsNeedUpdate || t.uvsNeedUpdate || t.normalsNeedUpdate || t.colorsNeedUpdate || t.tangentsNeedUpdate || p) && Ct(c, e, R.DYNAMIC_DRAW, !t.dynamic, h)
}
t.verticesNeedUpdate = !1, t.morphTargetsNeedUpdate = !1, t.elementsNeedUpdate = !1, t.uvsNeedUpdate = !1, t.normalsNeedUpdate = !1, t.colorsNeedUpdate = !1, t.tangentsNeedUpdate = !1, h.attributes && zt(h)
}
}
function Ut(e) {
for (var t in e.attributes)
if (e.attributes[t].needsUpdate) return !0;
return !1
}
function zt(e) {
for (var t in e.attributes) e.attributes[t].needsUpdate = !1
}
function Wt(e) {
(e instanceof THREE.Mesh || e instanceof THREE.PointCloud || e instanceof THREE.Line) && delete v[e.id], delete e.__webglInit, delete e._modelViewMatrix, delete e._normalMatrix, delete e.__webglActive
}
function Xt(e, t) {
for (var n = e.length - 1; n >= 0; n--) e[n].object === t && e.splice(n, 1)
}
function $t(e, t, n, r) {
e.addEventListener("dispose", mt);
var s = Vt[e.type];
if (s) {
var o = THREE.ShaderLib[s];
e.__webglShader = {
uniforms: THREE.UniformsUtils.clone(o.uniforms),
vertexShader: o.vertexShader,
fragmentShader: o.fragmentShader
}
} else e.__webglShader = {
uniforms: e.uniforms,
vertexShader: e.vertexShader,
fragmentShader: e.fragmentShader
};
var u = 0,
a = 0,
f = 0,
l = {
precision: i,
supportsVertexTextures: Z,
map: !!e.map,
envMap: !!e.envMap,
envMapMode: e.envMap && e.envMap.mapping,
lightMap: !!e.lightMap,
bumpMap: !!e.bumpMap,
normalMap: !!e.normalMap,
specularMap: !!e.specularMap,
alphaMap: !!e.alphaMap,
combine: e.combine,
vertexColors: e.vertexColors,
fog: n,
useFog: e.fog,
fogExp: n instanceof THREE.FogExp2,
flatShading: e.shading === THREE.FlatShading,
sizeAttenuation: e.sizeAttenuation,
logarithmicDepthBuffer: c,
skinning: e.skinning,
maxBones: f,
useVertexTexture: et && r && r.skeleton && r.skeleton.useVertexTexture,
morphTargets: e.morphTargets,
morphNormals: e.morphNormals,
maxMorphTargets: E.maxMorphTargets,
maxMorphNormals: E.maxMorphNormals,
maxDirLights: u.directional,
maxPointLights: u.point,
maxSpotLights: u.spot,
maxHemiLights: u.hemi,
maxShadows: a,
shadowMapEnabled: E.shadowMapEnabled && r.receiveShadow && a > 0,
shadowMapType: E.shadowMapType,
shadowMapDebug: E.shadowMapDebug,
shadowMapCascade: E.shadowMapCascade,
alphaTest: e.alphaTest,
metal: e.metal,
wrapAround: e.wrapAround,
doubleSided: e.side === THREE.DoubleSide,
flipSided: e.side === THREE.BackSide
},
h = [];
s ? h.push(s) : (h.push(e.fragmentShader), h.push(e.vertexShader));
if (e.defines !== undefined)
for (var p in e.defines) h.push(p), h.push(e.defines[p]);
for (var p in l) h.push(p), h.push(l[p]);
var d = h.join(),
v;
for (var m = 0, g = S.length; m < g; m++) {
var y = S[m];
if (y.code === d) {
v = y, v.usedTimes++;
break
}
}
v === undefined && (v = new THREE.WebGLProgram(E, d, e, l), S.push(v), E.info.memory.programs = S.length), e.program = v;
var b = v.attributes;
if (e.morphTargets) {
e.numSupportedMorphTargets = 0;
var w, x = "morphTarget";
for (var T = 0; T < E.maxMorphTargets; T++) w = x + T, b[w] >= 0 && e.numSupportedMorphTargets++
}
if (e.morphNormals) {
e.numSupportedMorphNormals = 0;
var w, x = "morphNormal";
for (T = 0; T < E.maxMorphNormals; T++) w = x + T, b[w] >= 0 && e.numSupportedMorphNormals++
}
e.uniformsList = [];
for (var N in e.__webglShader.uniforms) {
var C = e.program.uniforms[N];
C && e.uniformsList.push([e.__webglShader.uniforms[N], C])
}
}
function Jt(e) {
e.transparent === !0 ? W.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha) : W.setBlending(THREE.NoBlending), W.setDepthTest(e.depthTest), W.setDepthWrite(e.depthWrite), W.setColorWrite(e.colorWrite), W.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
}
function Kt(e, t, n, r, i) {
L = 0, r.needsUpdate && (r.program && Et(r), $t(r, t, n, i), r.needsUpdate = !1);
var s = !1,
o = !1,
u = !1,
a = r.program,
f = a.uniforms,
l = r.__webglShader.uniforms;
a.id !== x && (R.useProgram(a.program), x = a.id, s = !0, o = !0, u = !0), r.id !== N && (N === -1 && (u = !0), N = r.id, o = !0);
if (s || e !== k) R.uniformMatrix4fv(f.projectionMatrix, !1, e.projectionMatrix.elements), c && R.uniform1f(f.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)), e !== k && (k = e), (r instanceof THREE.ShaderMaterial || r instanceof THREE.MeshPhongMaterial || r.envMap) && f.cameraPosition !== null && (j.setFromMatrixPosition(e.matrixWorld), R.uniform3f(f.cameraPosition, j.x, j.y, j.z)), (r instanceof THREE.MeshPhongMaterial || r instanceof THREE.MeshLambertMaterial || r instanceof THREE.MeshBasicMaterial || r instanceof THREE.ShaderMaterial || r.skinning) && f.viewMatrix !== null && R.uniformMatrix4fv(f.viewMatrix, !1, e.matrixWorldInverse.elements);
return o && un(r.uniformsList), sn(f, i), f.modelMatrix !== null && R.uniformMatrix4fv(f.modelMatrix, !1, i.matrixWorld.elements), a
}
function Qt(e, t) {
e.opacity.value = t.opacity, e.diffuse.value = t.color, e.map.value = t.map, e.lightMap.value = t.lightMap, e.specularMap.value = t.specularMap, e.alphaMap.value = t.alphaMap, t.bumpMap && (e.bumpMap.value = t.bumpMap, e.bumpScale.value = t.bumpScale), t.normalMap && (e.normalMap.value = t.normalMap, e.normalScale.value.copy(t.normalScale));
var n;
t.map ? n = t.map : t.specularMap ? n = t.specularMap : t.normalMap ? n = t.normalMap : t.bumpMap ? n = t.bumpMap : t.alphaMap && (n = t.alphaMap);
if (n !== undefined) {
var r = n.offset,
i = n.repeat;
e.offsetRepeat.value.set(r.x, r.y, i.x, i.y)
}
e.envMap.value = t.envMap, e.flipEnvMap.value = t.envMap instanceof THREE.WebGLRenderTargetCube ? 1 : -1, e.reflectivity.value = t.reflectivity, e.refractionRatio.value = t.refractionRatio
}
function Gt(e, t) {
e.diffuse.value = t.color, e.opacity.value = t.opacity
}
function Yt(e, t) {
e.dashSize.value = t.dashSize, e.totalSize.value = t.dashSize + t.gapSize, e.scale.value = t.scale
}
function Zt(e, t) {
e.shininess.value = t.shininess, e.emissive.value = t.emissive, e.specular.value = t.specular, t.wrapAround && e.wrapRGB.value.copy(t.wrapRGB)
}
function en(e, t) {
e.emissive.value = t.emissive, t.wrapAround && e.wrapRGB.value.copy(t.wrapRGB)
}
function tn(e, t) {
e.ambientLightColor.value = t.ambient, e.directionalLightColor.value = t.directional.colors, e.directionalLightDirection.value = t.directional.positions, e.pointLightColor.value = t.point.colors, e.pointLightPosition.value = t.point.positions, e.pointLightDistance.value = t.point.distances, e.pointLightDecay.value = t.point.decays, e.spotLightColor.value = t.spot.colors, e.spotLightPosition.value = t.spot.positions, e.spotLightDistance.value = t.spot.distances, e.spotLightDirection.value = t.spot.directions, e.spotLightAngleCos.value = t.spot.anglesCos, e.spotLightExponent.value = t.spot.exponents, e.spotLightDecay.value = t.spot.decays, e.hemisphereLightSkyColor.value = t.hemi.skyColors, e.hemisphereLightGroundColor.value = t.hemi.groundColors, e.hemisphereLightDirection.value = t.hemi.positions
}
function nn(e, t) {
e.ambientLightColor.needsUpdate = t, e.directionalLightColor.needsUpdate = t, e.directionalLightDirection.needsUpdate = t, e.pointLightColor.needsUpdate = t, e.pointLightPosition.needsUpdate = t, e.pointLightDistance.needsUpdate = t, e.pointLightDecay.needsUpdate = t, e.spotLightColor.needsUpdate = t, e.spotLightPosition.needsUpdate = t, e.spotLightDistance.needsUpdate = t, e.spotLightDirection.needsUpdate = t, e.spotLightAngleCos.needsUpdate = t, e.spotLightExponent.needsUpdate = t, e.spotLightDecay.needsUpdate = t, e.hemisphereLightSkyColor.needsUpdate = t, e.hemisphereLightGroundColor.needsUpdate = t, e.hemisphereLightDirection.needsUpdate = t
}
function rn(e, t) {
if (e.shadowMatrix) {
var n = 0;
for (var r = 0, i = t.length; r < i; r++) {
var s = t[r];
if (!s.castShadow) continue;
if (s instanceof THREE.SpotLight || s instanceof THREE.DirectionalLight && !s.shadowCascade) e.shadowMap.value[n] = s.shadowMap, e.shadowMapSize.value[n] = s.shadowMapSize, e.shadowMatrix.value[n] = s.shadowMatrix, e.shadowDarkness.value[n] = s.shadowDarkness, e.shadowBias.value[n] = s.shadowBias, n++
}
}
}
function sn(e, t) {
R.uniformMatrix4fv(e.modelViewMatrix, !1, t._modelViewMatrix.elements), e.normalMatrix && R.uniformMatrix3fv(e.normalMatrix, !1, t._normalMatrix.elements)
}
function on() {
var e = L;
return e >= K && THREE.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + K), L += 1, e
}
function un(e) {
var t, n, r;
for (var i = 0, s = e.length; i < s; i++) {
var o = e[i][0];
if (o.needsUpdate === !1) continue;
var u = o.type,
a = o.value,
f = e[i][1];
switch (u) {
case "1i":
R.uniform1i(f, a);
break;
case "1f":
R.uniform1f(f, a);
break;
case "2f":
R.uniform2f(f, a[0], a[1]);
break;
case "3f":
R.uniform3f(f, a[0], a[1], a[2]);
break;
case "4f":
R.uniform4f(f, a[0], a[1], a[2], a[3]);
break;
case "1iv":
R.uniform1iv(f, a);
break;
case "3iv":
R.uniform3iv(f, a);
break;
case "1fv":
R.uniform1fv(f, a);
break;
case "2fv":
R.uniform2fv(f, a);
break;
case "3fv":
R.uniform3fv(f, a);
break;
case "4fv":
R.uniform4fv(f, a);
break;
case "Matrix3fv":
R.uniformMatrix3fv(f, !1, a);
break;
case "Matrix4fv":
R.uniformMatrix4fv(f, !1, a);
break;
case "i":
R.uniform1i(f, a);
break;
case "f":
R.uniform1f(f, a);
break;
case "v2":
R.uniform2f(f, a.x, a.y);
break;
case "v3":
R.uniform3f(f, a.x, a.y, a.z);
break;
case "v4":
R.uniform4f(f, a.x, a.y, a.z, a.w);
break;
case "c":
R.uniform3f(f, a.r, a.g, a.b);
break;
case "iv1":
R.uniform1iv(f, a);
break;
case "iv":
R.uniform3iv(f, a);
break;
case "fv1":
R.uniform1fv(f, a);
break;
case "fv":
R.uniform3fv(f, a);
break;
case "v2v":
o._array === undefined && (o._array = new Float32Array(2 * a.length));
for (var l = 0, c = a.length; l < c; l++) r = l * 2, o._array[r] = a[l].x, o._array[r + 1] = a[l].y;
R.uniform2fv(f, o._array);
break;
case "v3v":
o._array === undefined && (o._array = new Float32Array(3 * a.length));
for (var l = 0, c = a.length; l < c; l++) r = l * 3, o._array[r] = a[l].x, o._array[r + 1] = a[l].y, o._array[r + 2] = a[l].z;
R.uniform3fv(f, o._array);
break;
case "v4v":
o._array === undefined && (o._array = new Float32Array(4 * a.length));
for (var l = 0, c = a.length; l < c; l++) r = l * 4, o._array[r] = a[l].x, o._array[r + 1] = a[l].y, o._array[r + 2] = a[l].z, o._array[r + 3] = a[l].w;
R.uniform4fv(f, o._array);
break;
case "m3":
R.uniformMatrix3fv(f, !1, a.elements);
break;
case "m3v":
o._array === undefined && (o._array = new Float32Array(9 * a.length));
for (var l = 0, c = a.length; l < c; l++) a[l].flattenToArrayOffset(o._array, l * 9);
R.uniformMatrix3fv(f, !1, o._array);
break;
case "m4":
R.uniformMatrix4fv(f, !1, a.elements);
break;
case "m4v":
o._array === undefined && (o._array = new Float32Array(16 * a.length));
for (var l = 0, c = a.length; l < c; l++) a[l].flattenToArrayOffset(o._array, l * 16);
R.uniformMatrix4fv(f, !1, o._array);
break;
case "t":
t = a, n = on(), R.uniform1i(f, n);
if (!t) continue;
t instanceof THREE.CubeTexture || t.image instanceof Array && t.image.length === 6 ? hn(t, n) : t instanceof THREE.WebGLRenderTargetCube ? pn(t, n) : E.setTexture(t, n);
break;
case "tv":
o._array === undefined && (o._array = []);
for (var l = 0, c = o.value.length; l < c; l++) o._array[l] = on();
R.uniform1iv(f, o._array);
for (var l = 0, c = o.value.length; l < c; l++) {
t = o.value[l], n = o._array[l];
if (!t) continue;
E.setTexture(t, n)
}
break;
default:
THREE.warn("THREE.WebGLRenderer: Unknown uniform type: " + u)
}
}
}
function an(e, t) {
e._modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, e.matrixWorld), e._normalMatrix.getNormalMatrix(e._modelViewMatrix)
}
function fn(e, t, n, r) {
e[t] = n.r * r, e[t + 1] = n.g * r, e[t + 2] = n.b * r
}
function ln(e, t, n) {
var r;
n ? (R.texParameteri(e, R.TEXTURE_WRAP_S, yn(t.wrapS)), R.texParameteri(e, R.TEXTURE_WRAP_T, yn(t.wrapT)), R.texParameteri(e, R.TEXTURE_MAG_FILTER, yn(t.magFilter)), R.texParameteri(e, R.TEXTURE_MIN_FILTER, yn(t.minFilter))) : (R.texParameteri(e, R.TEXTURE_WRAP_S, R.CLAMP_TO_EDGE), R.texParameteri(e, R.TEXTURE_WRAP_T, R.CLAMP_TO_EDGE), (t.wrapS !== THREE.ClampToEdgeWrapping || t.wrapT !== THREE.ClampToEdgeWrapping) && THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( " + t.sourceFile + " )"), R.texParameteri(e, R.TEXTURE_MAG_FILTER, gn(t.magFilter)), R.texParameteri(e, R.TEXTURE_MIN_FILTER, gn(t.minFilter)), t.minFilter !== THREE.NearestFilter && t.minFilter !== THREE.LinearFilter && THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( " + t.sourceFile + " )")), r = X.get("EXT_texture_filter_anisotropic"), r && t.type !== THREE.FloatType && t.type !== THREE.HalfFloatType && (t.anisotropy > 1 || t.__currentAnisotropy) && (R.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, E.getMaxAnisotropy())), t.__currentAnisotropy = t.anisotropy)
}
function cn(e, t) {
if (e.width > t || e.height > t) {
var n = t / Math.max(e.width, e.height),
r = document.createElement("canvas");
r.width = Math.floor(e.width * n), r.height = Math.floor(e.height * n);
var i = r.getContext("2d");
return i.drawImage(e, 0, 0, e.width, e.height, 0, 0, r.width, r.height), THREE.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + r.width + "x" + r.height, e), r
}
return e
}
function hn(e, t) {
if (e.image.length === 6)
if (e.needsUpdate) {
e.image.__webglTextureCube || (e.addEventListener("dispose", dt), e.image.__webglTextureCube = R.createTexture(), E.info.memory.textures++), R.activeTexture(R.TEXTURE0 + t), R.bindTexture(R.TEXTURE_CUBE_MAP, e.image.__webglTextureCube), R.pixelStorei(R.UNPACK_FLIP_Y_WEBGL, e.flipY);
var n = e instanceof THREE.CompressedTexture,
r = e.image[0] instanceof THREE.DataTexture,
i = [];
for (var s = 0; s < 6; s++) E.autoScaleCubemaps && !n && !r ? i[s] = cn(e.image[s], Y) : i[s] = r ? e.image[s].image : e.image[s];
var o = i[0],
u = THREE.Math.isPowerOfTwo(o.width) && THREE.Math.isPowerOfTwo(o.height),
a = yn(e.format),
f = yn(e.type);
ln(R.TEXTURE_CUBE_MAP, e, u);
for (var s = 0; s < 6; s++)
if (!n) r ? R.texImage2D(R.TEXTURE_CUBE_MAP_POSITIVE_X + s, 0, a, i[s].width, i[s].height, 0, a, f, i[s].data) : R.texImage2D(R.TEXTURE_CUBE_MAP_POSITIVE_X + s, 0, a, a, f, i[s]);
else {
var l, c = i[s].mipmaps;
for (var h = 0, p = c.length; h < p; h++) l = c[h], e.format !== THREE.RGBAFormat && e.format !== THREE.RGBFormat ? st().indexOf(a) > -1 ? R.compressedTexImage2D(R.TEXTURE_CUBE_MAP_POSITIVE_X + s, h, a, l.width, l.height, 0, l.data) : THREE.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()") : R.texImage2D(R.TEXTURE_CUBE_MAP_POSITIVE_X + s, h, a, l.width, l.height, 0, a, f, l.data)
}
e.generateMipmaps && u && R.generateMipmap(R.TEXTURE_CUBE_MAP), e.needsUpdate = !1, e.onUpdate && e.onUpdate()
} else R.activeTexture(R.TEXTURE0 + t), R.bindTexture(R.TEXTURE_CUBE_MAP, e.image.__webglTextureCube)
}
function pn(e, t) {
R.activeTexture(R.TEXTURE0 + t), R.bindTexture(R.TEXTURE_CUBE_MAP, e.__webglTexture)
}
function dn(e, t, n) {
R.bindFramebuffer(R.FRAMEBUFFER, e), R.framebufferTexture2D(R.FRAMEBUFFER, R.COLOR_ATTACHMENT0, n, t.__webglTexture, 0)
}
function vn(e, t) {
R.bindRenderbuffer(R.RENDERBUFFER, e), t.depthBuffer && !t.stencilBuffer ? (R.renderbufferStorage(R.RENDERBUFFER, R.DEPTH_COMPONENT16, t.width, t.height), R.framebufferRenderbuffer(R.FRAMEBUFFER, R.DEPTH_ATTACHMENT, R.RENDERBUFFER, e)) : t.depthBuffer && t.stencilBuffer ? (R.renderbufferStorage(R.RENDERBUFFER, R.DEPTH_STENCIL, t.width, t.height), R.framebufferRenderbuffer(R.FRAMEBUFFER, R.DEPTH_STENCIL_ATTACHMENT, R.RENDERBUFFER, e)) : R.renderbufferStorage(R.RENDERBUFFER, R.RGBA4, t.width, t.height)
}
function mn(e) {
e instanceof THREE.WebGLRenderTargetCube ? (R.bindTexture(R.TEXTURE_CUBE_MAP, e.__webglTexture), R.generateMipmap(R.TEXTURE_CUBE_MAP), R.bindTexture(R.TEXTURE_CUBE_MAP, null)) : (R.bindTexture(R.TEXTURE_2D, e.__webglTexture), R.generateMipmap(R.TEXTURE_2D), R.bindTexture(R.TEXTURE_2D, null))
}
function gn(e) {
return e === THREE.NearestFilter || e === THREE.NearestMipMapNearestFilter || e === THREE.NearestMipMapLinearFilter ? R.NEAREST : R.LINEAR
}
function yn(e) {
var t;
if (e === THREE.RepeatWrapping) return R.REPEAT;
if (e === THREE.ClampToEdgeWrapping) return R.CLAMP_TO_EDGE;
if (e === THREE.MirroredRepeatWrapping) return R.MIRRORED_REPEAT;
if (e === THREE.NearestFilter) return R.NEAREST;
if (e === THREE.NearestMipMapNearestFilter) return R.NEAREST_MIPMAP_NEAREST;
if (e === THREE.NearestMipMapLinearFilter) return R.NEAREST_MIPMAP_LINEAR;
if (e === THREE.LinearFilter) return R.LINEAR;
if (e === THREE.LinearMipMapNearestFilter) return R.LINEAR_MIPMAP_NEAREST;
if (e === THREE.LinearMipMapLinearFilter) return R.LINEAR_MIPMAP_LINEAR;
if (e === THREE.UnsignedByteType) return R.UNSIGNED_BYTE;
if (e === THREE.UnsignedShort4444Type) return R.UNSIGNED_SHORT_4_4_4_4;
if (e === THREE.UnsignedShort5551Type) return R.UNSIGNED_SHORT_5_5_5_1;
if (e === THREE.UnsignedShort565Type) return R.UNSIGNED_SHORT_5_6_5;
if (e === THREE.ByteType) return R.BYTE;
if (e === THREE.ShortType) return R.SHORT;
if (e === THREE.UnsignedShortType) return R.UNSIGNED_SHORT;
if (e === THREE.IntType) return R.INT;
if (e === THREE.UnsignedIntType) return R.UNSIGNED_INT;
if (e === THREE.FloatType) return R.FLOAT;
t = X.get("OES_texture_half_float");
if (t !== null && e === THREE.HalfFloatType) return t.HALF_FLOAT_OES;
if (e === THREE.AlphaFormat) return R.ALPHA;
if (e === THREE.RGBFormat) return R.RGB;
if (e === THREE.RGBAFormat) return R.RGBA;
if (e === THREE.LuminanceFormat) return R.LUMINANCE;
if (e === THREE.LuminanceAlphaFormat) return R.LUMINANCE_ALPHA;
if (e === THREE.AddEquation) return R.FUNC_ADD;
if (e === THREE.SubtractEquation) return R.FUNC_SUBTRACT;
if (e === THREE.ReverseSubtractEquation) return R.FUNC_REVERSE_SUBTRACT;
if (e === THREE.ZeroFactor) return R.ZERO;
if (e === THREE.OneFactor) return R.ONE;
if (e === THREE.SrcColorFactor) return R.SRC_COLOR;
if (e === THREE.OneMinusSrcColorFactor) return R.ONE_MINUS_SRC_COLOR;
if (e === THREE.SrcAlphaFactor) return R.SRC_ALPHA;
if (e === THREE.OneMinusSrcAlphaFactor) return R.ONE_MINUS_SRC_ALPHA;
if (e === THREE.DstAlphaFactor) return R.DST_ALPHA;
if (e === THREE.OneMinusDstAlphaFactor) return R.ONE_MINUS_DST_ALPHA;
if (e === THREE.DstColorFactor) return R.DST_COLOR;
if (e === THREE.OneMinusDstColorFactor) return R.ONE_MINUS_DST_COLOR;
if (e === THREE.SrcAlphaSaturateFactor) return R.SRC_ALPHA_SATURATE;
t = X.get("WEBGL_compressed_texture_s3tc");
if (t !== null) {
if (e === THREE.RGB_S3TC_DXT1_Format) return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
if (e === THREE.RGBA_S3TC_DXT1_Format) return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
if (e === THREE.RGBA_S3TC_DXT3_Format) return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
if (e === THREE.RGBA_S3TC_DXT5_Format) return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
}
t = X.get("WEBGL_compressed_texture_pvrtc");
if (t !== null) {
if (e === THREE.RGB_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
if (e === THREE.RGB_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
if (e === THREE.RGBA_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
if (e === THREE.RGBA_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
}
t = X.get("EXT_blend_minmax");
if (t !== null) {
if (e === THREE.MinEquation) return t.MIN_EXT;
if (e === THREE.MaxEquation) return t.MAX_EXT
}
return 0
}
console.log("THREE.WebGLRenderer", THREE.REVISION), e = e || {};
var t = e.canvas !== undefined ? e.canvas : document.createElement("canvas"),
n = e.context !== undefined ? e.context : null,
r = 1,
i = e.precision !== undefined ? e.precision : "highp",
s = e.alpha !== undefined ? e.alpha : !1,
o = e.depth !== undefined ? e.depth : !0,
u = e.stencil !== undefined ? e.stencil : !0,
a = e.antialias !== undefined ? e.antialias : !1,
f = e.premultipliedAlpha !== undefined ? e.premultipliedAlpha : !0,
l = e.preserveDrawingBuffer !== undefined ? e.preserveDrawingBuffer : !1,
c = e.logarithmicDepthBuffer !== undefined ? e.logarithmicDepthBuffer : !1,
h = new THREE.Color(0),
p = 0,
d = [],
v = {},
m = [],
g = [],
y = [],
b = [],
w = [];
this.domElement = t, this.context = null, this.autoClear = !0, this.autoClearColor = !0, this.autoClearDepth = !0, this.autoClearStencil = !0, this.sortObjects = !0, this.gammaFactor = 2, this.gammaInput = !1, this.gammaOutput = !1, this.shadowMapEnabled = !1, this.shadowMapType = THREE.PCFShadowMap, this.shadowMapCullFace = THREE.CullFaceFront, this.shadowMapDebug = !1, this.shadowMapCascade = !1, this.maxMorphTargets = 8, this.maxMorphNormals = 4, this.autoScaleCubemaps = !0, this.info = {
memory: {
programs: 0,
geometries: 0,
textures: 0
},
render: {
calls: 0,
vertices: 0,
faces: 0,
points: 0
}
};
var E = this,
S = [],
x = null,
T = null,
N = -1,
C = "",
k = null,
L = 0,
A = 0,
O = 0,
M = t.width,
_ = t.height,
D = 0,
P = 0,
H = new THREE.Frustum,
B = new THREE.Matrix4,
j = new THREE.Vector3,
F = new THREE.Vector3,
I = !0,
q = {
ambient: [0, 0, 0],
directional: {
length: 0,
colors: [],
positions: []
},
point: {
length: 0,
colors: [],
positions: [],
distances: [],
decays: []
},
spot: {
length: 0,
colors: [],
positions: [],
distances: [],
directions: [],
anglesCos: [],
exponents: [],
decays: []
},
hemi: {
length: 0,
skyColors: [],
groundColors: [],
positions: []
}
},
R;
try {
var U = {
alpha: s,
depth: o,
stencil: u,
antialias: a,
premultipliedAlpha: f,
preserveDrawingBuffer: l
};
R = n || t.getContext("webgl", U) || t.getContext("experimental-webgl", U);
if (R === null) throw t.getContext("webgl") !== null ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
t.addEventListener("webglcontextlost", function(e) {
e.preventDefault(), J(), $(), v = {}
}, !1)
} catch (z) {
THREE.error("THREE.WebGLRenderer: " + z)
}
var W = new THREE.WebGLState(R, yn);
R.getShaderPrecisionFormat === undefined && (R.getShaderPrecisionFormat = function() {
return {
rangeMin: 1,
rangeMax: 1,
precision: 1
}
});
var X = new THREE.WebGLExtensions(R);
X.get("OES_texture_float"), X.get("OES_texture_float_linear"), X.get("OES_texture_half_float"), X.get("OES_texture_half_float_linear"), X.get("OES_standard_derivatives"), c && X.get("EXT_frag_depth");
var V = function(e, t, n, r) {
f === !0 && (e *= r, t *= r, n *= r), R.clearColor(e, t, n, r)
},
$ = function() {
R.clearColor(0, 0, 0, 1), R.clearDepth(1), R.clearStencil(0), R.enable(R.DEPTH_TEST), R.depthFunc(R.LEQUAL), R.frontFace(R.CCW), R.cullFace(R.BACK), R.enable(R.CULL_FACE), R.enable(R.BLEND), R.blendEquation(R.FUNC_ADD), R.blendFunc(R.SRC_ALPHA, R.ONE_MINUS_SRC_ALPHA), R.viewport(A, O, M, _), V(h.r, h.g, h.b, p)
},
J = function() {
x = null, k = null, C = "", N = -1, I = !0, W.reset()
};
$(), this.context = R, this.state = W;
var K = R.getParameter(R.MAX_TEXTURE_IMAGE_UNITS),
Q = R.getParameter(R.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
G = R.getParameter(R.MAX_TEXTURE_SIZE),
Y = R.getParameter(R.MAX_CUBE_MAP_TEXTURE_SIZE),
Z = Q > 0,
et = Z && X.get("OES_texture_float"),
tt = R.getShaderPrecisionFormat(R.VERTEX_SHADER, R.HIGH_FLOAT),
nt = R.getShaderPrecisionFormat(R.VERTEX_SHADER, R.MEDIUM_FLOAT),
rt = R.getShaderPrecisionFormat(R.FRAGMENT_SHADER, R.HIGH_FLOAT),
it = R.getShaderPrecisionFormat(R.FRAGMENT_SHADER, R.MEDIUM_FLOAT),
st = function() {
var e;
return function() {
if (e !== undefined) return e;
e = [];
if (X.get("WEBGL_compressed_texture_pvrtc") || X.get("WEBGL_compressed_texture_s3tc")) {
var t = R.getParameter(R.COMPRESSED_TEXTURE_FORMATS);
for (var n = 0; n < t.length; n++) e.push(t[n])
}
return e
}
}(),
ot = tt.precision > 0 && rt.precision > 0,
ut = nt.precision > 0 && it.precision > 0;
i === "highp" && !ot && (ut ? (i = "mediump", THREE.warn("THREE.WebGLRenderer: highp not supported, using mediump.")) : (i = "lowp", THREE.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp."))), i === "mediump" && !ut && (i = "lowp", THREE.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));
var at = new THREE.ShadowMapPlugin(this, d, v, m),
ft = new THREE.SpritePlugin(this, b),
lt = new THREE.LensFlarePlugin(this, w);
this.getContext = function() {
return R
}, this.forceContextLoss = function() {
X.get("WEBGL_lose_context").loseContext()
}, this.supportsVertexTextures = function() {
return Z
}, this.supportsFloatTextures = function() {
return X.get("OES_texture_float")
}, this.supportsHalfFloatTextures = function() {
return X.get("OES_texture_half_float")
}, this.supportsStandardDerivatives = function() {
return X.get("OES_standard_derivatives")
}, this.supportsCompressedTextureS3TC = function() {
return X.get("WEBGL_compressed_texture_s3tc")
}, this.supportsCompressedTexturePVRTC = function() {
return X.get("WEBGL_compressed_texture_pvrtc")
}, this.supportsBlendMinMax = function() {
return X.get("EXT_blend_minmax")
}, this.getMaxAnisotropy = function() {
var e;
return function() {
if (e !== undefined) return e;
var t = X.get("EXT_texture_filter_anisotropic");
return e = t !== null ? R.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0, e
}
}(), this.getPrecision = function() {
return i
}, this.getPixelRatio = function() {
return r
}, this.setPixelRatio = function(e) {
r = e
}, this.setSize = function(e, n, i) {
t.width = e * r, t.height = n * r, i !== !1 && (t.style.width = e + "px", t.style.height = n + "px"), this.setViewport(0, 0, e, n)
}, this.setViewport = function(e, t, n, i) {
A = e * r, O = t * r, M = n * r, _ = i * r, R.viewport(A, O, M, _)
}, this.setScissor = function(e, t, n, i) {
R.scissor(e * r, t * r, n * r, i * r)
}, this.enableScissorTest = function(e) {
e ? R.enable(R.SCISSOR_TEST) : R.disable(R.SCISSOR_TEST)
}, this.getClearColor = function() {
return h
}, this.setClearColor = function(e, t) {
h.set(e), p = t !== undefined ? t : 1, V(h.r, h.g, h.b, p)
}, this.getClearAlpha = function() {
return p
}, this.setClearAlpha = function(e) {
p = e, V(h.r, h.g, h.b, p)
}, this.clear = function(e, t, n) {
var r = 0;
if (e === undefined || e) r |= R.COLOR_BUFFER_BIT;
if (t === undefined || t) r |= R.DEPTH_BUFFER_BIT;
if (n === undefined || n) r |= R.STENCIL_BUFFER_BIT;
R.clear(r)
}, this.clearColor = function() {
R.clear(R.COLOR_BUFFER_BIT)
}, this.clearDepth = function() {
R.clear(R.DEPTH_BUFFER_BIT)
}, this.clearStencil = function() {
R.clear(R.STENCIL_BUFFER_BIT)
}, this.clearTarget = function(e, t, n, r) {
this.setRenderTarget(e), this.clear(t, n, r)
}, this.resetGLState = J;
var ht = function(e) {
var t = e.target;
t.traverse(function(e) {
e.removeEventListener("remove", ht), Wt(e)
})
},
pt = function(e) {
var t = e.target;
t.removeEventListener("dispose", pt), yt(t)
},
dt = function(e) {
var t = e.target;
t.removeEventListener("dispose", dt), bt(t), E.info.memory.textures--
},
vt = function(e) {
var t = e.target;
t.removeEventListener("dispose", vt), wt(t), E.info.memory.textures--
},
mt = function(e) {
var t = e.target;
t.removeEventListener("dispose", mt), Et(t)
},
gt = function(e) {
var t = ["__webglVertexBuffer", "__webglNormalBuffer", "__webglTangentBuffer", "__webglColorBuffer", "__webglUVBuffer", "__webglUV2Buffer", "__webglSkinIndicesBuffer", "__webglSkinWeightsBuffer", "__webglFaceBuffer", "__webglLineBuffer", "__webglLineDistanceBuffer"];
for (var n = 0, r = t.length; n < r; n++) {
var i = t[n];
e[i] !== undefined && (R.deleteBuffer(e[i]), delete e[i])
}
if (e.__webglCustomAttributesList !== undefined) {
for (var i in e.__webglCustomAttributesList) R.deleteBuffer(e.__webglCustomAttributesList[i].buffer);
delete e.__webglCustomAttributesList
}
E.info.memory.geometries--
},
yt = function(e) {
delete e.__webglInit;
if (e instanceof THREE.BufferGeometry) {
for (var t in e.attributes) {
var n = e.attributes[t];
n.buffer !== undefined && (R.deleteBuffer(n.buffer), delete n.buffer)
}
E.info.memory.geometries--
} else {
var r = Bt[e.id];
if (r !== undefined) {
for (var i = 0, s = r.length; i < s; i++) {
var o = r[i];
if (o.numMorphTargets !== undefined) {
for (var u = 0, a = o.numMorphTargets; u < a; u++) R.deleteBuffer(o.__webglMorphTargetsBuffers[u]);
delete o.__webglMorphTargetsBuffers
}
if (o.numMorphNormals !== undefined) {
for (var u = 0, a = o.numMorphNormals; u < a; u++) R.deleteBuffer(o.__webglMorphNormalsBuffers[u]);
delete o.__webglMorphNormalsBuffers
}
gt(o)
}
delete Bt[e.id]
} else gt(e)
}
C = ""
},
bt = function(e) {
if (e.image && e.image.__webglTextureCube) R.deleteTexture(e.image.__webglTextureCube), delete e.image.__webglTextureCube;
else {
if (e.__webglInit === undefined) return;
R.deleteTexture(e.__webglTexture), delete e.__webglTexture, delete e.__webglInit
}
},
wt = function(e) {
if (!e || e.__webglTexture === undefined) return;
R.deleteTexture(e.__webglTexture), delete e.__webglTexture;
if (e instanceof THREE.WebGLRenderTargetCube)
for (var t = 0; t < 6; t++) R.deleteFramebuffer(e.__webglFramebuffer[t]), R.deleteRenderbuffer(e.__webglRenderbuffer[t]);
else R.deleteFramebuffer(e.__webglFramebuffer), R.deleteRenderbuffer(e.__webglRenderbuffer);
delete e.__webglFramebuffer, delete e.__webglRenderbuffer
},
Et = function(e) {
var t = e.program.program;
if (t === undefined) return;
e.program = undefined;
var n, r, i, s = !1;
for (n = 0, r = S.length; n < r; n++) {
i = S[n];
if (i.program === t) {
i.usedTimes--, i.usedTimes === 0 && (s = !0);
break
}
}
if (s === !0) {
var o = [];
for (n = 0, r = S.length; n < r; n++) i = S[n], i.program !== t && o.push(i);
S = o, R.deleteProgram(t), E.info.memory.programs--
}
};
this.renderBufferDirect = function(e, t, n, r, i, s) {
if (r.visible === !1) return;
Rt(s);
var o = Kt(e, t, n, r, s),
u = !1,
a = r.wireframe ? 1 : 0,
f = "direct_" + i.id + "_" + o.id + "_" + a;
f !== C && (C = f, u = !0), u && W.initAttributes();
if (s instanceof THREE.Mesh) {
var l = r.wireframe === !0 ? R.LINES : R.TRIANGLES,
c = i.attributes.index;
if (i.drawRange) {
u && kt(r, o, i, 0);
var h = i.attributes.position;
R.drawArrays(l, 0, i.drawRange.count), E.info.render.calls++, E.info.render.vertices += h.array.length / h.itemSize, E.info.render.faces += h.array.length / (3 * h.itemSize)
} else if (c) {
var p, d;
c.array instanceof Uint32Array && X.get("OES_element_index_uint") ? (p = R.UNSIGNED_INT, d = 4) : (p = R.UNSIGNED_SHORT, d = 2);
var v = i.offsets;
if (v.length === 0) u && (kt(r, o, i, 0), R.bindBuffer(R.ELEMENT_ARRAY_BUFFER, c.buffer)), R.drawElements(l, c.array.length, p, 0), E.info.render.calls++, E.info.render.vertices += c.array.length, E.info.render.faces += c.array.length / 3;
else {
u = !0;
for (var m = 0, g = v.length; m < g; m++) {
var y = v[m].index;
u && (kt(r, o, i, y), R.bindBuffer(R.ELEMENT_ARRAY_BUFFER, c.buffer)), R.drawElements(l, v[m].count, p, v[m].start * d), E.info.render.calls++, E.info.render.vertices += v[m].count, E.info.render.faces += v[m].count / 3
}
}
} else {
u && kt(r, o, i, 0);
var h = i.attributes.position;
R.drawArrays(l, 0, h.array.length / h.itemSize), E.info.render.calls++, E.info.render.vertices += h.array.length / h.itemSize, E.info.render.faces += h.array.length / (3 * h.itemSize)
}
}
}, this.renderBuffer = function(e, t, n, i, s, o) {
if (i.visible === !1) return;
Rt(o);
var u = Kt(e, t, n, i, o),
a = u.attributes,
f = !1,
l = i.wireframe ? 1 : 0,
c = s.id + "_" + u.id + "_" + l;
c !== C && (C = c, f = !0), f && W.initAttributes(), !i.morphTargets && a.position >= 0 ? f && (R.bindBuffer(R.ARRAY_BUFFER, s.__webglVertexBuffer), W.enableAttribute(a.position), R.vertexAttribPointer(a.position, 3, R.FLOAT, !1, 0, 0)) : o.morphTargetBase && Lt(i, s, o);
if (f) {
if (s.__webglCustomAttributesList)
for (var h = 0, p = s.__webglCustomAttributesList.length; h < p; h++) {
var d = s.__webglCustomAttributesList[h];
a[d.buffer.belongsToAttribute] >= 0 && (R.bindBuffer(R.ARRAY_BUFFER, d.buffer), W.enableAttribute(a[d.buffer.belongsToAttribute]), R.vertexAttribPointer(a[d.buffer.belongsToAttribute], d.size, R.FLOAT, !1, 0, 0))
}
a.color >= 0 && (o.geometry.colors.length > 0 || o.geometry.faces.length > 0 ? (R.bindBuffer(R.ARRAY_BUFFER, s.__webglColorBuffer), W.enableAttribute(a.color), R.vertexAttribPointer(a.color, 3, R.FLOAT, !1, 0, 0)) : i.defaultAttributeValues !== undefined && R.vertexAttrib3fv(a.color, i.defaultAttributeValues.color)), a.normal >= 0 && (R.bindBuffer(R.ARRAY_BUFFER, s.__webglNormalBuffer), W.enableAttribute(a.normal), R.vertexAttribPointer(a.normal, 3, R.FLOAT, !1, 0, 0)), a.tangent >= 0 && (R.bindBuffer(R.ARRAY_BUFFER, s.__webglTangentBuffer), W.enableAttribute(a.tangent), R.vertexAttribPointer(a.tangent, 4, R.FLOAT, !1, 0, 0)), a.uv >= 0 && (o.geometry.faceVertexUvs[0] ? (R.bindBuffer(R.ARRAY_BUFFER, s.__webglUVBuffer), W.enableAttribute(a.uv), R.vertexAttribPointer(a.uv, 2, R.FLOAT, !1, 0, 0)) : i.defaultAttributeValues !== undefined && R.vertexAttrib2fv(a.uv, i.defaultAttributeValues.uv)), a.uv2 >= 0 && (o.geometry.faceVertexUvs[1] ? (R.bindBuffer(R.ARRAY_BUFFER, s.__webglUV2Buffer), W.enableAttribute(a.uv2), R.vertexAttribPointer(a.uv2, 2, R.FLOAT, !1, 0, 0)) : i.defaultAttributeValues !== undefined && R.vertexAttrib2fv(a.uv2, i.defaultAttributeValues.uv2)), i.skinning && a.skinIndex >= 0 && a.skinWeight >= 0 && (R.bindBuffer(R.ARRAY_BUFFER, s.__webglSkinIndicesBuffer), W.enableAttribute(a.skinIndex), R.vertexAttribPointer(a.skinIndex, 4, R.FLOAT, !1, 0, 0), R.bindBuffer(R.ARRAY_BUFFER, s.__webglSkinWeightsBuffer), W.enableAttribute(a.skinWeight), R.vertexAttribPointer(a.skinWeight, 4, R.FLOAT, !1, 0, 0)), a.lineDistance >= 0 && (R.bindBuffer(R.ARRAY_BUFFER, s.__webglLineDistanceBuffer), W.enableAttribute(a.lineDistance), R.vertexAttribPointer(a.lineDistance, 1, R.FLOAT, !1, 0, 0))
}
W.disableUnusedAttributes();
if (o instanceof THREE.Mesh) {
var v = s.__typeArray === Uint32Array ? R.UNSIGNED_INT : R.UNSIGNED_SHORT;
i.wireframe ? (W.setLineWidth(i.wireframeLinewidth * r), f && R.bindBuffer(R.ELEMENT_ARRAY_BUFFER, s.__webglLineBuffer), R.drawElements(R.LINES, s.__webglLineCount, v, 0)) : (f && R.bindBuffer(R.ELEMENT_ARRAY_BUFFER, s.__webglFaceBuffer), R.drawElements(R.TRIANGLES, s.__webglFaceCount, v, 0)), E.info.render.calls++, E.info.render.vertices += s.__webglFaceCount, E.info.render.faces += s.__webglFaceCount / 3
}
}, this.render = function(e, t, n, r) {
if (t instanceof THREE.Camera == 0) {
THREE.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
return
}
var i = e.fog;
C = "", N = -1, k = null, I = !0, e.autoUpdate === !0 && e.updateMatrixWorld(), t.parent === undefined && t.updateMatrixWorld(), e.traverse(function(e) {
e instanceof THREE.SkinnedMesh && e.skeleton.update()
}), t.matrixWorldInverse.getInverse(t.matrixWorld), B.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), H.setFromMatrix(B), d.length = 0, g.length = 0, y.length = 0, b.length = 0, w.length = 0, _t(e), E.sortObjects === !0 && (g.sort(At), y.sort(Ot)), E.info.render.calls = 0, E.info.render.vertices = 0, E.info.render.faces = 0, E.info.render.points = 0, this.setRenderTarget(n), (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil), W.setBlending(THREE.NoBlending), Dt(g, t, d, i, null), Dt(y, t, d, i, null), n && n.generateMipmaps && n.minFilter !== THREE.NearestFilter && n.minFilter !== THREE.LinearFilter && mn(n), W.setDepthTest(!0), W.setDepthWrite(!0), W.setColorWrite(!0)
};
var Bt = {},
jt = 0,
Vt = {
MeshDepthMaterial: "depth",
MeshNormalMaterial: "normal",
MeshBasicMaterial: "basic",
MeshLambertMaterial: "lambert",
MeshPhongMaterial: "phong",
LineBasicMaterial: "basic",
LineDashedMaterial: "dashed",
PointCloudMaterial: "particle_basic"
};
this.setFaceCulling = function(e, t) {
e === THREE.CullFaceNone ? R.disable(R.CULL_FACE) : (t === THREE.FrontFaceDirectionCW ? R.frontFace(R.CW) : R.frontFace(R.CCW), e === THREE.CullFaceBack ? R.cullFace(R.BACK) : e === THREE.CullFaceFront ? R.cullFace(R.FRONT) : R.cullFace(R.FRONT_AND_BACK), R.enable(R.CULL_FACE))
}, this.setMaterialFaces = function(e) {
W.setDoubleSided(e.side === THREE.DoubleSide), W.setFlipSided(e.side === THREE.BackSide)
}, this.uploadTexture = function(e) {
e.__webglInit === undefined && (e.__webglInit = !0, e.addEventListener("dispose", dt), e.__webglTexture = R.createTexture(), E.info.memory.textures++), R.bindTexture(R.TEXTURE_2D, e.__webglTexture), R.pixelStorei(R.UNPACK_FLIP_Y_WEBGL, e.flipY), R.pixelStorei(R.UNPACK_PREMULTIPLY_ALPHA_WEBGL, e.premultiplyAlpha), R.pixelStorei(R.UNPACK_ALIGNMENT, e.unpackAlignment), e.image = cn(e.image, G);
var t = e.image,
n = THREE.Math.isPowerOfTwo(t.width) && THREE.Math.isPowerOfTwo(t.height),
r = yn(e.format),
i = yn(e.type);
ln(R.TEXTURE_2D, e, n);
var s, o = e.mipmaps;
if (e instanceof THREE.DataTexture)
if (o.length > 0 && n) {
for (var u = 0, a = o.length; u < a; u++) s = o[u], R.texImage2D(R.TEXTURE_2D, u, r, s.width, s.height, 0, r, i, s.data);
e.generateMipmaps = !1
} else R.texImage2D(R.TEXTURE_2D, 0, r, t.width, t.height, 0, r, i, t.data);
else if (e instanceof THREE.CompressedTexture)
for (var u = 0, a = o.length; u < a; u++) s = o[u], e.format !== THREE.RGBAFormat && e.format !== THREE.RGBFormat ? st().indexOf(r) > -1 ? R.compressedTexImage2D(R.TEXTURE_2D, u, r, s.width, s.height, 0, s.data) : THREE.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : R.texImage2D(R.TEXTURE_2D, u, r, s.width, s.height, 0, r, i, s.data);
else if (o.length > 0 && n) {
for (var u = 0, a = o.length; u < a; u++) s = o[u], R.texImage2D(R.TEXTURE_2D, u, r, r, i, s);
e.generateMipmaps = !1
} else R.texImage2D(R.TEXTURE_2D, 0, r, r, i, e.image);
e.generateMipmaps && n && R.generateMipmap(R.TEXTURE_2D), e.needsUpdate = !1, e.onUpdate && e.onUpdate()
}, this.setTexture = function(e, t) {
R.activeTexture(R.TEXTURE0 + t), e.needsUpdate ? E.uploadTexture(e) : R.bindTexture(R.TEXTURE_2D, e.__webglTexture)
}, this.setRenderTarget = function(e) {
var t = e instanceof THREE.WebGLRenderTargetCube;
if (e && e.__webglFramebuffer === undefined) {
e.depthBuffer === undefined && (e.depthBuffer = !0), e.stencilBuffer === undefined && (e.stencilBuffer = !0), e.addEventListener("dispose", vt), e.__webglTexture = R.createTexture(), E.info.memory.textures++;
var n = THREE.Math.isPowerOfTwo(e.width) && THREE.Math.isPowerOfTwo(e.height),
r = yn(e.format),
i = yn(e.type);
if (t) {
e.__webglFramebuffer = [], e.__webglRenderbuffer = [], R.bindTexture(R.TEXTURE_CUBE_MAP, e.__webglTexture), ln(R.TEXTURE_CUBE_MAP, e, n);
for (var s = 0; s < 6; s++) e.__webglFramebuffer[s] = R.createFramebuffer(), e.__webglRenderbuffer[s] = R.createRenderbuffer(), R.texImage2D(R.TEXTURE_CUBE_MAP_POSITIVE_X + s, 0, r, e.width, e.height, 0, r, i, null), dn(e.__webglFramebuffer[s], e, R.TEXTURE_CUBE_MAP_POSITIVE_X + s), vn(e.__webglRenderbuffer[s], e);
n && R.generateMipmap(R.TEXTURE_CUBE_MAP)
} else e.__webglFramebuffer = R.createFramebuffer(), e.shareDepthFrom ? e.__webglRenderbuffer = e.shareDepthFrom.__webglRenderbuffer : e.__webglRenderbuffer = R.createRenderbuffer(), R.bindTexture(R.TEXTURE_2D, e.__webglTexture), ln(R.TEXTURE_2D, e, n), R.texImage2D(R.TEXTURE_2D, 0, r, e.width, e.height, 0, r, i, null), dn(e.__webglFramebuffer, e, R.TEXTURE_2D), e.shareDepthFrom ? e.depthBuffer && !e.stencilBuffer ? R.framebufferRenderbuffer(R.FRAMEBUFFER, R.DEPTH_ATTACHMENT, R.RENDERBUFFER, e.__webglRenderbuffer) : e.depthBuffer && e.stencilBuffer && R.framebufferRenderbuffer(R.FRAMEBUFFER, R.DEPTH_STENCIL_ATTACHMENT, R.RENDERBUFFER, e.__webglRenderbuffer) : vn(e.__webglRenderbuffer, e), n && R.generateMipmap(R.TEXTURE_2D);
t ? R.bindTexture(R.TEXTURE_CUBE_MAP, null) : R.bindTexture(R.TEXTURE_2D, null), R.bindRenderbuffer(R.RENDERBUFFER, null), R.bindFramebuffer(R.FRAMEBUFFER, null)
}
var o, u, a, f, l;
e ? (t ? o = e.__webglFramebuffer[e.activeCubeFace] : o = e.__webglFramebuffer, u = e.width, a = e.height, f = 0, l = 0) : (o = null, u = M, a = _, f = A, l = O), o !== T && (R.bindFramebuffer(R.FRAMEBUFFER, o), R.viewport(f, l, u, a), T = o), D = u, P = a
}, this.readRenderTargetPixels = function(e, t, n, r, i, s) {
if (!(e instanceof THREE.WebGLRenderTarget)) {
console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
return
}
if (e.__webglFramebuffer) {
if (e.format !== THREE.RGBAFormat) {
console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");
return
}
var o = !1;
e.__webglFramebuffer !== T && (R.bindFramebuffer(R.FRAMEBUFFER, e.__webglFramebuffer), o = !0), R.checkFramebufferStatus(R.FRAMEBUFFER) === R.FRAMEBUFFER_COMPLETE ? R.readPixels(t, n, r, i, R.RGBA, R.UNSIGNED_BYTE, s) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."), o && R.bindFramebuffer(R.FRAMEBUFFER, T)
}
}, this.initMaterial = function() {
THREE.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
}, this.addPrePlugin = function() {
THREE.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
}, this.addPostPlugin = function() {
THREE.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
}, this.updateShadowMap = function() {
THREE.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
}
}, THREE.WebGLRenderTarget = function(e, t, n) {
this.width = e, this.height = t, n = n || {}, this.wrapS = n.wrapS !== undefined ? n.wrapS : THREE.ClampToEdgeWrapping, this.wrapT = n.wrapT !== undefined ? n.wrapT : THREE.ClampToEdgeWrapping, this.magFilter = n.magFilter !== undefined ? n.magFilter : THREE.LinearFilter, this.minFilter = n.minFilter !== undefined ? n.minFilter : THREE.LinearMipMapLinearFilter, this.anisotropy = n.anisotropy !== undefined ? n.anisotropy : 1, this.offset = new THREE.Vector2(0, 0), this.repeat = new THREE.Vector2(1, 1), this.format = n.format !== undefined ? n.format : THREE.RGBAFormat, this.type = n.type !== undefined ? n.type : THREE.UnsignedByteType, this.depthBuffer = n.depthBuffer !== undefined ? n.depthBuffer : !0, this.stencilBuffer = n.stencilBuffer !== undefined ? n.stencilBuffer : !0, this.generateMipmaps = !0, this.shareDepthFrom = n.shareDepthFrom !== undefined ? n.shareDepthFrom : null
}, THREE.WebGLRenderTarget.prototype = {
constructor: THREE.WebGLRenderTarget,
setSize: function(e, t) {
this.width = e, this.height = t
},
clone: function() {
var e = new THREE.WebGLRenderTarget(this.width, this.height);
return e.wrapS = this.wrapS, e.wrapT = this.wrapT, e.magFilter = this.magFilter, e.minFilter = this.minFilter, e.anisotropy = this.anisotropy, e.offset.copy(this.offset), e.repeat.copy(this.repeat), e.format = this.format, e.type = this.type, e.depthBuffer = this.depthBuffer, e.stencilBuffer = this.stencilBuffer, e.generateMipmaps = this.generateMipmaps, e.shareDepthFrom = this.shareDepthFrom, e
},
dispose: function() {
this.dispatchEvent({
type: "dispose"
})
}
}, THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype), THREE.WebGLExtensions = function(e) {
var t = {};
this.get = function(n) {
if (t[n] !== undefined) return t[n];
var r;
switch (n) {
case "EXT_texture_filter_anisotropic":
r = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
break;
case "WEBGL_compressed_texture_s3tc":
r = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
break;
case "WEBGL_compressed_texture_pvrtc":
r = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
break;
default:
r = e.getExtension(n)
}
return r === null && THREE.warn("THREE.WebGLRenderer: " + n + " extension not supported."), t[n] = r, r
}
}, THREE.WebGLProgram = function() {
var e = 0,
t = function(e) {
var t, n, r = [];
for (var i in e) {
t = e[i];
if (t === !1) continue;
n = "#define " + i + " " + t, r.push(n)
}
return r.join("\n")
},
n = function(e, t, n) {
var r = {};
for (var i = 0, s = n.length; i < s; i++) {
var o = n[i];
r[o] = e.getUniformLocation(t, o)
}
return r
},
r = function(e, t, n) {
var r = {};
for (var i = 0, s = n.length; i < s; i++) {
var o = n[i];
r[o] = e.getAttribLocation(t, o)
}
return r
};
return function(i, s, o, u) {
var a = i,
f = a.context,
l = o.defines,
c = o.__webglShader.uniforms,
h = o.attributes,
p = o.__webglShader.vertexShader,
d = o.__webglShader.fragmentShader,
v = o.index0AttributeName;
v === undefined && u.morphTargets === !0 && (v = "position");
var m = "SHADOWMAP_TYPE_BASIC";
u.shadowMapType === THREE.PCFShadowMap ? m = "SHADOWMAP_TYPE_PCF" : u.shadowMapType === THREE.PCFSoftShadowMap && (m = "SHADOWMAP_TYPE_PCF_SOFT");
var g = "ENVMAP_TYPE_CUBE",
y = "ENVMAP_MODE_REFLECTION",
b = "ENVMAP_BLENDING_MULTIPLY";
if (u.envMap) {
switch (o.envMap.mapping) {
case THREE.CubeReflectionMapping:
case THREE.CubeRefractionMapping:
g = "ENVMAP_TYPE_CUBE";
break;
case THREE.EquirectangularReflectionMapping:
case THREE.EquirectangularRefractionMapping:
g = "ENVMAP_TYPE_EQUIREC";
break;
case THREE.SphericalReflectionMapping:
g = "ENVMAP_TYPE_SPHERE"
}
switch (o.envMap.mapping) {
case THREE.CubeRefractionMapping:
case THREE.EquirectangularRefractionMapping:
y = "ENVMAP_MODE_REFRACTION"
}
switch (o.combine) {
case THREE.MultiplyOperation:
b = "ENVMAP_BLENDING_MULTIPLY";
break;
case THREE.MixOperation:
b = "ENVMAP_BLENDING_MIX";
break;
case THREE.AddOperation:
b = "ENVMAP_BLENDING_ADD"
}
}
var w = i.gammaFactor > 0 ? i.gammaFactor : 1,
E = t(l),
S = f.createProgram(),
x, T;
o instanceof THREE.RawShaderMaterial ? (x = "", T = "") : (x = ["precision " + u.precision + " float;", "precision " + u.precision + " int;", E, u.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", a.gammaInput ? "#define GAMMA_INPUT" : "", a.gammaOutput ? "#define GAMMA_OUTPUT" : "", "#define GAMMA_FACTOR " + w, "#define MAX_DIR_LIGHTS " + u.maxDirLights, "#define MAX_POINT_LIGHTS " + u.maxPointLights, "#define MAX_SPOT_LIGHTS " + u.maxSpotLights, "#define MAX_HEMI_LIGHTS " + u.maxHemiLights, "#define MAX_SHADOWS " + u.maxShadows, "#define MAX_BONES " + u.maxBones, u.map ? "#define USE_MAP" : "", u.envMap ? "#define USE_ENVMAP" : "", u.envMap ? "#define " + y : "", u.lightMap ? "#define USE_LIGHTMAP" : "", u.bumpMap ? "#define USE_BUMPMAP" : "", u.normalMap ? "#define USE_NORMALMAP" : "", u.specularMap ? "#define USE_SPECULARMAP" : "", u.alphaMap ? "#define USE_ALPHAMAP" : "", u.vertexColors ? "#define USE_COLOR" : "", u.flatShading ? "#define FLAT_SHADED" : "", u.skinning ? "#define USE_SKINNING" : "", u.useVertexTexture ? "#define BONE_TEXTURE" : "", u.morphTargets ? "#define USE_MORPHTARGETS" : "", u.morphNormals ? "#define USE_MORPHNORMALS" : "", u.wrapAround ? "#define WRAP_AROUND" : "", u.doubleSided ? "#define DOUBLE_SIDED" : "", u.flipSided ? "#define FLIP_SIDED" : "", u.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", u.shadowMapEnabled ? "#define " + m : "", u.shadowMapDebug ? "#define SHADOWMAP_DEBUG" : "", u.shadowMapCascade ? "#define SHADOWMAP_CASCADE" : "", u.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", u.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", "uniform mat4 modelMatrix;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform mat4 viewMatrix;", "uniform mat3 normalMatrix;", "uniform vec3 cameraPosition;", "attribute vec3 position;", "attribute vec3 normal;", "attribute vec2 uv;", "attribute vec2 uv2;", "#ifdef USE_COLOR", " attribute vec3 color;", "#endif", "#ifdef USE_MORPHTARGETS", " attribute vec3 morphTarget0;", " attribute vec3 morphTarget1;", " attribute vec3 morphTarget2;", " attribute vec3 morphTarget3;", " #ifdef USE_MORPHNORMALS", " attribute vec3 morphNormal0;", " attribute vec3 morphNormal1;", " attribute vec3 morphNormal2;", " attribute vec3 morphNormal3;", " #else", " attribute vec3 morphTarget4;", " attribute vec3 morphTarget5;", " attribute vec3 morphTarget6;", " attribute vec3 morphTarget7;", " #endif", "#endif", "#ifdef USE_SKINNING", " attribute vec4 skinIndex;", " attribute vec4 skinWeight;", "#endif", ""].join("\n"), T = ["precision " + u.precision + " float;", "precision " + u.precision + " int;", u.bumpMap || u.normalMap || u.flatShading ? "#extension GL_OES_standard_derivatives : enable" : "", E, "#define MAX_DIR_LIGHTS " + u.maxDirLights, "#define MAX_POINT_LIGHTS " + u.maxPointLights, "#define MAX_SPOT_LIGHTS " + u.maxSpotLights, "#define MAX_HEMI_LIGHTS " + u.maxHemiLights, "#define MAX_SHADOWS " + u.maxShadows, u.alphaTest ? "#define ALPHATEST " + u.alphaTest : "", a.gammaInput ? "#define GAMMA_INPUT" : "", a.gammaOutput ? "#define GAMMA_OUTPUT" : "", "#define GAMMA_FACTOR " + w, u.useFog && u.fog ? "#define USE_FOG" : "", u.useFog && u.fogExp ? "#define FOG_EXP2" : "", u.map ? "#define USE_MAP" : "", u.envMap ? "#define USE_ENVMAP" : "", u.envMap ? "#define " + g : "", u.envMap ? "#define " + y : "", u.envMap ? "#define " + b : "", u.lightMap ? "#define USE_LIGHTMAP" : "", u.bumpMap ? "#define USE_BUMPMAP" : "", u.normalMap ? "#define USE_NORMALMAP" : "", u.specularMap ? "#define USE_SPECULARMAP" : "", u.alphaMap ? "#define USE_ALPHAMAP" : "", u.vertexColors ? "#define USE_COLOR" : "", u.flatShading ? "#define FLAT_SHADED" : "", u.metal ? "#define METAL" : "", u.wrapAround ? "#define WRAP_AROUND" : "", u.doubleSided ? "#define DOUBLE_SIDED" : "", u.flipSided ? "#define FLIP_SIDED" : "", u.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", u.shadowMapEnabled ? "#define " + m : "", u.shadowMapDebug ? "#define SHADOWMAP_DEBUG" : "", u.shadowMapCascade ? "#define SHADOWMAP_CASCADE" : "", u.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", ""].join("\n"));
var N = new THREE.WebGLShader(f, f.VERTEX_SHADER, x + p),
C = new THREE.WebGLShader(f, f.FRAGMENT_SHADER, T + d);
f.attachShader(S, N), f.attachShader(S, C), v !== undefined && f.bindAttribLocation(S, 0, v), f.linkProgram(S);
var k = f.getProgramInfoLog(S);
f.getProgramParameter(S, f.LINK_STATUS) === !1 && THREE.error("THREE.WebGLProgram: shader error: " + f.getError(), "gl.VALIDATE_STATUS", f.getProgramParameter(S, f.VALIDATE_STATUS), "gl.getPRogramInfoLog", k), k !== "" && THREE.warn("THREE.WebGLProgram: gl.getProgramInfoLog()" + k), f.deleteShader(N), f.deleteShader(C);
var L = ["viewMatrix", "modelViewMatrix", "projectionMatrix", "normalMatrix", "modelMatrix", "cameraPosition", "morphTargetInfluences", "bindMatrix", "bindMatrixInverse"];
u.useVertexTexture ? (L.push("boneTexture"), L.push("boneTextureWidth"), L.push("boneTextureHeight")) : L.push("boneGlobalMatrices"), u.logarithmicDepthBuffer && L.push("logDepthBufFC");
for (var A in c) L.push(A);
this.uniforms = n(f, S, L), L = ["position", "normal", "uv", "uv2", "tangent", "color", "skinIndex", "skinWeight", "lineDistance"];
for (var O = 0; O < u.maxMorphTargets; O++) L.push("morphTarget" + O);
for (var O = 0; O < u.maxMorphNormals; O++) L.push("morphNormal" + O);
for (var M in h) L.push(M);
return this.attributes = r(f, S, L), this.attributesKeys = Object.keys(this.attributes), this.id = e++, this.code = s, this.usedTimes = 1, this.program = S, this.vertexShader = N, this.fragmentShader = C, this
}
}(), THREE.WebGLShader = function() {
var e = function(e) {
var t = e.split("\n");
for (var n = 0; n < t.length; n++) t[n] = n + 1 + ": " + t[n];
return t.join("\n")
};
return function(t, n, r) {
var i = t.createShader(n);
return t.shaderSource(i, r), t.compileShader(i), t.getShaderParameter(i, t.COMPILE_STATUS) === !1 && THREE.error("THREE.WebGLShader: Shader couldn't compile."), t.getShaderInfoLog(i) !== "" && THREE.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t.getShaderInfoLog(i), e(r)), i
}
}(), THREE.WebGLState = function(e, t) {
var n = new Uint8Array(16),
r = new Uint8Array(16),
i = null,
s = null,
o = null,
u = null,
a = null,
f = null,
l = null,
c = null,
h = null,
p = null,
d = null,
v = null,
m = null,
g = null,
y = null,
b = null;
this.initAttributes = function() {
for (var e = 0, t = n.length; e < t; e++) n[e] = 0
}, this.enableAttribute = function(t) {
n[t] = 1, r[t] === 0 && (e.enableVertexAttribArray(t), r[t] = 1)
}, this.disableUnusedAttributes = function() {
for (var t = 0, i = r.length; t < i; t++) r[t] !== n[t] && (e.disableVertexAttribArray(t), r[t] = 0)
}, this.setBlending = function(n, r, c, h, p, d, v) {
n !== i && (n === THREE.NoBlending ? e.disable(e.BLEND) : n === THREE.AdditiveBlending ? (e.enable(e.BLEND), e.blendEquation(e.FUNC_ADD), e.blendFunc(e.SRC_ALPHA, e.ONE)) : n === THREE.SubtractiveBlending ? (e.enable(e.BLEND), e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : n === THREE.MultiplyBlending ? (e.enable(e.BLEND), e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.SRC_COLOR)) : n === THREE.CustomBlending ? e.enable(e.BLEND) : (e.enable(e.BLEND), e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)), i = n);
if (n === THREE.CustomBlending) {
p = p || r, d = d || c, v = v || h;
if (r !== s || p !== a) e.blendEquationSeparate(t(r), t(p)), s = r, a = p;
if (c !== o || h !== u || d !== f || v !== l) e.blendFuncSeparate(t(c), t(h), t(d), t(v)), o = c, u = h, f = d, l = v
} else s = null, o = null, u = null, a = null, f = null, l = null
}, this.setDepthTest = function(t) {
c !== t && (t ? e.enable(e.DEPTH_TEST) : e.disable(e.DEPTH_TEST), c = t)
}, this.setDepthWrite = function(t) {
h !== t && (e.depthMask(t), h = t)
}, this.setColorWrite = function(t) {
p !== t && (e.colorMask(t, t, t, t), p = t)
}, this.setDoubleSided = function(t) {
d !== t && (t ? e.disable(e.CULL_FACE) : e.enable(e.CULL_FACE), d = t)
}, this.setFlipSided = function(t) {
v !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), v = t)
}, this.setLineWidth = function(t) {
t !== m && (e.lineWidth(t), m = t)
}, this.setPolygonOffset = function(t, n, r) {
g !== t && (t ? e.enable(e.POLYGON_OFFSET_FILL) : e.disable(e.POLYGON_OFFSET_FILL), g = t), t && (y !== n || b !== r) && (e.polygonOffset(n, r), y = n, b = r)
}, this.reset = function() {
for (var e = 0; e < r.length; e++) r[e] = 0;
i = null, c = null, h = null, p = null, d = null, v = null
}
}, THREE.ImageUtils = {
crossOrigin: undefined,
loadTexture: function(e, t, n, r) {
var i = new THREE.ImageLoader;
i.crossOrigin = this.crossOrigin;
var s = new THREE.Texture(undefined, t);
return i.load(e, function(e) {
s.image = e, s.needsUpdate = !0, n && n(s)
}, undefined, function(e) {
r && r(e)
}), s.sourceFile = e, s
},
loadTextureCube: function(e, t, n, r) {
var i = [],
s = new THREE.ImageLoader;
s.crossOrigin = this.crossOrigin;
var o = new THREE.CubeTexture(i, t);
o.flipY = !1;
var u = 0,
a = function(t) {
s.load(e[t], function(e) {
o.images[t] = e, u += 1, u === 6 && (o.needsUpdate = !0, n && n(o))
}, undefined, r)
};
for (var f = 0, l = e.length; f < l; ++f) a(f);
return o
},
loadCompressedTexture: function() {
THREE.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
},
loadCompressedTextureCube: function() {
THREE.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
},
getNormalMap: function(e, t) {
var n = function(e, t) {
return [e[1] * t[2] - e[2] * t[1], e[2] * t[0] - e[0] * t[2], e[0] * t[1] - e[1] * t[0]]
},
r = function(e, t) {
return [e[0] - t[0], e[1] - t[1], e[2] - t[2]]
},
i = function(e) {
var t = Math.sqrt(e[0] * e[0] + e[1] * e[1] + e[2] * e[2]);
return [e[0] / t, e[1] / t, e[2] / t]
};
t |= 1;
var s = e.width,
o = e.height,
u = document.createElement("canvas");
u.width = s, u.height = o;
var a = u.getContext("2d");
a.drawImage(e, 0, 0);
var f = a.getImageData(0, 0, s, o).data,
l = a.createImageData(s, o),
c = l.data;
for (var h = 0; h < s; h++)
for (var p = 0; p < o; p++) {
var d = p - 1 < 0 ? 0 : p - 1,
v = p + 1 > o - 1 ? o - 1 : p + 1,
m = h - 1 < 0 ? 0 : h - 1,
g = h + 1 > s - 1 ? s - 1 : h + 1,
y = [],
b = [0, 0, f[(p * s + h) * 4] / 255 * t];
y.push([-1, 0, f[(p * s + m) * 4] / 255 * t]), y.push([-1, -1, f[(d * s + m) * 4] / 255 * t]), y.push([0, -1, f[(d * s + h) * 4] / 255 * t]), y.push([1, -1, f[(d * s + g) * 4] / 255 * t]), y.push([1, 0, f[(p * s + g) * 4] / 255 * t]), y.push([1, 1, f[(v * s + g) * 4] / 255 * t]), y.push([0, 1, f[(v * s + h) * 4] / 255 * t]), y.push([-1, 1, f[(v * s + m) * 4] / 255 * t]);
var w = [],
E = y.length;
for (var S = 0; S < E; S++) {
var x = y[S],
T = y[(S + 1) % E];
x = r(x, b), T = r(T, b), w.push(i(n(x, T)))
}
var N = [0, 0, 0];
for (var S = 0; S < w.length; S++) N[0] += w[S][0], N[1] += w[S][1], N[2] += w[S][2];
N[0] /= w.length, N[1] /= w.length, N[2] /= w.length;
var C = (p * s + h) * 4;
c[C] = (N[0] + 1) / 2 * 255 | 0, c[C + 1] = (N[1] + 1) / 2 * 255 | 0, c[C + 2] = N[2] * 255 | 0, c[C + 3] = 255
}
return a.putImageData(l, 0, 0), u
},
generateDataTexture: function(e, t, n) {
var r = e * t,
i = new Uint8Array(3 * r),
s = Math.floor(n.r * 255),
o = Math.floor(n.g * 255),
u = Math.floor(n.b * 255);
for (var a = 0; a < r; a++) i[a * 3] = s, i[a * 3 + 1] = o, i[a * 3 + 2] = u;
var f = new THREE.DataTexture(i, e, t, THREE.RGBFormat);
return f.needsUpdate = !0, f
}
}, THREE.BoxGeometry = function(e, t, n, r, i, s) {
function l(e, t, n, r, i, s, u, a) {
var f, l, c, h = o.widthSegments,
p = o.heightSegments,
d = i / 2,
v = s / 2,
m = o.vertices.length;
if (e === "x" && t === "y" || e === "y" && t === "x") f = "z";
else if (e === "x" && t === "z" || e === "z" && t === "x") f = "y", p = o.depthSegments;
else if (e === "z" && t === "y" || e === "y" && t === "z") f = "x", h = o.depthSegments;
var g = h + 1,
y = p + 1,
b = i / h,
w = s / p,
E = new THREE.Vector3;
E[f] = u > 0 ? 1 : -1;
for (c = 0; c < y; c++)
for (l = 0; l < g; l++) {
var S = new THREE.Vector3;
S[e] = (l * b - d) * n, S[t] = (c * w - v) * r, S[f] = u, o.vertices.push(S)
}
for (c = 0; c < p; c++)
for (l = 0; l < h; l++) {
var x = l + g * c,
T = l + g * (c + 1),
N = l + 1 + g * (c + 1),
C = l + 1 + g * c,
k = new THREE.Vector2(l / h, 1 - c / p),
L = new THREE.Vector2(l / h, 1 - (c + 1) / p),
A = new THREE.Vector2((l + 1) / h, 1 - (c + 1) / p),
O = new THREE.Vector2((l + 1) / h, 1 - c / p),
M = new THREE.Face3(x + m, T + m, C + m);
M.normal.copy(E), M.vertexNormals.push(E.clone(), E.clone(), E.clone()), M.materialIndex = a, o.faces.push(M), o.faceVertexUvs[0].push([k, L, O]), M = new THREE.Face3(T + m, N + m, C + m), M.normal.copy(E), M.vertexNormals.push(E.clone(), E.clone(), E.clone()), M.materialIndex = a, o.faces.push(M), o.faceVertexUvs[0].push([L.clone(), A, O.clone()])
}
}
THREE.Geometry.call(this), this.type = "BoxGeometry", this.parameters = {
width: e,
height: t,
depth: n,
widthSegments: r,
heightSegments: i,
depthSegments: s
}, this.widthSegments = r || 1, this.heightSegments = i || 1, this.depthSegments = s || 1;
var o = this,
u = e / 2,
a = t / 2,
f = n / 2;
l("z", "y", -1, -1, n, t, u, 0), l("z", "y", 1, -1, n, t, -u, 1), l("x", "z", 1, 1, e, n, a, 2), l("x", "z", 1, -1, e, n, -a, 3), l("x", "y", 1, -1, e, t, f, 4), l("x", "y", -1, -1, e, t, -f, 5), this.mergeVertices()
}, THREE.BoxGeometry.prototype = Object.create(THREE.Geometry.prototype), THREE.BoxGeometry.prototype.constructor = THREE.BoxGeometry, THREE.PlaneGeometry = function(e, t, n, r) {
console.info("THREE.PlaneGeometry: Consider using THREE.PlaneBufferGeometry for lower memory footprint."), THREE.Geometry.call(this), this.type = "PlaneGeometry", this.parameters = {
width: e,
height: t,
widthSegments: n,
heightSegments: r
}, this.fromBufferGeometry(new THREE.PlaneBufferGeometry(e, t, n, r))
}, THREE.PlaneGeometry.prototype = Object.create(THREE.Geometry.prototype), THREE.PlaneGeometry.prototype.constructor = THREE.PlaneGeometry, THREE.PlaneBufferGeometry = function(e, t, n, r) {
THREE.BufferGeometry.call(this), this.type = "PlaneBufferGeometry", this.parameters = {
width: e,
height: t,
widthSegments: n,
heightSegments: r
};
var i = e / 2,
s = t / 2,
o = n || 1,
u = r || 1,
a = o + 1,
f = u + 1,
l = e / o,
c = t / u,
h = new Float32Array(a * f * 3),
p = new Float32Array(a * f * 3),
d = new Float32Array(a * f * 2),
v = 0,
m = 0;
for (var g = 0; g < f; g++) {
var y = g * c - s;
for (var b = 0; b < a; b++) {
var w = b * l - i;
h[v] = w, h[v + 1] = -y, p[v + 2] = 1, d[m] = b / o, d[m + 1] = 1 - g / u, v += 3, m += 2
}
}
v = 0;
var E = new(h.length / 3 > 65535 ? Uint32Array : Uint16Array)(o * u * 6);
for (var g = 0; g < u; g++)
for (var b = 0; b < o; b++) {
var S = b + a * g,
x = b + a * (g + 1),
T = b + 1 + a * (g + 1),
N = b + 1 + a * g;
E[v] = S, E[v + 1] = x, E[v + 2] = N, E[v + 3] = x, E[v + 4] = T, E[v + 5] = N, v += 6
}
this.addAttribute("index", new THREE.BufferAttribute(E, 1)), this.addAttribute("position", new THREE.BufferAttribute(h, 3)), this.addAttribute("normal", new THREE.BufferAttribute(p, 3)), this.addAttribute("uv", new THREE.BufferAttribute(d, 2))
}, THREE.PlaneBufferGeometry.prototype = Object.create(THREE.BufferGeometry.prototype), THREE.PlaneBufferGeometry.prototype.constructor = THREE.PlaneBufferGeometry, define("three", function(e) {
return function() {
var t, n;
return t || e.THREE
}
}(this)), define("FLOCK/utils/Polyfills", [], function() {
Function.prototype.bind || (Function.prototype.bind = function(t) {
var n = this;
if (typeof n != "function") throw new TypeError;
var r = slice.call(arguments, 1),
i = function() {
if (this instanceof i) {
var e = function() {};
e.prototype = n.prototype;
var s = new e,
o = n.apply(s, r.concat(slice.call(arguments)));
return Object(o) === o ? o : s
}
return n.apply(t, r.concat(slice.call(arguments)))
};
return i
}),
function() {
Array.prototype.indexOf || (Array.prototype.indexOf = function(e, t) {
if (this === undefined || this === null) throw new TypeError('"this" is null or not defined');
var n = this.length >>> 0;
t = +t || 0, Math.abs(t) === Infinity && (t = 0), t < 0 && (t += n, t < 0 && (t = 0));
for (; t < n; t++)
if (this[t] === e) return t;
return -1
})
}(),
function() {
if (!document.getElementsByClassName) {
var e = [].indexOf || function(e) {
for (var t = 0; t < this.length; t++)
if (this[t] === e) return t;
return -1
};
getElementsByClassName = function(t, n) {
var r = document.querySelectorAll ? n.querySelectorAll("." + t) : function() {
var r = n.getElementsByTagName("*"),
i = [],
s = 0;
for (; s < r.length; s++) r[s].className && (" " + r[s].className + " ").indexOf(" " + t + " ") > -1 && e.call(i, r[s]) === -1 && i.push(r[s]);
return i
}();
return r
}, document.getElementsByClassName = function(e) {
return getElementsByClassName(e, document)
}, Element.prototype.getElementsByClassName = function(e) {
return getElementsByClassName(e, this)
}
}
}(),
function() {
typeof document != "undefined" && !("classList" in document.documentElement) && function(e) {
if (!("HTMLElement" in e || "Element" in e)) return;
var t = "classList",
n = "prototype",
r = (e.HTMLElement || e.Element)[n],
i = Object,
s = String[n].trim || function() {
return this.replace(/^\s+|\s+$/g, "")
},
o = Array[n].indexOf || function(e) {
var t = 0,
n = this.length;
for (; t < n; t++)
if (t in this && this[t] === e) return t;
return -1
},
u = function(e, t) {
this.name = e, this.code = DOMException[e], this.message = t
},
a = function(e, t) {
if (t === "") throw new u("SYNTAX_ERR", "An invalid or illegal string was specified");
if (/\s/.test(t)) throw new u("INVALID_CHARACTER_ERR", "String contains an invalid character");
return o.call(e, t)
},
f = function(e) {
var t = s.call(e.className),
n = t ? t.split(/\s+/) : [],
r = 0,
i = n.length;
for (; r < i; r++) this.push(n[r]);
this._updateClassName = function() {
e.className = this.toString()
}
},
l = f[n] = [],
c = function() {
return new f(this)
};
u[n] = Error[n], l.item = function(e) {
return this[e] || null
}, l.contains = function(e) {
return e += "", a(this, e) !== -1
}, l.add = function() {
var e = arguments,
t = 0,
n = e.length,
r, i = !1;
do r = e[t] + "", a(this, r) === -1 && (this.push(r), i = !0); while (++t < n);
i && this._updateClassName()
}, l.remove = function() {
var e = arguments,
t = 0,
n = e.length,
r, i = !1;
do {
r = e[t] + "";
var s = a(this, r);
s !== -1 && (this.splice(s, 1), i = !0)
} while (++t < n);
i && this._updateClassName()
}, l.toggle = function(e, t) {
e += "";
var n = this.contains(e),
r = n ? t !== !0 && "remove" : t !== !1 && "add";
return r && this[r](e), !n
}, l.toString = function() {
return this.join(" ")
};
if (i.defineProperty) {
var h = {
get: c,
enumerable: !0,
configurable: !0
};
try {
i.defineProperty(r, t, h)
} catch (p) {
p.number === -2146823252 && (h.enumerable = !1, i.defineProperty(r, t, h))
}
} else i[n].__defineGetter__ && r.__defineGetter__(t, c)
}(self)
}(),
function(e, t) {
function o(t, i, o, u) {
t[r](n + i, s == "wheel" ? o : function(t) {
!t && (t = e.event);
var n = {
originalEvent: t,
target: t.target || t.srcElement,
type: "wheel",
deltaMode: t.type == "MozMousePixelScroll" ? 0 : 1,
deltaX: 0,
delatZ: 0,
preventDefault: function() {
t.preventDefault ? t.preventDefault() : t.returnValue = !1
}
};
return s == "mousewheel" ? (n.deltaY = -1 / 40 * t.wheelDelta, t.wheelDeltaX && (n.deltaX = -1 / 40 * t.wheelDeltaX)) : n.deltaY = t.detail, o(n)
}, u || !1)
}
var n = "",
r, i, s;
e.addEventListener ? r = "addEventListener" : (r = "attachEvent", n = "on"), s = "onwheel" in t.createElement("div") ? "wheel" : t.onmousewheel !== undefined ? "mousewheel" : "DOMMouseScroll", e.addWheelListener = function(e, t, n) {
o(e, s, t, n), s == "DOMMouseScroll" && o(e, "MozMousePixelScroll", t, n)
}
}(window, document),
function() {
var e, t = function() {},
n = ["assert", "clear", "count", "debug", "dir", "dirxml", "error", "exception", "group", "groupCollapsed", "groupEnd", "info", "log", "markTimeline", "profile", "profileEnd", "table", "time", "timeEnd", "timeStamp", "trace", "warn"],
r = n.length,
i = window.console = window.console || {};
while (r--) {
e = n[r];
if (!i[e] || env === "prod") i[e] = t
}
}(),
function() {
var e = 0,
t = ["webkit", "moz"];
for (var n = 0; n < t.length && !window.requestAnimationFrame; ++n) window.requestAnimationFrame = window[t[n] + "RequestAnimationFrame"], window.cancelAnimationFrame = window[t[n] + "CancelAnimationFrame"] || window[t[n] + "CancelRequestAnimationFrame"];
window.requestAnimationFrame || (window.requestAnimationFrame = function(t, n) {
var r = (new Date).getTime(),
i = Math.max(0, 16 - (r - e)),
s = window.setTimeout(function() {
t(r + i)
}, i);
return e = r + i, s
}), window.cancelAnimationFrame || (window.cancelAnimationFrame = function(e) {
clearTimeout(e)
})
}()
}),
function(e, t) {
e.utils = e.utils || {}, typeof define == "function" && define.amd ? define("FLOCK/utils/DeviceDetect", [], function() {
return e.utils.DeviceDetect = t()
}) : e.utils.DeviceDetect = t()
}(window.FLOCK = window.FLOCK || {}, function() {
var e = {},
t = {
isMobile: function() {
var e = navigator.platform.toLowerCase(),
t = /(iphone|ipod|android|palm|windows\sphone|blackberry)/g;
return e.match(t) === null ? !1 : !0
},
searchString: function(e) {
for (var t = 0; t < e.length; t++) {
var n = e[t].string;
this.versionSearchString = e[t].subString;
if (n.indexOf(e[t].subString) != -1) return e[t].identity
}
},
searchVersion: function(e) {
var t = e.indexOf(this.versionSearchString);
if (t == -1) return;
return parseFloat(e.substring(t + this.versionSearchString.length + 1))
},
dataBrowser: [{
string: navigator.userAgent,
subString: "Android",
identity: "Android"
}, {
string: navigator.userAgent,
subString: "Chrome",
identity: "Chrome"
}, {
string: navigator.userAgent,
subString: "MSIE",
identity: "Explorer"
}, {
string: navigator.userAgent,
subString: "Trident",
identity: "Explorer"
}, {
string: navigator.userAgent,
subString: "Firefox",
identity: "Firefox"
}, {
string: navigator.userAgent,
subString: "Opera",
identity: "Opera"
}, {
string: navigator.userAgent,
subString: "iPod",
identity: "iPod"
}, {
string: navigator.userAgent,
subString: "iPad",
identity: "iPad"
}, {
string: navigator.userAgent,
subString: "iPhone",
identity: "iPhone"
}, {
string: navigator.userAgent,
subString: "Safari",
identity: "Safari"
}]
};
return e.browser = t.searchString(t.dataBrowser) || "Other", e.version = t.searchVersion(navigator.userAgent) || t.searchVersion(navigator.appVersion) || "Unknown", e.isIphone = e.browser === "iPhone", e.isIpod = e.browser === "iPod", e.isIpad = e.browser === "iPad", e.isIOS = e.browser === "iPhone" || e.browser === "iPad" || e.browser === "iPod", e.isAndroid = e.browser === "Android", e.isMobile = t.isMobile(), e.isMac = navigator.appVersion.indexOf("Mac") != -1 ? !0 : !1, e.isIE = e.browser === "Explorer" ? !0 : !1, e.isIETouch = e.browser === "Explorer" && navigator.userAgent.indexOf("Touch") >= 0 ? !0 : !1, e.isEarlyIE = navigator.userAgent.indexOf("MSIE 8.0") >= 0 ? !0 : !1, e
}),
function(e, t) {
e.utils = e.utils || {}, typeof define == "function" && define.amd ? define("FLOCK/utils/ArrayExecuter", [], function() {
return e.utils.ArrayExecuter = t()
}) : e.utils.ArrayExecuter = t()
}(window.FLOCK = window.FLOCK || {}, function() {
function t(e) {
for (var t in e) e.hasOwnProperty(t) && (e[t] = null);
e = null
}
var e = function(e, t) {
this.task_arr = [], this.defaultScope = e || this, this.id = t || "", this.verbose = !1
};
return e.prototype = {
execute: function(e) {
this.verbose && console.log("ArrayExecuter | " + this.id + " | execute"), this.addNext(e), this.runStep("")
},
addNext: function(e) {
this.verbose && console.log("ArrayExecuter | " + this.id + " | addNext");
if (typeof e == "function") this.task_arr.unshift({
fn: e,
vars: null
});
else {
e.reverse();
for (var t = 0; t < e.length; t++) e[t] && this.task_arr.unshift(e[t])
}
},
tackOn: function(e) {
this.verbose && console.log("ArrayExecuter | " + this.id + " | tackOn");
for (var t = 0; t < e.length; t++) this.task_arr.push(e[t]);
this.runStep("")
},
runFunctionInScope: function(e) {
var t = e[0],
n = e[1],
r = e.length > 2 ? e[2] : null;
e.length > 2 ? t[n](e[2]) : t[n]()
},
runStep: function(e) {
this.verbose && console.log("ArrayExecuter | " + this.id + " | runStep");
if (this.task_arr.length == 0) return;
var n = this.task_arr.shift(),
r = n.fn;
n.scope = n.scope || this.defaultScope, n.vars = n.vars || [], typeof n.vars == "string" && (n.vars = [n.vars]), r.apply(n.scope, n.vars), t(n)
},
stepComplete: function(e) {
this.verbose && console.log("ArrayExecuter | " + this.id + " | stepComplete"), this.task_arr.length > 0 && window.requestAnimationFrame(this.runStep.bind(this))
},
stepComplete_instant: function(e) {
this.verbose && console.log("ArrayExecuter | " + this.id + " | stepComplete_instant"), this.task_arr.length > 0 && this.runStep()
},
clearArrayExecuter: function() {
this.verbose && console.log("ArrayExecuter | " + this.id + " | clearArrayExecuter"), this.task_arr = []
},
destroy: function() {
for (var e = 0; e < this.task_arr.length; e++) t(this.task_arr[e]);
this.task_arr = [], this.defaultScope = null
}
}, e
}),
function(e, t) {
e.utils = e.utils || {}, typeof define == "function" && define.amd ? define("FLOCK/utils/SectionLoader", ["jquery", "FLOCK/utils/DeviceDetect", "FLOCK/utils/ArrayExecuter"], function(n) {
return e.utils.SectionLoader = t(n)
}) : e.utils.SectionLoader = t($)
}(window.FLOCK = window.FLOCK || {}, function(e) {
function i(t, n) {
e.ajax({
dataType: "text",
url: t,
success: function(t) {
t = t.replace(/(\r\n|\n|\r)/gm, ""), t = t.replace(/\t/g, ""), FLOCK.app.dataSrc = this.localizationJSON = e.parseJSON(String(t)), this.setupSections.call(this), n && n()
}.bind(this)
})
}
function s() {
var e, t;
for (e in FLOCK.app.dataSrc.sections)
if (FLOCK.app.dataSrc.sections.hasOwnProperty(e)) {
t = FLOCK.app.dataSrc.sections[e];
if (t.visible === "false") continue;
t.data.base = FLOCK.settings.base_url || "", this.addSection(e, t)
}
}
function a(e) {
this.verbose && console.log("SectionLoader | addLoaderUI: " + e), o.loader = e
}
function f(e, t) {
var n = P(e);
n.files = n.files || {};
if (typeof t == "String") n.addFiles.push(t);
else
for (var r = t.length - 1; r >= 0; r--) n.addFiles.push(t[r])
}
function l(e, t) {
this.verbose && console.log("SectionLoader | addSection: " + e);
var n = o.sections.length,
r = t.files || {},
i = r.templatePath || !1,
s = r.partials || {},
u = r.images || !1,
a = r.htmlPath || !1,
f = r.cssPath || !1,
l = r.jsPath || !1,
h = r.addFiles || [];
if (c(e)) {
this.verbose && console.log("SectionLoader | addSection: section id " + e + " already exists");
return
}
o.sections.push({
id: e,
images: u,
data: t.data,
templatePath: i,
partials: s,
htmlPath: a,
htmlData: null,
cssPath: f,
cssData: null,
jsPath: l,
jsAttached: !0,
jsData: null,
addFiles: h,
loaded: !1
}), e === "work"
}
function c(e) {
var t = o.sections.length;
while (t--)
if (o.sections[t].id === e) return !0;
return !1
}
function h() {
this.verbose && (console.log("////////////////////////////////////////////"), console.log("////////////////////////////////////////////"), console.log("////////////////////////////////////////////"));
var e = [],
n = Array.prototype.slice.call(arguments),
r;
if (n.length === 1 && n[0] === "all") {
n = [];
for (var i = o.sections.length - 1; i >= 0; i--) n.push(o.sections[i].id)
}
if (n !== undefined && n !== null)
for (var i = n.length - 1; i >= 0; i--) typeof n[i] == "function" ? r = n[i] : c(n[i]) ? (this.verbose && console.log("SectionLoader | loadSection: " + n[i]), e.push({
scope: this,
fn: this.initScrape,
vars: n[i]
})) : console.log("SECTION LOADER ERROR! section: " + n[i] + " does not exist");
else this.verbose && console.log("SectionLoader | this.loadSection: input not valid");
e.push({
scope: this,
fn: this.loadFiles,
vars: null
}), r && e.push({
fn: r,
vars: null
}), t.execute(e)
}
function p() {
var e = Array.prototype.slice.call(arguments),
n = e.pop(),
r, i, s = this.returnSectionOBJ(n);
if (s === undefined) {
this.verbose && console.log("SectionLoader | this.loadSection: section id " + n + " not found"), t.stepComplete_instant();
return
}
if (s.loaded === !0) {
this.verbose && console.log("SectionLoader | this.loadSection: " + n + " is already loaded"), t.stepComplete_instant();
return
}
o.currentlyLoadingIDs.push(s.id);
for (var u in s.partials) s.partials.hasOwnProperty(u) && o.templatesToLoad.push({
template_name: u,
template_path: s.partials[u]
});
r = s.addFiles.length;
while (r--) {
var a = s.addFiles[r];
a.indexOf(".gif") > 0 || a.indexOf(".jpg") > 0 || a.indexOf(".jpeg") > 0 || a.indexOf(".png") > 0 ? T.call(this, a) : C.call(this, a)
}
i = s.images.length;
while (i--) {
var a = s.images[i];
a.indexOf(".gif") > 0 || a.indexOf(".jpg") > 0 || a.indexOf(".jpeg") > 0 || a.indexOf(".png") > 0 ? T.call(this, a) : this.verbose && console.log("SectionLoader | not a supported fileType: " + a)
}
var f = [];
s.htmlPath && f.push({
scope: this,
fn: this.loadHTML,
vars: [s]
}), s.templatePath && f.push({
scope: this,
fn: this.loadTemplate,
vars: [s, s.templatePath]
});
for (var l = o.templatesToLoad.length - 1; l >= 0; l--) f.push({
scope: this,
fn: this.loadTemplate,
vars: [s, o.templatesToLoad[l]]
});
s.cssPath && f.push({
scope: this,
fn: this.loadCSS,
vars: [s]
}), t.execute(f)
}
function d(t) {
var n = this;
this.verbose && console.log("SectionLoader | loadHTML: " + t.htmlPath), e.get(t.htmlPath, function(e) {
n.htmlLoaded(t, e)
})
}
function v(n, r) {
this.verbose && console.log("SectionLoader | htmlLoaded: "), n.htmlData = r;
var i = n.id;
if (H.localizationJSON && H.localizationJSON.sections) {
var s, o, u, a, f, l, c;
if (H.localizationJSON.sections.shared && H.localizationJSON.sections.shared.html) {
s = H.localizationJSON.sections.shared.html, o = s.length;
while (o--) c = s[o], n.htmlData = m(n.htmlData, c)
}
if (H.localizationJSON.sections[i] && H.localizationJSON.sections[i].html) {
s = H.localizationJSON.sections[i].html, o = s.length;
while (o--) c = s[o], n.htmlData = m(n.htmlData, c)
}
var h = document.createElement("div");
h.innerHTML = n.htmlData;
var p = h.getElementsByClassName("styleholder");
for (var d = p.length - 1; d >= 0; d--) p[d].parentNode.setAttribute("style", p[d].getAttribute("data-style")), p[d].parentNode.removeChild(p[d]);
n.htmlData = h.innerHTML
}
var v = /<img [^>]*src="([^"]+)"[^>]*>/g,
g;
e(n.htmlData).data("backplate") && T.call(this, e(n.htmlData).data("backplate"));
while ((g = v.exec(n.htmlData)) !== null) T.call(this, g[1]);
t.stepComplete_instant()
}
function m(e, t) {
var n = String(e),
r, i, s, o;
while (n.indexOf(String(t.ID)) > 0) {
r = "", i = t.css ? t.css.length : 0;
while (i--) o = t.css[i], o.VAL && (r += o.ID + ":" + o.VAL + ";");
s = r == "" ? String(t.VAL) : '<span class="styleholder" data-style="' + r + '"></span>' + String(t.VAL), t.visible && String(t["visible"]).toLowerCase() == "false" && (s = ""), n = n.replace(String(t.ID), s)
}
return n
}
function g(t) {
var n = this;
this.verbose && console.log("SectionLoader | loadCSS: " + t.cssPath), e.get(t.cssPath, function(e) {
n.cssLoaded(t, e)
}, "text")
}
function y(e, n) {
this.verbose && console.log("SectionLoader | this.cssLoaded: " + e.id), e.cssData = String(n);
var r = e.id;
if (H.localizationJSON && H.localizationJSON.sections && H.localizationJSON.sections[r] && H.localizationJSON.sections[r].css) {
var i = H.localizationJSON.sections[r].css,
s = i.length;
while (s--)
while (String(e.cssData).indexOf(String(i[s].ID)) > 0) e.cssData = e.cssData.replace(String(i[s].ID), String(i[s].VAL))
}
var o = e.cssData.match(/[^\(]+\.(gif|jpg|jpeg|png)/g);
if (o) {
var u = o.length;
while (u--) {
var a = o[u].replace("../", "");
this.verbose && console.log("SectionLoader | cssLoaded: adding: " + a), T.call(this, a)
}
}
t.stepComplete()
}
function b(e) {
var t = this;
this.verbose && console.log("SectionLoader | loadJS: " + e.jsPath), e.jsPath && t.jsLoaded(e, null)
}
function w(e, n) {
this.verbose && console.log("SectionLoader | loadJS: success"), e.jsAttached = !0, t.stepComplete()
}
function E(e) {
var t = o.imagesToLoad.length;
while (t--)
if (o.imagesToLoad[t].url === e) return !0;
var n = o.miscToLoad.length;
while (n--)
if (o.miscToLoad[n].url === e) return !0;
return !1
}
function S(n, i) {
var s = this,
o = typeof i == "string" ? i : i.template_path;
e.get(r + o, function(e) {
typeof i == "string" ? n.template = e : n.partials[i.template_name] = e, Mustache.compile(e), t.stepComplete_instant()
})
}
function x() {
var e = o.imagesToLoad.length,
t = o.miscToLoad.length,
n, r, i = this;
if (e + t < 1) {
this.complete();
return
}
o.loader && o.loader.bringIn();
while (e--) N.call(this, o.imagesToLoad[e]);
while (t--) k.call(this, o.miscToLoad[t])
}
function T(e) {
if (!this.isDuplicate(e)) {
var t = o.imagesToLoad.length;
o.imagesToLoad.push({
url: e,
index: t
})
}
}
function N(t) {
this.verbose && console.log("SectionLoader | load image: " + t.url);
var n = t.url;
t.done = !1, t.size = this.getFileSize(n), newImage = new Image, newImage.alt = String(t.index), e(newImage).load(function() {
this.verbose && console.log("SectionLoader | image Loaded: " + t.url), t.done = !0, o.imagesLoaded++, H.checkComplete()
}.bind(this)).error("error", this.fileError), newImage.src = r + n
}
function C(e) {
this.isDuplicate(e) || o.miscToLoad.push({
url: e
})
}
function k(t) {
this.verbose && console.log("SectionLoader | xhr load: " + t.url);
var n = t.url;
t.perc = 0, t.done = !1, t.size = this.getFileSize(n), e.ajax({
xhr: function() {
var e = new window.XMLHttpRequest;
return e.addEventListener("progress", function(e) {
e.lengthComputable ? t.perc = e.loaded / e.total : t.perc = 0
}.bind(this), !1), e
}.bind(this),
type: "GET",
url: n,
success: function() {
t.done = !0, o.miscLoaded++, H.checkComplete()
}.bind(this)
})
}
function L(e, t) {
this.filesizes.push({
url: e,
size: t
})
}
function A(e) {
for (var t = 0; t < this.filesizes.length; t++)
if (e == this.filesizes[t].url) return this.filesizes[t].size;
return this.defaultSize
}
function O() {
var e = 0,
t = 0;
for (var n = 0; n < o.miscToLoad.length; n++) t += o.miscToLoad[n].size, o.miscToLoad[n].done ? e += o.miscToLoad[n].size : e += o.miscToLoad[n].size * o.miscToLoad[n].perc;
for (var r = 0; r < o.imagesToLoad.length; r++) t += o.imagesToLoad[r].size, o.imagesToLoad[r].done && (e += o.imagesToLoad[r].size);
return e / t
}
function M(e) {
this.verbose && (console.log("SectionLoader | fileError"), console.log(e))
}
function _() {
o.imagesLoaded >= o.imagesToLoad.length && o.miscLoaded >= o.miscToLoad.length && this.complete()
}
function D() {
this.verbose && (console.log("SectionLoader | complete: "), console.log("******************************************* "), console.log("******************************************* "), console.log("******************************************* "));
var n = o.currentlyLoadingIDs.length;
while (n--) {
var r = o.currentlyLoadingIDs[n],
i = this.returnSectionOBJ(r);
i.loaded = !0;
if (i.cssPath) {
this.verbose && console.log("SectionLoader | attachCSS: " + i.cssPath);
if (H.localizationJSON && H.localizationJSON.sections && H.localizationJSON.sections[r] && H.localizationJSON.sections[r].css) e('<style type="text/css">' + i.cssData + "</style>").appendTo("head");
else {
var s = document.createElement("link");
s.setAttribute("rel", "stylesheet"), s.setAttribute("type", "text/css"), s.setAttribute("href", i.cssPath), document.getElementsByTagName("head")[0].appendChild(s)
}
}
}
o.currentlyLoadingIDs = [], o.imagesToLoad = [], o.imagesLoaded = 0, o.miscToLoad = [], o.miscLoaded = 0, o.loader && !o.loader.finished ? o.loader.complete(t.stepComplete_instant.bind(t)) : t.stepComplete_instant()
}
function P(e) {
var t, n = o.sections.length;
while (n--) o.sections[n].id === e && (t = o.sections[n]);
return t
}
var t = new FLOCK.utils.ArrayExecuter,
n = FLOCK.utils.DeviceDetect,
r = "";
FLOCK.settings && (r = FLOCK.settings.base_url || "");
var o = {
sections: [],
currentlyLoadingIDs: [],
templatesToLoad: [],
imagesToLoad: [],
imagesLoaded: 0,
miscToLoad: [],
miscLoaded: 0,
loader: null
},
u = n.isMobile,
H = {
verbose: !1,
loadJSON: i,
setupSections: s,
localizationJSON: {},
addLoaderUI: a,
addSection: l,
sectionExists: c,
addFiles: f,
loadSection: h,
initScrape: p,
loadHTML: d,
loadTemplate: S,
htmlLoaded: v,
loadCSS: g,
cssLoaded: y,
loadJS: b,
jsLoaded: w,
isDuplicate: E,
loadFiles: x,
filesizes: [],
defaultSize: 100,
setFileSize: L,
getFileSize: A,
getPerc: O,
fileError: M,
checkComplete: _,
complete: D,
returnSectionOBJ: P
};
return H
});
var _gsScope = "undefined" != typeof module && module.exports && "undefined" != typeof global ? global : this || window;
(_gsScope._gsQueue || (_gsScope._gsQueue = [])).push(function() {
_gsScope._gsDefine("TweenMax", ["core.Animation", "core.SimpleTimeline", "TweenLite"], function(e, t, n) {
var r = function(e) {
var t, n = [],
r = e.length;
for (t = 0; t !== r; n.push(e[t++]));
return n
},
i = function(e, t, r) {
n.call(this, e, t, r), this._cycle = 0, this._yoyo = this.vars.yoyo === !0, this._repeat = this.vars.repeat || 0, this._repeatDelay = this.vars.repeatDelay || 0, this._dirty = !0, this.render = i.prototype.render
},
s = 1e-10,
o = n._internals,
u = o.isSelector,
a = o.isArray,
f = i.prototype = n.to({}, .1, {}),
l = [];
i.version = "1.15.1", f.constructor = i, f.kill()._gc = !1, i.killTweensOf = i.killDelayedCallsTo = n.killTweensOf, i.getTweensOf = n.getTweensOf, i.lagSmoothing = n.lagSmoothing, i.ticker = n.ticker, i.render = n.render, f.invalidate = function() {
return this._yoyo = this.vars.yoyo === !0, this._repeat = this.vars.repeat || 0, this._repeatDelay = this.vars.repeatDelay || 0, this._uncache(!0), n.prototype.invalidate.call(this)
}, f.updateTo = function(e, t) {
var r, i = this.ratio,
s = this.vars.immediateRender || e.immediateRender;
t && this._startTime < this._timeline._time && (this._startTime = this._timeline._time, this._uncache(!1), this._gc ? this._enabled(!0, !1) : this._timeline.insert(this, this._startTime - this._delay));
for (r in e) this.vars[r] = e[r];
if (this._initted || s)
if (t) this._initted = !1, s && this.render(0, !0, !0);
else if (this._gc && this._enabled(!0, !1), this._notifyPluginsOfEnabled && this._firstPT && n._onPluginEvent("_onDisable", this), this._time / this._duration > .998) {
var o = this._time;
this.render(0, !0, !1), this._initted = !1, this.render(o, !0, !1)
} else if (this._time > 0 || s) {
this._initted = !1, this._init();
for (var u, a = 1 / (1 - i), f = this._firstPT; f;) u = f.s + f.c, f.c *= a, f.s = u - f.c, f = f._next
}
return this
}, f.render = function(e, t, n) {
this._initted || 0 === this._duration && this.vars.repeat && this.invalidate();
var r, i, u, a, f, c, h, p, d = this._dirty ? this.totalDuration() : this._totalDuration,
v = this._time,
m = this._totalTime,
g = this._cycle,
y = this._duration,
b = this._rawPrevTime;
if (e >= d ? (this._totalTime = d, this._cycle = this._repeat, this._yoyo && 0 !== (1 & this._cycle) ? (this._time = 0, this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0) : (this._time = y, this.ratio = this._ease._calcEnd ? this._ease.getRatio(1) : 1), this._reversed || (r = !0, i = "onComplete"), 0 === y && (this._initted || !this.vars.lazy || n) && (this._startTime === this._timeline._duration && (e = 0), (0 === e || 0 > b || b === s) && b !== e && (n = !0, b > s && (i = "onReverseComplete")), this._rawPrevTime = p = !t || e || b === e ? e : s)) : 1e-7 > e ? (this._totalTime = this._time = this._cycle = 0, this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0, (0 !== m || 0 === y && b > 0 && b !== s) && (i = "onReverseComplete", r = this._reversed), 0 > e && (this._active = !1, 0 === y && (this._initted || !this.vars.lazy || n) && (b >= 0 && (n = !0), this._rawPrevTime = p = !t || e || b === e ? e : s)), this._initted || (n = !0)) : (this._totalTime = this._time = e, 0 !== this._repeat && (a = y + this._repeatDelay, this._cycle = this._totalTime / a >> 0, 0 !== this._cycle && this._cycle === this._totalTime / a && this._cycle--, this._time = this._totalTime - this._cycle * a, this._yoyo && 0 !== (1 & this._cycle) && (this._time = y - this._time), this._time > y ? this._time = y : 0 > this._time && (this._time = 0)), this._easeType ? (f = this._time / y, c = this._easeType, h = this._easePower, (1 === c || 3 === c && f >= .5) && (f = 1 - f), 3 === c && (f *= 2), 1 === h ? f *= f : 2 === h ? f *= f * f : 3 === h ? f *= f * f * f : 4 === h && (f *= f * f * f * f), this.ratio = 1 === c ? 1 - f : 2 === c ? f : .5 > this._time / y ? f / 2 : 1 - f / 2) : this.ratio = this._ease.getRatio(this._time / y)), v === this._time && !n && g === this._cycle) return m !== this._totalTime && this._onUpdate && (t || this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || l)), void 0;
if (!this._initted) {
if (this._init(), !this._initted || this._gc) return;
if (!n && this._firstPT && (this.vars.lazy !== !1 && this._duration || this.vars.lazy && !this._duration)) return this._time = v, this._totalTime = m, this._rawPrevTime = b, this._cycle = g, o.lazyTweens.push(this), this._lazy = [e, t], void 0;
this._time && !r ? this.ratio = this._ease.getRatio(this._time / y) : r && this._ease._calcEnd && (this.ratio = this._ease.getRatio(0 === this._time ? 0 : 1))
}
for (this._lazy !== !1 && (this._lazy = !1), this._active || !this._paused && this._time !== v && e >= 0 && (this._active = !0), 0 === m && (2 === this._initted && e > 0 && this._init(), this._startAt && (e >= 0 ? this._startAt.render(e, t, n) : i || (i = "_dummyGS")), this.vars.onStart && (0 !== this._totalTime || 0 === y) && (t || this.vars.onStart.apply(this.vars.onStartScope || this, this.vars.onStartParams || l))), u = this._firstPT; u;) u.f ? u.t[u.p](u.c * this.ratio + u.s) : u.t[u.p] = u.c * this.ratio + u.s, u = u._next;
this._onUpdate && (0 > e && this._startAt && this._startTime && this._startAt.render(e, t, n), t || (this._totalTime !== m || r) && this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || l)), this._cycle !== g && (t || this._gc || this.vars.onRepeat && this.vars.onRepeat.apply(this.vars.onRepeatScope || this, this.vars.onRepeatParams || l)), i && (!this._gc || n) && (0 > e && this._startAt && !this._onUpdate && this._startTime && this._startAt.render(e, t, n), r && (this._timeline.autoRemoveChildren && this._enabled(!1, !1), this._active = !1), !t && this.vars[i] && this.vars[i].apply(this.vars[i + "Scope"] || this, this.vars[i + "Params"] || l), 0 === y && this._rawPrevTime === s && p !== s && (this._rawPrevTime = 0))
}, i.to = function(e, t, n) {
return new i(e, t, n)
}, i.from = function(e, t, n) {
return n.runBackwards = !0, n.immediateRender = 0 != n.immediateRender, new i(e, t, n)
}, i.fromTo = function(e, t, n, r) {
return r.startAt = n, r.immediateRender = 0 != r.immediateRender && 0 != n.immediateRender, new i(e, t, r)
}, i.staggerTo = i.allTo = function(e, t, s, o, f, c, h) {
o = o || 0;
var p, d, v, m, g = s.delay || 0,
y = [],
b = function() {
s.onComplete && s.onComplete.apply(s.onCompleteScope || this, arguments), f.apply(h || this, c || l)
};
for (a(e) || ("string" == typeof e && (e = n.selector(e) || e), u(e) && (e = r(e))), e = e || [], 0 > o && (e = r(e), e.reverse(), o *= -1), p = e.length - 1, v = 0; p >= v; v++) {
d = {};
for (m in s) d[m] = s[m];
d.delay = g, v === p && f && (d.onComplete = b), y[v] = new i(e[v], t, d), g += o
}
return y
}, i.staggerFrom = i.allFrom = function(e, t, n, r, s, o, u) {
return n.runBackwards = !0, n.immediateRender = 0 != n.immediateRender, i.staggerTo(e, t, n, r, s, o, u)
}, i.staggerFromTo = i.allFromTo = function(e, t, n, r, s, o, u, a) {
return r.startAt = n, r.immediateRender = 0 != r.immediateRender && 0 != n.immediateRender, i.staggerTo(e, t, r, s, o, u, a)
}, i.delayedCall = function(e, t, n, r, s) {
return new i(t, 0, {
delay: e,
onComplete: t,
onCompleteParams: n,
onCompleteScope: r,
onReverseComplete: t,
onReverseCompleteParams: n,
onReverseCompleteScope: r,
immediateRender: !1,
useFrames: s,
overwrite: 0
})
}, i.set = function(e, t) {
return new i(e, 0, t)
}, i.isTweening = function(e) {
return n.getTweensOf(e, !0).length > 0
};
var c = function(e, t) {
for (var r = [], i = 0, s = e._first; s;) s instanceof n ? r[i++] = s : (t && (r[i++] = s), r = r.concat(c(s, t)), i = r.length), s = s._next;
return r
},
h = i.getAllTweens = function(t) {
return c(e._rootTimeline, t).concat(c(e._rootFramesTimeline, t))
};
i.killAll = function(e, n, r, i) {
null == n && (n = !0), null == r && (r = !0);
var s, o, u, a = h(0 != i),
f = a.length,
l = n && r && i;
for (u = 0; f > u; u++) o = a[u], (l || o instanceof t || (s = o.target === o.vars.onComplete) && r || n && !s) && (e ? o.totalTime(o._reversed ? 0 : o.totalDuration()) : o._enabled(!1, !1))
}, i.killChildTweensOf = function(e, t) {
if (null != e) {
var s, f, l, c, h, p = o.tweenLookup;
if ("string" == typeof e && (e = n.selector(e) || e), u(e) && (e = r(e)), a(e))
for (c = e.length; --c > -1;) i.killChildTweensOf(e[c], t);
else {
s = [];
for (l in p)
for (f = p[l].target.parentNode; f;) f === e && (s = s.concat(p[l].tweens)), f = f.parentNode;
for (h = s.length, c = 0; h > c; c++) t && s[c].totalTime(s[c].totalDuration()), s[c]._enabled(!1, !1)
}
}
};
var p = function(e, n, r, i) {
n = n !== !1, r = r !== !1, i = i !== !1;
for (var s, o, u = h(i), a = n && r && i, f = u.length; --f > -1;) o = u[f], (a || o instanceof t || (s = o.target === o.vars.onComplete) && r || n && !s) && o.paused(e)
};
return i.pauseAll = function(e, t, n) {
p(!0, e, t, n)
}, i.resumeAll = function(e, t, n) {
p(!1, e, t, n)
}, i.globalTimeScale = function(t) {
var r = e._rootTimeline,
i = n.ticker.time;
return arguments.length ? (t = t || s, r._startTime = i - (i - r._startTime) * r._timeScale / t, r = e._rootFramesTimeline, i = n.ticker.frame, r._startTime = i - (i - r._startTime) * r._timeScale / t, r._timeScale = e._rootTimeline._timeScale = t, t) : r._timeScale
}, f.progress = function(e) {
return arguments.length ? this.totalTime(this.duration() * (this._yoyo && 0 !== (1 & this._cycle) ? 1 - e : e) + this._cycle * (this._duration + this._repeatDelay), !1) : this._time / this.duration()
}, f.totalProgress = function(e) {
return arguments.length ? this.totalTime(this.totalDuration() * e, !1) : this._totalTime / this.totalDuration()
}, f.time = function(e, t) {
return arguments.length ? (this._dirty && this.totalDuration(), e > this._duration && (e = this._duration), this._yoyo && 0 !== (1 & this._cycle) ? e = this._duration - e + this._cycle * (this._duration + this._repeatDelay) : 0 !== this._repeat && (e += this._cycle * (this._duration + this._repeatDelay)), this.totalTime(e, t)) : this._time
}, f.duration = function(t) {
return arguments.length ? e.prototype.duration.call(this, t) : this._duration
}, f.totalDuration = function(e) {
return arguments.length ? -1 === this._repeat ? this : this.duration((e - this._repeat * this._repeatDelay) / (this._repeat + 1)) : (this._dirty && (this._totalDuration = -1 === this._repeat ? 999999999999 : this._duration * (this._repeat + 1) + this._repeatDelay * this._repeat, this._dirty = !1), this._totalDuration)
}, f.repeat = function(e) {
return arguments.length ? (this._repeat = e, this._uncache(!0)) : this._repeat
}, f.repeatDelay = function(e) {
return arguments.length ? (this._repeatDelay = e, this._uncache(!0)) : this._repeatDelay
}, f.yoyo = function(e) {
return arguments.length ? (this._yoyo = e, this) : this._yoyo
}, i
}, !0), _gsScope._gsDefine("TimelineLite", ["core.Animation", "core.SimpleTimeline", "TweenLite"], function(e, t, n) {
var r = function(e) {
t.call(this, e), this._labels = {}, this.autoRemoveChildren = this.vars.autoRemoveChildren === !0, this.smoothChildTiming = this.vars.smoothChildTiming === !0, this._sortChildren = !0, this._onUpdate = this.vars.onUpdate;
var n, r, i = this.vars;
for (r in i) n = i[r], a(n) && -1 !== n.join("").indexOf("{self}") && (i[r] = this._swapSelfInParams(n));
a(i.tweens) && this.add(i.tweens, 0, i.align, i.stagger)
},
i = 1e-10,
s = n._internals,
o = r._internals = {},
u = s.isSelector,
a = s.isArray,
f = s.lazyTweens,
l = s.lazyRender,
c = [],
h = _gsScope._gsDefine.globals,
p = function(e) {
var t, n = {};
for (t in e) n[t] = e[t];
return n
},
d = o.pauseCallback = function(e, t, n, r) {
var i = e._timeline,
s = i._totalTime;
!t && this._forcingPlayhead || i._rawPrevTime === e._startTime || (i.pause(e._startTime), t && t.apply(r || i, n || c), this._forcingPlayhead && i.seek(s))
},
v = function(e) {
var t, n = [],
r = e.length;
for (t = 0; t !== r; n.push(e[t++]));
return n
},
m = r.prototype = new t;
return r.version = "1.15.1", m.constructor = r, m.kill()._gc = m._forcingPlayhead = !1, m.to = function(e, t, r, i) {
var s = r.repeat && h.TweenMax || n;
return t ? this.add(new s(e, t, r), i) : this.set(e, r, i)
}, m.from = function(e, t, r, i) {
return this.add((r.repeat && h.TweenMax || n).from(e, t, r), i)
}, m.fromTo = function(e, t, r, i, s) {
var o = i.repeat && h.TweenMax || n;
return t ? this.add(o.fromTo(e, t, r, i), s) : this.set(e, i, s)
}, m.staggerTo = function(e, t, i, s, o, a, f, l) {
var c, h = new r({
onComplete: a,
onCompleteParams: f,
onCompleteScope: l,
smoothChildTiming: this.smoothChildTiming
});
for ("string" == typeof e && (e = n.selector(e) || e), e = e || [], u(e) && (e = v(e)), s = s || 0, 0 > s && (e = v(e), e.reverse(), s *= -1), c = 0; e.length > c; c++) i.startAt && (i.startAt = p(i.startAt)), h.to(e[c], t, p(i), c * s);
return this.add(h, o)
}, m.staggerFrom = function(e, t, n, r, i, s, o, u) {
return n.immediateRender = 0 != n.immediateRender, n.runBackwards = !0, this.staggerTo(e, t, n, r, i, s, o, u)
}, m.staggerFromTo = function(e, t, n, r, i, s, o, u, a) {
return r.startAt = n, r.immediateRender = 0 != r.immediateRender && 0 != n.immediateRender, this.staggerTo(e, t, r, i, s, o, u, a)
}, m.call = function(e, t, r, i) {
return this.add(n.delayedCall(0, e, t, r), i)
}, m.set = function(e, t, r) {
return r = this._parseTimeOrLabel(r, 0, !0), null == t.immediateRender && (t.immediateRender = r === this._time && !this._paused), this.add(new n(e, 0, t), r)
}, r.exportRoot = function(e, t) {
e = e || {}, null == e.smoothChildTiming && (e.smoothChildTiming = !0);
var i, s, o = new r(e),
u = o._timeline;
for (null == t && (t = !0), u._remove(o, !0), o._startTime = 0, o._rawPrevTime = o._time = o._totalTime = u._time, i = u._first; i;) s = i._next, t && i instanceof n && i.target === i.vars.onComplete || o.add(i, i._startTime - i._delay), i = s;
return u.add(o, 0), o
}, m.add = function(i, s, o, u) {
var f, l, c, h, p, d;
if ("number" != typeof s && (s = this._parseTimeOrLabel(s, 0, !0, i)), !(i instanceof e)) {
if (i instanceof Array || i && i.push && a(i)) {
for (o = o || "normal", u = u || 0, f = s, l = i.length, c = 0; l > c; c++) a(h = i[c]) && (h = new r({
tweens: h
})), this.add(h, f), "string" != typeof h && "function" != typeof h && ("sequence" === o ? f = h._startTime + h.totalDuration() / h._timeScale : "start" === o && (h._startTime -= h.delay())), f += u;
return this._uncache(!0)
}
if ("string" == typeof i) return this.addLabel(i, s);
if ("function" != typeof i) throw "Cannot add " + i + " into the timeline; it is not a tween, timeline, function, or string.";
i = n.delayedCall(0, i)
}
if (t.prototype.add.call(this, i, s), (this._gc || this._time === this._duration) && !this._paused && this._duration < this.duration())
for (p = this, d = p.rawTime() > i._startTime; p._timeline;) d && p._timeline.smoothChildTiming ? p.totalTime(p._totalTime, !0) : p._gc && p._enabled(!0, !1), p = p._timeline;
return this
}, m.remove = function(t) {
if (t instanceof e) return this._remove(t, !1);
if (t instanceof Array || t && t.push && a(t)) {
for (var n = t.length; --n > -1;) this.remove(t[n]);
return this
}
return "string" == typeof t ? this.removeLabel(t) : this.kill(null, t)
}, m._remove = function(e, n) {
t.prototype._remove.call(this, e, n);
var r = this._last;
return r ? this._time > r._startTime + r._totalDuration / r._timeScale && (this._time = this.duration(), this._totalTime = this._totalDuration) : this._time = this._totalTime = this._duration = this._totalDuration = 0, this
}, m.append = function(e, t) {
return this.add(e, this._parseTimeOrLabel(null, t, !0, e))
}, m.insert = m.insertMultiple = function(e, t, n, r) {
return this.add(e, t || 0, n, r)
}, m.appendMultiple = function(e, t, n, r) {
return this.add(e, this._parseTimeOrLabel(null, t, !0, e), n, r)
}, m.addLabel = function(e, t) {
return this._labels[e] = this._parseTimeOrLabel(t), this
}, m.addPause = function(e, t, r, i) {
var s = n.delayedCall(0, d, ["{self}", t, r, i], this);
return s.data = "isPause", this.add(s, e)
}, m.removeLabel = function(e) {
return delete this._labels[e], this
}, m.getLabelTime = function(e) {
return null != this._labels[e] ? this._labels[e] : -1
}, m._parseTimeOrLabel = function(t, n, r, i) {
var s;
if (i instanceof e && i.timeline === this) this.remove(i);
else if (i && (i instanceof Array || i.push && a(i)))
for (s = i.length; --s > -1;) i[s] instanceof e && i[s].timeline === this && this.remove(i[s]);
if ("string" == typeof n) return this._parseTimeOrLabel(n, r && "number" == typeof t && null == this._labels[n] ? t - this.duration() : 0, r);
if (n = n || 0, "string" != typeof t || !isNaN(t) && null == this._labels[t]) null == t && (t = this.duration());
else {
if (s = t.indexOf("="), -1 === s) return null == this._labels[t] ? r ? this._labels[t] = this.duration() + n : n : this._labels[t] + n;
n = parseInt(t.charAt(s - 1) + "1", 10) * Number(t.substr(s + 1)), t = s > 1 ? this._parseTimeOrLabel(t.substr(0, s - 1), 0, r) : this.duration()
}
return Number(t) + n
}, m.seek = function(e, t) {
return this.totalTime("number" == typeof e ? e : this._parseTimeOrLabel(e), t !== !1)
}, m.stop = function() {
return this.paused(!0)
}, m.gotoAndPlay = function(e, t) {
return this.play(e, t)
}, m.gotoAndStop = function(e, t) {
return this.pause(e, t)
}, m.render = function(e, t, n) {
this._gc && this._enabled(!0, !1);
var r, s, o, u, a, h = this._dirty ? this.totalDuration() : this._totalDuration,
p = this._time,
d = this._startTime,
v = this._timeScale,
m = this._paused;
if (e >= h ? (this._totalTime = this._time = h, this._reversed || this._hasPausedChild() || (s = !0, u = "onComplete", 0 === this._duration && (0 === e || 0 > this._rawPrevTime || this._rawPrevTime === i) && this._rawPrevTime !== e && this._first && (a = !0, this._rawPrevTime > i && (u = "onReverseComplete"))), this._rawPrevTime = this._duration || !t || e || this._rawPrevTime === e ? e : i, e = h + 1e-4) : 1e-7 > e ? (this._totalTime = this._time = 0, (0 !== p || 0 === this._duration && this._rawPrevTime !== i && (this._rawPrevTime > 0 || 0 > e && this._rawPrevTime >= 0)) && (u = "onReverseComplete", s = this._reversed), 0 > e ? (this._active = !1, this._rawPrevTime >= 0 && this._first && (a = !0), this._rawPrevTime = e) : (this._rawPrevTime = this._duration || !t || e || this._rawPrevTime === e ? e : i, e = 0, this._initted || (a = !0))) : this._totalTime = this._time = this._rawPrevTime = e, this._time !== p && this._first || n || a) {
if (this._initted || (this._initted = !0), this._active || !this._paused && this._time !== p && e > 0 && (this._active = !0), 0 === p && this.vars.onStart && 0 !== this._time && (t || this.vars.onStart.apply(this.vars.onStartScope || this, this.vars.onStartParams || c)), this._time >= p)
for (r = this._first; r && (o = r._next, !this._paused || m);)(r._active || r._startTime <= this._time && !r._paused && !r._gc) && (r._reversed ? r.render((r._dirty ? r.totalDuration() : r._totalDuration) - (e - r._startTime) * r._timeScale, t, n) : r.render((e - r._startTime) * r._timeScale, t, n)), r = o;
else
for (r = this._last; r && (o = r._prev, !this._paused || m);)(r._active || p >= r._startTime && !r._paused && !r._gc) && (r._reversed ? r.render((r._dirty ? r.totalDuration() : r._totalDuration) - (e - r._startTime) * r._timeScale, t, n) : r.render((e - r._startTime) * r._timeScale, t, n)), r = o;
this._onUpdate && (t || (f.length && l(), this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || c))), u && (this._gc || (d === this._startTime || v !== this._timeScale) && (0 === this._time || h >= this.totalDuration()) && (s && (f.length && l(), this._timeline.autoRemoveChildren && this._enabled(!1, !1), this._active = !1), !t && this.vars[u] && this.vars[u].apply(this.vars[u + "Scope"] || this, this.vars[u + "Params"] || c)))
}
}, m._hasPausedChild = function() {
for (var e = this._first; e;) {
if (e._paused || e instanceof r && e._hasPausedChild()) return !0;
e = e._next
}
return !1
}, m.getChildren = function(e, t, r, i) {
i = i || -9999999999;
for (var s = [], o = this._first, u = 0; o;) i > o._startTime || (o instanceof n ? t !== !1 && (s[u++] = o) : (r !== !1 && (s[u++] = o), e !== !1 && (s = s.concat(o.getChildren(!0, t, r)), u = s.length))), o = o._next;
return s
}, m.getTweensOf = function(e, t) {
var r, i, s = this._gc,
o = [],
u = 0;
for (s && this._enabled(!0, !0), r = n.getTweensOf(e), i = r.length; --i > -1;)(r[i].timeline === this || t && this._contains(r[i])) && (o[u++] = r[i]);
return s && this._enabled(!1, !0), o
}, m.recent = function() {
return this._recent
}, m._contains = function(e) {
for (var t = e.timeline; t;) {
if (t === this) return !0;
t = t.timeline
}
return !1
}, m.shiftChildren = function(e, t, n) {
n = n || 0;
for (var r, i = this._first, s = this._labels; i;) i._startTime >= n && (i._startTime += e), i = i._next;
if (t)
for (r in s) s[r] >= n && (s[r] += e);
return this._uncache(!0)
}, m._kill = function(e, t) {
if (!e && !t) return this._enabled(!1, !1);
for (var n = t ? this.getTweensOf(t) : this.getChildren(!0, !0, !1), r = n.length, i = !1; --r > -1;) n[r]._kill(e, t) && (i = !0);
return i
}, m.clear = function(e) {
var t = this.getChildren(!1, !0, !0),
n = t.length;
for (this._time = this._totalTime = 0; --n > -1;) t[n]._enabled(!1, !1);
return e !== !1 && (this._labels = {}), this._uncache(!0)
}, m.invalidate = function() {
for (var t = this._first; t;) t.invalidate(), t = t._next;
return e.prototype.invalidate.call(this)
}, m._enabled = function(e, n) {
if (e === this._gc)
for (var r = this._first; r;) r._enabled(e, !0), r = r._next;
return t.prototype._enabled.call(this, e, n)
}, m.totalTime = function() {
this._forcingPlayhead = !0;
var t = e.prototype.totalTime.apply(this, arguments);
return this._forcingPlayhead = !1, t
}, m.duration = function(e) {
return arguments.length ? (0 !== this.duration() && 0 !== e && this.timeScale(this._duration / e), this) : (this._dirty && this.totalDuration(), this._duration)
}, m.totalDuration = function(e) {
if (!arguments.length) {
if (this._dirty) {
for (var t, n, r = 0, i = this._last, s = 999999999999; i;) t = i._prev, i._dirty && i.totalDuration(), i._startTime > s && this._sortChildren && !i._paused ? this.add(i, i._startTime - i._delay) : s = i._startTime, 0 > i._startTime && !i._paused && (r -= i._startTime, this._timeline.smoothChildTiming && (this._startTime += i._startTime / this._timeScale), this.shiftChildren(-i._startTime, !1, -9999999999), s = 0), n = i._startTime + i._totalDuration / i._timeScale, n > r && (r = n), i = t;
this._duration = this._totalDuration = r, this._dirty = !1
}
return this._totalDuration
}
return 0 !== this.totalDuration() && 0 !== e && this.timeScale(this._totalDuration / e), this
}, m.usesFrames = function() {
for (var t = this._timeline; t._timeline;) t = t._timeline;
return t === e._rootFramesTimeline
}, m.rawTime = function() {
return this._paused ? this._totalTime : (this._timeline.rawTime() - this._startTime) * this._timeScale
}, r
}, !0), _gsScope._gsDefine("TimelineMax", ["TimelineLite", "TweenLite", "easing.Ease"], function(e, t, n) {
var r = function(t) {
e.call(this, t), this._repeat = this.vars.repeat || 0, this._repeatDelay = this.vars.repeatDelay || 0, this._cycle = 0, this._yoyo = this.vars.yoyo === !0, this._dirty = !0
},
i = 1e-10,
s = [],
o = t._internals,
u = o.lazyTweens,
a = o.lazyRender,
f = new n(null, null, 1, 0),
l = r.prototype = new e;
return l.constructor = r, l.kill()._gc = !1, r.version = "1.15.1", l.invalidate = function() {
return this._yoyo = this.vars.yoyo === !0, this._repeat = this.vars.repeat || 0, this._repeatDelay = this.vars.repeatDelay || 0, this._uncache(!0), e.prototype.invalidate.call(this)
}, l.addCallback = function(e, n, r, i) {
return this.add(t.delayedCall(0, e, r, i), n)
}, l.removeCallback = function(e, t) {
if (e)
if (null == t) this._kill(null, e);
else
for (var n = this.getTweensOf(e, !1), r = n.length, i = this._parseTimeOrLabel(t); --r > -1;) n[r]._startTime === i && n[r]._enabled(!1, !1);
return this
}, l.removePause = function(t) {
return this.removeCallback(e._internals.pauseCallback, t)
}, l.tweenTo = function(e, n) {
n = n || {};
var r, i, o, u = {
ease: f,
useFrames: this.usesFrames(),
immediateRender: !1
};
for (i in n) u[i] = n[i];
return u.time = this._parseTimeOrLabel(e), r = Math.abs(Number(u.time) - this._time) / this._timeScale || .001, o = new t(this, r, u), u.onStart = function() {
o.target.paused(!0), o.vars.time !== o.target.time() && r === o.duration() && o.duration(Math.abs(o.vars.time - o.target.time()) / o.target._timeScale), n.onStart && n.onStart.apply(n.onStartScope || o, n.onStartParams || s)
}, o
}, l.tweenFromTo = function(e, t, n) {
n = n || {}, e = this._parseTimeOrLabel(e), n.startAt = {
onComplete: this.seek,
onCompleteParams: [e],
onCompleteScope: this
}, n.immediateRender = n.immediateRender !== !1;
var r = this.tweenTo(t, n);
return r.duration(Math.abs(r.vars.time - e) / this._timeScale || .001)
}, l.render = function(e, t, n) {
this._gc && this._enabled(!0, !1);
var r, o, f, l, c, p, d = this._dirty ? this.totalDuration() : this._totalDuration,
v = this._duration,
m = this._time,
g = this._totalTime,
y = this._startTime,
b = this._timeScale,
w = this._rawPrevTime,
E = this._paused,
S = this._cycle;
if (e >= d ? (this._locked || (this._totalTime = d, this._cycle = this._repeat), this._reversed || this._hasPausedChild() || (o = !0, l = "onComplete", 0 === this._duration && (0 === e || 0 > w || w === i) && w !== e && this._first && (c = !0, w > i && (l = "onReverseComplete"))), this._rawPrevTime = this._duration || !t || e || this._rawPrevTime === e ? e : i, this._yoyo && 0 !== (1 & this._cycle) ? this._time = e = 0 : (this._time = v, e = v + 1e-4)) : 1e-7 > e ? (this._locked || (this._totalTime = this._cycle = 0), this._time = 0, (0 !== m || 0 === v && w !== i && (w > 0 || 0 > e && w >= 0) && !this._locked) && (l = "onReverseComplete", o = this._reversed), 0 > e ? (this._active = !1, w >= 0 && this._first && (c = !0), this._rawPrevTime = e) : (this._rawPrevTime = v || !t || e || this._rawPrevTime === e ? e : i, e = 0, this._initted || (c = !0))) : (0 === v && 0 > w && (c = !0), this._time = this._rawPrevTime = e, this._locked || (this._totalTime = e, 0 !== this._repeat && (p = v + this._repeatDelay, this._cycle = this._totalTime / p >> 0, 0 !== this._cycle && this._cycle === this._totalTime / p && this._cycle--, this._time = this._totalTime - this._cycle * p, this._yoyo && 0 !== (1 & this._cycle) && (this._time = v - this._time), this._time > v ? (this._time = v, e = v + 1e-4) : 0 > this._time ? this._time = e = 0 : e = this._time))), this._cycle !== S && !this._locked) {
var x = this._yoyo && 0 !== (1 & S),
T = x === (this._yoyo && 0 !== (1 & this._cycle)),
N = this._totalTime,
C = this._cycle,
k = this._rawPrevTime,
L = this._time;
if (this._totalTime = S * v, S > this._cycle ? x = !x : this._totalTime += v, this._time = m, this._rawPrevTime = 0 === v ? w - 1e-4 : w, this._cycle = S, this._locked = !0, m = x ? 0 : v, this.render(m, t, 0 === v), t || this._gc || this.vars.onRepeat && this.vars.onRepeat.apply(this.vars.onRepeatScope || this, this.vars.onRepeatParams || s), T && (m = x ? v + 1e-4 : -0.0001, this.render(m, !0, !1)), this._locked = !1, this._paused && !E) return;
this._time = L, this._totalTime = N, this._cycle = C, this._rawPrevTime = k
}
if (!(this._time !== m && this._first || n || c)) return g !== this._totalTime && this._onUpdate && (t || this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || s)), void 0;
if (this._initted || (this._initted = !0), this._active || !this._paused && this._totalTime !== g && e > 0 && (this._active = !0), 0 === g && this.vars.onStart && 0 !== this._totalTime && (t || this.vars.onStart.apply(this.vars.onStartScope || this, this.vars.onStartParams || s)), this._time >= m)
for (r = this._first; r && (f = r._next, !this._paused || E);)(r._active || r._startTime <= this._time && !r._paused && !r._gc) && (r._reversed ? r.render((r._dirty ? r.totalDuration() : r._totalDuration) - (e - r._startTime) * r._timeScale, t, n) : r.render((e - r._startTime) * r._timeScale, t, n)), r = f;
else
for (r = this._last; r && (f = r._prev, !this._paused || E);)(r._active || m >= r._startTime && !r._paused && !r._gc) && (r._reversed ? r.render((r._dirty ? r.totalDuration() : r._totalDuration) - (e - r._startTime) * r._timeScale, t, n) : r.render((e - r._startTime) * r._timeScale, t, n)), r = f;
this._onUpdate && (t || (u.length && a(), this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || s))), l && (this._locked || this._gc || (y === this._startTime || b !== this._timeScale) && (0 === this._time || d >= this.totalDuration()) && (o && (u.length && a(), this._timeline.autoRemoveChildren && this._enabled(!1, !1), this._active = !1), !t && this.vars[l] && this.vars[l].apply(this.vars[l + "Scope"] || this, this.vars[l + "Params"] || s)))
}, l.getActive = function(e, t, n) {
null == e && (e = !0), null == t && (t = !0), null == n && (n = !1);
var r, i, s = [],
o = this.getChildren(e, t, n),
u = 0,
a = o.length;
for (r = 0; a > r; r++) i = o[r], i.isActive() && (s[u++] = i);
return s
}, l.getLabelAfter = function(e) {
e || 0 !== e && (e = this._time);
var t, n = this.getLabelsArray(),
r = n.length;
for (t = 0; r > t; t++)
if (n[t].time > e) return n[t].name;
return null
}, l.getLabelBefore = function(e) {
null == e && (e = this._time);
for (var t = this.getLabelsArray(), n = t.length; --n > -1;)
if (e > t[n].time) return t[n].name;
return null
}, l.getLabelsArray = function() {
var e, t = [],
n = 0;
for (e in this._labels) t[n++] = {
time: this._labels[e],
name: e
};
return t.sort(function(e, t) {
return e.time - t.time
}), t
}, l.progress = function(e, t) {
return arguments.length ? this.totalTime(this.duration() * (this._yoyo && 0 !== (1 & this._cycle) ? 1 - e : e) + this._cycle * (this._duration + this._repeatDelay), t) : this._time / this.duration()
}, l.totalProgress = function(e, t) {
return arguments.length ? this.totalTime(this.totalDuration() * e, t) : this._totalTime / this.totalDuration()
}, l.totalDuration = function(t) {
return arguments.length ? -1 === this._repeat ? this : this.duration((t - this._repeat * this._repeatDelay) / (this._repeat + 1)) : (this._dirty && (e.prototype.totalDuration.call(this), this._totalDuration = -1 === this._repeat ? 999999999999 : this._duration * (this._repeat + 1) + this._repeatDelay * this._repeat), this._totalDuration)
}, l.time = function(e, t) {
return arguments.length ? (this._dirty && this.totalDuration(), e > this._duration && (e = this._duration), this._yoyo && 0 !== (1 & this._cycle) ? e = this._duration - e + this._cycle * (this._duration + this._repeatDelay) : 0 !== this._repeat && (e += this._cycle * (this._duration + this._repeatDelay)), this.totalTime(e, t)) : this._time
}, l.repeat = function(e) {
return arguments.length ? (this._repeat = e, this._uncache(!0)) : this._repeat
}, l.repeatDelay = function(e) {
return arguments.length ? (this._repeatDelay = e, this._uncache(!0)) : this._repeatDelay
}, l.yoyo = function(e) {
return arguments.length ? (this._yoyo = e, this) : this._yoyo
}, l.currentLabel = function(e) {
return arguments.length ? this.seek(e, !0) : this.getLabelBefore(this._time + 1e-8)
}, r
}, !0),
function() {
var e = 180 / Math.PI,
t = [],
n = [],
r = [],
i = {},
s = _gsScope._gsDefine.globals,
o = function(e, t, n, r) {
this.a = e, this.b = t, this.c = n, this.d = r, this.da = r - e, this.ca = n - e, this.ba = t - e
},
u = ",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,",
a = function(e, t, n, r) {
var i = {
a: e
},
s = {},
o = {},
u = {
c: r
},
a = (e + t) / 2,
f = (t + n) / 2,
l = (n + r) / 2,
c = (a + f) / 2,
h = (f + l) / 2,
p = (h - c) / 8;
return i.b = a + (e - a) / 4, s.b = c + p, i.c = s.a = (i.b + s.b) / 2, s.c = o.a = (c + h) / 2, o.b = h - p, u.b = l + (r - l) / 4, o.c = u.a = (o.b + u.b) / 2, [i, s, o, u]
},
f = function(e, i, s, o, u) {
var f, l, c, h, p, d, v, m, g, y, b, w, E, S = e.length - 1,
x = 0,
T = e[0].a;
for (f = 0; S > f; f++) p = e[x], l = p.a, c = p.d, h = e[x + 1].d, u ? (b = t[f], w = n[f], E = .25 * (w + b) * i / (o ? .5 : r[f] || .5), d = c - (c - l) * (o ? .5 * i : 0 !== b ? E / b : 0), v = c + (h - c) * (o ? .5 * i : 0 !== w ? E / w : 0), m = c - (d + ((v - d) * (3 * b / (b + w) + .5) / 4 || 0))) : (d = c - .5 * (c - l) * i, v = c + .5 * (h - c) * i, m = c - (d + v) / 2), d += m, v += m, p.c = g = d, p.b = 0 !== f ? T : T = p.a + .6 * (p.c - p.a), p.da = c - l, p.ca = g - l, p.ba = T - l, s ? (y = a(l, T, g, c), e.splice(x, 1, y[0], y[1], y[2], y[3]), x += 4) : x++, T = v;
p = e[x], p.b = T, p.c = T + .4 * (p.d - T), p.da = p.d - p.a, p.ca = p.c - p.a, p.ba = T - p.a, s && (y = a(p.a, T, p.c, p.d), e.splice(x, 1, y[0], y[1], y[2], y[3]))
},
l = function(e, r, i, s) {
var u, a, f, l, c, h, p = [];
if (s)
for (e = [s].concat(e), a = e.length; --a > -1;) "string" == typeof(h = e[a][r]) && "=" === h.charAt(1) && (e[a][r] = s[r] + Number(h.charAt(0) + h.substr(2)));
if (u = e.length - 2, 0 > u) return p[0] = new o(e[0][r], 0, 0, e[-1 > u ? 0 : 1][r]), p;
for (a = 0; u > a; a++) f = e[a][r], l = e[a + 1][r], p[a] = new o(f, 0, 0, l), i && (c = e[a + 2][r], t[a] = (t[a] || 0) + (l - f) * (l - f), n[a] = (n[a] || 0) + (c - l) * (c - l));
return p[a] = new o(e[a][r], 0, 0, e[a + 1][r]), p
},
c = function(e, s, o, a, c, h) {
var p, d, v, m, g, y, b, w, E = {},
S = [],
x = h || e[0];
c = "string" == typeof c ? "," + c + "," : u, null == s && (s = 1);
for (d in e[0]) S.push(d);
if (e.length > 1) {
for (w = e[e.length - 1], b = !0, p = S.length; --p > -1;)
if (d = S[p], Math.abs(x[d] - w[d]) > .05) {
b = !1;
break
}
b && (e = e.concat(), h && e.unshift(h), e.push(e[1]), h = e[e.length - 3])
}
for (t.length = n.length = r.length = 0, p = S.length; --p > -1;) d = S[p], i[d] = -1 !== c.indexOf("," + d + ","), E[d] = l(e, d, i[d], h);
for (p = t.length; --p > -1;) t[p] = Math.sqrt(t[p]), n[p] = Math.sqrt(n[p]);
if (!a) {
for (p = S.length; --p > -1;)
if (i[d])
for (v = E[S[p]], y = v.length - 1, m = 0; y > m; m++) g = v[m + 1].da / n[m] + v[m].da / t[m], r[m] = (r[m] || 0) + g * g;
for (p = r.length; --p > -1;) r[p] = Math.sqrt(r[p])
}
for (p = S.length, m = o ? 4 : 1; --p > -1;) d = S[p], v = E[d], f(v, s, o, a, i[d]), b && (v.splice(0, m), v.splice(v.length - m, m));
return E
},
h = function(e, t, n) {
t = t || "soft";
var r, i, s, u, a, f, l, c, h, p, d, v = {},
m = "cubic" === t ? 3 : 2,
g = "soft" === t,
y = [];
if (g && n && (e = [n].concat(e)), null == e || m + 1 > e.length) throw "invalid Bezier data";
for (h in e[0]) y.push(h);
for (f = y.length; --f > -1;) {
for (h = y[f], v[h] = a = [], p = 0, c = e.length, l = 0; c > l; l++) r = null == n ? e[l][h] : "string" == typeof(d = e[l][h]) && "=" === d.charAt(1) ? n[h] + Number(d.charAt(0) + d.substr(2)) : Number(d), g && l > 1 && c - 1 > l && (a[p++] = (r + a[p - 2]) / 2), a[p++] = r;
for (c = p - m + 1, p = 0, l = 0; c > l; l += m) r = a[l], i = a[l + 1], s = a[l + 2], u = 2 === m ? 0 : a[l + 3], a[p++] = d = 3 === m ? new o(r, i, s, u) : new o(r, (2 * i + r) / 3, (2 * i + s) / 3, s);
a.length = p
}
return v
},
p = function(e, t, n) {
for (var r, i, s, o, u, a, f, l, c, h, p, d = 1 / n, v = e.length; --v > -1;)
for (h = e[v], s = h.a, o = h.d - s, u = h.c - s, a = h.b - s, r = i = 0, l = 1; n >= l; l++) f = d * l, c = 1 - f, r = i - (i = (f * f * o + 3 * c * (f * u + c * a)) * f), p = v * n + l - 1, t[p] = (t[p] || 0) + r * r
},
d = function(e, t) {
t = t >> 0 || 6;
var n, r, i, s, o = [],
u = [],
a = 0,
f = 0,
l = t - 1,
c = [],
h = [];
for (n in e) p(e[n], o, t);
for (i = o.length, r = 0; i > r; r++) a += Math.sqrt(o[r]), s = r % t, h[s] = a, s === l && (f += a, s = r / t >> 0, c[s] = h, u[s] = f, a = 0, h = []);
return {
length: f,
lengths: u,
segments: c
}
},
v = _gsScope._gsDefine.plugin({
propName: "bezier",
priority: -1,
version: "1.3.4",
API: 2,
global: !0,
init: function(e, t, n) {
this._target = e, t instanceof Array && (t = {
values: t
}), this._func = {}, this._round = {}, this._props = [], this._timeRes = null == t.timeResolution ? 6 : parseInt(t.timeResolution, 10);
var r, i, s, o, u, a = t.values || [],
f = {},
l = a[0],
p = t.autoRotate || n.vars.orientToBezier;
this._autoRotate = p ? p instanceof Array ? p : [
["x", "y", "rotation", p === !0 ? 0 : Number(p) || 0]
] : null;
for (r in l) this._props.push(r);
for (s = this._props.length; --s > -1;) r = this._props[s], this._overwriteProps.push(r), i = this._func[r] = "function" == typeof e[r], f[r] = i ? e[r.indexOf("set") || "function" != typeof e["get" + r.substr(3)] ? r : "get" + r.substr(3)]() : parseFloat(e[r]), u || f[r] !== a[0][r] && (u = f);
if (this._beziers = "cubic" !== t.type && "quadratic" !== t.type && "soft" !== t.type ? c(a, isNaN(t.curviness) ? 1 : t.curviness, !1, "thruBasic" === t.type, t.correlate, u) : h(a, t.type, f), this._segCount = this._beziers[r].length, this._timeRes) {
var v = d(this._beziers, this._timeRes);
this._length = v.length, this._lengths = v.lengths, this._segments = v.segments, this._l1 = this._li = this._s1 = this._si = 0, this._l2 = this._lengths[0], this._curSeg = this._segments[0], this._s2 = this._curSeg[0], this._prec = 1 / this._curSeg.length
}
if (p = this._autoRotate)
for (this._initialRotations = [], p[0] instanceof Array || (this._autoRotate = p = [p]), s = p.length; --s > -1;) {
for (o = 0; 3 > o; o++) r = p[s][o], this._func[r] = "function" == typeof e[r] ? e[r.indexOf("set") || "function" != typeof e["get" + r.substr(3)] ? r : "get" + r.substr(3)] : !1;
r = p[s][2], this._initialRotations[s] = this._func[r] ? this._func[r].call(this._target) : this._target[r]
}
return this._startRatio = n.vars.runBackwards ? 1 : 0, !0
},
set: function(t) {
var n, r, i, s, o, u, a, f, l, c, h = this._segCount,
p = this._func,
d = this._target,
v = t !== this._startRatio;
if (this._timeRes) {
if (l = this._lengths, c = this._curSeg, t *= this._length, i = this._li, t > this._l2 && h - 1 > i) {
for (f = h - 1; f > i && t >= (this._l2 = l[++i]););
this._l1 = l[i - 1], this._li = i, this._curSeg = c = this._segments[i], this._s2 = c[this._s1 = this._si = 0]
} else if (this._l1 > t && i > 0) {
for (; i > 0 && (this._l1 = l[--i]) >= t;);
0 === i && this._l1 > t ? this._l1 = 0 : i++, this._l2 = l[i], this._li = i, this._curSeg = c = this._segments[i], this._s1 = c[(this._si = c.length - 1) - 1] || 0, this._s2 = c[this._si]
}
if (n = i, t -= this._l1, i = this._si, t > this._s2 && c.length - 1 > i) {
for (f = c.length - 1; f > i && t >= (this._s2 = c[++i]););
this._s1 = c[i - 1], this._si = i
} else if (this._s1 > t && i > 0) {
for (; i > 0 && (this._s1 = c[--i]) >= t;);
0 === i && this._s1 > t ? this._s1 = 0 : i++, this._s2 = c[i], this._si = i
}
u = (i + (t - this._s1) / (this._s2 - this._s1)) * this._prec
} else n = 0 > t ? 0 : t >= 1 ? h - 1 : h * t >> 0, u = (t - n * (1 / h)) * h;
for (r = 1 - u, i = this._props.length; --i > -1;) s = this._props[i], o = this._beziers[s][n], a = (u * u * o.da + 3 * r * (u * o.ca + r * o.ba)) * u + o.a, this._round[s] && (a = Math.round(a)), p[s] ? d[s](a) : d[s] = a;
if (this._autoRotate) {
var m, g, y, b, w, E, S, x = this._autoRotate;
for (i = x.length; --i > -1;) s = x[i][2], E = x[i][3] || 0, S = x[i][4] === !0 ? 1 : e, o = this._beziers[x[i][0]], m = this._beziers[x[i][1]], o && m && (o = o[n], m = m[n], g = o.a + (o.b - o.a) * u, b = o.b + (o.c - o.b) * u, g += (b - g) * u, b += (o.c + (o.d - o.c) * u - b) * u, y = m.a + (m.b - m.a) * u, w = m.b + (m.c - m.b) * u, y += (w - y) * u, w += (m.c + (m.d - m.c) * u - w) * u, a = v ? Math.atan2(w - y, b - g) * S + E : this._initialRotations[i], p[s] ? d[s](a) : d[s] = a)
}
}
}),
m = v.prototype;
v.bezierThrough = c, v.cubicToQuadratic = a, v._autoCSS = !0, v.quadraticToCubic = function(e, t, n) {
return new o(e, (2 * t + e) / 3, (2 * t + n) / 3, n)
}, v._cssRegister = function() {
var e = s.CSSPlugin;
if (e) {
var t = e._internals,
n = t._parseToProxy,
r = t._setPluginRatio,
i = t.CSSPropTween;
t._registerComplexSpecialProp("bezier", {
parser: function(e, t, s, o, u, a) {
t instanceof Array && (t = {
values: t
}), a = new v;
var f, l, c, h = t.values,
p = h.length - 1,
d = [],
m = {};
if (0 > p) return u;
for (f = 0; p >= f; f++) c = n(e, h[f], o, u, a, p !== f), d[f] = c.end;
for (l in t) m[l] = t[l];
return m.values = d, u = new i(e, "bezier", 0, 0, c.pt, 2), u.data = c, u.plugin = a, u.setRatio = r, 0 === m.autoRotate && (m.autoRotate = !0), !m.autoRotate || m.autoRotate instanceof Array || (f = m.autoRotate === !0 ? 0 : Number(m.autoRotate), m.autoRotate = null != c.end.left ? [
["left", "top", "rotation", f, !1]
] : null != c.end.x ? [
["x", "y", "rotation", f, !1]
] : !1), m.autoRotate && (o._transform || o._enableTransforms(!1), c.autoRotate = o._target._gsTransform), a._onInitTween(c.proxy, m, o._tween), u
}
})
}
}, m._roundProps = function(e, t) {
for (var n = this._overwriteProps, r = n.length; --r > -1;)(e[n[r]] || e.bezier || e.bezierThrough) && (this._round[n[r]] = t)
}, m._kill = function(e) {
var t, n, r = this._props;
for (t in this._beziers)
if (t in e)
for (delete this._beziers[t], delete this._func[t], n = r.length; --n > -1;) r[n] === t && r.splice(n, 1);
return this._super._kill.call(this, e)
}
}(), _gsScope._gsDefine("plugins.CSSPlugin", ["plugins.TweenPlugin", "TweenLite"], function(e, t) {
var n, r, i, s, o = function() {
e.call(this, "css"), this._overwriteProps.length = 0, this.setRatio = o.prototype.setRatio
},
u = _gsScope._gsDefine.globals,
a = {},
f = o.prototype = new e("css");
f.constructor = o, o.version = "1.15.1", o.API = 2, o.defaultTransformPerspective = 0, o.defaultSkewType = "compensated", f = "px", o.suffixMap = {
top: f,
right: f,
bottom: f,
left: f,
width: f,
height: f,
fontSize: f,
padding: f,
margin: f,
perspective: f,
lineHeight: ""
};
var l, c, h, p, d, v, m = /(?:\d|\-\d|\.\d|\-\.\d)+/g,
g = /(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,
y = /(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,
b = /(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g,
w = /(?:\d|\-|\+|=|#|\.)*/g,
E = /opacity *= *([^)]*)/i,
S = /opacity:([^;]*)/i,
x = /alpha\(opacity *=.+?\)/i,
T = /^(rgb|hsl)/,
N = /([A-Z])/g,
C = /-([a-z])/gi,
k = /(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,
L = function(e, t) {
return t.toUpperCase()
},
A = /(?:Left|Right|Width)/i,
O = /(M11|M12|M21|M22)=[\d\-\.e]+/gi,
M = /progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,
_ = /,(?=[^\)]*(?:\(|$))/gi,
D = Math.PI / 180,
P = 180 / Math.PI,
H = {},
B = document,
j = function(e) {
return B.createElementNS ? B.createElementNS("http://www.w3.org/1999/xhtml", e) : B.createElement(e)
},
F = j("div"),
I = j("img"),
q = o._internals = {
_specialProps: a
},
R = navigator.userAgent,
U = function() {
var e = R.indexOf("Android"),
t = j("a");
return h = -1 !== R.indexOf("Safari") && -1 === R.indexOf("Chrome") && (-1 === e || Number(R.substr(e + 8, 1)) > 3), d = h && 6 > Number(R.substr(R.indexOf("Version/") + 8, 1)), p = -1 !== R.indexOf("Firefox"), (/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R) || /Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R)) && (v = parseFloat(RegExp.$1)), t ? (t.style.cssText = "top:1px;opacity:.55;", /^0.55/.test(t.style.opacity)) : !1
}(),
z = function(e) {
return E.test("string" == typeof e ? e : (e.currentStyle ? e.currentStyle.filter : e.style.filter) || "") ? parseFloat(RegExp.$1) / 100 : 1
},
W = function(e) {
window.console && console.log(e)
},
X = "",
V = "",
$ = function(e, t) {
t = t || F;
var n, r, i = t.style;
if (void 0 !== i[e]) return e;
for (e = e.charAt(0).toUpperCase() + e.substr(1), n = ["O", "Moz", "ms", "Ms", "Webkit"], r = 5; --r > -1 && void 0 === i[n[r] + e];);
return r >= 0 ? (V = 3 === r ? "ms" : n[r], X = "-" + V.toLowerCase() + "-", V + e) : null
},
J = B.defaultView ? B.defaultView.getComputedStyle : function() {},
K = o.getStyle = function(e, t, n, r, i) {
var s;
return U || "opacity" !== t ? (!r && e.style[t] ? s = e.style[t] : (n = n || J(e)) ? s = n[t] || n.getPropertyValue(t) || n.getPropertyValue(t.replace(N, "-$1").toLowerCase()) : e.currentStyle && (s = e.currentStyle[t]), null == i || s && "none" !== s && "auto" !== s && "auto auto" !== s ? s : i) : z(e)
},
Q = q.convertToPixels = function(e, n, r, i, s) {
if ("px" === i || !i) return r;
if ("auto" === i || !r) return 0;
var u, a, f, l = A.test(n),
c = e,
h = F.style,
p = 0 > r;
if (p && (r = -r), "%" === i && -1 !== n.indexOf("border")) u = r / 100 * (l ? e.clientWidth : e.clientHeight);
else {
if (h.cssText = "border:0 solid red;position:" + K(e, "position") + ";line-height:0;", "%" !== i && c.appendChild) h[l ? "borderLeftWidth" : "borderTopWidth"] = r + i;
else {
if (c = e.parentNode || B.body, a = c._gsCache, f = t.ticker.frame, a && l && a.time === f) return a.width * r / 100;
h[l ? "width" : "height"] = r + i
}
c.appendChild(F), u = parseFloat(F[l ? "offsetWidth" : "offsetHeight"]), c.removeChild(F), l && "%" === i && o.cacheWidths !== !1 && (a = c._gsCache = c._gsCache || {}, a.time = f, a.width = 100 * (u / r)), 0 !== u || s || (u = Q(e, n, r, i, !0))
}
return p ? -u : u
},
G = q.calculateOffset = function(e, t, n) {
if ("absolute" !== K(e, "position", n)) return 0;
var r = "left" === t ? "Left" : "Top",
i = K(e, "margin" + r, n);
return e["offset" + r] - (Q(e, t, parseFloat(i), i.replace(w, "")) || 0)
},
Y = function(e, t) {
var n, r, i = {};
if (t = t || J(e, null))
for (n in t)(-1 === n.indexOf("Transform") || St === n) && (i[n] = t[n]);
else if (t = e.currentStyle || e.style)
for (n in t) "string" == typeof n && void 0 === i[n] && (i[n.replace(C, L)] = t[n]);
return U || (i.opacity = z(e)), r = _t(e, t, !1), i.rotation = r.rotation, i.skewX = r.skewX, i.scaleX = r.scaleX, i.scaleY = r.scaleY, i.x = r.x, i.y = r.y, Nt && (i.z = r.z, i.rotationX = r.rotationX, i.rotationY = r.rotationY, i.scaleZ = r.scaleZ), i.filters && delete i.filters, i
},
Z = function(e, t, n, r, i) {
var s, o, u, a = {},
f = e.style;
for (o in n) "cssText" !== o && "length" !== o && isNaN(o) && (t[o] !== (s = n[o]) || i && i[o]) && -1 === o.indexOf("Origin") && ("number" == typeof s || "string" == typeof s) && (a[o] = "auto" !== s || "left" !== o && "top" !== o ? "" !== s && "auto" !== s && "none" !== s || "string" != typeof t[o] || "" === t[o].replace(b, "") ? s : 0 : G(e, o), void 0 !== f[o] && (u = new pt(f, o, f[o], u)));
if (r)
for (o in r) "className" !== o && (a[o] = r[o]);
return {
difs: a,
firstMPT: u
}
},
et = {
width: ["Left", "Right"],
height: ["Top", "Bottom"]
},
tt = ["marginLeft", "marginRight", "marginTop", "marginBottom"],
nt = function(e, t, n) {
var r = parseFloat("width" === t ? e.offsetWidth : e.offsetHeight),
i = et[t],
s = i.length;
for (n = n || J(e, null); --s > -1;) r -= parseFloat(K(e, "padding" + i[s], n, !0)) || 0, r -= parseFloat(K(e, "border" + i[s] + "Width", n, !0)) || 0;
return r
},
rt = function(e, t) {
(null == e || "" === e || "auto" === e || "auto auto" === e) && (e = "0 0");
var n = e.split(" "),
r = -1 !== e.indexOf("left") ? "0%" : -1 !== e.indexOf("right") ? "100%" : n[0],
i = -1 !== e.indexOf("top") ? "0%" : -1 !== e.indexOf("bottom") ? "100%" : n[1];
return null == i ? i = "center" === r ? "50%" : "0" : "center" === i && (i = "50%"), ("center" === r || isNaN(parseFloat(r)) && -1 === (r + "").indexOf("=")) && (r = "50%"), t && (t.oxp = -1 !== r.indexOf("%"), t.oyp = -1 !== i.indexOf("%"), t.oxr = "=" === r.charAt(1), t.oyr = "=" === i.charAt(1), t.ox = parseFloat(r.replace(b, "")), t.oy = parseFloat(i.replace(b, ""))), r + " " + i + (n.length > 2 ? " " + n[2] : "")
},
it = function(e, t) {
return "string" == typeof e && "=" === e.charAt(1) ? parseInt(e.charAt(0) + "1", 10) * parseFloat(e.substr(2)) : parseFloat(e) - parseFloat(t)
},
st = function(e, t) {
return null == e ? t : "string" == typeof e && "=" === e.charAt(1) ? parseInt(e.charAt(0) + "1", 10) * parseFloat(e.substr(2)) + t : parseFloat(e)
},
ot = function(e, t, n, r) {
var i, s, o, u, a, f = 1e-6;
return null == e ? u = t : "number" == typeof e ? u = e : (i = 360, s = e.split("_"), a = "=" === e.charAt(1), o = (a ? parseInt(e.charAt(0) + "1", 10) * parseFloat(s[0].substr(2)) : parseFloat(s[0])) * (-1 === e.indexOf("rad") ? 1 : P) - (a ? 0 : t), s.length && (r && (r[n] = t + o), -1 !== e.indexOf("short") && (o %= i, o !== o % (i / 2) && (o = 0 > o ? o + i : o - i)), -1 !== e.indexOf("_cw") && 0 > o ? o = (o + 9999999999 * i) % i - (0 | o / i) * i : -1 !== e.indexOf("ccw") && o > 0 && (o = (o - 9999999999 * i) % i - (0 | o / i) * i)), u = t + o), f > u && u > -f && (u = 0), u
},
ut = {
aqua: [0, 255, 255],
lime: [0, 255, 0],
silver: [192, 192, 192],
black: [0, 0, 0],
maroon: [128, 0, 0],
teal: [0, 128, 128],
blue: [0, 0, 255],
navy: [0, 0, 128],
white: [255, 255, 255],
fuchsia: [255, 0, 255],
olive: [128, 128, 0],
yellow: [255, 255, 0],
orange: [255, 165, 0],
gray: [128, 128, 128],
purple: [128, 0, 128],
green: [0, 128, 0],
red: [255, 0, 0],
pink: [255, 192, 203],
cyan: [0, 255, 255],
transparent: [255, 255, 255, 0]
},
at = function(e, t, n) {
return e = 0 > e ? e + 1 : e > 1 ? e - 1 : e, 0 | 255 * (1 > 6 * e ? t + 6 * (n - t) * e : .5 > e ? n : 2 > 3 * e ? t + 6 * (n - t) * (2 / 3 - e) : t) + .5
},
ft = o.parseColor = function(e) {
var t, n, r, i, s, o;
return e && "" !== e ? "number" == typeof e ? [e >> 16, 255 & e >> 8, 255 & e] : ("," === e.charAt(e.length - 1) && (e = e.substr(0, e.length - 1)), ut[e] ? ut[e] : "#" === e.charAt(0) ? (4 === e.length && (t = e.charAt(1), n = e.charAt(2), r = e.charAt(3), e = "#" + t + t + n + n + r + r), e = parseInt(e.substr(1), 16), [e >> 16, 255 & e >> 8, 255 & e]) : "hsl" === e.substr(0, 3) ? (e = e.match(m), i = Number(e[0]) % 360 / 360, s = Number(e[1]) / 100, o = Number(e[2]) / 100, n = .5 >= o ? o * (s + 1) : o + s - o * s, t = 2 * o - n, e.length > 3 && (e[3] = Number(e[3])), e[0] = at(i + 1 / 3, t, n), e[1] = at(i, t, n), e[2] = at(i - 1 / 3, t, n), e) : (e = e.match(m) || ut.transparent, e[0] = Number(e[0]), e[1] = Number(e[1]), e[2] = Number(e[2]), e.length > 3 && (e[3] = Number(e[3])), e)) : ut.black
},
lt = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#.+?\\b";
for (f in ut) lt += "|" + f + "\\b";
lt = RegExp(lt + ")", "gi");
var ct = function(e, t, n, r) {
if (null == e) return function(e) {
return e
};
var i, s = t ? (e.match(lt) || [""])[0] : "",
o = e.split(s).join("").match(y) || [],
u = e.substr(0, e.indexOf(o[0])),
a = ")" === e.charAt(e.length - 1) ? ")" : "",
f = -1 !== e.indexOf(" ") ? " " : ",",
l = o.length,
c = l > 0 ? o[0].replace(m, "") : "";
return l ? i = t ? function(e) {
var t, h, p, d;
if ("number" == typeof e) e += c;
else if (r && _.test(e)) {
for (d = e.replace(_, "|").split("|"), p = 0; d.length > p; p++) d[p] = i(d[p]);
return d.join(",")
}
if (t = (e.match(lt) || [s])[0], h = e.split(t).join("").match(y) || [], p = h.length, l > p--)
for (; l > ++p;) h[p] = n ? h[0 | (p - 1) / 2] : o[p];
return u + h.join(f) + f + t + a + (-1 !== e.indexOf("inset") ? " inset" : "")
} : function(e) {
var t, s, h;
if ("number" == typeof e) e += c;
else if (r && _.test(e)) {
for (s = e.replace(_, "|").split("|"), h = 0; s.length > h; h++) s[h] = i(s[h]);
return s.join(",")
}
if (t = e.match(y) || [], h = t.length, l > h--)
for (; l > ++h;) t[h] = n ? t[0 | (h - 1) / 2] : o[h];
return u + t.join(f) + a
} : function(e) {
return e
}
},
ht = function(e) {
return e = e.split(","),
function(t, n, r, i, s, o, u) {
var a, f = (n + "").split(" ");
for (u = {}, a = 0; 4 > a; a++) u[e[a]] = f[a] = f[a] || f[(a - 1) / 2 >> 0];
return i.parse(t, u, s, o)
}
},
pt = (q._setPluginRatio = function(e) {
this.plugin.setRatio(e);
for (var t, n, r, i, s = this.data, o = s.proxy, u = s.firstMPT, a = 1e-6; u;) t = o[u.v], u.r ? t = Math.round(t) : a > t && t > -a && (t = 0), u.t[u.p] = t, u = u._next;
if (s.autoRotate && (s.autoRotate.rotation = o.rotation), 1 === e)
for (u = s.firstMPT; u;) {
if (n = u.t, n.type) {
if (1 === n.type) {
for (i = n.xs0 + n.s + n.xs1, r = 1; n.l > r; r++) i += n["xn" + r] + n["xs" + (r + 1)];
n.e = i
}
} else n.e = n.s + n.xs0;
u = u._next
}
}, function(e, t, n, r, i) {
this.t = e, this.p = t, this.v = n, this.r = i, r && (r._prev = this, this._next = r)
}),
dt = (q._parseToProxy = function(e, t, n, r, i, s) {
var o, u, a, f, l, c = r,
h = {},
p = {},
d = n._transform,
v = H;
for (n._transform = null, H = t, r = l = n.parse(e, t, r, i), H = v, s && (n._transform = d, c && (c._prev = null, c._prev && (c._prev._next = null))); r && r !== c;) {
if (1 >= r.type && (u = r.p, p[u] = r.s + r.c, h[u] = r.s, s || (f = new pt(r, "s", u, f, r.r), r.c = 0), 1 === r.type))
for (o = r.l; --o > 0;) a = "xn" + o, u = r.p + "_" + a, p[u] = r.data[a], h[u] = r[a], s || (f = new pt(r, a, u, f, r.rxp[a]));
r = r._next
}
return {
proxy: h,
end: p,
firstMPT: f,
pt: l
}
}, q.CSSPropTween = function(e, t, r, i, o, u, a, f, l, c, h) {
this.t = e, this.p = t, this.s = r, this.c = i, this.n = a || t, e instanceof dt || s.push(this.n), this.r = f, this.type = u || 0, l && (this.pr = l, n = !0), this.b = void 0 === c ? r : c, this.e = void 0 === h ? r + i : h, o && (this._next = o, o._prev = this)
}),
vt = o.parseComplex = function(e, t, n, r, i, s, o, u, a, f) {
n = n || s || "", o = new dt(e, t, 0, 0, o, f ? 2 : 1, null, !1, u, n, r), r += "";
var c, h, p, d, v, y, b, w, E, S, x, N, C = n.split(", ").join(",").split(" "),
k = r.split(", ").join(",").split(" "),
L = C.length,
A = l !== !1;
for ((-1 !== r.indexOf(",") || -1 !== n.indexOf(",")) && (C = C.join(" ").replace(_, ", ").split(" "), k = k.join(" ").replace(_, ", ").split(" "), L = C.length), L !== k.length && (C = (s || "").split(" "), L = C.length), o.plugin = a, o.setRatio = f, c = 0; L > c; c++)
if (d = C[c], v = k[c], w = parseFloat(d), w || 0 === w) o.appendXtra("", w, it(v, w), v.replace(g, ""), A && -1 !== v.indexOf("px"), !0);
else if (i && ("#" === d.charAt(0) || ut[d] || T.test(d))) N = "," === v.charAt(v.length - 1) ? ")," : ")", d = ft(d), v = ft(v), E = d.length + v.length > 6, E && !U && 0 === v[3] ? (o["xs" + o.l] += o.l ? " transparent" : "transparent", o.e = o.e.split(k[c]).join("transparent")) : (U || (E = !1), o.appendXtra(E ? "rgba(" : "rgb(", d[0], v[0] - d[0], ",", !0, !0).appendXtra("", d[1], v[1] - d[1], ",", !0).appendXtra("", d[2], v[2] - d[2], E ? "," : N, !0), E && (d = 4 > d.length ? 1 : d[3], o.appendXtra("", d, (4 > v.length ? 1 : v[3]) - d, N, !1)));
else if (y = d.match(m)) {
if (b = v.match(g), !b || b.length !== y.length) return o;
for (p = 0, h = 0; y.length > h; h++) x = y[h], S = d.indexOf(x, p), o.appendXtra(d.substr(p, S - p), Number(x), it(b[h], x), "", A && "px" === d.substr(S + x.length, 2), 0 === h), p = S + x.length;
o["xs" + o.l] += d.substr(p)
} else o["xs" + o.l] += o.l ? " " + d : d;
if (-1 !== r.indexOf("=") && o.data) {
for (N = o.xs0 + o.data.s, c = 1; o.l > c; c++) N += o["xs" + c] + o.data["xn" + c];
o.e = N + o["xs" + c]
}
return o.l || (o.type = -1, o.xs0 = o.e), o.xfirst || o
},
mt = 9;
for (f = dt.prototype, f.l = f.pr = 0; --mt > 0;) f["xn" + mt] = 0, f["xs" + mt] = "";
f.xs0 = "", f._next = f._prev = f.xfirst = f.data = f.plugin = f.setRatio = f.rxp = null, f.appendXtra = function(e, t, n, r, i, s) {
var o = this,
u = o.l;
return o["xs" + u] += s && u ? " " + e : e || "", n || 0 === u || o.plugin ? (o.l++, o.type = o.setRatio ? 2 : 1, o["xs" + o.l] = r || "", u > 0 ? (o.data["xn" + u] = t + n, o.rxp["xn" + u] = i, o["xn" + u] = t, o.plugin || (o.xfirst = new dt(o, "xn" + u, t, n, o.xfirst || o, 0, o.n, i, o.pr), o.xfirst.xs0 = 0), o) : (o.data = {
s: t + n
}, o.rxp = {}, o.s = t, o.c = n, o.r = i, o)) : (o["xs" + u] += t + (r || ""), o)
};
var gt = function(e, t) {
t = t || {}, this.p = t.prefix ? $(e) || e : e, a[e] = a[this.p] = this, this.format = t.formatter || ct(t.defaultValue, t.color, t.collapsible, t.multi), t.parser && (this.parse = t.parser), this.clrs = t.color, this.multi = t.multi, this.keyword = t.keyword, this.dflt = t.defaultValue, this.pr = t.priority || 0
},
yt = q._registerComplexSpecialProp = function(e, t, n) {
"object" != typeof t && (t = {
parser: n
});
var r, i, s = e.split(","),
o = t.defaultValue;
for (n = n || [o], r = 0; s.length > r; r++) t.prefix = 0 === r && t.prefix, t.defaultValue = n[r] || o, i = new gt(s[r], t)
},
bt = function(e) {
if (!a[e]) {
var t = e.charAt(0).toUpperCase() + e.substr(1) + "Plugin";
yt(e, {
parser: function(e, n, r, i, s, o, f) {
var l = u.com.greensock.plugins[t];
return l ? (l._cssRegister(), a[r].parse(e, n, r, i, s, o, f)) : (W("Error: " + t + " js file not loaded."), s)
}
})
}
};
f = gt.prototype, f.parseComplex = function(e, t, n, r, i, s) {
var o, u, a, f, l, c, h = this.keyword;
if (this.multi && (_.test(n) || _.test(t) ? (u = t.replace(_, "|").split("|"), a = n.replace(_, "|").split("|")) : h && (u = [t], a = [n])), a) {
for (f = a.length > u.length ? a.length : u.length, o = 0; f > o; o++) t = u[o] = u[o] || this.dflt, n = a[o] = a[o] || this.dflt, h && (l = t.indexOf(h), c = n.indexOf(h), l !== c && (n = -1 === c ? a : u, n[o] += " " + h));
t = u.join(", "), n = a.join(", ")
}
return vt(e, this.p, t, n, this.clrs, this.dflt, r, this.pr, i, s)
}, f.parse = function(e, t, n, r, s, o) {
return this.parseComplex(e.style, this.format(K(e, this.p, i, !1, this.dflt)), this.format(t), s, o)
}, o.registerSpecialProp = function(e, t, n) {
yt(e, {
parser: function(e, r, i, s, o, u) {
var a = new dt(e, i, 0, 0, o, 2, i, !1, n);
return a.plugin = u, a.setRatio = t(e, r, s._tween, i), a
},
priority: n
})
};
var wt, Et = "scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective,xPercent,yPercent".split(","),
St = $("transform"),
xt = X + "transform",
Tt = $("transformOrigin"),
Nt = null !== $("perspective"),
Ct = q.Transform = function() {
this.perspective = parseFloat(o.defaultTransformPerspective) || 0, this.force3D = o.defaultForce3D !== !1 && Nt ? o.defaultForce3D || "auto" : !1
},
kt = window.SVGElement,
Lt = function(e, t, n) {
var r, i = B.createElementNS("http://www.w3.org/2000/svg", e),
s = /([a-z])([A-Z])/g;
for (r in n) i.setAttributeNS(null, r.replace(s, "$1-$2").toLowerCase(), n[r]);
return t.appendChild(i), i
},
At = document.documentElement,
Ot = function() {
var e, t, n, r = v || /Android/i.test(R) && !window.chrome;
return B.createElementNS && !r && (e = Lt("svg", At), t = Lt("rect", e, {
width: 100,
height: 50,
x: 100
}), n = t.getBoundingClientRect().width, t.style[Tt] = "50% 50%", t.style[St] = "scaleX(0.5)", r = n === t.getBoundingClientRect().width && (!p || !Nt), At.removeChild(e)), r
}(),
Mt = function(e, t, n) {
var r = e.getBBox();
t = rt(t).split(" "), n.xOrigin = (-1 !== t[0].indexOf("%") ? parseFloat(t[0]) / 100 * r.width : parseFloat(t[0])) + r.x, n.yOrigin = (-1 !== t[1].indexOf("%") ? parseFloat(t[1]) / 100 * r.height : parseFloat(t[1])) + r.y
},
_t = q.getTransform = function(e, t, n, r) {
if (e._gsTransform && n && !r) return e._gsTransform;
var s, u, a, f, l, c, h, p, d, v, m = n ? e._gsTransform || new Ct : new Ct,
g = 0 > m.scaleX,
y = 2e-5,
b = 1e5,
w = Nt ? parseFloat(K(e, Tt, t, !1, "0 0 0").split(" ")[2]) || m.zOrigin || 0 : 0,
E = parseFloat(o.defaultTransformPerspective) || 0;
if (St ? u = K(e, xt, t, !0) : e.currentStyle && (u = e.currentStyle.filter.match(O), u = u && 4 === u.length ? [u[0].substr(4), Number(u[2].substr(4)), Number(u[1].substr(4)), u[3].substr(4), m.x || 0, m.y || 0].join(",") : ""), s = !u || "none" === u || "matrix(1, 0, 0, 1, 0, 0)" === u, m.svg = !!(kt && "function" == typeof e.getBBox && e.getCTM && (!e.parentNode || e.parentNode.getBBox && e.parentNode.getCTM)), m.svg && (Mt(e, K(e, Tt, i, !1, "50% 50%") + "", m), wt = o.useSVGTransformAttr || Ot, a = e.getAttribute("transform"), s && a && -1 !== a.indexOf("matrix") && (u = a, s = 0)), !s) {
for (a = (u || "").match(/(?:\-|\b)[\d\-\.e]+\b/gi) || [], f = a.length; --f > -1;) l = Number(a[f]), a[f] = (c = l - (l |= 0)) ? (0 | c * b + (0 > c ? -0.5 : .5)) / b + l : l;
if (16 === a.length) {
var S, x, T, N, C, k = a[0],
L = a[1],
A = a[2],
M = a[3],
_ = a[4],
D = a[5],
H = a[6],
B = a[7],
j = a[8],
F = a[9],
I = a[10],
q = a[12],
R = a[13],
U = a[14],
z = a[11],
W = Math.atan2(H, I);
m.zOrigin && (U = -m.zOrigin, q = j * U - a[12], R = F * U - a[13], U = I * U + m.zOrigin - a[14]), m.rotationX = W * P, W && (N = Math.cos(-W), C = Math.sin(-W), S = _ * N + j * C, x = D * N + F * C, T = H * N + I * C, j = _ * -C + j * N, F = D * -C + F * N, I = H * -C + I * N, z = B * -C + z * N, _ = S, D = x, H = T), W = Math.atan2(j, I), m.rotationY = W * P, W && (N = Math.cos(-W), C = Math.sin(-W), S = k * N - j * C, x = L * N - F * C, T = A * N - I * C, F = L * C + F * N, I = A * C + I * N, z = M * C + z * N, k = S, L = x, A = T), W = Math.atan2(L, k), m.rotation = W * P, W && (N = Math.cos(-W), C = Math.sin(-W), k = k * N + _ * C, x = L * N + D * C, D = L * -C + D * N, H = A * -C + H * N, L = x), m.rotationX && Math.abs(m.rotationX) + Math.abs(m.rotation) > 359.9 && (m.rotationX = m.rotation = 0, m.rotationY += 180), m.scaleX = (0 | Math.sqrt(k * k + L * L) * b + .5) / b, m.scaleY = (0 | Math.sqrt(D * D + F * F) * b + .5) / b, m.scaleZ = (0 | Math.sqrt(H * H + I * I) * b + .5) / b, m.skewX = 0, m.perspective = z ? 1 / (0 > z ? -z : z) : 0, m.x = q, m.y = R, m.z = U
} else if (!(Nt && !r && a.length && m.x === a[4] && m.y === a[5] && (m.rotationX || m.rotationY) || void 0 !== m.x && "none" === K(e, "display", t))) {
var X = a.length >= 6,
V = X ? a[0] : 1,
$ = a[1] || 0,
J = a[2] || 0,
Q = X ? a[3] : 1;
m.x = a[4] || 0, m.y = a[5] || 0, h = Math.sqrt(V * V + $ * $), p = Math.sqrt(Q * Q + J * J), d = V || $ ? Math.atan2($, V) * P : m.rotation || 0, v = J || Q ? Math.atan2(J, Q) * P + d : m.skewX || 0, Math.abs(v) > 90 && 270 > Math.abs(v) && (g ? (h *= -1, v += 0 >= d ? 180 : -180, d += 0 >= d ? 180 : -180) : (p *= -1, v += 0 >= v ? 180 : -180)), m.scaleX = h, m.scaleY = p, m.rotation = d, m.skewX = v, Nt && (m.rotationX = m.rotationY = m.z = 0, m.perspective = E, m.scaleZ = 1)
}
m.zOrigin = w;
for (f in m) y > m[f] && m[f] > -y && (m[f] = 0)
}
return n && (e._gsTransform = m), m
},
Dt = function(e) {
var t, n, r = this.data,
i = -r.rotation * D,
s = i + r.skewX * D,
o = 1e5,
u = (0 | Math.cos(i) * r.scaleX * o) / o,
a = (0 | Math.sin(i) * r.scaleX * o) / o,
f = (0 | Math.sin(s) * -r.scaleY * o) / o,
l = (0 | Math.cos(s) * r.scaleY * o) / o,
c = this.t.style,
h = this.t.currentStyle;
if (h) {
n = a, a = -f, f = -n, t = h.filter, c.filter = "";
var p, d, m = this.t.offsetWidth,
g = this.t.offsetHeight,
y = "absolute" !== h.position,
b = "progid:DXImageTransform.Microsoft.Matrix(M11=" + u + ", M12=" + a + ", M21=" + f + ", M22=" + l,
S = r.x + m * r.xPercent / 100,
x = r.y + g * r.yPercent / 100;
if (null != r.ox && (p = (r.oxp ? .01 * m * r.ox : r.ox) - m / 2, d = (r.oyp ? .01 * g * r.oy : r.oy) - g / 2, S += p - (p * u + d * a), x += d - (p * f + d * l)), y ? (p = m / 2, d = g / 2, b += ", Dx=" + (p - (p * u + d * a) + S) + ", Dy=" + (d - (p * f + d * l) + x) + ")") : b += ", sizingMethod='auto expand')", c.filter = -1 !== t.indexOf("DXImageTransform.Microsoft.Matrix(") ? t.replace(M, b) : b + " " + t, (0 === e || 1 === e) && 1 === u && 0 === a && 0 === f && 1 === l && (y && -1 === b.indexOf("Dx=0, Dy=0") || E.test(t) && 100 !== parseFloat(RegExp.$1) || -1 === t.indexOf(t.indexOf("Alpha")) && c.removeAttribute("filter")), !y) {
var T, N, C, k = 8 > v ? 1 : -1;
for (p = r.ieOffsetX || 0, d = r.ieOffsetY || 0, r.ieOffsetX = Math.round((m - ((0 > u ? -u : u) * m + (0 > a ? -a : a) * g)) / 2 + S), r.ieOffsetY = Math.round((g - ((0 > l ? -l : l) * g + (0 > f ? -f : f) * m)) / 2 + x), mt = 0; 4 > mt; mt++) N = tt[mt], T = h[N], n = -1 !== T.indexOf("px") ? parseFloat(T) : Q(this.t, N, parseFloat(T), T.replace(w, "")) || 0, C = n !== r[N] ? 2 > mt ? -r.ieOffsetX : -r.ieOffsetY : 2 > mt ? p - r.ieOffsetX : d - r.ieOffsetY, c[N] = (r[N] = Math.round(n - C * (0 === mt || 2 === mt ? 1 : k))) + "px"
}
}
},
Pt = q.set3DTransformRatio = function(e) {
var t, n, r, i, s, o, u, a, f, l, c, h, d, v, m, g, y, b, w, E, S, x = this.data,
T = this.t.style,
N = x.rotation * D,
C = x.scaleX,
k = x.scaleY,
L = x.scaleZ,
A = x.x,
O = x.y,
M = x.z,
_ = x.perspective;
if (!(1 !== e && 0 !== e && x.force3D || x.force3D === !0 || x.rotationY || x.rotationX || 1 !== L || _ || M)) return Ht.call(this, e), void 0;
if (p && (v = 1e-4, v > C && C > -v && (C = L = 2e-5), v > k && k > -v && (k = L = 2e-5), !_ || x.z || x.rotationX || x.rotationY || (_ = 0)), N || x.skewX) m = t = Math.cos(N), g = i = Math.sin(N), x.skewX && (N -= x.skewX * D, m = Math.cos(N), g = Math.sin(N), "simple" === x.skewType && (y = Math.tan(x.skewX * D), y = Math.sqrt(1 + y * y), m *= y, g *= y)), n = -g, s = m;
else {
if (!(x.rotationY || x.rotationX || 1 !== L || _ || x.svg)) return T[St] = (x.xPercent || x.yPercent ? "translate(" + x.xPercent + "%," + x.yPercent + "%) translate3d(" : "translate3d(") + A + "px," + O + "px," + M + "px)" + (1 !== C || 1 !== k ? " scale(" + C + "," + k + ")" : ""), void 0;
t = s = 1, n = i = 0
}
f = 1, r = o = u = a = l = c = 0, h = _ ? -1 / _ : 0, d = x.zOrigin, v = 1e-6, E = ",", S = "0", N = x.rotationY * D, N && (m = Math.cos(N), g = Math.sin(N), u = -g, l = h * -g, r = t * g, o = i * g, f = m, h *= m, t *= m, i *= m), N = x.rotationX * D, N && (m = Math.cos(N), g = Math.sin(N), y = n * m + r * g, b = s * m + o * g, a = f * g, c = h * g, r = n * -g + r * m, o = s * -g + o * m, f *= m, h *= m, n = y, s = b), 1 !== L && (r *= L, o *= L, f *= L, h *= L), 1 !== k && (n *= k, s *= k, a *= k, c *= k), 1 !== C && (t *= C, i *= C, u *= C, l *= C), (d || x.svg) && (d && (A += r * -d, O += o * -d, M += f * -d + d), x.svg && (A += x.xOrigin - (x.xOrigin * t + x.yOrigin * n), O += x.yOrigin - (x.xOrigin * i + x.yOrigin * s)), v > A && A > -v && (A = S), v > O && O > -v && (O = S), v > M && M > -v && (M = 0)), w = x.xPercent || x.yPercent ? "translate(" + x.xPercent + "%," + x.yPercent + "%) matrix3d(" : "matrix3d(", w += (v > t && t > -v ? S : t) + E + (v > i && i > -v ? S : i) + E + (v > u && u > -v ? S : u), w += E + (v > l && l > -v ? S : l) + E + (v > n && n > -v ? S : n) + E + (v > s && s > -v ? S : s), x.rotationX || x.rotationY ? (w += E + (v > a && a > -v ? S : a) + E + (v > c && c > -v ? S : c) + E + (v > r && r > -v ? S : r), w += E + (v > o && o > -v ? S : o) + E + (v > f && f > -v ? S : f) + E + (v > h && h > -v ? S : h) + E) : w += ",0,0,0,0,1,0,", w += A + E + O + E + M + E + (_ ? 1 + -M / _ : 1) + ")", T[St] = w
},
Ht = q.set2DTransformRatio = function(e) {
var t, n, r, i, s, o, u, a, f, l, c, h = this.data,
p = this.t,
d = p.style,
v = h.x,
m = h.y;
return !(h.rotationX || h.rotationY || h.z || h.force3D === !0 || "auto" === h.force3D && 1 !== e && 0 !== e) || h.svg && wt || !Nt ? (i = h.scaleX, s = h.scaleY, h.rotation || h.skewX || h.svg ? (t = h.rotation * D, n = t - h.skewX * D, r = 1e5, o = Math.cos(t) * i, u = Math.sin(t) * i, a = Math.sin(n) * -s, f = Math.cos(n) * s, h.svg && (v += h.xOrigin - (h.xOrigin * o + h.yOrigin * a), m += h.yOrigin - (h.xOrigin * u + h.yOrigin * f), c = 1e-6, c > v && v > -c && (v = 0), c > m && m > -c && (m = 0)), l = (0 | o * r) / r + "," + (0 | u * r) / r + "," + (0 | a * r) / r + "," + (0 | f * r) / r + "," + v + "," + m + ")", h.svg && wt ? p.setAttribute("transform", "matrix(" + l) : d[St] = (h.xPercent || h.yPercent ? "translate(" + h.xPercent + "%," + h.yPercent + "%) matrix(" : "matrix(") + l) : d[St] = (h.xPercent || h.yPercent ? "translate(" + h.xPercent + "%," + h.yPercent + "%) matrix(" : "matrix(") + i + ",0,0," + s + "," + v + "," + m + ")", void 0) : (this.setRatio = Pt, Pt.call(this, e), void 0)
};
f = Ct.prototype, f.x = f.y = f.z = f.skewX = f.skewY = f.rotation = f.rotationX = f.rotationY = f.zOrigin = f.xPercent = f.yPercent = 0, f.scaleX = f.scaleY = f.scaleZ = 1, yt("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent", {
parser: function(e, t, n, r, s, u, a) {
if (r._lastParsedTransform === a) return s;
r._lastParsedTransform = a;
var f, l, c, h, p, d, v, m = r._transform = _t(e, i, !0, a.parseTransform),
g = e.style,
y = 1e-6,
b = Et.length,
w = a,
E = {};
if ("string" == typeof w.transform && St) c = F.style, c[St] = w.transform, c.display = "block", c.position = "absolute", B.body.appendChild(F), f = _t(F, null, !1), B.body.removeChild(F);
else if ("object" == typeof w) {
if (f = {
scaleX: st(null != w.scaleX ? w.scaleX : w.scale, m.scaleX),
scaleY: st(null != w.scaleY ? w.scaleY : w.scale, m.scaleY),
scaleZ: st(w.scaleZ, m.scaleZ),
x: st(w.x, m.x),
y: st(w.y, m.y),
z: st(w.z, m.z),
xPercent: st(w.xPercent, m.xPercent),
yPercent: st(w.yPercent, m.yPercent),
perspective: st(w.transformPerspective, m.perspective)
}, v = w.directionalRotation, null != v)
if ("object" == typeof v)
for (c in v) w[c] = v[c];
else w.rotation = v;
"string" == typeof w.x && -1 !== w.x.indexOf("%") && (f.x = 0, f.xPercent = st(w.x, m.xPercent)), "string" == typeof w.y && -1 !== w.y.indexOf("%") && (f.y = 0, f.yPercent = st(w.y, m.yPercent)), f.rotation = ot("rotation" in w ? w.rotation : "shortRotation" in w ? w.shortRotation + "_short" : "rotationZ" in w ? w.rotationZ : m.rotation, m.rotation, "rotation", E), Nt && (f.rotationX = ot("rotationX" in w ? w.rotationX : "shortRotationX" in w ? w.shortRotationX + "_short" : m.rotationX || 0, m.rotationX, "rotationX", E), f.rotationY = ot("rotationY" in w ? w.rotationY : "shortRotationY" in w ? w.shortRotationY + "_short" : m.rotationY || 0, m.rotationY, "rotationY", E)), f.skewX = null == w.skewX ? m.skewX : ot(w.skewX, m.skewX), f.skewY = null == w.skewY ? m.skewY : ot(w.skewY, m.skewY), (l = f.skewY - m.skewY) && (f.skewX += l, f.rotation += l)
}
for (Nt && null != w.force3D && (m.force3D = w.force3D, d = !0), m.skewType = w.skewType || m.skewType || o.defaultSkewType, p = m.force3D || m.z || m.rotationX || m.rotationY || f.z || f.rotationX || f.rotationY || f.perspective, p || null == w.scale || (f.scaleZ = 1); --b > -1;) n = Et[b], h = f[n] - m[n], (h > y || -y > h || null != w[n] || null != H[n]) && (d = !0, s = new dt(m, n, m[n], h, s), n in E && (s.e = E[n]), s.xs0 = 0, s.plugin = u, r._overwriteProps.push(s.n));
return h = w.transformOrigin, h && m.svg && (Mt(e, rt(h), f), s = new dt(m, "xOrigin", m.xOrigin, f.xOrigin - m.xOrigin, s, -1, "transformOrigin"), s.b = m.xOrigin, s.e = s.xs0 = f.xOrigin, s = new dt(m, "yOrigin", m.yOrigin, f.yOrigin - m.yOrigin, s, -1, "transformOrigin"), s.b = m.yOrigin, s.e = s.xs0 = f.yOrigin, h = "0px 0px"), (h || Nt && p && m.zOrigin) && (St ? (d = !0, n = Tt, h = (h || K(e, n, i, !1, "50% 50%")) + "", s = new dt(g, n, 0, 0, s, -1, "transformOrigin"), s.b = g[n], s.plugin = u, Nt ? (c = m.zOrigin, h = h.split(" "), m.zOrigin = (h.length > 2 && (0 === c || "0px" !== h[2]) ? parseFloat(h[2]) : c) || 0, s.xs0 = s.e = h[0] + " " + (h[1] || "50%") + " 0px", s = new dt(m, "zOrigin", 0, 0, s, -1, s.n), s.b = c, s.xs0 = s.e = m.zOrigin) : s.xs0 = s.e = h) : rt(h + "", m)), d && (r._transformType = m.svg && wt || !p && 3 !== this._transformType ? 2 : 3), s
},
prefix: !0
}), yt("boxShadow", {
defaultValue: "0px 0px 0px 0px #999",
prefix: !0,
color: !0,
multi: !0,
keyword: "inset"
}), yt("borderRadius", {
defaultValue: "0px",
parser: function(e, t, n, s, o) {
t = this.format(t);
var u, a, f, l, c, h, p, d, v, m, g, y, b, w, E, S, x = ["borderTopLeftRadius", "borderTopRightRadius", "borderBottomRightRadius", "borderBottomLeftRadius"],
T = e.style;
for (v = parseFloat(e.offsetWidth), m = parseFloat(e.offsetHeight), u = t.split(" "), a = 0; x.length > a; a++) this.p.indexOf("border") && (x[a] = $(x[a])), c = l = K(e, x[a], i, !1, "0px"), -1 !== c.indexOf(" ") && (l = c.split(" "), c = l[0], l = l[1]), h = f = u[a], p = parseFloat(c), y = c.substr((p + "").length), b = "=" === h.charAt(1), b ? (d = parseInt(h.charAt(0) + "1", 10), h = h.substr(2), d *= parseFloat(h), g = h.substr((d + "").length - (0 > d ? 1 : 0)) || "") : (d = parseFloat(h), g = h.substr((d + "").length)), "" === g && (g = r[n] || y), g !== y && (w = Q(e, "borderLeft", p, y), E = Q(e, "borderTop", p, y), "%" === g ? (c = 100 * (w / v) + "%", l = 100 * (E / m) + "%") : "em" === g ? (S = Q(e, "borderLeft", 1, "em"), c = w / S + "em", l = E / S + "em") : (c = w + "px", l = E + "px"), b && (h = parseFloat(c) + d + g, f = parseFloat(l) + d + g)), o = vt(T, x[a], c + " " + l, h + " " + f, !1, "0px", o);
return o
},
prefix: !0,
formatter: ct("0px 0px 0px 0px", !1, !0)
}), yt("backgroundPosition", {
defaultValue: "0 0",
parser: function(e, t, n, r, s, o) {
var u, a, f, l, c, h, p = "background-position",
d = i || J(e, null),
m = this.format((d ? v ? d.getPropertyValue(p + "-x") + " " + d.getPropertyValue(p + "-y") : d.getPropertyValue(p) : e.currentStyle.backgroundPositionX + " " + e.currentStyle.backgroundPositionY) || "0 0"),
g = this.format(t);
if (-1 !== m.indexOf("%") != (-1 !== g.indexOf("%")) && (h = K(e, "backgroundImage").replace(k, ""), h && "none" !== h)) {
for (u = m.split(" "), a = g.split(" "), I.setAttribute("src", h), f = 2; --f > -1;) m = u[f], l = -1 !== m.indexOf("%"), l !== (-1 !== a[f].indexOf("%")) && (c = 0 === f ? e.offsetWidth - I.width : e.offsetHeight - I.height, u[f] = l ? parseFloat(m) / 100 * c + "px" : 100 * (parseFloat(m) / c) + "%");
m = u.join(" ")
}
return this.parseComplex(e.style, m, g, s, o)
},
formatter: rt
}), yt("backgroundSize", {
defaultValue: "0 0",
formatter: rt
}), yt("perspective", {
defaultValue: "0px",
prefix: !0
}), yt("perspectiveOrigin", {
defaultValue: "50% 50%",
prefix: !0
}), yt("transformStyle", {
prefix: !0
}), yt("backfaceVisibility", {
prefix: !0
}), yt("userSelect", {
prefix: !0
}), yt("margin", {
parser: ht("marginTop,marginRight,marginBottom,marginLeft")
}), yt("padding", {
parser: ht("paddingTop,paddingRight,paddingBottom,paddingLeft")
}), yt("clip", {
defaultValue: "rect(0px,0px,0px,0px)",
parser: function(e, t, n, r, s, o) {
var u, a, f;
return 9 > v ? (a = e.currentStyle, f = 8 > v ? " " : ",", u = "rect(" + a.clipTop + f + a.clipRight + f + a.clipBottom + f + a.clipLeft + ")", t = this.format(t).split(",").join(f)) : (u = this.format(K(e, this.p, i, !1, this.dflt)), t = this.format(t)), this.parseComplex(e.style, u, t, s, o)
}
}), yt("textShadow", {
defaultValue: "0px 0px 0px #999",
color: !0,
multi: !0
}), yt("autoRound,strictUnits", {
parser: function(e, t, n, r, i) {
return i
}
}), yt("border", {
defaultValue: "0px solid #000",
parser: function(e, t, n, r, s, o) {
return this.parseComplex(e.style, this.format(K(e, "borderTopWidth", i, !1, "0px") + " " + K(e, "borderTopStyle", i, !1, "solid") + " " + K(e, "borderTopColor", i, !1, "#000")), this.format(t), s, o)
},
color: !0,
formatter: function(e) {
var t = e.split(" ");
return t[0] + " " + (t[1] || "solid") + " " + (e.match(lt) || ["#000"])[0]
}
}), yt("borderWidth", {
parser: ht("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth")
}), yt("float,cssFloat,styleFloat", {
parser: function(e, t, n, r, i) {
var s = e.style,
o = "cssFloat" in s ? "cssFloat" : "styleFloat";
return new dt(s, o, 0, 0, i, -1, n, !1, 0, s[o], t)
}
});
var Bt = function(e) {
var t, n = this.t,
r = n.filter || K(this.data, "filter") || "",
i = 0 | this.s + this.c * e;
100 === i && (-1 === r.indexOf("atrix(") && -1 === r.indexOf("radient(") && -1 === r.indexOf("oader(") ? (n.removeAttribute("filter"), t = !K(this.data, "filter")) : (n.filter = r.replace(x, ""), t = !0)), t || (this.xn1 && (n.filter = r = r || "alpha(opacity=" + i + ")"), -1 === r.indexOf("pacity") ? 0 === i && this.xn1 || (n.filter = r + " alpha(opacity=" + i + ")") : n.filter = r.replace(E, "opacity=" + i))
};
yt("opacity,alpha,autoAlpha", {
defaultValue: "1",
parser: function(e, t, n, r, s, o) {
var u = parseFloat(K(e, "opacity", i, !1, "1")),
a = e.style,
f = "autoAlpha" === n;
return "string" == typeof t && "=" === t.charAt(1) && (t = ("-" === t.charAt(0) ? -1 : 1) * parseFloat(t.substr(2)) + u), f && 1 === u && "hidden" === K(e, "visibility", i) && 0 !== t && (u = 0), U ? s = new dt(a, "opacity", u, t - u, s) : (s = new dt(a, "opacity", 100 * u, 100 * (t - u), s), s.xn1 = f ? 1 : 0, a.zoom = 1, s.type = 2, s.b = "alpha(opacity=" + s.s + ")", s.e = "alpha(opacity=" + (s.s + s.c) + ")", s.data = e, s.plugin = o, s.setRatio = Bt), f && (s = new dt(a, "visibility", 0, 0, s, -1, null, !1, 0, 0 !== u ? "inherit" : "hidden", 0 === t ? "hidden" : "inherit"), s.xs0 = "inherit", r._overwriteProps.push(s.n), r._overwriteProps.push(n)), s
}
});
var jt = function(e, t) {
t && (e.removeProperty ? ("ms" === t.substr(0, 2) && (t = "M" + t.substr(1)), e.removeProperty(t.replace(N, "-$1").toLowerCase())) : e.removeAttribute(t))
},
Ft = function(e) {
if (this.t._gsClassPT = this, 1 === e || 0 === e) {
this.t.setAttribute("class", 0 === e ? this.b : this.e);
for (var t = this.data, n = this.t.style; t;) t.v ? n[t.p] = t.v : jt(n, t.p), t = t._next;
1 === e && this.t._gsClassPT === this && (this.t._gsClassPT = null)
} else this.t.getAttribute("class") !== this.e && this.t.setAttribute("class", this.e)
};
yt("className", {
parser: function(e, t, r, s, o, u, a) {
var f, l, c, h, p, d = e.getAttribute("class") || "",
v = e.style.cssText;
if (o = s._classNamePT = new dt(e, r, 0, 0, o, 2), o.setRatio = Ft, o.pr = -11, n = !0, o.b = d, l = Y(e, i), c = e._gsClassPT) {
for (h = {}, p = c.data; p;) h[p.p] = 1, p = p._next;
c.setRatio(1)
}
return e._gsClassPT = o, o.e = "=" !== t.charAt(1) ? t : d.replace(RegExp("\\s*\\b" + t.substr(2) + "\\b"), "") + ("+" === t.charAt(0) ? " " + t.substr(2) : ""), s._tween._duration && (e.setAttribute("class", o.e), f = Z(e, l, Y(e), a, h), e.setAttribute("class", d), o.data = f.firstMPT, e.style.cssText = v, o = o.xfirst = s.parse(e, f.difs, o, u)), o
}
});
var It = function(e) {
if ((1 === e || 0 === e) && this.data._totalTime === this.data._totalDuration && "isFromStart" !== this.data.data) {
var t, n, r, i, s = this.t.style,
o = a.transform.parse;
if ("all" === this.e) s.cssText = "", i = !0;
else
for (t = this.e.split(" ").join("").split(","), r = t.length; --r > -1;) n = t[r], a[n] && (a[n].parse === o ? i = !0 : n = "transformOrigin" === n ? Tt : a[n].p), jt(s, n);
i && (jt(s, St), this.t._gsTransform && delete this.t._gsTransform)
}
};
for (yt("clearProps", {
parser: function(e, t, r, i, s) {
return s = new dt(e, r, 0, 0, s, 2), s.setRatio = It, s.e = t, s.pr = -10, s.data = i._tween, n = !0, s
}
}), f = "bezier,throwProps,physicsProps,physics2D".split(","), mt = f.length; mt--;) bt(f[mt]);
f = o.prototype, f._firstPT = f._lastParsedTransform = f._transform = null, f._onInitTween = function(e, t, u) {
if (!e.nodeType) return !1;
this._target = e, this._tween = u, this._vars = t, l = t.autoRound, n = !1, r = t.suffixMap || o.suffixMap, i = J(e, ""), s = this._overwriteProps;
var a, f, p, v, m, g, y, b, w, E = e.style;
if (c && "" === E.zIndex && (a = K(e, "zIndex", i), ("auto" === a || "" === a) && this._addLazySet(E, "zIndex", 0)), "string" == typeof t && (v = E.cssText, a = Y(e, i), E.cssText = v + ";" + t, a = Z(e, a, Y(e)).difs, !U && S.test(t) && (a.opacity = parseFloat(RegExp.$1)), t = a, E.cssText = v), this._firstPT = f = this.parse(e, t, null), this._transformType) {
for (w = 3 === this._transformType, St ? h && (c = !0, "" === E.zIndex && (y = K(e, "zIndex", i), ("auto" === y || "" === y) && this._addLazySet(E, "zIndex", 0)), d && this._addLazySet(E, "WebkitBackfaceVisibility", this._vars.WebkitBackfaceVisibility || (w ? "visible" : "hidden"))) : E.zoom = 1, p = f; p && p._next;) p = p._next;
b = new dt(e, "transform", 0, 0, null, 2), this._linkCSSP(b, null, p), b.setRatio = w && Nt ? Pt : St ? Ht : Dt, b.data = this._transform || _t(e, i, !0), s.pop()
}
if (n) {
for (; f;) {
for (g = f._next, p = v; p && p.pr > f.pr;) p = p._next;
(f._prev = p ? p._prev : m) ? f._prev._next = f: v = f, (f._next = p) ? p._prev = f : m = f, f = g
}
this._firstPT = v
}
return !0
}, f.parse = function(e, t, n, s) {
var o, u, f, c, h, p, d, v, m, g, y = e.style;
for (o in t) p = t[o], u = a[o], u ? n = u.parse(e, p, o, this, n, s, t) : (h = K(e, o, i) + "", m = "string" == typeof p, "color" === o || "fill" === o || "stroke" === o || -1 !== o.indexOf("Color") || m && T.test(p) ? (m || (p = ft(p), p = (p.length > 3 ? "rgba(" : "rgb(") + p.join(",") + ")"), n = vt(y, o, h, p, !0, "transparent", n, 0, s)) : !m || -1 === p.indexOf(" ") && -1 === p.indexOf(",") ? (f = parseFloat(h), d = f || 0 === f ? h.substr((f + "").length) : "", ("" === h || "auto" === h) && ("width" === o || "height" === o ? (f = nt(e, o, i), d = "px") : "left" === o || "top" === o ? (f = G(e, o, i), d = "px") : (f = "opacity" !== o ? 0 : 1, d = "")), g = m && "=" === p.charAt(1), g ? (c = parseInt(p.charAt(0) + "1", 10), p = p.substr(2), c *= parseFloat(p), v = p.replace(w, "")) : (c = parseFloat(p), v = m ? p.replace(w, "") : ""), "" === v && (v = o in r ? r[o] : d), p = c || 0 === c ? (g ? c + f : c) + v : t[o], d !== v && "" !== v && (c || 0 === c) && f && (f = Q(e, o, f, d), "%" === v ? (f /= Q(e, o, 100, "%") / 100, t.strictUnits !== !0 && (h = f + "%")) : "em" === v ? f /= Q(e, o, 1, "em") : "px" !== v && (c = Q(e, o, c, v), v = "px"), g && (c || 0 === c) && (p = c + f + v)), g && (c += f), !f && 0 !== f || !c && 0 !== c ? void 0 !== y[o] && (p || "NaN" != p + "" && null != p) ? (n = new dt(y, o, c || f || 0, 0, n, -1, o, !1, 0, h, p), n.xs0 = "none" !== p || "display" !== o && -1 === o.indexOf("Style") ? p : h) : W("invalid " + o + " tween value: " + t[o]) : (n = new dt(y, o, f, c - f, n, 0, o, l !== !1 && ("px" === v || "zIndex" === o), 0, h, p), n.xs0 = v)) : n = vt(y, o, h, p, !0, null, n, 0, s)), s && n && !n.plugin && (n.plugin = s);
return n
}, f.setRatio = function(e) {
var t, n, r, i = this._firstPT,
s = 1e-6;
if (1 !== e || this._tween._time !== this._tween._duration && 0 !== this._tween._time)
if (e || this._tween._time !== this._tween._duration && 0 !== this._tween._time || this._tween._rawPrevTime === -0.000001)
for (; i;) {
if (t = i.c * e + i.s, i.r ? t = Math.round(t) : s > t && t > -s && (t = 0), i.type)
if (1 === i.type)
if (r = i.l, 2 === r) i.t[i.p] = i.xs0 + t + i.xs1 + i.xn1 + i.xs2;
else if (3 === r) i.t[i.p] = i.xs0 + t + i.xs1 + i.xn1 + i.xs2 + i.xn2 + i.xs3;
else if (4 === r) i.t[i.p] = i.xs0 + t + i.xs1 + i.xn1 + i.xs2 + i.xn2 + i.xs3 + i.xn3 + i.xs4;
else if (5 === r) i.t[i.p] = i.xs0 + t + i.xs1 + i.xn1 + i.xs2 + i.xn2 + i.xs3 + i.xn3 + i.xs4 + i.xn4 + i.xs5;
else {
for (n = i.xs0 + t + i.xs1, r = 1; i.l > r; r++) n += i["xn" + r] + i["xs" + (r + 1)];
i.t[i.p] = n
} else -1 === i.type ? i.t[i.p] = i.xs0 : i.setRatio && i.setRatio(e);
else i.t[i.p] = t + i.xs0;
i = i._next
} else
for (; i;) 2 !== i.type ? i.t[i.p] = i.b : i.setRatio(e), i = i._next;
else
for (; i;) 2 !== i.type ? i.t[i.p] = i.e : i.setRatio(e), i = i._next
}, f._enableTransforms = function(e) {
this._transform = this._transform || _t(this._target, i, !0), this._transformType = this._transform.svg && wt || !e && 3 !== this._transformType ? 2 : 3
};
var qt = function() {
this.t[this.p] = this.e, this.data._linkCSSP(this, this._next, null, !0)
};
f._addLazySet = function(e, t, n) {
var r = this._firstPT = new dt(e, t, 0, 0, this._firstPT, 2);
r.e = n, r.setRatio = qt, r.data = this
}, f._linkCSSP = function(e, t, n, r) {
return e && (t && (t._prev = e), e._next && (e._next._prev = e._prev), e._prev ? e._prev._next = e._next : this._firstPT === e && (this._firstPT = e._next, r = !0), n ? n._next = e : r || null !== this._firstPT || (this._firstPT = e), e._next = t, e._prev = n), e
}, f._kill = function(t) {
var n, r, i, s = t;
if (t.autoAlpha || t.alpha) {
s = {};
for (r in t) s[r] = t[r];
s.opacity = 1, s.autoAlpha && (s.visibility = 1)
}
return t.className && (n = this._classNamePT) && (i = n.xfirst, i && i._prev ? this._linkCSSP(i._prev, n._next, i._prev._prev) : i === this._firstPT && (this._firstPT = n._next), n._next && this._linkCSSP(n._next, n._next._next, i._prev), this._classNamePT = null), e.prototype._kill.call(this, s)
};
var Rt = function(e, t, n) {
var r, i, s, o;
if (e.slice)
for (i = e.length; --i > -1;) Rt(e[i], t, n);
else
for (r = e.childNodes, i = r.length; --i > -1;) s = r[i], o = s.type, s.style && (t.push(Y(s)), n && n.push(s)), 1 !== o && 9 !== o && 11 !== o || !s.childNodes.length || Rt(s, t, n)
};
return o.cascadeTo = function(e, n, r) {
var i, s, o, u = t.to(e, n, r),
a = [u],
f = [],
l = [],
c = [],
h = t._internals.reservedProps;
for (e = u._targets || u.target, Rt(e, f, c), u.render(n, !0), Rt(e, l), u.render(0, !0), u._enabled(!0), i = c.length; --i > -1;)
if (s = Z(c[i], f[i], l[i]), s.firstMPT) {
s = s.difs;
for (o in r) h[o] && (s[o] = r[o]);
a.push(t.to(c[i], n, s))
}
return a
}, e.activate([o]), o
}, !0),
function() {
var e = _gsScope._gsDefine.plugin({
propName: "roundProps",
priority: -1,
API: 2,
init: function(e, t, n) {
return this._tween = n, !0
}
}),
t = e.prototype;
t._onInitAllProps = function() {
for (var e, t, n, r = this._tween, i = r.vars.roundProps instanceof Array ? r.vars.roundProps : r.vars.roundProps.split(","), s = i.length, o = {}, u = r._propLookup.roundProps; --s > -1;) o[i[s]] = 1;
for (s = i.length; --s > -1;)
for (e = i[s], t = r._firstPT; t;) n = t._next, t.pg ? t.t._roundProps(o, !0) : t.n === e && (this._add(t.t, e, t.s, t.c), n && (n._prev = t._prev), t._prev ? t._prev._next = n : r._firstPT === t && (r._firstPT = n), t._next = t._prev = null, r._propLookup[e] = u), t = n;
return !1
}, t._add = function(e, t, n, r) {
this._addTween(e, t, n, n + r, t, !0), this._overwriteProps.push(t)
}
}(), _gsScope._gsDefine.plugin({
propName: "attr",
API: 2,
version: "0.3.3",
init: function(e, t) {
var n, r, i;
if ("function" != typeof e.setAttribute) return !1;
this._target = e, this._proxy = {}, this._start = {}, this._end = {};
for (n in t) this._start[n] = this._proxy[n] = r = e.getAttribute(n), i = this._addTween(this._proxy, n, parseFloat(r), t[n], n), this._end[n] = i ? i.s + i.c : t[n], this._overwriteProps.push(n);
return !0
},
set: function(e) {
this._super.setRatio.call(this, e);
for (var t, n = this._overwriteProps, r = n.length, i = 1 === e ? this._end : e ? this._proxy : this._start; --r > -1;) t = n[r], this._target.setAttribute(t, i[t] + "")
}
}), _gsScope._gsDefine.plugin({
propName: "directionalRotation",
version: "0.2.1",
API: 2,
init: function(e, t) {
"object" != typeof t && (t = {
rotation: t
}), this.finals = {};
var n, r, i, s, o, u, a = t.useRadians === !0 ? 2 * Math.PI : 360,
f = 1e-6;
for (n in t) "useRadians" !== n && (u = (t[n] + "").split("_"), r = u[0], i = parseFloat("function" != typeof e[n] ? e[n] : e[n.indexOf("set") || "function" != typeof e["get" + n.substr(3)] ? n : "get" + n.substr(3)]()), s = this.finals[n] = "string" == typeof r && "=" === r.charAt(1) ? i + parseInt(r.charAt(0) + "1", 10) * Number(r.substr(2)) : Number(r) || 0, o = s - i, u.length && (r = u.join("_"), -1 !== r.indexOf("short") && (o %= a, o !== o % (a / 2) && (o = 0 > o ? o + a : o - a)), -1 !== r.indexOf("_cw") && 0 > o ? o = (o + 9999999999 * a) % a - (0 | o / a) * a : -1 !== r.indexOf("ccw") && o > 0 && (o = (o - 9999999999 * a) % a - (0 | o / a) * a)), (o > f || -f > o) && (this._addTween(e, n, i, i + o, n), this._overwriteProps.push(n)));
return !0
},
set: function(e) {
var t;
if (1 !== e) this._super.setRatio.call(this, e);
else
for (t = this._firstPT; t;) t.f ? t.t[t.p](this.finals[t.p]) : t.t[t.p] = this.finals[t.p], t = t._next
}
})._autoCSS = !0, _gsScope._gsDefine("easing.Back", ["easing.Ease"], function(e) {
var t, n, r, i = _gsScope.GreenSockGlobals || _gsScope,
s = i.com.greensock,
o = 2 * Math.PI,
u = Math.PI / 2,
a = s._class,
f = function(t, n) {
var r = a("easing." + t, function() {}, !0),
i = r.prototype = new e;
return i.constructor = r, i.getRatio = n, r
},
l = e.register || function() {},
c = function(e, t, n, r) {
var i = a("easing." + e, {
easeOut: new t,
easeIn: new n,
easeInOut: new r
}, !0);
return l(i, e), i
},
h = function(e, t, n) {
this.t = e, this.v = t, n && (this.next = n, n.prev = this, this.c = n.v - t, this.gap = n.t - e)
},
p = function(t, n) {
var r = a("easing." + t, function(e) {
this._p1 = e || 0 === e ? e : 1.70158, this._p2 = 1.525 * this._p1
}, !0),
i = r.prototype = new e;
return i.constructor = r, i.getRatio = n, i.config = function(e) {
return new r(e)
}, r
},
d = c("Back", p("BackOut", function(e) {
return (e -= 1) * e * ((this._p1 + 1) * e + this._p1) + 1
}), p("BackIn", function(e) {
return e * e * ((this._p1 + 1) * e - this._p1)
}), p("BackInOut", function(e) {
return 1 > (e *= 2) ? .5 * e * e * ((this._p2 + 1) * e - this._p2) : .5 * ((e -= 2) * e * ((this._p2 + 1) * e + this._p2) + 2)
})),
v = a("easing.SlowMo", function(e, t, n) {
t = t || 0 === t ? t : .7, null == e ? e = .7 : e > 1 && (e = 1), this._p = 1 !== e ? t : 0, this._p1 = (1 - e) / 2, this._p2 = e, this._p3 = this._p1 + this._p2, this._calcEnd = n === !0
}, !0),
m = v.prototype = new e;
return m.constructor = v, m.getRatio = function(e) {
var t = e + (.5 - e) * this._p;
return this._p1 > e ? this._calcEnd ? 1 - (e = 1 - e / this._p1) * e : t - (e = 1 - e / this._p1) * e * e * e * t : e > this._p3 ? this._calcEnd ? 1 - (e = (e - this._p3) / this._p1) * e : t + (e - t) * (e = (e - this._p3) / this._p1) * e * e * e : this._calcEnd ? 1 : t
}, v.ease = new v(.7, .7), m.config = v.config = function(e, t, n) {
return new v(e, t, n)
}, t = a("easing.SteppedEase", function(e) {
e = e || 1, this._p1 = 1 / e, this._p2 = e + 1
}, !0), m = t.prototype = new e, m.constructor = t, m.getRatio = function(e) {
return 0 > e ? e = 0 : e >= 1 && (e = .999999999), (this._p2 * e >> 0) * this._p1
}, m.config = t.config = function(e) {
return new t(e)
}, n = a("easing.RoughEase", function(t) {
t = t || {};
for (var n, r, i, s, o, u, a = t.taper || "none", f = [], l = 0, c = 0 | (t.points || 20), p = c, d = t.randomize !== !1, v = t.clamp === !0, m = t.template instanceof e ? t.template : null, g = "number" == typeof t.strength ? .4 * t.strength : .4; --p > -1;) n = d ? Math.random() : 1 / c * p, r = m ? m.getRatio(n) : n, "none" === a ? i = g : "out" === a ? (s = 1 - n, i = s * s * g) : "in" === a ? i = n * n * g : .5 > n ? (s = 2 * n, i = .5 * s * s * g) : (s = 2 * (1 - n), i = .5 * s * s * g), d ? r += Math.random() * i - .5 * i : p % 2 ? r += .5 * i : r -= .5 * i, v && (r > 1 ? r = 1 : 0 > r && (r = 0)), f[l++] = {
x: n,
y: r
};
for (f.sort(function(e, t) {
return e.x - t.x
}), u = new h(1, 1, null), p = c; --p > -1;) o = f[p], u = new h(o.x, o.y, u);
this._prev = new h(0, 0, 0 !== u.t ? u : u.next)
}, !0), m = n.prototype = new e, m.constructor = n, m.getRatio = function(e) {
var t = this._prev;
if (e > t.t) {
for (; t.next && e >= t.t;) t = t.next;
t = t.prev
} else
for (; t.prev && t.t >= e;) t = t.prev;
return this._prev = t, t.v + (e - t.t) / t.gap * t.c
}, m.config = function(e) {
return new n(e)
}, n.ease = new n, c("Bounce", f("BounceOut", function(e) {
return 1 / 2.75 > e ? 7.5625 * e * e : 2 / 2.75 > e ? 7.5625 * (e -= 1.5 / 2.75) * e + .75 : 2.5 / 2.75 > e ? 7.5625 * (e -= 2.25 / 2.75) * e + .9375 : 7.5625 * (e -= 2.625 / 2.75) * e + .984375
}), f("BounceIn", function(e) {
return 1 / 2.75 > (e = 1 - e) ? 1 - 7.5625 * e * e : 2 / 2.75 > e ? 1 - (7.5625 * (e -= 1.5 / 2.75) * e + .75) : 2.5 / 2.75 > e ? 1 - (7.5625 * (e -= 2.25 / 2.75) * e + .9375) : 1 - (7.5625 * (e -= 2.625 / 2.75) * e + .984375)
}), f("BounceInOut", function(e) {
var t = .5 > e;
return e = t ? 1 - 2 * e : 2 * e - 1, e = 1 / 2.75 > e ? 7.5625 * e * e : 2 / 2.75 > e ? 7.5625 * (e -= 1.5 / 2.75) * e + .75 : 2.5 / 2.75 > e ? 7.5625 * (e -= 2.25 / 2.75) * e + .9375 : 7.5625 * (e -= 2.625 / 2.75) * e + .984375, t ? .5 * (1 - e) : .5 * e + .5
})), c("Circ", f("CircOut", function(e) {
return Math.sqrt(1 - (e -= 1) * e)
}), f("CircIn", function(e) {
return -(Math.sqrt(1 - e * e) - 1)
}), f("CircInOut", function(e) {
return 1 > (e *= 2) ? -0.5 * (Math.sqrt(1 - e * e) - 1) : .5 * (Math.sqrt(1 - (e -= 2) * e) + 1)
})), r = function(t, n, r) {
var i = a("easing." + t, function(e, t) {
this._p1 = e || 1, this._p2 = t || r, this._p3 = this._p2 / o * (Math.asin(1 / this._p1) || 0)
}, !0),
s = i.prototype = new e;
return s.constructor = i, s.getRatio = n, s.config = function(e, t) {
return new i(e, t)
}, i
}, c("Elastic", r("ElasticOut", function(e) {
return this._p1 * Math.pow(2, -10 * e) * Math.sin((e - this._p3) * o / this._p2) + 1
}, .3), r("ElasticIn", function(e) {
return -(this._p1 * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - this._p3) * o / this._p2))
}, .3), r("ElasticInOut", function(e) {
return 1 > (e *= 2) ? -0.5 * this._p1 * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - this._p3) * o / this._p2) : .5 * this._p1 * Math.pow(2, -10 * (e -= 1)) * Math.sin((e - this._p3) * o / this._p2) + 1
}, .45)), c("Expo", f("ExpoOut", function(e) {
return 1 - Math.pow(2, -10 * e)
}), f("ExpoIn", function(e) {
return Math.pow(2, 10 * (e - 1)) - .001
}), f("ExpoInOut", function(e) {
return 1 > (e *= 2) ? .5 * Math.pow(2, 10 * (e - 1)) : .5 * (2 - Math.pow(2, -10 * (e - 1)))
})), c("Sine", f("SineOut", function(e) {
return Math.sin(e * u)
}), f("SineIn", function(e) {
return -Math.cos(e * u) + 1
}), f("SineInOut", function(e) {
return -0.5 * (Math.cos(Math.PI * e) - 1)
})), a("easing.EaseLookup", {
find: function(t) {
return e.map[t]
}
}, !0), l(i.SlowMo, "SlowMo", "ease,"), l(n, "RoughEase", "ease,"), l(t, "SteppedEase", "ease,"), d
}, !0)
}), _gsScope._gsDefine && _gsScope._gsQueue.pop()(),
function(e, t) {
var n = e.GreenSockGlobals = e.GreenSockGlobals || e;
if (!n.TweenLite) {
var r, i, s, o, u, a = function(e) {
var t, r = e.split("."),
i = n;
for (t = 0; r.length > t; t++) i[r[t]] = i = i[r[t]] || {};
return i
},
f = a("com.greensock"),
l = 1e-10,
c = function(e) {
var t, n = [],
r = e.length;
for (t = 0; t !== r; n.push(e[t++]));
return n
},
h = function() {},
p = function() {
var e = Object.prototype.toString,
t = e.call([]);
return function(n) {
return null != n && (n instanceof Array || "object" == typeof n && !!n.push && e.call(n) === t)
}
}(),
d = {},
v = function(r, i, s, o) {
this.sc = d[r] ? d[r].sc : [], d[r] = this, this.gsClass = null, this.func = s;
var u = [];
this.check = function(f) {
for (var l, c, h, p, m = i.length, g = m; --m > -1;)(l = d[i[m]] || new v(i[m], [])).gsClass ? (u[m] = l.gsClass, g--) : f && l.sc.push(this);
if (0 === g && s)
for (c = ("com.greensock." + r).split("."), h = c.pop(), p = a(c.join("."))[h] = this.gsClass = s.apply(s, u), o && (n[h] = p, "function" == typeof define && define.amd ? define((e.GreenSockAMDPath ? e.GreenSockAMDPath + "/" : "") + r.split(".").pop(), [], function() {
return p
}) : r === t && "undefined" != typeof module && module.exports && (module.exports = p)), m = 0; this.sc.length > m; m++) this.sc[m].check()
}, this.check(!0)
},
m = e._gsDefine = function(e, t, n, r) {
return new v(e, t, n, r)
},
g = f._class = function(e, t, n) {
return t = t || function() {}, m(e, [], function() {
return t
}, n), t
};
m.globals = n;
var y = [0, 0, 1, 1],
b = [],
w = g("easing.Ease", function(e, t, n, r) {
this._func = e, this._type = n || 0, this._power = r || 0, this._params = t ? y.concat(t) : y
}, !0),
E = w.map = {},
S = w.register = function(e, t, n, r) {
for (var i, s, o, u, a = t.split(","), l = a.length, c = (n || "easeIn,easeOut,easeInOut").split(","); --l > -1;)
for (s = a[l], i = r ? g("easing." + s, null, !0) : f.easing[s] || {}, o = c.length; --o > -1;) u = c[o], E[s + "." + u] = E[u + s] = i[u] = e.getRatio ? e : e[u] || new e
};
for (s = w.prototype, s._calcEnd = !1, s.getRatio = function(e) {
if (this._func) return this._params[0] = e, this._func.apply(null, this._params);
var t = this._type,
n = this._power,
r = 1 === t ? 1 - e : 2 === t ? e : .5 > e ? 2 * e : 2 * (1 - e);
return 1 === n ? r *= r : 2 === n ? r *= r * r : 3 === n ? r *= r * r * r : 4 === n && (r *= r * r * r * r), 1 === t ? 1 - r : 2 === t ? r : .5 > e ? r / 2 : 1 - r / 2
}, r = ["Linear", "Quad", "Cubic", "Quart", "Quint,Strong"], i = r.length; --i > -1;) s = r[i] + ",Power" + i, S(new w(null, null, 1, i), s, "easeOut", !0), S(new w(null, null, 2, i), s, "easeIn" + (0 === i ? ",easeNone" : "")), S(new w(null, null, 3, i), s, "easeInOut");
E.linear = f.easing.Linear.easeIn, E.swing = f.easing.Quad.easeInOut;
var x = g("events.EventDispatcher", function(e) {
this._listeners = {}, this._eventTarget = e || this
});
s = x.prototype, s.addEventListener = function(e, t, n, r, i) {
i = i || 0;
var s, a, f = this._listeners[e],
l = 0;
for (null == f && (this._listeners[e] = f = []), a = f.length; --a > -1;) s = f[a], s.c === t && s.s === n ? f.splice(a, 1) : 0 === l && i > s.pr && (l = a + 1);
f.splice(l, 0, {
c: t,
s: n,
up: r,
pr: i
}), this !== o || u || o.wake()
}, s.removeEventListener = function(e, t) {
var n, r = this._listeners[e];
if (r)
for (n = r.length; --n > -1;)
if (r[n].c === t) return r.splice(n, 1), void 0
}, s.dispatchEvent = function(e) {
var t, n, r, i = this._listeners[e];
if (i)
for (t = i.length, n = this._eventTarget; --t > -1;) r = i[t], r && (r.up ? r.c.call(r.s || n, {
type: e,
target: n
}) : r.c.call(r.s || n))
};
var T = e.requestAnimationFrame,
N = e.cancelAnimationFrame,
C = Date.now || function() {
return (new Date).getTime()
},
k = C();
for (r = ["ms", "moz", "webkit", "o"], i = r.length; --i > -1 && !T;) T = e[r[i] + "RequestAnimationFrame"], N = e[r[i] + "CancelAnimationFrame"] || e[r[i] + "CancelRequestAnimationFrame"];
g("Ticker", function(e, t) {
var n, r, i, s, a, f = this,
c = C(),
p = t !== !1 && T,
d = 500,
v = 33,
m = "tick",
g = function(e) {
var t, o, u = C() - k;
u > d && (c += u - v), k += u, f.time = (k - c) / 1e3, t = f.time - a, (!n || t > 0 || e === !0) && (f.frame++, a += t + (t >= s ? .004 : s - t), o = !0), e !== !0 && (i = r(g)), o && f.dispatchEvent(m)
};
x.call(f), f.time = f.frame = 0, f.tick = function() {
g(!0)
}, f.lagSmoothing = function(e, t) {
d = e || 1 / l, v = Math.min(t, d, 0)
}, f.sleep = function() {
null != i && (p && N ? N(i) : clearTimeout(i), r = h, i = null, f === o && (u = !1))
}, f.wake = function() {
null !== i ? f.sleep() : f.frame > 10 && (k = C() - d + 5), r = 0 === n ? h : p && T ? T : function(e) {
return setTimeout(e, 0 | 1e3 * (a - f.time) + 1)
}, f === o && (u = !0), g(2)
}, f.fps = function(e) {
return arguments.length ? (n = e, s = 1 / (n || 60), a = this.time + s, f.wake(), void 0) : n
}, f.useRAF = function(e) {
return arguments.length ? (f.sleep(), p = e, f.fps(n), void 0) : p
}, f.fps(e), setTimeout(function() {
p && (!i || 5 > f.frame) && f.useRAF(!1)
}, 1500)
}), s = f.Ticker.prototype = new f.events.EventDispatcher, s.constructor = f.Ticker;
var L = g("core.Animation", function(e, t) {
if (this.vars = t = t || {}, this._duration = this._totalDuration = e || 0, this._delay = Number(t.delay) || 0, this._timeScale = 1, this._active = t.immediateRender === !0, this.data = t.data, this._reversed = t.reversed === !0, z) {
u || o.wake();
var n = this.vars.useFrames ? U : z;
n.add(this, n._time), this.vars.paused && this.paused(!0)
}
});
o = L.ticker = new f.Ticker, s = L.prototype, s._dirty = s._gc = s._initted = s._paused = !1, s._totalTime = s._time = 0, s._rawPrevTime = -1, s._next = s._last = s._onUpdate = s._timeline = s.timeline = null, s._paused = !1;
var A = function() {
u && C() - k > 2e3 && o.wake(), setTimeout(A, 2e3)
};
A(), s.play = function(e, t) {
return null != e && this.seek(e, t), this.reversed(!1).paused(!1)
}, s.pause = function(e, t) {
return null != e && this.seek(e, t), this.paused(!0)
}, s.resume = function(e, t) {
return null != e && this.seek(e, t), this.paused(!1)
}, s.seek = function(e, t) {
return this.totalTime(Number(e), t !== !1)
}, s.restart = function(e, t) {
return this.reversed(!1).paused(!1).totalTime(e ? -this._delay : 0, t !== !1, !0)
}, s.reverse = function(e, t) {
return null != e && this.seek(e || this.totalDuration(), t), this.reversed(!0).paused(!1)
}, s.render = function() {}, s.invalidate = function() {
return this._time = this._totalTime = 0, this._initted = this._gc = !1, this._rawPrevTime = -1, (this._gc || !this.timeline) && this._enabled(!0), this
}, s.isActive = function() {
var e, t = this._timeline,
n = this._startTime;
return !t || !this._gc && !this._paused && t.isActive() && (e = t.rawTime()) >= n && n + this.totalDuration() / this._timeScale > e
}, s._enabled = function(e, t) {
return u || o.wake(), this._gc = !e, this._active = this.isActive(), t !== !0 && (e && !this.timeline ? this._timeline.add(this, this._startTime - this._delay) : !e && this.timeline && this._timeline._remove(this, !0)), !1
}, s._kill = function() {
return this._enabled(!1, !1)
}, s.kill = function(e, t) {
return this._kill(e, t), this
}, s._uncache = function(e) {
for (var t = e ? this : this.timeline; t;) t._dirty = !0, t = t.timeline;
return this
}, s._swapSelfInParams = function(e) {
for (var t = e.length, n = e.concat(); --t > -1;) "{self}" === e[t] && (n[t] = this);
return n
}, s.eventCallback = function(e, t, n, r) {
if ("on" === (e || "").substr(0, 2)) {
var i = this.vars;
if (1 === arguments.length) return i[e];
null == t ? delete i[e] : (i[e] = t, i[e + "Params"] = p(n) && -1 !== n.join("").indexOf("{self}") ? this._swapSelfInParams(n) : n, i[e + "Scope"] = r), "onUpdate" === e && (this._onUpdate = t)
}
return this
}, s.delay = function(e) {
return arguments.length ? (this._timeline.smoothChildTiming && this.startTime(this._startTime + e - this._delay), this._delay = e, this) : this._delay
}, s.duration = function(e) {
return arguments.length ? (this._duration = this._totalDuration = e, this._uncache(!0), this._timeline.smoothChildTiming && this._time > 0 && this._time < this._duration && 0 !== e && this.totalTime(this._totalTime * (e / this._duration), !0), this) : (this._dirty = !1, this._duration)
}, s.totalDuration = function(e) {
return this._dirty = !1, arguments.length ? this.duration(e) : this._totalDuration
}, s.time = function(e, t) {
return arguments.length ? (this._dirty && this.totalDuration(), this.totalTime(e > this._duration ? this._duration : e, t)) : this._time
}, s.totalTime = function(e, t, n) {
if (u || o.wake(), !arguments.length) return this._totalTime;
if (this._timeline) {
if (0 > e && !n && (e += this.totalDuration()), this._timeline.smoothChildTiming) {
this._dirty && this.totalDuration();
var r = this._totalDuration,
i = this._timeline;
if (e > r && !n && (e = r), this._startTime = (this._paused ? this._pauseTime : i._time) - (this._reversed ? r - e : e) / this._timeScale, i._dirty || this._uncache(!1), i._timeline)
for (; i._timeline;) i._timeline._time !== (i._startTime + i._totalTime) / i._timeScale && i.totalTime(i._totalTime, !0), i = i._timeline
}
this._gc && this._enabled(!0, !1), (this._totalTime !== e || 0 === this._duration) && (this.render(e, t, !1), P.length && W())
}
return this
}, s.progress = s.totalProgress = function(e, t) {
return arguments.length ? this.totalTime(this.duration() * e, t) : this._time / this.duration()
}, s.startTime = function(e) {
return arguments.length ? (e !== this._startTime && (this._startTime = e, this.timeline && this.timeline._sortChildren && this.timeline.add(this, e - this._delay)), this) : this._startTime
}, s.endTime = function(e) {
return this._startTime + (0 != e ? this.totalDuration() : this.duration()) / this._timeScale
}, s.timeScale = function(e) {
if (!arguments.length) return this._timeScale;
if (e = e || l, this._timeline && this._timeline.smoothChildTiming) {
var t = this._pauseTime,
n = t || 0 === t ? t : this._timeline.totalTime();
this._startTime = n - (n - this._startTime) * this._timeScale / e
}
return this._timeScale = e, this._uncache(!1)
}, s.reversed = function(e) {
return arguments.length ? (e != this._reversed && (this._reversed = e, this.totalTime(this._timeline && !this._timeline.smoothChildTiming ? this.totalDuration() - this._totalTime : this._totalTime, !0)), this) : this._reversed
}, s.paused = function(e) {
if (!arguments.length) return this._paused;
if (e != this._paused && this._timeline) {
u || e || o.wake();
var t = this._timeline,
n = t.rawTime(),
r = n - this._pauseTime;
!e && t.smoothChildTiming && (this._startTime += r, this._uncache(!1)), this._pauseTime = e ? n : null, this._paused = e, this._active = this.isActive(), !e && 0 !== r && this._initted && this.duration() && this.render(t.smoothChildTiming ? this._totalTime : (n - this._startTime) / this._timeScale, !0, !0)
}
return this._gc && !e && this._enabled(!0, !1), this
};
var O = g("core.SimpleTimeline", function(e) {
L.call(this, 0, e), this.autoRemoveChildren = this.smoothChildTiming = !0
});
s = O.prototype = new L, s.constructor = O, s.kill()._gc = !1, s._first = s._last = s._recent = null, s._sortChildren = !1, s.add = s.insert = function(e, t) {
var n, r;
if (e._startTime = Number(t || 0) + e._delay, e._paused && this !== e._timeline && (e._pauseTime = e._startTime + (this.rawTime() - e._startTime) / e._timeScale), e.timeline && e.timeline._remove(e, !0), e.timeline = e._timeline = this, e._gc && e._enabled(!0, !0), n = this._last, this._sortChildren)
for (r = e._startTime; n && n._startTime > r;) n = n._prev;
return n ? (e._next = n._next, n._next = e) : (e._next = this._first, this._first = e), e._next ? e._next._prev = e : this._last = e, e._prev = n, this._recent = e, this._timeline && this._uncache(!0), this
}, s._remove = function(e, t) {
return e.timeline === this && (t || e._enabled(!1, !0), e._prev ? e._prev._next = e._next : this._first === e && (this._first = e._next), e._next ? e._next._prev = e._prev : this._last === e && (this._last = e._prev), e._next = e._prev = e.timeline = null, e === this._recent && (this._recent = this._last), this._timeline && this._uncache(!0)), this
}, s.render = function(e, t, n) {
var r, i = this._first;
for (this._totalTime = this._time = this._rawPrevTime = e; i;) r = i._next, (i._active || e >= i._startTime && !i._paused) && (i._reversed ? i.render((i._dirty ? i.totalDuration() : i._totalDuration) - (e - i._startTime) * i._timeScale, t, n) : i.render((e - i._startTime) * i._timeScale, t, n)), i = r
}, s.rawTime = function() {
return u || o.wake(), this._totalTime
};
var M = g("TweenLite", function(t, n, r) {
if (L.call(this, n, r), this.render = M.prototype.render, null == t) throw "Cannot tween a null target.";
this.target = t = "string" != typeof t ? t : M.selector(t) || t;
var i, s, o, u = t.jquery || t.length && t !== e && t[0] && (t[0] === e || t[0].nodeType && t[0].style && !t.nodeType),
a = this.vars.overwrite;
if (this._overwrite = a = null == a ? R[M.defaultOverwrite] : "number" == typeof a ? a >> 0 : R[a], (u || t instanceof Array || t.push && p(t)) && "number" != typeof t[0])
for (this._targets = o = c(t), this._propLookup = [], this._siblings = [], i = 0; o.length > i; i++) s = o[i], s ? "string" != typeof s ? s.length && s !== e && s[0] && (s[0] === e || s[0].nodeType && s[0].style && !s.nodeType) ? (o.splice(i--, 1), this._targets = o = o.concat(c(s))) : (this._siblings[i] = X(s, this, !1), 1 === a && this._siblings[i].length > 1 && $(s, this, null, 1, this._siblings[i])) : (s = o[i--] = M.selector(s), "string" == typeof s && o.splice(i + 1, 1)) : o.splice(i--, 1);
else this._propLookup = {}, this._siblings = X(t, this, !1), 1 === a && this._siblings.length > 1 && $(t, this, null, 1, this._siblings);
(this.vars.immediateRender || 0 === n && 0 === this._delay && this.vars.immediateRender !== !1) && (this._time = -l, this.render(-this._delay))
}, !0),
_ = function(t) {
return t && t.length && t !== e && t[0] && (t[0] === e || t[0].nodeType && t[0].style && !t.nodeType)
},
D = function(e, t) {
var n, r = {};
for (n in e) q[n] || n in t && "transform" !== n && "x" !== n && "y" !== n && "width" !== n && "height" !== n && "className" !== n && "border" !== n || !(!j[n] || j[n] && j[n]._autoCSS) || (r[n] = e[n], delete e[n]);
e.css = r
};
s = M.prototype = new L, s.constructor = M, s.kill()._gc = !1, s.ratio = 0, s._firstPT = s._targets = s._overwrittenProps = s._startAt = null, s._notifyPluginsOfEnabled = s._lazy = !1, M.version = "1.15.1", M.defaultEase = s._ease = new w(null, null, 1, 1), M.defaultOverwrite = "auto", M.ticker = o, M.autoSleep = !0, M.lagSmoothing = function(e, t) {
o.lagSmoothing(e, t)
}, M.selector = e.$ || e.jQuery || function(t) {
var n = e.$ || e.jQuery;
return n ? (M.selector = n, n(t)) : "undefined" == typeof document ? t : document.querySelectorAll ? document.querySelectorAll(t) : document.getElementById("#" === t.charAt(0) ? t.substr(1) : t)
};
var P = [],
H = {},
B = M._internals = {
isArray: p,
isSelector: _,
lazyTweens: P
},
j = M._plugins = {},
F = B.tweenLookup = {},
I = 0,
q = B.reservedProps = {
ease: 1,
delay: 1,
overwrite: 1,
onComplete: 1,
onCompleteParams: 1,
onCompleteScope: 1,
useFrames: 1,
runBackwards: 1,
startAt: 1,
onUpdate: 1,
onUpdateParams: 1,
onUpdateScope: 1,
onStart: 1,
onStartParams: 1,
onStartScope: 1,
onReverseComplete: 1,
onReverseCompleteParams: 1,
onReverseCompleteScope: 1,
onRepeat: 1,
onRepeatParams: 1,
onRepeatScope: 1,
easeParams: 1,
yoyo: 1,
immediateRender: 1,
repeat: 1,
repeatDelay: 1,
data: 1,
paused: 1,
reversed: 1,
autoCSS: 1,
lazy: 1,
onOverwrite: 1
},
R = {
none: 0,
all: 1,
auto: 2,
concurrent: 3,
allOnStart: 4,
preexisting: 5,
"true": 1,
"false": 0
},
U = L._rootFramesTimeline = new O,
z = L._rootTimeline = new O,
W = B.lazyRender = function() {
var e, t = P.length;
for (H = {}; --t > -1;) e = P[t], e && e._lazy !== !1 && (e.render(e._lazy[0], e._lazy[1], !0), e._lazy = !1);
P.length = 0
};
z._startTime = o.time, U._startTime = o.frame, z._active = U._active = !0, setTimeout(W, 1), L._updateRoot = M.render = function() {
var e, t, n;
if (P.length && W(), z.render((o.time - z._startTime) * z._timeScale, !1, !1), U.render((o.frame - U._startTime) * U._timeScale, !1, !1), P.length && W(), !(o.frame % 120)) {
for (n in F) {
for (t = F[n].tweens, e = t.length; --e > -1;) t[e]._gc && t.splice(e, 1);
0 === t.length && delete F[n]
}
if (n = z._first, (!n || n._paused) && M.autoSleep && !U._first && 1 === o._listeners.tick.length) {
for (; n && n._paused;) n = n._next;
n || o.sleep()
}
}
}, o.addEventListener("tick", L._updateRoot);
var X = function(e, t, n) {
var r, i, s = e._gsTweenID;
if (F[s || (e._gsTweenID = s = "t" + I++)] || (F[s] = {
target: e,
tweens: []
}), t && (r = F[s].tweens, r[i = r.length] = t, n))
for (; --i > -1;) r[i] === t && r.splice(i, 1);
return F[s].tweens
},
V = function(e, t, n, r) {
var i, s, o = e.vars.onOverwrite;
return o && (i = o(e, t, n, r)), o = M.onOverwrite, o && (s = o(e, t, n, r)), i !== !1 && s !== !1
},
$ = function(e, t, n, r, i) {
var s, o, u, a;
if (1 === r || r >= 4) {
for (a = i.length, s = 0; a > s; s++)
if ((u = i[s]) !== t) u._gc || V(u, t) && u._enabled(!1, !1) && (o = !0);
else if (5 === r) break;
return o
}
var f, c = t._startTime + l,
h = [],
p = 0,
d = 0 === t._duration;
for (s = i.length; --s > -1;)(u = i[s]) === t || u._gc || u._paused || (u._timeline !== t._timeline ? (f = f || J(t, 0, d), 0 === J(u, f, d) && (h[p++] = u)) : c >= u._startTime && u._startTime + u.totalDuration() / u._timeScale > c && ((d || !u._initted) && 2e-10 >= c - u._startTime || (h[p++] = u)));
for (s = p; --s > -1;)
if (u = h[s], 2 === r && u._kill(n, e, t) && (o = !0), 2 !== r || !u._firstPT && u._initted) {
if (2 !== r && !V(u, t)) continue;
u._enabled(!1, !1) && (o = !0)
}
return o
},
J = function(e, t, n) {
for (var r = e._timeline, i = r._timeScale, s = e._startTime; r._timeline;) {
if (s += r._startTime, i *= r._timeScale, r._paused) return -100;
r = r._timeline
}
return s /= i, s > t ? s - t : n && s === t || !e._initted && 2 * l > s - t ? l : (s += e.totalDuration() / e._timeScale / i) > t + l ? 0 : s - t - l
};
s._init = function() {
var e, t, n, r, i, s = this.vars,
o = this._overwrittenProps,
u = this._duration,
a = !!s.immediateRender,
f = s.ease;
if (s.startAt) {
this._startAt && (this._startAt.render(-1, !0), this._startAt.kill()), i = {};
for (r in s.startAt) i[r] = s.startAt[r];
if (i.overwrite = !1, i.immediateRender = !0, i.lazy = a && s.lazy !== !1, i.startAt = i.delay = null, this._startAt = M.to(this.target, 0, i), a)
if (this._time > 0) this._startAt = null;
else if (0 !== u) return
} else if (s.runBackwards && 0 !== u)
if (this._startAt) this._startAt.render(-1, !0), this._startAt.kill(), this._startAt = null;
else {
0 !== this._time && (a = !1), n = {};
for (r in s) q[r] && "autoCSS" !== r || (n[r] = s[r]);
if (n.overwrite = 0, n.data = "isFromStart", n.lazy = a && s.lazy !== !1, n.immediateRender = a, this._startAt = M.to(this.target, 0, n), a) {
if (0 === this._time) return
} else this._startAt._init(), this._startAt._enabled(!1), this.vars.immediateRender && (this._startAt = null)
}
if (this._ease = f = f ? f instanceof w ? f : "function" == typeof f ? new w(f, s.easeParams) : E[f] || M.defaultEase : M.defaultEase, s.easeParams instanceof Array && f.config && (this._ease = f.config.apply(f, s.easeParams)), this._easeType = this._ease._type, this._easePower = this._ease._power, this._firstPT = null, this._targets)
for (e = this._targets.length; --e > -1;) this._initProps(this._targets[e], this._propLookup[e] = {}, this._siblings[e], o ? o[e] : null) && (t = !0);
else t = this._initProps(this.target, this._propLookup, this._siblings, o);
if (t && M._onPluginEvent("_onInitAllProps", this), o && (this._firstPT || "function" != typeof this.target && this._enabled(!1, !1)), s.runBackwards)
for (n = this._firstPT; n;) n.s += n.c, n.c = -n.c, n = n._next;
this._onUpdate = s.onUpdate, this._initted = !0
}, s._initProps = function(t, n, r, i) {
var s, o, u, a, f, l;
if (null == t) return !1;
H[t._gsTweenID] && W(), this.vars.css || t.style && t !== e && t.nodeType && j.css && this.vars.autoCSS !== !1 && D(this.vars, t);
for (s in this.vars) {
if (l = this.vars[s], q[s]) l && (l instanceof Array || l.push && p(l)) && -1 !== l.join("").indexOf("{self}") && (this.vars[s] = l = this._swapSelfInParams(l, this));
else if (j[s] && (a = new j[s])._onInitTween(t, this.vars[s], this)) {
for (this._firstPT = f = {
_next: this._firstPT,
t: a,
p: "setRatio",
s: 0,
c: 1,
f: !0,
n: s,
pg: !0,
pr: a._priority
}, o = a._overwriteProps.length; --o > -1;) n[a._overwriteProps[o]] = this._firstPT;
(a._priority || a._onInitAllProps) && (u = !0), (a._onDisable || a._onEnable) && (this._notifyPluginsOfEnabled = !0)
} else this._firstPT = n[s] = f = {
_next: this._firstPT,
t: t,
p: s,
f: "function" == typeof t[s],
n: s,
pg: !1,
pr: 0
}, f.s = f.f ? t[s.indexOf("set") || "function" != typeof t["get" + s.substr(3)] ? s : "get" + s.substr(3)]() : parseFloat(t[s]), f.c = "string" == typeof l && "=" === l.charAt(1) ? parseInt(l.charAt(0) + "1", 10) * Number(l.substr(2)) : Number(l) - f.s || 0;
f && f._next && (f._next._prev = f)
}
return i && this._kill(i, t) ? this._initProps(t, n, r, i) : this._overwrite > 1 && this._firstPT && r.length > 1 && $(t, this, n, this._overwrite, r) ? (this._kill(n, t), this._initProps(t, n, r, i)) : (this._firstPT && (this.vars.lazy !== !1 && this._duration || this.vars.lazy && !this._duration) && (H[t._gsTweenID] = !0), u)
}, s.render = function(e, t, n) {
var r, i, s, o, u = this._time,
a = this._duration,
f = this._rawPrevTime;
if (e >= a) this._totalTime = this._time = a, this.ratio = this._ease._calcEnd ? this._ease.getRatio(1) : 1, this._reversed || (r = !0, i = "onComplete"), 0 === a && (this._initted || !this.vars.lazy || n) && (this._startTime === this._timeline._duration && (e = 0), (0 === e || 0 > f || f === l && "isPause" !== this.data) && f !== e && (n = !0, f > l && (i = "onReverseComplete")), this._rawPrevTime = o = !t || e || f === e ? e : l);
else if (1e-7 > e) this._totalTime = this._time = 0, this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0, (0 !== u || 0 === a && f > 0 && f !== l) && (i = "onReverseComplete", r = this._reversed), 0 > e && (this._active = !1, 0 === a && (this._initted || !this.vars.lazy || n) && (f >= 0 && (f !== l || "isPause" !== this.data) && (n = !0), this._rawPrevTime = o = !t || e || f === e ? e : l)), this._initted || (n = !0);
else if (this._totalTime = this._time = e, this._easeType) {
var c = e / a,
h = this._easeType,
p = this._easePower;
(1 === h || 3 === h && c >= .5) && (c = 1 - c), 3 === h && (c *= 2), 1 === p ? c *= c : 2 === p ? c *= c * c : 3 === p ? c *= c * c * c : 4 === p && (c *= c * c * c * c), this.ratio = 1 === h ? 1 - c : 2 === h ? c : .5 > e / a ? c / 2 : 1 - c / 2
} else this.ratio = this._ease.getRatio(e / a);
if (this._time !== u || n) {
if (!this._initted) {
if (this._init(), !this._initted || this._gc) return;
if (!n && this._firstPT && (this.vars.lazy !== !1 && this._duration || this.vars.lazy && !this._duration)) return this._time = this._totalTime = u, this._rawPrevTime = f, P.push(this), this._lazy = [e, t], void 0;
this._time && !r ? this.ratio = this._ease.getRatio(this._time / a) : r && this._ease._calcEnd && (this.ratio = this._ease.getRatio(0 === this._time ? 0 : 1))
}
for (this._lazy !== !1 && (this._lazy = !1), this._active || !this._paused && this._time !== u && e >= 0 && (this._active = !0), 0 === u && (this._startAt && (e >= 0 ? this._startAt.render(e, t, n) : i || (i = "_dummyGS")), this.vars.onStart && (0 !== this._time || 0 === a) && (t || this.vars.onStart.apply(this.vars.onStartScope || this, this.vars.onStartParams || b))), s = this._firstPT; s;) s.f ? s.t[s.p](s.c * this.ratio + s.s) : s.t[s.p] = s.c * this.ratio + s.s, s = s._next;
this._onUpdate && (0 > e && this._startAt && e !== -0.0001 && this._startAt.render(e, t, n), t || (this._time !== u || r) && this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || b)), i && (!this._gc || n) && (0 > e && this._startAt && !this._onUpdate && e !== -0.0001 && this._startAt.render(e, t, n), r && (this._timeline.autoRemoveChildren && this._enabled(!1, !1), this._active = !1), !t && this.vars[i] && this.vars[i].apply(this.vars[i + "Scope"] || this, this.vars[i + "Params"] || b), 0 === a && this._rawPrevTime === l && o !== l && (this._rawPrevTime = 0))
}
}, s._kill = function(e, t, n) {
if ("all" === e && (e = null), null != e || null != t && t !== this.target) {
t = "string" != typeof t ? t || this._targets || this.target : M.selector(t) || t;
var r, i, s, o, u, a, f, l, c;
if ((p(t) || _(t)) && "number" != typeof t[0])
for (r = t.length; --r > -1;) this._kill(e, t[r]) && (a = !0);
else {
if (this._targets) {
for (r = this._targets.length; --r > -1;)
if (t === this._targets[r]) {
u = this._propLookup[r] || {}, this._overwrittenProps = this._overwrittenProps || [], i = this._overwrittenProps[r] = e ? this._overwrittenProps[r] || {} : "all";
break
}
} else {
if (t !== this.target) return !1;
u = this._propLookup, i = this._overwrittenProps = e ? this._overwrittenProps || {} : "all"
}
if (u) {
if (f = e || u, l = e !== i && "all" !== i && e !== u && ("object" != typeof e || !e._tempKill), n && (M.onOverwrite || this.vars.onOverwrite)) {
for (s in f) u[s] && (c || (c = []), c.push(s));
if (!V(this, n, t, c)) return !1
}
for (s in f)(o = u[s]) && (o.pg && o.t._kill(f) && (a = !0), o.pg && 0 !== o.t._overwriteProps.length || (o._prev ? o._prev._next = o._next : o === this._firstPT && (this._firstPT = o._next), o._next && (o._next._prev = o._prev), o._next = o._prev = null), delete u[s]), l && (i[s] = 1);
!this._firstPT && this._initted && this._enabled(!1, !1)
}
}
return a
}
return this._lazy = !1, this._enabled(!1, !1)
}, s.invalidate = function() {
return this._notifyPluginsOfEnabled && M._onPluginEvent("_onDisable", this), this._firstPT = this._overwrittenProps = this._startAt = this._onUpdate = null, this._notifyPluginsOfEnabled = this._active = this._lazy = !1, this._propLookup = this._targets ? {} : [], L.prototype.invalidate.call(this), this.vars.immediateRender && (this._time = -l, this.render(-this._delay)), this
}, s._enabled = function(e, t) {
if (u || o.wake(), e && this._gc) {
var n, r = this._targets;
if (r)
for (n = r.length; --n > -1;) this._siblings[n] = X(r[n], this, !0);
else this._siblings = X(this.target, this, !0)
}
return L.prototype._enabled.call(this, e, t), this._notifyPluginsOfEnabled && this._firstPT ? M._onPluginEvent(e ? "_onEnable" : "_onDisable", this) : !1
}, M.to = function(e, t, n) {
return new M(e, t, n)
}, M.from = function(e, t, n) {
return n.runBackwards = !0, n.immediateRender = 0 != n.immediateRender, new M(e, t, n)
}, M.fromTo = function(e, t, n, r) {
return r.startAt = n, r.immediateRender = 0 != r.immediateRender && 0 != n.immediateRender, new M(e, t, r)
}, M.delayedCall = function(e, t, n, r, i) {
return new M(t, 0, {
delay: e,
onComplete: t,
onCompleteParams: n,
onCompleteScope: r,
onReverseComplete: t,
onReverseCompleteParams: n,
onReverseCompleteScope: r,
immediateRender: !1,
lazy: !1,
useFrames: i,
overwrite: 0
})
}, M.set = function(e, t) {
return new M(e, 0, t)
}, M.getTweensOf = function(e, t) {
if (null == e) return [];
e = "string" != typeof e ? e : M.selector(e) || e;
var n, r, i, s;
if ((p(e) || _(e)) && "number" != typeof e[0]) {
for (n = e.length, r = []; --n > -1;) r = r.concat(M.getTweensOf(e[n], t));
for (n = r.length; --n > -1;)
for (s = r[n], i = n; --i > -1;) s === r[i] && r.splice(n, 1)
} else
for (r = X(e).concat(), n = r.length; --n > -1;)(r[n]._gc || t && !r[n].isActive()) && r.splice(n, 1);
return r
}, M.killTweensOf = M.killDelayedCallsTo = function(e, t, n) {
"object" == typeof t && (n = t, t = !1);
for (var r = M.getTweensOf(e, t), i = r.length; --i > -1;) r[i]._kill(n, e)
};
var K = g("plugins.TweenPlugin", function(e, t) {
this._overwriteProps = (e || "").split(","), this._propName = this._overwriteProps[0], this._priority = t || 0, this._super = K.prototype
}, !0);
if (s = K.prototype, K.version = "1.10.1", K.API = 2, s._firstPT = null, s._addTween = function(e, t, n, r, i, s) {
var o, u;
return null != r && (o = "number" == typeof r || "=" !== r.charAt(1) ? Number(r) - n : parseInt(r.charAt(0) + "1", 10) * Number(r.substr(2))) ? (this._firstPT = u = {
_next: this._firstPT,
t: e,
p: t,
s: n,
c: o,
f: "function" == typeof e[t],
n: i || t,
r: s
}, u._next && (u._next._prev = u), u) : void 0
}, s.setRatio = function(e) {
for (var t, n = this._firstPT, r = 1e-6; n;) t = n.c * e + n.s, n.r ? t = Math.round(t) : r > t && t > -r && (t = 0), n.f ? n.t[n.p](t) : n.t[n.p] = t, n = n._next
}, s._kill = function(e) {
var t, n = this._overwriteProps,
r = this._firstPT;
if (null != e[this._propName]) this._overwriteProps = [];
else
for (t = n.length; --t > -1;) null != e[n[t]] && n.splice(t, 1);
for (; r;) null != e[r.n] && (r._next && (r._next._prev = r._prev), r._prev ? (r._prev._next = r._next, r._prev = null) : this._firstPT === r && (this._firstPT = r._next)), r = r._next;
return !1
}, s._roundProps = function(e, t) {
for (var n = this._firstPT; n;)(e[this._propName] || null != n.n && e[n.n.split(this._propName + "_").join("")]) && (n.r = t), n = n._next
}, M._onPluginEvent = function(e, t) {
var n, r, i, s, o, u = t._firstPT;
if ("_onInitAllProps" === e) {
for (; u;) {
for (o = u._next, r = i; r && r.pr > u.pr;) r = r._next;
(u._prev = r ? r._prev : s) ? u._prev._next = u: i = u, (u._next = r) ? r._prev = u : s = u, u = o
}
u = t._firstPT = i
}
for (; u;) u.pg && "function" == typeof u.t[e] && u.t[e]() && (n = !0), u = u._next;
return n
}, K.activate = function(e) {
for (var t = e.length; --t > -1;) e[t].API === K.API && (j[(new e[t])._propName] = e[t]);
return !0
}, m.plugin = function(e) {
if (!(e && e.propName && e.init && e.API)) throw "illegal plugin definition.";
var t, n = e.propName,
r = e.priority || 0,
i = e.overwriteProps,
s = {
init: "_onInitTween",
set: "setRatio",
kill: "_kill",
round: "_roundProps",
initAll: "_onInitAllProps"
},
o = g("plugins." + n.charAt(0).toUpperCase() + n.substr(1) + "Plugin", function() {
K.call(this, n, r), this._overwriteProps = i || []
}, e.global === !0),
u = o.prototype = new K(n);
u.constructor = o, o.API = e.API;
for (t in s) "function" == typeof e[t] && (u[s[t]] = e[t]);
return o.version = e.version, K.activate([o]), o
}, r = e._gsQueue) {
for (i = 0; r.length > i; i++) r[i]();
for (s in d) d[s].func || e.console.log("GSAP encountered missing dependency: com.greensock." + s)
}
u = !1
}
}("undefined" != typeof module && module.exports && "undefined" != typeof global ? global : this || window, "TweenMax"), define("greensock/TweenMax.min", function() {}),
function(e, t) {
e.utils = e.utils || {}, typeof define == "function" && define.amd ? define("FLOCK/utils/Preloader", ["jquery", "greensock/TweenLite.min", "FLOCK/utils/SectionLoader"], function(n) {
return e.utils.Preloader = t(n)
}) : e.utils.Preloader = t($)
}(window.FLOCK = window.FLOCK || {}, function(e) {
function a(e) {
r[e] ? n = e : console.log("preloader.js : switchLoader : no loader found with ID: " + e)
}
function f(e, t) {
r[e.id] = e, n || (n = e.id), t && t()
}
function l() {
console.log("preloader bringIn");
if (!n) return;
this.finished = !1, i = 0, n && r[n].bringIn !== undefined ? r[n].bringIn(c.bind(this)) : n && r[n].elem !== undefined ? (TweenLite.to(r[n].elem, .5, {
autoAlpha: 1,
onComplete: c.bind(this)
}), p.apply(this)) : c()
}
function c() {
console.log("preloader isIn"), h.apply(this)
}
function h(e) {
s = p.bind(this), TweenLite.ticker.addEventListener("tick", s)
}
function p(e) {
var o = t.getPerc();
o || (o = 1), o = i + Math.ceil(10 * (o - i) / .2) / 1e3, i = Math.max(i, o);
if (n && r[n].onProgress !== undefined) {
var u = r[n].onProgress(i);
i >= 1 && this.finished && u === !0 && (TweenLite.ticker.removeEventListener("tick", s), d())
} else {
n && r[n].updateBar !== undefined ? r[n].updateBar(i) : n && r[n].progressBar !== undefined && (r[n].progressBar.style.width = i * 100 + "%");
if (n && r[n].updateLabel !== undefined) r[n].updateText(i);
else if (n && r[n].loaderText !== undefined) {
var a = "";
n && r[n].loaderText_before !== undefined && (a += r[n].loaderText_before), a += Math.round(i * 100), n && r[n].loaderText_after !== undefined && (a += r[n].loaderText_after), r[n].loaderText.innerHTML = a
}
i >= 1 && this.finished && (TweenLite.ticker.removeEventListener("tick", s), d())
}
}
function d() {
console.log("preloader goOut"), n && r[n].goOut !== undefined ? r[n].goOut(v.bind(this)) : n && r[n].elem !== undefined ? TweenLite.to(r[n].elem, .5, {
autoAlpha: 0,
onComplete: v.bind(this)
}) : v()
}
function v(e) {
console.log("Preloader isOut"), o && o()
}
function m(e) {
o = e || !1, n || v(), this.finished = !0
}
var t = FLOCK.utils.SectionLoader,
n = !1,
r = {},
i = 0,
s, o = !1,
u = function() {
FLOCK.settings.instaLoad || t.addLoaderUI(this), this.finished = !0
};
return u.prototype.switchLoader = a, u.prototype.addLoader = f, u.prototype.bringIn = l, u.prototype.complete = m, new u
}), define("FLOCK/utils/PageVisibility", ["jquery"], function() {
(function() {
function t(t) {
var n = "visible",
r = "hidden",
i = {
focus: n,
focusin: n,
pageshow: n,
blur: r,
focusout: r,
pagehide: r
},
s;
t = t || window.event, t.type in i ? s = i[t.type] : s = this[e] ? "hidden" : "visible", $(window).trigger("onPageVisibilityChange", s)
}
var e = "hidden";
e in document ? document.addEventListener("visibilitychange", t) : (e = "mozHidden") in document ? document.addEventListener("mozvisibilitychange", t) : (e = "webkitHidden") in document ? document.addEventListener("webkitvisibilitychange", t) : (e = "msHidden") in document ? document.addEventListener("msvisibilitychange", t) : "onfocusin" in document ? document.onfocusin = document.onfocusout = t : window.onpageshow = window.onpagehide = window.onfocus = window.onblur = t, document[e] !== undefined && t({
type: document[e] ? "blur" : "focus"
})
})()
}),
function(e, t) {
if (typeof exports == "object" && exports) t(exports);
else {
var n = {};
t(n), typeof define == "function" && define.amd ? define("mustache", n) : e.Mustache = n
}
}(this, function(e) {
function n(e, n) {
return t.call(e, n)
}
function i(e) {
return !n(r, e)
}
function u(e) {
return typeof e == "function"
}
function a(e) {
return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&")
}
function l(e) {
return String(e).replace(/[&<>"'\/]/g, function(e) {
return f[e]
})
}
function c(e) {
if (!o(e) || e.length !== 2) throw new Error("Invalid tags: " + e);
return [new RegExp(a(e[0]) + "\\s*"), new RegExp("\\s*" + a(e[1]))]
}
function g(t, n) {
function E() {
if (l && !g)
while (f.length) delete u[f.pop()];
else f = [];
l = !1, g = !1
}
n = n || e.tags, t = t || "", typeof n == "string" && (n = n.split(p));
var r = c(n),
s = new w(t),
o = [],
u = [],
f = [],
l = !1,
g = !1,
S, x, T, N, C, k;
while (!s.eos()) {
S = s.pos, T = s.scanUntil(r[0]);
if (T)
for (var L = 0, A = T.length; L < A; ++L) N = T.charAt(L), i(N) ? f.push(u.length) : g = !0, u.push(["text", N, S, S + 1]), S += 1, N === "\n" && E();
if (!s.scan(r[0])) break;
l = !0, x = s.scan(m) || "name", s.scan(h), x === "=" ? (T = s.scanUntil(d), s.scan(d), s.scanUntil(r[1])) : x === "{" ? (T = s.scanUntil(new RegExp("\\s*" + a("}" + n[1]))), s.scan(v), s.scanUntil(r[1]), x = "&") : T = s.scanUntil(r[1]);
if (!s.scan(r[1])) throw new Error("Unclosed tag at " + s.pos);
C = [x, T, S, s.pos], u.push(C);
if (x === "#" || x === "^") o.push(C);
else if (x === "/") {
k = o.pop();
if (!k) throw new Error('Unopened section "' + T + '" at ' + S);
if (k[1] !== T) throw new Error('Unclosed section "' + k[1] + '" at ' + S)
} else x === "name" || x === "{" || x === "&" ? g = !0 : x === "=" && (r = c(n = T.split(p)))
}
k = o.pop();
if (k) throw new Error('Unclosed section "' + k[1] + '" at ' + s.pos);
return b(y(u))
}
function y(e) {
var t = [],
n, r;
for (var i = 0, s = e.length; i < s; ++i) n = e[i], n && (n[0] === "text" && r && r[0] === "text" ? (r[1] += n[1], r[3] = n[3]) : (t.push(n), r = n));
return t
}
function b(e) {
var t = [],
n = t,
r = [],
i, s;
for (var o = 0, u = e.length; o < u; ++o) {
i = e[o];
switch (i[0]) {
case "#":
case "^":
n.push(i), r.push(i), n = i[4] = [];
break;
case "/":
s = r.pop(), s[5] = i[2], n = r.length > 0 ? r[r.length - 1][4] : t;
break;
default:
n.push(i)
}
}
return t
}
function w(e) {
this.string = e, this.tail = e, this.pos = 0
}
function E(e, t) {
this.view = e == null ? {} : e, this.cache = {
".": this.view
}, this.parent = t
}
function S() {
this.cache = {}
}
var t = RegExp.prototype.test,
r = /\S/,
s = Object.prototype.toString,
o = Array.isArray || function(e) {
return s.call(e) === "[object Array]"
},
f = {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': "&quot;",
"'": "&#39;",
"/": "&#x2F;"
},
h = /\s*/,
p = /\s+/,
d = /\s*=/,
v = /\s*\}/,
m = /#|\^|\/|>|\{|&|=|!/;
w.prototype.eos = function() {
return this.tail === ""
}, w.prototype.scan = function(e) {
var t = this.tail.match(e);
if (t && t.index === 0) {
var n = t[0];
return this.tail = this.tail.substring(n.length), this.pos += n.length, n
}
return ""
}, w.prototype.scanUntil = function(e) {
var t = this.tail.search(e),
n;
switch (t) {
case -1:
n = this.tail, this.tail = "";
break;
case 0:
n = "";
break;
default:
n = this.tail.substring(0, t), this.tail = this.tail.substring(t)
}
return this.pos += n.length, n
}, E.prototype.push = function(e) {
return new E(e, this)
}, E.prototype.lookup = function(e) {
var t;
if (e in this.cache) t = this.cache[e];
else {
var n = this;
while (n) {
if (e.indexOf(".") > 0) {
t = n.view;
var r = e.split("."),
i = 0;
while (t != null && i < r.length) t = t[r[i++]]
} else t = n.view[e];
if (t != null) break;
n = n.parent
}
this.cache[e] = t
}
return u(t) && (t = t.call(this.view)), t
}, S.prototype.clearCache = function() {
this.cache = {}
}, S.prototype.parse = function(e, t) {
var n = this.cache,
r = n[e];
return r == null && (r = n[e] = g(e, t)), r
}, S.prototype.render = function(e, t, n) {
var r = this.parse(e),
i = t instanceof E ? t : new E(t);
return this.renderTokens(r, i, n, e)
}, S.prototype.renderTokens = function(t, n, r, i) {
function f(e) {
return a.render(e, n, r)
}
var s = "",
a = this,
l, c;
for (var h = 0, p = t.length; h < p; ++h) {
l = t[h];
switch (l[0]) {
case "#":
c = n.lookup(l[1]);
if (!c) continue;
if (o(c))
for (var d = 0, v = c.length; d < v; ++d) s += this.renderTokens(l[4], n.push(c[d]), r, i);
else if (typeof c == "object" || typeof c == "string") s += this.renderTokens(l[4], n.push(c), r, i);
else if (u(c)) {
if (typeof i != "string") throw new Error("Cannot use higher-order sections without the original template");
c = c.call(n.view, i.slice(l[3], l[5]), f), c != null && (s += c)
} else s += this.renderTokens(l[4], n, r, i);
break;
case "^":
c = n.lookup(l[1]);
if (!c || o(c) && c.length === 0) s += this.renderTokens(l[4], n, r, i);
break;
case ">":
if (!r) continue;
c = u(r) ? r(l[1]) : r[l[1]], c != null && (s += this.renderTokens(this.parse(c), n, r, c));
break;
case "&":
c = n.lookup(l[1]), c != null && (s += c);
break;
case "name":
c = n.lookup(l[1]), c != null && (s += e.escape(c));
break;
case "text":
s += l[1]
}
}
return s
}, e.name = "mustache.js", e.version = "0.8.1", e.tags = ["{{", "}}"];
var x = new S;
e.clearCache = function() {
return x.clearCache()
}, e.parse = function(e, t) {
return x.parse(e, t)
}, e.render = function(e, t, n) {
return x.render(e, t, n)
}, e.to_html = function(t, n, r, i) {
var s = e.render(t, n, r);
if (!u(i)) return s;
i(s)
}, e.escape = l, e.Scanner = w, e.Context = E, e.Writer = S
}),
function(e, t) {
e.classes = e.classes || {}, typeof define == "function" && define.amd ? define("FLOCK/classes/MenuPaginator", ["jquery", "greensock/TweenLite.min", "greensock/easing/EasePack.min", "greensock/plugins/CSSPlugin.min"], function() {
return e.classes.MenuPaginator = t()
}) : e.classes.MenuPaginator = t()
}(window.FLOCK = window.FLOCK || {}, function() {
var e = function(e) {
var t = 0,
n = this;
this.elements = {
wrapper: e.wrapper,
masker: $(e.wrapper).find(".paginatorMasker"),
list: $(e.wrapper).find("ul"),
prev: $('<p class="prev"></p>').appendTo(e.wrapper),
next: $('<p class="next"></p>').appendTo(e.wrapper)
}, this.elements.list.children("li").each(function() {
this.style.display !== "none" && (t += $(this).outerWidth(!0) + 1)
}), this.listWidth = t, this.elements.list[0].style.width = t + "px", $(this.elements.wrapper).on("click", ".prev, .next", function(e) {
e.preventDefault();
switch (this.className) {
case "prev on":
n.previous();
break;
case "next on":
n.next();
break;
default:
}
}), this.paginated = !1, this.currentPage = 1, this.numPages = 1, this.resize()
};
return e.prototype = {
paginate: function() {
this.paginated === !1 && (this.currentPage = 1, this.elements.prev[0].className = "prev off", this.elements.next[0].className = "next on", this.paginated = !0)
},
unpaginate: function() {
this.paginated === !0 && (this.currentPage = 1, this.elements.prev[0].className = "prev off", this.elements.next[0].className = "next off", this.elements.list[0].style.left = "0px", this.paginated = !1)
},
next: function() {
var e, t;
if (this.currentPage + 1 <= this.numPages) {
this.currentPage += 1;
if (this.currentPage === this.numPages) this.elements.next[0].className = "next off", t = this.elements.masker.width() - this.listWidth + "px", TweenLite.to(this.elements.list, 1, {
left: t,
ease: Power4.easeInOut
});
else {
e = -(this.elements.masker.width() - this.listWidth) - this.elements.masker.width() * (this.currentPage - 1);
if (e < 100) {
this.next();
return
}
t = -(this.elements.masker.width() * (this.currentPage - 1)) + "px", TweenLite.to(this.elements.list, 1, {
left: t,
ease: Power4.easeInOut
})
}
}
this.elements.prev[0].className = "prev on"
},
previous: function() {
var e;
if (this.currentPage - 1 >= 1) {
this.currentPage -= 1;
if (this.currentPage === 1) this.elements.prev[0].className = "prev off", TweenLite.to(this.elements.list, 1, {
left: "0px",
ease: Power4.easeInOut
});
else {
e = -parseInt(this.elements.list[0].style.left) - this.elements.masker.width() * (this.currentPage - 1);
if (e < 100) {
this.previous();
return
}
newleft = -(this.elements.masker.width() * (this.currentPage - 1)) + "px", TweenLite.to(this.elements.list, 1, {
left: newleft,
ease: Power4.easeInOut
})
}
}
this.elements.next[0].className = "next on"
},
resize: function() {
var e = this.elements.masker.width(),
t = -parseInt(this.elements.list[0].style.left) + this.elements.masker.width();
e < this.listWidth ? (this.numPages = Math.ceil(this.listWidth / e), isNaN(t) || (this.listWidth > t ? (this.currentPage = parseInt(this.elements.list[0].style.left) === 0 ? 1 : Math.ceil(-parseInt(this.elements.list[0].style.left) / this.elements.masker.width()) + 1, this.elements.next[0].className = "next on") : (this.elements.next[0].className = "next off", this.currentPage = this.numPages, this.elements.list[0].style.left = -(this.listWidth - this.elements.masker.width()) + "px")), this.paginate()) : this.unpaginate()
}
}, e
}),
function(e, t) {
e.classes = e.classes || {}, typeof define == "function" && define.amd ? define("FLOCK/classes/Menu", ["jquery", "mustache", "FLOCK/utils/DeviceDetect", "FLOCK/classes/MenuPaginator", "greensock/TweenLite.min", "greensock/TimelineLite.min", "greensock/easing/EasePack.min", "greensock/plugins/CSSPlugin.min"], function(n, r) {
return e.classes.Menu = t(n, r)
}) : e.classes.Menu = t($, Mustache)
}(window.FLOCK = window.FLOCK || {}, function(e, t) {
function s(t) {
this.verbose && console.log("Main Menu | " + this.menuID + " | init"), this.isHidden = !1, this.elements.listItems = this.elements.el.getElementsByTagName("li"), this.elements.selected = e('#menu a[data-section="' + t + '"]').addClass("selected"), this.selectMenuItem(this.elements.selected.data("section"), !1), this.hide(!0), this.resize()
}
function o() {
this.verbose && console.log("Main Menu | " + this.menuID + " | buildMenu");
switch (this.menuStyle) {
case "vertical":
u.call(this, this.menuList);
break;
case "horizontal":
this.menuStyle = "horizontal", a.call(this, this.menuList);
break;
default:
u.call(this, this.menuList)
}
}
function u(n) {
for (var r = 0; r < n.length; r++) {
var i = n[r];
if (String(i.visible).toLowerCase() == "false" || i.comingSoon == "true") continue;
var s = {},
o = !1;
i.className = "mainMenuBtn", i.type === "external" ? i.target = "_blank" : i.type === "popup" && (o = !0, i.rel = i.link + "," + i.dimensions[0] + "," + i.dimensions[1]);
for (var u = 0; u < FLOCK.app.dataSrc.sections.main.html.length; u++) FLOCK.app.dataSrc.sections.main.html[u].ID === i.label && (i.label = FLOCK.app.dataSrc.sections.main.html[u].VAL);
var a = e(t.render(this.template, i));
o && a.click(this.openPopUp);
var f = document.createElement("li");
f.appendChild(a.get()[0]), this.elements.el.appendChild(f)
}
}
function a(t) {
this.elements.wrapper.className = "horizontal paginatorWrapper " + this.elements.wrapper.className, this.elements.el.className = "centeredMenu", this.elements.paginatorEl.className = "paginatorMasker";
var n = !0;
for (var r = 0; r < t.length; r++) {
if (t[r].visible === !1) continue;
!n || (n = !1);
var i = document.createElement("li"),
s = document.createElement("a");
s.innerHTML = t[r].label, s.setAttribute("data-type", t[r].type), t[r].type === "external" && s.setAttribute("target", "_blank"), s.setAttribute("data-section", t[r].link), s.setAttribute("href", t[r].link), s.style.fontSize = t[r]["font-size"], t[r].type === "external" ? s.target = "_blank" : t[r].type === "popup" && (s.rel = t[r].link + "," + t[r].dimensions[0] + "," + t[r].dimensions[1], e(s).click(this.openPopUp)), i.appendChild(s), this.elements.el.appendChild(i)
}
var o = this;
window.setTimeout(function() {
o.menuPaginator = new FLOCK.classes.MenuPaginator({
wrapper: o.elements.wrapper
})
}, 50)
}
function f(t, r) {
this.verbose && console.log("Main Menu | " + this.menuID + " | selectMenuItem: " + t);
var i = e(this.elements.el).find('a[data-section="' + t + '"]');
if (i.length === 0) return;
this.elements.selected[0] && (this.elements.selected[0].className = ""), r = !0, n, this.elements.selectedID = t, this.elements.selected = i, this.elements.selected[0].className = "selected"
}
function l(e) {
this.verbose && console.log("Main Menu | " + this.menuID + " | hide");
if (this.isHidden === !0) return;
var t = .5;
e && (t = 0), this.isHidden = !0;
switch (this.menuStyle) {
case "horizontal":
TweenLite.to(this.elements.wrapper, t, {
y: -this.elements.wrapper.offsetHeight + "px",
ease: Power4.easeInOut
});
break;
case "vertical":
TweenLite.to(this.elements.wrapper, t, {
x: -this.elements.wrapper.offsetWidth + "px",
ease: Power4.easeInOut
});
break;
default:
console.log("invalid menustyle")
}
}
function c(e) {
e.preventDefault();
var t = String(e.target.rel).split(",");
return window.open(t[0], "_blank", "width=" + t[1] + ", height=" + t[2]), !1
}
function h(e) {
this.verbose && console.log("Main Menu | " + this.menuID + " | show");
if (this.isHidden === !1) return;
var t = .5;
e && (t = 0), this.isHidden = !1, document.getElementById("mainHeader").style.visibility = "visible";
switch (this.menuStyle) {
case "horizontal":
TweenLite.to(this.elements.wrapper, t, {
y: "0px",
ease: Power4.easeInOut
});
break;
case "vertical":
TweenLite.to(this.elements.wrapper, t, {
x: "0px",
ease: Power4.easeInOut
});
break;
default:
console.log("invalid menustyle")
}
}
function p() {
this.menuPaginator && this.menuPaginator.resize(FLOCK.settings.window_dimensions.width, FLOCK.settings.window_dimensions.height);
if (this.elements === undefined) return
}
var n = FLOCK.utils.DeviceDetect.isMobile,
r, i = function(e) {
this.menuID = e.menuID || "", this.verbose = !1, r = this, this.template = e.template ? e.template : '<a rel="{{{rel}}}" class="{{{className}}}" data-type="{{{type}}}" data-section="{{{link}}}" href="{{{link}}}" target="{{{target}}}" style="position: {{{position}}}; font-size: {{{font-size}}};">{{{label}}}</a>', this.elements = {
el: document.getElementById(e.menuID),
wrapper: document.getElementById(e.wrapperID),
paginatorEl: document.getElementById(e.paginatorElID)
}, this.menuList = e.menuList, this.menuStyle = e.menuStyle, e.menuList && this.buildMenu()
};
return i.prototype.init = s, i.prototype.openPopUp = c, i.prototype.hide = l, i.prototype.show = h, i.prototype.buildMenu = o, i.prototype.resize = p, i.prototype.selectMenuItem = f, i
}),
function(e, t) {
e.classes = e.classes || {}, typeof define == "function" && define.amd ? define("FLOCK/classes/EventHandlers", ["jquery", "FLOCK/utils/DeviceDetect", "FLOCK/classes/Menu", "greensock/TweenLite.min", "greensock/easing/EasePack.min", "greensock/plugins/CSSPlugin.min"], function() {
return e.classes.EventHandlers = t()
}) : e.classes.EventHandlers = t()
}(window.FLOCK = window.FLOCK || {}, function() {
function t(e) {
FLOCK.sections[FLOCK.app.navigation.current_section] && FLOCK.sections[FLOCK.app.navigation.current_section].mousemoveHandler && FLOCK.sections[FLOCK.app.navigation.current_section].mousemoveHandler(e)
}
function n(e) {
FLOCK.sections[FLOCK.app.navigation.current_section] && FLOCK.sections[FLOCK.app.navigation.current_section].mousewheelHandler && FLOCK.sections[FLOCK.app.navigation.current_section].mousewheelHandler(e)
}
function r(e) {
FLOCK.sections[FLOCK.app.navigation.current_section] && FLOCK.sections[FLOCK.app.navigation.current_section].scrollHandler && FLOCK.sections[FLOCK.app.navigation.current_section].scrollHandler(e)
}
function i(e) {
FLOCK.sections[FLOCK.app.navigation.current_section] && FLOCK.sections[FLOCK.app.navigation.current_section].keyHandler && FLOCK.sections[FLOCK.app.navigation.current_section].keyHandler(e)
}
function s(e) {
FLOCK.sections[FLOCK.app.navigation.current_section] && FLOCK.sections[FLOCK.app.navigation.current_section].touchStartHandler && FLOCK.sections[FLOCK.app.navigation.current_section].touchStartHandler(e)
}
function o(e) {
FLOCK.sections[FLOCK.app.navigation.current_section] && FLOCK.sections[FLOCK.app.navigation.current_section].touchMoveHandler && FLOCK.sections[FLOCK.app.navigation.current_section].touchMoveHandler(e)
}
function u(e) {
FLOCK.sections[FLOCK.app.navigation.current_section] && FLOCK.sections[FLOCK.app.navigation.current_section].touchEndHandler && FLOCK.sections[FLOCK.app.navigation.current_section].touchEndHandler(e)
}
var e = function(e) {};
return e.prototype.init = function(e) {
var a = $(window),
f = $(document);
f.on("keydown", i), a.on("scroll", r), window.addWheelListener(document, n), Modernizr.touch ? (f.on("touchstart", s), f.on("touchmove", o), f.on("touchend", u)) : a.on("mousemove", t)
}, new e
}),
function(e, t) {
e.classes = e.classes || {}, typeof define == "function" && define.amd ? define("FLOCK/classes/Navigation", ["jquery", "FLOCK/utils/SectionLoader", "FLOCK/utils/ArrayExecuter", "FLOCK/classes/Menu"], function() {
return e.classes.Navigation = t()
}) : e.classes.Navigation = t()
}(window.FLOCK = window.FLOCK || {}, function() {
function t(e) {
this.current_section = typeof e == "undefined" || e === "" ? "home" : e.split("/")[0]
}
function n(e, t, n) {
this.verbose && console.log("Navigation | changeSection: " + e + " | " + t);
if (!this.active) return;
if (this.current_section === e && !this.forceChange) {
t && FLOCK.sections[e].enterSubSection && FLOCK.sections[e].enterSubSection(t);
return
}
FLOCK.app.mainMenu && FLOCK.app.mainMenu.selectMenuItem(e), this.current_section != e && (this.previous_section = this.current_section), this.current_section = e, FLOCK.settings.deepLinking !== !1 && window.history && window.history.pushState && this.previous_section != "" && window.innerHeight != screen.height && history.pushState("data", "", this.current_section == "home" ? FLOCK.settings.base_path : FLOCK.settings.base_path + this.current_section + ".php"), this.load_queue(e), this.arrayExecuter.execute(this.assembleChangeFunction(n)), this.forceChange = !1
}
function r(e) {
var t = [{
fn: this.disable,
vars: [this.stepComplete]
}];
for (var n = 0; n < this.changeOrder.length; n++) switch (this.changeOrder[n]) {
case "load":
t.push({
fn: this.load,
vars: [this.stepComplete]
});
break;
case "section_add_next":
t.push({
fn: this.section_add,
vars: [this.current_section, this.stepComplete]
});
break;
case "section_init_next":
t.push({
fn: this.section_init,
vars: [this.current_section, this.stepComplete]
});
break;
case "section_startup_next":
t.push({
fn: this.section_startup,
vars: [this.current_section, this.stepComplete]
});
break;
case "section_show_next":
t.push({
fn: this.section_show,
vars: [this.current_section, this.stepComplete]
});
break;
case "section_hide_prev":
t.push({
fn: this.section_hide,
vars: [this.previous_section, this.stepComplete]
});
break;
case "section_shutdown_prev":
t.push({
fn: this.section_shutdown,
vars: [this.previous_section, this.stepComplete]
});
break;
case "section_remove_prev":
t.push({
fn: this.section_remove,
vars: [this.previous_section, this.stepComplete]
});
break;
default:
typeof this.changeOrder[n] == "function" ? t.push({
fn: this.changeOrder[n],
vars: [this.current_section, this.previous_section, this.stepComplete]
}) : console.log("assembleChangeFunction cannot add: " + this.changeOrder[n])
}
return t.push({
fn: this.enable,
vars: [this.stepComplete]
}), e && t.push({
fn: e,
vars: null
}), t
}
function i(e) {
var t = Array.prototype.slice.call(arguments);
for (var n = 0; n < t.length; n++) this.verbose && console.log("Navigation | load_queue: " + t[n]), FLOCK.utils.SectionLoader.sectionExists(t[n]) && this.loadlist.push(t[n]), FLOCK.sections[t[n]] && this.section_prepareLoad(t[n])
}
function s(e, t) {
this.verbose && console.log("Navigation | load");
var n = Array.prototype.slice.call(arguments);
n.shift(), n.length && this.load_queue(n);
for (var r = 0; r < n.length; r++) FLOCK.sections[sectionID].prepare && FLOCK.sections[sectionID].prepare();
this.loadlist.push(this.stepComplete);
var i = [{
fn: FLOCK.utils.SectionLoader.loadSection,
scope: FLOCK.utils.SectionLoader,
vars: this.loadlist
}, {
fn: this.load_done,
vars: null
}, {
fn: e,
vars: null
}];
this.arrayExecuter.execute(i)
}
function o() {
this.verbose && console.log("Navigation | load_done"), this.loadlist = [], this.stepComplete()
}
function u(e) {
this.verbose && console.log("Navigation | section_prepareLoad: " + e), FLOCK.sections[e].prepare && console.log("section " + e + " has prepare function"), FLOCK.sections[e].prepared || (FLOCK.sections[e].prepareLoad && FLOCK.sections[e].prepareLoad(), FLOCK.sections[e].prepared = !0)
}
function a(e, t) {
this.verbose && console.log("Navigation | section_add: " + e);
var n = FLOCK.sections[e] && FLOCK.sections[e].shell ? FLOCK.sections[e].shell : "#" + this.shell;
FLOCK.sections[e] && !FLOCK.sections[e].added && (FLOCK.sections[e].added = !0, FLOCK.sections[e].htmlElem = $(FLOCK.utils.SectionLoader.returnSectionOBJ(e).htmlData), $(n).append(FLOCK.sections[e].htmlElem)), t()
}
function f(e, t) {
this.verbose && console.log("Navigation | section_init: " + e);
if (!FLOCK.sections[e].initialized) {
FLOCK.sections[e].initialized = !0;
if (FLOCK.sections[e].init) {
FLOCK.sections[e].init(t);
return
}
}
t()
}
function l(e, t) {
this.verbose && console.log("Navigation | section_startup: " + e);
if (FLOCK.sections[e])
if (FLOCK.sections[e].startup) FLOCK.sections[e].startup(t);
else {
var n = document.getElementById(e);
n && (n.style.display = "block"), t()
} else t()
}
function c(e, t) {
this.verbose && console.log("Navigation | section_show: " + e), FLOCK.sections[e] && FLOCK.sections[e].show ? FLOCK.sections[e].show(t) : t()
}
function h(e, t) {
this.verbose && console.log("Navigation | section_hide " + e);
if (FLOCK.sections[e])
if (FLOCK.sections[e].hide) FLOCK.sections[e].hide(t);
else {
var n = document.getElementById(e);
n && (n.style.display = "none"), t()
} else t()
}
function p(e, t) {
this.verbose && console.log("Navigation | section_shutdown: " + e), FLOCK.sections[e] && FLOCK.sections[e].shutdown ? FLOCK.sections[e].shutdown(t) : t()
}
function d(e, t) {
this.verbose && console.log("Navigation | section_remove " + e);
if (!FLOCK.sections[e]) {
t();
return
}
var n = FLOCK.sections[e] && FLOCK.sections[e].shell ? FLOCK.sections[e].shell : "#" + this.shell;
FLOCK.sections[e].destroy && (FLOCK.sections[e].destroy(), FLOCK.sections[e].initialized = !1), FLOCK.sections[e].added && (FLOCK.sections[e].added = !1, $(FLOCK.sections[e].htmlElem).remove(), FLOCK.sections[e].htmlElem = null), t()
}
function v(e) {
this.verbose && console.log("/////// navigation_enable /////////"), this.active = !0, this.cover && (this.cover.style.display = "none"), e && e()
}
function m(e) {
this.verbose && console.log("/////// navigation_disable /////////"), this.active = !1, this.cover && (this.cover.style.display = "block"), e && e()
}
function g() {
this.verbose && console.log("navigation_freezeSite"), FLOCK.sections[sectionID].freeze && FLOCK.sections[sectionID].freeze()
}
function y() {
this.verbose && console.log("navigation_unFreezeSite"), FLOCK.sections[sectionID].unfreeze && FLOCK.sections[sectionID].unfreeze()
}
function b() {
this.verbose && console.log("navigation_unFreezeSiteDone")
}
var e = function(e) {
this.shell = e || "shell", this.verbose = !1, this.current_section = "", this.previous_section = "", this.forceChange = !1, this.loadlist = [], this.arrayExecuter = new FLOCK.utils.ArrayExecuter(this, "navigation"), this.stepComplete = this.arrayExecuter.stepComplete.bind(this.arrayExecuter), this.active = !0, this.changeOrder = ["load", "section_add_next", "section_init_next", "section_hide_prev", "section_shutdown_prev", "section_startup_next", "section_show_next"]
};
return e.prototype.parseDeepLink = t, e.prototype.changeSection = n, e.prototype.assembleChangeFunction = r, e.prototype.load_queue = i, e.prototype.load = s, e.prototype.load_done = o, e.prototype.section_prepareLoad = u, e.prototype.section_add = a, e.prototype.section_init = f, e.prototype.section_startup = l, e.prototype.section_show = c, e.prototype.section_hide = h, e.prototype.section_shutdown = p, e.prototype.section_remove = d, e.prototype.enable = v, e.prototype.disable = m, e
}),
function(e, t) {
e.app = e.app || {}, typeof define == "function" && define.amd ? define("app/LandingLoader", ["greensock/TweenMax.min"], function() {
return e.app.LandingLoader = t()
}) : e.app.LandingLoader = t()
}(window.FLOCK = window.FLOCK || {}, function() {
function n() {
var e = document.createElement("div");
return e.id = "default_loader", e
}
function r() {
var e = document.createElement("div");
return e.id = "loader_bar", e
}
function i(e) {
return this.progressBar.style.width = e * 100 + "%", this.loaderText.style.left = e * 100 + "%", this.animComplete
}
function s(e) {
var t = this;
TweenLite.to(this.elem, .5, {
autoAlpha: 1
}), $(".blurred").removeClass("blur-out"), document.getElementById("loaderLogo").style.visibility = "visible", TweenMax.to($("#loaderBg"), 1, {
autoAlpha: 1,
delay: .5,
onComplete: e
}), TweenMax.fromTo($("#i1"), 1, {
autoAlpha: 0
}, {
autoAlpha: 1
}), TweenMax.fromTo($("#i2"), 1, {
autoAlpha: 0
}, {
autoAlpha: 1,
delay: .5
}), TweenMax.fromTo($("#i3"), 1, {
autoAlpha: 0
}, {
autoAlpha: 1,
delay: 1
}), TweenMax.fromTo($("#i1"), 1, {
x: 100
}, {
x: 0,
ease: Expo.easeOut,
delay: 1.5
}), TweenMax.fromTo($("#i2"), 1, {
x: 33
}, {
x: 0,
ease: Expo.easeOut,
delay: 1.5
}), TweenMax.staggerFromTo($(".blurred"), .5, {
autoAlpha: 0
}, {
autoAlpha: 1,
delay: 2,
onStart: function() {
$(".blurred").addClass("blur-out")
}
}, .1), TweenMax.fromTo($("#i4"), 2, {
x: -25,
autoAlpha: 0
}, {
x: 0,
autoAlpha: 1,
ease: Expo.easeOut,
delay: 2.5,
onComplete: function() {
t.animComplete = !0
}
})
}
function o(e) {
TweenLite.to(this.elem, .5, {
autoAlpha: 0,
onComplete: function() {
u.apply(this), e()
}
})
}
function u() {
console.log("RESET LOADER")
}
function a() {}
var e = "LandingLoader",
t = function() {
this.id = "LandingLoader", this.animComplete = !1, this.elem = document.getElementById("insidiousLoader"), this.progressBar = document.getElementById("loaderBar"), this.loaderText_before = "", this.loaderText_after = "%", this.loaderText = document.createElement("h2"), this.loaderText.id = "loaderText", this.elem.appendChild(this.loaderText), FLOCK.settings.instaLoad ? this.elem.style.display = "none" : this.elem.style.display = "block"
};
return t.prototype.resize = a, t.prototype.onProgress = i, t.prototype.bringIn = s, t.prototype.goOut = o, t
}),
function(e, t) {
e.app = e.app || {}, typeof define == "function" && define.amd ? define("app/RoomLoader", [], function() {
return e.app.RoomLoader = t()
}) : e.app.RoomLoader = t()
}(window.FLOCK = window.FLOCK || {}, function() {
function n() {
var e = document.createElement("div");
return e.id = "default_loader", e.style.position = "absolute", e.style.zIndex = 200, e.style.width = "100%", e.style.height = "4px", e
}
function r() {
var e = document.createElement("div");
return e.id = "loader_bar", e.style.position = "absolute", e.style.top = "0px", e.style.left = "0px", e.style.height = "100%", e.style.width = "0%", e.style.background = "#FF0000", e
}
function i() {}
var e = "RoomLoader",
t = function() {
this.id = "RoomLoader", this.elem = n(), $("body").append($(this.elem)), this.progressBar = r(), this.elem.appendChild(this.progressBar), this.loaderText_before = "LOADING: ", this.loaderText_after = "% COMPLETE", this.loaderText = document.createElement("h2"), this.loaderText.id = "loaderText", this.elem.appendChild(this.loaderText), this.elem.style.display = "block", this.elem.style.visibility = "hidden"
};
return t.prototype.resize = i, t
}), FLOCK = FLOCK || {}, FLOCK.utils = FLOCK.utils || {}, FLOCK.utils.inherit = function() {
var e = function() {};
return function(t, n) {
e.prototype = n.prototype, t.prototype = new e, t.prototype._super = n, t.prototype.constructor = t
}
}(), define("FLOCK/utils/Inherit", function() {}),
function(e, t) {
e.app = e.app || {}, typeof define == "function" && define.amd ? define("app/Menu", ["FLOCK/classes/Menu", "FLOCK/utils/Inherit"], function() {
return e.app.Menu = t()
}) : e.app.Menu = t()
}(window.FLOCK = window.FLOCK || {}, function() {
var e, t = FLOCK.utils.DeviceDetect.isMobile,
n, r, i = function(t) {
console.log("main menu"), e = this, this.elements = {
el: document.getElementById(t.menuID),
wrapper: document.getElementById(t.wrapperID),
paginatorEl: document.getElementById(t.paginatorElID)
}, this.elements.listItems = this.elements.el.getElementsByTagName("li"), this.menuList = t.menuList, this.menuStyle = t.menuStyle, t.menuList && this.buildMenu()
};
return FLOCK.utils.inherit(i, FLOCK.classes.Menu), i
}),
function(e, t) {
e.classes = e.classes || {}, typeof define == "function" && define.amd ? define("FLOCK/classes/Footer", ["jquery", "mustache", "FLOCK/utils/DeviceDetect", "greensock/TweenLite.min", "greensock/easing/EasePack.min", "greensock/plugins/CSSPlugin.min"], function(n, r) {
return e.classes.Footer = t(n, r)
}) : e.classes.Footer = t($, Mustache)
}(window.FLOCK = window.FLOCK || {}, function(e, t) {
function u(n) {
s = FLOCK.app.dataSrc.sections.main.data;
var r = '{{#links}}{{#VISIBLE}}<li><a class="footer-btn" {{#font-size}}style="font-size:{{font-size}}"{{/font-size}} href="{{URL}}" target="_blank" >{{LABEL}}</a></li>{{/VISIBLE}}{{/links}}';
t.parse(r), this.elements = {
el: n
};
var i = s.footerLinks || [],
o, u;
for (var a = 0; a < i.length; a++) u = t.render(r, {
links: i[a].links
}), o = document.getElementById(i[a].id), o.innerHTML = u;
e("#credits-button").on("click", this.toggleCredits.bind(this)), document.getElementById("creditsbox-close") && e("#creditsbox-close").on("click", l), this.initFollow(s), this.initShare(s), this.init_extend && this.init_extend(s)
}
function a() {
var t = FLOCK.app.dataSrc.sections.main.data,
n = t.MPAA_requirements,
r = e("#MPAA_requirements");
if (!n.VISIBLE || n.VISIBLE === "false") return;
FLOCK.settings.mpaaShown = !0, TweenLite.to(r, 1, {
css: {
bottom: 0
},
ease: Power4.easeInOut
});
var i = this;
window.setTimeout(function() {
i.hideMPAARequirements()
}, 6e3)
}
function f() {
var t = e("#MPAA_requirements");
TweenLite.to(t, 1, {
css: {
bottom: -200
},
ease: Power4.easeInOut
})
}
function l(t) {
var n = document.getElementById("credits"),
r = document.getElementById("credits-button"),
i = e(n).outerHeight();
r.className.match("active") !== null || t === "close" ? (r.className = r.className.replace("active", ""), TweenLite.to(n, .5, {
bottom: -i + "px",
ease: Power4.easeInOut,
onUpdate: function() {
r.style.top = Math.min(0, Math.abs(parseInt(n.style.bottom)) - (i - 30)) + "px"
},
onComplete: function() {
r.style.zIndex = 1, n.style.zIndex = 0
}
})) : (r.className = r.className + " active", r.style.zIndex = 10, n.style.zIndex = 9, TweenLite.to(n, .5, {
bottom: "0px",
ease: Power4.easeInOut,
onUpdate: function() {
r.style.top = Math.min(0, Math.abs(parseInt(n.style.bottom)) - (i - 30)) + "px"
}
}), document.getElementById("sharelabel").className.match("active") && this.toggleShare());
if (t) return !1
}
function c(e) {
var t = e.footerFollowUs;
if (t) {
var n = document.getElementById("follow");
if (String(t["VISIBLE"]).toLowerCase() == "false") n.style.display = "none";
else
for (var r = 0; r < t.links.length; r++)
if (String(t.links[r]["VISIBLE"]).toLowerCase() == "true") {
var i = document.createElement("a");
i.className = "icon-" + t.links[r].CLASS + " social-icon", i.target = "_blank", i.href = t.links[r].URL, n.appendChild(i)
}
}
}
function h(t) {
var n = t.footerShare;
if (n)
if (String(n["VISIBLE"]).toLowerCase() == "false") e("#share").css("display", "none");
else {
var r = [{
JSON_ID: "getGlue",
HTML_ID: "getGlueBtn"
}, {
JSON_ID: "googlePlus",
HTML_ID: "gPlusBtn"
}, {
JSON_ID: "tweet",
HTML_ID: "tweetBtn"
}, {
JSON_ID: "facebook_like",
HTML_ID: "fbLikeBtn"
}, {
JSON_ID: "facebook_share",
HTML_ID: "share-facebook"
}];
for (var s = 0; s < r.length; s++) {
var o = r[s],
u = n["show_buttons"][o["JSON_ID"]].toLowerCase() == "true" ? "inherit" : "none";
e("#" + o.HTML_ID).css("display", u)
}
}
e("#share-facebook").on("click", function(t) {
window.open("http://www.facebook.com/share.php?u=" + encodeURIComponent(e(this).attr("href")), "_blank"), t.preventDefault()
}), e("#sharelabel").on("click", this.toggleShare.bind(this)), e("#shareShelf").css("top", FLOCK.settings.footer_height + "px"), e("#shareShelfContents").css("width", "auto"), i = e("#shareShelfContents").width() + 10, e("#shareShelfContents").css("width", i + "px")
}
function p(t) {
var n = e("#shareShelf"),
r = document.getElementById("sharelabel"),
i = e("#shareShelfContents"),
s = n.outerHeight();
n[0].className.match("active") !== null || t === "close" ? (n[0].className = n[0].className.replace("active", ""), r.className = r.className.replace("active", ""), TweenLite.to(n, .5, {
top: FLOCK.settings.footer_height + "px",
ease: Power4.easeInOut
}), TweenLite.to(r, .5, {
top: "0px",
ease: Power4.easeInOut,
onComplete: function() {
n[0].style.zIndex = 0, r.style.zIndex = 1, document.getElementById("share").style.zIndex = 0
}
})) : (n[0].className = n[0].className + " active", r.className = r.className + " active", n[0].style.zIndex = 10, r.style.zIndex = 11, document.getElementById("share").style.zIndex = 9, TweenLite.to(n, .5, {
top: -(s - FLOCK.settings.footer_height) + "px",
ease: Power4.easeInOut
}), TweenLite.to(r, .5, {
top: -(s - FLOCK.settings.footer_height) + "px",
ease: Power4.easeInOut
}), document.getElementById("credits-button").className.match("active") && this.toggleCredits());
if (t) return !1
}
function d(e) {
console.log("FOOTER | attachSocialScripts"), v(), m(), g(), e && e()
}
function v() {
var e = document.createElement("script");
e.src = "//widgets.getglue.com/checkin.js";
var t = document.getElementsByTagName("script")[0];
t.parentNode.insertBefore(e, t)
}
function m() {
window.twttr = function(e, t, n) {
var r, i, s = e.getElementsByTagName(t)[0];
if (e.getElementById(n)) return;
return i = e.createElement(t), i.id = n, i.src = "https://platform.twitter.com/widgets.js", s.parentNode.insertBefore(i, s), window.twttr || (r = {
_e: [],
ready: function(e) {
r._e.push(e)
}
})
}(document, "script", "twitter-wjs"), twttr.ready(function(e) {
e.events.bind("click", function() {
videos_pause()
})
})
}
function g() {
var e, t = document.getElementById("gPlusBtn");
if (t) {
e = document.createElement("g:plusone"), e.setAttribute("size", "medium"), e.setAttribute("annotation", "none"), e.setAttribute("href", FLOCK.settings.base_url), t.appendChild(e);
var n = document.createElement("script");
n.type = "text/javascript", n.async = !0, n.src = "https://apis.google.com/js/plusone.js";
var r = document.getElementsByTagName("script")[0];
r.parentNode.insertBefore(n, r)
}
}
function y(e, t) {
console.log("resize footer")
}
function b() {
this.toggleShare("close"), this.toggleCredits("close")
}
function w() {
TweenLite.to(this.elements.el, .25, {
bottom: -FLOCK.settings.footer_height + "px",
ease: Power2.easeInOut,
onComplete: function() {}
})
}
function E() {
TweenLite.to(this.elements.el, .25, {
bottom: "0px",
ease: Power2.easeInOut
})
}
var n, r = FLOCK.utils.DeviceDetect.isMobile,
i, s, o = function(e) {
n = this
};
return o.prototype.initFollow = c, o.prototype.initShare = h, o.prototype.toggleShare = p, o.prototype.toggleCredits = l, o.prototype.attachSocialScripts = d, o.prototype.closeMenus = b, o.prototype.init = u, o.prototype.hide = w, o.prototype.show = E, o.prototype.resize = y, o.prototype.showMPAARequirements = a, o.prototype.hideMPAARequirements = f, o
}), define("app/FacebookConnect", ["jquery", "FLOCK/utils/ArrayExecuter"], function(e) {
function t() {
this.initialized = !1, this.loggedIn = !1, this.ready = !1, this.arrayExecuter = new FLOCK.utils.ArrayExecuter
}
function o() {
this.initialized || (FB.init({
appId: s,
photo_upload: !0,
cookie: !0,
xfbml: !0,
version: "v2.1"
}), this.initialized = !0)
}
function u(e) {
o.apply(this);
var t = this;
FB.login(function(n) {
n.status === "connected" ? t.loggedIn = !0 : n.status === "not_authorized", e && e(t.loggedIn)
}, {
scope: "public_profile,user_likes,user_relationships,user_photos",
auth_type: "rerequest"
})
}
function a(t) {
if (this.share_img) return this.share_img;
var n = function() {
var e = this.share_canvas.getContext("2d"),
n = this.share_canvas.width - (this.share_tt.width + 84),
r = this.share_canvas.height - (this.share_tt.height + 84);
e.drawImage(this.share_tt, n, r), this.share_img = new Image, this.share_img.src = this.share_canvas.toDataURL(), t(this.share_img)
},
r = new Image,
i = room.crack.canvas,
s = room.crack.drawArea;
s.w *= FLOCK.app.name.scale, s.h *= FLOCK.app.name.scale;
var o = new Image;
e(o).on("load", function() {
this.share_tt = o, this.share_canvas && n.apply(this)
}.bind(this)), o.src = FLOCK.app.dataSrc.sections.endscreen.data.share_tt_src, e(r).on("load", function() {
this.share_canvas = document.createElement("canvas");
var e = this.share_canvas.getContext("2d");
this.share_canvas.width = 2067, this.share_canvas.height = 1163, e.drawImage(r, 0, 0);
var t = 0,
o = .4552083333 * s.h,
u = s.w,
a = .5447916667 * s.h,
f = .2380261248 * this.share_canvas.width,
l = .2837489252 * this.share_canvas.height,
c = .4179970972 * this.share_canvas.width,
h = .4041272571 * this.share_canvas.height;
e.drawImage(i, t, o, u, a, f, l, c, h), this.share_tt && n.apply(this)
}.bind(this)), r.src = FLOCK.app.dataSrc.sections.endscreen.data.share_img
}
function f() {
if (this.blob) return this.blob;
var e, t, n;
return e = this.share_canvas.toDataURL("image/png"), t = c(e), t
}
function l() {
blob = this.getBlob();
var t = new FormData,
n = FB.getAuthResponse().accessToken;
t.append("source", blob), t.append("access_token", n), e.ajax({
url: "https://graph.facebook.com/me/photos?access_token=" + n,
type: "POST",
data: t,
processData: !1,
contentType: !1,
cache: !1,
success: function(e) {
console.log("success " + e)
},
error: function(e, t, n) {
console.log("error " + n + " Status " + e.status)
},
complete: function() {
console.log("Posted to facebook")
}
})
}
function c(e) {
var t;
e.split(",")[0].indexOf("base64") >= 0 ? t = atob(e.split(",")[1]) : t = unescape(e.split(",")[1]);
var n = e.split(",")[0].split(":")[1].split(";")[0],
r = new Uint8Array(t.length);
for (var i = 0; i < t.length; i++) r[i] = t.charCodeAt(i);
return new Blob([r], {
type: n
})
}
function h(e) {
if (this.ready) {
e && e();
return
}
console.log("Welcome! Fetching your information.... ");
var t = [{
fn: d,
scope: this,
vars: [this.arrayExecuter.stepComplete.bind(this.arrayExecuter)]
}, {
fn: m,
scope: this,
vars: [this.arrayExecuter.stepComplete.bind(this.arrayExecuter)]
}, {
fn: v,
scope: this,
vars: [this.arrayExecuter.stepComplete.bind(this.arrayExecuter)]
}, {
fn: g,
scope: this,
vars: [this.arrayExecuter.stepComplete.bind(this.arrayExecuter)]
}, {
fn: p,
scope: this,
vars: [e]
}];
this.arrayExecuter.execute(t)
}
function p(e) {
this.ready = !0, e && e()
}
function d(e) {
if (this.profile) return this.profile;
var t = this;
FB.api("/me", function(n) {
t.profile = n, e && e()
})
}
function v(e) {
var t = this;
this.famPics = [], this.bedsidePhoto = [], FB.api("/me/photos", function(n) {
var r = n.data,
i, s, o = t.profile.id,
u = !1,
a = !1,
f, l = [],
c = [];
if (r.length === 0) {
e && e();
return
}
t.profile.significant_other ? s = t.profile.significant_other.id : s = t.familyIds;
for (var h = 0; h < r.length; h++) {
if (!r[h].tags) continue;
i = r[h].tags.data;
if (i.length <= 1 || i.length > 5) continue;
for (var p = 0; p < i.length; p++) i[p].id === o && (a = !0), typeof s == "string" ? i[p].id === s && (u = !0) : s.indexOf(i[p].id) > -1 && (u = !0), a && (u && i.length === 2 ? l.push(r[h]) : c.push(r[h]), a = !1, u = !1)
}
l.length > 0 && (l.sort(b), t.bedsidePhoto.push(E(300, 300, l.shift().images))), c = c.concat(l);
if (c.length > 0) {
c.sort(b);
for (var h = 0; h < c.length; h++) t.famPics.push(E(300, 300, c[h].images))
}
e && e()
})
}
function m(e) {
var t = this,
n = ["mother", "father", "sister", "brother", "son", "daughter", "wife", "husband"];
t.familyIds = [], FB.api("/me/family", function(r) {
for (var i = 0; i < r.data.length; i++) n.indexOf(r.data[i].relationship) > -1 && t.familyIds.push(r.data[i].id);
e && e()
})
}
function g(e) {
var t = this,
n = [],
r = 0;
t.bandPosters = [], FB.api("/me/music", function(i) {
r = i.data.length, postersLoaded = 0, r === 0 && e && e();
for (var s = 0; s < r; s++) FB.api("/" + i.data[s].id, function(i) {
n.push(i);
if (n.length === r) {
n.sort(w);
for (var s = 0; s < n.length; s++) y(n[s].id, 300, 300, function(r) {
this.poster = r, postersLoaded++;
if (postersLoaded === n.length - 1) {
for (var i = 0; i < n.length; i++) n[i].poster && t.bandPosters.push(n[i].poster);
e && e()
}
}.bind(n[s]), i)
}
})
})
}
function y(e, t, n, r, i) {
var s;
FB.api(e + "/picture?width=" + t + "&type=normal", function(e) {
r && (e.data.is_silhouette ? r(!1) : r(e.data.url))
})
}
function b(e, t) {
return e.likes ? t.likes ? e.likes.data.length > t.likes.data.length ? -1 : e.likes.data.length < t.likes.data.length ? 1 : 0 : -1 : -1
}
function w(e, t) {
return e.likes > t.likes ? -1 : e.likes < t.likes ? 1 : 0
}
function E(e, t, n) {
var r = {
width: 0,
height: 0
};
for (var i = 0; i < n.length; i++) n[i].width < e && n[i].height < t && n[i].width * n[i].height > r.width * r.height && (r = n[i]);
return r.source
}
window.FLOCK = window.FLOCK || {}, FLOCK.utils = FLOCK.utils || {};
var n = "833816713349434",
r = "874106459320459",
i = "878004795597292",
s;
window.location.href.match("legacy.theflock.com") ? s = n : window.location.href.match("localhost") ? s = i : s = n, t.prototype.login = u, t.prototype.connect = h, t.prototype.init = o, t.prototype.postCrack = l, t.prototype.getShareImg = a, t.prototype.getBlob = f, window.fbAsyncInit = function() {}, FLOCK.app.FacebookConnect = new t,
function(e, t, n) {
var r, i = e.getElementsByTagName(t)[0];
if (e.getElementById(n)) return;
r = e.createElement(t), r.id = n, r.src = "//connect.facebook.net/en_US/sdk.js", i.parentNode.insertBefore(r, i)
}(document, "script", "facebook-jssdk")
}),
function(e, t) {
e.app = e.app || {}, typeof define == "function" && define.amd ? define("app/Footer", ["jquery", "mustache", "FLOCK/classes/Footer", "FLOCK/utils/Inherit", "app/FacebookConnect", "greensock/TweenLite.min", "greensock/easing/EasePack.min", "greensock/plugins/CSSPlugin.min"], function(n, r) {
return e.app.Footer = t(n, r)
}) : e.app.Footer = t($, Mustache)
}(window.FLOCK = window.FLOCK || {}, function(e, t) {
function l(e) {
this.initLogos(e), FLOCK.app.FacebookConnect.init()
}
function c(e) {
var n = '{{#logos}}{{#VISIBLE}}<li>{{#URL}}<a href="{{URL}}" target="_blank" >{{/URL}}<img src="{{LOGO}}" alt="Logo" />{{#URL}}</a>{{/URL}}</li>{{/VISIBLE}}{{/logos}}';
t.parse(n);
var r = e.footerLogos,
i;
if (r) {
var s = document.getElementById("footer"),
o;
String(r.VISIBLE).toLowerCase() !== "false" && (o = document.createElement("ul"), o.id = "footerLogos", i = t.render(n, {
logos: r.logos
}), o.innerHTML = i, s.appendChild(o))
}
}
function h(e) {
var n = '{{#links}}{{#VISIBLE}}<a class="icon-{{CLASS}} social-icon" href="{{URL}}" target="_blank" ></a>{{/VISIBLE}}{{/links}}';
t.parse(n);
var r = e.footerFollowUs;
if (r) {
var i = document.getElementById("follow_icons");
if (String(r["VISIBLE"]).toLowerCase() == "false") document.getElementById("follow").style.display = "none";
else
for (var s = 0; s < r.links.length; s++) String(r.links[s]["VISIBLE"]).toLowerCase() == "true" && (i.innerHTML = t.render(n, {
links: r.links
}))
}
}
function p(t) {
var n = t.footerShare;
if (n)
if (String(n["VISIBLE"]).toLowerCase() == "false") e("#share").css("display", "none");
else {
var r = [{
JSON_ID: "getGlue",
HTML_ID: "getGlueBtn"
}, {
JSON_ID: "googlePlus",
HTML_ID: "gPlusBtn"
}, {
JSON_ID: "tweet",
HTML_ID: "tweetBtn"
}, {
JSON_ID: "facebook_like",
HTML_ID: "fbLikeBtn"
}, {
JSON_ID: "facebook_share",
HTML_ID: "share-facebook"
}];
for (var i = 0; i < r.length; i++) {
var s = r[i];
n.show_buttons[s.JSON_ID].toLowerCase() === "false" && e("#" + s.HTML_ID).css("display", "none")
}
}
e("#sharelabel").on("click touchend", this.toggleShare.bind(this)), e("#sharelabel").on("mouseenter", function() {
room.cursor && room.cursor.over()
}), e("#sharelabel").on("mouseleave", function() {
room.cursor && room.cursor.out()
}), e("#share").on("mouseenter", function() {
u = !1
}), e("#share").on("mouseleave", function() {
o = Date.now() + 500, u = !0, v()
}), e("#follow").on("mouseenter", function() {
a = !1
}), e("#follow").on("mouseleave", function() {
o = Date.now() + 500, a = !0, y()
}), e("#follow_label").on("click touchend", this.toggleFollow.bind(this)), e("#follow_label").on("mouseenter", function() {
room.cursor && room.cursor.over()
}), e("#follow_label").on("mouseleave", function() {
room.cursor && room.cursor.out()
});
if (FLOCK.utils.DeviceDetect.isIOS || FLOCK.utils.DeviceDetect.isAndroid) e("#follow_icons a").on("touchend", function() {
var t = e(this).attr("href");
return t && window.open(t, "_blank"), !1
}), e("#centerLinks a").on("touchend", function() {
var t = e(this).attr("href");
return t && window.open(t, "_blank"), !1
})
}
function d() {
e("#share").addClass("open")
}
function v() {
if (!u) return;
if (o > Date.now()) {
window.requestAnimationFrame(v);
return
}
e("#share").removeClass("open")
}
function m(t) {
o = 0, e("#share").hasClass("open") ? (u = !0, v()) : (d(), y()), t && t.preventDefault()
}
function g() {
e("#follow").addClass("open")
}
function y() {
if (!a) return;
if (o > Date.now()) {
window.requestAnimationFrame(y);
return
}
e("#follow").removeClass("open")
}
function b(t) {
o = 0, e("#follow").hasClass("open") ? (a = !0, y()) : (g(), v()), t && t.preventDefault()
}
function w() {
TweenLite.set(this.elements.el, {
autoAlpha: 0,
bottom: "-20px"
}), TweenLite.to(this.elements.el, 1.25, {
autoAlpha: 1,
bottom: "0px",
ease: Power2.easeInOut
})
}
var n, r = FLOCK.utils.DeviceDetect.isMobile,
i, s, o = 0,
u = !0,
a = !0,
f = function(e) {
n = this
};
return FLOCK.utils.inherit(f, FLOCK.classes.Footer), f.prototype.show = w, f.prototype.initLogos = c, f.prototype.initShare = p, f.prototype.initFollow = h, f.prototype.toggleShare = m, f.prototype.toggleFollow = b, f.prototype.init_extend = l, new f
}),
function(e, t) {
e.classes = e.classes || {}, typeof define == "function" && define.amd ? define("FLOCK/classes/Shell", ["jquery", "FLOCK/utils/DeviceDetect", "FLOCK/classes/Menu", "greensock/TweenLite.min", "greensock/easing/EasePack.min", "greensock/plugins/CSSPlugin.min"], function() {
return e.classes.Shell = t()
}) : e.classes.Shell = t()
}(window.FLOCK = window.FLOCK || {}, function() {
function t(e) {
console.log("Shell Init");
var t = FLOCK.utils.SectionLoader.returnSectionOBJ("main");
$("#shell").append($(t.htmlData)), window.requestAnimationFrame(function() {
this.ready(e)
}.bind(this))
}
function n(e) {
console.log("Shell ready"), this.initialized = !0, FLOCK.app.Footer.init(document.getElementById("footer")), FLOCK.app.navigation.current_section !== "videos" && FLOCK.app.Footer.show(), this.setupMenu(), this.resize(), e()
}
function r() {
var e = {
menuID: "menu",
wrapperID: "mainHeader",
paginatorElID: "mainNav",
menuStyle: FLOCK.app.dataSrc.sections.main.data.menu.menuStyle,
menuList: FLOCK.app.dataSrc.sections.main.data.menu.links
},
t = document.getElementById("menuTemplate");
t && (e.template = t.innerHTML), FLOCK.app.mainMenu = new FLOCK.classes.Menu(e), FLOCK.app.mainMenu.init(FLOCK.app.navigation.current_section), $("#menu").on("click", "a", function(e) {
if (this.getAttribute("target") === "_blank") return;
var t = $(this).data("section");
return this.getAttribute("data-type") === "overlay" ? FLOCK.functions.showOverlay(t) : FLOCK.app.navigation.changeSection(t), !1
})
}
function i() {
if (!this.initialized) return;
var e, t;
FLOCK.settings.window_dimensions = {
width: this.elements.window.width(),
height: this.elements.window.height()
}, e = Math.max(FLOCK.settings.min_width, FLOCK.settings.window_dimensions.width), t = Math.max(FLOCK.settings.min_height, FLOCK.settings.window_dimensions.height), this.elements.shell[0].style.width = e + "px", document.documentElement.className.match(/^(?=.*\bipad\b)(?=.*\bios7\b)/) || (this.elements.shell[0].style.height = t + "px"), FLOCK.app.mainMenu && FLOCK.app.mainMenu.elements && (FLOCK.settings.menu_width = FLOCK.app.mainMenu.elements.el.offsetWidth);
if (FLOCK.settings.isAndroid || FLOCK.settings.isMobile || FLOCK.settings.isIOS) {
var n = e > t ? !0 : !1,
r = document.getElementById("portraitTest");
r && (n ? (r.style.display = "none", FLOCK.settings.isIpad && (t = FLOCK.settings.window_dimensions.height = 672)) : r.style.display = "block"), e != 1e3 && (t *= 1e3 / e, e = 1e3)
}
FLOCK.settings.sectionWidth = e, FLOCK.app.BGRenderer && FLOCK.app.BGRenderer.resize(), FLOCK.sections[FLOCK.app.navigation.current_section] && FLOCK.sections[FLOCK.app.navigation.current_section].initialized && FLOCK.sections[FLOCK.app.navigation.current_section].resize(e, t), FLOCK.app.mainMenu && (FLOCK.settings.menu_width = FLOCK.app.mainMenu.resize()), FLOCK.settings.window_dimensions.width < FLOCK.settings.min_width || FLOCK.settings.window_dimensions.height < FLOCK.settings.min_height ? this.elements.shell[0].style.position = "absolute" : this.elements.shell[0].style.position = "fixed"
}
var e = function(e) {
this.elements = {
shell: $("#shell"),
window: $(window)
}
};
return e.prototype.init = t, e.prototype.ready = n, e.prototype.setupMenu = r, e.prototype.resize = i, e
}),
function(e, t) {
e.app = e.app || {}, typeof define == "function" && define.amd ? define("app/Shell", ["jquery", "FLOCK/classes/Shell", "FLOCK/utils/Inherit", "FLOCK/utils/DeviceDetect"], function(n) {
return e.app.Shell = t(n)
}) : e.app.Shell = t($)
}(window.FLOCK = window.FLOCK || {}, function(e) {
function n(e) {
console.log("Shell ready"), this.initialized = !0, FLOCK.app.Footer.init(document.getElementById("footer")), this.resize(), e()
}
var t = function(e) {
this._super()
};
return FLOCK.utils.inherit(t, FLOCK.classes.Shell), t.prototype.ready = n, new t
}),
function(e, t) {
e.classes = e.classes || {}, typeof define == "function" && define.amd ? define("FLOCK/classes/BGRenderer", ["jquery", "FLOCK/utils/DeviceDetect", "greensock/TweenLite.min", "greensock/easing/EasePack.min", "greensock/plugins/CSSPlugin.min"], function(n) {
return e.classes.BGRenderer = t(n)
}) : e.classes.BGRenderer = t($)
}(window.FLOCK = window.FLOCK || {}, function(e) {
function n() {
this.verbose && console.log("BGRenderer | init"), this.initialized = !0, this.container = document.getElementById(this.container), this.image1.outer = this.addStyles(document.createElement("div")), this.image1.inner = this.addStyles(document.createElement("div")), this.image1.outer.appendChild(this.image1.inner), this.container.appendChild(this.image1.outer), this.image2.outer = this.addStyles(document.createElement("div")), this.image2.inner = this.addStyles(document.createElement("div")), this.image2.outer.appendChild(this.image2.inner), this.container.appendChild(this.image2.outer), this.image1.outer.style.overflow = this.image2.outer.style.overflow = "hidden", FLOCK.app.Shell.resize()
}
function r(e) {
return e.style.position = "absolute", e.style.top = e.style.left = "0px", e.style.width = e.style.height = "100%", e
}
function i(e, t, n) {
this.initialized || this.init();
var r, i;
this.nextContainer == 0 ? (r = this.image1, i = this.image2, this.image1.obj = e, e.place && (this.image1.image = this.image1.obj.place(this.image1.inner), this.currentBG = this.image1)) : (r = this.image2, i = this.image1, this.image2.obj = e, e.place && (this.image2.image = this.image2.obj.place(this.image2.inner), this.currentBG = this.image2)), this.resize(), this.transition(r, i, t, n)
}
function s(e, t, n, r) {
var i = this,
s = new TimelineLite({
onComplete: function() {
i.changeComplete(r)
}.bind(this)
});
s.pause();
var o = n ? 0 : 8 / 3;
s.to(e.outer, 0, {
x: this.width + "px"
}), s.to(t.outer, o * 3.5 / 8, {
x: -this.width + "px",
ease: Expo.easeInOut
}, 0), s.to(e.outer, o * 3.5 / 8, {
x: "0px",
ease: Expo.easeInOut
}, 0), s.play()
}
function o(e) {
this.nextContainer == 0 ? (this.image2.inner.innerHTML = "", this.image2.image = null, this.image2.obj = null) : (this.image1.inner.innerHTML = "", this.image1.image = null, this.image1.obj = null), this.nextContainer = (this.nextContainer + 1) % 2, e && e()
}
function u() {
this.image1.inner.innerHTML = "", this.image1.image = null, this.image1.obj = null, this.image2.inner.innerHTML = "", this.image2.image = null, this.image2.obj = null
}
function a(e, t) {
if (!this.image1.inner) return;
e || (e = this.container.offsetWidth), t || (t = this.container.offsetHeight), this.width = e, this.height = t;
var n, r, i, s;
this.image1.obj && (this.image1.obj.dimensions ? (n = this.image1.obj.dimensions.width, r = this.image1.obj.dimensions.height) : (n = this.image1.image ? this.image1.image.offsetWidth : 0, r = this.image1.image ? this.image1.image.offsetHeight : 0)), this.image2.obj && (this.image2.obj.dimensions ? (i = this.image2.obj.dimensions.width, s = this.image2.obj.dimensions.height) : (i = this.image2.image ? this.image2.image.offsetWidth : 0, s = this.image2.image ? this.image2.image.offsetHeight : 0));
var o = {
w: n,
h: r
},
u = Math.max(e / o.w, t / o.h),
a = o.w * u,
f = o.h * u,
l = {
w: i,
h: s
},
c = Math.max(e / l.w, t / l.h),
h = l.w * c,
p = l.h * c,
d = 0,
v = 0,
m = -d / 2,
g = e - a + d / 2 - m,
y = e - h + d / 2 - m,
b = -v / 2,
w = t - f + v / 2 - b,
E = t - p + v / 2 - b;
this.image1.image && (this.image1.image.style.top = (b + w * this.image1.obj.v).toFixed() + "px", this.image1.image.style.left = (m + g * this.image1.obj.h).toFixed() + "px", this.image1.image.style.width = a + "px", this.image1.image.style.height = f + "px"), this.image2.image && (this.image2.image.style.top = (b + E * this.image2.obj.v).toFixed() + "px", this.image2.image.style.left = (m + y * this.image2.obj.h).toFixed() + "px", this.image2.image.style.width = h + "px", this.image2.image.style.height = p + "px")
}
var t = function(e) {
this.container = e, this.initialized = !1, this.image1 = {
image: null,
outer: null,
inner: null,
obj: null
}, this.image2 = {
image: null,
outer: null,
inner: null,
obj: null
}, this.nextContainer = 0, this.verbose = !1, this.width = 0, this.height = 0
};
return t.prototype.init = n, t.prototype.addStyles = r, t.prototype.changeBg = i, t.prototype.changeComplete = o, t.prototype.transition = s, t.prototype.clear = u, t.prototype.resize = a, t
}),
function(e, t) {
e.app = e.app || {}, typeof define == "function" && define.amd ? define("app/BGRenderer", ["FLOCK/classes/BGRenderer", "FLOCK/utils/Inherit"], function() {
return e.app.BGRenderer = t()
}) : e.app.BGRenderer = t()
}(window.FLOCK = window.FLOCK || {}, function() {
function t(e, t, n, r) {
var i = this,
s = new TimelineLite({
onComplete: function() {
i.changeComplete(r)
}.bind(this)
});
s.pause();
var o = n ? 0 : 3;
s.to(e.outer, 0, {
alpha: 0
}), s.to(t.outer, o, {
alpha: 0,
ease: Power4.easeOut
}, 0), s.to(e.outer, o, {
alpha: 1,
ease: Power4.easeOut
}, 0), s.play()
}
var e = function(e) {
this._super(e)
};
return FLOCK.utils.inherit(e, FLOCK.classes.BGRenderer), e.prototype.transition = t, e
}),
function(e, t) {
e.classes = e.classes || {}, typeof define == "function" && define.amd ? define("FLOCK/classes/BG_Image", ["jquery"], function(n) {
return e.classes.BG_Image = t(n)
}) : e.classes.BG_Image = t($)
}(window.FLOCK = window.FLOCK || {}, function(e) {
function n(e) {
return e.appendChild(this.img), this.img
}
var t = function(t, n) {
for (var r in t) t.hasOwnProperty(r) && (this[r] = t[r]);
this.img = new Image, this.el = this.img, this.img.style.position = "absolute", this.img.alt = "Background", e(this.img).on("load", function() {
n()
}), this.img.src = t.url
};
return t.prototype.place = n, t
}),
function(e, t) {
e.classes = e.classes || {}, typeof define == "function" && define.amd ? define("FLOCK/classes/BGManager", ["jquery", "FLOCK/utils/DeviceDetect", "greensock/TweenLite.min", "greensock/easing/EasePack.min", "greensock/plugins/CSSPlugin.min", "FLOCK/classes/BG_Image"], function(n) {
return e.classes.BGManager = t(n)
}) : e.classes.BGManager = t($)
}(window.FLOCK = window.FLOCK || {}, function(e) {
function n() {
this.verbose && console.log("BGManager | init"), this.initialized = !0, this.currBgObj = null;
var e = this.sections.length;
while (e--) {
var t = this.sections[e];
t.imgIDs && String(t.randomize).toLowerCase() != "false" && (t.imgIDs = f(t.imgIDs))
}
for (var n in this.images) this.images[n].img = null, this.images[n].type === "image" && FLOCK.utils.SectionLoader.addSection("background_" + n, {
files: {
images: [this.images[n].url]
}
})
}
function r(e) {
this.verbose && console.log("BGManager | returnSectionObj: " + e);
var t = null,
n = this.sections.length;
while (n--)
if (this.sections[n].id == e) {
t = this.sections[n];
break
}
return t
}
function i(e) {
this.verbose && console.log("BGManager | deprioritize: " + e);
var t = this.sections.length,
n;
while (t--) {
n = this.sections[t].imgIDs ? this.sections[t].imgIDs.length : 0;
while (n--) this.sections[t].imgIDs[n] == e && this.sections[t].imgIDs.push(this.sections[t].imgIDs.splice(n, 1)[0])
}
}
function s(e, t, n) {
this.verbose && console.log("BGManager | getBg: " + e), this.initialized || this.init();
var r = this.returnSectionObj(e),
i;
return !r || !r.imgIDs || r.imgIDs.length <= 0 ? !1 : (i = r.imgIDs[0], n || this.deprioritize(i), t ? "background_" + i : i)
}
function o(e, t, n) {
var r = this.getBg(e, !1, !1),
i = this.images[r],
s = !1,
o = this;
r === !1 && (i = {
img: !1
});
if (i == this.currBgObj) {
n && n();
return
}
this.currBgObj = i, i.img === !1 || i.img && i.loaded ? this.renderer.changeBg(i, t, n) : i.type === "image" ? i = new FLOCK.classes.BG_Image(this.images[r], function() {
if (s) return;
s = !0, i.loaded = !0, o.verbose && console.log("BGManager | image loaded: " + i.url), o.renderer.changeBg(i, t, n)
}) : FLOCK.utils.DeviceDetect.isMobile || FLOCK.utils.DeviceDetect.isAndroid || FLOCK.utils.DeviceDetect.isIpad || !document.createElement("video").canPlayType ? (this.images[r].url = this.images[r].fallback, i = new FLOCK.classes.BG_Image(this.images[r], function() {
if (s) return;
s = !0, i.loaded = !0, o.verbose && console.log("BGManager | image loaded: " + i.url), o.renderer.changeBg(i, t, n)
})) : i = new FLOCK.classes.BG_Video(this.images[r], function() {
if (s) return;
s = !0, this.loaded = !0, o.verbose && console.log("BGManager | image loaded: ", this), o.renderer.changeBg(this, t, n)
}, this.renderer.resize)
}
function u(t, n) {
var r = this.getBg(t, !1, !0);
if (!r) return;
var i = this.images[r];
i.img || (i.img = new Image, i.img.alt = "Background", e(i.img).bind("load readystatechange", function() {
i.loaded = !0, n && n()
}.bind(this)), i.img.src = i.url)
}
function a() {
this.renderer.clear()
}
function f(e) {
var t = [],
n = e.length;
while (n--) {
var r = Math.floor(Math.random() * e.length),
i = e.splice(r, 1)[0];
t.unshift(i)
}
return t
}
var t = function(e, t) {
console.log("BGManager | " + t), this.initialized = !1, this.verbose = !1, this.renderer = e, this.sections = t.sections, this.images = t.images
};
return t.prototype.init = n, t.prototype.returnSectionObj = r, t.prototype.deprioritize = i, t.prototype.getBg = s, t.prototype.preloadNextBg = u, t.prototype.clear = a, t.prototype.changeBg = o, t
}),
function(e, t) {
e.app = e.app || {}, typeof define == "function" && define.amd ? define("app/BGManager", ["FLOCK/classes/BGManager", "FLOCK/utils/Inherit"], function() {
return e.app.BGManager = t()
}) : e.app.BGManager = t()
}(window.FLOCK = window.FLOCK || {}, function() {
var e = function(e, t) {
this._super(e, t)
};
return FLOCK.utils.inherit(e, FLOCK.classes.BGManager), e
}), define("app/Button", ["jquery", "greensock/TimelineLite.min", "greensock/TweenLite.min", "greensock/easing/EasePack.min", "greensock/plugins/CSSPlugin.min"], function(e) {
function n() {
if (this.haltEvent) return;
FLOCK.app.Sound.sendEventToKlang("hotspot_rollover"), TweenLite.set(this.circle, {
alpha: 1,
scaleX: 0,
scaleY: 0,
transformOrigin: "center center"
}), TweenLite.to(this.circle, .5, {
scaleX: 1,
scaleY: 1,
alpha: 0
}), window.room && room.cursor && room.cursor.over()
}
function r() {
window.room && !this.haltEvent && room.cursor && room.cursor.out()
}
function i() {
e(this.el).on("mouseenter", this.overHandler), e(this.el).on("mouseleave", this.outHandler)
}
function s(e) {
typeof e == "boolean" && (this.haltEvent = e)
}
var t = function(e) {
var t = 35;
this.hotspotOpen = !1, this.haltEvent = !1, this.el = typeof e == "string" ? document.getElementById(e) : e, this.circle = document.createElement("p"), this.circle.className = "circleOvers", TweenLite.set(this.circle, {
scaleX: 0,
scaleY: 0,
transformOrigin: "center center"
}), this.el.appendChild(this.circle), this.overHandler = n.bind(this), this.outHandler = r.bind(this), i.apply(this)
};
t.prototype.haltEvents = s, FLOCK.ui = FLOCK.ui || {}, FLOCK.ui.Button = t
}),
function(e, t) {
e.Klang = t(), typeof define == "function" && define.amd ? define("packages/klang", [], function() {
return e.Klang
}) : typeof exports == "object" && (module.exports = e.Klang)
}(window, function() {
if (navigator.userAgent.indexOf("MSIE") != -1) {
var e = !0,
t = navigator.userAgent,
n = new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})"),
r;
n.exec(t) != null && (r = parseInt(RegExp.$1)), r < 9 && (Object.oldDefineProperty = Object.defineProperty, Object.defineProperty = function() {})
}(function() {
function t(e) {
if (!e) return;
e.setTargetValueAtTime || (e.setTargetValueAtTime = e.setTargetAtTime)
}
var e = window.AudioContext = window.AudioContext || window.webkitAudioContext || window.mozAudioContext;
if (e) {
(function() {
if (navigator.userAgent.indexOf("Chrome/42") !== -1) {
var e = window.AudioBufferSourceNode.prototype;
e.internal_start || (e.internal_start = e.start, e.start = function(t, n, r) {
this.loop ? e.internal_start.call(this, t) : e.internal_start.apply(this, arguments)
})
}
})();
var n = e.prototype,
r = new e;
n.hasOwnProperty("createGain") || (n.createGain = n.createGainNode), n.hasOwnProperty("internal_createBiquadFilter") || (n.internal_createBiquadFilter = n.createBiquadFilter, n.createBiquadFilter = function() {
var e = this.internal_createBiquadFilter();
t(e.frequency), t(e.detune), t(e.Q), t(e.gain);
var n = ["LOWPASS", "HIGHPASS", "BANDPASS", "LOWSHELF", "HIGHSHELF", "PEAKING", "NOTCH", "ALLPASS"];
for (var r = 0; r < n.length; ++r) {
var i = n[r],
s = i.toLowerCase();
e.hasOwnProperty(i) && (!Object.isFrozen || !Object.isFrozen(e)) && (e[i] = s)
}
return e
}), n.hasOwnProperty("createDelay") || (n.createDelay = n.createDelayNode);
var i = function(e, t) {
return e === undefined && t !== undefined
},
s = r.createBufferSource().constructor.prototype;
if (i(s.start, s.noteOn) || i(s.stop, s.noteOff)) {
var o = n.createBufferSource;
n.createBufferSource = function() {
var t = o.call(this);
return t.start = t.start || t.noteOn, t.stop = t.stop || t.noteOff, t
}
}
if (typeof r.createOscillator == "function") {
var u = r.createOscillator().constructor.prototype;
if (i(u.start, u.noteOn) || i(u.stop, u.noteOff)) {
var a = n.createOscillator;
n.createOscillator = function() {
var t = a.call(this);
return t.start = t.start || function() {
t.noteOn && (arguments.length > 1 ? t.noteGrainOn.apply(t, arguments) : t.noteOn.apply(t, arguments))
}, t.stop = t.stop || t.noteOff, t
}
}
}
n.createGain === undefined && n.createGainNode !== undefined && (n.createGain = n.createGainNode), n.createDelay === undefined && n.createDelayNode !== undefined && (n.createDelay = n.createDelayNode), n.createScriptProcessor === undefined && n.createJavaScriptNode !== undefined && (n.createScriptProcessor = n.createJavaScriptNode);
var f = window.AudioParam = window.AudioParam || window.webkitAudioParam;
if (f) {
var l = window.AudioParam.prototype;
l.setTargetAtTime = l.setTargetAtTime || l.setTargetValueAtTime
} else e.prototype.internal_createGain || (e.prototype.internal_createGain = e.prototype.createGain, e.prototype.createGain = function() {
var e = this.internal_createGain();
return t(e.gain), e
})
}
})();
var i = this.__extends || function(e, t) {
function n() {
this.constructor = e
}
n.prototype = t.prototype, e.prototype = new n
},
s;
return function(e) {
function o(e) {
s = s || {}, s[e] = arguments
}
function u(t) {
var n = [];
for (var i = 0; i < arguments.length - 1; i++) n[i] = arguments[i + 1];
if (!r.isInited) return;
try {
if (e.version === "webaudio") {
if (!e.context) return;
r.instance.triggerEvent(t, n)
} else e.version === "audiotag" && e.audioTagHandler && e.audioTagHandler.triggerEvent(t, n)
} catch (s) {
e.err("Klang exception: unable to trigger event: '" + t + "': " + s.name + ": " + s.message)
}
}
function a(t) {
var n = r.instance.findInstance(e.getEvents()[t]);
return n ? n.destination() : null
}
function f() {
if (s) {
for (var t in s) s.hasOwnProperty(t) && e.triggerEvent.apply(e, s[t]);
s = null
}
}
function l(t, n, i, s, o) {
navigator.userAgent.indexOf("Firefox") != -1 ? e.browser = "Firefox" : navigator.userAgent.indexOf("Chrome") != -1 ? e.browser = "Chrome" : navigator.userAgent.indexOf("Safari") != -1 ? e.browser = "Safari" : navigator.userAgent.indexOf("Opera") != -1 ? e.browser = "Opera" : navigator.userAgent.indexOf("MSIE") != -1 && (e.browser = "IE"), e.initOptions = o = o || {}, e.isMobile = j.checkMobile(), e.isIOS = j.checkIOS(), e.useMonoBuffers = e.isIOS, typeof t == "object" && t.settings && t.settings.force_logging && (e.loggingEnabled = !0);
if (e.klangInited) {
e.warn("Klang already initialized");
return
}
e.klangInited = !0, e.readyState = e.READY_STATE_NOT_INITIATED;
if (window.AudioContext === undefined || !!o.noWebAudio) {
e.version = "audiotag";
try {
e.audioTagHandler = new AudioTagHandler(t, function(t) {
e.readyState = e.READY_STATE_LOADED, n && n(t), f()
}, i)
} catch (u) {
return e.err("Klang exception: unable to initialize audio tag fallback"), e.version = "failed audiotag", n(!1), !1
}
return !0
}
e.context || (e.context = new AudioContext);
try {
return e.version = "webaudio", r.isInited() && e.warn("Klang already initialized"), r.instance.loadJSON(t, function(t) {
e.readyState = e.READY_STATE_LOADED, n && n(t), f()
}, i), !0
} catch (u) {
return e.err("Klang exception: unable to parse config file: '" + t + "': " + u.name + ": " + u.message), e.version = "failed web audio", n(!1), !1
}
}
function c() {
if (e.version == "webaudio") try {
r.instance.initIOS()
} catch (t) {
e.err("Klang exception: unable to init iOS: " + t.name + ": " + t.message)
} else e.version == "audiotag" && e.isMobile && e.audioTagHandler.initIOS()
}
function h() {
var t = [],
n;
if (e.version === "webaudio") n = B.FileHandler.instance;
else {
if (e.version !== "audiotag") return [];
n = e.audioTagHandler
}
t = n.getLoadGroups();
var r = t.indexOf("auto");
return r !== -1 && t.splice(r, 1), t
}
function p() {
return r.instance
}
function d() {
return B.FileHandler.instance
}
function v() {
return j
}
function m() {
return B
}
function g(t, n) {
return e.version !== "webaudio" ? (e.err("Schedule only availible in WebAudio version"), this) : (typeof t == "number" && typeof n == "function" ? r.instance.scheduler.at(t, n) : e.err(".schedule requires arg0 - time in seconds and arg1 - a callback function"), this)
}
function y(e, t) {
if (!B[e]) throw new Error("No such object");
return new B[e](t)
}
function b(e, t) {
r.debugSettings[e] = t
}
function w(t, n, i, s) {
try {
e.logc("Klang: Loading: '" + t + "'", j.LOG_LOAD_COLOR), e.version == "webaudio" ? r.instance.loadSoundFiles(t, n, i, s) : e.version == "audiotag" ? e.audioTagHandler.loadSoundFiles(t, n, i, s) : (i && i(1), n && n(!1))
} catch (o) {
e.err("Klang exception: unable to load file group: '" + t + "': " + o.name + ": " + o.message)
}
}
function E(t) {
try {
e.logc("Klang: Freeing: '" + t + "'", j.LOG_LOAD_COLOR), e.version == "webaudio" ? r.instance.freeSoundFiles(t) : e.version == "audiotag"
} catch (n) {
e.err("Klang exception: unable to free file group: '" + t + "': " + n.name + ": " + n.message)
}
}
function S() {
return B.FileHandler.instance.progress
}
function x() {
e.version == "webaudio" ? r.isInited() && r.instance.stopAll() : e.version == "audiotag" && e.audioTagHandler.stopAll()
}
function T(t, n) {
if (e.version == "webaudio") {
if (r.isInited()) {
if (t.indexOf(".") === 0) {
var i = t.substring(1),
s = [],
o = e.getCoreInstance()._objectTable;
for (var u in o)
if (o.hasOwnProperty(u)) {
var a = o[u];
a._type === i && s.push(a)
}
return s
}
var f = r.instance.getSymbolId(t);
return r.instance.findInstance(f)
}
} else e.version == "audiotag"
}
function N() {
var t = [];
for (var n = 0; n < arguments.length - 0; n++) t[n] = arguments[n + 0];
e.loggingEnabled && (e.browser == "Chrome" ? console.log("%c[" + M() + "] " + t.join(), "color:" + j.LOG_TIME_COLOR) : console.log.apply(console, t))
}
function C(t, n) {
e.loggingEnabled && (e.browser == "Chrome" ? (n || (n = "gray"), console.log("%c[" + M() + "] " + t, "color:" + n)) : console.log(t))
}
function k() {
var t = [];
for (var n = 0; n < arguments.length - 0; n++) t[n] = arguments[n + 0];
e.loggingEnabled && (e.browser == "Chrome" ? console.warn("%c[" + e.getTimeString() + "] " + t.join(), "color:" + j.LOG_WARN_COLOR) : console.warn.apply(console, t))
}
function L() {
var t = [];
for (var n = 0; n < arguments.length - 0; n++) t[n] = arguments[n + 0];
e.loggingEnabled && (e.browser == "Chrome" ? console.warn("%c[" + e.getTimeString() + "] " + t.join(), "color:" + j.LOG_ERROR_COLOR) : console.warn.apply(console, t))
}
function A(e, t) {
var n = e.toString();
while (n.length < t) n = "0" + n;
return n
}
function O(e) {
return A(e.getUTCMinutes(), 2) + ":" + A(e.getUTCSeconds(), 2) + "." + A(e.getUTCMilliseconds(), 3)
}
function M(t) {
t == undefined && (t = e.context.currentTime);
var n = Math.round(t * 1e3),
r = Math.floor(n / 1e3 % 60),
i = Math.floor(n / 6e4 % 60),
s = Math.floor(n / 36e5 % 24);
return A(s, 2) + ":" + A(i, 2) + ":" + A(r, 2) + "." + A(n % 1e3, 3)
}
function _() {
return e.version === "flash" ? null : e.version == "audiotag" ? e.audioTagHandler._events : r.instance._eventTable
}
function D(e) {
r.instance.setCallbacks(e)
}
function P(t) {
var n = 0,
r = setInterval(function() {
var i = e.context.currentTime,
s = t[n];
while (s.time < i) {
u(s.name, s.args), n++;
if (n == t.length) {
clearInterval(r);
break
}
s = t[n]
}
}, 10)
}
function H(t, n) {
e.klangInited = !1, e.version == "webaudio" ? r.isInited() && (r.instance.stopAll(), r.deinit()) : e.version == "audiotag" && e.audioTagHandler.stopAll(), e.version = "n/a"
}(function(e) {
function n() {
var e = window.document.createElement("audio");
if (!e.canPlayType) return !1;
var t = [];
return e.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/, "") && t.push(".ogg"), e.canPlayType("audio/aac").replace(/no/, "") && t.push(".m4a"), e.canPlayType("audio/mpeg;").replace(/no/, "") && t.push(".mp3"), t
}
function r(e) {
t = t || n();
for (var r = 0; r < t.length; r++)
if (t[r] === e) return !0;
return !1
}
function i() {
var e = navigator.userAgent,
t, n = e.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
if (/trident/i.test(n[1])) return t = /\brv[ :]+(\d+)/g.exec(e) || [], {
name: "IE",
version: t[1] || "unknown"
};
if (n[1] === "Chrome") {
t = e.match(/\bOPR\/(\d+)/);
if (t !== null) return {
name: "Opera",
version: t[1]
}
}
return n = n[2] ? [n[1], n[2]] : [navigator.appName, navigator.appVersion, "-?"], (t = e.match(/version\/(\d+)/i)) !== null && n.splice(1, 1, t[1]), {
name: n[0],
version: n[1]
}
}
var t;
e.canPlayAudioSuffix = r, e.browser = i()
})(e.detector || (e.detector = {}));
var t = e.detector;
(function(e) {
function t(e) {
var t = document.createElement("a");
t.href = e;
var n = document.createElement("a");
n.href = location.href;
var r = t.hostname != "" && (t.port != n.port || t.protocol != n.protocol || t.hostname != n.hostname);
return r
}
function n(e, n, r, i) {
var s;
e.type = e.type || "GET";
if (window.XDomainRequest && t(e.url)) s = new window.XDomainRequest, s.onload = function() {
n && n(s.responseText)
}, s.onprogress = r || function() {}, s.onerror = i || function() {}, s.open(e.type, e.url, !0);
else {
if (!window.XMLHttpRequest) throw "Error - browser does not support XDomain/XMLHttp Requests";
s = new XMLHttpRequest, s.open(e.type, e.url, !0), s.onreadystatechange = function() {
try {
if (s.readyState == 4 && s.status == 200) {
if (n) {
var e = s.responseText;
n(e)
}
} else s.status != 0 && s.status != 200 && i && i({
status: s.status
})
} catch (t) {
throw t
}
}
}
s && s.send(null)
}
e.isCrossDomain = t, e.request = n
})(e.network || (e.network = {}));
var n = e.network;
e.versionNumber = 1, e.context, e.version, e.progressCallback, e.readyCallback, e.browser, e.os, e.isMobile, e.isIOS, e.fallback, e.loggingEnabled = !1, e.useMonoBuffers = !1, e.Panner, e.safari = !1, e.initOptions;
var r = function() {
function t() {
this._initComplete = !1, this._blurFadeOut = !1, this._masterBusId = null, this._preLoadInitStack = [], this._postLoadInitStack = [], this._connectStack = [], this._superMasterOutput = e.context ? e.context.createGain() : null, e.Panner = B.Panner, this._eventHistory = [], this.scheduler = new B.Scheduler, j.getParameterByName("klang_log") && (e.loggingEnabled = !0)
}
return t.debugSettings = {}, t.inst = null, t.isInited = function() {
return t.inst == null ? !1 : t.inst._initComplete
}, Object.defineProperty(t.prototype, "initComplete", {
get: function() {
return this._initComplete
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t, "instance", {
get: function() {
return t.inst == null && (t.inst = new t), t.inst
},
enumerable: !0,
configurable: !0
}), t.prototype.setCallbacks = function(e) {
this._callbacks = e
}, Object.defineProperty(t, "callbacks", {
get: function() {
return t.instance._callbacks
},
enumerable: !0,
configurable: !0
}), t.deinit = function() {
t.inst = null
}, t.prototype.stopAll = function() {
window.KlangVisual && KlangVisual.stop();
for (var e in this._objectTable)
if (this._objectTable[e].stop) try {
this._objectTable[e].stop()
} catch (t) {}
}, t.prototype.loadJSON = function(n, r, i) {
this._readyCallback = r, this._progressCallback = i || function() {};
if (typeof n == "object") {
e.log("Loading config (editor)");
var s = this.createConfigNode(n);
t.settings = s.settings, t.instance.initContent(s), window.KlangVisual && KlangVisual.init(n)
} else {
if (typeof n != "string") throw "Klang exception: unrecognized options: '" + n + "'";
e.log("Loading config (client)");
var o = new XMLHttpRequest;
o.open("GET", n, !0);
var u = this;
o.onreadystatechange = function() {
if (o.readyState == 4 && o.status == 200) {
var e = o.responseText,
r = u.parseConfigJSON(e);
t.settings = r.settings, t.instance.initContent(r, null, n), window.KlangVisual && KlangVisual.init(JSON.parse(e))
} else {
if (o.status == 404) throw "Klang exception: config file not found: '" + n + "'";
if (o.status != 200) throw "Klang exception: unable to load config file: '" + n + "'"
}
}, o.send(null)
}
}, t.prototype.parseConfigJSON = function(t) {
return JSON.parse(t, function(t, n) {
return n && typeof n == "object" && typeof n.type == "string" ? (B[n.type] || e.warn("Core: Type not found: " + n.type), new B[n.type](n, t)) : n
})
}, t.prototype.createConfigNode = function(t) {
if (typeof t == "object")
for (var n in t) {
var r = t[n];
typeof r == "object" && typeof r.type == "string" ? (B[r.type] || e.warn("Core: Type not found: " + r.type), t[n] = this.createConfigNode(r), t[n] = new B[r.type](r, n)) : t[n] = this.createConfigNode(r)
}
return t
}, t.prototype.createObject = function(t, n, r) {
r || (r = {}), B[n.type] || e.warn("Core: Type not found: " + n.type), !r.excludeFromTable && this._objectTable[t] && e.warn("Core: Duplicate object: " + t);
var i = new B[n.type](n, t);
r.excludeFromTable || (this._objectTable[t] = i), !r.noInit && i.init && i.init();
if (!r.noConnect && i.destinationName && i.connect)
if (i.destinationName == "$OUT") i.connect(this._superMasterOutput);
else {
var s = this.findInstance(i.destinationName);
s || e.warn("Core: Destination not found: " + i.destinationName), s._type != "Bus" && e.warn("Core: Destination is not a bus: " + i.destinationName), i.connect(s.input)
}
return i
}, t.prototype.updateObject = function(e, t) {
var n = typeof e == "string" ? this._objectTable[e] : e;
if (n._type == "SimpleProcess" && t.type == "AdvancedProcess") {
var r = new B.AdvancedProcess(t, e);
r.init(), this._objectTable[e] = r
} else if (n._type == "AdvancedProcess" && t.type == "SimpleProcess") {
var i = new B.SimpleProcess(t, e);
i.init(), this._objectTable[e] = i
} else n.setData && n.setData(t)
}, t.prototype.createEvent = function(t, n) {
this._eventTable[t] && e.warn("Core: Duplicate event: " + t), this._eventTable[t] = n
}, t.prototype.initContent = function(n, r, i) {
var s = n.settings.relative_path,
o, u = n.settings.file_path || "";
s ? i.lastIndexOf("/") != -1 ? (o = i.substring(0, i.lastIndexOf("/")), o.charAt(o.length - 1) !== "/" && (o += "/"), o += u) : o = u : o = u, e.log("Initializing core");
var a = e.context.currentTime;
if (n.settings.blur_fade_time != -1) {
this._blurFadeOut = !0;
var f = n.settings.blur_fade_time || .5;
f < 0 && f != -1 && e.warn("Core: Invalid blur_fade_time value. Must be -1 or >= 0.");
var l = this;
function c() {
l.isHidden() ? l._blurFadeOut && j.curveParamLin(l._superMasterOutput.gain, 0, f) : j.curveParamLin(l._superMasterOutput.gain, 1, f)
}
var h = this.getHiddenProp();
if (h) {
var p = "visibilitychange";
document.addEventListener(p, c)
}
}
B.FileHandler.instance.fileInfo = (r != undefined ? r : n.files) || [], this._eventTable = n.events || {}, this._objectTable = {};
for (var d in n.audio) this._objectTable[d] = n.audio[d];
for (var d in n.busses) this._objectTable[d] = n.busses[d];
for (var d in n.sequencers) this._objectTable[d] = n.sequencers[d];
for (var d in n.processes) this._objectTable[d] = n.processes[d];
for (var d in n.synths) this._objectTable[d] = n.synths[d];
for (var d in n.lfos) this._objectTable[d] = n.lfos[d];
for (var d in n.automations) this._objectTable[d] = n.automations[d];
this.setVars(n.vars), this._masterBusId = n.masterBus, this._exportedSymbols = n.exportedSymbols || {}, this._logIgnore = n.debug.log_ignore || n.log_ignore || {}, B.Panner.setListenerData(n.settings.listener), j.createCurves(n.curves), this._loadStartTimestamp = (new Date).getTime(), n.debug && (e.debugData.ignoredEvents = n.debug.ignored_events || e.debugData.ignoredEvents, e.debugData.logToConsole = n.debug.log_to_console || e.debugData.logToConsole), e.log("Pre load initialization started");
for (var v = 0, m = this._preLoadInitStack.length; v < m; v++) {
var g = this._preLoadInitStack[v];
g.init && g.init()
}
e.log("Pre load initialization finished"), e.log("Connecting nodes"), this._superMasterOutput.connect(e.context.destination);
for (var v = 0, m = this._connectStack.length; v < m; v++) {
var g = this._connectStack[v];
switch (g.destinationName) {
case "$OUT":
g.connect(this._superMasterOutput);
break;
case "$PARENT":
break;
default:
var y = this.findInstance(g.destinationName);
y || e.warn("Core: Destination not found: " + g.destinationName), y._type != "Bus" && e.warn("Core: Destination is not a bus: " + g.destinationName), g.connect(y.input)
}
}
e.log("Nodes connected"), this._preLoadInitStack = null, this._connectStack = null, this._timeHandler = new B.TimeHandler, this._initComplete = !0, e.log("Core initialized"), B.FileHandler.instance.baseURL = o, (!e.initOptions || e.initOptions && !e.initOptions.noAutoLoad) && B.FileHandler.instance.loadFiles("auto", t.soundsLoaded, this._progressCallback)
}, t.prototype.isHidden = function() {
var e = this.getHiddenProp();
return e ? document[e] : !1
}, t.prototype.getHiddenProp = function() {
var e = ["webkit", "moz", "ms", "o"];
if ("hidden" in document) return "hidden";
for (var t = 0; t < e.length; t++)
if (e[t] + "Hidden" in document) return e[t] + "Hidden";
return null
}, t.prototype.setVars = function(e) {
if (e) {
for (var t in e)
if (typeof e[t] == "string" && e[t].indexOf("me.") > -1) e[t] = this.findInstance(e[t].split("me.")[1]);
else if (typeof e[t] == "object") {
var n = e[t];
for (var r in n) n.hasOwnProperty(r) && typeof n[r] == "string" && n[r].indexOf("me.") > -1 && (n[r] = this.findInstance(n[r].split("me.")[1]))
}
j.vars = e
}
}, t.prototype.loadSoundFiles = function(e, t, n, r) {
n && (this._progressCallback = n);
var i = this;
B.FileHandler.instance.loadFiles(e, function(e, n) {
for (var r = 0; r < n.length; r++) {
var s = n[r].id;
for (var o in i._objectTable)
if (i._objectTable.hasOwnProperty(o)) {
var u = i._objectTable[o];
u._type === "AudioSource" && u._fileId === s && u.init()
}
}
t && t(!0)
}, this._progressCallback, r)
}, t.prototype.freeSoundFiles = function(e) {
B.FileHandler.instance.freeSoundFiles(e);
for (var t in this._objectTable) {
var n = this._objectTable[t];
if (n._type == "AudioSource") {
var r = B.FileHandler.instance.getFileInfo(n._fileId);
r && r.load_group == e && n.freeBuffer()
}
}
}, t.soundsLoaded = function() {
e.log("Post load initialization started");
var r = t.instance;
for (var i = 0, s = r._postLoadInitStack.length; i < s; i++) r._postLoadInitStack[i].init();
e.log("Post load initialization finished"), r._postLoadInitStack = null, r._readyCallback && r._readyCallback(!0)
}, t.prototype.pushToPreLoadInitStack = function(e) {
return this._preLoadInitStack ? (this._preLoadInitStack.push(e), !0) : !1
}, t.prototype.pushToPostLoadInitStack = function(e) {
return this._postLoadInitStack ? (this._postLoadInitStack.push(e), !0) : !1
}, t.prototype.pushToConnectStack = function(e) {
return this._connectStack ? (this._connectStack.push(e), !0) : !1
}, t.prototype.findInstance = function(t) {
var n = this._objectTable[t];
return n || e.warn("Core: Unknown reference: '" + t + "'"), n
}, t.prototype.triggerEvent = function(t) {
var n = [];
for (var r = 0; r < arguments.length - 1; r++) n[r] = arguments[r + 1];
j.lastEvent = t;
if (e.debugData.ignoredEvents[t]) return;
this._eventTable[t] ? e.debugData.logToConsole && !this._logIgnore[t] && e.logc("Klang Core: Incoming sound event: '" + t + "'" + ", " + n, j.LOG_EVENT_COLOR) : e.debugData.logToConsole && !this._logIgnore[t] && e.logc("Klang Core: Incoming sound event: '" + t + "'" + ", " + n, j.LOG_UNIMPLEMENTED_EVENT_COLOR);
var i = this._eventTable[t];
if (typeof i == "string") this._objectTable[i] || e.warn("Core: Unknown process: '" + i + "'"), this._objectTable[i]._type != "SimpleProcess" && this._objectTable[i]._type != "AdvancedProcess" && e.warn("Core: Object is not a process: '" + i + "'"), this._objectTable[i].start(n[0]);
else if (i instanceof Array)
for (var s = 0, o = i.length; s < o; s++) this._objectTable[i[s]] || e.warn("Core: Unknown process: '" + i[s] + "'"), this._objectTable[i[s]]._type != "SimpleProcess" && this._objectTable[i[s]]._type != "AdvancedProcess" && e.warn("Core: Object is not a process: '" + i + "'"), this._objectTable[i[s]].start(n[0])
}, t.prototype.getSymbolId = function(e) {
return this._exportedSymbols[e]
}, t.prototype.initIOS = function() {
var t = e.context.createBufferSource();
t.start(0)
}, Object.defineProperty(t.prototype, "timeHandler", {
get: function() {
return this._timeHandler
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "output", {
get: function() {
return this._superMasterOutput
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "blurFadeOut", {
get: function() {
return this._blurFadeOut
},
set: function(e) {
this._blurFadeOut = e
},
enumerable: !0,
configurable: !0
}), t
}();
e.READY_STATE_NOT_INITIATED = 0, e.READY_STATE_INITIATED = 1, e.READY_STATE_LOADED = 2, e.klangInited = !1, e.readyState = e.READY_STATE_NOT_INITIATED;
var s;
e.pushToEventQue = o, e.triggerEvent = u, e.getDestinationForEvent = a, e.init = l, e.initIOS = c, e.getLoadGroups = h, e.getCoreInstance = p, e.getFileHandlerInstance = d, e.getUtil = v, e.getModel = m, e.schedule = g, e.createObject = y, e.setDebugFlag = b, e.load = w, e.free = E, e.getLoadProgress = S, e.stopAll = x, e.$ = T, e.log = N, e.logc = C, e.warn = k, e.err = L, e.zeropad = A, e.getTimeStamp = O, e.getTimeString = M, e.getEvents = _, e.debugData = {
ignoredEvents: {},
logToConsole: !0
}, e.visualWindow, e.setCallbacks = D, e.schedulePredefinedEvents = P, e.deinit = H;
var B;
(function(t) {
function a(e, t, n, r, i) {
typeof i == "undefined" && (i = "linear");
var s, o;
if (i == "linear") s = function(e) {
return 1 - e
}, o = function(e) {
return e
};
else {
if (i != "equalpower") return;
s = function(e) {
return Math.pow(1 - e, .5)
}, o = function(e) {
return Math.pow(e, .5)
}
}
n = Math.min(n, e.length), r = Math.min(r, t);
for (var u = 0; u < e.numberOfChannels; u++) {
var a = e.getChannelData(u),
f = n - 1,
l = t - 1;
for (var c = r - 1; c >= 0; c--) {
var h = (c + 1) / (r + 1);
a[f] = a[f] * s(h) + a[l] * o(h), f--, l--
}
var p = n,
d = t;
while (p < e.length) a[p++] = a[d++]
}
}
var n = function() {
function e() {}
return e.prototype.on = function(e, t, n) {
this._events = this._events || {};
var r = this._events[e] || (this._events[e] = []);
return r.push({
callback: t,
ctxArg: n,
context: n || this
}), this
}, e.prototype.off = function(e, t, n) {
var r, i, s, o;
if (!this._events || !this._events[e]) return this;
!e && !t && !n && (this._events = {});
var u = this._events[e];
if (u) {
o = [];
if (t && n)
for (r = 0, i = u.length; r < i; r++) s = u[r], t !== s.callback && n !== s.ctxArg && o.push(u[r]);
else if (t)
for (r = 0, i = u.length; r < i; r++) s = u[r], t !== s.callback && o.push(u[r]);
else if (n)
for (r = 0, i = u.length; r < i; r++) s = u[r], n !== s.ctxArg && o.push(u[r]);
this._events[e] = o
}
return this._events[e].length || delete this._events[e], this
}, e.prototype.trigger = function(e) {
var t = [];
for (var n = 0; n < arguments.length - 1; n++) t[n] = arguments[n + 1];
if (!this._events || !this._events[e]) return this;
var r, i, s;
s = this._events[e], t = [].splice.call(arguments, 1);
for (r = s.length - 1; r >= 0; r--) i = s[r], i.callback.apply(i.context, t);
return this
}, e
}();
t.EventEmitter = n;
var s = function() {
function t() {
this.memUsage = 0, this._decoding = !1, this._files = {}, this._bufferQue = [], this._groups = {}, this._lastSentPercent = -1
}
return t.inst = null, Object.defineProperty(t, "instance", {
get: function() {
return t.inst == null && (t.inst = new t), t.inst
},
enumerable: !0,
configurable: !0
}), t.prototype.sendProgressCallback = function(e) {
var t = this._groups[e];
if (t.progressCallback && !t.loadInterrupted) {
var n = 0;
t.progress.readyAudioFiles >= t.progress.totalAudioFiles && (n = Math.floor((t.progress.loadedBytes + t.progress.bufferedFiles) / (t.progress.totalBytes + t.progress.totalFiles) * (100 - (t.progress.totalFiles - t.progress.convertedFiles)))), this._lastSentPercent !== n && t.progressCallback(n), this._lastSentPercent = n
}
}, t.prototype.updateProgress = function(e, t) {
var n = e.load_group;
if (!e.sizeReceived) {
e.sizeReceived = !0;
var r = 1;
t.lengthComputable && (r = t.total, e.loadedBytes = 0), e.totalBytes = r, this._groups[n].progress.totalBytes += r, this._groups[n].progress.readyAudioFiles++
}
if (e["loadedBytes"] != undefined) {
var i = t.loaded - e.loadedBytes;
e.loadedBytes = t.loaded, this._groups[n].progress.loadedBytes += i, this.sendProgressCallback(n)
}
}, t.prototype.decodeBufferQue = function() {
var t = this;
if (this._bufferQue.length && !this._decoding) {
var n = this._bufferQue.pop(),
r = n.data,
i = n.info,
s = n.callback;
this._decoding = !0, e.context.decodeAudioData(r, function(r) {
var o = t._groups[i.load_group];
t._decoding = !1;
if (e.useMonoBuffers) {
var u = r.length,
a = e.context.createBuffer(1, u, e.context.sampleRate),
f = r.getChannelData(0),
l = a.getChannelData(0);
for (var c = 0; c < u; c++) l[c] = f[c];
r = a
}
t.memUsage += r.length * r.numberOfChannels * Float32Array.BYTES_PER_ELEMENT;
var h = t.memUsage,
p = h / 1e6;
t.addFile(i, r), o.progress.convertedFiles++, n.data = null, t._bufferQue.length ? t.decodeBufferQue() : s && s()
}, function(t) {
e.log("Klang warning: unable to load file '" + (this._baseURL || "") + i.url + "'")
})
}
}, t.prototype.loadAudioBuffer = function(t, n) {
var r = this,
i = new XMLHttpRequest,
s = ".ogg";
if (e.browser === "Safari" || e.detector.browser["name"] == "Netscape") s = ".mp3";
var o = (t.external ? "" : this._baseURL) + t.url + s;
i.open("GET", o, !0), i.responseType = "arraybuffer", i.sizeReceived = !1, i.load_group = t.load_group, i.onprogress = function(e) {
r.updateProgress(i, e)
}, i.onload = function(e) {
var s = r._groups[t.load_group];
r._bufferQue.push({
data: i.response,
load_group: s,
info: t,
callback: n
});
if (i.loadedBytes) {
var o = i.totalBytes - i.loadedBytes;
s.progress.loadedBytes += o
} else s.progress.loadedBytes += 1;
r.updateProgress(i, e), r.decodeBufferQue(), i.response = null, i = null
}, i.onreadystatechange = function() {
(i.readyState != 4 || i.status != 200) && i.status != 200 && (r._groups[t.load_group].loadInterrupted = !0, r._groups[t.load_group].loadFailedCallback && r._groups[t.load_group].loadFailedCallback())
}, i.send(), this._groups[t.load_group].progress.totalAudioFiles++
}, t.prototype.loadMidiFile = function(e, t) {
var n = this;
loadRemote(this._baseURL + e.url, function(e, t) {
n.updateProgress(e, t)
}, function(r) {
n.addFile(e, readMidiFile(r)), t && t()
})
}, t.prototype.loadMidiString = function(e) {
var t = this,
n = new XMLHttpRequest;
n.open("GET", this._baseURL + e.url), n.onprogress = function(e) {
t.updateProgress(n, e)
}, n.onreadystatechange = function() {
this.readyState == 4 && this.status == 200 && t.addFile(e, readMidiString(n.response))
}, n.send()
}, t.prototype.loadFiles = function(e, t, n, r) {
typeof e == "string" && (e = [e]);
for (var i = 0, s = e.length; i < s; i++) this._groups[e[i]] = {}, this._groups[e[i]]._loadedFiles = [], this._groups[e[i]].filesLoadedCallback = t, this._groups[e[i]].progressCallback = n, this._groups[e[i]].loadFailedCallback = r, this._groups[e[i]].loadInterrupted = !1, this._groups[e[i]].progress = {
totalBytes: 0,
loadedBytes: 0,
totalFiles: 0,
totalAudioFiles: 0,
readyAudioFiles: 0,
bufferedFiles: 0,
convertedFiles: 0
};
for (var i = 0, s = this._fileInfo.length; i < s; i++) {
var o = this._fileInfo[i],
u = e.indexOf(o.load_group);
if (u != -1 && !this._files[o.id] && !o.only_audio_tag) {
switch (o.file_type) {
case "audio":
this.loadAudioBuffer(o);
break;
case "midi":
this.loadMidiFile(o);
break;
case "midistring":
this.loadMidiString(o)
}
this._groups[e[u]].progress.totalFiles++
}
}
for (var i = 0, s = e.length; i < s; i++) this._groups[e[i]].progress.totalFiles == 0 && this._groups[e[i]].filesLoadedCallback && !this._groups[e[i]]._loadInterrupted && this._groups[e[i]].filesLoadedCallback(!0, this._groups[e[i]]._loadedFiles)
}, t.prototype.prepareFile = function(e) {
this._fileInfo.push(e)
}, t.prototype.prepareFiles = function(e) {
var t, n;
for (t = 0, n = e.length; t < n; t++) this.prepareFile(e[t])
}, t.prototype.addFile = function(e, t) {
this._files[e.id] = t, this._groups[e.load_group].progress.bufferedFiles++, this._groups[e.load_group]._loadedFiles = this._groups[e.load_group]._loadedFiles || [], this._groups[e.load_group]._loadedFiles.push(e), this.sendProgressCallback(e.load_group), this._groups[e.load_group].progress.bufferedFiles == this._groups[e.load_group].progress.totalFiles && !this._groups[e.load_group].loadInterrupted && this._groups[e.load_group].filesLoadedCallback && this._groups[e.load_group].filesLoadedCallback(!0, this._groups[e.load_group]._loadedFiles || [])
}, t.prototype.freeSoundFiles = function(e) {
typeof e == "string" && (e = [e]);
for (var t = 0, n = this._fileInfo.length; t < n; t++) {
var r = this._fileInfo[t];
e.indexOf(r.load_group) != -1 && (this._files[r.id] = null)
}
}, t.prototype.getLoadGroups = function() {
var e, t = this._fileInfo || [],
n = {},
r = [];
for (e = 0; e < t.length; e++) {
var i = t[e];
n[i.load_group] = i.load_group
}
for (e in n) r.push(e);
return r
}, t.prototype.getFile = function(e) {
return this._files[e] || null
}, t.prototype.getFilesForLoadgroup = function(e) {
var t = [];
for (var n = 0, r = this._fileInfo.length; n < r; n++) this._fileInfo[n].load_group == e && t.push(this._fileInfo[n]);
return t
}, t.prototype.getFileInfo = function(e) {
for (var t = 0, n = this._fileInfo.length; t < n; t++)
if (this._fileInfo[t].id == e) return this._fileInfo[t];
return undefined
}, Object.defineProperty(t.prototype, "progress", {
get: function() {
return this._groups
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "baseURL", {
set: function(e) {
this._baseURL = e
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "fileInfo", {
set: function(e) {
this._fileInfo = e
},
enumerable: !0,
configurable: !0
}), t
}();
t.FileHandler = s;
var o = function() {
function t(t, n) {
this._name = n, this._type = t.type, this._output = e.context.createGain(), this._volume = t.volume != undefined ? t.volume : 1, this._output.gain.value = this._volume, t.destination_name && (this.destinationName = t.destination_name, r.instance.initComplete || r.instance.pushToConnectStack(this))
}
return t.prototype.connect = function(t) {
return e.warn("Audio: Invocation of abstract method: Audio.connect in", this), this
}, t.prototype.disconnect = function() {
return e.warn("Audio: Invocation of abstract method: Audio.disconnect in", this), this
}, t.prototype.play = function(t, n) {
return e.warn("Audio: Invocation of abstract method: Audio.play in", this), this
}, t.prototype.stop = function(t) {
return e.warn("Audio: Invocation of abstract method: Audio.stop in", this), this
}, t.prototype.pause = function() {
return e.warn("Audio: Invocation of abstract method: Audio.pause in", this), this
}, t.prototype.unpause = function() {
return e.warn("Audio: Invocation of abstract method: Audio.unpause in", this), this
}, t.prototype.curvePlaybackRate = function(t, n) {
return e.warn("Audio: Invocation of abstract method: Audio.curvePlaybackRate in", this), this
}, t.prototype.fadeInAndPlay = function(e, t) {
return console.warn("Audio: Invocation of abstract method: Audio.fadeInAndPlay in", this), this
}, t.prototype.fadeOutAndStop = function(e, t) {
return console.warn("Audio: Invocation of abstract method: Audio.fadeOutAndStop in", this), this
}, t.prototype.deschedule = function() {
return console.warn("Audio: Invocation of abstract method: Audio.deschedule in", this), this
}, Object.defineProperty(t.prototype, "playbackRate", {
set: function(t) {
return e.warn("Audio: Invocation of abstract property: Audio.playbackRate in", this), this
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "playing", {
get: function() {
return e.warn("Audio: Invocation of abstract property: Audio.playing in", this), !1
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "duration", {
get: function() {
return e.warn("Audio: Invocation of abstract property: Audio.duration in", this), 0
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "output", {
get: function() {
return this._output
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "playbackState", {
get: function() {
return e.warn("Audio: Invocation of abstract property: Audio.playbackState in", this), 0
},
enumerable: !0,
configurable: !0
}), t.prototype.setData = function(e) {
this._volume = e.volume == undefined ? 1 : e.volume, this._output.gain.value = this._volume, this.destinationName != e.destination_name && (this.destinationName = e.destination_name, this.disconnect(), this.connect(r.instance.findInstance(this.destinationName).input))
}, t
}();
t.Audio = o;
var u = function(n) {
function o(e, t) {
n.call(this, e, t), this._sources = [], this._startTime = 0, this._loopStartTime = 0, this._scheduleAhead = .2, this._stopping = !1, this._fading = !1, this._paused = !1, this._pauseTime = -1, this._pauseStartTime = -1, this.data = e, this.editorName = e.editorName, this._fileId = e.file_id, this._playbackRate = e.playback_rate || 1, this._endTime = 0, this._loop = e.loop != undefined ? e.loop : !1, this._loopStart = e.loop_start, this._loopEnd = e.loop_end, this._offset = e.offset || 0, this._duration = e.duration || 0, this._reverse = e.reverse, this._retrig = e.retrig != undefined ? e.retrig : !0, this._lockPlaybackrate = e.lock_playback_rate != undefined ? e.lock_playback_rate : !1, this._volumeStartRange = e.volume_start_range, this._volumeEndRange = e.volume_end_range, this._pitchStartRange = e.pitch_start_range, this._pitchEndRange = e.pitch_end_range, e.panner && (this._panner = e.panner);
if (e.granular) {
this._granular = {
bufferDuration: 0,
speed: e.granular.speed || .3333,
pitch: e.granular.pitch || 0,
pitchRandomization: e.granular.pitch_randomization || 0,
timeRandomization: e.granular.time_randomization || 0,
realTime: 0,
grainTime: 0,
grainDuration: e.granular.grain_duration || .09,
grainSpacing: e.granular.grain_spacing || .045,
grainWindow: null
};
var i = 16384;
this._granular.grainWindow = new Float32Array(i);
for (var s = 0; s < i; ++s) this._granular.grainWindow[s] = Math.sin(Math.PI * s / i)
}
r.instance.pushToPostLoadInitStack(this) || this.init()
}
return i(o, n), o.prototype.init = function() {
this._fileId && (typeof this._fileId == "string" ? this._buffer = s.instance.getFile(this._fileId) : this._fileId.sampleRate && (this._buffer = this._fileId));
if (!this._buffer) return;
this._duration || (this._duration = this._buffer.duration), this._granular && (this._granular.bufferDuration = this._buffer.duration - .05);
if (this._reverse) {
var t = e.context.createBuffer(this._buffer.numberOfChannels, this._buffer.length, e.context.sampleRate);
for (var n = 0; n < this._buffer.numberOfChannels; n++) {
var r = this._buffer.getChannelData(n),
i = t.getChannelData(n);
for (var o = r.length, u = o - 1; u >= 0; u--) i[o - u] = r[u]
}
this._buffer = t
}
if (this.data.xfade) {
var f = e.context.createBuffer(this._buffer.numberOfChannels, this._buffer.length, e.context.sampleRate);
for (var n = 0; n < this._buffer.numberOfChannels; n++) {
var r = this._buffer.getChannelData(n),
l = f.getChannelData(n);
for (var o = r.length, u = o - 1; u >= 0; u--) l[u] = r[u]
}
this._buffer = f;
var c = e.context.sampleRate,
h = this.data.xfade === !0 ? 11025 : this.data.xfade * c,
p = this._loopStart == undefined ? h : Math.round(this._loopStart * c),
d = this._loopEnd == undefined ? this._buffer.length : Math.round(this._loopEnd * c);
a(this._buffer, p, d, h)
}
}, o.prototype.setLoopRegion = function(e, t) {
this._loopStart = e || this._loopStart, this._loopEnd = t || this._loopEnd;
for (var n = 0, r = this._sources.length; n < r; n++) {
var i = this._sources[n];
i.loopStart = this._loopStart, i.loopEnd = this._loopEnd
}
return this
}, o.prototype.connect = function(e, t) {
if (!this._destination || t) this._destination = e, this._panner ? (this._output.connect(this._panner.input), this._panner.output.connect(e)) : this._output.connect(e);
return this
}, o.prototype.disconnect = function() {
return this._output.disconnect(), this._destination = null, this._panner && this._panner.output.disconnect(), this
}, o.prototype.scheduleGrain = function() {
if (!this._buffer) return;
var t = this._granular,
n = e.context.createBufferSource();
n.buffer = this._buffer;
var r = Math.random(),
i = Math.random(),
s = Math.random(),
o = Math.random(),
u = Math.random();
r = (r - .5) * 2, i = (i - .5) * 2, s = (s - .5) * 2, o = (o - .5) * 2;
var a = e.context.createGain();
n.connect(a), a.connect(this._output);
var f = this._granular.pitch + r * t.pitchRandomization,
l = Math.pow(2, f / 1200);
n.playbackRate.value = l;
var c = i * t.timeRandomization;
n.start(t.realTime, t.grainTime + c, t.grainDuration);
var h = t.grainDuration / l;
a.gain.value = 0, a.gain.setValueCurveAtTime(t.grainWindow, t.realTime, h);
var p = t.grainTime;
t.realTime += t.grainSpacing, t.grainTime += t.speed * t.grainSpacing, t.grainTime > t.bufferDuration && (t.grainTime = 0, this._loop || this.stop()), t.grainTime < 0 && (t.grainTime += t.bufferDuration, this._loop || this.stop())
}, o.prototype.granularSchedule = function(t) {
while (this._granular.realTime < t + .1) this.scheduleGrain();
var n = this;
this._granular.scheduleId = setTimeout(function() {
n.granularSchedule(e.context.currentTime)
}, 20)
}, o.prototype.play = function(t, n, i) {
typeof t == "undefined" && (t = 0), typeof n == "undefined" && (n = 0), typeof i == "undefined" && (i = !1), this.removeUnusedSources();
if (!this._buffer) {
this.init();
if (!this._buffer) {
e.warn("AudioSource: Buffer not found!", this._name);
return
}
}
t = t || 0;
if (this._granular) this.granularSchedule(t);
else {
if (t != 0 && t + .01 <= e.context.currentTime) return e.warn("AudioSource: Returned, playTime < currentTime", this._name), this;
t == 0 && (t = e.context.currentTime), this.output.gain.cancelScheduledValues(t), this._volumeStartRange != undefined ? this.output.gain.setValueAtTime(this._volume * (Math.random() * (this._volumeEndRange - this._volumeStartRange) + this._volumeStartRange), t) : this.output.gain.setValueAtTime(this._volume, t), this.paused || (this._pauseStartTime = t), i || (this._pauseTime = 0), this._startTime = t, this._loopStartTime = t + this.duration, this._paused = !1;
if (this._stopping && !this._retrig) {
this.output.gain.cancelScheduledValues(t), this.output.gain.setValueAtTime(this.output.gain.value, t), this.output.gain.linearRampToValueAtTime(this._volume, t + .25), clearTimeout(this._stoppingId), this._stopping = !1;
return
}!this._fading, this._fading = !1;
if (!this._retrig && !this.loop) {
if (t < this._endTime) return
} else if (this.loop && !this._retrig) {
if (this._endTime == -1 || t < this._endTime) return
} else {
if (this.loop && this._retrig && this.playing && !this._stopping) return;
if (this._stopping) this._stopping = !1;
else if (Math.round(this._endTime * 1e3) / 1e3 == Math.round((t + this._buffer.duration) * 1e3) / 1e3) return e.warn("AudioSource: Returned, Doubletrig", this._name), this
}
this._endTime = this.loop ? -1 : t + this._buffer.duration;
var s = this.createBufferSource();
s.buffer = this._buffer, this._loop && (s.loop = !0, s.loopStart = this._loopStart ? this._loopStart : 0, s.loopEnd = this._loopEnd ? this._loopEnd : this._buffer.duration), this._destination || e.warn("AudioSource: no destination node"), typeof this._destination != "object" && e.warn("AudioSource: destination is not an object", this._name), s.connect(this._output), n > this._duration && (n %= this._duration), this._startOffset = this._offset + n;
var o = this._duration;
this._pitchStartRange != undefined && (s.playbackRate.value = this._playbackRate * (Math.random() * (this._pitchEndRange - this._pitchStartRange) + this._pitchStartRange)), s.startTime = t, s.start(t, this._startOffset, o || s.buffer.duration), r.callbacks && r.callbacks.scheduleAudioSource && r.callbacks.scheduleAudioSource({
audio: this,
startTime: t
})
}
return this
}, o.prototype.getNumberOfSamples = function() {
return this._buffer.length
}, o.prototype.stop = function(e) {
typeof e == "undefined" && (e = 0);
if (this._granular) clearTimeout(this._granular.scheduleId);
else {
this._stopping && (this._stopping = !1, clearTimeout(this._stoppingId));
var t = this._sources.length;
if (t > 0) {
e = e || j.now(), this._loop && (this._loopPlaying = !1), this._endTime = e;
if (this._retrig) this._sources[this._sources.length - 1].stop(e), this._sources.splice(this._sources.length - 1, 1);
else {
for (var n = 0; n < t; n++) {
var r = this._sources[n];
r.stop(e), this._endTime = j.now()
}
this._sources = []
}
} else this._loopPlaying = !1
}
return this
}, o.prototype.deschedule = function() {
for (var t = 0; t < this._sources.length; t++) {
var n = this._sources[t];
n.startTime > e.context.currentTime && (n.stop(0), this._sources[t].disconnect(), n.disconnect(), this._sources.splice(t, 1), t--)
}
return this
}, o.prototype.pause = function() {
if (this._endTime > j.now()) {
this._paused = !0;
var e = j.now() - this._startTime;
this._pauseTime += e, this.stop()
}
return this
}, o.prototype.unpause = function() {
if (this.paused) {
var e = this._offset;
this._offset += this._pauseTime, this.play(0, 0, !0), this._offset = e, this._paused = !1
}
return this
}, o.prototype.createBufferSource = function() {
var t = e.context.createBufferSource();
return t.playbackRate.value = this._playbackRate, this._sources.push(t), t
}, o.prototype.fadeInAndPlay = function(t, n, r) {
typeof r == "undefined" && (r = 0);
var i = e.context.currentTime;
n || (n = i);
if (this.loop && !this._retrig && (this._endTime == -1 || n < this._endTime) && !this._stopping) return;
if (this.loop && this._retrig && this.playing && !this._stopping) return;
this.output.gain.cancelScheduledValues(n);
if (this._stopping && !this._retrig) clearTimeout(this._stoppingId), this.output.gain.setValueAtTime(this.output.gain.value, n);
else {
if (this._stopping && this._retrig) {
this._fading = !0, this.play(n == i ? 0 : n, r);
var s = e.context.createGain();
this._sources[this._sources.length - 1].disconnect(), this._sources[this._sources.length - 1].connect(s), s.connect(this.output), s.gain.setValueAtTime(0, n), s.gain.linearRampToValueAtTime(1, n + t), this._stopping = !1;
return
}
this._fading = !0, this.play(n == i ? 0 : n, r), this.output.gain.setValueAtTime(0, n)
}
return this._stopping = !1, this.output.gain.linearRampToValueAtTime(this._volume, n + t), this
}, o.prototype.fadeOutAndStop = function(t, n) {
if (!this.playing) return;
n == undefined && (n = e.context.currentTime), this._stopping && clearTimeout(this._stoppingId);
if (this._retrig && !this._stopping) {
var r = e.context.createGain();
this._sources[this._sources.length - 1].disconnect(), this._sources[this._sources.length - 1].connect(r);
var i = this;
this._sources[this._sources.length - 1].hasOwnProperty("onended") ? this._sources[this._sources.length - 1].onended = function() {
i._stopping = !1
} : this._stoppingId = setTimeout(function() {
i._stopping = !1
}, (t + (n - j.now()) - i._scheduleAhead) * 1e4), r.connect(this.output), r.gain.setValueAtTime(1, n), r.gain.linearRampToValueAtTime(0, n + t), this.stop(n + t)
} else if (!this._retrig) {
this.output.gain.cancelScheduledValues(n), this.output.gain.setValueAtTime(this.output.gain.value || this._volume, n), this.output.gain.linearRampToValueAtTime(0, n + t);
var i = this;
this._stoppingId = setTimeout(function() {
if (!i._stopping) return;
i._stopping = !1, i.loop && (i._loopPlaying = !1), i.stop(n + t)
}, (t + (n - j.now()) - i._scheduleAhead) / .001)
}
return this._stopping = !0, this
}, o.prototype.removeUnusedSources = function() {
for (var t = 0; t < this._sources.length; t++) {
var n = this._sources[t];
if (!n.buffer || !this.loop && n.startTime + n.buffer.duration < e.context.currentTime) this._sources[t].disconnect(), this._sources.splice(t, 1), t--
}
}, o.prototype.curvePlaybackRate = function(e, t) {
if (this._lockPlaybackrate) return;
var n = this.playbackRateNode;
return n && (n.cancelScheduledValues(j.now()), n.setValueAtTime(n.value == 0 ? j.EXP_MIN_VALUE : n.value, j.now()), n.exponentialRampToValueAtTime(e, j.now() + t)), this._playbackRate = e, this
}, Object.defineProperty(o.prototype, "lastSource", {
get: function() {
var e = this._sources.length;
return e == 0 ? null : this._sources[e - 1]
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(o.prototype, "loop", {
get: function() {
return this._loop
},
set: function(e) {
this._loop = e
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(o.prototype, "offset", {
get: function() {
return this._offset
},
set: function(e) {
typeof e == "string" && e.indexOf("%") !== -1 && (e = this._duration * parseFloat(e)), this._offset = e
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(o.prototype, "position", {
get: function() {
if (!this.playing || !this._duration) return 0;
var e = this._duration;
if (this._loopStart || this._loopEnd) e = (this._loopEnd || e) - (this._loopStart || 0);
var t = j.now() - this._startTime,
n = j.now() + this._startOffset - this._loopStartTime;
return this._startOffset + t > this._duration ? this._loopStart + n % e : this._startOffset + t
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(o.prototype, "duration", {
get: function() {
return this._duration
},
set: function(e) {
this._duration = e
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(o.prototype, "paused", {
get: function() {
return this._paused
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(o.prototype, "playbackRate", {
get: function() {
return this._playbackRate
},
set: function(e) {
if (this._lockPlaybackrate) return;
var t = this.playbackRateNode;
t && t.cancelScheduledValues(j.now()), this._playbackRate = e;
for (var n = 0, r = this._sources.length; n < r; n++) this._sources[n].playbackRate.value = this._playbackRate
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(o.prototype, "nextPlaybackRate", {
set: function(e) {
if (this._lockPlaybackrate) return;
this._playbackRate = e
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(o.prototype, "playbackRateNode", {
get: function() {
var e = this.lastSource;
return e && e.playbackRate
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(o.prototype, "buffer", {
get: function() {
return this._buffer || (this._buffer = s.instance.getFile(this._fileId)), this._buffer
},
set: function(e) {
this._buffer = e
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(o.prototype, "playing", {
get: function() {
return this._endTime == -1 || this._endTime > j.now()
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(o.prototype, "playbackState", {
get: function() {
var e = this.lastSource;
return e ? e.playbackState : 0
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(o.prototype, "output", {
get: function() {
return this._panner ? this._panner.output : this._output
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(o.prototype, "panner", {
get: function() {
return this._panner
},
enumerable: !0,
configurable: !0
}), o.prototype.freeBuffer = function() {
this._buffer = null;
for (var e = 0, t = this._sources.length; e < t; e++) {
try {
this._sources[e].stop(0)
} catch (n) {}
this._sources[e].disconnect(), this._sources[e] = null
}
this._sources = []
}, o.prototype.setData = function(e) {
n.prototype.setData.call(this, e);
var r = !1;
this._volumeStartRange = e.volume_start_range, this._volumeEndRange = e.volume_end_range, this._pitchEndRange = e.pitch_end_range, this._pitchStartRange = e.pitch_start_range, e.file_id != undefined && this._fileId != e.file_id && (this._fileId = e.file_id, r = !0), this._playbackRate = e.playback_rate == undefined ? 1 : e.playback_rate, this.playbackRateNode && (this.playbackRateNode.value = this._playbackRate), this._loop = e.loop == undefined ? !1 : e.loop, this.lastSource && (this.lastSource.loop = this._loop), this._loop || (this._loopPlaying = !1), this._loopStart = e.loop_start == undefined ? 0 : e.loop_start, this.lastSource && (this.lastSource.loopStart = this._loopStart), this._loopEnd = e.loop_end == undefined ? 0 : e.loop_end, this.lastSource && (this.lastSource.loopEnd = this._loopEnd);
var i = e.offset == undefined ? 0 : e.offset;
this._offset != i && (this._offset = i, r = !0);
var s = e.duration == undefined ? 0 : e.duration;
this._duration != s && (this._duration = s, r = !0), this._retrig = e.retrig == undefined ? !0 : e.retrig, e.reverse == undefined && (e.reverse = !1), this._reverse != e.reverse && (this._reverse = e.reverse, r = !0), e.xfade == undefined && (e.xfade = !1), this.data.xfade != e.xfade && (r = !0), this.data = e, r && this.init();
if (e.granular)
if (this._granular) e.granular.speed != undefined && (this._granular.speed = e.granular.speed), e.granular.pitch != undefined && (this._granular.pitch = e.granular.pitch), e.granular.pitch_randomization != undefined && (this._granular.pitchRandomization = e.granular.pitch_randomization), e.granular.time_randomization != undefined && (this._granular.timeRandomization = e.granular.time_randomization), e.granular.grain_duration != undefined && (this._granular.grainDuration = e.granular.grain_duration), e.granular.grain_spacing != undefined && (this._granular.grainSpacing = e.granular.grain_spacing);
else {
this._granular = {
bufferDuration: this._buffer.duration - .05,
speed: e.granular.speed || .3333,
pitch: e.granular.pitch || 0,
pitchRandomization: e.granular.pitch_randomization || 0,
timeRandomization: e.granular.time_randomization || 0,
realTime: 0,
grainTime: 0,
grainDuration: e.granular.grain_duration || .09,
grainSpacing: e.granular.grain_spacing || .045,
grainWindow: null
};
var o = 16384,
u = new Float32Array(o);
for (var a = 0; a < o; ++a) u[a] = Math.sin(Math.PI * a / o);
this._granular.grainWindow = u
} else this._granular && (clearTimeout(this._granular.scheduleId), this._granular = null);
if (e.panner)
if (!this._panner) {
var f = this._destination;
this.disconnect(), this._panner = new t.Panner(e.panner), this.connect(f)
} else this._panner.setData(e.panner);
else if (!e.panner && this._panner) {
var f = this._destination;
this.disconnect(), this._panner = null, this.connect(f)
}
}, o
}(o);
t.AudioSource = u, t.crossfade = a;
var f = {
CONCURRENT: 0,
STEP: 1,
RANDOM: 2,
SHUFFLE: 3,
BACKWARDS: 4
},
l = {
NONE: 0,
ONE: 1,
INFINITE: 2
},
c = function(t) {
function n(e, n) {
t.call(this, e, n), this._adder = 0, this._currentId = 0, this._paused = !1, this._groupType = e.group_type != undefined ? e.group_type : f.STEP, this._retrig = e.retrig != undefined ? e.retrig : !0, this._queue = e.queue != undefined ? e.queue : l.NONE, this._content = e.content || [], r.instance.pushToPreLoadInitStack(this)
}
return i(n, t), n.prototype.init = function() {
var e = [];
for (var t = 0, n = this._content.length; t < n; t++) e.push(r.instance.findInstance(this._content[t]));
this._content = e
}, n.prototype.connect = function(e) {
for (var t = 0, n = this._content.length; t < n; t++) {
var r = this._content[t];
r.disconnect(), r.connect(this._output)
}
return this._output.connect(e), this
}, n.prototype.disconnect = function() {
return this._output.disconnect(), this
}, n.prototype.play = function(t, n, r) {
if (!this._content.length) return;
var i = this.latestPlayed ? this.latestPlayed.playing : !1;
if (!r && !this._retrig && i) return this._queue != l.NONE && (this._queue == l.ONE && this._latestStartTime > e.context.currentTime ? (this.latestPlayed.stop(), this.play(this._latestStartTime, n, !0)) : this.play(this._latestStartTime + this.latestPlayed.duration, n, !0)), this;
this._paused = !1;
if (n != undefined) {
var s;
typeof n == "number" ? s = n : typeof n == "string" ? s = this.getIdFromString(n) : n._name && (s = this.getIdFromString(n._name)), this._content[s].play(t), this._latestPlayed = this._content[s]
} else {
if (this._groupType == f.CONCURRENT)
for (var o = 0, u = this._content.length; o < u; o++) this._content[o].play(t);
else this._currentId = this.getIdToPlay(), this._content[this._currentId].play(t);
this._groupType === f.CONCURRENT ? this._latestPlayed = this._content[0] : this._latestPlayed = this._content[this._currentId]
}
return this._latestStartTime = t || e.context.currentTime, this
}, n.prototype.getIdToPlay = function() {
var e;
if (this._groupType == f.STEP) this._adder < 0 ? e = this._content.length - 1 + this._adder % this._content.length : e = this._adder % this._content.length, this._adder++;
else if (this._groupType == f.RANDOM) {
var t = Math.floor(Math.random() * (this._content.length - 1));
this._content.length > 1 && t == this._adder && (t = (t + 1) % this._content.length), e = this._adder = t
} else this._groupType == f.SHUFFLE ? (this._adder % this._content.length == 0 && j.shuffle(this._content), e = this._adder % this._content.length, this._adder++) : this._groupType == f.BACKWARDS && (this._adder < 0 ? e = this._content.length - 1 + this._adder % this._content.length : e = this._adder % this._content.length, this._adder--);
return e
}, n.prototype.stop = function(e) {
return this._content[this._currentId].stop(e), this
}, n.prototype.pause = function() {
return this._paused = !0, this._latestPlayed && this._latestPlayed.pause(), this
}, n.prototype.unpause = function() {
return this._paused = !1, this._latestPlayed && this._latestPlayed.unpause(), this
}, n.prototype.fadeInAndPlay = function(e, t) {
var n = this.latestPlayed ? this.latestPlayed.playing : !1;
if (!this._retrig && n) return;
return this._currentId = this.getIdToPlay(), this._latestPlayed = this._content[this._currentId], this._content[this._currentId].fadeInAndPlay(e, t), this
}, n.prototype.fadeOutAndStop = function(t, n) {
return n == undefined && (n = e.context.currentTime), this._latestPlayed && this._latestPlayed.fadeOutAndStop(t, n), this
}, n.prototype.curvePlaybackRate = function(e, t) {
for (var n = 0, r = this._content.length; n < r; n++) this._content[n].curvePlaybackRate(e, t);
return this
}, n.prototype.deschedule = function() {
for (var e = 0, t = this._content.length; e < t; e++) this._content[e].deschedule();
return this
}, n.prototype.getIdFromString = function(e) {
for (var t = 0, n = this._content.length; t < n; t++)
if (this._content[t]._name == e) return t
}, Object.defineProperty(n.prototype, "playbackRate", {
set: function(e) {
for (var t = 0, n = this._content.length; t < n; t++) this._content[t].playbackRate = e
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(n.prototype, "groupType", {
get: function() {
return this._groupType
},
set: function(e) {
this._groupType = e
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(n.prototype, "content", {
get: function() {
return this._content
},
set: function(e) {
this._content = e, this.init()
},
enumerable: !0,
configurable: !0
}), n.prototype.addContent = function(e) {
this._content.push(e)
}, n.prototype.removeContent = function(e) {
for (var t = 0; t < this._content.length; t++) this._content[t]._name === e && this._content.splice(t, 1)
}, Object.defineProperty(n.prototype, "playing", {
get: function() {
return this._latestPlayed ? this._latestPlayed.playing : !1
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(n.prototype, "duration", {
get: function() {
return this._latestPlayed ? this._latestPlayed.duration : this._content[0].duration
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(n.prototype, "playbackState", {
get: function() {
return this._content[this._currentId].playbackState
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(n.prototype, "latestPlayed", {
get: function() {
return this._latestPlayed
},
enumerable: !0,
configurable: !0
}), n.prototype.setData = function(e) {
t.prototype.setData.call(this, e), this._groupType = e.group_type == undefined ? f.STEP : e.group_type, this._retrig = e.retrig == undefined ? !0 : e.retrig, this._queue = e.queue == undefined ? l.NONE : e.queue, e.content && (this._content = e.content, this.init())
}, n
}(o);
t.AudioGroup = c;
var h = function() {
function t(e) {
this._startValue = e.start_value || 0, this._points = e.points || []
}
return t.prototype.automate = function(t, n) {
n = n || e.context.currentTime, t.cancelScheduledValues(n), t.setValueAtTime(this._startValue, n);
var r = 0;
for (var i = 0, s = this._points.length; i < s; i++) {
var o = this._points[i];
switch (o.curve) {
case "lin":
t.linearRampToValueAtTime(o.value, n + o.time);
break;
case "exp":
t.exponentialRampToValueAtTime(o.value, n + o.time);
break;
default:
if (!j.CUSTOM_CURVES[o.curve]) {
e.warn("Automation: Invalid curve type: " + o.curve);
break
}
t.setValueCurveAtTime(j.CUSTOM_CURVES[o.curve], n + r, o.time - r)
}
r = o.time
}
}, t
}();
t.Automation = h;
var p = function() {
function t(t, n) {
this._name = n, this._type = t.type, this._input = e.context.createGain(), this._output = e.context.createGain(), this._effects = t.effects || [];
for (var i = 0, s = this._effects.length; i < s; i++) t.effects[i].active === !1 && this._effects[i].setActive(!1);
this._input.gain.value = t.input_vol !== undefined ? t.input_vol : 1, this._output.gain.value = t.output_vol !== undefined ? t.output_vol : 1, t.destination_name && (this.destinationName = t.destination_name, r.instance.pushToConnectStack(this)), r.instance.pushToPreLoadInitStack(this)
}
return t.prototype.init = function() {
var e = this._input;
for (var t = 0, n = this._effects.length; t < n; t++) e.disconnect(), e.connect(this._effects[t].input), e = this._effects[t];
e.connect(this._output)
}, t.prototype.connect = function(e) {
return this._output.connect(e), this
}, t.prototype.disconnect = function() {
return this._output.disconnect(), this
}, t.prototype.insertEffect = function(e, t) {
var n = r.instance.createObject(undefined, e, {
excludeFromTable: !0
});
return t == undefined ? this._effects.push(n) : this._effects.splice(t, 0, n), this.init(), this
}, t.prototype.moveEffect = function(e, t) {
for (var n = 0, r = this._effects.length; n < r; n++) this._effects[n].disconnect();
var i = this._effects[e];
return this._effects.splice(e, 1), this._effects.splice(t, 0, i), this.init(), this
}, Object.defineProperty(t.prototype, "input", {
get: function() {
return this._input
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "output", {
get: function() {
return this._output
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "effects", {
get: function() {
return this._effects
},
enumerable: !0,
configurable: !0
}), t.prototype.setData = function(e) {
this._input.gain.value = e.input_vol == undefined ? 1 : e.input_vol, this._output.gain.value = e.output_vol == undefined ? 1 : e.output_vol;
if (e.effects.length < this.effects.length) {
this.input.disconnect();
var t = !1;
for (var n = 0; n < this._effects.length; n++) this._effects[n].disconnect(), t || (e.effects[n] == undefined ? (this._effects.splice(n, 1), t = !0) : this._effects[n]._type != e.effects[n].type && (this._effects.splice(n, 1), n--, t = !0));
this.init()
} else if (e.effects.length > this.effects.length) this.insertEffect(e.effects[e.effects.length - 1]);
else
for (var n = 0, i = this._effects.length; n < i; n++) this._effects[n].setData(e.effects[n]);
this.destinationName != e.destination_name && (this.destinationName = e.destination_name, this.disconnect(), this.destinationName == "$OUT" ? this.connect(r.instance._superMasterOutput) : this.connect(r.instance.findInstance(this.destinationName).input))
}, t
}();
t.Bus = p;
var d = function() {
function t(t) {
this.active = !0, this._type = t.type, this._input = e.context.createGain != undefined ? e.context.createGain() : e.context.createGainNode(), this._output = e.context.createGain != undefined ? e.context.createGain() : e.context.createGainNode(), t.active === !1 && (this.active = !1)
}
return t.prototype.connect = function(e) {
return this._output.connect(e), this
}, t.prototype.disconnect = function() {
return this._output.disconnect(), this
}, t.prototype.setActive = function(t) {
return e.warn("Effect: Invocation of abstract method: Effect.setActive in", this), this
}, Object.defineProperty(t.prototype, "input", {
get: function() {
return this._input
},
enumerable: !0,
configurable: !0
}), Object.defineProperty(t.prototype, "output", {
get: function() {
return this._output
},
enumerable: !0,
configurable: !0
}), t
}();
t.Effect = d;
var v = function(t) {
function n(r) {
t.call(this, r), this._name = r.name, this._panner = e.context.createPanner(), this._input.connect(this._panner), this._panner.connect(this._output), r.panning_model != undefined && (this._panner.panningModel = r.panning_model), r.distance_model != undefined && (this._panner.distanceModel =
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment