/*
@license
dhtmlxGantt v.8.0.6 Standard
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
To use dhtmlxGantt in non-GPL projects (and get Pro version of the product), please obtain Individual, Commercial, Enterprise or Ultimate license on our site https://dhtmlx.com/docs/products/dhtmlxGantt/#licensing or contact us at info@dhtmlx.com
(c) XB Software
*/
!function(t, e) {
"object" == typeof exports && "object" == typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define("dhtmlxgantt", [], e) : "object" == typeof exports ? exports.dhtmlxgantt = e() : t.dhtmlxgantt = e()
}(window, function() {
return function(t) {
var e = {};
function n(i) {
if (e[i])
return e[i].exports;
var r = e[i] = {
i: i,
l: !1,
exports: {}
};
return t[i].call(r.exports, r, r.exports, n),
r.l = !0,
r.exports
}
return n.m = t,
n.c = e,
n.d = function(t, e, i) {
n.o(t, e) || Object.defineProperty(t, e, {
enumerable: !0,
get: i
})
}
,
n.r = function(t) {
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {
value: "Module"
}),
Object.defineProperty(t, "__esModule", {
value: !0
})
}
,
n.t = function(t, e) {
if (1 & e && (t = n(t)),
8 & e)
return t;
if (4 & e && "object" == typeof t && t && t.__esModule)
return t;
var i = Object.create(null);
if (n.r(i),
Object.defineProperty(i, "default", {
enumerable: !0,
value: t
}),
2 & e && "string" != typeof t)
for (var r in t)
n.d(i, r, function(e) {
return t[e]
}
.bind(null, r));
return i
}
,
n.n = function(t) {
var e = t && t.__esModule ? function() {
return t.default
}
: function() {
return t
}
;
return n.d(e, "a", e),
e
}
,
n.o = function(t, e) {
return Object.prototype.hasOwnProperty.call(t, e)
}
,
n.p = "/codebase/",
n(n.s = 299)
}([function(t, e, n) {
function i(t) {
"@babel/helpers - typeof";
return (i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
var r, a = n(2), o = {}.constructor.toString();
t.exports = {
copy: function t(e) {
var n, r;
if (e && "object" == i(e))
switch (!0) {
case a.isDate(e):
r = new Date(e);
break;
case a.isArray(e):
for (r = new Array(e.length),
n = 0; n < e.length; n++)
r[n] = t(e[n]);
break;
default:
for (n in r = function(t) {
return t.constructor.toString() !== o
}(e) ? Object.create(e) : {},
e)
Object.prototype.hasOwnProperty.apply(e, [n]) && (r[n] = t(e[n]))
}
return r || e
},
defined: function(t) {
return void 0 !== t
},
mixin: function(t, e, n) {
for (var i in e)
(void 0 === t[i] || n) && (t[i] = e[i]);
return t
},
uid: function() {
return r || (r = (new Date).valueOf()),
++r
},
bind: function(t, e) {
return t.bind ? t.bind(e) : function() {
return t.apply(e, arguments)
}
},
event: function(t, e, n, i) {
t.addEventListener ? t.addEventListener(e, n, void 0 !== i && i) : t.attachEvent && t.attachEvent("on" + e, n)
},
eventRemove: function(t, e, n, i) {
t.removeEventListener ? t.removeEventListener(e, n, void 0 !== i && i) : t.detachEvent && t.detachEvent("on" + e, n)
}
}
}
, function(t, e) {
function n(t) {
var e = 0
, n = 0
, i = 0
, r = 0;
if (t.getBoundingClientRect) {
var a = t.getBoundingClientRect()
, o = document.body
, s = document.documentElement || document.body.parentNode || document.body
, l = window.pageYOffset || s.scrollTop || o.scrollTop
, c = window.pageXOffset || s.scrollLeft || o.scrollLeft
, u = s.clientTop || o.clientTop || 0
, d = s.clientLeft || o.clientLeft || 0;
e = a.top + l - u,
n = a.left + c - d,
i = document.body.offsetWidth - a.right,
r = document.body.offsetHeight - a.bottom
} else {
for (; t; )
e += parseInt(t.offsetTop, 10),
n += parseInt(t.offsetLeft, 10),
t = t.offsetParent;
i = document.body.offsetWidth - t.offsetWidth - n,
r = document.body.offsetHeight - t.offsetHeight - e
}
return {
y: Math.round(e),
x: Math.round(n),
width: t.offsetWidth,
height: t.offsetHeight,
right: Math.round(i),
bottom: Math.round(r)
}
}
function i(t) {
var e = !1
, n = !1;
if (window.getComputedStyle) {
var i = window.getComputedStyle(t, null);
e = i.display,
n = i.visibility
} else
t.currentStyle && (e = t.currentStyle.display,
n = t.currentStyle.visibility);
return "none" != e && "hidden" != n
}
function r(t) {
return !isNaN(t.getAttribute("tabindex")) && 1 * t.getAttribute("tabindex") >= 0
}
function a(t) {
return !{
a: !0,
area: !0
}[t.nodeName.loLowerCase()] || !!t.getAttribute("href")
}
function o(t) {
return !{
input: !0,
select: !0,
textarea: !0,
button: !0,
object: !0
}[t.nodeName.toLowerCase()] || !t.hasAttribute("disabled")
}
function s(t) {
if (!t)
return "";
var e = t.className || "";
return e.baseVal && (e = e.baseVal),
e.indexOf || (e = ""),
u(e)
}
var l;
function c(t) {
var e;
return t.tagName ? e = t : (e = (t = t || window.event).target || t.srcElement).shadowRoot && t.composedPath && (e = t.composedPath()[0]),
e
}
function u(t) {
return (String.prototype.trim || function() {
return this.replace(/^\s+|\s+$/g, "")
}
).apply(t)
}
function d() {
return document.head.createShadowRoot || document.head.attachShadow
}
function h(t) {
if (!t)
return document.body;
if (!d())
return document.body;
for (; t.parentNode && (t = t.parentNode); )
if (t instanceof ShadowRoot)
return t.host;
return document.body
}
t.exports = {
getNodePosition: n,
getFocusableNodes: function(t) {
for (var e = t.querySelectorAll(["a[href]", "area[href]", "input", "select", "textarea", "button", "iframe", "object", "embed", "[tabindex]", "[contenteditable]"].join(", ")), n = Array.prototype.slice.call(e, 0), s = 0; s < n.length; s++)
n[s].$position = s;
for (n.sort(function(t, e) {
return 0 === t.tabIndex && 0 !== e.tabIndex ? 1 : 0 !== t.tabIndex && 0 === e.tabIndex ? -1 : t.tabIndex === e.tabIndex ? t.$position - e.$position : t.tabIndex < e.tabIndex ? -1 : 1
}),
s = 0; s < n.length; s++) {
var l = n[s];
(r(l) || o(l) || a(l)) && i(l) || (n.splice(s, 1),
s--)
}
return n
},
getScrollSize: function() {
var t = document.createElement("div");
t.style.cssText = "visibility:hidden;position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;height:110px;min-height:100px;overflow-y:scroll;",
document.body.appendChild(t);
var e = t.offsetWidth - t.clientWidth;
return document.body.removeChild(t),
e
},
getClassName: s,
addClassName: function(t, e) {
e && -1 === t.className.indexOf(e) && (t.className += " " + e)
},
removeClassName: function(t, e) {
e = e.split(" ");
for (var n = 0; n < e.length; n++) {
var i = new RegExp("\\s?\\b" + e[n] + "\\b(?![-_.])","");
t.className = t.className.replace(i, "")
}
},
insertNode: function(t, e) {
l || (l = document.createElement("div")),
l.innerHTML = e;
var n = l.firstChild;
return t.appendChild(n),
n
},
removeNode: function(t) {
t && t.parentNode && t.parentNode.removeChild(t)
},
getChildNodes: function(t, e) {
for (var n = t.childNodes, i = n.length, r = [], a = 0; a < i; a++) {
var o = n[a];
o.className && -1 !== o.className.indexOf(e) && r.push(o)
}
return r
},
toNode: function(t) {
return "string" == typeof t ? document.getElementById(t) || document.querySelector(t) || document.body : t || document.body
},
locateClassName: function(t, e, n) {
var i = c(t)
, r = "";
for (void 0 === n && (n = !0); i; ) {
if (r = s(i)) {
var a = r.indexOf(e);
if (a >= 0) {
if (!n)
return i;
var o = 0 === a || !u(r.charAt(a - 1))
, l = a + e.length >= r.length || !u(r.charAt(a + e.length));
if (o && l)
return i
}
}
i = i.parentNode
}
return null
},
locateAttribute: function(t, e) {
if (e) {
for (var n = c(t); n; ) {
if (n.getAttribute && n.getAttribute(e))
return n;
n = n.parentNode
}
return null
}
},
getTargetNode: c,
getRelativeEventPosition: function(t, e) {
var i = document.documentElement
, r = n(e);
return {
x: t.clientX + i.scrollLeft - i.clientLeft - r.x + e.scrollLeft,
y: t.clientY + i.scrollTop - i.clientTop - r.y + e.scrollTop
}
},
isChildOf: function(t, e) {
if (!t || !e)
return !1;
for (; t && t != e; )
t = t.parentNode;
return t === e
},
hasClass: function(t, e) {
return "classList"in t ? t.classList.contains(e) : new RegExp("\\b" + e + "\\b").test(t.className)
},
closest: function(t, e) {
if (t.closest)
return t.closest(e);
if (t.matches || t.msMatchesSelector || t.webkitMatchesSelector) {
var n = t;
if (!document.documentElement.contains(n))
return null;
do {
if ((n.matches || n.msMatchesSelector || n.webkitMatchesSelector).call(n, e))
return n;
n = n.parentElement || n.parentNode
} while (null !== n && 1 === n.nodeType);
return null
}
return console.error("Your browser is not supported"),
null
},
getRootNode: h,
hasShadowParent: function(t) {
return !!h(t)
},
isShadowDomSupported: d,
getActiveElement: function() {
var t = document.activeElement;
return t.shadowRoot && (t = t.shadowRoot.activeElement),
t === document.body && document.getSelection && (t = document.getSelection().focusNode || document.body),
t
}
}
}
, function(t, e) {
function n(t) {
"@babel/helpers - typeof";
return (n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
var i = {
second: 1,
minute: 60,
hour: 3600,
day: 86400,
week: 604800,
month: 2592e3,
quarter: 7776e3,
year: 31536e3
};
function r(t) {
return !(!t || "object" !== n(t)) && !!(t.getFullYear && t.getMonth && t.getDate)
}
function a(t, e) {
var n = [];
if (t.filter)
return t.filter(e);
for (var i = 0; i < t.length; i++)
e(t[i], i) && (n[n.length] = t[i]);
return n
}
function o(t) {
return 0 === t
}
t.exports = {
getSecondsInUnit: function(t) {
return i[t] || i.hour
},
forEach: function(t, e) {
if (t.forEach)
t.forEach(e);
else
for (var n = t.slice(), i = 0; i < n.length; i++)
e(n[i], i)
},
arrayMap: function(t, e) {
if (t.map)
return t.map(e);
for (var n = t.slice(), i = [], r = 0; r < n.length; r++)
i.push(e(n[r], r));
return i
},
arrayIncludes: function(t, e) {
if (t.includes)
return t.includes(e);
for (var n = 0; n < t.length; n++)
if (t[n] === e)
return !0;
return !1
},
arrayFind: function(t, e) {
if (t.find)
return t.find(e);
for (var n = 0; n < t.length; n++)
if (e(t[n], n))
return t[n]
},
arrayFilter: a,
arrayDifference: function(t, e) {
return a(t, function(t, n) {
return !e(t, n)
})
},
arraySome: function(t, e) {
if (0 === t.length)
return !1;
for (var n = 0; n < t.length; n++)
if (e(t[n], n, t))
return !0;
return !1
},
hashToArray: function(t) {
var e = [];
for (var n in t)
t.hasOwnProperty(n) && e.push(t[n]);
return e
},
sortArrayOfHash: function(t, e, n) {
var i = function(t, e) {
return t < e
};
t.sort(function(t, r) {
return t[e] === r[e] ? 0 : n ? i(t[e], r[e]) : i(r[e], t[e])
})
},
throttle: function(t, e) {
var n = !1;
return function() {
n || (t.apply(null, arguments),
n = !0,
setTimeout(function() {
n = !1
}, e))
}
},
isArray: function(t) {
return Array.isArray ? Array.isArray(t) : t && void 0 !== t.length && t.pop && t.push
},
isDate: r,
isValidDate: function(t) {
return r(t) && !isNaN(t.getTime())
},
isStringObject: function(t) {
return t && "object" === n(t) && "function String() { [native code] }" === Function.prototype.toString.call(t.constructor)
},
isNumberObject: function(t) {
return t && "object" === n(t) && "function Number() { [native code] }" === Function.prototype.toString.call(t.constructor)
},
isBooleanObject: function(t) {
return t && "object" === n(t) && "function Boolean() { [native code] }" === Function.prototype.toString.call(t.constructor)
},
delay: function(t, e) {
var n, i = function i() {
i.$cancelTimeout(),
i.$pending = !0;
var r = Array.prototype.slice.call(arguments);
n = setTimeout(function() {
t.apply(this, r),
i.$pending = !1
}, e)
};
return i.$pending = !1,
i.$cancelTimeout = function() {
clearTimeout(n),
i.$pending = !1
}
,
i.$execute = function() {
var e = Array.prototype.slice.call(arguments);
t.apply(this, e),
i.$cancelTimeout()
}
,
i
},
objectKeys: function(t) {
if (Object.keys)
return Object.keys(t);
var e, n = [];
for (e in t)
Object.prototype.hasOwnProperty.call(t, e) && n.push(e);
return n
},
isEventable: function(t) {
return t.attachEvent && t.detachEvent
},
replaceValidZeroId: function(t, e) {
return o(t) && !o(e) && (t = "0"),
t
},
checkZeroId: o,
findBinary: function(t, e) {
for (var n, i, r, a = 0, o = t.length - 1; a <= o; )
if (i = +t[n = Math.floor((a + o) / 2)],
r = +t[n - 1],
i < e)
a = n + 1;
else {
if (!(i > e)) {
for (; +t[n] == +t[n + 1]; )
n++;
return n
}
if (!isNaN(r) && r < e)
return n - 1;
o = n - 1
}
return t.length - 1
}
}
}
, function(t, e) {
t.exports = function(t, e) {
for (var n in e)
e.hasOwnProperty(n) && (t[n] = e[n]);
function i() {
this.constructor = t
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype,
new i)
}
}
, function(t, e) {
function n(t) {
"@babel/helpers - typeof";
return (n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
var i;
i = function() {
return this
}();
try {
i = i || Function("return this")() || (0,
eval)("this")
} catch (t) {
"object" === ("undefined" == typeof window ? "undefined" : n(window)) && (i = window)
}
t.exports = i
}
, function(t, e) {
var n = function() {
this._silent_mode = !1,
this.listeners = {}
};
n.prototype = {
_silentStart: function() {
this._silent_mode = !0
},
_silentEnd: function() {
this._silent_mode = !1
}
};
var i = function(t) {
var e = {}
, n = 0
, i = function() {
var n = !0;
for (var i in e) {
var r = e[i].apply(t, arguments);
n = n && r
}
return n
};
return i.addEvent = function(t, r) {
if ("function" == typeof t) {
var a;
if (r && r.id ? a = r.id : (a = n,
n++),
r && r.once) {
var o = t;
t = function() {
o(),
i.removeEvent(a)
}
}
return e[a] = t,
a
}
return !1
}
,
i.removeEvent = function(t) {
delete e[t]
}
,
i.clear = function() {
e = {}
}
,
i
};
t.exports = function(t) {
var e = new n;
t.attachEvent = function(t, n, r) {
t = "ev_" + t.toLowerCase(),
e.listeners[t] || (e.listeners[t] = i(this)),
r && r.thisObject && (n = n.bind(r.thisObject));
var a = t + ":" + e.listeners[t].addEvent(n, r);
return r && r.id && (a = r.id),
a
}
,
t.attachAll = function(t) {
this.attachEvent("listen_all", t)
}
,
t.callEvent = function(t, n) {
if (e._silent_mode)
return !0;
var i = "ev_" + t.toLowerCase()
, r = e.listeners;
return r.ev_listen_all && r.ev_listen_all.apply(this, [t].concat(n)),
!r[i] || r[i].apply(this, n)
}
,
t.checkEvent = function(t) {
return !!e.listeners["ev_" + t.toLowerCase()]
}
,
t.detachEvent = function(t) {
if (t) {
var n = e.listeners;
for (var i in n)
n[i].removeEvent(t);
var r = t.split(":");
if (n = e.listeners,
2 === r.length) {
var a = r[0]
, o = r[1];
n[a] && n[a].removeEvent(o)
}
}
}
,
t.detachAllEvents = function() {
for (var t in e.listeners)
e.listeners[t].clear()
}
}
}
, function(t, e) {
t.exports = function(t, e, n, i, r) {
var a = e.getItemIndexByTopPosition(r.y) || 0
, o = e.getItemIndexByTopPosition(r.y_end) || i.count();
return {
start: Math.max(0, a - 1),
end: Math.min(i.count(), o + 1)
}
}
}
, function(t, e) {
function n() {
console.log("Method is not implemented.")
}
function i() {}
i.prototype.render = n,
i.prototype.set_value = n,
i.prototype.get_value = n,
i.prototype.focus = n,
t.exports = function(t) {
return i
}
}
, function(t, e) {
"function" == typeof Object.create ? t.exports = function(t, e) {
t.super_ = e,
t.prototype = Object.create(e.prototype, {
constructor: {
value: t,
enumerable: !1,
writable: !0,
configurable: !0
}
})
}
: t.exports = function(t, e) {
t.super_ = e;
var n = function() {};
n.prototype = e.prototype,
t.prototype = new n,
t.prototype.constructor = t
}
}
, function(t, e) {
var n, i, r = t.exports = {};
function a() {
throw new Error("setTimeout has not been defined")
}
function o() {
throw new Error("clearTimeout has not been defined")
}
function s(t) {
if (n === setTimeout)
return setTimeout(t, 0);
if ((n === a || !n) && setTimeout)
return n = setTimeout,
setTimeout(t, 0);
try {
return n(t, 0)
} catch (e) {
try {
return n.call(null, t, 0)
} catch (e) {
return n.call(this, t, 0)
}
}
}
!function() {
try {
n = "function" == typeof setTimeout ? setTimeout : a
} catch (t) {
n = a
}
try {
i = "function" == typeof clearTimeout ? clearTimeout : o
} catch (t) {
i = o
}
}();
var l, c = [], u = !1, d = -1;
function h() {
u && l && (u = !1,
l.length ? c = l.concat(c) : d = -1,
c.length && f())
}
function f() {
if (!u) {
var t = s(h);
u = !0;
for (var e = c.length; e; ) {
for (l = c,
c = []; ++d < e; )
l && l[d].run();
d = -1,
e = c.length
}
l = null,
u = !1,
function(t) {
if (i === clearTimeout)
return clearTimeout(t);
if ((i === o || !i) && clearTimeout)
return i = clearTimeout,
clearTimeout(t);
try {
i(t)
} catch (e) {
try {
return i.call(null, t)
} catch (e) {
return i.call(this, t)
}
}
}(t)
}
}
function _(t, e) {
this.fun = t,
this.array = e
}
function g() {}
r.nextTick = function(t) {
var e = new Array(arguments.length - 1);
if (arguments.length > 1)
for (var n = 1; n < arguments.length; n++)
e[n - 1] = arguments[n];
c.push(new _(t,e)),
1 !== c.length || u || s(f)
}
,
_.prototype.run = function() {
this.fun.apply(null, this.array)
}
,
r.title = "browser",
r.browser = !0,
r.env = {},
r.argv = [],
r.version = "",
r.versions = {},
r.on = g,
r.addListener = g,
r.once = g,
r.off = g,
r.removeListener = g,
r.removeAllListeners = g,
r.emit = g,
r.prependListener = g,
r.prependOnceListener = g,
r.listeners = function(t) {
return []
}
,
r.binding = function(t) {
throw new Error("process.binding is not supported")
}
,
r.cwd = function() {
return "/"
}
,
r.chdir = function(t) {
throw new Error("process.chdir is not supported")
}
,
r.umask = function() {
return 0
}
}
, function(t, e) {
t.exports = function(t) {
var e = function() {};
return e.prototype = {
show: function(t, e, n, i) {},
hide: function() {},
set_value: function(t, e, n, i) {
this.get_input(i).value = t
},
get_value: function(t, e, n) {
return this.get_input(n).value || ""
},
is_changed: function(t, e, n, i) {
var r = this.get_value(e, n, i);
return r && t && r.valueOf && t.valueOf ? r.valueOf() != t.valueOf() : r != t
},
is_valid: function(t, e, n, i) {
return !0
},
save: function(t, e, n) {},
get_input: function(t) {
return t.querySelector("input")
},
focus: function(t) {
var e = this.get_input(t);
e && (e.focus && e.focus(),
e.select && e.select())
}
},
e
}
}
, function(t, e) {
var n = "undefined" != typeof window
, i = {
isIE: n && (navigator.userAgent.indexOf("MSIE") >= 0 || navigator.userAgent.indexOf("Trident") >= 0),
isIE6: n && !XMLHttpRequest && navigator.userAgent.indexOf("MSIE") >= 0,
isIE7: n && navigator.userAgent.indexOf("MSIE 7.0") >= 0 && navigator.userAgent.indexOf("Trident") < 0,
isIE8: n && navigator.userAgent.indexOf("MSIE 8.0") >= 0 && navigator.userAgent.indexOf("Trident") >= 0,
isOpera: n && navigator.userAgent.indexOf("Opera") >= 0,
isChrome: n && navigator.userAgent.indexOf("Chrome") >= 0,
isKHTML: n && (navigator.userAgent.indexOf("Safari") >= 0 || navigator.userAgent.indexOf("Konqueror") >= 0),
isFF: n && navigator.userAgent.indexOf("Firefox") >= 0,
isIPad: n && navigator.userAgent.search(/iPad/gi) >= 0,
isEdge: n && -1 != navigator.userAgent.indexOf("Edge"),
isNode: !n || "undefined" == typeof navigator
};
t.exports = i
}
, function(t, e, n) {
"use strict";
var i = n(23)
, r = Object.keys || function(t) {
var e = [];
for (var n in t)
e.push(n);
return e
}
;
t.exports = d;
var a = n(17);
a.inherits = n(8);
var o = n(62)
, s = n(58);
a.inherits(d, o);
for (var l = r(s.prototype), c = 0; c < l.length; c++) {
var u = l[c];
d.prototype[u] || (d.prototype[u] = s.prototype[u])
}
function d(t) {
if (!(this instanceof d))
return new d(t);
o.call(this, t),
s.call(this, t),
t && !1 === t.readable && (this.readable = !1),
t && !1 === t.writable && (this.writable = !1),
this.allowHalfOpen = !0,
t && !1 === t.allowHalfOpen && (this.allowHalfOpen = !1),
this.once("end", h)
}
function h() {
this.allowHalfOpen || this._writableState.ended || i.nextTick(f, this)
}
function f(t) {
t.end()
}
Object.defineProperty(d.prototype, "writableHighWaterMark", {
enumerable: !1,
get: function() {
return this._writableState.highWaterMark
}
}),
Object.defineProperty(d.prototype, "destroyed", {
get: function() {
return void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed && this._writableState.destroyed)
},
set: function(t) {
void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed = t,
this._writableState.destroyed = t)
}
}),
d.prototype._destroy = function(t, e) {
this.push(null),
this.end(),
i.nextTick(e, t)
}
}
, function(t, e, n) {
"use strict";
(function(t) {
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh
* @license MIT
*/
var i = n(291)
, r = n(290)
, a = n(67);
function o() {
return l.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
}
function s(t, e) {
if (o() < e)
throw new RangeError("Invalid typed array length");
return l.TYPED_ARRAY_SUPPORT ? (t = new Uint8Array(e)).__proto__ = l.prototype : (null === t && (t = new l(e)),
t.length = e),
t
}
function l(t, e, n) {
if (!(l.TYPED_ARRAY_SUPPORT || this instanceof l))
return new l(t,e,n);
if ("number" == typeof t) {
if ("string" == typeof e)
throw new Error("If encoding is specified then the first argument must be a string");
return d(this, t)
}
return c(this, t, e, n)
}
function c(t, e, n, i) {
if ("number" == typeof e)
throw new TypeError('"value" argument must not be a number');
return "undefined" != typeof ArrayBuffer && e instanceof ArrayBuffer ? function(t, e, n, i) {
if (e.byteLength,
n < 0 || e.byteLength < n)
throw new RangeError("'offset' is out of bounds");
if (e.byteLength < n + (i || 0))
throw new RangeError("'length' is out of bounds");
e = void 0 === n && void 0 === i ? new Uint8Array(e) : void 0 === i ? new Uint8Array(e,n) : new Uint8Array(e,n,i);
l.TYPED_ARRAY_SUPPORT ? (t = e).__proto__ = l.prototype : t = h(t, e);
return t
}(t, e, n, i) : "string" == typeof e ? function(t, e, n) {
"string" == typeof n && "" !== n || (n = "utf8");
if (!l.isEncoding(n))
throw new TypeError('"encoding" must be a valid string encoding');
var i = 0 | _(e, n)
, r = (t = s(t, i)).write(e, n);
r !== i && (t = t.slice(0, r));
return t
}(t, e, n) : function(t, e) {
if (l.isBuffer(e)) {
var n = 0 | f(e.length);
return 0 === (t = s(t, n)).length ? t : (e.copy(t, 0, 0, n),
t)
}
if (e) {
if ("undefined" != typeof ArrayBuffer && e.buffer instanceof ArrayBuffer || "length"in e)
return "number" != typeof e.length || function(t) {
return t != t
}(e.length) ? s(t, 0) : h(t, e);
if ("Buffer" === e.type && a(e.data))
return h(t, e.data)
}
throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
}(t, e)
}
function u(t) {
if ("number" != typeof t)
throw new TypeError('"size" argument must be a number');
if (t < 0)
throw new RangeError('"size" argument must not be negative')
}
function d(t, e) {
if (u(e),
t = s(t, e < 0 ? 0 : 0 | f(e)),
!l.TYPED_ARRAY_SUPPORT)
for (var n = 0; n < e; ++n)
t[n] = 0;
return t
}
function h(t, e) {
var n = e.length < 0 ? 0 : 0 | f(e.length);
t = s(t, n);
for (var i = 0; i < n; i += 1)
t[i] = 255 & e[i];
return t
}
function f(t) {
if (t >= o())
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + o().toString(16) + " bytes");
return 0 | t
}
function _(t, e) {
if (l.isBuffer(t))
return t.length;
if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(t) || t instanceof ArrayBuffer))
return t.byteLength;
"string" != typeof t && (t = "" + t);
var n = t.length;
if (0 === n)
return 0;
for (var i = !1; ; )
switch (e) {
case "ascii":
case "latin1":
case "binary":
return n;
case "utf8":
case "utf-8":
case void 0:
return F(t).length;
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return 2 * n;
case "hex":
return n >>> 1;
case "base64":
return B(t).length;
default:
if (i)
return F(t).length;
e = ("" + e).toLowerCase(),
i = !0
}
}
function g(t, e, n) {
var i = t[e];
t[e] = t[n],
t[n] = i
}
function p(t, e, n, i, r) {
if (0 === t.length)
return -1;
if ("string" == typeof n ? (i = n,
n = 0) : n > 2147483647 ? n = 2147483647 : n < -2147483648 && (n = -2147483648),
n = +n,
isNaN(n) && (n = r ? 0 : t.length - 1),
n < 0 && (n = t.length + n),
n >= t.length) {
if (r)
return -1;
n = t.length - 1
} else if (n < 0) {
if (!r)
return -1;
n = 0
}
if ("string" == typeof e && (e = l.from(e, i)),
l.isBuffer(e))
return 0 === e.length ? -1 : v(t, e, n, i, r);
if ("number" == typeof e)
return e &= 255,
l.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(t, e, n) : Uint8Array.prototype.lastIndexOf.call(t, e, n) : v(t, [e], n, i, r);
throw new TypeError("val must be string, number or Buffer")
}
function v(t, e, n, i, r) {
var a, o = 1, s = t.length, l = e.length;
if (void 0 !== i && ("ucs2" === (i = String(i).toLowerCase()) || "ucs-2" === i || "utf16le" === i || "utf-16le" === i)) {
if (t.length < 2 || e.length < 2)
return -1;
o = 2,
s /= 2,
l /= 2,
n /= 2
}
function c(t, e) {
return 1 === o ? t[e] : t.readUInt16BE(e * o)
}
if (r) {
var u = -1;
for (a = n; a < s; a++)
if (c(t, a) === c(e, -1 === u ? 0 : a - u)) {
if (-1 === u && (u = a),
a - u + 1 === l)
return u * o
} else
-1 !== u && (a -= a - u),
u = -1
} else
for (n + l > s && (n = s - l),
a = n; a >= 0; a--) {
for (var d = !0, h = 0; h < l; h++)
if (c(t, a + h) !== c(e, h)) {
d = !1;
break
}
if (d)
return a
}
return -1
}
function m(t, e, n, i) {
n = Number(n) || 0;
var r = t.length - n;
i ? (i = Number(i)) > r && (i = r) : i = r;
var a = e.length;
if (a % 2 != 0)
throw new TypeError("Invalid hex string");
i > a / 2 && (i = a / 2);
for (var o = 0; o < i; ++o) {
var s = parseInt(e.substr(2 * o, 2), 16);
if (isNaN(s))
return o;
t[n + o] = s
}
return o
}
function y(t, e, n, i) {
return z(F(e, t.length - n), t, n, i)
}
function k(t, e, n, i) {
return z(function(t) {
for (var e = [], n = 0; n < t.length; ++n)
e.push(255 & t.charCodeAt(n));
return e
}(e), t, n, i)
}
function b(t, e, n, i) {
return k(t, e, n, i)
}
function x(t, e, n, i) {
return z(B(e), t, n, i)
}
function w(t, e, n, i) {
return z(function(t, e) {
for (var n, i, r, a = [], o = 0; o < t.length && !((e -= 2) < 0); ++o)
n = t.charCodeAt(o),
i = n >> 8,
r = n % 256,
a.push(r),
a.push(i);
return a
}(e, t.length - n), t, n, i)
}
function S(t, e, n) {
return 0 === e && n === t.length ? i.fromByteArray(t) : i.fromByteArray(t.slice(e, n))
}
function T(t, e, n) {
n = Math.min(t.length, n);
for (var i = [], r = e; r < n; ) {
var a, o, s, l, c = t[r], u = null, d = c > 239 ? 4 : c > 223 ? 3 : c > 191 ? 2 : 1;
if (r + d <= n)
switch (d) {
case 1:
c < 128 && (u = c);
break;
case 2:
128 == (192 & (a = t[r + 1])) && (l = (31 & c) << 6 | 63 & a) > 127 && (u = l);
break;
case 3:
a = t[r + 1],
o = t[r + 2],
128 == (192 & a) && 128 == (192 & o) && (l = (15 & c) << 12 | (63 & a) << 6 | 63 & o) > 2047 && (l < 55296 || l > 57343) && (u = l);
break;
case 4:
a = t[r + 1],
o = t[r + 2],
s = t[r + 3],
128 == (192 & a) && 128 == (192 & o) && 128 == (192 & s) && (l = (15 & c) << 18 | (63 & a) << 12 | (63 & o) << 6 | 63 & s) > 65535 && l < 1114112 && (u = l)
}
null === u ? (u = 65533,
d = 1) : u > 65535 && (u -= 65536,
i.push(u >>> 10 & 1023 | 55296),
u = 56320 | 1023 & u),
i.push(u),
r += d
}
return function(t) {
var e = t.length;
if (e <= $)
return String.fromCharCode.apply(String, t);
var n = ""
, i = 0;
for (; i < e; )
n += String.fromCharCode.apply(String, t.slice(i, i += $));
return n
}(i)
}
e.Buffer = l,
e.SlowBuffer = function(t) {
+t != t && (t = 0);
return l.alloc(+t)
}
,
e.INSPECT_MAX_BYTES = 50,
l.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : function() {
try {
var t = new Uint8Array(1);
return t.__proto__ = {
__proto__: Uint8Array.prototype,
foo: function() {
return 42
}
},
42 === t.foo() && "function" == typeof t.subarray && 0 === t.subarray(1, 1).byteLength
} catch (t) {
return !1
}
}(),
e.kMaxLength = o(),
l.poolSize = 8192,
l._augment = function(t) {
return t.__proto__ = l.prototype,
t
}
,
l.from = function(t, e, n) {
return c(null, t, e, n)
}
,
l.TYPED_ARRAY_SUPPORT && (l.prototype.__proto__ = Uint8Array.prototype,
l.__proto__ = Uint8Array,
"undefined" != typeof Symbol && Symbol.species && l[Symbol.species] === l && Object.defineProperty(l, Symbol.species, {
value: null,
configurable: !0
})),
l.alloc = function(t, e, n) {
return function(t, e, n, i) {
return u(e),
e <= 0 ? s(t, e) : void 0 !== n ? "string" == typeof i ? s(t, e).fill(n, i) : s(t, e).fill(n) : s(t, e)
}(null, t, e, n)
}
,
l.allocUnsafe = function(t) {
return d(null, t)
}
,
l.allocUnsafeSlow = function(t) {
return d(null, t)
}
,
l.isBuffer = function(t) {
return !(null == t || !t._isBuffer)
}
,
l.compare = function(t, e) {
if (!l.isBuffer(t) || !l.isBuffer(e))
throw new TypeError("Arguments must be Buffers");
if (t === e)
return 0;
for (var n = t.length, i = e.length, r = 0, a = Math.min(n, i); r < a; ++r)
if (t[r] !== e[r]) {
n = t[r],
i = e[r];
break
}
return n < i ? -1 : i < n ? 1 : 0
}
,
l.isEncoding = function(t) {
switch (String(t).toLowerCase()) {
case "hex":
case "utf8":
case "utf-8":
case "ascii":
case "latin1":
case "binary":
case "base64":
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return !0;
default:
return !1
}
}
,
l.concat = function(t, e) {
if (!a(t))
throw new TypeError('"list" argument must be an Array of Buffers');
if (0 === t.length)
return l.alloc(0);
var n;
if (void 0 === e)
for (e = 0,
n = 0; n < t.length; ++n)
e += t[n].length;
var i = l.allocUnsafe(e)
, r = 0;
for (n = 0; n < t.length; ++n) {
var o = t[n];
if (!l.isBuffer(o))
throw new TypeError('"list" argument must be an Array of Buffers');
o.copy(i, r),
r += o.length
}
return i
}
,
l.byteLength = _,
l.prototype._isBuffer = !0,
l.prototype.swap16 = function() {
var t = this.length;
if (t % 2 != 0)
throw new RangeError("Buffer size must be a multiple of 16-bits");
for (var e = 0; e < t; e += 2)
g(this, e, e + 1);
return this
}
,
l.prototype.swap32 = function() {
var t = this.length;
if (t % 4 != 0)
throw new RangeError("Buffer size must be a multiple of 32-bits");
for (var e = 0; e < t; e += 4)
g(this, e, e + 3),
g(this, e + 1, e + 2);
return this
}
,
l.prototype.swap64 = function() {
var t = this.length;
if (t % 8 != 0)
throw new RangeError("Buffer size must be a multiple of 64-bits");
for (var e = 0; e < t; e += 8)
g(this, e, e + 7),
g(this, e + 1, e + 6),
g(this, e + 2, e + 5),
g(this, e + 3, e + 4);
return this
}
,
l.prototype.toString = function() {
var t = 0 | this.length;
return 0 === t ? "" : 0 === arguments.length ? T(this, 0, t) : function(t, e, n) {
var i = !1;
if ((void 0 === e || e < 0) && (e = 0),
e > this.length)
return "";
if ((void 0 === n || n > this.length) && (n = this.length),
n <= 0)
return "";
if ((n >>>= 0) <= (e >>>= 0))
return "";
for (t || (t = "utf8"); ; )
switch (t) {
case "hex":
return A(this, e, n);
case "utf8":
case "utf-8":
return T(this, e, n);
case "ascii":
return C(this, e, n);
case "latin1":
case "binary":
return E(this, e, n);
case "base64":
return S(this, e, n);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return D(this, e, n);
default:
if (i)
throw new TypeError("Unknown encoding: " + t);
t = (t + "").toLowerCase(),
i = !0
}
}
.apply(this, arguments)
}
,
l.prototype.equals = function(t) {
if (!l.isBuffer(t))
throw new TypeError("Argument must be a Buffer");
return this === t || 0 === l.compare(this, t)
}
,
l.prototype.inspect = function() {
var t = ""
, n = e.INSPECT_MAX_BYTES;
return this.length > 0 && (t = this.toString("hex", 0, n).match(/.{2}/g).join(" "),
this.length > n && (t += " ... ")),
""
}
,
l.prototype.compare = function(t, e, n, i, r) {
if (!l.isBuffer(t))
throw new TypeError("Argument must be a Buffer");
if (void 0 === e && (e = 0),
void 0 === n && (n = t ? t.length : 0),
void 0 === i && (i = 0),
void 0 === r && (r = this.length),
e < 0 || n > t.length || i < 0 || r > this.length)
throw new RangeError("out of range index");
if (i >= r && e >= n)
return 0;
if (i >= r)
return -1;
if (e >= n)
return 1;
if (e >>>= 0,
n >>>= 0,
i >>>= 0,
r >>>= 0,
this === t)
return 0;
for (var a = r - i, o = n - e, s = Math.min(a, o), c = this.slice(i, r), u = t.slice(e, n), d = 0; d < s; ++d)
if (c[d] !== u[d]) {
a = c[d],
o = u[d];
break
}
return a < o ? -1 : o < a ? 1 : 0
}
,
l.prototype.includes = function(t, e, n) {
return -1 !== this.indexOf(t, e, n)
}
,
l.prototype.indexOf = function(t, e, n) {
return p(this, t, e, n, !0)
}
,
l.prototype.lastIndexOf = function(t, e, n) {
return p(this, t, e, n, !1)
}
,
l.prototype.write = function(t, e, n, i) {
if (void 0 === e)
i = "utf8",
n = this.length,
e = 0;
else if (void 0 === n && "string" == typeof e)
i = e,
n = this.length,
e = 0;
else {
if (!isFinite(e))
throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
e |= 0,
isFinite(n) ? (n |= 0,
void 0 === i && (i = "utf8")) : (i = n,
n = void 0)
}
var r = this.length - e;
if ((void 0 === n || n > r) && (n = r),
t.length > 0 && (n < 0 || e < 0) || e > this.length)
throw new RangeError("Attempt to write outside buffer bounds");
i || (i = "utf8");
for (var a = !1; ; )
switch (i) {
case "hex":
return m(this, t, e, n);
case "utf8":
case "utf-8":
return y(this, t, e, n);
case "ascii":
return k(this, t, e, n);
case "latin1":
case "binary":
return b(this, t, e, n);
case "base64":
return x(this, t, e, n);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return w(this, t, e, n);
default:
if (a)
throw new TypeError("Unknown encoding: " + i);
i = ("" + i).toLowerCase(),
a = !0
}
}
,
l.prototype.toJSON = function() {
return {
type: "Buffer",
data: Array.prototype.slice.call(this._arr || this, 0)
}
}
;
var $ = 4096;
function C(t, e, n) {
var i = "";
n = Math.min(t.length, n);
for (var r = e; r < n; ++r)
i += String.fromCharCode(127 & t[r]);
return i
}
function E(t, e, n) {
var i = "";
n = Math.min(t.length, n);
for (var r = e; r < n; ++r)
i += String.fromCharCode(t[r]);
return i
}
function A(t, e, n) {
var i = t.length;
(!e || e < 0) && (e = 0),
(!n || n < 0 || n > i) && (n = i);
for (var r = "", a = e; a < n; ++a)
r += H(t[a]);
return r
}
function D(t, e, n) {
for (var i = t.slice(e, n), r = "", a = 0; a < i.length; a += 2)
r += String.fromCharCode(i[a] + 256 * i[a + 1]);
return r
}
function M(t, e, n) {
if (t % 1 != 0 || t < 0)
throw new RangeError("offset is not uint");
if (t + e > n)
throw new RangeError("Trying to access beyond buffer length")
}
function I(t, e, n, i, r, a) {
if (!l.isBuffer(t))
throw new TypeError('"buffer" argument must be a Buffer instance');
if (e > r || e < a)
throw new RangeError('"value" argument is out of bounds');
if (n + i > t.length)
throw new RangeError("Index out of range")
}
function P(t, e, n, i) {
e < 0 && (e = 65535 + e + 1);
for (var r = 0, a = Math.min(t.length - n, 2); r < a; ++r)
t[n + r] = (e & 255 << 8 * (i ? r : 1 - r)) >>> 8 * (i ? r : 1 - r)
}
function N(t, e, n, i) {
e < 0 && (e = 4294967295 + e + 1);
for (var r = 0, a = Math.min(t.length - n, 4); r < a; ++r)
t[n + r] = e >>> 8 * (i ? r : 3 - r) & 255
}
function O(t, e, n, i, r, a) {
if (n + i > t.length)
throw new RangeError("Index out of range");
if (n < 0)
throw new RangeError("Index out of range")
}
function L(t, e, n, i, a) {
return a || O(t, 0, n, 4),
r.write(t, e, n, i, 23, 4),
n + 4
}
function R(t, e, n, i, a) {
return a || O(t, 0, n, 8),
r.write(t, e, n, i, 52, 8),
n + 8
}
l.prototype.slice = function(t, e) {
var n, i = this.length;
if (t = ~~t,
e = void 0 === e ? i : ~~e,
t < 0 ? (t += i) < 0 && (t = 0) : t > i && (t = i),
e < 0 ? (e += i) < 0 && (e = 0) : e > i && (e = i),
e < t && (e = t),
l.TYPED_ARRAY_SUPPORT)
(n = this.subarray(t, e)).__proto__ = l.prototype;
else {
var r = e - t;
n = new l(r,void 0);
for (var a = 0; a < r; ++a)
n[a] = this[a + t]
}
return n
}
,
l.prototype.readUIntLE = function(t, e, n) {
t |= 0,
e |= 0,
n || M(t, e, this.length);
for (var i = this[t], r = 1, a = 0; ++a < e && (r *= 256); )
i += this[t + a] * r;
return i
}
,
l.prototype.readUIntBE = function(t, e, n) {
t |= 0,
e |= 0,
n || M(t, e, this.length);
for (var i = this[t + --e], r = 1; e > 0 && (r *= 256); )
i += this[t + --e] * r;
return i
}
,
l.prototype.readUInt8 = function(t, e) {
return e || M(t, 1, this.length),
this[t]
}
,
l.prototype.readUInt16LE = function(t, e) {
return e || M(t, 2, this.length),
this[t] | this[t + 1] << 8
}
,
l.prototype.readUInt16BE = function(t, e) {
return e || M(t, 2, this.length),
this[t] << 8 | this[t + 1]
}
,
l.prototype.readUInt32LE = function(t, e) {
return e || M(t, 4, this.length),
(this[t] | this[t + 1] << 8 | this[t + 2] << 16) + 16777216 * this[t + 3]
}
,
l.prototype.readUInt32BE = function(t, e) {
return e || M(t, 4, this.length),
16777216 * this[t] + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3])
}
,
l.prototype.readIntLE = function(t, e, n) {
t |= 0,
e |= 0,
n || M(t, e, this.length);
for (var i = this[t], r = 1, a = 0; ++a < e && (r *= 256); )
i += this[t + a] * r;
return i >= (r *= 128) && (i -= Math.pow(2, 8 * e)),
i
}
,
l.prototype.readIntBE = function(t, e, n) {
t |= 0,
e |= 0,
n || M(t, e, this.length);
for (var i = e, r = 1, a = this[t + --i]; i > 0 && (r *= 256); )
a += this[t + --i] * r;
return a >= (r *= 128) && (a -= Math.pow(2, 8 * e)),
a
}
,
l.prototype.readInt8 = function(t, e) {
return e || M(t, 1, this.length),
128 & this[t] ? -1 * (255 - this[t] + 1) : this[t]
}
,
l.prototype.readInt16LE = function(t, e) {
e || M(t, 2, this.length);
var n = this[t] | this[t + 1] << 8;
return 32768 & n ? 4294901760 | n : n
}
,
l.prototype.readInt16BE = function(t, e) {
e || M(t, 2, this.length);
var n = this[t + 1] | this[t] << 8;
return 32768 & n ? 4294901760 | n : n
}
,
l.prototype.readInt32LE = function(t, e) {
return e || M(t, 4, this.length),
this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24
}
,
l.prototype.readInt32BE = function(t, e) {
return e || M(t, 4, this.length),
this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]
}
,
l.prototype.readFloatLE = function(t, e) {
return e || M(t, 4, this.length),
r.read(this, t, !0, 23, 4)
}
,
l.prototype.readFloatBE = function(t, e) {
return e || M(t, 4, this.length),
r.read(this, t, !1, 23, 4)
}
,
l.prototype.readDoubleLE = function(t, e) {
return e || M(t, 8, this.length),
r.read(this, t, !0, 52, 8)
}
,
l.prototype.readDoubleBE = function(t, e) {
return e || M(t, 8, this.length),
r.read(this, t, !1, 52, 8)
}
,
l.prototype.writeUIntLE = function(t, e, n, i) {
(t = +t,
e |= 0,
n |= 0,
i) || I(this, t, e, n, Math.pow(2, 8 * n) - 1, 0);
var r = 1
, a = 0;
for (this[e] = 255 & t; ++a < n && (r *= 256); )
this[e + a] = t / r & 255;
return e + n
}
,
l.prototype.writeUIntBE = function(t, e, n, i) {
(t = +t,
e |= 0,
n |= 0,
i) || I(this, t, e, n, Math.pow(2, 8 * n) - 1, 0);
var r = n - 1
, a = 1;
for (this[e + r] = 255 & t; --r >= 0 && (a *= 256); )
this[e + r] = t / a & 255;
return e + n
}
,
l.prototype.writeUInt8 = function(t, e, n) {
return t = +t,
e |= 0,
n || I(this, t, e, 1, 255, 0),
l.TYPED_ARRAY_SUPPORT || (t = Math.floor(t)),
this[e] = 255 & t,
e + 1
}
,
l.prototype.writeUInt16LE = function(t, e, n) {
return t = +t,
e |= 0,
n || I(this, t, e, 2, 65535, 0),
l.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t,
this[e + 1] = t >>> 8) : P(this, t, e, !0),
e + 2
}
,
l.prototype.writeUInt16BE = function(t, e, n) {
return t = +t,
e |= 0,
n || I(this, t, e, 2, 65535, 0),
l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 8,
this[e + 1] = 255 & t) : P(this, t, e, !1),
e + 2
}
,
l.prototype.writeUInt32LE = function(t, e, n) {
return t = +t,
e |= 0,
n || I(this, t, e, 4, 4294967295, 0),
l.TYPED_ARRAY_SUPPORT ? (this[e + 3] = t >>> 24,
this[e + 2] = t >>> 16,
this[e + 1] = t >>> 8,
this[e] = 255 & t) : N(this, t, e, !0),
e + 4
}
,
l.prototype.writeUInt32BE = function(t, e, n) {
return t = +t,
e |= 0,
n || I(this, t, e, 4, 4294967295, 0),
l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 24,
this[e + 1] = t >>> 16,
this[e + 2] = t >>> 8,
this[e + 3] = 255 & t) : N(this, t, e, !1),
e + 4
}
,
l.prototype.writeIntLE = function(t, e, n, i) {
if (t = +t,
e |= 0,
!i) {
var r = Math.pow(2, 8 * n - 1);
I(this, t, e, n, r - 1, -r)
}
var a = 0
, o = 1
, s = 0;
for (this[e] = 255 & t; ++a < n && (o *= 256); )
t < 0 && 0 === s && 0 !== this[e + a - 1] && (s = 1),
this[e + a] = (t / o >> 0) - s & 255;
return e + n
}
,
l.prototype.writeIntBE = function(t, e, n, i) {
if (t = +t,
e |= 0,
!i) {
var r = Math.pow(2, 8 * n - 1);
I(this, t, e, n, r - 1, -r)
}
var a = n - 1
, o = 1
, s = 0;
for (this[e + a] = 255 & t; --a >= 0 && (o *= 256); )
t < 0 && 0 === s && 0 !== this[e + a + 1] && (s = 1),
this[e + a] = (t / o >> 0) - s & 255;
return e + n
}
,
l.prototype.writeInt8 = function(t, e, n) {
return t = +t,
e |= 0,
n || I(this, t, e, 1, 127, -128),
l.TYPED_ARRAY_SUPPORT || (t = Math.floor(t)),
t < 0 && (t = 255 + t + 1),
this[e] = 255 & t,
e + 1
}
,
l.prototype.writeInt16LE = function(t, e, n) {
return t = +t,
e |= 0,
n || I(this, t, e, 2, 32767, -32768),
l.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t,
this[e + 1] = t >>> 8) : P(this, t, e, !0),
e + 2
}
,
l.prototype.writeInt16BE = function(t, e, n) {
return t = +t,
e |= 0,
n || I(this, t, e, 2, 32767, -32768),
l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 8,
this[e + 1] = 255 & t) : P(this, t, e, !1),
e + 2
}
,
l.prototype.writeInt32LE = function(t, e, n) {
return t = +t,
e |= 0,
n || I(this, t, e, 4, 2147483647, -2147483648),
l.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t,
this[e + 1] = t >>> 8,
this[e + 2] = t >>> 16,
this[e + 3] = t >>> 24) : N(this, t, e, !0),
e + 4
}
,
l.prototype.writeInt32BE = function(t, e, n) {
return t = +t,
e |= 0,
n || I(this, t, e, 4, 2147483647, -2147483648),
t < 0 && (t = 4294967295 + t + 1),
l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 24,
this[e + 1] = t >>> 16,
this[e + 2] = t >>> 8,
this[e + 3] = 255 & t) : N(this, t, e, !1),
e + 4
}
,
l.prototype.writeFloatLE = function(t, e, n) {
return L(this, t, e, !0, n)
}
,
l.prototype.writeFloatBE = function(t, e, n) {
return L(this, t, e, !1, n)
}
,
l.prototype.writeDoubleLE = function(t, e, n) {
return R(this, t, e, !0, n)
}
,
l.prototype.writeDoubleBE = function(t, e, n) {
return R(this, t, e, !1, n)
}
,
l.prototype.copy = function(t, e, n, i) {
if (n || (n = 0),
i || 0 === i || (i = this.length),
e >= t.length && (e = t.length),
e || (e = 0),
i > 0 && i < n && (i = n),
i === n)
return 0;
if (0 === t.length || 0 === this.length)
return 0;
if (e < 0)
throw new RangeError("targetStart out of bounds");
if (n < 0 || n >= this.length)
throw new RangeError("sourceStart out of bounds");
if (i < 0)
throw new RangeError("sourceEnd out of bounds");
i > this.length && (i = this.length),
t.length - e < i - n && (i = t.length - e + n);
var r, a = i - n;
if (this === t && n < e && e < i)
for (r = a - 1; r >= 0; --r)
t[r + e] = this[r + n];
else if (a < 1e3 || !l.TYPED_ARRAY_SUPPORT)
for (r = 0; r < a; ++r)
t[r + e] = this[r + n];
else
Uint8Array.prototype.set.call(t, this.subarray(n, n + a), e);
return a
}
,
l.prototype.fill = function(t, e, n, i) {
if ("string" == typeof t) {
if ("string" == typeof e ? (i = e,
e = 0,
n = this.length) : "string" == typeof n && (i = n,
n = this.length),
1 === t.length) {
var r = t.charCodeAt(0);
r < 256 && (t = r)
}
if (void 0 !== i && "string" != typeof i)
throw new TypeError("encoding must be a string");
if ("string" == typeof i && !l.isEncoding(i))
throw new TypeError("Unknown encoding: " + i)
} else
"number" == typeof t && (t &= 255);
if (e < 0 || this.length < e || this.length < n)
throw new RangeError("Out of range index");
if (n <= e)
return this;
var a;
if (e >>>= 0,
n = void 0 === n ? this.length : n >>> 0,
t || (t = 0),
"number" == typeof t)
for (a = e; a < n; ++a)
this[a] = t;
else {
var o = l.isBuffer(t) ? t : F(new l(t,i).toString())
, s = o.length;
for (a = 0; a < n - e; ++a)
this[a + e] = o[a % s]
}
return this
}
;
var j = /[^+\/0-9A-Za-z-_]/g;
function H(t) {
return t < 16 ? "0" + t.toString(16) : t.toString(16)
}
function F(t, e) {
var n;
e = e || 1 / 0;
for (var i = t.length, r = null, a = [], o = 0; o < i; ++o) {
if ((n = t.charCodeAt(o)) > 55295 && n < 57344) {
if (!r) {
if (n > 56319) {
(e -= 3) > -1 && a.push(239, 191, 189);
continue
}
if (o + 1 === i) {
(e -= 3) > -1 && a.push(239, 191, 189);
continue
}
r = n;
continue
}
if (n < 56320) {
(e -= 3) > -1 && a.push(239, 191, 189),
r = n;
continue
}
n = 65536 + (r - 55296 << 10 | n - 56320)
} else
r && (e -= 3) > -1 && a.push(239, 191, 189);
if (r = null,
n < 128) {
if ((e -= 1) < 0)
break;
a.push(n)
} else if (n < 2048) {
if ((e -= 2) < 0)
break;
a.push(n >> 6 | 192, 63 & n | 128)
} else if (n < 65536) {
if ((e -= 3) < 0)
break;
a.push(n >> 12 | 224, n >> 6 & 63 | 128, 63 & n | 128)
} else {
if (!(n < 1114112))
throw new Error("Invalid code point");
if ((e -= 4) < 0)
break;
a.push(n >> 18 | 240, n >> 12 & 63 | 128, n >> 6 & 63 | 128, 63 & n | 128)
}
}
return a
}
function B(t) {
return i.toByteArray(function(t) {
if ((t = function(t) {
return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "")
}(t).replace(j, "")).length < 2)
return "";
for (; t.length % 4 != 0; )
t += "=";
return t
}(t))
}
function z(t, e, n, i) {
for (var r = 0; r < i && !(r + n >= e.length || r >= t.length); ++r)
e[r + n] = t[r];
return r
}
}
).call(this, n(4))
}
, function(t, e, n) {
var i = n(0)
, r = n(5)
, a = n(1)
, o = function() {
"use strict";
function t(t, e, n, o) {
t && (this.$container = a.toNode(t),
this.$parent = t),
this.$config = i.mixin(e, {
headerHeight: 33
}),
this.$gantt = o,
this.$domEvents = o._createDomEventScope(),
this.$id = e.id || "c" + i.uid(),
this.$name = "cell",
this.$factory = n,
r(this)
}
return t.prototype.destructor = function() {
this.$parent = this.$container = this.$view = null,
this.$gantt.$services.getService("mouseEvents").detach("click", "gantt_header_arrow", this._headerClickHandler),
this.$domEvents.detachAll(),
this.callEvent("onDestroy", []),
this.detachAllEvents()
}
,
t.prototype.cell = function(t) {
return null
}
,
t.prototype.scrollTo = function(t, e) {
var n = this.$view;
this.$config.html && (n = this.$view.firstChild),
1 * t == t && (n.scrollLeft = t),
1 * e == e && (n.scrollTop = e)
}
,
t.prototype.clear = function() {
this.getNode().innerHTML = "",
this.getNode().className = "gantt_layout_content",
this.getNode().style.padding = "0"
}
,
t.prototype.resize = function(t) {
if (this.$parent)
return this.$parent.resize(t);
!1 === t && (this.$preResize = !0);
var e = this.$container
, n = e.offsetWidth
, i = e.offsetHeight
, r = this.getSize();
e === document.body && (n = document.body.offsetWidth,
i = document.body.offsetHeight),
n < r.minWidth && (n = r.minWidth),
n > r.maxWidth && (n = r.maxWidth),
i < r.minHeight && (i = r.minHeight),
i > r.maxHeight && (i = r.maxHeight),
this.setSize(n, i),
this.$preResize,
this.$preResize = !1
}
,
t.prototype.hide = function() {
this._hide(!0),
this.resize()
}
,
t.prototype.show = function(t) {
this._hide(!1),
t && this.$parent && this.$parent.show(),
this.resize()
}
,
t.prototype._hide = function(t) {
if (!0 === t && this.$view.parentNode)
this.$view.parentNode.removeChild(this.$view);
else if (!1 === t && !this.$view.parentNode) {
var e = this.$parent.cellIndex(this.$id);
this.$parent.moveView(this, e)
}
this.$config.hidden = t
}
,
t.prototype.$toHTML = function(t, e) {
void 0 === t && (t = ""),
e = [e || "", this.$config.css || ""].join(" ");
var n = this.$config
, i = "";
n.raw ? t = "string" == typeof n.raw ? n.raw : "" : (t || (t = "
" + (n.html || "") + "
"),
n.header && (i = "
" + (n.canCollapse ? "" : "") + "
" + n.header + "
"));
return "
" + i + t + "
"
}
,
t.prototype.$fill = function(t, e) {
this.$view = t,
this.$parent = e,
this.init()
}
,
t.prototype.getNode = function() {
return this.$view.querySelector("gantt_layout_cell") || this.$view
}
,
t.prototype.init = function() {
var t = this;
this._headerClickHandler = function(e) {
a.locateAttribute(e, "data-cell-id") == t.$id && t.toggle()
}
,
this.$gantt.$services.getService("mouseEvents").delegate("click", "gantt_header_arrow", this._headerClickHandler),
this.callEvent("onReady", [])
}
,
t.prototype.toggle = function() {
this.$config.collapsed = !this.$config.collapsed,
this.resize()
}
,
t.prototype.getSize = function() {
var t = {
height: this.$config.height || 0,
width: this.$config.width || 0,
gravity: this.$config.gravity || 1,
minHeight: this.$config.minHeight || 0,
minWidth: this.$config.minWidth || 0,
maxHeight: this.$config.maxHeight || 1e11,
maxWidth: this.$config.maxWidth || 1e11
};
if (this.$config.collapsed) {
var e = "x" === this.$config.mode;
t[e ? "width" : "height"] = t[e ? "maxWidth" : "maxHeight"] = this.$config.headerHeight
}
return t
}
,
t.prototype.getContentSize = function() {
var t = this.$lastSize.contentX;
t !== 1 * t && (t = this.$lastSize.width);
var e = this.$lastSize.contentY;
return e !== 1 * e && (e = this.$lastSize.height),
{
width: t,
height: e
}
}
,
t.prototype._getBorderSizes = function() {
var t = {
top: 0,
right: 0,
bottom: 0,
left: 0,
horizontal: 0,
vertical: 0
};
return this._currentBorders && (this._currentBorders[this._borders.left] && (t.left = 1,
t.horizontal++),
this._currentBorders[this._borders.right] && (t.right = 1,
t.horizontal++),
this._currentBorders[this._borders.top] && (t.top = 1,
t.vertical++),
this._currentBorders[this._borders.bottom] && (t.bottom = 1,
t.vertical++)),
t
}
,
t.prototype.setSize = function(t, e) {
this.$view.style.width = t + "px",
this.$view.style.height = e + "px";
var n = this._getBorderSizes()
, i = e - n.vertical
, r = t - n.horizontal;
this.$lastSize = {
x: t,
y: e,
contentX: r,
contentY: i
},
this.$config.header ? this._sizeHeader() : this._sizeContent()
}
,
t.prototype._borders = {
left: "gantt_layout_cell_border_left",
right: "gantt_layout_cell_border_right",
top: "gantt_layout_cell_border_top",
bottom: "gantt_layout_cell_border_bottom"
},
t.prototype._setBorders = function(t, e) {
e || (e = this);
var n = e.$view;
for (var i in this._borders)
a.removeClassName(n, this._borders[i]);
"string" == typeof t && (t = [t]);
var r = {};
for (i = 0; i < t.length; i++)
a.addClassName(n, t[i]),
r[t[i]] = !0;
e._currentBorders = r
}
,
t.prototype._sizeContent = function() {
var t = this.$view.childNodes[0];
t && "gantt_layout_content" == t.className && (t.style.height = this.$lastSize.contentY + "px")
}
,
t.prototype._sizeHeader = function() {
var t = this.$lastSize;
t.contentY -= this.$config.headerHeight;
var e = this.$view.childNodes[0]
, n = this.$view.childNodes[1]
, i = "x" === this.$config.mode;
if (this.$config.collapsed)
if (n.style.display = "none",
i) {
e.className = "gantt_layout_header collapsed_x",
e.style.width = t.y + "px";
var r = Math.floor(t.y / 2 - t.x / 2);
e.style.transform = "rotate(90deg) translate(" + r + "px, " + r + "px)",
n.style.display = "none"
} else
e.className = "gantt_layout_header collapsed_y";
else
e.className = i ? "gantt_layout_header" : "gantt_layout_header vertical",
e.style.width = "auto",
e.style.transform = "",
n.style.display = "",
n.style.height = t.contentY + "px";
e.style.height = this.$config.headerHeight + "px"
}
,
t
}();
t.exports = o
}
, function(t, e, n) {
var i = n(11);
t.exports = function(t) {
return i.isNode || !t.$root
}
}
, function(t, e) {
t.exports = function(t, e, n, i) {
if ((i = e ? e.config : i) && i.placeholder_task && n.exists(t))
return n.getItem(t).type === i.types.placeholder;
return !1
}
}
, function(t, e, n) {
(function(t) {
function n(t) {
"@babel/helpers - typeof";
return (n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
function i(t) {
return Object.prototype.toString.call(t)
}
e.isArray = function(t) {
return Array.isArray ? Array.isArray(t) : "[object Array]" === i(t)
}
,
e.isBoolean = function(t) {
return "boolean" == typeof t
}
,
e.isNull = function(t) {
return null === t
}
,
e.isNullOrUndefined = function(t) {
return null == t
}
,
e.isNumber = function(t) {
return "number" == typeof t
}
,
e.isString = function(t) {
return "string" == typeof t
}
,
e.isSymbol = function(t) {
return "symbol" === n(t)
}
,
e.isUndefined = function(t) {
return void 0 === t
}
,
e.isRegExp = function(t) {
return "[object RegExp]" === i(t)
}
,
e.isObject = function(t) {
return "object" === n(t) && null !== t
}
,
e.isDate = function(t) {
return "[object Date]" === i(t)
}
,
e.isError = function(t) {
return "[object Error]" === i(t) || t instanceof Error
}
,
e.isFunction = function(t) {
return "function" == typeof t
}
,
e.isPrimitive = function(t) {
return null === t || "boolean" == typeof t || "number" == typeof t || "string" == typeof t || "symbol" === n(t) || void 0 === t
}
,
e.isBuffer = t.isBuffer
}
).call(this, n(13).Buffer)
}
, function(t, e, n) {
var i = n(3)
, r = n(36);
t.exports = function(t) {
var e = n(7)(t);
function a() {
return e.apply(this, arguments) || this
}
return i(a, e),
a.prototype.render = function(t) {
var e = "
";
return e += r.getHtmlSelect(t.options, [{
key: "style",
value: "width:100%;"
}, {
key: "title",
value: t.name
}]),
e += "
"
}
,
a.prototype.set_value = function(t, e, n, i) {
var r = t.firstChild;
!r._dhx_onchange && i.onchange && (r.onchange = i.onchange,
r._dhx_onchange = !0),
void 0 === e && (e = (r.options[0] || {}).value),
r.value = e || ""
}
,
a.prototype.get_value = function(t) {
return t.firstChild.value
}
,
a.prototype.focus = function(e) {
var n = e.firstChild;
t._focus(n, !0)
}
,
a
}
}
, function(t, e) {
t.exports = function(t, e, n, i, r) {
if (!t.start_date || !t.end_date)
return null;
var a = n.getItemTop(t.id)
, o = n.getItemHeight(t.id);
if (a > e.y_end || a + o < e.y)
return !1;
var s = n.posFromDate(t.start_date)
, l = n.posFromDate(t.end_date)
, c = Math.min(s, l) - 200
, u = Math.max(s, l) + 200;
return !(c > e.x_end || u < e.x)
}
}
, function(t, e) {
t.exports = function(t) {
return t.config.smart_rendering && t._smart_render
}
}
, function(t, e, n) {
(function(e) {
var n;
n = "undefined" != typeof window ? window : e,
t.exports = n
}
).call(this, n(4))
}
, function(t, e, n) {
var i = n(13)
, r = i.Buffer;
function a(t, e) {
for (var n in t)
e[n] = t[n]
}
function o(t, e, n) {
return r(t, e, n)
}
r.from && r.alloc && r.allocUnsafe && r.allocUnsafeSlow ? t.exports = i : (a(i, e),
e.Buffer = o),
a(r, o),
o.from = function(t, e, n) {
if ("number" == typeof t)
throw new TypeError("Argument must not be a number");
return r(t, e, n)
}
,
o.alloc = function(t, e, n) {
if ("number" != typeof t)
throw new TypeError("Argument must be a number");
var i = r(t);
return void 0 !== e ? "string" == typeof n ? i.fill(e, n) : i.fill(e) : i.fill(0),
i
}
,
o.allocUnsafe = function(t) {
if ("number" != typeof t)
throw new TypeError("Argument must be a number");
return r(t)
}
,
o.allocUnsafeSlow = function(t) {
if ("number" != typeof t)
throw new TypeError("Argument must be a number");
return i.SlowBuffer(t)
}
}
, function(t, e, n) {
"use strict";
(function(e) {
!e.version || 0 === e.version.indexOf("v0.") || 0 === e.version.indexOf("v1.") && 0 !== e.version.indexOf("v1.8.") ? t.exports = {
nextTick: function(t, n, i, r) {
if ("function" != typeof t)
throw new TypeError('"callback" argument must be a function');
var a, o, s = arguments.length;
switch (s) {
case 0:
case 1:
return e.nextTick(t);
case 2:
return e.nextTick(function() {
t.call(null, n)
});
case 3:
return e.nextTick(function() {
t.call(null, n, i)
});
case 4:
return e.nextTick(function() {
t.call(null, n, i, r)
});
default:
for (a = new Array(s - 1),
o = 0; o < a.length; )
a[o++] = arguments[o];
return e.nextTick(function() {
t.apply(null, a)
})
}
}
} : t.exports = e
}
).call(this, n(9))
}
, function(t, e, n) {
var i = n(0);
t.exports = {
createDropTargetObject: function(t) {
var e = {
targetParent: null,
targetIndex: 0,
targetId: null,
child: !1,
nextSibling: !1,
prevSibling: !1
};
return t && i.mixin(e, t, !0),
e
},
nextSiblingTarget: function(t, e, n) {
var i = this.createDropTargetObject();
return i.targetId = e,
i.nextSibling = !0,
i.targetParent = n.getParent(i.targetId),
i.targetIndex = n.getBranchIndex(i.targetId),
(n.getParent(t) != i.targetParent || i.targetIndex < n.getBranchIndex(t)) && (i.targetIndex += 1),
i
},
prevSiblingTarget: function(t, e, n) {
var i = this.createDropTargetObject();
return i.targetId = e,
i.prevSibling = !0,
i.targetParent = n.getParent(i.targetId),
i.targetIndex = n.getBranchIndex(i.targetId),
n.getParent(t) == i.targetParent && i.targetIndex > n.getBranchIndex(t) && (i.targetIndex -= 1),
i
},
firstChildTarget: function(t, e, n) {
var i = this.createDropTargetObject();
return i.targetId = e,
i.targetParent = i.targetId,
i.targetIndex = 0,
i.child = !0,
i
},
lastChildTarget: function(t, e, n) {
var i = n.getChildren(e)
, r = this.createDropTargetObject();
return r.targetId = i[i.length - 1],
r.targetParent = e,
r.targetIndex = i.length,
r.nextSibling = !0,
r
}
}
}
, function(t, e, n) {
var i = n(20);
t.exports = function(t, e, n, r) {
var a = e.width[t];
if (a <= 0)
return !1;
if (!r.config.smart_rendering || i(r))
return !0;
var o = e.left[t] - a
, s = e.left[t] + a;
return o <= n.x_end && s >= n.x
}
}
, function(t, e) {
t.exports = function(t, e) {
var n = 0
, i = t.left.length - 1;
if (e)
for (var r = 0; r < t.left.length; r++) {
var a = t.left[r];
if (a < e.x && (n = r),
a > e.x_end) {
i = r;
break
}
}
return {
start: n,
end: i
}
}
}
, function(t, e) {
t.exports = function(t, e, n) {
return {
top: e.getItemTop(t.id),
height: e.getItemHeight(t.id),
left: 0,
right: 1 / 0
}
}
}
, function(t, e) {
t.exports = function(t) {
function e(e, a, o) {
if (!t._isAllowedUnscheduledTask(e) && t._isTaskInTimelineLimits(e)) {
var s = a.getItemPosition(e)
, l = o
, c = a.$getTemplates()
, u = t.getTaskType(e.type)
, d = a.getBarHeight(e.id, u == l.types.milestone)
, h = 0;
u == l.types.milestone && (h = (d - s.height) / 2);
var f = Math.floor((a.getItemHeight(e.id) - d) / 2);
u == l.types.milestone && (s.left -= Math.round(d / 2),
s.width = d);
var _ = document.createElement("div")
, g = Math.round(s.width);
a.$config.item_attribute && (_.setAttribute(a.$config.item_attribute, e.id),
_.setAttribute(a.$config.bind + "_id", e.id)),
l.show_progress && u != l.types.milestone && function(e, n, i, r, a) {
var o = 1 * e.progress || 0;
i = Math.max(i - 2, 0);
var s = document.createElement("div")
, l = Math.round(i * o);
l = Math.min(i, l),
e.progressColor && (s.style.backgroundColor = e.progressColor,
s.style.opacity = 1),
s.style.width = l + "px",
s.className = "gantt_task_progress",
s.innerHTML = a.progress_text(e.start_date, e.end_date, e),
r.rtl && (s.style.position = "absolute",
s.style.right = "0px");
var c = document.createElement("div");
if (c.className = "gantt_task_progress_wrapper",
c.appendChild(s),
n.appendChild(c),
t.config.drag_progress && !t.isReadonly(e)) {
var u = document.createElement("div")
, d = l;
r.rtl && (d = i - l),
u.style.left = d + "px",
u.className = "gantt_task_progress_drag",
s.appendChild(u),
n.appendChild(u)
}
}(e, _, g, l, c);
var p = function(e, n, i) {
var r = document.createElement("div");
return t.getTaskType(e.type) != t.config.types.milestone ? r.innerHTML = i.task_text(e.start_date, e.end_date, e) : t.getTaskType(e.type) == t.config.types.milestone && n && (r.style.height = r.style.width = n + "px"),
r.className = "gantt_task_content",
r
}(e, g, c);
e.textColor && (p.style.color = e.textColor),
_.appendChild(p);
var v = function(e, n, i, r) {
var a = r.$getConfig()
, o = [e];
n && o.push(n);
var s = t.getState()
, l = t.getTask(i);
if (t.getTaskType(l.type) == a.types.milestone ? o.push("gantt_milestone") : t.getTaskType(l.type) == a.types.project && o.push("gantt_project"),
o.push("gantt_bar_" + t.getTaskType(l.type)),
t.isSummaryTask(l) && o.push("gantt_dependent_task"),
t.isSplitTask(l) && (a.open_split_tasks && !l.$open || !a.open_split_tasks) && o.push("gantt_split_parent"),
a.select_task && t.isSelectedTask(i) && o.push("gantt_selected"),
i == s.drag_id && (o.push("gantt_drag_" + s.drag_mode),
s.touch_drag && o.push("gantt_touch_" + s.drag_mode)),
s.link_source_id == i && o.push("gantt_link_source"),
s.link_target_id == i && o.push("gantt_link_target"),
a.highlight_critical_path && t.isCriticalTask && t.isCriticalTask(l) && o.push("gantt_critical_task"),
s.link_landing_area && s.link_target_id && s.link_source_id && s.link_target_id != s.link_source_id && (s.link_target_id == i || s.link_source_id == i)) {
var c = s.link_source_id
, u = s.link_from_start
, d = s.link_to_start
, h = t.isLinkAllowed(c, i, u, d)
, f = "";
f = h ? d ? "link_start_allow" : "link_finish_allow" : d ? "link_start_deny" : "link_finish_deny",
o.push(f)
}
return o.join(" ")
}("gantt_task_line", c.task_class(e.start_date, e.end_date, e), e.id, a);
(e.color || e.progressColor || e.textColor) && (v += " gantt_task_inline_color"),
s.width < 20 && (v += " gantt_thin_task"),
_.className = v;
var m = ["left:" + s.left + "px", "top:" + (f + s.top) + "px", "height:" + (u == l.types.milestone ? s.height : d) + "px", "line-height:" + Math.max(d < 30 ? d - 2 : d, 0) + "px", "width:" + g + "px"];
e.color && m.push("background-color:" + e.color),
e.textColor && m.push("color:" + e.textColor),
_.style.cssText = m.join(";");
var y = function(t, e, r, a) {
var o = "gantt_left " + i(!e.rtl, t)
, s = null;
return a && (s = {
type: "marginRight",
value: a
}),
n(t, r.leftside_text, o, s)
}(e, l, c, h);
y && _.appendChild(y),
(y = function(t, e, r, a) {
var o = "gantt_right " + i(!!e.rtl, t)
, s = null;
return a && (s = {
type: "marginLeft",
value: a
}),
n(t, r.rightside_text, o, s)
}(e, l, c, h)) && _.appendChild(y),
t._waiAria.setTaskBarAttr(e, _);
var k = t.getState();
return t.isReadonly(e) || (l.drag_resize && !t.isSummaryTask(e) && u != l.types.milestone && r(_, "gantt_task_drag", e, function(t) {
var e = document.createElement("div");
return e.className = t,
e
}, l),
l.drag_links && l.show_links && r(_, "gantt_link_control", e, function(t) {
var e = document.createElement("div");
e.className = t,
e.style.cssText = ["height:" + d + "px", "line-height:" + d + "px"].join(";");
var n = document.createElement("div");
n.className = "gantt_link_point";
var i = !1;
return k.link_source_id && l.touch && (i = !0),
n.style.display = i ? "block" : "",
e.appendChild(n),
e
}, l, h)),
_
}
}
function n(t, e, n, i) {
if (!e)
return null;
var r = e(t.start_date, t.end_date, t);
if (!r)
return null;
var a = document.createElement("div");
return a.className = "gantt_side_content " + n,
a.innerHTML = r,
i && (a.style[i.type] = Math.abs(i.value) + "px"),
a
}
function i(e, n) {
var i = function(e) {
return e ? {
$source: [t.config.links.start_to_start],
$target: [t.config.links.start_to_start, t.config.links.finish_to_start]
} : {
$source: [t.config.links.finish_to_start, t.config.links.finish_to_finish],
$target: [t.config.links.finish_to_finish]
}
}(e);
for (var r in i)
for (var a = n[r], o = 0; o < a.length; o++)
for (var s = t.getLink(a[o]), l = 0; l < i[r].length; l++)
if (s.type == i[r][l])
return "gantt_link_crossing";
return ""
}
function r(e, n, i, r, a, o) {
var s, l = t.getState();
+i.start_date >= +l.min_date && ((s = r([n, a.rtl ? "task_right" : "task_left", "task_start_date"].join(" "))).setAttribute("data-bind-property", "start_date"),
o && (s.style.marginLeft = o + "px"),
e.appendChild(s)),
+i.end_date <= +l.max_date && ((s = r([n, a.rtl ? "task_left" : "task_right", "task_end_date"].join(" "))).setAttribute("data-bind-property", "end_date"),
o && (s.style.marginRight = o + "px"),
e.appendChild(s))
}
return function(n, i, r) {
var a = (r = i.$getConfig()).type_renderers[t.getTaskType(n.type)]
, o = e;
return a ? a.call(t, n, function(e) {
return o.call(t, e, i, r)
}, i) : o.call(t, n, i, r)
}
}
}
, function(t, e, n) {
var i = n(33)
, r = n(5)
, a = n(0)
, o = n(2)
, s = n(43)
, l = n(128)
, c = function(t, e, n, o) {
this.$config = a.mixin({}, e || {}),
this.$scaleHelper = new i(o),
this.$gantt = o,
this._posFromDateCache = {},
this._timelineDragScroll = null,
a.mixin(this, s(this)),
r(this)
};
c.prototype = {
init: function(t) {
t.innerHTML += "",
this.$task = t.childNodes[0],
this.$task.innerHTML = "",
this.$task_scale = this.$task.childNodes[0],
this.$task_data = this.$task.childNodes[1],
this.$task_data.innerHTML = "",
this.$task_bg = this.$task_data.childNodes[0],
this.$task_links = this.$task_data.childNodes[1],
this.$task_bars = this.$task_data.childNodes[2],
this._tasks = {
col_width: 0,
width: [],
full_width: 0,
trace_x: [],
rendered: {}
};
var e = this.$getConfig()
, n = e[this.$config.bind + "_attribute"]
, i = e[this.$config.bindLinks + "_attribute"];
!n && this.$config.bind && (n = "data-" + this.$config.bind + "-id"),
!i && this.$config.bindLinks && (i = "data-" + this.$config.bindLinks + "-id"),
this.$config.item_attribute = n || null,
this.$config.link_attribute = i || null;
var r = this._createLayerConfig();
this.$config.layers || (this.$config.layers = r.tasks),
this.$config.linkLayers || (this.$config.linkLayers = r.links),
this._attachLayers(this.$gantt),
this.callEvent("onReady", []),
this.$gantt.ext.dragTimeline && (this._timelineDragScroll = this.$gantt.ext.dragTimeline.create(),
this._timelineDragScroll.attach(this))
},
setSize: function(t, e) {
var n = this.$getConfig();
if (1 * t === t && (this.$config.width = t),
1 * e === e) {
this.$config.height = e;
var i = Math.max(this.$config.height - n.scale_height);
this.$task_data.style.height = i + "px"
}
this.refresh(),
this.$task_bg.style.backgroundImage = "",
n.smart_rendering && this.$config.rowStore ? this.$task_bg.style.height = this.getTotalHeight() + "px" : this.$task_bg.style.height = "";
for (var r = this._tasks, a = this.$task_data.childNodes, o = 0, s = a.length; o < s; o++) {
var l = a[o];
l.hasAttribute("data-layer") && l.style && (l.style.width = r.full_width + "px")
}
},
isVisible: function() {
return this.$parent && this.$parent.$config ? !this.$parent.$config.hidden : this.$task.offsetWidth
},
getSize: function() {
var t = this.$getConfig()
, e = this.$config.rowStore ? this.getTotalHeight() : 0
, n = this.isVisible() ? this._tasks.full_width : 0;
return {
x: this.isVisible() ? this.$config.width : 0,
y: this.isVisible() ? this.$config.height : 0,
contentX: this.isVisible() ? n : 0,
contentY: this.isVisible() ? t.scale_height + e : 0,
scrollHeight: this.isVisible() ? e : 0,
scrollWidth: this.isVisible() ? n : 0
}
},
scrollTo: function(t, e) {
if (this.isVisible()) {
var n = !1;
this.$config.scrollTop = this.$config.scrollTop || 0,
this.$config.scrollLeft = this.$config.scrollLeft || 0,
1 * e === e && (this.$config.scrollTop = e,
this.$task_data.scrollTop = this.$config.scrollTop,
n = !0),
1 * t === t && (this.$task.scrollLeft = t,
this.$config.scrollLeft = this.$task.scrollLeft,
this._refreshScales(),
n = !0),
n && this.callEvent("onScroll", [this.$config.scrollLeft, this.$config.scrollTop])
}
},
_refreshScales: function() {
if (this.isVisible() && this.$getConfig().smart_scales) {
var t = this.getViewPort()
, e = this._scales;
this.$task_scale.innerHTML = this._getScaleChunkHtml(e, t.x, t.x_end)
}
},
getViewPort: function() {
var t = this.$config.scrollLeft || 0
, e = this.$config.scrollTop || 0
, n = this.$config.height || 0
, i = this.$config.width || 0;
return {
y: e,
y_end: e + n,
x: t,
x_end: t + i,
height: n,
width: i
}
},
_createLayerConfig: function() {
var t = this
, e = function() {
return t.isVisible()
};
return {
tasks: [{
expose: !0,
renderer: this.$gantt.$ui.layers.taskBar(),
container: this.$task_bars,
filter: [e, function(t, e) {
return !e.hide_bar
}
]
}, {
renderer: this.$gantt.$ui.layers.taskSplitBar(),
filter: [e],
container: this.$task_bars,
append: !0
}, {
renderer: this.$gantt.$ui.layers.taskRollupBar(),
filter: [e],
container: this.$task_bars,
append: !0
}, {
renderer: this.$gantt.$ui.layers.taskBg(),
container: this.$task_bg,
filter: [e]
}],
links: [{
expose: !0,
renderer: this.$gantt.$ui.layers.link(),
container: this.$task_links,
filter: [e]
}]
}
},
_attachLayers: function(t) {
this._taskLayers = [],
this._linkLayers = [];
var e = this
, n = this.$gantt.$services.getService("layers");
if (this.$config.bind) {
this._bindStore();
var i = n.getDataRender(this.$config.bind);
i || (i = n.createDataRender({
name: this.$config.bind,
defaultContainer: function() {
return e.$task_data
}
})),
i.container = function() {
return e.$task_data
}
;
for (var r = this.$config.layers, a = 0; r && a < r.length; a++) {
"string" == typeof (c = r[a]) && (c = this.$gantt.$ui.layers[c]()),
("function" == typeof c || c && c.render && c.update) && (c = {
renderer: c
}),
c.view = this;
var o = i.addLayer(c);
this._taskLayers.push(o),
c.expose && (this._taskRenderer = i.getLayer(o))
}
this._initStaticBackgroundRender()
}
if (this.$config.bindLinks) {
e.$config.linkStore = e.$gantt.getDatastore(e.$config.bindLinks);
var s = n.getDataRender(this.$config.bindLinks);
s || (s = n.createDataRender({
name: this.$config.bindLinks,
defaultContainer: function() {
return e.$task_data
}
}));
var l = this.$config.linkLayers;
for (a = 0; l && a < l.length; a++) {
var c;
"string" == typeof c && (c = this.$gantt.$ui.layers[c]()),
(c = l[a]).view = this;
var u = s.addLayer(c);
this._taskLayers.push(u),
l[a].expose && (this._linkRenderer = s.getLayer(u))
}
}
},
_initStaticBackgroundRender: function() {
var t = this
, e = l.create()
, n = t.$config.rowStore;
n && (this._staticBgHandler = n.attachEvent("onStoreUpdated", function(n, i, r) {
if (null === n && t.isVisible()) {
var a = t.$getConfig();
if (a.static_background || a.timeline_placeholder) {
var o = t.$gantt.getDatastore(t.$config.bind)
, s = t.$task_bg_static;
if (s || ((s = document.createElement("div")).className = "gantt_task_bg",
t.$task_bg_static = s,
t.$task_bg.nextSibling ? t.$task_data.insertBefore(s, t.$task_bg.nextSibling) : t.$task_data.appendChild(s)),
o) {
var l = t.getTotalHeight();
a.timeline_placeholder && (l = a.timeline_placeholder.height || t.$task_data.offsetHeight || 99999),
e.render(s, a, t.getScale(), l, t.getItemHeight(i ? i.id : null))
}
} else
a.static_background && t.$task_bg_static && t.$task_bg_static.parentNode && t.$task_bg_static.parentNode.removeChild(t.$task_bg_static)
}
}),
this.attachEvent("onDestroy", function() {
e.destroy()
}),
this._initStaticBackgroundRender = function() {}
)
},
_clearLayers: function(t) {
var e = this.$gantt.$services.getService("layers")
, n = e.getDataRender(this.$config.bind)
, i = e.getDataRender(this.$config.bindLinks);
if (this._taskLayers)
for (var r = 0; r < this._taskLayers.length; r++)
n.removeLayer(this._taskLayers[r]);
if (this._linkLayers)
for (r = 0; r < this._linkLayers.length; r++)
i.removeLayer(this._linkLayers[r]);
this._linkLayers = [],
this._taskLayers = []
},
_render_tasks_scales: function() {
var t = this.$getConfig()
, e = ""
, n = 0
, i = 0
, r = this.$gantt.getState();
if (this.isVisible()) {
var a = this.$scaleHelper
, o = this._getScales();
i = t.scale_height;
var s = this.$config.width;
"x" != t.autosize && "xy" != t.autosize || (s = Math.max(t.autosize_min_width, 0));
var l = a.prepareConfigs(o, t.min_column_width, s, i - 1, r.min_date, r.max_date, t.rtl)
, c = this._tasks = l[l.length - 1];
this._scales = l,
this._posFromDateCache = {},
e = this._getScaleChunkHtml(l, 0, this.$config.width),
n = c.full_width + "px",
i += "px"
}
this.$task_scale.style.height = i,
this.$task_data.style.width = this.$task_scale.style.width = n,
this.$task_scale.innerHTML = e
},
_getScaleChunkHtml: function(t, e, n) {
for (var i = [], r = this.$gantt.templates.scale_row_class, a = 0; a < t.length; a++) {
var o = "gantt_scale_line"
, s = r(t[a]);
s && (o += " " + s),
i.push('
' + this._prepareScaleHtml(t[a], e, n) + "
")
}
return i.join("")
},
_prepareScaleHtml: function(t, e, n) {
var i = this.$getConfig()
, r = this.$gantt.templates
, a = []
, s = null
, l = null
, c = t.format || t.template || t.date;
"string" == typeof c && (c = this.$gantt.date.date_to_str(c));
var u = 0
, d = t.count;
!i.smart_scales || isNaN(e) || isNaN(n) || (u = o.findBinary(t.left, e),
d = o.findBinary(t.left, n) + 1),
l = t.css || function() {}
,
!t.css && i.inherit_scale_class && (l = r.scale_cell_class);
for (var h = u; h < d && t.trace_x[h]; h++) {
s = new Date(t.trace_x[h]);
var f = c.call(this, s)
, _ = t.width[h]
, g = t.height
, p = t.left[h]
, v = ""
, m = ""
, y = "";
if (_) {
v = "width:" + _ + "px;height:" + g + "px;" + (i.smart_scales ? "position:absolute;left:" + p + "px" : ""),
y = "gantt_scale_cell" + (h == t.count - 1 ? " gantt_last_cell" : ""),
(m = l.call(this, s)) && (y += " " + m);
var k = "
" + f + "
";
a.push(k)
}
}
return a.join("")
},
dateFromPos: function(t) {
var e = this._tasks;
if (t < 0 || t > e.full_width || !e.full_width)
return null;
var n = o.findBinary(this._tasks.left, t)
, i = this._tasks.left[n]
, r = e.width[n] || e.col_width
, a = 0;
r && (a = (t - i) / r,
e.rtl && (a = 1 - a));
var s = 0;
return a && (s = this._getColumnDuration(e, e.trace_x[n])),
new Date(e.trace_x[n].valueOf() + Math.round(a * s))
},
posFromDate: function(t) {
if (!this.isVisible())
return 0;
if (!t)
return 0;
var e = String(t.valueOf());
if (void 0 !== this._posFromDateCache[e])
return this._posFromDateCache[e];
var n = this.columnIndexByDate(t);
this.$gantt.assert(n >= 0, "Invalid day index");
var i = Math.floor(n)
, r = n % 1
, a = this._tasks.left[Math.min(i, this._tasks.width.length - 1)];
i == this._tasks.width.length && (a += this._tasks.width[this._tasks.width.length - 1]),
r && (i < this._tasks.width.length ? a += this._tasks.width[i] * (r % 1) : a += 1);
var o = Math.round(a);
return this._posFromDateCache[e] = o,
Math.round(o)
},
_getNextVisibleColumn: function(t, e, n) {
for (var i = +e[t], r = t; n[i]; )
i = +e[++r];
return r
},
_getPrevVisibleColumn: function(t, e, n) {
for (var i = +e[t], r = t; n[i]; )
i = +e[--r];
return r
},
_getClosestVisibleColumn: function(t, e, n) {
var i = this._getNextVisibleColumn(t, e, n);
return e[i] || (i = this._getPrevVisibleColumn(t, e, n)),
i
},
columnIndexByDate: function(t) {
var e = new Date(t).valueOf()
, n = this._tasks.trace_x_ascending
, i = this._tasks.ignore_x
, r = this.$gantt.getState();
if (e <= r.min_date)
return this._tasks.rtl ? n.length : 0;
if (e >= r.max_date)
return this._tasks.rtl ? 0 : n.length;
var a = o.findBinary(n, e)
, s = this._getClosestVisibleColumn(a, n, i)
, l = n[s]
, c = this._tasks.trace_index_transition;
if (!l)
return c ? c[0] : 0;
var u = (t - n[s]) / this._getColumnDuration(this._tasks, n[s]);
return c ? c[s] + (1 - u) : s + u
},
getItemPosition: function(t, e, n) {
var i, r, a;
return this._tasks.rtl ? (r = this.posFromDate(e || t.start_date),
i = this.posFromDate(n || t.end_date)) : (i = this.posFromDate(e || t.start_date),
r = this.posFromDate(n || t.end_date)),
a = Math.max(r - i, 0),
{
left: i,
top: this.getItemTop(t.id),
height: this.getBarHeight(t.id),
width: a,
rowHeight: this.getItemHeight(t.id)
}
},
getBarHeight: function(t, e) {
var n = this.$getConfig()
, i = this.$config.rowStore.getItem(t)
, r = i.task_height || i.bar_height || n.bar_height || n.task_height
, a = this.getItemHeight(t);
"full" == r && (r = a - (n.task_height_offset || 5));
return r = Math.min(r, a),
e && (r = Math.round(r / Math.sqrt(2))),
Math.max(r, 0)
},
getScale: function() {
return this._tasks
},
_getScales: function() {
var t = this.$getConfig()
, e = this.$scaleHelper
, n = [e.primaryScale(t)].concat(e.getSubScales(t));
return e.sortScales(n),
n
},
_getColumnDuration: function(t, e) {
return this.$gantt.date.add(e, t.step, t.unit) - e
},
_bindStore: function() {
if (this.$config.bind) {
var t = this.$gantt.getDatastore(this.$config.bind);
if (this.$config.rowStore = t,
t && !t._timelineCacheAttached) {
var e = this;
t._timelineCacheAttached = t.attachEvent("onBeforeFilter", function() {
e._resetTopPositionHeight()
})
}
}
},
_unbindStore: function() {
if (this.$config.bind) {
var t = this.$gantt.getDatastore(this.$config.bind);
t && t._timelineCacheAttached && (t.detachEvent(t._timelineCacheAttached),
t._timelineCacheAttached = !1)
}
},
refresh: function() {
this._bindStore(),
this.$config.bindLinks && (this.$config.linkStore = this.$gantt.getDatastore(this.$config.bindLinks)),
this._resetTopPositionHeight(),
this._resetHeight(),
this._initStaticBackgroundRender(),
this._render_tasks_scales()
},
destructor: function() {
var t = this.$gantt;
this._clearLayers(t),
this._unbindStore(),
this.$task = null,
this.$task_scale = null,
this.$task_data = null,
this.$task_bg = null,
this.$task_links = null,
this.$task_bars = null,
this.$gantt = null,
this.$config.rowStore && (this.$config.rowStore.detachEvent(this._staticBgHandler),
this.$config.rowStore = null),
this.$config.linkStore && (this.$config.linkStore = null),
this._timelineDragScroll && (this._timelineDragScroll.destructor(),
this._timelineDragScroll = null),
this.callEvent("onDestroy", []),
this.detachAllEvents()
}
},
t.exports = c
}
, function(t, e) {
t.exports = function(t, e, n) {
return {
top: e.getItemTop(t.id),
height: e.getItemHeight(t.id),
left: 0,
right: 1 / 0
}
}
}
, function(t, e) {
t.exports = function(t) {
var e = [];
return {
delegate: function(n, i, r, a) {
e.push([n, i, r, a]),
t.$services.getService("mouseEvents").delegate(n, i, r, a)
},
destructor: function() {
for (var n = t.$services.getService("mouseEvents"), i = 0; i < e.length; i++) {
var r = e[i];
n.detach(r[0], r[1], r[2], r[3])
}
e = []
}
}
}
}
, function(t, e, n) {
var i = n(1)
, r = n(0)
, a = n(5)
, o = n(209)
, s = n(43)
, l = n(207)
, c = n(206).default
, u = function(t, e, n, i) {
this.$config = r.mixin({}, e || {}),
this.$gantt = i,
this.$parent = t,
a(this),
this.$state = {},
r.mixin(this, s(this))
};
u.prototype = {
init: function(t) {
var e = this.$gantt
, i = e._waiAria.gridAttrString()
, r = e._waiAria.gridDataAttrString()
, a = this.$getConfig()
, s = a.reorder_grid_columns || !1;
void 0 !== this.$config.reorder_grid_columns && (s = this.$config.reorder_grid_columns),
t.innerHTML = "",
this.$grid = t.childNodes[0],
this.$grid.innerHTML = "",
this.$grid_scale = this.$grid.childNodes[0],
this.$grid_data = this.$grid.childNodes[1];
var u = a[this.$config.bind + "_attribute"];
if (!u && this.$config.bind && (u = "data-" + this.$config.bind + "-id"),
this.$config.item_attribute = u || null,
!this.$config.layers) {
var d = this._createLayerConfig();
this.$config.layers = d
}
var h = o(e, this);
h.init(),
this._renderHeaderResizers = h.doOnRender,
this._mouseDelegates = n(31)(e),
l(e, this).init(),
this._addLayers(this.$gantt),
this._initEvents(),
s && (this._columnDND = new c(e,this),
this._columnDND.init()),
this.callEvent("onReady", [])
},
_validateColumnWidth: function(t, e) {
var n = t[e];
if (n && "*" != n) {
var i = this.$gantt
, r = 1 * n;
isNaN(r) ? i.assert(!1, "Wrong " + e + " value of column " + t.name) : t[e] = r
}
},
setSize: function(t, e) {
this.$config.width = this.$state.width = t,
this.$config.height = this.$state.height = e;
for (var n, i = this.getGridColumns(), r = 0, a = (d = this.$getConfig()).grid_elastic_columns, o = 0, s = i.length; o < s; o++)
this._validateColumnWidth(i[o], "min_width"),
this._validateColumnWidth(i[o], "max_width"),
this._validateColumnWidth(i[o], "width"),
r += 1 * i[o].width;
if (!isNaN(r) && this.$config.scrollable || (r = n = this._setColumnsWidth(t + 1)),
this.$config.scrollable && a && !isNaN(r)) {
var l = "width";
"min_width" == a && (l = "min_width");
var c = 0;
i.forEach(function(t) {
c += t[l] || d.min_grid_column_width
});
var u = Math.max(c, t);
r = this._setColumnsWidth(u),
n = t
}
this.$config.scrollable ? (this.$grid_scale.style.width = r + "px",
this.$grid_data.style.width = r + "px") : (this.$grid_scale.style.width = "inherit",
this.$grid_data.style.width = "inherit"),
this.$config.width -= 1;
var d = this.$getConfig();
n !== t && (void 0 !== n ? (d.grid_width = n,
this.$config.width = n - 1) : isNaN(r) || (this._setColumnsWidth(r),
d.grid_width = r,
this.$config.width = r - 1));
var h = Math.max(this.$state.height - d.scale_height, 0);
this.$grid_data.style.height = h + "px",
this.refresh()
},
getSize: function() {
var t = this.$getConfig()
, e = this.$config.rowStore ? this.getTotalHeight() : 0
, n = this._getGridWidth();
return {
x: this.$state.width,
y: this.$state.height,
contentX: this.isVisible() ? n : 0,
contentY: this.isVisible() ? t.scale_height + e : 0,
scrollHeight: this.isVisible() ? e : 0,
scrollWidth: this.isVisible() ? n : 0
}
},
_bindStore: function() {
if (this.$config.bind) {
var t = this.$gantt.getDatastore(this.$config.bind);
if (this.$config.rowStore = t,
t && !t._gridCacheAttached) {
var e = this;
t._gridCacheAttached = t.attachEvent("onBeforeFilter", function() {
e._resetTopPositionHeight()
})
}
}
},
_unbindStore: function() {
if (this.$config.bind) {
var t = this.$gantt.getDatastore(this.$config.bind);
t && t._gridCacheAttached && (t.detachEvent(t._gridCacheAttached),
t._gridCacheAttached = !1)
}
},
refresh: function() {
this._bindStore(),
this._resetTopPositionHeight(),
this._resetHeight(),
this._initSmartRenderingPlaceholder(),
this._calculateGridWidth(),
this._renderGridHeader()
},
getViewPort: function() {
var t = this.$config.scrollLeft || 0
, e = this.$config.scrollTop || 0
, n = this.$config.height || 0
, i = this.$config.width || 0;
return {
y: e,
y_end: e + n,
x: t,
x_end: t + i,
height: n,
width: i
}
},
scrollTo: function(t, e) {
if (this.isVisible()) {
var n = !1;
this.$config.scrollTop = this.$config.scrollTop || 0,
this.$config.scrollLeft = this.$config.scrollLeft || 0,
1 * t == t && (this.$config.scrollLeft = this.$state.scrollLeft = this.$grid.scrollLeft = t,
n = !0),
1 * e == e && (this.$config.scrollTop = this.$state.scrollTop = this.$grid_data.scrollTop = e,
n = !0),
n && this.callEvent("onScroll", [this.$config.scrollLeft, this.$config.scrollTop])
}
},
getColumnIndex: function(t, e) {
for (var n = this.$getConfig().columns, i = 0, r = 0; r < n.length; r++)
if (e && n[r].hide && i++,
n[r].name == t)
return r - i;
return null
},
getColumn: function(t) {
var e = this.getColumnIndex(t);
return null === e ? null : this.$getConfig().columns[e]
},
getGridColumns: function() {
return this.$getConfig().columns.slice()
},
isVisible: function() {
return this.$parent && this.$parent.$config ? !this.$parent.$config.hidden : this.$grid.offsetWidth
},
_createLayerConfig: function() {
var t = this.$gantt
, e = this;
return [{
renderer: t.$ui.layers.gridLine(),
container: this.$grid_data,
filter: [function() {
return e.isVisible()
}
]
}, {
renderer: t.$ui.layers.gridTaskRowResizer(),
container: this.$grid_data,
append: !0,
filter: [function() {
return t.config.resize_rows
}
]
}]
},
_addLayers: function(t) {
if (this.$config.bind) {
this._taskLayers = [];
var e = this
, n = this.$gantt.$services.getService("layers")
, i = n.getDataRender(this.$config.bind);
i || (i = n.createDataRender({
name: this.$config.bind,
defaultContainer: function() {
return e.$grid_data
}
}));
for (var r = this.$config.layers, a = 0; r && a < r.length; a++) {
var o = r[a];
o.view = this;
var s = i.addLayer(o);
this._taskLayers.push(s)
}
this._bindStore(),
this._initSmartRenderingPlaceholder()
}
},
_refreshPlaceholderOnStoreUpdate: function(t) {
var e = this.$getConfig()
, n = this.$config.rowStore;
if (n && null === t && this.isVisible() && e.smart_rendering) {
var i;
if (this.$config.scrollY) {
var r = this.$gantt.$ui.getView(this.$config.scrollY);
r && (i = r.getScrollState().scrollSize)
}
if (i || (i = n ? this.getTotalHeight() : 0),
i) {
this.$rowsPlaceholder && this.$rowsPlaceholder.parentNode && this.$rowsPlaceholder.parentNode.removeChild(this.$rowsPlaceholder);
var a = this.$rowsPlaceholder = document.createElement("div");
a.style.visibility = "hidden",
a.style.height = i + "px",
a.style.width = "1px",
this.$grid_data.appendChild(a)
}
}
},
_initSmartRenderingPlaceholder: function() {
var t = this.$config.rowStore;
t && (this._initSmartRenderingPlaceholder = function() {}
,
this._staticBgHandler = t.attachEvent("onStoreUpdated", r.bind(this._refreshPlaceholderOnStoreUpdate, this)))
},
_initEvents: function() {
var t = this.$gantt;
this._mouseDelegates.delegate("click", "gantt_close", t.bind(function(t, e, n) {
var r = this.$config.rowStore;
if (!r)
return !0;
var a = i.locateAttribute(t, this.$config.item_attribute);
return a && r.close(a.getAttribute(this.$config.item_attribute)),
!1
}, this), this.$grid),
this._mouseDelegates.delegate("click", "gantt_open", t.bind(function(t, e, n) {
var r = this.$config.rowStore;
if (!r)
return !0;
var a = i.locateAttribute(t, this.$config.item_attribute);
return a && r.open(a.getAttribute(this.$config.item_attribute)),
!1
}, this), this.$grid)
},
_clearLayers: function(t) {
var e = this.$gantt.$services.getService("layers").getDataRender(this.$config.bind);
if (this._taskLayers)
for (var n = 0; n < this._taskLayers.length; n++)
e.removeLayer(this._taskLayers[n]);
this._taskLayers = []
},
_getColumnWidth: function(t, e, n) {
var i = t.min_width || e.min_grid_column_width
, r = Math.max(n, i || 10);
return t.max_width && (r = Math.min(r, t.max_width)),
r
},
_checkGridColumnMinWidthLimits: function(t, e) {
for (var n = 0, i = t.length; n < i; n++) {
var r = 1 * t[n].width;
!t[n].min_width && r < e.min_grid_column_width && (t[n].min_width = r)
}
},
_getGridWidthLimits: function() {
for (var t = this.$getConfig(), e = this.getGridColumns(), n = 0, i = 0, r = 0; r < e.length; r++)
n += e[r].min_width ? e[r].min_width : t.min_grid_column_width,
void 0 !== i && (i = e[r].max_width ? i + e[r].max_width : void 0);
return this._checkGridColumnMinWidthLimits(e, t),
[n, i]
},
_setColumnsWidth: function(t, e) {
var n = this.$getConfig()
, i = this.getGridColumns()
, r = 0
, a = t;
e = window.isNaN(e) ? -1 : e;
for (var o = 0, s = i.length; o < s; o++)
r += 1 * i[o].width;
if (window.isNaN(r)) {
this._calculateGridWidth(),
r = 0;
for (o = 0,
s = i.length; o < s; o++)
r += 1 * i[o].width
}
var l = a - r
, c = 0;
for (o = 0; o < e + 1; o++)
c += i[o].width;
r -= c;
for (o = e + 1; o < i.length; o++) {
var u = i[o]
, d = Math.round(l * (u.width / r));
l < 0 ? u.min_width && u.width + d < u.min_width ? d = u.min_width - u.width : !u.min_width && n.min_grid_column_width && u.width + d < n.min_grid_column_width && (d = n.min_grid_column_width - u.width) : u.max_width && u.width + d > u.max_width && (d = u.max_width - u.width),
r -= u.width,
u.width += d,
l -= d
}
for (var h = l > 0 ? 1 : -1; l > 0 && 1 === h || l < 0 && -1 === h; ) {
var f = l;
for (o = e + 1; o < i.length; o++) {
var _;
if ((_ = i[o].width + h) == this._getColumnWidth(i[o], n, _) && (l -= h,
i[o].width = _),
!l)
break
}
if (f == l)
break
}
l && e > -1 && ((_ = i[e].width + l) == this._getColumnWidth(i[e], n, _) && (i[e].width = _));
return this._getColsTotalWidth()
},
_getColsTotalWidth: function() {
for (var t = this.getGridColumns(), e = 0, n = 0; n < t.length; n++) {
var i = parseFloat(t[n].width);
if (window.isNaN(i))
return !1;
e += i
}
return e
},
_calculateGridWidth: function() {
for (var t = this.$getConfig(), e = this.getGridColumns(), n = 0, i = [], r = [], a = 0; a < e.length; a++) {
var o = parseFloat(e[a].width);
window.isNaN(o) && (o = t.min_grid_column_width || 10,
i.push(a)),
r[a] = o,
n += o
}
var s = this._getGridWidth() + 1;
if (t.autofit || i.length) {
var l = s - n;
if (t.autofit && !t.grid_elastic_columns)
for (a = 0; a < r.length; a++) {
var c = Math.round(l / (r.length - a));
r[a] += c,
(u = this._getColumnWidth(e[a], t, r[a])) != r[a] && (c = u - r[a],
r[a] = u),
l -= c
}
else if (i.length)
for (a = 0; a < i.length; a++) {
c = Math.round(l / (i.length - a));
var u, d = i[a];
r[d] += c,
(u = this._getColumnWidth(e[d], t, r[d])) != r[d] && (c = u - r[d],
r[d] = u),
l -= c
}
for (a = 0; a < r.length; a++)
e[a].width = r[a]
} else {
var h = s != n;
this.$config.width = n - 1,
t.grid_width = n,
h && this.$parent._setContentSize(this.$config.width, null)
}
},
_renderGridHeader: function() {
var t = this.$gantt
, e = this.$getConfig()
, n = this.$gantt.locale
, i = this.$gantt.templates
, r = this.getGridColumns();
e.rtl && (r = r.reverse());
for (var a = [], o = 0, s = n.labels, l = e.scale_height - 1, c = 0; c < r.length; c++) {
var u = c == r.length - 1
, d = r[c];
d.name || (d.name = t.uid() + "");
var h = 1 * d.width
, f = this._getGridWidth();
u && f > o + h && (d.width = h = f - o),
o += h;
var _ = t._sort && d.name == t._sort.name ? "" : ""
, g = ["gantt_grid_head_cell", "gantt_grid_head_" + d.name, u ? "gantt_last_cell" : "", i.grid_header_class(d.name, d)].join(" ")
, p = "width:" + (h - (u ? 1 : 0)) + "px;"
, v = d.label || s["column_" + d.name] || s[d.name];
v = v || "";
var m = "
" + v + _ + "
";
a.push(m)
}
this.$grid_scale.style.height = e.scale_height + "px",
this.$grid_scale.style.lineHeight = l + "px",
this.$grid_scale.innerHTML = a.join(""),
this._renderHeaderResizers && this._renderHeaderResizers()
},
_getGridWidth: function() {
return this.$config.width
},
destructor: function() {
this._clearLayers(this.$gantt),
this._mouseDelegates && (this._mouseDelegates.destructor(),
this._mouseDelegates = null),
this._unbindStore(),
this.$grid = null,
this.$grid_scale = null,
this.$grid_data = null,
this.$gantt = null,
this.$config.rowStore && (this.$config.rowStore.detachEvent(this._staticBgHandler),
this.$config.rowStore = null),
this.callEvent("onDestroy", []),
this.detachAllEvents()
}
},
t.exports = u
}
, function(t, e, n) {
var i = n(0);
t.exports = function(t) {
var e = t.date
, n = t.$services;
return {
getSum: function(t, e, n) {
void 0 === n && (n = t.length - 1),
void 0 === e && (e = 0);
for (var i = 0, r = e; r <= n; r++)
i += t[r];
return i
},
setSumWidth: function(t, e, n, i) {
var r = e.width;
void 0 === i && (i = r.length - 1),
void 0 === n && (n = 0);
var a = i - n + 1;
if (!(n > r.length - 1 || a <= 0 || i > r.length - 1)) {
var o = t - this.getSum(r, n, i);
this.adjustSize(o, r, n, i),
this.adjustSize(-o, r, i + 1),
e.full_width = this.getSum(r)
}
},
splitSize: function(t, e) {
for (var n = [], i = 0; i < e; i++)
n[i] = 0;
return this.adjustSize(t, n),
n
},
adjustSize: function(t, e, n, i) {
n || (n = 0),
void 0 === i && (i = e.length - 1);
for (var r = i - n + 1, a = this.getSum(e, n, i), o = n; o <= i; o++) {
var s = Math.floor(t * (a ? e[o] / a : 1 / r));
a -= e[o],
t -= s,
r--,
e[o] += s
}
e[e.length - 1] += t
},
sortScales: function(t) {
function n(t, n) {
var i = new Date(1970,0,1);
return e.add(i, n, t) - i
}
t.sort(function(t, e) {
return n(t.unit, t.step) < n(e.unit, e.step) ? 1 : n(t.unit, t.step) > n(e.unit, e.step) ? -1 : 0
});
for (var i = 0; i < t.length; i++)
t[i].index = i
},
_isLegacyMode: function(e) {
var n = e || t.config;
return n.scale_unit || n.date_scale || n.subscales
},
_prepareScaleObject: function(e) {
var n = e.format;
return n || (n = e.template || e.date || "%d %M"),
"string" == typeof n && (n = t.date.date_to_str(n)),
{
unit: e.unit || "day",
step: e.step || 1,
format: n,
css: e.css
}
},
primaryScale: function(e) {
var i, r = n.getService("templateLoader"), a = this._isLegacyMode(e), o = e || t.config;
if (a)
r.initTemplate("date_scale", void 0, void 0, o, t.config.templates),
i = {
unit: t.config.scale_unit,
step: t.config.step,
template: t.templates.date_scale,
date: t.config.date_scale,
css: t.templates.scale_cell_class
};
else {
var s = o.scales[0];
i = {
unit: s.unit,
step: s.step,
template: s.template,
format: s.format,
date: s.date,
css: s.css || t.templates.scale_cell_class
}
}
return this._prepareScaleObject(i)
},
getSubScales: function(e) {
var n = this._isLegacyMode(e)
, i = e || t.config;
return (n ? i.subscales || [] : i.scales.slice(1)).map(function(t) {
return this._prepareScaleObject(t)
}
.bind(this))
},
prepareConfigs: function(t, e, n, i, r, a, o) {
for (var s = this.splitSize(i, t.length), l = n, c = [], u = t.length - 1; u >= 0; u--) {
var d = u == t.length - 1
, h = this.initScaleConfig(t[u], r, a);
d && this.processIgnores(h),
this.initColSizes(h, e, l, s[u]),
this.limitVisibleRange(h),
d && (l = h.full_width),
c.unshift(h)
}
for (u = 0; u < c.length - 1; u++)
this.alineScaleColumns(c[c.length - 1], c[u]);
for (u = 0; u < c.length; u++)
o && this.reverseScale(c[u]),
this.setPosSettings(c[u]);
return c
},
reverseScale: function(t) {
t.width = t.width.reverse(),
t.trace_x = t.trace_x.reverse();
var e = t.trace_indexes;
t.trace_indexes = {},
t.trace_index_transition = {},
t.rtl = !0;
for (var n = 0; n < t.trace_x.length; n++)
t.trace_indexes[t.trace_x[n].valueOf()] = n,
t.trace_index_transition[e[t.trace_x[n].valueOf()]] = n;
return t
},
setPosSettings: function(t) {
for (var e = 0, n = t.trace_x.length; e < n; e++)
t.left.push((t.width[e - 1] || 0) + (t.left[e - 1] || 0))
},
_ignore_time_config: function(n, i) {
if (t.config.skip_off_time) {
for (var r = !0, a = n, o = 0; o < i.step; o++)
o && (a = e.add(n, o, i.unit)),
r = r && !this.isWorkTime(a, i.unit);
return r
}
return !1
},
processIgnores: function(t) {
t.ignore_x = {},
t.display_count = t.count
},
initColSizes: function(t, n, i, r) {
var a = i;
t.height = r;
var o = void 0 === t.display_count ? t.count : t.display_count;
o || (o = 1),
t.col_width = Math.floor(a / o),
n && t.col_width < n && (t.col_width = n,
a = t.col_width * o),
t.width = [];
for (var s = t.ignore_x || {}, l = 0; l < t.trace_x.length; l++)
if (s[t.trace_x[l].valueOf()] || t.display_count == t.count)
t.width[l] = 0;
else {
var c = 1;
"month" == t.unit && (c = Math.round((e.add(t.trace_x[l], t.step, t.unit) - t.trace_x[l]) / 864e5)),
t.width[l] = c
}
this.adjustSize(a - this.getSum(t.width), t.width),
t.full_width = this.getSum(t.width)
},
initScaleConfig: function(t, e, n) {
var r = i.mixin({
count: 0,
col_width: 0,
full_width: 0,
height: 0,
width: [],
left: [],
trace_x: [],
trace_indexes: {},
min_date: new Date(e),
max_date: new Date(n)
}, t);
return this.eachColumn(t.unit, t.step, e, n, function(t) {
r.count++,
r.trace_x.push(new Date(t)),
r.trace_indexes[t.valueOf()] = r.trace_x.length - 1
}),
r.trace_x_ascending = r.trace_x.slice(),
r
},
iterateScales: function(t, e, n, i, r) {
for (var a = e.trace_x, o = t.trace_x, s = n || 0, l = i || o.length - 1, c = 0, u = 1; u < a.length; u++) {
var d = t.trace_indexes[+a[u]];
void 0 !== d && d <= l && (r && r.apply(this, [c, u, s, d]),
s = d,
c = u)
}
},
alineScaleColumns: function(t, e, n, i) {
this.iterateScales(t, e, n, i, function(n, i, r, a) {
var o = this.getSum(t.width, r, a - 1);
this.getSum(e.width, n, i - 1) != o && this.setSumWidth(o, e, n, i - 1)
})
},
eachColumn: function(n, i, r, a, o) {
var s = new Date(r)
, l = new Date(a);
e[n + "_start"] && (s = e[n + "_start"](s));
var c = new Date(s);
for (+c >= +l && (l = e.add(c, i, n)); +c < +l; ) {
o.call(this, new Date(c));
var u = c.getTimezoneOffset();
c = e.add(c, i, n),
c = t._correct_dst_change(c, u, i, n),
e[n + "_start"] && (c = e[n + "_start"](c))
}
},
limitVisibleRange: function(t) {
var n = t.trace_x
, i = t.width.length - 1
, r = 0;
if (+n[0] < +t.min_date && 0 != i) {
var a = Math.floor(t.width[0] * ((n[1] - t.min_date) / (n[1] - n[0])));
r += t.width[0] - a,
t.width[0] = a,
n[0] = new Date(t.min_date)
}
var o = n.length - 1
, s = n[o]
, l = e.add(s, t.step, t.unit);
if (+l > +t.max_date && o > 0 && (a = t.width[o] - Math.floor(t.width[o] * ((l - t.max_date) / (l - s))),
r += t.width[o] - a,
t.width[o] = a),
r) {
for (var c = this.getSum(t.width), u = 0, d = 0; d < t.width.length; d++) {
var h = Math.floor(r * (t.width[d] / c));
t.width[d] += h,
u += h
}
this.adjustSize(r - u, t.width)
}
}
}
}
}
, , function(t, e, n) {}
, function(t, e, n) {
var i = n(2)
, r = {
getHtmlSelect: function(t, e, n) {
var r = ""
, o = this;
return t = t || [],
i.forEach(t, function(t) {
var e = [{
key: "value",
value: t.key
}];
n == t.key && (e[e.length] = {
key: "selected",
value: "selected"
}),
t.attributes && (e = e.concat(t.attributes)),
r += o.getHtmlOption({
innerHTML: t.label
}, e)
}),
a("select", {
innerHTML: r
}, e)
},
getHtmlOption: function(t, e) {
return a("option", t, e)
},
getHtmlButton: function(t, e) {
return a("button", t, e)
},
getHtmlDiv: function(t, e) {
return a("div", t, e)
},
getHtmlLabel: function(t, e) {
return a("label", t, e)
},
getHtmlInput: function(t) {
return ""
}
};
function a(t, e, n) {
return e = e || [],
"<" + t + o(n || []) + ">" + (e.innerHTML || "") + "" + t + ">"
}
function o(t) {
var e = "";
return i.forEach(t, function(t) {
e += " " + t.key + "='" + t.value + "'"
}),
e
}
t.exports = r
}
, function(t, e, n) {
var i = n(2);
t.exports = function(t) {
var e = {};
return t.$data.tasksStore.attachEvent("onStoreUpdated", function() {
e = {}
}),
function(n, r, a, o) {
var s = n.id + "_" + r + "_" + a.unit + "_" + a.step;
return e[s] ? e[s] : e[s] = function(e, n, r, a) {
var o, s = !1, l = {};
t.config.process_resource_assignments && n === t.config.resource_property ? (o = "task" == e.$role ? t.getResourceAssignments(e.$resource_id, e.$task_id) : t.getResourceAssignments(e.id),
s = !0) : o = "task" == e.$role ? [] : t.getTaskBy(n, e.id);
for (var c, u, d, h, f, l = function(e, n, r) {
for (var a = n.unit, o = n.step, s = {}, l = {}, c = 0; c < e.length; c++) {
var u = e[c]
, d = u;
r && (d = t.getTask(u.task_id));
var h = u.start_date || d.start_date
, f = u.end_date || d.end_date;
r && (u.start_date && (h = new Date(Math.max(u.start_date.valueOf(), d.start_date.valueOf()))),
u.end_date && (f = new Date(Math.min(u.end_date.valueOf(), d.end_date.valueOf()))));
var _ = i.findBinary(n.trace_x, h.valueOf())
, g = new Date(n.trace_x[_] || t.date[a + "_start"](new Date(h)))
, p = t.config.work_time ? t.getTaskCalendar(d) : t;
for (l[p.id] = {}; g < f; ) {
var v = l[p.id]
, m = g
, y = m.valueOf();
if (g = t.date.add(g, o, a),
!1 !== v[y]) {
var k = p.isWorkTime({
date: m,
task: d,
unit: a
});
k ? (s[y] || (s[y] = {
tasks: [],
assignments: []
}),
s[y].tasks.push(d),
r && s[y].assignments.push(u)) : v[y] = !1
}
}
}
return s
}(o, r, s), _ = r.unit, g = r.step, p = [], v = a.$getConfig(), m = 0; m < r.trace_x.length; m++)
c = new Date(r.trace_x[m]),
u = t.date.add(c, g, _),
f = l[c.valueOf()] || {},
d = f.tasks || [],
h = f.assignments || [],
d.length || v.resource_render_empty_cells ? p.push({
start_date: c,
end_date: u,
tasks: d,
assignments: h
}) : p.push(null);
return p
}(n, r, a, o)
}
}
}
, function(t, e, n) {
var i = n(3)
, r = n(1)
, a = function(t) {
"use strict";
function e(e, n, i) {
var r = t.apply(this, arguments) || this;
return e && (r.$root = !0),
r._parseConfig(n),
r.$name = "layout",
r
}
return i(e, t),
e.prototype.destructor = function() {
this.$container && this.$view && r.removeNode(this.$view);
for (var e = 0; e < this.$cells.length; e++) {
this.$cells[e].destructor()
}
this.$cells = [],
t.prototype.destructor.call(this)
}
,
e.prototype._resizeScrollbars = function(t, e) {
var n, i = !1, r = [], a = [], o = [];
function s(t) {
t.$parent.show(),
i = !0,
r.push(t)
}
function l(t) {
t.$parent.hide(),
i = !0,
a.push(t)
}
for (var c = 0; c < e.length; c++)
t[(n = e[c]).$config.scroll] ? l(n) : n.shouldHide() ? o.push(n) : n.shouldShow() ? s(n) : n.isVisible() ? r.push(n) : a.push(n);
var u = {};
for (c = 0; c < r.length; c++)
r[c].$config.group && (u[r[c].$config.group] = !0);
o.forEach(function(t) {
t.$config.group && u[t.$config.group] || l(t)
});
for (c = 0; c < a.length; c++)
if ((n = a[c]).$config.group && u[n.$config.group]) {
s(n);
for (var d = 0; d < r.length; d++)
if (r[d] == n) {
this.$gantt.$scrollbarRepaint = !0;
break
}
}
return i
}
,
e.prototype._syncCellSizes = function(t, e) {
if (t) {
var n = {};
return this._eachChild(function(t) {
t.$config.group && "scrollbar" != t.$name && "resizer" != t.$name && (n[t.$config.group] || (n[t.$config.group] = []),
n[t.$config.group].push(t))
}),
n[t] && this._syncGroupSize(n[t], e),
n[t]
}
}
,
e.prototype._syncGroupSize = function(t, e) {
if (t.length)
for (var n = t[0].$parent._xLayout ? "width" : "height", i = t[0].$parent.getNextSibling(t[0].$id) ? 1 : -1, r = e.value, a = e.isGravity, o = 0; o < t.length; o++) {
var s = t[o].getSize()
, l = i > 0 ? t[o].$parent.getNextSibling(t[o].$id) : t[o].$parent.getPrevSibling(t[o].$id);
"resizer" == l.$name && (l = i > 0 ? l.$parent.getNextSibling(l.$id) : l.$parent.getPrevSibling(l.$id));
var c = l.getSize();
if (a)
t[o].$config.gravity = r;
else if (l[n]) {
var u = s.gravity + c.gravity
, d = s[n] + c[n]
, h = u / d;
t[o].$config.gravity = h * r,
l.$config[n] = d - r,
l.$config.gravity = u - h * r
} else
t[o].$config[n] = r;
var f = this.$gantt.$ui.getView("grid");
!f || t[o].$content !== f || f.$config.scrollable || a || (this.$gantt.config.grid_width = r)
}
}
,
e.prototype.resize = function(e) {
var n = !1;
if (this.$root && !this._resizeInProgress && (this.callEvent("onBeforeResize", []),
n = !0,
this._resizeInProgress = !0),
t.prototype.resize.call(this, !0),
t.prototype.resize.call(this, !1),
n) {
var i = [];
i = (i = (i = i.concat(this.getCellsByType("viewCell"))).concat(this.getCellsByType("viewLayout"))).concat(this.getCellsByType("hostCell"));
for (var r = this.getCellsByType("scroller"), a = 0; a < i.length; a++)
i[a].$config.hidden || i[a].setContentSize();
var o = this._getAutosizeMode(this.$config.autosize)
, s = this._resizeScrollbars(o, r);
if (this.$config.autosize && (this.autosize(this.$config.autosize),
i.forEach(function(t) {
var e = t.$parent
, n = e.getContentSize(o);
o.x && (e.$config.$originalWidthStored || (e.$config.$originalWidthStored = !0,
e.$config.$originalWidth = e.$config.width),
e.$config.width = n.width),
o.y && (e.$config.$originalHeightStored || (e.$config.$originalHeightStored = !0,
e.$config.$originalHeight = e.$config.height),
e.$config.height = n.height)
}),
s = !0),
s) {
this.resize();
for (a = 0; a < i.length; a++)
i[a].$config.hidden || i[a].setContentSize()
}
this.callEvent("onResize", [])
}
n && (this._resizeInProgress = !1)
}
,
e.prototype._eachChild = function(t, e) {
if (t(e = e || this),
e.$cells)
for (var n = 0; n < e.$cells.length; n++)
this._eachChild(t, e.$cells[n])
}
,
e.prototype.isChild = function(t) {
var e = !1;
return this._eachChild(function(n) {
n !== t && n.$content !== t || (e = !0)
}),
e
}
,
e.prototype.getCellsByType = function(t) {
var n = [];
if (t === this.$name && n.push(this),
this.$content && this.$content.$name == t && n.push(this.$content),
this.$cells)
for (var i = 0; i < this.$cells.length; i++) {
var r = e.prototype.getCellsByType.call(this.$cells[i], t);
r.length && n.push.apply(n, r)
}
return n
}
,
e.prototype.getNextSibling = function(t) {
var e = this.cellIndex(t);
return e >= 0 && this.$cells[e + 1] ? this.$cells[e + 1] : null
}
,
e.prototype.getPrevSibling = function(t) {
var e = this.cellIndex(t);
return e >= 0 && this.$cells[e - 1] ? this.$cells[e - 1] : null
}
,
e.prototype.cell = function(t) {
for (var e = 0; e < this.$cells.length; e++) {
var n = this.$cells[e];
if (n.$id === t)
return n;
var i = n.cell(t);
if (i)
return i
}
}
,
e.prototype.cellIndex = function(t) {
for (var e = 0; e < this.$cells.length; e++)
if (this.$cells[e].$id === t)
return e;
return -1
}
,
e.prototype.moveView = function(t, e) {
if (this.$cells[e] !== t)
return window.alert("Not implemented");
e += this.$config.header ? 1 : 0;
var n = this.$view;
e >= n.childNodes.length ? n.appendChild(t.$view) : n.insertBefore(t.$view, n.childNodes[e])
}
,
e.prototype._parseConfig = function(t) {
this.$cells = [],
this._xLayout = !t.rows;
for (var e = t.rows || t.cols || t.views, n = 0; n < e.length; n++) {
var i = e[n];
i.mode = this._xLayout ? "x" : "y";
var r = this.$factory.initUI(i, this);
r ? (r.$parent = this,
this.$cells.push(r)) : (e.splice(n, 1),
n--)
}
}
,
e.prototype.getCells = function() {
return this.$cells
}
,
e.prototype.render = function() {
var t = r.insertNode(this.$container, this.$toHTML());
this.$fill(t, null),
this.callEvent("onReady", []),
this.resize(),
this.render = this.resize
}
,
e.prototype.$fill = function(t, e) {
this.$view = t,
this.$parent = e;
for (var n = r.getChildNodes(t, "gantt_layout_cell"), i = n.length - 1; i >= 0; i--) {
var a = this.$cells[i];
a.$fill(n[i], this),
a.$config.hidden && a.$view.parentNode.removeChild(a.$view)
}
}
,
e.prototype.$toHTML = function() {
for (var e = this._xLayout ? "x" : "y", n = [], i = 0; i < this.$cells.length; i++)
n.push(this.$cells[i].$toHTML());
return t.prototype.$toHTML.call(this, n.join(""), (this.$root ? "gantt_layout_root " : "") + "gantt_layout gantt_layout_" + e)
}
,
e.prototype.getContentSize = function(t) {
for (var e, n, i, r = 0, a = 0, o = 0; o < this.$cells.length; o++)
(n = this.$cells[o]).$config.hidden || (e = n.getContentSize(t),
"scrollbar" === n.$config.view && t[n.$config.scroll] && (e.height = 0,
e.width = 0),
n.$config.resizer && (this._xLayout ? e.height = 0 : e.width = 0),
i = n._getBorderSizes(),
this._xLayout ? (r += e.width + i.horizontal,
a = Math.max(a, e.height + i.vertical)) : (r = Math.max(r, e.width + i.horizontal),
a += e.height + i.vertical));
return {
width: r += (i = this._getBorderSizes()).horizontal,
height: a += i.vertical
}
}
,
e.prototype._cleanElSize = function(t) {
return 1 * (t || "").toString().replace("px", "") || 0
}
,
e.prototype._getBoxStyles = function(t) {
var e = null
, n = ["width", "height", "paddingTop", "paddingBottom", "paddingLeft", "paddingRight", "borderLeftWidth", "borderRightWidth", "borderTopWidth", "borderBottomWidth"]
, i = {
boxSizing: "border-box" == (e = window.getComputedStyle ? window.getComputedStyle(t, null) : {
width: t.clientWidth,
height: t.clientHeight
}).boxSizing
};
e.MozBoxSizing && (i.boxSizing = "border-box" == e.MozBoxSizing);
for (var r = 0; r < n.length; r++)
i[n[r]] = e[n[r]] ? this._cleanElSize(e[n[r]]) : 0;
var a = {
horPaddings: i.paddingLeft + i.paddingRight + i.borderLeftWidth + i.borderRightWidth,
vertPaddings: i.paddingTop + i.paddingBottom + i.borderTopWidth + i.borderBottomWidth,
borderBox: i.boxSizing,
innerWidth: i.width,
innerHeight: i.height,
outerWidth: i.width,
outerHeight: i.height
};
return a.borderBox ? (a.innerWidth -= a.horPaddings,
a.innerHeight -= a.vertPaddings) : (a.outerWidth += a.horPaddings,
a.outerHeight += a.vertPaddings),
a
}
,
e.prototype._getAutosizeMode = function(t) {
var e = {
x: !1,
y: !1
};
return "xy" === t ? e.x = e.y = !0 : "y" === t || !0 === t ? e.y = !0 : "x" === t && (e.x = !0),
e
}
,
e.prototype.autosize = function(t) {
var e = this._getAutosizeMode(t)
, n = this._getBoxStyles(this.$container)
, i = this.getContentSize(t)
, r = this.$container;
e.x && (n.borderBox && (i.width += n.horPaddings),
r.style.width = i.width + "px"),
e.y && (n.borderBox && (i.height += n.vertPaddings),
r.style.height = i.height + "px")
}
,
e.prototype.getSize = function() {
this._sizes = [];
for (var e = 0, n = 0, i = 1e11, r = 0, a = 1e11, o = 0, s = 0; s < this.$cells.length; s++) {
var l = this._sizes[s] = this.$cells[s].getSize();
this.$cells[s].$config.hidden || (this._xLayout ? (!l.width && l.minWidth ? e += l.minWidth : e += l.width,
i += l.maxWidth,
n += l.minWidth,
r = Math.max(r, l.height),
a = Math.min(a, l.maxHeight),
o = Math.max(o, l.minHeight)) : (!l.height && l.minHeight ? r += l.minHeight : r += l.height,
a += l.maxHeight,
o += l.minHeight,
e = Math.max(e, l.width),
i = Math.min(i, l.maxWidth),
n = Math.max(n, l.minWidth)))
}
var c = t.prototype.getSize.call(this);
return c.maxWidth >= 1e5 && (c.maxWidth = i),
c.maxHeight >= 1e5 && (c.maxHeight = a),
c.minWidth = c.minWidth != c.minWidth ? 0 : c.minWidth,
c.minHeight = c.minHeight != c.minHeight ? 0 : c.minHeight,
this._xLayout ? (c.minWidth += this.$config.margin * this.$cells.length || 0,
c.minWidth += 2 * this.$config.padding || 0,
c.minHeight += 2 * this.$config.padding || 0) : (c.minHeight += this.$config.margin * this.$cells.length || 0,
c.minHeight += 2 * this.$config.padding || 0),
c
}
,
e.prototype._calcFreeSpace = function(t, e, n) {
var i = n ? e.minWidth : e.minHeight
, r = e.maxWidth
, a = t;
return a ? (a > r && (a = r),
a < i && (a = i),
this._free -= a) : ((a = Math.floor(this._free / this._gravity * e.gravity)) > r && (a = r,
this._free -= a,
this._gravity -= e.gravity),
a < i && (a = i,
this._free -= a,
this._gravity -= e.gravity)),
a
}
,
e.prototype._calcSize = function(t, e, n) {
var i = t
, r = n ? e.minWidth : e.minHeight
, a = n ? e.maxWidth : e.maxHeight;
return i || (i = Math.floor(this._free / this._gravity * e.gravity)),
i > a && (i = a),
i < r && (i = r),
i
}
,
e.prototype._configureBorders = function() {
this.$root && this._setBorders([this._borders.left, this._borders.top, this._borders.right, this._borders.bottom], this);
for (var t = this._xLayout ? this._borders.right : this._borders.bottom, e = this.$cells, n = e.length - 1, i = n; i >= 0; i--)
if (!e[i].$config.hidden) {
n = i;
break
}
for (i = 0; i < e.length; i++)
if (!e[i].$config.hidden) {
var r = i >= n
, a = "";
!r && e[i + 1] && "scrollbar" == e[i + 1].$config.view && (this._xLayout ? r = !0 : a = "gantt_layout_cell_border_transparent"),
this._setBorders(r ? [] : [t, a], e[i])
}
}
,
e.prototype._updateCellVisibility = function() {
for (var t = this._visibleCells || {}, e = !this._visibleCells, n = {}, i = null, r = [], a = 0; a < this._sizes.length; a++)
(i = this.$cells[a]).$config.hide_empty && r.push(i),
!e && i.$config.hidden && t[i.$id] ? i._hide(!0) : i.$config.hidden || t[i.$id] || i._hide(!1),
i.$config.hidden || (n[i.$id] = !0);
this._visibleCells = n;
for (a = 0; a < r.length; a++) {
var o = !0;
(i = r[a]).$cells.forEach(function(t) {
t.$config.hidden || t.$config.resizer || (o = !1)
}),
i.$config.hidden = o
}
}
,
e.prototype.setSize = function(e, n) {
this._configureBorders(),
t.prototype.setSize.call(this, e, n),
n = this.$lastSize.contentY,
e = this.$lastSize.contentX;
var i, r, a = this.$config.padding || 0;
this.$view.style.padding = a + "px",
this._gravity = 0,
this._free = this._xLayout ? e : n,
this._free -= 2 * a,
this._updateCellVisibility();
for (var o = 0; o < this._sizes.length; o++)
if (!(i = this.$cells[o]).$config.hidden) {
var s = this.$config.margin || 0;
"resizer" != i.$name || s || (s = -1);
var l = i.$view
, c = this._xLayout ? "marginRight" : "marginBottom";
o !== this.$cells.length - 1 && (l.style[c] = s + "px",
this._free -= s),
r = this._sizes[o],
this._xLayout ? r.width || (this._gravity += r.gravity) : r.height || (this._gravity += r.gravity)
}
for (o = 0; o < this._sizes.length; o++)
if (!(i = this.$cells[o]).$config.hidden) {
var u = (r = this._sizes[o]).width
, d = r.height;
this._xLayout ? this._calcFreeSpace(u, r, !0) : this._calcFreeSpace(d, r, !1)
}
for (o = 0; o < this.$cells.length; o++)
if (!(i = this.$cells[o]).$config.hidden) {
r = this._sizes[o];
var h = void 0
, f = void 0;
this._xLayout ? (h = this._calcSize(r.width, r, !0),
f = n - 2 * a) : (h = e - 2 * a,
f = this._calcSize(r.height, r, !1)),
i.setSize(h, f)
}
}
,
e
}(n(14));
t.exports = a
}
, function(t, e) {
t.exports = function(t, e, n, i, r) {
var a = n.$gantt.getTask(t.source)
, o = n.$gantt.getTask(t.target)
, s = n.getItemTop(a.id)
, l = n.getItemHeight(a.id)
, c = n.getItemTop(o.id)
, u = n.getItemHeight(o.id);
if (e.y > s + l && e.y > c + u)
return !1;
if (e.y_end < c && e.y_end < s)
return !1;
var d = n.posFromDate(a.start_date)
, h = n.posFromDate(a.end_date)
, f = n.posFromDate(o.start_date)
, _ = n.posFromDate(o.end_date);
if (d > h) {
var g = h;
h = d,
d = g
}
if (f > _) {
g = _;
_ = f,
f = g
}
return d += -100,
h += 100,
f += -100,
_ += 100,
!(e.x > h && e.x > _) && !(e.x_end < d && e.x_end < f)
}
}
, function(t, e, n) {
var i = n(134);
t.exports = function() {
var t = []
, e = !1;
function n() {
t = [],
e = !1
}
var r = !1;
return function(a, o, s, l, c) {
!function(t) {
r || (r = !0,
t.attachEvent("onPreFilter", n),
t.attachEvent("onStoreUpdated", n),
t.attachEvent("onClearAll", n),
t.attachEvent("onBeforeStoreUpdate", n))
}(l),
e || function(n, r, a) {
var o = r.$getConfig();
n.getVisibleItems().forEach(function(e) {
var n = i(e, r, o, a);
n && t.push({
id: e.id,
rec: n
})
}),
t.sort(function(t, e) {
return t.rec.right < e.rec.right ? -1 : 1
}),
e = !0
}(l, o, a);
for (var u = [], d = 0; d < t.length; d++) {
var h = t[d]
, f = h.rec;
f.right < c.x || f.left < c.x_end && f.right > c.x && f.top < c.y_end && f.bottom > c.y && u.push(h.id)
}
return {
ids: u
}
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(196)
, r = n(195)
, a = n(194);
e.LargerUnitsCache = a.LargerUnitsCache,
e.createCacheObject = function() {
return "undefined" != typeof Map ? new i.WorkUnitsMapCache : new r.WorkUnitsObjectCache
}
}
, function(t, e, n) {
var i = n(0)
, r = n(2);
function a(t, e, n, i, r) {
return this.date = t,
this.unit = e,
this.task = n,
this.id = i,
this.calendar = r,
this
}
function o(t, e, n, i, r, a) {
return this.date = t,
this.dir = e,
this.unit = n,
this.task = i,
this.id = r,
this.calendar = a,
this
}
function s(t, e, n, i, r, a, o) {
return this.start_date = t,
this.duration = e,
this.unit = n,
this.step = i,
this.task = r,
this.id = a,
this.calendar = o,
this
}
function l(t, e, n, i) {
return this.start_date = t,
this.end_date = e,
this.task = n,
this.calendar = i,
this.unit = null,
this.step = null,
this
}
t.exports = function(t) {
return {
getWorkHoursArguments: function() {
var e = arguments[0];
if (e = r.isDate(e) ? {
date: e
} : i.mixin({}, e),
!r.isValidDate(e.date))
throw t.assert(!1, "Invalid date argument for getWorkHours method"),
new Error("Invalid date argument for getWorkHours method");
return e
},
setWorkTimeArguments: function() {
return arguments[0]
},
unsetWorkTimeArguments: function() {
return arguments[0]
},
isWorkTimeArguments: function() {
var e, n = arguments[0];
if (n instanceof a)
return n;
if ((e = n.date ? new a(n.date,n.unit,n.task,null,n.calendar) : new a(arguments[0],arguments[1],arguments[2],null,arguments[3])).unit = e.unit || t.config.duration_unit,
!r.isValidDate(e.date))
throw t.assert(!1, "Invalid date argument for isWorkTime method"),
new Error("Invalid date argument for isWorkTime method");
return e
},
getClosestWorkTimeArguments: function(e) {
var n, i = arguments[0];
if (i instanceof o)
return i;
if (n = r.isDate(i) ? new o(i) : new o(i.date,i.dir,i.unit,i.task,null,i.calendar),
i.id && (n.task = i),
n.dir = i.dir || "any",
n.unit = i.unit || t.config.duration_unit,
!r.isValidDate(n.date))
throw t.assert(!1, "Invalid date argument for getClosestWorkTime method"),
new Error("Invalid date argument for getClosestWorkTime method");
return n
},
_getStartEndConfig: function(e) {
var n, i = l;
if (e instanceof i)
return e;
if (r.isDate(e) ? n = new i(arguments[0],arguments[1],arguments[2],arguments[3]) : (n = new i(e.start_date,e.end_date,e.task),
null !== e.id && void 0 !== e.id && (n.task = e)),
n.unit = n.unit || t.config.duration_unit,
n.step = n.step || t.config.duration_step,
n.start_date = n.start_date || n.start || n.date,
!r.isValidDate(n.start_date))
throw t.assert(!1, "Invalid start_date argument for getDuration method"),
new Error("Invalid start_date argument for getDuration method");
if (!r.isValidDate(n.end_date))
throw t.assert(!1, "Invalid end_date argument for getDuration method"),
new Error("Invalid end_date argument for getDuration method");
return n
},
getDurationArguments: function(t, e, n, i) {
return this._getStartEndConfig.apply(this, arguments)
},
hasDurationArguments: function(t, e, n, i) {
return this._getStartEndConfig.apply(this, arguments)
},
calculateEndDateArguments: function(e, n, i, a) {
var o, l = arguments[0];
if (l instanceof s)
return l;
if (o = r.isDate(l) ? new s(arguments[0],arguments[1],arguments[2],void 0,arguments[3],void 0,arguments[4]) : new s(l.start_date,l.duration,l.unit,l.step,l.task,null,l.calendar),
null !== l.id && void 0 !== l.id && (o.task = l,
o.unit = null,
o.step = null),
o.unit = o.unit || t.config.duration_unit,
o.step = o.step || t.config.duration_step,
!r.isValidDate(o.start_date))
throw t.assert(!1, "Invalid start_date argument for calculateEndDate method"),
new Error("Invalid start_date argument for calculateEndDate method");
return o
}
}
}
}
, function(t, e, n) {
var i = n(208);
t.exports = function(t) {
var e = {}
, n = {}
, r = null
, a = -1
, o = null
, s = i(t);
return {
_resetTopPositionHeight: function() {
e = {},
n = {},
s.resetCache()
},
_resetHeight: function() {
var t = this.$config.rowStore
, e = this.getCacheStateTotalHeight(t);
o ? this.shouldClearHeightCache(o, e) && (o = e,
r = null) : o = e,
a = -1,
s.resetCache()
},
getRowTop: function(t) {
if (s.canUseSimpleCalculation())
return s.getRowTop(t);
var e = this.$config.rowStore;
if (!e)
return 0;
if (void 0 !== n[t])
return n[t];
for (var i = e.getIndexRange(), r = 0, a = 0, o = 0; o < i.length; o++)
n[o] = r,
r += this.getItemHeight(i[o].id),
o < t && (a = r);
return a
},
getItemTop: function(t) {
if (this.$config.rowStore) {
if (void 0 !== e[t])
return e[t];
var n = this.$config.rowStore;
if (!n)
return 0;
var i = n.getIndexById(t);
if (-1 === i && n.getParent && n.exists(t)) {
var r = n.getParent(t);
if (n.exists(r)) {
var a = n.getItem(r);
if (this.$gantt.isSplitTask(a))
return this.getItemTop(r)
}
}
return e[t] = this.getRowTop(i),
e[t]
}
return 0
},
getItemHeight: function(t) {
if (s.canUseSimpleCalculation())
return s.getItemHeight(t);
if (!r && this.$config.rowStore && this._fillHeightCache(this.$config.rowStore),
void 0 !== r[t])
return r[t];
var e = this.$getConfig().row_height;
if (this.$config.rowStore) {
var n = this.$config.rowStore;
if (!n)
return e;
var i = n.getItem(t);
return r[t] = i && i.row_height || e
}
return e
},
_fillHeightCache: function(t) {
if (t) {
r = {};
var e = this.$getConfig().row_height;
t.eachItem(function(t) {
return r[t.id] = t && t.row_height || e
})
}
},
getCacheStateTotalHeight: function(t) {
var e = this.$getConfig().row_height
, n = {}
, i = []
, r = 0;
return t && t.eachItem(function(t) {
i.push(t),
n[t.id] = t.row_height,
r += t.row_height || e
}),
{
globalHeight: e,
items: i,
count: i.length,
sumHeight: r
}
},
shouldClearHeightCache: function(t, e) {
if (t.count != e.count)
return !0;
if (t.globalHeight != e.globalHeight)
return !0;
if (t.sumHeight != e.sumHeight)
return !0;
for (var n in t.items) {
var i = e.items[n];
if (void 0 !== i && i != t.items[n])
return !0
}
return !1
},
getTotalHeight: function() {
if (s.canUseSimpleCalculation())
return s.getTotalHeight();
if (-1 != a)
return a;
if (this.$config.rowStore) {
var t = this.$config.rowStore;
this._fillHeightCache(t);
var e = this.getItemHeight.bind(this)
, n = 0;
return t.getVisibleItems().forEach(function(t) {
n += e(t.id)
}),
a = n,
n
}
return 0
},
getItemIndexByTopPosition: function(t) {
if (this.$config.rowStore) {
if (s.canUseSimpleCalculation())
return s.getItemIndexByTopPosition(t);
for (var e = this.$config.rowStore, n = 0; n < e.countVisible(); n++) {
var i = this.getRowTop(n)
, r = this.getRowTop(n + 1);
if (!r) {
var a = e.getIdByIndex(n);
r = i + this.getItemHeight(a)
}
if (t >= i && t < r)
return n
}
return e.countVisible() + 2
}
return 0
}
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = function() {
function t() {
var t = this;
this.canParse = function(e) {
return !isNaN(t.parse(e))
}
,
this.format = function(t) {
return String(t)
}
,
this.parse = function(t) {
return parseInt(t, 10)
}
}
return t.create = function(e) {
return void 0 === e && (e = null),
new t
}
,
t
}();
e.default = i
}
, function(t, e) {
function n(t, e, n) {
for (var i = 0; i < e.length; i++)
t.isLinkExists(e[i]) && (n[e[i]] = t.getLink(e[i]))
}
function i(t, e, i) {
n(t, e.$source, i),
n(t, e.$target, i)
}
t.exports = {
getSubtreeLinks: function(t, e) {
var n = {};
return t.isTaskExists(e) && i(t, t.getTask(e), n),
t.eachTask(function(e) {
i(t, e, n)
}, e),
n
},
getSubtreeTasks: function(t, e) {
var n = {};
return t.eachTask(function(t) {
n[t.id] = t
}, e),
n
}
}
}
, function(t, e, n) {
var i = n(33)
, r = n(33);
function a(t) {
var e = function(t) {
var e = new r(t).primaryScale()
, n = e.unit
, a = e.step;
if (t.config.scale_offset_minimal) {
var o = new i(t)
, s = [o.primaryScale()].concat(o.getSubScales());
o.sortScales(s),
n = s[s.length - 1].unit,
a = s[s.length - 1].step || 1
}
return {
unit: n,
step: a
}
}(t)
, n = e.unit
, a = e.step
, o = function(t, e) {
var n = {
start_date: null,
end_date: null
};
if (e.config.start_date && e.config.end_date) {
n.start_date = e.date[t + "_start"](new Date(e.config.start_date));
var i = new Date(e.config.end_date)
, r = e.date[t + "_start"](new Date(i));
i = +i != +r ? e.date.add(r, 1, t) : r,
n.end_date = i
}
return n
}(n, t);
if (!o.start_date || !o.end_date) {
for (var s = !0, l = t.getTaskByTime(), c = 0; c < l.length; c++) {
if (l[c].type !== t.config.types.project) {
s = !1;
break
}
}
if (l.length && s) {
var u = l[0].start_date
, d = t.date.add(u, 1, t.config.duration_unit);
o = {
start_date: new Date(u),
end_date: new Date(d)
}
} else
o = t.getSubtaskDates();
o.start_date && o.end_date || (o = {
start_date: new Date,
end_date: new Date
}),
o.start_date = t.date[n + "_start"](o.start_date),
o.start_date = t.calculateEndDate({
start_date: t.date[n + "_start"](o.start_date),
duration: -1,
unit: n,
step: a
}),
o.end_date = t.date[n + "_start"](o.end_date),
o.end_date = t.calculateEndDate({
start_date: o.end_date,
duration: 2,
unit: n,
step: a
})
}
t._min_date = o.start_date,
t._max_date = o.end_date
}
t.exports = function(t) {
a(t),
function(t) {
if (t.config.fit_tasks) {
var e = +t._min_date
, n = +t._max_date;
if (+t._min_date != e || +t._max_date != n)
return t.render(),
t.callEvent("onScaleAdjusted", []),
!0
}
}(t)
}
}
, function(t, e, n) {
var i = n(48)
, r = n(0)
, a = n(2)
, o = n(49)
, s = n(16)
, l = n(2).replaceValidZeroId;
o.default && (o = o.default);
var c = function(t) {
o.apply(this, [t]),
this._branches = {},
this.pull = {},
this.$initItem = function(e) {
var n = e;
t.initItem && (n = t.initItem(n));
var i = this.getItem(e.id);
return i && i.parent != n.parent && this.move(n.id, n.$index || -1, n.parent || this._ganttConfig.root_id),
n
}
,
this.$parentProperty = t.parentProperty || "parent",
"function" != typeof t.rootId ? this.$getRootId = function(t) {
return function() {
return t
}
}(t.rootId || 0) : this.$getRootId = t.rootId,
this.$openInitially = t.openInitially,
this.visibleOrder = i.$create(),
this.fullOrder = i.$create(),
this._searchVisibleOrder = {},
this._indexRangeCache = {},
this._eachItemMainRangeCache = null,
this._getItemsCache = null,
this._skip_refresh = !1,
this._ganttConfig = null,
t.getConfig && (this._ganttConfig = t.getConfig());
var e = {}
, n = {}
, r = {}
, a = {}
, s = !1;
return this._attachDataChange(function() {
return this._indexRangeCache = {},
this._eachItemMainRangeCache = null,
this._getItemsCache = null,
!0
}),
this.attachEvent("onPreFilter", function() {
this._indexRangeCache = {},
this._eachItemMainRangeCache = null,
e = {},
n = {},
r = {},
a = {},
s = !1,
this.eachItem(function(t) {
var i = this.getParent(t.id);
t.$open && !1 !== r[i] ? r[t.id] = !0 : r[t.id] = !1,
this._isSplitItem(t) && (s = !0,
e[t.id] = !0,
n[t.id] = !0),
s && n[i] && (n[t.id] = !0),
r[i] || void 0 === r[i] ? a[t.id] = !0 : a[t.id] = !1
})
}),
this.attachEvent("onFilterItem", function(t, i) {
var r = !1;
if (this._ganttConfig)
r = this._ganttConfig.open_split_tasks;
var o = a[i.id];
return s && (o && n[i.id] && !e[i.id] && (o = !!r),
n[i.id] && !e[i.id] && (i.$split_subtask = !0)),
i.$expanded_branch = !!a[i.id],
!!o
}),
this.attachEvent("onFilter", function() {
e = {},
n = {},
r = {},
a = {}
}),
this
};
c.prototype = r.mixin({
_buildTree: function(t) {
for (var e = null, n = this.$getRootId(), i = 0, a = t.length; i < a; i++)
e = t[i],
this.setParent(e, l(this.getParent(e), n) || n);
for (i = 0,
a = t.length; i < a; i++)
e = t[i],
this._add_branch(e),
e.$level = this.calculateItemLevel(e),
e.$local_index = this.getBranchIndex(e.id),
r.defined(e.$open) || (e.$open = r.defined(e.open) ? e.open : this.$openInitially());
this._updateOrder()
},
_isSplitItem: function(t) {
return "split" == t.render && this.hasChild(t.id)
},
parse: function(t) {
this._skip_refresh || this.callEvent("onBeforeParse", [t]);
var e = this._parseInner(t);
this._buildTree(e),
this.filter(),
this._skip_refresh || this.callEvent("onParse", [e])
},
_addItemInner: function(t, e) {
var n = this.getParent(t);
r.defined(n) || (n = this.$getRootId(),
this.setParent(t, n));
var i = this.getIndexById(n) + Math.min(Math.max(e, 0), this.visibleOrder.length);
1 * i !== i && (i = void 0),
o.prototype._addItemInner.call(this, t, i),
this.setParent(t, n),
t.hasOwnProperty("$rendered_parent") && this._move_branch(t, t.$rendered_parent),
this._add_branch(t, e)
},
_changeIdInner: function(t, e) {
var n = this.getChildren(t)
, i = this._searchVisibleOrder[t];
o.prototype._changeIdInner.call(this, t, e);
var r = this.getParent(e);
this._replace_branch_child(r, t, e),
this._branches[t] && (this._branches[e] = this._branches[t]);
for (var a = 0; a < n.length; a++) {
var s = this.getItem(n[a]);
s[this.$parentProperty] = e,
s.$rendered_parent = e
}
this._searchVisibleOrder[e] = i,
delete this._branches[t]
},
_traverseBranches: function(t, e) {
r.defined(e) || (e = this.$getRootId());
var n = this._branches[e];
if (n)
for (var i = 0; i < n.length; i++) {
var a = n[i];
t.call(this, a),
this._branches[a] && this._traverseBranches(t, a)
}
},
_updateOrder: function(t) {
this.fullOrder = i.$create(),
this._traverseBranches(function(t) {
this.fullOrder.push(t)
}),
t && o.prototype._updateOrder.call(this, t)
},
_removeItemInner: function(t) {
var e = [];
this.eachItem(function(t) {
e.push(t)
}, t),
e.push(this.getItem(t));
for (var n = 0; n < e.length; n++)
this._move_branch(e[n], this.getParent(e[n]), null),
o.prototype._removeItemInner.call(this, e[n].id),
this._move_branch(e[n], this.getParent(e[n]), null)
},
move: function(t, e, n) {
var i = arguments[3]
, a = (this._ganttConfig || {}).root_id || 0;
if (i = l(i, a)) {
if (i === t)
return;
n = this.getParent(i),
e = this.getBranchIndex(i)
}
if (t != n) {
r.defined(n) || (n = this.$getRootId());
var o = this.getItem(t)
, c = this.getParent(o.id)
, u = this.getChildren(n);
if (-1 == e && (e = u.length + 1),
c == n)
if (this.getBranchIndex(t) == e)
return;
if (!1 === this.callEvent("onBeforeItemMove", [t, n, e]))
return !1;
for (var d = [], h = 0; h < u.length; h++)
s(u[h], null, this, this._ganttConfig) && (d.push(u[h]),
u.splice(h, 1),
h--);
this._replace_branch_child(c, t);
var f = (u = this.getChildren(n))[e];
(f = l(f, a)) ? u = u.slice(0, e).concat([t]).concat(u.slice(e)) : u.push(t),
d.length && (u = u.concat(d)),
this.setParent(o, n),
this._branches[n] = u;
var _ = this.calculateItemLevel(o) - o.$level;
o.$level += _,
this.eachItem(function(t) {
t.$level += _
}, o.id, this),
this._moveInner(this.getIndexById(t), this.getIndexById(n) + e),
this.callEvent("onAfterItemMove", [t, n, e]),
this.refresh()
}
},
getBranchIndex: function(t) {
var e = this.getChildren(this.getParent(t))
, n = e.indexOf(t + "");
return -1 == n && (n = e.indexOf(+t)),
n
},
hasChild: function(t) {
var e = this._branches[t];
return e && e.length
},
getChildren: function(t) {
var e = this._branches[t];
return e || i.$create()
},
isChildOf: function(t, e) {
if (!this.exists(t))
return !1;
if (e === this.$getRootId())
return !0;
if (!this.hasChild(e))
return !1;
var n = this.getItem(t)
, i = this.getParent(t);
if (this.getItem(e).$level >= n.$level)
return !1;
for (; n && this.exists(i); ) {
if ((n = this.getItem(i)) && n.id == e)
return !0;
i = this.getParent(n)
}
return !1
},
getSiblings: function(t) {
if (!this.exists(t))
return i.$create();
var e = this.getParent(t);
return this.getChildren(e)
},
getNextSibling: function(t) {
for (var e = this.getSiblings(t), n = 0, i = e.length; n < i; n++)
if (e[n] == t) {
var r = e[n + 1];
return 0 === r && n > 0 && (r = "0"),
r || null
}
return null
},
getPrevSibling: function(t) {
for (var e = this.getSiblings(t), n = 0, i = e.length; n < i; n++)
if (e[n] == t) {
var r = e[n - 1];
return 0 === r && n > 0 && (r = "0"),
r || null
}
return null
},
getParent: function(t) {
var e = null;
return (e = void 0 !== t.id ? t : this.getItem(t)) ? e[this.$parentProperty] : this.$getRootId()
},
clearAll: function() {
this._branches = {},
o.prototype.clearAll.call(this)
},
calculateItemLevel: function(t) {
var e = 0;
return this.eachParent(function() {
e++
}, t),
e
},
_setParentInner: function(t, e, n) {
n || (t.hasOwnProperty("$rendered_parent") ? this._move_branch(t, t.$rendered_parent, e) : this._move_branch(t, t[this.$parentProperty], e))
},
setParent: function(t, e, n) {
this._setParentInner(t, e, n),
t[this.$parentProperty] = e
},
_eachItemCached: function(t, e) {
for (var n = 0, i = e.length; n < i; n++)
t.call(this, e[n])
},
_eachItemIterate: function(t, e, n) {
var i = this.getChildren(e);
for (i.length && (i = i.slice().reverse()); i.length; ) {
var r = i.pop()
, a = this.getItem(r);
if (t.call(this, a),
n && n.push(a),
this.hasChild(a.id))
for (var o = this.getChildren(a.id), s = o.length - 1; s >= 0; s--)
i.push(o[s])
}
},
eachItem: function(t, e) {
var n = this.$getRootId();
r.defined(e) || (e = n);
var i = l(e, n) || n
, a = !1
, o = !1
, s = null;
i === n && (this._eachItemMainRangeCache ? (a = !0,
s = this._eachItemMainRangeCache) : (o = !0,
s = this._eachItemMainRangeCache = [])),
a ? this._eachItemCached(t, s) : this._eachItemIterate(t, i, o ? s : null)
},
eachParent: function(t, e) {
for (var n = {}, i = e, r = this.getParent(i); this.exists(r); ) {
if (n[r])
throw new Error("Invalid tasks tree. Cyclic reference has been detected on task " + r);
n[r] = !0,
i = this.getItem(r),
t.call(this, i),
r = this.getParent(i)
}
},
_add_branch: function(t, e, n) {
var r = void 0 === n ? this.getParent(t) : n;
this.hasChild(r) || (this._branches[r] = i.$create());
var a = this.getChildren(r);
a.indexOf(t.id + "") > -1 || a.indexOf(+t.id) > -1 || (1 * e == e ? a.splice(e, 0, t.id) : a.push(t.id),
t.$rendered_parent = r)
},
_move_branch: function(t, e, n) {
this._eachItemMainRangeCache = null,
this._replace_branch_child(e, t.id),
this.exists(n) || n == this.$getRootId() ? this._add_branch(t, void 0, n) : delete this._branches[t.id],
t.$level = this.calculateItemLevel(t),
this.eachItem(function(t) {
t.$level = this.calculateItemLevel(t)
}, t.id)
},
_replace_branch_child: function(t, e, n) {
var r = this.getChildren(t);
if (r && void 0 !== t) {
var a = i.$create()
, o = r.indexOf(e + "");
-1 != o || isNaN(+e) || (o = r.indexOf(+e)),
o > -1 && (n ? r.splice(o, 1, n) : r.splice(o, 1)),
a = r,
this._branches[t] = a
}
},
sort: function(t, e, n) {
this.exists(n) || (n = this.$getRootId()),
t || (t = "order");
var i = "string" == typeof t ? function(e, n) {
return e[t] == n[t] || a.isDate(e[t]) && a.isDate(n[t]) && e[t].valueOf() == n[t].valueOf() ? 0 : e[t] > n[t] ? 1 : -1
}
: t;
if (e) {
var r = i;
i = function(t, e) {
return r(e, t)
}
}
var o = this.getChildren(n);
if (o) {
for (var s = [], l = o.length - 1; l >= 0; l--)
s[l] = this.getItem(o[l]);
s.sort(i);
for (l = 0; l < s.length; l++)
o[l] = s[l].id,
this.sort(t, e, o[l])
}
},
filter: function(t) {
for (var e in this.pull) {
var n = this.pull[e].$rendered_parent
, i = this.getParent(this.pull[e]);
n !== i && this._move_branch(this.pull[e], n, i)
}
return o.prototype.filter.apply(this, arguments)
},
open: function(t) {
this.exists(t) && (this.getItem(t).$open = !0,
this._skipTaskRecalculation = !0,
this.callEvent("onItemOpen", [t]))
},
close: function(t) {
this.exists(t) && (this.getItem(t).$open = !1,
this._skipTaskRecalculation = !0,
this.callEvent("onItemClose", [t]))
},
destructor: function() {
o.prototype.destructor.call(this),
this._branches = null,
this._indexRangeCache = {},
this._eachItemMainRangeCache = null
}
}, o.prototype),
t.exports = c
}
, function(t, e, n) {
var i = n(0)
, r = {
$create: function(t) {
return i.mixin(t || [], this)
},
$removeAt: function(t, e) {
t >= 0 && this.splice(t, e || 1)
},
$remove: function(t) {
this.$removeAt(this.$find(t))
},
$insertAt: function(t, e) {
if (e || 0 === e) {
var n = this.splice(e, this.length - e);
this[e] = t,
this.push.apply(this, n)
} else
this.push(t)
},
$find: function(t) {
for (var e = 0; e < this.length; e++)
if (t == this[e])
return e;
return -1
},
$each: function(t, e) {
for (var n = 0; n < this.length; n++)
t.call(e || this, this[n])
},
$map: function(t, e) {
for (var n = 0; n < this.length; n++)
this[n] = t.call(e || this, this[n]);
return this
},
$filter: function(t, e) {
for (var n = 0; n < this.length; n++)
t.call(e || this, this[n]) || (this.splice(n, 1),
n--);
return this
}
};
t.exports = r
}
, function(t, e, n) {
var i = n(48)
, r = n(0)
, a = n(5)
, o = n(16)
, s = function(t) {
return this.pull = {},
this.$initItem = t.initItem,
this.visibleOrder = i.$create(),
this.fullOrder = i.$create(),
this._skip_refresh = !1,
this._filterRule = null,
this._searchVisibleOrder = {},
this._indexRangeCache = {},
this._getItemsCache = null,
this.$config = t,
a(this),
this._attachDataChange(function() {
return this._indexRangeCache = {},
this._getItemsCache = null,
!0
}),
this
};
s.prototype = {
_attachDataChange: function(t) {
this.attachEvent("onClearAll", t),
this.attachEvent("onBeforeParse", t),
this.attachEvent("onBeforeUpdate", t),
this.attachEvent("onBeforeDelete", t),
this.attachEvent("onBeforeAdd", t),
this.attachEvent("onParse", t),
this.attachEvent("onBeforeFilter", t)
},
_parseInner: function(t) {
for (var e = null, n = [], i = 0, a = t.length; i < a; i++)
e = t[i],
this.$initItem && (this.$config.copyOnParse() && (e = r.copy(e)),
e = this.$initItem(e)),
this.callEvent("onItemLoading", [e]) && (this.pull.hasOwnProperty(e.id) || this.fullOrder.push(e.id),
n.push(e),
this.pull[e.id] = e);
return n
},
parse: function(t) {
this.isSilent() || this.callEvent("onBeforeParse", [t]);
var e = this._parseInner(t);
this.isSilent() || (this.refresh(),
this.callEvent("onParse", [e]))
},
getItem: function(t) {
return this.pull[t]
},
_updateOrder: function(t) {
t.call(this.visibleOrder),
t.call(this.fullOrder)
},
updateItem: function(t, e) {
if (r.defined(e) || (e = this.getItem(t)),
!this.isSilent() && !1 === this.callEvent("onBeforeUpdate", [e.id, e]))
return !1;
r.mixin(this.pull[t], e, !0),
this.isSilent() || (this.callEvent("onAfterUpdate", [e.id, e]),
this.callEvent("onStoreUpdated", [e.id, e, "update"]))
},
_removeItemInner: function(t) {
this._updateOrder(function() {
this.$remove(t)
}),
delete this.pull[t]
},
removeItem: function(t) {
var e = this.getItem(t);
if (!this.isSilent() && !1 === this.callEvent("onBeforeDelete", [e.id, e]))
return !1;
this.callEvent("onAfterDeleteConfirmed", [e.id, e]),
this._removeItemInner(t),
this.isSilent() || (this.filter(),
this.callEvent("onAfterDelete", [e.id, e]),
this.callEvent("onStoreUpdated", [e.id, e, "delete"]))
},
_addItemInner: function(t, e) {
if (this.exists(t.id))
this.silent(function() {
this.updateItem(t.id, t)
});
else {
var n = this.visibleOrder
, i = n.length;
(!r.defined(e) || e < 0) && (e = i),
e > i && (e = Math.min(n.length, e))
}
this.pull[t.id] = t,
this.isSilent() || this._updateOrder(function() {
-1 === this.$find(t.id) && this.$insertAt(t.id, e)
}),
this.filter()
},
isVisible: function(t) {
return this.visibleOrder.$find(t) > -1
},
getVisibleItems: function() {
return this.getIndexRange()
},
addItem: function(t, e) {
return r.defined(t.id) || (t.id = r.uid()),
this.$initItem && (t = this.$initItem(t)),
!(!this.isSilent() && !1 === this.callEvent("onBeforeAdd", [t.id, t])) && (this._addItemInner(t, e),
this.isSilent() || (this.callEvent("onAfterAdd", [t.id, t]),
this.callEvent("onStoreUpdated", [t.id, t, "add"])),
t.id)
},
_changeIdInner: function(t, e) {
this.pull[t] && (this.pull[e] = this.pull[t]);
var n = this._searchVisibleOrder[t];
this.pull[e].id = e,
this._updateOrder(function() {
this[this.$find(t)] = e
}),
this._searchVisibleOrder[e] = n,
delete this._searchVisibleOrder[t],
delete this.pull[t]
},
changeId: function(t, e) {
this._changeIdInner(t, e),
this.callEvent("onIdChange", [t, e])
},
exists: function(t) {
return !!this.pull[t]
},
_moveInner: function(t, e) {
var n = this.getIdByIndex(t);
this._updateOrder(function() {
this.$removeAt(t),
this.$insertAt(n, Math.min(this.length, e))
})
},
move: function(t, e) {
var n = this.getIdByIndex(t)
, i = this.getItem(n);
this._moveInner(t, e),
this.isSilent() || this.callEvent("onStoreUpdated", [i.id, i, "move"])
},
clearAll: function() {
this.$destroyed || (this.silent(function() {
this.unselect()
}),
this.pull = {},
this.visibleOrder = i.$create(),
this.fullOrder = i.$create(),
this.isSilent() || (this.callEvent("onClearAll", []),
this.refresh()))
},
silent: function(t, e) {
var n = !1;
this.isSilent() && (n = !0),
this._skip_refresh = !0,
t.call(e || this),
n || (this._skip_refresh = !1)
},
isSilent: function() {
return !!this._skip_refresh
},
arraysEqual: function(t, e) {
if (t.length !== e.length)
return !1;
for (var n = 0; n < t.length; n++)
if (t[n] !== e[n])
return !1;
return !0
},
refresh: function(t, e) {
var n, i;
if (!this.isSilent() && (t && (n = this.getItem(t)),
i = t ? [t, n, "paint"] : [null, null, null],
!1 !== this.callEvent("onBeforeStoreUpdate", i))) {
var r = this._quick_refresh && !this._mark_recompute;
if (this._mark_recompute = !1,
t) {
if (!e && !r) {
var a = this.visibleOrder;
this.filter(),
this.arraysEqual(a, this.visibleOrder) || (t = void 0)
}
} else
r || this.filter();
i = t ? [t, n, "paint"] : [null, null, null],
this.callEvent("onStoreUpdated", i)
}
},
count: function() {
return this.fullOrder.length
},
countVisible: function() {
return this.visibleOrder.length
},
sort: function(t) {},
serialize: function() {},
eachItem: function(t) {
for (var e = 0; e < this.fullOrder.length; e++) {
var n = this.getItem(this.fullOrder[e]);
t.call(this, n)
}
},
find: function(t) {
var e = [];
return this.eachItem(function(n) {
t(n) && e.push(n)
}),
e
},
filter: function(t) {
this.isSilent() || this.callEvent("onBeforeFilter", []),
this.callEvent("onPreFilter", []);
var e = i.$create()
, n = [];
this.eachItem(function(t) {
this.callEvent("onFilterItem", [t.id, t]) && (o(t.id, null, this, this._ganttConfig) ? n.push(t.id) : e.push(t.id))
});
for (var r = 0; r < n.length; r++)
e.push(n[r]);
this.visibleOrder = e,
this._searchVisibleOrder = {};
for (r = 0; r < this.visibleOrder.length; r++)
this._searchVisibleOrder[this.visibleOrder[r]] = r;
this.isSilent() || this.callEvent("onFilter", [])
},
getIndexRange: function(t, e) {
var n = Math.min(e || 1 / 0, this.countVisible() - 1)
, i = t || 0
, r = i + "-" + n;
if (this._indexRangeCache[r])
return this._indexRangeCache[r].slice();
for (var a = [], o = i; o <= n; o++)
a.push(this.getItem(this.visibleOrder[o]));
return this._indexRangeCache[r] = a.slice(),
a
},
getItems: function() {
if (this._getItemsCache)
return this._getItemsCache.slice();
var t = [];
for (var e in this.pull)
t.push(this.pull[e]);
return this._getItemsCache = t.slice(),
t
},
getIdByIndex: function(t) {
return this.visibleOrder[t]
},
getIndexById: function(t) {
var e = this._searchVisibleOrder[t];
return void 0 === e && (e = -1),
e
},
_getNullIfUndefined: function(t) {
return void 0 === t ? null : t
},
getFirst: function() {
return this._getNullIfUndefined(this.visibleOrder[0])
},
getLast: function() {
return this._getNullIfUndefined(this.visibleOrder[this.visibleOrder.length - 1])
},
getNext: function(t) {
return this._getNullIfUndefined(this.visibleOrder[this.getIndexById(t) + 1])
},
getPrev: function(t) {
return this._getNullIfUndefined(this.visibleOrder[this.getIndexById(t) - 1])
},
destructor: function() {
this.callEvent("onDestroy", []),
this.detachAllEvents(),
this.$destroyed = !0,
this.pull = null,
this.$initItem = null,
this.visibleOrder = null,
this.fullOrder = null,
this._skip_refresh = null,
this._filterRule = null,
this._searchVisibleOrder = null,
this._indexRangeCache = {}
}
},
t.exports = s
}
, function(t, e) {
t.exports = function(t, e) {
if (!e)
return !0;
if (t._on_timeout)
return !1;
var n = Math.ceil(1e3 / e);
return n < 2 || (setTimeout(function() {
delete t._on_timeout
}, n),
t._on_timeout = !0,
!0)
}
}
, function(t, e, n) {
var i = n(0);
t.exports = function t(e, n) {
e = e || i.event,
n = n || i.eventRemove;
var r = []
, a = {
attach: function(t, n, i, a) {
r.push({
element: t,
event: n,
callback: i,
capture: a
}),
e(t, n, i, a)
},
detach: function(t, e, i, a) {
n(t, e, i, a);
for (var o = 0; o < r.length; o++) {
var s = r[o];
s.element === t && s.event === e && s.callback === i && s.capture === a && (r.splice(o, 1),
o--)
}
},
detachAll: function() {
for (var t = r.slice(), e = 0; e < t.length; e++) {
var n = t[e];
a.detach(n.element, n.event, n.callback, n.capture),
a.detach(n.element, n.event, n.callback, void 0),
a.detach(n.element, n.event, n.callback, !1),
a.detach(n.element, n.event, n.callback, !0)
}
r.splice(0, r.length)
},
extend: function() {
return t(this.event, this.eventRemove)
}
};
return a
}
}
, function(t, e) {
function n(t) {
"@babel/helpers - typeof";
return (n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
t.exports = "object" == ("undefined" == typeof self ? "undefined" : n(self)) ? self.FormData : window.FormData
}
, function(t, e) {
(function(e) {
t.exports = e
}
).call(this, {})
}
, function(t, e, n) {
"use strict";
function i(t) {
"@babel/helpers - typeof";
return (i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
var r = n(278)
, a = n(276);
function o() {
this.protocol = null,
this.slashes = null,
this.auth = null,
this.host = null,
this.port = null,
this.hostname = null,
this.hash = null,
this.search = null,
this.query = null,
this.pathname = null,
this.path = null,
this.href = null
}
e.parse = k,
e.resolve = function(t, e) {
return k(t, !1, !0).resolve(e)
}
,
e.resolveObject = function(t, e) {
return t ? k(t, !1, !0).resolveObject(e) : e
}
,
e.format = function(t) {
a.isString(t) && (t = k(t));
return t instanceof o ? t.format() : o.prototype.format.call(t)
}
,
e.Url = o;
var s = /^([a-z0-9.+-]+:)/i
, l = /:[0-9]*$/
, c = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
, u = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
, d = ["'"].concat(u)
, h = ["%", "/", "?", ";", "#"].concat(d)
, f = ["/", "?", "#"]
, _ = /^[+a-z0-9A-Z_-]{0,63}$/
, g = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
, p = {
javascript: !0,
"javascript:": !0
}
, v = {
javascript: !0,
"javascript:": !0
}
, m = {
http: !0,
https: !0,
ftp: !0,
gopher: !0,
file: !0,
"http:": !0,
"https:": !0,
"ftp:": !0,
"gopher:": !0,
"file:": !0
}
, y = n(275);
function k(t, e, n) {
if (t && a.isObject(t) && t instanceof o)
return t;
var i = new o;
return i.parse(t, e, n),
i
}
o.prototype.parse = function(t, e, n) {
if (!a.isString(t))
throw new TypeError("Parameter 'url' must be a string, not " + i(t));
var o = t.indexOf("?")
, l = -1 !== o && o < t.indexOf("#") ? "?" : "#"
, u = t.split(l);
u[0] = u[0].replace(/\\/g, "/");
var k = t = u.join(l);
if (k = k.trim(),
!n && 1 === t.split("#").length) {
var b = c.exec(k);
if (b)
return this.path = k,
this.href = k,
this.pathname = b[1],
b[2] ? (this.search = b[2],
this.query = e ? y.parse(this.search.substr(1)) : this.search.substr(1)) : e && (this.search = "",
this.query = {}),
this
}
var x = s.exec(k);
if (x) {
var w = (x = x[0]).toLowerCase();
this.protocol = w,
k = k.substr(x.length)
}
if (n || x || k.match(/^\/\/[^@\/]+@[^@\/]+/)) {
var S = "//" === k.substr(0, 2);
!S || x && v[x] || (k = k.substr(2),
this.slashes = !0)
}
if (!v[x] && (S || x && !m[x])) {
for (var T, $, C = -1, E = 0; E < f.length; E++) {
-1 !== (A = k.indexOf(f[E])) && (-1 === C || A < C) && (C = A)
}
-1 !== ($ = -1 === C ? k.lastIndexOf("@") : k.lastIndexOf("@", C)) && (T = k.slice(0, $),
k = k.slice($ + 1),
this.auth = decodeURIComponent(T)),
C = -1;
for (E = 0; E < h.length; E++) {
var A;
-1 !== (A = k.indexOf(h[E])) && (-1 === C || A < C) && (C = A)
}
-1 === C && (C = k.length),
this.host = k.slice(0, C),
k = k.slice(C),
this.parseHost(),
this.hostname = this.hostname || "";
var D = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
if (!D)
for (var M = this.hostname.split(/\./), I = (E = 0,
M.length); E < I; E++) {
var P = M[E];
if (P && !P.match(_)) {
for (var N = "", O = 0, L = P.length; O < L; O++)
P.charCodeAt(O) > 127 ? N += "x" : N += P[O];
if (!N.match(_)) {
var R = M.slice(0, E)
, j = M.slice(E + 1)
, H = P.match(g);
H && (R.push(H[1]),
j.unshift(H[2])),
j.length && (k = "/" + j.join(".") + k),
this.hostname = R.join(".");
break
}
}
}
this.hostname.length > 255 ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
D || (this.hostname = r.toASCII(this.hostname));
var F = this.port ? ":" + this.port : ""
, B = this.hostname || "";
this.host = B + F,
this.href += this.host,
D && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
"/" !== k[0] && (k = "/" + k))
}
if (!p[w])
for (E = 0,
I = d.length; E < I; E++) {
var z = d[E];
if (-1 !== k.indexOf(z)) {
var U = encodeURIComponent(z);
U === z && (U = escape(z)),
k = k.split(z).join(U)
}
}
var W = k.indexOf("#");
-1 !== W && (this.hash = k.substr(W),
k = k.slice(0, W));
var V = k.indexOf("?");
if (-1 !== V ? (this.search = k.substr(V),
this.query = k.substr(V + 1),
e && (this.query = y.parse(this.query)),
k = k.slice(0, V)) : e && (this.search = "",
this.query = {}),
k && (this.pathname = k),
m[w] && this.hostname && !this.pathname && (this.pathname = "/"),
this.pathname || this.search) {
F = this.pathname || "";
var q = this.search || "";
this.path = F + q
}
return this.href = this.format(),
this
}
,
o.prototype.format = function() {
var t = this.auth || "";
t && (t = (t = encodeURIComponent(t)).replace(/%3A/i, ":"),
t += "@");
var e = this.protocol || ""
, n = this.pathname || ""
, i = this.hash || ""
, r = !1
, o = "";
this.host ? r = t + this.host : this.hostname && (r = t + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
this.port && (r += ":" + this.port)),
this.query && a.isObject(this.query) && Object.keys(this.query).length && (o = y.stringify(this.query));
var s = this.search || o && "?" + o || "";
return e && ":" !== e.substr(-1) && (e += ":"),
this.slashes || (!e || m[e]) && !1 !== r ? (r = "//" + (r || ""),
n && "/" !== n.charAt(0) && (n = "/" + n)) : r || (r = ""),
i && "#" !== i.charAt(0) && (i = "#" + i),
s && "?" !== s.charAt(0) && (s = "?" + s),
e + r + (n = n.replace(/[?#]/g, function(t) {
return encodeURIComponent(t)
})) + (s = s.replace("#", "%23")) + i
}
,
o.prototype.resolve = function(t) {
return this.resolveObject(k(t, !1, !0)).format()
}
,
o.prototype.resolveObject = function(t) {
if (a.isString(t)) {
var e = new o;
e.parse(t, !1, !0),
t = e
}
for (var n = new o, i = Object.keys(this), r = 0; r < i.length; r++) {
var s = i[r];
n[s] = this[s]
}
if (n.hash = t.hash,
"" === t.href)
return n.href = n.format(),
n;
if (t.slashes && !t.protocol) {
for (var l = Object.keys(t), c = 0; c < l.length; c++) {
var u = l[c];
"protocol" !== u && (n[u] = t[u])
}
return m[n.protocol] && n.hostname && !n.pathname && (n.path = n.pathname = "/"),
n.href = n.format(),
n
}
if (t.protocol && t.protocol !== n.protocol) {
if (!m[t.protocol]) {
for (var d = Object.keys(t), h = 0; h < d.length; h++) {
var f = d[h];
n[f] = t[f]
}
return n.href = n.format(),
n
}
if (n.protocol = t.protocol,
t.host || v[t.protocol])
n.pathname = t.pathname;
else {
for (var _ = (t.pathname || "").split("/"); _.length && !(t.host = _.shift()); )
;
t.host || (t.host = ""),
t.hostname || (t.hostname = ""),
"" !== _[0] && _.unshift(""),
_.length < 2 && _.unshift(""),
n.pathname = _.join("/")
}
if (n.search = t.search,
n.query = t.query,
n.host = t.host || "",
n.auth = t.auth,
n.hostname = t.hostname || t.host,
n.port = t.port,
n.pathname || n.search) {
var g = n.pathname || ""
, p = n.search || "";
n.path = g + p
}
return n.slashes = n.slashes || t.slashes,
n.href = n.format(),
n
}
var y = n.pathname && "/" === n.pathname.charAt(0)
, k = t.host || t.pathname && "/" === t.pathname.charAt(0)
, b = k || y || n.host && t.pathname
, x = b
, w = n.pathname && n.pathname.split("/") || []
, S = (_ = t.pathname && t.pathname.split("/") || [],
n.protocol && !m[n.protocol]);
if (S && (n.hostname = "",
n.port = null,
n.host && ("" === w[0] ? w[0] = n.host : w.unshift(n.host)),
n.host = "",
t.protocol && (t.hostname = null,
t.port = null,
t.host && ("" === _[0] ? _[0] = t.host : _.unshift(t.host)),
t.host = null),
b = b && ("" === _[0] || "" === w[0])),
k)
n.host = t.host || "" === t.host ? t.host : n.host,
n.hostname = t.hostname || "" === t.hostname ? t.hostname : n.hostname,
n.search = t.search,
n.query = t.query,
w = _;
else if (_.length)
w || (w = []),
w.pop(),
w = w.concat(_),
n.search = t.search,
n.query = t.query;
else if (!a.isNullOrUndefined(t.search)) {
if (S)
n.hostname = n.host = w.shift(),
(A = !!(n.host && n.host.indexOf("@") > 0) && n.host.split("@")) && (n.auth = A.shift(),
n.host = n.hostname = A.shift());
return n.search = t.search,
n.query = t.query,
a.isNull(n.pathname) && a.isNull(n.search) || (n.path = (n.pathname ? n.pathname : "") + (n.search ? n.search : "")),
n.href = n.format(),
n
}
if (!w.length)
return n.pathname = null,
n.search ? n.path = "/" + n.search : n.path = null,
n.href = n.format(),
n;
for (var T = w.slice(-1)[0], $ = (n.host || t.host || w.length > 1) && ("." === T || ".." === T) || "" === T, C = 0, E = w.length; E >= 0; E--)
"." === (T = w[E]) ? w.splice(E, 1) : ".." === T ? (w.splice(E, 1),
C++) : C && (w.splice(E, 1),
C--);
if (!b && !x)
for (; C--; C)
w.unshift("..");
!b || "" === w[0] || w[0] && "/" === w[0].charAt(0) || w.unshift(""),
$ && "/" !== w.join("/").substr(-1) && w.push("");
var A, D = "" === w[0] || w[0] && "/" === w[0].charAt(0);
S && (n.hostname = n.host = D ? "" : w.length ? w.shift() : "",
(A = !!(n.host && n.host.indexOf("@") > 0) && n.host.split("@")) && (n.auth = A.shift(),
n.host = n.hostname = A.shift()));
return (b = b || n.host && w.length) && !D && w.unshift(""),
w.length ? n.pathname = w.join("/") : (n.pathname = null,
n.path = null),
a.isNull(n.pathname) && a.isNull(n.search) || (n.path = (n.pathname ? n.pathname : "") + (n.search ? n.search : "")),
n.auth = t.auth || n.auth,
n.slashes = n.slashes || t.slashes,
n.href = n.format(),
n
}
,
o.prototype.parseHost = function() {
var t = this.host
, e = l.exec(t);
e && (":" !== (e = e[0]) && (this.port = e.substr(1)),
t = t.substr(0, t.length - e.length)),
t && (this.hostname = t)
}
}
, function(t, e, n) {
"use strict";
t.exports = a;
var i = n(12)
, r = n(17);
function a(t) {
if (!(this instanceof a))
return new a(t);
i.call(this, t),
this._transformState = {
afterTransform: function(t, e) {
var n = this._transformState;
n.transforming = !1;
var i = n.writecb;
if (!i)
return this.emit("error", new Error("write callback called multiple times"));
n.writechunk = null,
n.writecb = null,
null != e && this.push(e),
i(t);
var r = this._readableState;
r.reading = !1,
(r.needReadable || r.length < r.highWaterMark) && this._read(r.highWaterMark)
}
.bind(this),
needTransform: !1,
transforming: !1,
writecb: null,
writechunk: null,
writeencoding: null
},
this._readableState.needReadable = !0,
this._readableState.sync = !1,
t && ("function" == typeof t.transform && (this._transform = t.transform),
"function" == typeof t.flush && (this._flush = t.flush)),
this.on("prefinish", o)
}
function o() {
var t = this;
"function" == typeof this._flush ? this._flush(function(e, n) {
s(t, e, n)
}) : s(this, null, null)
}
function s(t, e, n) {
if (e)
return t.emit("error", e);
if (null != n && t.push(n),
t._writableState.length)
throw new Error("Calling transform done when ws.length != 0");
if (t._transformState.transforming)
throw new Error("Calling transform done when still transforming");
return t.push(null)
}
r.inherits = n(8),
r.inherits(a, i),
a.prototype.push = function(t, e) {
return this._transformState.needTransform = !1,
i.prototype.push.call(this, t, e)
}
,
a.prototype._transform = function(t, e, n) {
throw new Error("_transform() is not implemented")
}
,
a.prototype._write = function(t, e, n) {
var i = this._transformState;
if (i.writecb = n,
i.writechunk = t,
i.writeencoding = e,
!i.transforming) {
var r = this._readableState;
(i.needTransform || r.needReadable || r.length < r.highWaterMark) && this._read(r.highWaterMark)
}
}
,
a.prototype._read = function(t) {
var e = this._transformState;
null !== e.writechunk && e.writecb && !e.transforming ? (e.transforming = !0,
this._transform(e.writechunk, e.writeencoding, e.afterTransform)) : e.needTransform = !0
}
,
a.prototype._destroy = function(t, e) {
var n = this;
i.prototype._destroy.call(this, t, function(t) {
e(t),
n.emit("close")
})
}
}
, function(t, e, n) {
"use strict";
var i = n(22).Buffer
, r = i.isEncoding || function(t) {
switch ((t = "" + t) && t.toLowerCase()) {
case "hex":
case "utf8":
case "utf-8":
case "ascii":
case "binary":
case "base64":
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
case "raw":
return !0;
default:
return !1
}
}
;
function a(t) {
var e;
switch (this.encoding = function(t) {
var e = function(t) {
if (!t)
return "utf8";
for (var e; ; )
switch (t) {
case "utf8":
case "utf-8":
return "utf8";
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return "utf16le";
case "latin1":
case "binary":
return "latin1";
case "base64":
case "ascii":
case "hex":
return t;
default:
if (e)
return;
t = ("" + t).toLowerCase(),
e = !0
}
}(t);
if ("string" != typeof e && (i.isEncoding === r || !r(t)))
throw new Error("Unknown encoding: " + t);
return e || t
}(t),
this.encoding) {
case "utf16le":
this.text = l,
this.end = c,
e = 4;
break;
case "utf8":
this.fillLast = s,
e = 4;
break;
case "base64":
this.text = u,
this.end = d,
e = 3;
break;
default:
return this.write = h,
void (this.end = f)
}
this.lastNeed = 0,
this.lastTotal = 0,
this.lastChar = i.allocUnsafe(e)
}
function o(t) {
return t <= 127 ? 0 : t >> 5 == 6 ? 2 : t >> 4 == 14 ? 3 : t >> 3 == 30 ? 4 : t >> 6 == 2 ? -1 : -2
}
function s(t) {
var e = this.lastTotal - this.lastNeed
, n = function(t, e, n) {
if (128 != (192 & e[0]))
return t.lastNeed = 0,
"�";
if (t.lastNeed > 1 && e.length > 1) {
if (128 != (192 & e[1]))
return t.lastNeed = 1,
"�";
if (t.lastNeed > 2 && e.length > 2 && 128 != (192 & e[2]))
return t.lastNeed = 2,
"�"
}
}(this, t);
return void 0 !== n ? n : this.lastNeed <= t.length ? (t.copy(this.lastChar, e, 0, this.lastNeed),
this.lastChar.toString(this.encoding, 0, this.lastTotal)) : (t.copy(this.lastChar, e, 0, t.length),
void (this.lastNeed -= t.length))
}
function l(t, e) {
if ((t.length - e) % 2 == 0) {
var n = t.toString("utf16le", e);
if (n) {
var i = n.charCodeAt(n.length - 1);
if (i >= 55296 && i <= 56319)
return this.lastNeed = 2,
this.lastTotal = 4,
this.lastChar[0] = t[t.length - 2],
this.lastChar[1] = t[t.length - 1],
n.slice(0, -1)
}
return n
}
return this.lastNeed = 1,
this.lastTotal = 2,
this.lastChar[0] = t[t.length - 1],
t.toString("utf16le", e, t.length - 1)
}
function c(t) {
var e = t && t.length ? this.write(t) : "";
if (this.lastNeed) {
var n = this.lastTotal - this.lastNeed;
return e + this.lastChar.toString("utf16le", 0, n)
}
return e
}
function u(t, e) {
var n = (t.length - e) % 3;
return 0 === n ? t.toString("base64", e) : (this.lastNeed = 3 - n,
this.lastTotal = 3,
1 === n ? this.lastChar[0] = t[t.length - 1] : (this.lastChar[0] = t[t.length - 2],
this.lastChar[1] = t[t.length - 1]),
t.toString("base64", e, t.length - n))
}
function d(t) {
var e = t && t.length ? this.write(t) : "";
return this.lastNeed ? e + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : e
}
function h(t) {
return t.toString(this.encoding)
}
function f(t) {
return t && t.length ? this.write(t) : ""
}
e.StringDecoder = a,
a.prototype.write = function(t) {
if (0 === t.length)
return "";
var e, n;
if (this.lastNeed) {
if (void 0 === (e = this.fillLast(t)))
return "";
n = this.lastNeed,
this.lastNeed = 0
} else
n = 0;
return n < t.length ? e ? e + this.text(t, n) : this.text(t, n) : e || ""
}
,
a.prototype.end = function(t) {
var e = t && t.length ? this.write(t) : "";
return this.lastNeed ? e + "�" : e
}
,
a.prototype.text = function(t, e) {
var n = function(t, e, n) {
var i = e.length - 1;
if (i < n)
return 0;
var r = o(e[i]);
if (r >= 0)
return r > 0 && (t.lastNeed = r - 1),
r;
if (--i < n || -2 === r)
return 0;
if ((r = o(e[i])) >= 0)
return r > 0 && (t.lastNeed = r - 2),
r;
if (--i < n || -2 === r)
return 0;
if ((r = o(e[i])) >= 0)
return r > 0 && (2 === r ? r = 0 : t.lastNeed = r - 3),
r;
return 0
}(this, t, e);
if (!this.lastNeed)
return t.toString("utf8", e);
this.lastTotal = n;
var i = t.length - (n - this.lastNeed);
return t.copy(this.lastChar, 0, i),
t.toString("utf8", e, i)
}
,
a.prototype.fillLast = function(t) {
if (this.lastNeed <= t.length)
return t.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed),
this.lastChar.toString(this.encoding, 0, this.lastTotal);
t.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, t.length),
this.lastNeed -= t.length
}
}
, function(t, e, n) {
(function(t) {
var i = void 0 !== t && t || "undefined" != typeof self && self || window
, r = Function.prototype.apply;
function a(t, e) {
this._id = t,
this._clearFn = e
}
e.setTimeout = function() {
return new a(r.call(setTimeout, i, arguments),clearTimeout)
}
,
e.setInterval = function() {
return new a(r.call(setInterval, i, arguments),clearInterval)
}
,
e.clearTimeout = e.clearInterval = function(t) {
t && t.close()
}
,
a.prototype.unref = a.prototype.ref = function() {}
,
a.prototype.close = function() {
this._clearFn.call(i, this._id)
}
,
e.enroll = function(t, e) {
clearTimeout(t._idleTimeoutId),
t._idleTimeout = e
}
,
e.unenroll = function(t) {
clearTimeout(t._idleTimeoutId),
t._idleTimeout = -1
}
,
e._unrefActive = e.active = function(t) {
clearTimeout(t._idleTimeoutId);
var e = t._idleTimeout;
e >= 0 && (t._idleTimeoutId = setTimeout(function() {
t._onTimeout && t._onTimeout()
}, e))
}
,
n(284),
e.setImmediate = "undefined" != typeof self && self.setImmediate || void 0 !== t && t.setImmediate || this && this.setImmediate,
e.clearImmediate = "undefined" != typeof self && self.clearImmediate || void 0 !== t && t.clearImmediate || this && this.clearImmediate
}
).call(this, n(4))
}
, function(t, e, n) {
"use strict";
(function(e, i, r) {
var a = n(23);
function o(t) {
var e = this;
this.next = null,
this.entry = null,
this.finish = function() {
!function(t, e, n) {
var i = t.entry;
t.entry = null;
for (; i; ) {
var r = i.callback;
e.pendingcb--,
r(n),
i = i.next
}
e.corkedRequestsFree ? e.corkedRequestsFree.next = t : e.corkedRequestsFree = t
}(e, t)
}
}
t.exports = m;
var s, l = !e.browser && ["v0.10", "v0.9."].indexOf(e.version.slice(0, 5)) > -1 ? i : a.nextTick;
m.WritableState = v;
var c = n(17);
c.inherits = n(8);
var u = {
deprecate: n(283)
}
, d = n(60)
, h = n(22).Buffer
, f = r.Uint8Array || function() {}
;
var _, g = n(59);
function p() {}
function v(t, e) {
s = s || n(12),
t = t || {};
var i = e instanceof s;
this.objectMode = !!t.objectMode,
i && (this.objectMode = this.objectMode || !!t.writableObjectMode);
var r = t.highWaterMark
, c = t.writableHighWaterMark
, u = this.objectMode ? 16 : 16384;
this.highWaterMark = r || 0 === r ? r : i && (c || 0 === c) ? c : u,
this.highWaterMark = Math.floor(this.highWaterMark),
this.finalCalled = !1,
this.needDrain = !1,
this.ending = !1,
this.ended = !1,
this.finished = !1,
this.destroyed = !1;
var d = !1 === t.decodeStrings;
this.decodeStrings = !d,
this.defaultEncoding = t.defaultEncoding || "utf8",
this.length = 0,
this.writing = !1,
this.corked = 0,
this.sync = !0,
this.bufferProcessing = !1,
this.onwrite = function(t) {
!function(t, e) {
var n = t._writableState
, i = n.sync
, r = n.writecb;
if (function(t) {
t.writing = !1,
t.writecb = null,
t.length -= t.writelen,
t.writelen = 0
}(n),
e)
!function(t, e, n, i, r) {
--e.pendingcb,
n ? (a.nextTick(r, i),
a.nextTick(S, t, e),
t._writableState.errorEmitted = !0,
t.emit("error", i)) : (r(i),
t._writableState.errorEmitted = !0,
t.emit("error", i),
S(t, e))
}(t, n, i, e, r);
else {
var o = x(n);
o || n.corked || n.bufferProcessing || !n.bufferedRequest || b(t, n),
i ? l(k, t, n, o, r) : k(t, n, o, r)
}
}(e, t)
}
,
this.writecb = null,
this.writelen = 0,
this.bufferedRequest = null,
this.lastBufferedRequest = null,
this.pendingcb = 0,
this.prefinished = !1,
this.errorEmitted = !1,
this.bufferedRequestCount = 0,
this.corkedRequestsFree = new o(this)
}
function m(t) {
if (s = s || n(12),
!(_.call(m, this) || this instanceof s))
return new m(t);
this._writableState = new v(t,this),
this.writable = !0,
t && ("function" == typeof t.write && (this._write = t.write),
"function" == typeof t.writev && (this._writev = t.writev),
"function" == typeof t.destroy && (this._destroy = t.destroy),
"function" == typeof t.final && (this._final = t.final)),
d.call(this)
}
function y(t, e, n, i, r, a, o) {
e.writelen = i,
e.writecb = o,
e.writing = !0,
e.sync = !0,
n ? t._writev(r, e.onwrite) : t._write(r, a, e.onwrite),
e.sync = !1
}
function k(t, e, n, i) {
n || function(t, e) {
0 === e.length && e.needDrain && (e.needDrain = !1,
t.emit("drain"))
}(t, e),
e.pendingcb--,
i(),
S(t, e)
}
function b(t, e) {
e.bufferProcessing = !0;
var n = e.bufferedRequest;
if (t._writev && n && n.next) {
var i = e.bufferedRequestCount
, r = new Array(i)
, a = e.corkedRequestsFree;
a.entry = n;
for (var s = 0, l = !0; n; )
r[s] = n,
n.isBuf || (l = !1),
n = n.next,
s += 1;
r.allBuffers = l,
y(t, e, !0, e.length, r, "", a.finish),
e.pendingcb++,
e.lastBufferedRequest = null,
a.next ? (e.corkedRequestsFree = a.next,
a.next = null) : e.corkedRequestsFree = new o(e),
e.bufferedRequestCount = 0
} else {
for (; n; ) {
var c = n.chunk
, u = n.encoding
, d = n.callback;
if (y(t, e, !1, e.objectMode ? 1 : c.length, c, u, d),
n = n.next,
e.bufferedRequestCount--,
e.writing)
break
}
null === n && (e.lastBufferedRequest = null)
}
e.bufferedRequest = n,
e.bufferProcessing = !1
}
function x(t) {
return t.ending && 0 === t.length && null === t.bufferedRequest && !t.finished && !t.writing
}
function w(t, e) {
t._final(function(n) {
e.pendingcb--,
n && t.emit("error", n),
e.prefinished = !0,
t.emit("prefinish"),
S(t, e)
})
}
function S(t, e) {
var n = x(e);
return n && (!function(t, e) {
e.prefinished || e.finalCalled || ("function" == typeof t._final ? (e.pendingcb++,
e.finalCalled = !0,
a.nextTick(w, t, e)) : (e.prefinished = !0,
t.emit("prefinish")))
}(t, e),
0 === e.pendingcb && (e.finished = !0,
t.emit("finish"))),
n
}
c.inherits(m, d),
v.prototype.getBuffer = function() {
for (var t = this.bufferedRequest, e = []; t; )
e.push(t),
t = t.next;
return e
}
,
function() {
try {
Object.defineProperty(v.prototype, "buffer", {
get: u.deprecate(function() {
return this.getBuffer()
}, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
})
} catch (t) {}
}(),
"function" == typeof Symbol && Symbol.hasInstance && "function" == typeof Function.prototype[Symbol.hasInstance] ? (_ = Function.prototype[Symbol.hasInstance],
Object.defineProperty(m, Symbol.hasInstance, {
value: function(t) {
return !!_.call(this, t) || this === m && (t && t._writableState instanceof v)
}
})) : _ = function(t) {
return t instanceof this
}
,
m.prototype.pipe = function() {
this.emit("error", new Error("Cannot pipe, not readable"))
}
,
m.prototype.write = function(t, e, n) {
var i = this._writableState
, r = !1
, o = !i.objectMode && function(t) {
return h.isBuffer(t) || t instanceof f
}(t);
return o && !h.isBuffer(t) && (t = function(t) {
return h.from(t)
}(t)),
"function" == typeof e && (n = e,
e = null),
o ? e = "buffer" : e || (e = i.defaultEncoding),
"function" != typeof n && (n = p),
i.ended ? function(t, e) {
var n = new Error("write after end");
t.emit("error", n),
a.nextTick(e, n)
}(this, n) : (o || function(t, e, n, i) {
var r = !0
, o = !1;
return null === n ? o = new TypeError("May not write null values to stream") : "string" == typeof n || void 0 === n || e.objectMode || (o = new TypeError("Invalid non-string/buffer chunk")),
o && (t.emit("error", o),
a.nextTick(i, o),
r = !1),
r
}(this, i, t, n)) && (i.pendingcb++,
r = function(t, e, n, i, r, a) {
if (!n) {
var o = function(t, e, n) {
t.objectMode || !1 === t.decodeStrings || "string" != typeof e || (e = h.from(e, n));
return e
}(e, i, r);
i !== o && (n = !0,
r = "buffer",
i = o)
}
var s = e.objectMode ? 1 : i.length;
e.length += s;
var l = e.length < e.highWaterMark;
l || (e.needDrain = !0);
if (e.writing || e.corked) {
var c = e.lastBufferedRequest;
e.lastBufferedRequest = {
chunk: i,
encoding: r,
isBuf: n,
callback: a,
next: null
},
c ? c.next = e.lastBufferedRequest : e.bufferedRequest = e.lastBufferedRequest,
e.bufferedRequestCount += 1
} else
y(t, e, !1, s, i, r, a);
return l
}(this, i, o, t, e, n)),
r
}
,
m.prototype.cork = function() {
this._writableState.corked++
}
,
m.prototype.uncork = function() {
var t = this._writableState;
t.corked && (t.corked--,
t.writing || t.corked || t.finished || t.bufferProcessing || !t.bufferedRequest || b(this, t))
}
,
m.prototype.setDefaultEncoding = function(t) {
if ("string" == typeof t && (t = t.toLowerCase()),
!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((t + "").toLowerCase()) > -1))
throw new TypeError("Unknown encoding: " + t);
return this._writableState.defaultEncoding = t,
this
}
,
Object.defineProperty(m.prototype, "writableHighWaterMark", {
enumerable: !1,
get: function() {
return this._writableState.highWaterMark
}
}),
m.prototype._write = function(t, e, n) {
n(new Error("_write() is not implemented"))
}
,
m.prototype._writev = null,
m.prototype.end = function(t, e, n) {
var i = this._writableState;
"function" == typeof t ? (n = t,
t = null,
e = null) : "function" == typeof e && (n = e,
e = null),
null !== t && void 0 !== t && this.write(t, e),
i.corked && (i.corked = 1,
this.uncork()),
i.ending || i.finished || function(t, e, n) {
e.ending = !0,
S(t, e),
n && (e.finished ? a.nextTick(n) : t.once("finish", n));
e.ended = !0,
t.writable = !1
}(this, i, n)
}
,
Object.defineProperty(m.prototype, "destroyed", {
get: function() {
return void 0 !== this._writableState && this._writableState.destroyed
},
set: function(t) {
this._writableState && (this._writableState.destroyed = t)
}
}),
m.prototype.destroy = g.destroy,
m.prototype._undestroy = g.undestroy,
m.prototype._destroy = function(t, e) {
this.end(),
e(t)
}
}
).call(this, n(9), n(57).setImmediate, n(4))
}
, function(t, e, n) {
"use strict";
var i = n(23);
function r(t, e) {
t.emit("error", e)
}
t.exports = {
destroy: function(t, e) {
var n = this
, a = this._readableState && this._readableState.destroyed
, o = this._writableState && this._writableState.destroyed;
return a || o ? (e ? e(t) : !t || this._writableState && this._writableState.errorEmitted || i.nextTick(r, this, t),
this) : (this._readableState && (this._readableState.destroyed = !0),
this._writableState && (this._writableState.destroyed = !0),
this._destroy(t || null, function(t) {
!e && t ? (i.nextTick(r, n, t),
n._writableState && (n._writableState.errorEmitted = !0)) : e && e(t)
}),
this)
},
undestroy: function() {
this._readableState && (this._readableState.destroyed = !1,
this._readableState.reading = !1,
this._readableState.ended = !1,
this._readableState.endEmitted = !1),
this._writableState && (this._writableState.destroyed = !1,
this._writableState.ended = !1,
this._writableState.ending = !1,
this._writableState.finished = !1,
this._writableState.errorEmitted = !1)
}
}
}
, function(t, e, n) {
t.exports = n(61).EventEmitter
}
, function(t, e) {
function n(t) {
"@babel/helpers - typeof";
return (n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
function i() {
this._events = this._events || {},
this._maxListeners = this._maxListeners || void 0
}
function r(t) {
return "function" == typeof t
}
function a(t) {
return "object" === n(t) && null !== t
}
function o(t) {
return void 0 === t
}
t.exports = i,
i.EventEmitter = i,
i.prototype._events = void 0,
i.prototype._maxListeners = void 0,
i.defaultMaxListeners = 10,
i.prototype.setMaxListeners = function(t) {
if (!function(t) {
return "number" == typeof t
}(t) || t < 0 || isNaN(t))
throw TypeError("n must be a positive number");
return this._maxListeners = t,
this
}
,
i.prototype.emit = function(t) {
var e, n, i, s, l, c;
if (this._events || (this._events = {}),
"error" === t && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
if ((e = arguments[1])instanceof Error)
throw e;
var u = new Error('Uncaught, unspecified "error" event. (' + e + ")");
throw u.context = e,
u
}
if (o(n = this._events[t]))
return !1;
if (r(n))
switch (arguments.length) {
case 1:
n.call(this);
break;
case 2:
n.call(this, arguments[1]);
break;
case 3:
n.call(this, arguments[1], arguments[2]);
break;
default:
s = Array.prototype.slice.call(arguments, 1),
n.apply(this, s)
}
else if (a(n))
for (s = Array.prototype.slice.call(arguments, 1),
i = (c = n.slice()).length,
l = 0; l < i; l++)
c[l].apply(this, s);
return !0
}
,
i.prototype.addListener = function(t, e) {
var n;
if (!r(e))
throw TypeError("listener must be a function");
return this._events || (this._events = {}),
this._events.newListener && this.emit("newListener", t, r(e.listener) ? e.listener : e),
this._events[t] ? a(this._events[t]) ? this._events[t].push(e) : this._events[t] = [this._events[t], e] : this._events[t] = e,
a(this._events[t]) && !this._events[t].warned && (n = o(this._maxListeners) ? i.defaultMaxListeners : this._maxListeners) && n > 0 && this._events[t].length > n && (this._events[t].warned = !0,
console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[t].length),
"function" == typeof console.trace && console.trace()),
this
}
,
i.prototype.on = i.prototype.addListener,
i.prototype.once = function(t, e) {
if (!r(e))
throw TypeError("listener must be a function");
var n = !1;
function i() {
this.removeListener(t, i),
n || (n = !0,
e.apply(this, arguments))
}
return i.listener = e,
this.on(t, i),
this
}
,
i.prototype.removeListener = function(t, e) {
var n, i, o, s;
if (!r(e))
throw TypeError("listener must be a function");
if (!this._events || !this._events[t])
return this;
if (o = (n = this._events[t]).length,
i = -1,
n === e || r(n.listener) && n.listener === e)
delete this._events[t],
this._events.removeListener && this.emit("removeListener", t, e);
else if (a(n)) {
for (s = o; s-- > 0; )
if (n[s] === e || n[s].listener && n[s].listener === e) {
i = s;
break
}
if (i < 0)
return this;
1 === n.length ? (n.length = 0,
delete this._events[t]) : n.splice(i, 1),
this._events.removeListener && this.emit("removeListener", t, e)
}
return this
}
,
i.prototype.removeAllListeners = function(t) {
var e, n;
if (!this._events)
return this;
if (!this._events.removeListener)
return 0 === arguments.length ? this._events = {} : this._events[t] && delete this._events[t],
this;
if (0 === arguments.length) {
for (e in this._events)
"removeListener" !== e && this.removeAllListeners(e);
return this.removeAllListeners("removeListener"),
this._events = {},
this
}
if (r(n = this._events[t]))
this.removeListener(t, n);
else if (n)
for (; n.length; )
this.removeListener(t, n[n.length - 1]);
return delete this._events[t],
this
}
,
i.prototype.listeners = function(t) {
return this._events && this._events[t] ? r(this._events[t]) ? [this._events[t]] : this._events[t].slice() : []
}
,
i.prototype.listenerCount = function(t) {
if (this._events) {
var e = this._events[t];
if (r(e))
return 1;
if (e)
return e.length
}
return 0
}
,
i.listenerCount = function(t, e) {
return t.listenerCount(e)
}
}
, function(t, e, n) {
"use strict";
(function(e, i) {
var r = n(23);
t.exports = y;
var a, o = n(67);
y.ReadableState = m;
n(61).EventEmitter;
var s = function(t, e) {
return t.listeners(e).length
}
, l = n(60)
, c = n(22).Buffer
, u = e.Uint8Array || function() {}
;
var d = n(17);
d.inherits = n(8);
var h = n(287)
, f = void 0;
f = h && h.debuglog ? h.debuglog("stream") : function() {}
;
var _, g = n(286), p = n(59);
d.inherits(y, l);
var v = ["error", "close", "destroy", "pause", "resume"];
function m(t, e) {
a = a || n(12),
t = t || {};
var i = e instanceof a;
this.objectMode = !!t.objectMode,
i && (this.objectMode = this.objectMode || !!t.readableObjectMode);
var r = t.highWaterMark
, o = t.readableHighWaterMark
, s = this.objectMode ? 16 : 16384;
this.highWaterMark = r || 0 === r ? r : i && (o || 0 === o) ? o : s,
this.highWaterMark = Math.floor(this.highWaterMark),
this.buffer = new g,
this.length = 0,
this.pipes = null,
this.pipesCount = 0,
this.flowing = null,
this.ended = !1,
this.endEmitted = !1,
this.reading = !1,
this.sync = !0,
this.needReadable = !1,
this.emittedReadable = !1,
this.readableListening = !1,
this.resumeScheduled = !1,
this.destroyed = !1,
this.defaultEncoding = t.defaultEncoding || "utf8",
this.awaitDrain = 0,
this.readingMore = !1,
this.decoder = null,
this.encoding = null,
t.encoding && (_ || (_ = n(56).StringDecoder),
this.decoder = new _(t.encoding),
this.encoding = t.encoding)
}
function y(t) {
if (a = a || n(12),
!(this instanceof y))
return new y(t);
this._readableState = new m(t,this),
this.readable = !0,
t && ("function" == typeof t.read && (this._read = t.read),
"function" == typeof t.destroy && (this._destroy = t.destroy)),
l.call(this)
}
function k(t, e, n, i, r) {
var a, o = t._readableState;
null === e ? (o.reading = !1,
function(t, e) {
if (e.ended)
return;
if (e.decoder) {
var n = e.decoder.end();
n && n.length && (e.buffer.push(n),
e.length += e.objectMode ? 1 : n.length)
}
e.ended = !0,
S(t)
}(t, o)) : (r || (a = function(t, e) {
var n;
(function(t) {
return c.isBuffer(t) || t instanceof u
}
)(e) || "string" == typeof e || void 0 === e || t.objectMode || (n = new TypeError("Invalid non-string/buffer chunk"));
return n
}(o, e)),
a ? t.emit("error", a) : o.objectMode || e && e.length > 0 ? ("string" == typeof e || o.objectMode || Object.getPrototypeOf(e) === c.prototype || (e = function(t) {
return c.from(t)
}(e)),
i ? o.endEmitted ? t.emit("error", new Error("stream.unshift() after end event")) : b(t, o, e, !0) : o.ended ? t.emit("error", new Error("stream.push() after EOF")) : (o.reading = !1,
o.decoder && !n ? (e = o.decoder.write(e),
o.objectMode || 0 !== e.length ? b(t, o, e, !1) : $(t, o)) : b(t, o, e, !1))) : i || (o.reading = !1));
return function(t) {
return !t.ended && (t.needReadable || t.length < t.highWaterMark || 0 === t.length)
}(o)
}
function b(t, e, n, i) {
e.flowing && 0 === e.length && !e.sync ? (t.emit("data", n),
t.read(0)) : (e.length += e.objectMode ? 1 : n.length,
i ? e.buffer.unshift(n) : e.buffer.push(n),
e.needReadable && S(t)),
$(t, e)
}
Object.defineProperty(y.prototype, "destroyed", {
get: function() {
return void 0 !== this._readableState && this._readableState.destroyed
},
set: function(t) {
this._readableState && (this._readableState.destroyed = t)
}
}),
y.prototype.destroy = p.destroy,
y.prototype._undestroy = p.undestroy,
y.prototype._destroy = function(t, e) {
this.push(null),
e(t)
}
,
y.prototype.push = function(t, e) {
var n, i = this._readableState;
return i.objectMode ? n = !0 : "string" == typeof t && ((e = e || i.defaultEncoding) !== i.encoding && (t = c.from(t, e),
e = ""),
n = !0),
k(this, t, e, !1, n)
}
,
y.prototype.unshift = function(t) {
return k(this, t, null, !0, !1)
}
,
y.prototype.isPaused = function() {
return !1 === this._readableState.flowing
}
,
y.prototype.setEncoding = function(t) {
return _ || (_ = n(56).StringDecoder),
this._readableState.decoder = new _(t),
this._readableState.encoding = t,
this
}
;
var x = 8388608;
function w(t, e) {
return t <= 0 || 0 === e.length && e.ended ? 0 : e.objectMode ? 1 : t != t ? e.flowing && e.length ? e.buffer.head.data.length : e.length : (t > e.highWaterMark && (e.highWaterMark = function(t) {
return t >= x ? t = x : (t--,
t |= t >>> 1,
t |= t >>> 2,
t |= t >>> 4,
t |= t >>> 8,
t |= t >>> 16,
t++),
t
}(t)),
t <= e.length ? t : e.ended ? e.length : (e.needReadable = !0,
0))
}
function S(t) {
var e = t._readableState;
e.needReadable = !1,
e.emittedReadable || (f("emitReadable", e.flowing),
e.emittedReadable = !0,
e.sync ? r.nextTick(T, t) : T(t))
}
function T(t) {
f("emit readable"),
t.emit("readable"),
D(t)
}
function $(t, e) {
e.readingMore || (e.readingMore = !0,
r.nextTick(C, t, e))
}
function C(t, e) {
for (var n = e.length; !e.reading && !e.flowing && !e.ended && e.length < e.highWaterMark && (f("maybeReadMore read 0"),
t.read(0),
n !== e.length); )
n = e.length;
e.readingMore = !1
}
function E(t) {
f("readable nexttick read 0"),
t.read(0)
}
function A(t, e) {
e.reading || (f("resume read 0"),
t.read(0)),
e.resumeScheduled = !1,
e.awaitDrain = 0,
t.emit("resume"),
D(t),
e.flowing && !e.reading && t.read(0)
}
function D(t) {
var e = t._readableState;
for (f("flow", e.flowing); e.flowing && null !== t.read(); )
;
}
function M(t, e) {
return 0 === e.length ? null : (e.objectMode ? n = e.buffer.shift() : !t || t >= e.length ? (n = e.decoder ? e.buffer.join("") : 1 === e.buffer.length ? e.buffer.head.data : e.buffer.concat(e.length),
e.buffer.clear()) : n = function(t, e, n) {
var i;
t < e.head.data.length ? (i = e.head.data.slice(0, t),
e.head.data = e.head.data.slice(t)) : i = t === e.head.data.length ? e.shift() : n ? function(t, e) {
var n = e.head
, i = 1
, r = n.data;
t -= r.length;
for (; n = n.next; ) {
var a = n.data
, o = t > a.length ? a.length : t;
if (o === a.length ? r += a : r += a.slice(0, t),
0 === (t -= o)) {
o === a.length ? (++i,
n.next ? e.head = n.next : e.head = e.tail = null) : (e.head = n,
n.data = a.slice(o));
break
}
++i
}
return e.length -= i,
r
}(t, e) : function(t, e) {
var n = c.allocUnsafe(t)
, i = e.head
, r = 1;
i.data.copy(n),
t -= i.data.length;
for (; i = i.next; ) {
var a = i.data
, o = t > a.length ? a.length : t;
if (a.copy(n, n.length - t, 0, o),
0 === (t -= o)) {
o === a.length ? (++r,
i.next ? e.head = i.next : e.head = e.tail = null) : (e.head = i,
i.data = a.slice(o));
break
}
++r
}
return e.length -= r,
n
}(t, e);
return i
}(t, e.buffer, e.decoder),
n);
var n
}
function I(t) {
var e = t._readableState;
if (e.length > 0)
throw new Error('"endReadable()" called on non-empty stream');
e.endEmitted || (e.ended = !0,
r.nextTick(P, e, t))
}
function P(t, e) {
t.endEmitted || 0 !== t.length || (t.endEmitted = !0,
e.readable = !1,
e.emit("end"))
}
function N(t, e) {
for (var n = 0, i = t.length; n < i; n++)
if (t[n] === e)
return n;
return -1
}
y.prototype.read = function(t) {
f("read", t),
t = parseInt(t, 10);
var e = this._readableState
, n = t;
if (0 !== t && (e.emittedReadable = !1),
0 === t && e.needReadable && (e.length >= e.highWaterMark || e.ended))
return f("read: emitReadable", e.length, e.ended),
0 === e.length && e.ended ? I(this) : S(this),
null;
if (0 === (t = w(t, e)) && e.ended)
return 0 === e.length && I(this),
null;
var i, r = e.needReadable;
return f("need readable", r),
(0 === e.length || e.length - t < e.highWaterMark) && f("length less than watermark", r = !0),
e.ended || e.reading ? f("reading or ended", r = !1) : r && (f("do read"),
e.reading = !0,
e.sync = !0,
0 === e.length && (e.needReadable = !0),
this._read(e.highWaterMark),
e.sync = !1,
e.reading || (t = w(n, e))),
null === (i = t > 0 ? M(t, e) : null) ? (e.needReadable = !0,
t = 0) : e.length -= t,
0 === e.length && (e.ended || (e.needReadable = !0),
n !== t && e.ended && I(this)),
null !== i && this.emit("data", i),
i
}
,
y.prototype._read = function(t) {
this.emit("error", new Error("_read() is not implemented"))
}
,
y.prototype.pipe = function(t, e) {
var n = this
, a = this._readableState;
switch (a.pipesCount) {
case 0:
a.pipes = t;
break;
case 1:
a.pipes = [a.pipes, t];
break;
default:
a.pipes.push(t)
}
a.pipesCount += 1,
f("pipe count=%d opts=%j", a.pipesCount, e);
var l = (!e || !1 !== e.end) && t !== i.stdout && t !== i.stderr ? u : y;
function c(e, i) {
f("onunpipe"),
e === n && i && !1 === i.hasUnpiped && (i.hasUnpiped = !0,
f("cleanup"),
t.removeListener("close", v),
t.removeListener("finish", m),
t.removeListener("drain", d),
t.removeListener("error", p),
t.removeListener("unpipe", c),
n.removeListener("end", u),
n.removeListener("end", y),
n.removeListener("data", g),
h = !0,
!a.awaitDrain || t._writableState && !t._writableState.needDrain || d())
}
function u() {
f("onend"),
t.end()
}
a.endEmitted ? r.nextTick(l) : n.once("end", l),
t.on("unpipe", c);
var d = function(t) {
return function() {
var e = t._readableState;
f("pipeOnDrain", e.awaitDrain),
e.awaitDrain && e.awaitDrain--,
0 === e.awaitDrain && s(t, "data") && (e.flowing = !0,
D(t))
}
}(n);
t.on("drain", d);
var h = !1;
var _ = !1;
function g(e) {
f("ondata"),
_ = !1,
!1 !== t.write(e) || _ || ((1 === a.pipesCount && a.pipes === t || a.pipesCount > 1 && -1 !== N(a.pipes, t)) && !h && (f("false write response, pause", n._readableState.awaitDrain),
n._readableState.awaitDrain++,
_ = !0),
n.pause())
}
function p(e) {
f("onerror", e),
y(),
t.removeListener("error", p),
0 === s(t, "error") && t.emit("error", e)
}
function v() {
t.removeListener("finish", m),
y()
}
function m() {
f("onfinish"),
t.removeListener("close", v),
y()
}
function y() {
f("unpipe"),
n.unpipe(t)
}
return n.on("data", g),
function(t, e, n) {
if ("function" == typeof t.prependListener)
return t.prependListener(e, n);
t._events && t._events[e] ? o(t._events[e]) ? t._events[e].unshift(n) : t._events[e] = [n, t._events[e]] : t.on(e, n)
}(t, "error", p),
t.once("close", v),
t.once("finish", m),
t.emit("pipe", n),
a.flowing || (f("pipe resume"),
n.resume()),
t
}
,
y.prototype.unpipe = function(t) {
var e = this._readableState
, n = {
hasUnpiped: !1
};
if (0 === e.pipesCount)
return this;
if (1 === e.pipesCount)
return t && t !== e.pipes ? this : (t || (t = e.pipes),
e.pipes = null,
e.pipesCount = 0,
e.flowing = !1,
t && t.emit("unpipe", this, n),
this);
if (!t) {
var i = e.pipes
, r = e.pipesCount;
e.pipes = null,
e.pipesCount = 0,
e.flowing = !1;
for (var a = 0; a < r; a++)
i[a].emit("unpipe", this, n);
return this
}
var o = N(e.pipes, t);
return -1 === o ? this : (e.pipes.splice(o, 1),
e.pipesCount -= 1,
1 === e.pipesCount && (e.pipes = e.pipes[0]),
t.emit("unpipe", this, n),
this)
}
,
y.prototype.on = function(t, e) {
var n = l.prototype.on.call(this, t, e);
if ("data" === t)
!1 !== this._readableState.flowing && this.resume();
else if ("readable" === t) {
var i = this._readableState;
i.endEmitted || i.readableListening || (i.readableListening = i.needReadable = !0,
i.emittedReadable = !1,
i.reading ? i.length && S(this) : r.nextTick(E, this))
}
return n
}
,
y.prototype.addListener = y.prototype.on,
y.prototype.resume = function() {
var t = this._readableState;
return t.flowing || (f("resume"),
t.flowing = !0,
function(t, e) {
e.resumeScheduled || (e.resumeScheduled = !0,
r.nextTick(A, t, e))
}(this, t)),
this
}
,
y.prototype.pause = function() {
return f("call pause flowing=%j", this._readableState.flowing),
!1 !== this._readableState.flowing && (f("pause"),
this._readableState.flowing = !1,
this.emit("pause")),
this
}
,
y.prototype.wrap = function(t) {
var e = this
, n = this._readableState
, i = !1;
for (var r in t.on("end", function() {
if (f("wrapped end"),
n.decoder && !n.ended) {
var t = n.decoder.end();
t && t.length && e.push(t)
}
e.push(null)
}),
t.on("data", function(r) {
(f("wrapped data"),
n.decoder && (r = n.decoder.write(r)),
!n.objectMode || null !== r && void 0 !== r) && ((n.objectMode || r && r.length) && (e.push(r) || (i = !0,
t.pause())))
}),
t)
void 0 === this[r] && "function" == typeof t[r] && (this[r] = function(e) {
return function() {
return t[e].apply(t, arguments)
}
}(r));
for (var a = 0; a < v.length; a++)
t.on(v[a], this.emit.bind(this, v[a]));
return this._read = function(e) {
f("wrapped _read", e),
i && (i = !1,
t.resume())
}
,
this
}
,
Object.defineProperty(y.prototype, "readableHighWaterMark", {
enumerable: !1,
get: function() {
return this._readableState.highWaterMark
}
}),
y._fromList = M
}
).call(this, n(4), n(9))
}
, function(t, e, n) {
(e = t.exports = n(62)).Stream = e,
e.Readable = e,
e.Writable = n(58),
e.Duplex = n(12),
e.Transform = n(55),
e.PassThrough = n(282)
}
, function(t, e, n) {
(function(t, i, r) {
var a = n(65)
, o = n(8)
, s = n(63)
, l = e.readyStates = {
UNSENT: 0,
OPENED: 1,
HEADERS_RECEIVED: 2,
LOADING: 3,
DONE: 4
}
, c = e.IncomingMessage = function(e, n, o, l) {
var c = this;
if (s.Readable.call(c),
c._mode = o,
c.headers = {},
c.rawHeaders = [],
c.trailers = {},
c.rawTrailers = [],
c.on("end", function() {
t.nextTick(function() {
c.emit("close")
})
}),
"fetch" === o) {
if (c._fetchResponse = n,
c.url = n.url,
c.statusCode = n.status,
c.statusMessage = n.statusText,
n.headers.forEach(function(t, e) {
c.headers[e.toLowerCase()] = t,
c.rawHeaders.push(e, t)
}),
a.writableStream) {
var u = new WritableStream({
write: function(t) {
return new Promise(function(e, n) {
c._destroyed ? n() : c.push(new r(t)) ? e() : c._resumeFetch = e
}
)
},
close: function() {
i.clearTimeout(l),
c._destroyed || c.push(null)
},
abort: function(t) {
c._destroyed || c.emit("error", t)
}
});
try {
return void n.body.pipeTo(u).catch(function(t) {
i.clearTimeout(l),
c._destroyed || c.emit("error", t)
})
} catch (t) {}
}
var d = n.body.getReader();
!function t() {
d.read().then(function(e) {
if (!c._destroyed) {
if (e.done)
return i.clearTimeout(l),
void c.push(null);
c.push(new r(e.value)),
t()
}
}).catch(function(t) {
i.clearTimeout(l),
c._destroyed || c.emit("error", t)
})
}()
} else {
if (c._xhr = e,
c._pos = 0,
c.url = e.responseURL,
c.statusCode = e.status,
c.statusMessage = e.statusText,
e.getAllResponseHeaders().split(/\r?\n/).forEach(function(t) {
var e = t.match(/^([^:]+):\s*(.*)/);
if (e) {
var n = e[1].toLowerCase();
"set-cookie" === n ? (void 0 === c.headers[n] && (c.headers[n] = []),
c.headers[n].push(e[2])) : void 0 !== c.headers[n] ? c.headers[n] += ", " + e[2] : c.headers[n] = e[2],
c.rawHeaders.push(e[1], e[2])
}
}),
c._charset = "x-user-defined",
!a.overrideMimeType) {
var h = c.rawHeaders["mime-type"];
if (h) {
var f = h.match(/;\s*charset=([^;])(;|$)/);
f && (c._charset = f[1].toLowerCase())
}
c._charset || (c._charset = "utf-8")
}
}
}
;
o(c, s.Readable),
c.prototype._read = function() {
var t = this._resumeFetch;
t && (this._resumeFetch = null,
t())
}
,
c.prototype._onXHRProgress = function() {
var t = this
, e = t._xhr
, n = null;
switch (t._mode) {
case "text:vbarray":
if (e.readyState !== l.DONE)
break;
try {
n = new i.VBArray(e.responseBody).toArray()
} catch (t) {}
if (null !== n) {
t.push(new r(n));
break
}
case "text":
try {
n = e.responseText
} catch (e) {
t._mode = "text:vbarray";
break
}
if (n.length > t._pos) {
var a = n.substr(t._pos);
if ("x-user-defined" === t._charset) {
for (var o = new r(a.length), s = 0; s < a.length; s++)
o[s] = 255 & a.charCodeAt(s);
t.push(o)
} else
t.push(a, t._charset);
t._pos = n.length
}
break;
case "arraybuffer":
if (e.readyState !== l.DONE || !e.response)
break;
n = e.response,
t.push(new r(new Uint8Array(n)));
break;
case "moz-chunked-arraybuffer":
if (n = e.response,
e.readyState !== l.LOADING || !n)
break;
t.push(new r(new Uint8Array(n)));
break;
case "ms-stream":
if (n = e.response,
e.readyState !== l.LOADING)
break;
var c = new i.MSStreamReader;
c.onprogress = function() {
c.result.byteLength > t._pos && (t.push(new r(new Uint8Array(c.result.slice(t._pos)))),
t._pos = c.result.byteLength)
}
,
c.onload = function() {
t.push(null)
}
,
c.readAsArrayBuffer(n)
}
t._xhr.readyState === l.DONE && "ms-stream" !== t._mode && t.push(null)
}
}
).call(this, n(9), n(4), n(13).Buffer)
}
, function(t, e, n) {
(function(t) {
e.fetch = s(t.fetch) && s(t.ReadableStream),
e.writableStream = s(t.WritableStream),
e.abortController = s(t.AbortController),
e.blobConstructor = !1;
try {
new Blob([new ArrayBuffer(1)]),
e.blobConstructor = !0
} catch (t) {}
var n;
function i() {
if (void 0 !== n)
return n;
if (t.XMLHttpRequest) {
n = new t.XMLHttpRequest;
try {
n.open("GET", t.XDomainRequest ? "/" : "https://example.com")
} catch (t) {
n = null
}
} else
n = null;
return n
}
function r(t) {
var e = i();
if (!e)
return !1;
try {
return e.responseType = t,
e.responseType === t
} catch (t) {}
return !1
}
var a = void 0 !== t.ArrayBuffer
, o = a && s(t.ArrayBuffer.prototype.slice);
function s(t) {
return "function" == typeof t
}
e.arraybuffer = e.fetch || a && r("arraybuffer"),
e.msstream = !e.fetch && o && r("ms-stream"),
e.mozchunkedarraybuffer = !e.fetch && a && r("moz-chunked-arraybuffer"),
e.overrideMimeType = e.fetch || !!i() && s(i().overrideMimeType),
e.vbArray = s(t.VBArray),
n = null
}
).call(this, n(4))
}
, function(t, e, n) {
(function(t) {
var i = n(288)
, r = n(64)
, a = n(280)
, o = n(279)
, s = n(54)
, l = e;
l.request = function(e, n) {
e = "string" == typeof e ? s.parse(e) : a(e);
var r = -1 === t.location.protocol.search(/^https?:$/) ? "http:" : ""
, o = e.protocol || r
, l = e.hostname || e.host
, c = e.port
, u = e.path || "/";
l && -1 !== l.indexOf(":") && (l = "[" + l + "]"),
e.url = (l ? o + "//" + l : "") + (c ? ":" + c : "") + u,
e.method = (e.method || "GET").toUpperCase(),
e.headers = e.headers || {};
var d = new i(e);
return n && d.on("response", n),
d
}
,
l.get = function(t, e) {
var n = l.request(t, e);
return n.end(),
n
}
,
l.ClientRequest = i,
l.IncomingMessage = r.IncomingMessage,
l.Agent = function() {}
,
l.Agent.defaultMaxSockets = 4,
l.globalAgent = new l.Agent,
l.STATUS_CODES = o,
l.METHODS = ["CHECKOUT", "CONNECT", "COPY", "DELETE", "GET", "HEAD", "LOCK", "M-SEARCH", "MERGE", "MKACTIVITY", "MKCOL", "MOVE", "NOTIFY", "OPTIONS", "PATCH", "POST", "PROPFIND", "PROPPATCH", "PURGE", "PUT", "REPORT", "SEARCH", "SUBSCRIBE", "TRACE", "UNLOCK", "UNSUBSCRIBE"]
}
).call(this, n(4))
}
, function(t, e) {
var n = {}.toString;
t.exports = Array.isArray || function(t) {
return "[object Array]" == n.call(t)
}
}
, function(t, e) {
t.exports = function(t) {
var e = new RegExp("<(?:.|\n)*?>","gm")
, n = new RegExp(" +","gm");
function i(t) {
return (t + "").replace(e, " ").replace(n, " ")
}
var r = new RegExp("'","gm");
function a(t) {
return (t + "").replace(r, "'")
}
for (var o in t._waiAria = {
getAttributeString: function(t) {
var e = [" "];
for (var n in t) {
var r = a(i(t[n]));
e.push(n + "='" + r + "'")
}
return e.push(" "),
e.join(" ")
},
getTimelineCellAttr: function(e) {
return t._waiAria.getAttributeString({
"aria-label": e
})
},
_taskCommonAttr: function(e, n) {
e.start_date && e.end_date && (n.setAttribute("aria-label", i(t.templates.tooltip_text(e.start_date, e.end_date, e))),
e.$dataprocessor_class && n.setAttribute("aria-busy", !0))
},
setTaskBarAttr: function(e, n) {
this._taskCommonAttr(e, n),
n.setAttribute("role", "img"),
!t.isReadonly(e) && t.config.drag_move && (e.id != t.getState("tasksDnd").drag_id ? n.setAttribute("aria-grabbed", !1) : n.setAttribute("aria-grabbed", !0))
},
taskRowAttr: function(e, n) {
this._taskCommonAttr(e, n),
!t.isReadonly(e) && t.config.order_branch && n.setAttribute("aria-grabbed", !1),
n.setAttribute("role", "row"),
n.setAttribute("aria-selected", t.isSelectedTask(e.id) ? "true" : "false"),
n.setAttribute("aria-level", e.$level + 1 || 1),
t.hasChild(e.id) && n.setAttribute("aria-expanded", e.$open ? "true" : "false")
},
linkAttr: function(e, n) {
var r = t.config.links
, a = e.type == r.finish_to_start || e.type == r.start_to_start
, o = e.type == r.start_to_start || e.type == r.start_to_finish
, s = t.locale.labels.link + " " + t.templates.drag_link(e.source, o, e.target, a);
n.setAttribute("role", "img"),
n.setAttribute("aria-label", i(s)),
t.isReadonly(e) && n.setAttribute("aria-readonly", !0)
},
gridSeparatorAttr: function(t) {
t.setAttribute("role", "columnheader")
},
rowResizerAttr: function(t) {
t.setAttribute("role", "row")
},
lightboxHiddenAttr: function(t) {
t.setAttribute("aria-hidden", "true")
},
lightboxVisibleAttr: function(t) {
t.setAttribute("aria-hidden", "false")
},
lightboxAttr: function(t) {
t.setAttribute("role", "dialog"),
t.setAttribute("aria-hidden", "true"),
t.firstChild.setAttribute("role", "heading"),
t.firstChild.setAttribute("aria-level", "1")
},
lightboxButtonAttrString: function(e) {
return this.getAttributeString({
role: "button",
"aria-label": t.locale.labels[e],
tabindex: "0"
})
},
lightboxHeader: function(t, e) {
t.setAttribute("aria-label", e)
},
lightboxSelectAttrString: function(e) {
var n = "";
switch (e) {
case "%Y":
n = t.locale.labels.years;
break;
case "%m":
n = t.locale.labels.months;
break;
case "%d":
n = t.locale.labels.days;
break;
case "%H:%i":
n = t.locale.labels.hours + t.locale.labels.minutes
}
return t._waiAria.getAttributeString({
"aria-label": n
})
},
lightboxDurationInputAttrString: function(e) {
return this.getAttributeString({
"aria-label": t.locale.labels.column_duration,
"aria-valuemin": "0",
role: "spinbutton"
})
},
inlineEditorAttr: function(t) {
t.setAttribute("role", "row")
},
gridAttrString: function() {
return [" role='treegrid'", t.config.multiselect ? "aria-multiselectable='true'" : "aria-multiselectable='false'", " "].join(" ")
},
gridScaleRowAttrString: function() {
return "role='row'"
},
gridScaleCellAttrString: function(e, n) {
var i = "";
if ("add" == e.name)
i = this.getAttributeString({
role: "columnheader",
"aria-label": t.locale.labels.new_task
});
else {
var r = {
role: "columnheader",
"aria-label": n
};
t._sort && t._sort.name == e.name && ("asc" == t._sort.direction ? r["aria-sort"] = "ascending" : r["aria-sort"] = "descending"),
i = this.getAttributeString(r)
}
return i
},
gridDataAttrString: function() {
return "role='rowgroup'"
},
reorderMarkerAttr: function(t) {
t.setAttribute("role", "grid"),
t.firstChild.removeAttribute("aria-level"),
t.firstChild.setAttribute("aria-grabbed", "true")
},
gridCellAttrString: function(e, n, i) {
var r = {
role: "gridcell",
"aria-label": n
};
return e.editor && !t.isReadonly(i) || (r["aria-readonly"] = !0),
this.getAttributeString(r)
},
gridAddButtonAttrString: function(e) {
return this.getAttributeString({
role: "button",
"aria-label": t.locale.labels.new_task
})
},
messageButtonAttrString: function(t) {
return "tabindex='0' role='button' aria-label='" + t + "'"
},
messageInfoAttr: function(t) {
t.setAttribute("role", "alert")
},
messageModalAttr: function(t, e) {
t.setAttribute("role", "dialog"),
e && t.setAttribute("aria-labelledby", e)
},
quickInfoAttr: function(t) {
t.setAttribute("role", "dialog")
},
quickInfoHeaderAttrString: function() {
return " role='heading' aria-level='1' "
},
quickInfoHeader: function(t, e) {
t.setAttribute("aria-label", e)
},
quickInfoButtonAttrString: function(e) {
return t._waiAria.getAttributeString({
role: "button",
"aria-label": e,
tabindex: "0"
})
},
tooltipAttr: function(t) {
t.setAttribute("role", "tooltip")
},
tooltipVisibleAttr: function(t) {
t.setAttribute("aria-hidden", "false")
},
tooltipHiddenAttr: function(t) {
t.setAttribute("aria-hidden", "true")
}
},
t._waiAria)
t._waiAria[o] = function(e) {
return function() {
return t.config.wai_aria_attributes ? e.apply(this, arguments) : ""
}
}(t._waiAria[o])
}
}
, function(t, e) {
t.exports = function(t) {
t._extend_to_optional = function(e) {
var n = e
, i = {
render: n.render,
focus: n.focus,
set_value: function(e, r, a, o) {
var s = t._resolve_default_mapping(o);
if (!a[s.start_date] || "start_date" == s.start_date && this._isAllowedUnscheduledTask(a)) {
i.disable(e, o);
var l = {};
for (var c in s)
l[s[c]] = a[c];
return n.set_value.call(t, e, r, l, o)
}
return i.enable(e, o),
n.set_value.call(t, e, r, a, o)
},
get_value: function(e, i, r) {
return r.disabled ? {
start_date: null
} : n.get_value.call(t, e, i, r)
},
update_block: function(e, n) {
if (t.callEvent("onSectionToggle", [t._lightbox_id, n]),
e.style.display = n.disabled ? "none" : "block",
n.button) {
var i = e.previousSibling.querySelector(".gantt_custom_button_label")
, r = t.locale.labels
, a = n.disabled ? r[n.name + "_enable_button"] : r[n.name + "_disable_button"];
i.innerHTML = a
}
t.resizeLightbox()
},
disable: function(t, e) {
e.disabled = !0,
i.update_block(t, e)
},
enable: function(t, e) {
e.disabled = !1,
i.update_block(t, e)
},
button_click: function(e, n, r, a) {
if (!1 !== t.callEvent("onSectionButton", [t._lightbox_id, r])) {
var o = t._get_typed_lightbox_config()[e];
o.disabled ? i.enable(a, o) : i.disable(a, o)
}
}
};
return i
}
,
t.form_blocks.duration_optional = t._extend_to_optional(t.form_blocks.duration),
t.form_blocks.time_optional = t._extend_to_optional(t.form_blocks.time)
}
}
, function(t, e, n) {
var i = n(3);
t.exports = function(t) {
var e = n(18)(t);
function r() {
return e.apply(this, arguments) || this
}
return i(r, e),
r.prototype.render = function(n) {
var i = t.config.types
, r = t.locale.labels
, a = []
, o = n.filter || function(t, e) {
return !i.placeholder || e !== i.placeholder
}
;
for (var s in i)
!1 == !o(s, i[s]) && a.push({
key: i[s],
label: r["type_" + s]
});
n.options = a;
var l = n.onchange;
return n.onchange = function() {
t.changeLightboxType(this.value),
this.value === t.config.types.task && (t._lightbox_new_type = "task"),
"function" == typeof l && l.apply(this, arguments)
}
,
e.prototype.render.apply(this, arguments)
}
,
r
}
}
, function(t, e, n) {
var i = n(3)
, r = n(36);
t.exports = function(t) {
var e = n(7)(t);
function a() {
return e.apply(this, arguments) || this
}
function o(e) {
return !e || e === t.config.constraint_types.ASAP || e === t.config.constraint_types.ALAP
}
function s(t, e) {
for (var n = o(e), i = 0; i < t.length; i++)
t[i].disabled = n
}
return i(a, e),
a.prototype.render = function(e) {
var n = (e.height || 30) + "px"
, i = "
"
, a = [];
for (var o in t.config.constraint_types)
a.push({
key: t.config.constraint_types[o],
label: t.locale.labels[t.config.constraint_types[o]]
});
return e.options = e.options || a,
i += "" + r.getHtmlSelect(e.options, [{
key: "data-type",
value: "constraint-type"
}]) + "",
i += "",
i += "
"
}
,
a.prototype.set_value = function(e, n, i, r) {
var a = e.querySelector("[data-constraint-type-select] select")
, o = e.querySelectorAll("[data-constraint-time-select] select")
, l = r._time_format_order
, c = t._resolve_default_mapping(r);
a._eventsInitialized || (a.addEventListener("change", function(t) {
s(o, t.target.value)
}),
a._eventsInitialized = !0);
var u = i[c.constraint_date] || new Date;
t.form_blocks._fill_lightbox_select(o, 0, u, l, r);
var d = i[c.constraint_type] || t.getConstraintType(i);
a.value = d,
s(o, d)
}
,
a.prototype.get_value = function(e, n, i) {
var r = e.querySelector("[data-constraint-type-select] select")
, a = e.querySelectorAll("[data-constraint-time-select] select")
, s = r.value
, l = null;
return o(s) || (l = t.form_blocks.getTimePickerValue(a, i)),
{
constraint_type: s,
constraint_date: l
}
}
,
a.prototype.focus = function(e) {
t._focus(e.querySelector("select"))
}
,
a
}
}
, function(t, e, n) {
var i = n(3);
t.exports = function(t) {
var e = n(18)(t);
function r() {
return e.apply(this, arguments) || this
}
function a(e, n) {
var i = []
, r = [];
n && (i = t.getTaskByTime(),
e.allow_root && i.unshift({
id: t.config.root_id,
text: e.root_label || ""
}),
i = function(e, n, i) {
var r = n.filter || function() {
return !0
}
;
e = e.slice(0);
for (var a = 0; a < e.length; a++) {
var o = e[a];
(o.id == i || t.isChildOf(o.id, i) || !1 === r(o.id, o)) && (e.splice(a, 1),
a--)
}
return e
}(i, e, n),
e.sort && i.sort(e.sort));
for (var a = e.template || t.templates.task_text, o = 0; o < i.length; o++) {
var s = a.apply(t, [i[o].start_date, i[o].end_date, i[o]]);
void 0 === s && (s = ""),
r.push({
key: i[o].id,
label: s
})
}
return e.options = r,
e.map_to = e.map_to || "parent",
t.form_blocks.select.render.apply(this, arguments)
}
return i(r, e),
r.prototype.render = function(t) {
return a(t, !1)
}
,
r.prototype.set_value = function(e, n, i, r) {
0 === n && (n = "0");
var o = document.createElement("div");
o.innerHTML = a(r, i.id);
var s = o.removeChild(o.firstChild);
return e.onselect = null,
e.parentNode.replaceChild(s, e),
t.form_blocks.select.set_value.apply(t, [s, n, i, r])
}
,
r
}
}
, function(t, e, n) {
var i = n(3)
, r = n(44).default;
t.exports = function(t) {
var e = n(7)(t);
function a() {
return e.apply(this, arguments) || this
}
function o(t) {
return t.formatter || new r
}
function s(e, n) {
var i = e.getElementsByTagName("select")
, r = n._time_format_order
, a = 0
, o = 0;
if (t.defined(r[3])) {
var s = i[r[3]]
, l = parseInt(s.value, 10);
isNaN(l) && s.hasAttribute("data-value") && (l = parseInt(s.getAttribute("data-value"), 10)),
a = Math.floor(l / 60),
o = l % 60
}
return new Date(i[r[2]].value,i[r[1]].value,i[r[0]].value,a,o)
}
function l(t, e) {
var n = t.getElementsByTagName("input")[1];
return (n = o(e).parse(n.value)) && !window.isNaN(n) || (n = 1),
n < 0 && (n *= -1),
n
}
return i(a, e),
a.prototype.render = function(e) {
var n = "
" + t.form_blocks.getTimePicker.call(this, e) + "
"
, i = " " + t.locale.labels[t.config.duration_unit + "s"] + " "
, r = e.single_date ? " style='display:none'" : ""
, a = e.readonly ? " disabled='disabled'" : ""
, o = t._waiAria.lightboxDurationInputAttrString(e)
, s = "gantt_duration_value";
e.formatter && (i = "",
s += " gantt_duration_value_formatted");
var l = "
" + i + "
";
return "
" + n + " " + l + "
"
}
,
a.prototype.set_value = function(e, n, i, r) {
var a, c, u, d, h = e.getElementsByTagName("select"), f = e.getElementsByTagName("input"), _ = f[1], g = [f[0], f[2]], p = e.getElementsByTagName("span")[0], v = r._time_format_order;
function m() {
var n = s.call(t, e, r)
, a = l.call(t, e, r)
, o = t.calculateEndDate({
start_date: n,
duration: a,
task: i
})
, c = t.templates.task_end_date || t.templates.task_date;
p.innerHTML = c(o)
}
function y(t) {
var e = _.value;
e = o(r).parse(e),
window.isNaN(e) && (e = 0),
(e += t) < 1 && (e = 1),
_.value = o(r).format(e),
m()
}
g[0].onclick = t.bind(function() {
y(-1 * t.config.duration_step)
}, this),
g[1].onclick = t.bind(function() {
y(1 * t.config.duration_step)
}, this),
h[0].onchange = m,
h[1].onchange = m,
h[2].onchange = m,
h[3] && (h[3].onchange = m),
_.onkeydown = t.bind(function(e) {
var n;
return (n = (e = e || window.event).charCode || e.keyCode || e.which) == t.constants.KEY_CODES.DOWN ? (y(-1 * t.config.duration_step),
!1) : n == t.constants.KEY_CODES.UP ? (y(1 * t.config.duration_step),
!1) : void window.setTimeout(m, 1)
}, this),
_.onchange = t.bind(m, this),
"string" == typeof (a = t._resolve_default_mapping(r)) && (a = {
start_date: a
}),
c = i[a.start_date] || new Date,
u = i[a.end_date] || t.calculateEndDate({
start_date: c,
duration: 1,
task: i
}),
d = Math.round(i[a.duration]) || t.calculateDuration({
start_date: c,
end_date: u,
task: i
}),
d = o(r).format(d),
t.form_blocks._fill_lightbox_select(h, 0, c, v, r),
_.value = d,
m()
}
,
a.prototype.get_value = function(e, n, i) {
var r = s(e, i)
, a = l(e, i)
, o = t.calculateEndDate({
start_date: r,
duration: a,
task: n
});
return "string" == typeof t._resolve_default_mapping(i) ? r : {
start_date: r,
end_date: o,
duration: a
}
}
,
a.prototype.focus = function(e) {
t._focus(e.getElementsByTagName("select")[0])
}
,
a
}
}
, function(t, e, n) {
var i = n(3);
t.exports = function(t) {
var e = n(7)(t);
function r() {
return e.apply(this, arguments) || this
}
return i(r, e),
r.prototype.render = function(t) {
var e = "
";
if (t.options && t.options.length)
for (var n = 0; n < t.options.length; n++)
e += "";
return e += "
"
}
,
r.prototype.set_value = function(t, e, n, i) {
var r;
i.options && i.options.length && (r = t.querySelector("input[type=radio][value='" + e + "']") || t.querySelector("input[type=radio][value='" + i.default_value + "']")) && (!t._dhx_onchange && i.onchange && (t.onchange = i.onchange,
t._dhx_onchange = !0),
r.checked = !0)
}
,
r.prototype.get_value = function(t, e) {
var n = t.querySelector("input[type=radio]:checked");
return n ? n.value : ""
}
,
r.prototype.focus = function(e) {
t._focus(e.querySelector("input[type=radio]"))
}
,
r
}
}
, function(t, e, n) {
var i = n(2)
, r = n(3);
t.exports = function(t) {
var e = n(7)(t);
function a() {
return e.apply(this, arguments) || this
}
return r(a, e),
a.prototype.render = function(t) {
var e = "
";
if (t.options && t.options.length)
for (var n = 0; n < t.options.length; n++)
e += "";
else
t.single_value = !0,
e += "";
return e += "
"
}
,
a.prototype.set_value = function(t, e, n, r) {
var a = Array.prototype.slice.call(t.querySelectorAll("input[type=checkbox]"));
(!t._dhx_onchange && r.onchange && (t.onchange = r.onchange,
t._dhx_onchange = !0),
r.single_value) ? a[0].checked = !!e : i.forEach(a, function(t) {
t.checked = !!e && e.indexOf(t.value) >= 0
})
}
,
a.prototype.get_value = function(t, e, n) {
return n.single_value ? t.querySelector("input[type=checkbox]").checked : i.arrayMap(Array.prototype.slice.call(t.querySelectorAll("input[type=checkbox]:checked")), function(t) {
return t.value
})
}
,
a.prototype.focus = function(e) {
t._focus(e.querySelector("input[type=checkbox]"))
}
,
a
}
}
, function(t, e, n) {
var i = n(3);
t.exports = function(t) {
var e = n(7)(t);
function r() {
return e.apply(this, arguments) || this
}
return i(r, e),
r.prototype.render = function(e) {
var n = t.form_blocks.getTimePicker.call(this, e)
, i = "
";
return i += n,
e.single_date ? (n = t.form_blocks.getTimePicker.call(this, e, !0),
i += "") : i += " – ",
i += n,
i += "
"
}
,
r.prototype.set_value = function(e, n, i, r) {
var a = r
, o = e.getElementsByTagName("select")
, s = r._time_format_order;
if (a.auto_end_date)
for (var l = function() {
d = new Date(o[s[2]].value,o[s[1]].value,o[s[0]].value,0,0),
h = t.calculateEndDate({
start_date: d,
duration: 1,
task: i
}),
t.form_blocks._fill_lightbox_select(o, s.size, h, s, a)
}, c = 0; c < 4; c++)
o[c].onchange = l;
var u = t._resolve_default_mapping(r);
"string" == typeof u && (u = {
start_date: u
});
var d = i[u.start_date] || new Date
, h = i[u.end_date] || t.calculateEndDate({
start_date: d,
duration: 1,
task: i
});
t.form_blocks._fill_lightbox_select(o, 0, d, s, a),
t.form_blocks._fill_lightbox_select(o, s.size, h, s, a)
}
,
r.prototype.get_value = function(e, n, i) {
var r, a = e.getElementsByTagName("select"), o = i._time_format_order;
return r = t.form_blocks.getTimePickerValue(a, i),
"string" == typeof t._resolve_default_mapping(i) ? r : {
start_date: r,
end_date: function(e, n, r) {
var a = t.form_blocks.getTimePickerValue(e, i, n.size);
return a <= r && (!1 !== i.autofix_end || i.single_date) ? t.date.add(r, t._get_timepicker_step(), "minute") : a
}(a, o, r)
}
}
,
r.prototype.focus = function(e) {
t._focus(e.getElementsByTagName("select")[0])
}
,
r
}
}
, function(t, e, n) {
var i = n(3);
t.exports = function(t) {
var e = n(7)(t);
function r() {
return e.apply(this, arguments) || this
}
return i(r, e),
r.prototype.render = function(t) {
return ""
}
,
r.prototype.set_value = function(e, n) {
t.form_blocks.textarea._get_input(e).value = n || ""
}
,
r.prototype.get_value = function(e) {
return t.form_blocks.textarea._get_input(e).value
}
,
r.prototype.focus = function(e) {
var n = t.form_blocks.textarea._get_input(e);
t._focus(n, !0)
}
,
r.prototype._get_input = function(t) {
return t.querySelector("textarea")
}
,
r
}
}
, function(t, e, n) {
var i = n(3);
t.exports = function(t) {
var e = n(7)(t);
function r() {
return e.apply(this, arguments) || this
}
return i(r, e),
r.prototype.render = function(t) {
return ""
}
,
r.prototype.set_value = function(t, e) {
t.innerHTML = e || ""
}
,
r.prototype.get_value = function(t) {
return t.innerHTML || ""
}
,
r.prototype.focus = function() {}
,
r
}
}
, function(t, e, n) {
function i(t) {
"@babel/helpers - typeof";
return (i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
t.exports = function(t) {
var e = n(1)
, r = n(2)
, a = n(78)(t)
, o = n(77)(t)
, s = n(76)(t)
, l = n(18)(t)
, c = n(75)(t)
, u = n(74)(t)
, d = n(73)(t)
, h = n(72)(t)
, f = n(18)(t)
, _ = n(71)(t)
, g = n(70)(t);
function p(e, n) {
var i, r, a = "";
for (r = 0; r < e.length; r++)
i = t.config._migrate_buttons[e[r]] ? t.config._migrate_buttons[e[r]] : e[r],
a += "
" + t.locale.labels[i] + "
";
return a
}
function v(e, n, i) {
var r, a, o, s, l, c, u = "";
switch (i.timeFormat[n]) {
case "%Y":
for (e._time_format_order[2] = n,
e._time_format_order.size++,
e.year_range && (isNaN(e.year_range) ? e.year_range.push && (o = e.year_range[0],
s = e.year_range[1]) : r = e.year_range),
r = r || 10,
a = a || Math.floor(r / 2),
o = o || i.date.getFullYear() - a,
s = s || t.getState().max_date.getFullYear() + a,
l = o; l < s; l++)
u += "";
break;
case "%m":
for (e._time_format_order[1] = n,
e._time_format_order.size++,
l = 0; l < 12; l++)
u += "";
break;
case "%d":
for (e._time_format_order[0] = n,
e._time_format_order.size++,
l = 1; l < 32; l++)
u += "";
break;
case "%H:%i":
for (e._time_format_order[3] = n,
e._time_format_order.size++,
l = i.first,
c = i.date.getDate(),
e._time_values = []; l < i.last; )
u += "",
e._time_values.push(l),
i.date.setTime(i.date.valueOf() + 60 * t._get_timepicker_step() * 1e3),
l = 24 * (i.date.getDate() != c ? 1 : 0) * 60 + 60 * i.date.getHours() + i.date.getMinutes()
}
return u
}
t._lightbox_methods = {},
t._lightbox_template = "
",
t._lightbox_root = t.$root,
t.$services.getService("state").registerProvider("lightbox", function() {
return {
lightbox: t._lightbox_id
}
}),
t.showLightbox = function(t) {
if (this.callEvent("onBeforeLightbox", [t])) {
var e = this.getTask(t)
, n = this.getLightbox(this.getTaskType(e.type));
this._center_lightbox(n),
this.showCover(),
this._fill_lightbox(t, n),
this._waiAria.lightboxVisibleAttr(n),
this.callEvent("onLightbox", [t])
}
}
,
t._get_timepicker_step = function() {
if (this.config.round_dnd_dates) {
var e;
if (function(t) {
var e = t.$ui.getView("timeline");
return !(!e || !e.isVisible())
}(this)) {
var n = t.getScale();
e = r.getSecondsInUnit(n.unit) * n.step / 60
}
return (!e || e >= 1440) && (e = this.config.time_step),
e
}
return this.config.time_step
}
,
t.getLabel = function(t, e) {
for (var n = this._get_typed_lightbox_config(), i = 0; i < n.length; i++)
if (n[i].map_to == t)
for (var r = n[i].options, a = 0; a < r.length; a++)
if (r[a].key == e)
return r[a].label;
return ""
}
,
t.updateCollection = function(e, n) {
n = n.slice(0);
var i = t.serverList(e);
if (!i)
return !1;
i.splice(0, i.length),
i.push.apply(i, n || []),
t.resetLightbox()
}
,
t.getLightboxType = function() {
return this.getTaskType(this._lightbox_type)
}
,
t.getLightbox = function(e) {
var n, i, r, a, o, s = "";
if (function() {
var e = !0 === t.config.csp
, n = !!window.Sfdc || !!window.$A || window.Aura || "$shadowResolver$"in document.body;
t._lightbox_root = e || n ? t.$root : document.body
}(),
void 0 === e && (e = this.getLightboxType()),
!this._lightbox || this.getLightboxType() != this.getTaskType(e)) {
this._lightbox_type = this.getTaskType(e),
n = document.createElement("div"),
s = "gantt_cal_light",
i = this._is_lightbox_timepicker(),
(t.config.wide_form || i) && (s += " gantt_cal_light_wide"),
i && (t.config.wide_form = !0,
s += " gantt_cal_light_full"),
n.className = s,
n.style.visibility = "hidden",
r = this._lightbox_template,
r += p(this.config.buttons_left),
r += p(this.config.buttons_right, !0),
n.innerHTML = r,
t._waiAria.lightboxAttr(n),
t.config.drag_lightbox && (n.firstChild.onmousedown = t._ready_to_dnd,
n.firstChild.onselectstart = function() {
return !1
}
,
n.firstChild.style.cursor = "pointer",
t._init_dnd_events()),
this._lightbox && this.resetLightbox(),
t._lightbox_root.insertBefore(n, t._lightbox_root.firstChild),
this._lightbox = n,
a = this._get_typed_lightbox_config(e),
r = this._render_sections(a);
var l = (o = n.querySelector("div.gantt_cal_larea")).style.overflow;
o.style.overflow = "hidden",
o.innerHTML = r,
function(e) {
var n, i, r, a, o, s;
for (s = 0; s < e.length; s++)
n = e[s],
r = t._lightbox_root.querySelector("#" + n.id),
n.id && r && (i = r.querySelector("label"),
(a = r.nextSibling) && (o = a.querySelector("input, select, textarea")) && (o.id = o.id || "input_" + t.uid(),
n.inputId = o.id,
i.setAttribute("for", n.inputId)))
}(a),
this.resizeLightbox(),
o.style.overflow = l,
this._init_lightbox_events(this),
n.style.display = "none",
n.style.visibility = "visible"
}
return this._lightbox
}
,
t._render_sections = function(t) {
for (var e = "", n = 0; n < t.length; n++) {
var i = this.form_blocks[t[n].type];
if (i) {
t[n].id = "area_" + this.uid();
var r = t[n].hidden ? " style='display:none'" : ""
, a = "";
t[n].button && (a = "
";
t.innerHTML = a
}
function m() {
o = s = r = null,
a = !0
}
function y(n, i, r, a) {
var o = function() {
_._direction && _._direction.parentNode || (_._direction = document.createElement("div"),
t.$task_links.appendChild(_._direction));
return _._direction
}()
, s = u()
, l = ["gantt_link_direction"];
e.templates.link_direction_class && l.push(e.templates.link_direction_class(s.link_source_id, s.link_from_start, s.link_target_id, s.link_to_start));
var c = Math.sqrt(Math.pow(r - n, 2) + Math.pow(a - i, 2));
if (c = Math.max(0, c - 3)) {
o.className = l.join(" ");
var d = (a - i) / (r - n)
, h = Math.atan(d);
2 == k(n, r, i, a) ? h += Math.PI : 3 == k(n, r, i, a) && (h -= Math.PI);
var f = Math.sin(h)
, g = Math.cos(h)
, p = Math.round(i)
, v = Math.round(n)
, m = ["-webkit-transform: rotate(" + h + "rad)", "-moz-transform: rotate(" + h + "rad)", "-ms-transform: rotate(" + h + "rad)", "-o-transform: rotate(" + h + "rad)", "transform: rotate(" + h + "rad)", "width:" + Math.round(c) + "px"];
if (-1 != window.navigator.userAgent.indexOf("MSIE 8.0")) {
m.push('-ms-filter: "' + function(t, e) {
return "progid:DXImageTransform.Microsoft.Matrix(M11 = " + e + ",M12 = -" + t + ",M21 = " + t + ",M22 = " + e + ",SizingMethod = 'auto expand')"
}(f, g) + '"');
var y = Math.abs(Math.round(n - r))
, b = Math.abs(Math.round(a - i));
switch (k(n, r, i, a)) {
case 1:
p -= b;
break;
case 2:
v -= y,
p -= b;
break;
case 3:
v -= y
}
}
m.push("top:" + p + "px"),
m.push("left:" + v + "px"),
o.style.cssText = m.join(";")
}
}
function k(t, e, n, i) {
return e >= t ? i <= n ? 1 : 4 : i <= n ? 2 : 3
}
_.attachEvent("onBeforeDragStart", e.bind(function(n, r) {
var a = r.target || r.srcElement;
if (m(),
e.getState("tasksDnd").drag_id)
return !1;
if (i.locateClassName(a, "gantt_link_point")) {
i.locateClassName(a, "task_start_date") && (s = !0);
var l = e.locate(r);
o = l;
var c = e.getTask(l);
if (e.isReadonly(c))
return m(),
!1;
return this._dir_start = g(c, !!s, 0, t.$getConfig(), !0),
!0
}
return !1
}, this)),
_.attachEvent("onAfterDragStart", e.bind(function(t, n) {
e.config.touch && e.refreshData(),
v(_.config.marker)
}, this)),
_.attachEvent("onDragMove", e.bind(function(o, s) {
var l = _.config
, c = p(s, l.marker);
!function(t, e) {
t.style.left = e.x + "px",
t.style.top = e.y + "px"
}(l.marker, c);
var u = !!i.locateClassName(s, "gantt_link_control")
, d = r
, h = n
, f = a
, m = e.locate(s)
, k = !0
, b = i.getTargetNode(s);
if (i.isChildOf(b, e.$root) || (u = !1,
m = null),
u && (k = !i.locateClassName(s, "task_end_date"),
u = !!m),
r = m,
n = u,
a = k,
u) {
var x = e.getTask(m)
, w = t.$getConfig()
, S = i.locateClassName(s, "gantt_link_control")
, T = 0;
S && (T = Math.floor(S.offsetWidth / 2)),
this._dir_end = g(x, !!a, T, w)
} else
this._dir_end = i.getRelativeEventPosition(s, t.$task_data),
e.env.isEdge && (this._dir_end.y += window.scrollY);
var $ = !(h == u && d == m && f == k);
return $ && (d && e.refreshTask(d, !1),
m && e.refreshTask(m, !1)),
$ && v(l.marker),
y(this._dir_start.x, this._dir_start.y, this._dir_end.x, this._dir_end.y),
!0
}, this)),
_.attachEvent("onDragEnd", e.bind(function() {
var t = u();
if (t.link_source_id && t.link_target_id && t.link_source_id != t.link_target_id) {
var n = e._get_link_type(t.link_from_start, t.link_to_start)
, i = {
source: t.link_source_id,
target: t.link_target_id,
type: n
};
i.type && e.isLinkAllowed(i) && e.callEvent("onLinkCreated", [i]) && e.addLink(i)
}
m(),
e.config.touch ? e.refreshData() : (t.link_source_id && e.refreshTask(t.link_source_id, !1),
t.link_target_id && e.refreshTask(t.link_target_id, !1)),
_._direction && (_._direction.parentNode && _._direction.parentNode.removeChild(_._direction),
_._direction = null)
}, this)),
e.attachEvent("onGanttRender", e.bind(function() {
_._direction && y(this._dir_start.x, this._dir_start.y, this._dir_end.x, this._dir_end.y)
}, this))
};
t.exports = {
createLinkDND: function() {
return {
init: r
}
}
}
}
, function(t, e, n) {
var i = n(1)
, r = n(0)
, a = n(50)
, o = n(2);
t.exports = {
createTaskDND: function() {
var t;
return {
extend: function(e) {
e.roundTaskDates = function(e) {
t.round_task_dates(e)
}
},
init: function(e, n) {
return t = function(t, e) {
var n = e.$services;
return {
drag: null,
dragMultiple: {},
_events: {
before_start: {},
before_finish: {},
after_finish: {}
},
_handlers: {},
init: function() {
this._domEvents = e._createDomEventScope(),
this.clear_drag_state();
var t = e.config.drag_mode;
this.set_actions(),
n.getService("state").registerProvider("tasksDnd", r.bind(function() {
return {
drag_id: this.drag ? this.drag.id : void 0,
drag_mode: this.drag ? this.drag.mode : void 0,
drag_from_start: this.drag ? this.drag.left : void 0
}
}, this));
var i = {
before_start: "onBeforeTaskDrag",
before_finish: "onBeforeTaskChanged",
after_finish: "onAfterTaskDrag"
};
for (var a in this._events)
for (var o in t)
this._events[a][o] = i[a];
this._handlers[t.move] = this._move,
this._handlers[t.resize] = this._resize,
this._handlers[t.progress] = this._resize_progress
},
set_actions: function() {
var n = t.$task_data;
this._domEvents.attach(n, "mousemove", e.bind(function(t) {
this.on_mouse_move(t)
}, this)),
this._domEvents.attach(n, "mousedown", e.bind(function(t) {
this.on_mouse_down(t)
}, this)),
this._domEvents.attach(document.body, "mouseup", e.bind(function(t) {
this.on_mouse_up(t)
}, this))
},
clear_drag_state: function() {
this.drag = {
id: null,
mode: null,
pos: null,
start_x: null,
start_y: null,
obj: null,
left: null
},
this.dragMultiple = {}
},
_resize: function(n, i, r) {
var a = t.$getConfig()
, o = this._drag_task_coords(n, r);
r.left ? (n.start_date = e.dateFromPos(o.start + i),
n.start_date || (n.start_date = new Date(e.getState().min_date))) : (n.end_date = e.dateFromPos(o.end + i),
n.end_date || (n.end_date = new Date(e.getState().max_date)));
var s = this._calculateMinDuration(a.min_duration, a.duration_unit);
n.end_date - n.start_date < a.min_duration && (r.left ? n.start_date = e.calculateEndDate(n.end_date, -s, a.duration_unit, n) : n.end_date = e.calculateEndDate(n.start_date, s, a.duration_unit, n)),
e._init_task_timing(n)
},
_calculateMinDuration: function(t, e) {
return Math.ceil(t / {
minute: 6e4,
hour: 36e5,
day: 864e5,
week: 6048e5,
month: 24192e5,
year: 31356e6
}[e])
},
_resize_progress: function(e, n, i) {
var r = this._drag_task_coords(e, i)
, a = t.$getConfig().rtl ? r.start - i.pos.x : i.pos.x - r.start
, o = Math.max(0, a);
e.progress = Math.min(1, o / Math.abs(r.end - r.start))
},
_find_max_shift: function(t, n) {
var i;
for (var r in t) {
var a = t[r]
, o = e.getTask(a.id)
, s = this._drag_task_coords(o, a)
, l = e.posFromDate(new Date(e.getState().min_date))
, c = e.posFromDate(new Date(e.getState().max_date));
if (s.end + n > c) {
var u = c - s.end;
(u < i || void 0 === i) && (i = u)
} else if (s.start + n < l) {
var d = l - s.start;
(d > i || void 0 === i) && (i = d)
}
}
return i
},
_move: function(t, n, i, r) {
var a = this._drag_task_coords(t, i)
, o = null
, s = null;
r ? (o = new Date(+i.obj.start_date + r),
s = new Date(+i.obj.end_date + r)) : (o = e.dateFromPos(a.start + n),
s = e.dateFromPos(a.end + n)),
o ? s ? (t.start_date = o,
t.end_date = s) : (t.end_date = new Date(e.getState().max_date),
t.start_date = e.dateFromPos(e.posFromDate(t.end_date) - (a.end - a.start))) : (t.start_date = new Date(e.getState().min_date),
t.end_date = e.dateFromPos(e.posFromDate(t.start_date) + (a.end - a.start)))
},
_drag_task_coords: function(t, n) {
return {
start: n.obj_s_x = n.obj_s_x || e.posFromDate(t.start_date),
end: n.obj_e_x = n.obj_e_x || e.posFromDate(t.end_date)
}
},
_mouse_position_change: function(t, e) {
var n = t.x - e.x
, i = t.y - e.y;
return Math.sqrt(n * n + i * i)
},
_is_number: function(t) {
return !isNaN(parseFloat(t)) && isFinite(t)
},
on_mouse_move: function(t) {
if (this.drag.start_drag) {
var n = i.getRelativeEventPosition(t, e.$task_data)
, r = this.drag.start_drag.start_x
, o = this.drag.start_drag.start_y;
(Date.now() - this.drag.timestamp > 50 || this._is_number(r) && this._is_number(o) && this._mouse_position_change({
x: r,
y: o
}, n) > 20) && this._start_dnd(t)
}
if (this.drag.mode) {
if (!a(this, 40))
return;
this._update_on_move(t)
}
},
_update_item_on_move: function(t, n, i, r, a, o) {
var s = e.getTask(n)
, l = e.mixin({}, s)
, c = e.mixin({}, s);
this._handlers[i].apply(this, [c, t, r, o]),
e.mixin(s, c, !0),
e.callEvent("onTaskDrag", [s.id, i, c, l, a]),
e.mixin(s, c, !0),
e.refreshTask(n)
},
_update_on_move: function(n) {
var a = this.drag
, o = t.$getConfig();
if (a.mode) {
var s = i.getRelativeEventPosition(n, t.$task_data);
if (a.pos && a.pos.x == s.x)
return;
a.pos = s;
var l = e.dateFromPos(s.x);
if (!l || isNaN(l.getTime()))
return;
var c = s.x - a.start_x
, u = e.getTask(a.id);
if (this._handlers[a.mode]) {
if (a.mode === o.drag_mode.move) {
var d = {};
this._isMultiselect() && e.getSelectedTasks().indexOf(a.id) >= 0 && (d = this.dragMultiple);
var h = !1;
if (e.isSummaryTask(u) && e.config.drag_project) {
var f = {};
f[a.id] = r.copy(a),
h = !0,
d = r.mixin(f, this.dragMultiple)
}
var _ = this._find_max_shift(d, c);
for (var g in void 0 !== _ && (c = _),
this._update_item_on_move(c, a.id, a.mode, a, n),
d) {
var p = d[g];
if (h && p.id != a.id && (e._bulk_dnd = !0),
void 0 === _ && (h || Object.keys(d).length > 1))
var v = l - e.dateFromPos(a.start_x);
this._update_item_on_move(c, p.id, p.mode, p, n, v)
}
e._bulk_dnd = !1
} else
this._update_item_on_move(c, a.id, a.mode, a, n);
e._update_parents(a.id)
}
}
},
on_mouse_down: function(n, r) {
if (2 != n.button || void 0 === n.button) {
var a = t.$getConfig()
, o = e.locate(n)
, s = null;
if (e.isTaskExists(o) && (s = e.getTask(o)),
!e.isReadonly(s) && !this.drag.mode) {
this.clear_drag_state(),
r = r || n.target || n.srcElement;
var l = i.getClassName(r)
, c = this._get_drag_mode(l, r);
if (!l || !c)
return r.parentNode ? this.on_mouse_down(n, r.parentNode) : void 0;
if (c)
if (c.mode && c.mode != a.drag_mode.ignore && a["drag_" + c.mode]) {
if (o = e.locate(r),
s = e.copy(e.getTask(o) || {}),
e.isReadonly(s))
return this.clear_drag_state(),
!1;
if (e.isSummaryTask(s) && !a.drag_project && c.mode != a.drag_mode.progress)
return void this.clear_drag_state();
c.id = o;
var u = i.getRelativeEventPosition(n, e.$task_data);
c.start_x = u.x,
c.start_y = u.y,
c.obj = s,
this.drag.start_drag = c,
this.drag.timestamp = Date.now()
} else
this.clear_drag_state();
else if (e.checkEvent("onMouseDown") && e.callEvent("onMouseDown", [l.split(" ")[0]]) && r.parentNode)
return this.on_mouse_down(n, r.parentNode)
}
}
},
_fix_dnd_scale_time: function(n, i) {
var r = t.$getConfig()
, a = e.getScale().unit
, o = e.getScale().step;
function s(n) {
if (e.config.correct_work_time) {
var i = t.$getConfig();
e.isWorkTime(n.start_date, void 0, n) || (n.start_date = e.calculateEndDate({
start_date: n.start_date,
duration: -1,
unit: i.duration_unit,
task: n
}))
}
}
r.round_dnd_dates || (a = "minute",
o = r.time_step),
i.mode == r.drag_mode.resize ? i.left ? (n.start_date = e.roundDate({
date: n.start_date,
unit: a,
step: o
}),
s(n)) : (n.end_date = e.roundDate({
date: n.end_date,
unit: a,
step: o
}),
function(n) {
if (e.config.correct_work_time) {
var i = t.$getConfig();
e.isWorkTime(new Date(n.end_date - 1), void 0, n) || (n.end_date = e.calculateEndDate({
start_date: n.end_date,
duration: 1,
unit: i.duration_unit,
task: n
}))
}
}(n)) : i.mode == r.drag_mode.move && (n.start_date = e.roundDate({
date: n.start_date,
unit: a,
step: o
}),
s(n),
n.end_date = e.calculateEndDate(n))
},
_fix_working_times: function(n, i) {
var r = t.$getConfig();
(i = i || {
mode: r.drag_mode.move
}).mode == r.drag_mode.resize ? i.left ? n.start_date = e.getClosestWorkTime({
date: n.start_date,
dir: "future",
task: n
}) : n.end_date = e.getClosestWorkTime({
date: n.end_date,
dir: "past",
task: n
}) : i.mode == r.drag_mode.move && e.correctTaskWorkTime(n)
},
_finalize_mouse_up: function(t, n, i, r) {
var a = e.getTask(t);
if (n.work_time && n.correct_work_time && this._fix_working_times(a, i),
this._fix_dnd_scale_time(a, i),
this._fireEvent("before_finish", i.mode, [t, i.mode, e.copy(i.obj), r])) {
var o = t;
e._init_task_timing(a),
this.clear_drag_state(),
e.updateTask(a.id),
this._fireEvent("after_finish", i.mode, [o, i.mode, r])
} else
this.clear_drag_state(),
t == i.id && (i.obj._dhx_changed = !1,
e.mixin(a, i.obj, !0)),
e.refreshTask(a.id)
},
on_mouse_up: function(n) {
var i = this.drag;
if (i.mode && i.id) {
var r = t.$getConfig()
, a = e.getTask(i.id)
, o = this.dragMultiple
, s = !1
, l = 0;
i.mode === r.drag_mode.move && (e.isSummaryTask(a) && r.drag_project || this._isMultiselect()) && (s = !0,
l = Object.keys(o).length);
var c = function() {
if (s)
for (var t in o)
this._finalize_mouse_up(o[t].id, r, o[t], n);
this._finalize_mouse_up(i.id, r, i, n)
};
s && l > 10 ? e.batchUpdate(function() {
c.call(this)
}
.bind(this)) : c.call(this)
}
this.clear_drag_state()
},
_get_drag_mode: function(e, n) {
var i = t.$getConfig().drag_mode
, r = {
mode: null,
left: null
};
switch ((e || "").split(" ")[0]) {
case "gantt_task_line":
case "gantt_task_content":
r.mode = i.move;
break;
case "gantt_task_drag":
r.mode = i.resize;
var a = n.getAttribute("data-bind-property");
r.left = "start_date" == a;
break;
case "gantt_task_progress_drag":
r.mode = i.progress;
break;
case "gantt_link_control":
case "gantt_link_point":
r.mode = i.ignore;
break;
default:
r = null
}
return r
},
_start_dnd: function(n) {
var i = this.drag = this.drag.start_drag;
delete i.start_drag;
var r = t.$getConfig()
, a = i.id;
if (r["drag_" + i.mode] && e.callEvent("onBeforeDrag", [a, i.mode, n]) && this._fireEvent("before_start", i.mode, [a, i.mode, n])) {
delete i.start_drag;
var s = e.getTask(a);
if (e.isReadonly(s))
return void this.clear_drag_state();
if (this._isMultiselect()) {
var l = e.getSelectedTasks();
l.indexOf(i.id) >= 0 && o.forEach(l, e.bind(function(t) {
var n = e.getTask(t);
e.isSummaryTask(n) && e.config.drag_project && i.mode == r.drag_mode.move && this._addSubtasksToDragMultiple(n.id),
this.dragMultiple[t] = e.mixin({
id: n.id,
obj: e.copy(n)
}, this.drag)
}, this))
}
e.isSummaryTask(s) && e.config.drag_project && i.mode == r.drag_mode.move && this._addSubtasksToDragMultiple(s.id),
e.callEvent("onTaskDragStart", [])
} else
this.clear_drag_state()
},
_fireEvent: function(t, n, i) {
e.assert(this._events[t], "Invalid stage:{" + t + "}");
var r = this._events[t][n];
return e.assert(r, "Unknown after drop mode:{" + n + "}"),
e.assert(i, "Invalid event arguments"),
!e.checkEvent(r) || e.callEvent(r, i)
},
round_task_dates: function(e) {
var n = this.drag
, i = t.$getConfig();
n || (n = {
mode: i.drag_mode.move
}),
this._fix_dnd_scale_time(e, n)
},
destructor: function() {
this._domEvents.detachAll()
},
_isMultiselect: function() {
return e.config.drag_multiple && !!(e.getSelectedTasks && e.getSelectedTasks().length > 0)
},
_addSubtasksToDragMultiple: function(t) {
e.eachTask(function(t) {
this.dragMultiple[t.id] = e.mixin({
id: t.id,
obj: e.copy(t)
}, this.drag)
}, t, this)
}
}
}(e, n),
e._tasks_dnd = t,
t.init(n)
},
destructor: function() {
t && (t.destructor(),
t = null)
}
}
}
}
}
, function(t, e, n) {
var i = n(0)
, r = n(98)
, a = n(97)
, o = n(1)
, s = function(t) {
var e = t.$services;
return {
onCreated: function(e) {
var o = e.$config;
o.bind = i.defined(o.bind) ? o.bind : "task",
o.bindLinks = i.defined(o.bindLinks) ? o.bindLinks : "link",
e._linksDnD = a.createLinkDND(),
e._tasksDnD = r.createTaskDND(),
e._tasksDnD.extend(e),
this._mouseDelegates = n(31)(t)
},
onInitialized: function(e) {
this._attachDomEvents(t),
this._attachStateProvider(t, e),
e._tasksDnD.init(e, t),
e._linksDnD.init(e, t),
"timeline" == e.$config.id && this.extendDom(e)
},
onDestroyed: function(e) {
this._clearDomEvents(t),
this._clearStateProvider(t),
e._tasksDnD && e._tasksDnD.destructor()
},
extendDom: function(e) {
t.$task = e.$task,
t.$task_scale = e.$task_scale,
t.$task_data = e.$task_data,
t.$task_bg = e.$task_bg,
t.$task_links = e.$task_links,
t.$task_bars = e.$task_bars
},
_clearDomEvents: function() {
this._mouseDelegates.destructor(),
this._mouseDelegates = null
},
_attachDomEvents: function(t) {
function e(e, n) {
if (e && this.callEvent("onLinkDblClick", [e, n])) {
var i = this.getLink(e);
if (this.isReadonly(i))
return;
var r = this.locale.labels.link + " " + this.templates.link_description(this.getLink(e)) + " " + this.locale.labels.confirm_link_deleting;
window.setTimeout(function() {
t._simple_confirm(r, "", function() {
t.deleteLink(e)
})
}, this.config.touch ? 300 : 1)
}
}
this._mouseDelegates.delegate("click", "gantt_task_link", t.bind(function(t, e) {
var n = this.locate(t, this.config.link_attribute);
n && this.callEvent("onLinkClick", [n, t])
}, t), this.$task),
this._mouseDelegates.delegate("click", "gantt_scale_cell", t.bind(function(e, n) {
var i = o.getRelativeEventPosition(e, t.$task_data)
, r = t.dateFromPos(i.x)
, a = Math.floor(t.columnIndexByDate(r))
, s = t.getScale().trace_x[a];
t.callEvent("onScaleClick", [e, s])
}, t), this.$task),
this._mouseDelegates.delegate("doubleclick", "gantt_task_link", t.bind(function(n, i, r) {
i = this.locate(n, t.config.link_attribute),
e.call(this, i, n)
}, t), this.$task),
this._mouseDelegates.delegate("doubleclick", "gantt_link_point", t.bind(function(t, n, i) {
n = this.locate(t);
var r = this.getTask(n)
, a = null;
return i.parentNode && o.getClassName(i.parentNode) && (a = o.getClassName(i.parentNode).indexOf("_left") > -1 ? r.$target[0] : r.$source[0]),
a && e.call(this, a, t),
!1
}, t), this.$task)
},
_attachStateProvider: function(t, n) {
var i = n;
e.getService("state").registerProvider("tasksTimeline", function() {
return {
scale_unit: i._tasks ? i._tasks.unit : void 0,
scale_step: i._tasks ? i._tasks.step : void 0
}
})
},
_clearStateProvider: function() {
e.getService("state").unregisterProvider("tasksTimeline")
}
}
};
t.exports = s
}
, function(t, e, n) {
var i = n(1);
function r(t, e) {
var n = i.getNodePosition(e.$grid_data);
return t.x += n.x + e.$grid.scrollLeft,
t.y += n.y - e.$grid_data.scrollTop,
t
}
function a(t, e) {
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0
, r = i.getNodePosition(t.$root);
return e > r.width && (e = r.width - n - 2),
e
}
t.exports = {
removeLineHighlight: function(t) {
t.markerLine && t.markerLine.parentNode && t.markerLine.parentNode.removeChild(t.markerLine),
t.markerLine = null
},
highlightPosition: function(t, e, n) {
var o = function(t, e) {
var n = i.getNodePosition(e.$grid_data)
, r = i.getRelativeEventPosition(t, e.$grid_data)
, o = n.x + e.$grid.scrollLeft
, s = r.y - 10
, l = e.getItemHeight(t.targetId);
s < n.y && (s = n.y);
var c = e.getTotalHeight();
return s > n.y + c - l && (s = n.y + c - l),
n.x = o,
n.y = s,
n.width = a(e.$gantt, n.width, 9),
n
}(t, n);
e.marker.style.left = o.x + 9 + "px",
e.marker.style.width = o.width + "px",
e.marker.style.overflow = "hidden";
var s = e.markerLine;
s || ((s = document.createElement("div")).className = "gantt_drag_marker gantt_grid_dnd_marker",
s.innerHTML = "",
s.style.pointerEvents = "none"),
t.child ? function(t, e, n) {
var i = t.targetParent
, o = r({
x: 0,
y: n.getItemTop(i)
}, n)
, s = n.$grid_data.getBoundingClientRect().bottom + window.scrollY
, l = a(n.$gantt, n.$grid_data.offsetWidth);
e.innerHTML = "",
e.style.width = l + "px",
e.style.top = o.y + "px",
e.style.left = o.x + "px",
e.style.height = n.getItemHeight(i) + "px",
o.y > s && (e.style.top = s + "px")
}(t, s, n) : function(t, e, n) {
var i = function(t, e) {
var n = e.$config.rowStore
, i = {
x: 0,
y: 0
}
, o = e.$grid_data.querySelector(".gantt_tree_indent")
, s = 15
, l = 0;
if (o && (s = o.offsetWidth),
t.targetId !== n.$getRootId()) {
var c = e.getItemTop(t.targetId)
, u = e.getItemHeight(t.targetId);
if (l = n.exists(t.targetId) ? n.calculateItemLevel(n.getItem(t.targetId)) : 0,
t.prevSibling)
i.y = c;
else if (t.nextSibling) {
var d = 0;
n.eachItem(function(t) {
-1 !== n.getIndexById(t.id) && d++
}, t.targetId),
i.y = c + u + d * u
} else
i.y = c + u,
l += 1
}
return i.x = 40 + l * s,
i.width = a(e.$gantt, Math.max(e.$grid_data.offsetWidth - i.x, 0), i.x),
r(i, e)
}(t, n)
, o = n.$grid_data.getBoundingClientRect().bottom + window.scrollY;
e.innerHTML = "",
e.style.left = i.x + "px",
e.style.height = "4px";
var s = i.y - 2;
e.style.top = s + "px",
e.style.width = i.width + "px",
s > o && (e.style.top = o + "px")
}(t, s, n),
e.markerLine || (document.body.appendChild(s),
e.markerLine = s)
}
}
}
, function(t, e, n) {
var i = n(24);
t.exports = function(t, e, n, r, a) {
var o;
if (e !== a.$getRootId())
o = n < .25 ? i.prevSiblingTarget(t, e, a) : !(n > .6) || a.hasChild(e) && a.getItem(e).$open ? i.firstChildTarget(t, e, a) : i.nextSiblingTarget(t, e, a);
else {
var s = a.$getRootId();
o = a.hasChild(s) && r >= 0 ? i.lastChildTarget(t, s, a) : i.firstChildTarget(t, s, a)
}
return o
}
}
, function(t, e, n) {
var i = n(24);
function r(t, e, n, r, a) {
for (var o = e; r.exists(o); ) {
var s = r.calculateItemLevel(r.getItem(o));
if ((s === n || s === n - 1) && r.getBranchIndex(o) > -1)
break;
o = a ? r.getPrev(o) : r.getNext(o)
}
return r.exists(o) ? r.calculateItemLevel(r.getItem(o)) === n ? a ? i.nextSiblingTarget(t, o, r) : i.prevSiblingTarget(t, o, r) : i.firstChildTarget(t, o, r) : null
}
function a(t, e, n, i) {
return r(t, e, n, i, !0)
}
function o(t, e, n, i) {
return r(t, e, n, i, !1)
}
t.exports = function(t, e, n, r, s, l) {
var c;
if (e !== s.$getRootId()) {
var u = s.getItem(e)
, d = s.calculateItemLevel(u);
if (d === l) {
var h = s.getPrevSibling(e);
n < .5 && !h ? c = i.prevSiblingTarget(t, e, s) : (n < .5 && (e = h),
c = i.nextSiblingTarget(t, e, s))
} else if (d > l)
s.eachParent(function(t) {
s.calculateItemLevel(t) === l && (e = t.id)
}, u),
c = a(t, e, l, s);
else {
var f = a(t, e, l, s)
, _ = o(t, e, l, s);
c = n < .5 ? f : _
}
} else {
var g = s.$getRootId()
, p = s.getChildren(g);
c = i.createDropTargetObject(),
c = p.length && r >= 0 ? a(t, function(t) {
for (var e = t.getNext(); t.exists(e); ) {
var n = t.getNext(e);
if (!t.exists(n))
return e;
e = n
}
return null
}(s), l, s) : o(t, g, l, s)
}
return c
}
}
, function(t, e, n) {
var i = n(1)
, r = n(24)
, a = n(102)
, o = n(101)
, s = n(100)
, l = n(16);
t.exports = {
init: function(t, e) {
var n = t.$services.getService("dnd");
if (e.$config.bind && t.getDatastore(e.$config.bind)) {
var c = new n(e.$grid_data,{
updates_per_second: 60
});
t.defined(e.$getConfig().dnd_sensitivity) && (c.config.sensitivity = e.$getConfig().dnd_sensitivity),
c.attachEvent("onBeforeDragStart", t.bind(function(n, r) {
var a = u(r);
if (!a)
return !1;
if (t.hideQuickInfo && t._hideQuickInfo(),
i.closest(r.target, ".gantt_grid_editor_placeholder"))
return !1;
var o = a.getAttribute(e.$config.item_attribute)
, s = e.$config.rowStore.getItem(o);
return !t.isReadonly(s) && !d(o) && (c.config.initial_open_state = s.$open,
!!t.callEvent("onRowDragStart", [o, r.target || r.srcElement, r]) && void 0)
}, t)),
c.attachEvent("onAfterDragStart", t.bind(function(t, n) {
var i = u(n);
c.config.marker.innerHTML = i.outerHTML;
var a = c.config.marker.firstChild;
a && (c.config.marker.style.opacity = .4,
a.style.position = "static",
a.style.pointerEvents = "none"),
c.config.id = i.getAttribute(e.$config.item_attribute);
var o = e.$config.rowStore
, s = o.getItem(c.config.id);
c.config.level = o.calculateItemLevel(s),
c.config.drop_target = r.createDropTargetObject({
targetParent: o.getParent(s.id),
targetIndex: o.getBranchIndex(s.id),
targetId: s.id,
nextSibling: !0
}),
s.$open = !1,
s.$transparent = !0,
this.refreshData()
}, t)),
c.attachEvent("onDragMove", t.bind(function(n, i) {
var a = h(i);
return a && !1 !== t.callEvent("onBeforeRowDragMove", [c.config.id, a.targetParent, a.targetIndex]) || (a = r.createDropTargetObject(c.config.drop_target)),
s.highlightPosition(a, c.config, e),
c.config.drop_target = a,
t._waiAria.reorderMarkerAttr(c.config.marker),
this.callEvent("onRowDragMove", [c.config.id, a.targetParent, a.targetIndex]),
!0
}, t)),
c.attachEvent("onDragEnd", t.bind(function() {
var n = e.$config.rowStore
, i = n.getItem(c.config.id);
s.removeLineHighlight(c.config),
i.$transparent = !1,
i.$open = c.config.initial_open_state;
var r = c.config.drop_target;
!1 === this.callEvent("onBeforeRowDragEnd", [c.config.id, r.targetParent, r.targetIndex]) ? i.$drop_target = null : (n.move(c.config.id, r.targetIndex, r.targetParent),
t.render(),
this.callEvent("onRowDragEnd", [c.config.id, r.targetParent, r.targetIndex])),
n.refresh(i.id)
}, t))
}
function u(t) {
return i.locateAttribute(t, e.$config.item_attribute)
}
function d(n) {
return l(n, t, t.getDatastore(e.$config.bind))
}
function h(n) {
var r, s = function(n) {
var r = i.getRelativeEventPosition(n, e.$grid_data).y
, a = e.$config.rowStore;
document.doctype || (r += window.scrollY),
r = r || 0;
var o = e.$state.scrollTop || 0
, s = t.$grid_data.getBoundingClientRect().height + o + window.scrollY
, l = o
, u = e.getItemIndexByTopPosition(e.$state.scrollTop);
if (a.exists(u) || (u = a.countVisible() - 1),
u < 0)
return a.$getRootId();
var h = a.getIdByIndex(u)
, f = e.$state.scrollTop / e.getItemHeight(h)
, _ = f - Math.floor(f);
_ > .1 && _ < .9 && (s -= e.getItemHeight(h) * _,
l += e.getItemHeight(h) * (1 - _));
var g = i.getNodePosition(e.$grid_data)
, p = g.y + g.height
, v = c.config.marker.offsetHeight;
r + v + window.scrollY >= s && (c.config.marker.style.top = p - v + "px"),
r >= s ? r = s : r <= l && (r = l,
c.config.marker.style.top = g.y + "px");
var m = e.getItemIndexByTopPosition(r);
if (m > a.countVisible() - 1 || m < 0)
return a.$getRootId();
var y = a.getIdByIndex(m);
return d(y) ? a.getPrevSibling(y) : a.getIdByIndex(m)
}(n), l = null, u = e.$config.rowStore, h = !e.$getConfig().order_branch_free, f = i.getRelativeEventPosition(n, e.$grid_data).y;
return document.doctype || (f += window.scrollY),
s !== u.$getRootId() && (l = (f - e.getItemTop(s)) / e.getItemHeight(s)),
h ? (r = a(c.config.id, s, l, f, u, c.config.level)) && r.targetParent && d(r.targetParent) && (s = u.getPrevSibling(r.targetParent),
r = a(c.config.id, s, l, f, u, c.config.level)) : r = o(c.config.id, s, l, f, u),
r
}
}
}
}
, function(t, e, n) {
var i = n(1)
, r = n(16);
t.exports = {
init: function(t, e) {
var n = t.$services.getService("dnd");
if (e.$config.bind && t.getDatastore(e.$config.bind)) {
var a = new n(e.$grid_data,{
updates_per_second: 60
});
t.defined(e.$getConfig().dnd_sensitivity) && (a.config.sensitivity = e.$getConfig().dnd_sensitivity),
a.attachEvent("onBeforeDragStart", t.bind(function(n, r) {
var c = o(r);
if (!c)
return !1;
if (t.hideQuickInfo && t._hideQuickInfo(),
i.closest(r.target, ".gantt_grid_editor_placeholder"))
return !1;
var u = c.getAttribute(e.$config.item_attribute);
if (l(u))
return !1;
var d = s().getItem(u);
return !t.isReadonly(d) && (a.config.initial_open_state = d.$open,
!!t.callEvent("onRowDragStart", [u, r.target || r.srcElement, r]) && void 0)
}, t)),
a.attachEvent("onAfterDragStart", t.bind(function(t, n) {
var i = o(n);
a.config.marker.innerHTML = i.outerHTML;
var r = a.config.marker.firstChild;
r && (r.style.position = "static"),
a.config.id = i.getAttribute(e.$config.item_attribute);
var l = s()
, c = l.getItem(a.config.id);
a.config.index = l.getBranchIndex(a.config.id),
a.config.parent = c.parent,
c.$open = !1,
c.$transparent = !0,
this.refreshData()
}, t)),
a.lastTaskOfLevel = function(t) {
for (var e = null, n = s().getItems(), i = 0, r = n.length; i < r; i++)
n[i].$level == t && (e = n[i]);
return e ? e.id : null
}
,
a._getGridPos = t.bind(function(t) {
var n = i.getNodePosition(e.$grid_data)
, r = n.x + e.$grid.scrollLeft
, o = t.pos.y - 10
, s = e.getItemHeight(a.config.id);
o < n.y && (o = n.y);
var l = e.getTotalHeight();
o > n.y + l - s && (o = n.y + l - s);
var c = n.y + n.height;
return o > c - s && (o = c - s),
n.x = r,
n.y = o,
n
}, t),
a._getTargetY = t.bind(function(n) {
var r = i.getNodePosition(e.$grid_data)
, a = e.$state.scrollTop || 0
, o = t.$grid_data.getBoundingClientRect().height + a
, s = n.pageY - r.y + a;
return s > o ? s = o : s < a && (s = a),
s
}, t),
a._getTaskByY = t.bind(function(t, n) {
var i = s();
t = t || 0;
var r = e.getItemIndexByTopPosition(t);
return (r = n < r ? r - 1 : r) > i.countVisible() - 1 ? null : i.getIdByIndex(r)
}, t),
a.attachEvent("onDragMove", t.bind(function(n, r) {
var o = t.$grid_data.getBoundingClientRect()
, c = o.height + o.y + (e.$state.scrollTop || 0) + window.scrollY
, u = a.config
, d = a._getGridPos(r);
t._waiAria.reorderMarkerAttr(u.marker);
var h = e.$getConfig()
, f = s();
d.y < c ? u.marker.style.top = d.y + "px" : u.marker.style.top = c + "px",
u.marker.style.left = d.x + 10 + "px";
var _ = i.getNodePosition(t.$root);
d.width > _.width && (u.marker.style.width = _.width - 10 - 2 + "px",
u.marker.style.overflow = "hidden");
var g = f.getItem(a.config.id)
, p = a._getTargetY(r)
, v = a._getTaskByY(p, f.getIndexById(g.id));
function m(t, e) {
return !f.isChildOf(y.id, e.id) && (t.$level == e.$level || h.order_branch_free)
}
if (f.exists(v) || (v = a.lastTaskOfLevel(h.order_branch_free ? g.$level : 0)) == a.config.id && (v = null),
f.exists(v)) {
var y = f.getItem(v)
, k = e.getItemTop(y.id)
, b = e.getItemHeight(y.id);
if (k + b / 2 < p) {
var x = f.getIndexById(y.id)
, w = f.getNext(y.id)
, S = f.getItem(w);
if (l(w)) {
var T = f.getPrev(S.id);
S = f.getItem(T)
}
if (S) {
if (S.id == g.id)
return h.order_branch_free && f.isChildOf(g.id, y.id) && 1 == f.getChildren(y.id).length ? void f.move(g.id, f.getBranchIndex(y.id) + 1, f.getParent(y.id)) : void 0;
y = S
} else if (w = f.getIdByIndex(x),
S = f.getItem(w),
l(w) && (T = f.getPrev(S.id),
S = f.getItem(T)),
m(S, g) && S.id != g.id)
return void f.move(g.id, -1, f.getParent(S.id))
} else if (h.order_branch_free && y.id != g.id && m(y, g) && !l(y.id)) {
if (!f.hasChild(y.id))
return y.$open = !0,
void f.move(g.id, -1, y.id);
if (f.getIndexById(y.id) || b / 3 < p)
return
}
x = f.getIndexById(y.id),
T = f.getIdByIndex(x - 1);
for (var $ = f.getItem(T), C = 1; (!$ || $.id == y.id) && x - C >= 0; )
T = f.getIdByIndex(x - C),
$ = f.getItem(T),
C++;
if (g.id == y.id || l(y.id))
return;
m(y, g) && g.id != y.id ? f.move(g.id, 0, 0, y.id) : y.$level != g.$level - 1 || f.getChildren(y.id).length ? $ && m($, g) && g.id != $.id && f.move(g.id, -1, f.getParent($.id)) : f.move(g.id, 0, y.id)
}
return !0
}, t)),
a.attachEvent("onDragEnd", t.bind(function() {
var e = s()
, n = e.getItem(a.config.id);
n.$transparent = !1,
n.$open = a.config.initial_open_state,
!1 === this.callEvent("onBeforeRowDragEnd", [a.config.id, a.config.parent, a.config.index]) ? (e.move(a.config.id, a.config.index, a.config.parent),
n.$drop_target = null) : this.callEvent("onRowDragEnd", [a.config.id, n.$drop_target]),
t.render(),
this.refreshData()
}, t))
}
function o(t) {
return i.locateAttribute(t, e.$config.item_attribute)
}
function s() {
return t.getDatastore(e.$config.bind)
}
function l(e) {
return r(e, t, s())
}
}
}
}
, function(t, e, n) {
var i = n(0)
, r = n(104)
, a = n(103)
, o = function(t) {
return {
onCreated: function(e) {
e.$config = i.mixin(e.$config, {
bind: "task"
}),
"grid" == e.$config.id && (this.extendGantt(e),
t.ext.inlineEditors = t.ext._inlineEditors.createEditors(e),
t.ext.inlineEditors.init()),
this._mouseDelegates = n(31)(t)
},
onInitialized: function(e) {
var n = e.$getConfig();
n.order_branch && ("marker" == n.order_branch ? a.init(e.$gantt, e) : r.init(e.$gantt, e)),
this.initEvents(e, t),
"grid" == e.$config.id && this.extendDom(e)
},
onDestroyed: function(e) {
"grid" == e.$config.id && t.ext.inlineEditors.destructor(),
this.clearEvents(e, t)
},
initEvents: function(t, e) {
this._mouseDelegates.delegate("click", "gantt_row", e.bind(function(n, i, r) {
var a = t.$getConfig();
if (null !== i) {
var o = this.getTask(i);
a.scroll_on_click && !e._is_icon_open_click(n) && this.showDate(o.start_date),
e.callEvent("onTaskRowClick", [i, r])
}
}, e), t.$grid),
this._mouseDelegates.delegate("click", "gantt_grid_head_cell", e.bind(function(n, i, r) {
var a = r.getAttribute("data-column-id");
if (e.callEvent("onGridHeaderClick", [a, n])) {
var o = t.$getConfig();
if ("add" != a) {
if (o.sort && a) {
for (var s, l = a, c = 0; c < o.columns.length; c++)
if (o.columns[c].name == a) {
s = o.columns[c];
break
}
if (s && void 0 !== s.sort && !0 !== s.sort && !(l = s.sort))
return;
var u = this._sort && this._sort.direction && this._sort.name == a ? this._sort.direction : "desc";
u = "desc" == u ? "asc" : "desc",
this._sort = {
name: a,
direction: u
},
this.sort(l, "desc" == u)
}
} else
e.$services.getService("mouseEvents").callHandler("click", "gantt_add", t.$grid, [n, o.root_id])
}
}, e), t.$grid),
this._mouseDelegates.delegate("click", "gantt_add", e.bind(function(n, i, r) {
if (!t.$getConfig().readonly)
return this.createTask({}, i || e.config.root_id),
!1
}, e), t.$grid)
},
clearEvents: function(t, e) {
this._mouseDelegates.destructor(),
this._mouseDelegates = null
},
extendDom: function(e) {
t.$grid = e.$grid,
t.$grid_scale = e.$grid_scale,
t.$grid_data = e.$grid_data
},
extendGantt: function(e) {
t.getGridColumns = t.bind(e.getGridColumns, e),
e.attachEvent("onColumnResizeStart", function() {
return t.callEvent("onColumnResizeStart", arguments)
}),
e.attachEvent("onColumnResize", function() {
return t.callEvent("onColumnResize", arguments)
}),
e.attachEvent("onColumnResizeEnd", function() {
return t.callEvent("onColumnResizeEnd", arguments)
}),
e.attachEvent("onColumnResizeComplete", function(e, n) {
t.config.grid_width = n
}),
e.attachEvent("onBeforeRowResize", function() {
return t.callEvent("onBeforeRowResize", arguments)
}),
e.attachEvent("onRowResize", function() {
return t.callEvent("onRowResize", arguments)
}),
e.attachEvent("onBeforeRowResizeEnd", function() {
return t.callEvent("onBeforeRowResizeEnd", arguments)
}),
e.attachEvent("onAfterRowResize", function() {
return t.callEvent("onAfterRowResize", arguments)
})
}
}
};
t.exports = o
}
, function(t, e, n) {
var i = n(30)
, r = n(6);
t.exports = function(t) {
return {
render: function(e, n, i) {
var r = n.$getConfig()
, a = document.createElement("div");
return a.className = "gantt_task_grid_row_resize_wrap",
a.style.top = n.getItemTop(e.id) + n.getItemHeight(e.id) + "px",
a.innerHTML = "",
a.setAttribute(r.task_grid_row_resizer_attribute, e.id),
t._waiAria.rowResizerAttr(a),
a
},
update: null,
getRectangle: i,
getVisibleRange: r
}
}
}
, function(t, e, n) {
var i = n(27)
, r = n(6)
, a = n(26)
, o = n(25)
, s = n(37);
function l(t, e, n, i) {
var r = 100 * (1 - (1 * t || 0))
, a = i.posFromDate(e)
, o = i.posFromDate(n)
, s = document.createElement("div");
return s.className = "gantt_histogram_hor_bar",
s.style.top = r + "%",
s.style.left = a + "px",
s.style.width = o - a + 1 + "px",
s
}
function c(t, e, n) {
if (t === e)
return null;
var i = 1 - Math.max(t, e)
, r = Math.abs(t - e)
, a = document.createElement("div");
return a.className = "gantt_histogram_vert_bar",
a.style.top = 100 * i + "%",
a.style.height = 100 * r + "%",
a.style.left = n + "px",
a
}
t.exports = function(t) {
var e = s(t)
, n = {}
, u = {}
, d = {};
function h(t, e) {
var i = n[t];
i && i[e] && i[e].parentNode && i[e].parentNode.removeChild(i[e])
}
function f(e, n, i, r, o, s, u) {
var h = d[e.id];
h && h.parentNode && h.parentNode.removeChild(h);
var f = function(e, n, i, r) {
for (var o = n.getScale(), s = document.createElement("div"), u = a(o, r), d = u.start; d <= u.end; d++) {
var h = o.trace_x[d]
, f = o.trace_x[d + 1] || t.date.add(h, o.step, o.unit)
, _ = o.trace_x[d].valueOf()
, g = Math.min(e[_] / i, 1) || 0;
if (g < 0)
return null;
var p = Math.min(e[f.valueOf()] / i, 1) || 0
, v = l(g, h, f, n);
v && s.appendChild(v);
var m = c(g, p, n.posFromDate(f));
m && s.appendChild(m)
}
return s
}(i, o, s, u);
return f && n && (f.setAttribute("data-resource-id", e.id),
f.setAttribute(o.$config.item_attribute, e.id),
f.style.position = "absolute",
f.style.top = n.top + 1 + "px",
f.style.height = o.getItemHeight(e.id) - 1 + "px",
f.style.left = 0),
f
}
function _(t, e, n, i, r, a, o) {
var s = r.histogram_cell_class(a.start_date, a.end_date, t, a.tasks, a.assignments)
, l = r.histogram_cell_label(a.start_date, a.end_date, t, a.tasks, a.assignments)
, c = r.histogram_cell_allocated(a.start_date, a.end_date, t, a.tasks, a.assignments)
, u = o.getItemHeight(t.id) - 1;
if (s || l) {
var d = document.createElement("div");
return d.className = ["gantt_histogram_cell", s].join(" "),
d.setAttribute(o.$config.item_attribute, t.id),
d.style.cssText = ["left:" + e.left + "px", "width:" + e.width + "px", "height:" + u + "px", "line-height:" + u + "px", "top:" + (e.top + 1) + "px"].join(";"),
l && (l = "
" + l + "
"),
c && (l = "" + l),
l && (d.innerHTML = l),
d
}
return null
}
return {
render: function(i, r, s, l) {
var c = r.$getTemplates()
, h = r.getScale()
, g = e(i, s.resource_property, h, r)
, p = []
, v = {}
, m = i.capacity || r.$config.capacity || 24;
n[i.id] = {},
u[i.id] = null,
d[i.id] = null;
for (var y = !!l, k = a(h, l), b = k.start; b <= k.end; b++) {
var x = g[b];
if (x && (!y || o(b, h, l, t))) {
var w = c.histogram_cell_capacity(x.start_date, x.end_date, i, x.tasks, x.assignments);
v[x.start_date.valueOf()] = w || 0;
var S = r.getItemPosition(i, x.start_date, x.end_date)
, T = _(i, S, m, 0, c, x, r);
T && (p.push(T),
n[i.id][b] = T)
}
}
var $ = null;
if (p.length) {
$ = document.createElement("div");
for (var C = 0; C < p.length; C++)
$.appendChild(p[C]);
var E = f(i, S, v, 0, r, m, l);
E && ($.appendChild(E),
d[i.id] = E),
u[i.id] = $
}
return $
},
update: function(i, r, s, l, c) {
var u = s.$getTemplates()
, g = s.getScale()
, p = e(i, l.resource_property, g, s)
, v = i.capacity || s.$config.capacity || 24
, m = {}
, y = !!c
, k = a(g, c)
, b = {};
if (n && n[i.id])
for (var x in n[i.id])
b[x] = x;
for (var w = k.start; w <= k.end; w++) {
var S = p[w];
if (b[w] = !1,
S) {
var T = u.histogram_cell_capacity(S.start_date, S.end_date, i, S.tasks, S.assignments);
m[S.start_date.valueOf()] = T || 0;
var $ = s.getItemPosition(i, S.start_date, S.end_date);
if (!y || o(w, g, c, t)) {
var C = n[i.id];
if (C && C[w])
C && C[w] && !C[w].parentNode && r.appendChild(C[w]);
else {
var E = _(i, $, v, 0, u, S, s);
E && (r.appendChild(E),
n[i.id][w] = E)
}
} else
h(i.id, w)
}
}
for (var x in b)
!1 !== b[x] && h(i.id, x);
var A = f(i, $, m, 0, s, v, c);
A && (r.appendChild(A),
d[i.id] = A)
},
getRectangle: i,
getVisibleRange: r
}
}
}
, function(t, e, n) {
var i = n(27)
, r = n(6)
, a = n(26)
, o = n(25)
, s = n(37);
t.exports = function(t) {
var e = s(t)
, n = {};
function l(t, e, n, i, r) {
var a = n.resource_cell_class(e.start_date, e.end_date, t, e.tasks, e.assignments)
, o = n.resource_cell_value(e.start_date, e.end_date, t, e.tasks, e.assignments)
, s = r.getItemHeight(t.id) - 1;
if (a || o) {
var l = r.getItemPosition(t, e.start_date, e.end_date)
, c = document.createElement("div");
return c.setAttribute(r.$config.item_attribute, t.id),
c.className = ["gantt_resource_marker", a].join(" "),
c.style.cssText = ["left:" + l.left + "px", "width:" + l.width + "px", "height:" + s + "px", "line-height:" + s + "px", "top:" + l.top + "px"].join(";"),
o && (c.innerHTML = o),
c
}
return null
}
function c(t, e) {
n[t] && n[t][e] && n[t][e].parentNode && n[t][e].parentNode.removeChild(n[t][e])
}
return {
render: function(i, r, s, c) {
var u = r.$getTemplates()
, d = r.getScale()
, h = e(i, s.resource_property, r.getScale(), r)
, f = !!c
, _ = [];
n[i.id] = {};
for (var g = a(d, c), p = g.start; p <= g.end; p++) {
var v = h[p];
if (v && (!f || o(p, d, c, t))) {
var m = l(i, v, u, 0, r);
m && (_.push(m),
n[i.id][p] = m)
}
}
var y = null;
if (_.length) {
y = document.createElement("div");
for (var k = 0; k < _.length; k++)
y.appendChild(_[k])
}
return y
},
update: function(i, r, s, u, d) {
var h = s.$getTemplates()
, f = s.getScale()
, _ = e(i, u.resource_property, s.getScale(), s)
, g = a(f, d)
, p = {};
if (n && n[i.id])
for (var v in n[i.id])
p[v] = v;
for (var m = g.start; m <= g.end; m++) {
var y = _[m];
if (p[m] = !1,
y)
if (o(m, f, d, t))
if (n[i.id] && n[i.id][m])
n[i.id] && n[i.id][m] && !n[i.id][m].parentNode && r.appendChild(n[i.id][m]);
else {
var k = l(i, y, h, 0, s);
k && (r.appendChild(k),
n[i.id][m] = k)
}
else
c(i.id, m)
}
for (var v in p)
!1 !== p[v] && c(i.id, v)
},
getRectangle: i,
getVisibleRange: r
}
}
}
, function(t, e, n) {
function i(t) {
"@babel/helpers - typeof";
return (i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
var r = n(2)
, a = n(30)
, o = n(6);
t.exports = function(t) {
return {
render: function(e, n, i, a) {
for (var o = n.getGridColumns(), s = n.$getTemplates(), l = n.$config.rowStore, c = [], u = 0; u < o.length; u++) {
var d, h, f, _ = u == o.length - 1, g = o[u];
"add" == g.name ? (h = "",
f = "") : (h = g.template ? g.template(e) : e[g.name],
r.isDate(h) && (h = s.date_grid(h, e, g.name)),
null !== h && void 0 !== h || (h = ""),
f = h,
h = "
" + h + "
");
var p = "gantt_cell" + (_ ? " gantt_last_cell" : "")
, v = [];
if (g.tree) {
p += " gantt_cell_tree";
for (var m = 0; m < e.$level; m++)
v.push(s.grid_indent(e));
!l.hasChild(e.id) || t.isSplitTask(e) && !t.config.open_split_tasks ? (v.push(s.grid_blank(e)),
v.push(s.grid_file(e))) : (v.push(s.grid_open(e)),
v.push(s.grid_folder(e)))
}
var y = "width:" + (g.width - (_ ? 1 : 0)) + "px;";
if (this.defined(g.align)) {
var k = {
right: "flex-end",
left: "flex-start",
center: "center"
}[g.align];
y += "text-align:" + g.align + ";justify-content:" + k + ";"
}
var b = t._waiAria.gridCellAttrString(g, f, e);
v.push(h),
d = "
" + v.join("") + "
",
c.push(d)
}
switch (p = "",
l.$config.name) {
case "task":
p = t.getGlobalTaskIndex(e.id) % 2 == 0 ? "" : " odd";
break;
case "resource":
p = l.visibleOrder.indexOf(e.id) % 2 == 0 ? "" : " odd"
}
if (p += e.$transparent ? " gantt_transparent" : "",
p += e.$dataprocessor_class ? " " + e.$dataprocessor_class : "",
s.grid_row_class) {
var x = s.grid_row_class.call(t, e.start_date, e.end_date, e);
x && (p += " " + x)
}
l.isSelected(e.id) && (p += " gantt_selected");
var w = document.createElement("div");
w.className = "gantt_row" + p + " gantt_row_" + t.getTaskType(e.type);
var S = n.getItemHeight(e.id);
return w.style.height = S + "px",
w.style.lineHeight = S + "px",
i.smart_rendering && (w.style.position = "absolute",
w.style.left = "0px",
w.style.top = n.getItemTop(e.id) + "px"),
n.$config.item_attribute && (w.setAttribute(n.$config.item_attribute, e.id),
w.setAttribute(n.$config.bind + "_id", e.id)),
t._waiAria.taskRowAttr(e, w),
w.innerHTML = c.join(""),
w
},
update: null,
getRectangle: a,
getVisibleRange: o,
onrender: function(e, n, r) {
for (var a = r.getGridColumns(), o = 0; o < a.length; o++) {
var s = a[o];
if (s.onrender) {
var l = n.querySelector("[data-column-name=" + s.name + "]");
if (l) {
var c = s.onrender(e, l);
if (c && "string" == typeof c)
l.innerHTML = c;
else if (c && "object" === i(c) && t.config.external_render) {
var u = t.config.external_render;
u.isElement(c) && u.renderElement(c, l)
}
}
}
}
}
}
}
}
, function(t, e, n) {
var i = n(39)
, r = n(40);
t.exports = function(t) {
var e = {
current_pos: null,
dirs: {
left: "left",
right: "right",
up: "up",
down: "down"
},
path: [],
clear: function() {
this.current_pos = null,
this.path = []
},
point: function(e) {
this.current_pos = t.copy(e)
},
get_lines: function(t) {
this.clear(),
this.point(t[0]);
for (var e = 1; e < t.length; e++)
this.line_to(t[e]);
return this.get_path()
},
line_to: function(e) {
var n = t.copy(e)
, i = this.current_pos
, r = this._get_line(i, n);
this.path.push(r),
this.current_pos = n
},
get_path: function() {
return this.path
},
get_wrapper_sizes: function(t, e, n) {
var i, r = e.$getConfig().link_wrapper_width, a = t.y - r / 2;
switch (t.direction) {
case this.dirs.left:
i = {
top: a,
height: r,
lineHeight: r,
left: t.x - t.size - r / 2,
width: t.size + r
};
break;
case this.dirs.right:
i = {
top: a,
lineHeight: r,
height: r,
left: t.x - r / 2,
width: t.size + r
};
break;
case this.dirs.up:
i = {
top: a - t.size,
lineHeight: t.size + r,
height: t.size + r,
left: t.x - r / 2,
width: r
};
break;
case this.dirs.down:
i = {
top: a,
lineHeight: t.size + r,
height: t.size + r,
left: t.x - r / 2,
width: r
}
}
return i
},
get_line_sizes: function(t, e) {
var n, i = e.$getConfig(), r = i.link_line_width, a = i.link_wrapper_width, o = t.size + r;
switch (t.direction) {
case this.dirs.left:
case this.dirs.right:
n = {
height: r,
width: o,
marginTop: (a - r) / 2,
marginLeft: (a - r) / 2
};
break;
case this.dirs.up:
case this.dirs.down:
n = {
height: o,
width: r,
marginTop: (a - r) / 2,
marginLeft: (a - r) / 2
}
}
return n
},
render_line: function(t, e, n, i) {
var r = this.get_wrapper_sizes(t, n, i)
, a = document.createElement("div");
a.style.cssText = ["top:" + r.top + "px", "left:" + r.left + "px", "height:" + r.height + "px", "width:" + r.width + "px"].join(";"),
a.className = "gantt_line_wrapper";
var o = this.get_line_sizes(t, n)
, s = document.createElement("div");
return s.style.cssText = ["height:" + o.height + "px", "width:" + o.width + "px", "margin-top:" + o.marginTop + "px", "margin-left:" + o.marginLeft + "px"].join(";"),
s.className = "gantt_link_line_" + t.direction,
a.appendChild(s),
a
},
_get_line: function(t, e) {
var n = this.get_direction(t, e)
, i = {
x: t.x,
y: t.y,
direction: this.get_direction(t, e)
};
return n == this.dirs.left || n == this.dirs.right ? i.size = Math.abs(t.x - e.x) : i.size = Math.abs(t.y - e.y),
i
},
get_direction: function(t, e) {
return e.x < t.x ? this.dirs.left : e.x > t.x ? this.dirs.right : e.y > t.y ? this.dirs.down : this.dirs.up
}
}
, n = {
path: [],
clear: function() {
this.path = []
},
current: function() {
return this.path[this.path.length - 1]
},
point: function(e) {
return e ? (this.path.push(t.copy(e)),
e) : this.current()
},
point_to: function(n, i, r) {
r = r ? {
x: r.x,
y: r.y
} : t.copy(this.point());
var a = e.dirs;
switch (n) {
case a.left:
r.x -= i;
break;
case a.right:
r.x += i;
break;
case a.up:
r.y -= i;
break;
case a.down:
r.y += i
}
return this.point(r)
},
get_points: function(n, i, r, a) {
var o = this.get_endpoint(n, i, r, a)
, s = t.config
, l = o.e_y - o.y
, c = o.e_x - o.x
, u = e.dirs
, d = i.getItemHeight(n.source);
this.clear(),
this.point({
x: o.x,
y: o.y
});
var h = 2 * s.link_arrow_size
, f = this.get_line_type(n, i.$getConfig())
, _ = o.e_x > o.x;
if (f.from_start && f.to_start)
this.point_to(u.left, h),
_ ? (this.point_to(u.down, l),
this.point_to(u.right, c)) : (this.point_to(u.right, c),
this.point_to(u.down, l)),
this.point_to(u.right, h);
else if (!f.from_start && f.to_start)
if (_ = o.e_x > o.x + 2 * h,
this.point_to(u.right, h),
_)
c -= h,
this.point_to(u.down, l),
this.point_to(u.right, c);
else {
c -= 2 * h;
var g = l > 0 ? 1 : -1;
this.point_to(u.down, g * (d / 2)),
this.point_to(u.right, c),
this.point_to(u.down, g * (Math.abs(l) - d / 2)),
this.point_to(u.right, h)
}
else
f.from_start || f.to_start ? f.from_start && !f.to_start && (_ = o.e_x > o.x - 2 * h,
this.point_to(u.left, h),
_ ? (c += 2 * h,
g = l > 0 ? 1 : -1,
this.point_to(u.down, g * (d / 2)),
this.point_to(u.right, c),
this.point_to(u.down, g * (Math.abs(l) - d / 2)),
this.point_to(u.left, h)) : (c += h,
this.point_to(u.down, l),
this.point_to(u.right, c))) : (this.point_to(u.right, h),
_ ? (this.point_to(u.right, c),
this.point_to(u.down, l)) : (this.point_to(u.down, l),
this.point_to(u.right, c)),
this.point_to(u.left, h));
return this.path
},
get_line_type: function(e, n) {
var i = n.links
, r = !1
, a = !1;
return e.type == i.start_to_start ? r = a = !0 : e.type == i.finish_to_finish ? r = a = !1 : e.type == i.finish_to_start ? (r = !1,
a = !0) : e.type == i.start_to_finish ? (r = !0,
a = !1) : t.assert(!1, "Invalid link type"),
n.rtl && (r = !r,
a = !a),
{
from_start: r,
to_start: a
}
},
get_endpoint: function(t, e, n, i) {
var r = e.$getConfig()
, o = this.get_line_type(t, r)
, s = o.from_start
, l = o.to_start
, c = a(n, e, r)
, u = a(i, e, r);
return {
x: s ? c.left : c.left + c.width,
e_x: l ? u.left : u.left + u.width,
y: c.top + c.rowHeight / 2 - 1,
e_y: u.top + u.rowHeight / 2 - 1
}
}
};
function a(e, n, i) {
var r = n.getItemPosition(e);
if (t.getTaskType(e.type) == i.types.milestone) {
var a = n.getBarHeight(e.id, !0)
, o = Math.sqrt(2 * a * a);
r.left -= o / 2,
r.width = o
}
return r
}
return {
render: function(i, r, a) {
var o = t.getTask(i.source);
if (!o.hide_bar) {
var s = t.getTask(i.target);
if (!s.hide_bar) {
var l = n.get_endpoint(i, r, o, s)
, c = l.e_y - l.y;
if (!(l.e_x - l.x || c))
return null;
var u = n.get_points(i, r, o, s)
, d = e.get_lines(u, r)
, h = document.createElement("div")
, f = "gantt_task_link";
i.color && (f += " gantt_link_inline_color");
var _ = t.templates.link_class ? t.templates.link_class(i) : "";
_ && (f += " " + _),
a.highlight_critical_path && t.isCriticalLink && t.isCriticalLink(i) && (f += " gantt_critical_link"),
h.className = f,
r.$config.link_attribute && (h.setAttribute(r.$config.link_attribute, i.id),
h.setAttribute("link_id", i.id));
for (var g = 0; g < d.length; g++) {
g == d.length - 1 && (d[g].size -= a.link_arrow_size);
var p = e.render_line(d[g], d[g + 1], r, i.source);
i.color && (p.firstChild.style.backgroundColor = i.color),
h.appendChild(p)
}
var v = d[d.length - 1].direction
, m = function(t, n, i, r) {
var a = i.$getConfig()
, o = document.createElement("div")
, s = t.y
, l = t.x
, c = a.link_arrow_size
, u = "gantt_link_arrow gantt_link_arrow_" + n;
switch (n) {
case e.dirs.right:
s -= c / 2,
l -= c;
break;
case e.dirs.left:
s -= c / 2;
break;
case e.dirs.up:
l -= c;
break;
case e.dirs.down:
s += 2 * c,
l -= c
}
return o.style.cssText = ["top:" + s + "px", "left:" + l + "px"].join(";"),
o.className = u,
o
}(u[u.length - 1], v, r, i.source);
return i.color && (m.style.borderColor = i.color),
h.appendChild(m),
t._waiAria.linkAttr(i, h),
h
}
}
},
update: null,
isInViewPort: i,
getVisibleRange: r()
}
}
}
, function(t, e) {
t.exports = function(t, e) {
var n = e.config.timeline_placeholder;
if (t = t || [],
n && 0 === t.filter(function(t) {
return "timeline_placeholder_task" === t.id
}).length) {
var i = e.getState()
, r = null
, a = i.min_date
, o = i.max_date;
t.length && (r = t[t.length - 1].id);
var s = {
start_date: a,
end_date: o,
row_height: n.height || 0,
id: "timeline_placeholder_task",
unscheduled: !0,
lastTaskId: r,
calendar_id: n.calendar || "global",
$source: [],
$target: []
};
t.push(s)
}
}
}
, function(t, e, n) {
var i = n(27)
, r = n(20)
, a = n(6)
, o = n(26)
, s = n(25)
, l = n(111);
t.exports = function(t) {
var e = {}
, n = {};
function c(t, n) {
return !(!e[t.id][n] || !e[t.id][n].parentNode)
}
function u(t, n) {
e[t] && e[t][n] && e[t][n].parentNode && e[t][n].parentNode.removeChild(e[t][n])
}
function d(t) {
var e, n = t.$getTemplates();
return void 0 !== n.task_cell_class ? (e = n.task_cell_class,
(console.warn || console.log)("gantt.templates.task_cell_class template is deprecated and will be removed soon. Please use gantt.templates.timeline_cell_class instead.")) : e = n.timeline_cell_class,
e
}
function h(t) {
return t.$getTemplates().timeline_cell_content
}
function f(i, r, a, o, l, c, u, d) {
var h = i.width[r]
, f = "";
if (s(r, i, o, t)) {
var _ = c(a, i.trace_x[r])
, g = "";
if (u && (g = u(a, i.trace_x[r])),
d.static_background) {
var p = !(!_ && !g);
if (!d.static_background_cells || !p)
return null
}
if (e[a.id][r])
return n[a.id][r] = r,
e[a.id][r];
var v = document.createElement("div");
return v.style.width = h + "px",
f = "gantt_task_cell" + (r == l - 1 ? " gantt_last_cell" : ""),
_ && (f += " " + _),
v.className = f,
g && (v.innerHTML = g),
v.style.position = "absolute",
v.style.left = i.left[r] + "px",
e[a.id][r] = v,
n[a.id][r] = r,
v
}
return null
}
return {
render: function(i, a, s, l) {
var c = a.$getTemplates()
, u = a.getScale()
, _ = u.count;
if (s.static_background && !s.static_background_cells)
return null;
var g, p = document.createElement("div"), v = d(a), m = h(a);
if (g = l && s.smart_rendering && !r(t) ? o(u, l.x) : {
start: 0,
end: _ - 1
},
s.show_task_cells) {
e[i.id] = {},
n[i.id] = {};
for (var y = g.start; y <= g.end; y++) {
var k = f(u, y, i, l, _, v, m, s);
k && p.appendChild(k)
}
}
var b = a.$config.rowStore
, x = b.getIndexById(i.id) % 2 != 0
, w = c.task_row_class(i.start_date, i.end_date, i)
, S = "gantt_task_row" + (x ? " odd" : "") + (w ? " " + w : "");
if (b.isSelected(i.id) && (S += " gantt_selected"),
p.className = S,
s.smart_rendering ? (p.style.position = "absolute",
p.style.top = a.getItemTop(i.id) + "px",
p.style.width = "100%") : p.style.position = "relative",
p.style.height = a.getItemHeight(i.id) + "px",
"timeline_placeholder_task" == i.id) {
var T = 0;
i.lastTaskId && (T = a.getItemTop(i.lastTaskId) + a.getItemHeight(i.lastTaskId));
var $ = (i.row_height || a.$task_data.offsetHeight) - T;
$ < 0 && ($ = 0),
s.smart_rendering && (p.style.top = T + "px"),
p.style.height = $ + "px"
}
return a.$config.item_attribute && (p.setAttribute(a.$config.item_attribute, i.id),
p.setAttribute(a.$config.bind + "_id", i.id)),
p
},
update: function(t, i, r, a, s) {
var l = r.getScale()
, _ = l.count
, g = d(r)
, p = h(r);
if (a.show_task_cells) {
e[t.id] || (e[t.id] = {}),
n[t.id] || (n[t.id] = {});
var v = o(l, s);
for (var m in n[t.id]) {
var y = n[t.id][m];
(Number(y) < v.start || Number(y) > v.end) && u(t.id, y)
}
n[t.id] = {};
for (var k = v.start; k <= v.end; k++) {
var b = f(l, k, t, s, _, g, p, a);
!b && c(t, k) ? u(t.id, k) : b && !b.parentNode && i.appendChild(b)
}
}
},
getRectangle: i,
getVisibleRange: a,
prepareData: l
}
}
}
, function(t, e, n) {
var i = n(28)
, r = n(19)
, a = n(6);
t.exports = function(t) {
var e = i(t)
, n = {};
function o(t, e, n, i, a) {
var o = !0;
return i.smart_rendering && (o = r(t, e, n, i, a)),
o
}
function s(n, i, r, a) {
var o = t.copy(t.getTask(i.id));
if (o.$rendered_at = n.id,
!1 !== t.callEvent("onBeforeRollupTaskDisplay", [o.id, o, n.id])) {
var s = e(o, r);
if (s) {
var l = r.getBarHeight(n.id, i.type == t.config.types.milestone)
, c = Math.floor((r.getItemHeight(n.id) - l) / 2);
return s.style.top = a.top + c + "px",
s.classList.add("gantt_rollup_child"),
s.setAttribute("data-rollup-parent-id", n.id),
s
}
}
}
function l(t, e) {
return t + "_" + e
}
return {
render: function(e, i, r, a) {
if (!1 !== e.rollup && e.$rollup && e.$rollup.length) {
var c = document.createElement("div")
, u = t.getTaskPosition(e);
return a.y = 0,
a.y_end = t.$task_bg.scrollHeight,
e.$rollup.forEach(function(d) {
if (t.isTaskExists(d)) {
var h = t.getTask(d);
if (o(h, a, i, r, t)) {
var f = s(e, h, i, u);
f ? (n[l(h.id, e.id)] = f,
c.appendChild(f)) : n[l(h.id, e.id)] = !1
}
}
}),
c
}
return !1
},
update: function(e, i, r, a, c) {
var u = document.createElement("div")
, d = t.getTaskPosition(e);
c.y = 0,
c.y_end = t.$task_bg.scrollHeight,
e.$rollup.forEach(function(h) {
var f = t.getTask(h)
, _ = l(f.id, e.id)
, g = o(f, c, r, a, t);
if (g !== !!n[_])
if (g) {
var p = s(e, f, r, d);
n[_] = p || !1
} else
n[_] = !1;
n[_] && u.appendChild(n[_]),
i.innerHTML = "",
i.appendChild(u)
})
},
isInViewPort: r,
getVisibleRange: a
}
}
}
, function(t, e, n) {
var i = n(19);
t.exports = function(t, e, n, r, a) {
if (!a.isSplitTask(t))
return !1;
var o = a.getSubtaskDates(t.id);
return i({
id: t.id,
start_date: o.start_date,
end_date: o.end_date,
parent: t.parent
}, e, n, a)
}
}
, function(t, e, n) {
var i = n(28)
, r = n(6)
, a = n(114)
, o = n(19);
t.exports = function(t) {
var e = i(t)
, n = {};
function s(t, e, n, i, r) {
var a = !t.hide_bar;
return i.smart_rendering && a && (a = o(t, e, n, i, r)),
a
}
function l(n, i, r, a) {
if (!i.hide_bar) {
var o = t.isSummaryTask(i);
o && t.resetProjectDates(i);
var s = t.copy(t.getTask(i.id));
if (s.$rendered_at = n.id,
!1 !== t.callEvent("onBeforeSplitTaskDisplay", [s.id, s, n.id])) {
var l = e(s, r);
if (l) {
var c = r.getBarHeight(n.id, i.type == t.config.types.milestone)
, u = Math.floor((r.getItemHeight(n.id) - c) / 2);
return l.style.top = a.top + u + "px",
l.classList.add("gantt_split_child"),
o && l.classList.add("gantt_split_subproject"),
l
}
}
}
}
function c(t, e) {
return t + "_" + e
}
function u(e, n) {
return t.isSplitTask(e) && (n.open_split_tasks && !e.$open || !n.open_split_tasks) && t.hasChild(e.id)
}
return {
render: function(e, i, r, a) {
if (u(e, r)) {
var o = document.createElement("div")
, d = t.getTaskPosition(e);
return t.hasChild(e.id) && t.eachTask(function(u) {
if (s(u, a, i, r, t)) {
var h = l(e, u, i, d);
h ? (n[c(u.id, e.id)] = h,
o.appendChild(h)) : n[c(u.id, e.id)] = !1
}
}, e.id),
o
}
return !1
},
update: function(e, i, r, a, o) {
if (u(e, a)) {
var d = document.createElement("div")
, h = t.getTaskPosition(e);
t.eachTask(function(u) {
var f = c(u.id, e.id)
, _ = s(u, o, r, a, t);
if (_ !== !!n[f])
if (_) {
var g = l(e, u, r, h);
n[f] = g || !1
} else
n[f] = !1;
n[f] && d.appendChild(n[f]),
i.innerHTML = "",
i.appendChild(d)
}, e.id)
}
},
isInViewPort: a,
getVisibleRange: r
}
}
}
, function(t, e, n) {
var i = n(19)
, r = n(6)
, a = n(28);
t.exports = function(t) {
return {
render: a(t),
update: null,
isInViewPort: i,
getVisibleRange: r
}
}
}
, function(t, e) {
t.exports = function(t) {
return function(n, i, r) {
"keepDates" == r ? function(e, n) {
"duration" == n ? e.end_date = t.calculateEndDate(e) : "end_date" != n && "start_date" != n || (e.duration = t.calculateDuration(e))
}(n, i) : "keepDuration" == r ? function(n, i) {
"end_date" == i ? n.start_date = e(n) : "start_date" != i && "duration" != i || (n.end_date = t.calculateEndDate(n))
}(n, i) : function(n, i) {
t.config.schedule_from_end ? "end_date" == i || "duration" == i ? n.start_date = e(n) : "start_date" == i && (n.duration = t.calculateDuration(n)) : "start_date" == i || "duration" == i ? n.end_date = t.calculateEndDate(n) : "end_date" == i && (n.duration = t.calculateDuration(n))
}(n, i)
}
;
function e(e) {
return t.calculateEndDate({
start_date: e.end_date,
duration: -e.duration,
task: e
})
}
}
}
, function(t, e, n) {
t.exports = function(t) {
var e = n(10)(t)
, i = n(0);
function r() {
return e.apply(this, arguments) || this
}
function a(e) {
return e.formatter || t.ext.formatters.durationFormatter()
}
return n(3)(r, e),
i.mixin(r.prototype, {
show: function(t, e, n, i) {
var r = "");
i.innerHTML = r
},
set_value: function(t, e, n, i) {
this.get_input(i).value = a(n.editor).format(t)
},
get_value: function(t, e, n) {
return a(e.editor).parse(this.get_input(n).value || "")
}
}, !0),
r
}
}
, function(t, e, n) {
t.exports = function(t) {
var e = n(10)(t)
, i = n(0);
function r() {
return e.apply(this, arguments) || this
}
function a(e) {
return e.formatter || t.ext.formatters.linkFormatter()
}
function o(t, e) {
for (var n = (t || "").split(e.delimiter || ","), i = 0; i < n.length; i++) {
var r = n[i].trim();
r ? n[i] = r : (n.splice(i, 1),
i--)
}
return n.sort(),
n
}
function s(t, e, n) {
for (var i = t.$target, r = [], o = 0; o < i.length; o++) {
var s = n.getLink(i[o]);
r.push(a(e).format(s))
}
return r.join((e.delimiter || ",") + " ")
}
function l(t) {
return t.source + "_" + t.target + "_" + t.type + "_" + (t.lag || 0)
}
function c(e, n, i) {
var r = function(e, n, i) {
var r = [];
return n.forEach(function(n) {
var o = a(i).parse(n);
o && (o.target = e,
o.id = "predecessor_generated",
t.isLinkAllowed(o) && (o.id = void 0,
r.push(o)))
}),
r
}(e.id, n, i)
, o = {};
e.$target.forEach(function(e) {
var n = t.getLink(e);
o[l(n)] = n.id
});
var s = [];
r.forEach(function(t) {
var e = l(t);
o[e] ? delete o[e] : s.push(t)
});
var c = [];
for (var u in o)
c.push(o[u]);
return {
add: s,
remove: c
}
}
return n(3)(r, e),
i.mixin(r.prototype, {
show: function(t, e, n, i) {
var r = "");
i.innerHTML = r
},
hide: function() {},
set_value: function(e, n, i, r) {
this.get_input(r).value = s(e, i.editor, t)
},
get_value: function(t, e, n) {
return o(this.get_input(n).value || "", e.editor)
},
save: function(e, n, i) {
var r = c(t.getTask(e), this.get_value(e, n, i), n.editor);
(r.add.length || r.remove.length) && t.batchUpdate(function() {
r.add.forEach(function(e) {
t.addLink(e)
}),
r.remove.forEach(function(e) {
t.deleteLink(e)
}),
t.autoSchedule && t.autoSchedule()
})
},
is_changed: function(e, n, i, r) {
var a = this.get_value(n, i, r)
, l = o(s(e, i.editor, t), i.editor);
return a.join() !== l.join()
}
}, !0),
r
}
}
, function(t, e, n) {
t.exports = function(t) {
var e = n(10)(t)
, i = n(0)
, r = "%Y-%m-%d"
, a = null
, o = null;
function s() {
return e.apply(this, arguments) || this
}
return n(3)(s, e),
i.mixin(s.prototype, {
show: function(e, n, i, s) {
a || (a = t.date.date_to_str(r)),
o || (o = t.date.str_to_date(r));
var l = null
, c = null;
l = "function" == typeof i.min ? i.min(e, n) : i.min,
c = "function" == typeof i.max ? i.max(e, n) : i.max;
var u = l ? " min='" + a(l) + "' " : ""
, d = c ? " max='" + a(c) + "' " : ""
, h = "");
s.innerHTML = h
},
set_value: function(t, e, n, i) {
t && t.getFullYear ? this.get_input(i).value = a(t) : this.get_input(i).value = t
},
is_valid: function(t, e, n, i) {
return !(!t || isNaN(t.getTime()))
},
get_value: function(t, e, n) {
var i;
try {
i = o(this.get_input(n).value || "")
} catch (t) {
i = null
}
return i
}
}, !0),
s
}
}
, function(t, e, n) {
t.exports = function(t) {
var e = n(10)(t)
, i = n(0);
function r() {
return e.apply(this, arguments) || this
}
return n(3)(r, e),
i.mixin(r.prototype, {
show: function(t, e, n, i) {
for (var r = "",
i.innerHTML = r
},
get_input: function(t) {
return t.querySelector("select")
}
}, !0),
r
}
}
, function(t, e, n) {
t.exports = function(t) {
var e = n(10)(t)
, i = n(0);
function r() {
return e.apply(this, arguments) || this
}
return n(3)(r, e),
i.mixin(r.prototype, {
show: function(t, e, n, i) {
var r = n.min || 0
, a = n.max || 100
, o = "");
i.innerHTML = o
},
get_value: function(t, e, n) {
return this.get_input(n).value || ""
},
is_valid: function(t, e, n, i) {
return !isNaN(parseInt(t, 10))
}
}, !0),
r
}
}
, function(t, e, n) {
t.exports = function(t) {
var e = n(10)(t)
, i = n(0);
function r() {
return e.apply(this, arguments) || this
}
return n(3)(r, e),
i.mixin(r.prototype, {
show: function(t, e, n, i) {
var r = "");
i.innerHTML = r
}
}, !0),
r
}
}
, function(t, e) {
t.exports = {
init: function(t, e) {
var n = t
, i = e.$gantt
, r = null
, a = i.ext.keyboardNavigation;
a.attachEvent("onBeforeFocus", function(e) {
var i = t.locateCell(e);
if (clearTimeout(r),
i) {
var a = i.columnName
, o = i.id
, s = n.getState();
if (n.isVisible() && s.id == o && s.columnName === a)
return !1
}
return !0
}),
a.attachEvent("onFocus", function(e) {
var i = t.locateCell(e)
, a = t.getState();
return clearTimeout(r),
!i || i.id == a.id && i.columnName == a.columnName || n.isVisible() && n.save(),
!0
}),
t.attachEvent("onHide", function() {
clearTimeout(r)
}),
a.attachEvent("onBlur", function() {
return r = setTimeout(function() {
n.save()
}),
!0
}),
i.attachEvent("onTaskDblClick", function(e, n) {
var i = t.getState()
, r = t.locateCell(n.target);
return !r || !t.isVisible() || r.columnName != i.columnName
}),
i.attachEvent("onTaskClick", function(e, n) {
if (i._is_icon_open_click(n))
return !0;
var r = t.getState()
, a = t.locateCell(n.target);
return !a || !t.getEditorConfig(a.columnName) || (t.isVisible() && r.id == a.id && r.columnName == a.columnName || t.startEdit(a.id, a.columnName),
!1)
}),
i.attachEvent("onEmptyClick", function() {
return n.save(),
!0
}),
a.attachEvent("onKeyDown", function(e, r) {
var o = t.locateCell(r.target)
, s = !!o && t.getEditorConfig(o.columnName)
, l = t.getState()
, c = i.constants.KEY_CODES
, u = r.keyCode
, d = !1;
switch (u) {
case c.ENTER:
t.isVisible() ? (t.save(),
r.preventDefault(),
d = !0) : s && !(r.ctrlKey || r.metaKey || r.shiftKey) && (n.startEdit(o.id, o.columnName),
r.preventDefault(),
d = !0);
break;
case c.ESC:
t.isVisible() && (t.hide(),
r.preventDefault(),
d = !0);
break;
case c.UP:
case c.DOWN:
break;
case c.LEFT:
case c.RIGHT:
(s && t.isVisible() || "date" === l.editorType) && (d = !0);
break;
case c.SPACE:
t.isVisible() && (d = !0),
s && !t.isVisible() && (n.startEdit(o.id, o.columnName),
r.preventDefault(),
d = !0);
break;
case c.DELETE:
s && !t.isVisible() ? (n.startEdit(o.id, o.columnName),
d = !0) : s && t.isVisible() && (d = !0);
break;
case c.TAB:
if (t.isVisible()) {
r.shiftKey ? t.editPrevCell(!0) : t.editNextCell(!0);
var h = t.getState();
h.id && a.focus({
type: "taskCell",
id: h.id,
column: h.columnName
}),
r.preventDefault(),
d = !0
}
break;
default:
if (t.isVisible())
d = !0;
else if (u >= 48 && u <= 57 || u > 95 && u < 112 || u >= 64 && u <= 91 || u > 185 && u < 193 || u > 218 && u < 223) {
var f = e.modifiers
, _ = f.alt || f.ctrl || f.meta || f.shift;
f.alt || _ && a.getCommandHandler(e, "taskCell") || s && !t.isVisible() && (n.startEdit(o.id, o.columnName),
d = !0)
}
}
return !d
})
},
onShow: function(t, e, n) {},
onHide: function(t, e, n) {
n.$gantt.focus()
},
destroy: function() {}
}
}
, function(t, e) {
t.exports = {
init: function(t, e) {
var n = e.$gantt;
n.attachEvent("onTaskClick", function(e, i) {
if (n._is_icon_open_click(i))
return !0;
var r = t.getState()
, a = t.locateCell(i.target);
return !a || !t.getEditorConfig(a.columnName) || (t.isVisible() && r.id == a.id && r.columnName == a.columnName || t.startEdit(a.id, a.columnName),
!1)
}),
n.attachEvent("onEmptyClick", function() {
return t.isVisible() && t.isChanged() ? t.save() : t.hide(),
!0
}),
n.attachEvent("onTaskDblClick", function(e, n) {
var i = t.getState()
, r = t.locateCell(n.target);
return !r || !t.isVisible() || r.columnName != i.columnName
})
},
onShow: function(t, e, n) {
var i = n.$gantt;
i.ext && i.ext.keyboardNavigation && i.ext.keyboardNavigation.attachEvent("onKeyDown", function(e, n) {
var r = i.constants.KEY_CODES
, a = !1;
switch (n.keyCode) {
case r.SPACE:
t.isVisible() && (a = !0)
}
return !a
});
e.onkeydown = function(e) {
e = e || window.event;
var n = i.constants.KEY_CODES;
if (!(e.defaultPrevented || e.shiftKey && e.keyCode != n.TAB)) {
var r = !0;
switch (e.keyCode) {
case i.keys.edit_save:
t.save();
break;
case i.keys.edit_cancel:
t.hide();
break;
case n.UP:
case n.DOWN:
t.isVisible() && (t.hide(),
r = !1);
break;
case n.TAB:
e.shiftKey ? t.editPrevCell(!0) : t.editNextCell(!0);
break;
default:
r = !1
}
r && e.preventDefault()
}
}
},
onHide: function() {},
destroy: function() {}
}
}
, function(t, e, n) {
var i = n(125)
, r = n(124);
t.exports = function(t) {
var e = null;
return {
setMapping: function(t) {
e = t
},
getMapping: function() {
return e || (t.config.keyboard_navigation_cells && t.ext.keyboardNavigation ? r : i)
}
}
}
}
, function(t, e, n) {
var i = n(126)
, r = n(123)
, a = n(122)
, o = n(121)
, s = n(120)
, l = n(119)
, c = n(118)
, u = n(0)
, d = n(1)
, h = n(5)
, f = n(117);
function _(t) {
t.config.editor_types = {
text: new (r(t)),
number: new (a(t)),
select: new (o(t)),
date: new (s(t)),
predecessor: new (l(t)),
duration: new (c(t))
}
}
t.exports = function(t) {
var e = i(t)
, n = {};
h(n);
var r = {
init: _,
createEditors: function(i) {
function r(e, n) {
var r = i.$getConfig()
, a = function(t, e) {
for (var n = i.$getConfig(), r = i.getItemTop(t), a = i.getItemHeight(t), o = i.getGridColumns(), s = 0, l = 0, c = 0, u = 0; u < o.length; u++) {
if (o[u].name == e) {
c = o[u].width;
break
}
n.rtl ? l += o[u].width : s += o[u].width
}
return n.rtl ? {
top: r,
right: l,
height: a,
width: c
} : {
top: r,
left: s,
height: a,
width: c
}
}(e, n)
, o = document.createElement("div");
o.className = "gantt_grid_editor_placeholder",
o.setAttribute(i.$config.item_attribute, e),
o.setAttribute(i.$config.bind + "_id", e),
o.setAttribute("data-column-name", n);
var s = function(t, e) {
for (var n = t.getGridColumns(), i = 0; i < n.length; i++)
if (n[i].name == e)
return i;
return 0
}(i, n);
return o.setAttribute("data-column-index", s),
t._waiAria.inlineEditorAttr(o),
r.rtl ? o.style.cssText = ["top:" + a.top + "px", "right:" + a.right + "px", "width:" + a.width + "px", "height:" + a.height + "px"].join(";") : o.style.cssText = ["top:" + a.top + "px", "left:" + a.left + "px", "width:" + a.width + "px", "height:" + a.height + "px"].join(";"),
o
}
var a = f(t)
, o = []
, s = []
, l = null
, c = {
_itemId: null,
_columnName: null,
_editor: null,
_editorType: null,
_placeholder: null,
locateCell: function(t) {
if (!d.isChildOf(t, i.$grid))
return null;
var e = d.locateAttribute(t, i.$config.item_attribute)
, n = d.locateAttribute(t, "data-column-name");
if (e && n) {
var r = n.getAttribute("data-column-name");
return {
id: e.getAttribute(i.$config.item_attribute),
columnName: r
}
}
return null
},
getEditorConfig: function(t) {
return i.getColumn(t).editor
},
init: function() {
var n = e.getMapping();
n.init && n.init(this, i),
l = i.$gantt.getDatastore(i.$config.bind);
var r = this;
o.push(l.attachEvent("onIdChange", function(t, e) {
r._itemId == t && (r._itemId = e)
})),
o.push(l.attachEvent("onStoreUpdated", function() {
i.$gantt.getState("batchUpdate").batch_update || r.isVisible() && !l.isVisible(r._itemId) && r.hide()
})),
s.push(t.attachEvent("onDataRender", function() {
r._editor && r._placeholder && !d.isChildOf(r._placeholder, t.$root) && i.$grid_data.appendChild(r._placeholder)
})),
this.init = function() {}
},
getState: function() {
return {
editor: this._editor,
editorType: this._editorType,
placeholder: this._placeholder,
id: this._itemId,
columnName: this._columnName
}
},
startEdit: function(e, n) {
if (this.isVisible() && this.save(),
l.exists(e)) {
var i = {
id: e,
columnName: n
};
t.isReadonly(l.getItem(e)) ? this.callEvent("onEditPrevent", [i]) : !1 !== this.callEvent("onBeforeEditStart", [i]) ? (this.show(i.id, i.columnName),
this.setValue(),
this.callEvent("onEditStart", [i])) : this.callEvent("onEditPrevent", [i])
}
},
isVisible: function() {
return !(!this._editor || !d.isChildOf(this._placeholder, t.$root))
},
show: function(t, n) {
this.isVisible() && this.save();
var a = {
id: t,
columnName: n
}
, o = i.getColumn(a.columnName)
, s = this.getEditorConfig(o.name);
if (s) {
var l = i.$getConfig().editor_types[s.type]
, c = r(a.id, a.columnName);
i.$grid_data.appendChild(c),
l.show(a.id, o, s, c),
this._editor = l,
this._placeholder = c,
this._itemId = a.id,
this._columnName = a.columnName,
this._editorType = s.type;
var u = e.getMapping();
u.onShow && u.onShow(this, c, i)
}
},
setValue: function() {
var t = this.getState()
, e = t.id
, n = t.columnName
, r = i.getColumn(n)
, a = l.getItem(e)
, o = this.getEditorConfig(n);
if (o) {
var s = a[o.map_to];
"auto" == o.map_to && (s = l.getItem(e)),
this._editor.set_value(s, e, r, this._placeholder),
this.focus()
}
},
focus: function() {
this._editor.focus(this._placeholder)
},
getValue: function() {
var t = i.getColumn(this._columnName);
return this._editor.get_value(this._itemId, t, this._placeholder)
},
_getItemValue: function() {
var e = this.getEditorConfig(this._columnName);
if (e) {
var n = t.getTask(this._itemId)[e.map_to];
return "auto" == e.map_to && (n = l.getItem(this._itemId)),
n
}
},
isChanged: function() {
var t = i.getColumn(this._columnName)
, e = this._getItemValue();
return this._editor.is_changed(e, this._itemId, t, this._placeholder)
},
hide: function() {
if (this._itemId) {
var t = this._itemId
, n = this._columnName
, r = e.getMapping();
r.onHide && r.onHide(this, this._placeholder, i),
this._itemId = null,
this._columnName = null,
this._editorType = null,
this._placeholder && (this._editor && this._editor.hide && this._editor.hide(this._placeholder),
this._editor = null,
this._placeholder.parentNode && this._placeholder.parentNode.removeChild(this._placeholder),
this._placeholder = null,
this.callEvent("onEditEnd", [{
id: t,
columnName: n
}]))
}
},
save: function() {
if (this.isVisible() && l.exists(this._itemId) && this.isChanged()) {
var e = this._itemId
, n = this._columnName;
if (l.exists(e)) {
var r = l.getItem(e)
, o = this.getEditorConfig(n)
, s = {
id: e,
columnName: n,
newValue: this.getValue(),
oldValue: this._getItemValue()
};
if (!1 !== this.callEvent("onBeforeSave", [s]) && (!this._editor.is_valid || this._editor.is_valid(s.newValue, s.id, i.getColumn(n), this._placeholder))) {
var c = o.map_to
, u = s.newValue;
"auto" != c ? (r[c] = u,
a(r, c, t.config.inline_editors_date_processing),
l.updateItem(e)) : this._editor.save(e, i.getColumn(n), this._placeholder),
this.callEvent("onSave", [s])
}
this.hide()
}
} else
this.hide()
},
_findEditableCell: function(t, e) {
var n = t
, r = i.getGridColumns()[n]
, a = r ? r.name : null;
if (a) {
for (; a && !this.getEditorConfig(a); )
a = this._findEditableCell(t + e, e);
return a
}
return null
},
getNextCell: function(t) {
return this._findEditableCell(i.getColumnIndex(this._columnName, !0) + t, t)
},
getFirstCell: function() {
return this._findEditableCell(0, 1)
},
getLastCell: function() {
return this._findEditableCell(i.getGridColumns().length - 1, -1)
},
editNextCell: function(t) {
var e = this.getNextCell(1);
if (e) {
var n = this.getNextCell(1);
n && this.getEditorConfig(n) && this.startEdit(this._itemId, n)
} else if (t && this.moveRow(1)) {
var i = this.moveRow(1);
(e = this.getFirstCell()) && this.getEditorConfig(e) && this.startEdit(i, e)
}
},
editPrevCell: function(t) {
var e = this.getNextCell(-1);
if (e) {
var n = this.getNextCell(-1);
n && this.getEditorConfig(n) && this.startEdit(this._itemId, n)
} else if (t && this.moveRow(-1)) {
var i = this.moveRow(-1);
(e = this.getLastCell()) && this.getEditorConfig(e) && this.startEdit(i, e)
}
},
moveRow: function(e) {
for (var n = e > 0 ? t.getNext : t.getPrev, i = (n = t.bind(n, t))(this._itemId); t.isTaskExists(i) && t.isReadonly(t.getTask(i)); )
i = n(i);
return i
},
editNextRow: function(e) {
var n = this.getState().id;
if (t.isTaskExists(n)) {
var i = null;
i = e ? this.moveRow(1) : t.getNext(n),
t.isTaskExists(i) && this.startEdit(i, this._columnName)
}
},
editPrevRow: function(e) {
var n = this.getState().id;
if (t.isTaskExists(n)) {
var i = null;
i = e ? this.moveRow(-1) : t.getPrev(n),
t.isTaskExists(i) && this.startEdit(i, this._columnName)
}
},
destructor: function() {
o.forEach(function(t) {
l.detachEvent(t)
}),
s.forEach(function(e) {
t.detachEvent(e)
}),
o = [],
s = [],
l = null,
this.hide(),
this.detachAllEvents()
}
};
return u.mixin(c, e),
u.mixin(c, n),
c
}
};
return u.mixin(r, e),
u.mixin(r, n),
r
}
}
, function(t, e) {
t.exports = {
create: function() {
return {
render: function() {},
destroy: function() {}
}
}
}
}
, function(t, e, n) {
var i = n(3)
, r = n(1)
, a = n(0)
, o = n(11)
, s = function(t) {
"use strict";
var e = ["altKey", "shiftKey", "metaKey"];
function n(e, n, i, r) {
var o = t.apply(this, arguments) || this;
this.$config = a.mixin(n, {
scroll: "x"
}),
o._scrollHorizontalHandler = a.bind(o._scrollHorizontalHandler, o),
o._scrollVerticalHandler = a.bind(o._scrollVerticalHandler, o),
o._outerScrollVerticalHandler = a.bind(o._outerScrollVerticalHandler, o),
o._outerScrollHorizontalHandler = a.bind(o._outerScrollHorizontalHandler, o),
o._mouseWheelHandler = a.bind(o._mouseWheelHandler, o),
this.$config.hidden = !0;
var s = r.config.scroll_size;
return r.env.isIE && (s += 1),
this._isHorizontal() ? (o.$config.height = s,
o.$parent.$config.height = s) : (o.$config.width = s,
o.$parent.$config.width = s),
this.$config.scrollPosition = 0,
o.$name = "scroller",
o
}
return i(n, t),
n.prototype.init = function(t) {
t.innerHTML = this.$toHTML(),
this.$view = t.firstChild,
this.$view || this.init(),
this._isVertical() ? this._initVertical() : this._initHorizontal(),
this._initMouseWheel(),
this._initLinkedViews()
}
,
n.prototype.$toHTML = function() {
return "
"
}
,
n.prototype._getRootParent = function() {
for (var t = this.$parent; t && t.$parent; )
t = t.$parent;
if (t)
return t
}
,
n.prototype._eachView = function() {
var t = [];
return function t(e, n) {
if (n.push(e),
e.$cells)
for (var i = 0; i < e.$cells.length; i++)
t(e.$cells[i], n)
}(this._getRootParent(), t),
t
}
,
n.prototype._getLinkedViews = function() {
for (var t = this._eachView(), e = [], n = 0; n < t.length; n++)
t[n].$config && (this._isVertical() && t[n].$config.scrollY == this.$id || this._isHorizontal() && t[n].$config.scrollX == this.$id) && e.push(t[n]);
return e
}
,
n.prototype._initHorizontal = function() {
this.$scroll_hor = this.$view,
this.$domEvents.attach(this.$view, "scroll", this._scrollHorizontalHandler)
}
,
n.prototype._initLinkedViews = function() {
for (var t = this._getLinkedViews(), e = this._isVertical() ? "gantt_layout_outer_scroll gantt_layout_outer_scroll_vertical" : "gantt_layout_outer_scroll gantt_layout_outer_scroll_horizontal", n = 0; n < t.length; n++)
r.addClassName(t[n].$view || t[n].getNode(), e)
}
,
n.prototype._initVertical = function() {
this.$scroll_ver = this.$view,
this.$domEvents.attach(this.$view, "scroll", this._scrollVerticalHandler)
}
,
n.prototype._updateLinkedViews = function() {}
,
n.prototype._initMouseWheel = function() {
o.isFF ? this.$domEvents.attach(this._getRootParent().$view, "wheel", this._mouseWheelHandler, {
passive: !1
}) : this.$domEvents.attach(this._getRootParent().$view, "mousewheel", this._mouseWheelHandler, {
passive: !1
})
}
,
n.prototype.scrollHorizontally = function(t) {
if (!this._scrolling) {
this._scrolling = !0,
this.$scroll_hor.scrollLeft = t,
this.$config.codeScrollLeft = t,
t = this.$scroll_hor.scrollLeft;
for (var e = this._getLinkedViews(), n = 0; n < e.length; n++)
e[n].scrollTo && e[n].scrollTo(t, void 0);
var i = this.$config.scrollPosition;
this.$config.scrollPosition = t,
this.callEvent("onScroll", [i, t, this.$config.scroll]),
this._scrolling = !1
}
}
,
n.prototype.scrollVertically = function(t) {
if (!this._scrolling) {
this._scrolling = !0,
this.$scroll_ver.scrollTop = t,
t = this.$scroll_ver.scrollTop;
for (var e = this._getLinkedViews(), n = 0; n < e.length; n++)
e[n].scrollTo && e[n].scrollTo(void 0, t);
var i = this.$config.scrollPosition;
this.$config.scrollPosition = t,
this.callEvent("onScroll", [i, t, this.$config.scroll]),
this._scrolling = !1
}
}
,
n.prototype._isVertical = function() {
return "y" == this.$config.scroll
}
,
n.prototype._isHorizontal = function() {
return "x" == this.$config.scroll
}
,
n.prototype._scrollHorizontalHandler = function(t) {
if (!this._isVertical() && !this._scrolling) {
if (new Date - (this._wheel_time || 0) < 100)
return !0;
var e = this.$scroll_hor.scrollLeft;
this.scrollHorizontally(e),
this._oldLeft = this.$scroll_hor.scrollLeft
}
}
,
n.prototype._outerScrollHorizontalHandler = function(t) {
this._isVertical()
}
,
n.prototype.show = function() {
this.$parent.show()
}
,
n.prototype.hide = function() {
this.$parent.hide()
}
,
n.prototype._getScrollSize = function() {
for (var t, e = 0, n = 0, i = this._isHorizontal(), r = this._getLinkedViews(), a = i ? "scrollWidth" : "scrollHeight", o = i ? "contentX" : "contentY", s = i ? "x" : "y", l = this._getScrollOffset(), c = 0; c < r.length; c++)
if ((t = r[c]) && t.$content && t.$content.getSize && !t.$config.hidden) {
var u, d = t.$content.getSize();
if (u = d.hasOwnProperty(a) ? d[a] : d[o],
l)
d[o] > d[s] && d[o] > e && u > d[s] - l + 2 && (e = u + (i ? 0 : 2),
n = d[s]);
else {
var h = Math.max(d[o] - u, 0);
(u += h) > Math.max(d[s] - h, 0) && u > e && (e = u,
n = d[s])
}
}
return {
outerScroll: n,
innerScroll: e
}
}
,
n.prototype.scroll = function(t) {
this._isHorizontal() ? this.scrollHorizontally(t) : this.scrollVertically(t)
}
,
n.prototype.getScrollState = function() {
return {
visible: this.isVisible(),
direction: this.$config.scroll,
size: this.$config.outerSize,
scrollSize: this.$config.scrollSize || 0,
position: this.$config.scrollPosition || 0
}
}
,
n.prototype.setSize = function(e, n) {
t.prototype.setSize.apply(this, arguments);
var i = this._getScrollSize()
, r = (this._isVertical() ? n : e) - this._getScrollOffset() + (this._isHorizontal() ? 1 : 0);
i.innerScroll && r > i.outerScroll && (i.innerScroll += r - i.outerScroll),
this.$config.scrollSize = i.innerScroll,
this.$config.width = e,
this.$config.height = n,
this._setScrollSize(i.innerScroll)
}
,
n.prototype.isVisible = function() {
return !(!this.$parent || !this.$parent.$view.parentNode)
}
,
n.prototype.shouldShow = function() {
var t = this._getScrollSize();
return !(!t.innerScroll && this.$parent && this.$parent.$view.parentNode) && !(!t.innerScroll || this.$parent && this.$parent.$view.parentNode)
}
,
n.prototype.shouldHide = function() {
return !(this._getScrollSize().innerScroll || !this.$parent || !this.$parent.$view.parentNode)
}
,
n.prototype.toggleVisibility = function() {
this.shouldHide() ? this.hide() : this.shouldShow() && this.show()
}
,
n.prototype._getScaleOffset = function(t) {
var e = 0;
return !t || "timeline" != t.$config.view && "grid" != t.$config.view || (e = t.$content.$getConfig().scale_height),
e
}
,
n.prototype._getScrollOffset = function() {
var t = 0;
if (this._isVertical()) {
var e = this.$parent.$parent;
t = Math.max(this._getScaleOffset(e.getPrevSibling(this.$parent.$id)), this._getScaleOffset(e.getNextSibling(this.$parent.$id)))
} else
for (var n = this._getLinkedViews(), i = 0; i < n.length; i++) {
var r = n[i].$parent.$cells
, a = r[r.length - 1];
if (a && "scrollbar" == a.$config.view && !1 === a.$config.hidden) {
t = a.$config.width;
break
}
}
return t || 0
}
,
n.prototype._setScrollSize = function(t) {
var e = this._isHorizontal() ? "width" : "height"
, n = this._isHorizontal() ? this.$scroll_hor : this.$scroll_ver
, i = this._getScrollOffset()
, a = n.firstChild;
i ? this._isVertical() ? (this.$config.outerSize = this.$config.height - i + 3,
n.style.height = this.$config.outerSize + "px",
n.style.top = i - 1 + "px",
r.addClassName(n, this.$parent._borders.top),
r.addClassName(n.parentNode, "gantt_task_vscroll")) : (this.$config.outerSize = this.$config.width - i + 1,
n.style.width = this.$config.outerSize + "px") : (n.style.top = "auto",
r.removeClassName(n, this.$parent._borders.top),
r.removeClassName(n.parentNode, "gantt_task_vscroll"),
this.$config.outerSize = this.$config.height),
a.style[e] = t + "px"
}
,
n.prototype._scrollVerticalHandler = function(t) {
if (!this._scrollHorizontalHandler() && !this._scrolling) {
var e = this.$scroll_ver.scrollTop;
e != this._oldTop && (this.scrollVertically(e),
this._oldTop = this.$scroll_ver.scrollTop)
}
}
,
n.prototype._outerScrollVerticalHandler = function(t) {
this._scrollHorizontalHandler()
}
,
n.prototype._checkWheelTarget = function(t) {
for (var e = this._getLinkedViews().concat(this), n = 0; n < e.length; n++) {
var i = e[n].$view;
if (r.isChildOf(t, i))
return !0
}
return !1
}
,
n.prototype._mouseWheelHandler = function(t) {
var n = t.target || t.srcElement;
if (this._checkWheelTarget(n)) {
this._wheel_time = new Date;
var i = {}
, r = {
x: 1,
y: 1
}
, a = this.$gantt.config.wheel_scroll_sensitivity;
"number" == typeof a && a ? r = {
x: a,
y: a
} : "[object Object]" == {}.toString.apply(a) && (r = {
x: a.x,
y: a.y
});
var s = o.isFF
, l = s ? t.deltaX : t.wheelDeltaX
, c = s ? t.deltaY : t.wheelDelta
, u = -20;
s && (u = 0 !== t.deltaMode ? -40 : -10);
var d = s ? l * u * r.x : 2 * l * r.x
, h = s ? c * u * r.y : c * r.y
, f = this.$gantt.config.horizontal_scroll_key;
if (!1 !== f && e.indexOf(f) >= 0 && (!t[f] || t.deltaX || t.wheelDeltaX || (d = 2 * h,
h = 0)),
d && Math.abs(d) > Math.abs(h)) {
if (this._isVertical())
return;
if (i.x)
return !0;
if (!this.$scroll_hor || !this.$scroll_hor.offsetWidth)
return !0;
var _ = d / -40
, g = this._oldLeft
, p = g + 30 * _;
if (this.scrollHorizontally(p),
this.$scroll_hor.scrollLeft = p,
g == this.$scroll_hor.scrollLeft)
return !0;
this._oldLeft = this.$scroll_hor.scrollLeft
} else {
if (this._isHorizontal())
return;
if (i.y)
return !0;
if (!this.$scroll_ver || !this.$scroll_ver.offsetHeight)
return !0;
_ = h / -40;
void 0 === h && (_ = t.detail);
var v = this._oldTop
, m = this.$scroll_ver.scrollTop + 30 * _;
if (this.scrollVertically(m),
this.$scroll_ver.scrollTop = m,
v == this.$scroll_ver.scrollTop)
return !0;
this._oldTop = this.$scroll_ver.scrollTop
}
return t.preventDefault && t.preventDefault(),
t.cancelBubble = !0,
!1
}
}
,
n
}(n(14));
t.exports = s
}
, function(t, e) {
t.exports = null
}
, function(t, e, n) {
var i = n(3)
, r = n(0)
, a = function(t) {
"use strict";
function e(e, n, i) {
var a = t.apply(this, arguments) || this;
if (n.view) {
n.id && (this.$id = r.uid());
var o = r.copy(n);
if (delete o.config,
delete o.templates,
this.$content = this.$factory.createView(n.view, this, o, this),
!this.$content)
return !1
}
return a.$name = "viewCell",
a
}
return i(e, t),
e.prototype.destructor = function() {
this.clear(),
t.prototype.destructor.call(this)
}
,
e.prototype.clear = function() {
if (this.$initialized = !1,
this.$content) {
var e = this.$content.unload || this.$content.destructor;
e && e.call(this.$content)
}
t.prototype.clear.call(this)
}
,
e.prototype.scrollTo = function(e, n) {
this.$content && this.$content.scrollTo ? this.$content.scrollTo(e, n) : t.prototype.scrollTo.call(this, e, n)
}
,
e.prototype._setContentSize = function(t, e) {
var n = this._getBorderSizes();
if ("number" == typeof t) {
var i = t + n.horizontal;
this.$config.width = i
}
if ("number" == typeof e) {
var r = e + n.vertical;
this.$config.height = r
}
}
,
e.prototype.setSize = function(e, n) {
if (t.prototype.setSize.call(this, e, n),
!this.$preResize && this.$content && !this.$initialized) {
this.$initialized = !0;
var i = this.$view.childNodes[0]
, r = this.$view.childNodes[1];
r || (r = i),
this.$content.init(r)
}
}
,
e.prototype.setContentSize = function() {
!this.$preResize && this.$content && this.$initialized && this.$content.setSize(this.$lastSize.contentX, this.$lastSize.contentY)
}
,
e.prototype.getContentSize = function() {
var e = t.prototype.getContentSize.call(this);
if (this.$content && this.$initialized) {
var n = this.$content.getSize();
e.width = void 0 === n.contentX ? n.width : n.contentX,
e.height = void 0 === n.contentY ? n.height : n.contentY
}
var i = this._getBorderSizes();
return e.width += i.horizontal,
e.height += i.vertical,
e
}
,
e
}(n(14));
t.exports = a
}
, function(t, e, n) {
var i = n(3)
, r = n(38)
, a = n(14)
, o = function(t) {
"use strict";
function e(e, n, i) {
for (var r = t.apply(this, arguments) || this, a = 0; a < r.$cells.length; a++)
r.$cells[a].$config.hidden = 0 !== a;
return r.$cell = r.$cells[0],
r.$name = "viewLayout",
r
}
return i(e, t),
e.prototype.cell = function(e) {
var n = t.prototype.cell.call(this, e);
return n.$view || this.$fill(null, this),
n
}
,
e.prototype.moveView = function(t) {
var e = this.$view;
this.$cell && (this.$cell.$config.hidden = !0,
e.removeChild(this.$cell.$view)),
this.$cell = t,
e.appendChild(t.$view)
}
,
e.prototype.setSize = function(t, e) {
a.prototype.setSize.call(this, t, e)
}
,
e.prototype.setContentSize = function() {
var t = this.$lastSize;
this.$cell.setSize(t.contentX, t.contentY)
}
,
e.prototype.getSize = function() {
var e = t.prototype.getSize.call(this);
if (this.$cell) {
var n = this.$cell.getSize();
if (this.$config.byMaxSize)
for (var i = 0; i < this.$cells.length; i++) {
var r = this.$cells[i].getSize();
for (var a in n)
n[a] = Math.max(n[a], r[a])
}
for (var o in e)
e[o] = e[o] || n[o];
e.gravity = Math.max(e.gravity, n.gravity)
}
return e
}
,
e
}(r);
t.exports = o
}
, function(t, e) {
t.exports = function(t, e, n) {
if (!t.start_date || !t.end_date)
return null;
var i = e.posFromDate(t.start_date)
, r = e.posFromDate(t.end_date)
, a = Math.min(i, r) - 200
, o = Math.max(i, r) + 200;
return {
top: e.getItemTop(t.id),
height: e.getItemHeight(t.id),
left: a,
width: o - a
}
}
}
, function(t, e, n) {
var i = n(133);
t.exports = function(t, e, n, r) {
if (!r.isTaskExists(t.source))
return null;
if (!r.isTaskExists(t.target))
return null;
var a = i(r.getTask(t.source), e, r)
, o = i(r.getTask(t.target), e, r);
if (!a || !o)
return null;
var s = Math.min(a.left, o.left) - 100
, l = Math.max(a.left + a.width, o.left + o.width) + 100
, c = Math.min(a.top, o.top) - 100
, u = Math.max(a.top + a.height, o.top + o.height) + 100;
return {
top: c,
height: u - c,
bottom: u,
left: s,
width: l - s,
right: l
}
}
}
, function(t, e) {
t.exports = function(t, e) {
return !!e && (!(e.left > t.x_end || e.left + e.width < t.x) && !(e.top > t.y_end || e.top + e.height < t.y))
}
}
, function(t, e, n) {
var i = n(135)
, r = n(20)
, a = n(30)
, o = n(6);
t.exports = function(t) {
var e = {}
, n = {};
function s(e) {
var n = null;
return "string" == typeof e.view ? n = t.$ui.getView(e.view) : e.view && (n = e.view),
n
}
function l(l, c, u) {
if (n[l])
return n[l];
c.renderer || t.assert(!1, "Invalid renderer call");
var d = null
, h = null
, f = null
, _ = null
, g = null;
"function" == typeof c.renderer ? (d = c.renderer,
f = a) : (d = c.renderer.render,
h = c.renderer.update,
_ = c.renderer.onrender,
c.renderer.isInViewPort ? g = c.renderer.isInViewPort : f = c.renderer.getRectangle,
f || null === f || (f = a));
var p = c.filter;
return u && u.setAttribute(t.config.layer_attribute, !0),
n[l] = {
render_item: function(e, n, a, o, l) {
if (n = n || u,
!p || p(e)) {
var h = o || s(c)
, v = l || (h ? h.$getConfig() : null)
, m = a;
!m && v && v.smart_rendering && (m = h.getViewPort());
var y = null;
!r(t) && (f || g) && m ? (g ? g(e, m, h, v, t) : i(m, f(e, h, v, t))) && (y = d.call(t, e, h, v, m)) : y = d.call(t, e, h, v, m),
this.append(e, y, n);
var k = 11 == n.nodeType;
_ && !k && y && _.call(t, e, y, h)
} else
this.remove_item(e.id)
},
clear: function(t) {
this.rendered = e[l] = {},
c.append || this.clear_container(t)
},
clear_container: function(t) {
(t = t || u) && (t.innerHTML = "")
},
get_visible_range: function(e) {
var n, i, r = s(c), a = r ? r.$getConfig() : null;
return a && a.smart_rendering && (n = r.getViewPort()),
r && n && ("function" == typeof c.renderer ? i = o(t, r, a, e, n) : c.renderer && c.renderer.getVisibleRange && (i = c.renderer.getVisibleRange(t, r, a, e, n))),
i || (i = {
start: 0,
end: e.count()
}),
i
},
prepare_data: function(e) {
if (c.renderer && c.renderer.prepareData)
return c.renderer.prepareData(e, t, c)
},
render_items: function(e, n) {
n = n || u;
var i = document.createDocumentFragment();
this.clear(n);
var r = null
, a = s(c)
, o = a ? a.$getConfig() : null;
o && o.smart_rendering && (r = a.getViewPort());
for (var l = 0, d = e.length; l < d; l++)
this.render_item(e[l], i, r, a, o);
n.appendChild(i, n);
var h = {};
e.forEach(function(t) {
h[t.id] = t
});
var f = {};
if (_) {
var g = {};
for (var l in this.rendered)
f[l] || (g[l] = this.rendered[l],
_.call(t, h[l], this.rendered[l], a))
}
},
update_items: function(e, n) {
var a = s(c)
, o = a ? a.$getConfig() : null;
if (a && a.$getConfig().smart_rendering && !r(t) && this.rendered && (f || g)) {
n = n || u;
var l = document.createDocumentFragment()
, d = null;
a && (d = a.getViewPort());
var p = {};
e.forEach(function(t) {
p[t.id] = t
});
var v = {}
, m = {};
for (var y in this.rendered)
m[y] = !0,
v[y] = !0;
for (var k = {}, b = (y = 0,
e.length); y < b; y++) {
var x = e[y]
, w = this.rendered[x.id];
m[x.id] = !1,
w && w.parentNode ? (g ? g(x, d, a, o, t) : i(d, f(x, a, o, t))) ? (h && h.call(t, x, w, a, o, d),
this.restore(x, l)) : m[x.id] = !0 : (k[e[y].id] = !0,
this.render_item(e[y], l, d, a, o))
}
for (var y in m)
m[y] && this.hide(y);
if (l.childNodes.length && n.appendChild(l, n),
_) {
var S = {};
for (var y in this.rendered)
v[y] && !k[y] || (S[y] = this.rendered[y],
_.call(t, p[y], this.rendered[y], a))
}
}
},
append: function(t, e, n) {
this.rendered && (e ? (this.rendered[t.id] && this.rendered[t.id].parentNode ? this.replace_item(t.id, e) : n.appendChild(e),
this.rendered[t.id] = e) : this.rendered[t.id] && this.remove_item(t.id))
},
replace_item: function(t, e) {
var n = this.rendered[t];
n && n.parentNode && n.parentNode.replaceChild(e, n),
this.rendered[t] = e
},
remove_item: function(t) {
this.hide(t),
delete this.rendered[t]
},
hide: function(t) {
var e = this.rendered[t];
e && e.parentNode && e.parentNode.removeChild(e)
},
restore: function(t, e) {
var n = this.rendered[t.id];
n ? n.parentNode || this.append(t, n, e || u) : this.render_item(t, e || u)
},
change_id: function(t, e) {
this.rendered[e] = this.rendered[t],
delete this.rendered[t]
},
rendered: e[l],
node: u,
destructor: function() {
this.clear(),
delete n[l],
delete e[l]
}
},
n[l]
}
return {
getRenderer: l,
clearRenderers: function() {
for (var t in n)
l(t).destructor()
}
}
}
}
, function(t, e, n) {
var i = n(136)
, r = n(0)
, a = n(1)
, o = n(20);
function s(t) {
return t instanceof Array || (t = Array.prototype.slice.call(arguments, 0)),
function(e) {
for (var n = !0, i = 0, r = t.length; i < r; i++) {
var a = t[i];
a && (n = n && !1 !== a(e.id, e))
}
return n
}
}
t.exports = function(t) {
var e = i(t);
return {
createGroup: function(n, i, l, c) {
var u = {
tempCollection: [],
renderers: {},
container: n,
filters: [],
getLayers: function() {
this._add();
var t = [];
for (var e in this.renderers)
t.push(this.renderers[e]);
return t
},
getLayer: function(t) {
return this.renderers[t]
},
_add: function(n) {
n && (n.id = n.id || r.uid(),
this.tempCollection.push(n));
for (var o = this.container(), s = this.tempCollection, l = 0; l < s.length; l++)
if (n = s[l],
this.container() || n && n.container && a.isChildOf(n.container, document.body)) {
var u = n.container
, d = n.id
, h = n.topmost;
if (!u.parentNode)
if (h)
o.appendChild(u);
else {
var f = i ? i() : o.firstChild;
f && f.parentNode == o ? o.insertBefore(u, f) : o.appendChild(u)
}
this.renderers[d] = e.getRenderer(d, n, u),
c && c(n, t),
this.tempCollection.splice(l, 1),
l--
}
},
addLayer: function(e) {
if (e) {
"function" == typeof e && (e = {
renderer: e
}),
void 0 === e.filter ? e.filter = s(l || []) : e.filter instanceof Array && (e.filter.push(l),
e.filter = s(e.filter)),
e.container || (e.container = document.createElement("div"));
var n = this;
e.requestUpdate = function() {
t.config.smart_rendering && !o(t) && n.renderers[e.id] && n.onUpdateRequest(n.renderers[e.id])
}
}
return this._add(e),
e ? e.id : void 0
},
onUpdateRequest: function(t) {},
eachLayer: function(t) {
for (var e in this.renderers)
t(this.renderers[e])
},
removeLayer: function(t) {
this.renderers[t] && (this.renderers[t].destructor(),
delete this.renderers[t])
},
clear: function() {
for (var t in this.renderers)
this.renderers[t].destructor();
this.renderers = {}
}
};
return t.attachEvent("onDestroy", function() {
u.clear(),
u = null
}),
u
}
}
}
}
, function(t, e, n) {
var i = n(137)
, r = n(6)
, a = n(40)
, o = n(39);
function s(t, e) {
if (t.view) {
var n = t.view;
"string" == typeof n && (n = e.$ui.getView(n)),
n && n.attachEvent && n.attachEvent("onScroll", function() {
e.$services.getService("state").getState("batchUpdate").batch_update || n.$config.$skipSmartRenderOnScroll || t.requestUpdate && t.requestUpdate()
})
}
}
t.exports = function(t) {
var e = i(t);
return {
getDataRender: function(e) {
return t.$services.getService("layer:" + e) || null
},
createDataRender: function(n) {
var i = n.name
, r = n.defaultContainer
, a = n.defaultContainerSibling
, o = e.createGroup(r, a, function(t, e) {
if (!o.filters)
return !0;
for (var n = 0; n < o.filters.length; n++)
if (!1 === o.filters[n](t, e))
return !1
}, s);
return t.$services.setService("layer:" + i, function() {
return o
}),
t.attachEvent("onGanttReady", function() {
o.addLayer()
}),
o
},
init: function() {
var e = this.createDataRender({
name: "task",
defaultContainer: function() {
return t.$task_data ? t.$task_data : t.$ui.getView("timeline") ? t.$ui.getView("timeline").$task_data : void 0
},
defaultContainerSibling: function() {
return t.$task_links ? t.$task_links : t.$ui.getView("timeline") ? t.$ui.getView("timeline").$task_links : void 0
},
filter: function(t) {}
}, t)
, n = this.createDataRender({
name: "link",
defaultContainer: function() {
return t.$task_data ? t.$task_data : t.$ui.getView("timeline") ? t.$ui.getView("timeline").$task_data : void 0
}
}, t);
return {
addTaskLayer: function(t) {
var n = r;
return "function" == typeof t ? t = {
renderer: {
render: t,
getVisibleRange: n
}
} : t.renderer && !t.renderer.getVisibleRange && (t.renderer.getVisibleRange = n),
t.view = "timeline",
e.addLayer(t)
},
_getTaskLayers: function() {
return e.getLayers()
},
removeTaskLayer: function(t) {
e.removeLayer(t)
},
_clearTaskLayers: function() {
e.clear()
},
addLinkLayer: function(t) {
var e = a();
return "function" == typeof t ? t = {
renderer: {
render: t,
getVisibleRange: e
}
} : t.renderer && !t.renderer.getVisibleRange && (t.renderer.getVisibleRange = e),
t.view = "timeline",
t && t.renderer && (t.renderer.getRectangle || t.renderer.isInViewPort || (t.renderer.isInViewPort = o)),
n.addLayer(t)
},
_getLinkLayers: function() {
return n.getLayers()
},
removeLinkLayer: function(t) {
n.removeLayer(t)
},
_clearLinkLayers: function() {
n.clear()
}
}
}
}
}
}
, function(t, e, n) {
var i = function(t) {
return function(e) {
var n = {
click: {},
doubleclick: {},
contextMenu: {}
};
function i(t, e, i, r) {
n[t][e] || (n[t][e] = []),
n[t][e].push({
handler: i,
root: r
})
}
function r(t) {
t = t || window.event;
var i = e.locate(t)
, r = o(t, n.click)
, a = !0;
if (null !== i ? a = !e.checkEvent("onTaskClick") || e.callEvent("onTaskClick", [i, t]) : e.callEvent("onEmptyClick", [t]),
a) {
if (!s(r, t, i))
return;
switch (t.target.nodeName) {
case "SELECT":
case "INPUT":
return
}
i && e.getTask(i) && !e._multiselect && e.config.select_task && e.selectTask(i)
}
}
function a(t) {
var n = (t = t || window.event).target || t.srcElement
, i = e.locate(n)
, r = e.locate(n, e.config.link_attribute)
, a = !e.checkEvent("onContextMenu") || e.callEvent("onContextMenu", [i, r, t]);
return a || (t.preventDefault ? t.preventDefault() : t.returnValue = !1),
a
}
function o(e, n) {
for (var i = e.target || e.srcElement, r = []; i; ) {
var a = t.getClassName(i);
if (a) {
a = a.split(" ");
for (var o = 0; o < a.length; o++)
if (a[o] && n[a[o]])
for (var s = n[a[o]], l = 0; l < s.length; l++)
s[l].root && !t.isChildOf(i, s[l].root) || r.push(s[l].handler)
}
i = i.parentNode
}
return r
}
function s(t, n, i) {
for (var r = !0, a = 0; a < t.length; a++) {
var o = t[a].call(e, n, i, n.target || n.srcElement);
r = r && !(void 0 !== o && !0 !== o)
}
return r
}
function l(t) {
t = t || window.event;
var i = e.locate(t)
, r = o(t, n.doubleclick)
, a = !e.checkEvent("onTaskDblClick") || null === i || e.callEvent("onTaskDblClick", [i, t]);
if (a) {
if (!s(r, t, i))
return;
null !== i && e.getTask(i) && a && e.config.details_on_dblclick && !e.isReadonly(i) && e.showLightbox(i)
}
}
function c(t) {
if (e.checkEvent("onMouseMove")) {
var n = e.locate(t);
e._last_move_event = t,
e.callEvent("onMouseMove", [n, t])
}
}
var u = e._createDomEventScope();
function d(t) {
u.detachAll(),
t && (u.attach(t, "click", r),
u.attach(t, "dblclick", l),
u.attach(t, "mousemove", c),
u.attach(t, "contextmenu", a))
}
return {
reset: d,
global: function(t, e, n) {
i(t, e, n, null)
},
delegate: i,
detach: function(t, e, i, r) {
if (n[t] && n[t][e]) {
for (var a = n[t], o = a[e], s = 0; s < o.length; s++)
o[s].root == r && (o.splice(s, 1),
s--);
o.length || delete a[e]
}
},
callHandler: function(t, e, i, r) {
var a = n[t][e];
if (a)
for (var o = 0; o < a.length; o++)
(i || a[o].root) && a[o].root !== i || a[o].handler.apply(this, r)
},
onDoubleClick: l,
onMouseMove: c,
onContextMenu: a,
onClick: r,
destructor: function() {
d(),
n = null,
u = null
}
}
}
}(n(1));
t.exports = {
init: i
}
}
, function(t, e, n) {
var i = n(0);
function r(t, e) {
var n = this.$config[t];
return n ? (n.$extendedConfig || (n.$extendedConfig = !0,
Object.setPrototypeOf(n, e)),
n) : e
}
t.exports = function(t, e) {
i.mixin(t, function(t) {
var e, n;
return {
$getConfig: function() {
return e || (e = t ? t.$getConfig() : this.$gantt.config),
this.$config.config ? r.call(this, "config", e) : e
},
$getTemplates: function() {
return n || (n = t ? t.$getTemplates() : this.$gantt.templates),
this.$config.templates ? r.call(this, "templates", n) : n
}
}
}(e))
}
}
, function(t, e, n) {
function i(t) {
"@babel/helpers - typeof";
return (i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
var r = n(0)
, a = n(140);
t.exports = {
createFactory: function(t) {
var e = {};
var n = {};
function o(o, s, l, c) {
var u = e[o];
if (!u || !u.create)
return !1;
"resizer" != o || l.mode || (c.$config.cols ? l.mode = "x" : l.mode = "y"),
"viewcell" != o || "scrollbar" != l.view || l.scroll || (c.$config.cols ? l.scroll = "y" : l.scroll = "x"),
(l = r.copy(l)).id || n[l.view] || (l.id = l.view),
l.id && !l.css && (l.css = l.id + "_cell");
var d = new u.create(s,l,this,t);
return u.configure && u.configure(d),
a(d, c),
d.$id || (d.$id = l.id || t.uid()),
d.$parent || "object" != i(s) || (d.$parent = s),
d.$config || (d.$config = l),
n[d.$id] && (d.$id = t.uid()),
n[d.$id] = d,
d
}
return {
initUI: function(t, e) {
var n = "cell";
return t.view ? n = "viewcell" : t.resizer ? n = "resizer" : t.rows || t.cols ? n = "layout" : t.views && (n = "multiview"),
o.call(this, n, null, t, e)
},
reset: function() {
n = {}
},
registerView: function(t, n, i) {
e[t] = {
create: n,
configure: i
}
},
createView: o,
getView: function(t) {
return n[t]
}
}
}
}
}
, function(t, e, n) {
var i = n(141)
, r = n(139)
, a = n(138)
, o = n(14)
, s = n(38)
, l = n(132)
, c = n(131)
, u = n(130)
, d = n(129)
, h = n(29)
, f = n(32)
, _ = n(32)
, g = n(29)
, p = n(29)
, v = n(127)
, m = n(116)
, y = n(115)
, k = n(113)
, b = n(112)
, x = n(110)
, w = n(109)
, S = n(108)
, T = n(107)
, $ = n(106)
, C = n(105)
, E = n(99)
, A = n(96);
t.exports = {
init: function(t) {
function e(e, n) {
var i = n(t);
i.onCreated && i.onCreated(e),
e.attachEvent("onReady", function() {
i.onInitialized && i.onInitialized(e)
}),
e.attachEvent("onDestroy", function() {
i.onDestroyed && i.onDestroyed(e)
})
}
var n = i.createFactory(t);
n.registerView("cell", o),
n.registerView("resizer", u),
n.registerView("scrollbar", d),
n.registerView("layout", s, function(t) {
"main" === (t.$config ? t.$config.id : null) && e(t, A)
}),
n.registerView("viewcell", c),
n.registerView("multiview", l),
n.registerView("timeline", h, function(t) {
"timeline" !== (t.$config ? t.$config.id : null) && "task" != t.$config.bind || e(t, E)
}),
n.registerView("grid", f, function(t) {
"grid" !== (t.$config ? t.$config.id : null) && "task" != t.$config.bind || e(t, C)
}),
n.registerView("resourceGrid", _),
n.registerView("resourceTimeline", g),
n.registerView("resourceHistogram", p);
var D = a(t)
, M = v(t);
return t.ext.inlineEditors = M,
t.ext._inlineEditors = M,
M.init(t),
{
factory: n,
mouseEvents: r.init(t),
layersApi: D.init(),
render: {
gridLine: function() {
return w(t)
},
taskBg: function() {
return b(t)
},
taskBar: function() {
return m(t)
},
taskRollupBar: function() {
return k(t)
},
taskSplitBar: function() {
return y(t)
},
link: function() {
return x(t)
},
resourceRow: function() {
return S(t)
},
resourceHistogram: function() {
return T(t)
},
gridTaskRowResizer: function() {
return $(t)
}
},
layersService: {
getDataRender: function(e) {
return D.getDataRender(e, t)
},
createDataRender: function(e) {
return D.createDataRender(e, t)
}
}
}
}
}
}
, function(t, e, n) {
function i(t) {
"@babel/helpers - typeof";
return (i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
var r = n(0)
, a = n(1);
t.exports = function(t) {
var e = "data-dhxbox"
, n = null;
function o(t, e) {
var i = t.callback;
y.hide(t.box),
n = t.box = null,
i && i(e)
}
function s(t) {
if (n) {
var e = t.which || t.keyCode
, i = !1;
if (k.keyboard) {
if (13 == e || 32 == e) {
var r = t.target || t.srcElement;
a.getClassName(r).indexOf("gantt_popup_button") > -1 && r.click ? r.click() : (o(n, !0),
i = !0)
}
27 == e && (o(n, !1),
i = !0)
}
return i ? (t.preventDefault && t.preventDefault(),
!(t.cancelBubble = !0)) : void 0
}
}
var l = a.getRootNode(t.$root) || document;
function c(t) {
c.cover || (c.cover = document.createElement("div"),
c.cover.onkeydown = s,
c.cover.className = "dhx_modal_cover",
document.body.appendChild(c.cover)),
c.cover.style.display = t ? "inline-block" : "none"
}
function u(e, n, i) {
return "
" + e + "
"
}
function d(e) {
k.area || (k.area = document.createElement("div"),
k.area.className = "gantt_message_area",
k.area.style[k.position] = "5px",
document.body.appendChild(k.area)),
k.hide(e.id);
var n = document.createElement("div");
return n.innerHTML = "
" + e.text + "
",
n.className = "gantt-info gantt-" + e.type,
n.onclick = function() {
k.hide(e.id),
e = null
}
,
t._waiAria.messageInfoAttr(n),
"bottom" == k.position && k.area.firstChild ? k.area.insertBefore(n, k.area.firstChild) : k.area.appendChild(n),
e.expire > 0 && (k.timers[e.id] = window.setTimeout(function() {
k && k.hide(e.id)
}, e.expire)),
k.pull[e.id] = n,
n = null,
e.id
}
function h() {
for (var t = [].slice.apply(arguments, [0]), e = 0; e < t.length; e++)
if (t[e])
return t[e]
}
function f(l, d, f) {
var _ = l.tagName ? l : function(s, l, c) {
var d = document.createElement("div")
, f = r.uid();
t._waiAria.messageModalAttr(d, f),
d.className = " gantt_modal_box gantt-" + s.type,
d.setAttribute(e, 1);
var _ = "";
if (s.width && (d.style.width = s.width),
s.height && (d.style.height = s.height),
s.title && (_ += '
' + s.title + "
"),
_ += '
' + (s.content ? "" : s.text) + '
',
l && (_ += u(h(s.ok, t.locale.labels.message_ok, "OK"), "ok", !0)),
c && (_ += u(h(s.cancel, t.locale.labels.message_cancel, "Cancel"), "cancel", !1)),
s.buttons)
for (var g = 0; g < s.buttons.length; g++) {
var p = s.buttons[g];
"object" == i(p) ? _ += u(p.label, p.css || "gantt_" + p.label.toLowerCase() + "_button", p.value || g) : _ += u(p, p, g)
}
if (_ += "
",
d.innerHTML = _,
s.content) {
var v = s.content;
"string" == typeof v && (v = document.getElementById(v)),
"none" == v.style.display && (v.style.display = ""),
d.childNodes[s.title ? 1 : 0].appendChild(v)
}
return d.onclick = function(t) {
var e = t.target || t.srcElement;
if (e.className || (e = e.parentNode),
a.closest(e, ".gantt_popup_button")) {
var n = e.getAttribute("data-result");
o(s, n = "true" == n || "false" != n && n)
}
}
,
s.box = d,
(l || c) && (n = s),
d
}(l, d, f);
l.hidden || c(!0),
document.body.appendChild(_);
var g = Math.abs(Math.floor(((window.innerWidth || document.documentElement.offsetWidth) - _.offsetWidth) / 2))
, p = Math.abs(Math.floor(((window.innerHeight || document.documentElement.offsetHeight) - _.offsetHeight) / 2));
return "top" == l.position ? _.style.top = "-3px" : _.style.top = p + "px",
_.style.left = g + "px",
_.onkeydown = s,
y.focus(_),
l.hidden && y.hide(_),
t.callEvent("onMessagePopup", [_]),
_
}
function _(t) {
return f(t, !0, !1)
}
function g(t) {
return f(t, !0, !0)
}
function p(t) {
return f(t)
}
function v(t, e, n) {
return "object" != i(t) && ("function" == typeof e && (n = e,
e = ""),
t = {
text: t,
type: e,
callback: n
}),
t
}
function m(t, e, n, a) {
return "object" != i(t) && (t = {
text: t,
type: e,
expire: n,
id: a
}),
t.id = t.id || r.uid(),
t.expire = t.expire || k.expire,
t
}
t.event(l, "keydown", s, !0);
var y = function() {
var t = v.apply(this, arguments);
return t.type = t.type || "alert",
p(t)
};
y.hide = function(n) {
for (; n && n.getAttribute && !n.getAttribute(e); )
n = n.parentNode;
n && (n.parentNode.removeChild(n),
c(!1),
t.callEvent("onAfterMessagePopup", [n]))
}
,
y.focus = function(t) {
setTimeout(function() {
var e = a.getFocusableNodes(t);
e.length && e[0].focus && e[0].focus()
}, 1)
}
;
var k = function(t, e, n, i) {
switch ((t = m.apply(this, arguments)).type = t.type || "info",
t.type.split("-")[0]) {
case "alert":
return _(t);
case "confirm":
return g(t);
case "modalbox":
return p(t);
default:
return d(t)
}
};
k.seed = (new Date).valueOf(),
k.uid = r.uid,
k.expire = 4e3,
k.keyboard = !0,
k.position = "top",
k.pull = {},
k.timers = {},
k.hideAll = function() {
for (var t in k.pull)
k.hide(t)
}
,
k.hide = function(t) {
var e = k.pull[t];
e && e.parentNode && (window.setTimeout(function() {
e.parentNode.removeChild(e),
e = null
}, 2e3),
e.className += " hidden",
k.timers[t] && window.clearTimeout(k.timers[t]),
delete k.pull[t])
}
;
var b = [];
return t.attachEvent("onMessagePopup", function(t) {
b.push(t)
}),
t.attachEvent("onAfterMessagePopup", function(t) {
for (var e = 0; e < b.length; e++)
b[e] === t && (b.splice(e, 1),
e--)
}),
t.attachEvent("onDestroy", function() {
c.cover && c.cover.parentNode && c.cover.parentNode.removeChild(c.cover);
for (var t = 0; t < b.length; t++)
b[t].parentNode && b[t].parentNode.removeChild(b[t]);
b = null,
k.area && k.area.parentNode && k.area.parentNode.removeChild(k.area),
k = null
}),
{
alert: function() {
var t = v.apply(this, arguments);
return t.type = t.type || "confirm",
_(t)
},
confirm: function() {
var t = v.apply(this, arguments);
return t.type = t.type || "alert",
g(t)
},
message: k,
modalbox: y
}
}
}
, function(t, e, n) {
t.exports = function(t) {
var e = n(0)
, i = n(11)
, r = n(15);
if (!i.isNode) {
var a = n(1)
, o = n(2);
t.utils = {
arrayFind: o.arrayFind,
dom: a
};
var s = n(51)();
t.event = s.attach,
t.eventRemove = s.detach,
t._eventRemoveAll = s.detachAll,
t._createDomEventScope = s.extend,
e.mixin(t, n(143)(t));
var l = n(142).init(t);
t.$ui = l.factory,
t.$ui.layers = l.render,
t.$mouseEvents = l.mouseEvents,
t.$services.setService("mouseEvents", function() {
return t.$mouseEvents
}),
t.mixin(t, l.layersApi),
n(95)(t),
t.$services.setService("layers", function() {
return l.layersService
});
var c = n(94);
t.mixin(t, c()),
n(93)(t),
n(92)(t),
n(91)(t),
n(90)(t),
n(89)(t),
n(88)(t),
n(87)(t),
n(86)(t),
n(85)(t),
n(80)(t),
n(79)(t),
n(69)(t),
n(68)(t),
t.locate = function(t) {
var e = a.getTargetNode(t);
if (a.closest(e, ".gantt_task_row"))
return null;
var n = arguments[1] || this.config.task_attribute
, i = a.locateAttribute(e, n);
return i ? i.getAttribute(n) : null
}
,
t._locate_css = function(t, e, n) {
return a.locateClassName(t, e, n)
}
,
t._locateHTML = function(t, e) {
return a.locateAttribute(t, e || this.config.task_attribute)
}
}
t.attachEvent("onParse", function() {
r(t) || t.attachEvent("onGanttRender", function() {
if (t.config.initial_scroll) {
var e = t.getTaskByIndex(0)
, n = e ? e.id : t.config.root_id;
t.isTaskExists(n) && t.$task && t.utils.dom.isChildOf(t.$task, t.$container) && t.showTask(n)
}
}, {
once: !0
})
}),
t.attachEvent("onBeforeGanttReady", function() {
this.config.scroll_size || (this.config.scroll_size = a.getScrollSize() || 1),
r(t) || (this._eventRemoveAll(),
this.$mouseEvents.reset(),
this.resetLightbox())
}),
t.attachEvent("onGanttReady", function() {
!r(t) && t.config.rtl && t.$layout.getCellsByType("viewCell").forEach(function(e) {
var n = e.$config.scrollX;
if (n) {
var i = t.$ui.getView(n);
i && i.scrollTo(i.$config.scrollSize, 0)
}
})
}),
t.attachEvent("onGanttReady", function() {
if (!r(t)) {
var e = t.plugins()
, n = {
auto_scheduling: t.autoSchedule,
click_drag: t.ext.clickDrag,
critical_path: t.isCriticalTask,
drag_timeline: t.ext.dragTimeline,
export_api: t.exportToPDF,
fullscreen: t.ext.fullscreen,
grouping: t.groupBy,
keyboard_navigation: t.ext.keyboardNavigation,
marker: t.addMarker,
multiselect: t.eachSelectedTask,
overlay: t.ext.overlay,
quick_info: t.templates.quick_info_content,
tooltip: t.ext.tooltips,
undo: t.undo
};
for (var i in n)
n[i] && !e[i] && console.warn("You connected the '".concat(i, "' extension via an obsolete file. \nTo fix it, you need to remove the obsolete file and connect the extension via the plugins method: https://docs.dhtmlx.com/gantt/api__gantt_plugins.html"))
}
})
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Січень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "Вересень", "Жовтень", "Листопад", "Грудень"],
month_short: ["Січ", "Лют", "Бер", "Кві", "Тра", "Чер", "Лип", "Сер", "Вер", "Жов", "Лис", "Гру"],
day_full: ["Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота"],
day_short: ["Нед", "Пон", "Вів", "Сер", "Чет", "Птн", "Суб"]
},
labels: {
new_task: "Нове завдання",
icon_save: "Зберегти",
icon_cancel: "Відміна",
icon_details: "Деталі",
icon_edit: "Редагувати",
icon_delete: "Вилучити",
confirm_closing: "",
confirm_deleting: "Подія вилучиться назавжди. Ви впевнені?",
section_description: "Опис",
section_time: "Часовий проміжок",
section_type: "Тип",
column_wbs: "WBS",
column_text: "Task name",
column_start_date: "Start time",
column_duration: "Duration",
column_add: "",
link: "Link",
confirm_link_deleting: "will be deleted",
link_start: " (start)",
link_end: " (end)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Minutes",
hours: "Hours",
days: "Days",
weeks: "Week",
months: "Months",
years: "Years",
message_ok: "OK",
message_cancel: "Відміна",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"],
month_short: ["Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara"],
day_full: ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"],
day_short: ["Paz", "Pzt", "Sal", "Çar", "Per", "Cum", "Cmt"]
},
labels: {
new_task: "Yeni görev",
icon_save: "Kaydet",
icon_cancel: "İptal",
icon_details: "Detaylar",
icon_edit: "Düzenle",
icon_delete: "Sil",
confirm_closing: "",
confirm_deleting: "Görev silinecek, emin misiniz?",
section_description: "Açıklama",
section_time: "Zaman Aralığı",
section_type: "Tip",
column_wbs: "WBS",
column_text: "Görev Adı",
column_start_date: "Başlangıç",
column_duration: "Süre",
column_add: "",
link: "Bağlantı",
confirm_link_deleting: "silinecek",
link_start: " (başlangıç)",
link_end: " (bitiş)",
type_task: "Görev",
type_project: "Proje",
type_milestone: "Kilometretaşı",
minutes: "Dakika",
hours: "Saat",
days: "Gün",
weeks: "Hafta",
months: "Ay",
years: "Yıl",
message_ok: "OK",
message_cancel: "Ýptal",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"],
month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],
day_full: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"],
day_short: ["Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"]
},
labels: {
new_task: "Ny uppgift",
icon_save: "Spara",
icon_cancel: "Avbryt",
icon_details: "Detajer",
icon_edit: "Ändra",
icon_delete: "Ta bort",
confirm_closing: "",
confirm_deleting: "Är du säker på att du vill ta bort händelsen permanent?",
section_description: "Beskrivning",
section_time: "Tid",
section_type: "Typ",
column_wbs: "WBS",
column_text: "Uppgiftsnamn",
column_start_date: "Starttid",
column_duration: "Varaktighet",
column_add: "",
link: "Länk",
confirm_link_deleting: "kommer tas bort",
link_start: " (start)",
link_end: " (slut)",
type_task: "Uppgift",
type_project: "Projekt",
type_milestone: "Milstolpe",
minutes: "Minuter",
hours: "Timmar",
days: "Dagar",
weeks: "Veckor",
months: "Månader",
years: "År",
message_ok: "OK",
message_cancel: "Avbryt",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"],
month_short: ["Jan", "Feb", "Mar", "Apr", "Máj", "Jún", "Júl", "Aug", "Sept", "Okt", "Nov", "Dec"],
day_full: ["Nedeľa", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota"],
day_short: ["Ne", "Po", "Ut", "St", "Št", "Pi", "So"]
},
labels: {
new_task: "Nová úloha",
icon_save: "Uložiť",
icon_cancel: "Späť",
icon_details: "Detail",
icon_edit: "Edituj",
icon_delete: "Zmazať",
confirm_closing: "Vaše zmeny nebudú uložené. Skutočne?",
confirm_deleting: "Udalosť bude natrvalo vymazaná. Skutočne?",
section_description: "Poznámky",
section_time: "Doba platnosti",
section_type: "Type",
column_wbs: "WBS",
column_text: "Task name",
column_start_date: "Start time",
column_duration: "Duration",
column_add: "",
link: "Link",
confirm_link_deleting: "will be deleted",
link_start: " (start)",
link_end: " (end)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Minutes",
hours: "Hours",
days: "Days",
weeks: "Week",
months: "Months",
years: "Years",
message_ok: "OK",
message_cancel: "Späť",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"],
month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],
day_full: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota"],
day_short: ["Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob"]
},
labels: {
new_task: "Nova naloga",
icon_save: "Shrani",
icon_cancel: "Prekliči",
icon_details: "Podrobnosti",
icon_edit: "Uredi",
icon_delete: "Izbriši",
confirm_closing: "",
confirm_deleting: "Dogodek bo izbrisan. Želite nadaljevati?",
section_description: "Opis",
section_time: "Časovni okvir",
section_type: "Type",
column_wbs: "WBS",
column_text: "Task name",
column_start_date: "Start time",
column_duration: "Duration",
column_add: "",
link: "Link",
confirm_link_deleting: "will be deleted",
link_start: " (start)",
link_end: " (end)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Minutes",
hours: "Hours",
days: "Days",
weeks: "Week",
months: "Months",
years: "Years",
message_ok: "OK",
message_cancel: "Prekliči",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Январь", "Февраль", "Март", "Апрель", "Maй", "Июнь", "Июль", "Август", "Сентябрь", "Oктябрь", "Ноябрь", "Декабрь"],
month_short: ["Янв", "Фев", "Maр", "Aпр", "Maй", "Июн", "Июл", "Aвг", "Сен", "Окт", "Ноя", "Дек"],
day_full: ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"],
day_short: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"]
},
labels: {
new_task: "Новое задание",
icon_save: "Сохранить",
icon_cancel: "Отменить",
icon_details: "Детали",
icon_edit: "Изменить",
icon_delete: "Удалить",
confirm_closing: "",
confirm_deleting: "Событие будет удалено безвозвратно, продолжить?",
section_description: "Описание",
section_time: "Период времени",
section_type: "Тип",
column_wbs: "ИСР",
column_text: "Задача",
column_start_date: "Начало",
column_duration: "Длительность",
column_add: "",
link: "Связь",
confirm_link_deleting: "будет удалена",
link_start: " (начало)",
link_end: " (конец)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Минута",
hours: "Час",
days: "День",
weeks: "Неделя",
months: "Месяц",
years: "Год",
message_ok: "OK",
message_cancel: "Отменить",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "начните вводить слово для фильтрации",
resources_filter_label: "спрятать не установленные",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "November", "December"],
month_short: ["Ian", "Feb", "Mar", "Apr", "Mai", "Iun", "Iul", "Aug", "Sep", "Oct", "Nov", "Dec"],
day_full: ["Duminica", "Luni", "Marti", "Miercuri", "Joi", "Vineri", "Sambata"],
day_short: ["Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sa"]
},
labels: {
new_task: "Sarcina noua",
icon_save: "Salveaza",
icon_cancel: "Anuleaza",
icon_details: "Detalii",
icon_edit: "Editeaza",
icon_delete: "Sterge",
confirm_closing: "Schimbarile nu vor fi salvate, esti sigur?",
confirm_deleting: "Evenimentul va fi sters permanent, esti sigur?",
section_description: "Descriere",
section_time: "Interval",
section_type: "Type",
column_wbs: "WBS",
column_text: "Task name",
column_start_date: "Start time",
column_duration: "Duration",
column_add: "",
link: "Link",
confirm_link_deleting: "will be deleted",
link_start: " (start)",
link_end: " (end)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Minutes",
hours: "Hours",
days: "Days",
weeks: "Week",
months: "Months",
years: "Years",
message_ok: "OK",
message_cancel: "Anuleaza",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
month_short: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"],
day_full: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"],
day_short: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"]
},
labels: {
new_task: "Nova tarefa",
icon_save: "Salvar",
icon_cancel: "Cancelar",
icon_details: "Detalhes",
icon_edit: "Editar",
icon_delete: "Excluir",
confirm_closing: "",
confirm_deleting: "As tarefas serão excluidas permanentemente, confirme?",
section_description: "Descrição",
section_time: "Período",
section_type: "Tipo",
column_wbs: "EAP",
column_text: "Nome tarefa",
column_start_date: "Data início",
column_duration: "Duração",
column_add: "",
link: "Link",
confirm_link_deleting: "Será excluído!",
link_start: " (início)",
link_end: " (fim)",
type_task: "Task",
type_project: "Projeto",
type_milestone: "Marco",
minutes: "Minutos",
hours: "Horas",
days: "Dias",
weeks: "Semanas",
months: "Meses",
years: "Anos",
message_ok: "OK",
message_cancel: "Cancelar",
section_constraint: "Restrição",
constraint_type: "Tipo Restrição",
constraint_date: "Data restrição",
asap: "Mais breve possível",
alap: "Mais tarde possível",
snet: "Não começar antes de",
snlt: "Não começar depois de",
fnet: "Não terminar antes de",
fnlt: "Não terminar depois de",
mso: "Precisa começar em",
mfo: "Precisa terminar em",
resources_filter_placeholder: "Tipo de filtros",
resources_filter_label: "Ocultar vazios",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"],
month_short: ["Sty", "Lut", "Mar", "Kwi", "Maj", "Cze", "Lip", "Sie", "Wrz", "Paź", "Lis", "Gru"],
day_full: ["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"],
day_short: ["Nie", "Pon", "Wto", "Śro", "Czw", "Pią", "Sob"]
},
labels: {
new_task: "Nowe zadanie",
icon_save: "Zapisz",
icon_cancel: "Anuluj",
icon_details: "Szczegóły",
icon_edit: "Edytuj",
icon_delete: "Usuń",
confirm_closing: "",
confirm_deleting: "Zdarzenie zostanie usunięte na zawsze, kontynuować?",
section_description: "Opis",
section_time: "Okres czasu",
section_type: "Typ",
column_wbs: "WBS",
column_text: "Nazwa zadania",
column_start_date: "Początek",
column_duration: "Czas trwania",
column_add: "",
link: "Link",
confirm_link_deleting: "zostanie usunięty",
link_start: " (początek)",
link_end: " (koniec)",
type_task: "Zadanie",
type_project: "Projekt",
type_milestone: "Milestone",
minutes: "Minuty",
hours: "Godziny",
days: "Dni",
weeks: "Tydzień",
months: "Miesiące",
years: "Lata",
message_ok: "OK",
message_cancel: "Anuluj",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"],
month_short: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"],
day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"],
day_short: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"]
},
labels: {
new_task: "Ny oppgave",
icon_save: "Lagre",
icon_cancel: "Avbryt",
icon_details: "Detaljer",
icon_edit: "Endre",
icon_delete: "Slett",
confirm_closing: "Endringer blir ikke lagret, er du sikker?",
confirm_deleting: "Oppføringen vil bli slettet, er du sikker?",
section_description: "Beskrivelse",
section_time: "Tidsperiode",
section_type: "Type",
column_wbs: "WBS",
column_text: "Task name",
column_start_date: "Start time",
column_duration: "Duration",
column_add: "",
link: "Link",
confirm_link_deleting: "will be deleted",
link_start: " (start)",
link_end: " (end)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Minutes",
hours: "Hours",
days: "Days",
weeks: "Week",
months: "Months",
years: "Years",
message_ok: "OK",
message_cancel: "Avbryt",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"],
month_short: ["Jan", "Feb", "mrt", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],
day_full: ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"],
day_short: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za"]
},
labels: {
new_task: "Nieuwe taak",
icon_save: "Opslaan",
icon_cancel: "Annuleren",
icon_details: "Details",
icon_edit: "Bewerken",
icon_delete: "Verwijderen",
confirm_closing: "",
confirm_deleting: "Item zal permanent worden verwijderd, doorgaan?",
section_description: "Beschrijving",
section_time: "Tijd periode",
section_type: "Type",
column_wbs: "WBS",
column_text: "Taak omschrijving",
column_start_date: "Startdatum",
column_duration: "Duur",
column_add: "",
link: "Koppeling",
confirm_link_deleting: "zal worden verwijderd",
link_start: " (start)",
link_end: " (eind)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "minuten",
hours: "uren",
days: "dagen",
weeks: "weken",
months: "maanden",
years: "jaren",
message_ok: "OK",
message_cancel: "Annuleren",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"],
month_short: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"],
day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"],
day_short: ["Søn", "Mon", "Tir", "Ons", "Tor", "Fre", "Lør"]
},
labels: {
new_task: "Ny oppgave",
icon_save: "Lagre",
icon_cancel: "Avbryt",
icon_details: "Detaljer",
icon_edit: "Rediger",
icon_delete: "Slett",
confirm_closing: "",
confirm_deleting: "Hendelsen vil bli slettet permanent. Er du sikker?",
section_description: "Beskrivelse",
section_time: "Tidsperiode",
section_type: "Type",
column_wbs: "WBS",
column_text: "Task name",
column_start_date: "Start time",
column_duration: "Duration",
column_add: "",
link: "Link",
confirm_link_deleting: "will be deleted",
link_start: " (start)",
link_end: " (end)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Minutes",
hours: "Hours",
days: "Days",
weeks: "Week",
months: "Months",
years: "Years",
message_ok: "OK",
message_cancel: "Avbryt",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = function() {
return function(t) {
var e = this;
for (var n in this.addLocale = function(t, n) {
e._locales[t] = n
}
,
this.getLocale = function(t) {
return e._locales[t]
}
,
this._locales = {},
t)
this._locales[n] = t[n]
}
}();
e.default = i
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"],
month_short: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"],
day_full: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"],
day_short: ["일", "월", "화", "수", "목", "금", "토"]
},
labels: {
new_task: "이름없는 작업",
icon_save: "저장",
icon_cancel: "취소",
icon_details: "세부 사항",
icon_edit: "수정",
icon_delete: "삭제",
confirm_closing: "",
confirm_deleting: "작업을 삭제하시겠습니까?",
section_description: "설명",
section_time: "기간",
section_type: "Type",
column_wbs: "WBS",
column_text: "작업명",
column_start_date: "시작일",
column_duration: "기간",
column_add: "",
link: "전제",
confirm_link_deleting: "삭제 하시겠습니까?",
link_start: " (start)",
link_end: " (end)",
type_task: "작업",
type_project: "프로젝트",
type_milestone: "마일스톤",
minutes: "분",
hours: "시간",
days: "일",
weeks: "주",
months: "달",
years: "년",
message_ok: "OK",
message_cancel: "취소",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
month_short: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
day_full: ["日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日"],
day_short: ["日", "月", "火", "水", "木", "金", "土"]
},
labels: {
new_task: "新しい仕事",
icon_save: "保存",
icon_cancel: "キャンセル",
icon_details: "詳細",
icon_edit: "編集",
icon_delete: "削除",
confirm_closing: "",
confirm_deleting: "イベント完全に削除されます、宜しいですか?",
section_description: "デスクリプション",
section_time: "期間",
section_type: "Type",
column_wbs: "WBS",
column_text: "Task name",
column_start_date: "Start time",
column_duration: "Duration",
column_add: "",
link: "Link",
confirm_link_deleting: "will be deleted",
link_start: " (start)",
link_end: " (end)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Minutes",
hours: "Hours",
days: "Days",
weeks: "Week",
months: "Months",
years: "Years",
message_ok: "OK",
message_cancel: "キャンセル",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"],
month_short: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"],
day_full: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"],
day_short: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"]
},
labels: {
new_task: "Nuovo compito",
icon_save: "Salva",
icon_cancel: "Chiudi",
icon_details: "Dettagli",
icon_edit: "Modifica",
icon_delete: "Elimina",
confirm_closing: "",
confirm_deleting: "Sei sicuro di confermare l'eliminazione?",
section_description: "Descrizione",
section_time: "Periodo di tempo",
section_type: "Tipo",
column_wbs: "WBS",
column_text: "Nome Attività",
column_start_date: "Inizio",
column_duration: "Durata",
column_add: "",
link: "Link",
confirm_link_deleting: "sarà eliminato",
link_start: " (inizio)",
link_end: " (fine)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Minuti",
hours: "Ore",
days: "Giorni",
weeks: "Settimane",
months: "Mesi",
years: "Anni",
message_ok: "OK",
message_cancel: "Chiudi",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"],
month_short: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Ags", "Sep", "Okt", "Nov", "Des"],
day_full: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"],
day_short: ["Ming", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"]
},
labels: {
new_task: "Tugas baru",
icon_save: "Simpan",
icon_cancel: "Batal",
icon_details: "Detail",
icon_edit: "Edit",
icon_delete: "Hapus",
confirm_closing: "",
confirm_deleting: "Acara akan dihapus",
section_description: "Keterangan",
section_time: "Periode",
section_type: "Type",
column_wbs: "WBS",
column_text: "Task name",
column_start_date: "Start time",
column_duration: "Duration",
column_add: "",
link: "Link",
confirm_link_deleting: "will be deleted",
link_start: " (start)",
link_end: " (end)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Minutes",
hours: "Hours",
days: "Days",
weeks: "Week",
months: "Months",
years: "Years",
message_ok: "OK",
message_cancel: "Batal",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"],
month_short: ["Jan", "Feb", "Már", "Ápr", "Máj", "Jún", "Júl", "Aug", "Sep", "Okt", "Nov", "Dec"],
day_full: ["Vasárnap", "Hétfõ", "Kedd", "Szerda", "Csütörtök", "Péntek", "szombat"],
day_short: ["Va", "Hé", "Ke", "Sze", "Csü", "Pé", "Szo"]
},
labels: {
new_task: "Új feladat",
icon_save: "Mentés",
icon_cancel: "Mégse",
icon_details: "Részletek",
icon_edit: "Szerkesztés",
icon_delete: "Törlés",
confirm_closing: "",
confirm_deleting: "Az esemény törölve lesz, biztosan folytatja?",
section_description: "Leírás",
section_time: "Idõszak",
section_type: "Type",
column_wbs: "WBS",
column_text: "Task name",
column_start_date: "Start time",
column_duration: "Duration",
column_add: "",
link: "Link",
confirm_link_deleting: "will be deleted",
link_start: " (start)",
link_end: " (end)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Minutes",
hours: "Hours",
days: "Days",
weeks: "Week",
months: "Months",
years: "Years",
message_ok: "OK",
message_cancel: "Mégse",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Siječanj", "Veljača", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac"],
month_short: ["Sij", "Velj", "Ožu", "Tra", "Svi", "Lip", "Srp", "Kol", "Ruj", "Lis", "Stu", "Pro"],
day_full: ["Nedjelja", "Ponedjeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota"],
day_short: ["Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub"]
},
labels: {
new_task: "Novi Zadatak",
icon_save: "Spremi",
icon_cancel: "Odustani",
icon_details: "Detalji",
icon_edit: "Izmjeni",
icon_delete: "Obriši",
confirm_closing: "",
confirm_deleting: "Zadatak će biti trajno izbrisan, jeste li sigurni?",
section_description: "Opis",
section_time: "Vremenski Period",
section_type: "Tip",
column_wbs: "WBS",
column_text: "Naziv Zadatka",
column_start_date: "Početno Vrijeme",
column_duration: "Trajanje",
column_add: "",
link: "Poveznica",
confirm_link_deleting: "će biti izbrisan",
link_start: " (početak)",
link_end: " (kraj)",
type_task: "Zadatak",
type_project: "Projekt",
type_milestone: "Milestone",
minutes: "Minute",
hours: "Sati",
days: "Dani",
weeks: "Tjedni",
months: "Mjeseci",
years: "Godine",
message_ok: "OK",
message_cancel: "Odustani",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"],
month_short: ["ינו", "פבר", "מרץ", "אפר", "מאי", "יונ", "יול", "אוג", "ספט", "אוק", "נוב", "דצמ"],
day_full: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת"],
day_short: ["א", "ב", "ג", "ד", "ה", "ו", "ש"]
},
labels: {
new_task: "משימה חדש",
icon_save: "שמור",
icon_cancel: "בטל",
icon_details: "פרטים",
icon_edit: "ערוך",
icon_delete: "מחק",
confirm_closing: "",
confirm_deleting: "ארוע ימחק סופית.להמשיך?",
section_description: "הסבר",
section_time: "תקופה",
section_type: "Type",
column_wbs: "WBS",
column_text: "Task name",
column_start_date: "Start time",
column_duration: "Duration",
column_add: "",
link: "Link",
confirm_link_deleting: "will be deleted",
link_start: " (start)",
link_end: " (end)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Minutes",
hours: "Hours",
days: "Days",
weeks: "Week",
months: "Months",
years: "Years",
message_ok: "OK",
message_cancel: "בטל",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"],
month_short: ["Jan", "Fév", "Mar", "Avr", "Mai", "Juin", "Juil", "Aoû", "Sep", "Oct", "Nov", "Déc"],
day_full: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"],
day_short: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"]
},
labels: {
new_task: "Nouvelle tâche",
icon_save: "Enregistrer",
icon_cancel: "Annuler",
icon_details: "Détails",
icon_edit: "Modifier",
icon_delete: "Effacer",
confirm_closing: "",
confirm_deleting: "L'événement sera effacé sans appel, êtes-vous sûr ?",
section_description: "Description",
section_time: "Période",
section_type: "Type",
column_wbs: "OTP",
column_text: "Nom de la tâche",
column_start_date: "Date initiale",
column_duration: "Durée",
column_add: "",
link: "Le lien",
confirm_link_deleting: "sera supprimé",
link_start: "(début)",
link_end: "(fin)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Minutes",
hours: "Heures",
days: "Jours",
weeks: "Semaines",
months: "Mois",
years: "Années",
message_ok: "OK",
message_cancel: "Annuler",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"],
month_short: ["Tam", "Hel", "Maa", "Huh", "Tou", "Kes", "Hei", "Elo", "Syy", "Lok", "Mar", "Jou"],
day_full: ["Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai"],
day_short: ["Su", "Ma", "Ti", "Ke", "To", "Pe", "La"]
},
labels: {
new_task: "Uusi tehtävä",
icon_save: "Tallenna",
icon_cancel: "Peru",
icon_details: "Tiedot",
icon_edit: "Muokkaa",
icon_delete: "Poista",
confirm_closing: "",
confirm_deleting: "Haluatko varmasti poistaa tapahtuman?",
section_description: "Kuvaus",
section_time: "Aikajakso",
section_type: "Type",
column_wbs: "WBS",
column_text: "Task name",
column_start_date: "Start time",
column_duration: "Duration",
column_add: "",
link: "Link",
confirm_link_deleting: "will be deleted",
link_start: " (start)",
link_end: " (end)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Minutes",
hours: "Hours",
days: "Days",
weeks: "Week",
months: "Months",
years: "Years",
message_ok: "OK",
message_cancel: "Peru",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["ژانویه", "فوریه", "مارس", "آوریل", "مه", "ژوئن", "ژوئیه", "اوت", "سپتامبر", "اکتبر", "نوامبر", "دسامبر"],
month_short: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
day_full: ["يکشنبه", "دوشنبه", "سهشنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"],
day_short: ["ی", "د", "س", "چ", "پ", "ج", "ش"]
},
labels: {
new_task: "وظیفه جدید",
icon_save: "ذخیره",
icon_cancel: "لغو",
icon_details: "جزییات",
icon_edit: "ویرایش",
icon_delete: "حذف",
confirm_closing: "تغییرات شما ازدست خواهد رفت، آیا مطمئن هستید؟",
confirm_deleting: "این مورد برای همیشه حذف خواهد شد، آیا مطمئن هستید؟",
section_description: "توضیحات",
section_time: "مدت زمان",
section_type: "نوع",
column_wbs: "WBS",
column_text: "عنوان",
column_start_date: "زمان شروع",
column_duration: "مدت",
column_add: "",
link: "ارتباط",
confirm_link_deleting: "حذف خواهد شد",
link_start: " (آغاز)",
link_end: " (پایان)",
type_task: "وظیفه",
type_project: "پروژه",
type_milestone: "نگارش",
minutes: "دقایق",
hours: "ساعات",
days: "روزها",
weeks: "هفته",
months: "ماهها",
years: "سالها",
message_ok: "تایید",
message_cancel: "لغو",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],
month_short: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"],
day_full: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"],
day_short: ["Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"]
},
labels: {
new_task: "Nueva tarea",
icon_save: "Guardar",
icon_cancel: "Cancelar",
icon_details: "Detalles",
icon_edit: "Editar",
icon_delete: "Eliminar",
confirm_closing: "",
confirm_deleting: "El evento se borrará definitivamente, ¿continuar?",
section_description: "Descripción",
section_time: "Período",
section_type: "Tipo",
column_wbs: "EDT",
column_text: "Tarea",
column_start_date: "Inicio",
column_duration: "Duración",
column_add: "",
link: "Enlace",
confirm_link_deleting: "será borrada",
link_start: " (inicio)",
link_end: " (fin)",
type_task: "Tarea",
type_project: "Proyecto",
type_milestone: "Hito",
minutes: "Minutos",
hours: "Horas",
days: "Días",
weeks: "Semanas",
months: "Meses",
years: "Años",
message_ok: "OK",
message_cancel: "Cancelar",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
month_short: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
day_full: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
day_short: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
},
labels: {
new_task: "New task",
icon_save: "Save",
icon_cancel: "Cancel",
icon_details: "Details",
icon_edit: "Edit",
icon_delete: "Delete",
confirm_closing: "",
confirm_deleting: "Task will be deleted permanently, are you sure?",
section_description: "Description",
section_time: "Time period",
section_type: "Type",
column_wbs: "WBS",
column_text: "Task name",
column_start_date: "Start time",
column_duration: "Duration",
column_add: "",
link: "Link",
confirm_link_deleting: "will be deleted",
link_start: " (start)",
link_end: " (end)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Minutes",
hours: "Hours",
days: "Days",
weeks: "Week",
months: "Months",
years: "Years",
message_ok: "OK",
message_cancel: "Cancel",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάϊος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"],
month_short: ["ΙΑΝ", "ΦΕΒ", "ΜΑΡ", "ΑΠΡ", "ΜΑΙ", "ΙΟΥΝ", "ΙΟΥΛ", "ΑΥΓ", "ΣΕΠ", "ΟΚΤ", "ΝΟΕ", "ΔΕΚ"],
day_full: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Κυριακή"],
day_short: ["ΚΥ", "ΔΕ", "ΤΡ", "ΤΕ", "ΠΕ", "ΠΑ", "ΣΑ"]
},
labels: {
new_task: "Νέα εργασία",
icon_save: "Αποθήκευση",
icon_cancel: "Άκυρο",
icon_details: "Λεπτομέρειες",
icon_edit: "Επεξεργασία",
icon_delete: "Διαγραφή",
confirm_closing: "",
confirm_deleting: "Το έργο θα διαγραφεί οριστικά. Θέλετε να συνεχίσετε;",
section_description: "Περιγραφή",
section_time: "Χρονική περίοδος",
section_type: "Type",
column_wbs: "WBS",
column_text: "Task name",
column_start_date: "Start time",
column_duration: "Duration",
column_add: "",
link: "Link",
confirm_link_deleting: "will be deleted",
link_start: " (start)",
link_end: " (end)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Minutes",
hours: "Hours",
days: "Days",
weeks: "Week",
months: "Months",
years: "Years",
message_ok: "OK",
message_cancel: "Άκυρο",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: [" Januar", " Februar", " März ", " April", " Mai", " Juni", " Juli", " August", " September ", " Oktober", " November ", " Dezember"],
month_short: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"],
day_full: ["Sonntag", "Montag", "Dienstag", " Mittwoch", " Donnerstag", "Freitag", "Samstag"],
day_short: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"]
},
labels: {
new_task: "Neue Aufgabe",
icon_save: "Speichern",
icon_cancel: "Abbrechen",
icon_details: "Details",
icon_edit: "Ändern",
icon_delete: "Löschen",
confirm_closing: "",
confirm_deleting: "Der Eintrag wird gelöscht",
section_description: "Beschreibung",
section_time: "Zeitspanne",
section_type: "Type",
column_wbs: "PSP",
column_text: "Task-Namen",
column_start_date: "Startzeit",
column_duration: "Dauer",
column_add: "",
link: "Link",
confirm_link_deleting: "werden gelöscht",
link_start: "(starten)",
link_end: "(ende)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Minuten",
hours: "Stunden",
days: "Tage",
weeks: "Wochen",
months: "Monate",
years: "Jahre",
message_ok: "OK",
message_cancel: "Abbrechen",
section_constraint: "Regel",
constraint_type: "Regel",
constraint_date: "Regel - Datum",
asap: "So bald wie möglich",
alap: "So spät wie möglich",
snet: "Beginn nicht vor",
snlt: "Beginn nicht später als",
fnet: "Fertigstellung nicht vor",
fnlt: "Fertigstellung nicht später als",
mso: "Muss beginnen am",
mfo: "Muss fertig sein am",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December"],
month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],
day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"],
day_short: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"]
},
labels: {
new_task: "Ny opgave",
icon_save: "Gem",
icon_cancel: "Fortryd",
icon_details: "Detaljer",
icon_edit: "Tilret",
icon_delete: "Slet",
confirm_closing: "Dine rettelser vil gå tabt.. Er dy sikker?",
confirm_deleting: "Bigivenheden vil blive slettet permanent. Er du sikker?",
section_description: "Beskrivelse",
section_time: "Tidsperiode",
section_type: "Type",
column_wbs: "WBS",
column_text: "Task name",
column_start_date: "Start time",
column_duration: "Duration",
column_add: "",
link: "Link",
confirm_link_deleting: "will be deleted",
link_start: " (start)",
link_end: " (end)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Minutes",
hours: "Hours",
days: "Days",
weeks: "Week",
months: "Months",
years: "Years",
message_ok: "OK",
message_cancel: "Fortryd",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"],
month_short: ["Led", "Ún", "Bře", "Dub", "Kvě", "Čer", "Čec", "Srp", "Září", "Říj", "List", "Pro"],
day_full: ["Neděle", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota"],
day_short: ["Ne", "Po", "Út", "St", "Čt", "Pá", "So"]
},
labels: {
new_task: "Nová práce",
icon_save: "Uložit",
icon_cancel: "Zpět",
icon_details: "Detail",
icon_edit: "Edituj",
icon_delete: "Smazat",
confirm_closing: "",
confirm_deleting: "Událost bude trvale smazána, opravdu?",
section_description: "Poznámky",
section_time: "Doba platnosti",
section_type: "Type",
column_wbs: "WBS",
column_text: "Task name",
column_start_date: "Start time",
column_duration: "Duration",
column_add: "",
link: "Link",
confirm_link_deleting: "will be deleted",
link_start: " (start)",
link_end: " (end)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Minutes",
hours: "Hours",
days: "Days",
weeks: "Week",
months: "Months",
years: "Years",
message_ok: "OK",
message_cancel: "Zpět",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
month_short: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
day_full: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
day_short: ["日", "一", "二", "三", "四", "五", "六"]
},
labels: {
new_task: "新任務",
icon_save: "保存",
icon_cancel: "关闭",
icon_details: "详细",
icon_edit: "编辑",
icon_delete: "删除",
confirm_closing: "请确认是否撤销修改!",
confirm_deleting: "是否删除日程?",
section_description: "描述",
section_time: "时间范围",
section_type: "类型",
column_wbs: "工作分解结构",
column_text: "任务名",
column_start_date: "开始时间",
column_duration: "持续时间",
column_add: "",
link: "关联",
confirm_link_deleting: "将被删除",
link_start: " (开始)",
link_end: " (结束)",
type_task: "任务",
type_project: "项目",
type_milestone: "里程碑",
minutes: "分钟",
hours: "小时",
days: "天",
weeks: "周",
months: "月",
years: "年",
message_ok: "OK",
message_cancel: "关闭",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"],
month_short: ["Gen", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Des"],
day_full: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"],
day_short: ["Dg", "Dl", "Dm", "Dc", "Dj", "Dv", "Ds"]
},
labels: {
new_task: "Nova tasca",
icon_save: "Guardar",
icon_cancel: "Cancel·lar",
icon_details: "Detalls",
icon_edit: "Editar",
icon_delete: "Esborrar",
confirm_closing: "",
confirm_deleting: "L'esdeveniment s'esborrarà definitivament, continuar ?",
section_description: "Descripció",
section_time: "Periode de temps",
section_type: "Type",
column_wbs: "WBS",
column_text: "Task name",
column_start_date: "Start time",
column_duration: "Duration",
column_add: "",
link: "Link",
confirm_link_deleting: "will be deleted",
link_start: " (start)",
link_end: " (end)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Minutes",
hours: "Hours",
days: "Days",
weeks: "Week",
months: "Months",
years: "Years",
message_ok: "OK",
message_cancel: "Cancel·lar",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["Студзень", "Люты", "Сакавік", "Красавік", "Maй", "Чэрвень", "Ліпень", "Жнівень", "Верасень", "Кастрычнік", "Лістапад", "Снежань"],
month_short: ["Студз", "Лют", "Сак", "Крас", "Maй", "Чэр", "Ліп", "Жнів", "Вер", "Каст", "Ліст", "Снеж"],
day_full: ["Нядзеля", "Панядзелак", "Аўторак", "Серада", "Чацвер", "Пятніца", "Субота"],
day_short: ["Нд", "Пн", "Аўт", "Ср", "Чцв", "Пт", "Сб"]
},
labels: {
new_task: "Новае заданне",
icon_save: "Захаваць",
icon_cancel: "Адмяніць",
icon_details: "Дэталі",
icon_edit: "Змяніць",
icon_delete: "Выдаліць",
confirm_closing: "",
confirm_deleting: "Падзея будзе выдалена незваротна, працягнуць?",
section_description: "Апісанне",
section_time: "Перыяд часу",
section_type: "Тып",
column_wbs: "ІСР",
column_text: "Задача",
column_start_date: "Пачатак",
column_duration: "Працяг",
column_add: "",
link: "Сувязь",
confirm_link_deleting: "будзе выдалена",
link_start: "(пачатак)",
link_end: "(канец)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Хвiлiна",
hours: "Гадзiна",
days: "Дзень",
weeks: "Тыдзень",
months: "Месяц",
years: "Год",
message_ok: "OK",
message_cancel: "Адмяніць",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
e.default = {
date: {
month_full: ["كانون الثاني", "شباط", "آذار", "نيسان", "أيار", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"],
month_short: ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"],
day_full: ["الأحد", "الأثنين", "ألثلاثاء", "الأربعاء", "ألحميس", "ألجمعة", "السبت"],
day_short: ["احد", "اثنين", "ثلاثاء", "اربعاء", "خميس", "جمعة", "سبت"]
},
labels: {
new_task: "مهمة جديد",
icon_save: "اخزن",
icon_cancel: "الغاء",
icon_details: "تفاصيل",
icon_edit: "تحرير",
icon_delete: "حذف",
confirm_closing: "التغييرات سوف تضيع, هل انت متأكد؟",
confirm_deleting: "الحدث سيتم حذفها نهائيا ، هل أنت متأكد؟",
section_description: "الوصف",
section_time: "الفترة الزمنية",
section_type: "Type",
column_wbs: "WBS",
column_text: "Task name",
column_start_date: "Start time",
column_duration: "Duration",
column_add: "",
link: "Link",
confirm_link_deleting: "will be deleted",
link_start: " (start)",
link_end: " (end)",
type_task: "Task",
type_project: "Project",
type_milestone: "Milestone",
minutes: "Minutes",
hours: "Hours",
days: "Days",
weeks: "Week",
months: "Months",
years: "Years",
message_ok: "OK",
message_cancel: "الغاء",
section_constraint: "Constraint",
constraint_type: "Constraint type",
constraint_date: "Constraint date",
asap: "As Soon As Possible",
alap: "As Late As Possible",
snet: "Start No Earlier Than",
snlt: "Start No Later Than",
fnet: "Finish No Earlier Than",
fnlt: "Finish No Later Than",
mso: "Must Start On",
mfo: "Must Finish On",
resources_filter_placeholder: "type to filter",
resources_filter_label: "hide empty",
empty_state_text_link: "Click here",
empty_state_text_description: "to create your first task"
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(177)
, r = n(176)
, a = n(175)
, o = n(174)
, s = n(173)
, l = n(172)
, c = n(171)
, u = n(170)
, d = n(169)
, h = n(168)
, f = n(167)
, _ = n(166)
, g = n(165)
, p = n(164)
, v = n(163)
, m = n(162)
, y = n(161)
, k = n(160)
, b = n(159)
, x = n(158)
, w = n(157)
, S = n(156)
, T = n(155)
, $ = n(154)
, C = n(153)
, E = n(152)
, A = n(151)
, D = n(150)
, M = n(149)
, I = n(148)
, P = n(147)
, N = n(146)
, O = n(145);
e.default = function() {
return new w.default({
en: d.default,
ar: i.default,
be: r.default,
ca: a.default,
cn: o.default,
cs: s.default,
da: l.default,
de: c.default,
el: u.default,
es: h.default,
fa: f.default,
fi: _.default,
fr: g.default,
he: p.default,
hr: v.default,
hu: m.default,
id: y.default,
it: k.default,
jp: b.default,
kr: x.default,
nb: S.default,
nl: T.default,
no: $.default,
pl: C.default,
pt: E.default,
ro: A.default,
ru: D.default,
si: M.default,
sk: I.default,
sv: P.default,
tr: N.default,
ua: O.default
})
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
}),
e.default = function() {}
}
, function(t, e) {
t.exports = function(t) {
t.destructor = function() {
for (var t in this.clearAll(),
this.callEvent("onDestroy", []),
this.$root && delete this.$root.gantt,
this._eventRemoveAll && this._eventRemoveAll(),
this.$layout && this.$layout.destructor(),
this.resetLightbox && this.resetLightbox(),
this._dp && this._dp.destructor && this._dp.destructor(),
this.$services.destructor(),
this.detachAllEvents(),
this)
0 === t.indexOf("$") && delete this[t];
this.$destroyed = !0
}
}
}
, function(t, e) {
t.exports = function(t) {
return function(e, n) {
e || t.config.show_errors && !1 !== t.callEvent("onError", [n]) && (t.message ? t.message({
type: "error",
text: n,
expire: -1
}) : console.log(n))
}
}
}
, function(t, e) {
function n(t, e) {
var n, i = t.config.container_resize_timeout || 20;
if ("timeout" == t.config.container_resize_method)
s();
else
try {
t.event(e, "resize", function() {
t.$scrollbarRepaint ? t.$scrollbarRepaint = null : r()
})
} catch (t) {
s()
}
function r() {
clearTimeout(n),
n = setTimeout(function() {
t.$destroyed || t.render()
}, i)
}
var a = t.$root.offsetHeight
, o = t.$root.offsetWidth;
function s() {
t.$root.offsetHeight == a && t.$root.offsetWidth == o || r(),
a = t.$root.offsetHeight,
o = t.$root.offsetWidth,
setTimeout(s, i)
}
}
t.exports = function(t) {
"static" == window.getComputedStyle(t.$root).getPropertyValue("position") && (t.$root.style.position = "relative");
var e = document.createElement("iframe");
e.className = "gantt_container_resize_watcher",
e.tabIndex = -1,
t.config.wai_aria_attributes && (e.setAttribute("role", "none"),
e.setAttribute("aria-hidden", !0)),
(!!window.Sfdc || !!window.$A || window.Aura) && (t.config.container_resize_method = "timeout"),
t.$root.appendChild(e),
e.contentWindow ? n(t, e.contentWindow) : (t.$root.removeChild(e),
n(t, window))
}
}
, function(t, e, n) {
function i(t) {
"@babel/helpers - typeof";
return (i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
var r = n(1)
, a = n(2)
, o = n(15)
, s = n(182);
t.exports = function(t) {
var e = n(46);
t.assert = n(181)(t);
var l = "Invalid value of the first argument of `gantt.init`. Supported values: HTMLElement, String (element id).This error means that either invalid object is passed into `gantt.init` or that the element with the specified ID doesn't exist on the page when `gantt.init` is called.";
function c(e) {
if (!e || "string" == typeof e && document.getElementById(e))
return !0;
if (function(t) {
try {
t.cloneNode(!1)
} catch (t) {
return !1
}
return !0
}(e))
return !0;
throw t.assert(!1, l),
new Error(l)
}
t.init = function(e, n, i) {
t.env.isNode ? e = null : c(e),
n && i && (this.config.start_date = this._min_date = new Date(n),
this.config.end_date = this._max_date = new Date(i)),
this.date.init(),
this.init = function(e) {
t.env.isNode ? e = null : c(e),
this.$container && this.$container.parentNode && (this.$container.parentNode.removeChild(this.$container),
this.$container = null),
this.$layout && this.$layout.clear(),
this._reinit(e)
}
,
this._reinit(e)
}
,
t._quickRefresh = function(t) {
for (var e = this._getDatastores.call(this), n = 0; n < e.length; n++)
e[n]._quick_refresh = !0;
t();
for (n = 0; n < e.length; n++)
e[n]._quick_refresh = !1
}
;
var u = function() {
this._clearTaskLayers && this._clearTaskLayers(),
this._clearLinkLayers && this._clearLinkLayers(),
this.$layout && (this.$layout.destructor(),
this.$layout = null,
this.$ui.reset())
}
.bind(t)
, d = function() {
o(t) || (this.$root.innerHTML = "",
this.$root.gantt = this,
e(this),
this.config.layout.id = "main",
this.$layout = this.$ui.createView("layout", this.$root, this.config.layout),
this.$layout.attachEvent("onBeforeResize", function() {
for (var e = t.$services.getService("datastores"), n = 0; n < e.length; n++)
t.getDatastore(e[n]).filter(),
t.$data.tasksStore._skipTaskRecalculation ? "lightbox" != t.$data.tasksStore._skipTaskRecalculation && (t.$data.tasksStore._skipTaskRecalculation = !1) : t.getDatastore(e[n]).callEvent("onBeforeRefreshAll", [])
}),
this.$layout.attachEvent("onResize", function() {
t._quickRefresh(function() {
t.refreshData()
})
}),
this.callEvent("onGanttLayoutReady", []),
this.$layout.render(),
this.$container = this.$layout.$container.firstChild,
s(this))
}
.bind(t);
t.resetLayout = function() {
u(),
d(),
this.render()
}
,
t._reinit = function(t) {
this.callEvent("onBeforeGanttReady", []),
this._update_flags(),
this.$services.getService("templateLoader").initTemplates(this),
u(),
this.$root = null,
t && (this.$root = r.toNode(t),
d(),
this.$mouseEvents.reset(this.$root)),
this.callEvent("onTemplatesReady", []),
this.callEvent("onGanttReady", []),
this.render()
}
,
t.$click = {
buttons: {
edit: function(e) {
t.isReadonly(t.getTask(e)) || t.showLightbox(e)
},
delete: function(e) {
var n = t.getTask(e);
if (!t.isReadonly(n)) {
var i = t.locale.labels.confirm_deleting
, r = t.locale.labels.confirm_deleting_title;
t._simple_confirm(i, r, function() {
t.isTaskExists(e) ? (n.$new ? (t.$data.tasksStore._skipTaskRecalculation = "lightbox",
t.silent(function() {
t.deleteTask(e, !0)
}),
t.$data.tasksStore._skipTaskRecalculation = !1,
t.refreshData()) : (t.$data.tasksStore._skipTaskRecalculation = !0,
t.deleteTask(e)),
t.hideLightbox()) : t.hideLightbox()
})
}
}
}
},
t.render = function() {
var n;
if (this.callEvent("onBeforeGanttRender", []),
!o(t)) {
!this.config.sort && this._sort && (this._sort = void 0),
this.$root && (this.config.rtl ? (this.$root.classList.add("gantt_rtl"),
this.$root.firstChild.classList.add("gantt_rtl")) : (this.$root.classList.remove("gantt_rtl"),
this.$root.firstChild.classList.remove("gantt_rtl")));
var i = this.getScrollState()
, r = i ? i.x : 0;
if (this._getHorizontalScrollbar())
r = this._getHorizontalScrollbar().$config.codeScrollLeft || r || 0;
n = null,
r && (n = t.dateFromPos(r + this.config.task_scroll_offset))
}
if (e(this),
o(t))
t.refreshData();
else {
this.$layout.$config.autosize = this.config.autosize;
var a = this.config.preserve_scroll;
if (this.config.preserve_scroll = !1,
this.$layout.resize(),
this.config.preserve_scroll = a,
this.config.preserve_scroll && i) {
if (r || i.y) {
var s = t.getScrollState();
if (+n != +t.dateFromPos(s.x) || s.y != i.y) {
r = null;
var l = null;
if (n)
r = Math.max(t.posFromDate(n) - t.config.task_scroll_offset, 0);
i.y && (l = i.y),
t.scrollTo(r, l)
}
}
var c = t.$ui.getView("grid");
if (c) {
var u = c.$config.scrollY
, d = t.$ui.getView(u);
if (d)
t.utils.dom.isChildOf(d.$view, t.$container) || c.scrollTo(void 0, 0)
}
}
}
this.callEvent("onGanttRender", [])
}
,
t.setSizes = t.render,
t.getTaskRowNode = function(t) {
for (var e = this.$grid_data.childNodes, n = this.config.task_attribute, i = 0; i < e.length; i++) {
if (e[i].getAttribute)
if (e[i].getAttribute(n) == t)
return e[i]
}
return null
}
,
t.changeLightboxType = function(e) {
if (this.getLightboxType() == e)
return !0;
t._silent_redraw_lightbox(e)
}
,
t._get_link_type = function(e, n) {
var i = null;
return e && n ? i = t.config.links.start_to_start : !e && n ? i = t.config.links.finish_to_start : e || n ? e && !n && (i = t.config.links.start_to_finish) : i = t.config.links.finish_to_finish,
i
}
,
t.isLinkAllowed = function(t, e, n, r) {
var a = null;
if (!(a = "object" == i(t) ? t : {
source: t,
target: e,
type: this._get_link_type(n, r)
}))
return !1;
if (!(a.source && a.target && a.type))
return !1;
if (a.source == a.target)
return !1;
var o = !0;
return this.checkEvent("onLinkValidation") && (o = this.callEvent("onLinkValidation", [a])),
o
}
,
t._correct_dst_change = function(e, n, i, r) {
var o = a.getSecondsInUnit(r) * i;
if (o > 3600 && o < 86400) {
var s = e.getTimezoneOffset() - n;
s && (e = t.date.add(e, s, "minute"))
}
return e
}
,
t.isSplitTask = function(e) {
return t.assert(e && e instanceof Object, "Invalid argument task=" + e + " of gantt.isSplitTask. Task object was expected"),
this.$data.tasksStore._isSplitItem(e)
}
,
t._is_icon_open_click = function(t) {
if (!t)
return !1;
var e = t.target || t.srcElement;
if (!e || !e.className)
return !1;
var n = r.getClassName(e);
return -1 !== n.indexOf("gantt_tree_icon") && (-1 !== n.indexOf("gantt_close") || -1 !== n.indexOf("gantt_open"))
}
}
}
, function(t, e) {
t.exports = function(t) {
function e() {
return t._cached_functions.update_if_changed(t),
t._cached_functions.active || t._cached_functions.activate(),
!0
}
t._cached_functions = {
cache: {},
mode: !1,
critical_path_mode: !1,
wrap_methods: function(t, e) {
if (e._prefetch_originals)
for (var n in e._prefetch_originals)
e[n] = e._prefetch_originals[n];
e._prefetch_originals = {};
for (n = 0; n < t.length; n++)
this.prefetch(t[n], e)
},
prefetch: function(t, e) {
var n = e[t];
if (n) {
var i = this;
e._prefetch_originals[t] = n,
e[t] = function() {
for (var e = new Array(arguments.length), r = 0, a = arguments.length; r < a; r++)
e[r] = arguments[r];
if (i.active) {
var o = i.get_arguments_hash(Array.prototype.slice.call(e));
i.cache[t] || (i.cache[t] = {});
var s = i.cache[t];
if (i.has_cached_value(s, o))
return i.get_cached_value(s, o);
var l = n.apply(this, e);
return i.cache_value(s, o, l),
l
}
return n.apply(this, e)
}
}
return n
},
cache_value: function(t, e, n) {
this.is_date(n) && (n = new Date(n)),
t[e] = n
},
has_cached_value: function(t, e) {
return t.hasOwnProperty(e)
},
get_cached_value: function(t, e) {
var n = t[e];
return this.is_date(n) && (n = new Date(n)),
n
},
is_date: function(t) {
return t && t.getUTCDate
},
get_arguments_hash: function(t) {
for (var e = [], n = 0; n < t.length; n++)
e.push(this.stringify_argument(t[n]));
return "(" + e.join(";") + ")"
},
stringify_argument: function(t) {
return (t.id ? t.id : this.is_date(t) ? t.valueOf() : t) + ""
},
activate: function() {
this.clear(),
this.active = !0
},
deactivate: function() {
this.clear(),
this.active = !1
},
clear: function() {
this.cache = {}
},
setup: function(t) {
var e = []
, n = ["_isProjectEnd", "_getProjectEnd", "_getSlack"];
"auto" == this.mode ? t.config.highlight_critical_path && (e = n) : !0 === this.mode && (e = n),
this.wrap_methods(e, t)
},
update_if_changed: function(t) {
(this.critical_path_mode != t.config.highlight_critical_path || this.mode !== t.config.optimize_render) && (this.critical_path_mode = t.config.highlight_critical_path,
this.mode = t.config.optimize_render,
this.setup(t))
}
},
t.attachEvent("onBeforeGanttRender", e),
t.attachEvent("onBeforeDataRender", e),
t.attachEvent("onBeforeSmartRender", function() {
e()
}),
t.attachEvent("onBeforeParse", e),
t.attachEvent("onDataRender", function() {
t._cached_functions.deactivate()
});
var n = null;
t.attachEvent("onSmartRender", function() {
n && clearTimeout(n),
n = setTimeout(function() {
t._cached_functions.deactivate()
}, 1e3)
}),
t.attachEvent("onBeforeGanttReady", function() {
return t._cached_functions.update_if_changed(t),
!0
})
}
}
, function(t, e) {
function n(t) {
"@babel/helpers - typeof";
return (n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
t.exports = function(t) {
t.getTaskType = function(e) {
var i = e;
for (var r in e && "object" == n(e) && (i = e.type),
this.config.types)
if (this.config.types[r] == i)
return i;
return t.config.types.task
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
}),
e.default = function() {}
}
, function(t, e, n) {
var i = n(2);
t.exports = function(t) {
t.isUnscheduledTask = function(e) {
return t.assert(e && e instanceof Object, "Invalid argument task=" + e + " of gantt.isUnscheduledTask. Task object was expected"),
!!e.unscheduled || !e.start_date
}
,
t._isAllowedUnscheduledTask = function(e) {
return !(!e.unscheduled || !t.config.show_unscheduled)
}
,
t._isTaskInTimelineLimits = function(t) {
var e = t.start_date ? t.start_date.valueOf() : null
, n = t.end_date ? t.end_date.valueOf() : null;
return !!(e && n && e <= this._max_date.valueOf() && n >= this._min_date.valueOf())
}
,
t.isTaskVisible = function(t) {
if (!this.isTaskExists(t))
return !1;
var e = this.getTask(t);
return !(!this._isAllowedUnscheduledTask(e) && !this._isTaskInTimelineLimits(e)) && !!(this.getGlobalTaskIndex(t) >= 0)
}
,
t._getProjectEnd = function() {
if (t.config.project_end)
return t.config.project_end;
var e = t.getTaskByTime();
return (e = e.sort(function(t, e) {
return +t.end_date > +e.end_date ? 1 : -1
})).length ? e[e.length - 1].end_date : null
}
,
t._getProjectStart = function() {
if (t.config.project_start)
return t.config.project_start;
if (t.config.start_date)
return t.config.start_date;
if (t.getState().min_date)
return t.getState().min_date;
var e = t.getTaskByTime();
return (e = e.sort(function(t, e) {
return +t.start_date > +e.start_date ? 1 : -1
})).length ? e[0].start_date : null
}
;
var e = function(e, n) {
var i = !!(n && n != t.config.root_id && t.isTaskExists(n)) && t.getTask(n)
, r = null;
if (i)
r = t.config.schedule_from_end ? t.calculateEndDate({
start_date: i.end_date,
duration: -t.config.duration_step,
task: e
}) : i.start_date;
else if (t.config.schedule_from_end)
r = t.calculateEndDate({
start_date: t._getProjectEnd(),
duration: -t.config.duration_step,
task: e
});
else {
var a = t.getTaskByIndex(0);
r = a ? a.start_date ? a.start_date : a.end_date ? t.calculateEndDate({
start_date: a.end_date,
duration: -t.config.duration_step,
task: e
}) : null : t.config.start_date || t.getState().min_date
}
return t.assert(r, "Invalid dates"),
new Date(r)
};
t._set_default_task_timing = function(n) {
n.start_date = n.start_date || e(n, t.getParent(n)),
n.duration = n.duration || t.config.duration_step,
n.end_date = n.end_date || t.calculateEndDate(n)
}
,
t.createTask = function(n, i, r) {
(n = n || {},
t.defined(n.id) || (n.id = t.uid()),
n.start_date || (n.start_date = e(n, i)),
void 0 === n.text && (n.text = t.locale.labels.new_task),
void 0 === n.duration && (n.duration = 1),
this.isTaskExists(i)) && (this.setParent(n, i, !0),
this.getTask(i).$open = !0);
if (!this.callEvent("onTaskCreated", [n]))
return null;
if (this.config.details_on_create) {
if (t.isTaskExists(n.id))
t.getTask(n.id).$index != n.$index && (n.start_date && "string" == typeof n.start_date && (n.start_date = this.date.parseDate(n.start_date, "parse_date")),
n.end_date && "string" == typeof n.end_date && (n.end_date = this.date.parseDate(n.end_date, "parse_date")),
this.$data.tasksStore.updateItem(n.id, n));
else
n.$new = !0,
this.silent(function() {
t.$data.tasksStore.addItem(n, r)
});
this.selectTask(n.id),
this.refreshData(),
this.showLightbox(n.id)
} else
this.addTask(n, i, r) && (this.showTask(n.id),
this.selectTask(n.id));
return n.id
}
,
t._update_flags = function(e, n) {
var i = t.$data.tasksStore;
void 0 === e ? (this._lightbox_id = null,
i.silent(function() {
i.unselect()
}),
this.getSelectedTasks && this._multiselect.reset(),
this._tasks_dnd && this._tasks_dnd.drag && (this._tasks_dnd.drag.id = null)) : (this._lightbox_id == e && (this._lightbox_id = n),
i.getSelectedId() == e && i.silent(function() {
i.unselect(e),
i.select(n)
}),
this._tasks_dnd && this._tasks_dnd.drag && this._tasks_dnd.drag.id == e && (this._tasks_dnd.drag.id = n))
}
;
var n = function(e, n) {
var i = t.getTaskType(e.type)
, r = {
type: i,
$no_start: !1,
$no_end: !1
};
return n || i != e.$rendered_type ? (i == t.config.types.project ? r.$no_end = r.$no_start = !0 : i != t.config.types.milestone && (r.$no_end = !(e.end_date || e.duration),
r.$no_start = !e.start_date,
t._isAllowedUnscheduledTask(e) && (r.$no_end = r.$no_start = !1)),
r) : (r.$no_start = e.$no_start,
r.$no_end = e.$no_end,
r)
};
function r(e) {
e.$effective_calendar = t.getTaskCalendar(e).id,
e.start_date = t.getClosestWorkTime({
dir: "future",
date: e.start_date,
unit: t.config.duration_unit,
task: e
}),
e.end_date = t.calculateEndDate(e)
}
function a(e) {
var n = null
, i = null
, r = void 0 !== e ? e : t.config.root_id
, a = [];
return t.eachTask(function(e) {
t.getTaskType(e.type) == t.config.types.project || t.isUnscheduledTask(e) || (e.rollup && a.push(e.id),
e.start_date && !e.$no_start && (!n || n > e.start_date.valueOf()) && (n = e.start_date.valueOf()),
e.end_date && !e.$no_end && (!i || i < e.end_date.valueOf()) && (i = e.end_date.valueOf()))
}, r),
{
start_date: n ? new Date(n) : null,
end_date: i ? new Date(i) : null,
rollup: a
}
}
t._init_task_timing = function(t) {
var e = n(t, !0)
, i = t.$rendered_type != e.type
, a = e.type;
i && (t.$no_start = e.$no_start,
t.$no_end = e.$no_end,
t.$rendered_type = e.type),
i && a != this.config.types.milestone && a == this.config.types.project && (this._set_default_task_timing(t),
t.$calculate_duration = !1),
a == this.config.types.milestone && (t.end_date = t.start_date),
t.start_date && t.end_date && !1 !== t.$calculate_duration && (t.duration = this.calculateDuration(t)),
t.$calculate_duration || (t.$calculate_duration = !0),
t.end_date || (t.end_date = t.start_date),
t.duration = t.duration || 0,
0 === this.config.min_duration && 0 === t.duration && (t.$no_end = !1);
var o = this.getTaskCalendar(t);
t.$effective_calendar && t.$effective_calendar !== o.id && (r(t),
this.config.inherit_calendar && this.isSummaryTask(t) && this.eachTask(function(t) {
r(t)
}, t.id)),
t.$effective_calendar = o.id
}
,
t.isSummaryTask = function(e) {
t.assert(e && e instanceof Object, "Invalid argument task=" + e + " of gantt.isSummaryTask. Task object was expected");
var i = n(e);
return !(!i.$no_end && !i.$no_start)
}
,
t.resetProjectDates = function(t) {
var i = n(t);
if (i.$no_end || i.$no_start) {
var r = a(t.id);
(function(t, n, i, r) {
n.$no_start && (t.start_date = i ? new Date(i) : e(t, this.getParent(t)));
n.$no_end && (t.end_date = r ? new Date(r) : this.calculateEndDate({
start_date: t.start_date,
duration: this.config.duration_step,
task: t
}));
(n.$no_start || n.$no_end) && this._init_task_timing(t)
}
).call(this, t, i, r.start_date, r.end_date),
t.$rollup = r.rollup
}
}
,
t.getSubtaskDuration = function(e) {
var n = 0
, i = void 0 !== e ? e : t.config.root_id;
return this.eachTask(function(e) {
this.getTaskType(e.type) == t.config.types.project || this.isUnscheduledTask(e) || (n += e.duration)
}, i),
n
}
,
t.getSubtaskDates = function(t) {
var e = a(t);
return {
start_date: e.start_date,
end_date: e.end_date
}
}
,
t._update_parents = function(e, i, r) {
if (e) {
var a = this.getTask(e);
a.rollup && (r = !0);
var o = this.getParent(a)
, s = n(a)
, l = !0;
if (r || a.start_date && a.end_date && (s.$no_start || s.$no_end)) {
var c = a.start_date.valueOf()
, u = a.end_date.valueOf();
t.resetProjectDates(a),
r || c != a.start_date.valueOf() || u != a.end_date.valueOf() || (l = !1),
l && !i && this.refreshTask(a.id, !0)
}
l && o && this.isTaskExists(o) && this._update_parents(o, i, r)
}
}
,
t.roundDate = function(e) {
var n = t.getScale();
i.isDate(e) && (e = {
date: e,
unit: n ? n.unit : t.config.duration_unit,
step: n ? n.step : t.config.duration_step
});
var r, a, o, s = e.date, l = e.step, c = e.unit;
if (!n)
return s;
if (c == n.unit && l == n.step && +s >= +n.min_date && +s <= +n.max_date)
o = Math.floor(t.columnIndexByDate(s)),
n.trace_x[o] || (o -= 1,
n.rtl && (o = 0)),
a = new Date(n.trace_x[o]),
r = t.date.add(a, l, c);
else {
for (o = Math.floor(t.columnIndexByDate(s)),
r = t.date[c + "_start"](new Date(n.min_date)),
n.trace_x[o] && (r = t.date[c + "_start"](n.trace_x[o])); +r < +s; ) {
var u = (r = t.date[c + "_start"](t.date.add(r, l, c))).getTimezoneOffset();
r = t._correct_dst_change(r, u, r, c),
t.date[c + "_start"] && (r = t.date[c + "_start"](r))
}
a = t.date.add(r, -1 * l, c)
}
return e.dir && "future" == e.dir ? r : e.dir && "past" == e.dir ? a : Math.abs(s - a) < Math.abs(r - s) ? a : r
}
,
t.correctTaskWorkTime = function(e) {
t.config.work_time && t.config.correct_work_time && (this.isWorkTime(e.start_date, void 0, e) ? this.isWorkTime(new Date(+e.end_date - 1), void 0, e) || (e.end_date = this.calculateEndDate(e)) : (e.start_date = this.getClosestWorkTime({
date: e.start_date,
dir: "future",
task: e
}),
e.end_date = this.calculateEndDate(e)))
}
,
t.attachEvent("onBeforeTaskUpdate", function(e, n) {
return t._init_task_timing(n),
!0
}),
t.attachEvent("onBeforeTaskAdd", function(e, n) {
return t._init_task_timing(n),
!0
}),
t.attachEvent("onAfterTaskMove", function(e, n, i) {
return t._init_task_timing(t.getTask(e)),
!0
})
}
}
, function(t, e, n) {
var i = n(0);
t.exports = {
create: function(t, e) {
return {
getWorkHours: function(t) {
return e.getWorkHours(t)
},
setWorkTime: function(t) {
return e.setWorkTime(t)
},
unsetWorkTime: function(t) {
e.unsetWorkTime(t)
},
isWorkTime: function(t, n, i) {
return e.isWorkTime(t, n, i)
},
getClosestWorkTime: function(t) {
return e.getClosestWorkTime(t)
},
calculateDuration: function(t, n, i) {
return e.calculateDuration(t, n, i)
},
_hasDuration: function(t, n, i) {
return e.hasDuration(t, n, i)
},
calculateEndDate: function(t, n, i, r) {
return e.calculateEndDate(t, n, i, r)
},
mergeCalendars: i.bind(t.mergeCalendars, t),
createCalendar: i.bind(t.createCalendar, t),
addCalendar: i.bind(t.addCalendar, t),
getCalendar: i.bind(t.getCalendar, t),
getCalendars: i.bind(t.getCalendars, t),
getResourceCalendar: i.bind(t.getResourceCalendar, t),
getTaskCalendar: i.bind(t.getTaskCalendar, t),
deleteCalendar: i.bind(t.deleteCalendar, t)
}
}
}
}
, function(t, e) {
function n(t, e) {
this.argumentsHelper = e,
this.$gantt = t
}
n.prototype = {
getWorkHours: function() {
return [0, 24]
},
setWorkTime: function() {
return !0
},
unsetWorkTime: function() {
return !0
},
isWorkTime: function() {
return !0
},
getClosestWorkTime: function(t) {
return this.argumentsHelper.getClosestWorkTimeArguments.apply(this.argumentsHelper, arguments).date
},
calculateDuration: function() {
var t = this.argumentsHelper.getDurationArguments.apply(this.argumentsHelper, arguments)
, e = t.start_date
, n = t.end_date
, i = t.unit
, r = t.step;
return this._calculateDuration(e, n, i, r)
},
_calculateDuration: function(t, e, n, i) {
var r = this.$gantt.date
, a = {
week: 6048e5,
day: 864e5,
hour: 36e5,
minute: 6e4
}
, o = 0;
if (a[n])
o = Math.round((e - t) / (i * a[n]));
else {
for (var s = new Date(t), l = new Date(e); s.valueOf() < l.valueOf(); )
o += 1,
s = r.add(s, i, n);
s.valueOf() != e.valueOf() && (o += (l - s) / (r.add(s, i, n) - s))
}
return Math.round(o)
},
hasDuration: function() {
var t = this.argumentsHelper.getDurationArguments.apply(this.argumentsHelper, arguments)
, e = t.start_date
, n = t.end_date;
return !!t.unit && (e = new Date(e),
n = new Date(n),
e.valueOf() < n.valueOf())
},
hasWorkTime: function() {
return !0
},
equals: function(t) {
return t instanceof n
},
calculateEndDate: function() {
var t = this.argumentsHelper.calculateEndDateArguments.apply(this.argumentsHelper, arguments)
, e = t.start_date
, n = t.duration
, i = t.unit
, r = t.step;
return this.$gantt.date.add(e, r * n, i)
}
},
t.exports = n
}
, function(t, e, n) {
var i = n(42)
, r = n(189);
function a(t) {
this.$gantt = t.$gantt,
this.argumentsHelper = i(this.$gantt),
this.calendarManager = t,
this.$disabledCalendar = new r(this.$gantt,this.argumentsHelper)
}
a.prototype = {
_getCalendar: function(t) {
var e;
if (this.$gantt.config.work_time) {
var n = this.calendarManager;
t.task ? e = n.getTaskCalendar(t.task) : t.id ? e = n.getTaskCalendar(t) : t.calendar && (e = t.calendar),
e || (e = n.getTaskCalendar())
} else
e = this.$disabledCalendar;
return e
},
getWorkHours: function(t) {
return t = this.argumentsHelper.getWorkHoursArguments.apply(this.argumentsHelper, arguments),
this._getCalendar(t).getWorkHours(t.date)
},
setWorkTime: function(t, e) {
return t = this.argumentsHelper.setWorkTimeArguments.apply(this.argumentsHelper, arguments),
e || (e = this.calendarManager.getCalendar()),
e.setWorkTime(t)
},
unsetWorkTime: function(t, e) {
return t = this.argumentsHelper.unsetWorkTimeArguments.apply(this.argumentsHelper, arguments),
e || (e = this.calendarManager.getCalendar()),
e.unsetWorkTime(t)
},
isWorkTime: function(t, e, n, i) {
var r = this.argumentsHelper.isWorkTimeArguments.apply(this.argumentsHelper, arguments);
return this._getCalendar(r).isWorkTime(r)
},
getClosestWorkTime: function(t) {
return t = this.argumentsHelper.getClosestWorkTimeArguments.apply(this.argumentsHelper, arguments),
this._getCalendar(t).getClosestWorkTime(t)
},
calculateDuration: function() {
var t = this.argumentsHelper.getDurationArguments.apply(this.argumentsHelper, arguments);
return this._getCalendar(t).calculateDuration(t)
},
hasDuration: function() {
var t = this.argumentsHelper.hasDurationArguments.apply(this.argumentsHelper, arguments);
return this._getCalendar(t).hasDuration(t)
},
calculateEndDate: function(t) {
t = this.argumentsHelper.calculateEndDateArguments.apply(this.argumentsHelper, arguments);
return this._getCalendar(t).calculateEndDate(t)
}
},
t.exports = a
}
, function(t, e) {
t.exports = function() {
var t = {};
return {
getCalendarIdFromMultipleResources: function(e, n) {
var i = function(t) {
return t.map(function(t) {
return t && t.resource_id ? t.resource_id : t
}).sort().join("-")
}(e);
if (e.length) {
if (1 === e.length)
return n.getResourceCalendar(i).id;
if (t[i])
return t[i].id;
var r = function(t, e) {
return e.mergeCalendars(t.map(function(t) {
var n = t && t.resource_id ? t.resource_id : t;
return e.getResourceCalendar(n)
}))
}(e, n);
return t[i] = r,
n.addCalendar(r)
}
return null
}
}
}
}
, function(t, e) {
function n(t) {
"@babel/helpers - typeof";
return (n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
t.exports = {
isLegacyResourceCalendarFormat: function(t) {
if (!t)
return !1;
for (var e in t)
if (t[e] && "object" === n(t[e]))
return !0;
return !1
},
getResourceProperty: function(t) {
var e = t.resource_calendars
, n = t.resource_property;
if (this.isLegacyResourceCalendarFormat(e))
for (var i in t) {
n = i;
break
}
return n
},
getCalendarIdFromLegacyConfig: function(t, e) {
if (e)
for (var n in e) {
var i = e[n];
if (t[n]) {
var r = i[t[n]];
if (r)
return r
}
}
return null
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = function() {
function t() {
this.clear()
}
return t.prototype._getCacheObject = function(t, e, n) {
var i = this._cache;
i[e] || (i[e] = []);
var r = i[e];
r || (r = i[e] = {});
var a = r[n];
a || (a = r[n] = {});
var o = t.getFullYear()
, s = a[o];
return s || (s = a[o] = {
durations: {},
endDates: {}
}),
s
}
,
t.prototype._endDateCacheKey = function(t, e) {
return String(t) + "-" + String(e)
}
,
t.prototype._durationCacheKey = function(t, e) {
return String(t) + "-" + String(e)
}
,
t.prototype.getEndDate = function(t, e, n, i, r) {
var a, o = this._getCacheObject(t, n, i), s = t.valueOf(), l = this._endDateCacheKey(s, e);
if (void 0 === o.endDates[l]) {
var c = r()
, u = c.valueOf();
o.endDates[l] = u,
o.durations[this._durationCacheKey(s, u)] = e,
a = c
} else
a = new Date(o.endDates[l]);
return a
}
,
t.prototype.getDuration = function(t, e, n, i, r) {
var a, o = this._getCacheObject(t, n, i), s = t.valueOf(), l = e.valueOf(), c = this._durationCacheKey(s, l);
if (void 0 === o.durations[c]) {
var u = r();
o.durations[c] = u.valueOf(),
a = u
} else
a = o.durations[c];
return a
}
,
t.prototype.clear = function() {
this._cache = {}
}
,
t
}();
e.DateDurationCache = i
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = function() {
return function(t) {
var e = this;
this.getMinutesPerWeek = function(t) {
var n = t.valueOf();
if (e._weekCache.has(n))
return e._weekCache.get(n);
for (var i = e._calendar, r = e._calendar.$gantt, a = 0, o = r.date.week_start(new Date(t)), s = 0; s < 7; s++)
a += 60 * i.getHoursPerDay(o),
o = r.date.add(o, 1, "day");
return e._weekCache.set(n, a),
a
}
,
this.getMinutesPerMonth = function(t) {
var n = t.valueOf();
if (e._monthCache.has(n))
return e._monthCache.get(n);
for (var i = e._calendar, r = e._calendar.$gantt, a = 0, o = r.date.week_start(new Date(t)), s = r.date.add(o, 1, "month").valueOf(); o.valueOf() < s; )
a += 60 * i.getHoursPerDay(o),
o = r.date.add(o, 1, "day");
return e._monthCache.set(n, a),
a
}
,
this.clear = function() {
e._weekCache = new Map,
e._monthCache = new Map
}
,
this.clear(),
this._calendar = t
}
}();
e.LargerUnitsCache = i
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = function() {
function t() {
this.clear()
}
return t.prototype.getItem = function(t, e, n) {
var i = this._cache;
if (i && i[t]) {
var r = i[t];
if (void 0 === r)
return -1;
var a = r[n.getFullYear()];
if (a && void 0 !== a[e])
return a[e]
}
return -1
}
,
t.prototype.setItem = function(t, e, n, i) {
if (t && e) {
var r = this._cache;
if (r) {
r[t] || (r[t] = []);
var a = r[t]
, o = i.getFullYear()
, s = a[o];
s || (s = a[o] = {}),
s[e] = n
}
}
}
,
t.prototype.clear = function() {
this._cache = {}
}
,
t
}();
e.WorkUnitsObjectCache = i
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = function() {
function t() {
this.clear()
}
return t.prototype.getItem = function(t, e, n) {
if (this._cache.has(t)) {
var i = this._cache.get(t)[n.getFullYear()];
if (i && i.has(e))
return i.get(e)
}
return -1
}
,
t.prototype.setItem = function(t, e, n, i) {
if (t && e) {
var r, a = this._cache, o = i.getFullYear();
a.has(t) ? r = a.get(t) : (r = [],
a.set(t, r));
var s = r[o];
s || (s = r[o] = new Map),
s.set(e, n)
}
}
,
t.prototype.clear = function() {
this._cache = new Map
}
,
t
}();
e.WorkUnitsMapCache = i
}
, function(t, e, n) {
function i(t) {
"@babel/helpers - typeof";
return (i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
var r = n(41).createCacheObject
, a = n(41).LargerUnitsCache
, o = n(0)
, s = n(193).DateDurationCache;
function l(t, e) {
this.argumentsHelper = e,
this.$gantt = t,
this._workingUnitsCache = r(),
this._largeUnitsCache = new a(this),
this._dateDurationCache = new s,
this._worktime = null,
this._cached_timestamps = {},
this._cached_timestamps_count = 0
}
l.prototype = {
units: ["year", "month", "week", "day", "hour", "minute"],
_clearCaches: function() {
this._workingUnitsCache.clear(),
this._largeUnitsCache.clear(),
this._dateDurationCache.clear()
},
_getUnitOrder: function(t) {
for (var e = 0, n = this.units.length; e < n; e++)
if (this.units[e] == t)
return e
},
_resetTimestampCache: function() {
this._cached_timestamps = {},
this._cached_timestamps_count = 0
},
_timestamp: function(t) {
this._cached_timestamps_count > 1e6 && this._resetTimestampCache();
var e = null;
if (t.day || 0 === t.day)
e = t.day;
else if (t.date) {
var n = String(t.date.valueOf());
this._cached_timestamps[n] ? e = this._cached_timestamps[n] : (e = Date.UTC(t.date.getFullYear(), t.date.getMonth(), t.date.getDate()),
this._cached_timestamps[n] = e,
this._cached_timestamps_count++)
}
return e
},
_checkIfWorkingUnit: function(t, e) {
if (!this["_is_work_" + e]) {
var n = this.$gantt.date["".concat(e, "_start")](new Date(t))
, i = this.$gantt.date.add(n, 1, e);
return this.hasDuration(n, i)
}
return this["_is_work_" + e](t)
},
_is_work_day: function(t) {
var e = this._getWorkHours(t);
return !!Array.isArray(e) && e.length > 0
},
_is_work_hour: function(t) {
for (var e = this._getWorkHours(t), n = t.getHours(), i = 0; i < e.length; i++)
if (n >= e[i].startHour && n < e[i].endHour)
return !0;
return !1
},
_getTimeOfDayStamp: function(t, e) {
var n = t.getHours();
return t.getHours() || t.getMinutes() || !e || (n = 24),
60 * n * 60 + 60 * t.getMinutes()
},
_is_work_minute: function(t) {
for (var e = this._getWorkHours(t), n = this._getTimeOfDayStamp(t), i = 0; i < e.length; i++)
if (n >= e[i].start && n < e[i].end)
return !0;
return !1
},
_nextDate: function(t, e, n) {
return this.$gantt.date.add(t, n, e)
},
_getWorkUnitsBetweenGeneric: function(t, e, n, i) {
var r = this.$gantt.date
, a = new Date(t)
, o = new Date(e);
i = i || 1;
var s, l, c = 0, u = null, d = !1;
(s = r[n + "_start"](new Date(a))).valueOf() != a.valueOf() && (d = !0);
var h = !1;
(l = r[n + "_start"](new Date(e))).valueOf() != e.valueOf() && (h = !0);
for (var f = !1; a.valueOf() < o.valueOf(); ) {
if (f = (u = this._nextDate(a, n, i)).valueOf() > o.valueOf(),
this._isWorkTime(a, n))
(d || h && f) && (s = r[n + "_start"](new Date(a)),
l = r.add(s, i, n)),
d ? (d = !1,
u = this._nextDate(s, n, i),
c += (l.valueOf() - a.valueOf()) / (l.valueOf() - s.valueOf())) : h && f ? (h = !1,
c += (o.valueOf() - a.valueOf()) / (l.valueOf() - s.valueOf())) : c++;
else {
var _ = this._getUnitOrder(n)
, g = this.units[_ - 1];
g && !this._isWorkTime(a, g) && (u = this._getClosestWorkTimeFuture(a, g))
}
a = u
}
return c
},
_getMinutesPerHour: function(t) {
var e = this._getTimeOfDayStamp(t)
, n = this._getTimeOfDayStamp(this._nextDate(t, "hour", 1));
0 === n && (n = 86400);
for (var i = this._getWorkHours(t), r = 0; r < i.length; r++) {
var a = i[r];
if (e >= a.start && n <= a.end)
return 60;
if (e < a.end && n > a.start)
return (Math.min(n, a.end) - Math.max(e, a.start)) / 60
}
return 0
},
_getMinutesPerDay: function(t) {
var e = 0;
return this._getWorkHours(t).forEach(function(t) {
e += t.durationMinutes
}),
e
},
getHoursPerDay: function(t) {
var e = 0;
return this._getWorkHours(t).forEach(function(t) {
e += t.durationHours
}),
e
},
_getWorkUnitsForRange: function(t, e, n, i) {
var r, a = 0, s = new Date(t), l = new Date(e);
for (r = "minute" == n ? o.bind(this._getMinutesPerDay, this) : o.bind(this.getHoursPerDay, this); s.valueOf() < l.valueOf(); )
if (l - s > 27648e5 && 0 === s.getDate()) {
var c = this._largeUnitsCache.getMinutesPerMonth(s);
"hour" == n && (c /= 60),
a += c,
s = this.$gantt.date.add(s, 1, "month")
} else {
if (l - s > 13824e5) {
var u = this.$gantt.date.week_start(new Date(s));
if (s.valueOf() === u.valueOf()) {
c = this._largeUnitsCache.getMinutesPerWeek(s);
"hour" == n && (c /= 60),
a += c,
s = this.$gantt.date.add(s, 7, "day");
continue
}
}
a += r(s),
s = this._nextDate(s, "day", 1)
}
return a / i
},
_getMinutesBetweenSingleDay: function(t, e) {
for (var n = this._getIntervalTimestamp(t, e), i = this._getWorkHours(t), r = 0, a = 0; a < i.length; a++) {
var o = i[a];
if (n.end >= o.start && n.start <= o.end) {
var s = Math.max(o.start, n.start)
, l = Math.min(o.end, n.end);
r += (l - s) / 60,
n.start = l
}
}
return Math.floor(r)
},
_getMinutesBetween: function(t, e, n, i) {
var r = new Date(t)
, a = new Date(e);
i = i || 1;
var o = new Date(r)
, s = this.$gantt.date.add(this.$gantt.date.day_start(new Date(r)), 1, "day");
if (a.valueOf() <= s.valueOf())
return this._getMinutesBetweenSingleDay(t, e);
var l = this.$gantt.date.day_start(new Date(a))
, c = a
, u = this._getMinutesBetweenSingleDay(o, s)
, d = this._getMinutesBetweenSingleDay(l, c);
return u + this._getWorkUnitsForRange(s, l, n, i) + d
},
_getHoursBetween: function(t, e, n, i) {
var r = new Date(t)
, a = new Date(e);
i = i || 1;
var o = new Date(r)
, s = this.$gantt.date.add(this.$gantt.date.day_start(new Date(r)), 1, "day");
if (a.valueOf() <= s.valueOf())
return Math.round(this._getMinutesBetweenSingleDay(t, e) / 60);
var l = this.$gantt.date.day_start(new Date(a))
, c = a
, u = this._getMinutesBetweenSingleDay(o, s, n, i) / 60
, d = this._getMinutesBetweenSingleDay(l, c, n, i) / 60
, h = u + this._getWorkUnitsForRange(s, l, n, i) + d;
return Math.round(h)
},
getConfig: function() {
return this._worktime
},
_setConfig: function(t) {
this._worktime = t,
this._parseSettings(),
this._clearCaches()
},
_parseSettings: function() {
var t = this.getConfig();
for (var e in t.parsed = {
dates: {},
hours: null,
haveCustomWeeks: !1,
customWeeks: {},
customWeeksRangeStart: null,
customWeeksRangeEnd: null,
customWeeksBoundaries: []
},
t.parsed.hours = this._parseHours(t.hours),
t.dates)
t.parsed.dates[e] = this._parseHours(t.dates[e]);
if (t.customWeeks) {
var n = null
, i = null;
for (var e in t.customWeeks) {
var r = t.customWeeks[e];
if (r.from && r.to) {
var a = r.from
, o = r.to;
(!n || n > a.valueOf()) && (n = a.valueOf()),
(!i || i < o.valueOf()) && (i = o.valueOf()),
t.parsed.customWeeksBoundaries.push({
from: a.valueOf(),
fromReadable: new Date(a),
to: o.valueOf(),
toReadable: new Date(o),
name: e
}),
t.parsed.haveCustomWeeks = !0;
var s = t.parsed.customWeeks[e] = {
from: r.from,
to: r.to,
hours: this._parseHours(r.hours),
dates: {}
};
for (var l in r.dates)
s.dates[l] = this._parseHours(r.dates[l])
}
}
t.parsed.customWeeksRangeStart = n,
t.parsed.customWeeksRangeEnd = i
}
},
_tryChangeCalendarSettings: function(t) {
var e = JSON.stringify(this.getConfig());
return t(),
!!this.hasWorkTime() || (this._setConfig(JSON.parse(e)),
this._clearCaches(),
!1)
},
_arraysEqual: function(t, e) {
if (t === e)
return !0;
if (!t || !e)
return !1;
if (t.length != e.length)
return !1;
for (var n = 0; n < t.length; ++n)
if (t[n] !== e[n])
return !1;
return !0
},
_compareSettings: function(t, e) {
if (!this._arraysEqual(t.hours, e.hours))
return !1;
var n = Object.keys(t.dates)
, i = Object.keys(e.dates);
if (n.sort(),
i.sort(),
!this._arraysEqual(n, i))
return !1;
for (var r = 0; r < n.length; r++) {
var a = n[r]
, o = t.dates[a]
, s = t.dates[a];
if (o !== s && !(Array.isArray(o) && Array.isArray(s) && this._arraysEqual(o, s)))
return !1
}
return !0
},
equals: function(t) {
if (!(t instanceof l))
return !1;
var e = this.getConfig()
, n = t.getConfig();
if (!this._compareSettings(e, n))
return !1;
if (e.parsed.haveCustomWeeks && n.parsed.haveCustomWeeks) {
if (e.parsed.customWeeksBoundaries.length != n.parsed.customWeeksBoundaries.length)
return !1;
for (var i in e.parsed.customWeeks) {
var r = e.parsed.customWeeks[i]
, a = n.parsed.customWeeks[i];
if (!a)
return !1;
if (!this._compareSettings(r, a))
return !1
}
} else if (e.parse.haveCustomWeeks !== n.parsed.haveCustomWeeks)
return !1;
return !0
},
getWorkHours: function() {
var t = this.argumentsHelper.getWorkHoursArguments.apply(this.argumentsHelper, arguments);
return this._getWorkHours(t.date, !1)
},
_getWorkHours: function(t, e) {
var n = this.getConfig();
if (!1 !== e && (n = n.parsed),
!t)
return n.hours;
var i = this._timestamp({
date: t
});
if (n.haveCustomWeeks && n.customWeeksRangeStart <= i && n.customWeeksRangeEnd > i)
for (var r = 0; r < n.customWeeksBoundaries.length; r++)
if (n.customWeeksBoundaries[r].from <= i && n.customWeeksBoundaries[r].to > i) {
n = n.customWeeks[n.customWeeksBoundaries[r].name];
break
}
var a = !0;
return void 0 !== n.dates[i] ? a = n.dates[i] : void 0 !== n.dates[t.getDay()] && (a = n.dates[t.getDay()]),
!0 === a ? n.hours : a || []
},
_getIntervalTimestamp: function(t, e) {
var n = {
start: 0,
end: 0
};
n.start = 60 * t.getHours() * 60 + 60 * t.getMinutes() + t.getSeconds();
var i = e.getHours();
return !i && !e.getMinutes() && !e.getSeconds() && t.valueOf() < e.valueOf() && (i = 24),
n.end = 60 * i * 60 + 60 * e.getMinutes() + e.getSeconds(),
n
},
_parseHours: function(t) {
if (Array.isArray(t)) {
var e = [];
t.forEach(function(t) {
"number" == typeof t ? e.push(60 * t * 60) : "string" == typeof t && t.split("-").map(function(t) {
return t.trim()
}).forEach(function(t) {
var n = t.split(":").map(function(t) {
return t.trim()
})
, i = parseInt(60 * n[0] * 60);
n[1] && (i += parseInt(60 * n[1])),
n[2] && (i += parseInt(n[2])),
e.push(i)
})
});
for (var n = [], i = 0; i < e.length; i += 2) {
var r = e[i]
, a = e[i + 1]
, o = a - r;
n.push({
start: r,
end: a,
startHour: Math.floor(r / 3600),
startMinute: Math.floor(r / 60),
endHour: Math.ceil(a / 3600),
endMinute: Math.ceil(a / 60),
durationSeconds: o,
durationMinutes: o / 60,
durationHours: o / 3600
})
}
return n
}
return t
},
setWorkTime: function(t) {
return this._tryChangeCalendarSettings(o.bind(function() {
var e = void 0 === t.hours || t.hours
, n = this._timestamp(t)
, r = this.getConfig();
if (null !== n ? r.dates[n] = e : t.customWeeks || (r.hours = e),
t.customWeeks)
if (r.customWeeks || (r.customWeeks = {}),
"string" == typeof t.customWeeks)
null !== n ? r.customWeeks[t.customWeeks].dates[n] = e : t.customWeeks || (r.customWeeks[t.customWeeks].hours = e);
else if ("object" === i(t.customWeeks) && "function Object() { [native code] }" === Function.prototype.toString.call(t.customWeeks.constructor))
for (var a in t.customWeeks)
r.customWeeks[a] = t.customWeeks[a];
this._parseSettings(),
this._clearCaches()
}, this))
},
unsetWorkTime: function(t) {
return this._tryChangeCalendarSettings(o.bind(function() {
if (t) {
var e = this._timestamp(t);
null !== e && delete this.getConfig().dates[e]
} else
this.reset_calendar();
this._parseSettings(),
this._clearCaches()
}, this))
},
_isWorkTime: function(t, e) {
var n = -1
, i = null;
return i = String(t.valueOf()),
-1 == (n = this._workingUnitsCache.getItem(e, i, t)) && (n = this._checkIfWorkingUnit(t, e),
this._workingUnitsCache.setItem(e, i, n, t)),
n
},
isWorkTime: function() {
var t = this.argumentsHelper.isWorkTimeArguments.apply(this.argumentsHelper, arguments);
return this._isWorkTime(t.date, t.unit)
},
calculateDuration: function() {
var t = this.argumentsHelper.getDurationArguments.apply(this.argumentsHelper, arguments);
if (!t.unit)
return !1;
var e = this;
return this._dateDurationCache.getDuration(t.start_date, t.end_date, t.unit, t.step, function() {
return e._calculateDuration(t.start_date, t.end_date, t.unit, t.step)
})
},
_calculateDuration: function(t, e, n, i) {
var r = 0
, a = 1;
if (t.valueOf() > e.valueOf()) {
var o = e;
e = t,
t = o,
a = -1
}
return r = "hour" == n && 1 == i ? this._getHoursBetween(t, e, n, i) : "minute" == n && 1 == i ? this._getMinutesBetween(t, e, n, i) : this._getWorkUnitsBetweenGeneric(t, e, n, i),
a * Math.round(r)
},
hasDuration: function() {
var t = this.argumentsHelper.getDurationArguments.apply(this.argumentsHelper, arguments)
, e = t.start_date
, n = t.end_date
, i = t.unit
, r = t.step;
if (!i)
return !1;
var a = new Date(e)
, o = new Date(n);
for (r = r || 1; a.valueOf() < o.valueOf(); ) {
if (this._isWorkTime(a, i))
return !0;
a = this._nextDate(a, i, r)
}
return !1
},
calculateEndDate: function() {
var t = this.argumentsHelper.calculateEndDateArguments.apply(this.argumentsHelper, arguments)
, e = t.start_date
, n = t.duration
, i = t.unit
, r = t.step;
if (!i)
return !1;
var a = t.duration >= 0 ? 1 : -1;
n = Math.abs(1 * n);
var o = this;
return this._dateDurationCache.getEndDate(e, n, i, r * a, function() {
return o._calculateEndDate(e, n, i, r * a)
})
},
_calculateEndDate: function(t, e, n, i) {
return !!n && (1 == i && "minute" == n ? this._calculateMinuteEndDate(t, e, i) : -1 == i && "minute" == n ? this._subtractMinuteDate(t, e, i) : 1 == i && "hour" == n ? this._calculateHourEndDate(t, e, i) : this._addInterval(t, e, n, i, null).end)
},
_addInterval: function(t, e, n, i, r) {
for (var a = 0, o = t, s = !1; a < e && (!r || !r(o)); ) {
var l = this._nextDate(o, n, i);
"day" == n && (s = s || !o.getHours() && l.getHours()) && (l.setHours(0),
l.getHours() || (s = !1));
var c = new Date(l.valueOf() + 1);
i > 0 && (c = new Date(l.valueOf() - 1)),
this._isWorkTime(c, n) && !s && a++,
o = l
}
return {
end: o,
start: t,
added: a
}
},
_addHoursUntilDayEnd: function(t, e) {
for (var n = this.$gantt.date.add(this.$gantt.date.day_start(new Date(t)), 1, "day"), i = 0, r = e, a = this._getIntervalTimestamp(t, n), o = this._getWorkHours(t), s = 0; s < o.length && i < e; s++) {
var l = o[s];
if (a.end >= l.start && a.start <= l.end) {
var c = Math.max(l.start, a.start)
, u = Math.min(l.end, a.end)
, d = (u - c) / 3600;
d > r && (d = r,
u = c + 60 * r * 60);
var h = Math.round((u - c) / 3600);
i += h,
r -= h,
a.start = u
}
}
var f = n;
return i === e && (f = new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,a.start)),
{
added: i,
end: f
}
},
_calculateHourEndDate: function(t, e, n) {
var i = new Date(t)
, r = 0;
n = n || 1,
e = Math.abs(1 * e);
var a = this._addHoursUntilDayEnd(i, e);
if (r = a.added,
i = a.end,
c = e - r) {
for (var o = i; r < e; ) {
var s = this._nextDate(o, "day", n);
s.setHours(0),
s.setMinutes(0),
s.setSeconds(0);
var l = 0;
if (r + (l = n > 0 ? this.getHoursPerDay(new Date(s.valueOf() - 1)) : this.getHoursPerDay(new Date(s.valueOf() + 1))) >= e)
break;
r += l,
o = s
}
i = o
}
if (r < e) {
var c = e - r;
i = (a = this._addHoursUntilDayEnd(i, c)).end
}
return i
},
_addMinutesUntilHourEnd: function(t, e) {
if (0 === t.getMinutes())
return {
added: 0,
end: new Date(t)
};
for (var n = this.$gantt.date.add(this.$gantt.date.hour_start(new Date(t)), 1, "hour"), i = 0, r = e, a = this._getIntervalTimestamp(t, n), o = this._getWorkHours(t), s = 0; s < o.length && i < e; s++) {
var l = o[s];
if (a.end >= l.start && a.start <= l.end) {
var c = Math.max(l.start, a.start)
, u = Math.min(l.end, a.end)
, d = (u - c) / 60;
d > r && (d = r,
u = c + 60 * r);
var h = Math.round((u - c) / 60);
r -= h,
i += h,
a.start = u
}
}
var f = n;
return i === e && (f = new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,a.start)),
{
added: i,
end: f
}
},
_subtractMinutesUntilHourStart: function(t, e) {
for (var n = this.$gantt.date.hour_start(new Date(t)), i = 0, r = e, a = 60 * n.getHours() * 60 + 60 * n.getMinutes() + n.getSeconds(), o = 60 * t.getHours() * 60 + 60 * t.getMinutes() + t.getSeconds(), s = this._getWorkHours(t), l = s.length - 1; l >= 0 && i < e; l--) {
var c = s[l];
if (o > c.start && a <= c.end) {
var u = Math.min(o, c.end)
, d = Math.max(a, c.start)
, h = (u - d) / 60;
h > r && (h = r,
d = u - 60 * r);
var f = Math.abs(Math.round((u - d) / 60));
r -= f,
i += f,
o = d
}
}
var _ = n;
return i === e && (_ = new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,o)),
{
added: i,
end: _
}
},
_subtractMinuteDate: function(t, e, n) {
var i = new Date(t)
, r = 0;
n = n || -1,
e = Math.abs(1 * e),
e = Math.round(e);
var a = this._isMinutePrecision(i)
, o = this._subtractMinutesUntilHourStart(i, e);
r += o.added,
i = o.end;
for (var s = 0, l = [], c = 0; r < e; ) {
var u = this.$gantt.date.day_start(new Date(i))
, d = !1;
i.valueOf() === u.valueOf() && (u = this.$gantt.date.add(u, -1, "day"),
d = !0);
var h = new Date(u.getFullYear(),u.getMonth(),u.getDate(),23,59,59,999).valueOf();
h !== s && (l = this._getWorkHours(u),
c = this._getMinutesPerDay(u),
s = h);
var f = e - r
, _ = this._getTimeOfDayStamp(i, d);
if (l.length && c)
if (l[l.length - 1].end <= _ && f > c)
r += c,
i = this.$gantt.date.add(i, -1, "day");
else {
for (var g = !1, p = null, v = null, m = l.length - 1; m >= 0; m--)
if (l[m].start < _ - 1 && l[m].end >= _ - 1) {
g = !0,
p = l[m],
v = l[m - 1];
break
}
if (g)
if (_ === p.end && f >= p.durationMinutes)
r += p.durationMinutes,
i = this.$gantt.date.add(i, -p.durationMinutes, "minute");
else if (!a && f <= _ / 60 - p.startMinute)
r += f,
i = this.$gantt.date.add(i, -f, "minute");
else if (a)
f <= _ / 60 - p.startMinute ? (r += f,
i = this.$gantt.date.add(i, -f, "minute")) : (r += _ / 60 - p.startMinute,
i = v ? new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,v.end) : this.$gantt.date.day_start(i));
else {
var y = this._getMinutesPerHour(i);
y <= f ? (r += y,
i = this._nextDate(i, "hour", n)) : (r += (o = this._subtractMinutesUntilHourStart(i, f)).added,
i = o.end)
}
else if (0 === i.getHours() && 0 === i.getMinutes() && 0 === i.getSeconds()) {
if ((k = this._getClosestWorkTimePast(i, "hour")).valueOf() === i.valueOf()) {
var k = this.$gantt.date.add(i, -1, "day")
, b = this._getWorkHours(k);
if (b.length) {
var x = b[b.length - 1];
k.setSeconds(x.durationSeconds)
}
}
i = k
} else
i = this._getClosestWorkTimePast(new Date(i - 1), "hour")
}
else
i = this.$gantt.date.add(i, -1, "day")
}
if (r < e) {
var w = e - r;
r += (o = this._subtractMinutesUntilHourStart(i, w)).added,
i = o.end
}
return i
},
_calculateMinuteEndDate: function(t, e, n) {
var i = new Date(t)
, r = 0;
n = n || 1,
e = Math.abs(1 * e),
e = Math.round(e);
var a = this._addMinutesUntilHourEnd(i, e);
r += a.added,
i = a.end;
for (var o = 0, s = [], l = 0, c = this._isMinutePrecision(i); r < e; ) {
var u = this.$gantt.date.day_start(new Date(i)).valueOf();
u !== o && (s = this._getWorkHours(i),
l = this._getMinutesPerDay(i),
o = u);
var d = e - r
, h = this._getTimeOfDayStamp(i);
if (s.length && l)
if (s[0].start >= h && d >= l) {
if (r += l,
d == l) {
i = new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,s[s.length - 1].end);
break
}
i = this.$gantt.date.add(i, 1, "day"),
i = this.$gantt.date.day_start(i)
} else {
for (var f = !1, _ = null, g = 0; g < s.length; g++)
if (s[g].start <= h && s[g].end > h) {
f = !0,
_ = s[g];
break
}
if (f)
if (h === _.start && d >= _.durationMinutes)
r += _.durationMinutes,
i = this.$gantt.date.add(i, _.durationMinutes, "minute");
else if (d <= _.endMinute - h / 60)
r += d,
i = this.$gantt.date.add(i, d, "minute");
else {
var p = this._getMinutesPerHour(i);
p <= d ? (r += p,
i = c ? this.$gantt.date.add(i, p, "minute") : this._nextDate(i, "hour", n)) : (r += (a = this._addMinutesUntilHourEnd(i, d)).added,
i = a.end)
}
else
i = this._getClosestWorkTimeFuture(i, "hour")
}
else
i = this.$gantt.date.add(this.$gantt.date.day_start(i), 1, "day")
}
if (r < e) {
var v = e - r;
r += (a = this._addMinutesUntilHourEnd(i, v)).added,
i = a.end
}
return i
},
getClosestWorkTime: function() {
var t = this.argumentsHelper.getClosestWorkTimeArguments.apply(this.argumentsHelper, arguments);
return this._getClosestWorkTime(t.date, t.unit, t.dir)
},
_getClosestWorkTime: function(t, e, n) {
var i = new Date(t);
if (this._isWorkTime(i, e))
return i;
if (i = this.$gantt.date[e + "_start"](i),
"any" != n && n)
i = "past" == n ? this._getClosestWorkTimePast(i, e) : this._getClosestWorkTimeFuture(i, e);
else {
var r = this._getClosestWorkTimeFuture(i, e)
, a = this._getClosestWorkTimePast(i, e);
i = Math.abs(r - t) <= Math.abs(t - a) ? r : a
}
return i
},
_getClosestWorkTimeFuture: function(t, e) {
return this._getClosestWorkTimeGeneric(t, e, 1)
},
_getClosestWorkTimePast: function(t, e) {
var n = this._getClosestWorkTimeGeneric(t, e, -1);
return this.$gantt.date.add(n, 1, e)
},
_findClosestTimeInDay: function(t, e, n) {
var i = new Date(t)
, r = null
, a = !1;
this._getWorkHours(i).length || (i = this._getClosestWorkTime(i, "day", e < 0 ? "past" : "future"),
e < 0 && (i = new Date(i.valueOf() - 1),
a = !0),
n = this._getWorkHours(i));
var o = this._getTimeOfDayStamp(i);
if (a && (o = this._getTimeOfDayStamp(new Date(i.valueOf() + 1), a)),
e > 0) {
for (var s = 0; s < n.length; s++)
if (n[s].start >= o) {
r = new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,n[s].start);
break
}
} else
for (s = n.length - 1; s >= 0; s--) {
if (n[s].end <= o) {
r = new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,n[s].end);
break
}
if (n[s].end > o && n[s].start <= o) {
r = new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,o);
break
}
}
return r
},
_getClosestWorkMinute: function(t, e, n) {
var i = new Date(t)
, r = this._getWorkHours(i)
, a = this._findClosestTimeInDay(i, n, r);
return a || (i = this.calculateEndDate(i, n, "day"),
n > 0 ? i = this.$gantt.date.day_start(i) : (i = this.$gantt.date.day_start(i),
i = this.$gantt.date.add(i, 1, "day"),
i = new Date(i.valueOf() - 1)),
r = this._getWorkHours(i),
a = this._findClosestTimeInDay(i, n, r)),
n < 0 && (a = this.$gantt.date.add(a, -1, e)),
a
},
_getClosestWorkTimeGeneric: function(t, e, n) {
if ("hour" === e || "minute" === e)
return this._getClosestWorkMinute(t, e, n);
for (var i = this._getUnitOrder(e), r = this.units[i - 1], a = t, o = 0; !this._isWorkTime(a, e) && (!r || this._isWorkTime(a, r) || (a = n > 0 ? this._getClosestWorkTimeFuture(a, r) : this._getClosestWorkTimePast(a, r),
!this._isWorkTime(a, e))); ) {
if (++o > 3e3)
return this.$gantt.assert(!1, "Invalid working time check"),
!1;
var s = a.getTimezoneOffset();
a = this.$gantt.date.add(a, n, e),
a = this.$gantt._correct_dst_change(a, s, n, e),
this.$gantt.date[e + "_start"] && (a = this.$gantt.date[e + "_start"](a))
}
return a
},
hasWorkTime: function() {
var t = this.getConfig()
, e = t.dates
, n = [];
for (var i in t.dates)
Number(i) > 6 && n.push(Number(i));
var r = this._checkWorkHours(t.hours)
, a = !1;
return [0, 1, 2, 3, 4, 5, 6].forEach(function(t) {
if (!a) {
var n = e[t];
!0 === n ? a = r : Array.isArray(n) && (a = this._checkWorkHours(n))
}
}
.bind(this)),
a
},
_checkWorkHours: function(t) {
if (0 === t.length)
return !1;
for (var e = !1, n = 0; n < t.length; n += 2)
t[n] !== t[n + 1] && (e = !0);
return e
},
_isMinutePrecision: function(t) {
var e = !1;
return this._getWorkHours(t).forEach(function(t) {
(t.startMinute % 60 || t.endMinute % 60) && (e = !0)
}),
e
}
},
t.exports = l
}
, function(t, e, n) {
var i = n(0);
function r() {}
r.prototype = {
_getIntervals: function(t) {
for (var e = [], n = 0; n < t.length; n += 2)
e.push({
start: t[n],
end: t[n + 1]
});
return e
},
_toHoursArray: function(t) {
var e = [];
function n(t) {
var e = Math.floor(t / 3600)
, n = t - 60 * e * 60;
return e + ":" + function(t) {
var e = String(t);
return e.length < 2 && (e = "0" + e),
e
}(Math.floor(n / 60))
}
for (var i = 0; i < t.length; i++)
e.push(n(t[i].start) + "-" + n(t[i].end));
return e
},
_intersectHourRanges: function(t, e) {
var n = []
, i = t.length > e.length ? t : e
, r = t === i ? e : t;
i = i.slice(),
r = r.slice();
n = [];
for (var a = 0; a < i.length; a++)
for (var o = i[a], s = 0; s < r.length; s++) {
var l = r[s];
l.start < o.end && l.end > o.start && (n.push({
start: Math.max(o.start, l.start),
end: Math.min(o.end, l.end)
}),
o.end > l.end && (r.splice(s, 1),
s--,
a--))
}
return n
},
_mergeAdjacentIntervals: function(t) {
var e = t.slice();
e.sort(function(t, e) {
return t.start - e.start
});
for (var n = e[0], i = 1; i < e.length; i++) {
var r = e[i];
r.start <= n.end ? (r.end > n.end && (n.end = r.end),
e.splice(i, 1),
i--) : n = r
}
return e
},
_mergeHoursConfig: function(t, e) {
return this._mergeAdjacentIntervals(this._intersectHourRanges(t, e))
},
merge: function(t, e) {
var n = i.copy(t.getConfig().parsed)
, r = i.copy(e.getConfig().parsed)
, a = {
hours: this._toHoursArray(this._mergeHoursConfig(n.hours, r.hours)),
dates: {},
customWeeks: {}
};
for (var o in n.dates) {
var s = n.dates[o]
, l = r.dates[o];
if (s && l)
if (Array.isArray(s) || Array.isArray(l)) {
var c = Array.isArray(s) ? s : n.hours
, u = Array.isArray(l) ? l : r.hours;
a.dates[o] = this._toHoursArray(this._mergeHoursConfig(c, u))
} else
a.dates[o] = !0;
else
a.dates[o] = !1
}
if (n.customWeeks)
for (var o in n.customWeeks)
a.customWeeks[o] = n.customWeeks[o];
if (r.customWeeks)
for (var o in r.customWeeks)
a.customWeeks[o] = r.customWeeks[o];
return a
}
},
t.exports = r
}
, function(t, e, n) {
var i = n(0)
, r = n(42)
, a = n(198)
, o = n(197)
, s = n(192)
, l = n(191)();
function c(t) {
this.$gantt = t,
this._calendars = {},
this._legacyConfig = void 0,
this.$gantt.attachEvent("onGanttReady", function() {
this.$gantt.config.resource_calendars && (this._isLegacyConfig = s.isLegacyResourceCalendarFormat(this.$gantt.config.resource_calendars))
}
.bind(this)),
this.$gantt.attachEvent("onBeforeGanttReady", function() {
this.createDefaultCalendars()
}
.bind(this)),
this.$gantt.attachEvent("onBeforeGanttRender", function() {
this.createDefaultCalendars()
}
.bind(this))
}
c.prototype = {
_calendars: {},
_convertWorkTimeSettings: function(t) {
var e = t.days;
if (e && !t.dates) {
t.dates = t.dates || {};
for (var n = 0; n < e.length; n++)
t.dates[n] = e[n],
e[n]instanceof Array || (t.dates[n] = !!e[n])
}
return delete t.days,
t
},
mergeCalendars: function() {
var t = []
, e = arguments;
if (Array.isArray(e[0]))
t = e[0].slice();
else
for (var n = 0; n < arguments.length; n++)
t.push(arguments[n]);
var i, r = new a;
return t.forEach(function(t) {
i = i ? this._createCalendarFromConfig(r.merge(i, t)) : t
}
.bind(this)),
this.createCalendar(i)
},
_createCalendarFromConfig: function(t) {
var e = new o(this.$gantt,r(this.$gantt));
e.id = String(i.uid());
var n = this._convertWorkTimeSettings(t);
if (n.customWeeks)
for (var a in n.customWeeks)
n.customWeeks[a] = this._convertWorkTimeSettings(n.customWeeks[a]);
return e._setConfig(n),
e
},
createCalendar: function(t) {
var e;
t || (t = {}),
e = t.getConfig ? i.copy(t.getConfig()) : t.worktime ? i.copy(t.worktime) : i.copy(t);
var n = i.copy(this.defaults.fulltime.worktime);
return i.mixin(e, n),
this._createCalendarFromConfig(e)
},
getCalendar: function(t) {
t = t || "global";
var e = this._calendars[t];
return e || (this.createDefaultCalendars(),
e = this._calendars[t]),
e
},
getCalendars: function() {
var t = [];
for (var e in this._calendars)
t.push(this.getCalendar(e));
return t
},
_getOwnCalendar: function(t) {
var e = this.$gantt.config;
if (t[e.calendar_property])
return this.getCalendar(t[e.calendar_property]);
if (e.resource_calendars) {
var n;
if (n = !1 === this._legacyConfig ? e.resource_property : s.getResourceProperty(e),
Array.isArray(t[n]))
e.dynamic_resource_calendars && (i = l.getCalendarIdFromMultipleResources(t[n], this));
else if (void 0 === this._legacyConfig && (this._legacyConfig = s.isLegacyResourceCalendarFormat(e.resource_calendars)),
this._legacyConfig)
var i = s.getCalendarIdFromLegacyConfig(t, e.resource_calendars);
else if (n && t[n] && e.resource_calendars[t[n]])
var r = this.getResourceCalendar(t[n]);
if (i && (r = this.getCalendar(i)),
r)
return r
}
return null
},
getResourceCalendar: function(t) {
if (null === t || void 0 === t)
return this.getCalendar();
var e = null;
e = "number" == typeof t || "string" == typeof t ? t : t.id || t.key;
var n = this.$gantt.config
, i = n.resource_calendars
, r = null;
if (i) {
if (void 0 === this._legacyConfig && (this._legacyConfig = s.isLegacyResourceCalendarFormat(n.resource_calendars)),
this._legacyConfig) {
for (var a in i)
if (i[a][e]) {
r = i[a][e];
break
}
} else
r = i[e];
if (r)
return this.getCalendar(r)
}
return this.getCalendar()
},
getTaskCalendar: function(t) {
var e, n = this.$gantt;
if (null === t || void 0 === t)
return this.getCalendar();
if (!(e = "number" != typeof t && "string" != typeof t || !n.isTaskExists(t) ? t : n.getTask(t)))
return this.getCalendar();
var i = this._getOwnCalendar(e)
, r = !!n.getState().group_mode;
if (!i && n.config.inherit_calendar && n.isTaskExists(e.parent)) {
for (var a = e; n.isTaskExists(a.parent) && (a = n.getTask(a.parent),
!n.isSummaryTask(a) || !(i = this._getOwnCalendar(a))); )
;
r && !i && t.$effective_calendar && (i = this.getCalendar(t.$effective_calendar))
}
return i || this.getCalendar()
},
addCalendar: function(t) {
if (!this.isCalendar(t)) {
var e = t.id;
(t = this.createCalendar(t)).id = e
}
if (t._tryChangeCalendarSettings(function() {})) {
var n = this.$gantt.config;
return t.id = t.id || i.uid(),
this._calendars[t.id] = t,
n.worktimes || (n.worktimes = {}),
n.worktimes[t.id] = t.getConfig(),
t.id
}
return this.$gantt.callEvent("onCalendarError", [{
message: "Invalid calendar settings, no worktime available"
}, t]),
null
},
deleteCalendar: function(t) {
var e = this.$gantt.config;
return !!t && (!!this._calendars[t] && (delete this._calendars[t],
e.worktimes && e.worktimes[t] && delete e.worktimes[t],
!0))
},
restoreConfigCalendars: function(t) {
for (var e in t)
if (!this._calendars[e]) {
var n = t[e]
, i = this.createCalendar(n);
i.id = e,
this.addCalendar(i)
}
},
defaults: {
global: {
id: "global",
worktime: {
hours: [8, 12, 13, 17],
days: [0, 1, 1, 1, 1, 1, 0]
}
},
fulltime: {
id: "fulltime",
worktime: {
hours: [0, 24],
days: [1, 1, 1, 1, 1, 1, 1]
}
}
},
createDefaultCalendars: function() {
var t = this.$gantt.config;
this.restoreConfigCalendars(this.defaults),
this.restoreConfigCalendars(t.worktimes)
},
isCalendar: function(t) {
return [t.isWorkTime, t.setWorkTime, t.getWorkHours, t.unsetWorkTime, t.getClosestWorkTime, t.calculateDuration, t.hasDuration, t.calculateEndDate].every(function(t) {
return t instanceof Function
})
}
},
t.exports = c
}
, function(t, e, n) {
var i = n(199)
, r = n(190)
, a = n(188)
, o = n(0);
t.exports = function(t) {
var e = new i(t)
, n = new r(e)
, s = a.create(e, n);
o.mixin(t, s)
}
}
, function(t, e, n) {
function i(t) {
"@babel/helpers - typeof";
return (i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
var r = n(2);
t.exports = function(t) {
function e(e) {
throw t.assert(!1, "Can't parse data: incorrect value of gantt.parse or gantt.load method. Actual argument value: " + JSON.stringify(e)),
new Error("Invalid argument for gantt.parse or gantt.load. An object or a JSON string of format https://docs.dhtmlx.com/gantt/desktop__supported_data_formats.html#json is expected. Actual argument value: " + JSON.stringify(e))
}
t.load = function(e, n, i) {
this._load_url = e,
this.assert(arguments.length, "Invalid load arguments");
var r = "json"
, a = null;
return arguments.length >= 3 ? (r = n,
a = i) : "string" == typeof arguments[1] ? r = arguments[1] : "function" == typeof arguments[1] && (a = arguments[1]),
this._load_type = r,
this.callEvent("onLoadStart", [e, r]),
this.ajax.get(e, t.bind(function(t) {
this.on_load(t, r),
this.callEvent("onLoadEnd", [e, r]),
"function" == typeof a && a.call(this)
}, this))
}
,
t.parse = function(t, e) {
this.on_load({
xmlDoc: {
responseText: t
}
}, e)
}
,
t.serialize = function(t) {
return this[t = t || "json"].serialize()
}
,
t.on_load = function(e, n) {
if (e.xmlDoc && 404 === e.xmlDoc.status)
this.assert(!1, "Failed to load the data from " + e.xmlDoc.responseURL + ", server returns 404");
else if (!t.$destroyed) {
this.callEvent("onBeforeParse", []),
n || (n = "json"),
this.assert(this[n], "Invalid data type:'" + n + "'");
var i = e.xmlDoc.responseText
, r = this[n].parse(i, e);
this._process_loading(r)
}
}
,
t._process_loading = function(e) {
e.collections && this._load_collections(e.collections),
e.resources && this.$data.resourcesStore && this.$data.resourcesStore.parse(e.resources);
var n = e.data || e.tasks;
e.assignments && function(e, n) {
var i = {};
n.forEach(function(t) {
i[t.task_id] || (i[t.task_id] = []),
i[t.task_id].push(t)
}),
e.forEach(function(e) {
e[t.config.resource_property] = i[e.id] || []
})
}(n, e.assignments),
this.$data.tasksStore.parse(n);
var i = e.links || (e.collections ? e.collections.links : []);
this.$data.linksStore.parse(i),
this.callEvent("onParse", []),
this.render()
}
,
t._load_collections = function(t) {
var e = !1;
for (var n in t)
if (t.hasOwnProperty(n)) {
e = !0;
var i = t[n];
this.serverList[n] = this.serverList[n] || [];
var r = this.serverList[n];
if (!r)
continue;
r.splice(0, r.length);
for (var a = 0; a < i.length; a++) {
var o = i[a]
, s = this.copy(o);
for (var l in s.key = s.value,
o)
if (o.hasOwnProperty(l)) {
if ("value" == l || "label" == l)
continue;
s[l] = o[l]
}
r.push(s)
}
}
e && this.callEvent("onOptionsLoad", [])
}
,
t.attachEvent("onBeforeTaskDisplay", function(t, e) {
return !e.$ignore
}),
t.json = {
parse: function(n) {
if (n || e(n),
"string" == typeof n)
if (void 0 != ("undefined" == typeof JSON ? "undefined" : i(JSON)))
try {
n = JSON.parse(n)
} catch (t) {
e(n)
}
else
t.assert(!1, "JSON is not supported");
return n.data || n.tasks || e(n),
n.dhx_security && (t.security_key = n.dhx_security),
n
},
serializeTask: function(t) {
return this._copyObject(t)
},
serializeLink: function(t) {
return this._copyLink(t)
},
_copyLink: function(t) {
var e = {};
for (var n in t)
e[n] = t[n];
return e
},
_copyObject: function(e) {
var n = {};
for (var i in e)
"$" != i.charAt(0) && (n[i] = e[i],
r.isDate(n[i]) && (n[i] = t.defined(t.templates.xml_format) ? t.templates.xml_format(n[i]) : t.templates.format_date(n[i])));
return n
},
serialize: function() {
var e = []
, n = [];
t.eachTask(function(n) {
t.resetProjectDates(n),
e.push(this.serializeTask(n))
}, t.config.root_id, this);
for (var i = t.getLinks(), r = 0; r < i.length; r++)
n.push(this.serializeLink(i[r]));
return {
data: e,
links: n
}
}
},
t.xml = {
_xmlNodeToJSON: function(t, e) {
for (var n = {}, i = 0; i < t.attributes.length; i++)
n[t.attributes[i].name] = t.attributes[i].value;
if (!e) {
for (i = 0; i < t.childNodes.length; i++) {
var r = t.childNodes[i];
1 == r.nodeType && (n[r.tagName] = r.firstChild ? r.firstChild.nodeValue : "")
}
n.text || (n.text = t.firstChild ? t.firstChild.nodeValue : "")
}
return n
},
_getCollections: function(e) {
for (var n = {}, i = t.ajax.xpath("//coll_options", e), r = 0; r < i.length; r++)
for (var a = n[i[r].getAttribute("for")] = [], o = t.ajax.xpath(".//item", i[r]), s = 0; s < o.length; s++) {
for (var l = o[s].attributes, c = {
key: o[s].getAttribute("value"),
label: o[s].getAttribute("label")
}, u = 0; u < l.length; u++) {
var d = l[u];
"value" != d.nodeName && "label" != d.nodeName && (c[d.nodeName] = d.nodeValue)
}
a.push(c)
}
return n
},
_getXML: function(e, n, i) {
i = i || "data",
n.getXMLTopNode || (n = t.ajax.parse(n));
var r = t.ajax.xmltop(i, n.xmlDoc);
r && r.tagName == i || function(e) {
throw t.assert(!1, "Can't parse data: incorrect value of gantt.parse or gantt.load method. Actual argument value: " + JSON.stringify(e)),
new Error("Invalid argument for gantt.parse or gantt.load. An XML of format https://docs.dhtmlx.com/gantt/desktop__supported_data_formats.html#xmldhtmlxgantt20 is expected. Actual argument value: " + JSON.stringify(e))
}(e);
var a = r.getAttribute("dhx_security");
return a && (t.security_key = a),
r
},
parse: function(e, n) {
n = this._getXML(e, n);
for (var i = {}, r = i.data = [], a = t.ajax.xpath("//task", n), o = 0; o < a.length; o++)
r[o] = this._xmlNodeToJSON(a[o]);
return i.collections = this._getCollections(n),
i
},
_copyLink: function(t) {
return ""
},
_copyObject: function(t) {
return ""
},
serialize: function() {
for (var e = [], n = [], i = t.json.serialize(), r = 0, a = i.data.length; r < a; r++)
e.push(this._copyObject(i.data[r]));
for (r = 0,
a = i.links.length; r < a; r++)
n.push(this._copyLink(i.links[r]));
return "" + e.join("") + "" + n.join("") + ""
}
},
t.oldxml = {
parse: function(e, n) {
n = t.xml._getXML(e, n, "projects");
for (var i = {
collections: {
links: []
}
}, r = i.data = [], a = t.ajax.xpath("//task", n), o = 0; o < a.length; o++) {
r[o] = t.xml._xmlNodeToJSON(a[o]);
var s = a[o].parentNode;
"project" == s.tagName ? r[o].parent = "project-" + s.getAttribute("id") : r[o].parent = s.parentNode.getAttribute("id")
}
a = t.ajax.xpath("//project", n);
for (o = 0; o < a.length; o++) {
(l = t.xml._xmlNodeToJSON(a[o], !0)).id = "project-" + l.id,
r.push(l)
}
for (o = 0; o < r.length; o++) {
var l;
(l = r[o]).start_date = l.startdate || l.est,
l.end_date = l.enddate,
l.text = l.name,
l.duration = l.duration / 8,
l.open = 1,
l.duration || l.end_date || (l.duration = 1),
l.predecessortasks && i.collections.links.push({
target: l.id,
source: l.predecessortasks,
type: t.config.links.finish_to_start
})
}
return i
},
serialize: function() {
t.message("Serialization to 'old XML' is not implemented")
}
},
t.serverList = function(t, e) {
return e ? this.serverList[t] = e.slice(0) : this.serverList[t] || (this.serverList[t] = []),
this.serverList[t]
}
}
}
, function(t, e) {
t.exports = function(t) {
t.isReadonly = function(e) {
return "number" != typeof e && "string" != typeof e || !t.isTaskExists(e) || (e = t.getTask(e)),
(!e || !e[this.config.editable_property]) && (e && e[this.config.readonly_property] || this.config.readonly)
}
}
}
, function(t, e) {
t.exports = function(t) {
t.getGridColumn = function(e) {
for (var n = t.config.columns, i = 0; i < n.length; i++)
if (n[i].name == e)
return n[i];
return null
}
,
t.getGridColumns = function() {
return t.config.columns.slice()
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = function() {
function t(t) {
this._scrollOrder = 0;
var e = t.gantt
, n = t.grid
, i = t.dnd
, r = t.getCurrentX;
this.$gantt = e,
this.$grid = n,
this._dnd = i,
this.getCurrentX = r,
this._scrollView = this.$gantt.$ui.getView(this.$grid.$config.scrollX),
this.attachEvents()
}
return t.prototype.attachEvents = function() {
var t = this;
this.isScrollable() && (this._dnd.attachEvent("onDragMove", function(e, n) {
var i = t.$grid.$grid.getBoundingClientRect()
, r = i.right
, a = i.left
, o = t.getCurrentX(n.clientX);
return o >= r - 20 && (t.autoscrollRight(),
t.autoscrollStart()),
o <= a + 20 && (t.autoscrollLeft(),
t.autoscrollStart()),
o < r - 20 && o > a + 20 && t.autoscrollStop(),
!0
}),
this._dnd.attachEvent("onDragEnd", function() {
t.autoscrollStop()
}))
}
,
t.prototype.autoscrollStart = function() {
var t = this;
if (0 !== this._scrollOrder) {
var e = 10 * this._scrollOrder
, n = this._scrollView.getScrollState();
this._scrollView.scrollTo(n.position + e),
setTimeout(function() {
t.autoscrollStart()
}, 50)
}
}
,
t.prototype.autoscrollRight = function() {
this._scrollOrder = 1
}
,
t.prototype.autoscrollLeft = function() {
this._scrollOrder = -1
}
,
t.prototype.autoscrollStop = function() {
this._scrollOrder = 0
}
,
t.prototype.getCorrection = function() {
return this.isScrollable() ? this._scrollView.getScrollState().position : 0
}
,
t.prototype.isScrollable = function() {
return !!this.$grid.$config.scrollable
}
,
t
}();
e.default = i
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(1)
, r = n(204)
, a = function() {
function t(t, e) {
var n = this;
this._targetMarker = null,
this.calculateCurrentPosition = function(t) {
var e = n.$grid.$grid.getBoundingClientRect()
, i = e.right
, r = e.left
, a = t;
return a > i && (a = i),
a < r && (a = r),
a
}
,
this.$gantt = t,
this.$grid = e
}
return t.prototype.init = function() {
var t = this.$gantt.$services.getService("dnd");
this._dnd = new t(this.$grid.$grid_scale,{
updates_per_second: 60
}),
this._scrollableGrid = new r.default({
gantt: this.$gantt,
grid: this.$grid,
dnd: this._dnd,
getCurrentX: this.calculateCurrentPosition
}),
this.attachEvents()
}
,
t.prototype.attachEvents = function() {
var t = this;
this._dnd.attachEvent("onBeforeDragStart", function(e, n) {
if (t._draggedCell = t.$gantt.utils.dom.closest(n.target, ".gantt_grid_head_cell"),
t._draggedCell) {
var i, r, a = t.$grid.$getConfig().columns, o = t._draggedCell.getAttribute("data-column-id");
return a.map(function(t, e) {
t.name === o && (i = t,
r = e)
}),
!1 === t.$grid.callEvent("onBeforeColumnDragStart", [{
draggedColumn: i,
draggedIndex: r
}]) ? !1 : !(!t._draggedCell || !i) && (t._gridConfig = t.$grid.$getConfig(),
t._originAutoscroll = t.$gantt.config.autoscroll,
t.$gantt.config.autoscroll = !1,
!0)
}
}),
this._dnd.attachEvent("onAfterDragStart", function(e, n) {
t._draggedCell && (t._dnd.config.column = t._draggedCell.getAttribute("data-column-id"),
t._dnd.config.marker.innerHTML = t._draggedCell.outerHTML,
t._dnd.config.marker.classList.add("gantt_column_drag_marker"),
t._dnd.config.marker.style.height = t._gridConfig.scale_height + "px",
t._dnd.config.marker.style.lineHeight = t._gridConfig.scale_height + "px",
t._draggedCell.classList.add("gantt_grid_head_cell_dragged"))
}),
this._dnd.attachEvent("onDragMove", function(e, n) {
if (t._draggedCell) {
t._dragX = n.clientX;
var i = t.calculateCurrentPosition(n.clientX)
, r = t.findColumnsIndexes()
, a = r.targetIndex
, o = r.draggedIndex
, s = t.$grid.$getConfig().columns
, l = s[o]
, c = s[a];
return !1 === t.$grid.callEvent("onColumnDragMove", [{
draggedColumn: l,
targetColumn: c,
draggedIndex: o,
targetIndex: a
}]) ? (t.cleanTargetMarker(),
!1) : (t.setMarkerPosition(i),
t.drawTargetMarker(r),
!0)
}
}),
this._dnd.attachEvent("onDragEnd", function() {
t._draggedCell && (t.$gantt.config.autoscroll = t._originAutoscroll,
t._draggedCell.classList.remove("gantt_grid_head_cell_dragged"),
t.cleanTargetMarker(),
t.reorderColumns())
})
}
,
t.prototype.reorderColumns = function() {
var t = this.findColumnsIndexes()
, e = t.targetIndex
, n = t.draggedIndex
, i = this.$grid.$getConfig().columns
, r = i[n]
, a = i[e];
!1 !== this.$grid.callEvent("onBeforeColumnReorder", [{
draggedColumn: r,
targetColumn: a,
draggedIndex: n,
targetIndex: e
}]) && e !== n && (i.splice(n, 1),
i.splice(e, 0, r),
this.$gantt.render(),
this.$grid.callEvent("onAfterColumnReorder", [{
draggedColumn: r,
targetColumn: a,
draggedIndex: n,
targetIndex: e
}]))
}
,
t.prototype.findColumnsIndexes = function() {
var t, e, n, i, r, a = this._dnd.config.column, o = this.$grid.$getConfig().columns, s = {
startX: 0,
endX: 0
}, l = 0, c = o.length - 1, u = function(t, e) {
return t <= e
}, d = function(t) {
return ++t
};
this.$gantt.config.rtl && (l = o.length - 1,
c = 0,
u = function(t, e) {
return t >= e
}
,
d = function(t) {
return --t
}
);
for (var h = this._dragX - this.$grid.$grid.getBoundingClientRect().left + this._scrollableGrid.getCorrection(), f = l; u(f, c) && (void 0 === t || void 0 === e); f = d(f))
o[f].hide || (s.startX = s.endX,
s.endX += o[f].width,
h >= s.startX && (h <= s.endX || !u(d(f), c)) && (t = f,
n = s.startX,
i = s.endX,
r = (h - s.startX) / (s.endX - s.startX)),
a === o[f].name && (e = f));
return {
targetIndex: t,
draggedIndex: e,
xBefore: n,
xAfter: i,
columnRelativePos: r
}
}
,
t.prototype.setMarkerPosition = function(t, e) {
void 0 === e && (e = 10);
var n = this._dnd.config.marker
, i = this._dnd._obj.getBoundingClientRect();
n.style.top = i.y + e + "px",
n.style.left = t + "px"
}
,
t.prototype.drawTargetMarker = function(t) {
var e, n = t.targetIndex, r = t.draggedIndex, a = t.xBefore, o = t.xAfter, s = t.columnRelativePos;
this._targetMarker || (this._targetMarker = document.createElement("div"),
i.addClassName(this._targetMarker, "gantt_grid_target_marker"),
this._targetMarker.style.display = "none",
this._targetMarker.style.height = this._gridConfig.scale_height + "px"),
this._targetMarker.parentNode || this.$grid.$grid_scale.appendChild(this._targetMarker),
e = n > r ? o : n < r ? a : s > .5 ? o : a,
this._targetMarker.style.left = e + "px",
this._targetMarker.style.display = "block"
}
,
t.prototype.cleanTargetMarker = function() {
this._targetMarker && this._targetMarker.parentNode && this.$grid.$grid_scale.removeChild(this._targetMarker),
this._targetMarker = null
}
,
t
}();
e.ColumnsGridDnd = a
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(205);
e.default = i.ColumnsGridDnd
}
, function(t, e, n) {
var i = n(1);
t.exports = function(t, e) {
var n = {
row_before_start: t.bind(function(t, n, r) {
var a = e.$getConfig()
, o = e.$config.rowStore;
if (!i.locateAttribute(r, a.task_grid_row_resizer_attribute))
return !1;
var s = this.locate(r, a.task_grid_row_resizer_attribute)
, l = o.getItem(s);
return !1 !== e.callEvent("onBeforeRowResize", [l]) && void 0
}, t),
row_after_start: t.bind(function(t, n, i) {
var r = e.$getConfig()
, a = this.locate(i, r.task_grid_row_resizer_attribute);
t.config.marker.innerHTML = "",
t.config.marker.className += " gantt_row_grid_resize_area",
t.config.marker.style.width = e.$grid.offsetWidth + "px",
t.config.drag_id = a
}, t),
row_drag_move: t.bind(function(t, n, r) {
var a = e.$config.rowStore
, o = e.$getConfig()
, s = t.config
, l = s.drag_id
, c = e.getItemHeight(l)
, u = e.getItemTop(l)
, d = i.getNodePosition(e.$grid_data)
, h = parseInt(s.marker.style.top, 10)
, f = u + d.y
, _ = 0
, g = o.min_task_grid_row_height;
return (_ = h - f) < g && (_ = g),
s.marker.style.left = d.x + "px",
s.marker.style.top = f - 1 + "px",
s.marker.style.height = Math.abs(_) + 1 + "px",
s.marker_height = _,
e.callEvent("onRowResize", [l, a.getItem(l), _ + c]),
!0
}, t),
row_drag_end: t.bind(function(n, i, r) {
var a = e.$config.rowStore
, o = n.config
, s = o.drag_id
, l = a.getItem(s)
, c = e.getItemHeight(s)
, u = o.marker_height;
!1 !== e.callEvent("onBeforeRowResizeEnd", [s, l, u]) && l.row_height != u && (l.row_height = u,
t.updateTask(s),
e.callEvent("onAfterRowResize", [s, l, c, u]),
this.render())
}, t)
};
return {
init: function() {
var i = t.$services.getService("dnd")
, r = e.$getConfig()
, a = new i(e.$grid_data,{
updates_per_second: 60
});
t.defined(r.dnd_sensitivity) && (a.config.sensitivity = r.dnd_sensitivity),
a.attachEvent("onBeforeDragStart", function(t, e) {
return n.row_before_start(a, t, e)
}),
a.attachEvent("onAfterDragStart", function(t, e) {
return n.row_after_start(a, t, e)
}),
a.attachEvent("onDragMove", function(t, e) {
return n.row_drag_move(a, t, e)
}),
a.attachEvent("onDragEnd", function(t, e) {
return n.row_drag_end(a, t, e)
})
}
}
}
}
, function(t, e) {
t.exports = function(t) {
var e = -1
, n = -1;
return {
resetCache: function() {
e = -1,
n = -1
},
_getRowHeight: function() {
return -1 === e && (e = t.$getConfig().row_height),
e
},
_refreshState: function() {
this.resetCache(),
n = !0;
var e = t.$config.rowStore;
if (e)
for (var i = this._getRowHeight(), r = 0; r < e.fullOrder.length; r++) {
var a = e.getItem(e.fullOrder[r]);
if (a && a.row_height && a.row_height !== i) {
n = !1;
break
}
}
},
canUseSimpleCalculation: function() {
return -1 === n && this._refreshState(),
n
},
getRowTop: function(e) {
return t.$config.rowStore ? e * this._getRowHeight() : 0
},
getItemHeight: function(t) {
return this._getRowHeight()
},
getTotalHeight: function() {
return t.$config.rowStore ? t.$config.rowStore.countVisible() * this._getRowHeight() : 0
},
getItemIndexByTopPosition: function(e) {
return t.$config.rowStore ? Math.floor(e / this._getRowHeight()) : 0
}
}
}
}
, function(t, e) {
t.exports = function(t, e) {
return {
init: function() {},
doOnRender: function() {}
}
}
}
, function(t, e, n) {
var i = n(32);
t.exports = function(t) {
n(203)(t),
i.prototype.getGridColumns = function() {
for (var t = this.$getConfig().columns, e = [], n = 0; n < t.length; n++)
t[n].hide || e.push(t[n]);
return e
}
}
}
, function(t, e, n) {
t.exports = function(t) {
var e = n(47)
, i = {};
t.attachEvent("onClearAll", function() {
i = {}
});
var r = e.prototype.hasChild;
t.$data.tasksStore.hasChild = function(e) {
return t.config.branch_loading ? !!r.call(this, e) || !!this.exists(e) && this.getItem(e)[t.config.branch_loading_property] : r.call(this, e)
}
,
t.attachEvent("onTaskOpened", function(e) {
if (t.config.branch_loading && t._load_url && function(e) {
return !(!t.config.branch_loading || !t._load_url || i[e] || t.getChildren(e).length || !t.hasChild(e))
}(e)) {
var n = t._load_url
, r = (n = n.replace(/(\?|&)?parent_id=.+&?/, "")).indexOf("?") >= 0 ? "&" : "?"
, a = t.getScrollState().y || 0
, o = {
taskId: e,
url: n + r + "parent_id=" + encodeURIComponent(e)
};
if (!1 === t.callEvent("onBeforeBranchLoading", [o]))
return;
t.load(o.url, this._load_type, function() {
a && t.scrollTo(null, a),
t.callEvent("onAfterBranchLoading", [o])
}),
i[e] = !0
}
})
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
}),
e.default = function(t) {
t.ext = t.ext || {},
t.config.show_empty_state = !1,
t.ext.emptyStateElement = t.ext.emptyStateElement || {
isEnabled: function() {
return !0 === t.config.show_empty_state
},
isGanttEmpty: function() {
return !t.getTaskByTime().length
},
renderContent: function(e) {
var n = "
";
e.innerHTML = n
},
clickEvents: [],
attachAddTaskEvent: function() {
var e = t.attachEvent("onEmptyClick", function(e) {
t.utils.dom.closest(e.target, "[data-empty-state-create-task]") && t.createTask({
id: t.uid(),
text: "New Task"
})
});
this.clickEvents.push(e)
},
detachAddTaskEvents: function() {
this.clickEvents.forEach(function(e) {
t.detachEvent(e)
}),
this.clickEvents = []
},
getContainer: function() {
if (t.$container) {
var e = t.utils.dom;
if (t.$container.contains(t.$grid_data))
return e.closest(t.$grid_data, ".gantt_layout_content");
if (t.$container.contains(t.$task_data))
return e.closest(t.$task_data, ".gantt_layout_content")
}
return null
},
getNode: function() {
var t = this.getContainer();
return t ? t.querySelector(".gantt_empty_state_wrapper") : null
},
show: function() {
var e = this.getContainer();
if (!e && this.isGanttEmpty())
return null;
var n = document.createElement("div");
n.className = "gantt_empty_state_wrapper",
n.style.marginTop = t.config.scale_height - e.offsetHeight + "px";
var i = t.$container.querySelectorAll(".gantt_empty_state_wrapper");
Array.prototype.forEach.call(i, function(t) {
t.parentNode.removeChild(t)
}),
this.detachAddTaskEvents(),
this.attachAddTaskEvent(),
e.appendChild(n),
this.renderContent(n)
},
hide: function() {
var t = this.getNode();
if (!t)
return !1;
t.parentNode.removeChild(t)
},
init: function() {}
},
t.attachEvent("onDataRender", function() {
var e = t.ext.emptyStateElement;
e.isEnabled() && e.isGanttEmpty() ? e.show() : e.hide()
})
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = function() {
function t(t) {
var e = this;
this.format = function(t) {
return e._getWBSCode(t.source)
}
,
this.canParse = function(t) {
return e._linkReg.test(t)
}
,
this.parse = function(t) {
if (!e.canParse(t))
return null;
var n = e._linkReg.exec(t)[0].trim();
return {
id: void 0,
source: e._findSource(n) || null,
target: null,
type: e._gantt.config.links.finish_to_start,
lag: 0
}
}
,
this._getWBSCode = function(t) {
var n = e._gantt.getTask(t);
return e._gantt.getWBSCode(n)
}
,
this._findSource = function(t) {
var n = new RegExp("^[0-9.]+","i");
if (n.exec(t)) {
var i = n.exec(t)[0]
, r = e._gantt.getTaskByWBSCode(i);
if (r)
return r.id
}
return null
}
,
this._linkReg = /^[0-9\.]+/,
this._gantt = t
}
return t.create = function(e, n) {
return void 0 === e && (e = null),
new t(n)
}
,
t
}();
e.default = i
}
, function(t, e, n) {
var i = n(44).default
, r = n(213).default;
t.exports = function(t) {
t.ext.formatters = {
durationFormatter: function(e) {
return e || (e = {}),
e.store || (e.store = t.config.duration_unit),
e.enter || (e.enter = t.config.duration_unit),
i.create(e, t)
},
linkFormatter: function(e) {
return r.create(e, t)
}
}
}
}
, function(t, e) {
t.exports = function(t) {
function e(e) {
return function() {
return !t.config.auto_types || t.getTaskType(t.config.types.project) != t.config.types.project || e.apply(this, arguments)
}
}
function n(e, n) {
var i = t.getTask(e)
, r = a(i);
!1 !== r && t.getTaskType(i) !== r && (n.$needsUpdate = !0,
n[i.id] = {
task: i,
type: r
})
}
function i(e) {
if (!t.getState().group_mode) {
var i = function(e, i) {
return n(e, i = i || {}),
t.eachParent(function(t) {
n(t.id, i)
}, e),
i
}(e);
i.$needsUpdate && t.batchUpdate(function() {
!function(e) {
for (var n in e)
if (e[n] && e[n].task) {
var i = e[n].task;
i.type = e[n].type,
t.updateTask(i.id)
}
}(i)
})
}
}
var r;
function a(e) {
var n = t.config.types
, i = t.hasChild(e.id)
, r = t.getTaskType(e.type);
return i && r === n.task ? n.project : !i && r === n.project && n.task
}
var o, s, l = !0;
function c(e) {
e != t.config.root_id && t.isTaskExists(e) && i(e)
}
t.attachEvent("onParse", e(function() {
l = !1,
t.getState().group_mode || (t.batchUpdate(function() {
t.eachTask(function(e) {
var n = a(e);
!1 !== n && function(e, n) {
t.getState().group_mode || (e.type = n,
t.updateTask(e.id))
}(e, n)
})
}),
l = !0)
})),
t.attachEvent("onAfterTaskAdd", e(function(t) {
l && i(t)
})),
t.attachEvent("onAfterTaskUpdate", e(function(t) {
l && i(t)
})),
t.attachEvent("onBeforeTaskDelete", e(function(e, n) {
return r = t.getParent(e),
!0
})),
t.attachEvent("onAfterTaskDelete", e(function(t, e) {
c(r)
})),
t.attachEvent("onRowDragStart", e(function(e, n, i) {
return o = t.getParent(e),
!0
})),
t.attachEvent("onRowDragEnd", e(function(t, e) {
c(o),
i(t)
})),
t.attachEvent("onBeforeTaskMove", e(function(e, n, i) {
return s = t.getParent(e),
!0
})),
t.attachEvent("onAfterTaskMove", e(function(t, e, n) {
document.querySelector(".gantt_drag_marker") || (c(s),
i(t))
}))
}
}
, function(t, e) {
t.exports = function(t) {
function e(e) {
return function() {
return !t.config.placeholder_task || e.apply(this, arguments)
}
}
function n() {
var e = t.getTaskBy("type", t.config.types.placeholder);
if (!e.length || !t.isTaskExists(e[0].id)) {
var n = {
unscheduled: !0,
type: t.config.types.placeholder,
duration: 0,
text: t.locale.labels.new_task
};
if (!1 === t.callEvent("onTaskCreated", [n]))
return;
t.addTask(n)
}
}
function i(e) {
var n = t.getTask(e);
n.type == t.config.types.placeholder && (n.start_date && n.end_date && n.unscheduled && (n.unscheduled = !1),
t.batchUpdate(function() {
var e = t.copy(n);
t.silent(function() {
t.deleteTask(n.id)
}),
delete e["!nativeeditor_status"],
e.type = t.config.types.task,
e.id = t.uid(),
t.addTask(e)
}))
}
t.config.types.placeholder = "placeholder",
t.attachEvent("onDataProcessorReady", e(function(n) {
n && !n._silencedPlaceholder && (n._silencedPlaceholder = !0,
n.attachEvent("onBeforeUpdate", e(function(e, i, r) {
return r.type != t.config.types.placeholder || (n.setUpdated(e, !1),
!1)
})))
}));
var r = !1;
function a(e) {
if (t.config.types.placeholder && t.isTaskExists(e) && t.getTask(e).type == t.config.types.placeholder)
return !0;
return !1
}
function o(t) {
return !(!a(t.source) && !a(t.target))
}
t.attachEvent("onGanttReady", function() {
r || (r = !0,
t.attachEvent("onAfterTaskUpdate", e(i)),
t.attachEvent("onAfterTaskAdd", e(function(e, i) {
i.type != t.config.types.placeholder && (t.getTaskBy("type", t.config.types.placeholder).forEach(function(e) {
t.silent(function() {
t.isTaskExists(e.id) && t.deleteTask(e.id)
})
}),
n())
})),
t.attachEvent("onParse", e(n)))
}),
t.attachEvent("onLinkValidation", function(t) {
return !o(t)
}),
t.attachEvent("onBeforeLinkAdd", function(t, e) {
return !o(e)
}),
t.attachEvent("onBeforeUndoStack", function(e) {
for (var n = 0; n < e.commands.length; n++) {
var i = e.commands[n];
"task" === i.entity && i.value.type === t.config.types.placeholder && (e.commands.splice(n, 1),
n--)
}
return !0
})
}
}
, function(t, e) {
t.exports = function(t) {
var e = "$resourceAssignments";
t.config.resource_assignment_store = "resourceAssignments",
t.config.process_resource_assignments = !0;
var n = {
auto: "auto",
singleValue: "singleValue",
valueArray: "valueArray",
resourceValueArray: "resourceValueArray",
assignmentsArray: "assignmentsArray"
}
, i = n.auto
, r = {
fixedDates: "fixedDates",
fixedDuration: "fixedDuration",
default: "default"
};
function a(e, n) {
e.start_date ? e.start_date = t.date.parseDate(e.start_date, "parse_date") : e.start_date = null,
e.end_date ? e.end_date = t.date.parseDate(e.end_date, "parse_date") : e.end_date = null;
var i = Number(e.delay)
, a = !1;
if (isNaN(i) ? (e.delay = 0,
a = !0) : e.delay = i,
t.defined(e.value) || (e.value = null),
!e.task_id || !e.resource_id)
return !1;
if (e.mode = e.mode || r.default,
e.mode === r.fixedDuration && (isNaN(Number(e.duration)) && (n = n || t.getTask(e.task_id),
e.duration = t.calculateDuration({
start_date: e.start_date,
end_date: e.end_date,
id: n
})),
a && (n = n || t.getTask(e.task_id),
e.delay = t.calculateDuration({
start_date: n.start_date,
end_date: e.start_date,
id: n
}))),
e.mode !== r.fixedDates && (n || t.isTaskExists(e.task_id))) {
var o = s(e, n = n || t.getTask(e.task_id));
e.start_date = o.start_date,
e.end_date = o.end_date,
e.duration = o.duration
}
}
var o = t.createDatastore({
name: t.config.resource_assignment_store,
initItem: function(e) {
return e.id || (e.id = t.uid()),
a(e),
e
}
});
function s(e, n) {
if (e.mode === r.fixedDates)
return {
start_date: e.start_date,
end_date: e.end_date,
duration: e.duration
};
var i, a, o = e.delay ? t.calculateEndDate({
start_date: n.start_date,
duration: e.delay,
task: n
}) : new Date(n.start_date);
return e.mode === r.fixedDuration ? (i = t.calculateEndDate({
start_date: o,
duration: e.duration,
task: n
}),
a = e.duration) : (i = new Date(n.end_date),
a = n.duration - e.delay),
{
start_date: o,
end_date: i,
duration: a
}
}
function l(e) {
var o = t.config.resource_property
, s = e[o]
, l = []
, c = i === n.auto;
if (t.defined(s) && s) {
Array.isArray(s) || (s = [s],
c && (i = n.singleValue,
c = !1));
var u = {};
s.forEach(function(o) {
o.resource_id || (o = {
resource_id: o
},
c && (i = n.valueArray,
c = !1)),
c && (o.id && o.resource_id ? (i = n.assignmentsArray,
c = !1) : (i = n.resourceValueArray,
c = !1));
var s, d = r.default;
o.mode || (o.start_date && o.end_date || o.start_date && o.duration) && (d = r.fixedDuration),
s = o.id || !o.$id || u[o.$id] ? o.id && !u[o.id] ? o.id : t.uid() : o.$id,
u[s] = !0;
var h = {
id: s,
start_date: o.start_date,
duration: o.duration,
end_date: o.end_date,
delay: o.delay,
task_id: e.id,
resource_id: o.resource_id,
value: o.value,
mode: o.mode || d
};
h.start_date && h.start_date.getMonth && h.end_date && h.end_date.getMonth && "number" == typeof h.duration || a(h, e),
l.push(h)
})
}
return l
}
function c(e) {
if (t.isTaskExists(e)) {
var n = t.getTask(e);
u(n, t.getTaskAssignments(n.id))
}
}
function u(r, a) {
a.sort(function(t, e) {
return t.start_date && e.start_date && t.start_date.valueOf() != e.start_date.valueOf() ? t.start_date - e.start_date : 0
}),
i == n.assignmentsArray ? r[t.config.resource_property] = a : i == n.resourceValueArray && (r[t.config.resource_property] = a.map(function(t) {
return {
$id: t.id,
start_date: t.start_date,
duration: t.duration,
end_date: t.end_date,
delay: t.delay,
resource_id: t.resource_id,
value: t.value,
mode: t.mode
}
})),
r[e] = a
}
function d(e) {
var n = l(e)
, i = [];
return n.forEach(function(e) {
e.id = e.id || t.uid(),
i.push(e)
}),
n
}
function h(t, e) {
var a = function(t, e) {
var r = {
inBoth: [],
inTaskNotInStore: [],
inStoreNotInTask: []
};
if (i == n.singleValue) {
var a = t[0]
, o = a ? a.resource_id : null
, s = !1;
e.forEach(function(t) {
t.resource_id != o ? r.inStoreNotInTask.push(t) : t.resource_id == o && (r.inBoth.push({
store: t,
task: a
}),
s = !0)
}),
!s && a && r.inTaskNotInStore.push(a)
} else if (i == n.valueArray) {
var l = {}
, c = {}
, u = {};
t.forEach(function(t) {
l[t.resource_id] = t
}),
e.forEach(function(t) {
c[t.resource_id] = t
}),
t.concat(e).forEach(function(t) {
if (!u[t.resource_id]) {
u[t.resource_id] = !0;
var e = l[t.resource_id]
, n = c[t.resource_id];
e && n ? r.inBoth.push({
store: n,
task: e
}) : e && !n ? r.inTaskNotInStore.push(e) : !e && n && r.inStoreNotInTask.push(n)
}
})
} else
i != n.assignmentsArray && i != n.resourceValueArray || (l = {},
c = {},
u = {},
t.forEach(function(t) {
l[t.id || t.$id] = t
}),
e.forEach(function(t) {
c[t.id] = t
}),
t.concat(e).forEach(function(t) {
var e = t.id || t.$id;
if (!u[e]) {
u[e] = !0;
var n = l[e]
, i = c[e];
n && i ? r.inBoth.push({
store: i,
task: n
}) : n && !i ? r.inTaskNotInStore.push(n) : !n && i && r.inStoreNotInTask.push(i)
}
}));
return r
}(l(t), e);
a.inStoreNotInTask.forEach(function(t) {
o.removeItem(t.id)
}),
a.inTaskNotInStore.forEach(function(t) {
o.addItem(t)
}),
a.inBoth.forEach(function(e) {
if (function(t, e) {
var n = {
id: !0
};
for (var i in t)
if (!n[i] && String(t[i]) !== String(e[i]))
return !0;
return !1
}(e.task, e.store))
!function(t, e) {
var n = {
id: !0
};
for (var i in t)
n[i] || (e[i] = t[i])
}(e.task, e.store),
o.updateItem(e.store.id);
else if (e.task.start_date && e.task.end_date && e.task.mode !== r.fixedDates) {
var n = s(e.store, t);
e.store.start_date.valueOf() == n.start_date.valueOf() && e.store.end_date.valueOf() == n.end_date.valueOf() || (e.store.start_date = n.start_date,
e.store.end_date = n.end_date,
e.store.duration = n.duration,
o.updateItem(e.store.id))
}
}),
c(t.id)
}
function f(t) {
var n = t[e] || o.find(function(e) {
return e.task_id == t.id
});
h(t, n)
}
t.$data.assignmentsStore = o,
t.attachEvent("onGanttReady", function() {
if (t.config.process_resource_assignments) {
t.attachEvent("onParse", function() {
t.silent(function() {
o.clearAll();
var e = [];
t.eachTask(function(n) {
if (n.type !== t.config.types.project) {
var i = d(n);
u(n, i),
i.forEach(function(t) {
e.push(t)
})
}
}),
o.parse(e)
})
});
var e = !1
, n = !1
, i = {}
, r = !1;
t.attachEvent("onBeforeBatchUpdate", function() {
e = !0
}),
t.attachEvent("onAfterBatchUpdate", function() {
if (n) {
var r = {};
for (var a in i)
r[a] = t.getTaskAssignments(i[a].id);
for (var a in i)
h(i[a], r[a])
}
n = !1,
e = !1,
i = {}
}),
t.attachEvent("onTaskCreated", function(t) {
var e = d(t);
return o.parse(e),
u(t, e),
!0
}),
t.attachEvent("onAfterTaskUpdate", function(t, r) {
e ? (n = !0,
i[t] = r) : f(r)
}),
t.attachEvent("onAfterTaskAdd", function(t, r) {
e ? (n = !0,
i[t] = r) : f(r)
}),
t.attachEvent("onRowDragEnd", function(e) {
f(t.getTask(e))
}),
t.$data.tasksStore.attachEvent("onAfterDeleteConfirmed", function(e, n) {
var i = [e];
t.eachTask(function(t) {
i.push(t.id)
}, e),
function(t) {
var e = {};
t.forEach(function(t) {
e[t] = !0
}),
o.find(function(t) {
return e[t.task_id]
}).forEach(function(t) {
o.removeItem(t.id)
})
}(i)
}),
t.$data.tasksStore.attachEvent("onClearAll", function() {
return a = null,
s = null,
l = null,
o.clearAll(),
!0
}),
t.attachEvent("onTaskIdChange", function(t, e) {
o.find(function(e) {
return e.task_id == t
}).forEach(function(t) {
t.task_id = e,
o.updateItem(t.id)
}),
c(e)
}),
t.attachEvent("onBeforeUndo", function(t) {
return r = !0,
!0
}),
t.attachEvent("onAfterUndo", function(t) {
r = !0
});
var a = null
, s = null
, l = null;
o.attachEvent("onStoreUpdated", function() {
return !(!e || r) || (a = null,
s = null,
l = null,
!0)
}),
t.getResourceAssignments = function(e, n) {
var i = t.defined(n) && null !== n;
return null === a && (a = {},
s = {},
o.eachItem(function(t) {
a[t.resource_id] || (a[t.resource_id] = []),
a[t.resource_id].push(t);
var e = t.resource_id + "-" + t.task_id;
s[e] || (s[e] = []),
s[e].push(t)
})),
i ? (s[e + "-" + n] || []).slice() : (a[e] || []).slice()
}
,
t.getTaskAssignments = function(t) {
if (null === l) {
var e = [];
l = {},
o.eachItem(function(n) {
l[n.task_id] || (l[n.task_id] = []),
l[n.task_id].push(n),
n.task_id == t && e.push(n)
})
}
return (l[t] || []).slice()
}
,
t.getTaskResources = function(e) {
var n = t.getDatastore("resource")
, i = {};
t.getTaskAssignments(e).forEach(function(t) {
i[t.resource_id] || (i[t.resource_id] = t.resource_id)
});
var r = [];
for (var a in i) {
var o = n.getItem(i[a]);
o && r.push(o)
}
return r
}
,
t.updateTaskAssignments = c
}
}, {
once: !0
})
}
}
, function(t, e, n) {
var i = n(2);
function r(t) {
var e = {}
, n = !1;
t.$data.tasksStore.attachEvent("onStoreUpdated", function() {
e = {},
n = !1
}),
t.attachEvent("onBeforeGanttRender", function() {
e = {}
});
var r = String(Math.random());
function a(t) {
return null === t ? r + String(t) : String(t)
}
function o(t, e, n) {
return Array.isArray(t) ? t.map(function(t) {
return a(t)
}).join("_") + "_".concat(e, "_").concat(n) : a(t) + "_".concat(e, "_").concat(n)
}
function s(r, s, l) {
var c, u = o(s, r, JSON.stringify(l)), d = {};
return i.forEach(s, function(t) {
d[a(t)] = !0
}),
e[u] ? c = e[u] : (c = e[u] = [],
t.eachTask(function(s) {
if (l) {
if (!l[t.getTaskType(s)])
return
} else if (s.type == t.config.types.project)
return;
var u;
r in s && (u = i.isArray(s[r]) ? s[r] : [s[r]],
i.forEach(u, function(t) {
var i = t && t.resource_id ? t.resource_id : t;
if (d[a(i)])
c.push(s);
else if (!n) {
var l = o(t, r);
e[l] || (e[l] = []),
e[l].push(s)
}
}))
}),
n = !0),
c
}
function l(e, n, i) {
var r = t.config.resource_property
, a = [];
if (t.getDatastore("task").exists(n)) {
var o = t.getTask(n);
a = o[r] || []
}
Array.isArray(a) || (a = [a]);
for (var s = 0; s < a.length; s++)
a[s].resource_id == e && i.push({
task_id: o.id,
resource_id: a[s].resource_id,
value: a[s].value
})
}
return {
getTaskBy: function(e, n, r) {
return "function" == typeof e ? function(e) {
var n = [];
return t.eachTask(function(t) {
e(t) && n.push(t)
}),
n
}(e) : i.isArray(n) ? s(e, n, r) : s(e, [n], r)
},
getResourceAssignments: function(e, n) {
var i = []
, r = t.config.resource_property;
return void 0 !== n ? l(e, n, i) : t.getTaskBy(r, e).forEach(function(t) {
l(e, t.id, i)
}),
i
}
}
}
t.exports = function(t) {
var e = r(t);
t.ext.resources = function(t) {
var e = {
renderEditableLabel: function(e, n, i, r, a) {
var o = t.config.readonly ? "" : "contenteditable";
if (e < i.end_date && n > i.start_date) {
for (var s = 0; s < a.length; s++) {
var l = a[s];
return "
" + l.value + "
"
}
return "
-
"
}
return ""
},
renderSummaryLabel: function(t, e, n, i, r) {
var a = r.reduce(function(t, e) {
return t + Number(e.value)
}, 0);
return a % 1 && (a = Math.round(10 * a) / 10),
a ? "
" + a + "
" : ""
},
editableResourceCellTemplate: function(t, n, i, r, a) {
return "task" === i.$role ? e.renderEditableLabel(t, n, i, r, a) : e.renderSummaryLabel(t, n, i, r, a)
},
editableResourceCellClass: function(t, e, n, i, r) {
var a = [];
a.push("resource_marker"),
"task" === n.$role ? a.push("task_cell") : a.push("resource_cell");
var o = r.reduce(function(t, e) {
return t + Number(e.value)
}, 0)
, s = Number(n.capacity);
return isNaN(s) && (s = 8),
o <= s ? a.push("workday_ok") : a.push("workday_over"),
a.join(" ")
},
getSummaryResourceAssignments: function(e) {
var n, i = t.getDatastore(t.config.resource_store), r = i.getItem(e);
return "task" === r.$role ? n = t.getResourceAssignments(r.$resource_id, r.$task_id) : (n = t.getResourceAssignments(e),
i.eachItem && i.eachItem(function(e) {
"task" !== e.$role && (n = n.concat(t.getResourceAssignments(e.id)))
}, e)),
n
},
initEditableDiagram: function() {
t.config.resource_render_empty_cells = !0,
function() {
var e = null;
function n() {
return e && cancelAnimationFrame(e),
e = requestAnimationFrame(function() {
Array.prototype.slice.call(t.$container.querySelectorAll(".resourceTimeline_cell [data-assignment-cell]")).forEach(function(t) {
t.contentEditable = !0
})
}),
!0
}
t.attachEvent("onGanttReady", function() {
t.getDatastore(t.config.resource_assignment_store).attachEvent("onStoreUpdated", n),
t.getDatastore(t.config.resource_store).attachEvent("onStoreUpdated", n)
}, {
once: !0
}),
t.attachEvent("onGanttLayoutReady", function() {
t.$layout.getCellsByType("viewCell").forEach(function(t) {
t.$config && "resourceTimeline" === t.$config.view && t.$content && t.$content.attachEvent("onScroll", n)
})
})
}(),
t.attachEvent("onGanttReady", function() {
var e = !1;
t.event(t.$container, "keypress", function(t) {
var e = t.target.closest(".resourceTimeline_cell [data-assignment-cell]");
e && (13 !== t.keyCode && 27 !== t.keyCode || e.blur())
}),
t.event(t.$container, "focusout", function(n) {
if (!e) {
e = !0,
setTimeout(function() {
e = !1
}, 300);
var i = n.target.closest(".resourceTimeline_cell [data-assignment-cell]");
if (i) {
var r = (i.innerText || "").trim();
"-" == r && (r = "0");
var a = Number(r)
, o = i.getAttribute("data-row-id")
, s = i.getAttribute("data-assignment-id")
, l = i.getAttribute("data-task")
, c = i.getAttribute("data-resource-id")
, u = t.templates.parse_date(i.getAttribute("data-start-date"))
, d = t.templates.parse_date(i.getAttribute("data-end-date"))
, h = t.getDatastore(t.config.resource_assignment_store);
if (isNaN(a))
t.getDatastore(t.config.resource_store).refresh(o);
else {
var f = t.getTask(l);
if (t.plugins().undo && t.ext.undo.saveState(l, "task"),
s) {
if (a === (g = h.getItem(s)).value)
return;
if (g.start_date.valueOf() === u.valueOf() && g.end_date.valueOf() === d.valueOf())
g.value = a,
a ? h.updateItem(g.id) : h.removeItem(g.id);
else {
if (g.end_date.valueOf() > d.valueOf()) {
var _ = t.copy(g);
_.id = t.uid(),
_.start_date = d,
_.duration = t.calculateDuration({
start_date: _.start_date,
end_date: _.end_date,
task: f
}),
_.delay = t.calculateDuration({
start_date: f.start_date,
end_date: _.start_date,
task: f
}),
_.mode = g.mode || "default",
0 !== _.duration && h.addItem(_)
}
g.start_date.valueOf() < u.valueOf() ? (g.end_date = u,
g.duration = t.calculateDuration({
start_date: g.start_date,
end_date: g.end_date,
task: f
}),
g.mode = "fixedDuration",
0 === g.duration ? h.removeItem(g.id) : h.updateItem(g.id)) : h.removeItem(g.id),
a && h.addItem({
task_id: g.task_id,
resource_id: g.resource_id,
value: a,
start_date: u,
end_date: d,
duration: t.calculateDuration({
start_date: u,
end_date: d,
task: f
}),
delay: t.calculateDuration({
start_date: f.start_date,
end_date: u,
task: f
}),
mode: "fixedDuration"
})
}
t.updateTaskAssignments(f.id),
t.updateTask(f.id)
} else if (a) {
var g = {
task_id: l,
resource_id: c,
value: a,
start_date: u,
end_date: d,
duration: t.calculateDuration({
start_date: u,
end_date: d,
task: f
}),
delay: t.calculateDuration({
start_date: f.start_date,
end_date: u,
task: f
}),
mode: "fixedDuration"
};
h.addItem(g),
t.updateTaskAssignments(f.id),
t.updateTask(f.id)
}
}
}
}
})
}, {
once: !0
})
}
};
return e
}(t),
t.config.resources = {
dataprocessor_assignments: !1,
dataprocessor_resources: !1,
editable_resource_diagram: !1,
resource_store: {
type: "treeDataStore",
fetchTasks: !1,
initItem: function(e) {
return e.parent = e.parent || t.config.root_id,
e[t.config.resource_property] = e.parent,
e.open = !0,
e
}
},
lightbox_resources: function(e) {
var n = []
, i = t.getDatastore(t.config.resource_store);
return e.forEach(function(e) {
if (!i.hasChild(e.id)) {
var r = t.copy(e);
r.key = e.id,
r.label = e.text,
n.push(r)
}
}),
n
}
},
t.attachEvent("onBeforeGanttReady", function() {
if (!t.getDatastore(t.config.resource_store)) {
var e = t.config.resources ? t.config.resources.resource_store : void 0
, n = e ? e.fetchTasks : void 0;
t.config.resources && t.config.resources.editable_resource_diagram && (n = !0);
var i = function(e) {
return e.parent = e.parent || t.config.root_id,
e[t.config.resource_property] = e.parent,
e.open = !0,
e
};
e && e.initItem && (i = e.initItem);
var r = e && e.type ? e.type : "treeDatastore";
t.$resourcesStore = t.createDatastore({
name: t.config.resource_store,
type: r,
fetchTasks: void 0 !== n && n,
initItem: i
}),
t.$data.resourcesStore = t.$resourcesStore,
t.$resourcesStore.attachEvent("onParse", function() {
var e = function(e) {
var n = [];
return e.forEach(function(e) {
if (!t.$resourcesStore.hasChild(e.id)) {
var i = t.copy(e);
i.key = e.id,
i.label = e.text,
n.push(i)
}
}),
n
};
t.config.resources && t.config.resources.lightbox_resources && (e = t.config.resources.lightbox_resources);
var n = e(t.$resourcesStore.getItems());
t.updateCollection("resourceOptions", n)
})
}
}),
t.getTaskBy = e.getTaskBy,
t.getResourceAssignments = e.getResourceAssignments,
t.config.resource_property = "owner_id",
t.config.resource_store = "resource",
t.config.resource_render_empty_cells = !1,
t.templates.histogram_cell_class = function(t, e, n, i, r) {}
,
t.templates.histogram_cell_label = function(t, e, n, i, r) {
return i.length + "/3"
}
,
t.templates.histogram_cell_allocated = function(t, e, n, i, r) {
return i.length / 3
}
,
t.templates.histogram_cell_capacity = function(t, e, n, i, r) {
return 0
}
;
var n = function(t, e, n, i, r) {
return i.length <= 1 ? "gantt_resource_marker_ok" : "gantt_resource_marker_overtime"
}
, i = function(t, e, n, i, r) {
return 8 * i.length
};
t.templates.resource_cell_value = i,
t.templates.resource_cell_class = n,
t.attachEvent("onBeforeGanttReady", function() {
t.config.resources && t.config.resources.editable_resource_diagram && (t.config.resource_render_empty_cells = !0,
t.templates.resource_cell_value === i && (t.templates.resource_cell_value = t.ext.resources.editableResourceCellTemplate),
t.templates.resource_cell_class === n && (t.templates.resource_cell_class = t.ext.resources.editableResourceCellClass),
t.ext.resources.initEditableDiagram(t))
})
}
}
, function(t, e) {
t.exports = function(t) {
var e = function(t) {
return {
_needRecalc: !0,
reset: function() {
this._needRecalc = !0
},
_isRecalcNeeded: function() {
return !this._isGroupSort() && this._needRecalc
},
_isGroupSort: function() {
return !!t.getState().group_mode
},
_getWBSCode: function(t) {
return t ? (this._isRecalcNeeded() && this._calcWBS(),
t.$virtual ? "" : this._isGroupSort() ? t.$wbs || "" : (t.$wbs || (this.reset(),
this._calcWBS()),
t.$wbs)) : ""
},
_setWBSCode: function(t, e) {
t.$wbs = e
},
getWBSCode: function(t) {
return this._getWBSCode(t)
},
getByWBSCode: function(e) {
for (var n = e.split("."), i = t.config.root_id, r = 0; r < n.length; r++) {
var a = t.getChildren(i)
, o = 1 * n[r] - 1;
if (!t.isTaskExists(a[o]))
return null;
i = a[o]
}
return t.isTaskExists(i) ? t.getTask(i) : null
},
_calcWBS: function() {
if (this._isRecalcNeeded()) {
var e = !0;
t.eachTask(function(n) {
if (e)
return e = !1,
void this._setWBSCode(n, "1");
var i = t.getPrevSibling(n.id);
if (null !== i) {
var r = t.getTask(i).$wbs;
r && ((r = r.split("."))[r.length - 1]++,
this._setWBSCode(n, r.join(".")))
} else {
var a = t.getParent(n.id);
this._setWBSCode(n, t.getTask(a).$wbs + ".1")
}
}, t.config.root_id, this),
this._needRecalc = !1
}
}
}
}(t);
function n() {
return e.reset(),
!0
}
t.getWBSCode = function(t) {
return e.getWBSCode(t)
}
,
t.getTaskByWBSCode = function(t) {
return e.getByWBSCode(t)
}
,
t.attachEvent("onAfterTaskMove", n),
t.attachEvent("onBeforeParse", n),
t.attachEvent("onAfterTaskDelete", n),
t.attachEvent("onAfterTaskAdd", n),
t.attachEvent("onAfterSort", n)
}
}
, function(t, e, n) {
var i = n(21);
function r(t) {
var e = {}
, n = !1;
function r(t, n) {
n = "function" == typeof n ? n : function() {}
,
e[t] || (e[t] = this[t],
this[t] = n)
}
function a(t) {
e[t] && (this[t] = e[t],
e[t] = null)
}
function o() {
for (var t in e)
a.call(this, t)
}
function s(t) {
try {
t()
} catch (t) {
i.console.error(t)
}
}
return t.$services.getService("state").registerProvider("batchUpdate", function() {
return {
batch_update: n
}
}, !1),
function(t, e) {
if (n)
s(t);
else {
var i, a = this._dp && "off" != this._dp.updateMode;
a && (i = this._dp.updateMode,
this._dp.setUpdateMode("off"));
var l = {}
, c = {
render: !0,
refreshData: !0,
refreshTask: !0,
refreshLink: !0,
resetProjectDates: function(t) {
l[t.id] = t
}
};
for (var u in function(t) {
for (var e in t)
r.call(this, e, t[e])
}
.call(this, c),
n = !0,
this.callEvent("onBeforeBatchUpdate", []),
s(t),
this.callEvent("onAfterBatchUpdate", []),
o.call(this),
l)
this.resetProjectDates(l[u]);
n = !1,
e || this.render(),
a && (this._dp.setUpdateMode(i),
this._dp.setGanttMode("task"),
this._dp.sendData(),
this._dp.setGanttMode("link"),
this._dp.sendData())
}
}
}
t.exports = function(t) {
t.batchUpdate = r(t)
}
}
, function(t, e, n) {
t.exports = function(t) {
t.ext || (t.ext = {});
for (var e = [n(220), n(219), n(218), n(217), n(216), n(215), n(214), n(212).default], i = 0; i < e.length; i++)
e[i] && e[i](t)
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(0)
, r = function() {
function t() {
var t = this;
this.clear = function() {
t._storage = {}
}
,
this.storeItem = function(e) {
t._storage[e.id] = i.copy(e)
}
,
this.getStoredItem = function(e) {
return t._storage[e] || null
}
,
this._storage = {}
}
return t.create = function() {
return new t
}
,
t
}();
e.default = r
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
}),
e.default = function(t, e) {
t.getUserData = function(t, e, n) {
return this.userdata || (this.userdata = {}),
this.userdata[n] = this.userdata[n] || {},
this.userdata[n][t] && this.userdata[n][t][e] ? this.userdata[n][t][e] : ""
}
,
t.setUserData = function(t, e, n, i) {
this.userdata || (this.userdata = {}),
this.userdata[i] = this.userdata[i] || {},
this.userdata[i][t] = this.userdata[i][t] || {},
this.userdata[i][t][e] = n
}
,
t._change_id = function(t, e) {
switch (this._dp._ganttMode) {
case "task":
this.changeTaskId(t, e);
break;
case "link":
this.changeLinkId(t, e);
break;
case "assignment":
this.$data.assignmentsStore.changeId(t, e);
break;
case "resource":
this.$data.resourcesStore.changeId(t, e);
break;
default:
throw new Error("Invalid mode of the dataProcessor after database id is received: " + this._dp._ganttMode + ", new id: " + e)
}
}
,
t._row_style = function(e, n) {
"task" === this._dp._ganttMode && t.isTaskExists(e) && (t.getTask(e).$dataprocessor_class = n,
t.refreshTask(e))
}
,
t._delete_task = function(t, e) {}
,
t._sendTaskOrder = function(t, e) {
e.$drop_target && (this._dp.setGanttMode("task"),
this.getTask(t).target = e.$drop_target,
this._dp.setUpdated(t, !0, "order"),
delete this.getTask(t).$drop_target)
}
,
t.setDp = function() {
this._dp = e
}
,
t.setDp()
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(2)
, r = function() {
function t(t, e) {
this.$gantt = t,
this.$dp = e,
this._dataProcessorHandlers = []
}
return t.prototype.attach = function() {
var t = this
, e = this.$dp
, i = this.$gantt
, r = n(45)
, a = {}
, o = function(n) {
return t.clientSideDelete(n, e, i)
};
this._dataProcessorHandlers.push(i.attachEvent("onAfterTaskAdd", function(t, n) {
i.isTaskExists(t) && (e.setGanttMode("tasks"),
e.setUpdated(t, !0, "inserted"))
})),
this._dataProcessorHandlers.push(i.attachEvent("onAfterTaskUpdate", function(t, n) {
i.isTaskExists(t) && (e.setGanttMode("tasks"),
e.setUpdated(t, !0),
i._sendTaskOrder && i._sendTaskOrder(t, n))
})),
this._dataProcessorHandlers.push(i.attachEvent("onBeforeTaskDelete", function(t, n) {
return i.config.cascade_delete && (a[t] = {
tasks: r.getSubtreeTasks(i, t),
links: r.getSubtreeLinks(i, t)
}),
!e.deleteAfterConfirmation || (e.setGanttMode("tasks"),
e.setUpdated(t, !0, "deleted"),
!1)
})),
this._dataProcessorHandlers.push(i.attachEvent("onAfterTaskDelete", function(t, n) {
e.setGanttMode("tasks");
var r = !o(t)
, s = i.config.cascade_delete && a[t];
if (r || s) {
if (s) {
var l = e.updateMode;
e.setUpdateMode("off");
var c = a[t];
for (var u in c.tasks)
o(u) || (e.storeItem(c.tasks[u]),
e.setUpdated(u, !0, "deleted"));
for (var u in e.setGanttMode("links"),
c.links)
o(u) || (e.storeItem(c.links[u]),
e.setUpdated(u, !0, "deleted"));
a[t] = null,
"off" !== l && e.sendAllData(),
e.setGanttMode("tasks"),
e.setUpdateMode(l)
}
r && (e.storeItem(n),
e.deleteAfterConfirmation || e.setUpdated(t, !0, "deleted")),
"off" === e.updateMode || e._tSend || e.sendAllData()
}
})),
this._dataProcessorHandlers.push(i.attachEvent("onAfterLinkUpdate", function(t, n) {
i.isLinkExists(t) && (e.setGanttMode("links"),
e.setUpdated(t, !0))
})),
this._dataProcessorHandlers.push(i.attachEvent("onAfterLinkAdd", function(t, n) {
i.isLinkExists(t) && (e.setGanttMode("links"),
e.setUpdated(t, !0, "inserted"))
})),
this._dataProcessorHandlers.push(i.attachEvent("onAfterLinkDelete", function(t, n) {
e.setGanttMode("links"),
!o(t) && (e.storeItem(n),
e.setUpdated(t, !0, "deleted"))
})),
this._dataProcessorHandlers.push(i.attachEvent("onRowDragEnd", function(t, e) {
i._sendTaskOrder(t, i.getTask(t))
}));
var s = null
, l = null;
this._dataProcessorHandlers.push(i.attachEvent("onTaskIdChange", function(t, n) {
if (e._waitMode) {
var r = i.getChildren(n);
if (r.length) {
s = s || {};
for (var a = 0; a < r.length; a++) {
var o = this.getTask(r[a]);
s[o.id] = o
}
}
var c = function(t) {
var e = [];
return t.$source && (e = e.concat(t.$source)),
t.$target && (e = e.concat(t.$target)),
e
}(this.getTask(n));
if (c.length) {
l = l || {};
for (a = 0; a < c.length; a++) {
var u = this.getLink(c[a]);
l[u.id] = u
}
}
}
})),
e.attachEvent("onAfterUpdateFinish", function() {
(s || l) && (i.batchUpdate(function() {
for (var t in s)
i.updateTask(s[t].id);
for (var t in l)
i.updateLink(l[t].id);
s = null,
l = null
}),
s ? i._dp.setGanttMode("tasks") : i._dp.setGanttMode("links"))
}),
e.attachEvent("onBeforeDataSending", function() {
if ("CUSTOM" === this._tMode)
return !0;
var t = this._serverProcessor;
if ("REST-JSON" === this._tMode || "REST" === this._tMode) {
var e = this._ganttMode;
t = t.substring(0, t.indexOf("?") > -1 ? t.indexOf("?") : t.length),
this.serverProcessor = t + ("/" === t.slice(-1) ? "" : "/") + e
} else {
var n = this._ganttMode + "s";
this.serverProcessor = t + i.ajax.urlSeparator(t) + "gantt_mode=" + n
}
return !0
}),
e.attachEvent("insertCallback", function(t, e, n, r) {
var a = t.data || i.xml._xmlNodeToJSON(t.firstChild)
, o = {
add: i.addTask,
isExist: i.isTaskExists
};
"links" === r && (o.add = i.addLink,
o.isExist = i.isLinkExists),
o.isExist.call(i, e) || (a.id = e,
o.add.call(i, a))
}),
e.attachEvent("updateCallback", function(t, e) {
var n = t.data || i.xml._xmlNodeToJSON(t.firstChild);
if (i.isTaskExists(e)) {
var r = i.getTask(e);
for (var a in n) {
var o = n[a];
switch (a) {
case "id":
continue;
case "start_date":
case "end_date":
o = i.defined(i.templates.xml_date) ? i.templates.xml_date(o) : i.templates.parse_date(o);
break;
case "duration":
r.end_date = i.calculateEndDate({
start_date: r.start_date,
duration: o,
task: r
})
}
r[a] = o
}
i.updateTask(e),
i.refreshData()
}
}),
e.attachEvent("deleteCallback", function(t, e, n, r) {
var a = {
delete: i.deleteTask,
isExist: i.isTaskExists
};
"links" === r ? (a.delete = i.deleteLink,
a.isExist = i.isLinkExists) : "assignment" === r && (a.delete = function(t) {
i.$data.assignmentsStore.remove(t)
}
,
a.isExist = function(t) {
return i.$data.assignmentsStore.exists(t)
}
),
a.isExist.call(i, e) && a.delete.call(i, e)
}),
this.handleResourceCRUD(e, i),
this.handleResourceAssignmentCRUD(e, i)
}
,
t.prototype.clientSideDelete = function(t, e, n) {
var i = e.updatedRows.slice()
, r = !1;
"true_deleted" === n.getUserData(t, "!nativeeditor_status", e._ganttMode) && (r = !0,
e.setUpdated(t, !1));
for (var a = 0; a < i.length && !e._in_progress[t]; a++)
i[a] === t && ("inserted" === n.getUserData(t, "!nativeeditor_status", e._ganttMode) && (r = !0),
e.setUpdated(t, !1));
return r
}
,
t.prototype.handleResourceAssignmentCRUD = function(t, e) {
var n = this;
if (e.config.resources && !0 === e.config.resources.dataprocessor_assignments) {
var i = e.getDatastore(e.config.resource_assignment_store)
, r = {}
, a = {};
e.attachEvent("onBeforeTaskAdd", function(t, e) {
return r[t] = !0,
!0
}),
e.attachEvent("onTaskIdChange", function(t, e) {
delete r[t]
}),
i.attachEvent("onAfterAdd", function(t, e) {
r[e.task_id] ? function(t) {
a[t.id] = t,
r[t.task_id] = !0
}(e) : o(e)
}),
i.attachEvent("onAfterUpdate", function(e, n) {
i.exists(e) && (a[e] ? o(n) : (t.setGanttMode("assignment"),
t.setUpdated(e, !0)))
}),
i.attachEvent("onAfterDelete", function(i, r) {
t.setGanttMode("assignment"),
!n.clientSideDelete(i, t, e) && (t.storeItem(r),
t.setUpdated(i, !0, "deleted"))
})
}
function o(e) {
var n = e.id;
i.exists(n) && (t.setGanttMode("assignment"),
t.setUpdated(n, !0, "inserted")),
delete a[n]
}
}
,
t.prototype.handleResourceCRUD = function(t, e) {
var n = this;
if (e.config.resources && !0 === e.config.resources.dataprocessor_resources) {
var i = e.getDatastore(e.config.resource_store);
i.attachEvent("onAfterAdd", function(e, n) {
!function(e) {
var n = e.id;
i.exists(n) && (t.setGanttMode("resource"),
t.setUpdated(n, !0, "inserted"))
}(n)
}),
i.attachEvent("onAfterUpdate", function(e, n) {
i.exists(e) && (t.setGanttMode("resource"),
t.setUpdated(e, !0))
}),
i.attachEvent("onAfterDelete", function(i, r) {
t.setGanttMode("resource"),
!n.clientSideDelete(i, t, e) && (t.storeItem(r),
t.setUpdated(i, !0, "deleted"))
})
}
}
,
t.prototype.detach = function() {
var t = this;
i.forEach(this._dataProcessorHandlers, function(e) {
t.$gantt.detachEvent(e)
}),
this._dataProcessorHandlers = []
}
,
t
}();
e.default = r
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(5)
, r = n(2)
, a = n(0)
, o = n(224)
, s = n(223)
, l = n(222);
e.createDataProcessor = function(t) {
var e, n;
t instanceof Function ? e = t : t.hasOwnProperty("router") ? e = t.router : (t.hasOwnProperty("assignment") || t.hasOwnProperty("link") || t.hasOwnProperty("task")) && (e = t),
n = e ? "CUSTOM" : t.mode || "REST-JSON";
var i = new c(t.url);
return i.init(this),
i.setTransactionMode({
mode: n,
router: e
}, t.batchUpdate),
t.deleteAfterConfirmation && (i.deleteAfterConfirmation = t.deleteAfterConfirmation),
i
}
;
var c = function() {
function t(t) {
this.serverProcessor = t,
this.action_param = "!nativeeditor_status",
this.updatedRows = [],
this.autoUpdate = !0,
this.updateMode = "cell",
this._headers = null,
this._payload = null,
this._postDelim = "_",
this._routerParametersFormat = "parameters",
this._waitMode = 0,
this._in_progress = {},
this._storage = l.default.create(),
this._invalid = {},
this.messages = [],
this.styles = {
updated: "font-weight:bold;",
inserted: "font-weight:bold;",
deleted: "text-decoration : line-through;",
invalid: "background-color:FFE0E0;",
invalid_cell: "border-bottom:2px solid red;",
error: "color:red;",
clear: "font-weight:normal;text-decoration:none;"
},
this.enableUTFencoding(!0),
i(this)
}
return t.prototype.setTransactionMode = function(t, e) {
"object" == typeof t ? (this._tMode = t.mode || this._tMode,
a.defined(t.headers) && (this._headers = t.headers),
a.defined(t.payload) && (this._payload = t.payload),
this._tSend = !!e) : (this._tMode = t,
this._tSend = e),
"REST" === this._tMode && (this._tSend = !1),
"JSON" === this._tMode || "REST-JSON" === this._tMode ? (this._tSend = !1,
this._serializeAsJson = !0,
this._headers = this._headers || {},
this._headers["Content-Type"] = "application/json") : this._headers && !this._headers["Content-Type"] && (this._headers["Content-Type"] = "application/x-www-form-urlencoded"),
"CUSTOM" === this._tMode && (this._tSend = !1,
this._router = t.router)
}
,
t.prototype.escape = function(t) {
return this._utf ? encodeURIComponent(t) : escape(t)
}
,
t.prototype.enableUTFencoding = function(t) {
this._utf = !!t
}
,
t.prototype.getSyncState = function() {
return !this.updatedRows.length
}
,
t.prototype.setUpdateMode = function(t, e) {
this.autoUpdate = "cell" === t,
this.updateMode = t,
this.dnd = e
}
,
t.prototype.ignore = function(t, e) {
this._silent_mode = !0,
t.call(e || window),
this._silent_mode = !1
}
,
t.prototype.setUpdated = function(t, e, n) {
if (!this._silent_mode) {
var i = this.findRow(t);
n = n || "updated";
var r = this.$gantt.getUserData(t, this.action_param, this._ganttMode);
r && "updated" === n && (n = r),
e ? (this.set_invalid(t, !1),
this.updatedRows[i] = t,
this.$gantt.setUserData(t, this.action_param, n, this._ganttMode),
this._in_progress[t] && (this._in_progress[t] = "wait")) : this.is_invalid(t) || (this.updatedRows.splice(i, 1),
this.$gantt.setUserData(t, this.action_param, "", this._ganttMode)),
this.markRow(t, e, n),
e && this.autoUpdate && this.sendData(t)
}
}
,
t.prototype.markRow = function(t, e, n) {
var i = ""
, r = this.is_invalid(t);
if (r && (i = this.styles[r],
e = !0),
this.callEvent("onRowMark", [t, e, n, r]) && (i = this.styles[e ? n : "clear"] + " " + i,
this.$gantt[this._methods[0]](t, i),
r && r.details)) {
i += this.styles[r + "_cell"];
for (var a = 0; a < r.details.length; a++)
r.details[a] && this.$gantt[this._methods[1]](t, a, i)
}
}
,
t.prototype.getActionByState = function(t) {
return "inserted" === t ? "create" : "updated" === t ? "update" : "deleted" === t ? "delete" : "update"
}
,
t.prototype.getState = function(t) {
return this.$gantt.getUserData(t, this.action_param, this._ganttMode)
}
,
t.prototype.is_invalid = function(t) {
return this._invalid[t]
}
,
t.prototype.set_invalid = function(t, e, n) {
n && (e = {
value: e,
details: n,
toString: function() {
return this.value.toString()
}
}),
this._invalid[t] = e
}
,
t.prototype.checkBeforeUpdate = function(t) {
return !0
}
,
t.prototype.sendData = function(t) {
var e = this;
if (this.$gantt.editStop && this.$gantt.editStop(),
void 0 === t || this._tSend) {
var n = [];
if (this.modes) {
["task", "link", "assignment"].forEach(function(t) {
e.modes[t] && e.modes[t].updatedRows.length && n.push(t)
})
}
if (n.length) {
for (var i = 0; i < n.length; i++)
this.setGanttMode(n[i]),
this.sendAllData();
return
}
return this.sendAllData()
}
return !this._in_progress[t] && (this.messages = [],
!(!this.checkBeforeUpdate(t) && this.callEvent("onValidationError", [t, this.messages])) && void this._beforeSendData(this._getRowData(t), t))
}
,
t.prototype.serialize = function(t, e) {
if (this._serializeAsJson)
return this._serializeAsJSON(t);
if ("string" == typeof t)
return t;
if (void 0 !== e)
return this.serialize_one(t, "");
var n = []
, i = [];
for (var r in t)
t.hasOwnProperty(r) && (n.push(this.serialize_one(t[r], r + this._postDelim)),
i.push(r));
return n.push("ids=" + this.escape(i.join(","))),
this.$gantt.security_key && n.push("dhx_security=" + this.$gantt.security_key),
n.join("&")
}
,
t.prototype.serialize_one = function(t, e) {
if ("string" == typeof t)
return t;
var n = []
, i = "";
for (var r in t)
if (t.hasOwnProperty(r)) {
if (("id" === r || r == this.action_param) && "REST" === this._tMode)
continue;
i = "string" == typeof t[r] || "number" == typeof t[r] ? t[r] : JSON.stringify(t[r]),
n.push(this.escape((e || "") + r) + "=" + this.escape(i))
}
return n.join("&")
}
,
t.prototype.sendAllData = function() {
if (this.updatedRows.length) {
this.messages = [];
var t = !0;
if (this._forEachUpdatedRow(function(e) {
t = t && this.checkBeforeUpdate(e)
}),
!t && !this.callEvent("onValidationError", ["", this.messages]))
return !1;
this._tSend ? this._sendData(this._getAllData()) : this._forEachUpdatedRow(function(t) {
if (!this._in_progress[t]) {
if (this.is_invalid(t))
return;
this._beforeSendData(this._getRowData(t), t)
}
})
}
}
,
t.prototype.findRow = function(t) {
var e = 0;
for (e = 0; e < this.updatedRows.length && t != this.updatedRows[e]; e++)
;
return e
}
,
t.prototype.defineAction = function(t, e) {
this._uActions || (this._uActions = {}),
this._uActions[t] = e
}
,
t.prototype.afterUpdateCallback = function(t, e, n, i, r) {
var a = this;
if (this.$gantt) {
this.setGanttMode(r);
var o = t
, s = "error" !== n && "invalid" !== n;
if (s || this.set_invalid(t, n),
this._uActions && this._uActions[n] && !this._uActions[n](i))
return delete this._in_progress[o];
"wait" !== this._in_progress[o] && this.setUpdated(t, !1);
var l = t;
switch (n) {
case "inserted":
case "insert":
e != t && (this.setUpdated(t, !1),
this.$gantt[this._methods[2]](t, e),
t = e);
break;
case "delete":
case "deleted":
if (this.deleteAfterConfirmation && "task" === this._ganttMode) {
if ("task" === this._ganttMode && this.$gantt.isTaskExists(t)) {
this.$gantt.setUserData(t, this.action_param, "true_deleted", this._ganttMode);
var c = this.$gantt.getTask(t);
this.$gantt.silent(function() {
a.$gantt.deleteTask(t)
}),
this.$gantt.callEvent("onAfterTaskDelete", [t, c]),
this.$gantt.render(),
delete this._in_progress[o]
}
return this.callEvent("onAfterUpdate", [t, n, e, i])
}
return this.$gantt.setUserData(t, this.action_param, "true_deleted", this._ganttMode),
this.$gantt[this._methods[3]](t),
delete this._in_progress[o],
this.callEvent("onAfterUpdate", [t, n, e, i])
}
"wait" !== this._in_progress[o] ? (s && this.$gantt.setUserData(t, this.action_param, "", this._ganttMode),
delete this._in_progress[o]) : (delete this._in_progress[o],
this.setUpdated(e, !0, this.$gantt.getUserData(t, this.action_param, this._ganttMode))),
this.callEvent("onAfterUpdate", [l, n, e, i])
}
}
,
t.prototype.afterUpdate = function(t, e, n) {
var i, r = this;
i = 3 === arguments.length ? arguments[1] : arguments[4];
var a = this.getGanttMode()
, o = i.filePath || i.url;
a = "REST" !== this._tMode && "REST-JSON" !== this._tMode ? -1 !== o.indexOf("gantt_mode=links") ? "link" : -1 !== o.indexOf("gantt_mode=assignments") ? "assignment" : "task" : o.indexOf("/link") >= 0 ? "link" : o.indexOf("/assignment") >= 0 ? "assignment" : "task",
this.setGanttMode(a);
var s, l = this.$gantt.ajax;
try {
s = JSON.parse(e.xmlDoc.responseText)
} catch (t) {
e.xmlDoc.responseText.length || (s = {})
}
var c = function(e) {
var n = s.action || r.getState(e) || "updated"
, i = s.sid || e[0]
, o = s.tid || e[0];
t.afterUpdateCallback(i, o, n, s, a)
};
if (s)
return Array.isArray(n) && n.length > 1 ? n.forEach(function(t) {
return c(t)
}) : c(n),
t.finalizeUpdate(),
void this.setGanttMode(a);
var u = l.xmltop("data", e.xmlDoc);
if (!u)
return this.cleanUpdate(n);
var d = l.xpath("//data/action", u);
if (!d.length)
return this.cleanUpdate(n);
for (var h = 0; h < d.length; h++) {
var f = d[h]
, _ = f.getAttribute("type")
, g = f.getAttribute("sid")
, p = f.getAttribute("tid");
t.afterUpdateCallback(g, p, _, f, a)
}
t.finalizeUpdate()
}
,
t.prototype.cleanUpdate = function(t) {
if (t)
for (var e = 0; e < t.length; e++)
delete this._in_progress[t[e]]
}
,
t.prototype.finalizeUpdate = function() {
this._waitMode && this._waitMode--,
this.callEvent("onAfterUpdateFinish", []),
this.updatedRows.length || this.callEvent("onFullSync", [])
}
,
t.prototype.init = function(t) {
if (!this._initialized) {
this.$gantt = t,
this.$gantt._dp_init && this.$gantt._dp_init(this),
this._setDefaultTransactionMode(),
this.styles = {
updated: "gantt_updated",
order: "gantt_updated",
inserted: "gantt_inserted",
deleted: "gantt_deleted",
delete_confirmation: "gantt_deleted",
invalid: "gantt_invalid",
error: "gantt_error",
clear: ""
},
this._methods = ["_row_style", "setCellTextStyle", "_change_id", "_delete_task"],
s.default(this.$gantt, this);
var e = new o.default(this.$gantt,this);
e.attach(),
this.attachEvent("onDestroy", function() {
delete this.setGanttMode,
delete this._getRowData,
delete this.$gantt._dp,
delete this.$gantt._change_id,
delete this.$gantt._row_style,
delete this.$gantt._delete_task,
delete this.$gantt._sendTaskOrder,
delete this.$gantt,
e.detach()
}),
this.$gantt.callEvent("onDataProcessorReady", [this]),
this._initialized = !0
}
}
,
t.prototype.setOnAfterUpdate = function(t) {
this.attachEvent("onAfterUpdate", t)
}
,
t.prototype.setOnBeforeUpdateHandler = function(t) {
this.attachEvent("onBeforeDataSending", t)
}
,
t.prototype.setAutoUpdate = function(t, e) {
var n = this;
t = t || 2e3,
this._user = e || (new Date).valueOf(),
this._needUpdate = !1,
this._updateBusy = !1,
this.attachEvent("onAfterUpdate", this.afterAutoUpdate),
this.attachEvent("onFullSync", this.fullSync),
setInterval(function() {
n.loadUpdate()
}, t)
}
,
t.prototype.afterAutoUpdate = function(t, e, n, i) {
return "collision" !== e || (this._needUpdate = !0,
!1)
}
,
t.prototype.fullSync = function() {
return this._needUpdate && (this._needUpdate = !1,
this.loadUpdate()),
!0
}
,
t.prototype.getUpdates = function(t, e) {
var n = this.$gantt.ajax;
if (this._updateBusy)
return !1;
this._updateBusy = !0,
n.get(t, e)
}
,
t.prototype.loadUpdate = function() {
var t = this
, e = this.$gantt.ajax
, n = this.$gantt.getUserData(0, "version", this._ganttMode)
, i = this.serverProcessor + e.urlSeparator(this.serverProcessor) + ["dhx_user=" + this._user, "dhx_version=" + n].join("&");
i = i.replace("editing=true&", ""),
this.getUpdates(i, function(n) {
var i = e.xpath("//userdata", n);
t.$gantt.setUserData(0, "version", t._getXmlNodeValue(i[0]), t._ganttMode);
var r = e.xpath("//update", n);
if (r.length) {
t._silent_mode = !0;
for (var a = 0; a < r.length; a++) {
var o = r[a].getAttribute("status")
, s = r[a].getAttribute("id")
, l = r[a].getAttribute("parent");
switch (o) {
case "inserted":
t.callEvent("insertCallback", [r[a], s, l]);
break;
case "updated":
t.callEvent("updateCallback", [r[a], s, l]);
break;
case "deleted":
t.callEvent("deleteCallback", [r[a], s, l])
}
}
t._silent_mode = !1
}
t._updateBusy = !1
})
}
,
t.prototype.destructor = function() {
this.callEvent("onDestroy", []),
this.detachAllEvents(),
this.updatedRows = [],
this._in_progress = {},
this._invalid = {},
this._storage.clear(),
this._storage = null,
this._headers = null,
this._payload = null,
delete this._initialized
}
,
t.prototype.setGanttMode = function(t) {
"tasks" === t ? t = "task" : "links" === t && (t = "link");
var e = this.modes || {}
, n = this.getGanttMode();
n && (e[n] = {
_in_progress: this._in_progress,
_invalid: this._invalid,
_storage: this._storage,
updatedRows: this.updatedRows
});
var i = e[t];
i || (i = e[t] = {
_in_progress: {},
_invalid: {},
_storage: l.default.create(),
updatedRows: []
}),
this._in_progress = i._in_progress,
this._invalid = i._invalid,
this._storage = i._storage,
this.updatedRows = i.updatedRows,
this.modes = e,
this._ganttMode = t
}
,
t.prototype.getGanttMode = function() {
return this._ganttMode
}
,
t.prototype.storeItem = function(t) {
this._storage.storeItem(t)
}
,
t.prototype.url = function(t) {
this.serverProcessor = this._serverProcessor = t
}
,
t.prototype._beforeSendData = function(t, e) {
if (!this.callEvent("onBeforeUpdate", [e, this.getState(e), t]))
return !1;
this._sendData(t, e)
}
,
t.prototype._serializeAsJSON = function(t) {
if ("string" == typeof t)
return t;
var e = a.copy(t);
return "REST-JSON" === this._tMode && (delete e.id,
delete e[this.action_param]),
JSON.stringify(e)
}
,
t.prototype._applyPayload = function(t) {
var e = this.$gantt.ajax;
if (this._payload)
for (var n in this._payload)
t = t + e.urlSeparator(t) + this.escape(n) + "=" + this.escape(this._payload[n]);
return t
}
,
t.prototype._cleanupArgumentsBeforeSend = function(t) {
var e;
if (void 0 === t[this.action_param])
for (var n in e = {},
t)
e[n] = this._cleanupArgumentsBeforeSend(t[n]);
else
e = this._cleanupItemBeforeSend(t);
return e
}
,
t.prototype._cleanupItemBeforeSend = function(t) {
var e = null;
return t && ("deleted" === t[this.action_param] ? ((e = {}).id = t.id,
e[this.action_param] = t[this.action_param]) : e = t),
e
}
,
t.prototype._sendData = function(t, e) {
var n = this;
if (t) {
if (!this.callEvent("onBeforeDataSending", e ? [e, this.getState(e), t] : [null, null, t]))
return !1;
e && (this._in_progress[e] = (new Date).valueOf());
var i = this.$gantt.ajax;
if ("CUSTOM" !== this._tMode) {
var r;
r = {
callback: function(i) {
var r = [];
if (e)
r.push(e);
else if (t)
for (var a in t)
r.push(a);
return n.afterUpdate(n, i, r)
},
headers: this._headers
};
var a, o = "dhx_version=" + this.$gantt.getUserData(0, "version", this._ganttMode), s = this.serverProcessor + (this._user ? i.urlSeparator(this.serverProcessor) + ["dhx_user=" + this._user, o].join("&") : ""), l = this._applyPayload(s);
switch (this._tMode) {
case "GET":
a = this._cleanupArgumentsBeforeSend(t),
r.url = l + i.urlSeparator(l) + this.serialize(a, e),
r.method = "GET";
break;
case "POST":
a = this._cleanupArgumentsBeforeSend(t),
r.url = l,
r.method = "POST",
r.data = this.serialize(a, e);
break;
case "JSON":
a = {};
var c = this._cleanupItemBeforeSend(t);
for (var u in c)
u !== this.action_param && "id" !== u && "gr_id" !== u && (a[u] = c[u]);
r.url = l,
r.method = "POST",
r.data = JSON.stringify({
id: e,
action: t[this.action_param],
data: a
});
break;
case "REST":
case "REST-JSON":
switch (l = s.replace(/(&|\?)editing=true/, ""),
a = "",
this.getState(e)) {
case "inserted":
r.method = "POST",
r.data = this.serialize(t, e);
break;
case "deleted":
r.method = "DELETE",
l = l + ("/" === l.slice(-1) ? "" : "/") + e;
break;
default:
r.method = "PUT",
r.data = this.serialize(t, e),
l = l + ("/" === l.slice(-1) ? "" : "/") + e
}
r.url = this._applyPayload(l)
}
return this._waitMode++,
i.query(r)
}
var d = this.getState(e)
, h = this.getActionByState(d)
, f = this.getGanttMode()
, _ = function(t) {
var i = d || "updated"
, r = e
, a = e;
t && (i = t.action || d,
r = t.sid || r,
a = t.id || t.tid || a),
n.afterUpdateCallback(r, a, i, t, f)
}
, g = void 0;
if (this._router instanceof Function)
if ("object" === this._routerParametersFormat) {
var p = {
entity: f,
action: h,
data: t,
id: e
};
g = this._router(p)
} else
g = this._router(f, h, t, e);
else if (this._router[f]instanceof Function)
g = this._router[f](h, t, e);
else {
var v = "Incorrect configuration of gantt.createDataProcessor"
, m = "\nYou need to either add missing properties to the dataProcessor router object or to use a router function.\nSee https://docs.dhtmlx.com/gantt/desktop__server_side.html#customrouting and https://docs.dhtmlx.com/gantt/api__gantt_createdataprocessor.html for details.";
if (!this._router[f])
throw new Error(v + ": router for the **" + f + "** entity is not defined. " + m);
switch (d) {
case "inserted":
if (!this._router[f].create)
throw new Error(v + ": **create** action for the **" + f + "** entity is not defined. " + m);
g = this._router[f].create(t);
break;
case "deleted":
if (!this._router[f].delete)
throw new Error(v + ": **delete** action for the **" + f + "** entity is not defined. " + m);
g = this._router[f].delete(e);
break;
default:
if (!this._router[f].update)
throw new Error(v + ': **update**" action for the **' + f + "** entity is not defined. " + m);
g = this._router[f].update(t, e)
}
}
if (g) {
if (!g.then && void 0 === g.id && void 0 === g.tid && void 0 === g.action)
throw new Error("Incorrect router return value. A Promise or a response object is expected");
g.then ? g.then(_).catch(function(t) {
t && t.action ? _(t) : _({
action: "error",
value: t
})
}) : _(g)
} else
_(null)
}
}
,
t.prototype._forEachUpdatedRow = function(t) {
for (var e = this.updatedRows.slice(), n = 0; n < e.length; n++) {
var i = e[n];
this.$gantt.getUserData(i, this.action_param, this._ganttMode) && t.call(this, i)
}
}
,
t.prototype._setDefaultTransactionMode = function() {
this.serverProcessor && (this.setTransactionMode("POST", !0),
this.serverProcessor += (-1 !== this.serverProcessor.indexOf("?") ? "&" : "?") + "editing=true",
this._serverProcessor = this.serverProcessor)
}
,
t.prototype._getXmlNodeValue = function(t) {
return t.firstChild ? t.firstChild.nodeValue : ""
}
,
t.prototype._getAllData = function() {
var t = {}
, e = !1;
return this._forEachUpdatedRow(function(n) {
if (!this._in_progress[n] && !this.is_invalid(n)) {
var i = this._getRowData(n);
this.callEvent("onBeforeUpdate", [n, this.getState(n), i]) && (t[n] = i,
e = !0,
this._in_progress[n] = (new Date).valueOf())
}
}),
e ? t : null
}
,
t.prototype._prepareDate = function(t) {
return this.$gantt.defined(this.$gantt.templates.xml_format) ? this.$gantt.templates.xml_format(t) : this.$gantt.templates.format_date(t)
}
,
t.prototype._prepareArray = function(t, e) {
var n = this;
return e.push(t),
t.map(function(t) {
return r.isDate(t) ? n._prepareDate(t) : Array.isArray(t) && !r.arrayIncludes(e, t) ? n._prepareArray(t, e) : t && "object" == typeof t && !r.arrayIncludes(e, t) ? n._prepareObject(t, e) : t
})
}
,
t.prototype._prepareObject = function(t, e) {
var n = {};
for (var i in e.push(t),
t)
if ("$" !== i.substr(0, 1)) {
var a = t[i];
r.isDate(a) ? n[i] = this._prepareDate(a) : null === a ? n[i] = "" : Array.isArray(a) && !r.arrayIncludes(e, a) ? n[i] = this._prepareArray(a, e) : a && "object" == typeof a && !r.arrayIncludes(e, a) ? n[i] = this._prepareObject(a, e) : n[i] = a
}
return n
}
,
t.prototype._prepareDataItem = function(t) {
var e = this._prepareObject(t, []);
return e[this.action_param] = this.$gantt.getUserData(t.id, this.action_param, this._ganttMode),
e
}
,
t.prototype.getStoredItem = function(t) {
return this._storage.getStoredItem(t)
}
,
t.prototype._getRowData = function(t) {
var e, n = this.$gantt;
return "task" === this.getGanttMode() ? n.isTaskExists(t) && (e = this.$gantt.getTask(t)) : "assignment" === this.getGanttMode() ? this.$gantt.$data.assignmentsStore.exists(t) && (e = this.$gantt.$data.assignmentsStore.getItem(t)) : n.isLinkExists(t) && (e = this.$gantt.getLink(t)),
e || (e = this.getStoredItem(t)),
e || (e = {
id: t
}),
this._prepareDataItem(e)
}
,
t
}();
e.DataProcessor = c
}
, function(t, e, n) {
var i = n(225);
t.exports = {
DEPRECATED_api: function(t) {
return new i.DataProcessor(t)
},
createDataProcessor: i.createDataProcessor,
getDataProcessorModes: i.getAvailableModes
}
}
, function(t, e, n) {
var i = n(15);
t.exports = {
bindDataStore: function(t, e) {
var n = e.getDatastore(t)
, r = function(t, e) {
var i = e.getLayers()
, r = n.getItem(t);
if (r && n.isVisible(t))
for (var a = 0; a < i.length; a++)
i[a].render_item(r)
}
, a = function(t) {
for (var e = t.getLayers(), i = 0; i < e.length; i++)
e[i].clear();
for (var r = null, a = {}, o = 0; o < e.length; o++) {
var s = e[o]
, l = void 0;
if (s.get_visible_range) {
var c = s.get_visible_range(n);
if (void 0 !== c.start && void 0 !== c.end) {
var u = c.start + " - " + c.end;
a[u] ? l = a[u] : (l = n.getIndexRange(c.start, c.end),
a[u] = l)
} else {
if (void 0 === c.ids)
throw new Error("Invalid range returned from 'getVisibleRange' of the layer");
l = c.ids.map(function(t) {
return n.getItem(t)
})
}
} else
r || (r = n.getVisibleItems()),
l = r;
s.prepare_data && s.prepare_data(l),
e[o].render_items(l)
}
}
, o = function(t) {
if (t.update_items) {
var e;
if (t.get_visible_range) {
var i = t.get_visible_range(n);
if (void 0 !== i.start && void 0 !== i.end)
e = n.getIndexRange(i.start, i.end);
else {
if (void 0 === i.ids)
throw new Error("Invalid range returned from 'getVisibleRange' of the layer");
e = i.ids.map(function(t) {
return n.getItem(t)
})
}
} else
e = n.getVisibleItems();
t.prepare_data && t.prepare_data(e, t),
t.update_items(e)
}
};
function s(t) {
return !!t.$services.getService("state").getState("batchUpdate").batch_update
}
n.attachEvent("onStoreUpdated", function(n, r, a) {
if (i(e))
return !0;
var s = e.$services.getService("layers").getDataRender(t);
s && (s.onUpdateRequest = function(t) {
o(t)
}
)
}),
n.attachEvent("onStoreUpdated", function(t, i, r) {
s(e) || (t && "move" != r && "delete" != r ? (n.callEvent("onBeforeRefreshItem", [i.id]),
n.callEvent("onAfterRefreshItem", [i.id])) : (n.callEvent("onBeforeRefreshAll", []),
n.callEvent("onAfterRefreshAll", [])))
}),
n.attachEvent("onAfterRefreshAll", function() {
if (i(e))
return !0;
var n = e.$services.getService("layers").getDataRender(t);
n && !s(e) && a(n)
}),
n.attachEvent("onAfterRefreshItem", function(n) {
if (i(e))
return !0;
var a = e.$services.getService("layers").getDataRender(t);
a && r(n, a)
}),
n.attachEvent("onItemOpen", function() {
if (i(e))
return !0;
e.render()
}),
n.attachEvent("onItemClose", function() {
if (i(e))
return !0;
e.render()
}),
n.attachEvent("onIdChange", function(a, o) {
if (i(e))
return !0;
if (n.callEvent("onBeforeIdChange", [a, o]),
!s(e) && !n.isSilent()) {
var l = e.$services.getService("layers").getDataRender(t);
l ? (function(t, e, n, i) {
for (var r = 0; r < t.length; r++)
t[r].change_id(e, n)
}(l.getLayers(), a, o, n.getItem(o)),
r(o, l)) : e.render()
}
})
}
}
}
, function(t, e) {
t.exports = function(t) {
var e = null
, n = t._removeItemInner;
function i(t) {
e = null,
this.callEvent("onAfterUnselect", [t])
}
return t._removeItemInner = function(t) {
return e == t && i.call(this, t),
e && this.eachItem && this.eachItem(function(t) {
t.id == e && i.call(this, t.id)
}, t),
n.apply(this, arguments)
}
,
t.attachEvent("onIdChange", function(e, n) {
t.getSelectedId() == e && t.silent(function() {
t.unselect(e),
t.select(n)
})
}),
{
select: function(t) {
if (t) {
if (e == t)
return e;
if (!this._skip_refresh && !this.callEvent("onBeforeSelect", [t]))
return !1;
this.unselect(),
e = t,
this._skip_refresh || (this.refresh(t),
this.callEvent("onAfterSelect", [t]))
}
return e
},
getSelectedId: function() {
return e
},
isSelected: function(t) {
return t == e
},
unselect: function(t) {
(t = t || e) && (e = null,
this._skip_refresh || (this.refresh(t),
i.call(this, t)))
}
}
}
}
, function(t, e, n) {
var i = n(0);
t.exports = function() {
return {
getLinkCount: function() {
return this.$data.linksStore.count()
},
getLink: function(t) {
return this.$data.linksStore.getItem(t)
},
getLinks: function() {
return this.$data.linksStore.getItems()
},
isLinkExists: function(t) {
return this.$data.linksStore.exists(t)
},
addLink: function(t) {
var e = this.$data.linksStore.addItem(t);
return this.$data.linksStore.isSilent() && this.$data.linksStore.fullOrder.push(e),
e
},
updateLink: function(t, e) {
i.defined(e) || (e = this.getLink(t)),
this.$data.linksStore.updateItem(t, e)
},
deleteLink: function(t) {
return this.$data.linksStore.removeItem(t)
},
changeLinkId: function(t, e) {
return this.$data.linksStore.changeId(t, e)
}
}
}
}
, function(t, e, n) {
var i = n(0)
, r = n(2).replaceValidZeroId;
t.exports = function() {
return {
getTask: function(t) {
t = r(t, this.config.root_id),
this.assert(t, "Invalid argument for gantt.getTask");
var e = this.$data.tasksStore.getItem(t);
return this.assert(e, "Task not found id=" + t),
e
},
getTaskByTime: function(t, e) {
var n = this.$data.tasksStore.getItems()
, i = [];
if (t || e) {
t = +t || -1 / 0,
e = +e || 1 / 0;
for (var r = 0; r < n.length; r++) {
var a = n[r];
+a.start_date < e && +a.end_date > t && i.push(a)
}
} else
i = n;
return i
},
isTaskExists: function(t) {
return !(!this.$data || !this.$data.tasksStore) && this.$data.tasksStore.exists(t)
},
updateTask: function(t, e) {
i.defined(e) || (e = this.getTask(t)),
this.$data.tasksStore.updateItem(t, e),
this.isTaskExists(t) && this.refreshTask(t)
},
addTask: function(t, e, n) {
return i.defined(t.id) || (t.id = i.uid()),
this.isTaskExists(t.id) && this.getTask(t.id).$index != t.$index ? (t.start_date && "string" == typeof t.start_date && (t.start_date = this.date.parseDate(t.start_date, "parse_date")),
t.end_date && "string" == typeof t.end_date && (t.end_date = this.date.parseDate(t.end_date, "parse_date")),
this.$data.tasksStore.updateItem(t.id, t)) : (i.defined(e) || (e = this.getParent(t) || 0),
this.isTaskExists(e) || (e = this.config.root_id),
this.setParent(t, e),
this.$data.tasksStore.addItem(t, n, e))
},
deleteTask: function(t) {
return t = r(t, this.config.root_id),
this.$data.tasksStore.removeItem(t)
},
getTaskCount: function() {
return this.$data.tasksStore.count()
},
getVisibleTaskCount: function() {
return this.$data.tasksStore.countVisible()
},
getTaskIndex: function(t) {
return this.$data.tasksStore.getBranchIndex(t)
},
getGlobalTaskIndex: function(t) {
return t = r(t, this.config.root_id),
this.assert(t, "Invalid argument"),
this.$data.tasksStore.getIndexById(t)
},
eachTask: function(t, e, n) {
return this.$data.tasksStore.eachItem(i.bind(t, n || this), e)
},
eachParent: function(t, e, n) {
return this.$data.tasksStore.eachParent(i.bind(t, n || this), e)
},
changeTaskId: function(t, e) {
this.$data.tasksStore.changeId(t, e);
var n = this.$data.tasksStore.getItem(e)
, i = [];
n.$source && (i = i.concat(n.$source)),
n.$target && (i = i.concat(n.$target));
for (var r = 0; r < i.length; r++) {
var a = this.getLink(i[r]);
a.source == t && (a.source = e),
a.target == t && (a.target = e)
}
},
calculateTaskLevel: function(t) {
return this.$data.tasksStore.calculateItemLevel(t)
},
getNext: function(t) {
return this.$data.tasksStore.getNext(t)
},
getPrev: function(t) {
return this.$data.tasksStore.getPrev(t)
},
getParent: function(t) {
return this.$data.tasksStore.getParent(t)
},
setParent: function(t, e, n) {
return this.$data.tasksStore.setParent(t, e, n)
},
getSiblings: function(t) {
return this.$data.tasksStore.getSiblings(t).slice()
},
getNextSibling: function(t) {
return this.$data.tasksStore.getNextSibling(t)
},
getPrevSibling: function(t) {
return this.$data.tasksStore.getPrevSibling(t)
},
getTaskByIndex: function(t) {
var e = this.$data.tasksStore.getIdByIndex(t);
return this.isTaskExists(e) ? this.getTask(e) : null
},
getChildren: function(t) {
return this.hasChild(t) ? this.$data.tasksStore.getChildren(t).slice() : []
},
hasChild: function(t) {
return this.$data.tasksStore.hasChild(t)
},
open: function(t) {
this.$data.tasksStore.open(t)
},
close: function(t) {
this.$data.tasksStore.close(t)
},
moveTask: function(t, e, n) {
return n = r(n, this.config.root_id),
this.$data.tasksStore.move.apply(this.$data.tasksStore, arguments)
},
sort: function(t, e, n, i) {
var r = !i;
this.$data.tasksStore.sort(t, e, n),
this.callEvent("onAfterSort", [t, e, n]),
r && this.render()
}
}
}
}
, function(t, e, n) {
var i = n(0)
, r = n(230)
, a = n(229)
, o = n(49)
, s = n(47)
, l = n(228)
, c = n(227)
, u = n(15)
, d = n(2).replaceValidZeroId;
function h() {
for (var t = this.$services.getService("datastores"), e = [], n = 0; n < t.length; n++) {
var i = this.getDatastore(t[n]);
i.$destroyed || e.push(i)
}
return e
}
o.default && (o = o.default);
var f = function() {
return {
createDatastore: function(t) {
var e = "treedatastore" == (t.type || "").toLowerCase() ? s : o;
if (t) {
var n = this;
t.openInitially = function() {
return n.config.open_tree_initially
}
,
t.copyOnParse = function() {
return n.config.deepcopy_on_parse
}
}
var i = new e(t);
if (this.mixin(i, l(i)),
t.name) {
var r = "datastore:" + t.name;
i.attachEvent("onDestroy", function() {
this.$services.dropService(r);
for (var e = this.$services.getService("datastores"), n = 0; n < e.length; n++)
if (e[n] === t.name) {
e.splice(n, 1);
break
}
}
.bind(this)),
this.$services.dropService(r),
this.$services.setService(r, function() {
return i
});
var a = this.$services.getService("datastores");
a ? a.indexOf(t.name) < 0 && a.push(t.name) : (a = [],
this.$services.setService("datastores", function() {
return a
}),
a.push(t.name)),
c.bindDataStore(t.name, this)
}
return i
},
getDatastore: function(t) {
return this.$services.getService("datastore:" + t)
},
_getDatastores: h,
refreshData: function() {
var t;
u(this) || (t = this.getScrollState()),
this.callEvent("onBeforeDataRender", []);
for (var e = h.call(this), n = 0; n < e.length; n++)
e[n].refresh();
this.config.preserve_scroll && !u(this) && (t.x || t.y) && this.scrollTo(t.x, t.y),
this.callEvent("onDataRender", [])
},
isChildOf: function(t, e) {
return this.$data.tasksStore.isChildOf(t, e)
},
refreshTask: function(t, e) {
var n = this.getTask(t)
, i = this;
function r() {
if (void 0 === e || e) {
for (var t = 0; t < n.$source.length; t++)
i.refreshLink(n.$source[t]);
for (t = 0; t < n.$target.length; t++)
i.refreshLink(n.$target[t])
}
}
if (n && this.isTaskVisible(t))
this.$data.tasksStore.refresh(t, !!this.getState("tasksDnd").drag_id || !1 === e),
r();
else if (this.isTaskExists(t) && this.isTaskExists(this.getParent(t)) && !this._bulk_dnd) {
this.refreshTask(this.getParent(t));
var a = !1;
this.eachParent(function(t) {
(a || this.isSplitTask(t)) && (a = !0)
}, t),
a && r()
}
},
refreshLink: function(t) {
this.$data.linksStore.refresh(t, !!this.getState("tasksDnd").drag_id)
},
silent: function(t) {
var e = this;
e.$data.tasksStore.silent(function() {
e.$data.linksStore.silent(function() {
t()
})
})
},
clearAll: function() {
for (var t = h.call(this), e = 0; e < t.length; e++)
t[e].silent(function() {
t[e].clearAll()
});
for (e = 0; e < t.length; e++)
t[e].clearAll();
this._update_flags(),
this.userdata = {},
this.callEvent("onClear", []),
this.render()
},
_clear_data: function() {
this.$data.tasksStore.clearAll(),
this.$data.linksStore.clearAll(),
this._update_flags(),
this.userdata = {}
},
selectTask: function(t) {
var e = this.$data.tasksStore;
if (!this.config.select_task)
return !1;
if (t = d(t, this.config.root_id)) {
var n = this.getSelectedId();
e._skipResourceRepaint = !0,
e.select(t),
e._skipResourceRepaint = !1,
n && e.pull[n].$split_subtask && n != t && this.refreshTask(n),
e.pull[t].$split_subtask && n != t && this.refreshTask(t)
}
return e.getSelectedId()
},
unselectTask: function(t) {
var e = this.$data.tasksStore;
e.unselect(t),
t && e.pull[t].$split_subtask && this.refreshTask(t)
},
isSelectedTask: function(t) {
return this.$data.tasksStore.isSelected(t)
},
getSelectedId: function() {
return this.$data.tasksStore.getSelectedId()
}
}
};
t.exports = {
create: function() {
var t = i.mixin({}, f());
return i.mixin(t, r()),
i.mixin(t, a()),
t
}
}
}
, function(t, e, n) {
var i = n(0)
, r = n(231)
, a = n(46)
, o = n(16);
t.exports = function(t) {
var e = r.create();
i.mixin(t, e);
var s = t.createDatastore({
name: "task",
type: "treeDatastore",
rootId: function() {
return t.config.root_id
},
initItem: i.bind(function(e) {
this.defined(e.id) || (e.id = this.uid()),
e.start_date && (e.start_date = t.date.parseDate(e.start_date, "parse_date")),
e.end_date && (e.end_date = t.date.parseDate(e.end_date, "parse_date"));
var n = null;
(e.duration || 0 === e.duration) && (e.duration = n = 1 * e.duration),
n && (e.start_date && !e.end_date ? e.end_date = this.calculateEndDate(e) : !e.start_date && e.end_date && (e.start_date = this.calculateEndDate({
start_date: e.end_date,
duration: -e.duration,
task: e
}))),
e.progress = Number(e.progress) || 0,
this._isAllowedUnscheduledTask(e) && this._set_default_task_timing(e),
this._init_task_timing(e),
e.start_date && e.end_date && this.correctTaskWorkTime(e),
e.$source = [],
e.$target = [];
var r = this.$data.tasksStore.getItem(e.id);
return r && !i.defined(e.open) && (e.$open = r.$open),
void 0 === e.parent && (e.parent = this.config.root_id),
e
}, t),
getConfig: function() {
return t.config
}
})
, l = t.createDatastore({
name: "link",
initItem: i.bind(function(t) {
return this.defined(t.id) || (t.id = this.uid()),
t
}, t)
});
function c(e) {
var n = t.isTaskVisible(e);
if (!n && t.isTaskExists(e)) {
var i = t.getParent(e);
t.isTaskExists(i) && t.isTaskVisible(i) && (i = t.getTask(i),
t.isSplitTask(i) && (n = !0))
}
return n
}
function u(e) {
if (t.isTaskExists(e.source)) {
var n = t.getTask(e.source);
n.$source = n.$source || [],
n.$source.push(e.id)
}
if (t.isTaskExists(e.target)) {
var i = t.getTask(e.target);
i.$target = i.$target || [],
i.$target.push(e.id)
}
}
function d(e) {
if (t.isTaskExists(e.source))
for (var n = t.getTask(e.source), i = 0; i < n.$source.length; i++)
if (n.$source[i] == e.id) {
n.$source.splice(i, 1);
break
}
if (t.isTaskExists(e.target)) {
var r = t.getTask(e.target);
for (i = 0; i < r.$target.length; i++)
if (r.$target[i] == e.id) {
r.$target.splice(i, 1);
break
}
}
}
function h() {
for (var e = null, n = t.$data.tasksStore.getItems(), i = 0, r = n.length; i < r; i++)
(e = n[i]).$source = [],
e.$target = [];
var a = t.$data.linksStore.getItems();
for (i = 0,
r = a.length; i < r; i++)
u(a[i])
}
function f(t) {
var e = t.source
, n = t.target;
for (var i in t.events)
!function(t, i) {
e.attachEvent(t, function() {
return n.callEvent(i, Array.prototype.slice.call(arguments))
}, i)
}(i, t.events[i])
}
t.attachEvent("onDestroy", function() {
s.destructor(),
l.destructor()
}),
t.attachEvent("onLinkValidation", function(e) {
if (t.isLinkExists(e.id) || "predecessor_generated" === e.id)
return !0;
for (var n = t.getTask(e.source).$source, i = 0; i < n.length; i++) {
var r = t.getLink(n[i])
, a = e.source == r.source
, o = e.target == r.target
, s = e.type == r.type;
if (a && o && s)
return !1
}
return !0
}),
s.attachEvent("onBeforeRefreshAll", function() {
if (!s._skipTaskRecalculation)
for (var e = s.getVisibleItems(), n = 0; n < e.length; n++) {
var i = e[n];
i.$index = n,
i.$local_index = t.getTaskIndex(i.id),
t.resetProjectDates(i)
}
}),
s.attachEvent("onFilterItem", function(e, n) {
if (t.config.show_tasks_outside_timescale)
return !0;
var i = null
, r = null;
if (t.config.start_date && t.config.end_date) {
if (t._isAllowedUnscheduledTask(n))
return !0;
if (i = t.config.start_date.valueOf(),
r = t.config.end_date.valueOf(),
+n.start_date > r || +n.end_date < +i)
return !1
}
return !0
}),
s.attachEvent("onIdChange", function(e, n) {
t._update_flags(e, n);
var i = t.getTask(n);
s.isSilent() || (i.$split_subtask || i.rollup) && t.eachParent(function(e) {
t.refreshTask(e.id)
}, n)
}),
s.attachEvent("onAfterUpdate", function(e) {
if (t._update_parents(e),
t.getState("batchUpdate").batch_update)
return !0;
var n = s.getItem(e);
n.$source || (n.$source = []);
for (var i = 0; i < n.$source.length; i++)
l.refresh(n.$source[i]);
for (n.$target || (n.$target = []),
i = 0; i < n.$target.length; i++)
l.refresh(n.$target[i])
}),
s.attachEvent("onBeforeItemMove", function(e, n, i) {
return !o(e, t, s) || (console.log("The placeholder task cannot be moved to another position."),
!1)
}),
s.attachEvent("onAfterItemMove", function(e, n, i) {
var r = t.getTask(e);
null !== this.getNextSibling(e) ? r.$drop_target = this.getNextSibling(e) : null !== this.getPrevSibling(e) ? r.$drop_target = "next:" + this.getPrevSibling(e) : r.$drop_target = "next:null"
}),
s.attachEvent("onStoreUpdated", function(e, n, i) {
if ("delete" == i && t._update_flags(e, null),
!t.$services.getService("state").getState("batchUpdate").batch_update) {
if (t.config.fit_tasks && "paint" !== i) {
var r = t.getState();
a(t);
var o = t.getState();
if (+r.min_date != +o.min_date || +r.max_date != +o.max_date)
return t.render(),
t.callEvent("onScaleAdjusted", []),
!0
}
"add" == i || "move" == i || "delete" == i ? t.$layout && ("task" != this.$config.name || "add" != i && "delete" != i || "lightbox" != this._skipTaskRecalculation && (this._skipTaskRecalculation = !0),
t.$layout.resize()) : e || l.refresh()
}
}),
l.attachEvent("onAfterAdd", function(t, e) {
u(e)
}),
l.attachEvent("onAfterUpdate", function(t, e) {
h()
}),
l.attachEvent("onAfterDelete", function(t, e) {
d(e)
}),
l.attachEvent("onBeforeIdChange", function(e, n) {
d(t.mixin({
id: e
}, t.$data.linksStore.getItem(n))),
u(t.$data.linksStore.getItem(n))
}),
l.attachEvent("onFilterItem", function(e, n) {
if (!t.config.show_links)
return !1;
var i = c(n.source)
, r = c(n.target);
return !(!i || !r || t._isAllowedUnscheduledTask(t.getTask(n.source)) || t._isAllowedUnscheduledTask(t.getTask(n.target))) && t.callEvent("onBeforeLinkDisplay", [e, n])
}),
function() {
var e = n(45)
, i = {};
t.attachEvent("onBeforeTaskDelete", function(n, r) {
return i[n] = e.getSubtreeLinks(t, n),
!0
}),
t.attachEvent("onAfterTaskDelete", function(e, n) {
i[e] && t.$data.linksStore.silent(function() {
for (var n in i[e])
t.isLinkExists(n) && t.$data.linksStore.removeItem(n),
d(i[e][n]);
i[e] = null
})
})
}(),
t.attachEvent("onAfterLinkDelete", function(e, n) {
t.refreshTask(n.source),
t.refreshTask(n.target)
}),
t.attachEvent("onParse", h),
f({
source: l,
target: t,
events: {
onItemLoading: "onLinkLoading",
onBeforeAdd: "onBeforeLinkAdd",
onAfterAdd: "onAfterLinkAdd",
onBeforeUpdate: "onBeforeLinkUpdate",
onAfterUpdate: "onAfterLinkUpdate",
onBeforeDelete: "onBeforeLinkDelete",
onAfterDelete: "onAfterLinkDelete",
onIdChange: "onLinkIdChange"
}
}),
f({
source: s,
target: t,
events: {
onItemLoading: "onTaskLoading",
onBeforeAdd: "onBeforeTaskAdd",
onAfterAdd: "onAfterTaskAdd",
onBeforeUpdate: "onBeforeTaskUpdate",
onAfterUpdate: "onAfterTaskUpdate",
onBeforeDelete: "onBeforeTaskDelete",
onAfterDelete: "onAfterTaskDelete",
onIdChange: "onTaskIdChange",
onBeforeItemMove: "onBeforeTaskMove",
onAfterItemMove: "onAfterTaskMove",
onFilterItem: "onBeforeTaskDisplay",
onItemOpen: "onTaskOpened",
onItemClose: "onTaskClosed",
onBeforeSelect: "onBeforeTaskSelected",
onAfterSelect: "onTaskSelected",
onAfterUnselect: "onTaskUnselected"
}
}),
t.$data = {
tasksStore: s,
linksStore: l
}
}
}
, function(t, e, n) {
(function(n, i, r) {
var a, o, s;
function l(t) {
"@babel/helpers - typeof";
return (l = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
/* @preserve
* The MIT License (MIT)
*
* Copyright (c) 2013-2018 Petka Antonov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
!function(n) {
"object" == l(e) && void 0 !== t ? t.exports = n() : (o = [],
void 0 === (s = "function" == typeof (a = n) ? a.apply(e, o) : a) || (t.exports = s))
}(function() {
var t, e, a;
return function t(e, n, i) {
function r(o, s) {
if (!n[o]) {
if (!e[o]) {
var l = "function" == typeof _dereq_ && _dereq_;
if (!s && l)
return l(o, !0);
if (a)
return a(o, !0);
var c = new Error("Cannot find module '" + o + "'");
throw c.code = "MODULE_NOT_FOUND",
c
}
var u = n[o] = {
exports: {}
};
e[o][0].call(u.exports, function(t) {
var n = e[o][1][t];
return r(n || t)
}, u, u.exports, t, e, n, i)
}
return n[o].exports
}
for (var a = "function" == typeof _dereq_ && _dereq_, o = 0; o < i.length; o++)
r(i[o]);
return r
}({
1: [function(t, e, n) {
"use strict";
e.exports = function(t) {
var e = t._SomePromiseArray;
function n(t) {
var n = new e(t)
, i = n.promise();
return n.setHowMany(1),
n.setUnwrap(),
n.init(),
i
}
t.any = function(t) {
return n(t)
}
,
t.prototype.any = function() {
return n(this)
}
}
}
, {}],
2: [function(t, e, i) {
"use strict";
var r;
try {
throw new Error
} catch (t) {
r = t
}
var a = t("./schedule")
, o = t("./queue")
, s = t("./util");
function l() {
this._customScheduler = !1,
this._isTickUsed = !1,
this._lateQueue = new o(16),
this._normalQueue = new o(16),
this._haveDrainedQueues = !1,
this._trampolineEnabled = !0;
var t = this;
this.drainQueues = function() {
t._drainQueues()
}
,
this._schedule = a
}
function c(t, e, n) {
this._lateQueue.push(t, e, n),
this._queueTick()
}
function u(t, e, n) {
this._normalQueue.push(t, e, n),
this._queueTick()
}
function d(t) {
this._normalQueue._pushOne(t),
this._queueTick()
}
function h(t) {
for (; t.length() > 0; )
f(t)
}
function f(t) {
var e = t.shift();
if ("function" != typeof e)
e._settlePromises();
else {
var n = t.shift()
, i = t.shift();
e.call(n, i)
}
}
l.prototype.setScheduler = function(t) {
var e = this._schedule;
return this._schedule = t,
this._customScheduler = !0,
e
}
,
l.prototype.hasCustomScheduler = function() {
return this._customScheduler
}
,
l.prototype.enableTrampoline = function() {
this._trampolineEnabled = !0
}
,
l.prototype.disableTrampolineIfNecessary = function() {
s.hasDevTools && (this._trampolineEnabled = !1)
}
,
l.prototype.haveItemsQueued = function() {
return this._isTickUsed || this._haveDrainedQueues
}
,
l.prototype.fatalError = function(t, e) {
e ? (n.stderr.write("Fatal " + (t instanceof Error ? t.stack : t) + "\n"),
n.exit(2)) : this.throwLater(t)
}
,
l.prototype.throwLater = function(t, e) {
if (1 === arguments.length && (e = t,
t = function() {
throw e
}
),
"undefined" != typeof setTimeout)
setTimeout(function() {
t(e)
}, 0);
else
try {
this._schedule(function() {
t(e)
})
} catch (t) {
throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")
}
}
,
s.hasDevTools ? (l.prototype.invokeLater = function(t, e, n) {
this._trampolineEnabled ? c.call(this, t, e, n) : this._schedule(function() {
setTimeout(function() {
t.call(e, n)
}, 100)
})
}
,
l.prototype.invoke = function(t, e, n) {
this._trampolineEnabled ? u.call(this, t, e, n) : this._schedule(function() {
t.call(e, n)
})
}
,
l.prototype.settlePromises = function(t) {
this._trampolineEnabled ? d.call(this, t) : this._schedule(function() {
t._settlePromises()
})
}
) : (l.prototype.invokeLater = c,
l.prototype.invoke = u,
l.prototype.settlePromises = d),
l.prototype._drainQueues = function() {
h(this._normalQueue),
this._reset(),
this._haveDrainedQueues = !0,
h(this._lateQueue)
}
,
l.prototype._queueTick = function() {
this._isTickUsed || (this._isTickUsed = !0,
this._schedule(this.drainQueues))
}
,
l.prototype._reset = function() {
this._isTickUsed = !1
}
,
e.exports = l,
e.exports.firstLineError = r
}
, {
"./queue": 26,
"./schedule": 29,
"./util": 36
}],
3: [function(t, e, n) {
"use strict";
e.exports = function(t, e, n, i) {
var r = !1
, a = function(t, e) {
this._reject(e)
}
, o = function(t, e) {
e.promiseRejectionQueued = !0,
e.bindingPromise._then(a, a, null, this, t)
}
, s = function(t, e) {
0 == (50397184 & this._bitField) && this._resolveCallback(e.target)
}
, l = function(t, e) {
e.promiseRejectionQueued || this._reject(t)
};
t.prototype.bind = function(a) {
r || (r = !0,
t.prototype._propagateFrom = i.propagateFromFunction(),
t.prototype._boundValue = i.boundValueFunction());
var c = n(a)
, u = new t(e);
u._propagateFrom(this, 1);
var d = this._target();
if (u._setBoundTo(c),
c instanceof t) {
var h = {
promiseRejectionQueued: !1,
promise: u,
target: d,
bindingPromise: c
};
d._then(e, o, void 0, u, h),
c._then(s, l, void 0, u, h),
u._setOnCancel(c)
} else
u._resolveCallback(d);
return u
}
,
t.prototype._setBoundTo = function(t) {
void 0 !== t ? (this._bitField = 2097152 | this._bitField,
this._boundTo = t) : this._bitField = -2097153 & this._bitField
}
,
t.prototype._isBound = function() {
return 2097152 == (2097152 & this._bitField)
}
,
t.bind = function(e, n) {
return t.resolve(n).bind(e)
}
}
}
, {}],
4: [function(t, e, n) {
"use strict";
var i;
"undefined" != typeof Promise && (i = Promise);
var r = t("./promise")();
r.noConflict = function() {
try {
Promise === r && (Promise = i)
} catch (t) {}
return r
}
,
e.exports = r
}
, {
"./promise": 22
}],
5: [function(t, e, n) {
"use strict";
var i = Object.create;
if (i) {
var r = i(null)
, a = i(null);
r[" size"] = a[" size"] = 0
}
e.exports = function(e) {
var n = t("./util")
, i = n.canEvaluate;
n.isIdentifier;
function r(t) {
return function(t, i) {
var r;
if (null != t && (r = t[i]),
"function" != typeof r) {
var a = "Object " + n.classString(t) + " has no method '" + n.toString(i) + "'";
throw new e.TypeError(a)
}
return r
}(t, this.pop()).apply(t, this)
}
function a(t) {
return t[this]
}
function o(t) {
var e = +this;
return e < 0 && (e = Math.max(0, e + t.length)),
t[e]
}
e.prototype.call = function(t) {
var e = [].slice.call(arguments, 1);
return e.push(t),
this._then(r, void 0, void 0, e, void 0)
}
,
e.prototype.get = function(t) {
var e;
if ("number" == typeof t)
e = o;
else if (i) {
var n = (void 0)(t);
e = null !== n ? n : a
} else
e = a;
return this._then(e, void 0, void 0, t, void 0)
}
}
}
, {
"./util": 36
}],
6: [function(t, e, n) {
"use strict";
e.exports = function(e, n, i, r) {
var a = t("./util")
, o = a.tryCatch
, s = a.errorObj
, l = e._async;
e.prototype.break = e.prototype.cancel = function() {
if (!r.cancellation())
return this._warn("cancellation is disabled");
for (var t = this, e = t; t._isCancellable(); ) {
if (!t._cancelBy(e)) {
e._isFollowing() ? e._followee().cancel() : e._cancelBranched();
break
}
var n = t._cancellationParent;
if (null == n || !n._isCancellable()) {
t._isFollowing() ? t._followee().cancel() : t._cancelBranched();
break
}
t._isFollowing() && t._followee().cancel(),
t._setWillBeCancelled(),
e = t,
t = n
}
}
,
e.prototype._branchHasCancelled = function() {
this._branchesRemainingToCancel--
}
,
e.prototype._enoughBranchesHaveCancelled = function() {
return void 0 === this._branchesRemainingToCancel || this._branchesRemainingToCancel <= 0
}
,
e.prototype._cancelBy = function(t) {
return t === this ? (this._branchesRemainingToCancel = 0,
this._invokeOnCancel(),
!0) : (this._branchHasCancelled(),
!!this._enoughBranchesHaveCancelled() && (this._invokeOnCancel(),
!0))
}
,
e.prototype._cancelBranched = function() {
this._enoughBranchesHaveCancelled() && this._cancel()
}
,
e.prototype._cancel = function() {
this._isCancellable() && (this._setCancelled(),
l.invoke(this._cancelPromises, this, void 0))
}
,
e.prototype._cancelPromises = function() {
this._length() > 0 && this._settlePromises()
}
,
e.prototype._unsetOnCancel = function() {
this._onCancelField = void 0
}
,
e.prototype._isCancellable = function() {
return this.isPending() && !this._isCancelled()
}
,
e.prototype.isCancellable = function() {
return this.isPending() && !this.isCancelled()
}
,
e.prototype._doInvokeOnCancel = function(t, e) {
if (a.isArray(t))
for (var n = 0; n < t.length; ++n)
this._doInvokeOnCancel(t[n], e);
else if (void 0 !== t)
if ("function" == typeof t) {
if (!e) {
var i = o(t).call(this._boundValue());
i === s && (this._attachExtraTrace(i.e),
l.throwLater(i.e))
}
} else
t._resultCancelled(this)
}
,
e.prototype._invokeOnCancel = function() {
var t = this._onCancel();
this._unsetOnCancel(),
l.invoke(this._doInvokeOnCancel, this, t)
}
,
e.prototype._invokeInternalOnCancel = function() {
this._isCancellable() && (this._doInvokeOnCancel(this._onCancel(), !0),
this._unsetOnCancel())
}
,
e.prototype._resultCancelled = function() {
this.cancel()
}
}
}
, {
"./util": 36
}],
7: [function(t, e, n) {
"use strict";
e.exports = function(e) {
var n = t("./util")
, i = t("./es5").keys
, r = n.tryCatch
, a = n.errorObj;
return function(t, o, s) {
return function(l) {
var c = s._boundValue();
t: for (var u = 0; u < t.length; ++u) {
var d = t[u];
if (d === Error || null != d && d.prototype instanceof Error) {
if (l instanceof d)
return r(o).call(c, l)
} else if ("function" == typeof d) {
var h = r(d).call(c, l);
if (h === a)
return h;
if (h)
return r(o).call(c, l)
} else if (n.isObject(l)) {
for (var f = i(d), _ = 0; _ < f.length; ++_) {
var g = f[_];
if (d[g] != l[g])
continue t
}
return r(o).call(c, l)
}
}
return e
}
}
}
}
, {
"./es5": 13,
"./util": 36
}],
8: [function(t, e, n) {
"use strict";
e.exports = function(t) {
var e = !1
, n = [];
function i() {
this._trace = new i.CapturedTrace(r())
}
function r() {
var t = n.length - 1;
if (t >= 0)
return n[t]
}
return t.prototype._promiseCreated = function() {}
,
t.prototype._pushContext = function() {}
,
t.prototype._popContext = function() {
return null
}
,
t._peekContext = t.prototype._peekContext = function() {}
,
i.prototype._pushContext = function() {
void 0 !== this._trace && (this._trace._promiseCreated = null,
n.push(this._trace))
}
,
i.prototype._popContext = function() {
if (void 0 !== this._trace) {
var t = n.pop()
, e = t._promiseCreated;
return t._promiseCreated = null,
e
}
return null
}
,
i.CapturedTrace = null,
i.create = function() {
if (e)
return new i
}
,
i.deactivateLongStackTraces = function() {}
,
i.activateLongStackTraces = function() {
var n = t.prototype._pushContext
, a = t.prototype._popContext
, o = t._peekContext
, s = t.prototype._peekContext
, l = t.prototype._promiseCreated;
i.deactivateLongStackTraces = function() {
t.prototype._pushContext = n,
t.prototype._popContext = a,
t._peekContext = o,
t.prototype._peekContext = s,
t.prototype._promiseCreated = l,
e = !1
}
,
e = !0,
t.prototype._pushContext = i.prototype._pushContext,
t.prototype._popContext = i.prototype._popContext,
t._peekContext = t.prototype._peekContext = r,
t.prototype._promiseCreated = function() {
var t = this._peekContext();
t && null == t._promiseCreated && (t._promiseCreated = this)
}
}
,
i
}
}
, {}],
9: [function(t, e, i) {
"use strict";
e.exports = function(e, i) {
var r, a, o, s = e._getDomain, c = e._async, u = t("./errors").Warning, d = t("./util"), h = t("./es5"), f = d.canAttachTrace, _ = /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/, g = /\((?:timers\.js):\d+:\d+\)/, p = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/, v = null, m = null, y = !1, k = !(0 == d.env("BLUEBIRD_DEBUG")), b = !(0 == d.env("BLUEBIRD_WARNINGS") || !k && !d.env("BLUEBIRD_WARNINGS")), x = !(0 == d.env("BLUEBIRD_LONG_STACK_TRACES") || !k && !d.env("BLUEBIRD_LONG_STACK_TRACES")), w = 0 != d.env("BLUEBIRD_W_FORGOTTEN_RETURN") && (b || !!d.env("BLUEBIRD_W_FORGOTTEN_RETURN"));
e.prototype.suppressUnhandledRejections = function() {
var t = this._target();
t._bitField = -1048577 & t._bitField | 524288
}
,
e.prototype._ensurePossibleRejectionHandled = function() {
if (0 == (524288 & this._bitField)) {
this._setRejectionIsUnhandled();
var t = this;
setTimeout(function() {
t._notifyUnhandledRejection()
}, 1)
}
}
,
e.prototype._notifyUnhandledRejectionIsHandled = function() {
q("rejectionHandled", r, void 0, this)
}
,
e.prototype._setReturnedNonUndefined = function() {
this._bitField = 268435456 | this._bitField
}
,
e.prototype._returnedNonUndefined = function() {
return 0 != (268435456 & this._bitField)
}
,
e.prototype._notifyUnhandledRejection = function() {
if (this._isRejectionUnhandled()) {
var t = this._settledValue();
this._setUnhandledRejectionIsNotified(),
q("unhandledRejection", a, t, this)
}
}
,
e.prototype._setUnhandledRejectionIsNotified = function() {
this._bitField = 262144 | this._bitField
}
,
e.prototype._unsetUnhandledRejectionIsNotified = function() {
this._bitField = -262145 & this._bitField
}
,
e.prototype._isUnhandledRejectionNotified = function() {
return (262144 & this._bitField) > 0
}
,
e.prototype._setRejectionIsUnhandled = function() {
this._bitField = 1048576 | this._bitField
}
,
e.prototype._unsetRejectionIsUnhandled = function() {
this._bitField = -1048577 & this._bitField,
this._isUnhandledRejectionNotified() && (this._unsetUnhandledRejectionIsNotified(),
this._notifyUnhandledRejectionIsHandled())
}
,
e.prototype._isRejectionUnhandled = function() {
return (1048576 & this._bitField) > 0
}
,
e.prototype._warn = function(t, e, n) {
return z(t, e, n || this)
}
,
e.onPossiblyUnhandledRejection = function(t) {
var e = s();
a = "function" == typeof t ? null === e ? t : d.domainBind(e, t) : void 0
}
,
e.onUnhandledRejectionHandled = function(t) {
var e = s();
r = "function" == typeof t ? null === e ? t : d.domainBind(e, t) : void 0
}
;
var S = function() {};
e.longStackTraces = function() {
if (c.haveItemsQueued() && !tt.longStackTraces)
throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");
if (!tt.longStackTraces && Y()) {
var t = e.prototype._captureStackTrace
, n = e.prototype._attachExtraTrace
, r = e.prototype._dereferenceTrace;
tt.longStackTraces = !0,
S = function() {
if (c.haveItemsQueued() && !tt.longStackTraces)
throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");
e.prototype._captureStackTrace = t,
e.prototype._attachExtraTrace = n,
e.prototype._dereferenceTrace = r,
i.deactivateLongStackTraces(),
c.enableTrampoline(),
tt.longStackTraces = !1
}
,
e.prototype._captureStackTrace = H,
e.prototype._attachExtraTrace = F,
e.prototype._dereferenceTrace = B,
i.activateLongStackTraces(),
c.disableTrampolineIfNecessary()
}
}
,
e.hasLongStackTraces = function() {
return tt.longStackTraces && Y()
}
;
var T = function() {
try {
if ("function" == typeof CustomEvent) {
var t = new CustomEvent("CustomEvent");
return d.global.dispatchEvent(t),
function(t, e) {
var n = {
detail: e,
cancelable: !0
};
h.defineProperty(n, "promise", {
value: e.promise
}),
h.defineProperty(n, "reason", {
value: e.reason
});
var i = new CustomEvent(t.toLowerCase(),n);
return !d.global.dispatchEvent(i)
}
}
if ("function" == typeof Event) {
t = new Event("CustomEvent");
return d.global.dispatchEvent(t),
function(t, e) {
var n = new Event(t.toLowerCase(),{
cancelable: !0
});
return n.detail = e,
h.defineProperty(n, "promise", {
value: e.promise
}),
h.defineProperty(n, "reason", {
value: e.reason
}),
!d.global.dispatchEvent(n)
}
}
return (t = document.createEvent("CustomEvent")).initCustomEvent("testingtheevent", !1, !0, {}),
d.global.dispatchEvent(t),
function(t, e) {
var n = document.createEvent("CustomEvent");
return n.initCustomEvent(t.toLowerCase(), !1, !0, e),
!d.global.dispatchEvent(n)
}
} catch (t) {}
return function() {
return !1
}
}()
, $ = d.isNode ? function() {
return n.emit.apply(n, arguments)
}
: d.global ? function(t) {
var e = "on" + t.toLowerCase()
, n = d.global[e];
return !!n && (n.apply(d.global, [].slice.call(arguments, 1)),
!0)
}
: function() {
return !1
}
;
function C(t, e) {
return {
promise: e
}
}
var E = {
promiseCreated: C,
promiseFulfilled: C,
promiseRejected: C,
promiseResolved: C,
promiseCancelled: C,
promiseChained: function(t, e, n) {
return {
promise: e,
child: n
}
},
warning: function(t, e) {
return {
warning: e
}
},
unhandledRejection: function(t, e, n) {
return {
reason: e,
promise: n
}
},
rejectionHandled: C
}
, A = function(t) {
var e = !1;
try {
e = $.apply(null, arguments)
} catch (t) {
c.throwLater(t),
e = !0
}
var n = !1;
try {
n = T(t, E[t].apply(null, arguments))
} catch (t) {
c.throwLater(t),
n = !0
}
return n || e
};
function D() {
return !1
}
function M(t, e, n) {
var i = this;
try {
t(e, n, function(t) {
if ("function" != typeof t)
throw new TypeError("onCancel must be a function, got: " + d.toString(t));
i._attachCancellationCallback(t)
})
} catch (t) {
return t
}
}
function I(t) {
if (!this._isCancellable())
return this;
var e = this._onCancel();
void 0 !== e ? d.isArray(e) ? e.push(t) : this._setOnCancel([e, t]) : this._setOnCancel(t)
}
function P() {
return this._onCancelField
}
function N(t) {
this._onCancelField = t
}
function O() {
this._cancellationParent = void 0,
this._onCancelField = void 0
}
function L(t, e) {
if (0 != (1 & e)) {
this._cancellationParent = t;
var n = t._branchesRemainingToCancel;
void 0 === n && (n = 0),
t._branchesRemainingToCancel = n + 1
}
0 != (2 & e) && t._isBound() && this._setBoundTo(t._boundTo)
}
e.config = function(t) {
if ("longStackTraces"in (t = Object(t)) && (t.longStackTraces ? e.longStackTraces() : !t.longStackTraces && e.hasLongStackTraces() && S()),
"warnings"in t) {
var n = t.warnings;
tt.warnings = !!n,
w = tt.warnings,
d.isObject(n) && "wForgottenReturn"in n && (w = !!n.wForgottenReturn)
}
if ("cancellation"in t && t.cancellation && !tt.cancellation) {
if (c.haveItemsQueued())
throw new Error("cannot enable cancellation after promises are in use");
e.prototype._clearCancellationData = O,
e.prototype._propagateFrom = L,
e.prototype._onCancel = P,
e.prototype._setOnCancel = N,
e.prototype._attachCancellationCallback = I,
e.prototype._execute = M,
R = L,
tt.cancellation = !0
}
return "monitoring"in t && (t.monitoring && !tt.monitoring ? (tt.monitoring = !0,
e.prototype._fireEvent = A) : !t.monitoring && tt.monitoring && (tt.monitoring = !1,
e.prototype._fireEvent = D)),
e
}
,
e.prototype._fireEvent = D,
e.prototype._execute = function(t, e, n) {
try {
t(e, n)
} catch (t) {
return t
}
}
,
e.prototype._onCancel = function() {}
,
e.prototype._setOnCancel = function(t) {}
,
e.prototype._attachCancellationCallback = function(t) {}
,
e.prototype._captureStackTrace = function() {}
,
e.prototype._attachExtraTrace = function() {}
,
e.prototype._dereferenceTrace = function() {}
,
e.prototype._clearCancellationData = function() {}
,
e.prototype._propagateFrom = function(t, e) {}
;
var R = function(t, e) {
0 != (2 & e) && t._isBound() && this._setBoundTo(t._boundTo)
};
function j() {
var t = this._boundTo;
return void 0 !== t && t instanceof e ? t.isFulfilled() ? t.value() : void 0 : t
}
function H() {
this._trace = new Q(this._peekContext())
}
function F(t, e) {
if (f(t)) {
var n = this._trace;
if (void 0 !== n && e && (n = n._parent),
void 0 !== n)
n.attachExtraTrace(t);
else if (!t.__stackCleaned__) {
var i = W(t);
d.notEnumerableProp(t, "stack", i.message + "\n" + i.stack.join("\n")),
d.notEnumerableProp(t, "__stackCleaned__", !0)
}
}
}
function B() {
this._trace = void 0
}
function z(t, n, i) {
if (tt.warnings) {
var r, a = new u(t);
if (n)
i._attachExtraTrace(a);
else if (tt.longStackTraces && (r = e._peekContext()))
r.attachExtraTrace(a);
else {
var o = W(a);
a.stack = o.message + "\n" + o.stack.join("\n")
}
A("warning", a) || V(a, "", !0)
}
}
function U(t) {
for (var e = [], n = 0; n < t.length; ++n) {
var i = t[n]
, r = " (No stack trace)" === i || v.test(i)
, a = r && J(i);
r && !a && (y && " " !== i.charAt(0) && (i = " " + i),
e.push(i))
}
return e
}
function W(t) {
var e = t.stack
, n = t.toString();
return e = "string" == typeof e && e.length > 0 ? function(t) {
for (var e = t.stack.replace(/\s+$/g, "").split("\n"), n = 0; n < e.length; ++n) {
var i = e[n];
if (" (No stack trace)" === i || v.test(i))
break
}
return n > 0 && "SyntaxError" != t.name && (e = e.slice(n)),
e
}(t) : [" (No stack trace)"],
{
message: n,
stack: "SyntaxError" == t.name ? e : U(e)
}
}
function V(t, e, n) {
if ("undefined" != typeof console) {
var i;
if (d.isObject(t)) {
var r = t.stack;
i = e + m(r, t)
} else
i = e + String(t);
"function" == typeof o ? o(i, n) : "function" != typeof console.log && "object" !== l(console.log) || console.log(i)
}
}
function q(t, e, n, i) {
var r = !1;
try {
"function" == typeof e && (r = !0,
"rejectionHandled" === t ? e(i) : e(n, i))
} catch (t) {
c.throwLater(t)
}
"unhandledRejection" === t ? A(t, n, i) || r || V(n, "Unhandled rejection ") : A(t, i)
}
function G(t) {
var e;
if ("function" == typeof t)
e = "[function " + (t.name || "anonymous") + "]";
else {
e = t && "function" == typeof t.toString ? t.toString() : d.toString(t);
if (/\[object [a-zA-Z0-9$_]+\]/.test(e))
try {
e = JSON.stringify(t)
} catch (t) {}
0 === e.length && (e = "(empty array)")
}
return "(<" + function(t) {
if (t.length < 41)
return t;
return t.substr(0, 38) + "..."
}(e) + ">, no stack trace)"
}
function Y() {
return "function" == typeof Z
}
var J = function() {
return !1
}
, X = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;
function K(t) {
var e = t.match(X);
if (e)
return {
fileName: e[1],
line: parseInt(e[2], 10)
}
}
function Q(t) {
this._parent = t,
this._promisesCreated = 0;
var e = this._length = 1 + (void 0 === t ? 0 : t._length);
Z(this, Q),
e > 32 && this.uncycle()
}
d.inherits(Q, Error),
i.CapturedTrace = Q,
Q.prototype.uncycle = function() {
var t = this._length;
if (!(t < 2)) {
for (var e = [], n = {}, i = 0, r = this; void 0 !== r; ++i)
e.push(r),
r = r._parent;
for (i = (t = this._length = i) - 1; i >= 0; --i) {
var a = e[i].stack;
void 0 === n[a] && (n[a] = i)
}
for (i = 0; i < t; ++i) {
var o = n[e[i].stack];
if (void 0 !== o && o !== i) {
o > 0 && (e[o - 1]._parent = void 0,
e[o - 1]._length = 1),
e[i]._parent = void 0,
e[i]._length = 1;
var s = i > 0 ? e[i - 1] : this;
o < t - 1 ? (s._parent = e[o + 1],
s._parent.uncycle(),
s._length = s._parent._length + 1) : (s._parent = void 0,
s._length = 1);
for (var l = s._length + 1, c = i - 2; c >= 0; --c)
e[c]._length = l,
l++;
return
}
}
}
}
,
Q.prototype.attachExtraTrace = function(t) {
if (!t.__stackCleaned__) {
this.uncycle();
for (var e = W(t), n = e.message, i = [e.stack], r = this; void 0 !== r; )
i.push(U(r.stack.split("\n"))),
r = r._parent;
!function(t) {
for (var e = t[0], n = 1; n < t.length; ++n) {
for (var i = t[n], r = e.length - 1, a = e[r], o = -1, s = i.length - 1; s >= 0; --s)
if (i[s] === a) {
o = s;
break
}
for (s = o; s >= 0; --s) {
var l = i[s];
if (e[r] !== l)
break;
e.pop(),
r--
}
e = i
}
}(i),
function(t) {
for (var e = 0; e < t.length; ++e)
(0 === t[e].length || e + 1 < t.length && t[e][0] === t[e + 1][0]) && (t.splice(e, 1),
e--)
}(i),
d.notEnumerableProp(t, "stack", function(t, e) {
for (var n = 0; n < e.length - 1; ++n)
e[n].push("From previous event:"),
e[n] = e[n].join("\n");
return n < e.length && (e[n] = e[n].join("\n")),
t + "\n" + e.join("\n")
}(n, i)),
d.notEnumerableProp(t, "__stackCleaned__", !0)
}
}
;
var Z = function() {
var t = /^\s*at\s*/
, e = function(t, e) {
return "string" == typeof t ? t : void 0 !== e.name && void 0 !== e.message ? e.toString() : G(e)
};
if ("number" == typeof Error.stackTraceLimit && "function" == typeof Error.captureStackTrace) {
Error.stackTraceLimit += 6,
v = t,
m = e;
var n = Error.captureStackTrace;
return J = function(t) {
return _.test(t)
}
,
function(t, e) {
Error.stackTraceLimit += 6,
n(t, e),
Error.stackTraceLimit -= 6
}
}
var i, r = new Error;
if ("string" == typeof r.stack && r.stack.split("\n")[0].indexOf("stackDetection@") >= 0)
return v = /@/,
m = e,
y = !0,
function(t) {
t.stack = (new Error).stack
}
;
try {
throw new Error
} catch (t) {
i = "stack"in t
}
return "stack"in r || !i || "number" != typeof Error.stackTraceLimit ? (m = function(t, e) {
return "string" == typeof t ? t : "object" !== l(e) && "function" != typeof e || void 0 === e.name || void 0 === e.message ? G(e) : e.toString()
}
,
null) : (v = t,
m = e,
function(t) {
Error.stackTraceLimit += 6;
try {
throw new Error
} catch (e) {
t.stack = e.stack
}
Error.stackTraceLimit -= 6
}
)
}();
"undefined" != typeof console && void 0 !== console.warn && (o = function(t) {
console.warn(t)
}
,
d.isNode && n.stderr.isTTY ? o = function(t, e) {
var n = e ? "[33m" : "[31m";
console.warn(n + t + "[0m\n")
}
: d.isNode || "string" != typeof (new Error).stack || (o = function(t, e) {
console.warn("%c" + t, e ? "color: darkorange" : "color: red")
}
));
var tt = {
warnings: b,
longStackTraces: !1,
cancellation: !1,
monitoring: !1
};
return x && e.longStackTraces(),
{
longStackTraces: function() {
return tt.longStackTraces
},
warnings: function() {
return tt.warnings
},
cancellation: function() {
return tt.cancellation
},
monitoring: function() {
return tt.monitoring
},
propagateFromFunction: function() {
return R
},
boundValueFunction: function() {
return j
},
checkForgottenReturns: function(t, e, n, i, r) {
if (void 0 === t && null !== e && w) {
if (void 0 !== r && r._returnedNonUndefined())
return;
if (0 == (65535 & i._bitField))
return;
n && (n += " ");
var a = ""
, o = "";
if (e._trace) {
for (var s = e._trace.stack.split("\n"), l = U(s), c = l.length - 1; c >= 0; --c) {
var u = l[c];
if (!g.test(u)) {
var d = u.match(p);
d && (a = "at " + d[1] + ":" + d[2] + ":" + d[3] + " ");
break
}
}
if (l.length > 0) {
var h = l[0];
for (c = 0; c < s.length; ++c)
if (s[c] === h) {
c > 0 && (o = "\n" + s[c - 1]);
break
}
}
}
var f = "a promise was created in a " + n + "handler " + a + "but was not returned from it, see http://goo.gl/rRqMUw" + o;
i._warn(f, !0, e)
}
},
setBounds: function(t, e) {
if (Y()) {
for (var n, i, r = t.stack.split("\n"), a = e.stack.split("\n"), o = -1, s = -1, l = 0; l < r.length; ++l)
if (c = K(r[l])) {
n = c.fileName,
o = c.line;
break
}
for (l = 0; l < a.length; ++l) {
var c;
if (c = K(a[l])) {
i = c.fileName,
s = c.line;
break
}
}
o < 0 || s < 0 || !n || !i || n !== i || o >= s || (J = function(t) {
if (_.test(t))
return !0;
var e = K(t);
return !!(e && e.fileName === n && o <= e.line && e.line <= s)
}
)
}
},
warn: z,
deprecated: function(t, e) {
var n = t + " is deprecated and will be removed in a future version.";
return e && (n += " Use " + e + " instead."),
z(n)
},
CapturedTrace: Q,
fireDomEvent: T,
fireGlobalEvent: $
}
}
}
, {
"./errors": 12,
"./es5": 13,
"./util": 36
}],
10: [function(t, e, n) {
"use strict";
e.exports = function(t) {
function e() {
return this.value
}
function n() {
throw this.reason
}
t.prototype.return = t.prototype.thenReturn = function(n) {
return n instanceof t && n.suppressUnhandledRejections(),
this._then(e, void 0, void 0, {
value: n
}, void 0)
}
,
t.prototype.throw = t.prototype.thenThrow = function(t) {
return this._then(n, void 0, void 0, {
reason: t
}, void 0)
}
,
t.prototype.catchThrow = function(t) {
if (arguments.length <= 1)
return this._then(void 0, n, void 0, {
reason: t
}, void 0);
var e = arguments[1];
return this.caught(t, function() {
throw e
})
}
,
t.prototype.catchReturn = function(n) {
if (arguments.length <= 1)
return n instanceof t && n.suppressUnhandledRejections(),
this._then(void 0, e, void 0, {
value: n
}, void 0);
var i = arguments[1];
i instanceof t && i.suppressUnhandledRejections();
return this.caught(n, function() {
return i
})
}
}
}
, {}],
11: [function(t, e, n) {
"use strict";
e.exports = function(t, e) {
var n = t.reduce
, i = t.all;
function r() {
return i(this)
}
t.prototype.each = function(t) {
return n(this, t, e, 0)._then(r, void 0, void 0, this, void 0)
}
,
t.prototype.mapSeries = function(t) {
return n(this, t, e, e)
}
,
t.each = function(t, i) {
return n(t, i, e, 0)._then(r, void 0, void 0, t, void 0)
}
,
t.mapSeries = function(t, i) {
return n(t, i, e, e)
}
}
}
, {}],
12: [function(t, e, n) {
"use strict";
var i, r, a = t("./es5"), o = a.freeze, s = t("./util"), l = s.inherits, c = s.notEnumerableProp;
function u(t, e) {
function n(i) {
if (!(this instanceof n))
return new n(i);
c(this, "message", "string" == typeof i ? i : e),
c(this, "name", t),
Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : Error.call(this)
}
return l(n, Error),
n
}
var d = u("Warning", "warning")
, h = u("CancellationError", "cancellation error")
, f = u("TimeoutError", "timeout error")
, _ = u("AggregateError", "aggregate error");
try {
i = TypeError,
r = RangeError
} catch (t) {
i = u("TypeError", "type error"),
r = u("RangeError", "range error")
}
for (var g = "join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "), p = 0; p < g.length; ++p)
"function" == typeof Array.prototype[g[p]] && (_.prototype[g[p]] = Array.prototype[g[p]]);
a.defineProperty(_.prototype, "length", {
value: 0,
configurable: !1,
writable: !0,
enumerable: !0
}),
_.prototype.isOperational = !0;
var v = 0;
function m(t) {
if (!(this instanceof m))
return new m(t);
c(this, "name", "OperationalError"),
c(this, "message", t),
this.cause = t,
this.isOperational = !0,
t instanceof Error ? (c(this, "message", t.message),
c(this, "stack", t.stack)) : Error.captureStackTrace && Error.captureStackTrace(this, this.constructor)
}
_.prototype.toString = function() {
var t = Array(4 * v + 1).join(" ")
, e = "\n" + t + "AggregateError of:\n";
v++,
t = Array(4 * v + 1).join(" ");
for (var n = 0; n < this.length; ++n) {
for (var i = this[n] === this ? "[Circular AggregateError]" : this[n] + "", r = i.split("\n"), a = 0; a < r.length; ++a)
r[a] = t + r[a];
e += (i = r.join("\n")) + "\n"
}
return v--,
e
}
,
l(m, Error);
var y = Error.__BluebirdErrorTypes__;
y || (y = o({
CancellationError: h,
TimeoutError: f,
OperationalError: m,
RejectionError: m,
AggregateError: _
}),
a.defineProperty(Error, "__BluebirdErrorTypes__", {
value: y,
writable: !1,
enumerable: !1,
configurable: !1
})),
e.exports = {
Error: Error,
TypeError: i,
RangeError: r,
CancellationError: y.CancellationError,
OperationalError: y.OperationalError,
TimeoutError: y.TimeoutError,
AggregateError: y.AggregateError,
Warning: d
}
}
, {
"./es5": 13,
"./util": 36
}],
13: [function(t, e, n) {
var i = function() {
"use strict";
return void 0 === this
}();
if (i)
e.exports = {
freeze: Object.freeze,
defineProperty: Object.defineProperty,
getDescriptor: Object.getOwnPropertyDescriptor,
keys: Object.keys,
names: Object.getOwnPropertyNames,
getPrototypeOf: Object.getPrototypeOf,
isArray: Array.isArray,
isES5: i,
propertyIsWritable: function(t, e) {
var n = Object.getOwnPropertyDescriptor(t, e);
return !(n && !n.writable && !n.set)
}
};
else {
var r = {}.hasOwnProperty
, a = {}.toString
, o = {}.constructor.prototype
, s = function(t) {
var e = [];
for (var n in t)
r.call(t, n) && e.push(n);
return e
};
e.exports = {
isArray: function(t) {
try {
return "[object Array]" === a.call(t)
} catch (t) {
return !1
}
},
keys: s,
names: s,
defineProperty: function(t, e, n) {
return t[e] = n.value,
t
},
getDescriptor: function(t, e) {
return {
value: t[e]
}
},
freeze: function(t) {
return t
},
getPrototypeOf: function(t) {
try {
return Object(t).constructor.prototype
} catch (t) {
return o
}
},
isES5: i,
propertyIsWritable: function() {
return !0
}
}
}
}
, {}],
14: [function(t, e, n) {
"use strict";
e.exports = function(t, e) {
var n = t.map;
t.prototype.filter = function(t, i) {
return n(this, t, i, e)
}
,
t.filter = function(t, i, r) {
return n(t, i, r, e)
}
}
}
, {}],
15: [function(t, e, n) {
"use strict";
e.exports = function(e, n, i) {
var r = t("./util")
, a = e.CancellationError
, o = r.errorObj
, s = t("./catch_filter")(i);
function l(t, e, n) {
this.promise = t,
this.type = e,
this.handler = n,
this.called = !1,
this.cancelPromise = null
}
function c(t) {
this.finallyHandler = t
}
function u(t, e) {
return null != t.cancelPromise && (arguments.length > 1 ? t.cancelPromise._reject(e) : t.cancelPromise._cancel(),
t.cancelPromise = null,
!0)
}
function d() {
return f.call(this, this.promise._target()._settledValue())
}
function h(t) {
if (!u(this, t))
return o.e = t,
o
}
function f(t) {
var r = this.promise
, s = this.handler;
if (!this.called) {
this.called = !0;
var l = this.isFinallyHandler() ? s.call(r._boundValue()) : s.call(r._boundValue(), t);
if (l === i)
return l;
if (void 0 !== l) {
r._setReturnedNonUndefined();
var f = n(l, r);
if (f instanceof e) {
if (null != this.cancelPromise) {
if (f._isCancelled()) {
var _ = new a("late cancellation observer");
return r._attachExtraTrace(_),
o.e = _,
o
}
f.isPending() && f._attachCancellationCallback(new c(this))
}
return f._then(d, h, void 0, this, void 0)
}
}
}
return r.isRejected() ? (u(this),
o.e = t,
o) : (u(this),
t)
}
return l.prototype.isFinallyHandler = function() {
return 0 === this.type
}
,
c.prototype._resultCancelled = function() {
u(this.finallyHandler)
}
,
e.prototype._passThrough = function(t, e, n, i) {
return "function" != typeof t ? this.then() : this._then(n, i, void 0, new l(this,e,t), void 0)
}
,
e.prototype.lastly = e.prototype.finally = function(t) {
return this._passThrough(t, 0, f, f)
}
,
e.prototype.tap = function(t) {
return this._passThrough(t, 1, f)
}
,
e.prototype.tapCatch = function(t) {
var n = arguments.length;
if (1 === n)
return this._passThrough(t, 1, void 0, f);
var i, a = new Array(n - 1), o = 0;
for (i = 0; i < n - 1; ++i) {
var l = arguments[i];
if (!r.isObject(l))
return e.reject(new TypeError("tapCatch statement predicate: expecting an object but got " + r.classString(l)));
a[o++] = l
}
a.length = o;
var c = arguments[i];
return this._passThrough(s(a, c, this), 1, void 0, f)
}
,
l
}
}
, {
"./catch_filter": 7,
"./util": 36
}],
16: [function(t, e, n) {
"use strict";
e.exports = function(e, n, i, r, a, o) {
var s = t("./errors").TypeError
, l = t("./util")
, c = l.errorObj
, u = l.tryCatch
, d = [];
function h(t, n, r, a) {
if (o.cancellation()) {
var s = new e(i)
, l = this._finallyPromise = new e(i);
this._promise = s.lastly(function() {
return l
}),
s._captureStackTrace(),
s._setOnCancel(this)
} else {
(this._promise = new e(i))._captureStackTrace()
}
this._stack = a,
this._generatorFunction = t,
this._receiver = n,
this._generator = void 0,
this._yieldHandlers = "function" == typeof r ? [r].concat(d) : d,
this._yieldedPromise = null,
this._cancellationPhase = !1
}
l.inherits(h, a),
h.prototype._isResolved = function() {
return null === this._promise
}
,
h.prototype._cleanup = function() {
this._promise = this._generator = null,
o.cancellation() && null !== this._finallyPromise && (this._finallyPromise._fulfill(),
this._finallyPromise = null)
}
,
h.prototype._promiseCancelled = function() {
if (!this._isResolved()) {
var t;
if (void 0 !== this._generator.return)
this._promise._pushContext(),
t = u(this._generator.return).call(this._generator, void 0),
this._promise._popContext();
else {
var n = new e.CancellationError("generator .return() sentinel");
e.coroutine.returnSentinel = n,
this._promise._attachExtraTrace(n),
this._promise._pushContext(),
t = u(this._generator.throw).call(this._generator, n),
this._promise._popContext()
}
this._cancellationPhase = !0,
this._yieldedPromise = null,
this._continue(t)
}
}
,
h.prototype._promiseFulfilled = function(t) {
this._yieldedPromise = null,
this._promise._pushContext();
var e = u(this._generator.next).call(this._generator, t);
this._promise._popContext(),
this._continue(e)
}
,
h.prototype._promiseRejected = function(t) {
this._yieldedPromise = null,
this._promise._attachExtraTrace(t),
this._promise._pushContext();
var e = u(this._generator.throw).call(this._generator, t);
this._promise._popContext(),
this._continue(e)
}
,
h.prototype._resultCancelled = function() {
if (this._yieldedPromise instanceof e) {
var t = this._yieldedPromise;
this._yieldedPromise = null,
t.cancel()
}
}
,
h.prototype.promise = function() {
return this._promise
}
,
h.prototype._run = function() {
this._generator = this._generatorFunction.call(this._receiver),
this._receiver = this._generatorFunction = void 0,
this._promiseFulfilled(void 0)
}
,
h.prototype._continue = function(t) {
var n = this._promise;
if (t === c)
return this._cleanup(),
this._cancellationPhase ? n.cancel() : n._rejectCallback(t.e, !1);
var i = t.value;
if (!0 === t.done)
return this._cleanup(),
this._cancellationPhase ? n.cancel() : n._resolveCallback(i);
var a = r(i, this._promise);
if (a instanceof e || null !== (a = function(t, n, i) {
for (var a = 0; a < n.length; ++a) {
i._pushContext();
var o = u(n[a])(t);
if (i._popContext(),
o === c) {
i._pushContext();
var s = e.reject(c.e);
return i._popContext(),
s
}
var l = r(o, i);
if (l instanceof e)
return l
}
return null
}(a, this._yieldHandlers, this._promise))) {
var o = (a = a._target())._bitField;
0 == (50397184 & o) ? (this._yieldedPromise = a,
a._proxy(this, null)) : 0 != (33554432 & o) ? e._async.invoke(this._promiseFulfilled, this, a._value()) : 0 != (16777216 & o) ? e._async.invoke(this._promiseRejected, this, a._reason()) : this._promiseCancelled()
} else
this._promiseRejected(new s("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s", String(i)) + "From coroutine:\n" + this._stack.split("\n").slice(1, -7).join("\n")))
}
,
e.coroutine = function(t, e) {
if ("function" != typeof t)
throw new s("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");
var n = Object(e).yieldHandler
, i = h
, r = (new Error).stack;
return function() {
var e = t.apply(this, arguments)
, a = new i(void 0,void 0,n,r)
, o = a.promise();
return a._generator = e,
a._promiseFulfilled(void 0),
o
}
}
,
e.coroutine.addYieldHandler = function(t) {
if ("function" != typeof t)
throw new s("expecting a function but got " + l.classString(t));
d.push(t)
}
,
e.spawn = function(t) {
if (o.deprecated("Promise.spawn()", "Promise.coroutine()"),
"function" != typeof t)
return n("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");
var i = new h(t,this)
, r = i.promise();
return i._run(e.spawn),
r
}
}
}
, {
"./errors": 12,
"./util": 36
}],
17: [function(t, e, n) {
"use strict";
e.exports = function(e, n, i, r, a, o) {
var s = t("./util");
s.canEvaluate,
s.tryCatch,
s.errorObj;
e.join = function() {
var t, e = arguments.length - 1;
e > 0 && "function" == typeof arguments[e] && (t = arguments[e]);
var i = [].slice.call(arguments);
t && i.pop();
var r = new n(i).promise();
return void 0 !== t ? r.spread(t) : r
}
}
}
, {
"./util": 36
}],
18: [function(t, e, n) {
"use strict";
e.exports = function(e, n, i, r, a, o) {
var s = e._getDomain
, c = t("./util")
, u = c.tryCatch
, d = c.errorObj
, h = e._async;
function f(t, e, n, i) {
this.constructor$(t),
this._promise._captureStackTrace();
var r = s();
this._callback = null === r ? e : c.domainBind(r, e),
this._preservedValues = i === a ? new Array(this.length()) : null,
this._limit = n,
this._inFlight = 0,
this._queue = [],
h.invoke(this._asyncInit, this, void 0)
}
function _(t, n, r, a) {
if ("function" != typeof n)
return i("expecting a function but got " + c.classString(n));
var o = 0;
if (void 0 !== r) {
if ("object" !== l(r) || null === r)
return e.reject(new TypeError("options argument must be an object but it is " + c.classString(r)));
if ("number" != typeof r.concurrency)
return e.reject(new TypeError("'concurrency' must be a number but it is " + c.classString(r.concurrency)));
o = r.concurrency
}
return new f(t,n,o = "number" == typeof o && isFinite(o) && o >= 1 ? o : 0,a).promise()
}
c.inherits(f, n),
f.prototype._asyncInit = function() {
this._init$(void 0, -2)
}
,
f.prototype._init = function() {}
,
f.prototype._promiseFulfilled = function(t, n) {
var i = this._values
, a = this.length()
, s = this._preservedValues
, l = this._limit;
if (n < 0) {
if (i[n = -1 * n - 1] = t,
l >= 1 && (this._inFlight--,
this._drainQueue(),
this._isResolved()))
return !0
} else {
if (l >= 1 && this._inFlight >= l)
return i[n] = t,
this._queue.push(n),
!1;
null !== s && (s[n] = t);
var c = this._promise
, h = this._callback
, f = c._boundValue();
c._pushContext();
var _ = u(h).call(f, t, n, a)
, g = c._popContext();
if (o.checkForgottenReturns(_, g, null !== s ? "Promise.filter" : "Promise.map", c),
_ === d)
return this._reject(_.e),
!0;
var p = r(_, this._promise);
if (p instanceof e) {
var v = (p = p._target())._bitField;
if (0 == (50397184 & v))
return l >= 1 && this._inFlight++,
i[n] = p,
p._proxy(this, -1 * (n + 1)),
!1;
if (0 == (33554432 & v))
return 0 != (16777216 & v) ? (this._reject(p._reason()),
!0) : (this._cancel(),
!0);
_ = p._value()
}
i[n] = _
}
return ++this._totalResolved >= a && (null !== s ? this._filter(i, s) : this._resolve(i),
!0)
}
,
f.prototype._drainQueue = function() {
for (var t = this._queue, e = this._limit, n = this._values; t.length > 0 && this._inFlight < e; ) {
if (this._isResolved())
return;
var i = t.pop();
this._promiseFulfilled(n[i], i)
}
}
,
f.prototype._filter = function(t, e) {
for (var n = e.length, i = new Array(n), r = 0, a = 0; a < n; ++a)
t[a] && (i[r++] = e[a]);
i.length = r,
this._resolve(i)
}
,
f.prototype.preservedValues = function() {
return this._preservedValues
}
,
e.prototype.map = function(t, e) {
return _(this, t, e, null)
}
,
e.map = function(t, e, n, i) {
return _(t, e, n, i)
}
}
}
, {
"./util": 36
}],
19: [function(t, e, n) {
"use strict";
e.exports = function(e, n, i, r, a) {
var o = t("./util")
, s = o.tryCatch;
e.method = function(t) {
if ("function" != typeof t)
throw new e.TypeError("expecting a function but got " + o.classString(t));
return function() {
var i = new e(n);
i._captureStackTrace(),
i._pushContext();
var r = s(t).apply(this, arguments)
, o = i._popContext();
return a.checkForgottenReturns(r, o, "Promise.method", i),
i._resolveFromSyncValue(r),
i
}
}
,
e.attempt = e.try = function(t) {
if ("function" != typeof t)
return r("expecting a function but got " + o.classString(t));
var i, l = new e(n);
if (l._captureStackTrace(),
l._pushContext(),
arguments.length > 1) {
a.deprecated("calling Promise.try with more than 1 argument");
var c = arguments[1]
, u = arguments[2];
i = o.isArray(c) ? s(t).apply(u, c) : s(t).call(u, c)
} else
i = s(t)();
var d = l._popContext();
return a.checkForgottenReturns(i, d, "Promise.try", l),
l._resolveFromSyncValue(i),
l
}
,
e.prototype._resolveFromSyncValue = function(t) {
t === o.errorObj ? this._rejectCallback(t.e, !1) : this._resolveCallback(t, !0)
}
}
}
, {
"./util": 36
}],
20: [function(t, e, n) {
"use strict";
var i = t("./util")
, r = i.maybeWrapAsError
, a = t("./errors").OperationalError
, o = t("./es5");
var s = /^(?:name|message|stack|cause)$/;
function l(t) {
var e;
if (function(t) {
return t instanceof Error && o.getPrototypeOf(t) === Error.prototype
}(t)) {
(e = new a(t)).name = t.name,
e.message = t.message,
e.stack = t.stack;
for (var n = o.keys(t), r = 0; r < n.length; ++r) {
var l = n[r];
s.test(l) || (e[l] = t[l])
}
return e
}
return i.markAsOriginatingFromRejection(t),
t
}
e.exports = function(t, e) {
return function(n, i) {
if (null !== t) {
if (n) {
var a = l(r(n));
t._attachExtraTrace(a),
t._reject(a)
} else if (e) {
var o = [].slice.call(arguments, 1);
t._fulfill(o)
} else
t._fulfill(i);
t = null
}
}
}
}
, {
"./errors": 12,
"./es5": 13,
"./util": 36
}],
21: [function(t, e, n) {
"use strict";
e.exports = function(e) {
var n = t("./util")
, i = e._async
, r = n.tryCatch
, a = n.errorObj;
function o(t, e) {
if (!n.isArray(t))
return s.call(this, t, e);
var o = r(e).apply(this._boundValue(), [null].concat(t));
o === a && i.throwLater(o.e)
}
function s(t, e) {
var n = this._boundValue()
, o = void 0 === t ? r(e).call(n, null) : r(e).call(n, null, t);
o === a && i.throwLater(o.e)
}
function l(t, e) {
if (!t) {
var n = new Error(t + "");
n.cause = t,
t = n
}
var o = r(e).call(this._boundValue(), t);
o === a && i.throwLater(o.e)
}
e.prototype.asCallback = e.prototype.nodeify = function(t, e) {
if ("function" == typeof t) {
var n = s;
void 0 !== e && Object(e).spread && (n = o),
this._then(n, l, void 0, this, t)
}
return this
}
}
}
, {
"./util": 36
}],
22: [function(t, e, i) {
"use strict";
e.exports = function() {
var i = function() {
return new _("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")
}
, r = function() {
return new A.PromiseInspection(this._target())
}
, a = function(t) {
return A.reject(new _(t))
};
function o() {}
var s, l = {}, c = t("./util");
s = c.isNode ? function() {
var t = n.domain;
return void 0 === t && (t = null),
t
}
: function() {
return null
}
,
c.notEnumerableProp(A, "_getDomain", s);
var u = t("./es5")
, d = t("./async")
, h = new d;
u.defineProperty(A, "_async", {
value: h
});
var f = t("./errors")
, _ = A.TypeError = f.TypeError;
A.RangeError = f.RangeError;
var g = A.CancellationError = f.CancellationError;
A.TimeoutError = f.TimeoutError,
A.OperationalError = f.OperationalError,
A.RejectionError = f.OperationalError,
A.AggregateError = f.AggregateError;
var p = function() {}
, v = {}
, m = {}
, y = t("./thenables")(A, p)
, k = t("./promise_array")(A, p, y, a, o)
, b = t("./context")(A)
, x = b.create
, w = t("./debuggability")(A, b)
, S = (w.CapturedTrace,
t("./finally")(A, y, m))
, T = t("./catch_filter")(m)
, $ = t("./nodeback")
, C = c.errorObj
, E = c.tryCatch;
function A(t) {
t !== p && function(t, e) {
if (null == t || t.constructor !== A)
throw new _("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n");
if ("function" != typeof e)
throw new _("expecting a function but got " + c.classString(e))
}(this, t),
this._bitField = 0,
this._fulfillmentHandler0 = void 0,
this._rejectionHandler0 = void 0,
this._promise0 = void 0,
this._receiver0 = void 0,
this._resolveFromExecutor(t),
this._promiseCreated(),
this._fireEvent("promiseCreated", this)
}
function D(t) {
this.promise._resolveCallback(t)
}
function M(t) {
this.promise._rejectCallback(t, !1)
}
function I(t) {
var e = new A(p);
e._fulfillmentHandler0 = t,
e._rejectionHandler0 = t,
e._promise0 = t,
e._receiver0 = t
}
return A.prototype.toString = function() {
return "[object Promise]"
}
,
A.prototype.caught = A.prototype.catch = function(t) {
var e = arguments.length;
if (e > 1) {
var n, i = new Array(e - 1), r = 0;
for (n = 0; n < e - 1; ++n) {
var o = arguments[n];
if (!c.isObject(o))
return a("Catch statement predicate: expecting an object but got " + c.classString(o));
i[r++] = o
}
return i.length = r,
t = arguments[n],
this.then(void 0, T(i, t, this))
}
return this.then(void 0, t)
}
,
A.prototype.reflect = function() {
return this._then(r, r, void 0, this, void 0)
}
,
A.prototype.then = function(t, e) {
if (w.warnings() && arguments.length > 0 && "function" != typeof t && "function" != typeof e) {
var n = ".then() only accepts functions but was passed: " + c.classString(t);
arguments.length > 1 && (n += ", " + c.classString(e)),
this._warn(n)
}
return this._then(t, e, void 0, void 0, void 0)
}
,
A.prototype.done = function(t, e) {
this._then(t, e, void 0, void 0, void 0)._setIsFinal()
}
,
A.prototype.spread = function(t) {
return "function" != typeof t ? a("expecting a function but got " + c.classString(t)) : this.all()._then(t, void 0, void 0, v, void 0)
}
,
A.prototype.toJSON = function() {
var t = {
isFulfilled: !1,
isRejected: !1,
fulfillmentValue: void 0,
rejectionReason: void 0
};
return this.isFulfilled() ? (t.fulfillmentValue = this.value(),
t.isFulfilled = !0) : this.isRejected() && (t.rejectionReason = this.reason(),
t.isRejected = !0),
t
}
,
A.prototype.all = function() {
return arguments.length > 0 && this._warn(".all() was passed arguments but it does not take any"),
new k(this).promise()
}
,
A.prototype.error = function(t) {
return this.caught(c.originatesFromRejection, t)
}
,
A.getNewLibraryCopy = e.exports,
A.is = function(t) {
return t instanceof A
}
,
A.fromNode = A.fromCallback = function(t) {
var e = new A(p);
e._captureStackTrace();
var n = arguments.length > 1 && !!Object(arguments[1]).multiArgs
, i = E(t)($(e, n));
return i === C && e._rejectCallback(i.e, !0),
e._isFateSealed() || e._setAsyncGuaranteed(),
e
}
,
A.all = function(t) {
return new k(t).promise()
}
,
A.cast = function(t) {
var e = y(t);
return e instanceof A || ((e = new A(p))._captureStackTrace(),
e._setFulfilled(),
e._rejectionHandler0 = t),
e
}
,
A.resolve = A.fulfilled = A.cast,
A.reject = A.rejected = function(t) {
var e = new A(p);
return e._captureStackTrace(),
e._rejectCallback(t, !0),
e
}
,
A.setScheduler = function(t) {
if ("function" != typeof t)
throw new _("expecting a function but got " + c.classString(t));
return h.setScheduler(t)
}
,
A.prototype._then = function(t, e, n, i, r) {
var a = void 0 !== r
, o = a ? r : new A(p)
, l = this._target()
, u = l._bitField;
a || (o._propagateFrom(this, 3),
o._captureStackTrace(),
void 0 === i && 0 != (2097152 & this._bitField) && (i = 0 != (50397184 & u) ? this._boundValue() : l === this ? void 0 : this._boundTo),
this._fireEvent("promiseChained", this, o));
var d = s();
if (0 != (50397184 & u)) {
var f, _, v = l._settlePromiseCtx;
0 != (33554432 & u) ? (_ = l._rejectionHandler0,
f = t) : 0 != (16777216 & u) ? (_ = l._fulfillmentHandler0,
f = e,
l._unsetRejectionIsUnhandled()) : (v = l._settlePromiseLateCancellationObserver,
_ = new g("late cancellation observer"),
l._attachExtraTrace(_),
f = e),
h.invoke(v, l, {
handler: null === d ? f : "function" == typeof f && c.domainBind(d, f),
promise: o,
receiver: i,
value: _
})
} else
l._addCallbacks(t, e, o, i, d);
return o
}
,
A.prototype._length = function() {
return 65535 & this._bitField
}
,
A.prototype._isFateSealed = function() {
return 0 != (117506048 & this._bitField)
}
,
A.prototype._isFollowing = function() {
return 67108864 == (67108864 & this._bitField)
}
,
A.prototype._setLength = function(t) {
this._bitField = -65536 & this._bitField | 65535 & t
}
,
A.prototype._setFulfilled = function() {
this._bitField = 33554432 | this._bitField,
this._fireEvent("promiseFulfilled", this)
}
,
A.prototype._setRejected = function() {
this._bitField = 16777216 | this._bitField,
this._fireEvent("promiseRejected", this)
}
,
A.prototype._setFollowing = function() {
this._bitField = 67108864 | this._bitField,
this._fireEvent("promiseResolved", this)
}
,
A.prototype._setIsFinal = function() {
this._bitField = 4194304 | this._bitField
}
,
A.prototype._isFinal = function() {
return (4194304 & this._bitField) > 0
}
,
A.prototype._unsetCancelled = function() {
this._bitField = -65537 & this._bitField
}
,
A.prototype._setCancelled = function() {
this._bitField = 65536 | this._bitField,
this._fireEvent("promiseCancelled", this)
}
,
A.prototype._setWillBeCancelled = function() {
this._bitField = 8388608 | this._bitField
}
,
A.prototype._setAsyncGuaranteed = function() {
h.hasCustomScheduler() || (this._bitField = 134217728 | this._bitField)
}
,
A.prototype._receiverAt = function(t) {
var e = 0 === t ? this._receiver0 : this[4 * t - 4 + 3];
if (e !== l)
return void 0 === e && this._isBound() ? this._boundValue() : e
}
,
A.prototype._promiseAt = function(t) {
return this[4 * t - 4 + 2]
}
,
A.prototype._fulfillmentHandlerAt = function(t) {
return this[4 * t - 4 + 0]
}
,
A.prototype._rejectionHandlerAt = function(t) {
return this[4 * t - 4 + 1]
}
,
A.prototype._boundValue = function() {}
,
A.prototype._migrateCallback0 = function(t) {
t._bitField;
var e = t._fulfillmentHandler0
, n = t._rejectionHandler0
, i = t._promise0
, r = t._receiverAt(0);
void 0 === r && (r = l),
this._addCallbacks(e, n, i, r, null)
}
,
A.prototype._migrateCallbackAt = function(t, e) {
var n = t._fulfillmentHandlerAt(e)
, i = t._rejectionHandlerAt(e)
, r = t._promiseAt(e)
, a = t._receiverAt(e);
void 0 === a && (a = l),
this._addCallbacks(n, i, r, a, null)
}
,
A.prototype._addCallbacks = function(t, e, n, i, r) {
var a = this._length();
if (a >= 65531 && (a = 0,
this._setLength(0)),
0 === a)
this._promise0 = n,
this._receiver0 = i,
"function" == typeof t && (this._fulfillmentHandler0 = null === r ? t : c.domainBind(r, t)),
"function" == typeof e && (this._rejectionHandler0 = null === r ? e : c.domainBind(r, e));
else {
var o = 4 * a - 4;
this[o + 2] = n,
this[o + 3] = i,
"function" == typeof t && (this[o + 0] = null === r ? t : c.domainBind(r, t)),
"function" == typeof e && (this[o + 1] = null === r ? e : c.domainBind(r, e))
}
return this._setLength(a + 1),
a
}
,
A.prototype._proxy = function(t, e) {
this._addCallbacks(void 0, void 0, e, t, null)
}
,
A.prototype._resolveCallback = function(t, e) {
if (0 == (117506048 & this._bitField)) {
if (t === this)
return this._rejectCallback(i(), !1);
var n = y(t, this);
if (!(n instanceof A))
return this._fulfill(t);
e && this._propagateFrom(n, 2);
var r = n._target();
if (r !== this) {
var a = r._bitField;
if (0 == (50397184 & a)) {
var o = this._length();
o > 0 && r._migrateCallback0(this);
for (var s = 1; s < o; ++s)
r._migrateCallbackAt(this, s);
this._setFollowing(),
this._setLength(0),
this._setFollowee(r)
} else if (0 != (33554432 & a))
this._fulfill(r._value());
else if (0 != (16777216 & a))
this._reject(r._reason());
else {
var l = new g("late cancellation observer");
r._attachExtraTrace(l),
this._reject(l)
}
} else
this._reject(i())
}
}
,
A.prototype._rejectCallback = function(t, e, n) {
var i = c.ensureErrorObject(t)
, r = i === t;
if (!r && !n && w.warnings()) {
var a = "a promise was rejected with a non-error: " + c.classString(t);
this._warn(a, !0)
}
this._attachExtraTrace(i, !!e && r),
this._reject(t)
}
,
A.prototype._resolveFromExecutor = function(t) {
if (t !== p) {
var e = this;
this._captureStackTrace(),
this._pushContext();
var n = !0
, i = this._execute(t, function(t) {
e._resolveCallback(t)
}, function(t) {
e._rejectCallback(t, n)
});
n = !1,
this._popContext(),
void 0 !== i && e._rejectCallback(i, !0)
}
}
,
A.prototype._settlePromiseFromHandler = function(t, e, n, i) {
var r = i._bitField;
if (0 == (65536 & r)) {
var a;
i._pushContext(),
e === v ? n && "number" == typeof n.length ? a = E(t).apply(this._boundValue(), n) : (a = C).e = new _("cannot .spread() a non-array: " + c.classString(n)) : a = E(t).call(e, n);
var o = i._popContext();
0 == (65536 & (r = i._bitField)) && (a === m ? i._reject(n) : a === C ? i._rejectCallback(a.e, !1) : (w.checkForgottenReturns(a, o, "", i, this),
i._resolveCallback(a)))
}
}
,
A.prototype._target = function() {
for (var t = this; t._isFollowing(); )
t = t._followee();
return t
}
,
A.prototype._followee = function() {
return this._rejectionHandler0
}
,
A.prototype._setFollowee = function(t) {
this._rejectionHandler0 = t
}
,
A.prototype._settlePromise = function(t, e, n, i) {
var a = t instanceof A
, s = this._bitField
, l = 0 != (134217728 & s);
0 != (65536 & s) ? (a && t._invokeInternalOnCancel(),
n instanceof S && n.isFinallyHandler() ? (n.cancelPromise = t,
E(e).call(n, i) === C && t._reject(C.e)) : e === r ? t._fulfill(r.call(n)) : n instanceof o ? n._promiseCancelled(t) : a || t instanceof k ? t._cancel() : n.cancel()) : "function" == typeof e ? a ? (l && t._setAsyncGuaranteed(),
this._settlePromiseFromHandler(e, n, i, t)) : e.call(n, i, t) : n instanceof o ? n._isResolved() || (0 != (33554432 & s) ? n._promiseFulfilled(i, t) : n._promiseRejected(i, t)) : a && (l && t._setAsyncGuaranteed(),
0 != (33554432 & s) ? t._fulfill(i) : t._reject(i))
}
,
A.prototype._settlePromiseLateCancellationObserver = function(t) {
var e = t.handler
, n = t.promise
, i = t.receiver
, r = t.value;
"function" == typeof e ? n instanceof A ? this._settlePromiseFromHandler(e, i, r, n) : e.call(i, r, n) : n instanceof A && n._reject(r)
}
,
A.prototype._settlePromiseCtx = function(t) {
this._settlePromise(t.promise, t.handler, t.receiver, t.value)
}
,
A.prototype._settlePromise0 = function(t, e, n) {
var i = this._promise0
, r = this._receiverAt(0);
this._promise0 = void 0,
this._receiver0 = void 0,
this._settlePromise(i, t, r, e)
}
,
A.prototype._clearCallbackDataAtIndex = function(t) {
var e = 4 * t - 4;
this[e + 2] = this[e + 3] = this[e + 0] = this[e + 1] = void 0
}
,
A.prototype._fulfill = function(t) {
var e = this._bitField;
if (!((117506048 & e) >>> 16)) {
if (t === this) {
var n = i();
return this._attachExtraTrace(n),
this._reject(n)
}
this._setFulfilled(),
this._rejectionHandler0 = t,
(65535 & e) > 0 && (0 != (134217728 & e) ? this._settlePromises() : h.settlePromises(this),
this._dereferenceTrace())
}
}
,
A.prototype._reject = function(t) {
var e = this._bitField;
if (!((117506048 & e) >>> 16)) {
if (this._setRejected(),
this._fulfillmentHandler0 = t,
this._isFinal())
return h.fatalError(t, c.isNode);
(65535 & e) > 0 ? h.settlePromises(this) : this._ensurePossibleRejectionHandled()
}
}
,
A.prototype._fulfillPromises = function(t, e) {
for (var n = 1; n < t; n++) {
var i = this._fulfillmentHandlerAt(n)
, r = this._promiseAt(n)
, a = this._receiverAt(n);
this._clearCallbackDataAtIndex(n),
this._settlePromise(r, i, a, e)
}
}
,
A.prototype._rejectPromises = function(t, e) {
for (var n = 1; n < t; n++) {
var i = this._rejectionHandlerAt(n)
, r = this._promiseAt(n)
, a = this._receiverAt(n);
this._clearCallbackDataAtIndex(n),
this._settlePromise(r, i, a, e)
}
}
,
A.prototype._settlePromises = function() {
var t = this._bitField
, e = 65535 & t;
if (e > 0) {
if (0 != (16842752 & t)) {
var n = this._fulfillmentHandler0;
this._settlePromise0(this._rejectionHandler0, n, t),
this._rejectPromises(e, n)
} else {
var i = this._rejectionHandler0;
this._settlePromise0(this._fulfillmentHandler0, i, t),
this._fulfillPromises(e, i)
}
this._setLength(0)
}
this._clearCancellationData()
}
,
A.prototype._settledValue = function() {
var t = this._bitField;
return 0 != (33554432 & t) ? this._rejectionHandler0 : 0 != (16777216 & t) ? this._fulfillmentHandler0 : void 0
}
,
A.defer = A.pending = function() {
return w.deprecated("Promise.defer", "new Promise"),
{
promise: new A(p),
resolve: D,
reject: M
}
}
,
c.notEnumerableProp(A, "_makeSelfResolutionError", i),
t("./method")(A, p, y, a, w),
t("./bind")(A, p, y, w),
t("./cancel")(A, k, a, w),
t("./direct_resolve")(A),
t("./synchronous_inspection")(A),
t("./join")(A, k, y, p, h, s),
A.Promise = A,
A.version = "3.5.4",
t("./map.js")(A, k, a, y, p, w),
t("./call_get.js")(A),
t("./using.js")(A, a, y, x, p, w),
t("./timers.js")(A, p, w),
t("./generators.js")(A, a, p, y, o, w),
t("./nodeify.js")(A),
t("./promisify.js")(A, p),
t("./props.js")(A, k, y, a),
t("./race.js")(A, p, y, a),
t("./reduce.js")(A, k, a, y, p, w),
t("./settle.js")(A, k, w),
t("./some.js")(A, k, a),
t("./filter.js")(A, p),
t("./each.js")(A, p),
t("./any.js")(A),
c.toFastProperties(A),
c.toFastProperties(A.prototype),
I({
a: 1
}),
I({
b: 2
}),
I({
c: 3
}),
I(1),
I(function() {}),
I(void 0),
I(!1),
I(new A(p)),
w.setBounds(d.firstLineError, c.lastLineError),
A
}
}
, {
"./any.js": 1,
"./async": 2,
"./bind": 3,
"./call_get.js": 5,
"./cancel": 6,
"./catch_filter": 7,
"./context": 8,
"./debuggability": 9,
"./direct_resolve": 10,
"./each.js": 11,
"./errors": 12,
"./es5": 13,
"./filter.js": 14,
"./finally": 15,
"./generators.js": 16,
"./join": 17,
"./map.js": 18,
"./method": 19,
"./nodeback": 20,
"./nodeify.js": 21,
"./promise_array": 23,
"./promisify.js": 24,
"./props.js": 25,
"./race.js": 27,
"./reduce.js": 28,
"./settle.js": 30,
"./some.js": 31,
"./synchronous_inspection": 32,
"./thenables": 33,
"./timers.js": 34,
"./using.js": 35,
"./util": 36
}],
23: [function(t, e, n) {
"use strict";
e.exports = function(e, n, i, r, a) {
var o = t("./util");
o.isArray;
function s(t) {
var i = this._promise = new e(n);
t instanceof e && i._propagateFrom(t, 3),
i._setOnCancel(this),
this._values = t,
this._length = 0,
this._totalResolved = 0,
this._init(void 0, -2)
}
return o.inherits(s, a),
s.prototype.length = function() {
return this._length
}
,
s.prototype.promise = function() {
return this._promise
}
,
s.prototype._init = function t(n, a) {
var s = i(this._values, this._promise);
if (s instanceof e) {
var l = (s = s._target())._bitField;
if (this._values = s,
0 == (50397184 & l))
return this._promise._setAsyncGuaranteed(),
s._then(t, this._reject, void 0, this, a);
if (0 == (33554432 & l))
return 0 != (16777216 & l) ? this._reject(s._reason()) : this._cancel();
s = s._value()
}
if (null !== (s = o.asArray(s)))
0 !== s.length ? this._iterate(s) : -5 === a ? this._resolveEmptyArray() : this._resolve(function(t) {
switch (t) {
case -2:
return [];
case -3:
return {};
case -6:
return new Map
}
}(a));
else {
var c = r("expecting an array or an iterable object but got " + o.classString(s)).reason();
this._promise._rejectCallback(c, !1)
}
}
,
s.prototype._iterate = function(t) {
var n = this.getActualLength(t.length);
this._length = n,
this._values = this.shouldCopyValues() ? new Array(n) : this._values;
for (var r = this._promise, a = !1, o = null, s = 0; s < n; ++s) {
var l = i(t[s], r);
o = l instanceof e ? (l = l._target())._bitField : null,
a ? null !== o && l.suppressUnhandledRejections() : null !== o ? 0 == (50397184 & o) ? (l._proxy(this, s),
this._values[s] = l) : a = 0 != (33554432 & o) ? this._promiseFulfilled(l._value(), s) : 0 != (16777216 & o) ? this._promiseRejected(l._reason(), s) : this._promiseCancelled(s) : a = this._promiseFulfilled(l, s)
}
a || r._setAsyncGuaranteed()
}
,
s.prototype._isResolved = function() {
return null === this._values
}
,
s.prototype._resolve = function(t) {
this._values = null,
this._promise._fulfill(t)
}
,
s.prototype._cancel = function() {
!this._isResolved() && this._promise._isCancellable() && (this._values = null,
this._promise._cancel())
}
,
s.prototype._reject = function(t) {
this._values = null,
this._promise._rejectCallback(t, !1)
}
,
s.prototype._promiseFulfilled = function(t, e) {
return this._values[e] = t,
++this._totalResolved >= this._length && (this._resolve(this._values),
!0)
}
,
s.prototype._promiseCancelled = function() {
return this._cancel(),
!0
}
,
s.prototype._promiseRejected = function(t) {
return this._totalResolved++,
this._reject(t),
!0
}
,
s.prototype._resultCancelled = function() {
if (!this._isResolved()) {
var t = this._values;
if (this._cancel(),
t instanceof e)
t.cancel();
else
for (var n = 0; n < t.length; ++n)
t[n]instanceof e && t[n].cancel()
}
}
,
s.prototype.shouldCopyValues = function() {
return !0
}
,
s.prototype.getActualLength = function(t) {
return t
}
,
s
}
}
, {
"./util": 36
}],
24: [function(t, e, n) {
"use strict";
e.exports = function(e, n) {
var i = {}
, r = t("./util")
, a = t("./nodeback")
, o = r.withAppended
, s = r.maybeWrapAsError
, c = r.canEvaluate
, u = t("./errors").TypeError
, d = {
__isPromisified__: !0
}
, h = new RegExp("^(?:" + ["arity", "length", "name", "arguments", "caller", "callee", "prototype", "__isPromisified__"].join("|") + ")$")
, f = function(t) {
return r.isIdentifier(t) && "_" !== t.charAt(0) && "constructor" !== t
};
function _(t) {
return !h.test(t)
}
function g(t) {
try {
return !0 === t.__isPromisified__
} catch (t) {
return !1
}
}
function p(t, e, n) {
var i = r.getDataPropertyOrDefault(t, e + n, d);
return !!i && g(i)
}
function v(t, e, n, i) {
for (var a = r.inheritedDataKeys(t), o = [], s = 0; s < a.length; ++s) {
var l = a[s]
, c = t[l]
, d = i === f || f(l, c, t);
"function" != typeof c || g(c) || p(t, l, e) || !i(l, c, t, d) || o.push(l, c)
}
return function(t, e, n) {
for (var i = 0; i < t.length; i += 2) {
var r = t[i];
if (n.test(r))
for (var a = r.replace(n, ""), o = 0; o < t.length; o += 2)
if (t[o] === a)
throw new u("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s", e))
}
}(o, e, n),
o
}
var m = function(t) {
return t.replace(/([$])/, "\\$")
};
var y = c ? void 0 : function(t, l, c, u, d, h) {
var f = function() {
return this
}()
, _ = t;
function g() {
var r = l;
l === i && (r = this);
var c = new e(n);
c._captureStackTrace();
var u = "string" == typeof _ && this !== f ? this[_] : t
, d = a(c, h);
try {
u.apply(r, o(arguments, d))
} catch (t) {
c._rejectCallback(s(t), !0, !0)
}
return c._isFateSealed() || c._setAsyncGuaranteed(),
c
}
return "string" == typeof _ && (t = u),
r.notEnumerableProp(g, "__isPromisified__", !0),
g
}
;
function k(t, e, n, a, o) {
for (var s = new RegExp(m(e) + "$"), l = v(t, e, s, n), c = 0, u = l.length; c < u; c += 2) {
var d = l[c]
, h = l[c + 1]
, f = d + e;
if (a === y)
t[f] = y(d, i, d, h, e, o);
else {
var _ = a(h, function() {
return y(d, i, d, h, e, o)
});
r.notEnumerableProp(_, "__isPromisified__", !0),
t[f] = _
}
}
return r.toFastProperties(t),
t
}
e.promisify = function(t, e) {
if ("function" != typeof t)
throw new u("expecting a function but got " + r.classString(t));
if (g(t))
return t;
var n = function(t, e, n) {
return y(t, e, void 0, t, null, n)
}(t, void 0 === (e = Object(e)).context ? i : e.context, !!e.multiArgs);
return r.copyDescriptors(t, n, _),
n
}
,
e.promisifyAll = function(t, e) {
if ("function" != typeof t && "object" !== l(t))
throw new u("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");
var n = !!(e = Object(e)).multiArgs
, i = e.suffix;
"string" != typeof i && (i = "Async");
var a = e.filter;
"function" != typeof a && (a = f);
var o = e.promisifier;
if ("function" != typeof o && (o = y),
!r.isIdentifier(i))
throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");
for (var s = r.inheritedDataKeys(t), c = 0; c < s.length; ++c) {
var d = t[s[c]];
"constructor" !== s[c] && r.isClass(d) && (k(d.prototype, i, a, o, n),
k(d, i, a, o, n))
}
return k(t, i, a, o, n)
}
}
}
, {
"./errors": 12,
"./nodeback": 20,
"./util": 36
}],
25: [function(t, e, n) {
"use strict";
e.exports = function(e, n, i, r) {
var a, o = t("./util"), s = o.isObject, l = t("./es5");
"function" == typeof Map && (a = Map);
var c = function() {
var t = 0
, e = 0;
function n(n, i) {
this[t] = n,
this[t + e] = i,
t++
}
return function(i) {
e = i.size,
t = 0;
var r = new Array(2 * i.size);
return i.forEach(n, r),
r
}
}();
function u(t) {
var e, n = !1;
if (void 0 !== a && t instanceof a)
e = c(t),
n = !0;
else {
var i = l.keys(t)
, r = i.length;
e = new Array(2 * r);
for (var o = 0; o < r; ++o) {
var s = i[o];
e[o] = t[s],
e[o + r] = s
}
}
this.constructor$(e),
this._isMap = n,
this._init$(void 0, n ? -6 : -3)
}
function d(t) {
var n, a = i(t);
return s(a) ? (n = a instanceof e ? a._then(e.props, void 0, void 0, void 0, void 0) : new u(a).promise(),
a instanceof e && n._propagateFrom(a, 2),
n) : r("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")
}
o.inherits(u, n),
u.prototype._init = function() {}
,
u.prototype._promiseFulfilled = function(t, e) {
if (this._values[e] = t,
++this._totalResolved >= this._length) {
var n;
if (this._isMap)
n = function(t) {
for (var e = new a, n = t.length / 2 | 0, i = 0; i < n; ++i) {
var r = t[n + i]
, o = t[i];
e.set(r, o)
}
return e
}(this._values);
else {
n = {};
for (var i = this.length(), r = 0, o = this.length(); r < o; ++r)
n[this._values[r + i]] = this._values[r]
}
return this._resolve(n),
!0
}
return !1
}
,
u.prototype.shouldCopyValues = function() {
return !1
}
,
u.prototype.getActualLength = function(t) {
return t >> 1
}
,
e.prototype.props = function() {
return d(this)
}
,
e.props = function(t) {
return d(t)
}
}
}
, {
"./es5": 13,
"./util": 36
}],
26: [function(t, e, n) {
"use strict";
function i(t) {
this._capacity = t,
this._length = 0,
this._front = 0
}
i.prototype._willBeOverCapacity = function(t) {
return this._capacity < t
}
,
i.prototype._pushOne = function(t) {
var e = this.length();
this._checkCapacity(e + 1),
this[this._front + e & this._capacity - 1] = t,
this._length = e + 1
}
,
i.prototype.push = function(t, e, n) {
var i = this.length() + 3;
if (this._willBeOverCapacity(i))
return this._pushOne(t),
this._pushOne(e),
void this._pushOne(n);
var r = this._front + i - 3;
this._checkCapacity(i);
var a = this._capacity - 1;
this[r + 0 & a] = t,
this[r + 1 & a] = e,
this[r + 2 & a] = n,
this._length = i
}
,
i.prototype.shift = function() {
var t = this._front
, e = this[t];
return this[t] = void 0,
this._front = t + 1 & this._capacity - 1,
this._length--,
e
}
,
i.prototype.length = function() {
return this._length
}
,
i.prototype._checkCapacity = function(t) {
this._capacity < t && this._resizeTo(this._capacity << 1)
}
,
i.prototype._resizeTo = function(t) {
var e = this._capacity;
this._capacity = t,
function(t, e, n, i, r) {
for (var a = 0; a < r; ++a)
n[a + i] = t[a + e],
t[a + e] = void 0
}(this, 0, this, e, this._front + this._length & e - 1)
}
,
e.exports = i
}
, {}],
27: [function(t, e, n) {
"use strict";
e.exports = function(e, n, i, r) {
var a = t("./util")
, o = function(t) {
return t.then(function(e) {
return s(e, t)
})
};
function s(t, s) {
var l = i(t);
if (l instanceof e)
return o(l);
if (null === (t = a.asArray(t)))
return r("expecting an array or an iterable object but got " + a.classString(t));
var c = new e(n);
void 0 !== s && c._propagateFrom(s, 3);
for (var u = c._fulfill, d = c._reject, h = 0, f = t.length; h < f; ++h) {
var _ = t[h];
(void 0 !== _ || h in t) && e.cast(_)._then(u, d, void 0, c, null)
}
return c
}
e.race = function(t) {
return s(t, void 0)
}
,
e.prototype.race = function() {
return s(this, void 0)
}
}
}
, {
"./util": 36
}],
28: [function(t, e, n) {
"use strict";
e.exports = function(e, n, i, r, a, o) {
var s = e._getDomain
, l = t("./util")
, c = l.tryCatch;
function u(t, n, i, r) {
this.constructor$(t);
var o = s();
this._fn = null === o ? n : l.domainBind(o, n),
void 0 !== i && (i = e.resolve(i))._attachCancellationCallback(this),
this._initialValue = i,
this._currentCancellable = null,
this._eachValues = r === a ? Array(this._length) : 0 === r ? null : void 0,
this._promise._captureStackTrace(),
this._init$(void 0, -5)
}
function d(t, e) {
this.isFulfilled() ? e._resolve(t) : e._reject(t)
}
function h(t, e, n, r) {
return "function" != typeof e ? i("expecting a function but got " + l.classString(e)) : new u(t,e,n,r).promise()
}
function f(t) {
this.accum = t,
this.array._gotAccum(t);
var n = r(this.value, this.array._promise);
return n instanceof e ? (this.array._currentCancellable = n,
n._then(_, void 0, void 0, this, void 0)) : _.call(this, n)
}
function _(t) {
var n, i = this.array, r = i._promise, a = c(i._fn);
r._pushContext(),
(n = void 0 !== i._eachValues ? a.call(r._boundValue(), t, this.index, this.length) : a.call(r._boundValue(), this.accum, t, this.index, this.length))instanceof e && (i._currentCancellable = n);
var s = r._popContext();
return o.checkForgottenReturns(n, s, void 0 !== i._eachValues ? "Promise.each" : "Promise.reduce", r),
n
}
l.inherits(u, n),
u.prototype._gotAccum = function(t) {
void 0 !== this._eachValues && null !== this._eachValues && t !== a && this._eachValues.push(t)
}
,
u.prototype._eachComplete = function(t) {
return null !== this._eachValues && this._eachValues.push(t),
this._eachValues
}
,
u.prototype._init = function() {}
,
u.prototype._resolveEmptyArray = function() {
this._resolve(void 0 !== this._eachValues ? this._eachValues : this._initialValue)
}
,
u.prototype.shouldCopyValues = function() {
return !1
}
,
u.prototype._resolve = function(t) {
this._promise._resolveCallback(t),
this._values = null
}
,
u.prototype._resultCancelled = function(t) {
if (t === this._initialValue)
return this._cancel();
this._isResolved() || (this._resultCancelled$(),
this._currentCancellable instanceof e && this._currentCancellable.cancel(),
this._initialValue instanceof e && this._initialValue.cancel())
}
,
u.prototype._iterate = function(t) {
var n, i;
this._values = t;
var r = t.length;
if (void 0 !== this._initialValue ? (n = this._initialValue,
i = 0) : (n = e.resolve(t[0]),
i = 1),
this._currentCancellable = n,
!n.isRejected())
for (; i < r; ++i) {
var a = {
accum: null,
value: t[i],
index: i,
length: r,
array: this
};
n = n._then(f, void 0, void 0, a, void 0)
}
void 0 !== this._eachValues && (n = n._then(this._eachComplete, void 0, void 0, this, void 0)),
n._then(d, d, void 0, n, this)
}
,
e.prototype.reduce = function(t, e) {
return h(this, t, e, null)
}
,
e.reduce = function(t, e, n, i) {
return h(t, e, n, i)
}
}
}
, {
"./util": 36
}],
29: [function(t, e, a) {
"use strict";
var o, s = t("./util"), l = s.getNativePromise();
if (s.isNode && "undefined" == typeof MutationObserver) {
var c = i.setImmediate
, u = n.nextTick;
o = s.isRecentNode ? function(t) {
c.call(i, t)
}
: function(t) {
u.call(n, t)
}
} else if ("function" == typeof l && "function" == typeof l.resolve) {
var d = l.resolve();
o = function(t) {
d.then(t)
}
} else
o = "undefined" == typeof MutationObserver || "undefined" != typeof window && window.navigator && (window.navigator.standalone || window.cordova) ? void 0 !== r ? function(t) {
r(t)
}
: "undefined" != typeof setTimeout ? function(t) {
setTimeout(t, 0)
}
: function() {
throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")
}
: function() {
var t = document.createElement("div")
, e = {
attributes: !0
}
, n = !1
, i = document.createElement("div");
new MutationObserver(function() {
t.classList.toggle("foo"),
n = !1
}
).observe(i, e);
return function(r) {
var a = new MutationObserver(function() {
a.disconnect(),
r()
}
);
a.observe(t, e),
n || (n = !0,
i.classList.toggle("foo"))
}
}();
e.exports = o
}
, {
"./util": 36
}],
30: [function(t, e, n) {
"use strict";
e.exports = function(e, n, i) {
var r = e.PromiseInspection;
function a(t) {
this.constructor$(t)
}
t("./util").inherits(a, n),
a.prototype._promiseResolved = function(t, e) {
return this._values[t] = e,
++this._totalResolved >= this._length && (this._resolve(this._values),
!0)
}
,
a.prototype._promiseFulfilled = function(t, e) {
var n = new r;
return n._bitField = 33554432,
n._settledValueField = t,
this._promiseResolved(e, n)
}
,
a.prototype._promiseRejected = function(t, e) {
var n = new r;
return n._bitField = 16777216,
n._settledValueField = t,
this._promiseResolved(e, n)
}
,
e.settle = function(t) {
return i.deprecated(".settle()", ".reflect()"),
new a(t).promise()
}
,
e.prototype.settle = function() {
return e.settle(this)
}
}
}
, {
"./util": 36
}],
31: [function(t, e, n) {
"use strict";
e.exports = function(e, n, i) {
var r = t("./util")
, a = t("./errors").RangeError
, o = t("./errors").AggregateError
, s = r.isArray
, l = {};
function c(t) {
this.constructor$(t),
this._howMany = 0,
this._unwrap = !1,
this._initialized = !1
}
function u(t, e) {
if ((0 | e) !== e || e < 0)
return i("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");
var n = new c(t)
, r = n.promise();
return n.setHowMany(e),
n.init(),
r
}
r.inherits(c, n),
c.prototype._init = function() {
if (this._initialized)
if (0 !== this._howMany) {
this._init$(void 0, -5);
var t = s(this._values);
!this._isResolved() && t && this._howMany > this._canPossiblyFulfill() && this._reject(this._getRangeError(this.length()))
} else
this._resolve([])
}
,
c.prototype.init = function() {
this._initialized = !0,
this._init()
}
,
c.prototype.setUnwrap = function() {
this._unwrap = !0
}
,
c.prototype.howMany = function() {
return this._howMany
}
,
c.prototype.setHowMany = function(t) {
this._howMany = t
}
,
c.prototype._promiseFulfilled = function(t) {
return this._addFulfilled(t),
this._fulfilled() === this.howMany() && (this._values.length = this.howMany(),
1 === this.howMany() && this._unwrap ? this._resolve(this._values[0]) : this._resolve(this._values),
!0)
}
,
c.prototype._promiseRejected = function(t) {
return this._addRejected(t),
this._checkOutcome()
}
,
c.prototype._promiseCancelled = function() {
return this._values instanceof e || null == this._values ? this._cancel() : (this._addRejected(l),
this._checkOutcome())
}
,
c.prototype._checkOutcome = function() {
if (this.howMany() > this._canPossiblyFulfill()) {
for (var t = new o, e = this.length(); e < this._values.length; ++e)
this._values[e] !== l && t.push(this._values[e]);
return t.length > 0 ? this._reject(t) : this._cancel(),
!0
}
return !1
}
,
c.prototype._fulfilled = function() {
return this._totalResolved
}
,
c.prototype._rejected = function() {
return this._values.length - this.length()
}
,
c.prototype._addRejected = function(t) {
this._values.push(t)
}
,
c.prototype._addFulfilled = function(t) {
this._values[this._totalResolved++] = t
}
,
c.prototype._canPossiblyFulfill = function() {
return this.length() - this._rejected()
}
,
c.prototype._getRangeError = function(t) {
var e = "Input array must contain at least " + this._howMany + " items but contains only " + t + " items";
return new a(e)
}
,
c.prototype._resolveEmptyArray = function() {
this._reject(this._getRangeError(0))
}
,
e.some = function(t, e) {
return u(t, e)
}
,
e.prototype.some = function(t) {
return u(this, t)
}
,
e._SomePromiseArray = c
}
}
, {
"./errors": 12,
"./util": 36
}],
32: [function(t, e, n) {
"use strict";
e.exports = function(t) {
function e(t) {
void 0 !== t ? (t = t._target(),
this._bitField = t._bitField,
this._settledValueField = t._isFateSealed() ? t._settledValue() : void 0) : (this._bitField = 0,
this._settledValueField = void 0)
}
e.prototype._settledValue = function() {
return this._settledValueField
}
;
var n = e.prototype.value = function() {
if (!this.isFulfilled())
throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");
return this._settledValue()
}
, i = e.prototype.error = e.prototype.reason = function() {
if (!this.isRejected())
throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");
return this._settledValue()
}
, r = e.prototype.isFulfilled = function() {
return 0 != (33554432 & this._bitField)
}
, a = e.prototype.isRejected = function() {
return 0 != (16777216 & this._bitField)
}
, o = e.prototype.isPending = function() {
return 0 == (50397184 & this._bitField)
}
, s = e.prototype.isResolved = function() {
return 0 != (50331648 & this._bitField)
}
;
e.prototype.isCancelled = function() {
return 0 != (8454144 & this._bitField)
}
,
t.prototype.__isCancelled = function() {
return 65536 == (65536 & this._bitField)
}
,
t.prototype._isCancelled = function() {
return this._target().__isCancelled()
}
,
t.prototype.isCancelled = function() {
return 0 != (8454144 & this._target()._bitField)
}
,
t.prototype.isPending = function() {
return o.call(this._target())
}
,
t.prototype.isRejected = function() {
return a.call(this._target())
}
,
t.prototype.isFulfilled = function() {
return r.call(this._target())
}
,
t.prototype.isResolved = function() {
return s.call(this._target())
}
,
t.prototype.value = function() {
return n.call(this._target())
}
,
t.prototype.reason = function() {
var t = this._target();
return t._unsetRejectionIsUnhandled(),
i.call(t)
}
,
t.prototype._value = function() {
return this._settledValue()
}
,
t.prototype._reason = function() {
return this._unsetRejectionIsUnhandled(),
this._settledValue()
}
,
t.PromiseInspection = e
}
}
, {}],
33: [function(t, e, n) {
"use strict";
e.exports = function(e, n) {
var i = t("./util")
, r = i.errorObj
, a = i.isObject;
var o = {}.hasOwnProperty;
return function(t, s) {
if (a(t)) {
if (t instanceof e)
return t;
var l = function(t) {
try {
return function(t) {
return t.then
}(t)
} catch (t) {
return r.e = t,
r
}
}(t);
if (l === r) {
s && s._pushContext();
var c = e.reject(l.e);
return s && s._popContext(),
c
}
if ("function" == typeof l)
return function(t) {
try {
return o.call(t, "_promise0")
} catch (t) {
return !1
}
}(t) ? (c = new e(n),
t._then(c._fulfill, c._reject, void 0, c, null),
c) : function(t, a, o) {
var s = new e(n)
, l = s;
o && o._pushContext(),
s._captureStackTrace(),
o && o._popContext();
var c = !0
, u = i.tryCatch(a).call(t, function(t) {
s && (s._resolveCallback(t),
s = null)
}, function(t) {
s && (s._rejectCallback(t, c, !0),
s = null)
});
return c = !1,
s && u === r && (s._rejectCallback(u.e, !0, !0),
s = null),
l
}(t, l, s)
}
return t
}
}
}
, {
"./util": 36
}],
34: [function(t, e, n) {
"use strict";
e.exports = function(e, n, i) {
var r = t("./util")
, a = e.TimeoutError;
function o(t) {
this.handle = t
}
o.prototype._resultCancelled = function() {
clearTimeout(this.handle)
}
;
var s = function(t) {
return l(+this).thenReturn(t)
}
, l = e.delay = function(t, r) {
var a, l;
return void 0 !== r ? (a = e.resolve(r)._then(s, null, null, t, void 0),
i.cancellation() && r instanceof e && a._setOnCancel(r)) : (a = new e(n),
l = setTimeout(function() {
a._fulfill()
}, +t),
i.cancellation() && a._setOnCancel(new o(l)),
a._captureStackTrace()),
a._setAsyncGuaranteed(),
a
}
;
e.prototype.delay = function(t) {
return l(t, this)
}
;
function c(t) {
return clearTimeout(this.handle),
t
}
function u(t) {
throw clearTimeout(this.handle),
t
}
e.prototype.timeout = function(t, e) {
var n, s;
t = +t;
var l = new o(setTimeout(function() {
n.isPending() && function(t, e, n) {
var i;
i = "string" != typeof e ? e instanceof Error ? e : new a("operation timed out") : new a(e),
r.markAsOriginatingFromRejection(i),
t._attachExtraTrace(i),
t._reject(i),
null != n && n.cancel()
}(n, e, s)
}, t));
return i.cancellation() ? (s = this.then(),
(n = s._then(c, u, void 0, l, void 0))._setOnCancel(l)) : n = this._then(c, u, void 0, l, void 0),
n
}
}
}
, {
"./util": 36
}],
35: [function(t, e, n) {
"use strict";
e.exports = function(e, n, i, r, a, o) {
var s = t("./util")
, l = t("./errors").TypeError
, c = t("./util").inherits
, u = s.errorObj
, d = s.tryCatch
, h = {};
function f(t) {
setTimeout(function() {
throw t
}, 0)
}
function _(t, n) {
var r = 0
, o = t.length
, s = new e(a);
return function a() {
if (r >= o)
return s._fulfill();
var l = function(t) {
var e = i(t);
return e !== t && "function" == typeof t._isDisposable && "function" == typeof t._getDisposer && t._isDisposable() && e._setDisposable(t._getDisposer()),
e
}(t[r++]);
if (l instanceof e && l._isDisposable()) {
try {
l = i(l._getDisposer().tryDispose(n), t.promise)
} catch (t) {
return f(t)
}
if (l instanceof e)
return l._then(a, f, null, null, null)
}
a()
}(),
s
}
function g(t, e, n) {
this._data = t,
this._promise = e,
this._context = n
}
function p(t, e, n) {
this.constructor$(t, e, n)
}
function v(t) {
return g.isDisposer(t) ? (this.resources[this.index]._setDisposable(t),
t.promise()) : t
}
function m(t) {
this.length = t,
this.promise = null,
this[t - 1] = null
}
g.prototype.data = function() {
return this._data
}
,
g.prototype.promise = function() {
return this._promise
}
,
g.prototype.resource = function() {
return this.promise().isFulfilled() ? this.promise().value() : h
}
,
g.prototype.tryDispose = function(t) {
var e = this.resource()
, n = this._context;
void 0 !== n && n._pushContext();
var i = e !== h ? this.doDispose(e, t) : null;
return void 0 !== n && n._popContext(),
this._promise._unsetDisposable(),
this._data = null,
i
}
,
g.isDisposer = function(t) {
return null != t && "function" == typeof t.resource && "function" == typeof t.tryDispose
}
,
c(p, g),
p.prototype.doDispose = function(t, e) {
return this.data().call(t, t, e)
}
,
m.prototype._resultCancelled = function() {
for (var t = this.length, n = 0; n < t; ++n) {
var i = this[n];
i instanceof e && i.cancel()
}
}
,
e.using = function() {
var t = arguments.length;
if (t < 2)
return n("you must pass at least 2 arguments to Promise.using");
var r, a = arguments[t - 1];
if ("function" != typeof a)
return n("expecting a function but got " + s.classString(a));
var l = !0;
2 === t && Array.isArray(arguments[0]) ? (t = (r = arguments[0]).length,
l = !1) : (r = arguments,
t--);
for (var c = new m(t), h = 0; h < t; ++h) {
var f = r[h];
if (g.isDisposer(f)) {
var p = f;
(f = f.promise())._setDisposable(p)
} else {
var y = i(f);
y instanceof e && (f = y._then(v, null, null, {
resources: c,
index: h
}, void 0))
}
c[h] = f
}
var k = new Array(c.length);
for (h = 0; h < k.length; ++h)
k[h] = e.resolve(c[h]).reflect();
var b = e.all(k).then(function(t) {
for (var e = 0; e < t.length; ++e) {
var n = t[e];
if (n.isRejected())
return u.e = n.error(),
u;
if (!n.isFulfilled())
return void b.cancel();
t[e] = n.value()
}
x._pushContext(),
a = d(a);
var i = l ? a.apply(void 0, t) : a(t)
, r = x._popContext();
return o.checkForgottenReturns(i, r, "Promise.using", x),
i
})
, x = b.lastly(function() {
var t = new e.PromiseInspection(b);
return _(c, t)
});
return c.promise = x,
x._setOnCancel(c),
x
}
,
e.prototype._setDisposable = function(t) {
this._bitField = 131072 | this._bitField,
this._disposer = t
}
,
e.prototype._isDisposable = function() {
return (131072 & this._bitField) > 0
}
,
e.prototype._getDisposer = function() {
return this._disposer
}
,
e.prototype._unsetDisposable = function() {
this._bitField = -131073 & this._bitField,
this._disposer = void 0
}
,
e.prototype.disposer = function(t) {
if ("function" == typeof t)
return new p(t,this,r());
throw new l
}
}
}
, {
"./errors": 12,
"./util": 36
}],
36: [function(t, e, r) {
"use strict";
var a = t("./es5"), o = "undefined" == typeof navigator, s = {
e: {}
}, c, u = "undefined" != typeof self ? self : "undefined" != typeof window ? window : void 0 !== i ? i : void 0 !== this ? this : null;
function d() {
try {
var t = c;
return c = null,
t.apply(this, arguments)
} catch (t) {
return s.e = t,
s
}
}
function h(t) {
return c = t,
d
}
var f = function(t, e) {
var n = {}.hasOwnProperty;
function i() {
for (var i in this.constructor = t,
this.constructor$ = e,
e.prototype)
n.call(e.prototype, i) && "$" !== i.charAt(i.length - 1) && (this[i + "$"] = e.prototype[i])
}
return i.prototype = e.prototype,
t.prototype = new i,
t.prototype
};
function _(t) {
return null == t || !0 === t || !1 === t || "string" == typeof t || "number" == typeof t
}
function g(t) {
return "function" == typeof t || "object" === l(t) && null !== t
}
function p(t) {
return _(t) ? new Error(E(t)) : t
}
function v(t, e) {
var n, i = t.length, r = new Array(i + 1);
for (n = 0; n < i; ++n)
r[n] = t[n];
return r[n] = e,
r
}
function m(t, e, n) {
if (!a.isES5)
return {}.hasOwnProperty.call(t, e) ? t[e] : void 0;
var i = Object.getOwnPropertyDescriptor(t, e);
return null != i ? null == i.get && null == i.set ? i.value : n : void 0
}
function y(t, e, n) {
if (_(t))
return t;
var i = {
value: n,
configurable: !0,
enumerable: !1,
writable: !0
};
return a.defineProperty(t, e, i),
t
}
function k(t) {
throw t
}
var b = function() {
var t = [Array.prototype, Object.prototype, Function.prototype]
, e = function(e) {
for (var n = 0; n < t.length; ++n)
if (t[n] === e)
return !0;
return !1
};
if (a.isES5) {
var n = Object.getOwnPropertyNames;
return function(t) {
for (var i = [], r = Object.create(null); null != t && !e(t); ) {
var o;
try {
o = n(t)
} catch (t) {
return i
}
for (var s = 0; s < o.length; ++s) {
var l = o[s];
if (!r[l]) {
r[l] = !0;
var c = Object.getOwnPropertyDescriptor(t, l);
null != c && null == c.get && null == c.set && i.push(l)
}
}
t = a.getPrototypeOf(t)
}
return i
}
}
var i = {}.hasOwnProperty;
return function(n) {
if (e(n))
return [];
var r = [];
t: for (var a in n)
if (i.call(n, a))
r.push(a);
else {
for (var o = 0; o < t.length; ++o)
if (i.call(t[o], a))
continue t;
r.push(a)
}
return r
}
}()
, x = /this\s*\.\s*\S+\s*=/;
function w(t) {
try {
if ("function" == typeof t) {
var e = a.names(t.prototype)
, n = a.isES5 && e.length > 1
, i = e.length > 0 && !(1 === e.length && "constructor" === e[0])
, r = x.test(t + "") && a.names(t).length > 0;
if (n || i || r)
return !0
}
return !1
} catch (t) {
return !1
}
}
function S(t) {
function e() {}
e.prototype = t;
var n = new e;
function i() {
return l(n.foo)
}
return i(),
i(),
t
}
var T = /^[a-z$_][a-z$_0-9]*$/i;
function $(t) {
return T.test(t)
}
function C(t, e, n) {
for (var i = new Array(t), r = 0; r < t; ++r)
i[r] = e + r + n;
return i
}
function E(t) {
try {
return t + ""
} catch (t) {
return "[no string representation]"
}
}
function A(t) {
return t instanceof Error || null !== t && "object" === l(t) && "string" == typeof t.message && "string" == typeof t.name
}
function D(t) {
try {
y(t, "isOperational", !0)
} catch (t) {}
}
function M(t) {
return null != t && (t instanceof Error.__BluebirdErrorTypes__.OperationalError || !0 === t.isOperational)
}
function I(t) {
return A(t) && a.propertyIsWritable(t, "stack")
}
var P = "stack"in new Error ? function(t) {
return I(t) ? t : new Error(E(t))
}
: function(t) {
if (I(t))
return t;
try {
throw new Error(E(t))
} catch (t) {
return t
}
}
;
function N(t) {
return {}.toString.call(t)
}
function O(t, e, n) {
for (var i = a.names(t), r = 0; r < i.length; ++r) {
var o = i[r];
if (n(o))
try {
a.defineProperty(e, o, a.getDescriptor(t, o))
} catch (t) {}
}
}
var L = function(t) {
return a.isArray(t) ? t : null
};
if ("undefined" != typeof Symbol && Symbol.iterator) {
var R = "function" == typeof Array.from ? function(t) {
return Array.from(t)
}
: function(t) {
for (var e, n = [], i = t[Symbol.iterator](); !(e = i.next()).done; )
n.push(e.value);
return n
}
;
L = function(t) {
return a.isArray(t) ? t : null != t && "function" == typeof t[Symbol.iterator] ? R(t) : null
}
}
var j = void 0 !== n && "[object process]" === N(n).toLowerCase()
, H = void 0 !== n && void 0 !== n.env;
function F(t) {
return H ? n.env[t] : void 0
}
function B() {
if ("function" == typeof Promise)
try {
var t = new Promise(function() {}
);
if ("[object Promise]" === {}.toString.call(t))
return Promise
} catch (t) {}
}
function z(t, e) {
return t.bind(e)
}
var U = {
isClass: w,
isIdentifier: $,
inheritedDataKeys: b,
getDataPropertyOrDefault: m,
thrower: k,
isArray: a.isArray,
asArray: L,
notEnumerableProp: y,
isPrimitive: _,
isObject: g,
isError: A,
canEvaluate: o,
errorObj: s,
tryCatch: h,
inherits: f,
withAppended: v,
maybeWrapAsError: p,
toFastProperties: S,
filledRange: C,
toString: E,
canAttachTrace: I,
ensureErrorObject: P,
originatesFromRejection: M,
markAsOriginatingFromRejection: D,
classString: N,
copyDescriptors: O,
hasDevTools: "undefined" != typeof chrome && chrome && "function" == typeof chrome.loadTimes,
isNode: j,
hasEnvVariables: H,
env: F,
global: u,
getNativePromise: B,
domainBind: z
};
U.isRecentNode = U.isNode && function() {
var t;
return n.versions && n.versions.node ? t = n.versions.node.split(".").map(Number) : n.version && (t = n.version.split(".").map(Number)),
0 === t[0] && t[1] > 10 || t[0] > 0
}(),
U.isNode && U.toFastProperties(n);
try {
throw new Error
} catch (t) {
U.lastLineError = t
}
e.exports = U
}
, {
"./es5": 13
}]
}, {}, [4])(4)
}),
"undefined" != typeof window && null !== window ? window.P = window.Promise : "undefined" != typeof self && null !== self && (self.P = self.Promise)
}
).call(this, n(9), n(4), n(57).setImmediate)
}
, function(t, e, n) {
t.exports = n(233)
}
, function(t, e, n) {
var i = n(0);
t.exports = function() {
var t = {};
return {
getState: function(e) {
if (t[e])
return t[e].method();
var n = {};
for (var r in t)
t[r].internal || i.mixin(n, t[r].method(), !0);
return n
},
registerProvider: function(e, n, i) {
t[e] = {
method: n,
internal: i
}
},
unregisterProvider: function(e) {
delete t[e]
}
}
}
}
, function(t, e) {
t.exports = function(t) {
var e = {};
function n(n, i, r) {
r = r || n;
var a = t.config
, o = t.templates;
t.config[n] && e[r] != a[n] && (i && o[r] || (o[r] = t.date.date_to_str(a[n]),
e[r] = a[n]))
}
return {
initTemplates: function() {
var e = t.locale.labels;
e.gantt_save_btn = e.icon_save,
e.gantt_cancel_btn = e.icon_cancel,
e.gantt_delete_btn = e.icon_delete;
var i = t.date
, r = i.date_to_str
, a = t.config
, o = r(a.xml_date || a.date_format, a.server_utc)
, s = i.str_to_date(a.xml_date || a.date_format, a.server_utc);
n("date_scale", !0, void 0, t.config, t.templates),
n("date_grid", !0, "grid_date_format", t.config, t.templates),
n("task_date", !0, void 0, t.config, t.templates),
t.mixin(t.templates, {
xml_format: void 0,
format_date: o,
xml_date: void 0,
parse_date: s,
progress_text: function(t, e, n) {
return ""
},
grid_header_class: function(t, e) {
return ""
},
task_text: function(t, e, n) {
return n.text
},
task_class: function(t, e, n) {
return ""
},
task_end_date: function(e) {
return t.templates.task_date(e)
},
grid_row_class: function(t, e, n) {
return ""
},
task_row_class: function(t, e, n) {
return ""
},
timeline_cell_class: function(t, e) {
return ""
},
timeline_cell_content: function(t, e) {
return ""
},
scale_cell_class: function(t) {
return ""
},
scale_row_class: function(t) {
return ""
},
grid_indent: function(t) {
return ""
},
grid_folder: function(t) {
return ""
},
grid_file: function(t) {
return ""
},
grid_open: function(t) {
return ""
},
grid_blank: function(t) {
return ""
},
date_grid: function(e, n, i) {
return n && t.isUnscheduledTask(n) && t.config.show_unscheduled ? t.templates.task_unscheduled_time(n) : t.templates.grid_date_format(e, i)
},
task_time: function(e, n, i) {
return t.isUnscheduledTask(i) && t.config.show_unscheduled ? t.templates.task_unscheduled_time(i) : t.templates.task_date(e) + " - " + t.templates.task_end_date(n)
},
task_unscheduled_time: function(t) {
return ""
},
time_picker: r(a.time_picker),
link_class: function(t) {
return ""
},
link_description: function(e) {
var n = t.getTask(e.source)
, i = t.getTask(e.target);
return "" + n.text + " – " + i.text + ""
},
drag_link: function(e, n, i, r) {
e = t.getTask(e);
var a = t.locale.labels
, o = "" + e.text + " " + (n ? a.link_start : a.link_end) + " ";
return i && (o += " " + (i = t.getTask(i)).text + " " + (r ? a.link_start : a.link_end) + " "),
o
},
drag_link_class: function(e, n, i, r) {
var a = "";
return e && i && (a = " " + (t.isLinkAllowed(e, i, n, r) ? "gantt_link_allow" : "gantt_link_deny")),
"gantt_link_tooltip" + a
},
tooltip_date_format: i.date_to_str("%Y-%m-%d"),
tooltip_text: function(e, n, i) {
return "Task: " + i.text + " Start date: " + t.templates.tooltip_date_format(e) + " End date: " + t.templates.tooltip_date_format(n)
}
})
},
initTemplate: n
}
}
}
, function(t, e, n) {
var i = n(5)
, r = n(0)
, a = n(50)
, o = n(21)
, s = n(1);
t.exports = function(t) {
function e(t) {
return {
target: t.target || t.srcElement,
pageX: t.pageX,
pageY: t.pageY,
clientX: t.clientX,
clientY: t.clientY,
metaKey: t.metaKey,
shiftKey: t.shiftKey,
ctrlKey: t.ctrlKey,
altKey: t.altKey
}
}
function n(n, a) {
this._obj = n,
this._settings = a || {},
i(this);
var o = this.getInputMethods();
this._drag_start_timer = null,
t.attachEvent("onGanttScroll", r.bind(function(t, e) {
this.clearDragTimer()
}, this));
for (var l = {
passive: !1
}, c = 0; c < o.length; c++)
r.bind(function(i) {
t.event(n, i.down, r.bind(function(o) {
i.accessor(o) && (a.preventDefault && a.selector && s.closest(o.target, a.selector) && o.preventDefault(),
t.config.touch && o.timeStamp && o.timeStamp - 0 < 300 || (this._settings.original_target = e(o),
t.config.touch ? (this.clearDragTimer(),
this._drag_start_timer = setTimeout(r.bind(function() {
t.getState().lightbox || this.dragStart(n, o, i)
}, this), t.config.touch_drag)) : this.dragStart(n, o, i)))
}, this), l);
var o = document.body;
t.event(o, i.up, r.bind(function(t) {
i.accessor(t) && this.clearDragTimer()
}, this), l)
}, this)(o[c])
}
return n.prototype = {
traceDragEvents: function(e, n) {
var i = r.bind(function(t) {
return this.dragMove(e, t, n.accessor)
}, this);
r.bind(function(t) {
return this.dragScroll(e, t)
}, this);
var o = r.bind(function(t) {
if (!this.config.started || !r.defined(this.config.updates_per_second) || a(this, this.config.updates_per_second)) {
var e = i(t);
if (e)
try {
t && t.preventDefault && t.cancelable && t.preventDefault()
} catch (t) {}
return e
}
}, this)
, l = s.getRootNode(t.$root)
, c = this.config.mousemoveContainer || s.getRootNode(t.$root)
, u = {
passive: !1
}
, d = r.bind(function(i) {
return t.eventRemove(c, n.move, o),
t.eventRemove(l, n.up, d, u),
this.dragEnd(e)
}, this);
t.event(c, n.move, o, u),
t.event(l, n.up, d, u)
},
checkPositionChange: function(t) {
var e = t.x - this.config.pos.x
, n = t.y - this.config.pos.y;
return Math.sqrt(Math.pow(Math.abs(e), 2) + Math.pow(Math.abs(n), 2)) > this.config.sensitivity
},
initDnDMarker: function() {
var t = this.config.marker = document.createElement("div");
t.className = "gantt_drag_marker",
t.innerHTML = "",
document.body.appendChild(t)
},
backupEventTarget: function(n, i) {
if (t.config.touch) {
var r = i(n)
, a = r.target || r.srcElement
, o = a.cloneNode(!0);
this.config.original_target = e(r),
this.config.original_target.target = o,
this.config.backup_element = a,
a.parentNode.appendChild(o),
a.style.display = "none",
(this.config.mousemoveContainer || document.body).appendChild(a)
}
},
getInputMethods: function() {
var e = [];
if (e.push({
move: "mousemove",
down: "mousedown",
up: "mouseup",
accessor: function(t) {
return t
}
}),
t.config.touch) {
var n = !0;
try {
document.createEvent("TouchEvent")
} catch (t) {
n = !1
}
n ? e.push({
move: "touchmove",
down: "touchstart",
up: "touchend",
accessor: function(t) {
return t.touches && t.touches.length > 1 ? null : t.touches[0] ? {
target: document.elementFromPoint(t.touches[0].clientX, t.touches[0].clientY),
pageX: t.touches[0].pageX,
pageY: t.touches[0].pageY,
clientX: t.touches[0].clientX,
clientY: t.touches[0].clientY
} : t
}
}) : o.navigator.pointerEnabled ? e.push({
move: "pointermove",
down: "pointerdown",
up: "pointerup",
accessor: function(t) {
return "mouse" == t.pointerType ? null : t
}
}) : o.navigator.msPointerEnabled && e.push({
move: "MSPointerMove",
down: "MSPointerDown",
up: "MSPointerUp",
accessor: function(t) {
return t.pointerType == t.MSPOINTER_TYPE_MOUSE ? null : t
}
})
}
return e
},
clearDragTimer: function() {
this._drag_start_timer && (clearTimeout(this._drag_start_timer),
this._drag_start_timer = null)
},
dragStart: function(e, n, i) {
this.config && this.config.started || (this.config = {
obj: e,
marker: null,
started: !1,
pos: this.getPosition(n),
sensitivity: 4
},
this._settings && r.mixin(this.config, this._settings, !0),
this.traceDragEvents(e, i),
t._prevent_touch_scroll = !0,
document.body.className += " gantt_noselect",
t.config.touch && this.dragMove(e, n, i.accessor))
},
dragMove: function(e, n, i) {
var r = i(n);
if (!r)
return !1;
if (!this.config.marker && !this.config.started) {
var a = this.getPosition(r);
if (t.config.touch || this.checkPositionChange(a)) {
if (this.config.started = !0,
this.config.ignore = !1,
!1 === this.callEvent("onBeforeDragStart", [e, this.config.original_target]))
return this.config.ignore = !0,
!1;
this.backupEventTarget(n, i),
this.initDnDMarker(),
t._touch_feedback(),
this.callEvent("onAfterDragStart", [e, this.config.original_target])
} else
this.config.ignore = !0
}
if (!this.config.ignore) {
if (n.targetTouches && !r.target)
return;
return r.pos = this.getPosition(r),
this.config.marker.style.left = r.pos.x + "px",
this.config.marker.style.top = r.pos.y + "px",
this.callEvent("onDragMove", [e, r]),
!0
}
return !1
},
dragEnd: function(e) {
var n = this.config.backup_element;
n && n.parentNode && n.parentNode.removeChild(n),
t._prevent_touch_scroll = !1,
this.config.marker && (this.config.marker.parentNode.removeChild(this.config.marker),
this.config.marker = null,
this.callEvent("onDragEnd", [])),
this.config.started = !1,
document.body.className = document.body.className.replace(" gantt_noselect", "")
},
getPosition: function(t) {
var e = 0
, n = 0;
return t.pageX || t.pageY ? (e = t.pageX,
n = t.pageY) : (t.clientX || t.clientY) && (e = t.clientX + document.body.scrollLeft + document.documentElement.scrollLeft,
n = t.clientY + document.body.scrollTop + document.documentElement.scrollTop),
{
x: e,
y: n
}
}
},
n
}
}
, function(t, e, n) {
"use strict";
function i(t, e) {
for (var n = 0; n < e.length; n++) {
var i = e[n];
i.enumerable = i.enumerable || !1,
i.configurable = !0,
"value"in i && (i.writable = !0),
Object.defineProperty(t, i.key, i)
}
}
n.r(e),
n.d(e, "Client", function() {
return r
});
var r = function() {
function t(e) {
!function(t, e) {
if (!(t instanceof e))
throw new TypeError("Cannot call a class as a function")
}(this, t);
var n = e.url
, i = e.token;
this._url = n,
this._token = i,
this._mode = 1,
this._seed = 1,
this._queue = [],
this.data = {},
this.api = {},
this._events = {}
}
return function(t, e, n) {
e && i(t.prototype, e),
n && i(t, n)
}(t, [{
key: "headers",
value: function() {
return {
Accept: "application/json",
"Content-Type": "application/json",
"Remote-Token": this._token
}
}
}, {
key: "fetch",
value: function(t) {
function e(e, n) {
return t.apply(this, arguments)
}
return e.toString = function() {
return t.toString()
}
,
e
}(function(t, e) {
var n = {
credentials: "include",
headers: this.headers()
};
return e && (n.method = "POST",
n.body = e),
fetch(t, n).then(function(t) {
return t.json()
})
})
}, {
key: "load",
value: function(t) {
var e = this;
return t && (this._url = t),
this.fetch(this._url).then(function(t) {
return e.parse(t)
})
}
}, {
key: "parse",
value: function(t) {
var e = t.key
, n = t.websocket;
for (var i in e && (this._token = t.key),
t.data)
this.data[i] = t.data[i];
for (var r in t.api) {
var a = this.api[r] = {}
, o = t.api[r];
for (var s in o)
a[s] = this._wrapper(r + "." + s)
}
return n && this.connect(),
this
}
}, {
key: "connect",
value: function() {
var t = this
, e = this._socket;
e && (this._socket = null,
e.onclose = function() {}
,
e.close()),
this._mode = 2,
this._socket = function(e, n, i, r) {
var a = n;
"/" === a[0] && (a = document.location.protocol + "//" + document.location.host + n);
var o = -1 != (a = a.replace(/^http(s|):/, "ws$1:")).indexOf("?") ? "&" : "?";
a = "".concat(a).concat(o, "token=").concat(i, "&ws=1");
var s = new WebSocket(a);
return s.onclose = function() {
return setTimeout(function() {
return e.connect()
}, 2e3)
}
,
s.onmessage = function(n) {
var i = JSON.parse(n.data);
switch (i.action) {
case "result":
e.result(i.body, []);
break;
case "event":
e.fire(i.body.name, i.body.value);
break;
case "start":
t._mode = 3,
t._send(),
t._resubscribe();
break;
default:
e.onError(i.data)
}
}
,
s
}(this, this._url, this._token)
}
}, {
key: "_wrapper",
value: function(t) {
return function() {
var e = this
, n = [].slice.call(arguments)
, i = null
, r = new Promise(function(r, a) {
i = {
data: {
id: e._uid(),
name: t,
args: n
},
status: 1,
resolve: r,
reject: a
},
e._queue.push(i)
}
);
return this.onCall(i, r),
3 === this._mode ? this._send(i) : setTimeout(function() {
return e._send()
}, 1),
r
}
.bind(this)
}
}, {
key: "_uid",
value: function() {
return (this._seed++).toString()
}
}, {
key: "_send",
value: function(t) {
var e = this;
if (2 != this._mode) {
var n = t ? [t] : this._queue.filter(function(t) {
return 1 === t.status
});
if (n.length) {
var i = n.map(function(t) {
return t.status = 2,
t.data
});
3 !== this._mode ? this.fetch(this._url, JSON.stringify(i)).catch(function(t) {
return e.onError(t)
}).then(function(t) {
return e.result(t, i)
}) : this._socket.send(JSON.stringify({
action: "call",
body: i
}))
}
} else
setTimeout(function() {
return e._send()
}, 100)
}
}, {
key: "result",
value: function(t, e) {
var n = {};
if (t)
for (var i = 0; i < t.length; i++)
n[t[i].id] = t[i];
else
for (var r = 0; r < e.length; r++)
n[e[r].id] = {
id: e[r].id,
error: "Network Error",
data: null
};
for (var a = this._queue.length - 1; a >= 0; a--) {
var o = this._queue[a]
, s = n[o.data.id];
s && (this.onResponse(o, s),
s.error ? o.reject(s.error) : o.resolve(s.data),
this._queue.splice(a, 1))
}
}
}, {
key: "on",
value: function(t, e) {
var n = this._uid()
, i = this._events[t]
, r = !!i;
return r || (i = this._events[t] = []),
i.push({
id: n,
handler: e
}),
r || 3 != this._mode || this._socket.send(JSON.stringify({
action: "subscribe",
name: t
})),
{
name: t,
id: n
}
}
}, {
key: "_resubscribe",
value: function() {
if (3 == this._mode)
for (var t in this._events)
this._socket.send(JSON.stringify({
action: "subscribe",
name: t
}))
}
}, {
key: "detach",
value: function(t) {
if (t) {
var e = t.id
, n = t.name
, i = this._events[n];
if (i) {
var r = i.filter(function(t) {
return t.id != e
});
r.length ? this._events[n] = r : (delete this._events[n],
3 == this._mode && this._socket.send(JSON.stringify({
action: "unsubscribe",
name: n
})))
}
} else {
if (3 == this._mode)
for (var a in this._events)
this._socket.send(JSON.stringify({
action: "unsubscribe",
key: a
}));
this._events = {}
}
}
}, {
key: "fire",
value: function(t, e) {
var n = this._events[t];
if (n)
for (var i = 0; i < n.length; i++)
n[i].handler(e)
}
}, {
key: "onError",
value: function(t) {
return null
}
}, {
key: "onCall",
value: function(t, e) {}
}, {
key: "onResponse",
value: function(t, e) {}
}]),
t
}()
}
, function(t, e, n) {
var i = n(238);
t.exports = {
remoteEvents: function(t, e) {
var n = this
, r = new i.Client({
url: t,
token: e
});
r.fetch = function(t, e) {
var n = {
headers: this.headers()
};
return e && (n.method = "POST",
n.body = e),
fetch(t, n).then(function(t) {
return t.json()
})
}
,
this._ready = r.load().then(function(t) {
return n._remote = t
}),
this.ready = function() {
return this._ready
}
,
this.on = function(t, e) {
this.ready().then(function(n) {
if ("string" == typeof t)
n.on(t, e);
else
for (var i in t)
n.on(i, t[i])
})
}
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = {
date_to_str: function(t, e, n) {
return function(i) {
return t.replace(/%[a-zA-Z]/g, function(t) {
switch (t) {
case "%d":
return e ? n.date.to_fixed(i.getUTCDate()) : n.date.to_fixed(i.getDate());
case "%m":
return e ? n.date.to_fixed(i.getUTCMonth() + 1) : n.date.to_fixed(i.getMonth() + 1);
case "%j":
return e ? i.getUTCDate() : i.getDate();
case "%n":
return e ? i.getUTCMonth() + 1 : i.getMonth() + 1;
case "%y":
return e ? n.date.to_fixed(i.getUTCFullYear() % 100) : n.date.to_fixed(i.getFullYear() % 100);
case "%Y":
return e ? i.getUTCFullYear() : i.getFullYear();
case "%D":
return e ? n.locale.date.day_short[i.getUTCDay()] : n.locale.date.day_short[i.getDay()];
case "%l":
return e ? n.locale.date.day_full[i.getUTCDay()] : n.locale.date.day_full[i.getDay()];
case "%M":
return e ? n.locale.date.month_short[i.getUTCMonth()] : n.locale.date.month_short[i.getMonth()];
case "%F":
return e ? n.locale.date.month_full[i.getUTCMonth()] : n.locale.date.month_full[i.getMonth()];
case "%h":
return e ? n.date.to_fixed((i.getUTCHours() + 11) % 12 + 1) : n.date.to_fixed((i.getHours() + 11) % 12 + 1);
case "%g":
return e ? (i.getUTCHours() + 11) % 12 + 1 : (i.getHours() + 11) % 12 + 1;
case "%G":
return e ? i.getUTCHours() : i.getHours();
case "%H":
return e ? n.date.to_fixed(i.getUTCHours()) : n.date.to_fixed(i.getHours());
case "%i":
return e ? n.date.to_fixed(i.getUTCMinutes()) : n.date.to_fixed(i.getMinutes());
case "%a":
return e ? i.getUTCHours() > 11 ? "pm" : "am" : i.getHours() > 11 ? "pm" : "am";
case "%A":
return e ? i.getUTCHours() > 11 ? "PM" : "AM" : i.getHours() > 11 ? "PM" : "AM";
case "%s":
return e ? n.date.to_fixed(i.getUTCSeconds()) : n.date.to_fixed(i.getSeconds());
case "%W":
return e ? n.date.to_fixed(n.date.getUTCISOWeek(i)) : n.date.to_fixed(n.date.getISOWeek(i));
default:
return t
}
})
}
},
str_to_date: function(t, e, n) {
return function(i) {
for (var r = [0, 0, 1, 0, 0, 0], a = i.match(/[a-zA-Z]+|[0-9]+/g), o = t.match(/%[a-zA-Z]/g), s = 0; s < o.length; s++)
switch (o[s]) {
case "%j":
case "%d":
r[2] = a[s] || 1;
break;
case "%n":
case "%m":
r[1] = (a[s] || 1) - 1;
break;
case "%y":
r[0] = 1 * a[s] + (a[s] > 50 ? 1900 : 2e3);
break;
case "%g":
case "%G":
case "%h":
case "%H":
r[3] = a[s] || 0;
break;
case "%i":
r[4] = a[s] || 0;
break;
case "%Y":
r[0] = a[s] || 0;
break;
case "%a":
case "%A":
r[3] = r[3] % 12 + ("am" === (a[s] || "").toLowerCase() ? 0 : 12);
break;
case "%s":
r[5] = a[s] || 0;
break;
case "%M":
r[1] = n.locale.date.month_short_hash[a[s]] || 0;
break;
case "%F":
r[1] = n.locale.date.month_full_hash[a[s]] || 0
}
return e ? new Date(Date.UTC(r[0], r[1], r[2], r[3], r[4], r[5])) : new Date(r[0],r[1],r[2],r[3],r[4],r[5])
}
}
};
e.default = i
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = {
date_to_str: function(t, e, n) {
t = t.replace(/%[a-zA-Z]/g, function(t) {
switch (t) {
case "%d":
return '"+to_fixed(date.get' + (e ? "UTC" : "") + 'Date())+"';
case "%m":
return '"+to_fixed((date.get' + (e ? "UTC" : "") + 'Month()+1))+"';
case "%j":
return '"+date.get' + (e ? "UTC" : "") + 'Date()+"';
case "%n":
return '"+(date.get' + (e ? "UTC" : "") + 'Month()+1)+"';
case "%y":
return '"+to_fixed(date.get' + (e ? "UTC" : "") + 'FullYear()%100)+"';
case "%Y":
return '"+date.get' + (e ? "UTC" : "") + 'FullYear()+"';
case "%D":
return '"+locale.date.day_short[date.get' + (e ? "UTC" : "") + 'Day()]+"';
case "%l":
return '"+locale.date.day_full[date.get' + (e ? "UTC" : "") + 'Day()]+"';
case "%M":
return '"+locale.date.month_short[date.get' + (e ? "UTC" : "") + 'Month()]+"';
case "%F":
return '"+locale.date.month_full[date.get' + (e ? "UTC" : "") + 'Month()]+"';
case "%h":
return '"+to_fixed((date.get' + (e ? "UTC" : "") + 'Hours()+11)%12+1)+"';
case "%g":
return '"+((date.get' + (e ? "UTC" : "") + 'Hours()+11)%12+1)+"';
case "%G":
return '"+date.get' + (e ? "UTC" : "") + 'Hours()+"';
case "%H":
return '"+to_fixed(date.get' + (e ? "UTC" : "") + 'Hours())+"';
case "%i":
return '"+to_fixed(date.get' + (e ? "UTC" : "") + 'Minutes())+"';
case "%a":
return '"+(date.get' + (e ? "UTC" : "") + 'Hours()>11?"pm":"am")+"';
case "%A":
return '"+(date.get' + (e ? "UTC" : "") + 'Hours()>11?"PM":"AM")+"';
case "%s":
return '"+to_fixed(date.get' + (e ? "UTC" : "") + 'Seconds())+"';
case "%W":
return '"+to_fixed(getISOWeek(date))+"';
case "%w":
return '"+to_fixed(getWeek(date))+"';
default:
return t
}
});
var i = new Function("date","to_fixed","locale","getISOWeek","getWeek",'return "' + t + '";');
return function(t) {
return i(t, n.date.to_fixed, n.locale, n.date.getISOWeek, n.date.getWeek)
}
},
str_to_date: function(t, e, n) {
for (var i = "var temp=date.match(/[a-zA-Z]+|[0-9]+/g);", r = t.match(/%[a-zA-Z]/g), a = 0; a < r.length; a++)
switch (r[a]) {
case "%j":
case "%d":
i += "set[2]=temp[" + a + "]||1;";
break;
case "%n":
case "%m":
i += "set[1]=(temp[" + a + "]||1)-1;";
break;
case "%y":
i += "set[0]=temp[" + a + "]*1+(temp[" + a + "]>50?1900:2000);";
break;
case "%g":
case "%G":
case "%h":
case "%H":
i += "set[3]=temp[" + a + "]||0;";
break;
case "%i":
i += "set[4]=temp[" + a + "]||0;";
break;
case "%Y":
i += "set[0]=temp[" + a + "]||0;";
break;
case "%a":
case "%A":
i += "set[3]=set[3]%12+((temp[" + a + "]||'').toLowerCase()=='am'?0:12);";
break;
case "%s":
i += "set[5]=temp[" + a + "]||0;";
break;
case "%M":
i += "set[1]=locale.date.month_short_hash[temp[" + a + "]]||0;";
break;
case "%F":
i += "set[1]=locale.date.month_full_hash[temp[" + a + "]]||0;"
}
var o = "set[0],set[1],set[2],set[3],set[4],set[5]";
e && (o = " Date.UTC(" + o + ")");
var s = new Function("date","locale","var set=[0,0,1,0,0,0]; " + i + " return new Date(" + o + ");");
return function(t) {
return s(t, n.locale)
}
}
};
e.default = i
}
, function(t, e, n) {
var i = n(241).default
, r = n(240).default;
t.exports = function(t) {
var e = null;
function n() {
var n = !1;
return "auto" === t.config.csp ? (null === e && function() {
try {
new Function("canUseCsp = false;")
} catch (t) {
e = !0
}
}(),
n = e) : n = t.config.csp,
n
}
return {
init: function() {
for (var e = t.locale, n = e.date.month_short, i = e.date.month_short_hash = {}, r = 0; r < n.length; r++)
i[n[r]] = r;
for (n = e.date.month_full,
i = e.date.month_full_hash = {},
r = 0; r < n.length; r++)
i[n[r]] = r
},
date_part: function(t) {
var e = new Date(t);
return t.setHours(0),
this.hour_start(t),
t.getHours() && (t.getDate() < e.getDate() || t.getMonth() < e.getMonth() || t.getFullYear() < e.getFullYear()) && t.setTime(t.getTime() + 36e5 * (24 - t.getHours())),
t
},
time_part: function(t) {
return (t.valueOf() / 1e3 - 60 * t.getTimezoneOffset()) % 86400
},
week_start: function(e) {
var n = e.getDay();
return t.config.start_on_monday && (0 === n ? n = 6 : n--),
this.date_part(this.add(e, -1 * n, "day"))
},
month_start: function(t) {
return t.setDate(1),
this.date_part(t)
},
quarter_start: function(t) {
this.month_start(t);
var e, n = t.getMonth();
return e = n >= 9 ? 9 : n >= 6 ? 6 : n >= 3 ? 3 : 0,
t.setMonth(e),
t
},
year_start: function(t) {
return t.setMonth(0),
this.month_start(t)
},
day_start: function(t) {
return this.date_part(t)
},
hour_start: function(t) {
return t.getMinutes() && t.setMinutes(0),
this.minute_start(t),
t
},
minute_start: function(t) {
return t.getSeconds() && t.setSeconds(0),
t.getMilliseconds() && t.setMilliseconds(0),
t
},
_add_days: function(t, e, n) {
t.setDate(t.getDate() + e);
var i = e >= 0
, r = !n.getHours() && t.getHours()
, a = t.getDate() <= n.getDate() || t.getMonth() < n.getMonth() || t.getFullYear() < n.getFullYear();
return i && r && a && t.setTime(t.getTime() + 36e5 * (24 - t.getHours())),
e > 1 && r && t.setHours(0),
t
},
add: function(t, e, n) {
var i = new Date(t.valueOf());
switch (n) {
case "day":
i = this._add_days(i, e, t);
break;
case "week":
i = this._add_days(i, 7 * e, t);
break;
case "month":
i.setMonth(i.getMonth() + e);
break;
case "year":
i.setYear(i.getFullYear() + e);
break;
case "hour":
i.setTime(i.getTime() + 60 * e * 60 * 1e3);
break;
case "minute":
i.setTime(i.getTime() + 60 * e * 1e3);
break;
default:
return this["add_" + n](t, e, n)
}
return i
},
add_quarter: function(t, e) {
return this.add(t, 3 * e, "month")
},
to_fixed: function(t) {
return t < 10 ? "0" + t : t
},
copy: function(t) {
return new Date(t.valueOf())
},
date_to_str: function(e, a) {
var o = i;
return n() && (o = r),
o.date_to_str(e, a, t)
},
str_to_date: function(e, a) {
var o = i;
return n() && (o = r),
o.str_to_date(e, a, t)
},
getISOWeek: function(e) {
return t.date._getWeekNumber(e, !0)
},
_getWeekNumber: function(t, e) {
if (!t)
return !1;
var n = t.getDay();
e && 0 === n && (n = 7);
var i = new Date(t.valueOf());
i.setDate(t.getDate() + (4 - n));
var r = i.getFullYear()
, a = Math.round((i.getTime() - new Date(r,0,1).getTime()) / 864e5);
return 1 + Math.floor(a / 7)
},
getWeek: function(e) {
return t.date._getWeekNumber(e, t.config.start_on_monday)
},
getUTCISOWeek: function(e) {
return t.date.getISOWeek(e)
},
convert_to_utc: function(t) {
return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds())
},
parseDate: function(e, n) {
return e && !e.getFullYear && ("function" != typeof n && (n = "string" == typeof n ? "parse_date" === n || "xml_date" === n ? t.defined(t.templates.xml_date) ? t.templates.xml_date : t.templates.parse_date : t.defined(t.templates[n]) ? t.templates[n] : t.date.str_to_date(n) : t.defined(t.templates.xml_date) ? t.templates.xml_date : t.templates.parse_date),
e = e ? n(e) : null),
e
}
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
}),
e.default = function(t) {
if ("string" == typeof t || "number" == typeof t)
return t;
var e = "";
for (var n in t) {
var i = "";
t.hasOwnProperty(n) && (i = n + "=" + (i = "string" == typeof t[n] ? encodeURIComponent(t[n]) : "number" == typeof t[n] ? t[n] : encodeURIComponent(JSON.stringify(t[n]))),
e.length && (i = "&" + i),
e += i)
}
return e
}
}
, function(t, e, n) {
function i(t) {
"@babel/helpers - typeof";
return (i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
var r = n(11)
, a = n(21)
, o = n(243).default;
function s(t, e) {
var n = {
method: t
};
if (0 === e.length)
throw new Error("Arguments list of query is wrong.");
if (1 === e.length)
return "string" == typeof e[0] ? (n.url = e[0],
n.async = !0) : (n.url = e[0].url,
n.async = e[0].async || !0,
n.callback = e[0].callback,
n.headers = e[0].headers),
e[0].data ? "string" != typeof e[0].data ? n.data = o(e[0].data) : n.data = e[0].data : n.data = "",
n;
switch (n.url = e[0],
t) {
case "GET":
case "DELETE":
n.callback = e[1],
n.headers = e[2];
break;
case "POST":
case "PUT":
e[1] ? "string" != typeof e[1] ? n.data = o(e[1]) : n.data = e[1] : n.data = "",
n.callback = e[2],
n.headers = e[3]
}
return n
}
t.exports = function(t) {
return {
cache: !0,
method: "get",
parse: function(t) {
return "string" != typeof t ? t : (t = t.replace(/^[\s]+/, ""),
"undefined" == typeof DOMParser || r.isIE ? void 0 !== a.ActiveXObject && ((e = new a.ActiveXObject("Microsoft.XMLDOM")).async = "false",
e.loadXML(t)) : e = (new DOMParser).parseFromString(t, "text/xml"),
e);
var e
},
xmltop: function(e, n, i) {
if (void 0 === n.status || n.status < 400) {
var r = n.responseXML ? n.responseXML || n : this.parse(n.responseText || n);
if (r && null !== r.documentElement && !r.getElementsByTagName("parsererror").length)
return r.getElementsByTagName(e)[0]
}
return -1 !== i && t.callEvent("onLoadXMLError", ["Incorrect XML", arguments[1], i]),
document.createElement("DIV")
},
xpath: function(t, e) {
if (e.nodeName || (e = e.responseXML || e),
r.isIE)
return e.selectNodes(t) || [];
for (var n, i = [], a = (e.ownerDocument || e).evaluate(t, e, null, XPathResult.ANY_TYPE, null); n = a.iterateNext(); )
i.push(n);
return i
},
query: function(t) {
return this._call(t.method || "GET", t.url, t.data || "", t.async || !0, t.callback, t.headers)
},
get: function(t, e, n) {
var i = s("GET", arguments);
return this.query(i)
},
getSync: function(t, e) {
var n = s("GET", arguments);
return n.async = !1,
this.query(n)
},
put: function(t, e, n, i) {
var r = s("PUT", arguments);
return this.query(r)
},
del: function(t, e, n) {
var i = s("DELETE", arguments);
return this.query(i)
},
post: function(t, e, n, i) {
1 == arguments.length ? e = "" : 2 == arguments.length && "function" == typeof e && (e,
e = "");
var r = s("POST", arguments);
return this.query(r)
},
postSync: function(t, e, n) {
e = null === e ? "" : String(e);
var i = s("POST", arguments);
return i.async = !1,
this.query(i)
},
_call: function(e, n, r, o, s, l) {
return new t.Promise(function(c, u) {
var d = void 0 !== ("undefined" == typeof XMLHttpRequest ? "undefined" : i(XMLHttpRequest)) ? new XMLHttpRequest : new a.ActiveXObject("Microsoft.XMLHTTP")
, h = null !== navigator.userAgent.match(/AppleWebKit/) && null !== navigator.userAgent.match(/Qt/) && null !== navigator.userAgent.match(/Safari/);
o && (d.onreadystatechange = function() {
if (4 == d.readyState || h && 3 == d.readyState) {
if ((200 != d.status || "" === d.responseText) && !t.callEvent("onAjaxError", [d]))
return;
setTimeout(function() {
"function" == typeof s && s.apply(a, [{
xmlDoc: d,
filePath: n
}]),
c(d),
"function" == typeof s && (s = null,
d = null)
}, 0)
}
}
);
var f = !this || !this.cache;
if ("GET" == e && f && (n += (n.indexOf("?") >= 0 ? "&" : "?") + "dhxr" + (new Date).getTime() + "=1"),
d.open(e, n, o),
l)
for (var _ in l)
d.setRequestHeader(_, l[_]);
else
"POST" == e.toUpperCase() || "PUT" == e || "DELETE" == e ? d.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") : "GET" == e && (r = null);
if (d.setRequestHeader("X-Requested-With", "XMLHttpRequest"),
d.send(r),
!o)
return {
xmlDoc: d,
filePath: n
}
}
)
},
urlSeparator: function(t) {
return -1 != t.indexOf("?") ? "&" : "?"
}
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
}),
t.exports = function() {
return {
layout: {
css: "gantt_container",
rows: [{
cols: [{
view: "grid",
scrollX: "scrollHor",
scrollY: "scrollVer"
}, {
resizer: !0,
width: 1
}, {
view: "timeline",
scrollX: "scrollHor",
scrollY: "scrollVer"
}, {
view: "scrollbar",
id: "scrollVer"
}]
}, {
view: "scrollbar",
id: "scrollHor",
height: 20
}]
},
links: {
finish_to_start: "0",
start_to_start: "1",
finish_to_finish: "2",
start_to_finish: "3"
},
types: {
task: "task",
project: "project",
milestone: "milestone"
},
auto_types: !1,
duration_unit: "day",
work_time: !1,
correct_work_time: !1,
skip_off_time: !1,
cascade_delete: !0,
autosize: !1,
autosize_min_width: 0,
autoscroll: !0,
autoscroll_speed: 30,
deepcopy_on_parse: !1,
show_links: !0,
show_task_cells: !0,
static_background: !1,
static_background_cells: !0,
branch_loading: !1,
branch_loading_property: "$has_child",
show_loading: !1,
show_chart: !0,
show_grid: !0,
min_duration: 36e5,
date_format: "%d-%m-%Y %H:%i",
xml_date: void 0,
start_on_monday: !0,
server_utc: !1,
show_progress: !0,
fit_tasks: !1,
select_task: !0,
scroll_on_click: !0,
smart_rendering: !0,
preserve_scroll: !0,
readonly: !1,
container_resize_timeout: 20,
date_grid: "%Y-%m-%d",
drag_links: !0,
drag_progress: !0,
drag_resize: !0,
drag_project: !1,
drag_move: !0,
drag_mode: {
resize: "resize",
progress: "progress",
move: "move",
ignore: "ignore"
},
round_dnd_dates: !0,
link_wrapper_width: 20,
root_id: 0,
autofit: !1,
columns: [{
name: "text",
tree: !0,
width: "*",
resize: !0
}, {
name: "start_date",
align: "center",
resize: !0
}, {
name: "duration",
align: "center"
}, {
name: "add",
width: 44
}],
scale_offset_minimal: !0,
inherit_scale_class: !1,
scales: [{
unit: "day",
step: 1,
date: "%d %M"
}],
time_step: 60,
duration_step: 1,
task_date: "%d %F %Y",
time_picker: "%H:%i",
task_attribute: "data-task-id",
link_attribute: "data-link-id",
layer_attribute: "data-layer",
buttons_left: ["gantt_save_btn", "gantt_cancel_btn"],
_migrate_buttons: {
dhx_save_btn: "gantt_save_btn",
dhx_cancel_btn: "gantt_cancel_btn",
dhx_delete_btn: "gantt_delete_btn"
},
buttons_right: ["gantt_delete_btn"],
lightbox: {
sections: [{
name: "description",
height: 70,
map_to: "text",
type: "textarea",
focus: !0
}, {
name: "time",
type: "duration",
map_to: "auto"
}],
project_sections: [{
name: "description",
height: 70,
map_to: "text",
type: "textarea",
focus: !0
}, {
name: "type",
type: "typeselect",
map_to: "type"
}, {
name: "time",
type: "duration",
readonly: !0,
map_to: "auto"
}],
milestone_sections: [{
name: "description",
height: 70,
map_to: "text",
type: "textarea",
focus: !0
}, {
name: "type",
type: "typeselect",
map_to: "type"
}, {
name: "time",
type: "duration",
single_date: !0,
map_to: "auto"
}]
},
drag_lightbox: !0,
sort: !1,
details_on_create: !0,
details_on_dblclick: !0,
initial_scroll: !0,
task_scroll_offset: 100,
order_branch: !1,
order_branch_free: !1,
task_height: void 0,
bar_height: "full",
min_column_width: 70,
min_grid_column_width: 70,
grid_resizer_column_attribute: "data-column-index",
keep_grid_width: !1,
grid_resize: !1,
grid_elastic_columns: !1,
show_tasks_outside_timescale: !1,
show_unscheduled: !0,
resize_rows: !1,
task_grid_row_resizer_attribute: "data-row-index",
min_task_grid_row_height: 30,
readonly_property: "readonly",
editable_property: "editable",
calendar_property: "calendar_id",
resource_calendars: {},
dynamic_resource_calendars: !1,
inherit_calendar: !1,
type_renderers: {},
open_tree_initially: !1,
optimize_render: !0,
prevent_default_scroll: !1,
show_errors: !0,
wai_aria_attributes: !0,
smart_scales: !0,
rtl: !1,
placeholder_task: !1,
horizontal_scroll_key: "shiftKey",
drag_timeline: {
useKey: void 0,
ignore: ".gantt_task_line, .gantt_task_link"
},
drag_multiple: !0,
csp: "auto"
}
}
}
, function(t, e) {
t.exports = function() {
var t = {};
return {
services: {},
setService: function(e, n) {
t[e] = n
},
getService: function(e) {
return t[e] ? t[e]() : null
},
dropService: function(e) {
t[e] && delete t[e]
},
destructor: function() {
for (var e in t)
if (t[e]) {
var n = t[e];
n && n.destructor && n.destructor()
}
t = null
}
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = function() {
return function(t) {
var e = this;
for (var n in this.addExtension = function(t, n) {
e._extensions[t] = n
}
,
this.getExtension = function(t) {
return e._extensions[t]
}
,
this._extensions = {},
t)
this._extensions[n] = t[n]
}
}();
e.default = i
}
, function(t, e) {
t.exports = {
KEY_CODES: {
UP: 38,
DOWN: 40,
LEFT: 37,
RIGHT: 39,
SPACE: 32,
ENTER: 13,
DELETE: 46,
ESC: 27,
TAB: 9
}
}
}
, function(t, e, n) {
function i(t) {
"@babel/helpers - typeof";
return (i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
t.exports = function(t) {
var e = new function() {
this.constants = n(248),
this.version = "8.0.6",
this.license = "gpl",
this.templates = {},
this.ext = {},
this.keys = {
edit_save: this.constants.KEY_CODES.ENTER,
edit_cancel: this.constants.KEY_CODES.ESC
}
}
, r = new (0,
n(247).default)(t)
, a = {};
e.plugins = function(t) {
for (var n in t)
if (t[n] && !a[n]) {
var i = r.getExtension(n);
i && (i(e),
a[n] = !0)
}
return a
}
,
e.$services = n(246)(),
e.config = n(245)(),
e.ajax = n(244)(e),
e.date = n(242)(e),
e.RemoteEvents = n(239).remoteEvents;
var o = n(237)(e);
e.$services.setService("dnd", function() {
return o
});
var s = n(236)(e);
e.$services.setService("templateLoader", function() {
return s
}),
n(5)(e);
var l = new (n(235));
l.registerProvider("global", function() {
var t = {
min_date: e._min_date,
max_date: e._max_date,
selected_task: null
};
return e.$data && e.$data.tasksStore && (t.selected_task = e.$data.tasksStore.getSelectedId()),
t
}),
e.getState = l.getState,
e.$services.setService("state", function() {
return l
});
var c = n(0);
c.mixin(e, c),
e.Promise = n(234),
e.env = n(11),
n(232)(e);
var u = n(226);
e.dataProcessor = u.DEPRECATED_api,
e.createDataProcessor = u.createDataProcessor,
n(221)(e),
n(211)(e),
n(210)(e),
n(202)(e),
n(201)(e),
n(200)(e),
n(187)(e),
n(186).default(e),
n(185)(e),
n(184)(e),
n(183)(e),
n(180)(e),
n(179).default(e);
var d = n(178).default();
return e.i18n = {
addLocale: d.addLocale,
setLocale: function(t) {
if ("string" == typeof t) {
var n = d.getLocale(t);
n || (n = d.getLocale("en")),
e.locale = n
} else if (t)
if (e.locale)
for (var r in t)
t[r] && "object" === i(t[r]) ? (e.locale[r] || (e.locale[r] = {}),
e.mixin(e.locale[r], t[r], !0)) : e.locale[r] = t[r];
else
e.locale = t
},
getLocale: d.getLocale
},
e.i18n.setLocale("en"),
e
}
}
, function(t, e, n) {
n(35);
var i = n(249);
t.exports = function(t) {
var e = i(t);
return e.env.isNode || n(144)(e),
e
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = 100
, r = function() {
function t(t) {
var e = this;
this.maxSteps = i,
this.undoEnabled = !0,
this.redoEnabled = !0,
this.action = {
create: function(t) {
return {
commands: t ? t.slice() : []
}
},
invert: function(t) {
for (var n, i = e._gantt.copy(t), r = e.command, a = 0; a < t.commands.length; a++) {
var o = i.commands[a] = r.invert(i.commands[a]);
o.type !== r.type.update && o.type !== r.type.move || (n = [o.oldValue, o.value],
o.value = n[0],
o.oldValue = n[1])
}
return i
}
},
this.command = {
entity: null,
type: null,
create: function(t, n, i, r) {
var a = e._gantt;
return {
entity: r,
type: i,
value: a.copy(t),
oldValue: a.copy(n || t)
}
},
invert: function(t) {
var n = e._gantt.copy(t);
return n.type = e.command.inverseCommands(t.type),
n
},
inverseCommands: function(t) {
var n = e._gantt
, i = e.command.type;
switch (t) {
case i.update:
return i.update;
case i.remove:
return i.add;
case i.add:
return i.remove;
case i.move:
return i.move;
default:
return n.assert(!1, "Invalid command " + t),
null
}
}
},
this._undoStack = [],
this._redoStack = [],
this._gantt = t
}
return t.prototype.getUndoStack = function() {
return this._undoStack
}
,
t.prototype.setUndoStack = function(t) {
this._undoStack = t
}
,
t.prototype.getRedoStack = function() {
return this._redoStack
}
,
t.prototype.setRedoStack = function(t) {
this._redoStack = t
}
,
t.prototype.clearUndoStack = function() {
this._undoStack = []
}
,
t.prototype.clearRedoStack = function() {
this._redoStack = []
}
,
t.prototype.updateConfigs = function() {
var t = this._gantt;
this.maxSteps = t.config.undo_steps || i,
this.command.entity = t.config.undo_types,
this.command.type = t.config.undo_actions,
this.undoEnabled = !!t.config.undo,
this.redoEnabled = !!t.config.redo
}
,
t.prototype.undo = function() {
var t = this._gantt;
if (this.updateConfigs(),
this.undoEnabled) {
var e = this._pop(this._undoStack);
if (e && this._reorderCommands(e),
!1 !== t.callEvent("onBeforeUndo", [e]) && e)
return this._applyAction(this.action.invert(e)),
this._push(this._redoStack, t.copy(e)),
void t.callEvent("onAfterUndo", [e]);
t.callEvent("onAfterUndo", [null])
}
}
,
t.prototype.redo = function() {
var t = this._gantt;
if (this.updateConfigs(),
this.redoEnabled) {
var e = this._pop(this._redoStack);
if (e && this._reorderCommands(e),
!1 !== t.callEvent("onBeforeRedo", [e]) && e)
return this._applyAction(e),
this._push(this._undoStack, t.copy(e)),
void t.callEvent("onAfterRedo", [e]);
t.callEvent("onAfterRedo", [null])
}
}
,
t.prototype.logAction = function(t) {
this._push(this._undoStack, t),
this._redoStack = []
}
,
t.prototype._push = function(t, e) {
var n = this._gantt;
if (e.commands.length) {
var i = t === this._undoStack ? "onBeforeUndoStack" : "onBeforeRedoStack";
if (!1 !== n.callEvent(i, [e]) && e.commands.length) {
for (t.push(e); t.length > this.maxSteps; )
t.shift();
return e
}
}
}
,
t.prototype._pop = function(t) {
return t.pop()
}
,
t.prototype._reorderCommands = function(t) {
var e = {
any: 0,
link: 1,
task: 2
}
, n = {
move: 1,
any: 0
};
t.commands.sort(function(t, i) {
if ("task" === t.entity && "task" === i.entity)
return t.type !== i.type ? (n[i.type] || 0) - (n[t.type] || 0) : "move" === t.type && t.oldValue && i.oldValue && i.oldValue.parent === t.oldValue.parent ? t.oldValue.$index - i.oldValue.$index : 0;
var r = e[t.entity] || e.any;
return (e[i.entity] || e.any) - r
})
}
,
t.prototype._applyAction = function(t) {
var e = null
, n = this.command.entity
, i = this.command.type
, r = this._gantt
, a = {};
a[n.task] = {
add: "addTask",
get: "getTask",
update: "updateTask",
remove: "deleteTask",
move: "moveTask",
isExists: "isTaskExists"
},
a[n.link] = {
add: "addLink",
get: "getLink",
update: "updateLink",
remove: "deleteLink",
isExists: "isLinkExists"
},
r.batchUpdate(function() {
for (var n = 0; n < t.commands.length; n++) {
e = t.commands[n];
var o = a[e.entity][e.type]
, s = a[e.entity].get
, l = a[e.entity].isExists;
if (e.type === i.add)
r[o](e.oldValue, e.oldValue.parent, e.oldValue.$local_index);
else if (e.type === i.remove)
r[l](e.value.id) && r[o](e.value.id);
else if (e.type === i.update) {
var c = r[s](e.value.id);
for (var u in e.value)
u.startsWith("$") || u.startsWith("_") || (c[u] = e.value[u]);
r[o](e.value.id)
} else
e.type === i.move && (r[o](e.value.id, e.value.$local_index, e.value.parent),
r.callEvent("onRowDragEnd", [e.value.id]))
}
})
}
,
t
}();
e.Undo = r
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = {
onBeforeUndo: "onAfterUndo",
onBeforeRedo: "onAfterRedo"
}
, r = ["onTaskDragStart", "onAfterTaskUpdate", "onAfterTaskDelete", "onBeforeBatchUpdate"]
, a = function() {
function t(t, e) {
this._batchAction = null,
this._batchMode = !1,
this._ignore = !1,
this._ignoreMoveEvents = !1,
this._initialTasks = {},
this._initialLinks = {},
this._nestedTasks = {},
this._nestedLinks = {},
this._undo = t,
this._gantt = e,
this._attachEvents()
}
return t.prototype.store = function(t, e, n) {
return void 0 === n && (n = !1),
e === this._gantt.config.undo_types.task ? this._storeTask(t, n) : e === this._gantt.config.undo_types.link && this._storeLink(t, n)
}
,
t.prototype.isMoveEventsIgnored = function() {
return this._ignoreMoveEvents
}
,
t.prototype.toggleIgnoreMoveEvents = function(t) {
this._ignoreMoveEvents = t || !1
}
,
t.prototype.startIgnore = function() {
this._ignore = !0
}
,
t.prototype.stopIgnore = function() {
this._ignore = !1
}
,
t.prototype.startBatchAction = function() {
var t = this;
this._timeout || (this._timeout = setTimeout(function() {
t.stopBatchAction(),
t._timeout = null
}, 10)),
this._ignore || this._batchMode || (this._batchMode = !0,
this._batchAction = this._undo.action.create())
}
,
t.prototype.stopBatchAction = function() {
if (!this._ignore) {
var t = this._undo;
this._batchAction && t.logAction(this._batchAction),
this._batchMode = !1,
this._batchAction = null
}
}
,
t.prototype.onTaskAdded = function(t) {
this._ignore || this._storeTaskCommand(t, this._undo.command.type.add)
}
,
t.prototype.onTaskUpdated = function(t) {
this._ignore || this._storeTaskCommand(t, this._undo.command.type.update)
}
,
t.prototype.onTaskMoved = function(t) {
if (!this._ignore) {
t.$local_index = this._gantt.getTaskIndex(t.id);
var e = this.getInitialTask(t.id);
if (t.$local_index === e.$local_index && this._gantt.getParent(t) === this._gantt.getParent(e))
return;
this._storeEntityCommand(t, this.getInitialTask(t.id), this._undo.command.type.move, this._undo.command.entity.task)
}
}
,
t.prototype.onTaskDeleted = function(t) {
if (!this._ignore) {
if (this._storeTaskCommand(t, this._undo.command.type.remove),
this._nestedTasks[t.id])
for (var e = this._nestedTasks[t.id], n = 0; n < e.length; n++)
this._storeTaskCommand(e[n], this._undo.command.type.remove);
if (this._nestedLinks[t.id]) {
var i = this._nestedLinks[t.id];
for (n = 0; n < i.length; n++)
this._storeLinkCommand(i[n], this._undo.command.type.remove)
}
}
}
,
t.prototype.onLinkAdded = function(t) {
this._ignore || this._storeLinkCommand(t, this._undo.command.type.add)
}
,
t.prototype.onLinkUpdated = function(t) {
this._ignore || this._storeLinkCommand(t, this._undo.command.type.update)
}
,
t.prototype.onLinkDeleted = function(t) {
this._ignore || this._storeLinkCommand(t, this._undo.command.type.remove)
}
,
t.prototype.setNestedTasks = function(t, e) {
for (var n = this._gantt, i = null, r = [], a = this._getLinks(n.getTask(t)), o = 0; o < e.length; o++)
i = this.setInitialTask(e[o]),
a = a.concat(this._getLinks(i)),
r.push(i);
var s = {};
for (o = 0; o < a.length; o++)
s[a[o]] = !0;
var l = [];
for (var o in s)
l.push(this.setInitialLink(o));
this._nestedTasks[t] = r,
this._nestedLinks[t] = l
}
,
t.prototype.setInitialTask = function(t, e) {
var n = this._gantt;
if (e || !this._initialTasks[t] || !this._batchMode) {
var i = n.copy(n.getTask(t));
i.$index = n.getGlobalTaskIndex(t),
i.$local_index = n.getTaskIndex(t),
this.setInitialTaskObject(t, i)
}
return this._initialTasks[t]
}
,
t.prototype.getInitialTask = function(t) {
return this._initialTasks[t]
}
,
t.prototype.clearInitialTasks = function() {
this._initialTasks = {}
}
,
t.prototype.setInitialTaskObject = function(t, e) {
this._initialTasks[t] = e
}
,
t.prototype.setInitialLink = function(t, e) {
return this._initialLinks[t] && this._batchMode || (this._initialLinks[t] = this._gantt.copy(this._gantt.getLink(t))),
this._initialLinks[t]
}
,
t.prototype.getInitialLink = function(t) {
return this._initialLinks[t]
}
,
t.prototype.clearInitialLinks = function() {
this._initialLinks = {}
}
,
t.prototype._attachEvents = function() {
var t = this
, e = null
, n = this._gantt
, a = function() {
e || (e = setTimeout(function() {
e = null
}),
t.clearInitialTasks(),
n.eachTask(function(e) {
t.setInitialTask(e.id)
}),
t.clearInitialLinks(),
n.getLinks().forEach(function(e) {
t.setInitialLink(e.id)
}))
}
, o = function(t) {
return n.copy(n.getTask(t))
};
for (var s in i)
n.attachEvent(s, function() {
return t.startIgnore(),
!0
}),
n.attachEvent(i[s], function() {
return t.stopIgnore(),
!0
});
for (s = 0; s < r.length; s++)
n.attachEvent(r[s], function() {
return t.startBatchAction(),
!0
});
n.attachEvent("onParse", function() {
t._undo.clearUndoStack(),
t._undo.clearRedoStack(),
a()
}),
n.attachEvent("onAfterTaskAdd", function(e, n) {
t.setInitialTask(e, !0),
t.onTaskAdded(n)
}),
n.attachEvent("onAfterTaskUpdate", function(e, n) {
t.onTaskUpdated(n)
}),
n.attachEvent("onAfterTaskDelete", function(e, n) {
t.onTaskDeleted(n)
}),
n.attachEvent("onAfterLinkAdd", function(e, n) {
t.setInitialLink(e, !0),
t.onLinkAdded(n)
}),
n.attachEvent("onAfterLinkUpdate", function(e, n) {
t.onLinkUpdated(n)
}),
n.attachEvent("onAfterLinkDelete", function(e, n) {
t.onLinkDeleted(n)
}),
n.attachEvent("onRowDragEnd", function(e, n) {
return t.onTaskMoved(o(e)),
t.toggleIgnoreMoveEvents(),
!0
}),
n.attachEvent("onBeforeTaskDelete", function(e) {
t.store(e, n.config.undo_types.task);
var i = [];
return a(),
n.eachTask(function(t) {
i.push(t.id)
}, e),
t.setNestedTasks(e, i),
!0
});
var l = n.getDatastore("task");
l.attachEvent("onBeforeItemMove", function(e, n, i) {
return t.isMoveEventsIgnored() || a(),
!0
}),
l.attachEvent("onAfterItemMove", function(e, n, i) {
return t.isMoveEventsIgnored() || t.onTaskMoved(o(e)),
!0
}),
n.attachEvent("onRowDragStart", function(e, n, i) {
return t.toggleIgnoreMoveEvents(!0),
a(),
!0
}),
n.attachEvent("onBeforeTaskDrag", function(e) {
return t.store(e, n.config.undo_types.task)
}),
n.attachEvent("onLightbox", function(e) {
return t.store(e, n.config.undo_types.task)
}),
n.attachEvent("onBeforeTaskAutoSchedule", function(e) {
return t.store(e.id, n.config.undo_types.task),
!0
}),
n.ext.inlineEditors && n.ext.inlineEditors.attachEvent("onEditStart", function(e) {
t.store(e.id, n.config.undo_types.task)
})
}
,
t.prototype._storeCommand = function(t) {
var e = this._undo;
if (e.updateConfigs(),
e.undoEnabled)
if (this._batchMode)
this._batchAction.commands.push(t);
else {
var n = e.action.create([t]);
e.logAction(n)
}
}
,
t.prototype._storeEntityCommand = function(t, e, n, i) {
var r = this._undo.command.create(t, e, n, i);
this._storeCommand(r)
}
,
t.prototype._storeTaskCommand = function(t, e) {
this._gantt.isTaskExists(t.id) && (t.$local_index = this._gantt.getTaskIndex(t.id)),
this._storeEntityCommand(t, this.getInitialTask(t.id), e, this._undo.command.entity.task)
}
,
t.prototype._storeLinkCommand = function(t, e) {
this._storeEntityCommand(t, this.getInitialLink(t.id), e, this._undo.command.entity.link)
}
,
t.prototype._getLinks = function(t) {
return t.$source.concat(t.$target)
}
,
t.prototype._storeTask = function(t, e) {
var n = this;
void 0 === e && (e = !1);
var i = this._gantt;
return this.setInitialTask(t, e),
i.eachTask(function(t) {
n.setInitialTask(t.id)
}, t),
!0
}
,
t.prototype._storeLink = function(t, e) {
return void 0 === e && (e = !1),
this.setInitialLink(t, e),
!0
}
,
t
}();
e.Monitor = a
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(252)
, r = n(251);
e.default = function(t) {
var e = new r.Undo(t)
, n = new i.Monitor(e,t);
function a(t, e, n) {
t && (t.id === e && (t.id = n),
t.parent === e && (t.parent = n))
}
function o(t, e, n) {
a(t.value, e, n),
a(t.oldValue, e, n)
}
function s(t, e, n) {
t && (t.source === e && (t.source = n),
t.target === e && (t.target = n))
}
function l(t, e, n) {
s(t.value, e, n),
s(t.oldValue, e, n)
}
function c(t, n, i) {
for (var r = e, a = 0; a < t.length; a++)
for (var s = t[a], c = 0; c < s.commands.length; c++)
s.commands[c].entity === r.command.entity.task ? o(s.commands[c], n, i) : s.commands[c].entity === r.command.entity.link && l(s.commands[c], n, i)
}
function u(t, n, i) {
for (var r = e, a = 0; a < t.length; a++)
for (var o = t[a], s = 0; s < o.commands.length; s++) {
var l = o.commands[s];
l.entity === r.command.entity.link && (l.value && l.value.id === n && (l.value.id = i),
l.oldValue && l.oldValue.id === n && (l.oldValue.id = i))
}
}
t.config.undo = !0,
t.config.redo = !0,
t.config.undo_types = {
link: "link",
task: "task"
},
t.config.undo_actions = {
update: "update",
remove: "remove",
add: "add",
move: "move"
},
t.ext || (t.ext = {}),
t.ext.undo = {
undo: function() {
return e.undo()
},
redo: function() {
return e.redo()
},
getUndoStack: function() {
return e.getUndoStack()
},
setUndoStack: function(t) {
return e.setUndoStack(t)
},
getRedoStack: function() {
return e.getRedoStack()
},
setRedoStack: function(t) {
return e.setRedoStack(t)
},
clearUndoStack: function() {
return e.clearUndoStack()
},
clearRedoStack: function() {
return e.clearRedoStack()
},
saveState: function(t, e) {
return n.store(t, e, !0)
},
getInitialState: function(e, i) {
return i === t.config.undo_types.link ? n.getInitialLink(e) : n.getInitialTask(e)
}
},
t.undo = t.ext.undo.undo,
t.redo = t.ext.undo.redo,
t.getUndoStack = t.ext.undo.getUndoStack,
t.getRedoStack = t.ext.undo.getRedoStack,
t.clearUndoStack = t.ext.undo.clearUndoStack,
t.clearRedoStack = t.ext.undo.clearRedoStack,
t.attachEvent("onTaskIdChange", function(t, n) {
var i = e;
c(i.getUndoStack(), t, n),
c(i.getRedoStack(), t, n)
}),
t.attachEvent("onLinkIdChange", function(t, n) {
var i = e;
u(i.getUndoStack(), t, n),
u(i.getRedoStack(), t, n)
}),
t.attachEvent("onGanttReady", function() {
e.updateConfigs()
})
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(1)
, r = function() {
function t(t) {
this._gantt = t
}
return t.prototype.getNode = function() {
var t = this._gantt;
return this._tooltipNode || (this._tooltipNode = document.createElement("div"),
this._tooltipNode.className = "gantt_tooltip",
t._waiAria.tooltipAttr(this._tooltipNode)),
this._tooltipNode
}
,
t.prototype.setViewport = function(t) {
return this._root = t,
this
}
,
t.prototype.show = function(t, e) {
var n = this._gantt
, r = document.body
, a = this.getNode();
if (i.isChildOf(a, r) || (this.hide(),
r.appendChild(a)),
this._isLikeMouseEvent(t)) {
var o = this._calculateTooltipPosition(t);
e = o.top,
t = o.left
}
return a.style.top = e + "px",
a.style.left = t + "px",
n._waiAria.tooltipVisibleAttr(a),
this
}
,
t.prototype.hide = function() {
var t = this._gantt
, e = this.getNode();
return e && e.parentNode && e.parentNode.removeChild(e),
t._waiAria.tooltipHiddenAttr(e),
this
}
,
t.prototype.setContent = function(t) {
return this.getNode().innerHTML = t,
this
}
,
t.prototype._isLikeMouseEvent = function(t) {
return !(!t || "object" != typeof t) && ("clientX"in t && "clientY"in t)
}
,
t.prototype._getViewPort = function() {
return this._root || document.body
}
,
t.prototype._calculateTooltipPosition = function(t) {
var e = this._gantt
, n = this._getViewPortSize()
, r = this.getNode()
, a = {
top: 0,
left: 0,
width: r.offsetWidth,
height: r.offsetHeight,
bottom: 0,
right: 0
}
, o = e.config.tooltip_offset_x
, s = e.config.tooltip_offset_y
, l = document.body
, c = i.getRelativeEventPosition(t, l)
, u = i.getNodePosition(l);
c.y += u.y,
a.top = c.y,
a.left = c.x,
a.top += s,
a.left += o,
a.bottom = a.top + a.height,
a.right = a.left + a.width;
var d = window.scrollY + l.scrollTop;
return a.top < n.top - d ? (a.top = n.top,
a.bottom = a.top + a.height) : a.bottom > n.bottom && (a.bottom = n.bottom,
a.top = a.bottom - a.height),
a.left < n.left ? (a.left = n.left,
a.right = n.left + a.width) : a.right > n.right && (a.right = n.right,
a.left = a.right - a.width),
c.x >= a.left && c.x <= a.right && (a.left = c.x - a.width - o,
a.right = a.left + a.width),
c.y >= a.top && c.y <= a.bottom && (a.top = c.y - a.height - s,
a.bottom = a.top + a.height),
a
}
,
t.prototype._getViewPortSize = function() {
var t, e = this._gantt, n = this._getViewPort(), r = n, a = window.scrollY + document.body.scrollTop, o = window.scrollX + document.body.scrollLeft;
return n === e.$task_data ? (r = e.$task,
a = 0,
o = 0,
t = i.getNodePosition(e.$task)) : t = i.getNodePosition(r),
{
left: t.x + o,
top: t.y + a,
width: t.width,
height: t.height,
bottom: t.y + t.height + a,
right: t.x + t.width + o
}
}
,
t
}();
e.Tooltip = r
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(51)
, r = n(1)
, a = n(2)
, o = n(254)
, s = function() {
function t(t) {
this._listeners = {},
this.tooltip = new o.Tooltip(t),
this._gantt = t,
this._domEvents = i(),
this._initDelayedFunctions()
}
return t.prototype.destructor = function() {
this.tooltip.hide(),
this._domEvents.detachAll()
}
,
t.prototype.hideTooltip = function() {
this.delayHide()
}
,
t.prototype.attach = function(t) {
var e = this
, n = document.body
, i = this._gantt;
t.global || (n = i.$root);
var a = null
, o = function(n) {
var i = r.getTargetNode(n)
, o = r.closest(i, t.selector);
if (!r.isChildOf(i, e.tooltip.getNode())) {
var s = function() {
a = o,
t.onmouseenter(n, o)
};
a ? o && o === a ? t.onmousemove(n, o) : (t.onmouseleave(n, a),
a = null,
o && o !== a && s()) : o && s()
}
};
this.detach(t.selector),
this._domEvents.attach(n, "mousemove", o),
this._listeners[t.selector] = {
node: n,
handler: o
}
}
,
t.prototype.detach = function(t) {
var e = this._listeners[t];
e && this._domEvents.detach(e.node, "mousemove", e.handler)
}
,
t.prototype.tooltipFor = function(t) {
var e = this
, n = function(t) {
var e = t;
return document.createEventObject && !document.createEvent && (e = document.createEventObject(t)),
e
};
this._initDelayedFunctions(),
this.attach({
selector: t.selector,
global: t.global,
onmouseenter: function(i, r) {
var a = t.html(i, r);
a && e.delayShow(n(i), a)
},
onmousemove: function(i, r) {
var a = t.html(i, r);
a ? e.delayShow(n(i), a) : (e.delayShow.$cancelTimeout(),
e.delayHide())
},
onmouseleave: function() {
e.delayShow.$cancelTimeout(),
e.delayHide()
}
})
}
,
t.prototype._initDelayedFunctions = function() {
var t = this
, e = this._gantt;
this.delayShow && this.delayShow.$cancelTimeout(),
this.delayHide && this.delayHide.$cancelTimeout(),
this.tooltip.hide(),
this.delayShow = a.delay(function(n, i) {
!1 === e.callEvent("onBeforeTooltip", [n]) ? t.tooltip.hide() : (t.tooltip.setContent(i),
t.tooltip.show(n))
}, e.config.tooltip_timeout || 1),
this.delayHide = a.delay(function() {
t.delayShow.$cancelTimeout(),
t.tooltip.hide()
}, e.config.tooltip_hide_timeout || 1)
}
,
t
}();
e.TooltipManager = s
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(255);
e.default = function(t) {
t.config.tooltip_timeout = 30,
t.config.tooltip_offset_y = 20,
t.config.tooltip_offset_x = 10,
t.config.tooltip_hide_timeout = 30;
var e = new i.TooltipManager(t);
t.ext.tooltips = e,
t.attachEvent("onGanttReady", function() {
e.tooltipFor({
selector: "[" + t.config.task_attribute + "]:not(.gantt_task_row)",
html: function(e) {
if (!t.config.touch || t.config.touch_tooltip) {
var n = t.locate(e);
if (t.isTaskExists(n)) {
var i = t.getTask(n);
return t.templates.tooltip_text(i.start_date, i.end_date, i)
}
return null
}
},
global: !1
})
}),
t.attachEvent("onDestroy", function() {
e.destructor()
}),
t.attachEvent("onLightbox", function() {
e.hideTooltip()
}),
t.attachEvent("onBeforeTooltip", function() {
if (t.getState().link_source_id)
return !1
}),
t.attachEvent("onGanttScroll", function() {
e.hideTooltip()
})
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = function() {
function t(t) {
var e = this;
this.show = function(t, n) {
void 0 === n ? e._showForTask(t) : e._showAtCoordinates(t, n)
}
,
this.hide = function(t) {
var n = e._gantt
, i = e._quickInfoBox;
e._quickInfoBoxId = 0;
var r = e._quickInfoTask;
if (e._quickInfoTask = null,
i && i.parentNode) {
if (n.config.quick_info_detached)
return n.callEvent("onAfterQuickInfo", [r]),
i.parentNode.removeChild(i);
i.className += " gantt_qi_hidden",
"auto" === i.style.right ? i.style.left = "-350px" : i.style.right = "-350px",
t && (i.style.left = i.style.right = "",
i.parentNode.removeChild(i)),
n.callEvent("onAfterQuickInfo", [r])
}
}
,
this.getNode = function() {
return e._quickInfoBox ? e._quickInfoBox : null
}
,
this.setContainer = function(t) {
t && (e._container = "string" == typeof t ? document.getElementById(t) : t)
}
,
this.setContent = function(t) {
var n = e._gantt
, i = {
taskId: null,
header: {
title: "",
date: ""
},
content: "",
buttons: n.config.quickinfo_buttons
};
t || (t = i),
t.taskId || (t.taskId = i.taskId),
t.header || (t.header = i.header),
t.header.title || (t.header.title = i.header.title),
t.header.date || (t.header.date = i.header.date),
t.content || (t.content = i.content),
t.buttons || (t.buttons = i.buttons);
var r = e.getNode();
r || (r = e._createQuickInfoElement()),
t.taskId && (e._quickInfoBoxId = t.taskId);
var a = r.querySelector(".gantt_cal_qi_title")
, o = a.querySelector(".gantt_cal_qi_tcontent")
, s = a.querySelector(".gantt_cal_qi_tdate")
, l = r.querySelector(".gantt_cal_qi_content")
, c = r.querySelector(".gantt_cal_qi_controls");
n._waiAria.quickInfoHeader(r, [t.header.title, t.header.date].join(" ")),
o.innerHTML = t.header.title,
s.innerHTML = t.header.date,
t.header.title || t.header.date ? a.style.display = "" : a.style.display = "none",
l.innerHTML = t.content;
var u = t.buttons;
u.length ? c.style.display = "" : c.style.display = "none";
for (var d = "", h = 0; h < u.length; h++) {
var f = n._waiAria.quickInfoButtonAttrString(n.locale.labels[u[h]]);
d += '
" + n.locale.labels[u[h]] + "
"
}
c.innerHTML = d,
n.eventRemove(r, "click", e._qiButtonClickHandler),
n.eventRemove(r, "keypress", e._qiKeyPressHandler),
n.event(r, "click", e._qiButtonClickHandler),
n.event(r, "keypress", e._qiKeyPressHandler)
}
,
this._qiButtonClickHandler = function(t) {
t = t || event,
e._qi_button_click(t.target || t.srcElement)
}
,
this._qiKeyPressHandler = function(t) {
var n = (t = t || event).which || event.keyCode;
13 !== n && 32 !== n || setTimeout(function() {
e._qi_button_click(t.target || t.srcElement)
}, 1)
}
,
this._gantt = t
}
return t.prototype._showAtCoordinates = function(t, e) {
this.hide(!0),
this._quickInfoBoxId = 0,
this._quickInfoTask = null,
this._quickInfoBox || (this._createQuickInfoElement(),
this.setContent()),
this._appendAtCoordinates(t, e),
this._gantt.callEvent("onQuickInfo", [null])
}
,
t.prototype._showForTask = function(t) {
var e = this._gantt;
if ((t !== this._quickInfoBoxId || !e.utils.dom.isChildOf(this._quickInfoBox, document.body)) && e.config.show_quick_info) {
this.hide(!0);
var n = this._getContainer()
, i = this._get_event_counter_part(t, 6, n.xViewport, n.yViewport);
i && (this._quickInfoBox = this._init_quick_info(t),
this._quickInfoTask = t,
this._quickInfoBox.className = this._prepare_quick_info_classname(t),
this._fill_quick_data(t),
this._show_quick_info(i, 6),
e.callEvent("onQuickInfo", [t]))
}
}
,
t.prototype._get_event_counter_part = function(t, e, n, i) {
var r = this._gantt
, a = r.getTaskNode(t);
if (!a && !(a = r.getTaskRowNode(t)))
return null;
var o = 0
, s = e + a.offsetTop + a.offsetHeight
, l = a;
if (r.utils.dom.isChildOf(l, n))
for (; l && l !== n; )
o += l.offsetLeft,
l = l.offsetParent;
var c = r.getScrollState();
return l ? {
left: o,
top: s,
dx: o + a.offsetWidth / 2 - c.x > n.offsetWidth / 2 ? 1 : 0,
dy: s + a.offsetHeight / 2 - c.y > i.offsetHeight / 2 ? 1 : 0,
width: a.offsetWidth,
height: a.offsetHeight
} : null
}
,
t.prototype._createQuickInfoElement = function() {
var t = this
, e = this._gantt
, n = document.createElement("div");
n.className += "gantt_cal_quick_info",
e._waiAria.quickInfoAttr(n);
var i = '
';
if (i += '
',
i += "
",
n.innerHTML = i,
e.config.quick_info_detached) {
var r = this._getContainer();
e.event(r.parent, "scroll", function() {
t.hide()
})
}
return this._quickInfoBox = n,
n
}
,
t.prototype._init_quick_info = function(t) {
var e = this._gantt
, n = e.getTask(t);
return "boolean" == typeof this._quickInfoReadonly && e.isReadonly(n) !== this._quickInfoReadonly && (this.hide(!0),
this._quickInfoBox = null),
this._quickInfoReadonly = e.isReadonly(n),
this._quickInfoBox || (this._quickInfoBox = this._createQuickInfoElement()),
this._quickInfoBox
}
,
t.prototype._prepare_quick_info_classname = function(t) {
var e = this._gantt
, n = e.getTask(t)
, i = "gantt_cal_quick_info"
, r = e.templates.quick_info_class(n.start_date, n.end_date, n);
return r && (i += " " + r),
i
}
,
t.prototype._fill_quick_data = function(t) {
var e = this._gantt
, n = e.getTask(t);
this._quickInfoBoxId = t;
var i = [];
if (this._quickInfoReadonly)
for (var r = e.config.quickinfo_buttons, a = {
icon_delete: !0,
icon_edit: !0
}, o = 0; o < r.length; o++)
this._quickInfoReadonly && a[r[o]] || i.push(r[o]);
else
i = e.config.quickinfo_buttons;
this.setContent({
header: {
title: e.templates.quick_info_title(n.start_date, n.end_date, n),
date: e.templates.quick_info_date(n.start_date, n.end_date, n)
},
content: e.templates.quick_info_content(n.start_date, n.end_date, n),
buttons: i
})
}
,
t.prototype._appendAtCoordinates = function(t, e) {
var n = this._quickInfoBox
, i = this._getContainer();
n.parentNode && "#document-fragment" !== n.parentNode.nodeName.toLowerCase() || i.parent.appendChild(n),
n.style.left = t + "px",
n.style.top = e + "px"
}
,
t.prototype._show_quick_info = function(t, e) {
var n = this._gantt
, i = this._quickInfoBox;
if (n.config.quick_info_detached) {
var r = this._getContainer();
i.parentNode && "#document-fragment" !== i.parentNode.nodeName.toLowerCase() || r.parent.appendChild(i);
var a = i.offsetWidth
, o = i.offsetHeight
, s = n.getScrollState()
, l = r.xViewport
, c = r.yViewport
, u = l.offsetWidth + s.x - a
, d = t.top - s.y + o
, h = t.top;
d > c.offsetHeight / 2 && (h = t.top - (o + t.height + 2 * e)) < s.y && d <= c.offsetHeight && (h = t.top),
h < s.y && (h = s.y);
var f = Math.min(Math.max(s.x, t.left - t.dx * (a - t.width)), u)
, _ = h;
this._appendAtCoordinates(f, _)
} else
i.style.top = "20px",
1 === t.dx ? (i.style.right = "auto",
i.style.left = "-300px",
setTimeout(function() {
i.style.left = "10px"
}, 1)) : (i.style.left = "auto",
i.style.right = "-300px",
setTimeout(function() {
i.style.right = "10px"
}, 1)),
i.className += " gantt_qi_" + (1 === t.dx ? "left" : "right"),
n.$root.appendChild(i)
}
,
t.prototype._qi_button_click = function(t) {
var e = this._gantt
, n = this._quickInfoBox;
if (t && t !== n) {
var i = t.className;
if (-1 !== i.indexOf("_icon")) {
var r = this._quickInfoBoxId;
e.$click.buttons[i.split(" ")[1].replace("icon_", "")](r)
} else
this._qi_button_click(t.parentNode)
}
}
,
t.prototype._getContainer = function() {
var t = this._gantt
, e = this._container ? this._container : t.$task_data;
return e && e.offsetHeight && e.offsetWidth ? {
parent: e,
xViewport: t.$task,
yViewport: t.$task_data
} : (e = this._container ? this._container : t.$grid_data) && e.offsetHeight && e.offsetWidth ? {
parent: e,
xViewport: t.$grid,
yViewport: t.$grid_data
} : {
parent: this._container ? this._container : t.$layout,
xViewport: t.$layout,
yViewport: t.$layout
}
}
,
t
}();
e.QuickInfo = i
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(257);
e.default = function(t) {
t.ext || (t.ext = {}),
t.ext.quickInfo = new i.QuickInfo(t),
t.config.quickinfo_buttons = ["icon_delete", "icon_edit"],
t.config.quick_info_detached = !0,
t.config.show_quick_info = !0,
t.templates.quick_info_title = function(t, e, n) {
return n.text.substr(0, 50)
}
,
t.templates.quick_info_content = function(t, e, n) {
return n.details || n.text
}
,
t.templates.quick_info_date = function(e, n, i) {
return t.templates.task_time(e, n, i)
}
,
t.templates.quick_info_class = function(t, e, n) {
return ""
}
,
t.attachEvent("onTaskClick", function(e, n) {
return t.utils.dom.closest(n.target, ".gantt_add") || setTimeout(function() {
t.ext.quickInfo.show(e)
}, 0),
!0
});
for (var e = ["onViewChange", "onLightbox", "onBeforeTaskDelete", "onBeforeDrag"], n = function() {
return t.ext.quickInfo.hide(),
!0
}, r = 0; r < e.length; r++)
t.attachEvent(e[r], n);
function a() {
return t.ext.quickInfo.hide(),
t.ext.quickInfo._quickInfoBox = null,
!0
}
t.attachEvent("onEmptyClick", function(e) {
var i = !0
, r = document.querySelector(".gantt_cal_quick_info");
r && t.utils.dom.isChildOf(e.target, r) && (i = !1),
i && n()
}),
t.attachEvent("onGanttReady", a),
t.attachEvent("onDestroy", a),
t.event(window, "keydown", function(e) {
27 === e.keyCode && t.ext.quickInfo.hide()
})
}
}
, function(t, e, n) {
var i = n(2).replaceValidZeroId;
t.exports = function(t) {
t.config.multiselect = !0,
t.config.multiselect_one_level = !1,
t._multiselect = {
_selected: {},
_one_level: !1,
_active: !0,
_first_selected_when_shift: null,
getDefaultSelected: function() {
var t = this.getSelected();
return t.length ? t[t.length - 1] : null
},
setFirstSelected: function(t) {
this._first_selected_when_shift = t
},
getFirstSelected: function() {
return this._first_selected_when_shift
},
isActive: function() {
return this.updateState(),
this._active
},
updateState: function() {
this._one_level = t.config.multiselect_one_level;
var e = this._active;
this._active = t.config.select_task,
this._active != e && this.reset()
},
reset: function() {
this._selected = {}
},
setLastSelected: function(e) {
t.$data.tasksStore.silent(function() {
var n = t.$data.tasksStore;
e ? n.select(e + "") : n.unselect(null)
})
},
getLastSelected: function() {
var e = t.$data.tasksStore.getSelectedId();
return e && t.isTaskExists(e) ? e : null
},
select: function(e, n) {
return !!(e && t.callEvent("onBeforeTaskMultiSelect", [e, !0, n]) && t.callEvent("onBeforeTaskSelected", [e])) && (this._selected[e] = !0,
this.setLastSelected(e),
this.afterSelect(e),
t.callEvent("onTaskMultiSelect", [e, !0, n]),
t.callEvent("onTaskSelected", [e]),
!0)
},
toggle: function(t, e) {
this._selected[t] ? this.unselect(t, e) : this.select(t, e)
},
unselect: function(e, n) {
e && t.callEvent("onBeforeTaskMultiSelect", [e, !1, n]) && (this._selected[e] = !1,
this.getLastSelected() == e && this.setLastSelected(this.getDefaultSelected()),
this.afterSelect(e),
t.callEvent("onTaskMultiSelect", [e, !1, n]),
t.callEvent("onTaskUnselected", [e]))
},
isSelected: function(e) {
return !(!t.isTaskExists(e) || !this._selected[e])
},
getSelected: function() {
var e = [];
for (var n in this._selected)
this._selected[n] && t.isTaskExists(n) ? e.push(n) : this._selected[n] = !1;
return e.sort(function(e, n) {
return t.getGlobalTaskIndex(e) > t.getGlobalTaskIndex(n) ? 1 : -1
}),
e
},
forSelected: function(t) {
for (var e = this.getSelected(), n = 0; n < e.length; n++)
t(e[n])
},
isSameLevel: function(e) {
if (!this._one_level)
return !0;
var n = this.getLastSelected();
return !n || (!t.isTaskExists(n) || !t.isTaskExists(e) || !(t.calculateTaskLevel(t.getTask(n)) != t.calculateTaskLevel(t.getTask(e))))
},
afterSelect: function(e) {
t.isTaskExists(e) && t._quickRefresh(function() {
t.refreshTask(e)
})
},
doSelection: function(e) {
if (!this.isActive())
return !1;
if (t._is_icon_open_click(e))
return !1;
var n = t.locate(e);
if (!n)
return !1;
if (!t.callEvent("onBeforeMultiSelect", [e]))
return !1;
var i = this.getSelected()
, r = this.getFirstSelected()
, a = !1
, o = this.getLastSelected()
, s = t.config.multiselect
, l = function() {
var r = t.ext.inlineEditors
, a = r.getState()
, o = r.locateCell(e.target);
t.config.inline_editors_multiselect_open && o && r.getEditorConfig(o.columnName) && (r.isVisible() && a.id == o.id && a.columnName == o.columnName || r.startEdit(o.id, o.columnName)),
this.setFirstSelected(n),
this.isSelected(n) || this.select(n, e),
i = this.getSelected();
for (var s = 0; s < i.length; s++)
i[s] !== n && this.unselect(i[s], e)
}
.bind(this)
, c = function() {
if (o) {
if (n) {
for (var i = t.getGlobalTaskIndex(this.getFirstSelected()), s = t.getGlobalTaskIndex(n), l = t.getGlobalTaskIndex(o), c = o; t.getGlobalTaskIndex(c) !== i; )
this.unselect(c, e),
c = i > l ? t.getNext(c) : t.getPrev(c);
for (c = n; t.getGlobalTaskIndex(c) !== i; )
this.select(c, e) && !a && (a = !0,
r = c),
c = i > s ? t.getNext(c) : t.getPrev(c)
}
} else
o = n
}
.bind(this);
return s && (e.ctrlKey || e.metaKey) ? (this.isSelected(n) || this.setFirstSelected(n),
n && this.toggle(n, e)) : s && e.shiftKey ? (t.isTaskExists(this.getFirstSelected()) && null !== this.getFirstSelected() || this.setFirstSelected(n),
i.length ? c() : l()) : l(),
this.isSelected(n) ? this.setLastSelected(n) : r ? n == o && this.setLastSelected(e.shiftKey ? r : this.getDefaultSelected()) : this.setLastSelected(null),
this.getSelected().length || this.setLastSelected(null),
this.getLastSelected() && this.isSelected(this.getFirstSelected()) || this.setFirstSelected(this.getLastSelected()),
!0
}
},
function() {
var e = t.selectTask;
t.selectTask = function(n) {
if (!(n = i(n, this.config.root_id)))
return !1;
var r = t._multiselect
, a = n;
return r.isActive() ? (r.select(n, null) && r.setLastSelected(n),
r.setFirstSelected(r.getLastSelected())) : a = e.call(this, n),
a
}
;
var n = t.unselectTask;
t.unselectTask = function(e) {
var i = t._multiselect
, r = i.isActive();
(e = e || i.getLastSelected()) && r && (i.unselect(e, null),
e == i.getLastSelected() && i.setLastSelected(null),
t.refreshTask(e),
i.setFirstSelected(i.getLastSelected()));
var a = e;
return r || (a = n.call(this, e)),
a
}
,
t.toggleTaskSelection = function(e) {
var n = t._multiselect;
e && n.isActive() && (n.toggle(e),
n.setFirstSelected(n.getLastSelected()))
}
,
t.getSelectedTasks = function() {
var e = t._multiselect;
return e.isActive(),
e.getSelected()
}
,
t.eachSelectedTask = function(t) {
return this._multiselect.forSelected(t)
}
,
t.isSelectedTask = function(t) {
return this._multiselect.isSelected(t)
}
,
t.getLastSelectedTask = function() {
return this._multiselect.getLastSelected()
}
,
t.attachEvent("onGanttReady", function() {
var e = t.$data.tasksStore.isSelected;
t.$data.tasksStore.isSelected = function(n) {
return t._multiselect.isActive() ? t._multiselect.isSelected(n) : e.call(this, n)
}
})
}(),
t.attachEvent("onTaskIdChange", function(e, n) {
var i = t._multiselect;
if (!i.isActive())
return !0;
t.isSelectedTask(e) && (i.unselect(e, null),
i.select(n, null))
}),
t.attachEvent("onAfterTaskDelete", function(e, n) {
var i = t._multiselect;
if (!i.isActive())
return !0;
i._selected[e] && (i.unselect(e, null),
i._selected[e] = !1,
i.setLastSelected(i.getDefaultSelected())),
i.forSelected(function(e) {
t.isTaskExists(e) || i.unselect(e, null)
})
}),
t.attachEvent("onBeforeTaskMultiSelect", function(e, n, i) {
var r = t._multiselect;
return !(n && r.isActive() && r._one_level) || r.isSameLevel(e)
}),
t.attachEvent("onTaskClick", function(e, n) {
return t._multiselect.doSelection(n) && t.callEvent("onMultiSelect", [n]),
!0
})
}
}
, function(t, e) {
t.exports = function(t) {
function e(e) {
if (!t.config.show_markers)
return !1;
if (!e.start_date)
return !1;
var n = t.getState();
if (!(+e.start_date > +n.max_date || (!e.end_date || +e.end_date < +n.min_date) && +e.start_date < +n.min_date)) {
var i = document.createElement("div");
i.setAttribute("data-marker-id", e.id);
var r = "gantt_marker";
t.templates.marker_class && (r += " " + t.templates.marker_class(e)),
e.css && (r += " " + e.css),
e.title && (i.title = e.title),
i.className = r;
var a = t.posFromDate(e.start_date);
i.style.left = a + "px";
var o = Math.max(t.getRowTop(t.getVisibleTaskCount()), 0) + "px";
if (t.config.timeline_placeholder && (o = t.$container.scrollHeight + "px"),
i.style.height = o,
e.end_date) {
var s = t.posFromDate(e.end_date);
i.style.width = Math.max(s - a, 0) + "px"
}
return e.text && (i.innerHTML = "
" + e.text + "
"),
i
}
}
function n() {
if (t.$task_data) {
var e = document.createElement("div");
e.className = "gantt_marker_area",
t.$task_data.appendChild(e),
t.$marker_area = e
}
}
t._markers || (t._markers = t.createDatastore({
name: "marker",
initItem: function(e) {
return e.id = e.id || t.uid(),
e
}
})),
t.config.show_markers = !0,
t.attachEvent("onBeforeGanttRender", function() {
t.$marker_area || n()
}),
t.attachEvent("onDataRender", function() {
t.$marker_area || (n(),
t.renderMarkers())
}),
t.attachEvent("onGanttLayoutReady", function() {
t.attachEvent("onBeforeGanttRender", function() {
n(),
t.$services.getService("layers").createDataRender({
name: "marker",
defaultContainer: function() {
return t.$marker_area
}
}).addLayer(e)
}, {
once: !0
})
}),
t.getMarker = function(t) {
return this._markers ? this._markers.getItem(t) : null
}
,
t.addMarker = function(t) {
return this._markers.addItem(t)
}
,
t.deleteMarker = function(t) {
return !!this._markers.exists(t) && (this._markers.removeItem(t),
!0)
}
,
t.updateMarker = function(t) {
this._markers.refresh(t)
}
,
t._getMarkers = function() {
return this._markers.getItems()
}
,
t.renderMarkers = function() {
this._markers.refresh()
}
}
}
, function(t, e) {
t.exports = function(t) {
t.$keyboardNavigation.dispatcher = {
isActive: !1,
activeNode: null,
globalNode: new t.$keyboardNavigation.GanttNode,
enable: function() {
this.isActive = !0,
this.setActiveNode(this.getActiveNode())
},
disable: function() {
this.isActive = !1
},
isEnabled: function() {
return !!this.isActive
},
getDefaultNode: function() {
var e;
return (e = t.config.keyboard_navigation_cells ? new t.$keyboardNavigation.TaskCell : new t.$keyboardNavigation.TaskRow).isValid() || (e = e.fallback()),
e
},
setDefaultNode: function() {
this.setActiveNode(this.getDefaultNode())
},
getActiveNode: function() {
var t = this.activeNode;
return t && !t.isValid() && (t = t.fallback()),
t
},
fromDomElement: function(e) {
for (var n = [t.$keyboardNavigation.TaskRow, t.$keyboardNavigation.TaskCell, t.$keyboardNavigation.HeaderCell], i = 0; i < n.length; i++)
if (n[i].prototype.fromDomElement) {
var r = n[i].prototype.fromDomElement(e);
if (r)
return r
}
return null
},
focusGlobalNode: function() {
this.blurNode(this.globalNode),
this.focusNode(this.globalNode)
},
setActiveNode: function(t) {
var e = !0;
this.activeNode && this.activeNode.compareTo(t) && (e = !1),
this.isEnabled() && (e && this.blurNode(this.activeNode),
this.activeNode = t,
this.focusNode(this.activeNode, !e))
},
focusNode: function(t, e) {
t && t.focus && t.focus(e)
},
blurNode: function(t) {
t && t.blur && t.blur()
},
keyDownHandler: function(e) {
if (!t.$keyboardNavigation.isModal() && this.isEnabled() && !e.defaultPrevented) {
var n = this.globalNode
, i = t.$keyboardNavigation.shortcuts.getCommandFromEvent(e)
, r = this.getActiveNode();
!1 !== t.$keyboardNavigation.facade.callEvent("onKeyDown", [i, e]) && (r ? r.findHandler(i) ? r.doAction(i, e) : n.findHandler(i) && n.doAction(i, e) : this.setDefaultNode())
}
},
_timeout: null,
awaitsFocus: function() {
return null !== this._timeout
},
delay: function(e, n) {
clearTimeout(this._timeout),
this._timeout = setTimeout(t.bind(function() {
this._timeout = null,
e()
}, this), n || 1)
},
clearDelay: function() {
clearTimeout(this._timeout)
}
}
}
}
, function(t, e) {
t.exports = function(t) {
!function() {
var e = [];
function n() {
return !!e.length
}
function i(e) {
setTimeout(function() {
n() || t.$destroyed || t.focus()
}, 1)
}
function r(n) {
t.eventRemove(n, "keydown", o),
t.event(n, "keydown", o),
e.push(n)
}
function a() {
var n = e.pop();
n && t.eventRemove(n, "keydown", o),
i()
}
function o(n) {
var i = n.currentTarget;
(function(t) {
return t == e[e.length - 1]
}
)(i) && t.$keyboardNavigation.trapFocus(i, n)
}
function s() {
r(t.getLightbox())
}
t.attachEvent("onLightbox", s),
t.attachEvent("onAfterLightbox", a),
t.attachEvent("onLightboxChange", function() {
a(),
s()
}),
t.attachEvent("onAfterQuickInfo", function() {
i()
}),
t.attachEvent("onMessagePopup", function(e) {
l = t.utils.dom.getActiveElement(),
r(e)
}),
t.attachEvent("onAfterMessagePopup", function() {
a(),
setTimeout(function() {
l && (l.focus(),
l = null)
}, 1)
});
var l = null;
t.$keyboardNavigation.isModal = n
}()
}
}
, function(t, e, n) {
t.exports = function(t) {
var e = n(1)
, i = n(2).replaceValidZeroId;
t.$keyboardNavigation.TaskCell = function(e, n) {
if (!(e = i(e, t.config.root_id))) {
var r = t.getChildren(t.config.root_id);
r[0] && (e = r[0])
}
this.taskId = e,
this.columnIndex = n || 0,
t.isTaskExists(this.taskId) && (this.index = t.getTaskIndex(this.taskId),
this.globalIndex = t.getGlobalTaskIndex(this.taskId))
}
,
t.$keyboardNavigation.TaskCell.prototype = t._compose(t.$keyboardNavigation.TaskRow, {
_handlers: null,
isValid: function() {
return t.$keyboardNavigation.TaskRow.prototype.isValid.call(this) && !!t.getGridColumns()[this.columnIndex]
},
fallback: function() {
var e = t.$keyboardNavigation.TaskRow.prototype.fallback.call(this)
, n = e;
if (e instanceof t.$keyboardNavigation.TaskRow) {
for (var i = t.getGridColumns(), r = this.columnIndex; r >= 0 && !i[r]; )
r--;
i[r] && (n = new t.$keyboardNavigation.TaskCell(e.taskId,r))
}
return n
},
fromDomElement: function(n) {
if (!t.config.keyboard_navigation_cells)
return null;
var i = t.locate(n);
if (t.isTaskExists(i)) {
var r = 0
, a = e.locateAttribute(n, "data-column-index");
return a && (r = 1 * a.getAttribute("data-column-index")),
new t.$keyboardNavigation.TaskCell(i,r)
}
return null
},
getNode: function() {
if (t.isTaskExists(this.taskId) && t.isTaskVisible(this.taskId)) {
if (t.config.show_grid) {
var e = t.$grid.querySelector(".gantt_row[" + t.config.task_attribute + "='" + this.taskId + "']");
return e ? e.querySelector("[data-column-index='" + this.columnIndex + "']") : null
}
return t.getTaskNode(this.taskId)
}
},
keys: {
up: function() {
var e = null
, n = t.getPrev(this.taskId);
e = t.isTaskExists(n) ? new t.$keyboardNavigation.TaskCell(n,this.columnIndex) : new t.$keyboardNavigation.HeaderCell(this.columnIndex),
this.moveTo(e)
},
down: function() {
var e = t.getNext(this.taskId);
t.isTaskExists(e) && this.moveTo(new t.$keyboardNavigation.TaskCell(e,this.columnIndex))
},
left: function() {
this.columnIndex > 0 && this.moveTo(new t.$keyboardNavigation.TaskCell(this.taskId,this.columnIndex - 1))
},
right: function() {
var e = t.getGridColumns();
this.columnIndex < e.length - 1 && this.moveTo(new t.$keyboardNavigation.TaskCell(this.taskId,this.columnIndex + 1))
},
end: function() {
var e = t.getGridColumns();
this.moveTo(new t.$keyboardNavigation.TaskCell(this.taskId,e.length - 1))
},
home: function() {
this.moveTo(new t.$keyboardNavigation.TaskCell(this.taskId,0))
},
pagedown: function() {
t.getVisibleTaskCount() && this.moveTo(new t.$keyboardNavigation.TaskCell(t.getTaskByIndex(t.getVisibleTaskCount() - 1).id,this.columnIndex))
},
pageup: function() {
t.getVisibleTaskCount() && this.moveTo(new t.$keyboardNavigation.TaskCell(t.getTaskByIndex(0).id,this.columnIndex))
}
}
}),
t.$keyboardNavigation.TaskCell.prototype.bindAll(t.$keyboardNavigation.TaskRow.prototype.keys),
t.$keyboardNavigation.TaskCell.prototype.bindAll(t.$keyboardNavigation.TaskCell.prototype.keys)
}
}
, function(t, e) {
t.exports = function(t) {
t.$keyboardNavigation.TaskRow = function(e) {
if (!e) {
var n = t.getChildren(t.config.root_id);
n[0] && (e = n[0])
}
this.taskId = e,
t.isTaskExists(this.taskId) && (this.index = t.getTaskIndex(this.taskId),
this.globalIndex = t.getGlobalTaskIndex(this.taskId))
}
,
t.$keyboardNavigation.TaskRow.prototype = t._compose(t.$keyboardNavigation.KeyNavNode, {
_handlers: null,
isValid: function() {
return t.isTaskExists(this.taskId) && t.getTaskIndex(this.taskId) > -1
},
fallback: function() {
if (!t.getVisibleTaskCount()) {
var e = new t.$keyboardNavigation.HeaderCell;
return e.isValid() ? e : null
}
var n = -1;
if (t.getTaskByIndex(this.globalIndex - 1))
n = this.globalIndex - 1;
else if (t.getTaskByIndex(this.globalIndex + 1))
n = this.globalIndex + 1;
else
for (var i = this.globalIndex; i >= 0; ) {
if (t.getTaskByIndex(i)) {
n = i;
break
}
i--
}
if (n > -1)
return new t.$keyboardNavigation.TaskRow(t.getTaskByIndex(n).id)
},
fromDomElement: function(e) {
if (t.config.keyboard_navigation_cells)
return null;
var n = t.locate(e);
return t.isTaskExists(n) ? new t.$keyboardNavigation.TaskRow(n) : null
},
getNode: function() {
if (t.isTaskExists(this.taskId) && t.isTaskVisible(this.taskId))
return t.config.show_grid ? t.$grid.querySelector(".gantt_row[" + t.config.task_attribute + "='" + this.taskId + "']") : t.getTaskNode(this.taskId)
},
focus: function(e) {
if (!e) {
var n, i, r = t.getTaskPosition(t.getTask(this.taskId)), a = t.getTaskHeight(this.taskId), o = t.getScrollState();
n = t.$task ? t.$task.offsetWidth : o.inner_width,
i = t.$grid_data || t.$task_data ? (t.$grid_data || t.$task_data).offsetHeight : o.inner_height,
r.top < o.y || r.top + a > o.y + i ? t.scrollTo(null, r.top - 5 * a) : t.config.scroll_on_click && t.config.show_chart && (r.left > o.x + n ? t.scrollTo(r.left - t.config.task_scroll_offset) : r.left + r.width < o.x && t.scrollTo(r.left + r.width - t.config.task_scroll_offset))
}
t.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this, [e]),
function() {
var e = t.$ui.getView("grid")
, n = parseInt(e.$grid.scrollLeft)
, i = parseInt(e.$grid_data.scrollTop)
, r = e.$config.scrollX;
if (r && e.$config.scrollable) {
var a = t.$ui.getView(r);
a && a.scrollTo(n, i)
}
var o = e.$config.scrollY;
if (o) {
var s = t.$ui.getView(o);
s && s.scrollTo(n, i)
}
}()
},
keys: {
pagedown: function() {
t.getVisibleTaskCount() && this.moveTo(new t.$keyboardNavigation.TaskRow(t.getTaskByIndex(t.getVisibleTaskCount() - 1).id))
},
pageup: function() {
t.getVisibleTaskCount() && this.moveTo(new t.$keyboardNavigation.TaskRow(t.getTaskByIndex(0).id))
},
up: function() {
var e = null
, n = t.getPrev(this.taskId);
e = t.isTaskExists(n) ? new t.$keyboardNavigation.TaskRow(n) : new t.$keyboardNavigation.HeaderCell,
this.moveTo(e)
},
down: function() {
var e = t.getNext(this.taskId);
t.isTaskExists(e) && this.moveTo(new t.$keyboardNavigation.TaskRow(e))
},
"shift+down": function() {
t.hasChild(this.taskId) && !t.getTask(this.taskId).$open && t.open(this.taskId)
},
"shift+up": function() {
t.hasChild(this.taskId) && t.getTask(this.taskId).$open && t.close(this.taskId)
},
"shift+right": function() {
if (!t.isReadonly(this)) {
var e = t.getPrevSibling(this.taskId);
if (t.isTaskExists(e) && !t.isChildOf(this.taskId, e))
t.getTask(e).$open = !0,
!1 !== t.moveTask(this.taskId, -1, e) && t.updateTask(this.taskId)
}
},
"shift+left": function() {
if (!t.isReadonly(this)) {
var e = t.getParent(this.taskId);
if (t.isTaskExists(e))
!1 !== t.moveTask(this.taskId, t.getTaskIndex(e) + 1, t.getParent(e)) && t.updateTask(this.taskId)
}
},
space: function(e) {
t.isSelectedTask(this.taskId) ? t.unselectTask(this.taskId) : t.selectTask(this.taskId)
},
"ctrl+left": function(e) {
t.close(this.taskId)
},
"ctrl+right": function(e) {
t.open(this.taskId)
},
delete: function(e) {
t.isReadonly(this) || t.$click.buttons.delete(this.taskId)
},
enter: function() {
t.isReadonly(this) || t.showLightbox(this.taskId)
},
"ctrl+enter": function() {
t.isReadonly(this) || t.createTask({}, this.taskId)
}
}
}),
t.$keyboardNavigation.TaskRow.prototype.bindAll(t.$keyboardNavigation.TaskRow.prototype.keys)
}
}
, function(t, e, n) {
t.exports = function(t) {
var e = n(1);
t.$keyboardNavigation.HeaderCell = function(t) {
this.index = t || 0
}
,
t.$keyboardNavigation.HeaderCell.prototype = t._compose(t.$keyboardNavigation.KeyNavNode, {
_handlers: null,
isValid: function() {
return !(!t.config.show_grid && t.getVisibleTaskCount()) && (!!t.getGridColumns()[this.index] || !t.getVisibleTaskCount())
},
fallback: function() {
if (!t.config.show_grid)
return t.getVisibleTaskCount() ? new t.$keyboardNavigation.TaskRow : null;
for (var e = t.getGridColumns(), n = this.index; n >= 0 && !e[n]; )
n--;
return e[n] ? new t.$keyboardNavigation.HeaderCell(n) : null
},
fromDomElement: function(n) {
var i = e.locateClassName(n, "gantt_grid_head_cell");
if (i) {
for (var r = 0; i && i.previousSibling; )
i = i.previousSibling,
r += 1;
return new t.$keyboardNavigation.HeaderCell(r)
}
return null
},
getNode: function() {
return t.$grid_scale.childNodes[this.index]
},
keys: {
left: function() {
this.index > 0 && this.moveTo(new t.$keyboardNavigation.HeaderCell(this.index - 1))
},
right: function() {
var e = t.getGridColumns();
this.index < e.length - 1 && this.moveTo(new t.$keyboardNavigation.HeaderCell(this.index + 1))
},
down: function() {
var e, n = t.getChildren(t.config.root_id);
t.isTaskExists(n[0]) && (e = n[0]),
e && (t.config.keyboard_navigation_cells ? this.moveTo(new t.$keyboardNavigation.TaskCell(e,this.index)) : this.moveTo(new t.$keyboardNavigation.TaskRow(e)))
},
end: function() {
var e = t.getGridColumns();
this.moveTo(new t.$keyboardNavigation.HeaderCell(e.length - 1))
},
home: function() {
this.moveTo(new t.$keyboardNavigation.HeaderCell(0))
},
"enter, space": function() {
e.getActiveElement().click()
},
"ctrl+enter": function() {
t.isReadonly(this) || t.createTask({}, this.taskId)
}
}
}),
t.$keyboardNavigation.HeaderCell.prototype.bindAll(t.$keyboardNavigation.HeaderCell.prototype.keys)
}
}
, function(t, e) {
t.exports = function(t) {
t.$keyboardNavigation.KeyNavNode = function() {}
,
t.$keyboardNavigation.KeyNavNode.prototype = t._compose(t.$keyboardNavigation.EventHandler, {
isValid: function() {
return !0
},
fallback: function() {
return null
},
moveTo: function(e) {
t.$keyboardNavigation.dispatcher.setActiveNode(e)
},
compareTo: function(t) {
if (!t)
return !1;
for (var e in this) {
if (!!this[e] != !!t[e])
return !1;
var n = !(!this[e] || !this[e].toString)
, i = !(!t[e] || !t[e].toString);
if (i != n)
return !1;
if (i && n) {
if (t[e].toString() != this[e].toString())
return !1
} else if (t[e] != this[e])
return !1
}
return !0
},
getNode: function() {},
focus: function() {
var e = this.getNode();
if (e) {
var n = t.$keyboardNavigation.facade;
!1 !== n.callEvent("onBeforeFocus", [e]) && e && (e.setAttribute("tabindex", "-1"),
e.$eventAttached || (e.$eventAttached = !0,
t.event(e, "focus", function(t) {
return t.preventDefault(),
!1
}, !1)),
t.utils.dom.isChildOf(document.activeElement, e) && (e = document.activeElement),
e.focus && e.focus(),
n.callEvent("onFocus", [this.getNode()]))
}
},
blur: function() {
var e = this.getNode();
e && (t.$keyboardNavigation.facade.callEvent("onBlur", [e]),
e.setAttribute("tabindex", "-1"))
}
})
}
}
, function(t, e) {
t.exports = function(t) {
t.$keyboardNavigation.GanttNode = function() {}
,
t.$keyboardNavigation.GanttNode.prototype = t._compose(t.$keyboardNavigation.EventHandler, {
focus: function() {
t.focus()
},
blur: function() {},
isEnabled: function() {
return t.$container.hasAttribute("tabindex")
},
scrollHorizontal: function(e) {
var n = t.dateFromPos(t.getScrollState().x)
, i = t.getScale()
, r = e < 0 ? -i.step : i.step;
n = t.date.add(n, r, i.unit),
t.scrollTo(t.posFromDate(n))
},
scrollVertical: function(e) {
var n = t.getScrollState().y
, i = t.config.row_height;
t.scrollTo(null, n + (e < 0 ? -1 : 1) * i)
},
keys: {
"alt+left": function(t) {
this.scrollHorizontal(-1)
},
"alt+right": function(t) {
this.scrollHorizontal(1)
},
"alt+up": function(t) {
this.scrollVertical(-1)
},
"alt+down": function(t) {
this.scrollVertical(1)
},
"ctrl+z": function() {
t.undo && t.undo()
},
"ctrl+r": function() {
t.redo && t.redo()
}
}
}),
t.$keyboardNavigation.GanttNode.prototype.bindAll(t.$keyboardNavigation.GanttNode.prototype.keys)
}
}
, function(t, e, n) {
t.exports = function(t) {
!function() {
var e = n(1);
t.$keyboardNavigation.getFocusableNodes = e.getFocusableNodes,
t.$keyboardNavigation.trapFocus = function(n, i) {
if (9 != i.keyCode)
return !1;
for (var r = t.$keyboardNavigation.getFocusableNodes(n), a = e.getActiveElement(), o = -1, s = 0; s < r.length; s++)
if (r[s] == a) {
o = s;
break
}
if (i.shiftKey) {
if (o <= 0) {
var l = r[r.length - 1];
if (l)
return l.focus(),
i.preventDefault(),
!0
}
} else if (o >= r.length - 1) {
var c = r[0];
if (c)
return c.focus(),
i.preventDefault(),
!0
}
return !1
}
}()
}
}
, function(t, e) {
t.exports = function(t) {
t.$keyboardNavigation.EventHandler = {
_handlers: null,
findHandler: function(e) {
this._handlers || (this._handlers = {});
var n = t.$keyboardNavigation.shortcuts.getHash(e);
return this._handlers[n]
},
doAction: function(e, n) {
var i = this.findHandler(e);
if (i) {
if (!1 === t.$keyboardNavigation.facade.callEvent("onBeforeAction", [e, n]))
return;
i.call(this, n),
n.preventDefault ? n.preventDefault() : n.returnValue = !1
}
},
bind: function(e, n) {
this._handlers || (this._handlers = {});
for (var i = t.$keyboardNavigation.shortcuts, r = i.parse(e), a = 0; a < r.length; a++)
this._handlers[i.getHash(r[a])] = n
},
unbind: function(e) {
for (var n = t.$keyboardNavigation.shortcuts, i = n.parse(e), r = 0; r < i.length; r++)
this._handlers[n.getHash(i[r])] && delete this._handlers[n.getHash(i[r])]
},
bindAll: function(t) {
for (var e in t)
this.bind(e, t[e])
},
initKeys: function() {
this._handlers || (this._handlers = {}),
this.keys && this.bindAll(this.keys)
}
}
}
}
, function(t, e) {
t.exports = function(t) {
t.$keyboardNavigation.shortcuts = {
createCommand: function() {
return {
modifiers: {
shift: !1,
alt: !1,
ctrl: !1,
meta: !1
},
keyCode: null
}
},
parse: function(t) {
for (var e = [], n = this.getExpressions(this.trim(t)), i = 0; i < n.length; i++) {
for (var r = this.getWords(n[i]), a = this.createCommand(), o = 0; o < r.length; o++)
this.commandKeys[r[o]] ? a.modifiers[r[o]] = !0 : this.specialKeys[r[o]] ? a.keyCode = this.specialKeys[r[o]] : a.keyCode = r[o].charCodeAt(0);
e.push(a)
}
return e
},
getCommandFromEvent: function(t) {
var e = this.createCommand();
e.modifiers.shift = !!t.shiftKey,
e.modifiers.alt = !!t.altKey,
e.modifiers.ctrl = !!t.ctrlKey,
e.modifiers.meta = !!t.metaKey,
e.keyCode = t.which || t.keyCode,
e.keyCode >= 96 && e.keyCode <= 105 && (e.keyCode -= 48);
var n = String.fromCharCode(e.keyCode);
return n && (e.keyCode = n.toLowerCase().charCodeAt(0)),
e
},
getHashFromEvent: function(t) {
return this.getHash(this.getCommandFromEvent(t))
},
getHash: function(t) {
var e = [];
for (var n in t.modifiers)
t.modifiers[n] && e.push(n);
return e.push(t.keyCode),
e.join(this.junctionChar)
},
getExpressions: function(t) {
return t.split(this.junctionChar)
},
getWords: function(t) {
return t.split(this.combinationChar)
},
trim: function(t) {
return t.replace(/\s/g, "")
},
junctionChar: ",",
combinationChar: "+",
commandKeys: {
shift: 16,
alt: 18,
ctrl: 17,
meta: !0
},
specialKeys: {
backspace: 8,
tab: 9,
enter: 13,
esc: 27,
space: 32,
up: 38,
down: 40,
left: 37,
right: 39,
home: 36,
end: 35,
pageup: 33,
pagedown: 34,
delete: 46,
insert: 45,
plus: 107,
f1: 112,
f2: 113,
f3: 114,
f4: 115,
f5: 116,
f6: 117,
f7: 118,
f8: 119,
f9: 120,
f10: 121,
f11: 122,
f12: 123
}
}
}
}
, function(t, e, n) {
t.exports = function(t) {
var e = n(5);
!function(t) {
t.config.keyboard_navigation = !0,
t.config.keyboard_navigation_cells = !1,
t.$keyboardNavigation = {},
t._compose = function() {
for (var t = Array.prototype.slice.call(arguments, 0), e = {}, n = 0; n < t.length; n++) {
var i = t[n];
for (var r in "function" == typeof i && (i = new i),
i)
e[r] = i[r]
}
return e
}
,
n(270)(t),
n(269)(t),
n(268)(t),
n(267)(t),
n(266)(t),
n(265)(t),
n(264)(t),
n(263)(t),
n(262)(t),
n(261)(t);
var i = n(1);
!function() {
var n = t.$keyboardNavigation.dispatcher;
n.isTaskFocused = function(e) {
var i = n.activeNode;
return (i instanceof t.$keyboardNavigation.TaskRow || i instanceof t.$keyboardNavigation.TaskCell) && i.taskId == e
}
;
var r = function(e) {
if (t.config.keyboard_navigation && (t.config.keyboard_navigation_cells || !s(e)) && !l(e) && !function(t) {
return !!i.closest(t.target, ".gantt_cal_light")
}(e))
return n.keyDownHandler(e)
}
, a = function(e) {
if (n.$preventDefault)
return e.preventDefault(),
t.$container.blur(),
!1;
n.awaitsFocus() || n.focusGlobalNode()
}
, o = function() {
if (n.isEnabled()) {
var e = !i.isChildOf(document.activeElement, t.$container) && "body" != document.activeElement.localName
, r = n.getActiveNode();
if (r && !e) {
var a, o, s = r.getNode();
s && s.parentNode && (a = s.parentNode.scrollTop,
o = s.parentNode.scrollLeft),
r.focus(!0),
s && s.parentNode && (s.parentNode.scrollTop = a,
s.parentNode.scrollLeft = o)
}
}
};
function s(t) {
return !!i.closest(t.target, ".gantt_grid_editor_placeholder")
}
function l(t) {
return !!i.closest(t.target, ".no_keyboard_navigation")
}
function c(e) {
if (!t.config.keyboard_navigation)
return !0;
if (!t.config.keyboard_navigation_cells && s(e))
return !0;
if (!l(e)) {
var r, a = n.fromDomElement(e);
a && (n.activeNode instanceof t.$keyboardNavigation.TaskCell && i.isChildOf(e.target, t.$task) && (a = new t.$keyboardNavigation.TaskCell(a.taskId,n.activeNode.columnIndex)),
r = a),
r ? n.isEnabled() ? n.delay(function() {
n.setActiveNode(r)
}) : n.activeNode = r : (n.$preventDefault = !0,
setTimeout(function() {
n.$preventDefault = !1
}, 300))
}
}
t.attachEvent("onDataRender", function() {
t.config.keyboard_navigation && o()
}),
t.attachEvent("onGanttRender", function() {
t.eventRemove(t.$root, "keydown", r),
t.eventRemove(t.$container, "focus", a),
t.eventRemove(t.$container, "mousedown", c),
t.config.keyboard_navigation ? (t.event(t.$root, "keydown", r),
t.event(t.$container, "focus", a),
t.event(t.$container, "mousedown", c),
t.$container.setAttribute("tabindex", "0")) : t.$container.removeAttribute("tabindex")
});
var u = t.attachEvent("onGanttReady", function() {
if (t.detachEvent(u),
t.$data.tasksStore.attachEvent("onStoreUpdated", function(e) {
if (t.config.keyboard_navigation && n.isEnabled()) {
var i = n.getActiveNode();
i && i.taskId == e && o()
}
}),
t._smart_render) {
var e = t._smart_render._redrawTasks;
t._smart_render._redrawTasks = function(i, r) {
if (t.config.keyboard_navigation && n.isEnabled()) {
var a = n.getActiveNode();
if (a && void 0 !== a.taskId) {
for (var o = !1, s = 0; s < r.length; s++)
if (r[s].id == a.taskId && r[s].start_date) {
o = !0;
break
}
o || r.push(t.getTask(a.taskId))
}
}
return e.apply(this, arguments)
}
}
})
, d = null
, h = !1;
t.attachEvent("onTaskCreated", function(t) {
return d = t.id,
!0
}),
t.attachEvent("onAfterTaskAdd", function(e, i) {
if (!t.config.keyboard_navigation)
return !0;
if (n.isEnabled()) {
if (e == d && (h = !0,
setTimeout(function() {
h = !1,
d = null
})),
h && i.type == t.config.types.placeholder)
return;
var r = 0
, a = n.activeNode;
a instanceof t.$keyboardNavigation.TaskCell && (r = a.columnIndex);
var o = t.config.keyboard_navigation_cells ? t.$keyboardNavigation.TaskCell : t.$keyboardNavigation.TaskRow;
i.type == t.config.types.placeholder && !1 === t.config.placeholder_task.focusOnCreate || n.setActiveNode(new o(e,r))
}
}),
t.attachEvent("onTaskIdChange", function(e, i) {
if (!t.config.keyboard_navigation)
return !0;
var r = n.activeNode;
return n.isTaskFocused(e) && (r.taskId = i),
!0
});
var f = setInterval(function() {
t.config.keyboard_navigation && (n.isEnabled() || n.enable())
}, 500);
function _(e) {
var n = {
gantt: t.$keyboardNavigation.GanttNode,
headerCell: t.$keyboardNavigation.HeaderCell,
taskRow: t.$keyboardNavigation.TaskRow,
taskCell: t.$keyboardNavigation.TaskCell
};
return n[e] || n.gantt
}
function g(e) {
for (var n = t.getGridColumns(), i = 0; i < n.length; i++)
if (n[i].name == e)
return i;
return 0
}
t.attachEvent("onDestroy", function() {
clearInterval(f)
});
var p = {};
e(p),
t.mixin(p, {
addShortcut: function(t, e, n) {
var i = _(n);
i && i.prototype.bind(t, e)
},
getShortcutHandler: function(e, n) {
var i = t.$keyboardNavigation.shortcuts.parse(e);
if (i.length)
return p.getCommandHandler(i[0], n)
},
getCommandHandler: function(t, e) {
var n = _(e);
if (n && t)
return n.prototype.findHandler(t)
},
removeShortcut: function(t, e) {
var n = _(e);
n && n.prototype.unbind(t)
},
focus: function(t) {
var e, i = t ? t.type : null, r = _(i);
switch (i) {
case "taskCell":
e = new r(t.id,g(t.column));
break;
case "taskRow":
e = new r(t.id);
break;
case "headerCell":
e = new r(g(t.column))
}
n.delay(function() {
e ? n.setActiveNode(e) : (n.enable(),
n.getActiveNode() ? n.awaitsFocus() || n.enable() : n.setDefaultNode())
})
},
getActiveNode: function() {
if (n.isEnabled()) {
var e = n.getActiveNode()
, i = function(e) {
return e instanceof t.$keyboardNavigation.GanttNode ? "gantt" : e instanceof t.$keyboardNavigation.HeaderCell ? "headerCell" : e instanceof t.$keyboardNavigation.TaskRow ? "taskRow" : e instanceof t.$keyboardNavigation.TaskCell ? "taskCell" : null
}(e)
, r = t.getGridColumns();
switch (i) {
case "taskCell":
return {
type: "taskCell",
id: e.taskId,
column: r[e.columnIndex].name
};
case "taskRow":
return {
type: "taskRow",
id: e.taskId
};
case "headerCell":
return {
type: "headerCell",
column: r[e.index].name
}
}
}
return null
}
}),
t.$keyboardNavigation.facade = p,
t.ext.keyboardNavigation = p,
t.focus = function() {
p.focus()
}
,
t.addShortcut = p.addShortcut,
t.getShortcutHandler = p.getShortcutHandler,
t.removeShortcut = p.removeShortcut
}()
}(t)
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
}),
e.default = function(t) {
function e() {
var t = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement;
return !(!t || t !== document.body)
}
function n() {
try {
return document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled
} catch (t) {
console.error("Fullscreen is not available:", t)
}
}
t.$services.getService("state").registerProvider("fullscreen", function() {
return n() ? {
fullscreen: e()
} : void 0
});
var i = {
overflow: null,
padding: null,
paddingTop: null,
paddingRight: null,
paddingBottom: null,
paddingLeft: null
}
, r = {
width: null,
height: null,
top: null,
left: null,
position: null,
zIndex: null,
modified: !1
}
, a = null;
function o(t, e) {
e.width = t.width,
e.height = t.height,
e.top = t.top,
e.left = t.left,
e.position = t.position,
e.zIndex = t.zIndex
}
var s = !1;
function l() {
var n;
t.$container && (e() ? s && (n = "onExpand",
function() {
var e = t.ext.fullscreen.getFullscreenElement()
, n = document.body;
o(e.style, r),
i = {
overflow: n.style.overflow,
padding: n.style.padding ? n.style.padding : null,
paddingTop: n.style.paddingTop ? n.style.paddingTop : null,
paddingRight: n.style.paddingRight ? n.style.paddingRight : null,
paddingBottom: n.style.paddingBottom ? n.style.paddingBottom : null,
paddingLeft: n.style.paddingLeft ? n.style.paddingLeft : null
},
n.style.padding && (n.style.padding = "0"),
n.style.paddingTop && (n.style.paddingTop = "0"),
n.style.paddingRight && (n.style.paddingRight = "0"),
n.style.paddingBottom && (n.style.paddingBottom = "0"),
n.style.paddingLeft && (n.style.paddingLeft = "0"),
n.style.overflow = "hidden",
e.style.width = "100vw",
e.style.height = "100vh",
e.style.top = "0px",
e.style.left = "0px",
e.style.position = "absolute",
e.style.zIndex = 1,
r.modified = !0,
a = function(t) {
for (var e = t.parentNode, n = []; e && e.style; )
n.push({
element: e,
originalPositioning: e.style.position
}),
e.style.position = "static",
e = e.parentNode;
return n
}(e)
}()) : s && (s = !1,
n = "onCollapse",
function() {
var e = t.ext.fullscreen.getFullscreenElement()
, n = document.body;
r.modified && (i.padding && (n.style.padding = i.padding),
i.paddingTop && (n.style.paddingTop = i.paddingTop),
i.paddingRight && (n.style.paddingRight = i.paddingRight),
i.paddingBottom && (n.style.paddingBottom = i.paddingBottom),
i.paddingLeft && (n.style.paddingLeft = i.paddingLeft),
n.style.overflow = i.overflow,
i = {
overflow: null,
padding: null,
paddingTop: null,
paddingRight: null,
paddingBottom: null,
paddingLeft: null
},
o(r, e.style),
r.modified = !1),
function(t) {
t.forEach(function(t) {
t.element.style.position = t.originalPositioning
})
}(a),
a = null
}()),
setTimeout(function() {
t.render()
}),
setTimeout(function() {
t.callEvent(n, [t.ext.fullscreen.getFullscreenElement()])
}))
}
function c() {
return !t.$container || !t.ext.fullscreen.getFullscreenElement() || !n() && ((console.warning || console.log)("The `fullscreen` feature not being allowed, or full-screen mode not being supported"),
!0)
}
t.ext.fullscreen = {
expand: function() {
if (!c() && !e() && t.callEvent("onBeforeExpand", [this.getFullscreenElement()])) {
s = !0;
var n = document.body
, i = n.webkitRequestFullscreen ? [Element.ALLOW_KEYBOARD_INPUT] : []
, r = n.msRequestFullscreen || n.mozRequestFullScreen || n.webkitRequestFullscreen || n.requestFullscreen;
r && r.apply(n, i)
}
},
collapse: function() {
if (!c() && e() && t.callEvent("onBeforeCollapse", [this.getFullscreenElement()])) {
var n = document.msExitFullscreen || document.mozCancelFullScreen || document.webkitExitFullscreen || document.exitFullscreen;
n && n.apply(document)
}
},
toggle: function() {
c() || (e() ? this.collapse() : this.expand())
},
getFullscreenElement: function() {
return t.$root
}
},
t.expand = function() {
t.ext.fullscreen.expand()
}
,
t.collapse = function() {
t.ext.fullscreen.collapse()
}
,
t.attachEvent("onGanttReady", function() {
t.event(document, "webkitfullscreenchange", l),
t.event(document, "mozfullscreenchange", l),
t.event(document, "MSFullscreenChange", l),
t.event(document, "fullscreenChange", l),
t.event(document, "fullscreenchange", l)
})
}
}
, function(t, e, n) {
"use strict";
function i(t) {
"@babel/helpers - typeof";
return (i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
var r = function(t) {
switch (i(t)) {
case "string":
return t;
case "boolean":
return t ? "true" : "false";
case "number":
return isFinite(t) ? t : "";
default:
return ""
}
};
t.exports = function(t, e, n, l) {
return e = e || "&",
n = n || "=",
null === t && (t = void 0),
"object" === i(t) ? o(s(t), function(i) {
var s = encodeURIComponent(r(i)) + n;
return a(t[i]) ? o(t[i], function(t) {
return s + encodeURIComponent(r(t))
}).join(e) : s + encodeURIComponent(r(t[i]))
}).join(e) : l ? encodeURIComponent(r(l)) + n + encodeURIComponent(r(t)) : ""
}
;
var a = Array.isArray || function(t) {
return "[object Array]" === Object.prototype.toString.call(t)
}
;
function o(t, e) {
if (t.map)
return t.map(e);
for (var n = [], i = 0; i < t.length; i++)
n.push(e(t[i], i));
return n
}
var s = Object.keys || function(t) {
var e = [];
for (var n in t)
Object.prototype.hasOwnProperty.call(t, n) && e.push(n);
return e
}
}
, function(t, e, n) {
"use strict";
function i(t, e) {
return Object.prototype.hasOwnProperty.call(t, e)
}
t.exports = function(t, e, n, a) {
e = e || "&",
n = n || "=";
var o = {};
if ("string" != typeof t || 0 === t.length)
return o;
var s = /\+/g;
t = t.split(e);
var l = 1e3;
a && "number" == typeof a.maxKeys && (l = a.maxKeys);
var c = t.length;
l > 0 && c > l && (c = l);
for (var u = 0; u < c; ++u) {
var d, h, f, _, g = t[u].replace(s, "%20"), p = g.indexOf(n);
p >= 0 ? (d = g.substr(0, p),
h = g.substr(p + 1)) : (d = g,
h = ""),
f = decodeURIComponent(d),
_ = decodeURIComponent(h),
i(o, f) ? r(o[f]) ? o[f].push(_) : o[f] = [o[f], _] : o[f] = _
}
return o
}
;
var r = Array.isArray || function(t) {
return "[object Array]" === Object.prototype.toString.call(t)
}
}
, function(t, e, n) {
"use strict";
e.decode = e.parse = n(274),
e.encode = e.stringify = n(273)
}
, function(t, e, n) {
"use strict";
function i(t) {
"@babel/helpers - typeof";
return (i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
t.exports = {
isString: function(t) {
return "string" == typeof t
},
isObject: function(t) {
return "object" === i(t) && null !== t
},
isNull: function(t) {
return null === t
},
isNullOrUndefined: function(t) {
return null == t
}
}
}
, function(t, e) {
t.exports = function(t) {
return t.webpackPolyfill || (t.deprecate = function() {}
,
t.paths = [],
t.children || (t.children = []),
Object.defineProperty(t, "loaded", {
enumerable: !0,
get: function() {
return t.l
}
}),
Object.defineProperty(t, "id", {
enumerable: !0,
get: function() {
return t.i
}
}),
t.webpackPolyfill = 1),
t
}
}
, function(t, e, n) {
(function(t, i) {
var r;
function a(t) {
"@babel/helpers - typeof";
return (a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
return typeof t
}
: function(t) {
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
}
)(t)
}
/*! https://mths.be/punycode v1.4.1 by @mathias */
!function(o) {
var s = "object" == a(e) && e && !e.nodeType && e
, l = "object" == a(t) && t && !t.nodeType && t
, c = "object" == (void 0 === i ? "undefined" : a(i)) && i;
c.global !== c && c.window !== c && c.self !== c || (o = c);
var u, d, h = 2147483647, f = 36, _ = 1, g = 26, p = 38, v = 700, m = 72, y = 128, k = "-", b = /^xn--/, x = /[^\x20-\x7E]/, w = /[\x2E\u3002\uFF0E\uFF61]/g, S = {
overflow: "Overflow: input needs wider integers to process",
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
"invalid-input": "Invalid input"
}, T = f - _, $ = Math.floor, C = String.fromCharCode;
function E(t) {
throw new RangeError(S[t])
}
function A(t, e) {
for (var n = t.length, i = []; n--; )
i[n] = e(t[n]);
return i
}
function D(t, e) {
var n = t.split("@")
, i = "";
return n.length > 1 && (i = n[0] + "@",
t = n[1]),
i + A((t = t.replace(w, ".")).split("."), e).join(".")
}
function M(t) {
for (var e, n, i = [], r = 0, a = t.length; r < a; )
(e = t.charCodeAt(r++)) >= 55296 && e <= 56319 && r < a ? 56320 == (64512 & (n = t.charCodeAt(r++))) ? i.push(((1023 & e) << 10) + (1023 & n) + 65536) : (i.push(e),
r--) : i.push(e);
return i
}
function I(t) {
return A(t, function(t) {
var e = "";
return t > 65535 && (e += C((t -= 65536) >>> 10 & 1023 | 55296),
t = 56320 | 1023 & t),
e += C(t)
}).join("")
}
function P(t) {
return t - 48 < 10 ? t - 22 : t - 65 < 26 ? t - 65 : t - 97 < 26 ? t - 97 : f
}
function N(t, e) {
return t + 22 + 75 * (t < 26) - ((0 != e) << 5)
}
function O(t, e, n) {
var i = 0;
for (t = n ? $(t / v) : t >> 1,
t += $(t / e); t > T * g >> 1; i += f)
t = $(t / T);
return $(i + (T + 1) * t / (t + p))
}
function L(t) {
var e, n, i, r, a, o, s, l, c, u, d = [], p = t.length, v = 0, b = y, x = m;
for ((n = t.lastIndexOf(k)) < 0 && (n = 0),
i = 0; i < n; ++i)
t.charCodeAt(i) >= 128 && E("not-basic"),
d.push(t.charCodeAt(i));
for (r = n > 0 ? n + 1 : 0; r < p; ) {
for (a = v,
o = 1,
s = f; r >= p && E("invalid-input"),
((l = P(t.charCodeAt(r++))) >= f || l > $((h - v) / o)) && E("overflow"),
v += l * o,
!(l < (c = s <= x ? _ : s >= x + g ? g : s - x)); s += f)
o > $(h / (u = f - c)) && E("overflow"),
o *= u;
x = O(v - a, e = d.length + 1, 0 == a),
$(v / e) > h - b && E("overflow"),
b += $(v / e),
v %= e,
d.splice(v++, 0, b)
}
return I(d)
}
function R(t) {
var e, n, i, r, a, o, s, l, c, u, d, p, v, b, x, w = [];
for (p = (t = M(t)).length,
e = y,
n = 0,
a = m,
o = 0; o < p; ++o)
(d = t[o]) < 128 && w.push(C(d));
for (i = r = w.length,
r && w.push(k); i < p; ) {
for (s = h,
o = 0; o < p; ++o)
(d = t[o]) >= e && d < s && (s = d);
for (s - e > $((h - n) / (v = i + 1)) && E("overflow"),
n += (s - e) * v,
e = s,
o = 0; o < p; ++o)
if ((d = t[o]) < e && ++n > h && E("overflow"),
d == e) {
for (l = n,
c = f; !(l < (u = c <= a ? _ : c >= a + g ? g : c - a)); c += f)
x = l - u,
b = f - u,
w.push(C(N(u + x % b, 0))),
l = $(x / b);
w.push(C(N(l, 0))),
a = O(n, v, i == r),
n = 0,
++i
}
++n,
++e
}
return w.join("")
}
if (u = {
version: "1.4.1",
ucs2: {
decode: M,
encode: I
},
decode: L,
encode: R,
toASCII: function(t) {
return D(t, function(t) {
return x.test(t) ? "xn--" + R(t) : t
})
},
toUnicode: function(t) {
return D(t, function(t) {
return b.test(t) ? L(t.slice(4).toLowerCase()) : t
})
}
},
"object" == a(n(53)) && n(53))
void 0 === (r = function() {
return u
}
.call(e, n, e, t)) || (t.exports = r);
else if (s && l)
if (t.exports == s)
l.exports = u;
else
for (d in u)
u.hasOwnProperty(d) && (s[d] = u[d]);
else
o.punycode = u
}(this)
}
).call(this, n(277)(t), n(4))
}
, function(t, e) {
t.exports = {
100: "Continue",
101: "Switching Protocols",
102: "Processing",
200: "OK",
201: "Created",
202: "Accepted",
203: "Non-Authoritative Information",
204: "No Content",
205: "Reset Content",
206: "Partial Content",
207: "Multi-Status",
208: "Already Reported",
226: "IM Used",
300: "Multiple Choices",
301: "Moved Permanently",
302: "Found",
303: "See Other",
304: "Not Modified",
305: "Use Proxy",
307: "Temporary Redirect",
308: "Permanent Redirect",
400: "Bad Request",
401: "Unauthorized",
402: "Payment Required",
403: "Forbidden",
404: "Not Found",
405: "Method Not Allowed",
406: "Not Acceptable",
407: "Proxy Authentication Required",
408: "Request Timeout",
409: "Conflict",
410: "Gone",
411: "Length Required",
412: "Precondition Failed",
413: "Payload Too Large",
414: "URI Too Long",
415: "Unsupported Media Type",
416: "Range Not Satisfiable",
417: "Expectation Failed",
418: "I'm a teapot",
421: "Misdirected Request",
422: "Unprocessable Entity",
423: "Locked",
424: "Failed Dependency",
425: "Unordered Collection",
426: "Upgrade Required",
428: "Precondition Required",
429: "Too Many Requests",
431: "Request Header Fields Too Large",
451: "Unavailable For Legal Reasons",
500: "Internal Server Error",
501: "Not Implemented",
502: "Bad Gateway",
503: "Service Unavailable",
504: "Gateway Timeout",
505: "HTTP Version Not Supported",
506: "Variant Also Negotiates",
507: "Insufficient Storage",
508: "Loop Detected",
509: "Bandwidth Limit Exceeded",
510: "Not Extended",
511: "Network Authentication Required"
}
}
, function(t, e) {
t.exports = function() {
for (var t = {}, e = 0; e < arguments.length; e++) {
var i = arguments[e];
for (var r in i)
n.call(i, r) && (t[r] = i[r])
}
return t
}
;
var n = Object.prototype.hasOwnProperty
}
, function(t, e, n) {
var i = n(13).Buffer;
t.exports = function(t) {
if (t instanceof Uint8Array) {
if (0 === t.byteOffset && t.byteLength === t.buffer.byteLength)
return t.buffer;
if ("function" == typeof t.buffer.slice)
return t.buffer.slice(t.byteOffset, t.byteOffset + t.byteLength)
}
if (i.isBuffer(t)) {
for (var e = new Uint8Array(t.length), n = t.length, r = 0; r < n; r++)
e[r] = t[r];
return e.buffer
}
throw new Error("Argument must be a Buffer")
}
}
, function(t, e, n) {
"use strict";
t.exports = a;
var i = n(55)
, r = n(17);
function a(t) {
if (!(this instanceof a))
return new a(t);
i.call(this, t)
}
r.inherits = n(8),
r.inherits(a, i),
a.prototype._transform = function(t, e, n) {
n(null, t)
}
}
, function(t, e, n) {
(function(e) {
function n(t) {
try {
if (!e.localStorage)
return !1
} catch (t) {
return !1
}
var n = e.localStorage[t];
return null != n && "true" === String(n).toLowerCase()
}
t.exports = function(t, e) {
if (n("noDeprecation"))
return t;
var i = !1;
return function() {
if (!i) {
if (n("throwDeprecation"))
throw new Error(e);
n("traceDeprecation") ? console.trace(e) : console.warn(e),
i = !0
}
return t.apply(this, arguments)
}
}
}
).call(this, n(4))
}
, function(t, e, n) {
(function(t, e) {
!function(t, n) {
"use strict";
if (!t.setImmediate) {
var i, r = 1, a = {}, o = !1, s = t.document, l = Object.getPrototypeOf && Object.getPrototypeOf(t);
l = l && l.setTimeout ? l : t,
"[object process]" === {}.toString.call(t.process) ? i = function(t) {
e.nextTick(function() {
u(t)
})
}
: function() {
if (t.postMessage && !t.importScripts) {
var e = !0
, n = t.onmessage;
return t.onmessage = function() {
e = !1
}
,
t.postMessage("", "*"),
t.onmessage = n,
e
}
}() ? function() {
var e = "setImmediate$" + Math.random() + "$"
, n = function(n) {
n.source === t && "string" == typeof n.data && 0 === n.data.indexOf(e) && u(+n.data.slice(e.length))
};
t.addEventListener ? t.addEventListener("message", n, !1) : t.attachEvent("onmessage", n),
i = function(n) {
t.postMessage(e + n, "*")
}
}() : t.MessageChannel ? function() {
var t = new MessageChannel;
t.port1.onmessage = function(t) {
u(t.data)
}
,
i = function(e) {
t.port2.postMessage(e)
}
}() : s && "onreadystatechange"in s.createElement("script") ? function() {
var t = s.documentElement;
i = function(e) {
var n = s.createElement("script");
n.onreadystatechange = function() {
u(e),
n.onreadystatechange = null,
t.removeChild(n),
n = null
}
,
t.appendChild(n)
}
}() : i = function(t) {
setTimeout(u, 0, t)
}
,
l.setImmediate = function(t) {
"function" != typeof t && (t = new Function("" + t));
for (var e = new Array(arguments.length - 1), n = 0; n < e.length; n++)
e[n] = arguments[n + 1];
var o = {
callback: t,
args: e
};
return a[r] = o,
i(r),
r++
}
,
l.clearImmediate = c
}
function c(t) {
delete a[t]
}
function u(t) {
if (o)
setTimeout(u, 0, t);
else {
var e = a[t];
if (e) {
o = !0;
try {
!function(t) {
var e = t.callback
, i = t.args;
switch (i.length) {
case 0:
e();
break;
case 1:
e(i[0]);
break;
case 2:
e(i[0], i[1]);
break;
case 3:
e(i[0], i[1], i[2]);
break;
default:
e.apply(n, i)
}
}(e)
} finally {
c(t),
o = !1
}
}
}
}
}("undefined" == typeof self ? void 0 === t ? this : t : self)
}
).call(this, n(4), n(9))
}
, function(t, e) {}
, function(t, e, n) {
"use strict";
var i = n(22).Buffer
, r = n(285);
function a(t, e, n) {
t.copy(e, n)
}
t.exports = function() {
function t() {
!function(t, e) {
if (!(t instanceof e))
throw new TypeError("Cannot call a class as a function")
}(this, t),
this.head = null,
this.tail = null,
this.length = 0
}
return t.prototype.push = function(t) {
var e = {
data: t,
next: null
};
this.length > 0 ? this.tail.next = e : this.head = e,
this.tail = e,
++this.length
}
,
t.prototype.unshift = function(t) {
var e = {
data: t,
next: this.head
};
0 === this.length && (this.tail = e),
this.head = e,
++this.length
}
,
t.prototype.shift = function() {
if (0 !== this.length) {
var t = this.head.data;
return 1 === this.length ? this.head = this.tail = null : this.head = this.head.next,
--this.length,
t
}
}
,
t.prototype.clear = function() {
this.head = this.tail = null,
this.length = 0
}
,
t.prototype.join = function(t) {
if (0 === this.length)
return "";
for (var e = this.head, n = "" + e.data; e = e.next; )
n += t + e.data;
return n
}
,
t.prototype.concat = function(t) {
if (0 === this.length)
return i.alloc(0);
if (1 === this.length)
return this.head.data;
for (var e = i.allocUnsafe(t >>> 0), n = this.head, r = 0; n; )
a(n.data, e, r),
r += n.data.length,
n = n.next;
return e
}
,
t
}(),
r && r.inspect && r.inspect.custom && (t.exports.prototype[r.inspect.custom] = function() {
var t = r.inspect({
length: this.length
});
return this.constructor.name + " " + t
}
)
}
, function(t, e) {}
, function(t, e, n) {
(function(e, i, r) {
var a = n(65)
, o = n(8)
, s = n(64)
, l = n(63)
, c = n(281)
, u = s.IncomingMessage
, d = s.readyStates;
var h = t.exports = function(t) {
var n, i = this;
l.Writable.call(i),
i._opts = t,
i._body = [],
i._headers = {},
t.auth && i.setHeader("Authorization", "Basic " + new e(t.auth).toString("base64")),
Object.keys(t.headers).forEach(function(e) {
i.setHeader(e, t.headers[e])
});
var r = !0;
if ("disable-fetch" === t.mode || "requestTimeout"in t && !a.abortController)
r = !1,
n = !0;
else if ("prefer-streaming" === t.mode)
n = !1;
else if ("allow-wrong-content-type" === t.mode)
n = !a.overrideMimeType;
else {
if (t.mode && "default" !== t.mode && "prefer-fast" !== t.mode)
throw new Error("Invalid value for opts.mode");
n = !0
}
i._mode = function(t, e) {
return a.fetch && e ? "fetch" : a.mozchunkedarraybuffer ? "moz-chunked-arraybuffer" : a.msstream ? "ms-stream" : a.arraybuffer && t ? "arraybuffer" : a.vbArray && t ? "text:vbarray" : "text"
}(n, r),
i._fetchTimer = null,
i.on("finish", function() {
i._onFinish()
})
}
;
o(h, l.Writable),
h.prototype.setHeader = function(t, e) {
var n = t.toLowerCase();
-1 === f.indexOf(n) && (this._headers[n] = {
name: t,
value: e
})
}
,
h.prototype.getHeader = function(t) {
var e = this._headers[t.toLowerCase()];
return e ? e.value : null
}
,
h.prototype.removeHeader = function(t) {
delete this._headers[t.toLowerCase()]
}
,
h.prototype._onFinish = function() {
var t = this;
if (!t._destroyed) {
var n = t._opts
, o = t._headers
, s = null;
"GET" !== n.method && "HEAD" !== n.method && (s = a.arraybuffer ? c(e.concat(t._body)) : a.blobConstructor ? new i.Blob(t._body.map(function(t) {
return c(t)
}),{
type: (o["content-type"] || {}).value || ""
}) : e.concat(t._body).toString());
var l = [];
if (Object.keys(o).forEach(function(t) {
var e = o[t].name
, n = o[t].value;
Array.isArray(n) ? n.forEach(function(t) {
l.push([e, t])
}) : l.push([e, n])
}),
"fetch" === t._mode) {
var u = null;
if (a.abortController) {
var h = new AbortController;
u = h.signal,
t._fetchAbortController = h,
"requestTimeout"in n && 0 !== n.requestTimeout && (t._fetchTimer = i.setTimeout(function() {
t.emit("requestTimeout"),
t._fetchAbortController && t._fetchAbortController.abort()
}, n.requestTimeout))
}
i.fetch(t._opts.url, {
method: t._opts.method,
headers: l,
body: s || void 0,
mode: "cors",
credentials: n.withCredentials ? "include" : "same-origin",
signal: u
}).then(function(e) {
t._fetchResponse = e,
t._connect()
}, function(e) {
i.clearTimeout(t._fetchTimer),
t._destroyed || t.emit("error", e)
})
} else {
var f = t._xhr = new i.XMLHttpRequest;
try {
f.open(t._opts.method, t._opts.url, !0)
} catch (e) {
return void r.nextTick(function() {
t.emit("error", e)
})
}
"responseType"in f && (f.responseType = t._mode.split(":")[0]),
"withCredentials"in f && (f.withCredentials = !!n.withCredentials),
"text" === t._mode && "overrideMimeType"in f && f.overrideMimeType("text/plain; charset=x-user-defined"),
"requestTimeout"in n && (f.timeout = n.requestTimeout,
f.ontimeout = function() {
t.emit("requestTimeout")
}
),
l.forEach(function(t) {
f.setRequestHeader(t[0], t[1])
}),
t._response = null,
f.onreadystatechange = function() {
switch (f.readyState) {
case d.LOADING:
case d.DONE:
t._onXHRProgress()
}
}
,
"moz-chunked-arraybuffer" === t._mode && (f.onprogress = function() {
t._onXHRProgress()
}
),
f.onerror = function() {
t._destroyed || t.emit("error", new Error("XHR error"))
}
;
try {
f.send(s)
} catch (e) {
return void r.nextTick(function() {
t.emit("error", e)
})
}
}
}
}
,
h.prototype._onXHRProgress = function() {
(function(t) {
try {
var e = t.status;
return null !== e && 0 !== e
} catch (t) {
return !1
}
}
)(this._xhr) && !this._destroyed && (this._response || this._connect(),
this._response._onXHRProgress())
}
,
h.prototype._connect = function() {
var t = this;
t._destroyed || (t._response = new u(t._xhr,t._fetchResponse,t._mode,t._fetchTimer),
t._response.on("error", function(e) {
t.emit("error", e)
}),
t.emit("response", t._response))
}
,
h.prototype._write = function(t, e, n) {
this._body.push(t),
n()
}
,
h.prototype.abort = h.prototype.destroy = function() {
this._destroyed = !0,
i.clearTimeout(this._fetchTimer),
this._response && (this._response._destroyed = !0),
this._xhr ? this._xhr.abort() : this._fetchAbortController && this._fetchAbortController.abort()
}
,
h.prototype.end = function(t, e, n) {
"function" == typeof t && (n = t,
t = void 0),
l.Writable.prototype.end.call(this, t, e, n)
}
,
h.prototype.flushHeaders = function() {}
,
h.prototype.setTimeout = function() {}
,
h.prototype.setNoDelay = function() {}
,
h.prototype.setSocketKeepAlive = function() {}
;
var f = ["accept-charset", "accept-encoding", "access-control-request-headers", "access-control-request-method", "connection", "content-length", "cookie", "cookie2", "date", "dnt", "expect", "host", "keep-alive", "origin", "referer", "te", "trailer", "transfer-encoding", "upgrade", "via"]
}
).call(this, n(13).Buffer, n(4), n(9))
}
, function(t, e, n) {
var i = n(66)
, r = n(54)
, a = t.exports;
for (var o in i)
i.hasOwnProperty(o) && (a[o] = i[o]);
function s(t) {
if ("string" == typeof t && (t = r.parse(t)),
t.protocol || (t.protocol = "https:"),
"https:" !== t.protocol)
throw new Error('Protocol "' + t.protocol + '" not supported. Expected "https:"');
return t
}
a.request = function(t, e) {
return t = s(t),
i.request.call(this, t, e)
}
,
a.get = function(t, e) {
return t = s(t),
i.get.call(this, t, e)
}
}
, function(t, e) {
e.read = function(t, e, n, i, r) {
var a, o, s = 8 * r - i - 1, l = (1 << s) - 1, c = l >> 1, u = -7, d = n ? r - 1 : 0, h = n ? -1 : 1, f = t[e + d];
for (d += h,
a = f & (1 << -u) - 1,
f >>= -u,
u += s; u > 0; a = 256 * a + t[e + d],
d += h,
u -= 8)
;
for (o = a & (1 << -u) - 1,
a >>= -u,
u += i; u > 0; o = 256 * o + t[e + d],
d += h,
u -= 8)
;
if (0 === a)
a = 1 - c;
else {
if (a === l)
return o ? NaN : 1 / 0 * (f ? -1 : 1);
o += Math.pow(2, i),
a -= c
}
return (f ? -1 : 1) * o * Math.pow(2, a - i)
}
,
e.write = function(t, e, n, i, r, a) {
var o, s, l, c = 8 * a - r - 1, u = (1 << c) - 1, d = u >> 1, h = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0, f = i ? 0 : a - 1, _ = i ? 1 : -1, g = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0;
for (e = Math.abs(e),
isNaN(e) || e === 1 / 0 ? (s = isNaN(e) ? 1 : 0,
o = u) : (o = Math.floor(Math.log(e) / Math.LN2),
e * (l = Math.pow(2, -o)) < 1 && (o--,
l *= 2),
(e += o + d >= 1 ? h / l : h * Math.pow(2, 1 - d)) * l >= 2 && (o++,
l /= 2),
o + d >= u ? (s = 0,
o = u) : o + d >= 1 ? (s = (e * l - 1) * Math.pow(2, r),
o += d) : (s = e * Math.pow(2, d - 1) * Math.pow(2, r),
o = 0)); r >= 8; t[n + f] = 255 & s,
f += _,
s /= 256,
r -= 8)
;
for (o = o << r | s,
c += r; c > 0; t[n + f] = 255 & o,
f += _,
o /= 256,
c -= 8)
;
t[n + f - _] |= 128 * g
}
}
, function(t, e, n) {
"use strict";
e.byteLength = function(t) {
var e = c(t)
, n = e[0]
, i = e[1];
return 3 * (n + i) / 4 - i
}
,
e.toByteArray = function(t) {
for (var e, n = c(t), i = n[0], o = n[1], s = new a(function(t, e, n) {
return 3 * (e + n) / 4 - n
}(0, i, o)), l = 0, u = o > 0 ? i - 4 : i, d = 0; d < u; d += 4)
e = r[t.charCodeAt(d)] << 18 | r[t.charCodeAt(d + 1)] << 12 | r[t.charCodeAt(d + 2)] << 6 | r[t.charCodeAt(d + 3)],
s[l++] = e >> 16 & 255,
s[l++] = e >> 8 & 255,
s[l++] = 255 & e;
2 === o && (e = r[t.charCodeAt(d)] << 2 | r[t.charCodeAt(d + 1)] >> 4,
s[l++] = 255 & e);
1 === o && (e = r[t.charCodeAt(d)] << 10 | r[t.charCodeAt(d + 1)] << 4 | r[t.charCodeAt(d + 2)] >> 2,
s[l++] = e >> 8 & 255,
s[l++] = 255 & e);
return s
}
,
e.fromByteArray = function(t) {
for (var e, n = t.length, r = n % 3, a = [], o = 0, s = n - r; o < s; o += 16383)
a.push(d(t, o, o + 16383 > s ? s : o + 16383));
1 === r ? (e = t[n - 1],
a.push(i[e >> 2] + i[e << 4 & 63] + "==")) : 2 === r && (e = (t[n - 2] << 8) + t[n - 1],
a.push(i[e >> 10] + i[e >> 4 & 63] + i[e << 2 & 63] + "="));
return a.join("")
}
;
for (var i = [], r = [], a = "undefined" != typeof Uint8Array ? Uint8Array : Array, o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", s = 0, l = o.length; s < l; ++s)
i[s] = o[s],
r[o.charCodeAt(s)] = s;
function c(t) {
var e = t.length;
if (e % 4 > 0)
throw new Error("Invalid string. Length must be a multiple of 4");
var n = t.indexOf("=");
return -1 === n && (n = e),
[n, n === e ? 0 : 4 - n % 4]
}
function u(t) {
return i[t >> 18 & 63] + i[t >> 12 & 63] + i[t >> 6 & 63] + i[63 & t]
}
function d(t, e, n) {
for (var i, r = [], a = e; a < n; a += 3)
i = (t[a] << 16 & 16711680) + (t[a + 1] << 8 & 65280) + (255 & t[a + 2]),
r.push(u(i));
return r.join("")
}
r["-".charCodeAt(0)] = 62,
r["_".charCodeAt(0)] = 63
}
, function(t, e, n) {
"use strict";
(function(t) {
Object.defineProperty(e, "__esModule", {
value: !0
}),
e.default = function(e) {
e.ext = e.ext || {},
e.ext.export_api = e.ext.export_api || {
_apiUrl: "https://export.dhtmlx.com/gantt",
getNodeJSTransport: function(t) {
var e, i, r = t.split("://")[0];
switch (r) {
case "https":
e = n(289),
i = 443;
break;
case "http":
e = n(66),
i = 80;
break;
default:
throw new Error("Unsupported protocol: " + r + ", url: " + t)
}
return {
module: e,
defaultPort: i
}
},
_prepareConfigPDF: function(t, n) {
if (t && t.raw) {
var i = null;
t.start && t.end && (i = {
start_date: e.config.start_date,
end_date: e.config.end_date
},
e.config.start_date = e.date.str_to_date(e.config.date_format)(t.start),
e.config.end_date = e.date.str_to_date(e.config.date_format)(t.end)),
t = e.mixin(t, {
name: "gantt." + n,
data: e.ext.export_api._serializeHtml()
}),
i && (e.config.start_date = i.start_date,
e.config.end_date = i.end_date)
} else
t = e.mixin(t || {}, {
name: "gantt." + n,
data: e.ext.export_api._serializeAll(),
config: e.config
}),
e.ext.export_api._fixColumns(t.config.columns);
t.version = e.version,
e.ext.export_api._sendToExport(t, n)
},
exportToPDF: function(t) {
e.ext.export_api._prepareConfigPDF(t, "pdf")
},
exportToPNG: function(t) {
e.ext.export_api._prepareConfigPDF(t, "png")
},
exportToICal: function(t) {
t = e.mixin(t || {}, {
name: "gantt.ical",
data: e.ext.export_api._serializePlain().data,
version: e.version
}),
e.ext.export_api._sendToExport(t, "ical")
},
exportToExcel: function(t) {
var n, i, r, a;
t = t || {};
var o = e.config.smart_rendering;
if ("base-colors" === t.visual && (e.config.smart_rendering = !1),
t.start || t.end) {
r = e.getState(),
i = [e.config.start_date, e.config.end_date],
a = e.getScrollState();
var s = e.date.str_to_date(e.config.date_format);
n = e.eachTask,
t.start && (e.config.start_date = s(t.start)),
t.end && (e.config.end_date = s(t.end)),
e.render(),
e.config.smart_rendering = o,
e.eachTask = e.ext.export_api._eachTaskTimed(e.config.start_date, e.config.end_date)
} else
"base-colors" === t.visual && (e.render(),
e.config.smart_rendering = o);
e._no_progress_colors = "base-colors" === t.visual;
var l = null;
e.env.isNode || (l = e.ext.export_api._serializeTable(t).data),
(t = e.mixin(t, {
name: "gantt.xlsx",
title: "Tasks",
data: l,
columns: e.ext.export_api._serializeColumns({
rawDates: !0
}),
version: e.version
})).visual && (t.scales = e.ext.export_api._serializeScales(t)),
e.ext.export_api._sendToExport(t, "excel"),
(t.start || t.end) && (e.config.start_date = r.min_date,
e.config.end_date = r.max_date,
e.eachTask = n,
e.render(),
e.scrollTo(a.x, a.y),
e.config.start_date = i[0],
e.config.end_date = i[1])
},
exportToJSON: function(t) {
t = e.mixin(t || {}, {
name: "gantt.json",
data: e.ext.export_api._serializeAll(),
config: e.config,
columns: e.ext.export_api._serializeColumns(),
worktime: e.ext.export_api._getWorktimeSettings(),
version: e.version
}),
e.ext.export_api._sendToExport(t, "json")
},
importFromExcel: function(t) {
try {
var n = t.data;
if (n instanceof FormData)
;
else if (n instanceof File) {
var i = new FormData;
i.append("file", n),
t.data = i
}
} catch (t) {}
e.env.isNode ? e.ext.export_api._nodejsImportExcel(t) : e.ext.export_api._sendImportAjaxExcel(t)
},
importFromMSProject: function(t) {
var n = t.data;
try {
if (n instanceof FormData)
;
else if (n instanceof File) {
var i = new FormData;
i.append("file", n),
t.data = i
}
} catch (t) {}
e.env.isNode ? e.ext.export_api._nodejsImportMSP(t) : e.ext.export_api._sendImportAjaxMSP(t)
},
importFromPrimaveraP6: function(t) {
return t.type = "primaveraP6-parse",
e.importFromMSProject(t)
},
exportToMSProject: function(t) {
(t = t || {}).skip_circular_links = void 0 === t.skip_circular_links || !!t.skip_circular_links;
var n = e.templates.xml_format
, i = e.templates.format_date
, r = e.config.xml_date
, a = e.config.date_format;
e.config.xml_date = "%d-%m-%Y %H:%i:%s",
e.config.date_format = "%d-%m-%Y %H:%i:%s",
e.templates.xml_format = e.date.date_to_str("%d-%m-%Y %H:%i:%s"),
e.templates.format_date = e.date.date_to_str("%d-%m-%Y %H:%i:%s");
var o = e.ext.export_api._serializeAll();
e.ext.export_api._customProjectProperties(o, t),
e.ext.export_api._customTaskProperties(o, t),
t.skip_circular_links && e.ext.export_api._clearRecLinks(o),
t = e.ext.export_api._exportConfig(o, t),
e.ext.export_api._sendToExport(t, t.type || "msproject"),
e.config.xml_date = r,
e.config.date_format = a,
e.templates.xml_format = n,
e.templates.format_date = i,
e.config.$custom_data = null,
e.config.custom = null
},
exportToPrimaveraP6: function(t) {
return (t = t || {}).type = "primaveraP6",
e.exportToMSProject(t)
},
_nodejsImportExcel: function(t) {
var i = n(52)
, r = t.server || e.ext.export_api._apiUrl
, a = e.ext.export_api.getNodeJSTransport(r)
, o = r.split("://")[1]
, s = o.split("/")[0].split(":")
, l = o.split("/")
, c = {
hostname: s[0],
port: s[1] || a.defaultPort,
path: "/" + l.slice(1).join("/"),
method: "POST",
headers: {
"X-Requested-With": "XMLHttpRequest"
}
}
, u = new i;
u.append("file", t.data),
u.append("type", "excel-parse"),
u.append("data", JSON.stringify({
sheet: t.sheet || 0
})),
c.headers["Content-Type"] = u.getHeaders()["content-type"];
var d = a.module.request(c, function(e) {
var n = "";
e.on("data", function(t) {
n += t
}),
e.on("end", function(e) {
t.callback(n.toString())
})
});
d.on("error", function(t) {
console.error(t)
}),
u.pipe(d)
},
_nodejsImportMSP: function(t) {
var i = n(52)
, r = t.server || e.ext.export_api._apiUrl
, a = e.ext.export_api.getNodeJSTransport(r)
, o = r.split("://")[1]
, s = o.split("/")[0].split(":")
, l = o.split("/")
, c = {
hostname: s[0],
port: s[1] || a.defaultPort,
path: "/" + l.slice(1).join("/"),
method: "POST",
headers: {
"X-Requested-With": "XMLHttpRequest"
}
}
, u = {
durationUnit: t.durationUnit || void 0,
projectProperties: t.projectProperties || void 0,
taskProperties: t.taskProperties || void 0
}
, d = new i;
d.append("file", t.data),
d.append("type", t.type || "msproject-parse"),
d.append("data", JSON.stringify(u), c),
c.headers["Content-Type"] = d.getHeaders()["content-type"];
var h = a.module.request(c, function(e) {
var n = "";
e.on("data", function(t) {
n += t
}),
e.on("end", function(e) {
t.callback(n.toString())
})
});
h.on("error", function(t) {
console.error(t)
}),
d.pipe(h)
},
_fixColumns: function(t) {
for (var n = 0; n < t.length; n++)
t[n].label = t[n].label || e.locale.labels["column_" + t[n].name],
"string" == typeof t[n].width && (t[n].width = 1 * t[n].width)
},
_xdr: function(t, n, i) {
e.env.isNode ? e.ext.export_api._nodejsPostRequest(t, n, i) : e.ajax.post(t, n, i)
},
_nodejsPostRequest: function(n, i, r) {
var a = e.ext.export_api.getNodeJSTransport(n)
, o = n.split("://")[1]
, s = o.split("/")[0].split(":")
, l = o.split("/")
, c = {
hostname: s[0],
port: s[1] || a.defaultPort,
path: "/" + l.slice(1).join("/"),
method: "POST",
headers: {
"Content-Type": "application/json",
"Content-Length": JSON.stringify(i).length
}
}
, u = a.module.request(c, function(e) {
var n = [];
e.on("data", function(t) {
n.push(t)
}),
e.on("end", function(e) {
r(t.concat(n))
})
});
u.on("error", function(t) {
console.error(t)
}),
u.write(JSON.stringify(i)),
u.end()
},
_markColumns: function(t) {
var e = t.config.columns;
if (e)
for (var n = 0; n < e.length; n++)
e[n].template && (e[n].$template = !0)
},
_sendImportAjaxExcel: function(t) {
var n = t.server || e.ext.export_api._apiUrl
, i = t.store || 0
, r = t.data
, a = t.callback;
r.append("type", "excel-parse"),
r.append("data", JSON.stringify({
sheet: t.sheet || 0
})),
i && r.append("store", i);
var o = new XMLHttpRequest;
o.onreadystatechange = function(t) {
4 === o.readyState && 0 === o.status && a && a(null)
}
,
o.onload = function() {
var t = null;
if (!(o.status > 400))
try {
t = JSON.parse(o.responseText)
} catch (t) {}
a && a(t)
}
,
o.open("POST", n, !0),
o.setRequestHeader("X-Requested-With", "XMLHttpRequest"),
o.send(r)
},
_ajaxToExport: function(t, n, i) {
delete t.callback;
var r = t.server || e.ext.export_api._apiUrl
, a = "type=" + n + "&store=1&data=" + encodeURIComponent(JSON.stringify(t));
e.ext.export_api._xdr(r, a, function(t) {
var e = t.xmlDoc || t
, n = null;
if (!(e.status > 400))
try {
n = JSON.parse(e.responseText)
} catch (t) {}
i(n)
})
},
_serializableGanttConfig: function(t) {
var n = e.mixin({}, t);
return n.columns && (n.columns = n.columns.map(function(t) {
var n = e.mixin({}, t);
return delete n.editor,
n
})),
delete n.editor_types,
n
},
_sendToExport: function(t, n) {
var i = e.date.date_to_str(e.config.date_format || e.config.xml_date);
if (t.config && (t.config = e.copy(e.ext.export_api._serializableGanttConfig(t.config)),
e.ext.export_api._markColumns(t, n),
t.config.start_date && t.config.end_date && (t.config.start_date instanceof Date && (t.config.start_date = i(t.config.start_date)),
t.config.end_date instanceof Date && (t.config.end_date = i(t.config.end_date)))),
e.env.isNode) {
var r = t.server || e.ext.export_api._apiUrl
, a = {
type: n,
store: 0,
data: JSON.stringify(t)
}
, o = t.callback || function(t) {
console.log(t)
}
;
return e.ext.export_api._xdr(r, a, o)
}
if (t.callback)
return e.ext.export_api._ajaxToExport(t, n, t.callback);
var s = e.ext.export_api._createHiddenForm();
s.firstChild.action = t.server || e.ext.export_api._apiUrl,
s.firstChild.childNodes[0].value = JSON.stringify(t),
s.firstChild.childNodes[1].value = n,
s.firstChild.submit()
},
_createHiddenForm: function() {
if (!e.ext.export_api._hidden_export_form) {
var t = e.ext.export_api._hidden_export_form = document.createElement("div");
t.style.display = "none",
t.innerHTML = "",
document.body.appendChild(t)
}
return e.ext.export_api._hidden_export_form
},
_copyObjectBase: function(t) {
var n = {
start_date: void 0,
end_date: void 0
};
for (var i in t)
"$" !== i.charAt(0) && (n[i] = t[i]);
var r = e.templates.xml_format || e.templates.format_date;
return n.start_date = r(n.start_date),
n.end_date && (n.end_date = r(n.end_date)),
n
},
_color_box: null,
_color_hash: {},
_getStyles: function(t) {
if (e.ext.export_api._color_box || (e.ext.export_api._color_box = document.createElement("DIV"),
e.ext.export_api._color_box.style.cssText = "position:absolute; display:none;",
document.body.appendChild(e.ext.export_api._color_box)),
e.ext.export_api._color_hash[t])
return e.ext.export_api._color_hash[t];
e.ext.export_api._color_box.className = t;
var n = e.ext.export_api._getColor(e.ext.export_api._color_box, "color")
, i = e.ext.export_api._getColor(e.ext.export_api._color_box, "backgroundColor");
return e.ext.export_api._color_hash[t] = n + ";" + i
},
_getMinutesWorktimeSettings: function(t) {
var e = [];
return t.forEach(function(t) {
e.push(t.startMinute),
e.push(t.endMinute)
}),
e
},
_getWorktimeSettings: function() {
var t, n = {
hours: [0, 24],
minutes: null,
dates: {
0: !0,
1: !0,
2: !0,
3: !0,
4: !0,
5: !0,
6: !0
}
};
if (e.config.work_time) {
var i = e._working_time_helper;
if (i && i.get_calendar)
t = i.get_calendar();
else if (i)
t = {
hours: i.hours,
minutes: null,
dates: i.dates
};
else if (e.config.worktimes && e.config.worktimes.global) {
var r = e.config.worktimes.global;
if (r.parsed) {
var a = e.ext.export_api._getMinutesWorktimeSettings(r.parsed.hours);
for (var o in t = {
hours: null,
minutes: a,
dates: {}
},
r.parsed.dates)
Array.isArray(r.parsed.dates[o]) ? t.dates[o] = e.ext.export_api._getMinutesWorktimeSettings(r.parsed.dates[o]) : t.dates[o] = r.parsed.dates[o]
} else
t = {
hours: r.hours,
minutes: null,
dates: r.dates
}
} else
t = n
} else
t = n;
return t
},
_eachTaskTimed: function(t, n) {
return function(i, r, a) {
r = r || e.config.root_id,
a = a || e;
var o = e.getChildren(r);
if (o)
for (var s = 0; s < o.length; s++) {
var l = e._pull[o[s]];
(!t || l.end_date > t) && (!n || l.start_date < n) && i.call(a, l),
e.hasChild(l.id) && e.eachTask(i, l.id, a)
}
}
},
_originalCopyObject: e.json._copyObject,
_copyObjectPlain: function(t) {
var n = e.templates.task_text(t.start_date, t.end_date, t)
, i = e.ext.export_api._copyObjectBase(t);
return i.text = n || i.text,
i
},
_getColor: function(t, e) {
var n = t.currentStyle ? t.currentStyle[e] : getComputedStyle(t, null)[e]
, i = n.replace(/\s/g, "").match(/^rgba?\((\d+),(\d+),(\d+)/i);
return (i && 4 === i.length ? ("0" + parseInt(i[1], 10).toString(16)).slice(-2) + ("0" + parseInt(i[2], 10).toString(16)).slice(-2) + ("0" + parseInt(i[3], 10).toString(16)).slice(-2) : n).replace("#", "")
},
_copyObjectTable: function(t) {
var n = e.date.date_to_str("%Y-%m-%dT%H:%i:%s.000Z")
, i = e.ext.export_api._copyObjectColumns(t, e.ext.export_api._copyObjectPlain(t));
i.start_date && (i.start_date = n(t.start_date)),
i.end_date && (i.end_date = n(t.end_date));
var r = e._day_index_by_date ? e._day_index_by_date : e.columnIndexByDate;
i.$start = r.call(e, t.start_date),
i.$end = r.call(e, t.end_date);
var a = 0
, o = e.getScale().width;
if (o.indexOf(0) > -1) {
for (var s = 0; s < i.$start; s++)
o[s] || a++;
for (i.$start -= a; s < i.$end; s++)
o[s] || a++;
i.$end -= a
}
i.$level = t.$level,
i.$type = t.$rendered_type;
var l = e.templates;
return i.$text = l.task_text(t.start, t.end_date, t),
i.$left = l.leftside_text ? l.leftside_text(t.start, t.end_date, t) : "",
i.$right = l.rightside_text ? l.rightside_text(t.start, t.end_date, t) : "",
i
},
_copyObjectColors: function(t) {
var n = e.ext.export_api._copyObjectTable(t)
, i = e.getTaskNode(t.id);
if (i && i.firstChild) {
var r = e.ext.export_api._getColor(e._no_progress_colors ? i : i.firstChild, "backgroundColor");
"363636" === r && (r = e.ext.export_api._getColor(i, "backgroundColor")),
n.$color = r
} else
t.color && (n.$color = t.color);
return n
},
_copyObjectColumns: function(t, n) {
for (var i = 0; i < e.config.columns.length; i++) {
var r = e.config.columns[i].template;
if (r) {
var a = r(t);
a instanceof Date && (a = e.templates.date_grid(a, t)),
n["_" + i] = a
}
}
return n
},
_copyObjectAll: function(t) {
for (var n = e.ext.export_api._copyObjectBase(t), i = ["leftside_text", "rightside_text", "task_text", "progress_text", "task_class"], r = 0; r < i.length; r++) {
var a = e.templates[i[r]];
a && (n["$" + r] = a(t.start_date, t.end_date, t))
}
return e.ext.export_api._copyObjectColumns(t, n),
n.open = t.$open,
n
},
_serializeHtml: function() {
var t = e.config.smart_scales
, n = e.config.smart_rendering;
(t || n) && (e.config.smart_rendering = !1,
e.config.smart_scales = !1,
e.render());
var i = e.$container.parentNode.innerHTML;
return (t || n) && (e.config.smart_scales = t,
e.config.smart_rendering = n,
e.render()),
i
},
_serializeAll: function() {
e.json._copyObject = e.ext.export_api._copyObjectAll;
var t = e.ext.export_api._exportSerialize();
return e.json._copyObject = e.ext.export_api._originalCopyObject,
t
},
_serializePlain: function() {
var t = e.templates.xml_format
, n = e.templates.format_date;
e.templates.xml_format = e.date.date_to_str("%Y%m%dT%H%i%s", !0),
e.templates.format_date = e.date.date_to_str("%Y%m%dT%H%i%s", !0),
e.json._copyObject = e.ext.export_api._copyObjectPlain;
var i = e.ext.export_api._exportSerialize();
return e.templates.xml_format = t,
e.templates.format_date = n,
e.json._copyObject = e.ext.export_api._originalCopyObject,
delete i.links,
i
},
_getRaw: function() {
if (e._scale_helpers) {
var t = e._get_scales()
, n = e.config.min_column_width
, i = e._get_resize_options().x ? Math.max(e.config.autosize_min_width, 0) : e.config.$task.offsetWidth
, r = e.config.config.scale_height - 1;
return e._scale_helpers.prepareConfigs(t, n, i, r)
}
var a = e.$ui.getView("timeline");
if (a) {
var o = a.$config.width;
"x" !== e.config.autosize && "xy" !== e.config.autosize || (o = Math.max(e.config.autosize_min_width, 0));
var s = e.getState()
, l = (t = a._getScales(),
n = e.config.min_column_width,
r = e.config.scale_height - 1,
e.config.rtl);
return a.$scaleHelper.prepareConfigs(t, n, o, r, s.min_date, s.max_date, l)
}
},
_serializeTable: function(t) {
e.json._copyObject = t.visual ? e.ext.export_api._copyObjectColors : e.ext.export_api._copyObjectTable;
var n = e.ext.export_api._exportSerialize();
if (e.json._copyObject = e.ext.export_api._originalCopyObject,
delete n.links,
t.cellColors) {
var i = e.templates.timeline_cell_class || e.templates.task_cell_class;
if (i) {
for (var r = e.ext.export_api._getRaw(), a = r[0].trace_x, o = 1; o < r.length; o++)
r[o].trace_x.length > a.length && (a = r[o].trace_x);
for (o = 0; o < n.data.length; o++) {
n.data[o].styles = [];
for (var s = e.getTask(n.data[o].id), l = 0; l < a.length; l++) {
var c = i(s, a[l]);
c && n.data[o].styles.push({
index: l,
styles: e.ext.export_api._getStyles(c)
})
}
}
}
}
return n
},
_serializeScales: function(t) {
for (var n = [], i = e.ext.export_api._getRaw(), r = 1 / 0, a = 0, o = 0; o < i.length; o++)
r = Math.min(r, i[o].col_width);
for (o = 0; o < i.length; o++) {
var s = 0
, l = 0
, c = [];
n.push(c);
var u = i[o];
a = Math.max(a, u.trace_x.length);
for (var d = u.format || u.template || (u.date ? e.date.date_to_str(u.date) : e.config.date_scale), h = 0; h < u.trace_x.length; h++) {
var f = u.trace_x[h];
l = s + Math.round(u.width[h] / r);
var _ = {
text: d(f),
start: s,
end: l,
styles: ""
};
if (t.cellColors) {
var g = u.css || e.templates.scaleCell_class;
if (g) {
var p = g(f);
p && (_.styles = e.ext.export_api._getStyles(p))
}
}
c.push(_),
s = l
}
}
return {
width: a,
height: n.length,
data: n
}
},
_serializeColumns: function(t) {
e.exportMode = !0;
for (var n = [], i = e.config.columns, r = 0, a = 0; a < i.length; a++)
"add" !== i[a].name && "buttons" !== i[a].name && (n[r] = {
id: i[a].template ? "_" + a : i[a].name,
header: i[a].label || e.locale.labels["column_" + i[a].name],
width: i[a].width ? Math.floor(i[a].width / 4) : ""
},
"duration" === i[a].name && (n[r].type = "number"),
"start_date" !== i[a].name && "end_date" !== i[a].name || (n[r].type = "date",
t && t.rawDates && (n[r].id = i[a].name)),
r++);
return e.exportMode = !1,
n
},
_exportSerialize: function() {
e.exportMode = !0;
var t = e.templates.xml_format
, n = e.templates.format_date;
e.templates.xml_format = e.templates.format_date = e.date.date_to_str(e.config.date_format || e.config.xml_date);
var i = e.serialize();
return e.templates.xml_format = t,
e.templates.format_date = n,
e.exportMode = !1,
i
},
_setLevel: function(t) {
for (var e = 0; e < t.length; e++) {
0 == t[e].parent && (t[e]._lvl = 1);
for (var n = e + 1; n < t.length; n++)
t[e].id == t[n].parent && (t[n]._lvl = t[e]._lvl + 1)
}
},
_clearLevel: function(t) {
for (var e = 0; e < t.length; e++)
delete t[e]._lvl
},
_clearRecLinks: function(t) {
e.ext.export_api._setLevel(t.data);
for (var n = {}, i = 0; i < t.data.length; i++)
n[t.data[i].id] = t.data[i];
var r = {};
for (i = 0; i < t.links.length; i++) {
var a = t.links[i];
e.isTaskExists(a.source) && e.isTaskExists(a.target) && n[a.source] && n[a.target] && (r[a.id] = a)
}
for (var o in r)
e.ext.export_api._makeLinksSameLevel(r[o], n);
var s = {};
for (var o in n)
e.ext.export_api._clearCircDependencies(n[o], r, n, {}, s, null);
for (Object.keys(r) && e.ext.export_api._clearLinksSameLevel(r, n),
i = 0; i < t.links.length; i++)
r[t.links[i].id] || (t.links.splice(i, 1),
i--);
e.ext.export_api._clearLevel(t.data)
},
_clearCircDependencies: function(t, n, i, r, a, o) {
var s = t.$_source;
if (s) {
r[t.id] && e.ext.export_api._onCircDependencyFind(o, n, r, a),
r[t.id] = !0;
for (var l = {}, c = 0; c < s.length; c++)
if (!a[s[c]]) {
var u = n[s[c]]
, d = i[u._target];
l[d.id] && e.ext.export_api._onCircDependencyFind(u, n, r, a),
l[d.id] = !0,
e.ext.export_api._clearCircDependencies(d, n, i, r, a, u)
}
r[t.id] = !1
}
},
_onCircDependencyFind: function(t, n, i, r) {
t && (e.callEvent("onExportCircularDependency", [t.id, t]) && delete n[t.id],
delete i[t._source],
delete i[t._target],
r[t.id] = !0)
},
_makeLinksSameLevel: function(t, e) {
var n, i, r = {
target: e[t.target],
source: e[t.source]
};
if (r.target._lvl != r.source._lvl) {
r.target._lvl < r.source._lvl ? (n = "source",
i = r.target._lvl) : (n = "target",
i = r.source._lvl);
do {
var a = e[r[n].parent];
if (!a)
break;
r[n] = a
} while (r[n]._lvl < i);
for (var o = e[r.source.parent], s = e[r.target.parent]; o && s && o.id != s.id; )
r.source = o,
r.target = s,
o = e[r.source.parent],
s = e[r.target.parent]
}
t._target = r.target.id,
t._source = r.source.id,
r.target.$_target || (r.target.$_target = []),
r.target.$_target.push(t.id),
r.source.$_source || (r.source.$_source = []),
r.source.$_source.push(t.id)
},
_clearLinksSameLevel: function(t, e) {
for (var n in t)
delete t[n]._target,
delete t[n]._source;
for (var i in e)
delete e[i].$_source,
delete e[i].$_target
},
_customProjectProperties: function(t, n) {
if (n && n.project) {
for (var i in n.project)
e.config.$custom_data || (e.config.$custom_data = {}),
e.config.$custom_data[i] = "function" == typeof n.project[i] ? n.project[i](e.config) : n.project[i];
delete n.project
}
},
_customTaskProperties: function(t, n) {
n && n.tasks && (t.data.forEach(function(t) {
for (var i in n.tasks)
t.$custom_data || (t.$custom_data = {}),
t.$custom_data[i] = "function" == typeof n.tasks[i] ? n.tasks[i](t, e.config) : n.tasks[i]
}),
delete n.tasks)
},
_exportConfig: function(t, n) {
var i = n.name || "gantt.xml";
delete n.name,
e.config.custom = n;
var r = e.ext.export_api._getWorktimeSettings()
, a = e.getSubtaskDates();
if (a.start_date && a.end_date) {
var o = e.templates.format_date || e.templates.xml_format;
e.config.start_end = {
start_date: o(a.start_date),
end_date: o(a.end_date)
}
}
var s = void 0 !== n.auto_scheduling && !!n.auto_scheduling
, l = {
callback: n.callback || null,
config: e.config,
data: t,
manual: s,
name: i,
worktime: r
};
for (var c in n)
l[c] = n[c];
return l
},
_sendImportAjaxMSP: function(t) {
var n = t.server || e.ext.export_api._apiUrl
, i = t.store || 0
, r = t.data
, a = t.callback
, o = {
durationUnit: t.durationUnit || void 0,
projectProperties: t.projectProperties || void 0,
taskProperties: t.taskProperties || void 0
};
r.append("type", t.type || "msproject-parse"),
r.append("data", JSON.stringify(o)),
i && r.append("store", i);
var s = new XMLHttpRequest;
s.onreadystatechange = function(t) {
4 === s.readyState && 0 === s.status && a && a(null)
}
,
s.onload = function() {
var t = null;
if (!(s.status > 400))
try {
t = JSON.parse(s.responseText)
} catch (t) {}
a && a(t)
}
,
s.open("POST", n, !0),
s.setRequestHeader("X-Requested-With", "XMLHttpRequest"),
s.send(r)
}
},
e.exportToPDF = e.ext.export_api.exportToPDF,
e.exportToPNG = e.ext.export_api.exportToPNG,
e.exportToICal = e.ext.export_api.exportToICal,
e.exportToExcel = e.ext.export_api.exportToExcel,
e.exportToJSON = e.ext.export_api.exportToJSON,
e.importFromExcel = e.ext.export_api.importFromExcel,
e.importFromMSProject = e.ext.export_api.importFromMSProject,
e.exportToMSProject = e.ext.export_api.exportToMSProject,
e.importFromPrimaveraP6 = e.ext.export_api.importFromPrimaveraP6,
e.exportToPrimaveraP6 = e.ext.export_api.exportToPrimaveraP6
}
}
).call(this, n(13).Buffer)
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = function() {
function t(t) {
var e = this;
this._mouseDown = !1,
this._calculateDirectionVector = function() {
if (e._trace.length >= 10) {
for (var t = e._trace.slice(e._trace.length - 10), n = [], i = 1; i < t.length; i++)
n.push({
x: t[i].x - t[i - 1].x,
y: t[i].y - t[i - 1].y
});
var r = {
x: 0,
y: 0
};
return n.forEach(function(t) {
r.x += t.x,
r.y += t.y
}),
{
magnitude: Math.sqrt(r.x * r.x + r.y * r.y),
angleDegrees: 180 * Math.atan2(Math.abs(r.y), Math.abs(r.x)) / Math.PI
}
}
return null
}
,
this._applyDndReadyStyles = function() {
e._timeline.$task.classList.add("gantt_timeline_move_available")
}
,
this._clearDndReadyStyles = function() {
e._timeline.$task.classList.remove("gantt_timeline_move_available")
}
,
this._getScrollPosition = function(t) {
var n = e._gantt;
return {
x: n.$ui.getView(t.$config.scrollX).getScrollState().position,
y: n.$ui.getView(t.$config.scrollY).getScrollState().position
}
}
,
this._countNewScrollPosition = function(t) {
var n = e._calculateDirectionVector()
, i = e._startPoint.x - t.x
, r = e._startPoint.y - t.y;
return n && (n.angleDegrees < 15 ? r = 0 : n.angleDegrees > 75 && (i = 0)),
{
x: e._scrollState.x + i,
y: e._scrollState.y + r
}
}
,
this._setScrollPosition = function(t, n) {
var i = e._gantt;
requestAnimationFrame(function() {
i.scrollLayoutCell(t.$id, n.x, n.y)
})
}
,
this._stopDrag = function(t) {
var n = e._gantt;
if (e._trace = [],
n.$root.classList.remove("gantt_noselect"),
void 0 !== e._originalReadonly && (n.config.readonly = e._originalReadonly),
void 0 !== e._originAutoscroll && (n.config.autoscroll = e._originAutoscroll),
n.config.drag_timeline) {
var i = n.config.drag_timeline.useKey;
if (i && !0 !== t[i])
return
}
e._mouseDown = !1
}
,
this._startDrag = function(t) {
var n = e._gantt;
e._originAutoscroll = n.config.autoscroll,
n.config.autoscroll = !1,
n.$root.classList.add("gantt_noselect"),
e._originalReadonly = n.config.readonly,
n.config.readonly = !0,
e._trace = [],
e._mouseDown = !0;
var i = e._getScrollPosition(e._timeline)
, r = i.x
, a = i.y;
e._scrollState = {
x: r,
y: a
},
e._startPoint = {
x: t.clientX,
y: t.clientY
},
e._trace.push(e._startPoint)
}
,
this._gantt = t,
this._domEvents = t._createDomEventScope(),
this._trace = []
}
return t.create = function(e) {
return new t(e)
}
,
t.prototype.destructor = function() {
this._domEvents.detachAll()
}
,
t.prototype.attach = function(t) {
var e = this;
this._timeline = t;
var n = this._gantt;
this._domEvents.attach(t.$task, "mousedown", function(t) {
if (n.config.drag_timeline) {
var i = n.config.drag_timeline
, r = i.useKey
, a = i.ignore;
if (!1 !== i.enabled) {
var o = ".gantt_task_line, .gantt_task_link";
void 0 !== a && (o = a instanceof Array ? a.join(", ") : a),
o && n.utils.dom.closest(t.target, o) || r && !0 !== t[r] || e._startDrag(t)
}
}
}),
this._domEvents.attach(document, "keydown", function(t) {
if (n.config.drag_timeline) {
var i = n.config.drag_timeline.useKey;
i && !0 === t[i] && e._applyDndReadyStyles()
}
}),
this._domEvents.attach(document, "keyup", function(t) {
if (n.config.drag_timeline) {
var i = n.config.drag_timeline.useKey;
i && !1 === t[i] && (e._clearDndReadyStyles(),
e._stopDrag(t))
}
}),
this._domEvents.attach(document, "mouseup", function(t) {
e._stopDrag(t)
}),
this._domEvents.attach(n.$root, "mouseup", function(t) {
e._stopDrag(t)
}),
this._domEvents.attach(document, "mouseleave", function(t) {
e._stopDrag(t)
}),
this._domEvents.attach(n.$root, "mouseleave", function(t) {
e._stopDrag(t)
}),
this._domEvents.attach(n.$root, "mousemove", function(i) {
if (n.config.drag_timeline) {
var r = n.config.drag_timeline.useKey;
if (!r || !0 === i[r]) {
var a = e._gantt.ext.clickDrag
, o = (e._gantt.config.click_drag || {}).useKey;
if ((!a || !o || r || !i[o]) && !0 === e._mouseDown) {
e._trace.push({
x: i.clientX,
y: i.clientY
});
var s = e._countNewScrollPosition({
x: i.clientX,
y: i.clientY
});
e._setScrollPosition(t, s),
e._scrollState = s,
e._startPoint = {
x: i.clientX,
y: i.clientY
}
}
}
}
})
}
,
t
}();
e.EventsManager = i
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(293);
e.default = function(t) {
t.ext || (t.ext = {}),
t.ext.dragTimeline = {
create: function() {
return i.EventsManager.create(t)
}
},
t.config.drag_timeline = {
enabled: !0
}
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(5)
, r = n(2)
, a = function() {
function t(t, e, n) {
var a = this;
this._el = document.createElement("div"),
this.defaultRender = function(t, e) {
a._el || (a._el = document.createElement("div"));
var n = a._el
, i = Math.min(t.relative.top, e.relative.top)
, r = Math.max(t.relative.top, e.relative.top)
, o = Math.min(t.relative.left, e.relative.left)
, s = Math.max(t.relative.left, e.relative.left);
if (a._singleRow) {
var l = a._getTaskPositionByTop(a._startPoint.relative.top);
n.style.height = l.height + "px",
n.style.top = l.top + "px"
} else
n.style.height = Math.abs(r - i) + "px",
n.style.top = i + "px";
return n.style.width = Math.abs(s - o) + "px",
n.style.left = o + "px",
n
}
,
this._gantt = e,
this._view = n,
this._viewPort = t.viewPort,
this._el.classList.add(t.className),
"function" == typeof t.callback && (this._callback = t.callback),
this.render = function() {
var e;
(e = t.render ? t.render(a._startPoint, a._endPoint) : a.defaultRender(a._startPoint, a._endPoint)) !== a._el && (a._el && a._el.parentNode && a._el.parentNode.removeChild(a._el),
a._el = e),
"" !== t.className && a._el.classList.add(t.className),
a.draw()
}
,
r.isEventable(this._viewPort) || i(this._viewPort),
this._singleRow = t.singleRow,
this._useRequestAnimationFrame = t.useRequestAnimationFrame
}
return t.prototype.draw = function() {
var t = this;
if (this._useRequestAnimationFrame)
return requestAnimationFrame(function() {
t._viewPort.appendChild(t.getElement())
});
this._viewPort.appendChild(this.getElement())
}
,
t.prototype.clear = function() {
var t = this;
if (this._useRequestAnimationFrame)
return requestAnimationFrame(function() {
t._el.parentNode && t._viewPort.removeChild(t._el)
});
this._el.parentNode && this._viewPort.removeChild(this._el)
}
,
t.prototype.getElement = function() {
return this._el
}
,
t.prototype.getViewPort = function() {
return this._viewPort
}
,
t.prototype.setStart = function(t) {
var e = this._gantt;
this._startPoint = t,
this._startDate = e.dateFromPos(this._startPoint.relative.left),
this._viewPort.callEvent("onBeforeDrag", [this._startPoint])
}
,
t.prototype.setEnd = function(t) {
var e = this._gantt;
if (this._endPoint = t,
this._singleRow) {
var n = this._getTaskPositionByTop(this._startPoint.relative.top);
this._endPoint.relative.top = n.top
}
this._endDate = e.dateFromPos(this._endPoint.relative.left),
this._startPoint.relative.left > this._endPoint.relative.left && (this._positionPoint = {
relative: {
left: this._endPoint.relative.left,
top: this._positionPoint.relative.top
},
absolute: {
left: this._endPoint.absolute.left,
top: this._positionPoint.absolute.top
}
}),
this._startPoint.relative.top > this._endPoint.relative.top && (this._positionPoint = {
relative: {
left: this._positionPoint.relative.left,
top: this._endPoint.relative.top
},
absolute: {
left: this._positionPoint.absolute.left,
top: this._endPoint.absolute.top
}
}),
this._viewPort.callEvent("onDrag", [this._startPoint, this._endPoint])
}
,
t.prototype.setPosition = function(t) {
this._positionPoint = t
}
,
t.prototype.dragEnd = function(t) {
var e, n = this._gantt;
t.relative.left < 0 && (t.relative.left = 0),
this._viewPort.callEvent("onBeforeDragEnd", [this._startPoint, t]),
this.setEnd(t),
this._endDate = this._endDate || n.getState().max_date,
this._startDate.valueOf() > this._endDate.valueOf() && (e = [this._endDate, this._startDate],
this._startDate = e[0],
this._endDate = e[1]),
this.clear();
var i = n.getTaskByTime(this._startDate, this._endDate)
, r = this._getTasksByTop(this._startPoint.relative.top, this._endPoint.relative.top);
this._viewPort.callEvent("onDragEnd", [this._startPoint, this._endPoint]),
this._callback && this._callback(this._startPoint, this._endPoint, this._startDate, this._endDate, i, r)
}
,
t.prototype.getInBounds = function() {
return this._singleRow
}
,
t.prototype._getTasksByTop = function(t, e) {
var n = this._gantt
, i = t
, r = e;
t > e && (i = e,
r = t);
for (var a = this._getTaskPositionByTop(i).index, o = this._getTaskPositionByTop(r).index, s = [], l = a; l <= o; l++) {
n.getTaskByIndex(l) && s.push(n.getTaskByIndex(l))
}
return s
}
,
t.prototype._getTaskPositionByTop = function(t) {
var e = this._gantt
, n = this._view
, i = n.getItemIndexByTopPosition(t)
, r = e.getTaskByIndex(i);
if (r) {
var a = n.getItemHeight(r.id);
return {
top: n.getItemTop(r.id) || 0,
height: a || 0,
index: i
}
}
var o = n.getTotalHeight();
return {
top: t > o ? o : 0,
height: e.config.row_height,
index: t > o ? e.getTaskCount() : 0
}
}
,
t
}();
e.SelectedRegion = a
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(1)
, r = function() {
function t(t) {
this._mouseDown = !1,
this._gantt = t,
this._domEvents = t._createDomEventScope()
}
return t.prototype.attach = function(t, e, n) {
var r = this
, a = this._gantt
, o = t.getViewPort();
this._originPosition = window.getComputedStyle(o).display,
this._restoreOriginPosition = function() {
o.style.position = r._originPosition
}
,
"static" === this._originPosition && (o.style.position = "relative");
var s = a.$services.getService("state");
s.registerProvider("clickDrag", function() {
return {
autoscroll: !1
}
});
var l = null;
this._domEvents.attach(o, "mousedown", function(i) {
l = null;
var o = ".gantt_task_line, .gantt_task_link";
void 0 !== n && (o = n instanceof Array ? n.join(", ") : n),
o && a.utils.dom.closest(i.target, o) || (s.registerProvider("clickDrag", function() {
return {
autoscroll: r._mouseDown
}
}),
e && !0 !== i[e] || (l = r._getCoordinates(i, t)))
});
var c = i.getRootNode(a.$root) || document.body;
this._domEvents.attach(c, "mouseup", function(n) {
if (l = null,
(!e || !0 === n[e]) && !0 === r._mouseDown) {
r._mouseDown = !1;
var i = r._getCoordinates(n, t);
t.dragEnd(i)
}
}),
this._domEvents.attach(o, "mousemove", function(n) {
if (!e || !0 === n[e]) {
var i = r._gantt.ext.clickDrag
, o = (r._gantt.config.drag_timeline || {}).useKey;
if (!i || !o || e || !n[o]) {
var s = null;
if (!r._mouseDown && l)
return s = r._getCoordinates(n, t),
void (Math.abs(l.relative.left - s.relative.left) > 5 && l && (r._mouseDown = !0,
t.setStart(a.copy(l)),
t.setPosition(a.copy(l)),
t.setEnd(a.copy(l)),
l = null));
!0 === r._mouseDown && (s = r._getCoordinates(n, t),
t.setEnd(s),
t.render())
}
}
})
}
,
t.prototype.detach = function() {
var t = this._gantt;
this._domEvents.detachAll(),
this._restoreOriginPosition && this._restoreOriginPosition(),
t.$services.getService("state").unregisterProvider("clickDrag")
}
,
t.prototype.destructor = function() {
this.detach()
}
,
t.prototype._getCoordinates = function(t, e) {
var n = e.getViewPort()
, i = n.getBoundingClientRect()
, r = t.clientX
, a = t.clientY;
return {
absolute: {
left: r,
top: a
},
relative: {
left: r - i.left + n.scrollLeft,
top: a - i.top + n.scrollTop
}
}
}
,
t
}();
e.EventsManager = r
}
, function(t, e, n) {
"use strict";
var i = this && this.__assign || function() {
return (i = Object.assign || function(t) {
for (var e, n = 1, i = arguments.length; n < i; n++)
for (var r in e = arguments[n])
Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
return t
}
).apply(this, arguments)
}
;
Object.defineProperty(e, "__esModule", {
value: !0
});
var r = n(296)
, a = n(295);
e.default = function(t) {
t.ext || (t.ext = {});
var e = {
className: "gantt_click_drag_rect",
useRequestAnimationFrame: !0,
callback: void 0,
singleRow: !1
}
, n = new r.EventsManager(t);
t.ext.clickDrag = n,
t.attachEvent("onGanttReady", function() {
var n = i({
viewPort: t.$task_data
}, e);
if (t.config.click_drag) {
var r = t.config.click_drag;
n.render = r.render || e.render,
n.className = r.className || e.className,
n.callback = r.callback || e.callback,
n.viewPort = r.viewPort || t.$task_data,
n.useRequestAnimationFrame = void 0 === r.useRequestAnimationFrame ? e.useRequestAnimationFrame : r.useRequestAnimationFrame,
n.singleRow = void 0 === r.singleRow ? e.singleRow : r.singleRow;
var o = t.$ui.getView("timeline")
, s = new a.SelectedRegion(n,t,o);
t.ext.clickDrag.attach(s, r.useKey, r.ignore)
}
}),
t.attachEvent("onDestroy", function() {
n.destructor()
})
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(297)
, r = n(294)
, a = n(292)
, o = n(272)
, s = n(271)
, l = n(260)
, c = n(259)
, u = n(258)
, d = n(256)
, h = n(253);
e.default = {
click_drag: i.default,
drag_timeline: r.default,
fullscreen: o.default,
keyboard_navigation: s,
quick_info: u.default,
tooltip: d.default,
undo: h.default,
marker: l,
multiselect: c,
export_api: a.default
}
}
, function(t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
var i = n(298)
, r = n(250)
, a = n(21).gantt = r(i.default);
e.gantt = a,
e.default = a
}
])
});
//# sourceMappingURL=dhtmlxgantt.js.map