function TextWithSubline(t, e) {
var i = new THREE.Object3D(),
r = new THREE.TextGeometry(e, { font: t, size: 8, height: 0.5 });
r.computeBoundingBox();
var n = new THREE.MeshBasicMaterial({ color: "#ffffff", transparent: !0 }),
s = new THREE.Mesh(r, n),
o = r.boundingBox.max.x;
(s.position.x = -o / 2), i.add(s);
var r = new THREE.BoxGeometry(60, 1, 0.1),
n = new THREE.MeshBasicMaterial({ color: "#ff0000", transparent: !0 }),
a = new THREE.Mesh(r, n);
return (a.position.y = -20), i.add(a), i;
}
function Text(t, e) {
var i = new THREE.Object3D(),
r = new THREE.TextGeometry(e, { font: t, size: 8, height: 0.5 });
r.computeBoundingBox();
var n = new THREE.MeshBasicMaterial({ color: "#ffffff", transparent: !0 }),
s = new THREE.Mesh(r, n),
o = r.boundingBox.max.x;
return (s.position.x = -o / 2), i.add(s), i;
}
function PointsOnSphere(t) {
for (var e = [], i = Math.PI * (3 - Math.sqrt(5)), r = 2 / t, n = 0, s = 0, o = 0, a = 0, l = 0, h = 0; h < t; h++)
(s = h * r - 1 + r / 2), (a = Math.sqrt(1 - s * s)), (l = h * i), (n = Math.cos(l) * a), (o = Math.sin(l) * a), e.push(new THREE.Vector3(700 * n, 700 * s, 700 * o));
return e;
}
function fibonacci_sphere(t) {
var e = 1;
(randomize = !1), randomize && (e = Math.random() * t), (points = []), (offset = 2 / t), (increment = Math.PI * (3 - Math.sqrt(5)));
for (var i = 0; i < t; i++) (y = i * offset - 1 + offset / 2), (r = Math.sqrt(1 - Math.pow(y, 2))), (phi = ((i + e) % t) * increment), (x = Math.cos(phi) * r), (z = Math.sin(phi) * r), points.push(new THREE.Vector3(x, y, z));
return points;
}
var dat = dat || {};
(dat.gui = dat.gui || {}),
(dat.utils = dat.utils || {}),
(dat.controllers = dat.controllers || {}),
(dat.dom = dat.dom || {}),
(dat.color = dat.color || {}),
(dat.utils.css = (function () {
return {
load: function (t, e) {
var e = e || document,
i = e.createElement("link");
(i.type = "text/css"), (i.rel = "stylesheet"), (i.href = t), e.getElementsByTagName("head")[0].appendChild(i);
},
inject: function (t, e) {
var e = e || document,
i = document.createElement("style");
(i.type = "text/css"), (i.innerHTML = t), e.getElementsByTagName("head")[0].appendChild(i);
},
};
})()),
(dat.utils.common = (function () {
var t = Array.prototype.forEach,
e = Array.prototype.slice;
return {
BREAK: {},
extend: function (t) {
return (
this.each(
e.call(arguments, 1),
function (e) {
for (var i in e) this.isUndefined(e[i]) || (t[i] = e[i]);
},
this
),
t
);
},
defaults: function (t) {
return (
this.each(
e.call(arguments, 1),
function (e) {
for (var i in e) this.isUndefined(t[i]) && (t[i] = e[i]);
},
this
),
t
);
},
compose: function () {
var t = e.call(arguments);
return function () {
for (var i = e.call(arguments), r = t.length - 1; r >= 0; r--) i = [t[r].apply(this, i)];
return i[0];
};
},
each: function (e, i, r) {
if (t && e.forEach === t) e.forEach(i, r);
else if (e.length === e.length + 0) for (var n = 0, s = e.length; n < s && !(n in e && i.call(r, e[n], n) === this.BREAK); n++);
else for (n in e) if (i.call(r, e[n], n) === this.BREAK) break;
},
defer: function (t) {
setTimeout(t, 0);
},
toArray: function (t) {
return t.toArray ? t.toArray() : e.call(t);
},
isUndefined: function (t) {
return void 0 === t;
},
isNull: function (t) {
return null === t;
},
isNaN: function (t) {
return t !== t;
},
isArray:
Array.isArray ||
function (t) {
return t.constructor === Array;
},
isObject: function (t) {
return t === Object(t);
},
isNumber: function (t) {
return t === t + 0;
},
isString: function (t) {
return t === t + "";
},
isBoolean: function (t) {
return t === !1 || t === !0;
},
isFunction: function (t) {
return "[object Function]" === Object.prototype.toString.call(t);
},
};
})()),
(dat.controllers.Controller = (function (t) {
var e = function (t, e) {
(this.initialValue = t[e]), (this.domElement = document.createElement("div")), (this.object = t), (this.property = e), (this.__onFinishChange = this.__onChange = void 0);
};
return (
t.extend(e.prototype, {
onChange: function (t) {
return (this.__onChange = t), this;
},
onFinishChange: function (t) {
return (this.__onFinishChange = t), this;
},
setValue: function (t) {
return (this.object[this.property] = t), this.__onChange && this.__onChange.call(this, t), this.updateDisplay(), this;
},
getValue: function () {
return this.object[this.property];
},
updateDisplay: function () {
return this;
},
isModified: function () {
return this.initialValue !== this.getValue();
},
}),
e
);
})(dat.utils.common)),
(dat.dom.dom = (function (t) {
function e(e) {
return "0" === e || t.isUndefined(e) ? 0 : ((e = e.match(r)), t.isNull(e) ? 0 : parseFloat(e[1]));
}
var i = {};
t.each({ HTMLEvents: ["change"], MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"], KeyboardEvents: ["keydown"] }, function (e, r) {
t.each(e, function (t) {
i[t] = r;
});
});
var r = /(\d+(\.\d+)?)px/,
n = {
makeSelectable: function (t, e) {
void 0 !== t &&
void 0 !== t.style &&
((t.onselectstart = e
? function () {
return !1;
}
: function () {}),
(t.style.MozUserSelect = e ? "auto" : "none"),
(t.style.KhtmlUserSelect = e ? "auto" : "none"),
(t.unselectable = e ? "on" : "off"));
},
makeFullscreen: function (e, i, r) {
t.isUndefined(i) && (i = !0), t.isUndefined(r) && (r = !0), (e.style.position = "absolute"), i && ((e.style.left = 0), (e.style.right = 0)), r && ((e.style.top = 0), (e.style.bottom = 0));
},
fakeEvent: function (e, r, n, s) {
var n = n || {},
o = i[r];
if (!o) throw Error("Event type " + r + " not supported.");
var a = document.createEvent(o);
switch (o) {
case "MouseEvents":
a.initMouseEvent(r, n.bubbles || !1, n.cancelable || !0, window, n.clickCount || 1, 0, 0, n.x || n.clientX || 0, n.y || n.clientY || 0, !1, !1, !1, !1, 0, null);
break;
case "KeyboardEvents":
(o = a.initKeyboardEvent || a.initKeyEvent),
t.defaults(n, { cancelable: !0, ctrlKey: !1, altKey: !1, shiftKey: !1, metaKey: !1, keyCode: void 0, charCode: void 0 }),
o(r, n.bubbles || !1, n.cancelable, window, n.ctrlKey, n.altKey, n.shiftKey, n.metaKey, n.keyCode, n.charCode);
break;
default:
a.initEvent(r, n.bubbles || !1, n.cancelable || !0);
}
t.defaults(a, s), e.dispatchEvent(a);
},
bind: function (t, e, i, r) {
return t.addEventListener ? t.addEventListener(e, i, r || !1) : t.attachEvent && t.attachEvent("on" + e, i), n;
},
unbind: function (t, e, i, r) {
return t.removeEventListener ? t.removeEventListener(e, i, r || !1) : t.detachEvent && t.detachEvent("on" + e, i), n;
},
addClass: function (t, e) {
if (void 0 === t.className) t.className = e;
else if (t.className !== e) {
var i = t.className.split(/ +/);
i.indexOf(e) == -1 && (i.push(e), (t.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, "")));
}
return n;
},
removeClass: function (t, e) {
if (e) {
if (void 0 !== t.className)
if (t.className === e) t.removeAttribute("class");
else {
var i = t.className.split(/ +/),
r = i.indexOf(e);
r != -1 && (i.splice(r, 1), (t.className = i.join(" ")));
}
} else t.className = void 0;
return n;
},
hasClass: function (t, e) {
return RegExp("(?:^|\\s+)" + e + "(?:\\s+|$)").test(t.className) || !1;
},
getWidth: function (t) {
return (t = getComputedStyle(t)), e(t["border-left-width"]) + e(t["border-right-width"]) + e(t["padding-left"]) + e(t["padding-right"]) + e(t.width);
},
getHeight: function (t) {
return (t = getComputedStyle(t)), e(t["border-top-width"]) + e(t["border-bottom-width"]) + e(t["padding-top"]) + e(t["padding-bottom"]) + e(t.height);
},
getOffset: function (t) {
var e = { left: 0, top: 0 };
if (t.offsetParent)
do (e.left += t.offsetLeft), (e.top += t.offsetTop);
while ((t = t.offsetParent));
return e;
},
isActive: function (t) {
return t === document.activeElement && (t.type || t.href);
},
};
return n;
})(dat.utils.common)),
(dat.controllers.OptionController = (function (t, e, i) {
var r = function (t, n, s) {
r.superclass.call(this, t, n);
var o = this;
if (((this.__select = document.createElement("select")), i.isArray(s))) {
var a = {};
i.each(s, function (t) {
a[t] = t;
}),
(s = a);
}
i.each(s, function (t, e) {
var i = document.createElement("option");
(i.innerHTML = e), i.setAttribute("value", t), o.__select.appendChild(i);
}),
this.updateDisplay(),
e.bind(this.__select, "change", function () {
o.setValue(this.options[this.selectedIndex].value);
}),
this.domElement.appendChild(this.__select);
};
return (
(r.superclass = t),
i.extend(r.prototype, t.prototype, {
setValue: function (t) {
return (t = r.superclass.prototype.setValue.call(this, t)), this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), t;
},
updateDisplay: function () {
return (this.__select.value = this.getValue()), r.superclass.prototype.updateDisplay.call(this);
},
}),
r
);
})(dat.controllers.Controller, dat.dom.dom, dat.utils.common)),
(dat.controllers.NumberController = (function (t, e) {
var i = function (t, r, n) {
i.superclass.call(this, t, r),
(n = n || {}),
(this.__min = n.min),
(this.__max = n.max),
(this.__step = n.step),
(t = this.__impliedStep = e.isUndefined(this.__step) ? (0 == this.initialValue ? 1 : Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10) : this.__step),
(t = t.toString()),
(this.__precision = t.indexOf(".") > -1 ? t.length - t.indexOf(".") - 1 : 0);
};
return (
(i.superclass = t),
e.extend(i.prototype, t.prototype, {
setValue: function (t) {
return (
void 0 !== this.__min && t < this.__min ? (t = this.__min) : void 0 !== this.__max && t > this.__max && (t = this.__max),
void 0 !== this.__step && t % this.__step != 0 && (t = Math.round(t / this.__step) * this.__step),
i.superclass.prototype.setValue.call(this, t)
);
},
min: function (t) {
return (this.__min = t), this;
},
max: function (t) {
return (this.__max = t), this;
},
step: function (t) {
return (this.__step = t), this;
},
}),
i
);
})(dat.controllers.Controller, dat.utils.common)),
(dat.controllers.NumberControllerBox = (function (t, e, i) {
var r = function (t, n, s) {
function o() {
var t = parseFloat(c.__input.value);
i.isNaN(t) || c.setValue(t);
}
function a(t) {
var e = h - t.clientY;
c.setValue(c.getValue() + e * c.__impliedStep), (h = t.clientY);
}
function l() {
e.unbind(window, "mousemove", a), e.unbind(window, "mouseup", l);
}
(this.__truncationSuspended = !1), r.superclass.call(this, t, n, s);
var h,
c = this;
(this.__input = document.createElement("input")),
this.__input.setAttribute("type", "text"),
e.bind(this.__input, "change", o),
e.bind(this.__input, "blur", function () {
o(), c.__onFinishChange && c.__onFinishChange.call(c, c.getValue());
}),
e.bind(this.__input, "mousedown", function (t) {
e.bind(window, "mousemove", a), e.bind(window, "mouseup", l), (h = t.clientY);
}),
e.bind(this.__input, "keydown", function (t) {
13 === t.keyCode && ((c.__truncationSuspended = !0), this.blur(), (c.__truncationSuspended = !1));
}),
this.updateDisplay(),
this.domElement.appendChild(this.__input);
};
return (
(r.superclass = t),
i.extend(r.prototype, t.prototype, {
updateDisplay: function () {
var t,
e = this.__input;
if (this.__truncationSuspended) t = this.getValue();
else {
t = this.getValue();
var i = Math.pow(10, this.__precision);
t = Math.round(t * i) / i;
}
return (e.value = t), r.superclass.prototype.updateDisplay.call(this);
},
}),
r
);
})(dat.controllers.NumberController, dat.dom.dom, dat.utils.common)),
(dat.controllers.NumberControllerSlider = (function (t, e, i, r, n) {
var s = function (t, i, r, n, o) {
function a(t) {
t.preventDefault();
var i = e.getOffset(h.__background),
r = e.getWidth(h.__background);
return h.setValue(h.__min + (h.__max - h.__min) * ((t.clientX - i.left) / (i.left + r - i.left))), !1;
}
function l() {
e.unbind(window, "mousemove", a), e.unbind(window, "mouseup", l), h.__onFinishChange && h.__onFinishChange.call(h, h.getValue());
}
s.superclass.call(this, t, i, { min: r, max: n, step: o });
var h = this;
(this.__background = document.createElement("div")),
(this.__foreground = document.createElement("div")),
e.bind(this.__background, "mousedown", function (t) {
e.bind(window, "mousemove", a), e.bind(window, "mouseup", l), a(t);
}),
e.addClass(this.__background, "slider"),
e.addClass(this.__foreground, "slider-fg"),
this.updateDisplay(),
this.__background.appendChild(this.__foreground),
this.domElement.appendChild(this.__background);
};
return (
(s.superclass = t),
(s.useDefaultStyles = function () {
i.inject(n);
}),
r.extend(s.prototype, t.prototype, {
updateDisplay: function () {
return (this.__foreground.style.width = ((this.getValue() - this.__min) / (this.__max - this.__min)) * 100 + "%"), s.superclass.prototype.updateDisplay.call(this);
},
}),
s
);
})(
dat.controllers.NumberController,
dat.dom.dom,
dat.utils.css,
dat.utils.common,
".slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}"
)),
(dat.controllers.FunctionController = (function (t, e, i) {
var r = function (t, i, n) {
r.superclass.call(this, t, i);
var s = this;
(this.__button = document.createElement("div")),
(this.__button.innerHTML = void 0 === n ? "Fire" : n),
e.bind(this.__button, "click", function (t) {
return t.preventDefault(), s.fire(), !1;
}),
e.addClass(this.__button, "button"),
this.domElement.appendChild(this.__button);
};
return (
(r.superclass = t),
i.extend(r.prototype, t.prototype, {
fire: function () {
this.__onChange && this.__onChange.call(this), this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), this.getValue().call(this.object);
},
}),
r
);
})(dat.controllers.Controller, dat.dom.dom, dat.utils.common)),
(dat.controllers.BooleanController = (function (t, e, i) {
var r = function (t, i) {
r.superclass.call(this, t, i);
var n = this;
(this.__prev = this.getValue()),
(this.__checkbox = document.createElement("input")),
this.__checkbox.setAttribute("type", "checkbox"),
e.bind(
this.__checkbox,
"change",
function () {
n.setValue(!n.__prev);
},
!1
),
this.domElement.appendChild(this.__checkbox),
this.updateDisplay();
};
return (
(r.superclass = t),
i.extend(r.prototype, t.prototype, {
setValue: function (t) {
return (t = r.superclass.prototype.setValue.call(this, t)), this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), (this.__prev = this.getValue()), t;
},
updateDisplay: function () {
return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"), (this.__checkbox.checked = !0)) : (this.__checkbox.checked = !1), r.superclass.prototype.updateDisplay.call(this);
},
}),
r
);
})(dat.controllers.Controller, dat.dom.dom, dat.utils.common)),
(dat.color.toString = (function (t) {
return function (e) {
if (1 == e.a || t.isUndefined(e.a)) {
for (e = e.hex.toString(16); e.length < 6; ) e = "0" + e;
return "#" + e;
}
return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")";
};
})(dat.utils.common)),
(dat.color.interpret = (function (t, e) {
var i,
r,
n = [
{
litmus: e.isString,
conversions: {
THREE_CHAR_HEX: {
read: function (t) {
return (
(t = t.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i)),
null !== t && { space: "HEX", hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString()) }
);
},
write: t,
},
SIX_CHAR_HEX: {
read: function (t) {
return (t = t.match(/^#([A-F0-9]{6})$/i)), null !== t && { space: "HEX", hex: parseInt("0x" + t[1].toString()) };
},
write: t,
},
CSS_RGB: {
read: function (t) {
return (t = t.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/)), null !== t && { space: "RGB", r: parseFloat(t[1]), g: parseFloat(t[2]), b: parseFloat(t[3]) };
},
write: t,
},
CSS_RGBA: {
read: function (t) {
return (t = t.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/)), null !== t && { space: "RGB", r: parseFloat(t[1]), g: parseFloat(t[2]), b: parseFloat(t[3]), a: parseFloat(t[4]) };
},
write: t,
},
},
},
{
litmus: e.isNumber,
conversions: {
HEX: {
read: function (t) {
return { space: "HEX", hex: t, conversionName: "HEX" };
},
write: function (t) {
return t.hex;
},
},
},
},
{
litmus: e.isArray,
conversions: {
RGB_ARRAY: {
read: function (t) {
return 3 == t.length && { space: "RGB", r: t[0], g: t[1], b: t[2] };
},
write: function (t) {
return [t.r, t.g, t.b];
},
},
RGBA_ARRAY: {
read: function (t) {
return 4 == t.length && { space: "RGB", r: t[0], g: t[1], b: t[2], a: t[3] };
},
write: function (t) {
return [t.r, t.g, t.b, t.a];
},
},
},
},
{
litmus: e.isObject,
conversions: {
RGBA_OBJ: {
read: function (t) {
return !!(e.isNumber(t.r) && e.isNumber(t.g) && e.isNumber(t.b) && e.isNumber(t.a)) && { space: "RGB", r: t.r, g: t.g, b: t.b, a: t.a };
},
write: function (t) {
return { r: t.r, g: t.g, b: t.b, a: t.a };
},
},
RGB_OBJ: {
read: function (t) {
return !!(e.isNumber(t.r) && e.isNumber(t.g) && e.isNumber(t.b)) && { space: "RGB", r: t.r, g: t.g, b: t.b };
},
write: function (t) {
return { r: t.r, g: t.g, b: t.b };
},
},
HSVA_OBJ: {
read: function (t) {
return !!(e.isNumber(t.h) && e.isNumber(t.s) && e.isNumber(t.v) && e.isNumber(t.a)) && { space: "HSV", h: t.h, s: t.s, v: t.v, a: t.a };
},
write: function (t) {
return { h: t.h, s: t.s, v: t.v, a: t.a };
},
},
HSV_OBJ: {
read: function (t) {
return !!(e.isNumber(t.h) && e.isNumber(t.s) && e.isNumber(t.v)) && { space: "HSV", h: t.h, s: t.s, v: t.v };
},
write: function (t) {
return { h: t.h, s: t.s, v: t.v };
},
},
},
},
];
return function () {
r = !1;
var t = arguments.length > 1 ? e.toArray(arguments) : arguments[0];
return (
e.each(n, function (n) {
if (n.litmus(t))
return (
e.each(n.conversions, function (n, s) {
if (((i = n.read(t)), r === !1 && i !== !1)) return (r = i), (i.conversionName = s), (i.conversion = n), e.BREAK;
}),
e.BREAK
);
}),
r
);
};
})(dat.color.toString, dat.utils.common)),
(dat.GUI = dat.gui.GUI = (function (t, e, i, r, n, s, o, a, l, h, c, u, d, f, p) {
function m(t, e, i, s) {
if (void 0 === e[i]) throw Error("Object " + e + ' has no property "' + i + '"');
s.color ? (e = new c(e, i)) : ((e = [e, i].concat(s.factoryArgs)), (e = r.apply(t, e))),
s.before instanceof n && (s.before = s.before.__li),
g(t, e),
f.addClass(e.domElement, "c"),
(i = document.createElement("span")),
f.addClass(i, "property-name"),
(i.innerHTML = e.property);
var o = document.createElement("div");
return o.appendChild(i), o.appendChild(e.domElement), (s = _(t, o, s.before)), f.addClass(s, H.CLASS_CONTROLLER_ROW), f.addClass(s, typeof e.getValue()), v(t, s, e), t.__controllers.push(e), e;
}
function _(t, e, i) {
var r = document.createElement("li");
return e && r.appendChild(e), i ? t.__ul.insertBefore(r, params.before) : t.__ul.appendChild(r), t.onResize(), r;
}
function v(t, e, i) {
if (
((i.__li = e),
(i.__gui = t),
p.extend(i, {
options: function (e) {
return arguments.length > 1
? (i.remove(), m(t, i.object, i.property, { before: i.__li.nextElementSibling, factoryArgs: [p.toArray(arguments)] }))
: p.isArray(e) || p.isObject(e)
? (i.remove(), m(t, i.object, i.property, { before: i.__li.nextElementSibling, factoryArgs: [e] }))
: void 0;
},
name: function (t) {
return (i.__li.firstElementChild.firstElementChild.innerHTML = t), i;
},
listen: function () {
return i.__gui.listen(i), i;
},
remove: function () {
return i.__gui.remove(i), i;
},
}),
i instanceof l)
) {
var r = new a(i.object, i.property, { min: i.__min, max: i.__max, step: i.__step });
p.each(["updateDisplay", "onChange", "onFinishChange"], function (t) {
var e = i[t],
n = r[t];
i[t] = r[t] = function () {
var t = Array.prototype.slice.call(arguments);
return e.apply(i, t), n.apply(r, t);
};
}),
f.addClass(e, "has-slider"),
i.domElement.insertBefore(r.domElement, i.domElement.firstElementChild);
} else if (i instanceof a) {
var n = function (e) {
return p.isNumber(i.__min) && p.isNumber(i.__max) ? (i.remove(), m(t, i.object, i.property, { before: i.__li.nextElementSibling, factoryArgs: [i.__min, i.__max, i.__step] })) : e;
};
(i.min = p.compose(n, i.min)), (i.max = p.compose(n, i.max));
} else
i instanceof s
? (f.bind(e, "click", function () {
f.fakeEvent(i.__checkbox, "click");
}),
f.bind(i.__checkbox, "click", function (t) {
t.stopPropagation();
}))
: i instanceof o
? (f.bind(e, "click", function () {
f.fakeEvent(i.__button, "click");
}),
f.bind(e, "mouseover", function () {
f.addClass(i.__button, "hover");
}),
f.bind(e, "mouseout", function () {
f.removeClass(i.__button, "hover");
}))
: i instanceof c &&
(f.addClass(e, "color"),
(i.updateDisplay = p.compose(function (t) {
return (e.style.borderLeftColor = i.__color.toString()), t;
}, i.updateDisplay)),
i.updateDisplay());
i.setValue = p.compose(function (e) {
return t.getRoot().__preset_select && i.isModified() && E(t.getRoot(), !0), e;
}, i.setValue);
}
function g(t, e) {
var i = t.getRoot(),
r = i.__rememberedObjects.indexOf(e.object);
if (r != -1) {
var n = i.__rememberedObjectIndecesToControllers[r];
if ((void 0 === n && ((n = {}), (i.__rememberedObjectIndecesToControllers[r] = n)), (n[e.property] = e), i.load && i.load.remembered)) {
if (((i = i.load.remembered), i[t.preset])) i = i[t.preset];
else {
if (!i[R]) return;
i = i[R];
}
i[r] && void 0 !== i[r][e.property] && ((r = i[r][e.property]), (e.initialValue = r), e.setValue(r));
}
}
}
function y(t) {
var e = (t.__save_row = document.createElement("li"));
f.addClass(t.domElement, "has-save"), t.__ul.insertBefore(e, t.__ul.firstChild), f.addClass(e, "save-row");
var i = document.createElement("span");
(i.innerHTML = " "), f.addClass(i, "button gears");
var r = document.createElement("span");
(r.innerHTML = "Save"), f.addClass(r, "button"), f.addClass(r, "save");
var n = document.createElement("span");
(n.innerHTML = "New"), f.addClass(n, "button"), f.addClass(n, "save-as");
var s = document.createElement("span");
(s.innerHTML = "Revert"), f.addClass(s, "button"), f.addClass(s, "revert");
var o = (t.__preset_select = document.createElement("select"));
if (
(t.load && t.load.remembered
? p.each(t.load.remembered, function (e, i) {
T(t, i, i == t.preset);
})
: T(t, R, !1),
f.bind(o, "change", function () {
for (var e = 0; e < t.__preset_select.length; e++) t.__preset_select[e].innerHTML = t.__preset_select[e].value;
t.preset = this.value;
}),
e.appendChild(o),
e.appendChild(i),
e.appendChild(r),
e.appendChild(n),
e.appendChild(s),
S)
) {
var e = document.getElementById("dg-save-locally"),
a = document.getElementById("dg-local-explain");
(e.style.display = "block"), (e = document.getElementById("dg-local-storage")), "true" === localStorage.getItem(document.location.href + ".isLocal") && e.setAttribute("checked", "checked");
var l = function () {
a.style.display = t.useLocalStorage ? "block" : "none";
};
l(),
f.bind(e, "change", function () {
(t.useLocalStorage = !t.useLocalStorage), l();
});
}
var h = document.getElementById("dg-new-constructor");
f.bind(h, "keydown", function (t) {
t.metaKey && (67 === t.which || 67 == t.keyCode) && P.hide();
}),
f.bind(i, "click", function () {
(h.innerHTML = JSON.stringify(t.getSaveObject(), void 0, 2)), P.show(), h.focus(), h.select();
}),
f.bind(r, "click", function () {
t.save();
}),
f.bind(n, "click", function () {
var e = prompt("Enter a new preset name.");
e && t.saveAs(e);
}),
f.bind(s, "click", function () {
t.revert();
});
}
function b(t) {
function e(e) {
return e.preventDefault(), (n = e.clientX), f.addClass(t.__closeButton, H.CLASS_DRAG), f.bind(window, "mousemove", i), f.bind(window, "mouseup", r), !1;
}
function i(e) {
return e.preventDefault(), (t.width += n - e.clientX), t.onResize(), (n = e.clientX), !1;
}
function r() {
f.removeClass(t.__closeButton, H.CLASS_DRAG), f.unbind(window, "mousemove", i), f.unbind(window, "mouseup", r);
}
(t.__resize_handle = document.createElement("div")), p.extend(t.__resize_handle.style, { width: "6px", marginLeft: "-3px", height: "200px", cursor: "ew-resize", position: "absolute" });
var n;
f.bind(t.__resize_handle, "mousedown", e), f.bind(t.__closeButton, "mousedown", e), t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild);
}
function x(t, e) {
(t.domElement.style.width = e + "px"), t.__save_row && t.autoPlace && (t.__save_row.style.width = e + "px"), t.__closeButton && (t.__closeButton.style.width = e + "px");
}
function w(t, e) {
var i = {};
return (
p.each(t.__rememberedObjects, function (r, n) {
var s = {};
p.each(t.__rememberedObjectIndecesToControllers[n], function (t, i) {
s[i] = e ? t.initialValue : t.getValue();
}),
(i[n] = s);
}),
i
);
}
function T(t, e, i) {
var r = document.createElement("option");
(r.innerHTML = e), (r.value = e), t.__preset_select.appendChild(r), i && (t.__preset_select.selectedIndex = t.__preset_select.length - 1);
}
function E(t, e) {
var i = t.__preset_select[t.__preset_select.selectedIndex];
i.innerHTML = e ? i.value + "*" : i.value;
}
function C(t) {
0 != t.length &&
u(function () {
C(t);
}),
p.each(t, function (t) {
t.updateDisplay();
});
}
t.inject(i);
var S,
R = "Default";
try {
S = "localStorage" in window && null !== window.localStorage;
} catch (k) {
S = !1;
}
var P,
D,
A = !0,
M = !1,
O = [],
H = function (t) {
function e() {
localStorage.setItem(document.location.href + ".gui", JSON.stringify(r.getSaveObject()));
}
function i() {
var t = r.getRoot();
(t.width += 1),
p.defer(function () {
t.width -= 1;
});
}
var r = this;
(this.domElement = document.createElement("div")),
(this.__ul = document.createElement("ul")),
this.domElement.appendChild(this.__ul),
f.addClass(this.domElement, "dg"),
(this.__folders = {}),
(this.__controllers = []),
(this.__rememberedObjects = []),
(this.__rememberedObjectIndecesToControllers = []),
(this.__listening = []),
(t = t || {}),
(t = p.defaults(t, { autoPlace: !0, width: H.DEFAULT_WIDTH })),
(t = p.defaults(t, { resizable: t.autoPlace, hideable: t.autoPlace })),
p.isUndefined(t.load) ? (t.load = { preset: R }) : t.preset && (t.load.preset = t.preset),
p.isUndefined(t.parent) && t.hideable && O.push(this),
(t.resizable = p.isUndefined(t.parent) && t.resizable),
t.autoPlace && p.isUndefined(t.scrollable) && (t.scrollable = !0);
var n = S && "true" === localStorage.getItem(document.location.href + ".isLocal");
if (
(Object.defineProperties(this, {
parent: {
get: function () {
return t.parent;
},
},
scrollable: {
get: function () {
return t.scrollable;
},
},
autoPlace: {
get: function () {
return t.autoPlace;
},
},
preset: {
get: function () {
return r.parent ? r.getRoot().preset : t.load.preset;
},
set: function (e) {
for (r.parent ? (r.getRoot().preset = e) : (t.load.preset = e), e = 0; e < this.__preset_select.length; e++) this.__preset_select[e].value == this.preset && (this.__preset_select.selectedIndex = e);
r.revert();
},
},
width: {
get: function () {
return t.width;
},
set: function (e) {
(t.width = e), x(r, e);
},
},
name: {
get: function () {
return t.name;
},
set: function (e) {
(t.name = e), o && (o.innerHTML = t.name);
},
},
closed: {
get: function () {
return t.closed;
},
set: function (e) {
(t.closed = e), t.closed ? f.addClass(r.__ul, H.CLASS_CLOSED) : f.removeClass(r.__ul, H.CLASS_CLOSED), this.onResize(), r.__closeButton && (r.__closeButton.innerHTML = e ? H.TEXT_OPEN : H.TEXT_CLOSED);
},
},
load: {
get: function () {
return t.load;
},
},
useLocalStorage: {
get: function () {
return n;
},
set: function (t) {
S && ((n = t) ? f.bind(window, "unload", e) : f.unbind(window, "unload", e), localStorage.setItem(document.location.href + ".isLocal", t));
},
},
}),
p.isUndefined(t.parent))
) {
if (((t.closed = !1), f.addClass(this.domElement, H.CLASS_MAIN), f.makeSelectable(this.domElement, !1), S && n)) {
r.useLocalStorage = !0;
var s = localStorage.getItem(document.location.href + ".gui");
s && (t.load = JSON.parse(s));
}
(this.__closeButton = document.createElement("div")),
(this.__closeButton.innerHTML = H.TEXT_CLOSED),
f.addClass(this.__closeButton, H.CLASS_CLOSE_BUTTON),
this.domElement.appendChild(this.__closeButton),
f.bind(this.__closeButton, "click", function () {
r.closed = !r.closed;
});
} else {
void 0 === t.closed && (t.closed = !0);
var o = document.createTextNode(t.name);
f.addClass(o, "controller-name"),
(s = _(r, o)),
f.addClass(this.__ul, H.CLASS_CLOSED),
f.addClass(s, "title"),
f.bind(s, "click", function (t) {
return t.preventDefault(), (r.closed = !r.closed), !1;
}),
t.closed || (this.closed = !1);
}
t.autoPlace &&
(p.isUndefined(t.parent) &&
(A && ((D = document.createElement("div")), f.addClass(D, "dg"), f.addClass(D, H.CLASS_AUTO_PLACE_CONTAINER), document.body.appendChild(D), (A = !1)),
D.appendChild(this.domElement),
f.addClass(this.domElement, H.CLASS_AUTO_PLACE)),
this.parent || x(r, t.width)),
f.bind(window, "resize", function () {
r.onResize();
}),
f.bind(this.__ul, "webkitTransitionEnd", function () {
r.onResize();
}),
f.bind(this.__ul, "transitionend", function () {
r.onResize();
}),
f.bind(this.__ul, "oTransitionEnd", function () {
r.onResize();
}),
this.onResize(),
t.resizable && b(this),
r.getRoot(),
t.parent || i();
};
return (
(H.toggleHide = function () {
(M = !M),
p.each(O, function (t) {
(t.domElement.style.zIndex = M ? -999 : 999), (t.domElement.style.opacity = M ? 0 : 1);
});
}),
(H.CLASS_AUTO_PLACE = "a"),
(H.CLASS_AUTO_PLACE_CONTAINER = "ac"),
(H.CLASS_MAIN = "main"),
(H.CLASS_CONTROLLER_ROW = "cr"),
(H.CLASS_TOO_TALL = "taller-than-window"),
(H.CLASS_CLOSED = "closed"),
(H.CLASS_CLOSE_BUTTON = "close-button"),
(H.CLASS_DRAG = "drag"),
(H.DEFAULT_WIDTH = 245),
(H.TEXT_CLOSED = "Close Controls"),
(H.TEXT_OPEN = "Open Controls"),
f.bind(
window,
"keydown",
function (t) {
"text" !== document.activeElement.type && (72 === t.which || 72 == t.keyCode) && H.toggleHide();
},
!1
),
p.extend(H.prototype, {
add: function (t, e) {
return m(this, t, e, { factoryArgs: Array.prototype.slice.call(arguments, 2) });
},
addColor: function (t, e) {
return m(this, t, e, { color: !0 });
},
remove: function (t) {
this.__ul.removeChild(t.__li), this.__controllers.slice(this.__controllers.indexOf(t), 1);
var e = this;
p.defer(function () {
e.onResize();
});
},
destroy: function () {
this.autoPlace && D.removeChild(this.domElement);
},
addFolder: function (t) {
if (void 0 !== this.__folders[t]) throw Error('You already have a folder in this GUI by the name "' + t + '"');
var e = { name: t, parent: this };
return (
(e.autoPlace = this.autoPlace),
this.load && this.load.folders && this.load.folders[t] && ((e.closed = this.load.folders[t].closed), (e.load = this.load.folders[t])),
(e = new H(e)),
(this.__folders[t] = e),
(t = _(this, e.domElement)),
f.addClass(t, "folder"),
e
);
},
open: function () {
this.closed = !1;
},
close: function () {
this.closed = !0;
},
onResize: function () {
var t = this.getRoot();
if (t.scrollable) {
var e = f.getOffset(t.__ul).top,
i = 0;
p.each(t.__ul.childNodes, function (e) {
(t.autoPlace && e === t.__save_row) || (i += f.getHeight(e));
}),
window.innerHeight - e - 20 < i
? (f.addClass(t.domElement, H.CLASS_TOO_TALL), (t.__ul.style.height = window.innerHeight - e - 20 + "px"))
: (f.removeClass(t.domElement, H.CLASS_TOO_TALL), (t.__ul.style.height = "auto"));
}
t.__resize_handle &&
p.defer(function () {
t.__resize_handle.style.height = t.__ul.offsetHeight + "px";
}),
t.__closeButton && (t.__closeButton.style.width = t.width + "px");
},
remember: function () {
if ((p.isUndefined(P) && ((P = new d()), (P.domElement.innerHTML = e)), this.parent)) throw Error("You can only call remember on a top level GUI.");
var t = this;
p.each(Array.prototype.slice.call(arguments), function (e) {
0 == t.__rememberedObjects.length && y(t), t.__rememberedObjects.indexOf(e) == -1 && t.__rememberedObjects.push(e);
}),
this.autoPlace && x(this, this.width);
},
getRoot: function () {
for (var t = this; t.parent; ) t = t.parent;
return t;
},
getSaveObject: function () {
var t = this.load;
return (
(t.closed = this.closed),
this.__rememberedObjects.length > 0 && ((t.preset = this.preset), t.remembered || (t.remembered = {}), (t.remembered[this.preset] = w(this))),
(t.folders = {}),
p.each(this.__folders, function (e, i) {
t.folders[i] = e.getSaveObject();
}),
t
);
},
save: function () {
this.load.remembered || (this.load.remembered = {}), (this.load.remembered[this.preset] = w(this)), E(this, !1);
},
saveAs: function (t) {
this.load.remembered || ((this.load.remembered = {}), (this.load.remembered[R] = w(this, !0))), (this.load.remembered[t] = w(this)), (this.preset = t), T(this, t, !0);
},
revert: function (t) {
p.each(
this.__controllers,
function (e) {
this.getRoot().load.remembered ? g(t || this.getRoot(), e) : e.setValue(e.initialValue);
},
this
),
p.each(this.__folders, function (t) {
t.revert(t);
}),
t || E(this.getRoot(), !1);
},
listen: function (t) {
var e = 0 == this.__listening.length;
this.__listening.push(t), e && C(this.__listening);
},
}),
H
);
})(
dat.utils.css,
'
\n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n
\n\n Automatically save\n values to localStorage on exit.\n\n
The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n \n
\n \n
\n\n
',
".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear;border:0;position:absolute;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-x:hidden}.dg.a.has-save ul{margin-top:27px}.dg.a.has-save ul.closed{margin-top:0}.dg.a .save-row{position:fixed;top:0;z-index:1002}.dg li{-webkit-transition:height 0.1s ease-out;-o-transition:height 0.1s ease-out;-moz-transition:height 0.1s ease-out;transition:height 0.1s ease-out}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;overflow:hidden;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li > *{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:9px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n",
(dat.controllers.factory = (function (t, e, i, r, n, s, o) {
return function (a, l, h, c) {
var u = a[l];
return o.isArray(h) || o.isObject(h)
? new t(a, l, h)
: o.isNumber(u)
? o.isNumber(h) && o.isNumber(c)
? new i(a, l, h, c)
: new e(a, l, { min: h, max: c })
: o.isString(u)
? new r(a, l)
: o.isFunction(u)
? new n(a, l, "")
: o.isBoolean(u)
? new s(a, l)
: void 0;
};
})(
dat.controllers.OptionController,
dat.controllers.NumberControllerBox,
dat.controllers.NumberControllerSlider,
(dat.controllers.StringController = (function (t, e, i) {
var r = function (t, i) {
function n() {
s.setValue(s.__input.value);
}
r.superclass.call(this, t, i);
var s = this;
(this.__input = document.createElement("input")),
this.__input.setAttribute("type", "text"),
e.bind(this.__input, "keyup", n),
e.bind(this.__input, "change", n),
e.bind(this.__input, "blur", function () {
s.__onFinishChange && s.__onFinishChange.call(s, s.getValue());
}),
e.bind(this.__input, "keydown", function (t) {
13 === t.keyCode && this.blur();
}),
this.updateDisplay(),
this.domElement.appendChild(this.__input);
};
return (
(r.superclass = t),
i.extend(r.prototype, t.prototype, {
updateDisplay: function () {
return e.isActive(this.__input) || (this.__input.value = this.getValue()), r.superclass.prototype.updateDisplay.call(this);
},
}),
r
);
})(dat.controllers.Controller, dat.dom.dom, dat.utils.common)),
dat.controllers.FunctionController,
dat.controllers.BooleanController,
dat.utils.common
)),
dat.controllers.Controller,
dat.controllers.BooleanController,
dat.controllers.FunctionController,
dat.controllers.NumberControllerBox,
dat.controllers.NumberControllerSlider,
dat.controllers.OptionController,
(dat.controllers.ColorController = (function (t, e, i, r, n) {
function s(t, e, i, r) {
(t.style.background = ""),
n.each(l, function (n) {
t.style.cssText += "background: " + n + "linear-gradient(" + e + ", " + i + " 0%, " + r + " 100%); ";
});
}
function o(t) {
(t.style.background = ""),
(t.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);"),
(t.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"),
(t.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"),
(t.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"),
(t.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);");
}
var a = function (t, l) {
function h(t) {
f(t), e.bind(window, "mousemove", f), e.bind(window, "mouseup", c);
}
function c() {
e.unbind(window, "mousemove", f), e.unbind(window, "mouseup", c);
}
function u() {
var t = r(this.value);
t !== !1 ? ((m.__color.__state = t), m.setValue(m.__color.toOriginal())) : (this.value = m.__color.toString());
}
function d() {
e.unbind(window, "mousemove", p), e.unbind(window, "mouseup", d);
}
function f(t) {
t.preventDefault();
var i = e.getWidth(m.__saturation_field),
r = e.getOffset(m.__saturation_field),
n = (t.clientX - r.left + document.body.scrollLeft) / i,
t = 1 - (t.clientY - r.top + document.body.scrollTop) / i;
return t > 1 ? (t = 1) : t < 0 && (t = 0), n > 1 ? (n = 1) : n < 0 && (n = 0), (m.__color.v = t), (m.__color.s = n), m.setValue(m.__color.toOriginal()), !1;
}
function p(t) {
t.preventDefault();
var i = e.getHeight(m.__hue_field),
r = e.getOffset(m.__hue_field),
t = 1 - (t.clientY - r.top + document.body.scrollTop) / i;
return t > 1 ? (t = 1) : t < 0 && (t = 0), (m.__color.h = 360 * t), m.setValue(m.__color.toOriginal()), !1;
}
a.superclass.call(this, t, l), (this.__color = new i(this.getValue())), (this.__temp = new i(0));
var m = this;
(this.domElement = document.createElement("div")),
e.makeSelectable(this.domElement, !1),
(this.__selector = document.createElement("div")),
(this.__selector.className = "selector"),
(this.__saturation_field = document.createElement("div")),
(this.__saturation_field.className = "saturation-field"),
(this.__field_knob = document.createElement("div")),
(this.__field_knob.className = "field-knob"),
(this.__field_knob_border = "2px solid "),
(this.__hue_knob = document.createElement("div")),
(this.__hue_knob.className = "hue-knob"),
(this.__hue_field = document.createElement("div")),
(this.__hue_field.className = "hue-field"),
(this.__input = document.createElement("input")),
(this.__input.type = "text"),
(this.__input_textShadow = "0 1px 1px "),
e.bind(this.__input, "keydown", function (t) {
13 === t.keyCode && u.call(this);
}),
e.bind(this.__input, "blur", u),
e.bind(this.__selector, "mousedown", function () {
e.addClass(this, "drag").bind(window, "mouseup", function () {
e.removeClass(m.__selector, "drag");
});
});
var _ = document.createElement("div");
n.extend(this.__selector.style, { width: "122px", height: "102px", padding: "3px", backgroundColor: "#222", boxShadow: "0px 1px 3px rgba(0,0,0,0.3)" }),
n.extend(this.__field_knob.style, {
position: "absolute",
width: "12px",
height: "12px",
border: this.__field_knob_border + (this.__color.v < 0.5 ? "#fff" : "#000"),
boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
borderRadius: "12px",
zIndex: 1,
}),
n.extend(this.__hue_knob.style, { position: "absolute", width: "15px", height: "2px", borderRight: "4px solid #fff", zIndex: 1 }),
n.extend(this.__saturation_field.style, { width: "100px", height: "100px", border: "1px solid #555", marginRight: "3px", display: "inline-block", cursor: "pointer" }),
n.extend(_.style, { width: "100%", height: "100%", background: "none" }),
s(_, "top", "rgba(0,0,0,0)", "#000"),
n.extend(this.__hue_field.style, { width: "15px", height: "100px", display: "inline-block", border: "1px solid #555", cursor: "ns-resize" }),
o(this.__hue_field),
n.extend(this.__input.style, { outline: "none", textAlign: "center", color: "#fff", border: 0, fontWeight: "bold", textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)" }),
e.bind(this.__saturation_field, "mousedown", h),
e.bind(this.__field_knob, "mousedown", h),
e.bind(this.__hue_field, "mousedown", function (t) {
p(t), e.bind(window, "mousemove", p), e.bind(window, "mouseup", d);
}),
this.__saturation_field.appendChild(_),
this.__selector.appendChild(this.__field_knob),
this.__selector.appendChild(this.__saturation_field),
this.__selector.appendChild(this.__hue_field),
this.__hue_field.appendChild(this.__hue_knob),
this.domElement.appendChild(this.__input),
this.domElement.appendChild(this.__selector),
this.updateDisplay();
};
(a.superclass = t),
n.extend(a.prototype, t.prototype, {
updateDisplay: function () {
var t = r(this.getValue());
if (t !== !1) {
var e = !1;
n.each(
i.COMPONENTS,
function (i) {
if (!n.isUndefined(t[i]) && !n.isUndefined(this.__color.__state[i]) && t[i] !== this.__color.__state[i]) return (e = !0), {};
},
this
),
e && n.extend(this.__color.__state, t);
}
n.extend(this.__temp.__state, this.__color.__state), (this.__temp.a = 1);
var o = this.__color.v < 0.5 || this.__color.s > 0.5 ? 255 : 0,
a = 255 - o;
n.extend(this.__field_knob.style, {
marginLeft: 100 * this.__color.s - 7 + "px",
marginTop: 100 * (1 - this.__color.v) - 7 + "px",
backgroundColor: this.__temp.toString(),
border: this.__field_knob_border + "rgb(" + o + "," + o + "," + o + ")",
}),
(this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px"),
(this.__temp.s = 1),
(this.__temp.v = 1),
s(this.__saturation_field, "left", "#fff", this.__temp.toString()),
n.extend(this.__input.style, {
backgroundColor: (this.__input.value = this.__color.toString()),
color: "rgb(" + o + "," + o + "," + o + ")",
textShadow: this.__input_textShadow + "rgba(" + a + "," + a + "," + a + ",.7)",
});
},
});
var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
return a;
})(
dat.controllers.Controller,
dat.dom.dom,
(dat.color.Color = (function (t, e, i, r) {
function n(t, e, i) {
Object.defineProperty(t, e, {
get: function () {
return "RGB" === this.__state.space ? this.__state[e] : (o(this, e, i), this.__state[e]);
},
set: function (t) {
"RGB" !== this.__state.space && (o(this, e, i), (this.__state.space = "RGB")), (this.__state[e] = t);
},
});
}
function s(t, e) {
Object.defineProperty(t, e, {
get: function () {
return "HSV" === this.__state.space ? this.__state[e] : (a(this), this.__state[e]);
},
set: function (t) {
"HSV" !== this.__state.space && (a(this), (this.__state.space = "HSV")), (this.__state[e] = t);
},
});
}
function o(t, i, n) {
if ("HEX" === t.__state.space) t.__state[i] = e.component_from_hex(t.__state.hex, n);
else {
if ("HSV" !== t.__state.space) throw "Corrupted color state";
r.extend(t.__state, e.hsv_to_rgb(t.__state.h, t.__state.s, t.__state.v));
}
}
function a(t) {
var i = e.rgb_to_hsv(t.r, t.g, t.b);
r.extend(t.__state, { s: i.s, v: i.v }), r.isNaN(i.h) ? r.isUndefined(t.__state.h) && (t.__state.h = 0) : (t.__state.h = i.h);
}
var l = function () {
if (((this.__state = t.apply(this, arguments)), this.__state === !1)) throw "Failed to interpret color arguments";
this.__state.a = this.__state.a || 1;
};
return (
(l.COMPONENTS = "r,g,b,h,s,v,hex,a".split(",")),
r.extend(l.prototype, {
toString: function () {
return i(this);
},
toOriginal: function () {
return this.__state.conversion.write(this);
},
}),
n(l.prototype, "r", 2),
n(l.prototype, "g", 1),
n(l.prototype, "b", 0),
s(l.prototype, "h"),
s(l.prototype, "s"),
s(l.prototype, "v"),
Object.defineProperty(l.prototype, "a", {
get: function () {
return this.__state.a;
},
set: function (t) {
this.__state.a = t;
},
}),
Object.defineProperty(l.prototype, "hex", {
get: function () {
return "HEX" !== !this.__state.space && (this.__state.hex = e.rgb_to_hex(this.r, this.g, this.b)), this.__state.hex;
},
set: function (t) {
(this.__state.space = "HEX"), (this.__state.hex = t);
},
}),
l
);
})(
dat.color.interpret,
(dat.color.math = (function () {
var t;
return {
hsv_to_rgb: function (t, e, i) {
var r = t / 60 - Math.floor(t / 60),
n = i * (1 - e),
s = i * (1 - r * e),
e = i * (1 - (1 - r) * e),
t = [
[i, e, n],
[s, i, n],
[n, i, e],
[n, s, i],
[e, n, i],
[i, n, s],
][Math.floor(t / 60) % 6];
return { r: 255 * t[0], g: 255 * t[1], b: 255 * t[2] };
},
rgb_to_hsv: function (t, e, i) {
var r = Math.min(t, e, i),
n = Math.max(t, e, i),
r = n - r;
return 0 == n ? { h: NaN, s: 0, v: 0 } : ((t = t == n ? (e - i) / r : e == n ? 2 + (i - t) / r : 4 + (t - e) / r), (t /= 6), t < 0 && (t += 1), { h: 360 * t, s: r / n, v: n / 255 });
},
rgb_to_hex: function (t, e, i) {
return (t = this.hex_with_component(0, 2, t)), (t = this.hex_with_component(t, 1, e)), (t = this.hex_with_component(t, 0, i));
},
component_from_hex: function (t, e) {
return (t >> (8 * e)) & 255;
},
hex_with_component: function (e, i, r) {
return (r << (t = 8 * i)) | (e & ~(255 << t));
},
};
})()),
dat.color.toString,
dat.utils.common
)),
dat.color.interpret,
dat.utils.common
)),
(dat.utils.requestAnimationFrame = (function () {
return (
window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function (t) {
window.setTimeout(t, 1e3 / 60);
}
);
})()),
(dat.dom.CenteredDiv = (function (t, e) {
var i = function () {
(this.backgroundElement = document.createElement("div")),
e.extend(this.backgroundElement.style, { backgroundColor: "rgba(0,0,0,0.8)", top: 0, left: 0, display: "none", zIndex: "1000", opacity: 0, WebkitTransition: "opacity 0.2s linear" }),
t.makeFullscreen(this.backgroundElement),
(this.backgroundElement.style.position = "fixed"),
(this.domElement = document.createElement("div")),
e.extend(this.domElement.style, { position: "fixed", display: "none", zIndex: "1001", opacity: 0, WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear" }),
document.body.appendChild(this.backgroundElement),
document.body.appendChild(this.domElement);
var i = this;
t.bind(this.backgroundElement, "click", function () {
i.hide();
});
};
return (
(i.prototype.show = function () {
var t = this;
(this.backgroundElement.style.display = "block"),
(this.domElement.style.display = "block"),
(this.domElement.style.opacity = 0),
(this.domElement.style.webkitTransform = "scale(1.1)"),
this.layout(),
e.defer(function () {
(t.backgroundElement.style.opacity = 1), (t.domElement.style.opacity = 1), (t.domElement.style.webkitTransform = "scale(1)");
});
}),
(i.prototype.hide = function () {
var e = this,
i = function () {
(e.domElement.style.display = "none"),
(e.backgroundElement.style.display = "none"),
t.unbind(e.domElement, "webkitTransitionEnd", i),
t.unbind(e.domElement, "transitionend", i),
t.unbind(e.domElement, "oTransitionEnd", i);
};
t.bind(this.domElement, "webkitTransitionEnd", i),
t.bind(this.domElement, "transitionend", i),
t.bind(this.domElement, "oTransitionEnd", i),
(this.backgroundElement.style.opacity = 0),
(this.domElement.style.opacity = 0),
(this.domElement.style.webkitTransform = "scale(1.1)");
}),
(i.prototype.layout = function () {
(this.domElement.style.left = window.innerWidth / 2 - t.getWidth(this.domElement) / 2 + "px"), (this.domElement.style.top = window.innerHeight / 2 - t.getHeight(this.domElement) / 2 + "px");
}),
i
);
})(dat.dom.dom, dat.utils.common)),
dat.dom.dom,
dat.utils.common
));
var Detector = {
canvas: !!window.CanvasRenderingContext2D,
webgl: (function () {
try {
var t = document.createElement("canvas");
return !(!window.WebGLRenderingContext || (!t.getContext("webgl") && !t.getContext("experimental-webgl")));
} catch (e) {
return !1;
}
})(),
workers: !!window.Worker,
fileapi: window.File && window.FileReader && window.FileList && window.Blob,
getWebGLErrorMessage: function () {
var t = document.createElement("div");
return (
(t.id = "webgl-error-message"),
(t.style.fontFamily = "monospace"),
(t.style.fontSize = "13px"),
(t.style.fontWeight = "normal"),
(t.style.textAlign = "center"),
(t.style.background = "#fff"),
(t.style.color = "#000"),
(t.style.padding = "1.5em"),
(t.style.width = "400px"),
(t.style.margin = "5em auto 0"),
this.webgl ||
(t.innerHTML = window.WebGLRenderingContext
? [
'Your graphics card does not seem to support WebGL. ',
'Find out how to get it here.',
].join("\n")
: [
'Your browser does not seem to support WebGL. ',
'Find out how to get it here.',
].join("\n")),
t
);
},
addGetWebGLMessage: function (t) {
var e, i, r;
(t = t || {}), (e = void 0 !== t.parent ? t.parent : document.body), (i = void 0 !== t.id ? t.id : "oldie"), (r = Detector.getWebGLErrorMessage()), (r.id = i), e.appendChild(r);
},
};
"object" == typeof module && (module.exports = Detector),
(THREE.OrbitControls = function (t, e) {
function i() {
return ((2 * Math.PI) / 60 / 60) * O.autoRotateSpeed;
}
function r() {
return Math.pow(0.95, O.zoomSpeed);
}
function n(t) {
I.theta -= t;
}
function s(t) {
I.phi -= t;
}
function o(t) {
O.object instanceof THREE.PerspectiveCamera
? (B /= t)
: O.object instanceof THREE.OrthographicCamera
? ((O.object.zoom = Math.max(O.minZoom, Math.min(O.maxZoom, O.object.zoom * t))), O.object.updateProjectionMatrix(), (W = !0))
: (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), (O.enableZoom = !1));
}
function a(t) {
O.object instanceof THREE.PerspectiveCamera
? (B *= t)
: O.object instanceof THREE.OrthographicCamera
? ((O.object.zoom = Math.max(O.minZoom, Math.min(O.maxZoom, O.object.zoom / t))), O.object.updateProjectionMatrix(), (W = !0))
: (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), (O.enableZoom = !1));
}
function l(t) {
X.set(t.clientX, t.clientY);
}
function h(t) {
Q.set(t.clientX, t.clientY);
}
function c(t) {
Y.set(t.clientX, t.clientY);
}
function u(t) {
G.set(t.clientX, t.clientY), q.subVectors(G, X);
var e = O.domElement === document ? O.domElement.body : O.domElement;
n(((2 * Math.PI * q.x) / e.clientWidth) * O.rotateSpeed), s(((2 * Math.PI * q.y) / e.clientHeight) * O.rotateSpeed), X.copy(G), O.update();
}
function d(t) {
J.set(t.clientX, t.clientY), $.subVectors(J, Q), $.y > 0 ? o(r()) : $.y < 0 && a(r()), Q.copy(J), O.update();
}
function f(t) {
Z.set(t.clientX, t.clientY), K.subVectors(Z, Y), it(K.x, K.y), Y.copy(Z), O.update();
}
function p(t) {}
function m(t) {
t.deltaY < 0 ? a(r()) : t.deltaY > 0 && o(r()), O.update();
}
function _(t) {
switch (t.keyCode) {
case O.keys.UP:
it(0, O.keyPanSpeed), O.update();
break;
case O.keys.BOTTOM:
it(0, -O.keyPanSpeed), O.update();
break;
case O.keys.LEFT:
it(O.keyPanSpeed, 0), O.update();
break;
case O.keys.RIGHT:
it(-O.keyPanSpeed, 0), O.update();
}
}
function v(t) {
X.set(t.touches[0].pageX, t.touches[0].pageY);
}
function g(t) {
var e = t.touches[0].pageX - t.touches[1].pageX,
i = t.touches[0].pageY - t.touches[1].pageY,
r = Math.sqrt(e * e + i * i);
Q.set(0, r);
}
function y(t) {
Y.set(t.touches[0].pageX, t.touches[0].pageY);
}
function b(t) {
G.set(t.touches[0].pageX, t.touches[0].pageY), q.subVectors(G, X);
var e = O.domElement === document ? O.domElement.body : O.domElement;
n(((2 * Math.PI * q.x) / e.clientWidth) * O.rotateSpeed), s(((2 * Math.PI * q.y) / e.clientHeight) * O.rotateSpeed), X.copy(G), O.update();
}
function x(t) {
var e = t.touches[0].pageX - t.touches[1].pageX,
i = t.touches[0].pageY - t.touches[1].pageY,
n = Math.sqrt(e * e + i * i);
J.set(0, n), $.subVectors(J, Q), $.y > 0 ? a(r()) : $.y < 0 && o(r()), Q.copy(J), O.update();
}
function w(t) {
Z.set(t.touches[0].pageX, t.touches[0].pageY), K.subVectors(Z, Y), it(K.x, K.y), Y.copy(Z), O.update();
}
function T(t) {}
function E(t) {
if (O.enabled !== !1) {
if ((t.preventDefault(), t.button === O.mouseButtons.ORBIT)) {
if (O.enableRotate === !1) return;
l(t), (N = z.ROTATE);
} else if (t.button === O.mouseButtons.ZOOM) {
if (O.enableZoom === !1) return;
h(t), (N = z.DOLLY);
} else if (t.button === O.mouseButtons.PAN) {
if (O.enablePan === !1) return;
c(t), (N = z.PAN);
}
N !== z.NONE && (document.addEventListener("mousemove", C, !1), document.addEventListener("mouseup", S, !1), O.dispatchEvent(U));
}
}
function C(t) {
if (O.enabled !== !1)
if ((t.preventDefault(), N === z.ROTATE)) {
if (O.enableRotate === !1) return;
u(t);
} else if (N === z.DOLLY) {
if (O.enableZoom === !1) return;
d(t);
} else if (N === z.PAN) {
if (O.enablePan === !1) return;
f(t);
}
}
function S(t) {
O.enabled !== !1 && (p(t), document.removeEventListener("mousemove", C, !1), document.removeEventListener("mouseup", S, !1), O.dispatchEvent(F), (N = z.NONE));
}
function R(t) {
O.enabled === !1 || O.enableZoom === !1 || (N !== z.NONE && N !== z.ROTATE) || (t.preventDefault(), m(t), O.dispatchEvent(U), O.dispatchEvent(F));
}
function k(t) {
O.enabled !== !1 && O.enableKeys !== !1 && O.enablePan !== !1 && _(t);
}
function P(t) {
if (O.enabled !== !1) {
switch (t.touches.length) {
case 1:
if (O.enableRotate === !1) return;
v(t), (N = z.TOUCH_ROTATE);
break;
case 2:
if (O.enableZoom === !1) return;
g(t), (N = z.TOUCH_DOLLY);
break;
case 3:
if (O.enablePan === !1) return;
y(t), (N = z.TOUCH_PAN);
break;
default:
N = z.NONE;
}
N !== z.NONE && O.dispatchEvent(U);
}
}
function D(t) {
if (O.enabled !== !1)
switch ((t.preventDefault(), t.stopPropagation(), t.touches.length)) {
case 1:
if (O.enableRotate === !1) return;
if (N !== z.TOUCH_ROTATE) return;
b(t);
break;
case 2:
if (O.enableZoom === !1) return;
if (N !== z.TOUCH_DOLLY) return;
x(t);
break;
case 3:
if (O.enablePan === !1) return;
if (N !== z.TOUCH_PAN) return;
w(t);
break;
default:
N = z.NONE;
}
}
function A(t) {
O.enabled !== !1 && (T(t), O.dispatchEvent(F), (N = z.NONE));
}
function M(t) {
t.preventDefault();
}
(this.object = t),
(this.domElement = void 0 !== e ? e : document),
(this.enabled = !0),
(this.target = new THREE.Vector3()),
(this.minDistance = 0),
(this.maxDistance = 1 / 0),
(this.minZoom = 0),
(this.maxZoom = 1 / 0),
(this.minPolarAngle = 0),
(this.maxPolarAngle = Math.PI),
(this.minAzimuthAngle = -(1 / 0)),
(this.maxAzimuthAngle = 1 / 0),
(this.enableDamping = !1),
(this.dampingFactor = 0.25),
(this.enableZoom = !0),
(this.zoomSpeed = 1),
(this.enableRotate = !0),
(this.rotateSpeed = 1),
(this.enablePan = !0),
(this.keyPanSpeed = 7),
(this.autoRotate = !1),
(this.autoRotateSpeed = 0.2),
(this.enableKeys = !0),
(this.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 }),
(this.mouseButtons = { ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT }),
(this.target0 = this.target.clone()),
(this.position0 = this.object.position.clone()),
(this.zoom0 = this.object.zoom),
(this.getPolarAngle = function () {
return j.phi;
}),
(this.getAzimuthalAngle = function () {
return j.theta;
}),
(this.reset = function () {
O.target.copy(O.target0), O.object.position.copy(O.position0), (O.object.zoom = O.zoom0), O.object.updateProjectionMatrix(), O.dispatchEvent(H), O.update(), (N = z.NONE);
}),
(this.update = (function () {
var e = new THREE.Vector3(),
r = new THREE.Quaternion().setFromUnitVectors(t.up, new THREE.Vector3(0, 1, 0)),
s = r.clone().inverse(),
o = new THREE.Vector3(),
a = new THREE.Quaternion();
return function () {
var t = O.object.position;
return (
e.copy(t).sub(O.target),
e.applyQuaternion(r),
j.setFromVector3(e),
O.autoRotate && N === z.NONE && n(i()),
(j.theta += I.theta),
(j.phi += I.phi),
(j.theta = Math.max(O.minAzimuthAngle, Math.min(O.maxAzimuthAngle, j.theta))),
(j.phi = Math.max(O.minPolarAngle, Math.min(O.maxPolarAngle, j.phi))),
j.makeSafe(),
(j.radius *= B),
(j.radius = Math.max(O.minDistance, Math.min(O.maxDistance, j.radius))),
O.target.add(V),
e.setFromSpherical(j),
e.applyQuaternion(s),
t.copy(O.target).add(e),
O.object.lookAt(O.target),
O.enableDamping === !0 ? ((I.theta *= 1 - O.dampingFactor), (I.phi *= 1 - O.dampingFactor)) : I.set(0, 0, 0),
(B = 1),
V.set(0, 0, 0),
!!(W || o.distanceToSquared(O.object.position) > L || 8 * (1 - a.dot(O.object.quaternion)) > L) && (O.dispatchEvent(H), o.copy(O.object.position), a.copy(O.object.quaternion), (W = !1), !0)
);
};
})()),
(this.dispose = function () {
O.domElement.removeEventListener("contextmenu", M, !1),
O.domElement.removeEventListener("mousedown", E, !1),
O.domElement.removeEventListener("wheel", R, !1),
O.domElement.removeEventListener("touchstart", P, !1),
O.domElement.removeEventListener("touchend", A, !1),
O.domElement.removeEventListener("touchmove", D, !1),
document.removeEventListener("mousemove", C, !1),
document.removeEventListener("mouseup", S, !1),
window.removeEventListener("keydown", k, !1);
});
var O = this,
H = { type: "change" },
U = { type: "start" },
F = { type: "end" },
z = { NONE: -1, ROTATE: 0, DOLLY: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_DOLLY: 4, TOUCH_PAN: 5 },
N = z.NONE,
L = 1e-6,
j = new THREE.Spherical(),
I = new THREE.Spherical(),
B = 1,
V = new THREE.Vector3(),
W = !1,
X = new THREE.Vector2(),
G = new THREE.Vector2(),
q = new THREE.Vector2(),
Y = new THREE.Vector2(),
Z = new THREE.Vector2(),
K = new THREE.Vector2(),
Q = new THREE.Vector2(),
J = new THREE.Vector2(),
$ = new THREE.Vector2(),
tt = (function () {
var t = new THREE.Vector3();
return function (e, i) {
t.setFromMatrixColumn(i, 0), t.multiplyScalar(-e), V.add(t);
};
})(),
et = (function () {
var t = new THREE.Vector3();
return function (e, i) {
t.setFromMatrixColumn(i, 1), t.multiplyScalar(e), V.add(t);
};
})(),
it = (function () {
var t = new THREE.Vector3();
return function (e, i) {
var r = O.domElement === document ? O.domElement.body : O.domElement;
if (O.object instanceof THREE.PerspectiveCamera) {
var n = O.object.position;
t.copy(n).sub(O.target);
var s = t.length();
(s *= Math.tan(((O.object.fov / 2) * Math.PI) / 180)), tt((2 * e * s) / r.clientHeight, O.object.matrix), et((2 * i * s) / r.clientHeight, O.object.matrix);
} else
O.object instanceof THREE.OrthographicCamera
? (tt((e * (O.object.right - O.object.left)) / O.object.zoom / r.clientWidth, O.object.matrix), et((i * (O.object.top - O.object.bottom)) / O.object.zoom / r.clientHeight, O.object.matrix))
: (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), (O.enablePan = !1));
};
})();
O.domElement.addEventListener("contextmenu", M, !1),
O.domElement.addEventListener("mousedown", E, !1),
O.domElement.addEventListener("wheel", R, !1),
O.domElement.addEventListener("touchstart", P, !1),
O.domElement.addEventListener("touchend", A, !1),
O.domElement.addEventListener("touchmove", D, !1),
window.addEventListener("keydown", k, !1),
this.update();
}),
(THREE.OrbitControls.prototype = Object.create(THREE.EventDispatcher.prototype)),
(THREE.OrbitControls.prototype.constructor = THREE.OrbitControls),
Object.defineProperties(THREE.OrbitControls.prototype, {
center: {
get: function () {
return console.warn("THREE.OrbitControls: .center has been renamed to .target"), this.target;
},
},
noZoom: {
get: function () {
return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."), !this.enableZoom;
},
set: function (t) {
console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."), (this.enableZoom = !t);
},
},
noRotate: {
get: function () {
return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."), !this.enableRotate;
},
set: function (t) {
console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."), (this.enableRotate = !t);
},
},
noPan: {
get: function () {
return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."), !this.enablePan;
},
set: function (t) {
console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."), (this.enablePan = !t);
},
},
noKeys: {
get: function () {
return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."), !this.enableKeys;
},
set: function (t) {
console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."), (this.enableKeys = !t);
},
},
staticMoving: {
get: function () {
return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."), !this.enableDamping;
},
set: function (t) {
console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."), (this.enableDamping = !t);
},
},
dynamicDampingFactor: {
get: function () {
return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."), this.dampingFactor;
},
set: function (t) {
console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."), (this.dampingFactor = t);
},
},
});
var Stats = function () {
function t(t) {
return r.appendChild(t.dom), t;
}
function e(t) {
for (var e = 0; e < r.children.length; e++) r.children[e].style.display = e === t ? "block" : "none";
i = t;
}
var i = 0,
r = document.createElement("div");
(r.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000"),
r.addEventListener(
"click",
function (t) {
t.preventDefault(), e(++i % r.children.length);
},
!1
);
var n = (performance || Date).now(),
s = n,
o = 0,
a = t(new Stats.Panel("FPS", "#0ff", "#002")),
l = t(new Stats.Panel("MS", "#0f0", "#020"));
if (self.performance && self.performance.memory) var h = t(new Stats.Panel("MB", "#f08", "#201"));
return (
e(0),
{
REVISION: 16,
dom: r,
addPanel: t,
showPanel: e,
begin: function () {
n = (performance || Date).now();
},
end: function () {
o++;
var t = (performance || Date).now();
if ((l.update(t - n, 200), t > s + 1e3 && (a.update((1e3 * o) / (t - s), 100), (s = t), (o = 0), h))) {
var e = performance.memory;
h.update(e.usedJSHeapSize / 1048576, e.jsHeapSizeLimit / 1048576);
}
return t;
},
update: function () {
n = this.end();
},
domElement: r,
setMode: e,
}
);
};
(Stats.Panel = function (t, e, i) {
var r = 1 / 0,
n = 0,
s = Math.round,
o = s(window.devicePixelRatio || 1),
a = 80 * o,
l = 48 * o,
h = 3 * o,
c = 2 * o,
u = 3 * o,
d = 15 * o,
f = 74 * o,
p = 30 * o,
m = document.createElement("canvas");
(m.width = a), (m.height = l), (m.style.cssText = "width:80px;height:48px");
var _ = m.getContext("2d");
return (
(_.font = "bold " + 9 * o + "px Helvetica,Arial,sans-serif"),
(_.textBaseline = "top"),
(_.fillStyle = i),
_.fillRect(0, 0, a, l),
(_.fillStyle = e),
_.fillText(t, h, c),
_.fillRect(u, d, f, p),
(_.fillStyle = i),
(_.globalAlpha = 0.9),
_.fillRect(u, d, f, p),
{
dom: m,
update: function (l, v) {
(r = Math.min(r, l)),
(n = Math.max(n, l)),
(_.fillStyle = i),
(_.globalAlpha = 1),
_.fillRect(0, 0, a, d),
(_.fillStyle = e),
_.fillText(s(l) + " " + t + " (" + s(r) + "-" + s(n) + ")", h, c),
_.drawImage(m, u + o, d, f - o, p, u, d, f - o, p),
_.fillRect(u + f - o, d, o, p),
(_.fillStyle = i),
(_.globalAlpha = 0.9),
_.fillRect(u + f - o, d, o, s((1 - l / v) * p));
},
}
);
}),
"object" == typeof module && (module.exports = Stats),
!(function (t, e) {
"use strict";
var i = (t.GreenSockGlobals = t.GreenSockGlobals || t);
if (!i.TweenLite) {
var r,
n,
s,
o,
a,
l = function (t) {
var e,
r = t.split("."),
n = i;
for (e = 0; e < r.length; e++) n[r[e]] = n = n[r[e]] || {};
return n;
},
h = l("com.greensock"),
c = 1e-10,
u = function (t) {
var e,
i = [],
r = t.length;
for (e = 0; e !== r; i.push(t[e++]));
return i;
},
d = function () {},
f = (function () {
var t = Object.prototype.toString,
e = t.call([]);
return function (i) {
return null != i && (i instanceof Array || ("object" == typeof i && !!i.push && t.call(i) === e));
};
})(),
p = {},
m = function (r, n, s, o) {
(this.sc = p[r] ? p[r].sc : []), (p[r] = this), (this.gsClass = null), (this.func = s);
var a = [];
(this.check = function (h) {
for (var c, u, d, f, _, v = n.length, g = v; --v > -1; ) (c = p[n[v]] || new m(n[v], [])).gsClass ? ((a[v] = c.gsClass), g--) : h && c.sc.push(this);
if (0 === g && s)
for (
u = ("com.greensock." + r).split("."),
d = u.pop(),
f = l(u.join("."))[d] = this.gsClass = s.apply(s, a),
o &&
((i[d] = f),
(_ = "undefined" != typeof module && module.exports),
!_ && "function" == typeof define && define.amd
? define((t.GreenSockAMDPath ? t.GreenSockAMDPath + "/" : "") + r.split(".").pop(), [], function () {
return f;
})
: r === e && _ && (module.exports = f)),
v = 0;
v < this.sc.length;
v++
)
this.sc[v].check();
}),
this.check(!0);
},
_ = (t._gsDefine = function (t, e, i, r) {
return new m(t, e, i, r);
}),
v = (h._class = function (t, e, i) {
return (
(e = e || function () {}),
_(
t,
[],
function () {
return e;
},
i
),
e
);
});
_.globals = i;
var g = [0, 0, 1, 1],
y = [],
b = v(
"easing.Ease",
function (t, e, i, r) {
(this._func = t), (this._type = i || 0), (this._power = r || 0), (this._params = e ? g.concat(e) : g);
},
!0
),
x = (b.map = {}),
w = (b.register = function (t, e, i, r) {
for (var n, s, o, a, l = e.split(","), c = l.length, u = (i || "easeIn,easeOut,easeInOut").split(","); --c > -1; )
for (s = l[c], n = r ? v("easing." + s, null, !0) : h.easing[s] || {}, o = u.length; --o > -1; ) (a = u[o]), (x[s + "." + a] = x[a + s] = n[a] = t.getRatio ? t : t[a] || new t());
});
for (
s = b.prototype,
s._calcEnd = !1,
s.getRatio = function (t) {
if (this._func) return (this._params[0] = t), this._func.apply(null, this._params);
var e = this._type,
i = this._power,
r = 1 === e ? 1 - t : 2 === e ? t : 0.5 > t ? 2 * t : 2 * (1 - t);
return 1 === i ? (r *= r) : 2 === i ? (r *= r * r) : 3 === i ? (r *= r * r * r) : 4 === i && (r *= r * r * r * r), 1 === e ? 1 - r : 2 === e ? r : 0.5 > t ? r / 2 : 1 - r / 2;
},
r = ["Linear", "Quad", "Cubic", "Quart", "Quint,Strong"],
n = r.length;
--n > -1;
)
(s = r[n] + ",Power" + n), w(new b(null, null, 1, n), s, "easeOut", !0), w(new b(null, null, 2, n), s, "easeIn" + (0 === n ? ",easeNone" : "")), w(new b(null, null, 3, n), s, "easeInOut");
(x.linear = h.easing.Linear.easeIn), (x.swing = h.easing.Quad.easeInOut);
var T = v("events.EventDispatcher", function (t) {
(this._listeners = {}), (this._eventTarget = t || this);
});
(s = T.prototype),
(s.addEventListener = function (t, e, i, r, n) {
n = n || 0;
var s,
l,
h = this._listeners[t],
c = 0;
for (null == h && (this._listeners[t] = h = []), l = h.length; --l > -1; ) (s = h[l]), s.c === e && s.s === i ? h.splice(l, 1) : 0 === c && s.pr < n && (c = l + 1);
h.splice(c, 0, { c: e, s: i, up: r, pr: n }), this !== o || a || o.wake();
}),
(s.removeEventListener = function (t, e) {
var i,
r = this._listeners[t];
if (r) for (i = r.length; --i > -1; ) if (r[i].c === e) return void r.splice(i, 1);
}),
(s.dispatchEvent = function (t) {
var e,
i,
r,
n = this._listeners[t];
if (n) for (e = n.length, i = this._eventTarget; --e > -1; ) (r = n[e]), r && (r.up ? r.c.call(r.s || i, { type: t, target: i }) : r.c.call(r.s || i));
});
var E = t.requestAnimationFrame,
C = t.cancelAnimationFrame,
S =
Date.now ||
function () {
return new Date().getTime();
},
R = S();
for (r = ["ms", "moz", "webkit", "o"], n = r.length; --n > -1 && !E; ) (E = t[r[n] + "RequestAnimationFrame"]), (C = t[r[n] + "CancelAnimationFrame"] || t[r[n] + "CancelRequestAnimationFrame"]);
v("Ticker", function (t, e) {
var i,
r,
n,
s,
l,
h = this,
u = S(),
f = !(e === !1 || !E) && "auto",
p = 500,
m = 33,
_ = "tick",
v = function (t) {
var e,
o,
a = S() - R;
a > p && (u += a - m), (R += a), (h.time = (R - u) / 1e3), (e = h.time - l), (!i || e > 0 || t === !0) && (h.frame++, (l += e + (e >= s ? 0.004 : s - e)), (o = !0)), t !== !0 && (n = r(v)), o && h.dispatchEvent(_);
};
T.call(h),
(h.time = h.frame = 0),
(h.tick = function () {
v(!0);
}),
(h.lagSmoothing = function (t, e) {
(p = t || 1 / c), (m = Math.min(e, p, 0));
}),
(h.sleep = function () {
null != n && (f && C ? C(n) : clearTimeout(n), (r = d), (n = null), h === o && (a = !1));
}),
(h.wake = function (t) {
null !== n ? h.sleep() : t ? (u += -R + (R = S())) : h.frame > 10 && (R = S() - p + 5),
(r =
0 === i
? d
: f && E
? E
: function (t) {
return setTimeout(t, (1e3 * (l - h.time) + 1) | 0);
}),
h === o && (a = !0),
v(2);
}),
(h.fps = function (t) {
return arguments.length ? ((i = t), (s = 1 / (i || 60)), (l = this.time + s), void h.wake()) : i;
}),
(h.useRAF = function (t) {
return arguments.length ? (h.sleep(), (f = t), void h.fps(i)) : f;
}),
h.fps(t),
setTimeout(function () {
"auto" === f && h.frame < 5 && "hidden" !== document.visibilityState && h.useRAF(!1);
}, 1500);
}),
(s = h.Ticker.prototype = new h.events.EventDispatcher()),
(s.constructor = h.Ticker);
var k = v("core.Animation", function (t, e) {
if (
((this.vars = e = e || {}),
(this._duration = this._totalDuration = t || 0),
(this._delay = Number(e.delay) || 0),
(this._timeScale = 1),
(this._active = e.immediateRender === !0),
(this.data = e.data),
(this._reversed = e.reversed === !0),
q)
) {
a || o.wake();
var i = this.vars.useFrames ? G : q;
i.add(this, i._time), this.vars.paused && this.paused(!0);
}
});
(o = k.ticker = new h.Ticker()),
(s = k.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 P = function () {
a && S() - R > 2e3 && o.wake(), setTimeout(P, 2e3);
};
P(),
(s.play = function (t, e) {
return null != t && this.seek(t, e), this.reversed(!1).paused(!1);
}),
(s.pause = function (t, e) {
return null != t && this.seek(t, e), this.paused(!0);
}),
(s.resume = function (t, e) {
return null != t && this.seek(t, e), this.paused(!1);
}),
(s.seek = function (t, e) {
return this.totalTime(Number(t), e !== !1);
}),
(s.restart = function (t, e) {
return this.reversed(!1)
.paused(!1)
.totalTime(t ? -this._delay : 0, e !== !1, !0);
}),
(s.reverse = function (t, e) {
return null != t && this.seek(t || this.totalDuration(), e), this.reversed(!0).paused(!1);
}),
(s.render = function (t, e, i) {}),
(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 t,
e = this._timeline,
i = this._startTime;
return !e || (!this._gc && !this._paused && e.isActive() && (t = e.rawTime()) >= i && t < i + this.totalDuration() / this._timeScale);
}),
(s._enabled = function (t, e) {
return (
a || o.wake(),
(this._gc = !t),
(this._active = this.isActive()),
e !== !0 && (t && !this.timeline ? this._timeline.add(this, this._startTime - this._delay) : !t && this.timeline && this._timeline._remove(this, !0)),
!1
);
}),
(s._kill = function (t, e) {
return this._enabled(!1, !1);
}),
(s.kill = function (t, e) {
return this._kill(t, e), this;
}),
(s._uncache = function (t) {
for (var e = t ? this : this.timeline; e; ) (e._dirty = !0), (e = e.timeline);
return this;
}),
(s._swapSelfInParams = function (t) {
for (var e = t.length, i = t.concat(); --e > -1; ) "{self}" === t[e] && (i[e] = this);
return i;
}),
(s._callback = function (t) {
var e = this.vars;
e[t].apply(e[t + "Scope"] || e.callbackScope || this, e[t + "Params"] || y);
}),
(s.eventCallback = function (t, e, i, r) {
if ("on" === (t || "").substr(0, 2)) {
var n = this.vars;
if (1 === arguments.length) return n[t];
null == e ? delete n[t] : ((n[t] = e), (n[t + "Params"] = f(i) && -1 !== i.join("").indexOf("{self}") ? this._swapSelfInParams(i) : i), (n[t + "Scope"] = r)), "onUpdate" === t && (this._onUpdate = e);
}
return this;
}),
(s.delay = function (t) {
return arguments.length ? (this._timeline.smoothChildTiming && this.startTime(this._startTime + t - this._delay), (this._delay = t), this) : this._delay;
}),
(s.duration = function (t) {
return arguments.length
? ((this._duration = this._totalDuration = t),
this._uncache(!0),
this._timeline.smoothChildTiming && this._time > 0 && this._time < this._duration && 0 !== t && this.totalTime(this._totalTime * (t / this._duration), !0),
this)
: ((this._dirty = !1), this._duration);
}),
(s.totalDuration = function (t) {
return (this._dirty = !1), arguments.length ? this.duration(t) : this._totalDuration;
}),
(s.time = function (t, e) {
return arguments.length ? (this._dirty && this.totalDuration(), this.totalTime(t > this._duration ? this._duration : t, e)) : this._time;
}),
(s.totalTime = function (t, e, i) {
if ((a || o.wake(), !arguments.length)) return this._totalTime;
if (this._timeline) {
if ((0 > t && !i && (t += this.totalDuration()), this._timeline.smoothChildTiming)) {
this._dirty && this.totalDuration();
var r = this._totalDuration,
n = this._timeline;
if ((t > r && !i && (t = r), (this._startTime = (this._paused ? this._pauseTime : n._time) - (this._reversed ? r - t : t) / this._timeScale), n._dirty || this._uncache(!1), n._timeline))
for (; n._timeline; ) n._timeline._time !== (n._startTime + n._totalTime) / n._timeScale && n.totalTime(n._totalTime, !0), (n = n._timeline);
}
this._gc && this._enabled(!0, !1), (this._totalTime !== t || 0 === this._duration) && (H.length && Z(), this.render(t, e, !1), H.length && Z());
}
return this;
}),
(s.progress = s.totalProgress = function (t, e) {
var i = this.duration();
return arguments.length ? this.totalTime(i * t, e) : i ? this._time / i : this.ratio;
}),
(s.startTime = function (t) {
return arguments.length ? (t !== this._startTime && ((this._startTime = t), this.timeline && this.timeline._sortChildren && this.timeline.add(this, t - this._delay)), this) : this._startTime;
}),
(s.endTime = function (t) {
return this._startTime + (0 != t ? this.totalDuration() : this.duration()) / this._timeScale;
}),
(s.timeScale = function (t) {
if (!arguments.length) return this._timeScale;
if (((t = t || c), this._timeline && this._timeline.smoothChildTiming)) {
var e = this._pauseTime,
i = e || 0 === e ? e : this._timeline.totalTime();
this._startTime = i - ((i - this._startTime) * this._timeScale) / t;
}
return (this._timeScale = t), this._uncache(!1);
}),
(s.reversed = function (t) {
return arguments.length
? (t != this._reversed && ((this._reversed = t), this.totalTime(this._timeline && !this._timeline.smoothChildTiming ? this.totalDuration() - this._totalTime : this._totalTime, !0)), this)
: this._reversed;
}),
(s.paused = function (t) {
if (!arguments.length) return this._paused;
var e,
i,
r = this._timeline;
return (
t != this._paused &&
r &&
(a || t || o.wake(),
(e = r.rawTime()),
(i = e - this._pauseTime),
!t && r.smoothChildTiming && ((this._startTime += i), this._uncache(!1)),
(this._pauseTime = t ? e : null),
(this._paused = t),
(this._active = this.isActive()),
!t && 0 !== i && this._initted && this.duration() && ((e = r.smoothChildTiming ? this._totalTime : (e - this._startTime) / this._timeScale), this.render(e, e === this._totalTime, !0))),
this._gc && !t && this._enabled(!0, !1),
this
);
});
var D = v("core.SimpleTimeline", function (t) {
k.call(this, 0, t), (this.autoRemoveChildren = this.smoothChildTiming = !0);
});
(s = D.prototype = new k()),
(s.constructor = D),
(s.kill()._gc = !1),
(s._first = s._last = s._recent = null),
(s._sortChildren = !1),
(s.add = s.insert = function (t, e, i, r) {
var n, s;
if (
((t._startTime = Number(e || 0) + t._delay),
t._paused && this !== t._timeline && (t._pauseTime = t._startTime + (this.rawTime() - t._startTime) / t._timeScale),
t.timeline && t.timeline._remove(t, !0),
(t.timeline = t._timeline = this),
t._gc && t._enabled(!0, !0),
(n = this._last),
this._sortChildren)
)
for (s = t._startTime; n && n._startTime > s; ) n = n._prev;
return (
n ? ((t._next = n._next), (n._next = t)) : ((t._next = this._first), (this._first = t)), t._next ? (t._next._prev = t) : (this._last = t), (t._prev = n), (this._recent = t), this._timeline && this._uncache(!0), this
);
}),
(s._remove = function (t, e) {
return (
t.timeline === this &&
(e || t._enabled(!1, !0),
t._prev ? (t._prev._next = t._next) : this._first === t && (this._first = t._next),
t._next ? (t._next._prev = t._prev) : this._last === t && (this._last = t._prev),
(t._next = t._prev = t.timeline = null),
t === this._recent && (this._recent = this._last),
this._timeline && this._uncache(!0)),
this
);
}),
(s.render = function (t, e, i) {
var r,
n = this._first;
for (this._totalTime = this._time = this._rawPrevTime = t; n; )
(r = n._next),
(n._active || (t >= n._startTime && !n._paused)) &&
(n._reversed ? n.render((n._dirty ? n.totalDuration() : n._totalDuration) - (t - n._startTime) * n._timeScale, e, i) : n.render((t - n._startTime) * n._timeScale, e, i)),
(n = r);
}),
(s.rawTime = function () {
return a || o.wake(), this._totalTime;
});
var A = v(
"TweenLite",
function (e, i, r) {
if ((k.call(this, i, r), (this.render = A.prototype.render), null == e)) throw "Cannot tween a null target.";
this.target = e = "string" != typeof e ? e : A.selector(e) || e;
var n,
s,
o,
a = e.jquery || (e.length && e !== t && e[0] && (e[0] === t || (e[0].nodeType && e[0].style && !e.nodeType))),
l = this.vars.overwrite;
if (((this._overwrite = l = null == l ? X[A.defaultOverwrite] : "number" == typeof l ? l >> 0 : X[l]), (a || e instanceof Array || (e.push && f(e))) && "number" != typeof e[0]))
for (this._targets = o = u(e), this._propLookup = [], this._siblings = [], n = 0; n < o.length; n++)
(s = o[n]),
s
? "string" != typeof s
? s.length && s !== t && s[0] && (s[0] === t || (s[0].nodeType && s[0].style && !s.nodeType))
? (o.splice(n--, 1), (this._targets = o = o.concat(u(s))))
: ((this._siblings[n] = K(s, this, !1)), 1 === l && this._siblings[n].length > 1 && J(s, this, null, 1, this._siblings[n]))
: ((s = o[n--] = A.selector(s)), "string" == typeof s && o.splice(n + 1, 1))
: o.splice(n--, 1);
else (this._propLookup = {}), (this._siblings = K(e, this, !1)), 1 === l && this._siblings.length > 1 && J(e, this, null, 1, this._siblings);
(this.vars.immediateRender || (0 === i && 0 === this._delay && this.vars.immediateRender !== !1)) && ((this._time = -c), this.render(-this._delay));
},
!0
),
M = function (e) {
return e && e.length && e !== t && e[0] && (e[0] === t || (e[0].nodeType && e[0].style && !e.nodeType));
},
O = function (t, e) {
var i,
r = {};
for (i in t)
W[i] || (i in e && "transform" !== i && "x" !== i && "y" !== i && "width" !== i && "height" !== i && "className" !== i && "border" !== i) || !(!I[i] || (I[i] && I[i]._autoCSS)) || ((r[i] = t[i]), delete t[i]);
t.css = r;
};
(s = A.prototype = new k()),
(s.constructor = A),
(s.kill()._gc = !1),
(s.ratio = 0),
(s._firstPT = s._targets = s._overwrittenProps = s._startAt = null),
(s._notifyPluginsOfEnabled = s._lazy = !1),
(A.version = "1.18.2"),
(A.defaultEase = s._ease = new b(null, null, 1, 1)),
(A.defaultOverwrite = "auto"),
(A.ticker = o),
(A.autoSleep = 120),
(A.lagSmoothing = function (t, e) {
o.lagSmoothing(t, e);
}),
(A.selector =
t.$ ||
t.jQuery ||
function (e) {
var i = t.$ || t.jQuery;
return i ? ((A.selector = i), i(e)) : "undefined" == typeof document ? e : document.querySelectorAll ? document.querySelectorAll(e) : document.getElementById("#" === e.charAt(0) ? e.substr(1) : e);
});
var H = [],
U = {},
F = /(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,
z = function (t) {
for (var e, i = this._firstPT, r = 1e-6; i; )
(e = i.blob ? (t ? this.join("") : this.start) : i.c * t + i.s), i.r ? (e = Math.round(e)) : r > e && e > -r && (e = 0), i.f ? (i.fp ? i.t[i.p](i.fp, e) : i.t[i.p](e)) : (i.t[i.p] = e), (i = i._next);
},
N = function (t, e, i, r) {
var n,
s,
o,
a,
l,
h,
c,
u = [t, e],
d = 0,
f = "",
p = 0;
for (u.start = t, i && (i(u), (t = u[0]), (e = u[1])), u.length = 0, n = t.match(F) || [], s = e.match(F) || [], r && ((r._next = null), (r.blob = 1), (u._firstPT = r)), l = s.length, a = 0; l > a; a++)
(c = s[a]),
(h = e.substr(d, e.indexOf(c, d) - d)),
(f += h || !a ? h : ","),
(d += h.length),
p ? (p = (p + 1) % 5) : "rgba(" === h.substr(-5) && (p = 1),
c === n[a] || n.length <= a
? (f += c)
: (f && (u.push(f), (f = "")),
(o = parseFloat(n[a])),
u.push(o),
(u._firstPT = { _next: u._firstPT, t: u, p: u.length - 1, s: o, c: ("=" === c.charAt(1) ? parseInt(c.charAt(0) + "1", 10) * parseFloat(c.substr(2)) : parseFloat(c) - o) || 0, f: 0, r: p && 4 > p })),
(d += c.length);
return (f += e.substr(d)), f && u.push(f), (u.setRatio = z), u;
},
L = function (t, e, i, r, n, s, o, a) {
var l,
h,
c = "get" === i ? t[e] : i,
u = typeof t[e],
d = "string" == typeof r && "=" === r.charAt(1),
f = { t: t, p: e, s: c, f: "function" === u, pg: 0, n: n || e, r: s, pr: 0, c: d ? parseInt(r.charAt(0) + "1", 10) * parseFloat(r.substr(2)) : parseFloat(r) - c || 0 };
return (
"number" !== u &&
("function" === u && "get" === i && ((h = e.indexOf("set") || "function" != typeof t["get" + e.substr(3)] ? e : "get" + e.substr(3)), (f.s = c = o ? t[h](o) : t[h]())),
"string" == typeof c && (o || isNaN(c))
? ((f.fp = o), (l = N(c, r, a || A.defaultStringFilter, f)), (f = { t: l, p: "setRatio", s: 0, c: 1, f: 2, pg: 0, n: n || e, pr: 0 }))
: d || ((f.s = parseFloat(c)), (f.c = parseFloat(r) - f.s || 0))),
f.c ? ((f._next = this._firstPT) && (f._next._prev = f), (this._firstPT = f), f) : void 0
);
},
j = (A._internals = { isArray: f, isSelector: M, lazyTweens: H, blobDif: N }),
I = (A._plugins = {}),
B = (j.tweenLookup = {}),
V = 0,
W = (j.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,
callbackScope: 1,
stringFilter: 1,
}),
X = { none: 0, all: 1, auto: 2, concurrent: 3, allOnStart: 4, preexisting: 5, true: 1, false: 0 },
G = (k._rootFramesTimeline = new D()),
q = (k._rootTimeline = new D()),
Y = 30,
Z = (j.lazyRender = function () {
var t,
e = H.length;
for (U = {}; --e > -1; ) (t = H[e]), t && t._lazy !== !1 && (t.render(t._lazy[0], t._lazy[1], !0), (t._lazy = !1));
H.length = 0;
});
(q._startTime = o.time),
(G._startTime = o.frame),
(q._active = G._active = !0),
setTimeout(Z, 1),
(k._updateRoot = A.render = function () {
var t, e, i;
if ((H.length && Z(), q.render((o.time - q._startTime) * q._timeScale, !1, !1), G.render((o.frame - G._startTime) * G._timeScale, !1, !1), H.length && Z(), o.frame >= Y)) {
Y = o.frame + (parseInt(A.autoSleep, 10) || 120);
for (i in B) {
for (e = B[i].tweens, t = e.length; --t > -1; ) e[t]._gc && e.splice(t, 1);
0 === e.length && delete B[i];
}
if (((i = q._first), (!i || i._paused) && A.autoSleep && !G._first && 1 === o._listeners.tick.length)) {
for (; i && i._paused; ) i = i._next;
i || o.sleep();
}
}
}),
o.addEventListener("tick", k._updateRoot);
var K = function (t, e, i) {
var r,
n,
s = t._gsTweenID;
if ((B[s || (t._gsTweenID = s = "t" + V++)] || (B[s] = { target: t, tweens: [] }), e && ((r = B[s].tweens), (r[(n = r.length)] = e), i))) for (; --n > -1; ) r[n] === e && r.splice(n, 1);
return B[s].tweens;
},
Q = function (t, e, i, r) {
var n,
s,
o = t.vars.onOverwrite;
return o && (n = o(t, e, i, r)), (o = A.onOverwrite), o && (s = o(t, e, i, r)), n !== !1 && s !== !1;
},
J = function (t, e, i, r, n) {
var s, o, a, l;
if (1 === r || r >= 4) {
for (l = n.length, s = 0; l > s; s++)
if ((a = n[s]) !== e) a._gc || (a._kill(null, t, e) && (o = !0));
else if (5 === r) break;
return o;
}
var h,
u = e._startTime + c,
d = [],
f = 0,
p = 0 === e._duration;
for (s = n.length; --s > -1; )
(a = n[s]) === e ||
a._gc ||
a._paused ||
(a._timeline !== e._timeline
? ((h = h || $(e, 0, p)), 0 === $(a, h, p) && (d[f++] = a))
: a._startTime <= u && a._startTime + a.totalDuration() / a._timeScale > u && (((p || !a._initted) && u - a._startTime <= 2e-10) || (d[f++] = a)));
for (s = f; --s > -1; )
if (((a = d[s]), 2 === r && a._kill(i, t, e) && (o = !0), 2 !== r || (!a._firstPT && a._initted))) {
if (2 !== r && !Q(a, e)) continue;
a._enabled(!1, !1) && (o = !0);
}
return o;
},
$ = function (t, e, i) {
for (var r = t._timeline, n = r._timeScale, s = t._startTime; r._timeline; ) {
if (((s += r._startTime), (n *= r._timeScale), r._paused)) return -100;
r = r._timeline;
}
return (s /= n), s > e ? s - e : (i && s === e) || (!t._initted && 2 * c > s - e) ? c : (s += t.totalDuration() / t._timeScale / n) > e + c ? 0 : s - e - c;
};
(s._init = function () {
var t,
e,
i,
r,
n,
s = this.vars,
o = this._overwrittenProps,
a = this._duration,
l = !!s.immediateRender,
h = s.ease;
if (s.startAt) {
this._startAt && (this._startAt.render(-1, !0), this._startAt.kill()), (n = {});
for (r in s.startAt) n[r] = s.startAt[r];
if (((n.overwrite = !1), (n.immediateRender = !0), (n.lazy = l && s.lazy !== !1), (n.startAt = n.delay = null), (this._startAt = A.to(this.target, 0, n)), l))
if (this._time > 0) this._startAt = null;
else if (0 !== a) return;
} else if (s.runBackwards && 0 !== a)
if (this._startAt) this._startAt.render(-1, !0), this._startAt.kill(), (this._startAt = null);
else {
0 !== this._time && (l = !1), (i = {});
for (r in s) (W[r] && "autoCSS" !== r) || (i[r] = s[r]);
if (((i.overwrite = 0), (i.data = "isFromStart"), (i.lazy = l && s.lazy !== !1), (i.immediateRender = l), (this._startAt = A.to(this.target, 0, i)), l)) {
if (0 === this._time) return;
} else this._startAt._init(), this._startAt._enabled(!1), this.vars.immediateRender && (this._startAt = null);
}
if (
((this._ease = h = h ? (h instanceof b ? h : "function" == typeof h ? new b(h, s.easeParams) : x[h] || A.defaultEase) : A.defaultEase),
s.easeParams instanceof Array && h.config && (this._ease = h.config.apply(h, s.easeParams)),
(this._easeType = this._ease._type),
(this._easePower = this._ease._power),
(this._firstPT = null),
this._targets)
)
for (t = this._targets.length; --t > -1; ) this._initProps(this._targets[t], (this._propLookup[t] = {}), this._siblings[t], o ? o[t] : null) && (e = !0);
else e = this._initProps(this.target, this._propLookup, this._siblings, o);
if ((e && A._onPluginEvent("_onInitAllProps", this), o && (this._firstPT || ("function" != typeof this.target && this._enabled(!1, !1))), s.runBackwards))
for (i = this._firstPT; i; ) (i.s += i.c), (i.c = -i.c), (i = i._next);
(this._onUpdate = s.onUpdate), (this._initted = !0);
}),
(s._initProps = function (e, i, r, n) {
var s, o, a, l, h, c;
if (null == e) return !1;
U[e._gsTweenID] && Z(), this.vars.css || (e.style && e !== t && e.nodeType && I.css && this.vars.autoCSS !== !1 && O(this.vars, e));
for (s in this.vars)
if (((c = this.vars[s]), W[s])) c && (c instanceof Array || (c.push && f(c))) && -1 !== c.join("").indexOf("{self}") && (this.vars[s] = c = this._swapSelfInParams(c, this));
else if (I[s] && (l = new I[s]())._onInitTween(e, this.vars[s], this)) {
for (this._firstPT = h = { _next: this._firstPT, t: l, p: "setRatio", s: 0, c: 1, f: 1, n: s, pg: 1, pr: l._priority }, o = l._overwriteProps.length; --o > -1; ) i[l._overwriteProps[o]] = this._firstPT;
(l._priority || l._onInitAllProps) && (a = !0), (l._onDisable || l._onEnable) && (this._notifyPluginsOfEnabled = !0), h._next && (h._next._prev = h);
} else i[s] = L.call(this, e, s, "get", c, s, 0, null, this.vars.stringFilter);
return n && this._kill(n, e)
? this._initProps(e, i, r, n)
: this._overwrite > 1 && this._firstPT && r.length > 1 && J(e, this, i, this._overwrite, r)
? (this._kill(i, e), this._initProps(e, i, r, n))
: (this._firstPT && ((this.vars.lazy !== !1 && this._duration) || (this.vars.lazy && !this._duration)) && (U[e._gsTweenID] = !0), a);
}),
(s.render = function (t, e, i) {
var r,
n,
s,
o,
a = this._time,
l = this._duration,
h = this._rawPrevTime;
if (t >= l - 1e-7)
(this._totalTime = this._time = l),
(this.ratio = this._ease._calcEnd ? this._ease.getRatio(1) : 1),
this._reversed || ((r = !0), (n = "onComplete"), (i = i || this._timeline.autoRemoveChildren)),
0 === l &&
(this._initted || !this.vars.lazy || i) &&
(this._startTime === this._timeline._duration && (t = 0),
(0 > h || (0 >= t && t >= -1e-7) || (h === c && "isPause" !== this.data)) && h !== t && ((i = !0), h > c && (n = "onReverseComplete")),
(this._rawPrevTime = o = !e || t || h === t ? t : c));
else if (1e-7 > t)
(this._totalTime = this._time = 0),
(this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0),
(0 !== a || (0 === l && h > 0)) && ((n = "onReverseComplete"), (r = this._reversed)),
0 > t && ((this._active = !1), 0 === l && (this._initted || !this.vars.lazy || i) && (h >= 0 && (h !== c || "isPause" !== this.data) && (i = !0), (this._rawPrevTime = o = !e || t || h === t ? t : c))),
this._initted || (i = !0);
else if (((this._totalTime = this._time = t), this._easeType)) {
var u = t / l,
d = this._easeType,
f = this._easePower;
(1 === d || (3 === d && u >= 0.5)) && (u = 1 - u),
3 === d && (u *= 2),
1 === f ? (u *= u) : 2 === f ? (u *= u * u) : 3 === f ? (u *= u * u * u) : 4 === f && (u *= u * u * u * u),
1 === d ? (this.ratio = 1 - u) : 2 === d ? (this.ratio = u) : 0.5 > t / l ? (this.ratio = u / 2) : (this.ratio = 1 - u / 2);
} else this.ratio = this._ease.getRatio(t / l);
if (this._time !== a || i) {
if (!this._initted) {
if ((this._init(), !this._initted || this._gc)) return;
if (!i && this._firstPT && ((this.vars.lazy !== !1 && this._duration) || (this.vars.lazy && !this._duration)))
return (this._time = this._totalTime = a), (this._rawPrevTime = h), H.push(this), void (this._lazy = [t, e]);
this._time && !r ? (this.ratio = this._ease.getRatio(this._time / l)) : 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 !== a && t >= 0 && (this._active = !0)),
0 === a && (this._startAt && (t >= 0 ? this._startAt.render(t, e, i) : n || (n = "_dummyGS")), this.vars.onStart && (0 !== this._time || 0 === l) && (e || this._callback("onStart"))),
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 > t && this._startAt && t !== -1e-4 && this._startAt.render(t, e, i), e || ((this._time !== a || r) && this._callback("onUpdate"))),
n &&
(!this._gc || i) &&
(0 > t && this._startAt && !this._onUpdate && t !== -1e-4 && this._startAt.render(t, e, i),
r && (this._timeline.autoRemoveChildren && this._enabled(!1, !1), (this._active = !1)),
!e && this.vars[n] && this._callback(n),
0 === l && this._rawPrevTime === c && o !== c && (this._rawPrevTime = 0));
}
}),
(s._kill = function (t, e, i) {
if (("all" === t && (t = null), null == t && (null == e || e === this.target))) return (this._lazy = !1), this._enabled(!1, !1);
e = "string" != typeof e ? e || this._targets || this.target : A.selector(e) || e;
var r,
n,
s,
o,
a,
l,
h,
c,
u,
d = i && this._time && i._startTime === this._startTime && this._timeline === i._timeline;
if ((f(e) || M(e)) && "number" != typeof e[0]) for (r = e.length; --r > -1; ) this._kill(t, e[r], i) && (l = !0);
else {
if (this._targets) {
for (r = this._targets.length; --r > -1; )
if (e === this._targets[r]) {
(a = this._propLookup[r] || {}), (this._overwrittenProps = this._overwrittenProps || []), (n = this._overwrittenProps[r] = t ? this._overwrittenProps[r] || {} : "all");
break;
}
} else {
if (e !== this.target) return !1;
(a = this._propLookup), (n = this._overwrittenProps = t ? this._overwrittenProps || {} : "all");
}
if (a) {
if (((h = t || a), (c = t !== n && "all" !== n && t !== a && ("object" != typeof t || !t._tempKill)), i && (A.onOverwrite || this.vars.onOverwrite))) {
for (s in h) a[s] && (u || (u = []), u.push(s));
if ((u || !t) && !Q(this, i, e, u)) return !1;
}
for (s in h)
(o = a[s]) &&
(d && (o.f ? o.t[o.p](o.s) : (o.t[o.p] = o.s), (l = !0)),
o.pg && o.t._kill(h) && (l = !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 a[s]),
c && (n[s] = 1);
!this._firstPT && this._initted && this._enabled(!1, !1);
}
}
return l;
}),
(s.invalidate = function () {
return (
this._notifyPluginsOfEnabled && A._onPluginEvent("_onDisable", this),
(this._firstPT = this._overwrittenProps = this._startAt = this._onUpdate = null),
(this._notifyPluginsOfEnabled = this._active = this._lazy = !1),
(this._propLookup = this._targets ? {} : []),
k.prototype.invalidate.call(this),
this.vars.immediateRender && ((this._time = -c), this.render(-this._delay)),
this
);
}),
(s._enabled = function (t, e) {
if ((a || o.wake(), t && this._gc)) {
var i,
r = this._targets;
if (r) for (i = r.length; --i > -1; ) this._siblings[i] = K(r[i], this, !0);
else this._siblings = K(this.target, this, !0);
}
return k.prototype._enabled.call(this, t, e), !(!this._notifyPluginsOfEnabled || !this._firstPT) && A._onPluginEvent(t ? "_onEnable" : "_onDisable", this);
}),
(A.to = function (t, e, i) {
return new A(t, e, i);
}),
(A.from = function (t, e, i) {
return (i.runBackwards = !0), (i.immediateRender = 0 != i.immediateRender), new A(t, e, i);
}),
(A.fromTo = function (t, e, i, r) {
return (r.startAt = i), (r.immediateRender = 0 != r.immediateRender && 0 != i.immediateRender), new A(t, e, r);
}),
(A.delayedCall = function (t, e, i, r, n) {
return new A(e, 0, { delay: t, onComplete: e, onCompleteParams: i, callbackScope: r, onReverseComplete: e, onReverseCompleteParams: i, immediateRender: !1, lazy: !1, useFrames: n, overwrite: 0 });
}),
(A.set = function (t, e) {
return new A(t, 0, e);
}),
(A.getTweensOf = function (t, e) {
if (null == t) return [];
t = "string" != typeof t ? t : A.selector(t) || t;
var i, r, n, s;
if ((f(t) || M(t)) && "number" != typeof t[0]) {
for (i = t.length, r = []; --i > -1; ) r = r.concat(A.getTweensOf(t[i], e));
for (i = r.length; --i > -1; ) for (s = r[i], n = i; --n > -1; ) s === r[n] && r.splice(i, 1);
} else for (r = K(t).concat(), i = r.length; --i > -1; ) (r[i]._gc || (e && !r[i].isActive())) && r.splice(i, 1);
return r;
}),
(A.killTweensOf = A.killDelayedCallsTo = function (t, e, i) {
"object" == typeof e && ((i = e), (e = !1));
for (var r = A.getTweensOf(t, e), n = r.length; --n > -1; ) r[n]._kill(i, t);
});
var tt = v(
"plugins.TweenPlugin",
function (t, e) {
(this._overwriteProps = (t || "").split(",")), (this._propName = this._overwriteProps[0]), (this._priority = e || 0), (this._super = tt.prototype);
},
!0
);
if (
((s = tt.prototype),
(tt.version = "1.18.0"),
(tt.API = 2),
(s._firstPT = null),
(s._addTween = L),
(s.setRatio = z),
(s._kill = function (t) {
var e,
i = this._overwriteProps,
r = this._firstPT;
if (null != t[this._propName]) this._overwriteProps = [];
else for (e = i.length; --e > -1; ) null != t[i[e]] && i.splice(e, 1);
for (; r; ) null != t[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 (t, e) {
for (var i = this._firstPT; i; ) (t[this._propName] || (null != i.n && t[i.n.split(this._propName + "_").join("")])) && (i.r = e), (i = i._next);
}),
(A._onPluginEvent = function (t, e) {
var i,
r,
n,
s,
o,
a = e._firstPT;
if ("_onInitAllProps" === t) {
for (; a; ) {
for (o = a._next, r = n; r && r.pr > a.pr; ) r = r._next;
(a._prev = r ? r._prev : s) ? (a._prev._next = a) : (n = a), (a._next = r) ? (r._prev = a) : (s = a), (a = o);
}
a = e._firstPT = n;
}
for (; a; ) a.pg && "function" == typeof a.t[t] && a.t[t]() && (i = !0), (a = a._next);
return i;
}),
(tt.activate = function (t) {
for (var e = t.length; --e > -1; ) t[e].API === tt.API && (I[new t[e]()._propName] = t[e]);
return !0;
}),
(_.plugin = function (t) {
if (!(t && t.propName && t.init && t.API)) throw "illegal plugin definition.";
var e,
i = t.propName,
r = t.priority || 0,
n = t.overwriteProps,
s = { init: "_onInitTween", set: "setRatio", kill: "_kill", round: "_roundProps", initAll: "_onInitAllProps" },
o = v(
"plugins." + i.charAt(0).toUpperCase() + i.substr(1) + "Plugin",
function () {
tt.call(this, i, r), (this._overwriteProps = n || []);
},
t.global === !0
),
a = (o.prototype = new tt(i));
(a.constructor = o), (o.API = t.API);
for (e in s) "function" == typeof t[e] && (a[s[e]] = t[e]);
return (o.version = t.version), tt.activate([o]), o;
}),
(r = t._gsQueue))
) {
for (n = 0; n < r.length; n++) r[n]();
for (s in p) p[s].func || t.console.log("GSAP encountered missing dependency: com.greensock." + s);
}
a = !1;
}
})("undefined" != typeof module && module.exports && "undefined" != typeof global ? global : this || window, "TweenLite");
var _gsScope = "undefined" != typeof module && module.exports && "undefined" != typeof global ? global : this || window;
(_gsScope._gsQueue || (_gsScope._gsQueue = [])).push(function () {
"use strict";
_gsScope._gsDefine(
"TweenMax",
["core.Animation", "core.SimpleTimeline", "TweenLite"],
function (t, e, i) {
var r = function (t) {
var e,
i = [],
r = t.length;
for (e = 0; e !== r; i.push(t[e++]));
return i;
},
n = function (t, e, i) {
var r,
n,
s = t.cycle;
for (r in s) (n = s[r]), (t[r] = "function" == typeof n ? n.call(e[i], i) : n[i % n.length]);
delete t.cycle;
},
s = function (t, e, r) {
i.call(this, t, e, 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 = s.prototype.render);
},
o = 1e-10,
a = i._internals,
l = a.isSelector,
h = a.isArray,
c = (s.prototype = i.to({}, 0.1, {})),
u = [];
(s.version = "1.18.2"),
(c.constructor = s),
(c.kill()._gc = !1),
(s.killTweensOf = s.killDelayedCallsTo = i.killTweensOf),
(s.getTweensOf = i.getTweensOf),
(s.lagSmoothing = i.lagSmoothing),
(s.ticker = i.ticker),
(s.render = i.render),
(c.invalidate = function () {
return (this._yoyo = this.vars.yoyo === !0), (this._repeat = this.vars.repeat || 0), (this._repeatDelay = this.vars.repeatDelay || 0), this._uncache(!0), i.prototype.invalidate.call(this);
}),
(c.updateTo = function (t, e) {
var r,
n = this.ratio,
s = this.vars.immediateRender || t.immediateRender;
e && 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 t) this.vars[r] = t[r];
if (this._initted || s)
if (e) (this._initted = !1), s && this.render(0, !0, !0);
else if ((this._gc && this._enabled(!0, !1), this._notifyPluginsOfEnabled && this._firstPT && i._onPluginEvent("_onDisable", this), this._time / this._duration > 0.998)) {
var o = this._totalTime;
this.render(0, !0, !1), (this._initted = !1), this.render(o, !0, !1);
} else if (((this._initted = !1), this._init(), this._time > 0 || s)) for (var a, l = 1 / (1 - n), h = this._firstPT; h; ) (a = h.s + h.c), (h.c *= l), (h.s = a - h.c), (h = h._next);
return this;
}),
(c.render = function (t, e, i) {
this._initted || (0 === this._duration && this.vars.repeat && this.invalidate());
var r,
n,
s,
l,
h,
c,
u,
d,
f = this._dirty ? this.totalDuration() : this._totalDuration,
p = this._time,
m = this._totalTime,
_ = this._cycle,
v = this._duration,
g = this._rawPrevTime;
if (
(t >= f - 1e-7
? ((this._totalTime = f),
(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 = v), (this.ratio = this._ease._calcEnd ? this._ease.getRatio(1) : 1)),
this._reversed || ((r = !0), (n = "onComplete"), (i = i || this._timeline.autoRemoveChildren)),
0 === v &&
(this._initted || !this.vars.lazy || i) &&
(this._startTime === this._timeline._duration && (t = 0),
(0 > g || (0 >= t && t >= -1e-7) || (g === o && "isPause" !== this.data)) && g !== t && ((i = !0), g > o && (n = "onReverseComplete")),
(this._rawPrevTime = d = !e || t || g === t ? t : o)))
: 1e-7 > t
? ((this._totalTime = this._time = this._cycle = 0),
(this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0),
(0 !== m || (0 === v && g > 0)) && ((n = "onReverseComplete"), (r = this._reversed)),
0 > t && ((this._active = !1), 0 === v && (this._initted || !this.vars.lazy || i) && (g >= 0 && (i = !0), (this._rawPrevTime = d = !e || t || g === t ? t : o))),
this._initted || (i = !0))
: ((this._totalTime = this._time = t),
0 !== this._repeat &&
((l = v + this._repeatDelay),
(this._cycle = (this._totalTime / l) >> 0),
0 !== this._cycle && this._cycle === this._totalTime / l && this._cycle--,
(this._time = this._totalTime - this._cycle * l),
this._yoyo && 0 !== (1 & this._cycle) && (this._time = v - this._time),
this._time > v ? (this._time = v) : this._time < 0 && (this._time = 0)),
this._easeType
? ((h = this._time / v),
(c = this._easeType),
(u = this._easePower),
(1 === c || (3 === c && h >= 0.5)) && (h = 1 - h),
3 === c && (h *= 2),
1 === u ? (h *= h) : 2 === u ? (h *= h * h) : 3 === u ? (h *= h * h * h) : 4 === u && (h *= h * h * h * h),
1 === c ? (this.ratio = 1 - h) : 2 === c ? (this.ratio = h) : this._time / v < 0.5 ? (this.ratio = h / 2) : (this.ratio = 1 - h / 2))
: (this.ratio = this._ease.getRatio(this._time / v))),
p === this._time && !i && _ === this._cycle)
)
return void (m !== this._totalTime && this._onUpdate && (e || this._callback("onUpdate")));
if (!this._initted) {
if ((this._init(), !this._initted || this._gc)) return;
if (!i && this._firstPT && ((this.vars.lazy !== !1 && this._duration) || (this.vars.lazy && !this._duration)))
return (this._time = p), (this._totalTime = m), (this._rawPrevTime = g), (this._cycle = _), a.lazyTweens.push(this), void (this._lazy = [t, e]);
this._time && !r ? (this.ratio = this._ease.getRatio(this._time / v)) : 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 !== p && t >= 0 && (this._active = !0)),
0 === m &&
(2 === this._initted && t > 0 && this._init(),
this._startAt && (t >= 0 ? this._startAt.render(t, e, i) : n || (n = "_dummyGS")),
this.vars.onStart && (0 !== this._totalTime || 0 === v) && (e || this._callback("onStart"))),
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 > t && this._startAt && this._startTime && this._startAt.render(t, e, i), e || ((this._totalTime !== m || r) && this._callback("onUpdate"))),
this._cycle !== _ && (e || this._gc || (this.vars.onRepeat && this._callback("onRepeat"))),
n &&
(!this._gc || i) &&
(0 > t && this._startAt && !this._onUpdate && this._startTime && this._startAt.render(t, e, i),
r && (this._timeline.autoRemoveChildren && this._enabled(!1, !1), (this._active = !1)),
!e && this.vars[n] && this._callback(n),
0 === v && this._rawPrevTime === o && d !== o && (this._rawPrevTime = 0));
}),
(s.to = function (t, e, i) {
return new s(t, e, i);
}),
(s.from = function (t, e, i) {
return (i.runBackwards = !0), (i.immediateRender = 0 != i.immediateRender), new s(t, e, i);
}),
(s.fromTo = function (t, e, i, r) {
return (r.startAt = i), (r.immediateRender = 0 != r.immediateRender && 0 != i.immediateRender), new s(t, e, r);
}),
(s.staggerTo = s.allTo = function (t, e, o, a, c, d, f) {
a = a || 0;
var p,
m,
_,
v,
g = 0,
y = [],
b = function () {
o.onComplete && o.onComplete.apply(o.onCompleteScope || this, arguments), c.apply(f || o.callbackScope || this, d || u);
},
x = o.cycle,
w = o.startAt && o.startAt.cycle;
for (h(t) || ("string" == typeof t && (t = i.selector(t) || t), l(t) && (t = r(t))), t = t || [], 0 > a && ((t = r(t)), t.reverse(), (a *= -1)), p = t.length - 1, _ = 0; p >= _; _++) {
m = {};
for (v in o) m[v] = o[v];
if ((x && n(m, t, _), w)) {
w = m.startAt = {};
for (v in o.startAt) w[v] = o.startAt[v];
n(m.startAt, t, _);
}
(m.delay = g + (m.delay || 0)), _ === p && c && (m.onComplete = b), (y[_] = new s(t[_], e, m)), (g += a);
}
return y;
}),
(s.staggerFrom = s.allFrom = function (t, e, i, r, n, o, a) {
return (i.runBackwards = !0), (i.immediateRender = 0 != i.immediateRender), s.staggerTo(t, e, i, r, n, o, a);
}),
(s.staggerFromTo = s.allFromTo = function (t, e, i, r, n, o, a, l) {
return (r.startAt = i), (r.immediateRender = 0 != r.immediateRender && 0 != i.immediateRender), s.staggerTo(t, e, r, n, o, a, l);
}),
(s.delayedCall = function (t, e, i, r, n) {
return new s(e, 0, { delay: t, onComplete: e, onCompleteParams: i, callbackScope: r, onReverseComplete: e, onReverseCompleteParams: i, immediateRender: !1, useFrames: n, overwrite: 0 });
}),
(s.set = function (t, e) {
return new s(t, 0, e);
}),
(s.isTweening = function (t) {
return i.getTweensOf(t, !0).length > 0;
});
var d = function (t, e) {
for (var r = [], n = 0, s = t._first; s; ) s instanceof i ? (r[n++] = s) : (e && (r[n++] = s), (r = r.concat(d(s, e))), (n = r.length)), (s = s._next);
return r;
},
f = (s.getAllTweens = function (e) {
return d(t._rootTimeline, e).concat(d(t._rootFramesTimeline, e));
});
(s.killAll = function (t, i, r, n) {
null == i && (i = !0), null == r && (r = !0);
var s,
o,
a,
l = f(0 != n),
h = l.length,
c = i && r && n;
for (a = 0; h > a; a++) (o = l[a]), (c || o instanceof e || ((s = o.target === o.vars.onComplete) && r) || (i && !s)) && (t ? o.totalTime(o._reversed ? 0 : o.totalDuration()) : o._enabled(!1, !1));
}),
(s.killChildTweensOf = function (t, e) {
if (null != t) {
var n,
o,
c,
u,
d,
f = a.tweenLookup;
if (("string" == typeof t && (t = i.selector(t) || t), l(t) && (t = r(t)), h(t))) for (u = t.length; --u > -1; ) s.killChildTweensOf(t[u], e);
else {
n = [];
for (c in f) for (o = f[c].target.parentNode; o; ) o === t && (n = n.concat(f[c].tweens)), (o = o.parentNode);
for (d = n.length, u = 0; d > u; u++) e && n[u].totalTime(n[u].totalDuration()), n[u]._enabled(!1, !1);
}
}
});
var p = function (t, i, r, n) {
(i = i !== !1), (r = r !== !1), (n = n !== !1);
for (var s, o, a = f(n), l = i && r && n, h = a.length; --h > -1; ) (o = a[h]), (l || o instanceof e || ((s = o.target === o.vars.onComplete) && r) || (i && !s)) && o.paused(t);
};
return (
(s.pauseAll = function (t, e, i) {
p(!0, t, e, i);
}),
(s.resumeAll = function (t, e, i) {
p(!1, t, e, i);
}),
(s.globalTimeScale = function (e) {
var r = t._rootTimeline,
n = i.ticker.time;
return arguments.length
? ((e = e || o),
(r._startTime = n - ((n - r._startTime) * r._timeScale) / e),
(r = t._rootFramesTimeline),
(n = i.ticker.frame),
(r._startTime = n - ((n - r._startTime) * r._timeScale) / e),
(r._timeScale = t._rootTimeline._timeScale = e),
e)
: r._timeScale;
}),
(c.progress = function (t) {
return arguments.length ? this.totalTime(this.duration() * (this._yoyo && 0 !== (1 & this._cycle) ? 1 - t : t) + this._cycle * (this._duration + this._repeatDelay), !1) : this._time / this.duration();
}),
(c.totalProgress = function (t) {
return arguments.length ? this.totalTime(this.totalDuration() * t, !1) : this._totalTime / this.totalDuration();
}),
(c.time = function (t, e) {
return arguments.length
? (this._dirty && this.totalDuration(),
t > this._duration && (t = this._duration),
this._yoyo && 0 !== (1 & this._cycle) ? (t = this._duration - t + this._cycle * (this._duration + this._repeatDelay)) : 0 !== this._repeat && (t += this._cycle * (this._duration + this._repeatDelay)),
this.totalTime(t, e))
: this._time;
}),
(c.duration = function (e) {
return arguments.length ? t.prototype.duration.call(this, e) : this._duration;
}),
(c.totalDuration = function (t) {
return arguments.length
? -1 === this._repeat
? this
: this.duration((t - 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);
}),
(c.repeat = function (t) {
return arguments.length ? ((this._repeat = t), this._uncache(!0)) : this._repeat;
}),
(c.repeatDelay = function (t) {
return arguments.length ? ((this._repeatDelay = t), this._uncache(!0)) : this._repeatDelay;
}),
(c.yoyo = function (t) {
return arguments.length ? ((this._yoyo = t), this) : this._yoyo;
}),
s
);
},
!0
),
_gsScope._gsDefine(
"TimelineLite",
["core.Animation", "core.SimpleTimeline", "TweenLite"],
function (t, e, i) {
var r = function (t) {
e.call(this, t),
(this._labels = {}),
(this.autoRemoveChildren = this.vars.autoRemoveChildren === !0),
(this.smoothChildTiming = this.vars.smoothChildTiming === !0),
(this._sortChildren = !0),
(this._onUpdate = this.vars.onUpdate);
var i,
r,
n = this.vars;
for (r in n) (i = n[r]), l(i) && -1 !== i.join("").indexOf("{self}") && (n[r] = this._swapSelfInParams(i));
l(n.tweens) && this.add(n.tweens, 0, n.align, n.stagger);
},
n = 1e-10,
s = i._internals,
o = (r._internals = {}),
a = s.isSelector,
l = s.isArray,
h = s.lazyTweens,
c = s.lazyRender,
u = _gsScope._gsDefine.globals,
d = function (t) {
var e,
i = {};
for (e in t) i[e] = t[e];
return i;
},
f = function (t, e, i) {
var r,
n,
s = t.cycle;
for (r in s) (n = s[r]), (t[r] = "function" == typeof n ? n.call(e[i], i) : n[i % n.length]);
delete t.cycle;
},
p = (o.pauseCallback = function () {}),
m = function (t) {
var e,
i = [],
r = t.length;
for (e = 0; e !== r; i.push(t[e++]));
return i;
},
_ = (r.prototype = new e());
return (
(r.version = "1.18.2"),
(_.constructor = r),
(_.kill()._gc = _._forcingPlayhead = _._hasPause = !1),
(_.to = function (t, e, r, n) {
var s = (r.repeat && u.TweenMax) || i;
return e ? this.add(new s(t, e, r), n) : this.set(t, r, n);
}),
(_.from = function (t, e, r, n) {
return this.add(((r.repeat && u.TweenMax) || i).from(t, e, r), n);
}),
(_.fromTo = function (t, e, r, n, s) {
var o = (n.repeat && u.TweenMax) || i;
return e ? this.add(o.fromTo(t, e, r, n), s) : this.set(t, n, s);
}),
(_.staggerTo = function (t, e, n, s, o, l, h, c) {
var u,
p,
_ = new r({ onComplete: l, onCompleteParams: h, callbackScope: c, smoothChildTiming: this.smoothChildTiming }),
v = n.cycle;
for ("string" == typeof t && (t = i.selector(t) || t), t = t || [], a(t) && (t = m(t)), s = s || 0, 0 > s && ((t = m(t)), t.reverse(), (s *= -1)), p = 0; p < t.length; p++)
(u = d(n)), u.startAt && ((u.startAt = d(u.startAt)), u.startAt.cycle && f(u.startAt, t, p)), v && f(u, t, p), _.to(t[p], e, u, p * s);
return this.add(_, o);
}),
(_.staggerFrom = function (t, e, i, r, n, s, o, a) {
return (i.immediateRender = 0 != i.immediateRender), (i.runBackwards = !0), this.staggerTo(t, e, i, r, n, s, o, a);
}),
(_.staggerFromTo = function (t, e, i, r, n, s, o, a, l) {
return (r.startAt = i), (r.immediateRender = 0 != r.immediateRender && 0 != i.immediateRender), this.staggerTo(t, e, r, n, s, o, a, l);
}),
(_.call = function (t, e, r, n) {
return this.add(i.delayedCall(0, t, e, r), n);
}),
(_.set = function (t, e, r) {
return (r = this._parseTimeOrLabel(r, 0, !0)), null == e.immediateRender && (e.immediateRender = r === this._time && !this._paused), this.add(new i(t, 0, e), r);
}),
(r.exportRoot = function (t, e) {
(t = t || {}), null == t.smoothChildTiming && (t.smoothChildTiming = !0);
var n,
s,
o = new r(t),
a = o._timeline;
for (null == e && (e = !0), a._remove(o, !0), o._startTime = 0, o._rawPrevTime = o._time = o._totalTime = a._time, n = a._first; n; )
(s = n._next), (e && n instanceof i && n.target === n.vars.onComplete) || o.add(n, n._startTime - n._delay), (n = s);
return a.add(o, 0), o;
}),
(_.add = function (n, s, o, a) {
var h, c, u, d, f, p;
if (("number" != typeof s && (s = this._parseTimeOrLabel(s, 0, !0, n)), !(n instanceof t))) {
if (n instanceof Array || (n && n.push && l(n))) {
for (o = o || "normal", a = a || 0, h = s, c = n.length, u = 0; c > u; u++)
l((d = n[u])) && (d = new r({ tweens: d })),
this.add(d, h),
"string" != typeof d && "function" != typeof d && ("sequence" === o ? (h = d._startTime + d.totalDuration() / d._timeScale) : "start" === o && (d._startTime -= d.delay())),
(h += a);
return this._uncache(!0);
}
if ("string" == typeof n) return this.addLabel(n, s);
if ("function" != typeof n) throw "Cannot add " + n + " into the timeline; it is not a tween, timeline, function, or string.";
n = i.delayedCall(0, n);
}
if ((e.prototype.add.call(this, n, s), (this._gc || this._time === this._duration) && !this._paused && this._duration < this.duration()))
for (f = this, p = f.rawTime() > n._startTime; f._timeline; ) p && f._timeline.smoothChildTiming ? f.totalTime(f._totalTime, !0) : f._gc && f._enabled(!0, !1), (f = f._timeline);
return this;
}),
(_.remove = function (e) {
if (e instanceof t) {
this._remove(e, !1);
var i = (e._timeline = e.vars.useFrames ? t._rootFramesTimeline : t._rootTimeline);
return (e._startTime = (e._paused ? e._pauseTime : i._time) - (e._reversed ? e.totalDuration() - e._totalTime : e._totalTime) / e._timeScale), this;
}
if (e instanceof Array || (e && e.push && l(e))) {
for (var r = e.length; --r > -1; ) this.remove(e[r]);
return this;
}
return "string" == typeof e ? this.removeLabel(e) : this.kill(null, e);
}),
(_._remove = function (t, i) {
e.prototype._remove.call(this, t, i);
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
);
}),
(_.append = function (t, e) {
return this.add(t, this._parseTimeOrLabel(null, e, !0, t));
}),
(_.insert = _.insertMultiple = function (t, e, i, r) {
return this.add(t, e || 0, i, r);
}),
(_.appendMultiple = function (t, e, i, r) {
return this.add(t, this._parseTimeOrLabel(null, e, !0, t), i, r);
}),
(_.addLabel = function (t, e) {
return (this._labels[t] = this._parseTimeOrLabel(e)), this;
}),
(_.addPause = function (t, e, r, n) {
var s = i.delayedCall(0, p, r, n || this);
return (s.vars.onComplete = s.vars.onReverseComplete = e), (s.data = "isPause"), (this._hasPause = !0), this.add(s, t);
}),
(_.removeLabel = function (t) {
return delete this._labels[t], this;
}),
(_.getLabelTime = function (t) {
return null != this._labels[t] ? this._labels[t] : -1;
}),
(_._parseTimeOrLabel = function (e, i, r, n) {
var s;
if (n instanceof t && n.timeline === this) this.remove(n);
else if (n && (n instanceof Array || (n.push && l(n)))) for (s = n.length; --s > -1; ) n[s] instanceof t && n[s].timeline === this && this.remove(n[s]);
if ("string" == typeof i) return this._parseTimeOrLabel(i, r && "number" == typeof e && null == this._labels[i] ? e - this.duration() : 0, r);
if (((i = i || 0), "string" != typeof e || (!isNaN(e) && null == this._labels[e]))) null == e && (e = this.duration());
else {
if (((s = e.indexOf("=")), -1 === s)) return null == this._labels[e] ? (r ? (this._labels[e] = this.duration() + i) : i) : this._labels[e] + i;
(i = parseInt(e.charAt(s - 1) + "1", 10) * Number(e.substr(s + 1))), (e = s > 1 ? this._parseTimeOrLabel(e.substr(0, s - 1), 0, r) : this.duration());
}
return Number(e) + i;
}),
(_.seek = function (t, e) {
return this.totalTime("number" == typeof t ? t : this._parseTimeOrLabel(t), e !== !1);
}),
(_.stop = function () {
return this.paused(!0);
}),
(_.gotoAndPlay = function (t, e) {
return this.play(t, e);
}),
(_.gotoAndStop = function (t, e) {
return this.pause(t, e);
}),
(_.render = function (t, e, i) {
this._gc && this._enabled(!0, !1);
var r,
s,
o,
a,
l,
u,
d,
f = this._dirty ? this.totalDuration() : this._totalDuration,
p = this._time,
m = this._startTime,
_ = this._timeScale,
v = this._paused;
if (t >= f - 1e-7)
(this._totalTime = this._time = f),
this._reversed ||
this._hasPausedChild() ||
((s = !0),
(a = "onComplete"),
(l = !!this._timeline.autoRemoveChildren),
0 === this._duration &&
((0 >= t && t >= -1e-7) || this._rawPrevTime < 0 || this._rawPrevTime === n) &&
this._rawPrevTime !== t &&
this._first &&
((l = !0), this._rawPrevTime > n && (a = "onReverseComplete"))),
(this._rawPrevTime = this._duration || !e || t || this._rawPrevTime === t ? t : n),
(t = f + 1e-4);
else if (1e-7 > t)
if (
((this._totalTime = this._time = 0),
(0 !== p || (0 === this._duration && this._rawPrevTime !== n && (this._rawPrevTime > 0 || (0 > t && this._rawPrevTime >= 0)))) && ((a = "onReverseComplete"), (s = this._reversed)),
0 > t)
)
(this._active = !1), this._timeline.autoRemoveChildren && this._reversed ? ((l = s = !0), (a = "onReverseComplete")) : this._rawPrevTime >= 0 && this._first && (l = !0), (this._rawPrevTime = t);
else {
if (((this._rawPrevTime = this._duration || !e || t || this._rawPrevTime === t ? t : n), 0 === t && s)) for (r = this._first; r && 0 === r._startTime; ) r._duration || (s = !1), (r = r._next);
(t = 0), this._initted || (l = !0);
}
else {
if (this._hasPause && !this._forcingPlayhead && !e) {
if (t >= p) for (r = this._first; r && r._startTime <= t && !u; ) r._duration || "isPause" !== r.data || r.ratio || (0 === r._startTime && 0 === this._rawPrevTime) || (u = r), (r = r._next);
else for (r = this._last; r && r._startTime >= t && !u; ) r._duration || ("isPause" === r.data && r._rawPrevTime > 0 && (u = r)), (r = r._prev);
u && ((this._time = t = u._startTime), (this._totalTime = t + this._cycle * (this._totalDuration + this._repeatDelay)));
}
this._totalTime = this._time = this._rawPrevTime = t;
}
if ((this._time !== p && this._first) || i || l || u) {
if (
(this._initted || (this._initted = !0),
this._active || (!this._paused && this._time !== p && t > 0 && (this._active = !0)),
0 === p && this.vars.onStart && 0 !== this._time && (e || this._callback("onStart")),
(d = this._time),
d >= p)
)
for (r = this._first; r && ((o = r._next), d === this._time && (!this._paused || v)); )
(r._active || (r._startTime <= d && !r._paused && !r._gc)) &&
(u === r && this.pause(), r._reversed ? r.render((r._dirty ? r.totalDuration() : r._totalDuration) - (t - r._startTime) * r._timeScale, e, i) : r.render((t - r._startTime) * r._timeScale, e, i)),
(r = o);
else
for (r = this._last; r && ((o = r._prev), d === this._time && (!this._paused || v)); ) {
if (r._active || (r._startTime <= p && !r._paused && !r._gc)) {
if (u === r) {
for (u = r._prev; u && u.endTime() > this._time; ) u.render(u._reversed ? u.totalDuration() - (t - u._startTime) * u._timeScale : (t - u._startTime) * u._timeScale, e, i), (u = u._prev);
(u = null), this.pause();
}
r._reversed ? r.render((r._dirty ? r.totalDuration() : r._totalDuration) - (t - r._startTime) * r._timeScale, e, i) : r.render((t - r._startTime) * r._timeScale, e, i);
}
r = o;
}
this._onUpdate && (e || (h.length && c(), this._callback("onUpdate"))),
a &&
(this._gc ||
((m === this._startTime || _ !== this._timeScale) &&
(0 === this._time || f >= this.totalDuration()) &&
(s && (h.length && c(), this._timeline.autoRemoveChildren && this._enabled(!1, !1), (this._active = !1)), !e && this.vars[a] && this._callback(a))));
}
}),
(_._hasPausedChild = function () {
for (var t = this._first; t; ) {
if (t._paused || (t instanceof r && t._hasPausedChild())) return !0;
t = t._next;
}
return !1;
}),
(_.getChildren = function (t, e, r, n) {
n = n || -9999999999;
for (var s = [], o = this._first, a = 0; o; )
o._startTime < n || (o instanceof i ? e !== !1 && (s[a++] = o) : (r !== !1 && (s[a++] = o), t !== !1 && ((s = s.concat(o.getChildren(!0, e, r))), (a = s.length)))), (o = o._next);
return s;
}),
(_.getTweensOf = function (t, e) {
var r,
n,
s = this._gc,
o = [],
a = 0;
for (s && this._enabled(!0, !0), r = i.getTweensOf(t), n = r.length; --n > -1; ) (r[n].timeline === this || (e && this._contains(r[n]))) && (o[a++] = r[n]);
return s && this._enabled(!1, !0), o;
}),
(_.recent = function () {
return this._recent;
}),
(_._contains = function (t) {
for (var e = t.timeline; e; ) {
if (e === this) return !0;
e = e.timeline;
}
return !1;
}),
(_.shiftChildren = function (t, e, i) {
i = i || 0;
for (var r, n = this._first, s = this._labels; n; ) n._startTime >= i && (n._startTime += t), (n = n._next);
if (e) for (r in s) s[r] >= i && (s[r] += t);
return this._uncache(!0);
}),
(_._kill = function (t, e) {
if (!t && !e) return this._enabled(!1, !1);
for (var i = e ? this.getTweensOf(e) : this.getChildren(!0, !0, !1), r = i.length, n = !1; --r > -1; ) i[r]._kill(t, e) && (n = !0);
return n;
}),
(_.clear = function (t) {
var e = this.getChildren(!1, !0, !0),
i = e.length;
for (this._time = this._totalTime = 0; --i > -1; ) e[i]._enabled(!1, !1);
return t !== !1 && (this._labels = {}), this._uncache(!0);
}),
(_.invalidate = function () {
for (var e = this._first; e; ) e.invalidate(), (e = e._next);
return t.prototype.invalidate.call(this);
}),
(_._enabled = function (t, i) {
if (t === this._gc) for (var r = this._first; r; ) r._enabled(t, !0), (r = r._next);
return e.prototype._enabled.call(this, t, i);
}),
(_.totalTime = function (e, i, r) {
this._forcingPlayhead = !0;
var n = t.prototype.totalTime.apply(this, arguments);
return (this._forcingPlayhead = !1), n;
}),
(_.duration = function (t) {
return arguments.length ? (0 !== this.duration() && 0 !== t && this.timeScale(this._duration / t), this) : (this._dirty && this.totalDuration(), this._duration);
}),
(_.totalDuration = function (t) {
if (!arguments.length) {
if (this._dirty) {
for (var e, i, r = 0, n = this._last, s = 999999999999; n; )
(e = n._prev),
n._dirty && n.totalDuration(),
n._startTime > s && this._sortChildren && !n._paused ? this.add(n, n._startTime - n._delay) : (s = n._startTime),
n._startTime < 0 &&
!n._paused &&
((r -= n._startTime), this._timeline.smoothChildTiming && (this._startTime += n._startTime / this._timeScale), this.shiftChildren(-n._startTime, !1, -9999999999), (s = 0)),
(i = n._startTime + n._totalDuration / n._timeScale),
i > r && (r = i),
(n = e);
(this._duration = this._totalDuration = r), (this._dirty = !1);
}
return this._totalDuration;
}
return t && this.totalDuration() ? this.timeScale(this._totalDuration / t) : this;
}),
(_.paused = function (e) {
if (!e) for (var i = this._first, r = this._time; i; ) i._startTime === r && "isPause" === i.data && (i._rawPrevTime = 0), (i = i._next);
return t.prototype.paused.apply(this, arguments);
}),
(_.usesFrames = function () {
for (var e = this._timeline; e._timeline; ) e = e._timeline;
return e === t._rootFramesTimeline;
}),
(_.rawTime = function () {
return this._paused ? this._totalTime : (this._timeline.rawTime() - this._startTime) * this._timeScale;
}),
r
);
},
!0
),
_gsScope._gsDefine(
"TimelineMax",
["TimelineLite", "TweenLite", "easing.Ease"],
function (t, e, i) {
var r = function (e) {
t.call(this, e), (this._repeat = this.vars.repeat || 0), (this._repeatDelay = this.vars.repeatDelay || 0), (this._cycle = 0), (this._yoyo = this.vars.yoyo === !0), (this._dirty = !0);
},
n = 1e-10,
s = e._internals,
o = s.lazyTweens,
a = s.lazyRender,
l = new i(null, null, 1, 0),
h = (r.prototype = new t());
return (
(h.constructor = r),
(h.kill()._gc = !1),
(r.version = "1.18.2"),
(h.invalidate = function () {
return (this._yoyo = this.vars.yoyo === !0), (this._repeat = this.vars.repeat || 0), (this._repeatDelay = this.vars.repeatDelay || 0), this._uncache(!0), t.prototype.invalidate.call(this);
}),
(h.addCallback = function (t, i, r, n) {
return this.add(e.delayedCall(0, t, r, n), i);
}),
(h.removeCallback = function (t, e) {
if (t)
if (null == e) this._kill(null, t);
else for (var i = this.getTweensOf(t, !1), r = i.length, n = this._parseTimeOrLabel(e); --r > -1; ) i[r]._startTime === n && i[r]._enabled(!1, !1);
return this;
}),
(h.removePause = function (e) {
return this.removeCallback(t._internals.pauseCallback, e);
}),
(h.tweenTo = function (t, i) {
i = i || {};
var r,
n,
s,
o = { ease: l, useFrames: this.usesFrames(), immediateRender: !1 };
for (n in i) o[n] = i[n];
return (
(o.time = this._parseTimeOrLabel(t)),
(r = Math.abs(Number(o.time) - this._time) / this._timeScale || 0.001),
(s = new e(this, r, o)),
(o.onStart = function () {
s.target.paused(!0), s.vars.time !== s.target.time() && r === s.duration() && s.duration(Math.abs(s.vars.time - s.target.time()) / s.target._timeScale), i.onStart && s._callback("onStart");
}),
s
);
}),
(h.tweenFromTo = function (t, e, i) {
(i = i || {}), (t = this._parseTimeOrLabel(t)), (i.startAt = { onComplete: this.seek, onCompleteParams: [t], callbackScope: this }), (i.immediateRender = i.immediateRender !== !1);
var r = this.tweenTo(e, i);
return r.duration(Math.abs(r.vars.time - t) / this._timeScale || 0.001);
}),
(h.render = function (t, e, i) {
this._gc && this._enabled(!0, !1);
var r,
s,
l,
h,
c,
u,
d,
f,
p = this._dirty ? this.totalDuration() : this._totalDuration,
m = this._duration,
_ = this._time,
v = this._totalTime,
g = this._startTime,
y = this._timeScale,
b = this._rawPrevTime,
x = this._paused,
w = this._cycle;
if (t >= p - 1e-7)
this._locked || ((this._totalTime = p), (this._cycle = this._repeat)),
this._reversed ||
this._hasPausedChild() ||
((s = !0),
(h = "onComplete"),
(c = !!this._timeline.autoRemoveChildren),
0 === this._duration && ((0 >= t && t >= -1e-7) || 0 > b || b === n) && b !== t && this._first && ((c = !0), b > n && (h = "onReverseComplete"))),
(this._rawPrevTime = this._duration || !e || t || this._rawPrevTime === t ? t : n),
this._yoyo && 0 !== (1 & this._cycle) ? (this._time = t = 0) : ((this._time = m), (t = m + 1e-4));
else if (1e-7 > t)
if (
(this._locked || (this._totalTime = this._cycle = 0),
(this._time = 0),
(0 !== _ || (0 === m && b !== n && (b > 0 || (0 > t && b >= 0)) && !this._locked)) && ((h = "onReverseComplete"), (s = this._reversed)),
0 > t)
)
(this._active = !1), this._timeline.autoRemoveChildren && this._reversed ? ((c = s = !0), (h = "onReverseComplete")) : b >= 0 && this._first && (c = !0), (this._rawPrevTime = t);
else {
if (((this._rawPrevTime = m || !e || t || this._rawPrevTime === t ? t : n), 0 === t && s)) for (r = this._first; r && 0 === r._startTime; ) r._duration || (s = !1), (r = r._next);
(t = 0), this._initted || (c = !0);
}
else if (
(0 === m && 0 > b && (c = !0),
(this._time = this._rawPrevTime = t),
this._locked ||
((this._totalTime = t),
0 !== this._repeat &&
((u = m + this._repeatDelay),
(this._cycle = (this._totalTime / u) >> 0),
0 !== this._cycle && this._cycle === this._totalTime / u && this._cycle--,
(this._time = this._totalTime - this._cycle * u),
this._yoyo && 0 !== (1 & this._cycle) && (this._time = m - this._time),
this._time > m ? ((this._time = m), (t = m + 1e-4)) : this._time < 0 ? (this._time = t = 0) : (t = this._time))),
this._hasPause && !this._forcingPlayhead && !e)
) {
if (((t = this._time), t >= _)) for (r = this._first; r && r._startTime <= t && !d; ) r._duration || "isPause" !== r.data || r.ratio || (0 === r._startTime && 0 === this._rawPrevTime) || (d = r), (r = r._next);
else for (r = this._last; r && r._startTime >= t && !d; ) r._duration || ("isPause" === r.data && r._rawPrevTime > 0 && (d = r)), (r = r._prev);
d && ((this._time = t = d._startTime), (this._totalTime = t + this._cycle * (this._totalDuration + this._repeatDelay)));
}
if (this._cycle !== w && !this._locked) {
var T = this._yoyo && 0 !== (1 & w),
E = T === (this._yoyo && 0 !== (1 & this._cycle)),
C = this._totalTime,
S = this._cycle,
R = this._rawPrevTime,
k = this._time;
if (
((this._totalTime = w * m),
this._cycle < w ? (T = !T) : (this._totalTime += m),
(this._time = _),
(this._rawPrevTime = 0 === m ? b - 1e-4 : b),
(this._cycle = w),
(this._locked = !0),
(_ = T ? 0 : m),
this.render(_, e, 0 === m),
e || this._gc || (this.vars.onRepeat && this._callback("onRepeat")),
_ !== this._time)
)
return;
if ((E && ((_ = T ? m + 1e-4 : -1e-4), this.render(_, !0, !1)), (this._locked = !1), this._paused && !x)) return;
(this._time = k), (this._totalTime = C), (this._cycle = S), (this._rawPrevTime = R);
}
if (!((this._time !== _ && this._first) || i || c || d)) return void (v !== this._totalTime && this._onUpdate && (e || this._callback("onUpdate")));
if (
(this._initted || (this._initted = !0),
this._active || (!this._paused && this._totalTime !== v && t > 0 && (this._active = !0)),
0 === v && this.vars.onStart && 0 !== this._totalTime && (e || this._callback("onStart")),
(f = this._time),
f >= _)
)
for (r = this._first; r && ((l = r._next), f === this._time && (!this._paused || x)); )
(r._active || (r._startTime <= this._time && !r._paused && !r._gc)) &&
(d === r && this.pause(), r._reversed ? r.render((r._dirty ? r.totalDuration() : r._totalDuration) - (t - r._startTime) * r._timeScale, e, i) : r.render((t - r._startTime) * r._timeScale, e, i)),
(r = l);
else
for (r = this._last; r && ((l = r._prev), f === this._time && (!this._paused || x)); ) {
if (r._active || (r._startTime <= _ && !r._paused && !r._gc)) {
if (d === r) {
for (d = r._prev; d && d.endTime() > this._time; ) d.render(d._reversed ? d.totalDuration() - (t - d._startTime) * d._timeScale : (t - d._startTime) * d._timeScale, e, i), (d = d._prev);
(d = null), this.pause();
}
r._reversed ? r.render((r._dirty ? r.totalDuration() : r._totalDuration) - (t - r._startTime) * r._timeScale, e, i) : r.render((t - r._startTime) * r._timeScale, e, i);
}
r = l;
}
this._onUpdate && (e || (o.length && a(), this._callback("onUpdate"))),
h &&
(this._locked ||
this._gc ||
((g === this._startTime || y !== this._timeScale) &&
(0 === this._time || p >= this.totalDuration()) &&
(s && (o.length && a(), this._timeline.autoRemoveChildren && this._enabled(!1, !1), (this._active = !1)), !e && this.vars[h] && this._callback(h))));
}),
(h.getActive = function (t, e, i) {
null == t && (t = !0), null == e && (e = !0), null == i && (i = !1);
var r,
n,
s = [],
o = this.getChildren(t, e, i),
a = 0,
l = o.length;
for (r = 0; l > r; r++) (n = o[r]), n.isActive() && (s[a++] = n);
return s;
}),
(h.getLabelAfter = function (t) {
t || (0 !== t && (t = this._time));
var e,
i = this.getLabelsArray(),
r = i.length;
for (e = 0; r > e; e++) if (i[e].time > t) return i[e].name;
return null;
}),
(h.getLabelBefore = function (t) {
null == t && (t = this._time);
for (var e = this.getLabelsArray(), i = e.length; --i > -1; ) if (e[i].time < t) return e[i].name;
return null;
}),
(h.getLabelsArray = function () {
var t,
e = [],
i = 0;
for (t in this._labels) e[i++] = { time: this._labels[t], name: t };
return (
e.sort(function (t, e) {
return t.time - e.time;
}),
e
);
}),
(h.progress = function (t, e) {
return arguments.length ? this.totalTime(this.duration() * (this._yoyo && 0 !== (1 & this._cycle) ? 1 - t : t) + this._cycle * (this._duration + this._repeatDelay), e) : this._time / this.duration();
}),
(h.totalProgress = function (t, e) {
return arguments.length ? this.totalTime(this.totalDuration() * t, e) : this._totalTime / this.totalDuration();
}),
(h.totalDuration = function (e) {
return arguments.length
? -1 !== this._repeat && e
? this.timeScale(this.totalDuration() / e)
: this
: (this._dirty && (t.prototype.totalDuration.call(this), (this._totalDuration = -1 === this._repeat ? 999999999999 : this._duration * (this._repeat + 1) + this._repeatDelay * this._repeat)), this._totalDuration);
}),
(h.time = function (t, e) {
return arguments.length
? (this._dirty && this.totalDuration(),
t > this._duration && (t = this._duration),
this._yoyo && 0 !== (1 & this._cycle) ? (t = this._duration - t + this._cycle * (this._duration + this._repeatDelay)) : 0 !== this._repeat && (t += this._cycle * (this._duration + this._repeatDelay)),
this.totalTime(t, e))
: this._time;
}),
(h.repeat = function (t) {
return arguments.length ? ((this._repeat = t), this._uncache(!0)) : this._repeat;
}),
(h.repeatDelay = function (t) {
return arguments.length ? ((this._repeatDelay = t), this._uncache(!0)) : this._repeatDelay;
}),
(h.yoyo = function (t) {
return arguments.length ? ((this._yoyo = t), this) : this._yoyo;
}),
(h.currentLabel = function (t) {
return arguments.length ? this.seek(t, !0) : this.getLabelBefore(this._time + 1e-8);
}),
r
);
},
!0
),
(function () {
var t = 180 / Math.PI,
e = [],
i = [],
r = [],
n = {},
s = _gsScope._gsDefine.globals,
o = function (t, e, i, r) {
(this.a = t), (this.b = e), (this.c = i), (this.d = r), (this.da = r - t), (this.ca = i - t), (this.ba = e - t);
},
a = ",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,",
l = function (t, e, i, r) {
var n = { a: t },
s = {},
o = {},
a = { c: r },
l = (t + e) / 2,
h = (e + i) / 2,
c = (i + r) / 2,
u = (l + h) / 2,
d = (h + c) / 2,
f = (d - u) / 8;
return (n.b = l + (t - l) / 4), (s.b = u + f), (n.c = s.a = (n.b + s.b) / 2), (s.c = o.a = (u + d) / 2), (o.b = d - f), (a.b = c + (r - c) / 4), (o.c = a.a = (o.b + a.b) / 2), [n, s, o, a];
},
h = function (t, n, s, o, a) {
var h,
c,
u,
d,
f,
p,
m,
_,
v,
g,
y,
b,
x,
w = t.length - 1,
T = 0,
E = t[0].a;
for (h = 0; w > h; h++)
(f = t[T]),
(c = f.a),
(u = f.d),
(d = t[T + 1].d),
a
? ((y = e[h]),
(b = i[h]),
(x = ((b + y) * n * 0.25) / (o ? 0.5 : r[h] || 0.5)),
(p = u - (u - c) * (o ? 0.5 * n : 0 !== y ? x / y : 0)),
(m = u + (d - u) * (o ? 0.5 * n : 0 !== b ? x / b : 0)),
(_ = u - (p + (((m - p) * ((3 * y) / (y + b) + 0.5)) / 4 || 0))))
: ((p = u - (u - c) * n * 0.5), (m = u + (d - u) * n * 0.5), (_ = u - (p + m) / 2)),
(p += _),
(m += _),
(f.c = v = p),
0 !== h ? (f.b = E) : (f.b = E = f.a + 0.6 * (f.c - f.a)),
(f.da = u - c),
(f.ca = v - c),
(f.ba = E - c),
s ? ((g = l(c, E, v, u)), t.splice(T, 1, g[0], g[1], g[2], g[3]), (T += 4)) : T++,
(E = m);
(f = t[T]), (f.b = E), (f.c = E + 0.4 * (f.d - E)), (f.da = f.d - f.a), (f.ca = f.c - f.a), (f.ba = E - f.a), s && ((g = l(f.a, E, f.c, f.d)), t.splice(T, 1, g[0], g[1], g[2], g[3]));
},
c = function (t, r, n, s) {
var a,
l,
h,
c,
u,
d,
f = [];
if (s) for (t = [s].concat(t), l = t.length; --l > -1; ) "string" == typeof (d = t[l][r]) && "=" === d.charAt(1) && (t[l][r] = s[r] + Number(d.charAt(0) + d.substr(2)));
if (((a = t.length - 2), 0 > a)) return (f[0] = new o(t[0][r], 0, 0, t[-1 > a ? 0 : 1][r])), f;
for (l = 0; a > l; l++) (h = t[l][r]), (c = t[l + 1][r]), (f[l] = new o(h, 0, 0, c)), n && ((u = t[l + 2][r]), (e[l] = (e[l] || 0) + (c - h) * (c - h)), (i[l] = (i[l] || 0) + (u - c) * (u - c)));
return (f[l] = new o(t[l][r], 0, 0, t[l + 1][r])), f;
},
u = function (t, s, o, l, u, d) {
var f,
p,
m,
_,
v,
g,
y,
b,
x = {},
w = [],
T = d || t[0];
(u = "string" == typeof u ? "," + u + "," : a), null == s && (s = 1);
for (p in t[0]) w.push(p);
if (t.length > 1) {
for (b = t[t.length - 1], y = !0, f = w.length; --f > -1; )
if (((p = w[f]), Math.abs(T[p] - b[p]) > 0.05)) {
y = !1;
break;
}
y && ((t = t.concat()), d && t.unshift(d), t.push(t[1]), (d = t[t.length - 3]));
}
for (e.length = i.length = r.length = 0, f = w.length; --f > -1; ) (p = w[f]), (n[p] = -1 !== u.indexOf("," + p + ",")), (x[p] = c(t, p, n[p], d));
for (f = e.length; --f > -1; ) (e[f] = Math.sqrt(e[f])), (i[f] = Math.sqrt(i[f]));
if (!l) {
for (f = w.length; --f > -1; ) if (n[p]) for (m = x[w[f]], g = m.length - 1, _ = 0; g > _; _++) (v = m[_ + 1].da / i[_] + m[_].da / e[_]), (r[_] = (r[_] || 0) + v * v);
for (f = r.length; --f > -1; ) r[f] = Math.sqrt(r[f]);
}
for (f = w.length, _ = o ? 4 : 1; --f > -1; ) (p = w[f]), (m = x[p]), h(m, s, o, l, n[p]), y && (m.splice(0, _), m.splice(m.length - _, _));
return x;
},
d = function (t, e, i) {
e = e || "soft";
var r,
n,
s,
a,
l,
h,
c,
u,
d,
f,
p,
m = {},
_ = "cubic" === e ? 3 : 2,
v = "soft" === e,
g = [];
if ((v && i && (t = [i].concat(t)), null == t || t.length < _ + 1)) throw "invalid Bezier data";
for (d in t[0]) g.push(d);
for (h = g.length; --h > -1; ) {
for (d = g[h], m[d] = l = [], f = 0, u = t.length, c = 0; u > c; c++)
(r = null == i ? t[c][d] : "string" == typeof (p = t[c][d]) && "=" === p.charAt(1) ? i[d] + Number(p.charAt(0) + p.substr(2)) : Number(p)), v && c > 1 && u - 1 > c && (l[f++] = (r + l[f - 2]) / 2), (l[f++] = r);
for (u = f - _ + 1, f = 0, c = 0; u > c; c += _) (r = l[c]), (n = l[c + 1]), (s = l[c + 2]), (a = 2 === _ ? 0 : l[c + 3]), (l[f++] = p = 3 === _ ? new o(r, n, s, a) : new o(r, (2 * n + r) / 3, (2 * n + s) / 3, s));
l.length = f;
}
return m;
},
f = function (t, e, i) {
for (var r, n, s, o, a, l, h, c, u, d, f, p = 1 / i, m = t.length; --m > -1; )
for (d = t[m], s = d.a, o = d.d - s, a = d.c - s, l = d.b - s, r = n = 0, c = 1; i >= c; c++)
(h = p * c), (u = 1 - h), (r = n - (n = (h * h * o + 3 * u * (h * a + u * l)) * h)), (f = m * i + c - 1), (e[f] = (e[f] || 0) + r * r);
},
p = function (t, e) {
e = e >> 0 || 6;
var i,
r,
n,
s,
o = [],
a = [],
l = 0,
h = 0,
c = e - 1,
u = [],
d = [];
for (i in t) f(t[i], o, e);
for (n = o.length, r = 0; n > r; r++) (l += Math.sqrt(o[r])), (s = r % e), (d[s] = l), s === c && ((h += l), (s = (r / e) >> 0), (u[s] = d), (a[s] = h), (l = 0), (d = []));
return { length: h, lengths: a, segments: u };
},
m = _gsScope._gsDefine.plugin({
propName: "bezier",
priority: -1,
version: "1.3.4",
API: 2,
global: !0,
init: function (t, e, i) {
(this._target = t), e instanceof Array && (e = { values: e }), (this._func = {}), (this._round = {}), (this._props = []), (this._timeRes = null == e.timeResolution ? 6 : parseInt(e.timeResolution, 10));
var r,
n,
s,
o,
a,
l = e.values || [],
h = {},
c = l[0],
f = e.autoRotate || i.vars.orientToBezier;
this._autoRotate = f ? (f instanceof Array ? f : [["x", "y", "rotation", f === !0 ? 0 : Number(f) || 0]]) : null;
for (r in c) this._props.push(r);
for (s = this._props.length; --s > -1; )
(r = this._props[s]),
this._overwriteProps.push(r),
(n = this._func[r] = "function" == typeof t[r]),
(h[r] = n ? t[r.indexOf("set") || "function" != typeof t["get" + r.substr(3)] ? r : "get" + r.substr(3)]() : parseFloat(t[r])),
a || (h[r] !== l[0][r] && (a = h));
if (
((this._beziers = "cubic" !== e.type && "quadratic" !== e.type && "soft" !== e.type ? u(l, isNaN(e.curviness) ? 1 : e.curviness, !1, "thruBasic" === e.type, e.correlate, a) : d(l, e.type, h)),
(this._segCount = this._beziers[r].length),
this._timeRes)
) {
var m = p(this._beziers, this._timeRes);
(this._length = m.length),
(this._lengths = m.lengths),
(this._segments = m.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 ((f = this._autoRotate))
for (this._initialRotations = [], f[0] instanceof Array || (this._autoRotate = f = [f]), s = f.length; --s > -1; ) {
for (o = 0; 3 > o; o++) (r = f[s][o]), (this._func[r] = "function" == typeof t[r] && t[r.indexOf("set") || "function" != typeof t["get" + r.substr(3)] ? r : "get" + r.substr(3)]);
(r = f[s][2]), (this._initialRotations[s] = this._func[r] ? this._func[r].call(this._target) : this._target[r]);
}
return (this._startRatio = i.vars.runBackwards ? 1 : 0), !0;
},
set: function (e) {
var i,
r,
n,
s,
o,
a,
l,
h,
c,
u,
d = this._segCount,
f = this._func,
p = this._target,
m = e !== this._startRatio;
if (this._timeRes) {
if (((c = this._lengths), (u = this._curSeg), (e *= this._length), (n = this._li), e > this._l2 && d - 1 > n)) {
for (h = d - 1; h > n && (this._l2 = c[++n]) <= e; );
(this._l1 = c[n - 1]), (this._li = n), (this._curSeg = u = this._segments[n]), (this._s2 = u[(this._s1 = this._si = 0)]);
} else if (e < this._l1 && n > 0) {
for (; n > 0 && (this._l1 = c[--n]) >= e; );
0 === n && e < this._l1 ? (this._l1 = 0) : n++, (this._l2 = c[n]), (this._li = n), (this._curSeg = u = this._segments[n]), (this._s1 = u[(this._si = u.length - 1) - 1] || 0), (this._s2 = u[this._si]);
}
if (((i = n), (e -= this._l1), (n = this._si), e > this._s2 && n < u.length - 1)) {
for (h = u.length - 1; h > n && (this._s2 = u[++n]) <= e; );
(this._s1 = u[n - 1]), (this._si = n);
} else if (e < this._s1 && n > 0) {
for (; n > 0 && (this._s1 = u[--n]) >= e; );
0 === n && e < this._s1 ? (this._s1 = 0) : n++, (this._s2 = u[n]), (this._si = n);
}
a = (n + (e - this._s1) / (this._s2 - this._s1)) * this._prec;
} else (i = 0 > e ? 0 : e >= 1 ? d - 1 : (d * e) >> 0), (a = (e - i * (1 / d)) * d);
for (r = 1 - a, n = this._props.length; --n > -1; )
(s = this._props[n]), (o = this._beziers[s][i]), (l = (a * a * o.da + 3 * r * (a * o.ca + r * o.ba)) * a + o.a), this._round[s] && (l = Math.round(l)), f[s] ? p[s](l) : (p[s] = l);
if (this._autoRotate) {
var _,
v,
g,
y,
b,
x,
w,
T = this._autoRotate;
for (n = T.length; --n > -1; )
(s = T[n][2]),
(x = T[n][3] || 0),
(w = T[n][4] === !0 ? 1 : t),
(o = this._beziers[T[n][0]]),
(_ = this._beziers[T[n][1]]),
o &&
_ &&
((o = o[i]),
(_ = _[i]),
(v = o.a + (o.b - o.a) * a),
(y = o.b + (o.c - o.b) * a),
(v += (y - v) * a),
(y += (o.c + (o.d - o.c) * a - y) * a),
(g = _.a + (_.b - _.a) * a),
(b = _.b + (_.c - _.b) * a),
(g += (b - g) * a),
(b += (_.c + (_.d - _.c) * a - b) * a),
(l = m ? Math.atan2(b - g, y - v) * w + x : this._initialRotations[n]),
f[s] ? p[s](l) : (p[s] = l));
}
},
}),
_ = m.prototype;
(m.bezierThrough = u),
(m.cubicToQuadratic = l),
(m._autoCSS = !0),
(m.quadraticToCubic = function (t, e, i) {
return new o(t, (2 * e + t) / 3, (2 * e + i) / 3, i);
}),
(m._cssRegister = function () {
var t = s.CSSPlugin;
if (t) {
var e = t._internals,
i = e._parseToProxy,
r = e._setPluginRatio,
n = e.CSSPropTween;
e._registerComplexSpecialProp("bezier", {
parser: function (t, e, s, o, a, l) {
e instanceof Array && (e = { values: e }), (l = new m());
var h,
c,
u,
d = e.values,
f = d.length - 1,
p = [],
_ = {};
if (0 > f) return a;
for (h = 0; f >= h; h++) (u = i(t, d[h], o, a, l, f !== h)), (p[h] = u.end);
for (c in e) _[c] = e[c];
return (
(_.values = p),
(a = new n(t, "bezier", 0, 0, u.pt, 2)),
(a.data = u),
(a.plugin = l),
(a.setRatio = r),
0 === _.autoRotate && (_.autoRotate = !0),
!_.autoRotate ||
_.autoRotate instanceof Array ||
((h = _.autoRotate === !0 ? 0 : Number(_.autoRotate)), (_.autoRotate = null != u.end.left ? [["left", "top", "rotation", h, !1]] : null != u.end.x && [["x", "y", "rotation", h, !1]])),
_.autoRotate && (o._transform || o._enableTransforms(!1), (u.autoRotate = o._target._gsTransform)),
l._onInitTween(u.proxy, _, o._tween),
a
);
},
});
}
}),
(_._roundProps = function (t, e) {
for (var i = this._overwriteProps, r = i.length; --r > -1; ) (t[i[r]] || t.bezier || t.bezierThrough) && (this._round[i[r]] = e);
}),
(_._kill = function (t) {
var e,
i,
r = this._props;
for (e in this._beziers) if (e in t) for (delete this._beziers[e], delete this._func[e], i = r.length; --i > -1; ) r[i] === e && r.splice(i, 1);
return this._super._kill.call(this, t);
});
})(),
_gsScope._gsDefine(
"plugins.CSSPlugin",
["plugins.TweenPlugin", "TweenLite"],
function (t, e) {
var i,
r,
n,
s,
o = function () {
t.call(this, "css"), (this._overwriteProps.length = 0), (this.setRatio = o.prototype.setRatio);
},
a = _gsScope._gsDefine.globals,
l = {},
h = (o.prototype = new t("css"));
(h.constructor = o),
(o.version = "1.18.2"),
(o.API = 2),
(o.defaultTransformPerspective = 0),
(o.defaultSkewType = "compensated"),
(o.defaultSmoothOrigin = !0),
(h = "px"),
(o.suffixMap = { top: h, right: h, bottom: h, left: h, width: h, height: h, fontSize: h, padding: h, margin: h, perspective: h, lineHeight: "" });
var c,
u,
d,
f,
p,
m,
_ = /(?:\d|\-\d|\.\d|\-\.\d)+/g,
v = /(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,
g = /(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,
y = /(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g,
b = /(?:\d|\-|\+|=|#|\.)*/g,
x = /opacity *= *([^)]*)/i,
w = /opacity:([^;]*)/i,
T = /alpha\(opacity *=.+?\)/i,
E = /^(rgb|hsl)/,
C = /([A-Z])/g,
S = /-([a-z])/gi,
R = /(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,
k = function (t, e) {
return e.toUpperCase();
},
P = /(?:Left|Right|Width)/i,
D = /(M11|M12|M21|M22)=[\d\-\.e]+/gi,
A = /progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,
M = /,(?=[^\)]*(?:\(|$))/gi,
O = Math.PI / 180,
H = 180 / Math.PI,
U = {},
F = document,
z = function (t) {
return F.createElementNS ? F.createElementNS("http://www.w3.org/1999/xhtml", t) : F.createElement(t);
},
N = z("div"),
L = z("img"),
j = (o._internals = { _specialProps: l }),
I = navigator.userAgent,
B = (function () {
var t = I.indexOf("Android"),
e = z("a");
return (
(d = -1 !== I.indexOf("Safari") && -1 === I.indexOf("Chrome") && (-1 === t || Number(I.substr(t + 8, 1)) > 3)),
(p = d && Number(I.substr(I.indexOf("Version/") + 8, 1)) < 6),
(f = -1 !== I.indexOf("Firefox")),
(/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I) || /Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I)) && (m = parseFloat(RegExp.$1)),
!!e && ((e.style.cssText = "top:1px;opacity:.55;"), /^0.55/.test(e.style.opacity))
);
})(),
V = function (t) {
return x.test("string" == typeof t ? t : (t.currentStyle ? t.currentStyle.filter : t.style.filter) || "") ? parseFloat(RegExp.$1) / 100 : 1;
},
W = function (t) {
window.console && console.log(t);
},
X = "",
G = "",
q = function (t, e) {
e = e || N;
var i,
r,
n = e.style;
if (void 0 !== n[t]) return t;
for (t = t.charAt(0).toUpperCase() + t.substr(1), i = ["O", "Moz", "ms", "Ms", "Webkit"], r = 5; --r > -1 && void 0 === n[i[r] + t]; );
return r >= 0 ? ((G = 3 === r ? "ms" : i[r]), (X = "-" + G.toLowerCase() + "-"), G + t) : null;
},
Y = F.defaultView ? F.defaultView.getComputedStyle : function () {},
Z = (o.getStyle = function (t, e, i, r, n) {
var s;
return B || "opacity" !== e
? (!r && t.style[e] ? (s = t.style[e]) : (i = i || Y(t)) ? (s = i[e] || i.getPropertyValue(e) || i.getPropertyValue(e.replace(C, "-$1").toLowerCase())) : t.currentStyle && (s = t.currentStyle[e]),
null == n || (s && "none" !== s && "auto" !== s && "auto auto" !== s) ? s : n)
: V(t);
}),
K = (j.convertToPixels = function (t, i, r, n, s) {
if ("px" === n || !n) return r;
if ("auto" === n || !r) return 0;
var a,
l,
h,
c = P.test(i),
u = t,
d = N.style,
f = 0 > r;
if ((f && (r = -r), "%" === n && -1 !== i.indexOf("border"))) a = (r / 100) * (c ? t.clientWidth : t.clientHeight);
else {
if (((d.cssText = "border:0 solid red;position:" + Z(t, "position") + ";line-height:0;"), "%" !== n && u.appendChild && "v" !== n.charAt(0) && "rem" !== n)) d[c ? "borderLeftWidth" : "borderTopWidth"] = r + n;
else {
if (((u = t.parentNode || F.body), (l = u._gsCache), (h = e.ticker.frame), l && c && l.time === h)) return (l.width * r) / 100;
d[c ? "width" : "height"] = r + n;
}
u.appendChild(N),
(a = parseFloat(N[c ? "offsetWidth" : "offsetHeight"])),
u.removeChild(N),
c && "%" === n && o.cacheWidths !== !1 && ((l = u._gsCache = u._gsCache || {}), (l.time = h), (l.width = (a / r) * 100)),
0 !== a || s || (a = K(t, i, r, n, !0));
}
return f ? -a : a;
}),
Q = (j.calculateOffset = function (t, e, i) {
if ("absolute" !== Z(t, "position", i)) return 0;
var r = "left" === e ? "Left" : "Top",
n = Z(t, "margin" + r, i);
return t["offset" + r] - (K(t, e, parseFloat(n), n.replace(b, "")) || 0);
}),
J = function (t, e) {
var i,
r,
n,
s = {};
if ((e = e || Y(t, null)))
if ((i = e.length)) for (; --i > -1; ) (n = e[i]), (-1 === n.indexOf("-transform") || Ct === n) && (s[n.replace(S, k)] = e.getPropertyValue(n));
else for (i in e) (-1 === i.indexOf("Transform") || Et === i) && (s[i] = e[i]);
else if ((e = t.currentStyle || t.style)) for (i in e) "string" == typeof i && void 0 === s[i] && (s[i.replace(S, k)] = e[i]);
return (
B || (s.opacity = V(t)),
(r = zt(t, e, !1)),
(s.rotation = r.rotation),
(s.skewX = r.skewX),
(s.scaleX = r.scaleX),
(s.scaleY = r.scaleY),
(s.x = r.x),
(s.y = r.y),
Rt && ((s.z = r.z), (s.rotationX = r.rotationX), (s.rotationY = r.rotationY), (s.scaleZ = r.scaleZ)),
s.filters && delete s.filters,
s
);
},
$ = function (t, e, i, r, n) {
var s,
o,
a,
l = {},
h = t.style;
for (o in i)
"cssText" !== o &&
"length" !== o &&
isNaN(o) &&
(e[o] !== (s = i[o]) || (n && n[o])) &&
-1 === o.indexOf("Origin") &&
("number" == typeof s || "string" == typeof s) &&
((l[o] = "auto" !== s || ("left" !== o && "top" !== o) ? (("" !== s && "auto" !== s && "none" !== s) || "string" != typeof e[o] || "" === e[o].replace(y, "") ? s : 0) : Q(t, o)),
void 0 !== h[o] && (a = new pt(h, o, h[o], a)));
if (r) for (o in r) "className" !== o && (l[o] = r[o]);
return { difs: l, firstMPT: a };
},
tt = { width: ["Left", "Right"], height: ["Top", "Bottom"] },
et = ["marginLeft", "marginRight", "marginTop", "marginBottom"],
it = function (t, e, i) {
var r = parseFloat("width" === e ? t.offsetWidth : t.offsetHeight),
n = tt[e],
s = n.length;
for (i = i || Y(t, null); --s > -1; ) (r -= parseFloat(Z(t, "padding" + n[s], i, !0)) || 0), (r -= parseFloat(Z(t, "border" + n[s] + "Width", i, !0)) || 0);
return r;
},
rt = function (t, e) {
if ("contain" === t || "auto" === t || "auto auto" === t) return t + " ";
(null == t || "" === t) && (t = "0 0");
var i = t.split(" "),
r = -1 !== t.indexOf("left") ? "0%" : -1 !== t.indexOf("right") ? "100%" : i[0],
n = -1 !== t.indexOf("top") ? "0%" : -1 !== t.indexOf("bottom") ? "100%" : i[1];
return (
null == n ? (n = "center" === r ? "50%" : "0") : "center" === n && (n = "50%"),
("center" === r || (isNaN(parseFloat(r)) && -1 === (r + "").indexOf("="))) && (r = "50%"),
(t = r + " " + n + (i.length > 2 ? " " + i[2] : "")),
e &&
((e.oxp = -1 !== r.indexOf("%")),
(e.oyp = -1 !== n.indexOf("%")),
(e.oxr = "=" === r.charAt(1)),
(e.oyr = "=" === n.charAt(1)),
(e.ox = parseFloat(r.replace(y, ""))),
(e.oy = parseFloat(n.replace(y, ""))),
(e.v = t)),
e || t
);
},
nt = function (t, e) {
return "string" == typeof t && "=" === t.charAt(1) ? parseInt(t.charAt(0) + "1", 10) * parseFloat(t.substr(2)) : parseFloat(t) - parseFloat(e);
},
st = function (t, e) {
return null == t ? e : "string" == typeof t && "=" === t.charAt(1) ? parseInt(t.charAt(0) + "1", 10) * parseFloat(t.substr(2)) + e : parseFloat(t);
},
ot = function (t, e, i, r) {
var n,
s,
o,
a,
l,
h = 1e-6;
return (
null == t
? (a = e)
: "number" == typeof t
? (a = t)
: ((n = 360),
(s = t.split("_")),
(l = "=" === t.charAt(1)),
(o = (l ? parseInt(t.charAt(0) + "1", 10) * parseFloat(s[0].substr(2)) : parseFloat(s[0])) * (-1 === t.indexOf("rad") ? 1 : H) - (l ? 0 : e)),
s.length &&
(r && (r[i] = e + o),
-1 !== t.indexOf("short") && ((o %= n), o !== o % (n / 2) && (o = 0 > o ? o + n : o - n)),
-1 !== t.indexOf("_cw") && 0 > o ? (o = ((o + 9999999999 * n) % n) - ((o / n) | 0) * n) : -1 !== t.indexOf("ccw") && o > 0 && (o = ((o - 9999999999 * n) % n) - ((o / n) | 0) * n)),
(a = e + o)),
h > a && a > -h && (a = 0),
a
);
},
at = {
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],
},
lt = function (t, e, i) {
return (t = 0 > t ? t + 1 : t > 1 ? t - 1 : t), (255 * (1 > 6 * t ? e + (i - e) * t * 6 : 0.5 > t ? i : 2 > 3 * t ? e + (i - e) * (2 / 3 - t) * 6 : e) + 0.5) | 0;
},
ht = (o.parseColor = function (t, e) {
var i, r, n, s, o, a, l, h, c, u, d;
if (t)
if ("number" == typeof t) i = [t >> 16, (t >> 8) & 255, 255 & t];
else {
if (("," === t.charAt(t.length - 1) && (t = t.substr(0, t.length - 1)), at[t])) i = at[t];
else if ("#" === t.charAt(0))
4 === t.length && ((r = t.charAt(1)), (n = t.charAt(2)), (s = t.charAt(3)), (t = "#" + r + r + n + n + s + s)), (t = parseInt(t.substr(1), 16)), (i = [t >> 16, (t >> 8) & 255, 255 & t]);
else if ("hsl" === t.substr(0, 3))
if (((i = d = t.match(_)), e)) {
if (-1 !== t.indexOf("=")) return t.match(v);
} else
(o = (Number(i[0]) % 360) / 360),
(a = Number(i[1]) / 100),
(l = Number(i[2]) / 100),
(n = 0.5 >= l ? l * (a + 1) : l + a - l * a),
(r = 2 * l - n),
i.length > 3 && (i[3] = Number(t[3])),
(i[0] = lt(o + 1 / 3, r, n)),
(i[1] = lt(o, r, n)),
(i[2] = lt(o - 1 / 3, r, n));
else i = t.match(_) || at.transparent;
(i[0] = Number(i[0])), (i[1] = Number(i[1])), (i[2] = Number(i[2])), i.length > 3 && (i[3] = Number(i[3]));
}
else i = at.black;
return (
e &&
!d &&
((r = i[0] / 255),
(n = i[1] / 255),
(s = i[2] / 255),
(h = Math.max(r, n, s)),
(c = Math.min(r, n, s)),
(l = (h + c) / 2),
h === c ? (o = a = 0) : ((u = h - c), (a = l > 0.5 ? u / (2 - h - c) : u / (h + c)), (o = h === r ? (n - s) / u + (s > n ? 6 : 0) : h === n ? (s - r) / u + 2 : (r - n) / u + 4), (o *= 60)),
(i[0] = (o + 0.5) | 0),
(i[1] = (100 * a + 0.5) | 0),
(i[2] = (100 * l + 0.5) | 0)),
i
);
}),
ct = function (t, e) {
var i,
r,
n,
s = t.match(ut) || [],
o = 0,
a = s.length ? "" : t;
for (i = 0; i < s.length; i++)
(r = s[i]),
(n = t.substr(o, t.indexOf(r, o) - o)),
(o += n.length + r.length),
(r = ht(r, e)),
3 === r.length && r.push(1),
(a += n + (e ? "hsla(" + r[0] + "," + r[1] + "%," + r[2] + "%," + r[3] : "rgba(" + r.join(",")) + ")");
return a;
},
ut = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3}){1,2}\\b";
for (h in at) ut += "|" + h + "\\b";
(ut = new RegExp(ut + ")", "gi")),
(o.colorStringFilter = function (t) {
var e,
i = t[0] + t[1];
(ut.lastIndex = 0), ut.test(i) && ((e = -1 !== i.indexOf("hsl(") || -1 !== i.indexOf("hsla(")), (t[0] = ct(t[0], e)), (t[1] = ct(t[1], e)));
}),
e.defaultStringFilter || (e.defaultStringFilter = o.colorStringFilter);
var dt = function (t, e, i, r) {
if (null == t)
return function (t) {
return t;
};
var n,
s = e ? (t.match(ut) || [""])[0] : "",
o = t.split(s).join("").match(g) || [],
a = t.substr(0, t.indexOf(o[0])),
l = ")" === t.charAt(t.length - 1) ? ")" : "",
h = -1 !== t.indexOf(" ") ? " " : ",",
c = o.length,
u = c > 0 ? o[0].replace(_, "") : "";
return c
? (n = e
? function (t) {
var e, d, f, p;
if ("number" == typeof t) t += u;
else if (r && M.test(t)) {
for (p = t.replace(M, "|").split("|"), f = 0; f < p.length; f++) p[f] = n(p[f]);
return p.join(",");
}
if (((e = (t.match(ut) || [s])[0]), (d = t.split(e).join("").match(g) || []), (f = d.length), c > f--)) for (; ++f < c; ) d[f] = i ? d[((f - 1) / 2) | 0] : o[f];
return a + d.join(h) + h + e + l + (-1 !== t.indexOf("inset") ? " inset" : "");
}
: function (t) {
var e, s, d;
if ("number" == typeof t) t += u;
else if (r && M.test(t)) {
for (s = t.replace(M, "|").split("|"), d = 0; d < s.length; d++) s[d] = n(s[d]);
return s.join(",");
}
if (((e = t.match(g) || []), (d = e.length), c > d--)) for (; ++d < c; ) e[d] = i ? e[((d - 1) / 2) | 0] : o[d];
return a + e.join(h) + l;
})
: function (t) {
return t;
};
},
ft = function (t) {
return (
(t = t.split(",")),
function (e, i, r, n, s, o, a) {
var l,
h = (i + "").split(" ");
for (a = {}, l = 0; 4 > l; l++) a[t[l]] = h[l] = h[l] || h[((l - 1) / 2) >> 0];
return n.parse(e, a, s, o);
}
);
},
pt =
((j._setPluginRatio = function (t) {
this.plugin.setRatio(t);
for (var e, i, r, n, s, o = this.data, a = o.proxy, l = o.firstMPT, h = 1e-6; l; ) (e = a[l.v]), l.r ? (e = Math.round(e)) : h > e && e > -h && (e = 0), (l.t[l.p] = e), (l = l._next);
if ((o.autoRotate && (o.autoRotate.rotation = a.rotation), 1 === t || 0 === t))
for (l = o.firstMPT, s = 1 === t ? "e" : "b"; l; ) {
if (((i = l.t), i.type)) {
if (1 === i.type) {
for (n = i.xs0 + i.s + i.xs1, r = 1; r < i.l; r++) n += i["xn" + r] + i["xs" + (r + 1)];
i[s] = n;
}
} else i[s] = i.s + i.xs0;
l = l._next;
}
}),
function (t, e, i, r, n) {
(this.t = t), (this.p = e), (this.v = i), (this.r = n), r && ((r._prev = this), (this._next = r));
}),
mt =
((j._parseToProxy = function (t, e, i, r, n, s) {
var o,
a,
l,
h,
c,
u = r,
d = {},
f = {},
p = i._transform,
m = U;
for (i._transform = null, U = e, r = c = i.parse(t, e, r, n), U = m, s && ((i._transform = p), u && ((u._prev = null), u._prev && (u._prev._next = null))); r && r !== u; ) {
if (r.type <= 1 && ((a = r.p), (f[a] = r.s + r.c), (d[a] = r.s), s || ((h = new pt(r, "s", a, h, r.r)), (r.c = 0)), 1 === r.type))
for (o = r.l; --o > 0; ) (l = "xn" + o), (a = r.p + "_" + l), (f[a] = r.data[l]), (d[a] = r[l]), s || (h = new pt(r, l, a, h, r.rxp[l]));
r = r._next;
}
return { proxy: d, end: f, firstMPT: h, pt: c };
}),
(j.CSSPropTween = function (t, e, r, n, o, a, l, h, c, u, d) {
(this.t = t),
(this.p = e),
(this.s = r),
(this.c = n),
(this.n = l || e),
t instanceof mt || s.push(this.n),
(this.r = h),
(this.type = a || 0),
c && ((this.pr = c), (i = !0)),
(this.b = void 0 === u ? r : u),
(this.e = void 0 === d ? r + n : d),
o && ((this._next = o), (o._prev = this));
})),
_t = function (t, e, i, r, n, s) {
var o = new mt(t, e, i, r - i, n, -1, s);
return (o.b = i), (o.e = o.xs0 = r), o;
},
vt = (o.parseComplex = function (t, e, i, r, n, s, o, a, l, h) {
(i = i || s || ""), (o = new mt(t, e, 0, 0, o, h ? 2 : 1, null, !1, a, i, r)), (r += "");
var u,
d,
f,
p,
m,
g,
y,
b,
x,
w,
T,
E,
C,
S = i.split(", ").join(",").split(" "),
R = r.split(", ").join(",").split(" "),
k = S.length,
P = c !== !1;
for (
(-1 !== r.indexOf(",") || -1 !== i.indexOf(",")) && ((S = S.join(" ").replace(M, ", ").split(" ")), (R = R.join(" ").replace(M, ", ").split(" ")), (k = S.length)),
k !== R.length && ((S = (s || "").split(" ")), (k = S.length)),
o.plugin = l,
o.setRatio = h,
ut.lastIndex = 0,
u = 0;
k > u;
u++
)
if (((p = S[u]), (m = R[u]), (b = parseFloat(p)), b || 0 === b)) o.appendXtra("", b, nt(m, b), m.replace(v, ""), P && -1 !== m.indexOf("px"), !0);
else if (n && ut.test(p))
(E = "," === m.charAt(m.length - 1) ? ")," : ")"),
(C = -1 !== m.indexOf("hsl") && B),
(p = ht(p, C)),
(m = ht(m, C)),
(x = p.length + m.length > 6),
x && !B && 0 === m[3]
? ((o["xs" + o.l] += o.l ? " transparent" : "transparent"), (o.e = o.e.split(R[u]).join("transparent")))
: (B || (x = !1),
C
? o
.appendXtra(x ? "hsla(" : "hsl(", p[0], nt(m[0], p[0]), ",", !1, !0)
.appendXtra("", p[1], nt(m[1], p[1]), "%,", !1)
.appendXtra("", p[2], nt(m[2], p[2]), x ? "%," : "%" + E, !1)
: o
.appendXtra(x ? "rgba(" : "rgb(", p[0], m[0] - p[0], ",", !0, !0)
.appendXtra("", p[1], m[1] - p[1], ",", !0)
.appendXtra("", p[2], m[2] - p[2], x ? "," : E, !0),
x && ((p = p.length < 4 ? 1 : p[3]), o.appendXtra("", p, (m.length < 4 ? 1 : m[3]) - p, E, !1))),
(ut.lastIndex = 0);
else if ((g = p.match(_))) {
if (((y = m.match(v)), !y || y.length !== g.length)) return o;
for (f = 0, d = 0; d < g.length; d++) (T = g[d]), (w = p.indexOf(T, f)), o.appendXtra(p.substr(f, w - f), Number(T), nt(y[d], T), "", P && "px" === p.substr(w + T.length, 2), 0 === d), (f = w + T.length);
o["xs" + o.l] += p.substr(f);
} else o["xs" + o.l] += o.l ? " " + m : m;
if (-1 !== r.indexOf("=") && o.data) {
for (E = o.xs0 + o.data.s, u = 1; u < o.l; u++) E += o["xs" + u] + o.data["xn" + u];
o.e = E + o["xs" + u];
}
return o.l || ((o.type = -1), (o.xs0 = o.e)), o.xfirst || o;
}),
gt = 9;
for (h = mt.prototype, h.l = h.pr = 0; --gt > 0; ) (h["xn" + gt] = 0), (h["xs" + gt] = "");
(h.xs0 = ""),
(h._next = h._prev = h.xfirst = h.data = h.plugin = h.setRatio = h.rxp = null),
(h.appendXtra = function (t, e, i, r, n, s) {
var o = this,
a = o.l;
return (
(o["xs" + a] += s && a ? " " + t : t || ""),
i || 0 === a || o.plugin
? (o.l++,
(o.type = o.setRatio ? 2 : 1),
(o["xs" + o.l] = r || ""),
a > 0
? ((o.data["xn" + a] = e + i), (o.rxp["xn" + a] = n), (o["xn" + a] = e), o.plugin || ((o.xfirst = new mt(o, "xn" + a, e, i, o.xfirst || o, 0, o.n, n, o.pr)), (o.xfirst.xs0 = 0)), o)
: ((o.data = { s: e + i }), (o.rxp = {}), (o.s = e), (o.c = i), (o.r = n), o))
: ((o["xs" + a] += e + (r || "")), o)
);
});
var yt = function (t, e) {
(e = e || {}),
(this.p = e.prefix ? q(t) || t : t),
(l[t] = l[this.p] = this),
(this.format = e.formatter || dt(e.defaultValue, e.color, e.collapsible, e.multi)),
e.parser && (this.parse = e.parser),
(this.clrs = e.color),
(this.multi = e.multi),
(this.keyword = e.keyword),
(this.dflt = e.defaultValue),
(this.pr = e.priority || 0);
},
bt = (j._registerComplexSpecialProp = function (t, e, i) {
"object" != typeof e && (e = { parser: i });
var r,
n,
s = t.split(","),
o = e.defaultValue;
for (i = i || [o], r = 0; r < s.length; r++) (e.prefix = 0 === r && e.prefix), (e.defaultValue = i[r] || o), (n = new yt(s[r], e));
}),
xt = function (t) {
if (!l[t]) {
var e = t.charAt(0).toUpperCase() + t.substr(1) + "Plugin";
bt(t, {
parser: function (t, i, r, n, s, o, h) {
var c = a.com.greensock.plugins[e];
return c ? (c._cssRegister(), l[r].parse(t, i, r, n, s, o, h)) : (W("Error: " + e + " js file not loaded."), s);
},
});
}
};
(h = yt.prototype),
(h.parseComplex = function (t, e, i, r, n, s) {
var o,
a,
l,
h,
c,
u,
d = this.keyword;
if ((this.multi && (M.test(i) || M.test(e) ? ((a = e.replace(M, "|").split("|")), (l = i.replace(M, "|").split("|"))) : d && ((a = [e]), (l = [i]))), l)) {
for (h = l.length > a.length ? l.length : a.length, o = 0; h > o; o++)
(e = a[o] = a[o] || this.dflt), (i = l[o] = l[o] || this.dflt), d && ((c = e.indexOf(d)), (u = i.indexOf(d)), c !== u && (-1 === u ? (a[o] = a[o].split(d).join("")) : -1 === c && (a[o] += " " + d)));
(e = a.join(", ")), (i = l.join(", "));
}
return vt(t, this.p, e, i, this.clrs, this.dflt, r, this.pr, n, s);
}),
(h.parse = function (t, e, i, r, s, o, a) {
return this.parseComplex(t.style, this.format(Z(t, this.p, n, !1, this.dflt)), this.format(e), s, o);
}),
(o.registerSpecialProp = function (t, e, i) {
bt(t, {
parser: function (t, r, n, s, o, a, l) {
var h = new mt(t, n, 0, 0, o, 2, n, !1, i);
return (h.plugin = a), (h.setRatio = e(t, r, s._tween, n)), h;
},
priority: i,
});
}),
(o.useSVGTransformAttr = d || f);
var wt,
Tt = "scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective,xPercent,yPercent".split(","),
Et = q("transform"),
Ct = X + "transform",
St = q("transformOrigin"),
Rt = null !== q("perspective"),
kt = (j.Transform = function () {
(this.perspective = parseFloat(o.defaultTransformPerspective) || 0), (this.force3D = !(o.defaultForce3D === !1 || !Rt) && (o.defaultForce3D || "auto"));
}),
Pt = window.SVGElement,
Dt = function (t, e, i) {
var r,
n = F.createElementNS("http://www.w3.org/2000/svg", t),
s = /([a-z])([A-Z])/g;
for (r in i) n.setAttributeNS(null, r.replace(s, "$1-$2").toLowerCase(), i[r]);
return e.appendChild(n), n;
},
At = F.documentElement,
Mt = (function () {
var t,
e,
i,
r = m || (/Android/i.test(I) && !window.chrome);
return (
F.createElementNS &&
!r &&
((t = Dt("svg", At)),
(e = Dt("rect", t, { width: 100, height: 50, x: 100 })),
(i = e.getBoundingClientRect().width),
(e.style[St] = "50% 50%"),
(e.style[Et] = "scaleX(0.5)"),
(r = i === e.getBoundingClientRect().width && !(f && Rt)),
At.removeChild(t)),
r
);
})(),
Ot = function (t, e, i, r, n) {
var s,
a,
l,
h,
c,
u,
d,
f,
p,
m,
_,
v,
g,
y,
b = t._gsTransform,
x = Ft(t, !0);
b && ((g = b.xOrigin), (y = b.yOrigin)),
(!r || (s = r.split(" ")).length < 2) &&
((d = t.getBBox()),
(e = rt(e).split(" ")),
(s = [(-1 !== e[0].indexOf("%") ? (parseFloat(e[0]) / 100) * d.width : parseFloat(e[0])) + d.x, (-1 !== e[1].indexOf("%") ? (parseFloat(e[1]) / 100) * d.height : parseFloat(e[1])) + d.y])),
(i.xOrigin = h = parseFloat(s[0])),
(i.yOrigin = c = parseFloat(s[1])),
r &&
x !== Ut &&
((u = x[0]),
(d = x[1]),
(f = x[2]),
(p = x[3]),
(m = x[4]),
(_ = x[5]),
(v = u * p - d * f),
(a = h * (p / v) + c * (-f / v) + (f * _ - p * m) / v),
(l = h * (-d / v) + c * (u / v) - (u * _ - d * m) / v),
(h = i.xOrigin = s[0] = a),
(c = i.yOrigin = s[1] = l)),
b && (n || (n !== !1 && o.defaultSmoothOrigin !== !1) ? ((a = h - g), (l = c - y), (b.xOffset += a * x[0] + l * x[2] - a), (b.yOffset += a * x[1] + l * x[3] - l)) : (b.xOffset = b.yOffset = 0)),
t.setAttribute("data-svg-origin", s.join(" "));
},
Ht = function (t) {
return !!(Pt && "function" == typeof t.getBBox && t.getCTM && (!t.parentNode || (t.parentNode.getBBox && t.parentNode.getCTM)));
},
Ut = [1, 0, 0, 1, 0, 0],
Ft = function (t, e) {
var i,
r,
n,
s,
o,
a = t._gsTransform || new kt(),
l = 1e5;
if (
(Et
? (r = Z(t, Ct, null, !0))
: t.currentStyle && ((r = t.currentStyle.filter.match(D)), (r = r && 4 === r.length ? [r[0].substr(4), Number(r[2].substr(4)), Number(r[1].substr(4)), r[3].substr(4), a.x || 0, a.y || 0].join(",") : "")),
(i = !r || "none" === r || "matrix(1, 0, 0, 1, 0, 0)" === r),
(a.svg || (t.getBBox && Ht(t))) &&
(i && -1 !== (t.style[Et] + "").indexOf("matrix") && ((r = t.style[Et]), (i = 0)),
(n = t.getAttribute("transform")),
i && n && (-1 !== n.indexOf("matrix") ? ((r = n), (i = 0)) : -1 !== n.indexOf("translate") && ((r = "matrix(1,0,0,1," + n.match(/(?:\-|\b)[\d\-\.e]+\b/gi).join(",") + ")"), (i = 0)))),
i)
)
return Ut;
for (n = (r || "").match(/(?:\-|\b)[\d\-\.e]+\b/gi) || [], gt = n.length; --gt > -1; ) (s = Number(n[gt])), (n[gt] = (o = s - (s |= 0)) ? ((o * l + (0 > o ? -0.5 : 0.5)) | 0) / l + s : s);
return e && n.length > 6 ? [n[0], n[1], n[4], n[5], n[12], n[13]] : n;
},
zt = (j.getTransform = function (t, i, r, s) {
if (t._gsTransform && r && !s) return t._gsTransform;
var a,
l,
h,
c,
u,
d,
f = r ? t._gsTransform || new kt() : new kt(),
p = f.scaleX < 0,
m = 2e-5,
_ = 1e5,
v = Rt ? parseFloat(Z(t, St, i, !1, "0 0 0").split(" ")[2]) || f.zOrigin || 0 : 0,
g = parseFloat(o.defaultTransformPerspective) || 0;
if (((f.svg = !(!t.getBBox || !Ht(t))), f.svg && (Ot(t, Z(t, St, n, !1, "50% 50%") + "", f, t.getAttribute("data-svg-origin")), (wt = o.useSVGTransformAttr || Mt)), (a = Ft(t)), a !== Ut)) {
if (16 === a.length) {
var y,
b,
x,
w,
T,
E = a[0],
C = a[1],
S = a[2],
R = a[3],
k = a[4],
P = a[5],
D = a[6],
A = a[7],
M = a[8],
O = a[9],
U = a[10],
F = a[12],
z = a[13],
N = a[14],
L = a[11],
j = Math.atan2(D, U);
f.zOrigin && ((N = -f.zOrigin), (F = M * N - a[12]), (z = O * N - a[13]), (N = U * N + f.zOrigin - a[14])),
(f.rotationX = j * H),
j &&
((w = Math.cos(-j)),
(T = Math.sin(-j)),
(y = k * w + M * T),
(b = P * w + O * T),
(x = D * w + U * T),
(M = k * -T + M * w),
(O = P * -T + O * w),
(U = D * -T + U * w),
(L = A * -T + L * w),
(k = y),
(P = b),
(D = x)),
(j = Math.atan2(-S, U)),
(f.rotationY = j * H),
j && ((w = Math.cos(-j)), (T = Math.sin(-j)), (y = E * w - M * T), (b = C * w - O * T), (x = S * w - U * T), (O = C * T + O * w), (U = S * T + U * w), (L = R * T + L * w), (E = y), (C = b), (S = x)),
(j = Math.atan2(C, E)),
(f.rotation = j * H),
j && ((w = Math.cos(-j)), (T = Math.sin(-j)), (E = E * w + k * T), (b = C * w + P * T), (P = C * -T + P * w), (D = S * -T + D * w), (C = b)),
f.rotationX && Math.abs(f.rotationX) + Math.abs(f.rotation) > 359.9 && ((f.rotationX = f.rotation = 0), (f.rotationY = 180 - f.rotationY)),
(f.scaleX = ((Math.sqrt(E * E + C * C) * _ + 0.5) | 0) / _),
(f.scaleY = ((Math.sqrt(P * P + O * O) * _ + 0.5) | 0) / _),
(f.scaleZ = ((Math.sqrt(D * D + U * U) * _ + 0.5) | 0) / _),
(f.skewX = 0),
(f.perspective = L ? 1 / (0 > L ? -L : L) : 0),
(f.x = F),
(f.y = z),
(f.z = N),
f.svg && ((f.x -= f.xOrigin - (f.xOrigin * E - f.yOrigin * k)), (f.y -= f.yOrigin - (f.yOrigin * C - f.xOrigin * P)));
} else if ((!Rt || s || !a.length || f.x !== a[4] || f.y !== a[5] || (!f.rotationX && !f.rotationY)) && (void 0 === f.x || "none" !== Z(t, "display", i))) {
var I = a.length >= 6,
B = I ? a[0] : 1,
V = a[1] || 0,
W = a[2] || 0,
X = I ? a[3] : 1;
(f.x = a[4] || 0),
(f.y = a[5] || 0),
(h = Math.sqrt(B * B + V * V)),
(c = Math.sqrt(X * X + W * W)),
(u = B || V ? Math.atan2(V, B) * H : f.rotation || 0),
(d = W || X ? Math.atan2(W, X) * H + u : f.skewX || 0),
Math.abs(d) > 90 && Math.abs(d) < 270 && (p ? ((h *= -1), (d += 0 >= u ? 180 : -180), (u += 0 >= u ? 180 : -180)) : ((c *= -1), (d += 0 >= d ? 180 : -180))),
(f.scaleX = h),
(f.scaleY = c),
(f.rotation = u),
(f.skewX = d),
Rt && ((f.rotationX = f.rotationY = f.z = 0), (f.perspective = g), (f.scaleZ = 1)),
f.svg && ((f.x -= f.xOrigin - (f.xOrigin * B + f.yOrigin * W)), (f.y -= f.yOrigin - (f.xOrigin * V + f.yOrigin * X)));
}
f.zOrigin = v;
for (l in f) f[l] < m && f[l] > -m && (f[l] = 0);
}
return (
r &&
((t._gsTransform = f),
f.svg &&
(wt && t.style[Et]
? e.delayedCall(0.001, function () {
It(t.style, Et);
})
: !wt &&
t.getAttribute("transform") &&
e.delayedCall(0.001, function () {
t.removeAttribute("transform");
}))),
f
);
}),
Nt = function (t) {
var e,
i,
r = this.data,
n = -r.rotation * O,
s = n + r.skewX * O,
o = 1e5,
a = ((Math.cos(n) * r.scaleX * o) | 0) / o,
l = ((Math.sin(n) * r.scaleX * o) | 0) / o,
h = ((Math.sin(s) * -r.scaleY * o) | 0) / o,
c = ((Math.cos(s) * r.scaleY * o) | 0) / o,
u = this.t.style,
d = this.t.currentStyle;
if (d) {
(i = l), (l = -h), (h = -i), (e = d.filter), (u.filter = "");
var f,
p,
_ = this.t.offsetWidth,
v = this.t.offsetHeight,
g = "absolute" !== d.position,
y = "progid:DXImageTransform.Microsoft.Matrix(M11=" + a + ", M12=" + l + ", M21=" + h + ", M22=" + c,
w = r.x + (_ * r.xPercent) / 100,
T = r.y + (v * r.yPercent) / 100;
if (
(null != r.ox && ((f = (r.oxp ? _ * r.ox * 0.01 : r.ox) - _ / 2), (p = (r.oyp ? v * r.oy * 0.01 : r.oy) - v / 2), (w += f - (f * a + p * l)), (T += p - (f * h + p * c))),
g ? ((f = _ / 2), (p = v / 2), (y += ", Dx=" + (f - (f * a + p * l) + w) + ", Dy=" + (p - (f * h + p * c) + T) + ")")) : (y += ", sizingMethod='auto expand')"),
-1 !== e.indexOf("DXImageTransform.Microsoft.Matrix(") ? (u.filter = e.replace(A, y)) : (u.filter = y + " " + e),
(0 === t || 1 === t) &&
1 === a &&
0 === l &&
0 === h &&
1 === c &&
((g && -1 === y.indexOf("Dx=0, Dy=0")) || (x.test(e) && 100 !== parseFloat(RegExp.$1)) || (-1 === e.indexOf(e.indexOf("Alpha")) && u.removeAttribute("filter"))),
!g)
) {
var E,
C,
S,
R = 8 > m ? 1 : -1;
for (
f = r.ieOffsetX || 0,
p = r.ieOffsetY || 0,
r.ieOffsetX = Math.round((_ - ((0 > a ? -a : a) * _ + (0 > l ? -l : l) * v)) / 2 + w),
r.ieOffsetY = Math.round((v - ((0 > c ? -c : c) * v + (0 > h ? -h : h) * _)) / 2 + T),
gt = 0;
4 > gt;
gt++
)
(C = et[gt]),
(E = d[C]),
(i = -1 !== E.indexOf("px") ? parseFloat(E) : K(this.t, C, parseFloat(E), E.replace(b, "")) || 0),
(S = i !== r[C] ? (2 > gt ? -r.ieOffsetX : -r.ieOffsetY) : 2 > gt ? f - r.ieOffsetX : p - r.ieOffsetY),
(u[C] = (r[C] = Math.round(i - S * (0 === gt || 2 === gt ? 1 : R))) + "px");
}
}
},
Lt = (j.set3DTransformRatio = j.setTransformRatio = function (t) {
var e,
i,
r,
n,
s,
o,
a,
l,
h,
c,
u,
d,
p,
m,
_,
v,
g,
y,
b,
x,
w,
T,
E,
C = this.data,
S = this.t.style,
R = C.rotation,
k = C.rotationX,
P = C.rotationY,
D = C.scaleX,
A = C.scaleY,
M = C.scaleZ,
H = C.x,
U = C.y,
F = C.z,
z = C.svg,
N = C.perspective,
L = C.force3D;
if (((((1 === t || 0 === t) && "auto" === L && (this.tween._totalTime === this.tween._totalDuration || !this.tween._totalTime)) || !L) && !F && !N && !P && !k && 1 === M) || (wt && z) || !Rt)
return void (R || C.skewX || z
? ((R *= O),
(T = C.skewX * O),
(E = 1e5),
(e = Math.cos(R) * D),
(n = Math.sin(R) * D),
(i = Math.sin(R - T) * -A),
(s = Math.cos(R - T) * A),
T && "simple" === C.skewType && ((g = Math.tan(T)), (g = Math.sqrt(1 + g * g)), (i *= g), (s *= g), C.skewY && ((e *= g), (n *= g))),
z &&
((H += C.xOrigin - (C.xOrigin * e + C.yOrigin * i) + C.xOffset),
(U += C.yOrigin - (C.xOrigin * n + C.yOrigin * s) + C.yOffset),
wt && (C.xPercent || C.yPercent) && ((m = this.t.getBBox()), (H += 0.01 * C.xPercent * m.width), (U += 0.01 * C.yPercent * m.height)),
(m = 1e-6),
m > H && H > -m && (H = 0),
m > U && U > -m && (U = 0)),
(b = ((e * E) | 0) / E + "," + ((n * E) | 0) / E + "," + ((i * E) | 0) / E + "," + ((s * E) | 0) / E + "," + H + "," + U + ")"),
z && wt ? this.t.setAttribute("transform", "matrix(" + b) : (S[Et] = (C.xPercent || C.yPercent ? "translate(" + C.xPercent + "%," + C.yPercent + "%) matrix(" : "matrix(") + b))
: (S[Et] = (C.xPercent || C.yPercent ? "translate(" + C.xPercent + "%," + C.yPercent + "%) matrix(" : "matrix(") + D + ",0,0," + A + "," + H + "," + U + ")"));
if ((f && ((m = 1e-4), m > D && D > -m && (D = M = 2e-5), m > A && A > -m && (A = M = 2e-5), !N || C.z || C.rotationX || C.rotationY || (N = 0)), R || C.skewX))
(R *= O),
(_ = e = Math.cos(R)),
(v = n = Math.sin(R)),
C.skewX &&
((R -= C.skewX * O), (_ = Math.cos(R)), (v = Math.sin(R)), "simple" === C.skewType && ((g = Math.tan(C.skewX * O)), (g = Math.sqrt(1 + g * g)), (_ *= g), (v *= g), C.skewY && ((e *= g), (n *= g)))),
(i = -v),
(s = _);
else {
if (!(P || k || 1 !== M || N || z))
return void (S[Et] =
(C.xPercent || C.yPercent ? "translate(" + C.xPercent + "%," + C.yPercent + "%) translate3d(" : "translate3d(") +
H +
"px," +
U +
"px," +
F +
"px)" +
(1 !== D || 1 !== A ? " scale(" + D + "," + A + ")" : ""));
(e = s = 1), (i = n = 0);
}
(h = 1),
(r = o = a = l = c = u = 0),
(d = N ? -1 / N : 0),
(p = C.zOrigin),
(m = 1e-6),
(x = ","),
(w = "0"),
(R = P * O),
R && ((_ = Math.cos(R)), (v = Math.sin(R)), (a = -v), (c = d * -v), (r = e * v), (o = n * v), (h = _), (d *= _), (e *= _), (n *= _)),
(R = k * O),
R && ((_ = Math.cos(R)), (v = Math.sin(R)), (g = i * _ + r * v), (y = s * _ + o * v), (l = h * v), (u = d * v), (r = i * -v + r * _), (o = s * -v + o * _), (h *= _), (d *= _), (i = g), (s = y)),
1 !== M && ((r *= M), (o *= M), (h *= M), (d *= M)),
1 !== A && ((i *= A), (s *= A), (l *= A), (u *= A)),
1 !== D && ((e *= D), (n *= D), (a *= D), (c *= D)),
(p || z) &&
(p && ((H += r * -p), (U += o * -p), (F += h * -p + p)),
z && ((H += C.xOrigin - (C.xOrigin * e + C.yOrigin * i) + C.xOffset), (U += C.yOrigin - (C.xOrigin * n + C.yOrigin * s) + C.yOffset)),
m > H && H > -m && (H = w),
m > U && U > -m && (U = w),
m > F && F > -m && (F = 0)),
(b = C.xPercent || C.yPercent ? "translate(" + C.xPercent + "%," + C.yPercent + "%) matrix3d(" : "matrix3d("),
(b += (m > e && e > -m ? w : e) + x + (m > n && n > -m ? w : n) + x + (m > a && a > -m ? w : a)),
(b += x + (m > c && c > -m ? w : c) + x + (m > i && i > -m ? w : i) + x + (m > s && s > -m ? w : s)),
k || P || 1 !== M
? ((b += x + (m > l && l > -m ? w : l) + x + (m > u && u > -m ? w : u) + x + (m > r && r > -m ? w : r)),
(b += x + (m > o && o > -m ? w : o) + x + (m > h && h > -m ? w : h) + x + (m > d && d > -m ? w : d) + x))
: (b += ",0,0,0,0,1,0,"),
(b += H + x + U + x + F + x + (N ? 1 + -F / N : 1) + ")"),
(S[Et] = b);
});
(h = kt.prototype),
(h.x = h.y = h.z = h.skewX = h.skewY = h.rotation = h.rotationX = h.rotationY = h.zOrigin = h.xPercent = h.yPercent = h.xOffset = h.yOffset = 0),
(h.scaleX = h.scaleY = h.scaleZ = 1),
bt(
"transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,svgOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent,smoothOrigin",
{
parser: function (t, e, i, r, s, a, l) {
if (r._lastParsedTransform === l) return s;
r._lastParsedTransform = l;
var h,
c,
u,
d,
f,
p,
m,
_,
v,
g,
y = t._gsTransform,
b = t.style,
x = 1e-6,
w = Tt.length,
T = l,
E = {},
C = "transformOrigin";
if (
(l.display ? ((d = Z(t, "display")), (b.display = "block"), (h = zt(t, n, !0, l.parseTransform)), (b.display = d)) : (h = zt(t, n, !0, l.parseTransform)),
(r._transform = h),
"string" == typeof T.transform && Et)
)
(d = N.style),
(d[Et] = T.transform),
(d.display = "block"),
(d.position = "absolute"),
F.body.appendChild(N),
(c = zt(N, null, !1)),
F.body.removeChild(N),
c.perspective || (c.perspective = h.perspective),
null != T.xPercent && (c.xPercent = st(T.xPercent, h.xPercent)),
null != T.yPercent && (c.yPercent = st(T.yPercent, h.yPercent));
else if ("object" == typeof T) {
if (
((c = {
scaleX: st(null != T.scaleX ? T.scaleX : T.scale, h.scaleX),
scaleY: st(null != T.scaleY ? T.scaleY : T.scale, h.scaleY),
scaleZ: st(T.scaleZ, h.scaleZ),
x: st(T.x, h.x),
y: st(T.y, h.y),
z: st(T.z, h.z),
xPercent: st(T.xPercent, h.xPercent),
yPercent: st(T.yPercent, h.yPercent),
perspective: st(T.transformPerspective, h.perspective),
}),
(_ = T.directionalRotation),
null != _)
)
if ("object" == typeof _) for (d in _) T[d] = _[d];
else T.rotation = _;
"string" == typeof T.x && -1 !== T.x.indexOf("%") && ((c.x = 0), (c.xPercent = st(T.x, h.xPercent))),
"string" == typeof T.y && -1 !== T.y.indexOf("%") && ((c.y = 0), (c.yPercent = st(T.y, h.yPercent))),
(c.rotation = ot("rotation" in T ? T.rotation : "shortRotation" in T ? T.shortRotation + "_short" : "rotationZ" in T ? T.rotationZ : h.rotation, h.rotation, "rotation", E)),
Rt &&
((c.rotationX = ot("rotationX" in T ? T.rotationX : "shortRotationX" in T ? T.shortRotationX + "_short" : h.rotationX || 0, h.rotationX, "rotationX", E)),
(c.rotationY = ot("rotationY" in T ? T.rotationY : "shortRotationY" in T ? T.shortRotationY + "_short" : h.rotationY || 0, h.rotationY, "rotationY", E))),
(c.skewX = null == T.skewX ? h.skewX : ot(T.skewX, h.skewX)),
(c.skewY = null == T.skewY ? h.skewY : ot(T.skewY, h.skewY)),
(u = c.skewY - h.skewY) && ((c.skewX += u), (c.rotation += u));
}
for (
Rt && null != T.force3D && ((h.force3D = T.force3D), (m = !0)),
h.skewType = T.skewType || h.skewType || o.defaultSkewType,
p = h.force3D || h.z || h.rotationX || h.rotationY || c.z || c.rotationX || c.rotationY || c.perspective,
p || null == T.scale || (c.scaleZ = 1);
--w > -1;
)
(i = Tt[w]),
(f = c[i] - h[i]),
(f > x || -x > f || null != T[i] || null != U[i]) && ((m = !0), (s = new mt(h, i, h[i], f, s)), i in E && (s.e = E[i]), (s.xs0 = 0), (s.plugin = a), r._overwriteProps.push(s.n));
return (
(f = T.transformOrigin),
h.svg &&
(f || T.svgOrigin) &&
((v = h.xOffset),
(g = h.yOffset),
Ot(t, rt(f), c, T.svgOrigin, T.smoothOrigin),
(s = _t(h, "xOrigin", (y ? h : c).xOrigin, c.xOrigin, s, C)),
(s = _t(h, "yOrigin", (y ? h : c).yOrigin, c.yOrigin, s, C)),
(v !== h.xOffset || g !== h.yOffset) && ((s = _t(h, "xOffset", y ? v : h.xOffset, h.xOffset, s, C)), (s = _t(h, "yOffset", y ? g : h.yOffset, h.yOffset, s, C))),
(f = wt ? null : "0px 0px")),
(f || (Rt && p && h.zOrigin)) &&
(Et
? ((m = !0),
(i = St),
(f = (f || Z(t, i, n, !1, "50% 50%")) + ""),
(s = new mt(b, i, 0, 0, s, -1, C)),
(s.b = b[i]),
(s.plugin = a),
Rt
? ((d = h.zOrigin),
(f = f.split(" ")),
(h.zOrigin = (f.length > 2 && (0 === d || "0px" !== f[2]) ? parseFloat(f[2]) : d) || 0),
(s.xs0 = s.e = f[0] + " " + (f[1] || "50%") + " 0px"),
(s = new mt(h, "zOrigin", 0, 0, s, -1, s.n)),
(s.b = d),
(s.xs0 = s.e = h.zOrigin))
: (s.xs0 = s.e = f))
: rt(f + "", h)),
m && (r._transformType = (h.svg && wt) || (!p && 3 !== this._transformType) ? 2 : 3),
s
);
},
prefix: !0,
}
),
bt("boxShadow", { defaultValue: "0px 0px 0px 0px #999", prefix: !0, color: !0, multi: !0, keyword: "inset" }),
bt("borderRadius", {
defaultValue: "0px",
parser: function (t, e, i, s, o, a) {
e = this.format(e);
var l,
h,
c,
u,
d,
f,
p,
m,
_,
v,
g,
y,
b,
x,
w,
T,
E = ["borderTopLeftRadius", "borderTopRightRadius", "borderBottomRightRadius", "borderBottomLeftRadius"],
C = t.style;
for (_ = parseFloat(t.offsetWidth), v = parseFloat(t.offsetHeight), l = e.split(" "), h = 0; h < E.length; h++)
this.p.indexOf("border") && (E[h] = q(E[h])),
(d = u = Z(t, E[h], n, !1, "0px")),
-1 !== d.indexOf(" ") && ((u = d.split(" ")), (d = u[0]), (u = u[1])),
(f = c = l[h]),
(p = parseFloat(d)),
(y = d.substr((p + "").length)),
(b = "=" === f.charAt(1)),
b ? ((m = parseInt(f.charAt(0) + "1", 10)), (f = f.substr(2)), (m *= parseFloat(f)), (g = f.substr((m + "").length - (0 > m ? 1 : 0)) || "")) : ((m = parseFloat(f)), (g = f.substr((m + "").length))),
"" === g && (g = r[i] || y),
g !== y &&
((x = K(t, "borderLeft", p, y)),
(w = K(t, "borderTop", p, y)),
"%" === g ? ((d = (x / _) * 100 + "%"), (u = (w / v) * 100 + "%")) : "em" === g ? ((T = K(t, "borderLeft", 1, "em")), (d = x / T + "em"), (u = w / T + "em")) : ((d = x + "px"), (u = w + "px")),
b && ((f = parseFloat(d) + m + g), (c = parseFloat(u) + m + g))),
(o = vt(C, E[h], d + " " + u, f + " " + c, !1, "0px", o));
return o;
},
prefix: !0,
formatter: dt("0px 0px 0px 0px", !1, !0),
}),
bt("backgroundPosition", {
defaultValue: "0 0",
parser: function (t, e, i, r, s, o) {
var a,
l,
h,
c,
u,
d,
f = "background-position",
p = n || Y(t, null),
_ = this.format((p ? (m ? p.getPropertyValue(f + "-x") + " " + p.getPropertyValue(f + "-y") : p.getPropertyValue(f)) : t.currentStyle.backgroundPositionX + " " + t.currentStyle.backgroundPositionY) || "0 0"),
v = this.format(e);
if ((-1 !== _.indexOf("%")) != (-1 !== v.indexOf("%")) && ((d = Z(t, "backgroundImage").replace(R, "")), d && "none" !== d)) {
for (a = _.split(" "), l = v.split(" "), L.setAttribute("src", d), h = 2; --h > -1; )
(_ = a[h]),
(c = -1 !== _.indexOf("%")),
c !== (-1 !== l[h].indexOf("%")) && ((u = 0 === h ? t.offsetWidth - L.width : t.offsetHeight - L.height), (a[h] = c ? (parseFloat(_) / 100) * u + "px" : (parseFloat(_) / u) * 100 + "%"));
_ = a.join(" ");
}
return this.parseComplex(t.style, _, v, s, o);
},
formatter: rt,
}),
bt("backgroundSize", { defaultValue: "0 0", formatter: rt }),
bt("perspective", { defaultValue: "0px", prefix: !0 }),
bt("perspectiveOrigin", { defaultValue: "50% 50%", prefix: !0 }),
bt("transformStyle", { prefix: !0 }),
bt("backfaceVisibility", { prefix: !0 }),
bt("userSelect", { prefix: !0 }),
bt("margin", { parser: ft("marginTop,marginRight,marginBottom,marginLeft") }),
bt("padding", { parser: ft("paddingTop,paddingRight,paddingBottom,paddingLeft") }),
bt("clip", {
defaultValue: "rect(0px,0px,0px,0px)",
parser: function (t, e, i, r, s, o) {
var a, l, h;
return (
9 > m
? ((l = t.currentStyle), (h = 8 > m ? " " : ","), (a = "rect(" + l.clipTop + h + l.clipRight + h + l.clipBottom + h + l.clipLeft + ")"), (e = this.format(e).split(",").join(h)))
: ((a = this.format(Z(t, this.p, n, !1, this.dflt))), (e = this.format(e))),
this.parseComplex(t.style, a, e, s, o)
);
},
}),
bt("textShadow", { defaultValue: "0px 0px 0px #999", color: !0, multi: !0 }),
bt("autoRound,strictUnits", {
parser: function (t, e, i, r, n) {
return n;
},
}),
bt("border", {
defaultValue: "0px solid #000",
parser: function (t, e, i, r, s, o) {
return this.parseComplex(t.style, this.format(Z(t, "borderTopWidth", n, !1, "0px") + " " + Z(t, "borderTopStyle", n, !1, "solid") + " " + Z(t, "borderTopColor", n, !1, "#000")), this.format(e), s, o);
},
color: !0,
formatter: function (t) {
var e = t.split(" ");
return e[0] + " " + (e[1] || "solid") + " " + (t.match(ut) || ["#000"])[0];
},
}),
bt("borderWidth", { parser: ft("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth") }),
bt("float,cssFloat,styleFloat", {
parser: function (t, e, i, r, n, s) {
var o = t.style,
a = "cssFloat" in o ? "cssFloat" : "styleFloat";
return new mt(o, a, 0, 0, n, -1, i, !1, 0, o[a], e);
},
});
var jt = function (t) {
var e,
i = this.t,
r = i.filter || Z(this.data, "filter") || "",
n = (this.s + this.c * t) | 0;
100 === n && (-1 === r.indexOf("atrix(") && -1 === r.indexOf("radient(") && -1 === r.indexOf("oader(") ? (i.removeAttribute("filter"), (e = !Z(this.data, "filter"))) : ((i.filter = r.replace(T, "")), (e = !0))),
e || (this.xn1 && (i.filter = r = r || "alpha(opacity=" + n + ")"), -1 === r.indexOf("pacity") ? (0 === n && this.xn1) || (i.filter = r + " alpha(opacity=" + n + ")") : (i.filter = r.replace(x, "opacity=" + n)));
};
bt("opacity,alpha,autoAlpha", {
defaultValue: "1",
parser: function (t, e, i, r, s, o) {
var a = parseFloat(Z(t, "opacity", n, !1, "1")),
l = t.style,
h = "autoAlpha" === i;
return (
"string" == typeof e && "=" === e.charAt(1) && (e = ("-" === e.charAt(0) ? -1 : 1) * parseFloat(e.substr(2)) + a),
h && 1 === a && "hidden" === Z(t, "visibility", n) && 0 !== e && (a = 0),
B
? (s = new mt(l, "opacity", a, e - a, s))
: ((s = new mt(l, "opacity", 100 * a, 100 * (e - a), s)),
(s.xn1 = h ? 1 : 0),
(l.zoom = 1),
(s.type = 2),
(s.b = "alpha(opacity=" + s.s + ")"),
(s.e = "alpha(opacity=" + (s.s + s.c) + ")"),
(s.data = t),
(s.plugin = o),
(s.setRatio = jt)),
h && ((s = new mt(l, "visibility", 0, 0, s, -1, null, !1, 0, 0 !== a ? "inherit" : "hidden", 0 === e ? "hidden" : "inherit")), (s.xs0 = "inherit"), r._overwriteProps.push(s.n), r._overwriteProps.push(i)),
s
);
},
});
var It = function (t, e) {
e && (t.removeProperty ? (("ms" === e.substr(0, 2) || "webkit" === e.substr(0, 6)) && (e = "-" + e), t.removeProperty(e.replace(C, "-$1").toLowerCase())) : t.removeAttribute(e));
},
Bt = function (t) {
if (((this.t._gsClassPT = this), 1 === t || 0 === t)) {
this.t.setAttribute("class", 0 === t ? this.b : this.e);
for (var e = this.data, i = this.t.style; e; ) e.v ? (i[e.p] = e.v) : It(i, e.p), (e = e._next);
1 === t && this.t._gsClassPT === this && (this.t._gsClassPT = null);
} else this.t.getAttribute("class") !== this.e && this.t.setAttribute("class", this.e);
};
bt("className", {
parser: function (t, e, r, s, o, a, l) {
var h,
c,
u,
d,
f,
p = t.getAttribute("class") || "",
m = t.style.cssText;
if (((o = s._classNamePT = new mt(t, r, 0, 0, o, 2)), (o.setRatio = Bt), (o.pr = -11), (i = !0), (o.b = p), (c = J(t, n)), (u = t._gsClassPT))) {
for (d = {}, f = u.data; f; ) (d[f.p] = 1), (f = f._next);
u.setRatio(1);
}
return (
(t._gsClassPT = o),
(o.e = "=" !== e.charAt(1) ? e : p.replace(new RegExp("\\s*\\b" + e.substr(2) + "\\b"), "") + ("+" === e.charAt(0) ? " " + e.substr(2) : "")),
t.setAttribute("class", o.e),
(h = $(t, c, J(t), l, d)),
t.setAttribute("class", p),
(o.data = h.firstMPT),
(t.style.cssText = m),
(o = o.xfirst = s.parse(t, h.difs, o, a))
);
},
});
var Vt = function (t) {
if ((1 === t || 0 === t) && this.data._totalTime === this.data._totalDuration && "isFromStart" !== this.data.data) {
var e,
i,
r,
n,
s,
o = this.t.style,
a = l.transform.parse;
if ("all" === this.e) (o.cssText = ""), (n = !0);
else for (e = this.e.split(" ").join("").split(","), r = e.length; --r > -1; ) (i = e[r]), l[i] && (l[i].parse === a ? (n = !0) : (i = "transformOrigin" === i ? St : l[i].p)), It(o, i);
n && (It(o, Et), (s = this.t._gsTransform), s && (s.svg && (this.t.removeAttribute("data-svg-origin"), this.t.removeAttribute("transform")), delete this.t._gsTransform));
}
};
for (
bt("clearProps", {
parser: function (t, e, r, n, s) {
return (s = new mt(t, r, 0, 0, s, 2)), (s.setRatio = Vt), (s.e = e), (s.pr = -10), (s.data = n._tween), (i = !0), s;
},
}),
h = "bezier,throwProps,physicsProps,physics2D".split(","),
gt = h.length;
gt--;
)
xt(h[gt]);
(h = o.prototype),
(h._firstPT = h._lastParsedTransform = h._transform = null),
(h._onInitTween = function (t, e, a) {
if (!t.nodeType) return !1;
(this._target = t), (this._tween = a), (this._vars = e), (c = e.autoRound), (i = !1), (r = e.suffixMap || o.suffixMap), (n = Y(t, "")), (s = this._overwriteProps);
var h,
f,
m,
_,
v,
g,
y,
b,
x,
T = t.style;
if (
(u && "" === T.zIndex && ((h = Z(t, "zIndex", n)), ("auto" === h || "" === h) && this._addLazySet(T, "zIndex", 0)),
"string" == typeof e && ((_ = T.cssText), (h = J(t, n)), (T.cssText = _ + ";" + e), (h = $(t, h, J(t)).difs), !B && w.test(e) && (h.opacity = parseFloat(RegExp.$1)), (e = h), (T.cssText = _)),
e.className ? (this._firstPT = f = l.className.parse(t, e.className, "className", this, null, null, e)) : (this._firstPT = f = this.parse(t, e, null)),
this._transformType)
) {
for (
x = 3 === this._transformType,
Et
? d &&
((u = !0),
"" === T.zIndex && ((y = Z(t, "zIndex", n)), ("auto" === y || "" === y) && this._addLazySet(T, "zIndex", 0)),
p && this._addLazySet(T, "WebkitBackfaceVisibility", this._vars.WebkitBackfaceVisibility || (x ? "visible" : "hidden")))
: (T.zoom = 1),
m = f;
m && m._next;
)
m = m._next;
(b = new mt(t, "transform", 0, 0, null, 2)), this._linkCSSP(b, null, m), (b.setRatio = Et ? Lt : Nt), (b.data = this._transform || zt(t, n, !0)), (b.tween = a), (b.pr = -1), s.pop();
}
if (i) {
for (; f; ) {
for (g = f._next, m = _; m && m.pr > f.pr; ) m = m._next;
(f._prev = m ? m._prev : v) ? (f._prev._next = f) : (_ = f), (f._next = m) ? (m._prev = f) : (v = f), (f = g);
}
this._firstPT = _;
}
return !0;
}),
(h.parse = function (t, e, i, s) {
var o,
a,
h,
u,
d,
f,
p,
m,
_,
v,
g = t.style;
for (o in e)
(f = e[o]),
(a = l[o]),
a
? (i = a.parse(t, f, o, this, i, s, e))
: ((d = Z(t, o, n) + ""),
(_ = "string" == typeof f),
"color" === o || "fill" === o || "stroke" === o || -1 !== o.indexOf("Color") || (_ && E.test(f))
? (_ || ((f = ht(f)), (f = (f.length > 3 ? "rgba(" : "rgb(") + f.join(",") + ")")), (i = vt(g, o, d, f, !0, "transparent", i, 0, s)))
: !_ || (-1 === f.indexOf(" ") && -1 === f.indexOf(","))
? ((h = parseFloat(d)),
(p = h || 0 === h ? d.substr((h + "").length) : ""),
("" === d || "auto" === d) &&
("width" === o || "height" === o ? ((h = it(t, o, n)), (p = "px")) : "left" === o || "top" === o ? ((h = Q(t, o, n)), (p = "px")) : ((h = "opacity" !== o ? 0 : 1), (p = ""))),
(v = _ && "=" === f.charAt(1)),
v ? ((u = parseInt(f.charAt(0) + "1", 10)), (f = f.substr(2)), (u *= parseFloat(f)), (m = f.replace(b, ""))) : ((u = parseFloat(f)), (m = _ ? f.replace(b, "") : "")),
"" === m && (m = o in r ? r[o] : p),
(f = u || 0 === u ? (v ? u + h : u) + m : e[o]),
p !== m &&
"" !== m &&
(u || 0 === u) &&
h &&
((h = K(t, o, h, p)),
"%" === m
? ((h /= K(t, o, 100, "%") / 100), e.strictUnits !== !0 && (d = h + "%"))
: "em" === m || "rem" === m || "vw" === m || "vh" === m
? (h /= K(t, o, 1, m))
: "px" !== m && ((u = K(t, o, u, m)), (m = "px")),
v && (u || 0 === u) && (f = u + h + m)),
v && (u += h),
(!h && 0 !== h) || (!u && 0 !== u)
? void 0 !== g[o] && (f || (f + "" != "NaN" && null != f))
? ((i = new mt(g, o, u || h || 0, 0, i, -1, o, !1, 0, d, f)), (i.xs0 = "none" !== f || ("display" !== o && -1 === o.indexOf("Style")) ? f : d))
: W("invalid " + o + " tween value: " + e[o])
: ((i = new mt(g, o, h, u - h, i, 0, o, c !== !1 && ("px" === m || "zIndex" === o), 0, d, f)), (i.xs0 = m)))
: (i = vt(g, o, d, f, !0, null, i, 0, s))),
s && i && !i.plugin && (i.plugin = s);
return i;
}),
(h.setRatio = function (t) {
var e,
i,
r,
n = this._firstPT,
s = 1e-6;
if (1 !== t || (this._tween._time !== this._tween._duration && 0 !== this._tween._time))
if (t || (this._tween._time !== this._tween._duration && 0 !== this._tween._time) || this._tween._rawPrevTime === -1e-6)
for (; n; ) {
if (((e = n.c * t + n.s), n.r ? (e = Math.round(e)) : s > e && e > -s && (e = 0), n.type))
if (1 === n.type)
if (((r = n.l), 2 === r)) n.t[n.p] = n.xs0 + e + n.xs1 + n.xn1 + n.xs2;
else if (3 === r) n.t[n.p] = n.xs0 + e + n.xs1 + n.xn1 + n.xs2 + n.xn2 + n.xs3;
else if (4 === r) n.t[n.p] = n.xs0 + e + n.xs1 + n.xn1 + n.xs2 + n.xn2 + n.xs3 + n.xn3 + n.xs4;
else if (5 === r) n.t[n.p] = n.xs0 + e + n.xs1 + n.xn1 + n.xs2 + n.xn2 + n.xs3 + n.xn3 + n.xs4 + n.xn4 + n.xs5;
else {
for (i = n.xs0 + e + n.xs1, r = 1; r < n.l; r++) i += n["xn" + r] + n["xs" + (r + 1)];
n.t[n.p] = i;
}
else -1 === n.type ? (n.t[n.p] = n.xs0) : n.setRatio && n.setRatio(t);
else n.t[n.p] = e + n.xs0;
n = n._next;
}
else for (; n; ) 2 !== n.type ? (n.t[n.p] = n.b) : n.setRatio(t), (n = n._next);
else
for (; n; ) {
if (2 !== n.type)
if (n.r && -1 !== n.type)
if (((e = Math.round(n.s + n.c)), n.type)) {
if (1 === n.type) {
for (r = n.l, i = n.xs0 + e + n.xs1, r = 1; r < n.l; r++) i += n["xn" + r] + n["xs" + (r + 1)];
n.t[n.p] = i;
}
} else n.t[n.p] = e + n.xs0;
else n.t[n.p] = n.e;
else n.setRatio(t);
n = n._next;
}
}),
(h._enableTransforms = function (t) {
(this._transform = this._transform || zt(this._target, n, !0)), (this._transformType = (this._transform.svg && wt) || (!t && 3 !== this._transformType) ? 2 : 3);
});
var Wt = function (t) {
(this.t[this.p] = this.e), this.data._linkCSSP(this, this._next, null, !0);
};
(h._addLazySet = function (t, e, i) {
var r = (this._firstPT = new mt(t, e, 0, 0, this._firstPT, 2));
(r.e = i), (r.setRatio = Wt), (r.data = this);
}),
(h._linkCSSP = function (t, e, i, r) {
return (
t &&
(e && (e._prev = t),
t._next && (t._next._prev = t._prev),
t._prev ? (t._prev._next = t._next) : this._firstPT === t && ((this._firstPT = t._next), (r = !0)),
i ? (i._next = t) : r || null !== this._firstPT || (this._firstPT = t),
(t._next = e),
(t._prev = i)),
t
);
}),
(h._kill = function (e) {
var i,
r,
n,
s = e;
if (e.autoAlpha || e.alpha) {
s = {};
for (r in e) s[r] = e[r];
(s.opacity = 1), s.autoAlpha && (s.visibility = 1);
}
return (
e.className &&
(i = this._classNamePT) &&
((n = i.xfirst),
n && n._prev ? this._linkCSSP(n._prev, i._next, n._prev._prev) : n === this._firstPT && (this._firstPT = i._next),
i._next && this._linkCSSP(i._next, i._next._next, n._prev),
(this._classNamePT = null)),
t.prototype._kill.call(this, s)
);
});
var Xt = function (t, e, i) {
var r, n, s, o;
if (t.slice) for (n = t.length; --n > -1; ) Xt(t[n], e, i);
else for (r = t.childNodes, n = r.length; --n > -1; ) (s = r[n]), (o = s.type), s.style && (e.push(J(s)), i && i.push(s)), (1 !== o && 9 !== o && 11 !== o) || !s.childNodes.length || Xt(s, e, i);
};
return (
(o.cascadeTo = function (t, i, r) {
var n,
s,
o,
a,
l = e.to(t, i, r),
h = [l],
c = [],
u = [],
d = [],
f = e._internals.reservedProps;
for (t = l._targets || l.target, Xt(t, c, d), l.render(i, !0, !0), Xt(t, u), l.render(0, !0, !0), l._enabled(!0), n = d.length; --n > -1; )
if (((s = $(d[n], c[n], u[n])), s.firstMPT)) {
s = s.difs;
for (o in r) f[o] && (s[o] = r[o]);
a = {};
for (o in s) a[o] = c[n][o];
h.push(e.fromTo(d[n], i, a, s));
}
return h;
}),
t.activate([o]),
o
);
},
!0
),
(function () {
var t = _gsScope._gsDefine.plugin({
propName: "roundProps",
version: "1.5",
priority: -1,
API: 2,
init: function (t, e, i) {
return (this._tween = i), !0;
},
}),
e = function (t) {
for (; t; ) t.f || t.blob || (t.r = 1), (t = t._next);
},
i = t.prototype;
(i._onInitAllProps = function () {
for (var t, i, r, n = this._tween, s = n.vars.roundProps.join ? n.vars.roundProps : n.vars.roundProps.split(","), o = s.length, a = {}, l = n._propLookup.roundProps; --o > -1; ) a[s[o]] = 1;
for (o = s.length; --o > -1; )
for (t = s[o], i = n._firstPT; i; )
(r = i._next),
i.pg
? i.t._roundProps(a, !0)
: i.n === t &&
(2 === i.f && i.t
? e(i.t._firstPT)
: (this._add(i.t, t, i.s, i.c), r && (r._prev = i._prev), i._prev ? (i._prev._next = r) : n._firstPT === i && (n._firstPT = r), (i._next = i._prev = null), (n._propLookup[t] = l))),
(i = r);
return !1;
}),
(i._add = function (t, e, i, r) {
this._addTween(t, e, i, i + r, e, !0), this._overwriteProps.push(e);
});
})(),
(function () {
_gsScope._gsDefine.plugin({
propName: "attr",
API: 2,
version: "0.5.0",
init: function (t, e, i) {
var r;
if ("function" != typeof t.setAttribute) return !1;
for (r in e) this._addTween(t, "setAttribute", t.getAttribute(r) + "", e[r] + "", r, !1, r), this._overwriteProps.push(r);
return !0;
},
});
})(),
(_gsScope._gsDefine.plugin({
propName: "directionalRotation",
version: "0.2.1",
API: 2,
init: function (t, e, i) {
"object" != typeof e && (e = { rotation: e }), (this.finals = {});
var r,
n,
s,
o,
a,
l,
h = e.useRadians === !0 ? 2 * Math.PI : 360,
c = 1e-6;
for (r in e)
"useRadians" !== r &&
((l = (e[r] + "").split("_")),
(n = l[0]),
(s = parseFloat("function" != typeof t[r] ? t[r] : t[r.indexOf("set") || "function" != typeof t["get" + r.substr(3)] ? r : "get" + r.substr(3)]())),
(o = this.finals[r] = "string" == typeof n && "=" === n.charAt(1) ? s + parseInt(n.charAt(0) + "1", 10) * Number(n.substr(2)) : Number(n) || 0),
(a = o - s),
l.length &&
((n = l.join("_")),
-1 !== n.indexOf("short") && ((a %= h), a !== a % (h / 2) && (a = 0 > a ? a + h : a - h)),
-1 !== n.indexOf("_cw") && 0 > a ? (a = ((a + 9999999999 * h) % h) - ((a / h) | 0) * h) : -1 !== n.indexOf("ccw") && a > 0 && (a = ((a - 9999999999 * h) % h) - ((a / h) | 0) * h)),
(a > c || -c > a) && (this._addTween(t, r, s, s + a, r), this._overwriteProps.push(r)));
return !0;
},
set: function (t) {
var e;
if (1 !== t) this._super.setRatio.call(this, t);
else for (e = this._firstPT; e; ) e.f ? e.t[e.p](this.finals[e.p]) : (e.t[e.p] = this.finals[e.p]), (e = e._next);
},
})._autoCSS = !0),
_gsScope._gsDefine(
"easing.Back",
["easing.Ease"],
function (t) {
var e,
i,
r,
n = _gsScope.GreenSockGlobals || _gsScope,
s = n.com.greensock,
o = 2 * Math.PI,
a = Math.PI / 2,
l = s._class,
h = function (e, i) {
var r = l("easing." + e, function () {}, !0),
n = (r.prototype = new t());
return (n.constructor = r), (n.getRatio = i), r;
},
c = t.register || function () {},
u = function (t, e, i, r, n) {
var s = l("easing." + t, { easeOut: new e(), easeIn: new i(), easeInOut: new r() }, !0);
return c(s, t), s;
},
d = function (t, e, i) {
(this.t = t), (this.v = e), i && ((this.next = i), (i.prev = this), (this.c = i.v - e), (this.gap = i.t - t));
},
f = function (e, i) {
var r = l(
"easing." + e,
function (t) {
(this._p1 = t || 0 === t ? t : 1.70158), (this._p2 = 1.525 * this._p1);
},
!0
),
n = (r.prototype = new t());
return (
(n.constructor = r),
(n.getRatio = i),
(n.config = function (t) {
return new r(t);
}),
r
);
},
p = u(
"Back",
f("BackOut", function (t) {
return (t -= 1) * t * ((this._p1 + 1) * t + this._p1) + 1;
}),
f("BackIn", function (t) {
return t * t * ((this._p1 + 1) * t - this._p1);
}),
f("BackInOut", function (t) {
return (t *= 2) < 1 ? 0.5 * t * t * ((this._p2 + 1) * t - this._p2) : 0.5 * ((t -= 2) * t * ((this._p2 + 1) * t + this._p2) + 2);
})
),
m = l(
"easing.SlowMo",
function (t, e, i) {
(e = e || 0 === e ? e : 0.7), null == t ? (t = 0.7) : t > 1 && (t = 1), (this._p = 1 !== t ? e : 0), (this._p1 = (1 - t) / 2), (this._p2 = t), (this._p3 = this._p1 + this._p2), (this._calcEnd = i === !0);
},
!0
),
_ = (m.prototype = new t());
return (
(_.constructor = m),
(_.getRatio = function (t) {
var e = t + (0.5 - t) * this._p;
return t < this._p1
? this._calcEnd
? 1 - (t = 1 - t / this._p1) * t
: e - (t = 1 - t / this._p1) * t * t * t * e
: t > this._p3
? this._calcEnd
? 1 - (t = (t - this._p3) / this._p1) * t
: e + (t - e) * (t = (t - this._p3) / this._p1) * t * t * t
: this._calcEnd
? 1
: e;
}),
(m.ease = new m(0.7, 0.7)),
(_.config = m.config = function (t, e, i) {
return new m(t, e, i);
}),
(e = l(
"easing.SteppedEase",
function (t) {
(t = t || 1), (this._p1 = 1 / t), (this._p2 = t + 1);
},
!0
)),
(_ = e.prototype = new t()),
(_.constructor = e),
(_.getRatio = function (t) {
return 0 > t ? (t = 0) : t >= 1 && (t = 0.999999999), ((this._p2 * t) >> 0) * this._p1;
}),
(_.config = e.config = function (t) {
return new e(t);
}),
(i = l(
"easing.RoughEase",
function (e) {
e = e || {};
for (
var i,
r,
n,
s,
o,
a,
l = e.taper || "none",
h = [],
c = 0,
u = 0 | (e.points || 20),
f = u,
p = e.randomize !== !1,
m = e.clamp === !0,
_ = e.template instanceof t ? e.template : null,
v = "number" == typeof e.strength ? 0.4 * e.strength : 0.4;
--f > -1;
)
(i = p ? Math.random() : (1 / u) * f),
(r = _ ? _.getRatio(i) : i),
"none" === l ? (n = v) : "out" === l ? ((s = 1 - i), (n = s * s * v)) : "in" === l ? (n = i * i * v) : 0.5 > i ? ((s = 2 * i), (n = s * s * 0.5 * v)) : ((s = 2 * (1 - i)), (n = s * s * 0.5 * v)),
p ? (r += Math.random() * n - 0.5 * n) : f % 2 ? (r += 0.5 * n) : (r -= 0.5 * n),
m && (r > 1 ? (r = 1) : 0 > r && (r = 0)),
(h[c++] = { x: i, y: r });
for (
h.sort(function (t, e) {
return t.x - e.x;
}),
a = new d(1, 1, null),
f = u;
--f > -1;
)
(o = h[f]), (a = new d(o.x, o.y, a));
this._prev = new d(0, 0, 0 !== a.t ? a : a.next);
},
!0
)),
(_ = i.prototype = new t()),
(_.constructor = i),
(_.getRatio = function (t) {
var e = this._prev;
if (t > e.t) {
for (; e.next && t >= e.t; ) e = e.next;
e = e.prev;
} else for (; e.prev && t <= e.t; ) e = e.prev;
return (this._prev = e), e.v + ((t - e.t) / e.gap) * e.c;
}),
(_.config = function (t) {
return new i(t);
}),
(i.ease = new i()),
u(
"Bounce",
h("BounceOut", function (t) {
return 1 / 2.75 > t ? 7.5625 * t * t : 2 / 2.75 > t ? 7.5625 * (t -= 1.5 / 2.75) * t + 0.75 : 2.5 / 2.75 > t ? 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375 : 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375;
}),
h("BounceIn", function (t) {
return (t = 1 - t) < 1 / 2.75
? 1 - 7.5625 * t * t
: 2 / 2.75 > t
? 1 - (7.5625 * (t -= 1.5 / 2.75) * t + 0.75)
: 2.5 / 2.75 > t
? 1 - (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375)
: 1 - (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375);
}),
h("BounceInOut", function (t) {
var e = 0.5 > t;
return (
(t = e ? 1 - 2 * t : 2 * t - 1),
(t = 1 / 2.75 > t ? 7.5625 * t * t : 2 / 2.75 > t ? 7.5625 * (t -= 1.5 / 2.75) * t + 0.75 : 2.5 / 2.75 > t ? 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375 : 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375),
e ? 0.5 * (1 - t) : 0.5 * t + 0.5
);
})
),
u(
"Circ",
h("CircOut", function (t) {
return Math.sqrt(1 - (t -= 1) * t);
}),
h("CircIn", function (t) {
return -(Math.sqrt(1 - t * t) - 1);
}),
h("CircInOut", function (t) {
return (t *= 2) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);
})
),
(r = function (e, i, r) {
var n = l(
"easing." + e,
function (t, e) {
(this._p1 = t >= 1 ? t : 1), (this._p2 = (e || r) / (1 > t ? t : 1)), (this._p3 = (this._p2 / o) * (Math.asin(1 / this._p1) || 0)), (this._p2 = o / this._p2);
},
!0
),
s = (n.prototype = new t());
return (
(s.constructor = n),
(s.getRatio = i),
(s.config = function (t, e) {
return new n(t, e);
}),
n
);
}),
u(
"Elastic",
r(
"ElasticOut",
function (t) {
return this._p1 * Math.pow(2, -10 * t) * Math.sin((t - this._p3) * this._p2) + 1;
},
0.3
),
r(
"ElasticIn",
function (t) {
return -(this._p1 * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - this._p3) * this._p2));
},
0.3
),
r(
"ElasticInOut",
function (t) {
return (t *= 2) < 1 ? -0.5 * (this._p1 * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - this._p3) * this._p2)) : this._p1 * Math.pow(2, -10 * (t -= 1)) * Math.sin((t - this._p3) * this._p2) * 0.5 + 1;
},
0.45
)
),
u(
"Expo",
h("ExpoOut", function (t) {
return 1 - Math.pow(2, -10 * t);
}),
h("ExpoIn", function (t) {
return Math.pow(2, 10 * (t - 1)) - 0.001;
}),
h("ExpoInOut", function (t) {
return (t *= 2) < 1 ? 0.5 * Math.pow(2, 10 * (t - 1)) : 0.5 * (2 - Math.pow(2, -10 * (t - 1)));
})
),
u(
"Sine",
h("SineOut", function (t) {
return Math.sin(t * a);
}),
h("SineIn", function (t) {
return -Math.cos(t * a) + 1;
}),
h("SineInOut", function (t) {
return -0.5 * (Math.cos(Math.PI * t) - 1);
})
),
l(
"easing.EaseLookup",
{
find: function (e) {
return t.map[e];
},
},
!0
),
c(n.SlowMo, "SlowMo", "ease,"),
c(i, "RoughEase", "ease,"),
c(e, "SteppedEase", "ease,"),
p
);
},
!0
);
}),
_gsScope._gsDefine && _gsScope._gsQueue.pop()(),
(function (t, e) {
"use strict";
var i = (t.GreenSockGlobals = t.GreenSockGlobals || t);
if (!i.TweenLite) {
var r,
n,
s,
o,
a,
l = function (t) {
var e,
r = t.split("."),
n = i;
for (e = 0; e < r.length; e++) n[r[e]] = n = n[r[e]] || {};
return n;
},
h = l("com.greensock"),
c = 1e-10,
u = function (t) {
var e,
i = [],
r = t.length;
for (e = 0; e !== r; i.push(t[e++]));
return i;
},
d = function () {},
f = (function () {
var t = Object.prototype.toString,
e = t.call([]);
return function (i) {
return null != i && (i instanceof Array || ("object" == typeof i && !!i.push && t.call(i) === e));
};
})(),
p = {},
m = function (r, n, s, o) {
(this.sc = p[r] ? p[r].sc : []), (p[r] = this), (this.gsClass = null), (this.func = s);
var a = [];
(this.check = function (h) {
for (var c, u, d, f, _, v = n.length, g = v; --v > -1; ) (c = p[n[v]] || new m(n[v], [])).gsClass ? ((a[v] = c.gsClass), g--) : h && c.sc.push(this);
if (0 === g && s)
for (
u = ("com.greensock." + r).split("."),
d = u.pop(),
f = l(u.join("."))[d] = this.gsClass = s.apply(s, a),
o &&
((i[d] = f),
(_ = "undefined" != typeof module && module.exports),
!_ && "function" == typeof define && define.amd
? define((t.GreenSockAMDPath ? t.GreenSockAMDPath + "/" : "") + r.split(".").pop(), [], function () {
return f;
})
: r === e && _ && (module.exports = f)),
v = 0;
v < this.sc.length;
v++
)
this.sc[v].check();
}),
this.check(!0);
},
_ = (t._gsDefine = function (t, e, i, r) {
return new m(t, e, i, r);
}),
v = (h._class = function (t, e, i) {
return (
(e = e || function () {}),
_(
t,
[],
function () {
return e;
},
i
),
e
);
});
_.globals = i;
var g = [0, 0, 1, 1],
y = [],
b = v(
"easing.Ease",
function (t, e, i, r) {
(this._func = t), (this._type = i || 0), (this._power = r || 0), (this._params = e ? g.concat(e) : g);
},
!0
),
x = (b.map = {}),
w = (b.register = function (t, e, i, r) {
for (var n, s, o, a, l = e.split(","), c = l.length, u = (i || "easeIn,easeOut,easeInOut").split(","); --c > -1; )
for (s = l[c], n = r ? v("easing." + s, null, !0) : h.easing[s] || {}, o = u.length; --o > -1; ) (a = u[o]), (x[s + "." + a] = x[a + s] = n[a] = t.getRatio ? t : t[a] || new t());
});
for (
s = b.prototype,
s._calcEnd = !1,
s.getRatio = function (t) {
if (this._func) return (this._params[0] = t), this._func.apply(null, this._params);
var e = this._type,
i = this._power,
r = 1 === e ? 1 - t : 2 === e ? t : 0.5 > t ? 2 * t : 2 * (1 - t);
return 1 === i ? (r *= r) : 2 === i ? (r *= r * r) : 3 === i ? (r *= r * r * r) : 4 === i && (r *= r * r * r * r), 1 === e ? 1 - r : 2 === e ? r : 0.5 > t ? r / 2 : 1 - r / 2;
},
r = ["Linear", "Quad", "Cubic", "Quart", "Quint,Strong"],
n = r.length;
--n > -1;
)
(s = r[n] + ",Power" + n), w(new b(null, null, 1, n), s, "easeOut", !0), w(new b(null, null, 2, n), s, "easeIn" + (0 === n ? ",easeNone" : "")), w(new b(null, null, 3, n), s, "easeInOut");
(x.linear = h.easing.Linear.easeIn), (x.swing = h.easing.Quad.easeInOut);
var T = v("events.EventDispatcher", function (t) {
(this._listeners = {}), (this._eventTarget = t || this);
});
(s = T.prototype),
(s.addEventListener = function (t, e, i, r, n) {
n = n || 0;
var s,
l,
h = this._listeners[t],
c = 0;
for (null == h && (this._listeners[t] = h = []), l = h.length; --l > -1; ) (s = h[l]), s.c === e && s.s === i ? h.splice(l, 1) : 0 === c && s.pr < n && (c = l + 1);
h.splice(c, 0, { c: e, s: i, up: r, pr: n }), this !== o || a || o.wake();
}),
(s.removeEventListener = function (t, e) {
var i,
r = this._listeners[t];
if (r) for (i = r.length; --i > -1; ) if (r[i].c === e) return void r.splice(i, 1);
}),
(s.dispatchEvent = function (t) {
var e,
i,
r,
n = this._listeners[t];
if (n) for (e = n.length, i = this._eventTarget; --e > -1; ) (r = n[e]), r && (r.up ? r.c.call(r.s || i, { type: t, target: i }) : r.c.call(r.s || i));
});
var E = t.requestAnimationFrame,
C = t.cancelAnimationFrame,
S =
Date.now ||
function () {
return new Date().getTime();
},
R = S();
for (r = ["ms", "moz", "webkit", "o"], n = r.length; --n > -1 && !E; ) (E = t[r[n] + "RequestAnimationFrame"]), (C = t[r[n] + "CancelAnimationFrame"] || t[r[n] + "CancelRequestAnimationFrame"]);
v("Ticker", function (t, e) {
var i,
r,
n,
s,
l,
h = this,
u = S(),
f = !(e === !1 || !E) && "auto",
p = 500,
m = 33,
_ = "tick",
v = function (t) {
var e,
o,
a = S() - R;
a > p && (u += a - m), (R += a), (h.time = (R - u) / 1e3), (e = h.time - l), (!i || e > 0 || t === !0) && (h.frame++, (l += e + (e >= s ? 0.004 : s - e)), (o = !0)), t !== !0 && (n = r(v)), o && h.dispatchEvent(_);
};
T.call(h),
(h.time = h.frame = 0),
(h.tick = function () {
v(!0);
}),
(h.lagSmoothing = function (t, e) {
(p = t || 1 / c), (m = Math.min(e, p, 0));
}),
(h.sleep = function () {
null != n && (f && C ? C(n) : clearTimeout(n), (r = d), (n = null), h === o && (a = !1));
}),
(h.wake = function (t) {
null !== n ? h.sleep() : t ? (u += -R + (R = S())) : h.frame > 10 && (R = S() - p + 5),
(r =
0 === i
? d
: f && E
? E
: function (t) {
return setTimeout(t, (1e3 * (l - h.time) + 1) | 0);
}),
h === o && (a = !0),
v(2);
}),
(h.fps = function (t) {
return arguments.length ? ((i = t), (s = 1 / (i || 60)), (l = this.time + s), void h.wake()) : i;
}),
(h.useRAF = function (t) {
return arguments.length ? (h.sleep(), (f = t), void h.fps(i)) : f;
}),
h.fps(t),
setTimeout(function () {
"auto" === f && h.frame < 5 && "hidden" !== document.visibilityState && h.useRAF(!1);
}, 1500);
}),
(s = h.Ticker.prototype = new h.events.EventDispatcher()),
(s.constructor = h.Ticker);
var k = v("core.Animation", function (t, e) {
if (
((this.vars = e = e || {}),
(this._duration = this._totalDuration = t || 0),
(this._delay = Number(e.delay) || 0),
(this._timeScale = 1),
(this._active = e.immediateRender === !0),
(this.data = e.data),
(this._reversed = e.reversed === !0),
q)
) {
a || o.wake();
var i = this.vars.useFrames ? G : q;
i.add(this, i._time), this.vars.paused && this.paused(!0);
}
});
(o = k.ticker = new h.Ticker()),
(s = k.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 P = function () {
a && S() - R > 2e3 && o.wake(), setTimeout(P, 2e3);
};
P(),
(s.play = function (t, e) {
return null != t && this.seek(t, e), this.reversed(!1).paused(!1);
}),
(s.pause = function (t, e) {
return null != t && this.seek(t, e), this.paused(!0);
}),
(s.resume = function (t, e) {
return null != t && this.seek(t, e), this.paused(!1);
}),
(s.seek = function (t, e) {
return this.totalTime(Number(t), e !== !1);
}),
(s.restart = function (t, e) {
return this.reversed(!1)
.paused(!1)
.totalTime(t ? -this._delay : 0, e !== !1, !0);
}),
(s.reverse = function (t, e) {
return null != t && this.seek(t || this.totalDuration(), e), this.reversed(!0).paused(!1);
}),
(s.render = function (t, e, i) {}),
(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 t,
e = this._timeline,
i = this._startTime;
return !e || (!this._gc && !this._paused && e.isActive() && (t = e.rawTime()) >= i && t < i + this.totalDuration() / this._timeScale);
}),
(s._enabled = function (t, e) {
return (
a || o.wake(),
(this._gc = !t),
(this._active = this.isActive()),
e !== !0 && (t && !this.timeline ? this._timeline.add(this, this._startTime - this._delay) : !t && this.timeline && this._timeline._remove(this, !0)),
!1
);
}),
(s._kill = function (t, e) {
return this._enabled(!1, !1);
}),
(s.kill = function (t, e) {
return this._kill(t, e), this;
}),
(s._uncache = function (t) {
for (var e = t ? this : this.timeline; e; ) (e._dirty = !0), (e = e.timeline);
return this;
}),
(s._swapSelfInParams = function (t) {
for (var e = t.length, i = t.concat(); --e > -1; ) "{self}" === t[e] && (i[e] = this);
return i;
}),
(s._callback = function (t) {
var e = this.vars;
e[t].apply(e[t + "Scope"] || e.callbackScope || this, e[t + "Params"] || y);
}),
(s.eventCallback = function (t, e, i, r) {
if ("on" === (t || "").substr(0, 2)) {
var n = this.vars;
if (1 === arguments.length) return n[t];
null == e ? delete n[t] : ((n[t] = e), (n[t + "Params"] = f(i) && -1 !== i.join("").indexOf("{self}") ? this._swapSelfInParams(i) : i), (n[t + "Scope"] = r)), "onUpdate" === t && (this._onUpdate = e);
}
return this;
}),
(s.delay = function (t) {
return arguments.length ? (this._timeline.smoothChildTiming && this.startTime(this._startTime + t - this._delay), (this._delay = t), this) : this._delay;
}),
(s.duration = function (t) {
return arguments.length
? ((this._duration = this._totalDuration = t),
this._uncache(!0),
this._timeline.smoothChildTiming && this._time > 0 && this._time < this._duration && 0 !== t && this.totalTime(this._totalTime * (t / this._duration), !0),
this)
: ((this._dirty = !1), this._duration);
}),
(s.totalDuration = function (t) {
return (this._dirty = !1), arguments.length ? this.duration(t) : this._totalDuration;
}),
(s.time = function (t, e) {
return arguments.length ? (this._dirty && this.totalDuration(), this.totalTime(t > this._duration ? this._duration : t, e)) : this._time;
}),
(s.totalTime = function (t, e, i) {
if ((a || o.wake(), !arguments.length)) return this._totalTime;
if (this._timeline) {
if ((0 > t && !i && (t += this.totalDuration()), this._timeline.smoothChildTiming)) {
this._dirty && this.totalDuration();
var r = this._totalDuration,
n = this._timeline;
if ((t > r && !i && (t = r), (this._startTime = (this._paused ? this._pauseTime : n._time) - (this._reversed ? r - t : t) / this._timeScale), n._dirty || this._uncache(!1), n._timeline))
for (; n._timeline; ) n._timeline._time !== (n._startTime + n._totalTime) / n._timeScale && n.totalTime(n._totalTime, !0), (n = n._timeline);
}
this._gc && this._enabled(!0, !1), (this._totalTime !== t || 0 === this._duration) && (H.length && Z(), this.render(t, e, !1), H.length && Z());
}
return this;
}),
(s.progress = s.totalProgress = function (t, e) {
var i = this.duration();
return arguments.length ? this.totalTime(i * t, e) : i ? this._time / i : this.ratio;
}),
(s.startTime = function (t) {
return arguments.length ? (t !== this._startTime && ((this._startTime = t), this.timeline && this.timeline._sortChildren && this.timeline.add(this, t - this._delay)), this) : this._startTime;
}),
(s.endTime = function (t) {
return this._startTime + (0 != t ? this.totalDuration() : this.duration()) / this._timeScale;
}),
(s.timeScale = function (t) {
if (!arguments.length) return this._timeScale;
if (((t = t || c), this._timeline && this._timeline.smoothChildTiming)) {
var e = this._pauseTime,
i = e || 0 === e ? e : this._timeline.totalTime();
this._startTime = i - ((i - this._startTime) * this._timeScale) / t;
}
return (this._timeScale = t), this._uncache(!1);
}),
(s.reversed = function (t) {
return arguments.length
? (t != this._reversed && ((this._reversed = t), this.totalTime(this._timeline && !this._timeline.smoothChildTiming ? this.totalDuration() - this._totalTime : this._totalTime, !0)), this)
: this._reversed;
}),
(s.paused = function (t) {
if (!arguments.length) return this._paused;
var e,
i,
r = this._timeline;
return (
t != this._paused &&
r &&
(a || t || o.wake(),
(e = r.rawTime()),
(i = e - this._pauseTime),
!t && r.smoothChildTiming && ((this._startTime += i), this._uncache(!1)),
(this._pauseTime = t ? e : null),
(this._paused = t),
(this._active = this.isActive()),
!t && 0 !== i && this._initted && this.duration() && ((e = r.smoothChildTiming ? this._totalTime : (e - this._startTime) / this._timeScale), this.render(e, e === this._totalTime, !0))),
this._gc && !t && this._enabled(!0, !1),
this
);
});
var D = v("core.SimpleTimeline", function (t) {
k.call(this, 0, t), (this.autoRemoveChildren = this.smoothChildTiming = !0);
});
(s = D.prototype = new k()),
(s.constructor = D),
(s.kill()._gc = !1),
(s._first = s._last = s._recent = null),
(s._sortChildren = !1),
(s.add = s.insert = function (t, e, i, r) {
var n, s;
if (
((t._startTime = Number(e || 0) + t._delay),
t._paused && this !== t._timeline && (t._pauseTime = t._startTime + (this.rawTime() - t._startTime) / t._timeScale),
t.timeline && t.timeline._remove(t, !0),
(t.timeline = t._timeline = this),
t._gc && t._enabled(!0, !0),
(n = this._last),
this._sortChildren)
)
for (s = t._startTime; n && n._startTime > s; ) n = n._prev;
return (
n ? ((t._next = n._next), (n._next = t)) : ((t._next = this._first), (this._first = t)), t._next ? (t._next._prev = t) : (this._last = t), (t._prev = n), (this._recent = t), this._timeline && this._uncache(!0), this
);
}),
(s._remove = function (t, e) {
return (
t.timeline === this &&
(e || t._enabled(!1, !0),
t._prev ? (t._prev._next = t._next) : this._first === t && (this._first = t._next),
t._next ? (t._next._prev = t._prev) : this._last === t && (this._last = t._prev),
(t._next = t._prev = t.timeline = null),
t === this._recent && (this._recent = this._last),
this._timeline && this._uncache(!0)),
this
);
}),
(s.render = function (t, e, i) {
var r,
n = this._first;
for (this._totalTime = this._time = this._rawPrevTime = t; n; )
(r = n._next),
(n._active || (t >= n._startTime && !n._paused)) &&
(n._reversed ? n.render((n._dirty ? n.totalDuration() : n._totalDuration) - (t - n._startTime) * n._timeScale, e, i) : n.render((t - n._startTime) * n._timeScale, e, i)),
(n = r);
}),
(s.rawTime = function () {
return a || o.wake(), this._totalTime;
});
var A = v(
"TweenLite",
function (e, i, r) {
if ((k.call(this, i, r), (this.render = A.prototype.render), null == e)) throw "Cannot tween a null target.";
this.target = e = "string" != typeof e ? e : A.selector(e) || e;
var n,
s,
o,
a = e.jquery || (e.length && e !== t && e[0] && (e[0] === t || (e[0].nodeType && e[0].style && !e.nodeType))),
l = this.vars.overwrite;
if (((this._overwrite = l = null == l ? X[A.defaultOverwrite] : "number" == typeof l ? l >> 0 : X[l]), (a || e instanceof Array || (e.push && f(e))) && "number" != typeof e[0]))
for (this._targets = o = u(e), this._propLookup = [], this._siblings = [], n = 0; n < o.length; n++)
(s = o[n]),
s
? "string" != typeof s
? s.length && s !== t && s[0] && (s[0] === t || (s[0].nodeType && s[0].style && !s.nodeType))
? (o.splice(n--, 1), (this._targets = o = o.concat(u(s))))
: ((this._siblings[n] = K(s, this, !1)), 1 === l && this._siblings[n].length > 1 && J(s, this, null, 1, this._siblings[n]))
: ((s = o[n--] = A.selector(s)), "string" == typeof s && o.splice(n + 1, 1))
: o.splice(n--, 1);
else (this._propLookup = {}), (this._siblings = K(e, this, !1)), 1 === l && this._siblings.length > 1 && J(e, this, null, 1, this._siblings);
(this.vars.immediateRender || (0 === i && 0 === this._delay && this.vars.immediateRender !== !1)) && ((this._time = -c), this.render(-this._delay));
},
!0
),
M = function (e) {
return e && e.length && e !== t && e[0] && (e[0] === t || (e[0].nodeType && e[0].style && !e.nodeType));
},
O = function (t, e) {
var i,
r = {};
for (i in t)
W[i] || (i in e && "transform" !== i && "x" !== i && "y" !== i && "width" !== i && "height" !== i && "className" !== i && "border" !== i) || !(!I[i] || (I[i] && I[i]._autoCSS)) || ((r[i] = t[i]), delete t[i]);
t.css = r;
};
(s = A.prototype = new k()),
(s.constructor = A),
(s.kill()._gc = !1),
(s.ratio = 0),
(s._firstPT = s._targets = s._overwrittenProps = s._startAt = null),
(s._notifyPluginsOfEnabled = s._lazy = !1),
(A.version = "1.18.2"),
(A.defaultEase = s._ease = new b(null, null, 1, 1)),
(A.defaultOverwrite = "auto"),
(A.ticker = o),
(A.autoSleep = 120),
(A.lagSmoothing = function (t, e) {
o.lagSmoothing(t, e);
}),
(A.selector =
t.$ ||
t.jQuery ||
function (e) {
var i = t.$ || t.jQuery;
return i ? ((A.selector = i), i(e)) : "undefined" == typeof document ? e : document.querySelectorAll ? document.querySelectorAll(e) : document.getElementById("#" === e.charAt(0) ? e.substr(1) : e);
});
var H = [],
U = {},
F = /(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,
z = function (t) {
for (var e, i = this._firstPT, r = 1e-6; i; )
(e = i.blob ? (t ? this.join("") : this.start) : i.c * t + i.s), i.r ? (e = Math.round(e)) : r > e && e > -r && (e = 0), i.f ? (i.fp ? i.t[i.p](i.fp, e) : i.t[i.p](e)) : (i.t[i.p] = e), (i = i._next);
},
N = function (t, e, i, r) {
var n,
s,
o,
a,
l,
h,
c,
u = [t, e],
d = 0,
f = "",
p = 0;
for (u.start = t, i && (i(u), (t = u[0]), (e = u[1])), u.length = 0, n = t.match(F) || [], s = e.match(F) || [], r && ((r._next = null), (r.blob = 1), (u._firstPT = r)), l = s.length, a = 0; l > a; a++)
(c = s[a]),
(h = e.substr(d, e.indexOf(c, d) - d)),
(f += h || !a ? h : ","),
(d += h.length),
p ? (p = (p + 1) % 5) : "rgba(" === h.substr(-5) && (p = 1),
c === n[a] || n.length <= a
? (f += c)
: (f && (u.push(f), (f = "")),
(o = parseFloat(n[a])),
u.push(o),
(u._firstPT = { _next: u._firstPT, t: u, p: u.length - 1, s: o, c: ("=" === c.charAt(1) ? parseInt(c.charAt(0) + "1", 10) * parseFloat(c.substr(2)) : parseFloat(c) - o) || 0, f: 0, r: p && 4 > p })),
(d += c.length);
return (f += e.substr(d)), f && u.push(f), (u.setRatio = z), u;
},
L = function (t, e, i, r, n, s, o, a) {
var l,
h,
c = "get" === i ? t[e] : i,
u = typeof t[e],
d = "string" == typeof r && "=" === r.charAt(1),
f = { t: t, p: e, s: c, f: "function" === u, pg: 0, n: n || e, r: s, pr: 0, c: d ? parseInt(r.charAt(0) + "1", 10) * parseFloat(r.substr(2)) : parseFloat(r) - c || 0 };
return (
"number" !== u &&
("function" === u && "get" === i && ((h = e.indexOf("set") || "function" != typeof t["get" + e.substr(3)] ? e : "get" + e.substr(3)), (f.s = c = o ? t[h](o) : t[h]())),
"string" == typeof c && (o || isNaN(c))
? ((f.fp = o), (l = N(c, r, a || A.defaultStringFilter, f)), (f = { t: l, p: "setRatio", s: 0, c: 1, f: 2, pg: 0, n: n || e, pr: 0 }))
: d || ((f.s = parseFloat(c)), (f.c = parseFloat(r) - f.s || 0))),
f.c ? ((f._next = this._firstPT) && (f._next._prev = f), (this._firstPT = f), f) : void 0
);
},
j = (A._internals = { isArray: f, isSelector: M, lazyTweens: H, blobDif: N }),
I = (A._plugins = {}),
B = (j.tweenLookup = {}),
V = 0,
W = (j.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,
callbackScope: 1,
stringFilter: 1,
}),
X = { none: 0, all: 1, auto: 2, concurrent: 3, allOnStart: 4, preexisting: 5, true: 1, false: 0 },
G = (k._rootFramesTimeline = new D()),
q = (k._rootTimeline = new D()),
Y = 30,
Z = (j.lazyRender = function () {
var t,
e = H.length;
for (U = {}; --e > -1; ) (t = H[e]), t && t._lazy !== !1 && (t.render(t._lazy[0], t._lazy[1], !0), (t._lazy = !1));
H.length = 0;
});
(q._startTime = o.time),
(G._startTime = o.frame),
(q._active = G._active = !0),
setTimeout(Z, 1),
(k._updateRoot = A.render = function () {
var t, e, i;
if ((H.length && Z(), q.render((o.time - q._startTime) * q._timeScale, !1, !1), G.render((o.frame - G._startTime) * G._timeScale, !1, !1), H.length && Z(), o.frame >= Y)) {
Y = o.frame + (parseInt(A.autoSleep, 10) || 120);
for (i in B) {
for (e = B[i].tweens, t = e.length; --t > -1; ) e[t]._gc && e.splice(t, 1);
0 === e.length && delete B[i];
}
if (((i = q._first), (!i || i._paused) && A.autoSleep && !G._first && 1 === o._listeners.tick.length)) {
for (; i && i._paused; ) i = i._next;
i || o.sleep();
}
}
}),
o.addEventListener("tick", k._updateRoot);
var K = function (t, e, i) {
var r,
n,
s = t._gsTweenID;
if ((B[s || (t._gsTweenID = s = "t" + V++)] || (B[s] = { target: t, tweens: [] }), e && ((r = B[s].tweens), (r[(n = r.length)] = e), i))) for (; --n > -1; ) r[n] === e && r.splice(n, 1);
return B[s].tweens;
},
Q = function (t, e, i, r) {
var n,
s,
o = t.vars.onOverwrite;
return o && (n = o(t, e, i, r)), (o = A.onOverwrite), o && (s = o(t, e, i, r)), n !== !1 && s !== !1;
},
J = function (t, e, i, r, n) {
var s, o, a, l;
if (1 === r || r >= 4) {
for (l = n.length, s = 0; l > s; s++)
if ((a = n[s]) !== e) a._gc || (a._kill(null, t, e) && (o = !0));
else if (5 === r) break;
return o;
}
var h,
u = e._startTime + c,
d = [],
f = 0,
p = 0 === e._duration;
for (s = n.length; --s > -1; )
(a = n[s]) === e ||
a._gc ||
a._paused ||
(a._timeline !== e._timeline
? ((h = h || $(e, 0, p)), 0 === $(a, h, p) && (d[f++] = a))
: a._startTime <= u && a._startTime + a.totalDuration() / a._timeScale > u && (((p || !a._initted) && u - a._startTime <= 2e-10) || (d[f++] = a)));
for (s = f; --s > -1; )
if (((a = d[s]), 2 === r && a._kill(i, t, e) && (o = !0), 2 !== r || (!a._firstPT && a._initted))) {
if (2 !== r && !Q(a, e)) continue;
a._enabled(!1, !1) && (o = !0);
}
return o;
},
$ = function (t, e, i) {
for (var r = t._timeline, n = r._timeScale, s = t._startTime; r._timeline; ) {
if (((s += r._startTime), (n *= r._timeScale), r._paused)) return -100;
r = r._timeline;
}
return (s /= n), s > e ? s - e : (i && s === e) || (!t._initted && 2 * c > s - e) ? c : (s += t.totalDuration() / t._timeScale / n) > e + c ? 0 : s - e - c;
};
(s._init = function () {
var t,
e,
i,
r,
n,
s = this.vars,
o = this._overwrittenProps,
a = this._duration,
l = !!s.immediateRender,
h = s.ease;
if (s.startAt) {
this._startAt && (this._startAt.render(-1, !0), this._startAt.kill()), (n = {});
for (r in s.startAt) n[r] = s.startAt[r];
if (((n.overwrite = !1), (n.immediateRender = !0), (n.lazy = l && s.lazy !== !1), (n.startAt = n.delay = null), (this._startAt = A.to(this.target, 0, n)), l))
if (this._time > 0) this._startAt = null;
else if (0 !== a) return;
} else if (s.runBackwards && 0 !== a)
if (this._startAt) this._startAt.render(-1, !0), this._startAt.kill(), (this._startAt = null);
else {
0 !== this._time && (l = !1), (i = {});
for (r in s) (W[r] && "autoCSS" !== r) || (i[r] = s[r]);
if (((i.overwrite = 0), (i.data = "isFromStart"), (i.lazy = l && s.lazy !== !1), (i.immediateRender = l), (this._startAt = A.to(this.target, 0, i)), l)) {
if (0 === this._time) return;
} else this._startAt._init(), this._startAt._enabled(!1), this.vars.immediateRender && (this._startAt = null);
}
if (
((this._ease = h = h ? (h instanceof b ? h : "function" == typeof h ? new b(h, s.easeParams) : x[h] || A.defaultEase) : A.defaultEase),
s.easeParams instanceof Array && h.config && (this._ease = h.config.apply(h, s.easeParams)),
(this._easeType = this._ease._type),
(this._easePower = this._ease._power),
(this._firstPT = null),
this._targets)
)
for (t = this._targets.length; --t > -1; ) this._initProps(this._targets[t], (this._propLookup[t] = {}), this._siblings[t], o ? o[t] : null) && (e = !0);
else e = this._initProps(this.target, this._propLookup, this._siblings, o);
if ((e && A._onPluginEvent("_onInitAllProps", this), o && (this._firstPT || ("function" != typeof this.target && this._enabled(!1, !1))), s.runBackwards))
for (i = this._firstPT; i; ) (i.s += i.c), (i.c = -i.c), (i = i._next);
(this._onUpdate = s.onUpdate), (this._initted = !0);
}),
(s._initProps = function (e, i, r, n) {
var s, o, a, l, h, c;
if (null == e) return !1;
U[e._gsTweenID] && Z(), this.vars.css || (e.style && e !== t && e.nodeType && I.css && this.vars.autoCSS !== !1 && O(this.vars, e));
for (s in this.vars)
if (((c = this.vars[s]), W[s])) c && (c instanceof Array || (c.push && f(c))) && -1 !== c.join("").indexOf("{self}") && (this.vars[s] = c = this._swapSelfInParams(c, this));
else if (I[s] && (l = new I[s]())._onInitTween(e, this.vars[s], this)) {
for (this._firstPT = h = { _next: this._firstPT, t: l, p: "setRatio", s: 0, c: 1, f: 1, n: s, pg: 1, pr: l._priority }, o = l._overwriteProps.length; --o > -1; ) i[l._overwriteProps[o]] = this._firstPT;
(l._priority || l._onInitAllProps) && (a = !0), (l._onDisable || l._onEnable) && (this._notifyPluginsOfEnabled = !0), h._next && (h._next._prev = h);
} else i[s] = L.call(this, e, s, "get", c, s, 0, null, this.vars.stringFilter);
return n && this._kill(n, e)
? this._initProps(e, i, r, n)
: this._overwrite > 1 && this._firstPT && r.length > 1 && J(e, this, i, this._overwrite, r)
? (this._kill(i, e), this._initProps(e, i, r, n))
: (this._firstPT && ((this.vars.lazy !== !1 && this._duration) || (this.vars.lazy && !this._duration)) && (U[e._gsTweenID] = !0), a);
}),
(s.render = function (t, e, i) {
var r,
n,
s,
o,
a = this._time,
l = this._duration,
h = this._rawPrevTime;
if (t >= l - 1e-7)
(this._totalTime = this._time = l),
(this.ratio = this._ease._calcEnd ? this._ease.getRatio(1) : 1),
this._reversed || ((r = !0), (n = "onComplete"), (i = i || this._timeline.autoRemoveChildren)),
0 === l &&
(this._initted || !this.vars.lazy || i) &&
(this._startTime === this._timeline._duration && (t = 0),
(0 > h || (0 >= t && t >= -1e-7) || (h === c && "isPause" !== this.data)) && h !== t && ((i = !0), h > c && (n = "onReverseComplete")),
(this._rawPrevTime = o = !e || t || h === t ? t : c));
else if (1e-7 > t)
(this._totalTime = this._time = 0),
(this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0),
(0 !== a || (0 === l && h > 0)) && ((n = "onReverseComplete"), (r = this._reversed)),
0 > t && ((this._active = !1), 0 === l && (this._initted || !this.vars.lazy || i) && (h >= 0 && (h !== c || "isPause" !== this.data) && (i = !0), (this._rawPrevTime = o = !e || t || h === t ? t : c))),
this._initted || (i = !0);
else if (((this._totalTime = this._time = t), this._easeType)) {
var u = t / l,
d = this._easeType,
f = this._easePower;
(1 === d || (3 === d && u >= 0.5)) && (u = 1 - u),
3 === d && (u *= 2),
1 === f ? (u *= u) : 2 === f ? (u *= u * u) : 3 === f ? (u *= u * u * u) : 4 === f && (u *= u * u * u * u),
1 === d ? (this.ratio = 1 - u) : 2 === d ? (this.ratio = u) : 0.5 > t / l ? (this.ratio = u / 2) : (this.ratio = 1 - u / 2);
} else this.ratio = this._ease.getRatio(t / l);
if (this._time !== a || i) {
if (!this._initted) {
if ((this._init(), !this._initted || this._gc)) return;
if (!i && this._firstPT && ((this.vars.lazy !== !1 && this._duration) || (this.vars.lazy && !this._duration)))
return (this._time = this._totalTime = a), (this._rawPrevTime = h), H.push(this), void (this._lazy = [t, e]);
this._time && !r ? (this.ratio = this._ease.getRatio(this._time / l)) : 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 !== a && t >= 0 && (this._active = !0)),
0 === a && (this._startAt && (t >= 0 ? this._startAt.render(t, e, i) : n || (n = "_dummyGS")), this.vars.onStart && (0 !== this._time || 0 === l) && (e || this._callback("onStart"))),
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 > t && this._startAt && t !== -1e-4 && this._startAt.render(t, e, i), e || ((this._time !== a || r) && this._callback("onUpdate"))),
n &&
(!this._gc || i) &&
(0 > t && this._startAt && !this._onUpdate && t !== -1e-4 && this._startAt.render(t, e, i),
r && (this._timeline.autoRemoveChildren && this._enabled(!1, !1), (this._active = !1)),
!e && this.vars[n] && this._callback(n),
0 === l && this._rawPrevTime === c && o !== c && (this._rawPrevTime = 0));
}
}),
(s._kill = function (t, e, i) {
if (("all" === t && (t = null), null == t && (null == e || e === this.target))) return (this._lazy = !1), this._enabled(!1, !1);
e = "string" != typeof e ? e || this._targets || this.target : A.selector(e) || e;
var r,
n,
s,
o,
a,
l,
h,
c,
u,
d = i && this._time && i._startTime === this._startTime && this._timeline === i._timeline;
if ((f(e) || M(e)) && "number" != typeof e[0]) for (r = e.length; --r > -1; ) this._kill(t, e[r], i) && (l = !0);
else {
if (this._targets) {
for (r = this._targets.length; --r > -1; )
if (e === this._targets[r]) {
(a = this._propLookup[r] || {}), (this._overwrittenProps = this._overwrittenProps || []), (n = this._overwrittenProps[r] = t ? this._overwrittenProps[r] || {} : "all");
break;
}
} else {
if (e !== this.target) return !1;
(a = this._propLookup), (n = this._overwrittenProps = t ? this._overwrittenProps || {} : "all");
}
if (a) {
if (((h = t || a), (c = t !== n && "all" !== n && t !== a && ("object" != typeof t || !t._tempKill)), i && (A.onOverwrite || this.vars.onOverwrite))) {
for (s in h) a[s] && (u || (u = []), u.push(s));
if ((u || !t) && !Q(this, i, e, u)) return !1;
}
for (s in h)
(o = a[s]) &&
(d && (o.f ? o.t[o.p](o.s) : (o.t[o.p] = o.s), (l = !0)),
o.pg && o.t._kill(h) && (l = !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 a[s]),
c && (n[s] = 1);
!this._firstPT && this._initted && this._enabled(!1, !1);
}
}
return l;
}),
(s.invalidate = function () {
return (
this._notifyPluginsOfEnabled && A._onPluginEvent("_onDisable", this),
(this._firstPT = this._overwrittenProps = this._startAt = this._onUpdate = null),
(this._notifyPluginsOfEnabled = this._active = this._lazy = !1),
(this._propLookup = this._targets ? {} : []),
k.prototype.invalidate.call(this),
this.vars.immediateRender && ((this._time = -c), this.render(-this._delay)),
this
);
}),
(s._enabled = function (t, e) {
if ((a || o.wake(), t && this._gc)) {
var i,
r = this._targets;
if (r) for (i = r.length; --i > -1; ) this._siblings[i] = K(r[i], this, !0);
else this._siblings = K(this.target, this, !0);
}
return k.prototype._enabled.call(this, t, e), !(!this._notifyPluginsOfEnabled || !this._firstPT) && A._onPluginEvent(t ? "_onEnable" : "_onDisable", this);
}),
(A.to = function (t, e, i) {
return new A(t, e, i);
}),
(A.from = function (t, e, i) {
return (i.runBackwards = !0), (i.immediateRender = 0 != i.immediateRender), new A(t, e, i);
}),
(A.fromTo = function (t, e, i, r) {
return (r.startAt = i), (r.immediateRender = 0 != r.immediateRender && 0 != i.immediateRender), new A(t, e, r);
}),
(A.delayedCall = function (t, e, i, r, n) {
return new A(e, 0, { delay: t, onComplete: e, onCompleteParams: i, callbackScope: r, onReverseComplete: e, onReverseCompleteParams: i, immediateRender: !1, lazy: !1, useFrames: n, overwrite: 0 });
}),
(A.set = function (t, e) {
return new A(t, 0, e);
}),
(A.getTweensOf = function (t, e) {
if (null == t) return [];
t = "string" != typeof t ? t : A.selector(t) || t;
var i, r, n, s;
if ((f(t) || M(t)) && "number" != typeof t[0]) {
for (i = t.length, r = []; --i > -1; ) r = r.concat(A.getTweensOf(t[i], e));
for (i = r.length; --i > -1; ) for (s = r[i], n = i; --n > -1; ) s === r[n] && r.splice(i, 1);
} else for (r = K(t).concat(), i = r.length; --i > -1; ) (r[i]._gc || (e && !r[i].isActive())) && r.splice(i, 1);
return r;
}),
(A.killTweensOf = A.killDelayedCallsTo = function (t, e, i) {
"object" == typeof e && ((i = e), (e = !1));
for (var r = A.getTweensOf(t, e), n = r.length; --n > -1; ) r[n]._kill(i, t);
});
var tt = v(
"plugins.TweenPlugin",
function (t, e) {
(this._overwriteProps = (t || "").split(",")), (this._propName = this._overwriteProps[0]), (this._priority = e || 0), (this._super = tt.prototype);
},
!0
);
if (
((s = tt.prototype),
(tt.version = "1.18.0"),
(tt.API = 2),
(s._firstPT = null),
(s._addTween = L),
(s.setRatio = z),
(s._kill = function (t) {
var e,
i = this._overwriteProps,
r = this._firstPT;
if (null != t[this._propName]) this._overwriteProps = [];
else for (e = i.length; --e > -1; ) null != t[i[e]] && i.splice(e, 1);
for (; r; ) null != t[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 (t, e) {
for (var i = this._firstPT; i; ) (t[this._propName] || (null != i.n && t[i.n.split(this._propName + "_").join("")])) && (i.r = e), (i = i._next);
}),
(A._onPluginEvent = function (t, e) {
var i,
r,
n,
s,
o,
a = e._firstPT;
if ("_onInitAllProps" === t) {
for (; a; ) {
for (o = a._next, r = n; r && r.pr > a.pr; ) r = r._next;
(a._prev = r ? r._prev : s) ? (a._prev._next = a) : (n = a), (a._next = r) ? (r._prev = a) : (s = a), (a = o);
}
a = e._firstPT = n;
}
for (; a; ) a.pg && "function" == typeof a.t[t] && a.t[t]() && (i = !0), (a = a._next);
return i;
}),
(tt.activate = function (t) {
for (var e = t.length; --e > -1; ) t[e].API === tt.API && (I[new t[e]()._propName] = t[e]);
return !0;
}),
(_.plugin = function (t) {
if (!(t && t.propName && t.init && t.API)) throw "illegal plugin definition.";
var e,
i = t.propName,
r = t.priority || 0,
n = t.overwriteProps,
s = { init: "_onInitTween", set: "setRatio", kill: "_kill", round: "_roundProps", initAll: "_onInitAllProps" },
o = v(
"plugins." + i.charAt(0).toUpperCase() + i.substr(1) + "Plugin",
function () {
tt.call(this, i, r), (this._overwriteProps = n || []);
},
t.global === !0
),
a = (o.prototype = new tt(i));
(a.constructor = o), (o.API = t.API);
for (e in s) "function" == typeof t[e] && (a[s[e]] = t[e]);
return (o.version = t.version), tt.activate([o]), o;
}),
(r = t._gsQueue))
) {
for (n = 0; n < r.length; n++) r[n]();
for (s in p) p[s].func || t.console.log("GSAP encountered missing dependency: com.greensock." + s);
}
a = !1;
}
})("undefined" != typeof module && module.exports && "undefined" != typeof global ? global : this || window, "TweenMax"),
(THREE.BokehShader = {
uniforms: { tColor: { value: null }, tDepth: { value: null }, focus: { value: 1 }, aspect: { value: 1 }, aperture: { value: 0.025 }, maxblur: { value: 1 } },
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: [
"varying vec2 vUv;",
"uniform sampler2D tColor;",
"uniform sampler2D tDepth;",
"uniform float maxblur;",
"uniform float aperture;",
"uniform float focus;",
"uniform float aspect;",
"void main() {",
"vec2 aspectcorrect = vec2( 1.0, aspect );",
"vec4 depth1 = texture2D( tDepth, vUv );",
"float factor = depth1.x - focus;",
"vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );",
"vec2 dofblur9 = dofblur * 0.9;",
"vec2 dofblur7 = dofblur * 0.7;",
"vec2 dofblur4 = dofblur * 0.4;",
"vec4 col = vec4( 0.0 );",
"col += texture2D( tColor, vUv.xy );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );",
"gl_FragColor = col / 41.0;",
"gl_FragColor.a = 1.0;",
"}",
].join("\n"),
}),
(THREE.BokehShader = {
uniforms: {
textureWidth: { type: "f", value: 1 },
textureHeight: { type: "f", value: 1 },
focalDepth: { type: "f", value: 1 },
focalLength: { type: "f", value: 24 },
fstop: { type: "f", value: 0.9 },
tColor: { type: "t", value: null },
tDepth: { type: "t", value: null },
maxblur: { type: "f", value: 1 },
showFocus: { type: "i", value: 0 },
manualdof: { type: "i", value: 0 },
vignetting: { type: "i", value: 0 },
depthblur: { type: "i", value: 0 },
threshold: { type: "f", value: 0.5 },
gain: { type: "f", value: 2 },
bias: { type: "f", value: 0.5 },
fringe: { type: "f", value: 0.7 },
znear: { type: "f", value: 0.1 },
zfar: { type: "f", value: 100 },
noise: { type: "i", value: 1 },
dithering: { type: "f", value: 1e-4 },
pentagon: { type: "i", value: 0 },
shaderFocus: { type: "i", value: 1 },
focusCoords: { type: "v2", value: new THREE.Vector2() },
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: [
"varying vec2 vUv;",
"uniform sampler2D tColor;",
"uniform sampler2D tDepth;",
"uniform float textureWidth;",
"uniform float textureHeight;",
"const float PI = 3.14159265;",
"uniform float focalDepth; //focal distance value in meters, but you may use autofocus option below",
"uniform float focalLength; //focal length in mm",
"uniform float fstop; //f-stop value",
"uniform bool showFocus; //show debug focus point and focal range (red = focal point, green = focal range)",
"/*",
"make sure that these two values are the same for your camera, otherwise distances will be wrong.",
"*/",
"uniform float znear; // camera clipping start",
"uniform float zfar; // camera clipping end",
"//------------------------------------------",
"//user variables",
"const int samples = SAMPLES; //samples on the first ring",
"const int rings = RINGS; //ring count",
"const int maxringsamples = rings * samples;",
"uniform bool manualdof; // manual dof calculation",
"float ndofstart = 1.0; // near dof blur start",
"float ndofdist = 2.0; // near dof blur falloff distance",
"float fdofstart = 1.0; // far dof blur start",
"float fdofdist = 3.0; // far dof blur falloff distance",
"float CoC = 0.03; //circle of confusion size in mm (35mm film = 0.03mm)",
"uniform bool vignetting; // use optical lens vignetting",
"float vignout = 1.3; // vignetting outer border",
"float vignin = 0.0; // vignetting inner border",
"float vignfade = 22.0; // f-stops till vignete fades",
"uniform bool shaderFocus;",
"// disable if you use external focalDepth value",
"uniform vec2 focusCoords;",
"// autofocus point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)",
"// if center of screen use vec2(0.5, 0.5);",
"uniform float maxblur;",
"//clamp value of max blur (0.0 = no blur, 1.0 default)",
"uniform float threshold; // highlight threshold;",
"uniform float gain; // highlight gain;",
"uniform float bias; // bokeh edge bias",
"uniform float fringe; // bokeh chromatic aberration / fringing",
"uniform bool noise; //use noise instead of pattern for sample dithering",
"uniform float dithering;",
"uniform bool depthblur; // blur the depth buffer",
"float dbsize = 1.25; // depth blur size",
"/*",
"next part is experimental",
"not looking good with small sample and ring count",
"looks okay starting from samples = 4, rings = 4",
"*/",
"uniform bool pentagon; //use pentagon as bokeh shape?",
"float feather = 0.4; //pentagon shape feather",
"//------------------------------------------",
"float penta(vec2 coords) {",
"//pentagonal shape",
"float scale = float(rings) - 1.3;",
"vec4 HS0 = vec4( 1.0, 0.0, 0.0, 1.0);",
"vec4 HS1 = vec4( 0.309016994, 0.951056516, 0.0, 1.0);",
"vec4 HS2 = vec4(-0.809016994, 0.587785252, 0.0, 1.0);",
"vec4 HS3 = vec4(-0.809016994,-0.587785252, 0.0, 1.0);",
"vec4 HS4 = vec4( 0.309016994,-0.951056516, 0.0, 1.0);",
"vec4 HS5 = vec4( 0.0 ,0.0 , 1.0, 1.0);",
"vec4 one = vec4( 1.0 );",
"vec4 P = vec4((coords),vec2(scale, scale));",
"vec4 dist = vec4(0.0);",
"float inorout = -4.0;",
"dist.x = dot( P, HS0 );",
"dist.y = dot( P, HS1 );",
"dist.z = dot( P, HS2 );",
"dist.w = dot( P, HS3 );",
"dist = smoothstep( -feather, feather, dist );",
"inorout += dot( dist, one );",
"dist.x = dot( P, HS4 );",
"dist.y = HS5.w - abs( P.z );",
"dist = smoothstep( -feather, feather, dist );",
"inorout += dist.x;",
"return clamp( inorout, 0.0, 1.0 );",
"}",
"float bdepth(vec2 coords) {",
"// Depth buffer blur",
"float d = 0.0;",
"float kernel[9];",
"vec2 offset[9];",
"vec2 wh = vec2(1.0/textureWidth,1.0/textureHeight) * dbsize;",
"offset[0] = vec2(-wh.x,-wh.y);",
"offset[1] = vec2( 0.0, -wh.y);",
"offset[2] = vec2( wh.x -wh.y);",
"offset[3] = vec2(-wh.x, 0.0);",
"offset[4] = vec2( 0.0, 0.0);",
"offset[5] = vec2( wh.x, 0.0);",
"offset[6] = vec2(-wh.x, wh.y);",
"offset[7] = vec2( 0.0, wh.y);",
"offset[8] = vec2( wh.x, wh.y);",
"//kernel[0] = 1.0/16.0; kernel[1] = 2.0/16.0; kernel[2] = 1.0/16.0;",
"//kernel[3] = 2.0/16.0; kernel[4] = 4.0/16.0; kernel[5] = 2.0/16.0;",
"//kernel[6] = 1.0/16.0; kernel[7] = 2.0/16.0; kernel[8] = 1.0/16.0;",
"kernel[0] = 0.0625; kernel[1] = 0.125; kernel[2] = 0.0625;",
"kernel[3] = 0.125; kernel[4] = 0.25; kernel[5] = 0.125;",
"kernel[6] = 0.0625; kernel[7] = 0.125; kernel[8] = 0.0625;",
"for( int i=0; i<9; i++ ) {",
"float tmp = texture2D(tDepth, coords + offset[i]).r;",
"d += tmp * kernel[i];",
"}",
"return d;",
"}",
"vec3 color(vec2 coords,float blur) {",
"//processing the sample",
"vec3 col = vec3(0.0);",
"vec2 texel = vec2(1.0/textureWidth,1.0/textureHeight);",
"col.r = texture2D(tColor,coords + vec2(0.0,1.0)*texel*fringe*blur).r;",
"col.g = texture2D(tColor,coords + vec2(-0.866,-0.5)*texel*fringe*blur).g;",
"col.b = texture2D(tColor,coords + vec2(0.866,-0.5)*texel*fringe*blur).b;",
"vec3 lumcoeff = vec3(0.299,0.587,0.114);",
"float lum = dot(col.rgb, lumcoeff);",
"float thresh = max((lum-threshold)*gain, 0.0);",
"return col+mix(vec3(0.0),col,thresh*blur);",
"}",
"vec2 rand(vec2 coord) {",
"// generating noise / pattern texture for dithering",
"float noiseX = ((fract(1.0-coord.s*(textureWidth/2.0))*0.25)+(fract(coord.t*(textureHeight/2.0))*0.75))*2.0-1.0;",
"float noiseY = ((fract(1.0-coord.s*(textureWidth/2.0))*0.75)+(fract(coord.t*(textureHeight/2.0))*0.25))*2.0-1.0;",
"return vec2(noiseX,noiseY);",
"}",
"vec3 debugFocus(vec3 col, float blur, float depth) {",
"float edge = 0.002*depth; //distance based edge smoothing",
"float m = clamp(smoothstep(0.0,edge,blur),0.0,1.0);",
"float e = clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);",
"col = mix(col,vec3(1.0,0.5,0.0),(1.0-m)*0.6);",
"col = mix(col,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);",
"return col;",
"}",
"float linearize(float depth) {",
"return -zfar * znear / (depth * (zfar - znear) - zfar);",
"}",
"float vignette() {",
"float dist = distance(vUv.xy, vec2(0.5,0.5));",
"dist = smoothstep(vignout+(fstop/vignfade), vignin+(fstop/vignfade), dist);",
"return clamp(dist,0.0,1.0);",
"}",
"float gather(float i, float j, int ringsamples, inout vec3 col, float w, float h, float blur) {",
"float rings2 = float(rings);",
"float step = PI*2.0 / float(ringsamples);",
"float pw = cos(j*step)*i;",
"float ph = sin(j*step)*i;",
"float p = 1.0;",
"col += color(vUv.xy + vec2(pw*w,ph*h), blur) * mix(1.0, i/rings2, bias) * p;",
"return 1.0 * mix(1.0, i /rings2, bias) * p;",
"}",
"void main() {",
"//scene depth calculation",
"//float depth = linearize(texture2D(tDepth,vUv.xy).x);",
"// Blur depth?",
"float depth = linearize(bdepth(vUv.xy));",
"//focal plane calculation",
"float fDepth = focalDepth;",
"// dof blur factor calculation",
"float blur = 0.0;",
"float f = focalLength; // focal length in mm",
"float d = fDepth*1000.0; // focal plane in mm",
"float o = depth*1000.0; // depth in mm",
"float a = (o*f)/(o-f);",
"float b = (d*f)/(d-f);",
"float c = (d-f)/(d*fstop*CoC);",
"blur = abs(a-b)*c;",
"blur = clamp(blur,0.0,1.0);",
"// calculation of pattern for dithering",
"vec2 noise = rand(vUv.xy)*dithering*blur;",
"// getting blur x and y step factor",
"float w = (1.0/textureWidth)*blur*maxblur+noise.x;",
"float h = (1.0/textureHeight)*blur*maxblur+noise.y;",
"// calculation of final color",
"vec3 col = vec3(0.0);",
"if(blur < 0.05) {",
"//some optimization thingy",
"col = texture2D(tColor, vUv.xy).rgb;",
"} else {",
"col = texture2D(tColor, vUv.xy).rgb;",
"float s = 1.0;",
"int ringsamples;",
"for (int i = 1; i <= rings; i++) {",
"/*unboxstart*/",
"ringsamples = i * samples;",
"for (int j = 0 ; j < maxringsamples ; j++) {",
"if (j >= ringsamples) break;",
"s += gather(float(i), float(j), ringsamples, col, w, h, blur);",
"}",
"/*unboxend*/",
"}",
"col /= s; //divide by sample count",
"}",
"float curva_eval_y = pow((gl_FragCoord.x/textureWidth - 0.6),2.0)*10.0-0.20;",
"float clampe = clamp( (gl_FragCoord.y/textureHeight)*2.0 - curva_eval_y,0.01,1.0);",
"gl_FragColor.rgb = mix(col , texture2D(tColor, vUv.xy).rgb + col*(0.1), clampe);",
"if ( gl_FragColor.a > 0.0 ) {gl_FragColor.a = 1.0;};",
"if ( gl_FragColor.a <= 0.0 ) {gl_FragColor.a = 0.0;};",
"} ",
].join("\n"),
}),
(THREE.BokehShader2 = {
uniforms: {
textureWidth: { type: "f", value: 1 },
textureHeight: { type: "f", value: 1 },
focalDepth: { type: "f", value: 1 },
focalLength: { type: "f", value: 24 },
fstop: { type: "f", value: 0.9 },
tColor: { type: "t", value: null },
tDepth: { type: "t", value: null },
maxblur: { type: "f", value: 1 },
showFocus: { type: "i", value: 0 },
manualdof: { type: "i", value: 0 },
vignetting: { type: "i", value: 0 },
depthblur: { type: "i", value: 0 },
threshold: { type: "f", value: 0.5 },
gain: { type: "f", value: 2 },
bias: { type: "f", value: 0.5 },
fringe: { type: "f", value: 0.7 },
znear: { type: "f", value: 0.1 },
zfar: { type: "f", value: 100 },
noise: { type: "i", value: 1 },
dithering: { type: "f", value: 1e-4 },
pentagon: { type: "i", value: 0 },
shaderFocus: { type: "i", value: 1 },
focusCoords: { type: "v2", value: new THREE.Vector2() },
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: [
"varying vec2 vUv;",
"uniform sampler2D tColor;",
"uniform sampler2D tDepth;",
"uniform float textureWidth;",
"uniform float textureHeight;",
"const float PI = 3.14159265;",
"uniform float focalDepth; //focal distance value in meters, but you may use autofocus option below",
"uniform float focalLength; //focal length in mm",
"uniform float fstop; //f-stop value",
"uniform bool showFocus; //show debug focus point and focal range (red = focal point, green = focal range)",
"/*",
"make sure that these two values are the same for your camera, otherwise distances will be wrong.",
"*/",
"uniform float znear; // camera clipping start",
"uniform float zfar; // camera clipping end",
"//------------------------------------------",
"//user variables",
"const int samples = SAMPLES; //samples on the first ring",
"const int rings = RINGS; //ring count",
"const int maxringsamples = rings * samples;",
"uniform bool manualdof; // manual dof calculation",
"float ndofstart = 1.0; // near dof blur start",
"float ndofdist = 2.0; // near dof blur falloff distance",
"float fdofstart = 1.0; // far dof blur start",
"float fdofdist = 3.0; // far dof blur falloff distance",
"float CoC = 0.03; //circle of confusion size in mm (35mm film = 0.03mm)",
"uniform bool vignetting; // use optical lens vignetting",
"float vignout = 1.3; // vignetting outer border",
"float vignin = 0.0; // vignetting inner border",
"float vignfade = 22.0; // f-stops till vignete fades",
"uniform bool shaderFocus;",
"// disable if you use external focalDepth value",
"uniform vec2 focusCoords;",
"// autofocus point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)",
"// if center of screen use vec2(0.5, 0.5);",
"uniform float maxblur;",
"//clamp value of max blur (0.0 = no blur, 1.0 default)",
"uniform float threshold; // highlight threshold;",
"uniform float gain; // highlight gain;",
"uniform float bias; // bokeh edge bias",
"uniform float fringe; // bokeh chromatic aberration / fringing",
"uniform bool noise; //use noise instead of pattern for sample dithering",
"uniform float dithering;",
"uniform bool depthblur; // blur the depth buffer",
"float dbsize = 1.25; // depth blur size",
"/*",
"next part is experimental",
"not looking good with small sample and ring count",
"looks okay starting from samples = 4, rings = 4",
"*/",
"uniform bool pentagon; //use pentagon as bokeh shape?",
"float feather = 0.4; //pentagon shape feather",
"//------------------------------------------",
"float penta(vec2 coords) {",
"//pentagonal shape",
"float scale = float(rings) - 1.3;",
"vec4 HS0 = vec4( 1.0, 0.0, 0.0, 1.0);",
"vec4 HS1 = vec4( 0.309016994, 0.951056516, 0.0, 1.0);",
"vec4 HS2 = vec4(-0.809016994, 0.587785252, 0.0, 1.0);",
"vec4 HS3 = vec4(-0.809016994,-0.587785252, 0.0, 1.0);",
"vec4 HS4 = vec4( 0.309016994,-0.951056516, 0.0, 1.0);",
"vec4 HS5 = vec4( 0.0 ,0.0 , 1.0, 1.0);",
"vec4 one = vec4( 1.0 );",
"vec4 P = vec4((coords),vec2(scale, scale));",
"vec4 dist = vec4(0.0);",
"float inorout = -4.0;",
"dist.x = dot( P, HS0 );",
"dist.y = dot( P, HS1 );",
"dist.z = dot( P, HS2 );",
"dist.w = dot( P, HS3 );",
"dist = smoothstep( -feather, feather, dist );",
"inorout += dot( dist, one );",
"dist.x = dot( P, HS4 );",
"dist.y = HS5.w - abs( P.z );",
"dist = smoothstep( -feather, feather, dist );",
"inorout += dist.x;",
"return clamp( inorout, 0.0, 1.0 );",
"}",
"float bdepth(vec2 coords) {",
"// Depth buffer blur",
"float d = 0.0;",
"float kernel[9];",
"vec2 offset[9];",
"vec2 wh = vec2(1.0/textureWidth,1.0/textureHeight) * dbsize;",
"offset[0] = vec2(-wh.x,-wh.y);",
"offset[1] = vec2( 0.0, -wh.y);",
"offset[2] = vec2( wh.x -wh.y);",
"offset[3] = vec2(-wh.x, 0.0);",
"offset[4] = vec2( 0.0, 0.0);",
"offset[5] = vec2( wh.x, 0.0);",
"offset[6] = vec2(-wh.x, wh.y);",
"offset[7] = vec2( 0.0, wh.y);",
"offset[8] = vec2( wh.x, wh.y);",
"//kernel[0] = 1.0/16.0; kernel[1] = 2.0/16.0; kernel[2] = 1.0/16.0;",
"//kernel[3] = 2.0/16.0; kernel[4] = 4.0/16.0; kernel[5] = 2.0/16.0;",
"//kernel[6] = 1.0/16.0; kernel[7] = 2.0/16.0; kernel[8] = 1.0/16.0;",
"kernel[0] = 0.0625; kernel[1] = 0.125; kernel[2] = 0.0625;",
"kernel[3] = 0.125; kernel[4] = 0.25; kernel[5] = 0.125;",
"kernel[6] = 0.0625; kernel[7] = 0.125; kernel[8] = 0.0625;",
"for( int i=0; i<9; i++ ) {",
"float tmp = texture2D(tDepth, coords + offset[i]).r;",
"d += tmp * kernel[i];",
"}",
"return d;",
"}",
"vec3 color(vec2 coords,float blur) {",
"//processing the sample",
"vec3 col = vec3(0.0);",
"vec2 texel = vec2(1.0/textureWidth,1.0/textureHeight);",
"col.r = texture2D(tColor,coords + vec2(0.0,1.0)*texel*fringe*blur).r;",
"col.g = texture2D(tColor,coords + vec2(-0.866,-0.5)*texel*fringe*blur).g;",
"col.b = texture2D(tColor,coords + vec2(0.866,-0.5)*texel*fringe*blur).b;",
"vec3 lumcoeff = vec3(0.299,0.587,0.114);",
"float lum = dot(col.rgb, lumcoeff);",
"float thresh = max((lum-threshold)*gain, 0.0);",
"return col+mix(vec3(0.0),col,thresh*blur);",
"}",
"vec2 rand(vec2 coord) {",
"// generating noise / pattern texture for dithering",
"float noiseX = ((fract(1.0-coord.s*(textureWidth/2.0))*0.25)+(fract(coord.t*(textureHeight/2.0))*0.75))*2.0-1.0;",
"float noiseY = ((fract(1.0-coord.s*(textureWidth/2.0))*0.75)+(fract(coord.t*(textureHeight/2.0))*0.25))*2.0-1.0;",
"return vec2(noiseX,noiseY);",
"}",
"vec3 debugFocus(vec3 col, float blur, float depth) {",
"float edge = 0.002*depth; //distance based edge smoothing",
"float m = clamp(smoothstep(0.0,edge,blur),0.0,1.0);",
"float e = clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);",
"col = mix(col,vec3(1.0,0.5,0.0),(1.0-m)*0.6);",
"col = mix(col,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);",
"return col;",
"}",
"float linearize(float depth) {",
"return -zfar * znear / (depth * (zfar - znear) - zfar);",
"}",
"float vignette() {",
"float dist = distance(vUv.xy, vec2(0.5,0.5));",
"dist = smoothstep(vignout+(fstop/vignfade), vignin+(fstop/vignfade), dist);",
"return clamp(dist,0.0,1.0);",
"}",
"float gather(float i, float j, int ringsamples, inout vec3 col, float w, float h, float blur) {",
"float rings2 = float(rings);",
"float step = PI*2.0 / float(ringsamples);",
"float pw = cos(j*step)*i;",
"float ph = sin(j*step)*i;",
"float p = 1.0;",
"col += color(vUv.xy + vec2(pw*w,ph*h), blur) * mix(1.0, i/rings2, bias) * p;",
"return 1.0 * mix(1.0, i /rings2, bias) * p;",
"}",
"void main() {",
"//scene depth calculation",
"//float depth = linearize(texture2D(tDepth,vUv.xy).x);",
"// Blur depth?",
"float depth = linearize(bdepth(vUv.xy));",
"//focal plane calculation",
"float fDepth = focalDepth;",
"// dof blur factor calculation",
"float blur = 0.0;",
"float f = focalLength; // focal length in mm",
"float d = fDepth*1000.0; // focal plane in mm",
"float o = depth*1000.0; // depth in mm",
"float a = (o*f)/(o-f);",
"float b = (d*f)/(d-f);",
"float c = (d-f)/(d*fstop*CoC);",
"blur = abs(a-b)*c;",
"blur = clamp(blur,0.0,1.0);",
"// calculation of pattern for dithering",
"vec2 noise = rand(vUv.xy)*dithering*blur;",
"// getting blur x and y step factor",
"float w = (1.0/textureWidth)*blur*maxblur+noise.x;",
"float h = (1.0/textureHeight)*blur*maxblur+noise.y;",
"// calculation of final color",
"vec3 col = vec3(0.0);",
"if(blur < 0.05) {",
"//some optimization thingy",
"col = texture2D(tColor, vUv.xy).rgb;",
"} else {",
"col = texture2D(tColor, vUv.xy).rgb;",
"float s = 1.0;",
"int ringsamples;",
"for (int i = 1; i <= rings; i++) {",
"/*unboxstart*/",
"ringsamples = i * samples;",
"for (int j = 0 ; j < maxringsamples ; j++) {",
"if (j >= ringsamples) break;",
"s += gather(float(i), float(j), ringsamples, col, w, h, blur);",
"}",
"/*unboxend*/",
"}",
"col /= s; //divide by sample count",
"}",
"float curva_eval_y = pow((gl_FragCoord.x/textureWidth - 0.6),2.0)*10.0-0.20;",
"float clampe = clamp( (gl_FragCoord.y/textureHeight)*2.0 - curva_eval_y,0.01,1.0);",
"gl_FragColor.rgb = mix(col , texture2D(tColor, vUv.xy).rgb + col*(0.1), clampe);",
"gl_FragColor.a = 1.0;",
"} ",
].join("\n"),
}),
(THREE.ConvolutionShader = {
defines: { KERNEL_SIZE_FLOAT: "25.0", KERNEL_SIZE_INT: "25" },
uniforms: { tDiffuse: { type: "t", value: null }, uImageIncrement: { type: "v2", value: new THREE.Vector2(953125e-9, 0) }, cKernel: { type: "fv1", value: [] } },
vertexShader: [
"uniform vec2 uImageIncrement;",
"varying vec2 vUv;",
"void main() {",
"vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;",
"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
"}",
].join("\n"),
fragmentShader: [
"uniform float cKernel[ KERNEL_SIZE_INT ];",
"uniform sampler2D tDiffuse;",
"uniform vec2 uImageIncrement;",
"varying vec2 vUv;",
"void main() {",
"vec2 imageCoord = vUv;",
"vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );",
"for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {",
"sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];",
"imageCoord += uImageIncrement;",
"}",
"gl_FragColor = sum;",
"}",
].join("\n"),
buildKernel: function (t) {
function e(t, e) {
return Math.exp(-(t * t) / (2 * e * e));
}
var i,
r,
n,
s,
o = 25,
a = 2 * Math.ceil(3 * t) + 1;
for (a > o && (a = o), s = 0.5 * (a - 1), r = new Array(a), n = 0, i = 0; i < a; ++i) (r[i] = e(i - s, t)), (n += r[i]);
for (i = 0; i < a; ++i) r[i] /= n;
return r;
},
}),
(THREE.CopyShader = {
uniforms: { tDiffuse: { value: null }, opacity: { value: 1 } },
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n"),
}),
(THREE.EffectComposer = function (t, e) {
if (((this.renderer = t), void 0 === e)) {
var i = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBAFormat, stencilBuffer: !1 },
r = t.getSize();
e = new THREE.WebGLRenderTarget(r.width, r.height, i);
}
(this.renderTarget1 = e),
(this.renderTarget2 = e.clone()),
(this.writeBuffer = this.renderTarget1),
(this.readBuffer = this.renderTarget2),
(this.passes = []),
void 0 === THREE.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
(this.copyPass = new THREE.ShaderPass(THREE.CopyShader));
}),
Object.assign(THREE.EffectComposer.prototype, {
swapBuffers: function () {
var t = this.readBuffer;
(this.readBuffer = this.writeBuffer), (this.writeBuffer = t);
},
addPass: function (t) {
this.passes.push(t);
var e = this.renderer.getSize();
t.setSize(e.width, e.height);
},
insertPass: function (t, e) {
this.passes.splice(e, 0, t);
},
render: function (t) {
var e,
i,
r = !1,
n = this.passes.length;
for (i = 0; i < n; i++)
if (((e = this.passes[i]), e.enabled !== !1)) {
if ((e.render(this.renderer, this.writeBuffer, this.readBuffer, t, r), e.needsSwap)) {
if (r) {
var s = this.renderer.context;
s.stencilFunc(s.NOTEQUAL, 1, 4294967295), this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, t), s.stencilFunc(s.EQUAL, 1, 4294967295);
}
this.swapBuffers();
}
void 0 !== THREE.MaskPass && (e instanceof THREE.MaskPass ? (r = !0) : e instanceof THREE.ClearMaskPass && (r = !1));
}
},
reset: function (t) {
if (void 0 === t) {
var e = this.renderer.getSize();
(t = this.renderTarget1.clone()), t.setSize(e.width, e.height);
}
this.renderTarget1.dispose(), this.renderTarget2.dispose(), (this.renderTarget1 = t), (this.renderTarget2 = t.clone()), (this.writeBuffer = this.renderTarget1), (this.readBuffer = this.renderTarget2);
},
setSize: function (t, e) {
this.renderTarget1.setSize(t, e), this.renderTarget2.setSize(t, e);
for (var i = 0; i < this.passes.length; i++) this.passes[i].setSize(t, e);
},
}),
(THREE.Pass = function () {
(this.enabled = !0), (this.needsSwap = !0), (this.clear = !1), (this.renderToScreen = !1);
}),
Object.assign(THREE.Pass.prototype, {
setSize: function (t, e) {},
render: function (t, e, i, r, n) {
console.error("THREE.Pass: .render() must be implemented in derived pass.");
},
}),
(THREE.FocusShader = {
uniforms: { tDiffuse: { type: "t", value: !1 }, screenWidth: { type: "f", value: 1024 }, screenHeight: { type: "f", value: 1024 }, sampleDistance: { type: "f", value: 0.02 }, waveFactor: { type: "f", value: 0.00125 } },
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: [
"uniform float screenWidth;",
"uniform float screenHeight;",
"uniform float sampleDistance;",
"uniform float waveFactor;",
"uniform sampler2D tDiffuse;",
"varying vec2 vUv;",
"void main() {",
"vec4 color, org, tmp, add;",
"float sample_dist, f;",
"vec2 vin;",
"vec2 uv = vUv;",
"add = color = org = texture2D( tDiffuse, uv );",
"vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );",
"sample_dist = dot( vin, vin ) * 2.0;",
"f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;",
"vec2 sampleSize = vec2( 1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );",
"add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );",
"if( tmp.b < color.b ) color = tmp;",
"add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );",
"if( tmp.b < color.b ) color = tmp;",
"add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );",
"if( tmp.b < color.b ) color = tmp;",
"add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );",
"if( tmp.b < color.b ) color = tmp;",
"add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );",
"if( tmp.b < color.b ) color = tmp;",
"add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );",
"if( tmp.b < color.b ) color = tmp;",
"add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );",
"if( tmp.b < color.b ) color = tmp;",
"color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );",
"color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );",
"gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );",
"}",
].join("\n"),
}),
(THREE.ShaderExtras = {
screen: {
uniforms: { tDiffuse: { type: "t", value: 0, texture: null }, opacity: { type: "f", value: 1 } },
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = vec2( uv.x, 1.0 - uv.y );", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n"),
},
convolution: {
uniforms: { tDiffuse: { type: "t", value: 0, texture: null }, uImageIncrement: { type: "v2", value: new THREE.Vector2(0.001953125, 0) }, cKernel: { type: "fv1", value: [] } },
vertexShader: [
"uniform vec2 uImageIncrement;",
"varying vec2 vUv;",
"void main() {",
"vUv = uv - ( ( KERNEL_SIZE - 1.0 ) / 2.0 ) * uImageIncrement;",
"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
"}",
].join("\n"),
fragmentShader: [
"uniform float cKernel[ KERNEL_SIZE ];",
"uniform sampler2D tDiffuse;",
"uniform vec2 uImageIncrement;",
"varying vec2 vUv;",
"void main() {",
"vec2 imageCoord = vUv;",
"vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );",
"for( int i = 0; i < KERNEL_SIZE; i ++ ) {",
"sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];",
"imageCoord += uImageIncrement;",
"}",
"gl_FragColor = sum;",
"}",
].join("\n"),
},
film: {
uniforms: {
tDiffuse: { type: "t", value: 0, texture: null },
time: { type: "f", value: 0 },
nIntensity: { type: "f", value: 0.5 },
sIntensity: { type: "f", value: 0.05 },
sCount: { type: "f", value: 4096 },
grayscale: { type: "i", value: 1 },
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = vec2( uv.x, 1.0 - uv.y );", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: [
"uniform float time;",
"uniform bool grayscale;",
"uniform float nIntensity;",
"uniform float sIntensity;",
"uniform float sCount;",
"uniform sampler2D tDiffuse;",
"varying vec2 vUv;",
"void main() {",
"vec4 cTextureScreen = texture2D( tDiffuse, vUv );",
"float x = vUv.x * vUv.y * time * 1000.0;",
"x = mod( x, 13.0 ) * mod( x, 123.0 );",
"float dx = mod( x, 0.01 );",
"vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx * 100.0, 0.0, 1.0 );",
"vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );",
"cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;",
"cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );",
"if( grayscale ) {",
"cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );",
"}",
"gl_FragColor = vec4( cResult, cTextureScreen.a );",
"}",
].join("\n"),
},
bokeh: {
uniforms: {
tColor: { type: "t", value: 0, texture: null },
tDepth: { type: "t", value: 1, texture: null },
focus: { type: "f", value: 1 },
aspect: { type: "f", value: 1 },
aperture: { type: "f", value: 0.025 },
maxblur: { type: "f", value: 1 },
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = vec2( uv.x, 1.0 - uv.y );", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: [
"varying vec2 vUv;",
"uniform sampler2D tColor;",
"uniform sampler2D tDepth;",
"uniform float maxblur;",
"uniform float aperture;",
"uniform float focus;",
"uniform float aspect;",
"void main() {",
"vec2 aspectcorrect = vec2( 1.0, aspect );",
"vec4 depth1 = texture2D( tDepth, vUv );",
"float factor = depth1.x - focus;",
"vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );",
"vec2 dofblur9 = dofblur * 0.9;",
"vec2 dofblur7 = dofblur * 0.7;",
"vec2 dofblur4 = dofblur * 0.4;",
"vec4 col = vec4( 0.0 );",
"col += texture2D( tColor, vUv.xy );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );",
"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );",
"col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );",
"gl_FragColor = col / 41.0;",
"gl_FragColor.a = 1.0;",
"}",
].join("\n"),
},
dofmipmap: {
uniforms: { tColor: { type: "t", value: 0, texture: null }, tDepth: { type: "t", value: 1, texture: null }, focus: { type: "f", value: 1 }, maxblur: { type: "f", value: 1 } },
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = vec2( uv.x, 1.0 - uv.y );", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: [
"uniform float focus;",
"uniform float maxblur;",
"uniform sampler2D tColor;",
"uniform sampler2D tDepth;",
"varying vec2 vUv;",
"void main() {",
"vec4 depth = texture2D( tDepth, vUv );",
"float factor = depth.x - focus;",
"vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );",
"gl_FragColor = col;",
"gl_FragColor.a = 1.0;",
"}",
].join("\n"),
},
sepia: {
uniforms: { tDiffuse: { type: "t", value: 0, texture: null }, amount: { type: "f", value: 1 } },
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = vec2( uv.x, 1.0 - uv.y );", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: [
"uniform float amount;",
"uniform sampler2D tDiffuse;",
"varying vec2 vUv;",
"void main() {",
"vec4 color = texture2D( tDiffuse, vUv );",
"vec3 c = color.rgb;",
"color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );",
"color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );",
"color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );",
"gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );",
"}",
].join("\n"),
},
dotscreen: {
uniforms: {
tDiffuse: { type: "t", value: 0, texture: null },
tSize: { type: "v2", value: new THREE.Vector2(256, 256) },
center: { type: "v2", value: new THREE.Vector2(0.5, 0.5) },
angle: { type: "f", value: 1.57 },
scale: { type: "f", value: 1 },
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = vec2( uv.x, 1.0 - uv.y );", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: [
"uniform vec2 center;",
"uniform float angle;",
"uniform float scale;",
"uniform vec2 tSize;",
"uniform sampler2D tDiffuse;",
"varying vec2 vUv;",
"float pattern() {",
"float s = sin( angle ), c = cos( angle );",
"vec2 tex = vUv * tSize - center;",
"vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;",
"return ( sin( point.x ) * sin( point.y ) ) * 4.0;",
"}",
"void main() {",
"vec4 color = texture2D( tDiffuse, vUv );",
"float average = ( color.r + color.g + color.b ) / 3.0;",
"gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );",
"}",
].join("\n"),
},
vignette: {
uniforms: { tDiffuse: { type: "t", value: 0, texture: null }, offset: { type: "f", value: 1 }, darkness: { type: "f", value: 1 } },
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = vec2( uv.x, 1.0 - uv.y );", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: [
"uniform float offset;",
"uniform float darkness;",
"uniform sampler2D tDiffuse;",
"varying vec2 vUv;",
"void main() {",
"vec4 texel = texture2D( tDiffuse, vUv );",
"vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );",
"gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );",
"}",
].join("\n"),
},
bleachbypass: {
uniforms: { tDiffuse: { type: "t", value: 0, texture: null }, opacity: { type: "f", value: 1 } },
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = vec2( uv.x, 1.0 - uv.y );", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: [
"uniform float opacity;",
"uniform sampler2D tDiffuse;",
"varying vec2 vUv;",
"void main() {",
"vec4 base = texture2D( tDiffuse, vUv );",
"vec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );",
"float lum = dot( lumCoeff, base.rgb );",
"vec3 blend = vec3( lum );",
"float L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );",
"vec3 result1 = 2.0 * base.rgb * blend;",
"vec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );",
"vec3 newColor = mix( result1, result2, L );",
"float A2 = opacity * base.a;",
"vec3 mixRGB = A2 * newColor.rgb;",
"mixRGB += ( ( 1.0 - A2 ) * base.rgb );",
"gl_FragColor = vec4( mixRGB, base.a );",
"}",
].join("\n"),
},
focus: {
uniforms: {
tDiffuse: { type: "t", value: 0, texture: null },
screenWidth: { type: "f", value: 1024 },
screenHeight: { type: "f", value: 1024 },
sampleDistance: { type: "f", value: 0.94 },
waveFactor: { type: "f", value: 0.00125 },
},
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = vec2( uv.x, 1.0 - uv.y );", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: [
"uniform float screenWidth;",
"uniform float screenHeight;",
"uniform float sampleDistance;",
"uniform float waveFactor;",
"uniform sampler2D tDiffuse;",
"varying vec2 vUv;",
"void main() {",
"vec4 color, org, tmp, add;",
"float sample_dist, f;",
"vec2 vin;",
"vec2 uv = vUv;",
"add += color = org = texture2D( tDiffuse, uv );",
"vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );",
"sample_dist = dot( vin, vin ) * 2.0;",
"f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;",
"vec2 sampleSize = vec2( 1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );",
"add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );",
"if( tmp.b < color.b ) color = tmp;",
"add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );",
"if( tmp.b < color.b ) color = tmp;",
"add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );",
"if( tmp.b < color.b ) color = tmp;",
"add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );",
"if( tmp.b < color.b ) color = tmp;",
"add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );",
"if( tmp.b < color.b ) color = tmp;",
"add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );",
"if( tmp.b < color.b ) color = tmp;",
"add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );",
"if( tmp.b < color.b ) color = tmp;",
"color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );",
"color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );",
"gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );",
"}",
].join("\n"),
},
triangleBlur: {
uniforms: { texture: { type: "t", value: 0, texture: null }, delta: { type: "v2", value: new THREE.Vector2(1, 1) } },
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = vec2( uv.x, 1.0 - uv.y );", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: [
"#define ITERATIONS 10.0",
"uniform sampler2D texture;",
"uniform vec2 delta;",
"varying vec2 vUv;",
"float random( vec3 scale, float seed ) {",
"return fract( sin( dot( gl_FragCoord.xyz + seed, scale ) ) * 43758.5453 + seed );",
"}",
"void main() {",
"vec4 color = vec4( 0.0 );",
"float total = 0.0;",
"float offset = random( vec3( 12.9898, 78.233, 151.7182 ), 0.0 );",
"for ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {",
"float percent = ( t + offset - 0.5 ) / ITERATIONS;",
"float weight = 1.0 - abs( percent );",
"color += texture2D( texture, vUv + delta * percent ) * weight;",
"total += weight;",
"}",
"gl_FragColor = color / total;",
"}",
].join("\n"),
},
basic: {
uniforms: {},
vertexShader: ["void main() {", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: ["void main() {", "gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );", "}"].join("\n"),
},
horizontalBlur: {
uniforms: { tDiffuse: { type: "t", value: 0, texture: null }, h: { type: "f", value: 1 / 512 } },
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = vec2( uv.x, 1.0 - uv.y );", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: [
"uniform sampler2D tDiffuse;",
"uniform float h;",
"varying vec2 vUv;",
"void main() {",
"vec4 sum = vec4( 0.0 );",
"sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;",
"sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;",
"sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;",
"sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;",
"sum += texture2D( tDiffuse, vec2( vUv.x, \t\t \tvUv.y ) ) * 0.1633;",
"sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;",
"sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;",
"sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;",
"sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;",
"gl_FragColor = sum;",
"}",
].join("\n"),
},
verticalBlur: {
uniforms: { tDiffuse: { type: "t", value: 0, texture: null }, v: { type: "f", value: 1 / 512 } },
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = vec2( uv.x, 1.0 - uv.y );", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: [
"uniform sampler2D tDiffuse;",
"uniform float v;",
"varying vec2 vUv;",
"void main() {",
"vec4 sum = vec4( 0.0 );",
"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;",
"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;",
"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;",
"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;",
"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y\t\t\t ) ) * 0.1633;",
"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;",
"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;",
"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;",
"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;",
"gl_FragColor = sum;",
"}",
].join("\n"),
},
horizontalTiltShift: {
uniforms: { tDiffuse: { type: "t", value: 0, texture: null }, h: { type: "f", value: 1 / 512 }, r: { type: "f", value: 0.35 } },
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = vec2( uv.x, 1.0 - uv.y );", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: [
"uniform sampler2D tDiffuse;",
"uniform float h;",
"uniform float r;",
"varying vec2 vUv;",
"void main() {",
"vec4 sum = vec4( 0.0 );",
"float hh = h * abs( r - vUv.y );",
"sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;",
"sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;",
"sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;",
"sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;",
"sum += texture2D( tDiffuse, vec2( vUv.x, \t\t \t vUv.y ) ) * 0.1633;",
"sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;",
"sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;",
"sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;",
"sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;",
"gl_FragColor = sum;",
"}",
].join("\n"),
},
verticalTiltShift: {
uniforms: { tDiffuse: { type: "t", value: 0, texture: null }, v: { type: "f", value: 1 / 512 }, r: { type: "f", value: 0.35 } },
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = vec2( uv.x, 1.0 - uv.y );", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: [
"uniform sampler2D tDiffuse;",
"uniform float v;",
"uniform float r;",
"varying vec2 vUv;",
"void main() {",
"vec4 sum = vec4( 0.0 );",
"float vv = v * abs( r - vUv.y );",
"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;",
"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;",
"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;",
"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;",
"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y\t\t\t ) ) * 0.1633;",
"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;",
"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;",
"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;",
"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;",
"gl_FragColor = sum;",
"}",
].join("\n"),
},
blend: {
uniforms: { tDiffuse1: { type: "t", value: 0, texture: null }, tDiffuse2: { type: "t", value: 1, texture: null }, mixRatio: { type: "f", value: 0.5 }, opacity: { type: "f", value: 1 } },
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = vec2( uv.x, 1.0 - uv.y );", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: [
"uniform float opacity;",
"uniform float mixRatio;",
"uniform sampler2D tDiffuse1;",
"uniform sampler2D tDiffuse2;",
"varying vec2 vUv;",
"void main() {",
"vec4 texel1 = texture2D( tDiffuse1, vUv );",
"vec4 texel2 = texture2D( tDiffuse2, vUv );",
"gl_FragColor = opacity * mix( texel1, texel2, mixRatio );",
"}",
].join("\n"),
},
fxaa: {
uniforms: { tDiffuse: { type: "t", value: 0, texture: null }, resolution: { type: "v2", value: new THREE.Vector2(1 / 1024, 1 / 512) } },
vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = vec2( uv.x, 1.0 - uv.y );", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
fragmentShader: [
"uniform sampler2D tDiffuse;",
"uniform vec2 resolution;",
"varying vec2 vUv;",
"#define FXAA_REDUCE_MIN (1.0/128.0)",
"#define FXAA_REDUCE_MUL (1.0/8.0)",
"#define FXAA_SPAN_MAX 8.0",
"void main() {",
"vec3 rgbNW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ).xyz;",
"vec3 rgbNE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ).xyz;",
"vec3 rgbSW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ).xyz;",
"vec3 rgbSE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ).xyz;",
"vec3 rgbM = texture2D( tDiffuse, gl_FragCoord.xy * resolution ).xyz;",
"vec3 luma = vec3( 0.299, 0.587, 0.114 );",
"float lumaNW = dot( rgbNW, luma );",
"float lumaNE = dot( rgbNE, luma );",
"float lumaSW = dot( rgbSW, luma );",
"float lumaSE = dot( rgbSE, luma );",
"float lumaM = dot( rgbM, luma );",
"float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );",
"float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );",
"vec2 dir;",
"dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));",
"dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));",
"float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );",
"float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );",
"dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),",
"max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),",
"dir * rcpDirMin)) * resolution;",
"vec3 rgbA = 0.5 * (",
"texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ).xyz +",
"texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ).xyz );",
"vec3 rgbB = rgbA * 0.5 + 0.25 * (",
"texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * -0.5 ).xyz +",
"texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * 0.5 ).xyz );",
"float lumaB = dot( rgbB, luma );",
"if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) ) {",
"gl_FragColor = vec4( rgbA, 1.0 );",
"} else {",
"gl_FragColor = vec4( rgbB, 1.0 );",
"}",
"}",
].join("\n"),
},
buildKernel: function (t) {
function e(t, e) {
return Math.exp(-(t * t) / (2 * e * e));
}
var i,
r,
n,
s,
o = 25,
a = 2 * Math.ceil(3 * t) + 1;
for (a > o && (a = o), s = 0.5 * (a - 1), r = new Array(a), n = 0, i = 0; i < a; ++i) (r[i] = e(i - s, t)), (n += r[i]);
for (i = 0; i < a; ++i) r[i] /= n;
return r;
},
}),
(THREE.BloomPass = function (t, e, i, r) {
THREE.Pass.call(this), (t = void 0 !== t ? t : 1), (e = void 0 !== e ? e : 25), (i = void 0 !== i ? i : 4), (r = void 0 !== r ? r : 256);
var n = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBAFormat };
(this.renderTargetX = new THREE.WebGLRenderTarget(r, r, n)), (this.renderTargetY = new THREE.WebGLRenderTarget(r, r, n)), void 0 === THREE.CopyShader && console.error("THREE.BloomPass relies on THREE.CopyShader");
var s = THREE.CopyShader;
(this.copyUniforms = THREE.UniformsUtils.clone(s.uniforms)),
(this.copyUniforms.opacity.value = t),
(this.materialCopy = new THREE.ShaderMaterial({ uniforms: this.copyUniforms, vertexShader: s.vertexShader, fragmentShader: s.fragmentShader, blending: THREE.AdditiveBlending, transparent: !0 })),
void 0 === THREE.ConvolutionShader && console.error("THREE.BloomPass relies on THREE.ConvolutionShader");
var o = THREE.ConvolutionShader;
(this.convolutionUniforms = THREE.UniformsUtils.clone(o.uniforms)),
(this.convolutionUniforms.uImageIncrement.value = THREE.BloomPass.blurX),
(this.convolutionUniforms.cKernel.value = THREE.ConvolutionShader.buildKernel(i)),
(this.materialConvolution = new THREE.ShaderMaterial({
uniforms: this.convolutionUniforms,
vertexShader: o.vertexShader,
fragmentShader: o.fragmentShader,
defines: { KERNEL_SIZE_FLOAT: e.toFixed(1), KERNEL_SIZE_INT: e.toFixed(0) },
})),
(this.needsSwap = !1),
(this.camera = new THREE.OrthographicCamera(-1, 1, 1, -1, 0, 1)),
(this.scene = new THREE.Scene()),
(this.quad = new THREE.Mesh(new THREE.PlaneBufferGeometry(2, 2), null)),
this.scene.add(this.quad);
}),
(THREE.BloomPass.prototype = Object.assign(Object.create(THREE.Pass.prototype), {
constructor: THREE.BloomPass,
render: function (t, e, i, r, n) {
n && t.context.disable(t.context.STENCIL_TEST),
(this.quad.material = this.materialConvolution),
(this.convolutionUniforms.tDiffuse.value = i.texture),
(this.convolutionUniforms.uImageIncrement.value = THREE.BloomPass.blurX),
t.render(this.scene, this.camera, this.renderTargetX, !0),
(this.convolutionUniforms.tDiffuse.value = this.renderTargetX.texture),
(this.convolutionUniforms.uImageIncrement.value = THREE.BloomPass.blurY),
t.render(this.scene, this.camera, this.renderTargetY, !0),
(this.quad.material = this.materialCopy),
(this.copyUniforms.tDiffuse.value = this.renderTargetY.texture),
n && t.context.enable(t.context.STENCIL_TEST),
t.render(this.scene, this.camera, i, this.clear);
},
})),
(THREE.BloomPass.blurX = new THREE.Vector2(0.001953125, 0)),
(THREE.BloomPass.blurY = new THREE.Vector2(0, 0.001953125)),
(THREE.BokehPass = function (t, e, i) {
THREE.Pass.call(this), (this.scene = t), (this.camera = e);
var r = void 0 !== i.focus ? i.focus : 1,
n = void 0 !== i.aspect ? i.aspect : e.aspect,
s = void 0 !== i.aperture ? i.aperture : 0.025,
o = void 0 !== i.maxblur ? i.maxblur : 1,
a = i.width || window.innerWidth || 1,
l = i.height || window.innerHeight || 1;
(this.renderTargetColor = new THREE.WebGLRenderTarget(a, l, { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat })),
(this.renderTargetDepth = this.renderTargetColor.clone()),
(this.materialDepth = new THREE.MeshDepthMaterial()),
void 0 === THREE.BokehShader && console.error("THREE.BokehPass relies on THREE.BokehShader");
var h = THREE.BokehShader,
c = THREE.UniformsUtils.clone(h.uniforms);
(c.tDepth.value = this.renderTargetDepth.texture),
(c.focus.value = r),
(c.aspect.value = n),
(c.aperture.value = s),
(c.maxblur.value = o),
(this.materialBokeh = new THREE.ShaderMaterial({ uniforms: c, vertexShader: h.vertexShader, fragmentShader: h.fragmentShader })),
(this.uniforms = c),
(this.needsSwap = !1),
(this.camera2 = new THREE.OrthographicCamera(-1, 1, 1, -1, 0, 1)),
(this.scene2 = new THREE.Scene()),
(this.quad2 = new THREE.Mesh(new THREE.PlaneBufferGeometry(2, 2), null)),
this.scene2.add(this.quad2);
}),
(THREE.BokehPass.prototype = Object.assign(Object.create(THREE.Pass.prototype), {
constructor: THREE.BokehPass,
render: function (t, e, i, r, n) {
(this.quad2.material = this.materialBokeh),
(this.scene.overrideMaterial = this.materialDepth),
t.render(this.scene, this.camera, this.renderTargetDepth, !0),
(this.uniforms.tColor.value = i.texture),
this.renderToScreen ? t.render(this.scene2, this.camera2) : t.render(this.scene2, this.camera2, e, this.clear),
(this.scene.overrideMaterial = null);
},
})),
(THREE.ManualMSAARenderPass = function (t, e, i, r) {
THREE.Pass.call(this),
(this.scene = t),
(this.camera = e),
(this.sampleLevel = 4),
(this.unbiased = !0),
(this.clearColor = void 0 !== i ? i : 0),
(this.clearAlpha = void 0 !== r ? r : 0),
void 0 === THREE.CopyShader && console.error("THREE.ManualMSAARenderPass relies on THREE.CopyShader");
var n = THREE.CopyShader;
(this.copyUniforms = THREE.UniformsUtils.clone(n.uniforms)),
(this.copyMaterial = new THREE.ShaderMaterial({
uniforms: this.copyUniforms,
vertexShader: n.vertexShader,
fragmentShader: n.fragmentShader,
premultipliedAlpha: !0,
transparent: !0,
blending: THREE.AdditiveBlending,
depthTest: !1,
depthWrite: !1,
})),
(this.camera2 = new THREE.OrthographicCamera(-1, 1, 1, -1, 0, 1)),
(this.scene2 = new THREE.Scene()),
(this.quad2 = new THREE.Mesh(new THREE.PlaneGeometry(2, 2), this.copyMaterial)),
this.scene2.add(this.quad2);
}),
(THREE.ManualMSAARenderPass.prototype = Object.assign(Object.create(THREE.Pass.prototype), {
constructor: THREE.ManualMSAARenderPass,
dispose: function () {
this.sampleRenderTarget && (this.sampleRenderTarget.dispose(), (this.sampleRenderTarget = null));
},
setSize: function (t, e) {
this.sampleRenderTarget && this.sampleRenderTarget.setSize(t, e);
},
render: function (t, e, i, r, n) {
this.sampleRenderTarget || (this.sampleRenderTarget = new THREE.WebGLRenderTarget(i.width, i.height, { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBAFormat }));
var s = THREE.ManualMSAARenderPass.JitterVectors[Math.max(0, Math.min(this.sampleLevel, 5))],
o = t.autoClear;
t.autoClear = !1;
var a = t.getClearColor().getHex(),
l = t.getClearAlpha(),
h = 1 / s.length,
c = 1 / 32;
this.copyUniforms.tDiffuse.value = this.sampleRenderTarget.texture;
for (var u = i.width, d = i.height, f = 0; f < s.length; f++) {
var p = s[f];
this.camera.setViewOffset && this.camera.setViewOffset(u, d, 0.0625 * p[0], 0.0625 * p[1], u, d);
var m = h;
if (this.unbiased) {
var _ = -0.5 + (f + 0.5) / s.length;
m += c * _;
}
(this.copyUniforms.opacity.value = m),
t.setClearColor(this.clearColor, this.clearAlpha),
t.render(this.scene, this.camera, this.sampleRenderTarget, !0),
0 === f && t.setClearColor(0, 0),
t.render(this.scene2, this.camera2, this.renderToScreen ? null : e, 0 === f);
}
this.camera.clearViewOffset && this.camera.clearViewOffset(), (t.autoClear = o), t.setClearColor(a, l);
},
})),
(THREE.ManualMSAARenderPass.JitterVectors = [
[[0, 0]],
[
[4, 4],
[-4, -4],
],
[
[-2, -6],
[6, -2],
[-6, 2],
[2, 6],
],
[
[1, -3],
[-1, 3],
[5, 1],
[-3, -5],
[-5, 5],
[-7, -1],
[3, 7],
[7, -7],
],
[
[1, 1],
[-1, -3],
[-3, 2],
[4, -1],
[-5, -2],
[2, 5],
[5, 3],
[3, -5],
[-2, 6],
[0, -7],
[-4, -6],
[-6, 4],
[-8, 0],
[7, -4],
[6, 7],
[-7, -8],
],
[
[-4, -7],
[-7, -5],
[-3, -5],
[-5, -4],
[-1, -4],
[-2, -2],
[-6, -1],
[-4, 0],
[-7, 1],
[-1, 2],
[-6, 3],
[-3, 3],
[-7, 6],
[-3, 6],
[-5, 7],
[-1, 7],
[5, -7],
[1, -6],
[6, -5],
[4, -4],
[2, -3],
[7, -2],
[1, -1],
[4, -1],
[2, 1],
[6, 2],
[0, 4],
[4, 4],
[2, 5],
[7, 5],
[5, 6],
[3, 7],
],
]),
(THREE.MaskPass = function (t, e) {
THREE.Pass.call(this), (this.scene = t), (this.camera = e), (this.clear = !0), (this.needsSwap = !1), (this.inverse = !1);
}),
(THREE.MaskPass.prototype = Object.assign(Object.create(THREE.Pass.prototype), {
constructor: THREE.MaskPass,
render: function (t, e, i, r, n) {
var s = t.context,
o = t.state;
o.buffers.color.setMask(!1), o.buffers.depth.setMask(!1), o.buffers.color.setLocked(!0), o.buffers.depth.setLocked(!0);
var a, l;
this.inverse ? ((a = 0), (l = 1)) : ((a = 1), (l = 0)),
o.buffers.stencil.setTest(!0),
o.buffers.stencil.setOp(s.REPLACE, s.REPLACE, s.REPLACE),
o.buffers.stencil.setFunc(s.ALWAYS, a, 4294967295),
o.buffers.stencil.setClear(l),
t.render(this.scene, this.camera, i, this.clear),
t.render(this.scene, this.camera, e, this.clear),
o.buffers.color.setLocked(!1),
o.buffers.depth.setLocked(!1),
o.buffers.stencil.setFunc(s.EQUAL, 1, 4294967295),
o.buffers.stencil.setOp(s.KEEP, s.KEEP, s.KEEP);
},
})),
(THREE.ClearMaskPass = function () {
THREE.Pass.call(this), (this.needsSwap = !1);
}),
(THREE.ClearMaskPass.prototype = Object.create(THREE.Pass.prototype)),
Object.assign(THREE.ClearMaskPass.prototype, {
render: function (t, e, i, r, n) {
t.state.buffers.stencil.setTest(!1);
},
}),
(THREE.RenderPass = function (t, e, i, r, n) {
THREE.Pass.call(this), (this.scene = t), (this.camera = e), (this.overrideMaterial = i), (this.clearColor = r), (this.clearAlpha = void 0 !== n ? n : 0), (this.clear = !0), (this.needsSwap = !1);
}),
(THREE.RenderPass.prototype = Object.assign(Object.create(THREE.Pass.prototype), {
constructor: THREE.RenderPass,
render: function (t, e, i, r, n) {
var s = t.autoClear;
(t.autoClear = !1), (this.scene.overrideMaterial = this.overrideMaterial);
var o, a;
this.clearColor && ((o = t.getClearColor().getHex()), (a = t.getClearAlpha()), t.setClearColor(this.clearColor, this.clearAlpha)),
t.render(this.scene, this.camera, this.renderToScreen ? null : i, this.clear),
this.clearColor && t.setClearColor(o, a),
(this.scene.overrideMaterial = null),
(t.autoClear = s);
},
})),
(THREE.ShaderPass = function (t, e) {
THREE.Pass.call(this),
(this.textureID = void 0 !== e ? e : "tDiffuse"),
t instanceof THREE.ShaderMaterial
? ((this.uniforms = t.uniforms), (this.material = t))
: t &&
((this.uniforms = THREE.UniformsUtils.clone(t.uniforms)), (this.material = new THREE.ShaderMaterial({ defines: t.defines || {}, uniforms: this.uniforms, vertexShader: t.vertexShader, fragmentShader: t.fragmentShader }))),
(this.camera = new THREE.OrthographicCamera(-1, 1, 1, -1, 0, 1)),
(this.scene = new THREE.Scene()),
(this.quad = new THREE.Mesh(new THREE.PlaneBufferGeometry(2, 2), null)),
this.scene.add(this.quad);
}),
(THREE.ShaderPass.prototype = Object.assign(Object.create(THREE.Pass.prototype), {
constructor: THREE.ShaderPass,
render: function (t, e, i, r, n) {
this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i.texture),
(this.quad.material = this.material),
this.renderToScreen ? t.render(this.scene, this.camera) : t.render(this.scene, this.camera, e, this.clear);
},
}));
var BranchWeb = function () {
this.full_object = new THREE.Object3D();
};
BranchWeb.prototype.clean = function () {
this.full_object = new THREE.Object3D();
};
var gray_color_picker = ["#000000", "#111111", "#222222", "#333333", "#444444", "#555555", "#666666", "#777777", "#888888", "#999999", "#AAAAAA", "#BBBBBB", "#CCCCCC", "#DDDDDD", "#EEEEEE", "#ffffff"],
social_color_picker = [
"#00aced",
"#3b5998",
"#dd4b39",
"#cb2027",
"#007bb6",
"#bb0000",
"#aad450",
"#32506d",
"#517fa4",
"#ff0084",
"#ea4c89",
"#a82400",
"#0072b1",
"#5B9A68",
"#45668e",
"#21759b",
"#EB4823",
"#7B0099",
"#fb8f3d",
"#ff3a00",
];
(BranchWeb.prototype.generate = function (t, e, i, r, n, s, o) {
(this.dots_velocity = i), (this.opacity = 0.5);
var r = r ? r : 90,
a = new THREE.LineBasicMaterial({ color: gray_color_picker[Math.round(4 * Math.random()) + 8], linewidth: 1.5, transparent: !0, fog: !0, opacity: 0 }),
l = new THREE.Geometry();
l.vertices.push(new THREE.Vector3(0, 0, 0), new THREE.Vector3(t[0] * r, t[1] * r, t[2] * r)), l.computeLineDistances(), (this.brazo = new THREE.Line(l, a)), this.full_object.add(this.brazo), (this.dots = []);
for (var h = 0; h < e; h++) this.dots.push(new THREE.Mesh(n, s)), this.brazo.add(this.dots[h]);
(this.color = Math.round(19 * Math.random())),
(this.color_using = []),
(this.color_using[1] = new THREE.Color("#ffffff")),
(this.color_using[0] = new THREE.Color("#ffffff")),
(this.color_theme = !1),
(this.color_theme_selector = 0),
(this.color_changer = 0);
var a = new THREE.MeshBasicMaterial({ fog: !0, color: social_color_picker[this.color], transparent: !0, opacity: 0 });
(this.final_sphere = new THREE.Mesh(o, a)),
(this.final_sphere.position.x = t[0] * r),
(this.final_sphere.position.y = t[1] * r),
(this.final_sphere.position.z = t[2] * r),
(size = 1.5 + Math.random()),
this.final_sphere.scale.set(size, size, size),
this.full_object.add(this.final_sphere),
(this.visible = !0);
}),
(BranchWeb.prototype.resetColour = function () {
(this.color_theme = !1), (this.color_changer = 0);
}),
(BranchWeb.prototype.changeMainColour = function (t) {
this.brazo.material.color.setStyle(t), (this.color_using[1] = new THREE.Color(t));
}),
(BranchWeb.prototype.changeSecondaryColour = function (t) {
for (var e = 0; e < this.dots.length; e++) this.dots[e].material.color.setStyle(t);
this.color_using[1] = new THREE.Color(t);
}),
(BranchWeb.prototype.changeMainNodeColour = function (t) {
this.final_sphere.material.color.setStyle(t), (this.color_theme = !0), (this.color_using[0] = new THREE.Color(t)), (this.color_changer = 0);
}),
(BranchWeb.prototype.animate = function () {
if (((working = 0 != quality), working)) {
var t = Math.abs(Math.sin(u_time * this.dots_velocity));
(this.color_changer += 0.008 + 0.001 * t),
this.color_theme
? (this.color_changer >= 1 && ((this.color_theme_selector = 1 == this.color_theme_selector ? 0 : 1), (this.color_changer = 0)),
this.final_sphere.material.color.lerp(this.color_using[this.color_theme_selector], this.color_changer))
: (this.color_changer >= 1 && (this.color < social_color_picker.length - 1 ? this.color++ : (this.color = 0), (this.color_changer = 0)),
this.final_sphere.material.color.lerp(new THREE.Color(social_color_picker[this.color + 1]), this.color_changer));
for (var e = 0; e < this.dots.length; e++) this.dots[e].position.lerpVectors(this.brazo.geometry.vertices[0], this.brazo.geometry.vertices[1], t);
if (!this.visible) {
for (var e = 0; e < this.dots.length; e++) this.dots[e].visible = !0;
this.visible = !0;
}
} else if (this.visible) {
for (var e = 0; e < this.dots.length; e++) this.dots[e].visible = !1;
this.visible = !1;
}
}),
(BranchWeb.prototype.getObject = function () {
var t = this.full_object;
return t;
});
var cylinderMesh = function (t, e) {
var i = new THREE.Vector3().subVectors(e, t),
r = new THREE.ArrowHelper(i, t),
n = new THREE.CylinderGeometry(2, 2, i.length(), 6, 4),
s = new THREE.Mesh(n, new THREE.MeshBasicMaterial({ color: 255 }));
return (s.rotation = r.rotation.clone()), (s.position = new THREE.Vector3().addVectors(t, i.multiplyScalar(0.5))), s;
};
(BranchWeb.prototype.fadeIn = function (t) {
if (this.opacity < 1)
if (this.opacity + t < 1) {
(this.brazo.visible = !0), (this.brazo.material.opacity += t), (this.opacity = this.brazo.material.opacity);
for (var e = 0; e < this.dots.length; e++) (this.dots[e].visible = !0), (this.dots[e].material.opacity += t);
} else {
(this.brazo.material.opacity = 1), (this.opacity = this.brazo.material.opacity);
for (var e = 0; e < this.dots.length; e++) this.dots[e].material.opacity = 1;
}
}),
(BranchWeb.prototype.fadeOut = function (t) {
if (this.opacity > 0)
if (this.opacity - t > 0) {
(this.brazo.material.opacity -= t), (this.opacity = this.brazo.material.opacity);
for (var e = 0; e < this.dots.length; e++) this.dots[e].material.opacity -= t;
} else {
(this.brazo.material.opacity = 0), (this.brazo.visible = !1), (this.opacity = this.brazo.material.opacity);
for (var e = 0; e < this.dots.length; e++) (this.dots[e].material.opacity = 0), (this.dots[e].visible = !1);
}
}),
(BranchWeb.prototype.fadeInSphere = function (t) {
s_u_time > 0 && (this.final_sphere.material.opacity + t <= 1 ? ((this.final_sphere.visible = !0), (this.final_sphere.material.opacity += t)) : 1 != this.final_sphere.material.opacity && (this.final_sphere.material.opacity = 1));
}),
(BranchWeb.prototype.fadeOutSphere = function (t) {
s_u_time > 0 && (this.final_sphere.material.opacity - t >= 0 ? (this.final_sphere.material.opacity -= t) : 0 != this.final_sphere.material.opacity && ((this.final_sphere.material.opacity = 0), (this.final_sphere.visible = !1)));
}),
(data = [
[0, 0, 1.021],
[0.4035482, 0, 0.9378643],
[-0.2274644, 0.3333333, 0.9378643],
[-0.1471226, -0.375774, 0.9378643],
[0.579632, 0.3333333, 0.7715933],
[0.5058321, -0.375774, 0.8033483],
[-0.6020514, 0.2908927, 0.7715933],
[-0.05138057, 0.6666667, 0.7715933],
[0.1654988, -0.6080151, 0.8033483],
[-0.5217096, -0.4182147, 0.7715933],
[0.8579998, 0.2908927, 0.4708062],
[0.3521676, 0.6666667, 0.6884578],
[0.7841999, -0.4182147, 0.5025612],
[-0.657475, 0.5979962, 0.5025612],
[-0.749174, -0.08488134, 0.6884578],
[-0.3171418, 0.8302373, 0.5025612],
[0.1035333, -0.8826969, 0.5025612],
[-0.5836751, -0.6928964, 0.4708062],
[0.8025761, 0.5979962, 0.2017741],
[0.9602837, -0.08488134, 0.3362902],
[0.4899547, 0.8302373, 0.3362902],
[0.7222343, -0.6928964, 0.2017741],
[-0.8600213, 0.5293258, 0.1503935],
[-0.9517203, -0.1535518, 0.3362902],
[-0.1793548, 0.993808, 0.1503935],
[0.381901, -0.9251375, 0.2017741],
[-0.2710537, -0.9251375, 0.3362902],
[-0.8494363, -0.5293258, 0.2017741],
[0.8494363, 0.5293258, -0.2017741],
[1.007144, -0.1535518, -0.06725804],
[0.2241935, 0.993808, 0.06725804],
[0.8600213, -0.5293258, -0.1503935],
[-0.7222343, 0.6928964, -0.2017741],
[-1.007144, 0.1535518, 0.06725804],
[-0.381901, 0.9251375, -0.2017741],
[0.1793548, -0.993808, -0.1503935],
[-0.2241935, -0.993808, -0.06725804],
[-0.8025761, -0.5979962, -0.2017741],
[0.5836751, 0.6928964, -0.4708062],
[0.9517203, 0.1535518, -0.3362902],
[0.2710537, 0.9251375, -0.3362902],
[0.657475, -0.5979962, -0.5025612],
[-0.7841999, 0.4182147, -0.5025612],
[-0.9602837, 0.08488134, -0.3362902],
[-0.1035333, 0.8826969, -0.5025612],
[0.3171418, -0.8302373, -0.5025612],
[-0.4899547, -0.8302373, -0.3362902],
[-0.8579998, -0.2908927, -0.4708062],
[0.5217096, 0.4182147, -0.7715933],
[0.749174, 0.08488134, -0.6884578],
[0.6020514, -0.2908927, -0.7715933],
[-0.5058321, 0.375774, -0.8033483],
[-0.1654988, 0.6080151, -0.8033483],
[0.05138057, -0.6666667, -0.7715933],
[-0.3521676, -0.6666667, -0.6884578],
[-0.579632, -0.3333333, -0.7715933],
[0.1471226, 0.375774, -0.9378643],
[0.2274644, -0.3333333, -0.9378643],
[-0.4035482, 0, -0.9378643],
[0, 0, -1.021],
]),
(edge = [
[0, 3],
[3, 8],
[8, 5],
[5, 1],
[1, 0],
[2, 7],
[7, 15],
[15, 13],
[13, 6],
[6, 2],
[4, 10],
[10, 18],
[18, 20],
[20, 11],
[11, 4],
[9, 14],
[14, 23],
[23, 27],
[27, 17],
[17, 9],
[12, 21],
[21, 31],
[31, 29],
[29, 19],
[19, 12],
[16, 26],
[26, 36],
[36, 35],
[35, 25],
[25, 16],
[22, 32],
[32, 42],
[42, 43],
[43, 33],
[33, 22],
[24, 30],
[30, 40],
[40, 44],
[44, 34],
[34, 24],
[28, 39],
[39, 49],
[49, 48],
[48, 38],
[38, 28],
[37, 47],
[47, 55],
[55, 54],
[54, 46],
[46, 37],
[41, 45],
[45, 53],
[53, 57],
[57, 50],
[50, 41],
[51, 52],
[52, 56],
[56, 59],
[59, 58],
[58, 51],
[1, 4],
[11, 7],
[2, 0],
[6, 14],
[9, 3],
[5, 12],
[19, 10],
[17, 26],
[16, 8],
[25, 21],
[13, 22],
[33, 23],
[20, 30],
[24, 15],
[29, 39],
[28, 18],
[34, 32],
[27, 37],
[46, 36],
[38, 40],
[35, 45],
[41, 31],
[43, 47],
[50, 49],
[44, 52],
[51, 42],
[54, 53],
[48, 56],
[58, 55],
[57, 59],
]),
(face = [
[0, 3, 8, 5, 1],
[2, 7, 15, 13, 6],
[4, 10, 18, 20, 11],
[9, 14, 23, 27, 17],
[12, 21, 31, 29, 19],
[16, 26, 36, 35, 25],
[22, 32, 42, 43, 33],
[24, 30, 40, 44, 34],
[28, 39, 49, 48, 38],
[37, 47, 55, 54, 46],
[41, 45, 53, 57, 50],
[51, 52, 56, 59, 58],
[0, 1, 4, 11, 7, 2],
[0, 2, 6, 14, 9, 3],
[1, 5, 12, 19, 10, 4],
[3, 9, 17, 26, 16, 8],
[5, 8, 16, 25, 21, 12],
[6, 13, 22, 33, 23, 14],
[7, 11, 20, 30, 24, 15],
[10, 19, 29, 39, 28, 18],
[13, 15, 24, 34, 32, 22],
[17, 27, 37, 46, 36, 26],
[18, 28, 38, 40, 30, 20],
[21, 25, 35, 45, 41, 31],
[23, 33, 43, 47, 37, 27],
[29, 31, 41, 50, 49, 39],
[32, 34, 44, 52, 51, 42],
[35, 36, 46, 54, 53, 45],
[38, 48, 56, 52, 44, 40],
[42, 51, 58, 55, 47, 43],
[48, 49, 50, 57, 59, 56],
[53, 54, 55, 58, 59, 57],
]),
(face_points = [
[0.18555130000000003, -0.27191262000000005, 0.9006850400000002],
[-0.371102634, 0.54382524, 0.6972346600000001],
[0.61646604, 0.54382524, 0.49378432000000005],
[-0.7311430600000001, -0.37577400800000005, 0.49378432000000005],
[0.8667766400000001, -0.375774008, 0.16459479200000002],
[0.03390838000000001, -0.94411758, 0.16459479200000002],
[-0.8667766400000001, 0.375774008, -0.16459479200000002],
[-0.03390838, 0.9441175800000001, -0.16459479200000002],
[0.7311430600000001, 0.375774008, -0.49378432000000005],
[-0.61646604, -0.54382524, -0.49378432000000005],
[0.371102634, -0.54382524, -0.6972346600000001],
[-0.18555130000000003, 0.27191262000000005, -0.9006850399999999],
[0.17608380499999998, 0.33333333333333326, 0.8547288333333334],
[-0.374587, -0.04244067333333332, 0.8547288333333334],
[0.6819159499999999, -0.04244067333333333, 0.63707725],
[-0.20908814999999997, -0.6504557666666667, 0.6370772499999999],
[0.44386656666666663, -0.6504557666666666, 0.5025612],
[-0.8045976666666667, 0.22222222666666663, 0.41942567333333336],
[0.08640643833333335, 0.8302373333333333, 0.4194256733333333],
[0.9048600333333333, 0.22222222666666663, 0.06725802666666666],
[-0.5196880333333334, 0.7615668666666666, 0.15039353333333336],
[-0.5368149, -0.7615668666666666, 0.06725802666666666],
[0.5368149, 0.7615668666666666, -0.06725802666666666],
[0.5196880333333334, -0.7615668666666666, -0.15039353333333336],
[-0.9048600333333332, -0.22222222666666663, -0.06725802666666666],
[0.8045976666666667, -0.22222222666666663, -0.41942567333333336],
[-0.4438665666666667, 0.6504557666666667, -0.5025612],
[-0.08640643833333335, -0.8302373333333332, -0.4194256733333333],
[0.20908814999999997, 0.6504557666666666, -0.63707725],
[-0.6819159499999998, 0.04244067333333333, -0.63707725],
[0.37458699999999995, 0.042440673333333324, -0.8547288333333332],
[-0.176083805, -0.3333333333333333, -0.8547288333333332],
]);
var data_color_picker = ["#e5fbf9", "#effafe", "#f8fefe", "#56b8db", "#3f89ac", "#608ea5", "#83d4f1", "#58b5d6", "#dbffff", "#ebf6fc", "#e5f5f5", "#ffffff"],
Line = function (t, e, i, r) {
this.line, this.dots2, this.parent1, this.parent2, (this.parent1 = t), (this.parent2 = e), (this.opacity = 0.5);
var n = new THREE.Geometry();
(n.dynamic = !0), n.vertices.push(new THREE.Vector3(), new THREE.Vector3()), (this.line = new THREE.Line(n, i)), (this.line.visible = !1), (this.dots2 = []), (this.pointcounts = r > 0 ? r : 3 * Math.random() + 2);
for (
var n = new THREE.SphereGeometry(0.1 + 0.2 * Math.random(), 5, 5), s = new THREE.MeshBasicMaterial({ fog: !1, color: data_color_picker[Math.round(11 * Math.random())], transparent: !0, opacity: 0 }), o = 0;
o < this.pointcounts;
o++
)
this.dots2.push({ dot: new THREE.Mesh(n, s), speed: 0.02 * Math.random() }), (this.dots2[o].dot.visible = !1), this.line.add(this.dots2[o].dot);
};
(Line.prototype.changeMainColour = function (t) {
this.line.material.color.setStyle(t);
}),
(Line.prototype.changeSecondaryColour = function (t) {
for (var e = 0; e < this.dots2.length; e++) this.dots2[e].dot.material.color.setStyle(t);
}),
(Line.prototype.animate = function () {
if (
(this.line.geometry.vertices[0].setFromMatrixPosition(this.parent1.matrixWorld),
this.line.geometry.vertices[1].setFromMatrixPosition(this.parent2.matrixWorld),
(this.line.geometry.verticesNeedUpdate = !0),
(working = 0 != quality),
working)
) {
for (var t = 0; t < this.dots2.length; t++) {
var e = Math.abs(Math.sin(u_time * this.dots2[t].speed));
this.dots2[t].dot.position.lerpVectors(this.line.geometry.vertices[1], this.line.geometry.vertices[0], e);
}
if (!this.visible) {
for (var t = 0; t < this.dots2.length; t++) this.dots2[t].dot.visible = !0;
this.visible = !0;
}
} else if (this.visible) {
for (var t = 0; t < this.dots2.length; t++) this.dots2[t].dot.visible = !1;
this.visible = !1;
}
}),
(Line.prototype.fadeIn = function (t) {
if (1 == t) {
(this.line.visible = !0), (this.opacity = 1), (this.line.material.opacity = 1);
for (var e = 0; e < this.dots2.length; e++) (this.dots2[e].dot.visible = !0), (this.dots2[e].dot.material.opacity = t);
}
if (this.opacity < 1)
if (this.opacity + t < 1) {
(this.line.visible = !0), (this.line.material.opacity += t), (this.opacity = this.line.material.opacity);
for (var e = 0; e < this.dots2.length; e++) (this.dots2[e].dot.visible = !0), (this.dots2[e].dot.material.opacity = this.opacity);
} else {
(this.line.material.opacity = 1), (this.opacity = 1);
for (var e = 0; e < this.dots2.length; e++) this.dots2[e].dot.material.opacity = 1;
}
}),
(Line.prototype.updateMat = function () {
this.line.material.needsUpdate = !0;
for (var t = 0; t < this.dots2.length; t++) this.dots2[t].dot.material.needsUpdate;
}),
(Line.prototype.fadeOut = function (t) {
if (this.opacity > 0)
if (this.opacity - t > 0) {
(this.line.material.opacity -= t), (this.opacity = this.line.material.opacity);
for (var e = 0; e < this.dots2.length; e++) this.dots2[e].dot.material.opacity -= t;
} else {
(this.line.material.opacity = 0), (this.line.visible = !1), (this.opacity = 0);
for (var e = 0; e < this.dots2.length; e++) (this.dots2[e].dot.material.opacity = 0), (this.dots2[e].dot.visible = !1);
}
});
var WireframedRectangle = function () {
var t = [];
(t[0] = new THREE.SphereGeometry(0.1, 8, 8)),
(t[1] = t[0].clone()),
(t[2] = t[0].clone()),
(t[3] = t[0].clone()),
(t[4] = t[0].clone()),
(t[5] = t[0].clone()),
(t[6] = t[0].clone()),
(t[7] = t[0].clone()),
t[0].translate(1, 1, 1),
t[1].translate(1, 1, -1),
t[2].translate(-1, 1, 1),
t[3].translate(-1, 1, -1),
t[4].translate(1, -1, 1),
t[5].translate(1, -1, -1),
t[6].translate(-1, -1, 1),
t[7].translate(-1, -1, -1);
var e = [];
(e[0] = new THREE.CylinderGeometry(0.05, 0.05, 2, 8)),
(e[1] = e[0].clone()),
(e[2] = e[0].clone()),
(e[3] = e[0].clone()),
(e[4] = e[0].clone()),
e[4].rotateX(Math.PI / 2),
(e[5] = e[4].clone()),
(e[6] = e[4].clone()),
(e[7] = e[4].clone()),
(e[8] = e[4].clone()),
e[8].rotateY(Math.PI / 2),
(e[9] = e[8].clone()),
(e[10] = e[8].clone()),
(e[11] = e[8].clone()),
e[0].translate(1, 0, 1),
e[1].translate(1, 0, -1),
e[2].translate(-1, 0, 1),
e[3].translate(-1, 0, -1),
e[4].translate(1, 1, 0),
e[5].translate(1, -1, 0),
e[6].translate(-1, 1, 0),
e[7].translate(-1, -1, 0),
e[8].translate(0, 1, -1),
e[9].translate(0, -1, -1),
e[10].translate(0, 1, 1),
e[11].translate(0, -1, 1);
for (var i = 1; i < t.length; i++) t[0].merge(t[i]);
for (var i = 0; i < e.length; i++) t[0].merge(e[i]);
return t[0];
},
FXScene = function () {
(this.foreground_scene = new THREE.Scene()),
(this.background_scene = new THREE.Scene()),
(this.foreground_camera = new THREE.Camera()),
(this.background_camera = new THREE.Camera()),
(this.animation_bang = !1),
(this.animation = { animation_time: 0, vibration: 0.002 }),
(this.clock = new THREE.Clock(!0)),
(this.tick = 0);
};
(FXScene.prototype.startAnimationEvents = function () {
TweenMax.fromTo(this.animation, 5, { animation_time: 0, vibration: 0.001 }, { animation_time: 1, vibration: 8e-4, yoyo: !0 });
}),
(FXScene.prototype.setup = function () {
this.background_scene.add(this.background_camera), this.foreground_scene.add(this.foreground_camera);
new THREE.TextureLoader();
}),
(FXScene.prototype.loop = function () {});
var Scene01 = function () {
(this.scene = new THREE.Scene()), (this.animation_bang = !1), (this.animation_text = { opacity: 0 });
};
(Scene01.prototype.setup = function () {
(this.header_text = new TextWithSubline(electrolized_font, "CASCADING DISRUPTION")), (this.header_text.children[0].material.opacity = 0), (this.header_text.children[1].material.opacity = 0), this.scene.add(this.header_text);
}),
(Scene01.prototype.reset = function () {
(this.animation_text = { opacity: 0 }), (this.header_text.children[0].material.opacity = 0), (this.header_text.children[1].material.opacity = 0), (this.animation_bang = !1);
}),
(Scene01.prototype.loop = function () {
this.animation_bang === !1 && (this.startAnimationEvents(), (this.animation_bang = !0)),
(this.header_text.children[0].material.opacity = this.animation_text.opacity),
(this.header_text.children[1].material.opacity = this.animation_text.opacity);
}),
(Scene01.prototype.startAnimationEvents = function () {
TweenMax.fromTo(this.animation_text, 2, { opacity: 0 }, { repeat: 1, opacity: 1, yoyo: !0 });
});
var Scene02 = function () {
(this.scene = new THREE.Scene()), (this.animation_bang = !1), (this.animation_text = { opacity: 0 });
};
(Scene02.prototype.setup = function (t) {
(this.header_text = new TextWithSubline(electrolized_font, t.first_scene_text)), (this.header_text.children[0].material.opacity = 0), (this.header_text.children[1].material.opacity = 0), this.scene.add(this.header_text);
}),
(Scene02.prototype.reset = function () {
(this.animation_text = { opacity: 0 }), (this.header_text.children[0].material.opacity = 0), (this.header_text.children[1].material.opacity = 0), (this.animation_bang = !1);
}),
(Scene02.prototype.loop = function () {
this.animation_bang === !1 && (this.startAnimationEvents(), (this.animation_bang = !0)),
(this.header_text.children[0].material.opacity = this.animation_text.opacity),
(this.header_text.children[1].material.opacity = this.animation_text.opacity);
}),
(Scene02.prototype.startAnimationEvents = function () {
TweenMax.fromTo(this.animation_text, 2, { opacity: 0 }, { opacity: 1, repeat: 1, yoyo: !0 });
});
var Scene03 = function () {
(this.rotation = 6e-4), (this.r3 = 0.3 * Math.PI), (this.NODE_COUNT = 60), (this.NODE_SIZE = 10), (this.HALF_SIZE = this.NODE_SIZE / 2);
};
(Scene03.prototype.startAnimationEvents = function () {
TweenMax.fromTo(this.animation, 6, { animation_time: 0, branches_opacity: 0, vibration: 0.001 }, { animation_time: 1, branches_opacity: 1, vibration: 8e-4, yoyo: !0 });
}),
(Scene03.prototype.exporte = function () {
return {
branches: this.branches,
stars_count: this.stars_count,
middle_branches: this.middle_branches,
central_sphere: this.central_sphere,
face_branches: this.face_branches,
face_lines: this.face_lines,
quaternary_branches: this.quaternary_branches,
particle_system: this.particle_system,
particles: this.particles,
};
}),
(Scene03.prototype.setup = function (t) {
(this.scene = new THREE.Scene()),
(this.scene.fog = new THREE.FogExp2(1118481, 0.002)),
(this.animation_bang = !1),
(this.animation = { branches_opacity: 0, animation_time: 0, vibration: 0.002 }),
(this.nodes_appear = []),
(this.nodes_opacity = []),
(this.clock = new THREE.Clock(!0)),
(this.tick = 0),
(this.particles = new THREE.Geometry()),
(this.stars_count = t.background_stars_count),
(this.particleCount = this.stars_count),
(pMaterial = new THREE.PointsMaterial({ color: 16777215, fog: !1, transparent: !0, alphaTest: 0.5, size: 20, map: new THREE.TextureLoader().load(t.particle_path) }));
for (var e = PointsOnSphere(this.particleCount), i = 0; i < this.particleCount; i++) {
var r = e[i].x + 100 * (-Math.random() + Math.random()),
n = e[i].y + 100 * (-Math.random() + Math.random()),
s = e[i].z + 100 * (-Math.random() + Math.random()),
o = new THREE.Vector3(r, n, s);
(o.velocity = new THREE.Vector3(0.03 * (-Math.random() + Math.random()), 0.03 * (-Math.random() + Math.random()), 0.03 * (-Math.random() + Math.random()))), this.particles.vertices.push(o);
}
(this.particle_system = new THREE.Points(this.particles, pMaterial)), (this.particle_system.sortParticles = !0), this.scene.add(this.particle_system), (this.central_sphere = []);
var a = new THREE.SphereGeometry(3, 32, 32),
l = new THREE.MeshBasicMaterial({ fog: !0, color: "#ffffff", transparent: !0, opacity: 0 });
(this.central_sphere[0] = new THREE.Mesh(a, l)),
this.scene.add(this.central_sphere[0]),
(this.branches = []),
(this.middle_branches = []),
(this.cantidad_branches = this.NODE_COUNT),
(this.face_branches = []),
(this.face_lines = []),
(this.step = (2 * Math.PI) / (this.cantidad_branches / this.NODE_SIZE));
for (
var h = new THREE.SphereGeometry(0.5 + 0.2 * Math.random(), 20, 20), a = new THREE.SphereGeometry(0.25 + 0.1 * Math.random(), 10, 10), c = new THREE.MeshBasicMaterial({ color: "#FFFFFF", transparent: !0, opacity: 0 }), u = 0;
u < this.cantidad_branches / this.NODE_SIZE;
u++
) {
var d = new BranchWeb();
d.generate([0, 0.6, 0], 1 + Math.floor(2 * Math.random()), 0.01 + 0.03 * Math.random(), 90 + Math.random(), a, c, h),
this.middle_branches.push(d),
this.scene.add(this.middle_branches[u].getObject()),
(this.middle_branches[u].getObject().rotation.z = 0.1 * Math.random() + u * this.step);
}
for (var u = 0; u < face_points.length; u++) {
var d = new BranchWeb();
d.generate(face_points[u], 1 + Math.floor(2 * Math.random()), 0.01 + 0.03 * Math.random(), 98 + Math.random(), a, c, h),
this.face_branches.push(d),
(this.face_branches[u].brazo.material.opacity = 0),
(this.face_branches[u].brazo.visible = !1);
}
for (var u = 0; u < this.cantidad_branches; u++) {
var d = new BranchWeb();
d.generate(data[u], 1 + Math.floor(2 * Math.random()), 0.01 + 0.03 * Math.random(), 90 + Math.random(), a, c, h), this.branches.push(d), this.scene.add(this.branches[u].getObject());
}
for (var u = 0; u < this.face_branches.length; u++)
for (var f = 0; f < face[u].length; f++) {
var p = new THREE.LineBasicMaterial({ opacity: 0, transparent: !0, color: "#7fb7e7", fog: !0 });
(this.whole_line = new Line(this.face_branches[u].final_sphere, this.branches[face[u][f]].final_sphere, p, 2)), this.face_lines.push(this.whole_line);
}
this.quaternary_branches = [];
for (var u = 0; u < edge.length; u++) {
var m = new THREE.LineBasicMaterial({ opacity: 0, transparent: !0, color: "#7fb7e7", fog: !0 });
(this.whole_line = new Line(this.branches[edge[u][0]].final_sphere, this.branches[edge[u][1]].final_sphere, m, 3)), this.quaternary_branches.push(this.whole_line);
}
this.node_preference = [];
for (var u = 0; u < this.branches.length; u++) (this.nodes_appear[u] = !1), (this.nodes_opacity[u] = -0.2), (this.node_preference[u] = data[u][0] * data[u][2] >= 0 ? 1 : -1);
(this.main_color = ""), (this.secondary_color = ""), (this.main_color_change = !1), (this.secondary_color_change = !1), (this.color_change = !1), (this.reset_colors = !1);
}),
(Scene03.prototype.changeMainColour = function (t) {
(this.color_change = !0), (this.main_color = t), (this.main_color_change = !0);
}),
(Scene03.prototype.changeSecondaryColour = function (t) {
(this.color_change = !0), (this.secondary_color = t), (this.secondary_color_change = !0);
}),
(Scene03.prototype.changeMainNodeColour = function (t) {
(this.color_change = !0), (this.main_node_color = t), (this.main_node_color_change = !0);
}),
(Scene03.prototype.resetColor = function () {
(this.color_change = !0), (this.reset_colors = !0);
}),
(Scene03.prototype.loop = function () {
var t = this.animation.vibration + this.rotation * (this.animation.animation_time * this.animation.animation_time) * 0.001,
e = Math.sin(0.01 * u_time) * t,
i = Math.sin(0.02 * u_time) * t;
this.animation_bang === !1 && (this.startAnimationEvents(), (this.animation_bang = !0)), (this.central_sphere[0].material.opacity = this.animation.branches_opacity);
for (var r = (u_time * this.animation.vibration, 0); r < this.face_branches.length; r++) {
var n = this.animation.vibration * Math.random();
(this.face_branches[r].getObject().rotation.x += e + n), (this.face_branches[r].getObject().rotation.z += i + n);
}
for (var r = 0; r < this.cantidad_branches; r++) {
var n = this.animation.vibration * Math.random();
(this.branches[r].getObject().rotation.x += e + n),
(this.branches[r].getObject().rotation.z += i + n),
1 == this.nodes_appear[r]
? ((this.branches[r].final_sphere.display = !0), this.branches[r].fadeIn(0.1))
: this.animation.animation_time * this.animation.animation_time * this.animation.animation_time * this.animation.animation_time > Math.random() &&
(this.animation.animation_time > 0.2 && (this.nodes_appear[r] = !0),
(this.branches[r].final_sphere.material.opacity = 1),
r < this.middle_branches.length && (this.middle_branches[r].final_sphere.material.opacity = 1)),
this.branches[r].animate();
}
for (var r = 0; r < this.middle_branches.length; r++)
(this.middle_branches[r].getObject().rotation.x += e),
(this.middle_branches[r].getObject().rotation.z += i),
1 == this.nodes_appear[r] && ((this.middle_branches[r].final_sphere.display = !0), this.middle_branches[r].fadeIn(0.1)),
this.middle_branches[r].animate();
if (s_u_time > 0.5 || s_u_time < -0.5) {
for (var s = this.particleCount; s--; ) {
var o = this.particles.vertices[s];
(o.velocity.y -= 0.02 * (Math.random() - Math.random())), (o.velocity.x -= 0.05 * (Math.random() - Math.random())), (o.velocity.z -= 0.005 * (Math.random() - Math.random())), o.add(o.velocity);
}
(this.particle_system.geometry.__dirtyVertices = !0), (this.particle_system.geometry.verticesNeedUpdate = !0);
}
if (this.color_change) {
if (this.main_color_change) {
for (var r = 0; r < this.cantidad_branches; r++) this.branches[r].changeMainColour(this.main_color);
this.main_color_change = !1;
}
if (this.secondary_color_change) {
for (var r = 0; r < this.cantidad_branches; r++) this.branches[r].changeSecondaryColour(this.secondary_color);
this.secondary_color_change = !1;
}
if (this.main_node_color_change) {
for (var r = 0; r < this.cantidad_branches; r++) this.branches[r].changeMainNodeColour(this.main_node_color);
this.main_node_color_change = !1;
}
if (this.reset_colors) {
for (var r = 0; r < this.cantidad_branches; r++) this.branches[r].resetColour();
this.reset_colors = !1;
}
this.color_change = !1;
}
});
var gray_color_picker = ["#000000", "#111111", "#222222", "#333333", "#444444", "#555555", "#666666", "#777777", "#888888", "#999999", "#AAAAAA", "#BBBBBB", "#CCCCCC", "#DDDDDD", "#EEEEEE", "#ffffff"],
Scene04 = function () {
(this.NODE_SIZE = 10), (this.HALF_SIZE = this.NODE_SIZE / 2), (this.rotation = -0.003), (this.r3 = 0.35 * Math.PI);
};
(Scene04.prototype.startAnimationEvents = function () {
TweenMax.fromTo(
this.animation,
6,
{ animation_time: 0, central_sphere_scale: 1, central_sphere_opacity: 1, going_to_center: 1, branches_opacity: 1, dots_opacity: 1, scale: 1, new_branches_opacity: 0, vibration: 0.0025 },
{ animation_time: 1, central_sphere_scale: 0.8, central_sphere_opacity: 0, going_to_center: 0.95, branches_opacity: 0, dots_opacity: 1, scale: 1.5, new_branches_opacity: 1, vibration: 0.002, yoyo: !0 }
);
}),
(Scene04.prototype.exporte = function () {
return {
branches: this.branches,
stars_count: this.stars_count,
middle_branches: this.middle_branches,
central_sphere: this.central_sphere,
secondary_branches: this.secondary_branches,
middle_secondary_branches: this.middle_secondary_branches,
face_branches: this.face_branches,
face_lines: this.face_lines,
quaternary_branches: this.quaternary_branches,
particle_system: this.particle_system,
particles: this.particles,
};
}),
(Scene04.prototype.setup = function (t) {
(this.scene = new THREE.Scene()),
(this.scene.fog = new THREE.FogExp2(1118481, 0.002)),
(this.animation_bang = !1),
(this.animation = { animation_time: 0, central_sphere_opacity: 0, central_sphere_scale: 1, branches_opacity: 1, new_branches_opacity: 0, scale: 1, going_to_center: 1, vibration: 0.001 }),
(this.main_color = ""),
(this.secondary_color = ""),
(this.main_node_color = ""),
(this.main_color_change = !1),
(this.secondary_color_change = !1),
(this.main_node_color_change = !1),
(this.color_change = !1),
(this.stars_count = t.stars_count),
(this.branches = t.branches),
(this.central_sphere = t.central_sphere),
(this.cantidad_branches = this.branches.length),
(this.secondary_branches = []),
(this.face_lines = t.face_lines),
(this.face_branches = t.face_branches),
(this.middle_branches = t.middle_branches),
(this.quaternary_branches = t.quaternary_branches),
(this.particle_system = t.particle_system),
(this.particles = t.particles),
this.scene.add(this.particle_system);
for (var e = 0; e < this.cantidad_branches; e++) this.scene.add(this.branches[e].getObject());
for (var e = 0; e < this.middle_branches.length; e++) this.scene.add(this.middle_branches[e].getObject());
this.scene.add(this.central_sphere[0]);
for (var i = new THREE.Vector3(), r = new THREE.Vector3(), n = new THREE.Vector2(), s = new THREE.Vector2(), e = 0; e < this.branches.length; e++) {
for (var o = [], a = 0; a < this.middle_branches.length; a++)
i.setFromMatrixPosition(this.branches[e].final_sphere.matrixWorld), r.setFromMatrixPosition(this.middle_branches[a].final_sphere.matrixWorld), n.set(i.x, i.y), s.set(r.x, r.y), (o[a] = n.distanceToSquared(s));
for (var l = [], a = 0; a < o.length; a++) (void 0 === l[0] || o[a] < o[l[0]]) && (l[0] = a);
var h = new THREE.LineBasicMaterial({ opacity: 0, transparent: !0, color: "#3ea4d4", fog: !0 }),
c = new THREE.Geometry();
(c.dynamic = !0), c.vertices.push(new THREE.Vector3(), new THREE.Vector3());
for (var a = 0; a < l.length; a++)
(this.whole_line = new Line(this.branches[e].final_sphere, this.middle_branches[l[a]].final_sphere, h)),
(this.whole_line.visible = !1),
this.secondary_branches.push(this.whole_line),
this.scene.add(this.secondary_branches[e].line);
}
this.middle_secondary_branches = [];
for (var a = 0; a < this.middle_branches.length; a++) {
var u = new THREE.LineBasicMaterial({ opacity: 0, transparent: !0, color: 16777215, fog: !0 });
(this.whole_line = new Line(this.middle_branches[a].final_sphere, this.middle_branches[a == this.middle_branches.length - 1 ? 0 : a + 1].final_sphere, u)),
(this.whole_line.visible = !1),
this.middle_secondary_branches.push(this.whole_line),
this.scene.add(this.middle_secondary_branches[a].line);
}
(this.node_changing = []), (this.node_preference = []), (this.middle_node_changing = []);
for (var e = 0; e < this.branches.length; e++) (this.node_preference[e] = data[e][0] * data[e][2] >= 0 ? 1 : -1), (this.node_changing[e] = !1);
for (var e = 0; e < this.middle_secondary_branches.length; e++) this.middle_node_changing[e] = !1;
}),
(Scene04.prototype.changeMainColour = function (t) {
(this.color_change = !0), (this.main_color = t), (this.main_color_change = !0);
}),
(Scene04.prototype.changeSecondaryColour = function (t) {
(this.color_change = !0), (this.secondary_color = t), (this.secondary_color_change = !0);
}),
(Scene04.prototype.changeMainNodeColour = function (t) {
(this.color_change = !0), (this.main_node_color = t), (this.main_node_color_change = !0);
}),
(Scene04.prototype.resetColor = function () {
(this.color_change = !0), (this.reset_colors = !0);
}),
(Scene04.prototype.loop = function () {
this.r3 = Math.PI * (0.45 - 0.15 * this.animation.animation_time);
var t = this.animation.animation_time * this.animation.animation_time,
e = this.rotation * t * 0.001,
i = (Math.sin(0.025 * u_time) * this.animation.vibration) / 2 + e,
r = Math.sin(0.01 * u_time) * this.animation.vibration + e;
this.animation.animation_time * this.branches.length, t * t * this.middle_branches.length;
this.animation_bang === !1 && (this.startAnimationEvents(), (this.animation_bang = !0)), 1 != this.animation.animation_time && (this.central_sphere[0].material.opacity = 1 - t);
for (var n = Math.random(), s = 0; s < this.face_branches.length; s++)
(this.face_branches[s].getObject().rotation.x += i + this.animation.vibration * n), (this.face_branches[s].getObject().rotation.z -= r + this.animation.vibration * n);
for (var s = 0; s < this.cantidad_branches; s++)
(this.branches[s].getObject().rotation.y = this.node_preference[s] * (0.3 * t) * this.r3),
(this.branches[s].getObject().rotation.x += i + this.animation.vibration * n),
(this.branches[s].getObject().rotation.z -= r + this.animation.vibration * n),
this.secondary_branches[s].animate(),
this.branches[s].animate(),
0 == this.node_changing[s] && this.animation.animation_time > s / this.cantidad_branches && (this.node_changing[s] = !0),
this.node_changing[s] &&
1 != this.secondary_branches[s].line.material.opacity &&
(n < 0.01 ? (this.secondary_branches[s].fadeIn(0.2), this.branches[s].fadeOut(0.2)) : (this.secondary_branches[s].fadeIn(0.1), this.branches[s].fadeOut(0.1)));
for (var s = 0; s < this.middle_branches.length; s++)
(this.middle_branches[s].getObject().rotation.x -= i),
(this.middle_branches[s].getObject().rotation.z -= r),
this.middle_branches[s].animate(),
this.middle_secondary_branches[s].animate(),
0 == this.middle_node_changing[s] && this.animation.animation_time > s / this.middle_branches.length && (this.middle_node_changing[s] = !0),
this.middle_node_changing[s] &&
1 != this.middle_secondary_branches[s].line.material.opacity &&
(n < 0.01 ? (this.middle_branches[s].fadeOut(0.2), this.middle_secondary_branches[s].fadeIn(0.2)) : (this.middle_branches[s].fadeOut(0.1), this.middle_secondary_branches[s].fadeIn(0.1)));
if (s_u_time > 0.5 || s_u_time < -0.5) {
for (var o = this.stars_count; o--; ) {
var a = this.particles.vertices[o];
(a.velocity.y -= 0.02 * (Math.random() - Math.random())), (a.velocity.x -= 0.05 * (Math.random() - Math.random())), (a.velocity.z -= 0.005 * (Math.random() - Math.random())), a.add(a.velocity);
}
(this.particle_system.geometry.__dirtyVertices = !0), (this.particle_system.geometry.verticesNeedUpdate = !0);
}
if (this.color_change) {
if (this.main_color_change) {
for (var s = 0; s < this.secondary_branches.length; s++) this.secondary_branches[s].changeMainColour(this.main_color);
for (var s = 0; s < this.cantidad_branches; s++) this.branches[s].changeMainColour(this.main_color);
this.main_color_change = !1;
}
if (this.secondary_color_change) {
for (var s = 0; s < this.secondary_branches.length; s++) this.branches[s].changeSecondaryColour(this.secondary_color);
this.secondary_color_change = !1;
}
if (this.main_node_color_change) {
for (var s = 0; s < this.cantidad_branches; s++) this.branches[s].changeMainNodeColour(this.main_node_color);
this.main_node_color_change = !1;
}
if (this.reset_colors) {
for (var s = 0; s < this.cantidad_branches; s++) this.branches[s].resetColour();
this.reset_colors = !1;
}
this.color_change = !1;
}
});
var gray_color_picker = ["#000000", "#111111", "#222222", "#333333", "#444444", "#555555", "#666666", "#777777", "#888888", "#999999", "#AAAAAA", "#BBBBBB", "#CCCCCC", "#DDDDDD", "#EEEEEE", "#ffffff"],
Scene06 = function (t) {
(this.NODE_SIZE = 10), (this.HALF_SIZE = this.NODE_SIZE / 2), (this.rotation = 0.002), (this.r3 = 0.35 * Math.PI);
};
(Scene06.prototype.startAnimationEvents = function () {
TweenMax.fromTo(this.animation, 6, { branches_opacity: 1, animation_time: 0, new_branches_opacity: 0, vibration: 0.0012 }, { branches_opacity: 0, animation_time: 1, new_branches_opacity: 1, yoyo: !0, vibration: 9e-4 });
}),
(Scene06.prototype.exporte = function () {
return { primary_branches: this.primary_branches, central_sphere: this.central_sphere, secondary_branches: this.secondary_branches, middle_branches: this.middle_branches, quaternary_branches: this.quaternary_branches };
}),
(Scene06.prototype.setup = function (t, e) {
this.central_sphere = [];
var i = new THREE.SphereGeometry(3, 32, 32),
r = new THREE.MeshBasicMaterial({ fog: !1, color: "#ffffff", transparent: !0, opacity: 1 });
(this.central_sphere[2] = new THREE.Mesh(i, r)),
this.central_sphere[2].scale.set(27, 27, 27),
(this.central_sphere[2].visible = !1),
this.central_sphere[2].material.color.setHex(15020593),
(this.central_sphere[2].rotation.x += 0.4),
(this.scene = new THREE.Scene()),
(this.scene.fog = new THREE.FogExp2(1118481, 0.002)),
(this.main_color = ""),
(this.secondary_color = ""),
(this.main_color_change = !1),
(this.secondary_color_change = !1),
(this.color_change = !1),
(this.animation_bang = !1),
(this.animation = { animation_time: 0, branches_opacity: 1, new_branches_opacity: 0, vibration: 0.0012 }),
(this.primary_branches = t.branches),
(this.secondary_branches = t.secondary_branches),
(this.middle_branches = t.middle_branches),
(this.face_branches = t.face_branches),
(this.quaternary_branches = t.quaternary_branches),
(this.middle_secondary_branches = t.middle_secondary_branches),
(this.particle_system = t.particle_system),
(this.particles = t.particles),
this.scene.add(this.particle_system),
(this.face_lines = t.face_lines);
this.scene, this.central_sphere;
this.scene.add(this.central_sphere[2]), (this.central_sphere[2].visible = !0);
for (var n = 0; n < this.face_lines.length; n++) this.scene.add(this.face_lines[n].line);
for (var n = 0; n < this.primary_branches.length; n++) this.scene.add(this.primary_branches[n].getObject());
for (var n = 0; n < this.secondary_branches.length; n++) this.scene.add(this.secondary_branches[n].line);
for (var n = 0; n < this.face_branches.length; n++) this.scene.add(this.face_branches[n].getObject());
for (var n = 0; n < this.quaternary_branches.length; n++) this.scene.add(this.quaternary_branches[n].line);
for (var n = 0; n < this.middle_branches.length; n++) this.scene.add(this.middle_branches[n].getObject()), this.scene.add(this.middle_secondary_branches[n].line);
this.scene.updateMatrixWorld(), (this.node_changing = []), (this.node_preference = []), (this.middle_node_changing = []), (this.set = []);
for (var n = 0; n < this.primary_branches.length; n++) (this.node_preference[n] = data[n][0] * data[n][2] >= 0 ? 1 : -1), (this.node_changing[n] = !1);
for (var n = 0; n < this.middle_secondary_branches.length; n++) this.middle_node_changing[n] = !1;
for (var n = 0; n < this.face_lines.length; n++) this.set[n] = !1;
(this.set[0] = !0),
(this.times = [0, 0, 0, 0, void 0]),
(this.times_counted = 0),
(this.activity = this.fadeInFunc),
(this.central_sphere[2].material.alphaMap = new THREE.TextureLoader().load(e.spec_path)),
(this.central_sphere[2].material.bumpMap = new THREE.TextureLoader().load(e.spec_path)),
(this.stars_count = t.stars_count);
}),
(Scene06.prototype.changeMainColour = function (t) {
(this.color_change = !0), (this.main_color = t), (this.main_color_change = !0);
}),
(Scene06.prototype.changeSecondaryColour = function (t) {
(this.color_change = !0), (this.secondary_color = t), (this.secondary_color_change = !0);
}),
(Scene06.prototype.changeMainNodeColour = function (t) {
(this.color_change = !0), (this.main_node_color = t), (this.main_node_color_change = !0);
}),
(Scene06.prototype.resetColor = function () {
(this.color_change = !0), (this.reset_colors = !0);
}),
(Scene06.prototype.loop = function () {
this.activity(), (this.r3 = Math.PI * (0.35 + 0.05 * this.animation.animation_time));
var t = this.animation.animation_time * this.animation.animation_time,
e = this.rotation * t * 5e-4,
i = (Math.sin(0.025 * u_time) * this.animation.vibration) / 2 + e,
r = Math.sin(0.01 * u_time) * this.animation.vibration + e;
u_time * this.animation.vibration, Math.random();
this.animation_bang === !1 && (this.startAnimationEvents(), (this.animation_bang = !0)),
(this.central_sphere[2].rotation.x -= i),
(this.central_sphere[2].rotation.z += r),
1 == this.animation.animation_time && (this.central_sphere[2].rotation.y += 0.001);
for (var n = 0; n < this.face_branches.length; n++)
(this.face_branches[n].getObject().rotation.x -= i),
(this.face_branches[n].getObject().rotation.z += r),
1 == this.animation.animation_time && (this.face_branches[n].getObject().rotation.y += 0.001),
this.face_branches[n].animate();
if (1 != this.animation.animation_time)
for (var n = 0; n < this.middle_branches.length; n++)
(this.middle_branches[n].getObject().rotation.x -= i), (this.middle_branches[n].getObject().rotation.z -= r), this.middle_branches[n].animate(), this.middle_secondary_branches[n].animate();
for (var n = 0; n < this.primary_branches.length; n++)
1 != this.animation.animation_time
? ((this.primary_branches[n].getObject().rotation.y = this.node_preference[n] * (1 - t) * 0.3 * this.r3), this.secondary_branches[n].animate())
: (this.primary_branches[n].getObject().rotation.y += 0.001),
(this.primary_branches[n].getObject().rotation.x -= i),
(this.primary_branches[n].getObject().rotation.z += r),
this.primary_branches[n].animate();
for (var n = this.face_lines.length; n--; ) this.face_lines[n].animate();
for (var n = 0; n < this.quaternary_branches.length; n++)
this.quaternary_branches[n].animate(),
1 != this.animation.animation_time && this.animation.animation_time > n && ((this.node_changing[edge[n][0]] = !0), (this.node_changing[edge[n][1]] = !0), this.quaternary_branches[n].fadeIn(0.05));
if (s_u_time > 0.5 || s_u_time < -0.5) {
for (var s = this.stars_count; s--; ) {
var o = this.particles.vertices[s];
(o.velocity.y -= 0.02 * (Math.random() - Math.random())), (o.velocity.x -= 0.05 * (Math.random() - Math.random())), (o.velocity.z -= 0.01 * (Math.random() - Math.random())), o.add(o.velocity);
}
(this.particle_system.geometry.__dirtyVertices = !0), (this.particle_system.geometry.verticesNeedUpdate = !0);
}
if (
(1e3 == this.times_counted &&
((this.times_counted = 0),
console.log("1 " + this.times[0] / 1e3),
console.log("2 " + this.times[1] / 1e3),
console.log("3 " + this.times[2] / 1e3),
console.log("4 " + this.times[3] / 1e3),
(this.times[0] = 0),
(this.times[1] = 0),
(this.times[2] = 0),
(this.times[3] = 0)),
this.color_change)
) {
if (this.main_color_change) {
for (var n = 0; n < this.secondary_branches.length; n++) this.secondary_branches[n].changeMainColour(this.main_color);
for (var n = 0; n < this.quaternary_branches.length; n++) this.quaternary_branches[n].changeMainColour(this.main_color);
this.main_color_change = !1;
}
if (this.secondary_color_change) {
for (var n = 0; n < this.face_lines.length; n++) this.face_lines[n].changeMainColour(this.secondary_color);
for (var n = 0; n < this.secondary_branches.length; n++) this.secondary_branches[n].changeSecondaryColour(this.secondary_color);
this.secondary_color_change = !1;
}
if (this.main_node_color_change) {
for (var n = 0; n < this.primary_branches.length; n++) this.primary_branches[n].changeMainNodeColour(this.main_node_color);
for (var n = 0; n < this.face_branches.length; n++) this.face_branches[n].changeMainNodeColour(this.main_node_color);
this.main_node_color_change = !1;
}
if (this.reset_colors) {
for (var n = 0; n < this.cantidad_branches; n++) this.branches[n].resetColour();
for (var n = 0; n < this.face_branches.length; n++) this.face_branches[n].resetColour();
this.reset_colors = !1;
}
this.color_change = !1;
}
}),
(Scene06.prototype.fadeOut = function () {
this.activity = this.fadeOutFunc;
}),
(Scene06.prototype.fadeOutFunc = function () {
for (var t = 0.06, e = this.quaternary_branches.length; e--; ) this.quaternary_branches[e].fadeOut(t);
for (var e = this.face_lines.length; e--; ) this.face_lines[e].fadeOut(t);
for (var e = this.primary_branches.length; e--; ) this.primary_branches[e].fadeOutSphere(t);
for (var e = this.face_branches.length; e--; ) this.face_branches[e].fadeOutSphere(t);
this.central_sphere[2].material.opacity -= t;
}),
(Scene06.prototype.fadeInFunc = function () {
var t = this.animation.animation_time * this.animation.animation_time,
e = this.animation.animation_time * this.primary_branches.length,
i = this.animation.animation_time * this.middle_branches.length,
r = Math.random();
1 != this.animation.animation_time && (this.central_sphere[2].material.opacity = t * t);
for (var n = 0; n < this.face_branches.length; n++) 1 == this.animation.animation_time && 1 != this.face_branches[n].brazo.material.opacity && this.face_branches[n].fadeInSphere(0.7);
if (1 != this.animation.animation_time)
for (var n = 0; n < this.middle_branches.length; n++)
0 == this.middle_node_changing[n] && i > n && (this.middle_node_changing[n] = !0),
this.middle_node_changing[n] &&
0 != this.middle_secondary_branches[n].line.material.opacity &&
(r < 0.01
? (this.middle_secondary_branches[n].fadeOut(0.3), this.middle_branches[n].fadeOut(0.3), this.middle_branches[n].fadeOutSphere(0.3))
: (this.middle_secondary_branches[n].fadeOut(0.2), this.middle_branches[n].fadeOut(0.1), this.middle_branches[n].fadeOutSphere(0.1)));
for (var n = 0; n < this.primary_branches.length; n++)
0 == this.node_changing[n] && e > n && 1 == this.middle_node_changing[Math.floor(n / this.NODE_SIZE)] && (this.node_changing[n] = !0),
this.node_changing[n] && (this.animation.animation_time < 1 || 0 != this.secondary_branches[n].opacity) && (r < 0.01 ? this.secondary_branches[n].fadeOut(0.3) : r < 0.5 && this.secondary_branches[n].fadeOut(0.1));
for (var n = this.face_lines.length; n--; ) 1 == this.animation.animation_time && this.face_lines[n].fadeIn(0.01);
for (var n = 0; n < this.quaternary_branches.length; n++)
1 != this.animation.animation_time &&
this.animation.animation_time > n / this.quaternary_branches.length &&
((this.node_changing[edge[n][0]] = !0), (this.node_changing[edge[n][1]] = !0), this.quaternary_branches[n].fadeIn(0.1));
});
var SceneCubes = function () {
(navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia),
(isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor)),
(isMobile = !1),
(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(
navigator.userAgent
) ||
/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(
navigator.userAgent.substr(0, 4)
)) &&
(isMobile = !0);
var t = window.matchMedia("only screen and (max-width: 760px)");
t.matches && (isMobile = !0);
};
(SceneCubes.prototype.setup = function (t) {
function e() {
function e() {
(p = { sampleDistance: 0.75, waveFactor: 0.0021 }), (effectBloom = new THREE.BloomPass(0.8, 32, 32, 1024));
var t = new THREE.RenderPass(a, o);
(effectFocus = new THREE.ShaderPass(THREE.FocusShader)),
(msaaRenderPassP = new THREE.ManualMSAARenderPass(a, o)),
(msaaRenderPassP.sampleLevel = isChrome ? 2 : 1),
(effectFocus.uniforms.screenWidth.value = O),
(effectFocus.uniforms.screenHeight.value = H),
(effectFocus.uniforms.sampleDistance.value = p.sampleDistance),
(effectFocus.uniforms.waveFactor.value = p.waveFactor);
var e = new THREE.EffectComposer(l);
e.addPass(t), e.addPass(msaaRenderPassP), e.addPass(effectBloom), e.addPass(effectFocus), (effectFocus.renderToScreen = !0), (D.composer = e);
}
(R = new THREE.Vector2()),
(P = new THREE.Raycaster()),
(l = t.renderer),
(o = new THREE.PerspectiveCamera(45, O / H, 1, 7e3)),
o.position.set(-170, 100, -170),
(controls = new THREE.OrbitControls(o, l.domElement)),
(controls.target = new THREE.Vector3(0, 0, 0)),
(controls.autoRotate = !0),
(controls.minDistance = 60),
(controls.maxDistance = 450),
(controls.enablePan = !1),
(controls.enableZoom = !0),
(controls.enableDamping = !0),
(controls.dampingFactor = 0.03),
(controls.rotateSpeed = 0.1),
(controls.zoomSpeed = 0.8),
(a = new THREE.Scene()),
(a.vector5 = new THREE.Vector3(5, 5, 5)),
(a.vector1 = new THREE.Vector3(1, 1, 1)),
(a.vector0 = new THREE.Vector3(0.001, 0.001, 0.001)),
(a.vector01 = new THREE.Vector3(0.5, 0.5, 0.5)),
(light = new THREE.SpotLight(16717647, 1)),
light.position.set(0, 900, 2e3),
(light.castShadow = !0),
a.add(light),
(light2 = new THREE.SpotLight(16764735, 1)),
light2.position.set(0, -900, -1800),
(light2.castShadow = !0),
a.add(light2),
(fov = 75),
(side = isMobile ? 5 : isChrome ? 8 : 6),
(size = 10),
(m = !1),
(_ = !1),
(lon = 45),
(onMouseDownLon = 0),
(lat = 45),
(onMouseDownLat = 0),
(phi = 0),
(theta = 0);
var i,
r = new THREE.CubeGeometry(size, size, size),
n = new WireframedRectangle();
n.scale(0.5 * size, 0.5 * size, 0.5 * size);
for (var s = new THREE.MeshLambertMaterial({ fog: !1, color: 16777215, transparent: !0, opacity: 0.99, side: THREE.FrontSide }), h = 0; h < side; h++)
for (var T = 0; T < side; T++)
for (var E = 0; E < side; E++) {
(i = new THREE.Mesh(Math.random() > 0.3 ? r : n, s.clone())),
(i.position.x = (E - 0.5 * side) * size),
(i.position.y = (T - 0.5 * side) * size),
(i.position.z = (h - 0.5 * side) * size),
(i.position0 = new THREE.Vector3()),
i.position0.copy(i.position),
(i.position1 = new THREE.Vector3()),
i.position1.copy(i.position),
(i.matrixAutoUpdate = !1);
var C = Math.random() < 0.05;
(i.conway = !1), a.add(i), A.push(i), M.push({ status: C });
}
for (var k = A.length; k--; );
new THREE.TextureLoader();
(v = new THREE.Mesh(new THREE.SphereGeometry(500, 6, 6), new THREE.MeshBasicMaterial({ fog: !1, side: THREE.BackSide, color: "#333333" }))),
(g = new THREE.Mesh(new THREE.SphereGeometry(3e3, 128, 128), new THREE.MeshLambertMaterial({ fog: !1, side: THREE.BackSide, color: "#777777" }))),
(g.visible = !1),
a.add(g),
a.add(v),
(c = !1),
(f = !1),
(running = !1),
(x = function () {
if (c) (c = !1), (g.material.map = void 0), (g.material.needsUpdate = !0), (v.visible = !0), (g.visible = !1), track.getVideoTracks()[0].stop();
else {
(d = document.createElement("video")), (d.width = 320), (d.height = 240), (d.autoplay = !0), (d.controls = !0);
!!navigator.getUserMedia;
navigator.getUserMedia(
{ audio: !1, video: !0 },
function (t) {
(track = t),
(d.src = URL.createObjectURL(t)),
(d.oncanplay = function () {
(u = new THREE.Texture(this)),
(u.minFilter = THREE.LinearFilter),
(u.wrapS = THREE.ClampToEdgeWrapping),
(u.wrapT = THREE.ClampToEdgeWrapping),
(g.material.map = u),
(g.material.map.needsUpdate = !0),
(g.material.needsUpdate = !0),
(v.visible = !1),
(g.visible = !0),
(c = !0);
});
},
function (t) {
console.log("Failed to get a stream due to", t);
}
);
}
}),
e(),
(a.matrixAutoUpdate = !1);
var U = function () {
(effectFocus.uniforms.sampleDistance.value = p.sampleDistance), (effectFocus.uniforms.waveFactor.value = p.waveFactor), (_ = !0);
},
F = { color0: t.initial_primary_color || "#bb4773", color1: t.initial_secondary_color || "#8e669b", colorScene: t.initial_background_color || "#333333" },
z = function () {
light.color.setStyle(F.color0), light2.color.setStyle(F.color1), g.material.color.setStyle(F.colorScene), v.material.color.setStyle(F.colorScene);
};
z(),
(effects = { expand: 1, size: 1, "selfie mode": x }),
(y = function () {
for (var t = A.length; t--; ) (A[t].position0.x = A[t].position1.x * effects.expand), (A[t].position0.y = A[t].position1.y * effects.expand), (A[t].position0.z = A[t].position1.z * effects.expand);
}),
(b = function () {
a.vector1 = new THREE.Vector3(effects.size, effects.size, effects.size);
});
var N = {
pause: function () {
(m = !m), (controls.autoRotate = !controls.autoRotate);
},
};
(themes_to_pick = {
"compact red": { wave: [1e-4, 2e-4], expand: 0.7, size: 1.5, sample: [1e-4, 2e-4], c1: { r: 0.4, g: 0, b: 0 }, c2: { r: 0.1, g: 0, b: 0 }, c3: t.initial_background_color || "#ff0000" },
radioactive: {
wave: [0, 0],
expand: 1.7,
size: 0.95,
sample: [1e-4, 2e-4],
c1: { r: 0.2823529411764706, g: 1, b: 0.36470588235294116 },
c2: { r: 0.9215686274509803, g: 0.9176470588235294, b: 0.1607843137254902 },
c3: t.initial_background_color || "#2a2a2a",
},
sky: { wave: [0, 0], expand: 3, size: 1.1, sample: [0, 0], c1: { r: 0.72, g: 0.83, b: 0.99 }, c2: { r: 0.72, g: 0.77, b: 0.9 }, c3: t.initial_background_color || "#334466" },
oasis: { wave: [0.001, 0.002], expand: 1.3, size: 0.9, c2: { r: 0.36, g: 0.13, b: 0.13 }, c1: { r: 0.949, g: 0.776, b: 0.224 }, sample: [0.001, 0.002], c3: t.initial_background_color || "#5c431e" },
"black & blue": {
wave: [0.001, 0.1],
size: 1.1,
expand: 1.1,
sample: [1.7, 2.3],
c1: { r: 0.2627450980392157, g: 0.0196078431372549, b: 0.0196078431372549 },
c2: { r: 0.1411764705882353, g: 0, b: 0.6078431372549019 },
c3: t.initial_background_color || "#d7a7c7",
},
hallucination: {
wave: [0.001, 0.2],
expand: 1.5,
size: 1,
sample: [0.001, 0.1],
c1: { r: 0.8509803921568627, g: 0.5686274509803921, b: 0.9098039215686274 },
c2: { r: 0.9803921568627451, g: 0.3058823529411765, b: 0.3058823529411765 },
c3: t.initial_background_color || "#060616",
},
berry: { wave: [0.08, 0.08], expand: 1.2, size: 1.1, sample: [3, 3], c1: { r: 0.59375, g: 0.59375, b: 0.7421875 }, c2: { r: 0.69921875, g: 0.578125, b: 0.5625 }, c3: t.initial_background_color || "#2a2a2a" },
}),
(themes_to_pick_names = { "compact red": "compact red", radioactive: "radioactive", sky: "sky", "black & blue": "black & blue", hallucination: "hallucination", berry: "berry" }),
(possible_rules = { "prime number": 0, exponentiation: 3, inversion: 4, "standard life": 5 }),
(theme = { rule: 5, theme: themes_to_pick_names[t.initial_theme] }),
(w = function (t) {
(_ = !1),
light.color.copy(themes_to_pick[theme.theme].c1),
(F.color0 = "#" + light.color.getHexString()),
light2.color.copy(themes_to_pick[theme.theme].c2),
(F.color1 = "#" + light2.color.getHexString()),
t !== !0 && (console.log(t), g.material.color.setStyle(themes_to_pick[theme.theme].c3), v.material.color.setStyle(themes_to_pick[theme.theme].c3)),
(F.colorScene = "#" + g.material.color.getHexString()),
(effects.expand = themes_to_pick[theme.theme].expand),
y(),
(effects.size = themes_to_pick[theme.theme].size),
b(),
void 0 != themes_to_pick[theme.theme].wave ? (effectFocus.uniforms.waveFactor.value = themes_to_pick[theme.theme].wave) : (effectFocus.uniforms.waveFactor.value = 0.003);
}),
w(!0),
(S = t.gui),
S.add(p, "sampleDistance", 0, 3, 0.001).listen().onChange(U),
S.add(p, "waveFactor", 0, 0.6, 0.0025).listen().onChange(U),
S.addColor(F, "color0").onChange(z).listen(),
S.addColor(F, "color1").onChange(z).listen(),
S.addColor(F, "colorScene").onChange(z).listen(),
S.add(effects, "expand", 1, 3, 0.1).listen().onChange(y),
S.add(effects, "size", 1, 2, 0.1).listen().onChange(b),
S.add(effects, "selfie mode"),
S.add(N, "pause"),
S.add(theme, "rule", possible_rules),
S.add(theme, "theme", themes_to_pick_names).onChange(w),
S.close();
}
function i(t) {
for (var e = M[t].status, i = 0, r = -1; r <= 1; r++)
for (var n = -1; n <= 1; n++)
for (var s = -1; s <= 1; s++) {
var o = t + r * side * side + n * side + s;
M[o] && M[o].status && i++;
}
return e ? !(i < rules[theme.rule][1] - 2) && !(i > rules[theme.rule][0] + 1) && e : !(i > rules[theme.rule][0]) && !(i < rules[theme.rule][1]) && ((i > rules[theme.rule][1] && i <= rules[theme.rule][0]) || e);
}
function r() {
if (m || U) U = !1;
else {
for (var t = !1, e = [], n = 0, s = 0; s < side; s++) for (var o = 0; o < side; o++) for (var a = 0; a < side; a++) (e[n] = { status: i(n) }), 0 == t && 1 == e[n].status && (t = !0), n++;
M = e;
for (var n = 0, l = M.length; n < l; n++) (M[n].conway = M[n].status), (A[n].conway = M[n].status);
t || F();
}
timeout = setTimeout(r, 3500);
}
function n() {
if (!_) {
var t = Math.abs(Math.sin(z / 100));
(effectFocus.uniforms.sampleDistance.value = (1 - t) * themes_to_pick[theme.theme].sample[1] + t * themes_to_pick[theme.theme].sample[0]),
(effectFocus.uniforms.waveFactor.value = (1 - t) * themes_to_pick[theme.theme].wave[1] + t * themes_to_pick[theme.theme].wave[0]),
(p.sampleDistance = effectFocus.uniforms.sampleDistance.value),
(p.waveFactor = effectFocus.uniforms.waveFactor.value);
}
}
function s() {
D.composer.render(), controls.update(), n(), c && d.readyState === d.HAVE_ENOUGH_DATA && (u.needsUpdate = !0);
var t = Date.now();
z++;
var e = z / 1e3,
i = 400,
r = 3e-4 * t;
light.position.set(o.position.x, o.position.y + 50, o.position.z);
var r = 25e-5 * t;
light2.position.set(i * Math.sin(r) * Math.cos(r), i * Math.sin(r), i * Math.cos(r));
for (var s = A.length; s--; )
A[s].conway &&
(A[s].material.opacity < 1 && (A[s].material.opacity += 0.02),
A[s].scale.lerp(a.vector1, 0.2),
(A[s].rotation.y *= 0.9),
(A[s].rotation.z *= 0.9),
(A[s].position.y += 0.05 * Math.sin(e)),
A[s].position.lerp(A[s].position0, 0.1),
A[s].updateMatrix()),
!A[s].conway &&
A[s].material.opacity > 0 &&
(A[s].scale.lerp(a.vector0, 0.05),
m
? (A[s].scale.lerp(a.vector01, 0.1), A[s].material.opacity < 0.8 && (A[s].material.opacity += 0.01))
: (A[s].scale.lerp(a.vector0, 0.1), (A[s].material.opacity *= 0.9), (A[s].rotation.y += 0.008), (A[s].rotation.z += 0.005)),
A[s].position.lerp(A[s].position0, 0.01),
A[s].updateMatrix());
for (s = 0; s < A.length; s++) (h = (s / A.length) % 1), A[s].material.color.setHSL(h, 1, 0.5 + 0.1 * Math.sin(z / 50));
P.setFromCamera(R, o);
var l = P.intersectObjects(A);
l.length > 0
? ((controls.autoRotate = !1),
k != l[0].object
? (k && k.material.emissive.setHex(k.currentHex), (k = l[0].object), (k.currentHex = k.material.emissive.getHex()), k.material.emissive.setHex(16711680), m || ((k.scale.x *= 1.1), (k.scale.y *= 1.1), (k.scale.z *= 1.1)))
: (1 == f && (k.conway = !k.conway), m ? k.scale.lerp(a.vector1, 0.1) : k.scale.lerp(a.vector5, 0.1)))
: (k && k.material.emissive.setHex(k.currentHex), (k = null), (controls.autoRotate = !0)),
(f = !1);
}
console.log(t);
var o,
a,
l,
c,
u,
d,
f,
p,
m,
_,
v,
g,
y,
b,
x,
w,
T,
E,
C,
S,
R,
k,
P,
D = {},
A = [],
M = [],
O = t.width,
H = t.height,
U = !1;
e(),
(rules = [
[4, 3],
[2, 1],
[6, 3],
[20, 3],
[2, -1],
[8, 5],
]),
(this.reset = function () {
U = !0;
for (var t = 0; t < side; t++)
for (var e = 0; e < side; e++)
for (var i = 0; i < side; i++) {
var r = t * side * side + e * side + i;
(M[r].conway = Math.random() < 0.08),
(M[r].status = M[r].conway),
(A[r].conway = M[r].conway),
(A[r].position.x = (i - 0.5 * side) * size * 5),
(A[r].position.y = (e - 0.5 * side) * size * 5),
(A[r].position.z = (t - 0.5 * side) * size * 5);
}
});
var F = this.reset;
r(), (this.animate = function () {});
var z = 0;
(this.render = function () {
s();
}),
(T = function (t) {
t.preventDefault();
var e = l.domElement.getBoundingClientRect();
(R.x = ((t.clientX - e.left) / (e.right - e.left)) * 2 - 1), (R.y = (-(t.clientY - e.top) / (e.bottom - e.top)) * 2 + 1);
}),
(E = function (t) {
f = !0;
}),
(C = function () {
(O = container.clientWidth),
(H = container.clientHeight),
(effectFocus.uniforms.screenWidth.value = O),
(effectFocus.uniforms.screenHeight.value = H),
(o.aspect = O / H),
o.updateProjectionMatrix(),
l.setPixelRatio(window.devicePixelRatio),
l.setSize(O, H),
D.composer.setSize(O, H);
}),
window.addEventListener("mousemove", T, !1),
document.addEventListener("mouseup", E, !1),
window.addEventListener("resize", C, !1),
(this.updateZoom = function (t) {
o.setFocalLength(t);
}),
(this.changeColorMain = function (t) {
light.color.setStyle(t);
}),
(this.changeColorSecondary = function (t) {
light2.color.setStyle(t);
}),
(this.changeColorBackground = function (t) {
g.material.color.setStyle(t), v.material.color.setStyle(t);
}),
(this.stop = function () {}),
(this.changeSampleDistance = function (t) {
(_ = !0), (effectFocus.uniforms.sampleDistance.value = t);
}),
(this.changeWaveFactor = function (t) {
(_ = !0), (effectFocus.uniforms.waveFactor.value = t);
}),
(this.expandTo = function (t) {
(t < 0.5 || t > 5) && console.warn("recommended values are between 0.5 and 5"), (effects.expand = t), y();
}),
(this.resizeTo = function (t) {
(t < 0.5 || t > 5) && console.warn("recommended values are between 0.5 and 5"), (effects.size = t), b();
}),
(this.toggleSelfieMode = function () {
x();
}),
(this.changeRuleTo = function (t) {
void 0 != possible_rules[t] ? (theme.rule = possible_rules[t]) : console.error(newTheme, " not defined as a valid rule");
}),
(this.changeThemeTo = function (t) {
void 0 != themes_to_pick_names[t] ? ((theme.theme = t), w()) : console.error(t, " not defined as a valid theme");
}),
(this.stop = function () {
running && ((running = !running), cancelAnimationFrame(anim_frame));
}),
(this.start = function () {
running || ((running = !0), this.animate());
}),
(this.pause = function () {
(m = !m), (running = !running), (controls.autoRotate = !controls.autoRotate);
});
}),
(quality = 0),
(u_time = 0),
(window.requestAnimationFrame = (function () {
return (
window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function (t, e) {
window.setTimeout(t, 1e3 / 60);
}
);
})());
var Animation01 = function (t) {
(this.version = "5.0"), (this.author = "Tibaldo Juan AgustÃn"), (this.link = "tibaldo.io"), console.log("VERSION " + this.version + " author " + this.author + " " + this.link), Detector.webgl || Detector.addGetWebGLMessage();
var e = function () {
try {
var t = document.createElement("canvas");
return !(!window.WebGLRenderingContext || (!t.getContext("webgl") && !t.getContext("experimental-webgl")));
} catch (e) {
return !1;
}
};
e() || t();
};
(Animation01.prototype.setup = function (t, e, i) {
(this.renderer = new THREE.WebGLRenderer({ antialias: !0, alpha: !0 })),
(this.running = !1),
this.anim_frame,
(this.scenes = []),
(this.start_time = []),
(this.scene_set = []),
(this.params = t),
(this.CURRENT_SCENE = 0),
(this.scenes[0] = new Scene01()),
(this.scenes[1] = new Scene02()),
(this.scenes[2] = new Scene03()),
(this.scenes[3] = new Scene04()),
(this.scenes[4] = new Scene06()),
(this.scenes[5] = new SceneCubes()),
(this.fx_scene = new FXScene()),
(this.SECONDS = 60),
(this.container = document.getElementById(this.params.container_id)),
this.renderer,
(this.start_time[0] = [1, 0]),
(this.start_time[1] = [1, 0]),
(this.start_time[2] = [0, 6]),
(this.start_time[3] = [6, 11]),
(this.start_time[4] = [11, 16]),
(this.start_time[5] = [16, 21]);
for (var r = 0; r < this.start_time.length; r++) (this.start_time[r][0] *= this.SECONDS), (this.start_time[r][1] *= this.SECONDS), console.log("scene " + r + " time : " + this.start_time[r]);
for (var r = 0; r < this.scenes.length; r++) this.scene_set[r] = !1;
(this.setupScenes = function () {
this.scenes[0].setup(), this.scenes[1].setup(this.params), this.scenes[2].setup(this.params), this.scenes[5].setup(this.params), this.fx_scene.setup(this.params);
}),
(this.height = this.container.clientHeight),
(this.width = this.container.clientWidth),
(this.aspectRatio = this.width / this.height),
(this.params.renderer = this.renderer),
(this.params.width = this.height),
(this.params.height = this.width),
this.renderer.setClearColor(655361, 0),
this.renderer.setSize(this.container.clientWidth, this.container.clientHeight),
(this.renderer.autoClear = !1),
this.renderer.domElement.setAttribute("id", this.params.renderer_id),
(this.gui = new dat.GUI({ autoPlace: !1 })),
(this.params.gui = this.gui),
this.container.appendChild(this.renderer.domElement),
(this.main_camera = new THREE.PerspectiveCamera(75, this.aspectRatio, 0.01, 8e3)),
(this.main_camera.position.z = 375),
(this.main_camera.position.y = 10),
(this.control = new THREE.OrbitControls(this.main_camera, this.renderer.domElement)),
(this.control.target = new THREE.Vector3(0, 0, 0)),
(this.control.autoRotate = !1),
(this.control.minDistance = 60),
(this.control.maxDistance = 450),
(this.control.minPolarAngle = 0.9),
(this.control.maxPolarAngle = 3),
(this.control.enablePan = !1),
(this.control.enableZoom = !0),
(this.control.enableDamping = !0),
(this.control.dampingFactor = 0.03),
(this.control.rotateSpeed = 0.2),
(this.control.zoomSpeed = 0.8),
(this.stats = new Stats()),
this.stats.setMode(0),
this.container.appendChild(this.stats.domElement),
this.stats.domElement.setAttribute("id", this.params.stats_id),
(this.postprocessing = { enabled: !0 }),
(this.shaderSettings = { rings: 3, samples: 5 }),
(this.qualityO = {}),
(this.qualityO[this.params.quality_name] = 0),
(this.effectController = { fstop: 0.1, maxblur: 2.9, focalDepth: 4.3, depthblur: !0, threshold: 0.17, gain: 29.3, bias: 0.1, fringe: 0.49, dithering: 0 }),
(this.effectController[this.params.focal_length_name] = this.params.focal_length_init_val),
(this.material_depth = new THREE.MeshDepthMaterial()),
(this.initpostprocessing = function (t, e) {
var i = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat },
r = 0 == this.params.shader_to_use ? THREE.BokehShader : THREE.BokehShader2;
(this.postprocessing.scene = new THREE.Scene()),
(this.postprocessing.camera = new THREE.OrthographicCamera(t / -2, t / 2, e / 2, e / -2, -1e4, 1e4)),
(this.postprocessing.camera.position.z = 100),
this.postprocessing.scene.add(this.postprocessing.camera),
(this.postprocessing.rtTextureDepth = new THREE.WebGLRenderTarget(t, e, i)),
(this.postprocessing.rtTextureColor = new THREE.WebGLRenderTarget(t, e, i)),
(this.postprocessing.bokeh_uniforms = THREE.UniformsUtils.clone(r.uniforms)),
(this.postprocessing.bokeh_uniforms.tColor.value = this.postprocessing.rtTextureColor),
(this.postprocessing.bokeh_uniforms.tDepth.value = this.postprocessing.rtTextureDepth),
(this.postprocessing.bokeh_uniforms.textureWidth.value = t),
(this.postprocessing.bokeh_uniforms.textureHeight.value = e),
(this.postprocessing.materialBokeh = new THREE.ShaderMaterial({
uniforms: this.postprocessing.bokeh_uniforms,
vertexShader: r.vertexShader,
fragmentShader: r.fragmentShader,
defines: { RINGS: this.shaderSettings.rings, SAMPLES: this.shaderSettings.samples },
})),
(this.postprocessing.quad = new THREE.Mesh(new THREE.PlaneBufferGeometry(t, e), this.postprocessing.materialBokeh)),
(this.postprocessing.quad.position.z = -500),
this.postprocessing.scene.add(this.postprocessing.quad);
}),
this.initpostprocessing(this.width, this.height),
(this.shaderUpdate = function () {
(this.postprocessing.materialBokeh.defines.RINGS = this.shaderSettings.rings), (this.postprocessing.materialBokeh.defines.SAMPLES = this.shaderSettings.samples), (this.postprocessing.materialBokeh.needsUpdate = !0);
}),
(this.qualityUpdate = function () {
(quality = this.qualityO[this.params.quality_name]),
2 == quality || 3 == quality
? ((this.renderType = this.renderGl),
2 == quality
? ((this.postprocessing.materialBokeh.defines.RINGS = 3),
(this.postprocessing.materialBokeh.defines.SAMPLES = 5),
(this.postprocessing.bokeh_uniforms.maxblur.value = 2.9),
(this.postprocessing.bokeh_uniforms.fstop.value = 0.1),
(this.postprocessing.bokeh_uniforms.gain.value = 29),
(this.postprocessing.materialBokeh.needsUpdate = !0))
: ((this.postprocessing.materialBokeh.defines.RINGS = 7),
(this.postprocessing.materialBokeh.defines.SAMPLES = 6),
(this.postprocessing.bokeh_uniforms.maxblur.value = 2.4),
(this.postprocessing.bokeh_uniforms.fstop.value = 3.2),
(this.postprocessing.bokeh_uniforms.gain.value = 62),
(this.postprocessing.materialBokeh.needsUpdate = !0)))
: (this.renderType = this.renderCanvas);
}),
(this.themeColorChange = function () {
if (5 == this.color[this.params.color_theme_name]) for (var t = 2; t <= 4; t++) this.scenes[t].resetColor();
else
for (var t = 2; t <= 4; t++)
this.scenes[t].changeMainColour(this.color.theme[this.color[this.params.color_theme_name]][0]),
this.scenes[t].changeSecondaryColour(this.color.theme[this.color[this.params.color_theme_name]][1]),
this.scenes[t].changeMainNodeColour(this.color.theme[this.color[this.params.color_theme_name]][2]);
}),
(this.matChanger = function () {
for (var t in this.effectController) t in this.postprocessing.bokeh_uniforms && (this.postprocessing.bokeh_uniforms[t].value = this.effectController[t]);
this.main_camera.setFocalLength(this.effectController[this.params.focal_length_name]),
(this.postprocessing.bokeh_uniforms.znear.value = this.main_camera.near),
(this.postprocessing.bokeh_uniforms.zfar.value = this.main_camera.far);
}),
(this.mainColorChange = function () {
for (var t = 2; t <= 4; t++) this.scenes[t].changeMainColour(this.color[this.params.main_color_name]);
}),
(this.secondaryColorChange = function () {
for (var t = 2; t <= 4; t++) this.scenes[t].changeSecondaryColour(this.color[this.params.secondary_color_name]);
}),
(this.nodeColorChange = function () {
for (var t = 2; t <= 4; t++) this.scenes[t].changeMainNodeColour(this.color[this.params.spheres_color_name]);
}),
(this.color = {
theme: [
["#153243", "#284B63", "#B4B8AB"],
["#FFAAAA", "#550000", "#801515"],
["#496C89", "#123552", "#042037"],
],
}),
(this.color[this.params.color_theme_name] = 0),
(this.color[this.params.spheres_color_name] = "#d29c9c"),
(this.color[this.params.secondary_color_name] = "#8333af"),
(this.color[this.params.main_color_name] = "#966164");
var n = this;
(this.controls = {}),
(this.controls[this.params.next_name] = function () {
n.next();
}),
(this.controls[this.params.play_name] = function () {
n.run();
}),
(this.controls[this.params.pause_name] = function () {
n.pause();
}),
(this.controls[this.params.stop_name] = function () {
n.stop();
}),
(this.controls[this.params.reset_name] = function () {
n.reset();
}),
(this.controls[this.params.next_animation_name] = function () {
n.next();
}),
(this.folder_general = this.gui.addFolder("General")),
(this.folder_color = this.gui.addFolder("Color Picker")),
(this.folder_control = this.gui.addFolder("Animation Control")),
this.folder_general.add(this.effectController, this.params.focal_length_name, 16, 80, 0.01).onChange(this.matChanger.bind(this)),
this.folder_general.add(this.qualityO, this.params.quality_name, 0, 3).step(1).onChange(this.qualityUpdate.bind(this)),
this.folder_general.add(this.color, this.params.color_theme_name, 0, 2).step(1).onChange(this.themeColorChange.bind(this)),
this.folder_color.addColor(this.color, this.params.main_color_name).onChange(this.mainColorChange.bind(this)),
this.folder_color.addColor(this.color, this.params.secondary_color_name).onChange(this.secondaryColorChange.bind(this)),
this.folder_color.addColor(this.color, this.params.spheres_color_name).onChange(this.nodeColorChange.bind(this)),
this.folder_control.add(this.controls, this.params.next_name),
this.folder_control.add(this.controls, this.params.play_name),
this.folder_control.add(this.controls, this.params.pause_name),
this.folder_control.add(this.controls, this.params.stop_name),
this.folder_control.add(this.controls, this.params.reset_name),
this.matChanger(),
this.container.appendChild(this.gui.domElement),
this.gui.domElement.setAttribute("id", this.params.gui_id),
(this.avisar_fin = !0),
(this.anim_playing = this.params.now_playing),
(this.render = function () {
(this.anim_frame = requestAnimationFrame(this.render.bind(this))),
(this.running = !0),
this.stats.begin(),
0 == this.anim_playing
? (this.control.update(),
u_time++,
(s_u_time = Math.sin(u_time)),
u_time > this.start_time[0][0] && u_time < this.start_time[0][1] && this.scene_set[0] === !1 && ((this.CURRENT_SCENE = 0), (this.scene_set[this.CURRENT_SCENE] = !0)),
u_time > this.start_time[1][0] && u_time < this.start_time[1][1] && this.scene_set[1] === !1 && ((this.CURRENT_SCENE = 1), (this.scene_set[this.CURRENT_SCENE] = !0)),
u_time > this.start_time[2][0] && u_time < this.start_time[2][1] && this.scene_set[2] === !1 && ((this.CURRENT_SCENE = 2), (this.scene_set[this.CURRENT_SCENE] = !0)),
u_time > this.start_time[3][0] &&
u_time < this.start_time[3][1] &&
this.scene_set[3] === !1 &&
((this.CURRENT_SCENE = 3), (this.scene_set[this.CURRENT_SCENE] = !0), this.scenes[this.CURRENT_SCENE].setup(this.scenes[2].exporte())),
u_time > this.start_time[4][0] &&
u_time < this.start_time[4][1] &&
this.scene_set[4] === !1 &&
((this.CURRENT_SCENE = 4), (this.scene_set[this.CURRENT_SCENE] = !0), this.scenes[this.CURRENT_SCENE].setup(this.scenes[3].exporte(), this.params)),
this.avisar_fin && u_time > this.start_time[4][1] && ((this.avisar_fin = !1), console.log(u_time), i()),
this.fx_scene.loop(),
this.renderer.render(this.fx_scene.background_scene, this.fx_scene.background_camera),
this.renderType(),
this.renderer.render(this.fx_scene.foreground_scene, this.fx_scene.foreground_camera),
this.stats.end())
: this.scenes[5].render(),
this.loopCallback && this.loopCallback();
}),
(this.renderGl = function () {
0 === this.CURRENT_SCENE || 1 === this.CURRENT_SCENE
? ((this.scenes[this.CURRENT_SCENE].scene.overrideMaterial = null), this.scenes[this.CURRENT_SCENE].loop(), this.renderer.render(this.scenes[this.CURRENT_SCENE].scene, this.main_camera))
: ((this.scenes[this.CURRENT_SCENE].scene.overrideMaterial = null),
this.scenes[this.CURRENT_SCENE].loop(),
this.renderer.render(this.scenes[this.CURRENT_SCENE].scene, this.main_camera, this.postprocessing.rtTextureColor, !0),
(this.scenes[this.CURRENT_SCENE].scene.overrideMaterial = this.material_depth),
this.renderer.render(this.scenes[this.CURRENT_SCENE].scene, this.main_camera, this.postprocessing.rtTextureDepth, !0),
this.renderer.render(this.postprocessing.scene, this.postprocessing.camera));
}),
(this.renderCanvas = function () {
(this.scenes[this.CURRENT_SCENE].scene.overrideMaterial = null), this.scenes[this.CURRENT_SCENE].loop(), this.renderer.render(this.scenes[this.CURRENT_SCENE].scene, this.main_camera);
}),
(this.renderType = this.renderCanvas),
(this.loadFont = function (t) {
var i = new THREE.FontLoader();
i.load(this.params.electrolized_path, function (i) {
(electrolized_font = i), t.setupScenes(), e();
});
}),
this.loadFont(this);
}),
(Animation01.prototype.run = function () {
this.running || this.render();
}),
(Animation01.prototype.reset = function () {
this.stop(), (this.main_camera.position.z = 220), (this.main_camera.position.y = 10), (this.main_camera.position.x = 0), this.main_camera.rotation.set(0, 0, 0), (this.avisar_fin = !0), (u_time = 0);
for (var t = this.scenes.length; t--; ) (this.CURRENT_SCENE = 1), (this.scene_set[t] = !1);
this.scenes[0].reset(), this.scenes[1].reset(), this.scenes[2].setup(this.params), this.scenes[5].reset(), this.run();
}),
(Animation01.prototype.isRunning = function () {
return this.running;
}),
(Animation01.prototype.stop = function () {
this.running && ((this.running = !this.running), cancelAnimationFrame(this.anim_frame));
}),
(Animation01.prototype.pause = function () {
this.scenes[5].pause();
}),
(Animation01.prototype.updateZoom = function (t) {
0 == this.anim_playing ? (this.effectController[this.params.focal_length_name] = t) : this.scenes[5].updateZoom(t), this.matChanger();
}),
(Animation01.prototype.updateQuality = function (t) {
(this.qualityO[this.params.quality_name] = t), this.qualityUpdate();
}),
(Animation01.prototype.updateTheme = function (t) {
(this.color[this.params.color_theme_name] = t), this.themeColorChange();
}),
(Animation01.prototype.updateColorMain = function (t) {
(this.color[this.params.main_color_name] = t), this.mainColorChange();
}),
(Animation01.prototype.updateColorSecondary = function (t) {
(this.color[this.params.secondary_color_name] = t), this.secondaryColorChange();
}),
(Animation01.prototype.updateColorSphere = function (t) {
(this.color[this.params.spheres_color_name] = t), this.nodeColorChange();
}),
(Animation01.prototype.setLoopCallback = function (t) {
this.loopCallback = t;
}),
(Animation01.prototype.updateCanvas = function () {
(this.height = this.container.clientHeight),
(this.width = this.container.clientWidth),
(this.aspectRatio = this.width / this.height),
(this.postprocessing.camera.aspect = this.aspectRatio),
(this.main_camera.aspect = this.aspectRatio),
this.main_camera.updateProjectionMatrix(),
this.postprocessing.camera.updateProjectionMatrix(),
this.renderer.setSize(this.width, this.height),
(this.postprocessing.bokeh_uniforms.textureWidth.value = this.width),
(this.postprocessing.bokeh_uniforms.textureHeight.value = this.height),
this.scenes[5].updateCanvas();
}),
(Animation01.prototype.version = function () {
return this.version;
}),
(Animation01.prototype.next = function () {
(this.anim_playing = 0 == this.anim_playing ? 1 : 0), 1 == this.anim_playing && this.scenes[5].start();
}),
(Animation01.prototype.changeColorMain = function (t) {
this.scenes[5].changeColorMain(t), light.color.setStyle(t);
}),
(Animation01.prototype.changeColorSecondary = function (t) {
this.scenes[5].changeColorSecondary(t);
}),
(Animation01.prototype.changeColorBackground = function (t) {
this.scenes[5].changeColorBackground(t);
}),
(Animation01.prototype.changeSampleDistance = function (t) {
this.scenes[5].changeSampleDistance(t);
}),
(Animation01.prototype.changeWaveFactor = function (t) {
this.scenes[5].changeWaveFactor(t);
}),
(Animation01.prototype.expandTo = function (t) {
this.scenes[5].expandTo(t);
}),
(Animation01.prototype.resizeTo = function (t) {
this.scenes[5].resizeTo(t);
}),
(Animation01.prototype.toggleSelfieMode = function () {
this.scenes[5].toggleSelfieMode();
}),
(Animation01.prototype.changeRuleTo = function (t) {
this.scenes[5].changeRuleTo(t);
}),
(Animation01.prototype.changeThemeTo = function (t) {
this.scenes[5].changeThemeTo(t);
});