! function (x, o, Z) {
"use strict";
function l(_, r) {
if ("function" != typeof r && null !== r) throw new TypeError("Super expression must either be null or a function");
_.prototype = o.create(r && r.prototype, {
constructor: {
value: _,
writable: !0,
configurable: !0
}
}), r && rb(_, r)
}
function d(e) {
var B = o.prototype.toString.call(e);
return "Array]" === B.substring(B.length - 6)
}
function y(F, D, n, T, x, Y) {
D = D || [], n = n || [], T = T || [];
try {
D.push(F);
var C = Function.apply(0, D);
return n[n.length] = "return " + C, Function.apply(0, n).apply(0, T)
} catch (U) {
return Y && Y(U), x
}
}
function E(b) {
var K = {};
return {
get: function (D) {
if (K[D] !== Z) return K[D];
var X;
switch (D) {
case "WEBGL_depth_texture":
X = b.getExtension("WEBGL_depth_texture") || b.getExtension("MOZ_WEBGL_depth_texture") || b.getExtension("WEBKIT_WEBGL_depth_texture");
break;
case "EXT_texture_filter_anisotropic":
X = b.getExtension("EXT_texture_filter_anisotropic") || b.getExtension("MOZ_EXT_texture_filter_anisotropic") || b.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
break;
case "WEBGL_compressed_texture_s3tc":
X = b.getExtension("WEBGL_compressed_texture_s3tc") || b.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || b.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
break;
case "WEBGL_compressed_texture_pvrtc":
X = b.getExtension("WEBGL_compressed_texture_pvrtc") || b.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
break;
case "WEBGL_compressed_texture_etc1":
X = b.getExtension("WEBGL_compressed_texture_etc1");
break;
default:
X = b.getExtension(D)
}
return K[D] = X, X
}
}
}
function B(y, V, h) {
function d() {
if (p !== Z) return p;
var K = V.get("EXT_texture_filter_anisotropic");
return p = null !== K ? y.getParameter(K.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
}
function r(o) {
if ("highp" === o) {
if (y.getShaderPrecisionFormat(y.VERTEX_SHADER, y.HIGH_FLOAT).precision > 0 && y.getShaderPrecisionFormat(y.FRAGMENT_SHADER, y.HIGH_FLOAT).precision > 0) return "highp";
o = "mediump"
}
return "mediump" === o && y.getShaderPrecisionFormat(y.VERTEX_SHADER, y.MEDIUM_FLOAT).precision > 0 && y.getShaderPrecisionFormat(y.FRAGMENT_SHADER, y.MEDIUM_FLOAT).precision > 0 ? "mediump" : "lowp"
}
var p;
h = h || {};
var K = "undefined" != typeof WebGL2RenderingContext && y instanceof WebGL2RenderingContext,
x = h.precision !== Z ? h.precision : "highp",
D = r(x);
D !== x && (console.warn("WebGL:", x, "not supported, using", D, "instead."), x = D);
var c = h.logarithmicDepthBuffer === !0,
F = y.getParameter(y.MAX_TEXTURE_IMAGE_UNITS),
C = y.getParameter(y.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
Y = y.getParameter(y.MAX_TEXTURE_SIZE),
n = y.getParameter(y.MAX_CUBE_MAP_TEXTURE_SIZE),
I = y.getParameter(y.MAX_VERTEX_ATTRIBS),
e = y.getParameter(y.MAX_VERTEX_UNIFORM_VECTORS),
o = y.getParameter(y.MAX_VARYING_VECTORS),
O = y.getParameter(y.MAX_FRAGMENT_UNIFORM_VECTORS),
j = C > 0,
i = K || !!V.get("OES_texture_float"),
s = (K || !!V.get("OES_element_index_uint")) && "undefined" != typeof Uint32Array,
q = j && i,
k = K ? y.getParameter(y.MAX_SAMPLES) : 0;
return {
getMaxAnisotropy: d,
getMaxPrecision: r,
precision: x,
logarithmicDepthBuffer: c,
maxTextures: F,
maxVertexTextures: C,
maxTextureSize: Y,
maxCubemapSize: n,
maxAttributes: I,
maxVertexUniforms: e,
maxVaryings: o,
maxFragmentUniforms: O,
vertexTextures: j,
floatFragmentTextures: i,
elementTypeUint: s,
floatVertexTextures: q,
maxSamples: k
}
}
function i(J, U) {
return J.z !== U.z ? J.z - U.z : J.id - U.id
}
function p(q, r) {
return q.z !== r.z ? r.z - q.z : q.id - r.id
}
var Y = "ht";
if (!x[Y]) {
! function () {
Date.now && Date.prototype.getTime || (Date.now = function () {
return (new Date).getTime()
}), x.performance && x.performance.now || function () {
var $ = Date.now();
x.performance || (x.performance = {}), x.performance.now = function () {
return Date.now() - $
}
}();
for (var Q = Date.now(), $ = 16, J = ["ms", "moz", "webkit", "o"], n = 0; n < J.length && !x.requestAnimationFrame; ++n) x.requestAnimationFrame = x[J[n] + "RequestAnimationFrame"], x.cancelAnimationFrame = x[J[n] + "CancelAnimationFrame"] || x[J[n] + "CancelRequestAnimationFrame"];
x.requestAnimationFrame || (x.requestAnimationFrame = function (_) {
var k = Date.now(),
d = $ + Q - k;
return 0 > d && (d = 0), Q = k, x.setTimeout(function () {
Q = Date.now(), _(performance.now())
}, d)
}), x.cancelAnimationFrame || (x.cancelAnimationFrame = function (G) {
return x.clearTimeout(G)
}), o.assign === Z && (o.assign = function (P) {
if (P === Z || null === P) throw new TypeError("Cannot convert undefined or null to object");
for (var h = o(P), z = 1; z < arguments.length; z++) {
var f = arguments[z];
if (f !== Z && null !== f)
for (var s in f) o.prototype.hasOwnProperty.call(f, s) && (h[s] = f[s])
}
return h
})
}();
var U = x.document,
F = null,
O = x[Y] = {},
M = x[Y + "config"],
u = O.Default = M && M.Default || {},
z = O.Style = M && M.Style || {},
I = O.Attr = M && M.Attr || {},
C = function () {
return !0
},
Q = function (R) {
return R
},
j = function (_) {
return !_
},
S = O.Color = M && M.Color || {},
t = O.IsGetter = M && M.IsGetter || {};
! function () {
var h = !1;
try {
var a = o.defineProperty({}, "passive", {
get: function () {
return h = !0, Z
}
});
x.addEventListener("test", a, a), x.removeEventListener("test", a, a)
} catch (t) {
h = !1
}
u.passiveSupported = h
}();
var e, G, H, g, f = u.passiveSupported,
J = u.eventListenerOptionsFalse = f ? {
passive: !1,
capture: !1
} : !1,
r = u.eventListenerOptionsTrue = f ? {
passive: !1,
capture: !0
} : !0,
K = function (m, t, W, C) {
m.addEventListener(t, W, C ? r : J)
},
b = function (l, s, x, H) {
l.removeEventListener(s, x, H ? r : J)
},
h = Math,
A = h.round,
T = h.floor,
s = h.ceil,
w = h.sqrt,
q = h.max,
V = h.min,
X = h.abs,
k = h.cos,
c = h.acos,
n = h.sin,
P = h.pow,
a = h.asin,
L = h.exp,
W = h.PI,
$ = 2 * W,
N = W / 2,
R = h.tan,
D = h.atan2,
m = h.random,
v = h.log,
_ = !1,
Ad = !1,
Zb = x.parseInt || global.parseInt,
yh = "2021-6-15",
Qe = x.navigator ? x.navigator.platform.indexOf("Win") > -1 : !1,
ds = function (p) {
return p * p
},
cd = x.setTimeout,
nr = x.clearTimeout,
ge = x.location,
jb = x.navigator ? x.navigator.userAgent.toLowerCase() : "",
Sq = function (W) {
return W.test(jb)
},
$f = Sq(/msie/),
Uq = Sq(/msie/) || Sq(/trident/),
Xf = Sq(/msie 10/),
Bj = Sq(/edge/),
es = Sq(/firefox/),
eg = Sq(/mac/),
nf = u.isTouchable === Z ? Qe ? !1 : U ? "ontouchend" in U : !1 : u.isTouchable,
lp = "default",
vq = "single",
tb = "multiple",
wg = "front",
Qq = "back",
nq = "left",
fm = "right",
$c = "top",
Kd = "bottom",
sc = "center",
to = "eye",
Sg = "middle",
Yn = "east",
Wg = "west",
Tb = "north",
Jc = "none",
oe = "px",
Ki = "absolute",
Xe = "border",
_d = "triangle",
Tq = "rect",
Eq = "circle",
xk = "cylinder",
bl = "shape",
Uj = "items",
Fk = "normal",
Ce = "remove",
Tg = "clear",
ul = "width",
Hh = "height",
Dm = "ingroup",
tm = "check",
He = "uncheck",
Hp = "radio",
kj = "radioOn",
yb = "radioOff",
_b = "points",
kd = "values",
Kh = "series",
nh = "body",
Bg = "label",
Qk = "label2",
Rm = "note",
Vk = "note2",
ub = "icons",
Vm = "labelFont",
fe = "labelColor",
Uo = "labelSelectColor",
ke = "note.expanded",
Mh = "note2.expanded",
kh = "edge.expanded",
Ei = "edge.points",
ej = "edge.type",
ac = "rotation",
fc = "hidden",
Pd = "visible",
ih = "tuv",
Df = "no",
Ph = "draw",
nj = "select",
Fi = "currentSubGraph",
op = "selectBackground",
Pi = "autoMakeVisible",
Ji = "autoHideScrollBar",
df = "scrollBarColor",
gd = "scrollBarSize",
Vb = "indent",
Jj = "rowHeight",
Gr = "columnLineColor",
Ln = "rowLineColor",
jh = "columnLineVisible",
Yc = "rowLineVisible",
dj = "visibleFunc",
Zi = "expandIcon",
xj = "collapseIcon",
wi = "checkMode",
go = "sortFunc",
Me = "editable",
Zh = "batchEditable",
qh = "tristate",
Sh = "asc",
rj = "desc",
pr = "position",
zl = "__",
pd = "elevation",
Wf = "children",
gq = "translateX",
wb = "translateY",
uk = "dataModel",
Pq = "maxSize",
xq = "enc",
Cp = "state",
Yk = xq + "o" + "de",
Lm = "shape3d",
cp = "shape3d.resolution",
lm = "shape3d.visible",
Rb = "shape3d.from.visible",
xh = "shape3d.to.visible",
Je = "shape3d.top.visible",
Ho = "shape3d.bottom.visible",
Sn = "repeat.uv.length",
No = "serializeValue",
Ij = "deserializeValue",
Mg = "centerUniform",
gs = "uniform",
nb = "rgba(255,255,255,0)",
om = "style",
dr = "attr",
Kb = "field",
Gl = "string",
hm = "boolean",
dg = "color",
fj = "int",
Mo = "number",
Nc = "ew-resize",
zi = "ns-resize",
Zk = "pointer",
iq = "auto",
fp = "mousedown",
rp = "mousemove",
cj = "mouseup",
Si = "mouseout",
Xd = "touchstart",
wj = "touchmove",
Sj = "touchend",
Ze = "keydown",
gn = "keyup",
kg = ["DOMMouseScroll", "mousewheel"],
ad = es ? kg[0] : kg[1],
Xl = zl + Y + zl + Yk,
Vr = [Xd, wj, Sj],
vs = [fp, rp, cj, Si, ad, "wheel", "mouseenter", "mouseleave", "mouseover"],
kr = [Ze, gn, "keypress", "input", "contextmenu", "compositionstart", "compositionupdate", "compositionend"],
Ec = nf ? Vr.concat(kr) : vs.concat(kr),
Xm = F,
xn = F,
sq = F,
Ob = cj.length,
Yp = function () {
sq && (nr(sq.timeout), sq = F)
},
Xk = function () {
sq && me(sq.e, sq.info)
};
x.addEventListener && (nf || (K(x, Si, function () {
Yp()
}), K(x, ad, function () {
Um()
})), K(x, gn, function (y) {
91 === y.keyCode ? pl = {} : delete pl[y.keyCode]
}, !0), K(x, Ze, function (b) {
pl[b.keyCode] = !0
}, !0), K(x, "blur", function () {
pl = {}
}));
var ug, yo, Qg, aj = 0,
nn = F,
Jl = function (Z, A) {
var T = cd(function () {
delete nn[T], wd(nn) && (nn = F), Z()
}, A);
return T
},
Gk = F,
vi = F,
Zl = {},
Oe = {},
ef = {},
Zm = {},
Mq = {},
pl = {},
Xh = {},
$d = {},
Al = {},
Dc = {},
Bm = /.json$/,
Gq = /\.(json|bin)$/,
Ok = /^data:image\/svg\+xml/,
$i = {},
Pc = [],
Xn = {},
zs = F,
rq = F,
Mr = function () { },
jm = function () {
throw "Oops!"
},
bg = [0, 0, 0],
nl = {
x: 0,
y: 0,
width: 0,
height: 0
},
de = F,
rm = F,
Wc = F,
vl = function (Z, y) {
Oe[Z] = y, y && y.comps && !y.uuid && (y.uuid = O.Math.generateUUID()), wk[Z] && (y.cacheRule = wk[Z], delete wk[Z])
},
Dd = function (V) {
rm && !V._72O && (Wc || (Wc = {}), Wc[V._72O = xp()] = V), ug != F ? Gg() < .05 && g && !yo && (tf = Yp) : tf = El
},
sd = function (P, X, v, z) {
rm || (rm = {});
var Q = rm[P];
if (Q) {
if (Q.url === X) return;
Q.image ? (Q.image.onload = Mr, Q.image.onerror = Mr) : Q.request && (Q.request.onload = Mr, Q.request.onerror = Mr)
}
if (Bm.test(X)) {
var m = new De;
if (rm[P] = {
request: m,
url: X
}, X = u.beforeLoadURL(X, P), X.data) {
var _ = u.parse(X.data);
Sm(P, _), u.handleImageLoaded(P, _)
} else {
m.onload = function () {
if (200 === this.status || 0 === this.status) {
var p = u.parse(m.getResponseText());
Sm(P, p), u.handleImageLoaded(P, p)
} else Sm(P, u.handleUnfoundImage(P, X) || F)
}, m.onerror = function () {
Sm(P, u.handleUnfoundImage(P, X) || F)
};
var x = {};
x.url = encodeURI(X), x.sync = !1, m.send(x)
}
} else {
var _ = new Image;
rm[P] = {
image: _,
url: X
}, /^data:image/.test(X) || (X = u.beforeLoadURL(X, P), X = u.appendTimeStamp(X), X = encodeURI(X), _.crossOrigin = u.crossOrigin), u.convertImageSrc(X, function (f) {
Uq && (X.toLowerCase().indexOf(".svg") > 0 || Ok.test(X)) ? (U.body.appendChild(_), _.style.visibility = "hidden", _.onload = function () {
cd(function () {
if (v && (_.width = v), z && (_.height = z), !_.width || !_.height) {
var H = _.width || _.clientWidth,
B = _.height || _.clientHeight;
_.width = H, _.height = B
}
u.handleImageLoaded(P, _), Sm(P, _), U.body.removeChild(_), _.style.visibility = ""
}, 180)
}, _.onerror = function () {
Sm(P, u.handleUnfoundImage(P, X) || F), U.body.removeChild(_), _.style.visibility = ""
}) : (_.onload = function () {
v && (_.width = v), z && (_.height = z), u.handleImageLoaded(P, _), Sm(P, _)
}, _.onerror = function () {
Sm(P, u.handleUnfoundImage(P, X) || F)
}), _.src = f
})
}
},
Sm = function (S, B) {
if (vl(S, B), delete rm[S], wd(rm) && (rm = F, Wc)) {
for (var z in Wc) {
var A = Wc[z];
A._2O && A._2O[S] && (A.deleteTexture(S), delete A._2O[S]), A.invalidateAll && A.invalidateAll(Z, "imageLoaded", S), A.redraw && A.redraw(), A.iv(), delete A._72O
}
Wc = F
}
if (B && Wc)
for (var z in Wc) {
var A = Wc[z];
A.invalidateAll && A.invalidateAll(Z, "imageLoading", S), A.redraw && A.redraw(), A.iv()
}
},
mm = function () {
return v = h && Date,
function () {
return x.performance && x.performance.now ? x.performance.now() : Date.now()
}
}(),
ee = function (u, g, v) {
return {
width: u,
height: g,
comps: ip(v) ? v : [v]
}
},
eq = function (S, X) {
return {
type: Eq,
rect: [S, X, 1.6, 1.6],
borderWidth: 1,
borderColor: Ur,
gradient: Nf,
gradientColor: Cn,
background: Ur
}
},
lj = function (H, J) {
return ee(16, 16, {
type: _d,
rect: [4, 4, 10, 8],
background: H,
rotation: J ? 1.57 : 3.14
})
},
mf = function (O, h) {
return ee(16, 16, {
type: _d,
rect: [4, 4, 8, 7],
background: O,
rotation: h ? 3.14 : 0
})
},
Oj = function (g) {
var O = g._orientation;
return "horizontal" === O || "h" === O
},
$o = function (B, l) {
var E = F || 4,
h = F || 1,
v = F || 1;
0 > E ? E = 0 : E > .25 && (E = .25);
var o, D, p, g, s, y, S, M = .5,
q = [],
T = [],
Q = [],
b = $ / v,
m = $ / h,
a = M - E;
for (D = 0; h >= D; D++)
for (g = -W + D * m, y = k(g), s = n(g), o = 0; v >= o; o++) p = o * b, S = a + E * y, q.push(k(p) * S, s * E, -n(p) * S), (G = [B, l]) && T.push(o / v, 1 - D / h);
for (D = 0; h > D; D++) {
var i = D * (v + 1),
O = (D + 1) * (v + 1);
for (o = 0; v > o; o++) Q.push(i + o, O + o + 1, O + o, i + o, i + o + 1, O + o + 1), qg.z = ok.z = [B, l]
}
},
lh = function ($) {
var i = 2,
E = 0;
for (var s in $) s.length === i && Zb(s, 32) === $r && (zs = rq = $[s]), E++;
return E
},
Cc = function (Z, l, d, G) {
return d || (d = nf ? 5 : 3, d /= G || 1), {
x: Z - d,
y: l - d,
width: 2 * d,
height: 2 * d
}
},
Ub = function (_, e, A, d) {
var y = this;
e || (e = nf ? 5 : 3, A = 20, d = 20);
var p = {
x: _,
y: e,
width: A,
height: d
};
if (A)
for (var N = 0; A > N; N++)
if (3 === A) d = 20;
else
for (var j = 0; d > j; j++) y = x ? x : A;
var q = {
x: W,
y: 2 * W
};
if (cf(p, q)) {
var T = Hh[0] + $c[0] + Tg[1] + Sh.length,
g = fc[0] + qh[0] + Tg[1] + nh.length;
Xb[to] = [y[T], y[g]], y[T] = tg[to], y[g] = tg[Lm]
}
},
kp = function (w) {
return (/ble$/.test(w) || /ed$/.test(w) || t[w] ? "is" : "get") + w.charAt(0).toUpperCase() + w.slice(1)
},
tg = function (p) {
return "set" + p.charAt(0).toUpperCase() + p.slice(1)
},
dk = function (M) {
return typeof M === Gl || M instanceof String
},
Bp = function (c) {
return typeof c === Mo
},
El = function (_) {
return typeof _ === hm
},
xl = function (q) {
return q && "object" == typeof q
},
Mf = function (J) {
return "function" == typeof J
},
ip = function (l) {
return l instanceof Array
},
Xo = function (E) {
return E instanceof xr
},
mh = function (y) {
return ip(y) ? new xr(y) : y
},
Fq = function (U) {
return U instanceof Dp
},
Bk = function (N) {
return N instanceof Xg
},
yl = function (K) {
return K instanceof Lc
},
Th = function (m, I) {
if (!(m instanceof O.Group)) return !1;
if (!I) return m.isExpanded();
var $ = I.getDataUI(m);
return $ && $._88I ? !0 : !1
},
Qb = function (m) {
return m instanceof Br
},
Db = function (B) {
return B && "IFRAME" === B.tagName
},
Oo = function (d) {
return d == F || u.numberDigits == F ? d : parseFloat(d.toFixed(u.numberDigits))
},
gc = function (s, $, i) {
var E, L = $.length;
if (i)
for (var z = 0; i > z; z++)
if (3 === L) s.push($[0]), s.push($[1]), s.push($[2]);
else
for (E = 0; L > E; E++) s.push($[E]);
else if (3 === L) s.push($[0]), s.push($[1]), s.push($[2]);
else
for (E = 0; L > E; E++) s.push($[E])
},
Il = function (p) {
return p ? xl(p) ? p : {} : !1
},
Uh = function (L, O, J) {
var j, b = xl(L) ? L : L.prototype;
for (j in O) J && j in b ? b[j] === Z && console.warn("class", b, "has own undefined property", j, ", keep exist!") : b[j] = O[j];
return L
},
sg = function (Y, L) {
if (!("wheelDelta" in L)) {
var A = L.deltaMode;
L.wheelDelta = A === L.DOM_DELTA_PIXEL ? -L.deltaY : A === L.DOM_DELTA_LINE ? 40 * -L.deltaY : 120 * -L.deltaY
}
Y.handle_mousewheel(L)
},
Hc = function (B) {
return String.fromCharCode(B)
},
fo = function (N) {
for (var s, f = 0, i = ""; f < N.length; f++) s = N[N.length - 1 - f], "%" === s ? s = "'" : "a" === s ? s = '"' : "]" === s && (s = "\\"), i += Hc(s.charCodeAt(0) - 1);
return i
},
fi = function (G, e, E) {
G.superClass.constructor.apply(e, E)
},
wd = function (n) {
for (var g in n) return !1;
return !0
},
Ro = function (g) {
return g ? 0 === g.length : !0
},
jg = function () {
var w = "";
return [He[0], Ln[0], Bg[0]].forEach(function (O) {
w += tg(O).slice(3)
}), gs = U && U[w] || Mg,
function (z, V) {
return z === V ? !0 : z.x === V.x && z.y === V.y && z.width === V.width && z.height === V.height
}
}(),
re = function (Q, Z, R) {
return Z > Q ? Z : Q > R ? R : Q
},
he = function (e) {
return 0 > e ? -1 : e > 0 ? 1 : 0
},
Gg = function () {
var z = 1e4 * n(Ob++);
return z - T(z)
},
Rl = function (L, K, J) {
return ti(L.x, L.y, K.x, K.y, J.x, J.y, J.x + J.width, J.y, !0) || ti(L.x, L.y, K.x, K.y, J.x + J.width, J.y, J.x + J.width, J.y + J.height, !0) || ti(L.x, L.y, K.x, K.y, J.x + J.width, J.y + J.height, J.x, J.y + J.height, !0) || ti(L.x, L.y, K.x, K.y, J.x, J.y + J.height, J.x, J.y, !0)
},
ti = function (D, w, R, T, d, C, u, b, r) {
var B = (u - d) * (w - C) - (b - C) * (D - d),
l = (b - C) * (R - D) - (u - d) * (T - w);
if (0 !== l) {
var O = B / l,
e = D + O * (R - D),
o = w + O * (T - w);
return r && (e + Wp < V(D, R) || e - Wp > q(D, R) || e + Wp < V(d, u) || e - Wp > q(d, u) || o + Wp < V(w, T) || o - Wp > q(w, T) || o + Wp < V(C, b) || o - Wp > q(C, b)) ? F : [e, o]
}
return F
},
jq = function (U, Q, _) {
if (U && _)
if (Q) {
if (Q === om) return U.getStyle(_);
if (Q === dr) return U.getAttr(_);
if (Q === Kb) return U[_]
} else if (_ = kp(_), U[_]) return U[_]();
return Z
},
Di = function (c, W, b, h) {
if (c && b)
if (W) {
if (W === om) c.s(b, h);
else if (W === dr) c.a(b, h);
else if (W === Kb) {
var w = c[b];
c[b] = h, c.fp("f:" + b, w, h)
}
} else b = tg(b), c[b] && c[b](h)
},
Wh = function (L, W, X) {
return W && "top" !== W ? "bottom" === W ? {
x: L.x,
y: L.y,
width: L.width,
height: L.height * X
} : "right" === W ? {
x: L.x,
y: L.y,
width: L.width * X,
height: L.height
} : "left" === W ? {
x: L.x + L.width * (1 - X),
y: L.y,
width: L.width * X,
height: L.height
} : void 0 : {
x: L.x,
y: L.y + L.height * (1 - X),
width: L.width,
height: L.height * X
}
},
cs = function (z, f, b, Q, N) {
f && fl(z, b, Q, 1, N, f)
},
Id = function (w, R, p, n) {
var E = 1 - w;
return E * E * R + 2 * w * E * p + w * w * n
},
qg = function (C, I, s, m, O) {
var i = 1 - C;
return i * i * i * I + 3 * i * i * C * s + 3 * i * C * C * m + C * C * C * O
},
tj = function (h) {
var l, G, t, g, x = 0;
return h.forEach(function (s) {
if (l = s.length, l > 0)
for (G = s[0], g = 1; l > g; g++) t = s[g], x += En(G, t), G = t
}), x
},
ic = function (D, L, q) {
var j = "__" + D,
l = function (i) {
("mousedown" === D || "mouseup" === D || "touchstart" === D || "touchend" === D) && wm(i), q.disabled || q["handle_" + D](i)
};
q[j] || (q[j] = l, K(L, D, l))
},
ws = function (D, E, B) {
var N = "__" + D,
W = B[N];
W && (b(E, D, W), delete B[N])
},
em = function (P, V) {
var e = "_" + V;
P[kp(V)] = function () {
return this[e]
}, P[tg(V)] = function (q) {
var n = this[e];
this[e] = q, this.fp(V, n, q)
}
},
Ci = function (C) {
return o.create(C)
},
bh = function ($) {
if (!$.element) {
var W, s;
(W = $.textField) ? s = Wn(Vs.TextField, W) : (W = $.textArea) ? s = Wn(Vs.TextArea, W) : (W = $.button) ? s = Wn(Vs.Button, W) : (W = $.comboBox) ? s = Wn(Vs.ComboBox, W) : (W = $.checkBox) ? s = Wn(Vs.CheckBox, W) : (W = $.radioButton) ? s = Wn(Vs.RadioButton, W) : (W = $.slider) ? s = Wn(Vs.Slider, W) : (W = $.colorPicker) ? s = Wn(Vs.ColorPicker, W) : (W = $.image) && (s = Wn(Vs.Image, W)), s && ($.element = s)
}
},
ve = function (J, c) {
var P = dd(J);
return P._ht = c, P
},
Iq = x.top === x ? x.top : x || x.document,
dd = function (p, C) {
var i = U.createElement("div"),
L = i.style;
return i.tabIndex = -1, i.onkeydown = Qc, L.msTouchAction = Jc, Yq(i, F, 0), nf && L.setProperty("-webkit-tap-highlight-color", "rgba(0, 0, 0, 0)", F), p && (L.overflow = fc), C && sn(C, i), i
},
uo = function (W, M) {
var h = U.createElement("canvas"),
v = h.style;
return v.msTouchAction = Jc, M || (v.pointerEvents = Jc), Yq(h, F, 0), W && sn(W, h), h
},
Yq = function (A, x, r) {
var u = A.style;
u.border = x ? x + " solid 1px" : 0, u.outline = 0, u.padding = r ? "0 " + r + oe : 0, uj(A)
},
uj = function (B) {
var I = B.style;
I.position = Ki, I.margin = 0, I.setProperty("box-sizing", "border-box", F), I.setProperty("-moz-box-sizing", "border-box", F)
},
Bn = function (I, w, u, X) {
X || (X = ij), w != F && (I.width = w * X, I.style.width = w + oe), u != F && (I.height = u * X, I.style.height = u + oe)
},
sn = function (D, t, m) {
D.appendChild(t), m && (t.style.position = Ki)
},
qr = function (P, S) {
S.split || (S += "");
for (var m, z = S.split("\n"), T = 0, K = z.length, e = 0; K > e; e++) {
var w = ln(P.font, z[e]);
w.width > T && (T = w.width), m || (m = w.height)
}
return P.ss = z, {
width: T,
height: m * K
}
},
Om = function (w, G, t, V, Z, j) {
var J = G.length;
if (1 === J) Lp(w, G[0], t, V, Z);
else
for (var k = t.height / J, H = {
x: t.x,
y: t.y,
width: t.width,
height: k
}, m = 0; m < G.length; m++) j ? nd(w, G[m], V, Z, H.x, H.y, H.width, H.height, j) : Lp(w, G[m], H, V, Z), H.y += k
},
Lp = function (c, V, W, D, G) {
c.font = D ? D : Fh, c.fillStyle = G ? G : Dh, c.textAlign = sc, c.textBaseline = Sg;
var j, M;
W ? W.width === Z ? (j = W.x, M = W.y) : (j = W.x + W.width / 2, M = W.y + W.height / 2) : (j = 0, M = 0), c.fillText(V, A(j), A(M))
},
oh = function (h) {
h.getView && (h = h.getView());
var W = h.offsetWidth || h.scrollWidth;
return !W && h.style.width && (W = Zb(h.style.width)), W
},
zp = function (f) {
f.getView && (f = f.getView());
var r = f.offsetHeight || f.scrollHeight;
return !r && f.style.height && (r = Zb(f.style.height)), r
},
Jg = function (F, k, X) {
var B = k[0].toUpperCase() + k.substring(1, k.length);
F["webkit" + B] = X, F["moz" + B] = X, F["ms" + B] = X, F["o" + B] = X, F[k] = X
},
lo = function () {
var Z = function (j) {
Qc(j), j.stopPropagation()
},
o = function (u) {
Qc(u)
},
h = [Xd, Ze, fp];
return function (c, H) {
var P = dd(),
J = P.style;
return J.backgroundColor = u.disabledBackground, c && (J.backgroundImage = "url(" + c + ")", J.backgroundPosition = "50% 50%", J.backgroundRepeat = "no-repeat no-repeat"), H === !1 ? h.forEach(function (x) {
K(P, x, o)
}) : h.forEach(function (R) {
K(P, R, Z)
}), P
}
}(),
Wd = function (C) {
var F = C.getContext("2d");
return F.save(), F.lineCap = ob, F.lineJoin = Wl, F
},
tf = function (I, s, m, P) {
wh(I, s * ij, m * ij), P *= ij, 1 !== P && I.scale(P, P)
},
wh = function (s, n, N) {
s.translate(n, N)
},
jc = function (z, k) {
k && z.rotate(k)
},
ec = function (v, i, m) {
i === Z && (i = 1), m === Z && (m = 1), (1 !== i || 1 !== m) && v.scale(i, m)
},
lg = !1,
L = Iq[tm[1] + gq[0]],
hr = function (i) {
var n = U.activeElement;
if (U.activeElement !== i) {
n && n.forceOnblur && n.forceOnblur();
for (var C = [], c = i.parentNode; c;) C.push([c, c.scrollLeft, c.scrollTop]), c = c.parentNode;
if (!lg) {
var V = [],
J = [];
try {
for (var $ = x.parent, H = x; $ !== H;) V.push([$, $.scrollX, $.scrollY]), H = $, $ = x.parent;
var N = x.frameElement;
if (N)
for (var X = N.parentNode; X;) J.push([X, X.scrollLeft, X.scrollTop]), X = X.parentNode
} catch (d) {
lg = !0
}
}
if (nf) i.focus();
else {
var a = hq(),
k = a.target;
i.focus(), k.scrollLeft = a.left, k.scrollTop = a.top
}
C.forEach(function (I) {
I[0].scrollLeft = I[1], I[0].scrollTop = I[2]
}), lg || (V.forEach(function (g) {
g[0].scrollTo(g[1], g[2])
}), J.forEach(function (a) {
a[0].scrollLeft = a[1], a[0].scrollTop = a[2]
}))
}
},
Bq = function (r) {
return r && r.getView ? r.getView() : r
},
qp = function (R, A, i, d, P) {
if (2 === arguments.length && (i = A.y, d = A.width, P = A.height, A = A.x), R.isSelfViewEvent) R.setX(A), R.setY(i), R.setWidth(d), R.setHeight(P);
else {
var W = Bq(R),
p = W.style;
if ((U.fullscreenElement || U.mozFullScreenElement || U.webkitFullscreenElement || U.msFullscreenElement) !== W) A !== Z && (p.left = A + oe), i !== Z && (p.top = i + oe), d !== Z && (p.width = d + oe), P !== Z && (p.height = P + oe);
else {
var e = u.getWindowInfo();
p.left = (A = e.left) + oe, p.top = (i = e.top) + oe, p.width = (d = e.width) + oe, p.height = (P = e.height) + oe
}
R.endEditing && !nf && R.endEditing(), R.redraw && R.redraw(), R.invalidate && R.invalidate(), R.onLayouted && R.onLayouted(A, i, d, P), R.fireViewEvent && R.fireViewEvent("layout")
}
},
Xj = function (D) {
if (!D.touches) return D;
var g = D.touches[0];
return g ? g : D.changedTouches[0]
},
gr = function (V) {
return li(V) ? Xj(V).target : V.target
},
li = function (d) {
return d && "object" == typeof d && "touches" in d
},
ek = function (n) {
u.popup && u.popup.close(), u.popup = n
},
si = F,
Ed = function ($) {
si.handleWindowTouchMove($)
},
Zr = function ($) {
si.handleWindowTouchEnd($), b(x, wj, Ed), b(x, Sj, Zr), si = F
},
Kn = function (z) {
si.handleWindowMouseMove(z)
},
tc = function (Z) {
si.handleWindowMouseUp(Z), b(x, rp, Kn), b(x, cj, tc), si = F
},
Bf = function (r) {
return 1 === Qj(r)
},
sh = function (F, h) {
return h ? h.keyCode === F : pl[F]
},
Dq = function (N) {
return ik(N) && sh(65, N)
},
qq = function (L) {
return sh(46, L) || sh(8, L)
},
jl = function (g) {
return function (M) {
return M ? M.keyCode === g : pl[g]
}
},
$r = 573,
Fe = [65, 83, 68, 87, 37, 38, 39, 40, 32, 13, 27],
sb = jl(Fe[0]),
Ib = jl(Fe[1]),
Fr = jl(Fe[2]),
$j = jl(Fe[3]),
Wk = jl(Fe[4]),
Nk = jl(Fe[5]),
_i = jl(Fe[6]),
ri = jl(Fe[7]),
Cf = jl(Fe[8]),
hd = jl(Fe[9]),
bj = jl(Fe[10]),
Gj = {
65: 1,
83: 1,
68: 1,
87: 1,
37: 1,
38: 1,
39: 1,
40: 1
},
Cg = [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 5, 5, 5, 5, 5, 7, 4027],
abd ="20t24bt02b28 12c12c11",
xm = F,
Fb = F,
Cr = function (B, M) {
xm || (xm = uo()), Bn(xm, B, M, 1);
var Q = Wd(xm);
return Q.clearRect(0, 0, B, M), Q
},
nm = function (F, I, q) {
if (I && F) {
if ("override" === q) return I;
if ("override_rgb" === q) {
var z = ns(I);
return F = zd(F), "rgba(" + A(255 * z[0]) + "," + A(255 * z[1]) + "," + A(255 * z[2]) + "," + F[3] / 255 + ")"
}
if ("override_a" === q) {
var z = ns(I);
return F = zd(F), "rgba(" + F[0] + "," + F[1] + "," + F[2] + "," + z[3] + ")"
}
if ("multiply_destinationAtop" === q) {
var d = Pm(ns(F)),
C = d[3],
h = Pm(ns(I)),
m = h[3],
w = Pm(d),
N = w[3],
x = d.map(function (R, S) {
return R * h[S]
}),
E = 1 - C,
s = 1 - m,
H = s * C + m;
return d = d.map(function (i, j) {
return (m * E * h[j] + m * C * x[j] + s * C * i) / H
}), C = H, E = 1 - C, d = d.map(function (v, b) {
return (N * w[b] * E + C * v * N) / N
}), C = N, "rgba(" + A(255 * d[0]) + "," + A(255 * d[1]) + "," + A(255 * d[2]) + "," + C + ")"
}
var z = ns(I);
return F = zd(F), "rgba(" + A(F[0] * z[0]) + "," + A(F[1] * z[1]) + "," + A(F[2] * z[2]) + "," + F[3] / 255 * z[3] + ")"
}
return F
},
zd = function () {
var m, k = {};
for (var u in x) {
var T = tb.length;
if (u.length == T && u[0] === tb[2] && u[1] === Jc[1] && u[4] === tb[3] && u[5] === tb[4] && u.substr(T - 2) === Jc[1] + Jc[2]) {
var Z = x[u];
for (var d in Z) d.length === T && d.substr(0, 3) === fm[3] + Ce[3] + nj[0] && d.substr(T - 2) === tb[0] + Rm[3] && (kg = Z[d])
}
}
return function (_) {
var O, X = k[_];
return X || (m || (m = uo(), Bn(m, 1, 1, 1)), O = m.getContext("2d"), O.clearRect(0, 0, 1, 1), fl(O, 0, 0, 1, 1, _), X = O.getImageData(0, 0, 1, 1).data, X = k[_] = [X[0], X[1], X[2], X[3]]), X
}
}(),
ns = function (U) {
if (!dk(U)) return U;
var E = zd(U);
return E.CA || (E.CA = [E[0] / 255, E[1] / 255, E[2] / 255, E[3] / 255]), E.CA
},
oi = function (X, i, h, Z, O) {
var b = uo();
b.width = h, b.height = Z;
var V = b.getContext("2d");
V.drawImage(X, 0, 0, h, Z);
try {
for (var l = V.getImageData(0, 0, h, Z), B = l.data, H = 0, q = B.length; q > H; H += 4) {
var U = B[H + 0],
g = B[H + 1],
t = B[H + 2],
W = B[H + 3];
"override_a" === O ? B[H + 3] = 255 * i[3] : "override_rgb" === O ? (B[H + 0] = 255 * i[0], B[H + 1] = 255 * i[1], B[H + 2] = 255 * i[2]) : "override" === O ? (B[H + 0] = 255 * i[0], B[H + 1] = 255 * i[1], B[H + 2] = 255 * i[2], B[H + 3] = 255 * i[3]) : (B[H + 0] = i[0] * U, B[H + 1] = i[1] * g, B[H + 2] = i[2] * t, B[H + 3] = i[3] * W)
}
V.putImageData(l, 0, 0)
} catch (M) {
return X
}
return b
},
Xb = function (_, k, K) {
return k && (k = "miter" === K ? 8 * k + 20 : k + 1, _ && vn(_, k)), k
},
Rj = function (e, U) {
if (U) {
var h = new In(U),
s = e.width / 2,
g = e.height / 2,
H = ms([h.tf(-s, -g), h.tf(s, -g), h.tf(s, g), h.tf(-s, g)]);
return H.x += e.x + s, H.y += e.y + g, H
}
return e
},
dc = function (K, O, X, t, Q, g, y, j) {
t *= Math.PI / 180;
var G = {
x: Math.cos(t) * (K.x - y.x) / 2 + Math.sin(t) * (K.y - y.y) / 2,
y: -Math.sin(t) * (K.x - y.x) / 2 + Math.cos(t) * (K.y - y.y) / 2
},
H = Math.pow(G.x, 2) / Math.pow(O, 2) + Math.pow(G.y, 2) / Math.pow(X, 2);
H > 1 && (O *= Math.sqrt(H), X *= Math.sqrt(H));
var b = (Q == g ? -1 : 1) * Math.sqrt((Math.pow(O, 2) * Math.pow(X, 2) - Math.pow(O, 2) * Math.pow(G.y, 2) - Math.pow(X, 2) * Math.pow(G.x, 2)) / (Math.pow(O, 2) * Math.pow(G.y, 2) + Math.pow(X, 2) * Math.pow(G.x, 2)));
isNaN(b) && (b = 0);
var e = {
x: b * O * G.y / X,
y: b * -X * G.x / O
},
d = {
x: (K.x + y.x) / 2 + Math.cos(t) * e.x - Math.sin(t) * e.y,
y: (K.y + y.y) / 2 + Math.sin(t) * e.x + Math.cos(t) * e.y
},
C = function (K) {
return Math.sqrt(Math.pow(K[0], 2) + Math.pow(K[1], 2))
},
$ = function (B, J) {
return (B[0] * J[0] + B[1] * J[1]) / (C(B) * C(J))
},
u = function (J, _) {
return (J[0] * _[1] < J[1] * _[0] ? -1 : 1) * Math.acos($(J, _))
},
w = u([1, 0], [(G.x - e.x) / O, (G.y - e.y) / X]),
r = [(G.x - e.x) / O, (G.y - e.y) / X],
T = [(-G.x - e.x) / O, (-G.y - e.y) / X],
n = u(r, T);
$(r, T) <= -1 && (n = Math.PI), $(r, T) >= 1 && (n = 0);
var $ = O > X ? O : X,
E = O > X ? 1 : O / X,
N = O > X ? X / O : 1;
if (null == j) {
var l = {
x: 0,
y: 0,
width: 0,
height: 0
};
vn(l, $), l.x *= E, l.width *= E, l.y *= N, l.height *= N;
var f = new In(t);
return l = ms([f.tf(l.x, l.y), f.tf(l.x + l.width, l.y), f.tf(l.x + l.width, l.y + l.height), f.tf(l.x, l.y + l.height)]), l.x += d.x, l.y += d.y, [{
x: l.x,
y: l.y
}, {
x: l.x + l.width,
y: l.y
}, {
x: l.x + l.width,
y: l.y + l.height
}, {
x: l.x,
y: l.y + l.height
}]
}
j.translate(d.x, d.y), j.rotate(t), j.scale(E, N), j.arc(0, 0, $, w, w + n, 1 - g), j.scale(1 / E, 1 / N), j.rotate(-t), j.translate(-d.x, -d.y)
},
jp = function (q, I) {
q && q.beginPath();
for (var N, p, z, v = [], V = function (k) {
for (var m, b = /(\-{0,1}[\d\.]+)/gi, c = []; m = b.exec(k);) c.push(parseFloat(m[0]));
return c
}, u = /([MmLlHhVvCcSsQqTtAa]{1}[\d\.,\s\-Zz]*)/gi, g = {
x: 0,
y: 0
}; N = u.exec(I);) {
var S = N[0],
J = S.substr(0, 1);
if ("M" === J || "m" === J) {
for (var R = V(S), L = 0; L < R.length; L += 2) {
var b = R[L],
W = R[L + 1];
"m" === J && (b += g.x, W += g.y), q && q.moveTo(b, W), v.push({
x: b,
y: W
}), g.x = b, g.y = W
}
p = z = null
} else if ("H" === J || "h" === J) {
for (var R = V(S), L = 0; L < R.length; L += 1) {
var b = R[L];
"h" === J && (b += g.x), q && q.lineTo(b, g.y), v.push({
x: b,
y: g.y
}), g.x = b
}
p = z = null
} else if ("C" === J || "c" === J) {
for (var R = V(S), L = 0; L < R.length; L += 6) {
var B = R[L],
c = R[L + 1],
T = R[L + 2],
D = R[L + 3],
b = R[L + 4],
W = R[L + 5];
"c" === J && (B += g.x, c += g.y, T += g.x, D += g.y, b += g.x, W += g.y), q && q.bezierCurveTo(B, c, T, D, b, W), v.push({
x: B,
y: c
}), v.push({
x: T,
y: D
}), v.push({
x: b,
y: W
}), g.x = b, g.y = W
}
p = [B, c, T, D, b, W], z = null
} else if ("S" === J || "s" === J) {
for (var R = V(S), L = 0; L < R.length; L += 4) {
var B, c;
p ? (B = 2 * p[4] - p[2], c = 2 * p[5] - p[3]) : (B = g.x, c = g.y);
var T = R[L],
D = R[L + 1],
b = R[L + 2],
W = R[L + 3];
"s" === J && (T += g.x, D += g.y, b += g.x, W += g.y), q && q.bezierCurveTo(B, c, T, D, b, W), v.push({
x: B,
y: c
}), v.push({
x: T,
y: D
}), v.push({
x: b,
y: W
}), g.x = b, g.y = W
}
p = [B, c, T, D, b, W], z = null
} else if ("Q" === J || "q" === J) {
for (var R = V(S), L = 0; L < R.length; L += 4) {
var B = R[L],
c = R[L + 1],
b = R[L + 2],
W = R[L + 3];
"q" === J && (B += g.x, c += g.y, b += g.x, W += g.y), q && q.quadraticCurveTo(B, c, b, W), v.push({
x: B,
y: c
}), v.push({
x: b,
y: W
}), g.x = b, g.y = W
}
p = null, z = [B, c, b, W]
} else if ("T" === J || "t" === J) {
for (var R = V(S), L = 0; L < R.length; L += 2) {
var B, c;
z ? (B = 2 * z[2] - z[0], c = 2 * z[3] - z[1]) : (B = g.x, c = g.y);
var b = R[L],
W = R[L + 1];
"t" === J && (b += g.x, W += g.y), q && q.quadraticCurveTo(B, c, b, W), v.push({
x: B,
y: c
}), v.push({
x: b,
y: W
}), g.x = b, g.y = W
}
p = null, z = [B, c, b, W]
} else if ("V" === J || "v" === J) {
for (var R = V(S), L = 0; L < R.length; L += 1) {
var W = R[L];
"v" === J && (W += g.y), q && q.lineTo(g.x, W), v.push({
x: g.x,
y: W
}), g.y = W
}
p = z = null
} else if ("L" === J || "l" === J) {
for (var R = V(S), L = 0; L < R.length; L += 2) {
var b = R[L],
W = R[L + 1];
"l" === J && (b += g.x, W += g.y), q && q.lineTo(b, W), v.push({
x: b,
y: W
}), g.x = b, g.y = W
}
p = z = null
} else if ("A" === J || "a" === J) {
for (var R = V(S), L = 0; L < R.length; L += 7) {
var X = R[L],
o = R[L + 1],
H = R[L + 2],
i = R[L + 3],
y = R[L + 4],
b = R[L + 5],
W = R[L + 6];
"a" === J && (b += g.x, W += g.y);
var _ = dc(g, X, o, H, i, y, {
x: b,
y: W
}, q);
_ && (v = v.concat(_)), g.x = b, g.y = W
}
p = z = null
}
var O = S.substr(S.length - 1);
("z" === O || "Z" === O) && q && q.closePath()
}
return v
},
uq = function (q, Y, O) {
var w, K, c = "L" === Y[0],
g = Y.length;
q.save(), c ? (q.transform(Y[5], Y[6], Y[7], Y[8], Y[9], Y[10]), w = q.createLinearGradient(Y[1], Y[2], Y[3], Y[4]), K = 11) : (q.transform(Y[7], Y[8], Y[9], Y[10], Y[11], Y[12]), w = q.createRadialGradient(Y[1], Y[2], Y[3], Y[4], Y[5], Y[6]), K = 13);
for (var v = q.compGray; g > K;) {
var V = Y[K + 1];
V = O(V), w.addColorStop(Y[K], v ? u.toGrayColor(V) : V), K += 2
}
q.fillStyle = w
},
ok = function (e, J) {
var F = e.s("shape.gradient.pack");
if (F) {
for (var H = F.length, Q = new Array(H), f = 0; H > f; f++) Q[f] = F[f];
var M, n, q, Y, E, w, B, N, I, U, $, R, A, m = "L" === Q[0];
M = m ? 5 : 7, n = Q[M], q = Q[M + 1], Y = Q[M + 2], E = Q[M + 3], w = Q[M + 4], B = Q[M + 5], N = J[0], I = J[1], U = J[2], $ = J[3], R = J[4], A = J[5], Q[M] = N * n + U * q, Q[M + 1] = I * n + $ * q, Q[M + 2] = N * Y + U * E, Q[M + 3] = I * Y + $ * E, Q[M + 4] = N * w + U * B + R, Q[M + 5] = I * w + $ * B + A, e.s("shape.gradient.pack", Q)
}
},
en = function (T, U, F, m) {
var N = !1;
if (T.beginPath ? T.beginPath() : N = !0, Xo(U) && (U = U._as), Xo(F) && (F = F._as), F && F.length) {
for (var A, $, p, W, B = 0, g = 0, y = F.length; y > g; g++) A = F[g], 1 === A ? ($ = U[B++], T.moveTo($.x, N ? -$.y : $.y)) : 2 === A ? ($ = U[B++], T.lineTo($.x, N ? -$.y : $.y)) : 3 === A ? ($ = U[B++], p = U[B++], T.quadraticCurveTo($.x, N ? -$.y : $.y, p.x, N ? -p.y : p.y)) : 4 === A ? ($ = U[B++], p = U[B++], W = U[B++], T.bezierCurveTo($.x, N ? -$.y : $.y, p.x, N ? -p.y : p.y, W.x, N ? -W.y : W.y)) : 5 === A && T.closePath();
m && 5 !== A && T.closePath()
} else {
var w, M, j, d = U.length;
if (d > 0) {
for (w = U[0], T.moveTo(w.x, N ? -w.y : w.y), M = 1; d > M; M++) j = U[M], T.lineTo(j.x, N ? -j.y : j.y);
m && T.closePath()
}
}
},
Yo = function (s, P, G, h) {
if (Xo(s) && (s = s._as), Xo(P) && (P = P._as), P && P.length) {
G = G || Nl;
for (var C, U, N, y, W, _, E, q, k = [], w = F, Y = 0, I = 0, v = P.length; v > I; I++)
if (C = P[I], 1 === C) k.push(w = []), w.push(s[Y++]);
else if (2 === C) w.push(s[Y++]);
else if (3 === C) {
for (U = w[w.length - 1], N = s[Y++], y = s[Y++], _ = 1; G > _; _++) E = Id(_ / G, U.x, N.x, y.x), q = Id(_ / G, U.y, N.y, y.y), w.push({
x: E,
y: q,
b: !0
});
w.push(y)
} else if (4 === C) {
for (U = w[w.length - 1], N = s[Y++], y = s[Y++], W = s[Y++], _ = 1; G > _; _++) E = qg(_ / G, U.x, N.x, y.x, W.x), q = qg(_ / G, U.y, N.y, y.y, W.y), w.push({
x: E,
y: q,
b: !0
});
w.push(W)
} else 5 === C && w.push(w[0]);
return h && 5 !== C && w && w.length > 2 && w.push(w[0]), k
}
return h && s.length > 2 && (s = s.slice(), s.push(s[0])), s ? [s] : []
},
fr = function (X, D, L, Z, c, g) {
var n, l, Q, x = zd(D),
B = Z,
J = x[0],
R = x[1],
f = x[2];
if (L) {
var u = zd(L);
n = u[0] - J, l = u[1] - R, Q = u[2] - f
} else n = 255 - J, l = 255 - R, Q = 255 - f;
for (g || (g = Z > 10 ? 1 : .5, g = 1 > c ? V(g / c, 2) : g), X.save(), X.shadowOffsetX = 0, X.shadowOffsetY = 0, X.shadowBlur = 0, X.shadowColor = 0;
(Z -= g) > 0;) {
var d = 1 - Z / B,
M = J + n * d,
P = R + l * d,
$ = f + Q * d;
M = V(s(M), 255), P = V(s(P), 255), $ = V(s($), 255), X.strokeStyle = "rgb(" + M + "," + P + "," + $ + ")", X.lineWidth = Z, X.stroke()
}
X.restore()
},
mp = function () {
var y = {};
return function (O, d) {
var p = O + "-" + d,
a = y[p];
if (a) return a;
var u, T, b, L = zd(O);
return 0 > d ? (d = (100 + d) / 100, u = s(L[0] * d), T = s(L[1] * d), b = s(L[2] * d)) : (d /= 100, u = L[0], T = L[1], b = L[2], u += (255 - u) * d, T += (255 - T) * d, b += (255 - b) * d, u = V(s(u), 255), T = V(s(T), 255), b = V(s(b), 255)), y[p] = "rgb(" + u + "," + T + "," + b + ")"
}
}(),
fl = function (D, e, d, f, k, c) {
c && (D.fillStyle = c), D.beginPath(), D.rect(e, d, f, k), D.fill()
},
Ej = function (x, j, Q, M, R, t, K) {
x.beginPath(), Eg[j](x, Q.x, Q.y, Q.width, Q.height, M, R, t, K)
},
Ge = function (M, V, S, Q, T) {
var m = Eg[S];
M.fillStyle = m ? m(M, V, Q ? Q : Cn, T.x, T.y, T.width, T.height) : V
},
fg = function (Y, Q, u, v, S, q) {
Y.fillStyle = am(Y, Q, u, v, S, q)
},
qb = function (t, I, T, M, w, l) {
t.strokeStyle = am(t, I, T, M, w, l)
},
am = function (k, I, o, x, F, J) {
var f;
try {
if (!I.tagName && I.comps) {
I._cacheImage_ || (I._cacheImage_ = {});
var y;
y = "override" === x ? "colors_override" : "override_rgb" === x ? "colors_override_rgb" : "override_a" === x ? "colors_override_a" : "colors", I._cacheImage_[y] || (I._cacheImage_[y] = {
__count__: 0
});
var H = I._cacheImage_[y][o];
H || (I._cacheImage_[y].__count__ > u.imageCacheThreshold && (I._cacheImage_[y] = {
__count__: 0
}), H = O.Default.toCanvas(I, xc(I), oo(I), null, F, J, o, null, x), I._cacheImage_[y][o] = H, I._cacheImage_[y].__count__++), I = H
}
f = k.createPattern(I, "repeat")
} catch (w) {
f = "black"
}
return f
},
Gh = function (r) {
var z, $, v = [],
n = 0,
U = r.length;
for (z = 0; 65 > z; z++) v[z] = z;
for (z = 0; 65 > z; z++) n = (n + v[z] + r.charCodeAt(z % U)) % 65, $ = v[z], v[z] = v[n], v[n] = $;
for (z = 0; 65 > z; z++) v[z] = Of[v[z]];
return v.join("")
},
bn = function (T) {
for (var q = 8 + Rc.randomInt(8), j = Of[8 * Rc.randomInt(8) + (q - 8)], P = "", i = 0; q > i; i++) P += Of[Rc.randomInt(64)];
var w = Gh(P + Y + zl + Yk);
return j + P + Nq.encode(T, w)
},
_o = function (N) {
var H = N[0],
P = Of.indexOf(H);
if (0 > P) return "";
P = 8 + (7 & P);
var h = N.slice(1, 1 + P),
q = Gh(h + Y + zl + Yk);
return Nq.decode(N, q, 1 + P)
},
Xr = function (X, Z, D, r, O, E, p) {
X.save(), X.translate(Z, D), X.scale(1, p / E), X.arc(0, 0, E, r, O), X.restore()
},
mo = function (L, t, g, e, y, U, Z, _) {
var I, P, m, b, r, $, D, f, N, M, A;
if (X(y) > 2 * W && (y = 2 * W), r = s(X(y) / (W / 4)), I = y / r, P = -I, m = -e, r > 0) {
$ = t + k(e) * U, D = g + n(-e) * Z, _ ? L.lineTo($, D) : L.moveTo($, D);
for (var i = 0; r > i; i++) m += P, b = m - P / 2, f = t + k(m) * U, N = g + n(m) * Z, M = t + k(b) * (U / k(P / 2)), A = g + n(b) * (Z / k(P / 2)), L.quadraticCurveTo(M, A, f, N)
}
},
pg = function ($, k, P, r, X, x, c, O, G) {
6 === arguments.length && (c = x, O = x, G = x);
var M = k + r,
n = P + X,
v = X > r ? 2 * r : 2 * X;
x = v > x ? x : v, c = v > c ? c : v, O = v > O ? O : v, G = v > G ? G : v;
var q = .29 * G,
Y = .58 * G;
$.moveTo(M, n - G), $.quadraticCurveTo(M, n - Y, M - q, n - q), $.quadraticCurveTo(M - Y, n, M - G, n), q = .29 * O, Y = .58 * O, $.lineTo(k + O, n), $.quadraticCurveTo(k + Y, n, k + q, n - q), $.quadraticCurveTo(k, n - Y, k, n - O), q = .29 * x, Y = .58 * x, $.lineTo(k, P + x), $.quadraticCurveTo(k, P + Y, k + q, P + q), $.quadraticCurveTo(k + Y, P, k + x, P), q = .29 * c, Y = .58 * c, $.lineTo(M - c, P), $.quadraticCurveTo(M - Y, P, M - q, P + q), $.quadraticCurveTo(M, P + Y, M, P + c), $.lineTo(M, n - G)
},
Ie = function (f, g, w, c, v, J, b) {
g && (w = A(w), c = A(c), b || (b = 1), f.fillStyle = g, f.beginPath(), f.rect(w, c, b, J), f.rect(w, c, v, b), J - b > 0 && f.rect(w, c + J - b, v, b), v - b > 0 && f.rect(w + v - b, c, b, J), f.fill())
},
Wq = function (o, N, m, K) {
var U = K.x,
M = K.y,
I = K.width,
j = K.height;
if (!(!N || !m || 0 >= I || 0 >= j)) {
var _, t = Ee(N),
q = cn(N),
$ = m > 0;
1 === m || -1 === m ? (o.fillStyle = $ ? t : q, o.beginPath(), o.rect(U, M, 1, j), o.rect(U, M, I, 1), o.fill(), o.fillStyle = $ ? q : t, o.beginPath(), o.rect(U, M + j - 1, I, 1), o.rect(U + I - 1, M, 1, j), o.fill()) : (m = V(X(m), V(I / 2, j / 2)), _ = o.createLinearGradient(U, M, U + m, M), _.addColorStop(0, $ ? t : q), _.addColorStop(1, N), o.fillStyle = _, o.beginPath(), o.moveTo(U, M), o.lineTo(U + m, M + m), o.lineTo(U + m, M + j - m), o.lineTo(U, M + j), o.lineTo(U, M), o.fill(), _ = o.createLinearGradient(U, M, U, M + m), _.addColorStop(0, $ ? t : q), _.addColorStop(1, N), o.fillStyle = _, o.beginPath(), o.moveTo(U, M), o.lineTo(U + m, M + m), o.lineTo(U + I - m, M + m), o.lineTo(U + I, M), o.lineTo(U, M), o.fill(), _ = o.createLinearGradient(U, M + j, U, M + j - m), _.addColorStop(0, $ ? q : t), _.addColorStop(1, N), o.fillStyle = _, o.beginPath(), o.moveTo(U, M + j), o.lineTo(U + m, M + j - m), o.lineTo(U + I - m, M + j - m), o.lineTo(U + I, M + j), o.lineTo(U, M + j), o.fill(), _ = o.createLinearGradient(U + I, M, U + I - m, M), _.addColorStop(0, $ ? q : t), _.addColorStop(1, N), o.fillStyle = _, o.beginPath(), o.moveTo(U + I, M), o.lineTo(U + I - m, M + m), o.lineTo(U + I - m, M + j - m), o.lineTo(U + I, M + j), o.lineTo(U + I, M), o.fill())
}
},
Hf = function (L, m, r, s, h, i, B) {
var A = L.createLinearGradient(s, h, i, B);
return A.addColorStop(0, r), A.addColorStop(1, m), A
},
Nd = function ($, B, i, W, j, H, t) {
var U = $.createLinearGradient(W, j, H, t);
return U.addColorStop(0, B), U.addColorStop(.5, i), U.addColorStop(1, B), U
},
Dl = function (W, O, L, u, $, N, y) {
var P = W.createLinearGradient(u, $, N, y);
return P.addColorStop(0, O), P.addColorStop(1 / 3, L), P.addColorStop(2 / 3, O), P.addColorStop(1, L), P
},
Ni = function (O, i, A, I, D, z, F, X, U) {
var c = O.createRadialGradient(I + z * X, D + F * U, V(z, F) / 24, I + z / 2, D + F / 2, q(z, F) / 2);
return c.addColorStop(0, A), c.addColorStop(1, i), c
},
og = [0, -1, .22451398828979272, -.30901699437494734, .9510565162951535, -.30901699437494745, .3632712640026804, .11803398874989468, .5877852522924731, .8090169943749473, -1.1102230246251565e-16, .38196601125010515, -.587785252292473, .8090169943749475, -.3632712640026805, .1180339887498949, -.9510565162951536, -.3090169943749473, -.22451398828979285, -.30901699437494734],
Eg = {
polygon: function (L, N, X, t, c, h) {
(h == F || 3 > h) && (h = 6);
for (var l, p, q = V(t, c) / 2, z = N + t / 2, B = X + c / 2, b = 0, K = 2 * W / h, y = 0; h > y; y++) l = z + k(b) * q, p = B + n(b) * q, 0 === y ? L.moveTo(l, p) : L.lineTo(l, p), b += K;
L.closePath()
}, arc: function (j, c, p, k, T, d, K, m, t) {
d == F && (d = W), K == F && (K = $), m == F && (m = !0);
var J = c + k / 2,
E = p + T / 2;
m && j.moveTo(J, E), t ? Xr(j, J, E, d, K, k / 2, T / 2) : j.arc(J, E, V(k, T) / 2, d, K), m && j.closePath()
}, rect: function (A, i, x, G, U) {
A.rect(i, x, G, U)
}, circle: function (n, g, I, i, s) {
n.arc(g + i / 2, I + s / 2, V(i, s) / 2, 0, $, !0)
}, oval: function (y, J, v, I, H) {
Xr(y, J + I / 2, v + H / 2, 0, $, I / 2, H / 2)
}, roundRect: function (E, m, R, Q, y, w) {
w == F && (w = V(V(Q, y) / 4, 8)), pg(E, m, R, Q, y, w)
}, star: function (I, B, F, z, x) {
var L = 2 * z,
t = 2 * x,
E = B + z / 2,
o = F + x / 2;
I.moveTo(E - L / 4, o - t / 12), I.lineTo(B + .306 * z, F + .579 * x), I.lineTo(E - L / 6, o + t / 4), I.lineTo(B + z / 2, F + .733 * x), I.lineTo(E + L / 6, o + t / 4), I.lineTo(B + .693 * z, F + .579 * x), I.lineTo(E + L / 4, o - t / 12), I.lineTo(B + .611 * z, F + .332 * x), I.lineTo(E + 0, o - t / 4), I.lineTo(B + .388 * z, F + .332 * x), I.closePath()
}, pentagram: function (F, T, a, L, U) {
var m = .5 * U,
Q = T + .5 * L,
Z = a + m,
W = .5257311121191336 * L;
W > m && (W = m);
var R = og,
K = 0;
for (F.moveTo(Q + W * R[K++], Z + W * R[K++]); 20 > K;) F.lineTo(Q + W * R[K++], Z + W * R[K++]);
F.closePath()
}, triangle: function (D, j, H, O, T) {
D.moveTo(j + O / 2, H), D.lineTo(j + O, H + T), D.lineTo(j, H + T), D.closePath()
}, hexagon: function (_, i, Z, r, f) {
_.moveTo(i, Z + f / 2), _.lineTo(i + r / 4, Z + f), _.lineTo(i + 3 * r / 4, +Z + f), _.lineTo(i + r, Z + f / 2), _.lineTo(i + 3 * r / 4, Z), _.lineTo(i + r / 4, Z), _.closePath()
}, pentagon: function (i, m, j, p, A) {
var b = 2 * p,
f = 2 * A,
E = m + p / 2,
k = j + A / 2;
i.moveTo(E - b / 4, k - f / 12), i.lineTo(E - b / 6, k + f / 4), i.lineTo(E + b / 6, k + f / 4), i.lineTo(E + b / 4, k - f / 12), i.lineTo(E + 0, k - f / 4), i.closePath()
}, diamond: function (x, l, v, u, n) {
x.moveTo(l + u / 2, v), x.lineTo(l, v + n / 2), x.lineTo(l + u / 2, v + n), x.lineTo(l + u, v + n / 2), x.closePath()
}, rightTriangle: function (N, Z, G, b, L) {
N.moveTo(Z, G), N.lineTo(Z + b, G + L), N.lineTo(Z, G + L), N.closePath()
}, parallelogram: function (Q, g, B, p, k) {
var V = p / 4;
Q.moveTo(g + V, B), Q.lineTo(g + p, B), Q.lineTo(g + p - V, B + k), Q.lineTo(g, B + k), Q.closePath()
}, trapezoid: function (C, D, a, y, m) {
var M = y / 4;
C.moveTo(D + M, a), C.lineTo(D + y - M, a), C.lineTo(D + y, a + m), C.lineTo(D, a + m), C.closePath()
}, "linear.southwest": function (k, R, u, P, i, g, v) {
return Hf(k, R, u, P, i + v, P + g, i)
}, "linear.southeast": function (X, h, r, S, b, e, f) {
return Hf(X, h, r, S + e, b + f, S, b)
}, "linear.northwest": function (e, L, p, K, y, k, U) {
return Hf(e, L, p, K, y, K + k, y + U)
}, "linear.northeast": function (E, D, $, L, V, N, J) {
return Hf(E, D, $, L + N, V, L, V + J)
}, "linear.north": function (t, E, N, q, C, P, J) {
return Hf(t, E, N, q, C, q, C + J)
}, "linear.south": function (w, U, P, m, V, t, L) {
return Hf(w, U, P, m, V + L, m, V)
}, "linear.west": function (H, $, G, d, s, u) {
return Hf(H, $, G, d, s, d + u, s)
}, "linear.east": function (e, l, L, i, t, h) {
return Hf(e, l, L, i + h, t, i, t)
}, "radial.center": function (T, s, S, h, l, Z, U) {
return Ni(T, s, S, h, l, Z, U, .5, .5)
}, "radial.southwest": function (Y, Z, z, n, L, o, a) {
return Ni(Y, Z, z, n, L, o, a, .25, .75)
}, "radial.southeast": function (p, U, m, b, M, d, w) {
return Ni(p, U, m, b, M, d, w, .75, .75)
}, "radial.northwest": function (L, J, G, $, r, w, V) {
return Ni(L, J, G, $, r, w, V, .25, .25)
}, "radial.northeast": function (B, l, J, v, V, f, a) {
return Ni(B, l, J, v, V, f, a, .75, .25)
}, "radial.north": function (F, i, H, n, S, r, K) {
return Ni(F, i, H, n, S, r, K, .5, .25)
}, "radial.south": function (L, h, R, Y, E, a, S) {
return Ni(L, h, R, Y, E, a, S, .5, .75)
}, "radial.west": function (R, V, v, t, C, A, $) {
return Ni(R, V, v, t, C, A, $, .25, .5)
}, "radial.east": function (i, J, r, o, v, j, w) {
return Ni(i, J, r, o, v, j, w, .75, .5)
}, "spread.horizontal": function (H, I, D, z, E, q) {
return Nd(H, I, D, z, E, z + q, E)
}, "spread.vertical": function (I, R, N, o, K, h, P) {
return Nd(I, R, N, o, K, o, K + P)
}, "spread.diagonal": function (A, c, x, B, P, F, d) {
return Nd(A, c, x, B + F, P, B, P + d)
}, "spread.antidiagonal": function (G, C, d, q, p, D, $) {
return Nd(G, C, d, q, p, q + D, p + $)
}, "spread.north": function (A, o, t, z, $, M, c) {
return Dl(A, o, t, z, $ - c / 4, z, $ + c + c / 4)
}, "spread.south": function (E, l, w, N, J, f, r) {
return Dl(E, w, l, N, J - r / 4, N, J + r + r / 4)
}, "spread.west": function (S, P, r, W, G, q) {
return Dl(S, P, r, W - q / 4, G, W + q + q / 4, G)
}, "spread.east": function (D, J, f, w, N, s) {
return Dl(D, f, J, w - s / 4, N, w + s + s / 4, N)
}
},
Go = function (o, l, _) {
return new In(o).tf(l, _)
},
zo = function (N) {
var C = N.touches[0],
p = N.touches[1],
B = C.clientX,
b = C.clientY,
z = p.clientX,
J = p.clientY;
return w((B - z) * (B - z) + (b - J) * (b - J))
},
ne = function (p) {
var K = p.touches[0],
n = p.touches[1],
T = K.clientX,
e = K.clientY,
O = n.clientX,
x = n.clientY;
return {
x: (T + O) / 2,
y: (e + x) / 2
}
},
er = (function () {
for (var Q = 0, F = rj.split(""), L = 0; L < F.length; L++) Q = 10 * Zb(F[L]) + Q;
return $o(x[$r.toString(8 * L) + Bg.substr(L) + 3], x[$r.toString(8 * L) + Bg.substr(L) + 4]), Q
}(), function (M, A, N) {
for (var g = 0; g < N.size(); g++) {
var F = N.get(g);
M.co(F) && A.add(F)
}
for (g = 0; g < N.size(); g++) F = N.get(g), er(M, A, F._children)
}),
no = function (H, N, Y) {
for (var g = 0; g < Y.size(); g++) {
var Z = Y.get(Y.size() - 1 - g);
H.co(Z) && N.add(Z)
}
for (g = 0; g < Y.size(); g++) Z = Y.get(g), no(H, N, Z._children)
},
ao = function (Z, y, t) {
for (var z = !1, o = 0; o < t.size(); o++) {
var N = t.get(o);
Z.co(N) ? z && y.add(N) : z = 1
}
for (o = 0; o < t.size(); o++) N = t.get(o), ao(Z, y, N._children)
},
Tk = function (I, r, Z) {
for (var R = !1, Q = 0; Q < Z.size(); Q++) {
var S = Z.get(Z.size() - 1 - Q);
I.co(S) ? R && r.add(S) : R = !0
}
for (Q = 0; Q < Z.size(); Q++) S = Z.get(Q), Tk(I, r, S._children)
},
qc = u.moveDatas = function (j, p, E, o) {
var U = o == F;
if (0 !== p || 0 !== E || !U && 0 !== o) {
var V = !0,
R = [];
if (j.forEach(function (Y) {
V && (Y._69O || yl(Y) || Qb(Y)) && (V = !1)
}), V) R = j;
else {
var O = {},
l = {};
j.forEach(function (L) {
O[L._id] = !0
});
var y = {},
g = function (B) {
var H = B._id;
return O[H] ? (R.push(B), y[H] = !0) : y[H] = !1
},
a = function (C) {
var W = C._id;
if (l[W]) return g(C);
var N = y[W];
if (N !== Z) return N;
var q = C._parent;
if (q && (Qb(q) || yl(q)) && a(q)) return y[W] = !0;
var J = C._host;
return J && (l[W] = W, N = a(J), l[W] = Z, N) ? y[W] = !0 : g(C)
};
j.forEach(function (S) {
a(S)
})
}
R.forEach(function (k) {
if (Fq(k)) U ? k.translate(p, E) : k.translate3d(p, E, o);
else {
var W = k.s(Ei);
if (!W || W.isEmpty()) return;
var y = new xr;
W.each(function (b) {
b = Pm(b), U ? (b.x += p, b.y += E) : (b.x += p, b.y += o, b.e == F ? b.e = E : b.e += E), y.add(b)
}), k.s(Ei, y)
}
})
}
},
Vg = function () {
function n(e, P) {
return P === e.substring(0, P.length) ? !0 : !1
}
function f(K) {
return parseFloat(K) || 0
}
function b(D, q) {
if (q == Z && (q = new br), n(D, "matrix3d")) {
var m = D.substring(9, D.length - 1).split(",");
m = m.map(f), q.fromArray(m)
} else if (n(D, "matrix")) {
var m = D.substring(7, D.length - 1).split(",");
m = m.map(f), q.el[0] = m[0], q.el[1] = m[1], q.el[2] = 0, q.el[3] = 0, q.el[4] = m[2], q.el[5] = m[3], q.el[6] = 0, q.el[7] = 0, q.el[8] = 0, q.el[9] = 0, q.el[10] = 1, q.el[11] = 0, q.el[12] = m[4], q.el[13] = m[5], q.el[14] = 0, q.el[15] = 1
}
return q
}
function j(O, W) {
W == Z && (W = new tl);
var z = O.split(/\s+/);
return z = z.map(f), W.set(z[0] || 0, z[1] || 0, z[2] || 0), W
}
var H, M, w, A, h, R = function (W, c) {
H || (H = new br, M = new tl, w = new br, A = new br, h = new br), c == Z && (c = new br);
var P = getComputedStyle(W);
P.transform && "none" !== P.transform && (b(P.transform, H), j(P.transformOrigin, M), A.setPosition(M), M.negate(), h.setPosition(M), (Uq || "preserve-3d" !== P.transformStyle) && (H.el[8] = 0, H.el[9] = 0, H.el[10] = 1, H.el[11] = 0), c.multiplyMatrices(h, c), c.multiplyMatrices(H, c), c.multiplyMatrices(A, c)), !Uq && P.perspective && "none" !== P.perspective && (w.el[11] = -1 / f(P.perspective), j(P.perspectiveOrigin, M), A.setPosition(M), M.negate(), h.setPosition(M), c.multiplyMatrices(h, c), c.multiplyMatrices(w, c), c.multiplyMatrices(A, c));
for (var C = W.offsetParent, s = W.offsetLeft, n = W.offsetTop, x = W.parentElement; x && x !== C;) {
var q = getComputedStyle(x);
if ("none" !== q.transform || "none" !== q.perspective) break;
x = x.parentElement
}
return x == Z && W !== W.ownerDocument.documentElement && "fixed" !== P.position && (x = W.ownerDocument.documentElement), C != Z && C !== x && (s -= x.offsetLeft, n -= x.offsetTop), M.set(s, n, 0), A.setPosition(M), c.multiplyMatrices(A, c), x && R(x, c), c
};
return function (g, a) {
var O = g.parentElement;
if (O) {
var V = O.updateAppendMatrix;
if (V) {
delete O.updateAppendMatrix;
var S = new br;
R(O, S);
var J = new br;
J.getInverse(S), O._matrixAppend = J, O._maxrixPreAppend = S
}
return a ? O._matrixAppend : O._maxrixPreAppend
}
}
}(),
Jm = function (b, p) {
for (; b && !b.hasOwnProperty(p);) b = o.getPrototypeOf(b);
return b && o.getOwnPropertyDescriptor(b, p)
},
Ug = o.getPrototypeOf ? function (n, p, W) {
var C = Jm(p, W);
C && o.defineProperty(n, W, C)
} : function (v, f, S) {
v[S] = f[S]
},
cg = {
1: 29,
2: 30,
3: 31,
4: 32,
5: 33,
6: 26,
7: 27,
8: 28,
9: 21,
10: 22,
11: 23,
12: 24,
13: 25,
14: 14,
15: 15,
16: 16,
17: 17,
18: 18,
19: 19,
20: 20,
21: 9,
22: 10,
23: 11,
24: 12,
25: 13,
26: 6,
27: 7,
28: 8,
29: 1,
30: 2,
31: 3,
32: 4,
33: 5,
34: 36,
35: 37,
36: 34,
37: 35,
38: 54,
39: 55,
40: 52,
41: 53,
42: 50,
43: 51,
44: 49,
50: 42,
51: 43,
52: 40,
53: 41,
54: 38,
55: 39
},
Re = function () {
var Q = {
1: function (Z, z) {
return {
x: Z.x - z.width / 2,
y: Z.y - z.height / 2
}
}, 2: function (i, e) {
return {
x: i.x + e.width / 2,
y: i.y - e.height / 2
}
}, 3: function (k, F) {
return {
x: k.x + k.width / 2,
y: k.y - F.height / 2
}
}, 4: function (L, F) {
return {
x: L.x + L.width - F.width / 2,
y: L.y - F.height / 2
}
}, 5: function (g, l) {
return {
x: g.x + g.width + l.width / 2,
y: g.y - l.height / 2
}
}, 6: function (r) {
return {
x: r.x,
y: r.y
}
}, 7: function (N) {
return {
x: N.x + N.width / 2,
y: N.y
}
}, 8: function (Z) {
return {
x: Z.x + Z.width,
y: Z.y
}
}, 9: function (U, V) {
return {
x: U.x - V.width / 2,
y: U.y + V.height / 2
}
}, 10: function (n, M) {
return {
x: n.x + M.width / 2,
y: n.y + M.height / 2
}
}, 11: function (D, w) {
return {
x: D.x + D.width / 2,
y: D.y + w.height / 2
}
}, 12: function (E, u) {
return {
x: E.x - u.width / 2 + E.width,
y: E.y + u.height / 2
}
}, 13: function (Y, P) {
return {
x: Y.x + Y.width + P.width / 2,
y: Y.y + P.height / 2
}
}, 14: function (A, U) {
return {
x: A.x - U.width / 2,
y: A.y + A.height / 2
}
}, 15: function (b) {
return {
x: b.x,
y: b.y + b.height / 2
}
}, 16: function (e, p) {
return {
x: e.x + p.width / 2,
y: e.y + e.height / 2
}
}, 17: function (y) {
return {
x: y.x + y.width / 2,
y: y.y + y.height / 2
}
}, 18: function (L, s) {
return {
x: L.x + L.width - s.width / 2,
y: L.y + L.height / 2
}
}, 19: function (y) {
return {
x: y.x + y.width,
y: y.y + y.height / 2
}
}, 20: function (R, c) {
return {
x: R.x + R.width + c.width / 2,
y: R.y + R.height / 2
}
}, 21: function (S, s) {
return {
x: S.x - s.width / 2,
y: S.y + S.height - s.height / 2
}
}, 22: function (W, D) {
return {
x: W.x + D.width / 2,
y: W.y + W.height - D.height / 2
}
}, 23: function (d, a) {
return {
x: d.x + d.width / 2,
y: d.y + d.height - a.height / 2
}
}, 24: function (J, O) {
return {
x: J.x + J.width - O.width / 2,
y: J.y + J.height - O.height / 2
}
}, 25: function (C, k) {
return {
x: C.x + C.width + k.width / 2,
y: C.y + C.height - k.height / 2
}
}, 26: function (x) {
return {
x: x.x,
y: x.y + x.height
}
}, 27: function (W) {
return {
x: W.x + W.width / 2,
y: W.y + W.height
}
}, 28: function (g) {
return {
x: g.x + g.width,
y: g.y + g.height
}
}, 29: function (k, r) {
return {
x: k.x - r.width / 2,
y: k.y + k.height + r.height / 2
}
}, 30: function (u, B) {
return {
x: u.x + B.width / 2,
y: u.y + u.height + B.height / 2
}
}, 31: function (H, w) {
return {
x: H.x + H.width / 2,
y: H.y + H.height + w.height / 2
}
}, 32: function (N, b) {
return {
x: N.x + N.width - b.width / 2,
y: N.y + N.height + b.height / 2
}
}, 33: function (l, B) {
return {
x: l.x + l.width + B.width / 2,
y: l.y + l.height + B.height / 2
}
}, 34: function (q, t) {
return {
x: q.x,
y: q.y - t.height / 2
}
}, 35: function (Y, x) {
return {
x: Y.x + Y.width,
y: Y.y - x.height / 2
}
}, 36: function (j, q) {
return {
x: j.x,
y: j.y + j.height + q.height / 2
}
}, 37: function (i, o) {
return {
x: i.x + i.width,
y: i.y + i.height + o.height / 2
}
}, 38: function (u, x) {
return {
x: u.x + u.width / 4,
y: u.y - x.height / 2
}
}, 39: function (N, e) {
return {
x: N.x + 3 * N.width / 4,
y: N.y - e.height / 2
}
}, 40: function (l) {
return {
x: l.x + l.width / 4,
y: l.y
}
}, 41: function (w) {
return {
x: w.x + 3 * w.width / 4,
y: w.y
}
}, 42: function (x, i) {
return {
x: x.x + x.width / 4,
y: x.y + i.height / 2
}
}, 43: function (A, t) {
return {
x: A.x + 3 * A.width / 4,
y: A.y + t.height / 2
}
}, 44: function (M, d) {
return {
x: M.x + M.width / 2,
y: M.y + M.height / 2 - d.height / 2
}
}, 45: function (N) {
return {
x: N.x + N.width / 4,
y: N.y + N.height / 2
}
}, 46: function (M, w) {
return {
x: M.x + M.width / 2 - w.width / 2,
y: M.y + M.height / 2
}
}, 47: function (a, E) {
return {
x: a.x + a.width / 2 + E.width / 2,
y: a.y + a.height / 2
}
}, 48: function (U) {
return {
x: U.x + 3 * U.width / 4,
y: U.y + U.height / 2
}
}, 49: function (u, L) {
return {
x: u.x + u.width / 2,
y: u.y + u.height / 2 + L.height / 2
}
}, 50: function (O, J) {
return {
x: O.x + O.width / 4,
y: O.y + O.height - J.height / 2
}
}, 51: function (l, S) {
return {
x: l.x + 3 * l.width / 4,
y: l.y + l.height - S.height / 2
}
}, 52: function (j) {
return {
x: j.x + j.width / 4,
y: j.y + j.height
}
}, 53: function (O) {
return {
x: O.x + 3 * O.width / 4,
y: O.y + O.height
}
}, 54: function (W, G) {
return {
x: W.x + W.width / 4,
y: W.y + W.height + G.height / 2
}
}, 55: function (A, u) {
return {
x: A.x + 3 * A.width / 4,
y: A.y + A.height + u.height / 2
}
}
};
return lh(x) ? function (V, Y, O) {
return Q[V](Y, O ? O : nl)
} : void 0
}();
Uh(S, {
highlight: "#1ABC9C",
label: "#000",
labelSelect: "#FFF",
transparent: "rgba(0,0,0,0.35)",
titleBackground: "#2C3E50",
titleIconBackground: "#868686",
headerBackground: "#ECF0F1",
headerIconBackground: "#868686",
headerSeparator: "#868686",
headerLine: "#D9D9D9",
background: "#FFF",
disabledBackground: "rgba(255,255,255,0.65)",
toolTipBackground: "#FFFFE0",
rectSelectBorder: "#45C4F9",
rectSelectBackground: "rgba(0,0,0,0.35)",
editPointBorder: "#2C3E50",
editPointBackground: "#D9D9D9",
dash: "#2C3E50",
groupBackground: "#ECF0F1",
groupTitleBackground: "#2C3E50",
gridBackground: "#D9D9D9",
gridCellBorderColor: "#868686",
gridBlockColor: "#868686",
reverse: "#868686",
contentIconBackground: "#868686",
contentLine: "#D9D9D9",
widgetBackground: "#ECF0F1",
widgetBorder: "#D9D9D9",
widgetIconBackground: "#868686",
widgetIconBorder: "#868686",
widgetIconGradient: "#D9D9D9",
widgetIconHighlight: "#43AFF1",
imageBackground: "#3498DB",
imageGradient: "#FFF",
chart: ["#2f7ed8", "#0d233a", "#8bbc21", "#910000", "#1aadce", "#492970", "#f28f43", "#77a1e5", "#c42525", "#a6c96a"]
}, !0);
var vc = S.reverse,
od = S.transparent,
Vh = S.rectSelectBackground,
dm = S.dash,
Kf = S.titleBackground,
Fj = S.titleIconBackground,
Yl = S.headerBackground,
cb = S.headerIconBackground,
Yb = S.headerSeparator,
qj = S.headerLine,
hk = S.contentIconBackground,
rh = S.contentLine,
Em = (S.widgetIconHighlight, S.widgetIconBorder),
Ur = (S.widgetIconGradient, S.imageBackground),
Cn = S.imageGradient,
Bc = S.highlight,
Un = S.label,
Dg = S.labelSelect;
if (false && !x.shutAlert1) {
var ml = new Date,
qn = yh.split("-"),
$n = new Date(ml.getFullYear(), ml.getMonth(), ml.getDate()),
yh = new Date(Zb(qn[0], 10), Zb(qn[1], 10) - 1, Zb(qn[2], 10)),
Pe = $n.getTime(),
of = yh.getTime(),
Wm = Y + "_try",
xi = x.alert;
try {
var Gd = x.localStorage;
if (Gd && xi)
if (of > Pe && 1728e6 > of - Pe) {
var Oc = (of - Pe) / 864e5;
Gd && Gd[Wm] != Oc && (Gd[Wm] = Oc, x.htWillExpire ? xi(x.htWillExpire.replace("{{day}}", Oc)) : xi("HT for Web free trial license will expire in " + Oc + " days, please apply for a new license!"))
} else Pe >= of && (x.htExpired ? xi(x.htExpired) : xi("Your free trial of HT for Web has expired!")),
Gd && delete Gd[Wm]
} catch (bd) { }
}
Math.sign === Z && (Math.sign = function (M) {
return 0 > M ? -1 : M > 0 ? 1 : +M
});
var Of = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
Nq = {
encode: function (F, B) {
var p, j, f, G, M, E, i, l = "",
C = 0;
for (F = unescape(encodeURIComponent(F)); C < F.length;) p = F.charCodeAt(C++), j = F.charCodeAt(C++), f = F.charCodeAt(C++), G = p >> 2, M = (3 & p) << 4 | j >> 4, E = (15 & j) << 2 | f >> 6, i = 63 & f, isNaN(j) ? E = i = 64 : isNaN(f) && (i = 64), l = l + B.charAt(G) + B.charAt(M) + B.charAt(E) + B.charAt(i);
return l
}, decode: function (o, I, T) {
for (var u, f, v, i, s, K, V, j = "", y = T || 0; y < o.length;) i = I.indexOf(o.charAt(y++)), s = I.indexOf(o.charAt(y++)), K = I.indexOf(o.charAt(y++)), V = I.indexOf(o.charAt(y++)), u = i << 2 | s >> 4, f = (15 & s) << 4 | K >> 2, v = (3 & K) << 6 | V, j += String.fromCharCode(u), 64 != K && (j += String.fromCharCode(f)), 64 != V && (j += String.fromCharCode(v));
return j = decodeURIComponent(escape(j))
}, _utf8_encode: function (a) {
a = a.replace(/\r\n/g, "\n");
for (var L = "", h = 0; h < a.length; h++) {
var l = a.charCodeAt(h);
128 > l ? L += String.fromCharCode(l) : l > 127 && 2048 > l ? (L += String.fromCharCode(192 | l >> 6), L += String.fromCharCode(128 | 63 & l)) : (L += String.fromCharCode(224 | l >> 12), L += String.fromCharCode(128 | 63 & l >> 6), L += String.fromCharCode(128 | 63 & l))
}
return L
}, _utf8_decode: function (k) {
for (var K = "", $ = 0, O = 0, h = 0, B = 0; $ < k.length;) O = k.charCodeAt($), 128 > O ? (K += String.fromCharCode(O), $++) : O > 191 && 224 > O ? (h = k.charCodeAt($ + 1), K += String.fromCharCode((31 & O) << 6 | 63 & h), $ += 2) : (h = k.charCodeAt($ + 1), B = k.charCodeAt($ + 2), K += String.fromCharCode((15 & O) << 12 | (63 & h) << 6 | 63 & B), $ += 3);
return K
}
},
Xq = [],
Uf = [],
Rc = O.Math = {
generateUUID: function () {
for (var k = [], f = 0; 256 > f; f++) k[f] = (16 > f ? "0" : "") + f.toString(16).toUpperCase();
return function () {
var r = 0 | 4294967295 * Math.random(),
i = 0 | 4294967295 * Math.random(),
x = 0 | 4294967295 * Math.random(),
z = 0 | 4294967295 * Math.random();
return k[255 & r] + k[255 & r >> 8] + k[255 & r >> 16] + k[255 & r >> 24] + "-" + k[255 & i] + k[255 & i >> 8] + "-" + k[64 | 15 & i >> 16] + k[255 & i >> 24] + "-" + k[128 | 63 & x] + k[255 & x >> 8] + "-" + k[255 & x >> 16] + k[255 & x >> 24] + k[255 & z] + k[255 & z >> 8] + k[255 & z >> 16] + k[255 & z >> 24]
}
}(),
clamp: function (K, V, v) {
return Math.max(V, Math.min(v, K))
}, generateIncreasingID: function () {
var e = 0;
return function () {
return ++e
}
}(),
encodeBase64: function (z, g) {
return Nq.encode(z, g || Of)
}, decodeBase64: function (t, z) {
return Nq.decode(t, z || Of)
}, randomArray: function (z, c) {
c = c || z.length;
for (var q = c - 1; q > 0; q--) {
var Y = Math.floor(Math.random() * (q + 1)),
T = z[q];
z[q] = z[Y], z[Y] = T
}
return z
}, randomInt: function (e, q) {
return q === Z && (q = e, e = 0), e + Math.floor(Math.random() * (q - e))
}, isPOT: function (H) {
return H > 0 && 0 === (H - 1 & H)
}, nearestPOT: function (A) {
if (!A) return 1;
var p = A;
p--, p |= p >> 1, p |= p >> 2, p |= p >> 4, p |= p >> 8, p |= p >> 16, p++;
var j = p >> 1;
return A - j > p - A ? p : j
}, requestMatrix4: function () {
return Xq.length > 0 ? Xq.pop() : new Rc.Matrix4
}, releaseMatrix4: function (N) {
Xq.push(N)
}, requestVector3: function () {
return Uf.length > 0 ? Uf.pop() : new Rc.Vector3
}, releaseVector3: function (b) {
Uf.push(b)
}
},
Np = O.Matrix = O.Math.Matrix2d = function (W, g, H, G, x) {
this.setFromTransform(W, g, H, G, x)
},
In = Np;
Np.prototype = {}, Np.prototype.constructor = Np, Np.prototype.set = function (s, d, C, R, K, L) {
return this.a = s, this.b = d, this.c = C, this.d = R, this.tx = K, this.ty = L, this
}, Np.prototype.setFromTransform = function (V, u, T, D, I) {
var Q = this;
if (V === Z) return Q.a = 1, Q.b = 0, Q.c = 0, Q.d = 1, Q.tx = 0, Q.ty = 0, void 0;
V = V || 0;
var U = n(V),
P = k(V);
return D = D || 1, I = I || 1, Q.a = P * D, Q.b = U * D, Q.c = -U * I, Q.d = P * I, Q.tx = u || 0, Q.ty = T || 0, Q
}, Np.prototype.apply = function (h, T) {
T = T || new Xi;
var D = h.x,
j = h.y;
return T.x = this.a * D + this.c * j + this.tx, T.y = this.b * D + this.d * j + this.ty, T
}, Np.prototype.applyInverse = function (p, o) {
o = o || new Xi;
var Q = 1 / (this.a * this.d + this.c * -this.b),
A = p.x,
c = p.y;
return o.x = this.d * Q * A + -this.c * Q * c + (this.ty * this.c - this.tx * this.d) * Q, o.y = this.a * Q * c + -this.b * Q * A + (-this.ty * this.a + this.tx * this.b) * Q, o
}, Np.prototype.translate = function (D, b) {
return this.tx += D, this.ty += b, this
}, Np.prototype.scale = function (b, o) {
return this.a *= b, this.d *= o, this.c *= b, this.b *= o, this.tx *= b, this.ty *= o, this
}, Np.prototype.rotate = function (V) {
var Y = Math.cos(V),
$ = Math.sin(V),
F = this.a,
C = this.c,
b = this.tx;
return this.a = F * Y - this.b * $, this.b = F * $ + this.b * Y, this.c = C * Y - this.d * $, this.d = C * $ + this.d * Y, this.tx = b * Y - this.ty * $, this.ty = b * $ + this.ty * Y, this
}, Np.prototype.appendTranslate = function (c, Y) {
return this.tx += this.a * c + this.c * Y, this.ty += this.b * c + this.d * Y, this
}, Np.prototype.appendScale = function (L, I) {
return this.a *= L, this.d *= I, this.c *= I, this.b *= L, this
}, Np.prototype.appendRotate = function (J) {
if (!J) return this;
var K = Math.cos(J),
X = Math.sin(J),
w = this.a,
h = this.b;
return this.a = w * K + this.c * X, this.b = h * K + this.d * X, this.c = -w * X + this.c * K, this.d = -h * X + this.d * K, this
}, Np.prototype.append = function (X) {
var n = this.a,
W = this.b,
P = this.c,
s = this.d;
return this.a = X.a * n + X.b * P, this.b = X.a * W + X.b * s, this.c = X.c * n + X.d * P, this.d = X.c * W + X.d * s, this.tx = X.tx * n + X.ty * P + this.tx, this.ty = X.tx * W + X.ty * s + this.ty, this
}, Np.prototype.setTransform = function (z, d, q, S, L, n, E, Y, K) {
var J, A, Q, N, P, T, e, a, r, Z;
return P = Math.sin(E), T = Math.cos(E), e = Math.cos(K), a = Math.sin(K), r = -Math.sin(Y), Z = Math.cos(Y), J = T * L, A = P * L, Q = -P * n, N = T * n, this.a = e * J + a * Q, this.b = e * A + a * N, this.c = r * J + Z * Q, this.d = r * A + Z * N, this.tx = z + (q * J + S * Q), this.ty = d + (q * A + S * N), this
}, Np.prototype.prepend = function (d) {
var v = this.tx;
if (1 !== d.a || 0 !== d.b || 0 !== d.c || 1 !== d.d) {
var y = this.a,
w = this.c;
this.a = y * d.a + this.b * d.c, this.b = y * d.b + this.b * d.d, this.c = w * d.a + this.d * d.c, this.d = w * d.b + this.d * d.d
}
return this.tx = v * d.a + this.ty * d.c + d.tx, this.ty = v * d.b + this.ty * d.d + d.ty, this
}, Np.prototype.transform = Np.prototype.prepend, Np.prototype.invert = function () {
var M = this.a,
R = this.b,
Y = this.c,
o = this.d,
a = this.tx,
h = M * o - R * Y;
return this.a = o / h, this.b = -R / h, this.c = -Y / h, this.d = M / h, this.tx = (Y * this.ty - o * a) / h, this.ty = -(M * this.ty - R * a) / h, this
}, Np.prototype.identity = function () {
return this.a = 1, this.b = 0, this.c = 0, this.d = 1, this.tx = 0, this.ty = 0, this
}, Np.prototype.clone = function () {
var o = new Np;
return o.a = this.a, o.b = this.b, o.c = this.c, o.d = this.d, o.tx = this.tx, o.ty = this.ty, o
}, Np.prototype.copy = function (d) {
return d.a = this.a, d.b = this.b, d.c = this.c, d.d = this.d, d.tx = this.tx, d.ty = this.ty, d
}, Np.prototype.tf = function (m, h) {
1 === arguments.length && (h = m.y, m = m.x);
var J = this;
return {
x: J.a * m + J.c * h + J.tx,
y: J.b * m + J.d * h + J.ty
}
}, Np.prototype.tfi = function (x, q) {
1 === arguments.length && (q = x.y, x = x.x);
var C = this,
j = 1 / (C.a * C.d + C.c * -C.b);
return {
x: C.d * j * x + -C.c * j * q + (C.ty * C.c - C.tx * C.d) * j,
y: C.a * j * q + -C.b * j * x + (-C.ty * C.a + C.tx * C.b) * j
}
}, Np.IDENTITY = new Np, Np.TEMP_MATRIX = new Np;
var fs = O.Math.Quaternion = function (q, I, f, h) {
this.set(q, I, f, h)
};
o.assign(fs.prototype, {
set: function (X, R, C, j) {
var f = this;
return f._x = X || 0, f._y = R || 0, f._z = C || 0, f._w = j !== Z ? j : 1, f
}, clone: function () {
return new this.constructor(this._x, this._y, this._z, this._w)
}, copy: function (u) {
var t = this;
return t._x = u._x, t._y = u._y, t._z = u._z, t._w = u._w, t
}, inverse: function () {
return this.conjugate()
}, conjugate: function () {
return this._x *= -1, this._y *= -1, this._z *= -1, this
}, dot: function (N) {
return this._x * N._x + this._y * N._y + this._z * N._z + this._w * N._w
}, lengthSq: function () {
return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
}, length: function () {
return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
}, normalize: function () {
var J = this.length();
return 0 === J ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (J = 1 / J, this._x = this._x * J, this._y = this._y * J, this._z = this._z * J, this._w = this._w * J), this
}, fromArray: function (S, M) {
M === Z && (M = 0);
var g = this;
return g._x = S[M], g._y = S[M + 1], g._z = S[M + 2], g._w = S[M + 3], this
}, slerp: function (W, L) {
if (0 === L) return this;
if (1 === L) return this.copy(W);
var c = this._x,
Z = this._y,
p = this._z,
E = this._w,
O = E * W._w + c * W._x + Z * W._y + p * W._z;
if (0 > O ? (this._w = -W._w, this._x = -W._x, this._y = -W._y, this._z = -W._z, O = -O) : this.copy(W), O >= 1) return this._w = E, this._x = c, this._y = Z, this._z = p, this;
var G = Math.sqrt(1 - O * O);
if (Math.abs(G) < .001) return this._w = .5 * (E + this._w), this._x = .5 * (c + this._x), this._y = .5 * (Z + this._y), this._z = .5 * (p + this._z), this;
var _ = Math.atan2(G, O),
Q = Math.sin((1 - L) * _) / G,
v = Math.sin(L * _) / G;
return this._w = E * Q + this._w * v, this._x = c * Q + this._x * v, this._y = Z * Q + this._y * v, this._z = p * Q + this._z * v, this
}, setFromAxisAngle: function (r, B) {
var W = B / 2,
A = Math.sin(W);
return this._x = r.x * A, this._y = r.y * A, this._z = r.z * A, this._w = Math.cos(W), this
}, setFromEuler: function (m) {
var R = m._x,
C = m._y,
y = m._z,
v = m._order,
B = Math.cos,
g = Math.sin,
E = B(R / 2),
Z = B(C / 2),
w = B(y / 2),
T = g(R / 2),
u = g(C / 2),
r = g(y / 2);
return "XYZ" === v ? (this._x = T * Z * w + E * u * r, this._y = E * u * w - T * Z * r, this._z = E * Z * r + T * u * w, this._w = E * Z * w - T * u * r) : "YXZ" === v ? (this._x = T * Z * w + E * u * r, this._y = E * u * w - T * Z * r, this._z = E * Z * r - T * u * w, this._w = E * Z * w + T * u * r) : "ZXY" === v ? (this._x = T * Z * w - E * u * r, this._y = E * u * w + T * Z * r, this._z = E * Z * r + T * u * w, this._w = E * Z * w - T * u * r) : "ZYX" === v ? (this._x = T * Z * w - E * u * r, this._y = E * u * w + T * Z * r, this._z = E * Z * r - T * u * w, this._w = E * Z * w + T * u * r) : "YZX" === v ? (this._x = T * Z * w + E * u * r, this._y = E * u * w + T * Z * r, this._z = E * Z * r - T * u * w, this._w = E * Z * w - T * u * r) : "XZY" === v && (this._x = T * Z * w - E * u * r, this._y = E * u * w - T * Z * r, this._z = E * Z * r + T * u * w, this._w = E * Z * w + T * u * r), this
}, setFromRotationMatrix: function (m) {
var S, k = m.el,
t = k[0],
Z = k[4],
F = k[8],
G = k[1],
$ = k[5],
W = k[9],
R = k[2],
Q = k[6],
x = k[10],
A = t + $ + x;
return A > 0 ? (S = .5 / Math.sqrt(A + 1), this._w = .25 / S, this._x = (Q - W) * S, this._y = (F - R) * S, this._z = (G - Z) * S) : t > $ && t > x ? (S = 2 * Math.sqrt(1 + t - $ - x), this._w = (Q - W) / S, this._x = .25 * S, this._y = (Z + G) / S, this._z = (F + R) / S) : $ > x ? (S = 2 * Math.sqrt(1 + $ - t - x), this._w = (F - R) / S, this._x = (Z + G) / S, this._y = .25 * S, this._z = (W + Q) / S) : (S = 2 * Math.sqrt(1 + x - t - $), this._w = (G - Z) / S, this._x = (F + R) / S, this._y = (W + Q) / S, this._z = .25 * S), this
}, setFromToVectors: function () {
var a, w;
return function (d, M) {
return a === Z && (a = new tl), w = d.dot(M) + 1, 1e-7 > w ? (w = 0, Math.abs(d.x) > Math.abs(d.z) ? a.set(-d.y, d.x, 0) : a.set(0, -d.z, d.y)) : a.crossVectors(d, M), this._x = a.x, this._y = a.y, this._z = a.z, this._w = w, this.normalize()
}
}(),
setFromUnitVectors: function () {
var P, Q, h = 1e-6;
return function (g, u) {
return P === Z && (P = new tl), Q = g.dot(u) + 1, h > Q ? (Q = 0, Math.abs(g.x) > Math.abs(g.z) ? P.set(-g.y, g.x, 0) : P.set(0, -g.z, g.y)) : P.crossVectors(g, u), this._x = P.x, this._y = P.y, this._z = P.z, this._w = Q, this.normalize()
}
}(),
multiply: function (S) {
return this.multiplyQuaternions(this, S)
}, premultiply: function (k) {
return this.multiplyQuaternions(k, this)
}, multiplyQuaternions: function (y, W) {
var z = y._x,
L = y._y,
r = y._z,
N = y._w,
o = W._x,
p = W._y,
O = W._z,
Y = W._w;
return this._x = z * Y + N * o + L * O - r * p, this._y = L * Y + N * p + r * o - z * O, this._z = r * Y + N * O + z * p - L * o, this._w = N * Y - z * o - L * p - r * O, this
}
});
var ye = O.Math.Vector4 = function (F, H, L, N) {
this.x = F || 0, this.y = H || 0, this.z = L || 0, this.w = N !== Z ? N : 1
};
o.assign(ye.prototype, {
isVector4: !0,
set: function (r, B, R, s) {
return this.x = r, this.y = B, this.z = R, this.w = s, this
}, setScalar: function (R) {
return this.x = R, this.y = R, this.z = R, this.w = R, this
}, setX: function (F) {
return this.x = F, this
}, setY: function (b) {
return this.y = b, this
}, setZ: function (R) {
return this.z = R, this
}, setW: function (r) {
return this.w = r, this
}, setComponent: function (N, V) {
switch (N) {
case 0:
this.x = V;
break;
case 1:
this.y = V;
break;
case 2:
this.z = V;
break;
case 3:
this.w = V;
break;
default:
throw new Error("index is out of range: " + N)
}
return this
}, getComponent: function (y) {
switch (y) {
case 0:
return this.x;
case 1:
return this.y;
case 2:
return this.z;
case 3:
return this.w;
default:
throw new Error("index is out of range: " + y)
}
}, clone: function () {
return new this.constructor(this.x, this.y, this.z, this.w)
}, copy: function (i) {
return this.x = i.x, this.y = i.y, this.z = i.z, this.w = i.w !== Z ? i.w : 1, this
}, add: function (S, $) {
return $ !== Z ? this.addVectors(S, $) : (this.x += S.x, this.y += S.y, this.z += S.z, this.w += S.w, this)
}, addScalar: function (d) {
return this.x += d, this.y += d, this.z += d, this.w += d, this
}, addVectors: function (J, D) {
return this.x = J.x + D.x, this.y = J.y + D.y, this.z = J.z + D.z, this.w = J.w + D.w, this
}, addScaledVector: function (v, d) {
return this.x += v.x * d, this.y += v.y * d, this.z += v.z * d, this.w += v.w * d, this
}, sub: function (k, l) {
return l !== Z ? this.subVectors(k, l) : (this.x -= k.x, this.y -= k.y, this.z -= k.z, this.w -= k.w, this)
}, subScalar: function (f) {
return this.x -= f, this.y -= f, this.z -= f, this.w -= f, this
}, subVectors: function ($, y) {
return this.x = $.x - y.x, this.y = $.y - y.y, this.z = $.z - y.z, this.w = $.w - y.w, this
}, multiplyScalar: function (m) {
return this.x *= m, this.y *= m, this.z *= m, this.w *= m, this
}, applyMatrix4: function (M) {
var r = this.x,
o = this.y,
v = this.z,
X = this.w,
E = M.el;
return this.x = E[0] * r + E[4] * o + E[8] * v + E[12] * X, this.y = E[1] * r + E[5] * o + E[9] * v + E[13] * X, this.z = E[2] * r + E[6] * o + E[10] * v + E[14] * X, this.w = E[3] * r + E[7] * o + E[11] * v + E[15] * X, this
}, divideScalar: function (O) {
return this.multiplyScalar(1 / O)
}, setAxisAngleFromQuaternion: function (p) {
this.w = 2 * Math.acos(p.w);
var z = Math.sqrt(1 - p.w * p.w);
return 1e-4 > z ? (this.x = 1, this.y = 0, this.z = 0) : (this.x = p.x / z, this.y = p.y / z, this.z = p.z / z), this
}, setAxisAngleFromRotationMatrix: function (c) {
var S, z, k, _, i = .01,
I = .1,
u = c.el,
P = u[0],
g = u[4],
L = u[8],
o = u[1],
f = u[5],
X = u[9],
s = u[2],
x = u[6],
q = u[10];
if (Math.abs(g - o) < i && Math.abs(L - s) < i && Math.abs(X - x) < i) {
if (Math.abs(g + o) < I && Math.abs(L + s) < I && Math.abs(X + x) < I && Math.abs(P + f + q - 3) < I) return this.set(1, 0, 0, 0), this;
S = Math.PI;
var $ = (P + 1) / 2,
W = (f + 1) / 2,
C = (q + 1) / 2,
Y = (g + o) / 4,
H = (L + s) / 4,
T = (X + x) / 4;
return $ > W && $ > C ? i > $ ? (z = 0, k = .707106781, _ = .707106781) : (z = Math.sqrt($), k = Y / z, _ = H / z) : W > C ? i > W ? (z = .707106781, k = 0, _ = .707106781) : (k = Math.sqrt(W), z = Y / k, _ = T / k) : i > C ? (z = .707106781, k = .707106781, _ = 0) : (_ = Math.sqrt(C), z = H / _, k = T / _), this.set(z, k, _, S), this
}
var M = Math.sqrt((x - X) * (x - X) + (L - s) * (L - s) + (o - g) * (o - g));
return Math.abs(M) < .001 && (M = 1), this.x = (x - X) / M, this.y = (L - s) / M, this.z = (o - g) / M, this.w = Math.acos((P + f + q - 1) / 2), this
}, min: function (Y) {
return this.x = Math.min(this.x, Y.x), this.y = Math.min(this.y, Y.y), this.z = Math.min(this.z, Y.z), this.w = Math.min(this.w, Y.w), this
}, max: function (f) {
return this.x = Math.max(this.x, f.x), this.y = Math.max(this.y, f.y), this.z = Math.max(this.z, f.z), this.w = Math.max(this.w, f.w), this
}, clamp: function (k, j) {
return this.x = Math.max(k.x, Math.min(j.x, this.x)), this.y = Math.max(k.y, Math.min(j.y, this.y)), this.z = Math.max(k.z, Math.min(j.z, this.z)), this.w = Math.max(k.w, Math.min(j.w, this.w)), this
}, clampScalar: function () {
var v, L;
return function (k, m) {
return v === Z && (v = new ye, L = new ye), v.set(k, k, k, k), L.set(m, m, m, m), this.clamp(v, L)
}
}(),
clampLength: function (r, I) {
var R = this.length();
return this.divideScalar(R || 1).multiplyScalar(Math.max(r, Math.min(I, R)))
}, floor: function () {
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this.w = Math.floor(this.w), this
}, ceil: function () {
return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this.w = Math.ceil(this.w), this
}, round: function () {
return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this.w = Math.round(this.w), this
}, roundToZero: function () {
return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y), this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z), this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w), this
}, negate: function () {
return this.x = -this.x, this.y = -this.y, this.z = -this.z, this.w = -this.w, this
}, dot: function (H) {
return this.x * H.x + this.y * H.y + this.z * H.z + this.w * H.w
}, lengthSq: function () {
return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
}, length: function () {
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
}, manhattanLength: function () {
return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
}, normalize: function () {
return this.divideScalar(this.length() || 1)
}, setLength: function (h) {
return this.normalize().multiplyScalar(h)
}, lerp: function (I, X) {
return this.x += (I.x - this.x) * X, this.y += (I.y - this.y) * X, this.z += (I.z - this.z) * X, this.w += (I.w - this.w) * X, this
}, lerpVectors: function (W, j, q) {
return this.subVectors(j, W).multiplyScalar(q).add(W)
}, equals: function (O) {
return O.x === this.x && O.y === this.y && O.z === this.z && O.w === this.w
}, fromArray: function (E, c) {
return c === Z && (c = 0), this.x = E[c], this.y = E[c + 1], this.z = E[c + 2], this.w = E[c + 3], this
}, toArray: function (K, E) {
return K === Z && (K = []), E === Z && (E = 0), K[E] = this.x, K[E + 1] = this.y, K[E + 2] = this.z, K[E + 3] = this.w, K
}, fromBufferAttribute: function (O, S) {
return this.x = O.getX(S), this.y = O.getY(S), this.z = O.getZ(S), this.w = O.getW(S), this
}
});
var tl = O.Math.Vector3 = function (F, m, V) {
F === Z ? (this.x = 0, this.y = 0, this.z = 0) : "object" == typeof F ? this.copy(F) : this.set(F, m == Z ? F : m, V == Z ? F : V)
};
o.assign(tl.prototype, {
isNaN: function () {
return isNaN(this.x) || isNaN(this.y) || isNaN(this.z)
}, set: function (T, g, X) {
return this.x = T, this.y = g, this.z = X, this
}, equals: function (C) {
return C && this.x === C.x && this.y === C.y && this.z === C.z
}, setScalar: function (A) {
return this.x = A, this.y = A, this.z = A, this
}, setX: function (e) {
return this.x = e, this
}, setY: function (X) {
return this.y = X, this
}, setZ: function (s) {
return this.z = s, this
}, clone: function () {
return new this.constructor(this.x, this.y, this.z)
}, copy: function (U) {
return U.x === Z ? (this.x = U[0], this.y = U[1], this.z = U[2]) : (this.x = U.x, this.y = U.y, this.z = U.z || 0), this
}, add: function (i) {
return this.x += i.x, this.y += i.y, this.z += i.z, this
}, addScalar: function (E) {
return this.x += E, this.y += E, this.z += E, this
}, addVectors: function (n, b) {
return this.x = n.x + b.x, this.y = n.y + b.y, this.z = n.z + b.z, this
}, addScaledVector: function (t, p) {
return this.x += t.x * p, this.y += t.y * p, this.z += t.z * p, this
}, sub: function (k) {
return this.x -= k.x, this.y -= k.y, this.z -= k.z, this
}, subScalar: function (X) {
return this.x -= X, this.y -= X, this.z -= X, this
}, subVectors: function (x, $) {
return this.x = x.x - $.x, this.y = x.y - $.y, this.z = x.z - $.z, this
}, divide: function (A) {
return this.x /= A.x, this.y /= A.y, this.z /= A.z, this
}, multiply: function (K) {
return this.x *= K.x, this.y *= K.y, this.z *= K.z, this
}, multiplyScalar: function (m) {
return this.x *= m, this.y *= m, this.z *= m, this
}, distanceTo: function (i) {
return Math.sqrt(this.distanceToSquared(i))
}, distanceToSquared: function (m) {
var i = this.x - m.x,
Z = this.y - m.y,
G = this.z - m.z;
return i * i + Z * Z + G * G
}, distanceToSquared2: function (f) {
var h = this.x - f[0],
Z = this.y - f[1],
J = this.z - f[2];
return h * h + Z * Z + J * J
}, divideVectors: function (X, M) {
return this.x = X.x / M.x, this.y = X.y / M.y, this.z = X.z / M.z, this
}, multiplyVectors: function (Z, H) {
return this.x = Z.x * H.x, this.y = Z.y * H.y, this.z = Z.z * H.z, this
}, transformDirection: function (L) {
var G = this.x,
i = this.y,
Y = this.z,
m = L.el;
return this.x = m[0] * G + m[4] * i + m[8] * Y, this.y = m[1] * G + m[5] * i + m[9] * Y, this.z = m[2] * G + m[6] * i + m[10] * Y, this.normalize()
}, applyAxisAngle: function () {
var i = new fs;
return function (Q, u) {
return this.applyQuaternion(i.setFromAxisAngle(Q, u))
}
}(),
applyEuler: function () {
var n = new fs;
return function (M) {
return this.applyQuaternion(n.setFromEuler(M))
}
}(),
applyQuaternion: function (C) {
var X = this.x,
h = this.y,
l = this.z,
P = C._x,
o = C._y,
R = C._z,
d = C._w,
q = d * X + o * l - R * h,
i = d * h + R * X - P * l,
z = d * l + P * h - o * X,
j = -P * X - o * h - R * l;
return this.x = q * d + j * -P + i * -R - z * -o, this.y = i * d + j * -o + z * -P - q * -R, this.z = z * d + j * -R + q * -o - i * -P, this
}, applyMatrix4: function (l) {
var v = this.x,
C = this.y,
W = this.z,
R = l.el,
K = 1 / (R[3] * v + R[7] * C + R[11] * W + R[15]);
return this.x = (R[0] * v + R[4] * C + R[8] * W + R[12]) * K, this.y = (R[1] * v + R[5] * C + R[9] * W + R[13]) * K, this.z = (R[2] * v + R[6] * C + R[10] * W + R[14]) * K, this
}, applyMatrix3: function (q) {
var K = this.x,
I = this.y,
U = this.z,
J = q.el;
return this.x = J[0] * K + J[3] * I + J[6] * U, this.y = J[1] * K + J[4] * I + J[7] * U, this.z = J[2] * K + J[5] * I + J[8] * U, this
}, negate: function () {
return this.x = -this.x, this.y = -this.y, this.z = -this.z, this
}, reflect: function () {
var F = new tl;
return function (w) {
return this.sub(F.copy(w).multiplyScalar(2 * this.dot(w)))
}
}(),
dot: function (P) {
return this.x * P.x + this.y * P.y + this.z * P.z
}, lengthSq: function () {
return this.x * this.x + this.y * this.y + this.z * this.z
}, length: function () {
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
}, manhattanLength: function () {
return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
}, normalize: function () {
var W = this.length();
return W ? this.multiplyScalar(1 / W) : this
}, setLength: function (G) {
return this.normalize().multiplyScalar(G)
}, fromArray: function (v, O) {
return O === Z && (O = 0), this.x = v[O], this.y = v[O + 1], this.z = v[O + 2], this
}, toArray: function (R, X) {
return R === Z && (R = [0, 0, 0]), X === Z && (X = 0), R[X] = this.x, R[X + 1] = this.y, R[X + 2] = this.z, R
}, cross: function (M) {
return this.crossVectors(this, M)
}, angleTo: function (t) {
var j = this.dot(t) / Math.sqrt(this.lengthSq() * t.lengthSq());
return j > 1 || -1 > j ? 0 : Math.acos(j)
}, lerp: function (Z, J) {
return this.x += (Z.x - this.x) * J, this.y += (Z.y - this.y) * J, this.z += (Z.z - this.z) * J, this
}, lerpVectors: function (E, K, y) {
return this.subVectors(K, E).multiplyScalar(y).add(E)
}, crossVectors: function (q, O) {
var R = q.x,
H = q.y,
C = q.z,
F = O.x,
z = O.y,
L = O.z;
return this.x = H * L - C * z, this.y = C * F - R * L, this.z = R * z - H * F, this
}, min: function (J) {
return this.x = Math.min(this.x, J.x), this.y = Math.min(this.y, J.y), this.z = Math.min(this.z, J.z), this
}, max: function (W) {
return this.x = Math.max(this.x, W.x), this.y = Math.max(this.y, W.y), this.z = Math.max(this.z, W.z), this
}, setFromMatrixPosition: function (F) {
return this.setFromMatrixColumn(F, 3)
}, setFromMatrixScale: function (K) {
var y = this.setFromMatrixColumn(K, 0).length(),
s = this.setFromMatrixColumn(K, 1).length(),
f = this.setFromMatrixColumn(K, 2).length();
return this.x = y, this.y = s, this.z = f, this
}, setFromMatrixColumn: function (r, q) {
return this.fromArray(r.el, 4 * q)
}
});
var Xi = O.Math.Vector2 = function (C, P, G) {
"object" == typeof C && (C.x != Z ? (P = C.y, C = C.x, G = C.e) : (G = C[2], P = C[1], C = C[0])), this.set(C || 0, P || 0, G)
};
Xi.prototype = {}, Xi.prototype.constructor = Xi, o.defineProperties(Xi.prototype, {
width: {
get: function () {
return this.x
}, set: function (p) {
this.x = p
}
},
height: {
get: function () {
return this.y
}, set: function (W) {
this.y = W
}
}
}), Xi.prototype.clone = function () {
return new Xi(this.x, this.y, this.e)
}, Xi.prototype.copy = function (I) {
return this.set(I.x, I.y, I.e), this
}, Xi.prototype.equals = function (R) {
return R.x === this.x && R.y === this.y
}, Xi.prototype.set = function (U, w, D) {
return this.x = U || 0, this.y = w || (0 !== w ? this.x : 0), D != Z && (this.e = D), this
}, Xi.prototype.setScalar = function (y) {
return this.x = y, this.y = y, this
}, Xi.prototype.setX = function (b) {
return this.x = b || 0, this
}, Xi.prototype.setY = function (A) {
return this.y = A || 0, this
}, Xi.prototype.add = function (S) {
return this.x += S.x, this.y += S.y, this
}, Xi.prototype.addVectors = function (M, B) {
return this.x = M.x + B.x, this.y = M.y + B.y, this
}, Xi.prototype.addScalar = function (X) {
return this.x += X, this.y += X, this
}, Xi.prototype.addScaledVector = function (o, p) {
return this.x += o.x * p, this.y += o.y * p, this
}, Xi.prototype.sub = function (a) {
return this.x -= a.x, this.y -= a.y, this
}, Xi.prototype.subScalar = function (r) {
return this.x -= r, this.y -= r, this
}, Xi.prototype.subVectors = function (U, H) {
return this.x = U.x - H.x, this.y = U.y - H.y, this
}, Xi.prototype.multiply = function (k) {
return this.x *= k.x, this.y *= k.y, this
}, Xi.prototype.multiplyScalar = function (x) {
return this.x *= x, this.y *= x, this
}, Xi.prototype.divide = function (K) {
return this.x /= K.x, this.y /= K.y, this
}, Xi.prototype.divideScalar = function (H) {
return this.multiplyScalar(1 / H)
}, Xi.prototype.min = function (M) {
return this.x = Math.min(this.x, M.x), this.y = Math.min(this.y, M.y), this
}, Xi.prototype.max = function (Q) {
return this.x = Math.max(this.x, Q.x), this.y = Math.max(this.y, Q.y), this
}, Xi.prototype.fromArray = function (Y, B) {
return B === Z && (B = 0), this.x = Y[B], this.y = Y[B + 1], this
}, Xi.prototype.clamp = function (o, f) {
return this.x = Math.max(o.x, Math.min(f.x, this.x)), this.y = Math.max(o.y, Math.min(f.y, this.y)), this
}, Xi.prototype.clampScalar = function () {
var e, c;
return function (m, _) {
return e === Z && (e = new Xi, c = new Xi), e.set(m, m), c.set(_, _), this.clamp(e, c)
}
}(), Xi.prototype.clampLength = function (e, c) {
var l = this.length();
return this.multiplyScalar(Math.max(e, Math.min(c, l)) / l)
}, Xi.prototype.dot = function (M) {
return this.x * M.x + this.y * M.y
}, Xi.prototype.lengthSq = function () {
return this.x * this.x + this.y * this.y
}, Xi.prototype.length = function () {
return Math.sqrt(this.x * this.x + this.y * this.y)
}, Xi.prototype.normalize = function () {
return this.divideScalar(this.length())
}, Xi.prototype.angle = function () {
var P = Math.atan2(this.y, this.x);
return 0 > P && (P += 2 * Math.PI), P
}, Xi.prototype.distanceTo = function ($) {
return Math.sqrt(this.distanceToSquared($))
}, Xi.prototype.distanceToSquared = function (F) {
var o = this.x - F.x,
v = this.y - F.y;
return o * o + v * v
}, Xi.prototype.isNearEnough = function (S) {
return this.distanceToSquared(S) < 1e-8
}, Xi.prototype.setLength = function (I) {
var l = this.length();
return l ? this.multiplyScalar(I / l) : this
}, Xi.prototype.lerp = function (u, p) {
return this.x += (u.x - this.x) * p, this.y += (u.y - this.y) * p, this
}, Xi.prototype.lerpVectors = function (E, Y, s) {
return this.subVectors(Y, E).multiplyScalar(s).add(E)
}, Xi.prototype.rotateAround = function (O, L) {
var q = O ? O.x : 0,
A = O ? O.y : 0,
F = Math.cos(L),
N = Math.sin(L),
a = this.x - q,
c = this.y - A;
return this.x = a * F - c * N + q, this.y = a * N + c * F + A, this
};
var sm = O.Math.Matrix3 = function () {
this.el = [1, 0, 0, 0, 1, 0, 0, 0, 1]
};
o.assign(sm.prototype, {
isMatrix3: !0,
set: function (W, D, A, V, T, U, f, $, I) {
var S = this.el;
return S[0] = W, S[1] = V, S[2] = f, S[3] = D, S[4] = T, S[5] = $, S[6] = A, S[7] = U, S[8] = I, this
}, identity: function () {
return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this
}, clone: function () {
return (new this.constructor).fromArray(this.el)
}, copy: function (S) {
var W = this.el,
H = S.el;
return W[0] = H[0], W[1] = H[1], W[2] = H[2], W[3] = H[3], W[4] = H[4], W[5] = H[5], W[6] = H[6], W[7] = H[7], W[8] = H[8], this
}, setFromMatrix4: function (P) {
var M = P.el;
return this.set(M[0], M[4], M[8], M[1], M[5], M[9], M[2], M[6], M[10]), this
}, applyToBufferAttribute: function () {
var N = new tl;
return function (U) {
for (var b = 0, j = U.count; j > b; b++) N.x = U.getX(b), N.y = U.getY(b), N.z = U.getZ(b), N.applyMatrix3(this), U.setXYZ(b, N.x, N.y, N.z);
return U
}
}(),
multiply: function (A) {
return this.multiplyMatrices(this, A)
}, premultiply: function (K) {
return this.multiplyMatrices(K, this)
}, multiplyMatrices: function (B, t) {
var r = B.el,
A = t.el,
W = this.el,
N = r[0],
C = r[3],
S = r[6],
o = r[1],
l = r[4],
X = r[7],
F = r[2],
P = r[5],
j = r[8],
D = A[0],
T = A[3],
J = A[6],
e = A[1],
k = A[4],
R = A[7],
s = A[2],
Q = A[5],
v = A[8];
return W[0] = N * D + C * e + S * s, W[3] = N * T + C * k + S * Q, W[6] = N * J + C * R + S * v, W[1] = o * D + l * e + X * s, W[4] = o * T + l * k + X * Q, W[7] = o * J + l * R + X * v, W[2] = F * D + P * e + j * s, W[5] = F * T + P * k + j * Q, W[8] = F * J + P * R + j * v, this
}, multiplyScalar: function (v) {
var p = this.el;
return p[0] *= v, p[3] *= v, p[6] *= v, p[1] *= v, p[4] *= v, p[7] *= v, p[2] *= v, p[5] *= v, p[8] *= v, this
}, determinant: function () {
var j = this.el,
l = j[0],
q = j[1],
B = j[2],
n = j[3],
t = j[4],
s = j[5],
N = j[6],
H = j[7],
m = j[8];
return l * t * m - l * s * H - q * n * m + q * s * N + B * n * H - B * t * N
}, getInverse: function (t) {
var L = t.el,
M = this.el,
f = L[0],
D = L[1],
i = L[2],
S = L[3],
E = L[4],
Q = L[5],
o = L[6],
j = L[7],
c = L[8],
B = c * E - Q * j,
w = Q * o - c * S,
N = j * S - E * o,
K = f * B + D * w + i * N;
if (0 === K) return this.identity();
var F = 1 / K;
return M[0] = B * F, M[1] = (i * j - c * D) * F, M[2] = (Q * D - i * E) * F, M[3] = w * F, M[4] = (c * f - i * o) * F, M[5] = (i * S - Q * f) * F, M[6] = N * F, M[7] = (D * o - j * f) * F, M[8] = (E * f - D * S) * F, this
}, transpose: function () {
var H, $ = this.el;
return H = $[1], $[1] = $[3], $[3] = H, H = $[2], $[2] = $[6], $[6] = H, H = $[5], $[5] = $[7], $[7] = H, this
}, getNormalMatrix: function (w) {
return this.setFromMatrix4(w).getInverse(this).transpose()
}, transposeIntoArray: function (v) {
var B = this.el;
return v[0] = B[0], v[1] = B[3], v[2] = B[6], v[3] = B[1], v[4] = B[4], v[5] = B[7], v[6] = B[2], v[7] = B[5], v[8] = B[8], this
}, setUvTransform: function (r, H, h, R, f, K, P) {
var i = Math.cos(f),
Y = Math.sin(f);
this.set(h * i, h * Y, -h * (i * K + Y * P) + K + r, -R * Y, R * i, -R * (-Y * K + i * P) + P + H, 0, 0, 1)
}, scale: function (p, g) {
var H = this.el;
return H[0] *= p, H[3] *= p, H[6] *= p, H[1] *= g, H[4] *= g, H[7] *= g, this
}, rotate: function (W) {
var R = Math.cos(W),
J = Math.sin(W),
r = this.el,
g = r[0],
O = r[3],
Y = r[6],
w = r[1],
c = r[4],
_ = r[7];
return r[0] = R * g + J * w, r[3] = R * O + J * c, r[6] = R * Y + J * _, r[1] = -J * g + R * w, r[4] = -J * O + R * c, r[7] = -J * Y + R * _, this
}, translate: function (t, M) {
var o = this.el;
return o[0] += t * o[2], o[3] += t * o[5], o[6] += t * o[8], o[1] += M * o[2], o[4] += M * o[5], o[7] += M * o[8], this
}, equals: function (z) {
for (var M = this.el, Q = z.el, V = 0; 9 > V; V++)
if (M[V] !== Q[V]) return !1;
return !0
}, fromArray: function (X, J) {
J === Z && (J = 0);
for (var j = 0; 9 > j; j++) this.el[j] = X[j + J];
return this
}, toArray: function (D, A) {
D === Z && (D = []), A === Z && (A = 0);
var P = this.el;
return D[A] = P[0], D[A + 1] = P[1], D[A + 2] = P[2], D[A + 3] = P[3], D[A + 4] = P[4], D[A + 5] = P[5], D[A + 6] = P[6], D[A + 7] = P[7], D[A + 8] = P[8], D
}
});
var Io = O.Math.Plane = function (s, S) {
this.normal = s !== Z ? s : new tl(1, 0, 0), this.constant = S !== Z ? S : 0
};
o.assign(Io.prototype, {
set: function (L, G) {
return this.normal.copy(L), this.constant = G, this
}, setComponents: function (D, S, E, C) {
return this.normal.set(D, S, E), this.constant = C, this
}, setFromNormalAndCoplanarPoint: function (O, e) {
return this.normal.copy(O), this.constant = -e.dot(this.normal), this
}, setFromCoplanarPoints: function () {
var v = new tl,
c = new tl;
return function (Q, e, o) {
var j = v.subVectors(o, e).cross(c.subVectors(Q, e)).normalize();
return this.setFromNormalAndCoplanarPoint(j, Q), this
}
}(),
clone: function () {
return (new this.constructor).copy(this)
}, copy: function (h) {
return this.normal.copy(h.normal), this.constant = h.constant, this
}, normalize: function () {
var V = 1 / this.normal.length();
return this.normal.multiplyScalar(V), this.constant *= V, this
}, negate: function () {
return this.constant *= -1, this.normal.negate(), this
}, distanceToPoint: function (Q) {
return this.normal.dot(Q) + this.constant
}, distanceToSphere: function (r) {
return this.distanceToPoint(r.center) - r.radius
}, projectPoint: function (X, R) {
return R === Z && (R = new tl), R.copy(this.normal).multiplyScalar(-this.distanceToPoint(X)).add(X)
}, intersectLine: function () {
var s = new tl;
return function (r, R) {
R === Z && (R = new tl);
var j = r.delta(s),
L = this.normal.dot(j);
if (0 === L) return 0 === this.distanceToPoint(r.start) ? R.copy(r.start) : Z;
var V = -(r.start.dot(this.normal) + this.constant) / L;
return 0 > V || V > 1 ? Z : R.copy(j).multiplyScalar(V).add(r.start)
}
}(),
intersectsLine: function (D) {
var x = this.distanceToPoint(D.start),
r = this.distanceToPoint(D.end);
return 0 > x && r > 0 || 0 > r && x > 0
}, intersectsBox: function (K) {
return K.intersectsPlane(this)
}, intersectsSphere: function (L) {
return L.intersectsPlane(this)
}, coplanarPoint: function (V) {
return V === Z && (V = new tl), V.copy(this.normal).multiplyScalar(-this.constant)
}, applyMatrix4: function () {
var C = new tl,
i = new sm;
return function (X, N) {
var $ = N || i.getNormalMatrix(X),
R = this.coplanarPoint(C).applyMatrix4(X),
j = this.normal.applyMatrix3($).normalize();
return this.constant = -R.dot(j), this
}
}(),
translate: function (Y) {
return this.constant -= Y.dot(this.normal), this
}, equals: function (v) {
return v.normal.equals(this.normal) && v.constant === this.constant
}
});
var Qi = O.Math.Ray = function (I, V) {
this.origin = I !== Z ? I.clone() : new tl, this.direction = V !== Z ? V.clone() : new tl
};
o.assign(Qi.prototype, {
set: function (K, n) {
return this.origin.copy(K), this.direction.copy(n), this
}, clone: function () {
return (new this.constructor).copy(this)
}, copy: function (T) {
return this.origin.copy(T.origin), this.direction.copy(T.direction), this.maxHitLen = T.maxHitLen, this
}, at: function (n, r) {
var I = r || new tl;
return I.copy(this.direction).multiplyScalar(n).add(this.origin)
}, setMaxHitLength: function ($) {
this.maxHitLen = $
}, lookAt: function (o) {
return this.direction.copy(o).sub(this.origin).normalize(), this
}, applyMatrix4: function (U) {
var i = this.maxHitLen;
if (i) {
var L = this.direction.clone().multiplyScalar(i).add(this.origin);
L.applyMatrix4(U)
}
return this.origin.applyMatrix4(U), this.direction.transformDirection(U), i && (this.maxHitLen = this.origin.distanceTo(L)), this
}, intersectSphere: function () {
var s = new tl;
return function (h, K) {
s.subVectors(h.center, this.origin);
var m = s.dot(this.direction),
T = s.dot(s) - m * m,
I = h.radius * h.radius;
if (T > I) return null;
var i = Math.sqrt(I - T),
Y = m - i,
y = m + i;
return 0 > Y && 0 > y ? null : 0 > Y ? this.at(y, K) : this.at(Y, K)
}
}(),
intersectEllipsoid: function () {
var P = new tl,
A = new tl;
return function (s, i) {
P.subVectors(s.center, this.origin), P.divide(s.radius), A.divideVectors(this.direction, s.radius);
var J = A.lengthSq(),
I = P.dot(A),
r = P.dot(P) * J - I * I;
if (r > J) return null;
var H = Math.sqrt(J - r),
l = (I - H) / J,
U = (I + H) / J;
return 0 > l && 0 > U ? null : 0 > l ? this.at(U, i) : this.at(l, i)
}
}(),
intersectBox: function (P, y) {
var T, M, t, w, Q, q, e = 1 / this.direction.x,
$ = 1 / this.direction.y,
u = 1 / this.direction.z,
z = this.origin;
if (e >= 0 ? (T = (P.min.x - z.x) * e, M = (P.max.x - z.x) * e) : (T = (P.max.x - z.x) * e, M = (P.min.x - z.x) * e), $ >= 0 ? (t = (P.min.y - z.y) * $, w = (P.max.y - z.y) * $) : (t = (P.max.y - z.y) * $, w = (P.min.y - z.y) * $), T > w || t > M) return null;
if ((t > T || T !== T) && (T = t), (M > w || M !== M) && (M = w), u >= 0 ? (Q = (P.min.z - z.z) * u, q = (P.max.z - z.z) * u) : (Q = (P.max.z - z.z) * u, q = (P.min.z - z.z) * u), T > q || Q > M) return null;
if ((Q > T || T !== T) && (T = Q), (M > q || M !== M) && (M = q), 0 > M) return null;
var c = T >= 0 ? T : M,
o = this.maxHitLen;
return o && c > o ? null : this.at(c, y)
}, intersectTriangle: function () {
var D = new tl,
L = new tl,
n = new tl,
H = new tl;
return function (E, u, s, d, x) {
L.subVectors(u, E), n.subVectors(s, E), H.crossVectors(L, n);
var w, b = this.direction.dot(H);
if (b > 0) {
if (d) return null;
w = 1
} else {
if (!(0 > b)) return null;
w = -1, b = -b
}
D.subVectors(this.origin, E);
var B = w * this.direction.dot(n.crossVectors(D, n));
if (0 > B) return null;
var M = w * this.direction.dot(L.cross(D));
if (0 > M || B + M > b) return null;
var y = -w * D.dot(H);
if (0 > y) return null;
var z = y / b,
p = this.maxHitLen;
return p && z > p ? null : this.at(z, x)
}
}()
});
var Hi = O.Math.Box3 = function (i, V) {
this.min = i !== Z ? i : new tl(1 / 0, 1 / 0, 1 / 0), this.max = V !== Z ? V : new tl(-1 / 0, -1 / 0, -1 / 0)
};
o.assign(Hi.prototype, {
set: function (E, p) {
return this.min.copy(E), this.max.copy(p), this
}, setFromArray: function ($) {
for (var n = 1 / 0, P = 1 / 0, L = 1 / 0, V = -1 / 0, l = -1 / 0, Y = -1 / 0, v = 0, D = $.length; D > v; v += 3) {
var u = $[v],
T = $[v + 1],
Q = $[v + 2];
n > u && (n = u), P > T && (P = T), L > Q && (L = Q), u > V && (V = u), T > l && (l = T), Q > Y && (Y = Q)
}
return this.min.set(n, P, L), this.max.set(V, l, Y), this
}, setFromPoints: function (p) {
this.makeEmpty();
for (var D = 0, O = p.length; O > D; D++) this.expandByPoint(p[D]);
return this
}, clone: function () {
return (new this.constructor).copy(this)
}, intersectsBox: function (f) {
return f.max.x < this.min.x || f.min.x > this.max.x || f.max.y < this.min.y || f.min.y > this.max.y || f.max.z < this.min.z || f.min.z > this.max.z ? !1 : !0
}, copy: function (O) {
return this.min.copy(O.min), this.max.copy(O.max), this
}, makeEmpty: function () {
return this.min.x = this.min.y = this.min.z = 1 / 0, this.max.x = this.max.y = this.max.z = -1 / 0, this
}, isEmpty: function () {
return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
}, expandByPoint: function (Y) {
return this.min.min(Y), this.max.max(Y), this
}, expandByBox: function (p) {
return this.min.min(p.min), this.max.max(p.max), this
}, applyMatrix4: function () {
var w = [new tl, new tl, new tl, new tl, new tl, new tl, new tl, new tl];
return function (a) {
return this.isEmpty() ? this : (w[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(a), w[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(a), w[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(a), w[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(a), w[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(a), w[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(a), w[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(a), w[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(a), this.setFromPoints(w), this)
}
}()
});
var Mk = O.Math.Sphere = function (V, v) {
this.center = V !== Z ? V : new tl, this.radius = v !== Z ? v : 0
};
o.assign(Mk.prototype, {
set: function (b, z) {
return this.center.copy(b), this.radius = z, this
}, setFromPoints: function () {
var d = new Hi;
return function (T, $) {
var V = this.center;
$ !== Z ? V.copy($) : d.setFromPoints(T).getCenter(V);
for (var M = 0, j = 0, H = T.length; H > j; j++) M = Math.max(M, V.distanceToSquared(T[j]));
return this.radius = Math.sqrt(M), this
}
}(),
clone: function () {
return (new this.constructor).copy(this)
}, copy: function (m) {
return this.center.copy(m.center), this.radius = m.radius, this
}, empty: function () {
return this.radius <= 0
}, containsPoint: function (Z) {
return Z.distanceToSquared(this.center) <= this.radius * this.radius
}, distanceToPoint: function (s) {
return s.distanceTo(this.center) - this.radius
}, intersectsSphere: function (y) {
var Z = this.radius + y.radius;
return y.center.distanceToSquared(this.center) <= Z * Z
}, intersectsBox: function (Y) {
return Y.intersectsSphere(this)
}, intersectsPlane: function ($) {
return Math.abs($.distanceToPoint(this.center)) <= this.radius
}, clampPoint: function (I, y) {
var L = this.center.distanceToSquared(I);
return y === Z && (y = new tl), y.copy(I), L > this.radius * this.radius && (y.sub(this.center).normalize(), y.multiplyScalar(this.radius).add(this.center)), y
}, getBoundingBox: function (X) {
return X === Z && (X = new Hi), X.set(this.center, this.center), X.expandByScalar(this.radius), X
}, applyMatrix4: function (L) {
return this.center.applyMatrix4(L), this.radius = this.radius * L.getMaxScaleOnAxis(), this
}, translate: function (A) {
return this.center.add(A), this
}, equals: function (j) {
return j.center.equals(this.center) && j.radius === this.radius
}
});
var Vc = O.Math.Frustum = function (H, F, B, J, r, Q) {
this.planes = [H !== Z ? H : new Io, F !== Z ? F : new Io, B !== Z ? B : new Io, J !== Z ? J : new Io, r !== Z ? r : new Io, Q !== Z ? Q : new Io]
};
o.assign(Vc.prototype, {
set: function (b, n, w, S, E, Z) {
var d = this.planes;
return d[0].copy(b), d[1].copy(n), d[2].copy(w), d[3].copy(S), d[4].copy(E), d[5].copy(Z), this
}, clone: function () {
return (new this.constructor).copy(this)
}, copy: function (y) {
for (var u = this.planes, g = 0; 6 > g; g++) u[g].copy(y.planes[g]);
return this
}, setFromMatrix: function (L) {
var Q = this.planes,
T = L.el,
u = T[0],
i = T[1],
E = T[2],
A = T[3],
U = T[4],
f = T[5],
c = T[6],
V = T[7],
G = T[8],
q = T[9],
r = T[10],
l = T[11],
J = T[12],
C = T[13],
Z = T[14],
h = T[15];
return Q[0].setComponents(A - u, V - U, l - G, h - J).normalize(), Q[1].setComponents(A + u, V + U, l + G, h + J).normalize(), Q[2].setComponents(A + i, V + f, l + q, h + C).normalize(), Q[3].setComponents(A - i, V - f, l - q, h - C).normalize(), Q[4].setComponents(A - E, V - c, l - r, h - Z).normalize(), Q[5].setComponents(A + E, V + c, l + r, h + Z).normalize(), this
}, intersectsObject: function () {
var Y = new Mk;
return function (o) {
var K = o.geometry;
return null === K.boundingSphere && K.computeBoundingSphere(), Y.copy(K.boundingSphere).applyMatrix4(o.matrixWorld), this.intersectsSphere(Y)
}
}(),
intersectsSprite: function () {
var K = new Mk;
return function (m) {
return K.center.set(0, 0, 0), K.radius = .7071067811865476, K.applyMatrix4(m.matrixWorld), this.intersectsSphere(K)
}
}(),
intersectsSphere: function (L) {
for (var v = this.planes, O = L.center, Q = -L.radius, s = 0; 6 > s; s++) {
var g = v[s].distanceToPoint(O);
if (Q > g) return !1
}
return !0
}, intersectsBox: function () {
var D = new tl;
return function (b) {
for (var Q = this.planes, I = 0; 6 > I; I++) {
var K = Q[I];
if (D.x = K.normal.x > 0 ? b.max.x : b.min.x, D.y = K.normal.y > 0 ? b.max.y : b.min.y, D.z = K.normal.z > 0 ? b.max.z : b.min.z, K.distanceToPoint(D) < 0) return !1
}
return !0
}
}(),
containsPoint: function ($) {
for (var c = this.planes, E = 0; 6 > E; E++)
if (c[E].distanceToPoint($) < 0) return !1;
return !0
}
});
var br = O.Math.Matrix4 = function () {
this.el = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
};
o.assign(br.prototype, {
set: function (j, F, t, K, Y, A, V, O, P, v, k, w, G, H, B, m) {
var x = this.el;
return x[0] = j, x[4] = F, x[8] = t, x[12] = K, x[1] = Y, x[5] = A, x[9] = V, x[13] = O, x[2] = P, x[6] = v, x[10] = k, x[14] = w, x[3] = G, x[7] = H, x[11] = B, x[15] = m, this
}, clone: function () {
return (new br).fromArray(this.el)
}, fromArray: function (c, Q) {
Q === Z && (Q = 0);
for (var n = this.el, v = 0; 16 > v; v++) n[v] = c[v + Q];
return this
}, getElements: function () {
return this.el
}, scale: function (w) {
var W = this.el,
H = w.x,
C = w.y,
b = w.z;
return W[0] *= H, W[4] *= C, W[8] *= b, W[1] *= H, W[5] *= C, W[9] *= b, W[2] *= H, W[6] *= C, W[10] *= b, W[3] *= H, W[7] *= C, W[11] *= b, this
}, makeRotationFromEuler: function (K) {
var D = this.el,
M = K._x,
R = K._y,
o = K._z,
X = K._order,
z = Math.cos(M),
I = Math.sin(M),
p = Math.cos(R),
l = Math.sin(R),
Z = Math.cos(o),
i = Math.sin(o);
if ("XYZ" === X) {
var m = z * Z,
r = z * i,
t = I * Z,
f = I * i;
D[0] = p * Z, D[4] = -p * i, D[8] = l, D[1] = r + t * l, D[5] = m - f * l, D[9] = -I * p, D[2] = f - m * l, D[6] = t + r * l, D[10] = z * p
} else if ("YXZ" === X) {
var n = p * Z,
b = p * i,
a = l * Z,
V = l * i;
D[0] = n + V * I, D[4] = a * I - b, D[8] = z * l, D[1] = z * i, D[5] = z * Z, D[9] = -I, D[2] = b * I - a, D[6] = V + n * I, D[10] = z * p
} else if ("ZXY" === X) {
var n = p * Z,
b = p * i,
a = l * Z,
V = l * i;
D[0] = n - V * I, D[4] = -z * i, D[8] = a + b * I, D[1] = b + a * I, D[5] = z * Z, D[9] = V - n * I, D[2] = -z * l, D[6] = I, D[10] = z * p
} else if ("ZYX" === X) {
var m = z * Z,
r = z * i,
t = I * Z,
f = I * i;
D[0] = p * Z, D[4] = t * l - r, D[8] = m * l + f, D[1] = p * i, D[5] = f * l + m, D[9] = r * l - t, D[2] = -l, D[6] = I * p, D[10] = z * p
} else if ("YZX" === X) {
var g = z * p,
T = z * l,
j = I * p,
G = I * l;
D[0] = p * Z, D[4] = G - g * i, D[8] = j * i + T, D[1] = i, D[5] = z * Z, D[9] = -I * Z, D[2] = -l * Z, D[6] = T * i + j, D[10] = g - G * i
} else if ("XZY" === X) {
var g = z * p,
T = z * l,
j = I * p,
G = I * l;
D[0] = p * Z, D[4] = -i, D[8] = l * Z, D[1] = g * i + G, D[5] = z * Z, D[9] = T * i - j, D[2] = j * i - T, D[6] = I * Z, D[10] = G * i + g
}
return D[3] = 0, D[7] = 0, D[11] = 0, D[12] = 0, D[13] = 0, D[14] = 0, D[15] = 1, this
}, makeRotationFromQuaternion: function (R) {
var Y = this.el,
U = R._x,
n = R._y,
S = R._z,
G = R._w,
$ = U + U,
K = n + n,
L = S + S,
F = U * $,
e = U * K,
c = U * L,
X = n * K,
q = n * L,
O = S * L,
w = G * $,
j = G * K,
s = G * L;
return Y[0] = 1 - (X + O), Y[4] = e - s, Y[8] = c + j, Y[1] = e + s, Y[5] = 1 - (F + O), Y[9] = q - w, Y[2] = c - j, Y[6] = q + w, Y[10] = 1 - (F + X), Y[3] = 0, Y[7] = 0, Y[11] = 0, Y[12] = 0, Y[13] = 0, Y[14] = 0, Y[15] = 1, this
}, identity: function () {
return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
}, getInverse: function (V) {
var D = this.el,
x = V.el,
k = x[0],
H = x[1],
R = x[2],
Y = x[3],
e = x[4],
v = x[5],
i = x[6],
M = x[7],
$ = x[8],
o = x[9],
y = x[10],
U = x[11],
p = x[12],
h = x[13],
Q = x[14],
u = x[15],
q = o * Q * M - h * y * M + h * i * U - v * Q * U - o * i * u + v * y * u,
K = p * y * M - $ * Q * M - p * i * U + e * Q * U + $ * i * u - e * y * u,
f = $ * h * M - p * o * M + p * v * U - e * h * U - $ * v * u + e * o * u,
w = p * o * i - $ * h * i - p * v * y + e * h * y + $ * v * Q - e * o * Q,
l = k * q + H * K + R * f + Y * w;
if (0 === l) return this.identity();
var r = 1 / l;
return D[0] = q * r, D[1] = (h * y * Y - o * Q * Y - h * R * U + H * Q * U + o * R * u - H * y * u) * r, D[2] = (v * Q * Y - h * i * Y + h * R * M - H * Q * M - v * R * u + H * i * u) * r, D[3] = (o * i * Y - v * y * Y - o * R * M + H * y * M + v * R * U - H * i * U) * r, D[4] = K * r, D[5] = ($ * Q * Y - p * y * Y + p * R * U - k * Q * U - $ * R * u + k * y * u) * r, D[6] = (p * i * Y - e * Q * Y - p * R * M + k * Q * M + e * R * u - k * i * u) * r, D[7] = (e * y * Y - $ * i * Y + $ * R * M - k * y * M - e * R * U + k * i * U) * r, D[8] = f * r, D[9] = (p * o * Y - $ * h * Y - p * H * U + k * h * U + $ * H * u - k * o * u) * r, D[10] = (e * h * Y - p * v * Y + p * H * M - k * h * M - e * H * u + k * v * u) * r, D[11] = ($ * v * Y - e * o * Y - $ * H * M + k * o * M + e * H * U - k * v * U) * r, D[12] = w * r, D[13] = ($ * h * R - p * o * R + p * H * y - k * h * y - $ * H * Q + k * o * Q) * r, D[14] = (p * v * R - e * h * R - p * H * i + k * h * i + e * H * Q - k * v * Q) * r, D[15] = (e * o * R - $ * v * R + $ * H * i - k * o * i - e * H * y + k * v * y) * r, this
}, makeRotationAxis: function (Z, d) {
var a = Math.cos(d),
o = Math.sin(d),
L = 1 - a,
M = Z.x,
j = Z.y,
x = Z.z,
T = L * M,
Y = L * j;
return this.set(T * M + a, T * j - o * x, T * x + o * j, 0, T * j + o * x, Y * j + a, Y * x - o * M, 0, T * x - o * j, Y * x + o * M, L * x * x + a, 0, 0, 0, 0, 1), this
}, multiply: function (X) {
return this.multiplyMatrices(this, X)
}, premultiply: function (S) {
return this.multiplyMatrices(S, this)
}, multiplyMatrices: function (P, F) {
var W = P.el,
C = F.el,
u = this.el,
s = W[0],
A = W[4],
Q = W[8],
o = W[12],
t = W[1],
S = W[5],
_ = W[9],
N = W[13],
T = W[2],
z = W[6],
j = W[10],
c = W[14],
h = W[3],
d = W[7],
x = W[11],
E = W[15],
l = C[0],
D = C[4],
G = C[8],
B = C[12],
I = C[1],
H = C[5],
M = C[9],
K = C[13],
J = C[2],
r = C[6],
Y = C[10],
e = C[14],
X = C[3],
n = C[7],
L = C[11],
v = C[15];
return u[0] = s * l + A * I + Q * J + o * X, u[4] = s * D + A * H + Q * r + o * n, u[8] = s * G + A * M + Q * Y + o * L, u[12] = s * B + A * K + Q * e + o * v, u[1] = t * l + S * I + _ * J + N * X, u[5] = t * D + S * H + _ * r + N * n, u[9] = t * G + S * M + _ * Y + N * L, u[13] = t * B + S * K + _ * e + N * v, u[2] = T * l + z * I + j * J + c * X, u[6] = T * D + z * H + j * r + c * n, u[10] = T * G + z * M + j * Y + c * L, u[14] = T * B + z * K + j * e + c * v, u[3] = h * l + d * I + x * J + E * X, u[7] = h * D + d * H + x * r + E * n, u[11] = h * G + d * M + x * Y + E * L, u[15] = h * B + d * K + x * e + E * v, this
}, lookAt: function () {
var u = new tl,
e = new tl,
R = new tl;
return function (E, q, z) {
var r = this.el;
return R.subVectors(E, q), 0 === R.lengthSq() && (R.z = 1), R.normalize(), u.crossVectors(z, R), 0 === u.lengthSq() && (1 === Math.abs(z.z) ? R.x += 1e-4 : R.z += 1e-4, R.normalize(), u.crossVectors(z, R)), u.normalize(), e.crossVectors(R, u), r[0] = u.x, r[4] = e.x, r[8] = R.x, r[1] = u.y, r[5] = e.y, r[9] = R.y, r[2] = u.z, r[6] = e.z, r[10] = R.z, this
}
}(),
extractScale: function () {
var f;
return function (I) {
f === Z && (f = new tl), I === Z && (I = new tl);
var l = f.setFromMatrixColumn(this, 0).length(),
Q = f.setFromMatrixColumn(this, 1).length(),
U = f.setFromMatrixColumn(this, 2).length();
return I.set(l, Q, U), I
}
}(),
extractRotation: function () {
var p;
return function (o) {
p === Z && (p = new tl), o === Z && (o = new br);
var c = this.el,
f = o.el,
r = 1 / p.setFromMatrixColumn(o, 0).length(),
K = 1 / p.setFromMatrixColumn(o, 1).length(),
A = 1 / p.setFromMatrixColumn(o, 2).length();
return c[0] = f[0] * r, c[1] = f[1] * r, c[2] = f[2] * r, c[4] = f[4] * K, c[5] = f[5] * K, c[6] = f[6] * K, c[8] = f[8] * A, c[9] = f[9] * A, c[10] = f[10] * A, this
}
}(),
multiplyScalar: function (u) {
var v = this.el;
return v[0] *= u, v[4] *= u, v[8] *= u, v[12] *= u, v[1] *= u, v[5] *= u, v[9] *= u, v[13] *= u, v[2] *= u, v[6] *= u, v[10] *= u, v[14] *= u, v[3] *= u, v[7] *= u, v[11] *= u, v[15] *= u, this
}, getPosition: function (j) {
return j === Z && (j = new tl), j.setFromMatrixColumn(this, 3)
}, setPosition: function (S) {
var h = this.el;
return h[12] = S.x, h[13] = S.y, h[14] = S.z, this
}, toArray: function (g, D) {
g === Z && (g = []), D === Z && (D = 0);
var Y = this.el;
return g[D] = Y[0], g[D + 1] = Y[1], g[D + 2] = Y[2], g[D + 3] = Y[3], g[D + 4] = Y[4], g[D + 5] = Y[5], g[D + 6] = Y[6], g[D + 7] = Y[7], g[D + 8] = Y[8], g[D + 9] = Y[9], g[D + 10] = Y[10], g[D + 11] = Y[11], g[D + 12] = Y[12], g[D + 13] = Y[13], g[D + 14] = Y[14], g[D + 15] = Y[15], g
}, determinant: function () {
var C = this.el,
g = C[0],
q = C[4],
H = C[8],
J = C[12],
s = C[1],
I = C[5],
_ = C[9],
j = C[13],
V = C[2],
N = C[6],
u = C[10],
b = C[14],
d = C[3],
n = C[7],
y = C[11],
S = C[15];
return d * (+J * _ * N - H * j * N - J * I * u + q * j * u + H * I * b - q * _ * b) + n * (+g * _ * b - g * j * u + J * s * u - H * s * b + H * j * V - J * _ * V) + y * (+g * j * N - g * I * b - J * s * N + q * s * b + J * I * V - q * j * V) + S * (-H * I * V - g * _ * N + g * I * u + H * s * N - q * s * u + q * _ * V)
}, copy: function (e) {
var h = this.el,
n = e.el;
return h[0] = n[0], h[1] = n[1], h[2] = n[2], h[3] = n[3], h[4] = n[4], h[5] = n[5], h[6] = n[6], h[7] = n[7], h[8] = n[8], h[9] = n[9], h[10] = n[10], h[11] = n[11], h[12] = n[12], h[13] = n[13], h[14] = n[14], h[15] = n[15], this
}, compose: function (o, f, T) {
var P = this.el,
H = f._x,
m = f._y,
C = f._z,
Z = f._w,
w = H + H,
G = m + m,
R = C + C,
K = H * w,
Q = H * G,
u = H * R,
X = m * G,
F = m * R,
O = C * R,
$ = Z * w,
e = Z * G,
L = Z * R,
B = T.x,
j = T.y,
z = T.z;
return P[0] = (1 - (X + O)) * B, P[1] = (Q + L) * B, P[2] = (u - e) * B, P[3] = 0, P[4] = (Q - L) * j, P[5] = (1 - (K + O)) * j, P[6] = (F + $) * j, P[7] = 0, P[8] = (u + e) * z, P[9] = (F - $) * z, P[10] = (1 - (K + X)) * z, P[11] = 0, P[12] = o.x, P[13] = o.y, P[14] = o.z, P[15] = 1, this
}, decompose: function () {
var N = new tl,
Y = new br;
return function (k, I, H) {
var F = this.el,
i = N.set(F[0], F[1], F[2]).length(),
p = N.set(F[4], F[5], F[6]).length(),
q = N.set(F[8], F[9], F[10]).length(),
W = this.determinant();
0 > W && (i = -i), k.x = F[12], k.y = F[13], k.z = F[14], Y.copy(this);
var n = 1 / i,
o = 1 / p,
c = 1 / q;
return Y.el[0] *= n, Y.el[1] *= n, Y.el[2] *= n, Y.el[4] *= o, Y.el[5] *= o, Y.el[6] *= o, Y.el[8] *= c, Y.el[9] *= c, Y.el[10] *= c, I.setFromRotationMatrix(Y), H.x = i, H.y = p, H.z = q, this
}
}()
});
var pq = O.Math.Triangle = function (i, N, v) {
this.a = i !== Z ? i : new tl, this.b = N !== Z ? N : new tl, this.c = v !== Z ? v : new tl
};
o.assign(pq, {
barycoordFromPoint: function () {
var b = new tl,
g = new tl,
C = new tl;
return function (j, m, U, N, V) {
b.subVectors(N, m), g.subVectors(U, m), C.subVectors(j, m);
var Y = b.dot(b),
_ = b.dot(g),
X = b.dot(C),
I = g.dot(g),
q = g.dot(C),
W = Y * I - _ * _,
G = V || new tl;
if (0 === W) return G.set(-2, -1, -1);
var Z = 1 / W,
o = (I * X - _ * q) * Z,
c = (Y * q - _ * X) * Z;
return G.set(1 - o - c, c, o)
}
}()
});
var gg = O.Math.Euler = function (j, s, H, $, I) {
this.set(j, s, H, $, I)
};
gg.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"], gg.DefaultOrder = "XYZ", gg.ReverseOrder = function (U) {
return U = U[2] + U[1] + U[0], U.toUpperCase()
}, o.defineProperties(gg.prototype, {
x: {
get: function () {
return this._x
}, set: function (s) {
this._x = s, this.onChangeCallback()
}
},
y: {
get: function () {
return this._y
}, set: function (F) {
this._y = F, this.onChangeCallback()
}
},
z: {
get: function () {
return this._z
}, set: function (q) {
this._z = q, this.onChangeCallback()
}
},
order: {
get: function () {
return this._order
}, set: function (t) {
this._order = t, this.onChangeCallback()
}
}
}), o.assign(gg.prototype, {
set: function (C, d, e, f, y) {
return ip(C) && (y = e, f = d, e = C[2], d = C[1], C = C[0]), f ? y && (f = gg.ReverseOrder(f)) : f = "ZYX", this._x = C || 0, this._y = d || 0, this._z = e || 0, this._order = f || this._order, this.onChangeCallback(), this
}, clone: function () {
return new this.constructor(this._x, this._y, this._z, this._order)
}, copy: function (O) {
return this._x = O._x, this._y = O._y, this._z = O._z, this._order = O._order, this.onChangeCallback(), this
}, setFromRotationMatrix: function (o, H, X) {
var p = O.Math.clamp,
N = o.el || o,
U = N[0],
E = N[4],
x = N[8],
D = N[1],
F = N[5],
h = N[9],
I = N[2],
Q = N[6],
P = N[10];
return H = H || this._order, "XYZ" === H ? (this._y = Math.asin(p(x, -1, 1)), Math.abs(x) < .99999 ? (this._x = Math.atan2(-h, P), this._z = Math.atan2(-E, U)) : (this._x = Math.atan2(Q, F), this._z = 0)) : "YXZ" === H ? (this._x = Math.asin(-p(h, -1, 1)), Math.abs(h) < .99999 ? (this._y = Math.atan2(x, P), this._z = Math.atan2(D, F)) : (this._y = Math.atan2(-I, U), this._z = 0)) : "ZXY" === H ? (this._x = Math.asin(p(Q, -1, 1)), Math.abs(Q) < .99999 ? (this._y = Math.atan2(-I, P), this._z = Math.atan2(-E, F)) : (this._y = 0, this._z = Math.atan2(D, U))) : "ZYX" === H ? (this._y = Math.asin(-p(I, -1, 1)), Math.abs(I) < .99999 ? (this._x = Math.atan2(Q, P), this._z = Math.atan2(D, U)) : (this._x = 0, this._z = Math.atan2(-E, F))) : "YZX" === H ? (this._z = Math.asin(p(D, -1, 1)), Math.abs(D) < .99999 ? (this._x = Math.atan2(-h, F), this._y = Math.atan2(-I, U)) : (this._x = 0, this._y = Math.atan2(x, P))) : "XZY" === H ? (this._z = Math.asin(-p(E, -1, 1)), Math.abs(E) < .99999 ? (this._x = Math.atan2(Q, F), this._y = Math.atan2(x, U)) : (this._x = Math.atan2(-h, P), this._y = 0)) : console.warn("unsupported order: " + H), this._order = H, X !== !1 && this.onChangeCallback(), this
}, setFromQuaternion: function () {
var S = new br;
return function (A, c, w) {
return S.makeRotationFromQuaternion(A), this.setFromRotationMatrix(S, c, w)
}
}(),
setFromVector3: function (J, I) {
return this.set(J.x, J.y, J.z, I || this._order)
}, reorder: function () {
var S = new fs;
return function (f) {
return S.setFromEuler(this), this.setFromQuaternion(S, f)
}
}(),
equals: function (O) {
return O._x === this._x && O._y === this._y && O._z === this._z && O._order === this._order
}, fromArray: function (S) {
return this._x = S[0], this._y = S[1], this._z = S[2], S[3] !== Z && (this._order = S[3]), this.onChangeCallback(), this
}, toArray: function (q, w) {
return q === Z && (q = []), w === Z && (w = 0), q[w] = this._x, q[w + 1] = this._y, q[w + 2] = this._z, q[w + 3] = this._order, q
}, toVector3: function (a) {
return a ? a.set(this._x, this._y, this._z) : new tl(this._x, this._y, this._z)
}, onChange: function (W) {
return this.onChangeCallback = W, this
}, onChangeCallback: function () { }
});
var fb = {
ms_ac: function (L, V) {
for (var C = V.ms_ac, W = 0; W < C.length; W++) em(L, C[W])
}, ms_listener: function (Y) {
Y.addListeners = function () {
var s = this,
Z = Ec;
u.mockTouch && (Z = Vr.concat(vs).concat(kr)), s.__events__ = Z;
for (var T = 0, D = Z.length; D > T; T++) {
var _ = Z[T];
"wheel" === _ && !s.handle_wheel && s.handle_mousewheel && (s.handle_wheel = function ($) {
sg(s, $)
}), s["handle_" + _] && ic(_, s.getView(), s)
}
}, Y.removeListeners = function () {
var X = this,
z = X.__events__;
if (z) {
X.__events__ = Z;
for (var c = 0, g = z.length; g > c; c++) X["handle_" + z[c]] && ws(z[c], X.getView(), X)
}
}
}, ms_fire: function (R) {
R.mp = function (A, u, V) {
this.addPropertyChangeListener(A, u, V)
}, R.ump = function (Q, p) {
this.removePropertyChangeListener(Q, p)
}, R.fp = function (k, l, d, A, B) {
return this.firePropertyChange(k, l, d, A, B)
}, R.addPropertyChangeListener = function (y, H, s) {
var F = this;
F._62I || (F._62I = new Yj), F._62I.add(y, H, s)
}, R.removePropertyChangeListener = function (n, y) {
this._62I && this._62I.remove(n, y)
}, R.firePropertyChange = function (b, K, H, g, U) {
if (g) {
if (g(K, H)) return !1
} else if (K === H) return !1;
var f = this,
P = U || {};
return P.property = b, P.oldValue = K, P.newValue = H, P.source = f, P.data = f, f._62I && f._62I.fire(P), f.onPropertyChanged && f.onPropertyChanged(P), !0
}
}, ms_attr: function (A) {
A.a = function (D, N) {
var A = this;
if (2 === arguments.length) A.setAttr(D, N);
else {
if (!xl(D)) return A.getAttr(D);
for (var b in D) A.setAttr(b, D[b])
}
return A
}, A.getAttr = function (m, p) {
if (p === Z && (p = 1), this._attrObject && m in this._attrObject) return this._attrObject[m];
if (this.getImage) {
var q = this.getImage();
if (dk(q) && (q = Oe[q]), xl(q) && "dataBindings" in q)
for (var S = q.dataBindings, r = S.length - 1; r >= 0; r--) {
var b = S[r];
if (b.attr === m) {
if ("defaultValue" in b) return b.defaultValue;
break
}
}
}
return p ? I[m] : Z
}, A.setAttr = function (q, T) {
var F = this;
F._attrObject || (F._attrObject = {});
var C = F._attrObject[q];
T === Z ? delete F._attrObject[q] : F._attrObject[q] = T, F.fp && F.fp("a:" + q, C, T) && F.onAttrChanged && F.onAttrChanged(q, C, T)
}, A.getSerializableAttrs = function () {
var B, p = {};
for (B in this._attrObject) p[B] = 1;
return p
}
}, ms_bnb: function (v) {
v.getBodyColor = function (G) {
return G.s("body.color")
}, v.getBorderColor = function (S) {
return S.s("border.color")
}
}, _51o: function (h) {
h.mi = function (X, g, k) {
this.addInteractorListener(X, g, k)
}, h.umi = function (O, F) {
this.removeInteractorListener(O, F)
}, h.fi = function (I) {
this.fireInteractorEvent(I)
}, h.addInteractorListener = function (M, F, G) {
var r = this;
r._63I || (r._63I = new Yj), r._63I.add(M, F, G)
}, h.removeInteractorListener = function (B, D) {
this._63I && this._63I.remove(B, D)
}, h.fireInteractorEvent = function (W) {
this._63I && this._63I.fire(W)
}, h.setInteractors = function (A) {
var o = this,
C = o._interactors;
C && C.each(function (T) {
T.tearDown()
}), ip(A) && (A = new xr(A)), o._interactors = A, A && A.each(function (v) {
v.setUp()
}), o.fp("interactors", C, A), o.invalidateSelection()
}, h.getInteractors = function () {
return this._interactors
}
}, _49o: function (T) {
T._44O = F, T._45O = F, T.getTopPainters = function () {
return this._44O
}, T.getBottomPainters = function () {
return this._45O
}, T.addTopPainter = function (u) {
var c = this;
c._44O || (c._44O = new xr), c._44O.contains(u) || (c._44O.add(u), c.redraw && c.redraw())
}, T.removeTopPainter = function (d) {
var k = this;
k._44O && (k._44O.remove(d), k.redraw && k.redraw())
}, T.addBottomPainter = function (Q) {
var V = this;
V._45O || (V._45O = new xr), V._45O.contains(Q) || (V._45O.add(Q), V.redraw && V.redraw())
}, T.removeBottomPainter = function (z) {
var N = this;
N._45O && (N._45O.remove(z), N.redraw && N.redraw())
}, T._93db = function (Y, M) {
var N = this;
N._45O && N._45O.each(function (b) {
b.draw ? b.draw(Y, M) : b.call(N, Y, M)
})
}, T._92db = function (_, N) {
var A = this;
A._44O && A._44O.each(function (v) {
v.draw ? v.draw(_, N) : v.call(A, _, N)
})
}
}, ms_sm: function (l) {
l.sm = function () {
return this.getSelectionModel()
}, l.setSelectableFunc = function (W) {
this.sm().setFilterFunc(W)
}, l.getSelectableFunc = function () {
return this.sm().getFilterFunc()
}, l.getSelectionModel = function () {
var s = this;
return s._selectionModel ? s._selectionModel : s.dm().sm()
}, l.isSelectionModelShared = function () {
return !this._selectionModel
}, l.setSelectionModelShared = function (y) {
var X = this,
n = !X._selectionModel,
S = X.handleSelectionChange,
W = X.dm();
n !== y && (X.invalidateSelection && X.invalidateSelection(), y ? (W.sm().ms(S, X), X._selectionModel.ums(S, X), X._selectionModel.dispose(), X._selectionModel = F) : (W.sm().ums(S, X), X._selectionModel = new Uc(W), X._selectionModel.ms(S, X)), X.onSelectionModelSharedChanged(), X.fp("selectionModelShared", n, y))
}, l.onSelectionModelSharedChanged = function () {
var D = this;
D.redraw(), D.invalidateSelection && D.invalidateSelection()
}, l.removeSelection = function () {
var w = this.dm();
w.beginTransaction(), this.sm().toSelection().each(w.remove, w), w.endTransaction()
}, l.selectAll = function () {
var y = this;
y.sm().ss(y.dm().toDatas(function (o) {
return y.isVisible(o) && y.isSelectable(o)
}))
}, l.isSelected = function (T) {
return this.sm().co(T)
}, l.isSelectedById = function (P) {
var D = this.dm().getDataById(P);
return D ? this.isSelected(D) : !1
}, l.isSelectable = function (y) {
return this.sm().isSelectable(y)
}
}, ms_tx: function (o) {
o._64I = 0, o._65O = 0, o.isScrollable = function () {
return this.getWidth() < this._64I
}, o._40o = function () {
return this.isScrollable()
}, o.getLogicalPoint = function (T) {
return Nm(T, this._canvas || this._view, this.tx(), this.ty ? this.ty() : 0)
}, o.tx = function (A) {
return A === Z ? this.getTranslateX() : (this.setTranslateX(A), void 0)
}, o.getTranslateX = function () {
return this._65O
}, o.setTranslateX = function (D) {
var C = this,
X = C.getWidth() - C._64I;
X > D && (D = X), D > 0 && (D = 0), D = A(D);
var B = C._65O;
C._65O = D, C.fp(gq, B, D)
}
}, ms_ty: function (k) {
k._23Q = 0, k._66O = 0, k._41o = function () {
return this.getHeight() < this._23Q
}, k.getLogicalPoint = function (Z) {
return Nm(Z, this._canvas || this._view, this.tx ? this.tx() : 0, this.ty())
}, k.ty = function (Q) {
return Q === Z ? this.getTranslateY() : (this.setTranslateY(Q), void 0)
}, k.getTranslateY = function () {
return this._66O
}, k.setTranslateY = function (x) {
var f = this,
H = f.getHeight() - f._23Q;
H > x && (x = H), x > 0 && (x = 0), x = A(x);
var y = f._66O;
f._66O = x, f.fp(wb, y, x)
}
}, ms_txy: function (o) {
o._65O = 0, o._66O = 0, o.tx = function (f) {
return f === Z ? this.getTranslateX() : (this.setTranslateX(f), void 0)
}, o.ty = function (k) {
return k === Z ? this.getTranslateY() : (this.setTranslateY(k), void 0)
}, o.onTranslateEnded = function () { }, o.setTranslate = function (K, l, o) {
var w = this;
if (o = Il(o)) {
w._65I && w._65I.stop(!0);
var j = w.tx(),
I = w.ty();
o.action = function (E) {
w.setTranslate(j + (K - j) * E, I + (l - I) * E)
}, o._37o = function () {
delete w._66I, delete w._65I, w.onTranslateEnded()
}, w._66I = 1, w._65I = Sf(o)
} else w.tx(K), w.ty(l)
}, o.getTranslateX = function () {
return this._65O
}, o.setTranslateX = function (w) {
var g = this;
w = g.adjustTranslateX(w);
var I = g._65O;
g._65O = w, g.fp(gq, I, w)
}, o.getTranslateY = function () {
return this._66O
}, o.setTranslateY = function (T) {
var G = this;
T = G.adjustTranslateY(T);
var M = G._66O;
G._66O = T, G.fp(wb, M, T)
}, o.adjustTranslateX = function (c) {
return A(c)
}, o.adjustTranslateY = function (D) {
return A(D)
}, o.translate = function (I, d, h) {
this.setTranslate(this.tx() + I, this.ty() + d, h)
}, o.getLogicalPoint = function (D) {
var m = this;
return Nm(D, this._canvas || m._view, m.tx(), m.ty())
}
}, ms_dm: function (w) {
w.dm = function (a) {
return a ? (this.setDataModel(a), void 0) : this.getDataModel()
}, w.getDataModel = function () {
return this._dataModel
}
}, ms_lp: function (D) {
D.lp = function (D) {
return this.getLogicalPoint(D)
}
}, ms_v: function (Q) {
Q._disabled = !1, Q.setDisabled = function (K, Q) {
var F = this,
B = F._disabled;
B !== K && (B && (yj(F._63O), delete F._63O), K && (sn(F._view, F._63O = lo(Q)), F.iv()), F._disabled = K, F.fp("disabled", B, K))
}, Q.isDisabled = function () {
return this._disabled
}, Q.getDisabledDiv = function () {
return this._63O
}, Q.getView = function () {
return this._view
}, Q.addToDOM = function (X) {
var u = this,
m = u.getView(),
Y = m.style;
X = X || U.body, X.appendChild(m), Y.left = "0", Y.right = "0", Y.top = "0", Y.bottom = "0", K(x, "resize", function () {
u.iv()
}), u.iv()
}, Q.getWidth = function () {
return this._view.clientWidth
}, Q.getHeight = function () {
return this._view.clientHeight
}, Q.setWidth = function (R) {
var D = this;
D._view.style.width = R + oe, D.iv(), D.fp && D.fp(ul, F, R)
}, Q.setHeight = function (z) {
var Q = this;
Q._view.style.height = z + oe, Q.iv(), Q.fp && Q.fp(Hh, F, z)
}, Q.setFocus = function (V) {
var G = this,
s = G._currentEditor;
return V && s && (s.getView && (s = s.getView()), s.contains(V.target)) ? !1 : (hr(G._view), G.endEditing && G.endEditing(), G.fireViewEvent("focus"), !0)
}, Q.iv = function (x) {
this.invalidate(x)
}, Q.invalidate = function (z) {
var T = this;
T._68I || (T._68I = 1, $e(T.validate, T, F, z), T.onInvalidated && T.onInvalidated(), T.fireViewEvent("invalidate"))
}, Q.validate = function () {
var r = this,
_ = r._view;
if (r._68I && (delete r._68I, _.parentNode))
if (0 === _.offsetWidth && 0 === _.offsetHeight && r._67I !== F) r._67I === Z && (r._67I = u.reinvalidateCount), r._67I > 0 ? r._67I-- : r._67I = F, r.iv();
else {
r.fireViewEvent("beginValidate"), r.validateImpl(), r.onValidated && r.onValidated(), r.fireViewEvent("validate");
var s = r._63O;
s && (_.lastChild !== s && (yj(s), sn(_, s)), qp(s, 0, 0, r.getWidth(), r.getHeight())), Dd(r), Fo(r), Yi(r)
}
}, Q.layout = function (H, T, h, k) {
1 === arguments.length ? qp(this, H) : qp(this, H, T, h, k)
}, Q.addViewListener = function (l, Z, V) {
var y = this;
y._67O || (y._67O = new Yj), y._67O.add(l, Z, V)
}, Q.removeViewListener = function (p, M) {
this._67O.remove(p, M)
}, Q.fireViewEvent = function (a) {
var m = this;
m._67O && (dk(a) && (a = {
kind: a
}), m._67O.fire(a)), u.viewListener && u.viewListener(m, a)
}
}, ms_tip: function (c) {
c.setToolTipEnabled = function (M) {
var S = this;
M ? nf || S._13o || (S.enableToolTip(), S.fp("toolTipEnabled", !1, !0)) : S._13o && (S.disableToolTip(), S.fp("toolTipEnabled", !0, !1))
}, c.isToolTipEnabled = function () {
return !!this._13o
}, c.enableToolTip = function () {
var C = this;
if (!nf && !C._13o) {
C._13o = function (i) {
var J = C.getToolTip(i);
J != F ? u.toolTipContinual && u.isToolTipShowing() ? me(i, J) : (Um(), sq = {
timeout: cd(Xk, gj),
e: i,
info: J
}) : Um()
};
var h = C.getView();
K(h, rp, C._13o), K(h, "mouseleave", u.hideToolTip)
}
}, c.disableToolTip = function () {
var w = this;
if (w._13o) {
var K = w.getView();
b(K, rp, w._13o), b(K, "mouseleave", u.hideToolTip), delete w._13o
}
}, c.getToolTip = function (p) {
var J = this;
if (J.getDataAt) {
var H = J.getDataAt(p);
return H ? H.getToolTip() : F
}
return J.getValue ? J.getValue() : void 0
}
}, _52o: function (X) {
X._zoom = 1, X._29I = nl, X.zoomIn = function (S, C) {
this.setZoom(this._zoom * lq, S, C)
}, X.zoomOut = function (Y, k) {
this.setZoom(this._zoom / lq, Y, k)
}, X.zoomReset = function (w, u) {
this.setZoom(1, w, u)
}, X.scrollZoomIn = function (v) {
this.setZoom(this._zoom * _f, F, v)
}, X.scrollZoomOut = function (J) {
this.setZoom(this._zoom / _f, F, J)
}, X.pinchZoomIn = function (j) {
this.setZoom(this._zoom * db, F, j)
}, X.pinchZoomOut = function (K) {
this.setZoom(this._zoom / db, F, K)
}, X.adjustZoom = function (m) {
return gh > m ? gh : m > us ? us : m
}, X.getZoom = function () {
return this._zoom
}, X.setZoom = function (c, v, K) {
var _ = this;
if (v = Il(v)) {
_._14o && _._14o.stop(!0);
var p = _._zoom;
v.action = function (j) {
_._96O(p + (c - p) * j, K)
}, v._37o = function () {
delete _._zooming, delete _._14o, _.onZoomEnded()
}, _._zooming = 1, _._14o = Sf(v)
} else _._96O(c, K)
}, X._96O = function (X, b) {
var m = this;
if (X = m.adjustZoom(X), X !== m._zoom) {
m.validate();
var M = m._29I,
_ = m._zoom;
0 !== M.width && 0 !== M.height && (b = b ? b : {
x: M.x + M.width / 2,
y: M.y + M.height / 2
}, m.tx((b.x - M.x) * _ - b.x * X), m.ty((b.y - M.y) * _ - b.y * X)), m._zoom = X, m.fp("zoom", _, X)
}
}
}, ms_edge: function (B) {
B._2I = function (z) {
var q = this;
q._44I || (q._44I = new xr), q._42I || (q._42I = new xr), q._44I.add(z), q._42I.add(z), q._20I()
}, B._4I = function (M) {
var F = this;
F._44I || (F._44I = new xr), F._43I || (F._43I = new xr), F._44I.add(M), F._43I.add(M), F._20I()
}, B._16I = function (x) {
var d = this;
d._44I.remove(x), d._42I.remove(x), d._44I.isEmpty() && delete d._44I, d._42I.isEmpty() && delete d._42I, d._20I()
}, B._18I = function (u) {
var d = this;
d._44I.remove(u), d._43I.remove(u), d._44I.isEmpty() && delete d._44I, d._43I.isEmpty() && delete d._43I, d._20I()
}, B._20I = function () {
var y = this;
if (delete y._45I, !y._44I || y._44I.isEmpty()) return delete y._70O, void 0;
var k;
y._44I.each(function (l) {
l.isLooped() && (k || (k = {}), k[l._id] || (y._45I || (y._45I = new xr), y._45I.add(l), k[l._id] = l))
}), k ? (y._70O = new xr, y._44I.each(function (A) {
k[A._id] ? "A" === k[A._id] || (k[A._id] = "A", y._70O.add(A)) : y._70O.add(A)
})) : y._70O = y._44I
}, B.hasAgentEdges = function () {
return !!this._49I && !this._49I.isEmpty()
}, B.getSourceAgentEdges = function () {
return this._46I
}, B.getTargetAgentEdges = function () {
return this._47I
}, B._1I = function (F) {
var e = this;
e._46I || (e._46I = new xr), e._48I || (e._48I = new xr), e._46I.add(F), e._48I.add(F), e._19I()
}, B._3I = function (T) {
var H = this;
H._47I || (H._47I = new xr), H._48I || (H._48I = new xr), H._47I.add(T), H._48I.add(T), H._19I()
}, B._15I = function (W) {
var Y = this;
Y._46I.remove(W), Y._48I.remove(W), Y._46I.isEmpty() && delete Y._46I, Y._48I.isEmpty() && delete Y._48I, Y._19I()
}, B._17I = function (B) {
var K = this;
K._47I.remove(B), K._48I.remove(B), K._47I.isEmpty() && delete K._47I, K._48I.isEmpty() && delete K._48I, K._19I()
}, B._19I = function () {
var Y = this;
delete Y._49I;
var b = Y._48I;
if (b && !b.isEmpty()) {
var _ = {};
b.each(function (G) {
_[G._id] ? Y._49I || (Y._49I = new xr) : _[G._id] = G
}), Y._49I ? b.each(function (c) {
_[c._id] && (Y._49I.add(c), delete _[c._id])
}) : Y._49I = b
}
}, B.getLoopedEdges = function () {
return this._45I
}, B.getEdges = function () {
return this._70O
}, B.getAgentEdges = function () {
return this._49I
}, B.getSourceEdges = function () {
return this._42I
}, B.getTargetEdges = function () {
return this._43I
}, B._8I = function () {
this._70O && this._70O.each(function (k) {
k._7I()
})
}
}, ms_shadow: function (c) {
_r.PARAMS.forEach(function (u) {
var k = u.replace(/(^|\.)[a-z]/g, function (e) {
return e[e.length - 1].toUpperCase()
}),
R = k.charAt(0).toLowerCase() + k.substr(1);
c["getShadow" + k] = function () {
return this._getShadowParam(R)
}, c["setShadow" + k] = function (f) {
this._setShadowParam(R, f)
}
}), c.enableShadow = function (D) {
this.shadowMap.setShadow(!0, D)
}, c.disableShadow = function () {
this.shadowMap.setShadow(!1)
}, c._getShadowParam = function (Z) {
return this.shadowMap.getShadow()[Z]
}, c._setShadowParam = function (s, b) {
var f = this._getShadowParam(s),
u = {};
u[s] = b;
var h = this.shadowMap;
h.setShadow(h.enable, u), this.firePropertyChange("shadow" + s.charAt(0).toUpperCase() + s.substr(1), f, b)
}
}
};
Uh(u, {
getVersion: function () {
return "7.2.1"
}
}, !0), Uh(u, {
numberDigits: 5,
crossOrigin: "",
baseZIndex: Z,
isTouchable: nf,
mockTouch: !0,
devicePixelRatio: x.devicePixelRatio ? x.devicePixelRatio : 1,
reinvalidateCount: 3,
hitMaxArea: 3e3,
imageCacheThreshold: 20,
autoMakeVisible: !0,
autoHideScrollBar: !0,
disabledOpacity: .4,
disabledBackground: S.disabledBackground,
forceHierarchicalSerialization: !0,
hoverDelay: 600,
clickDelay: 200,
toolTipDelay: 800,
toolTipContinual: !1,
getDragger: function () {
return si
}, lineCap: "butt",
lineJoin: "round",
imageGradient: "linear.northeast",
dashPattern: [16, 16],
blockMinSize: 1,
encodeStringKey: null,
doubleClickSpeed: 500,
doubleClickRange: 1,
doubleTouchRange: 20,
touchMoveThreshold: 10,
animDuration: 200,
animEasing: function (W) {
return W * W
}, labelColor: Un,
labelSelectColor: Dg,
labelFont: "12px arial, sans-serif",
widgetIndent: nf ? 30 : 20,
widgetRowHeight: nf ? 30 : 20,
widgetHeaderHeight: nf ? 32 : 22,
widgetTitleHeight: nf ? 34 : 24,
scrollBarColor: od,
scrollBarSize: 7,
scrollBarTimeout: 1e3,
scrollBarMinLength: 20,
scrollBarInteractiveSize: nf ? 32 : 16,
zoomIncrement: 1.3,
scrollZoomIncrement: 1.05,
pinchZoomIncrement: 1.08,
pinchZoomThreshold: 1,
zoomMax: 20,
zoomMin: .01,
segmentResolution: 12,
shapeResolution: 24,
shapeSide: 24,
intersectionLineRect: Rl,
intersectionLineLine: ti,
isEnter: hd,
isEsc: bj,
isDelete: qq,
isSpace: Cf,
isLeft: Wk,
isUp: Nk,
isRight: _i,
isDown: ri,
isTouchEvent: li,
getTarget: gr,
isString: dk,
isNumber: Bp,
isBoolean: El,
isArray: ip,
isSelectAll: Dq,
isFunction: Mf,
isObject: xl,
getPropertyValue: jq,
setPropertyValue: Di,
addMethod: Uh,
isMobile: function () {
var g;
return function () {
return g !== Z ? g : (g = !1, function (k) {
(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(k) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(k.substr(0, 4))) && (g = !0)
}(navigator.userAgent || navigator.vendor || x.opera), g)
}
}(),
createGradient: function (k, b, L, Z, w, d, H, p) {
var N = Eg[b];
return N(k, L, Z, w, d, H, p)
}, appendToScreen: function (v) {
v = v.getView ? v.getView() : v, (U.fullscreenElement || U.mozFullScreenElement || U.webkitFullscreenElement || U.msFullscreenElement || U.body).appendChild(v)
}, encodeString: function (m) {
return O.Math.encodeBase64(m, u.encodeStringKey)
}, decodeString: function (M) {
return O.Math.decodeBase64(M, u.encodeStringKey)
}, findView: function (L) {
var s = function (F, Y) {
var z = Y._ht;
z && F.push(z);
var v = Y.children,
U = v.length;
if (U)
for (var D = 0; U > D; D++) s(F, v[D])
},
r = [];
s(r, U.body);
var G = function (h, H) {
for (var m = "2d" === H ? hg.GraphView : Eh.Graph3dView, l = 0, W = h.length; W > l; l++)
if (h[l] instanceof m) return r[l];
return null
};
return "all" === L ? r : "2d" === L ? G(r, "2d") : "3d" === L ? G(r, "3d") : G(r, "3d") || G(r, "2d")
}, toggleFullscreen: function (D) {
var Y = D.getView();
if (U.fullscreenElement || U.mozFullScreenElement || U.webkitFullscreenElement || U.msFullscreenElement) U.exitFullscreen ? U.exitFullscreen() : U.msExitFullscreen ? U.msExitFullscreen() : U.mozCancelFullScreen ? U.mozCancelFullScreen() : U.webkitExitFullscreen && U.webkitExitFullscreen();
else {
var W = !0;
if (D.isSelfViewEvent) {
var i = D.getX(),
s = D.getY(),
E = D.getWidth(),
N = D.getHeight(),
g = Y.style.background,
A = Y.style.backgroundColor;
g || A || (Y.style.backgroundColor = "white"), Y.requestFullscreen ? Y.requestFullscreen() : Y.msRequestFullscreen ? Y.msRequestFullscreen() : Y.mozRequestFullScreen ? Y.mozRequestFullScreen() : Y.webkitRequestFullscreen && Y.webkitRequestFullscreen();
var p = setInterval(function () {
if (Y !== (U.fullscreenElement || U.mozFullScreenElement || U.webkitFullscreenElement || U.msFullscreenElement)) clearInterval(p), D.setX(i), D.setY(s), D.setWidth(E), D.setHeight(N), D._fullscreen = !1, Y.style.oldBackgroundColor = A, D.iv();
else {
var I = O.Default.getWindowInfo();
(W || I.width !== D.getWidth() || I.height !== D.getHeight()) && (D.setX(I.left), D.setY(I.top), D.setWidth(I.width), D.setHeight(I.height), D._fullscreen = !0, D.iv(), W = !1)
}
}, 500)
} else {
var j = Y.style.left,
w = Y.style.top,
E = Y.style.width,
N = Y.style.height,
g = Y.style.background,
A = Y.style.backgroundColor;
g || A || (Y.style.backgroundColor = "white"), Y.requestFullscreen ? Y.requestFullscreen() : Y.msRequestFullscreen ? Y.msRequestFullscreen() : Y.mozRequestFullScreen ? Y.mozRequestFullScreen() : Y.webkitRequestFullscreen && Y.webkitRequestFullscreen();
var p = setInterval(function () {
if (Y !== (U.fullscreenElement || U.mozFullScreenElement || U.webkitFullscreenElement || U.msFullscreenElement)) clearInterval(p), Y.style.left = j, Y.style.top = w, Y.style.width = E, Y.style.height = N, Y.style.oldBackgroundColor = A, D.iv();
else {
var I = O.Default.getWindowInfo();
(W || I.width !== D.getWidth() || I.height !== D.getHeight()) && (qp(D), W = !1)
}
}, 500)
}
}
}, appendTimeStamp: function (H) {
return H
}, setCompType: function (O, m) {
Mf(m) || xl(m) ? Xh[O] = m : qs(O)
}, getCompType: function (o) {
var r = Xh[o];
return r === Z && Bm.test(o) && qs(o), r
}, getCompTypeMap: function () {
return Xh
}, drawCompType: function (j, O, w, $, l, H) {
j(O, w, $, l, H)
}, numberListener: function () {
var r = {
46: 1,
8: 1,
9: 1,
27: 1,
13: 1,
109: 1,
110: 1,
189: 1,
190: 1
};
return function (K) {
var T = K.keyCode;
r[T] || 65 === T && u.isCtrlDown(K) || 86 === T && u.isCtrlDown(K) || 67 === T && u.isCtrlDown(K) || 88 === T && u.isCtrlDown(K) || T >= 35 && 40 >= T || (K.shiftKey || 48 > T || T > 57) && (96 > T || T > 105) && K.preventDefault()
}
}(),
ignoreKeyCodes: [122, 123],
preventDefault: function (J) {
var H = J.target.tagName;
("DIV" === H || "CANVAS" === H) && !(u.ignoreKeyCodes.indexOf(J.keyCode) >= 0) && ("keydown" !== J.type || Wk(J) || _i(J) || Nk(J) || ri(J) || qq(J) || 65 === J.keyCode && (J.metaKey || J.ctrlKey)) && (J.preventDefault(), J.preventManipulation && J.preventManipulation())
}, getWindowInfo: function () {
var H = U.documentElement,
z = H && (H.scrollLeft || H.scrollTop) ? H : U.body;
return {
target: z,
left: z.scrollLeft,
top: z.scrollTop,
width: x.innerWidth || z.clientWidth,
height: x.innerHeight || z.clientHeight
}
}, isDragging: function () {
return !!si
}, isLeftButton: function (M) {
return li(M) ? !0 : 0 === M.button
}, isMiddleButton: function (I) {
return li(I) ? !1 : I && (1 === I.button || 4 & (I.buttons || 0))
}, isRightButton: function (G) {
return li(G) ? !1 : G && (2 === G.button || 2 & (G.buttons || 0))
}, isInput: function (D) {
if (!D) return !1;
var n = D.tagName;
return "INPUT" === n || "TEXTAREA" === n || "SELECT" === n
}, getTouchCount: function (e) {
return li(e) ? e.touches.length : 1
}, isDoubleClick: function () {
function j(f) {
f.details = 0, f.timeout = null, f.lastPoint = null
}
var T = {};
return Gk = new v, vi = Gk.getTime(),
function (C) {
if (Qj(C) > 1) return !1;
var I = C.button == F ? "" : C.button,
m = C.type + I,
h = m + "_isDoubleClick",
y = T[m];
if (y || (y = T[m] = {
details: 0,
timeout: null,
lastPoint: null
}), C[h] === Z) {
C[h] = !0;
var l = lb(C);
y.timeout && (nr(y.timeout), y.timeout = null);
var s = li(C) ? u.doubleTouchRange : u.doubleClickRange;
y.lastPoint && En(y.lastPoint, l) > s && j(y), y.lastPoint = l, y.details++, y.timeout = cd(function () {
j(this)
}.bind(y), u.doubleClickSpeed)
}
return 2 === y.details
}
}(),
isShiftDown: function (z) {
return z ? z.shiftKey : pl["16"]
}, isCtrlDown: function (Q) {
return Q ? eg ? Q.metaKey : Q.ctrlKey : eg ? pl["91"] : pl["17"]
}, getClientPoint: function (r) {
return li(r) && (r = Xj(r)), {
x: r.clientX,
y: r.clientY
}
}, isMouseEvent: function (P) {
return P instanceof MouseEvent || 0 === P.type.indexOf("mouse")
}, getTargetElement: function (z) {
if (u.isMouseEvent(z) || !U.elementFromPoint) return z.target;
var V = Fd(z);
return U.elementFromPoint(V.x, V.y)
}, getPagePoint: function (Q) {
return li(Q) && (Q = Xj(Q)), {
x: Q.pageX,
y: Q.pageY
}
}, createObject: function (E, Y) {
var l = new E;
for (var G in Y) {
var r = Y[G];
if (Mf(r)) l[G] = r;
else if (0 === G.indexOf("s:")) l.s(G.substr(2), Y[G]);
else if (0 === G.indexOf("a:")) l.a(G.substr(2), Y[G]);
else {
var R = tg(G),
r = Y[G];
l[R] ? (l[R](r), "setToolTip" === R && l.enableToolTip && l.enableToolTip()) : l[G] = r
}
}
return l
}, setImage: function (v, b, k, U) {
var W = arguments.length;
4 === W ? sd(v, U, b, k) : 2 === W ? dk(b) ? sd(v, b) : vl(v, b) : 1 === W && sd(v, v)
}, getImage: function (s, I, K) {
var U;
if (s == F) return F;
if (xl(s) ? U = s : (U = Oe[s], s && U === Z && (rm && rm[s] || sd(s, s))), I && U && U.tagName) {
var w;
w = "override" === K ? "colors_override" : "override_rgb" === K ? "colors_override_rgb" : "override_a" === K ? "colors_override_a" : "colors", U[w] || (U[w] = {
__count__: 0
});
var G = U[w][I];
return G || (U[w].__count__ > u.imageCacheThreshold && (U[w] = {
__count__: 0
}), G = oi(U, ns(I), U.width, U.height, K), U[w][I] = G, U[w].__count__++), G
}
return U
}, isImageComplete: function (k, H, K) {
var r = ii(k);
if (!r) return !1;
if (r.tagName) return r.complete;
for (var x, k, v, D = r.comps, U = !0, p = 0, l = D.length; l > p; p++)
if (x = D[p], v = x.type, "image" === x.type) {
k = x.name, k && k.func && (k = Dj(k, H));
var R = Dr(k, H, K);
if (!R) {
U = !1;
break
}
} else if (Bm.test(v) && u.getCompType(v) === Z) {
U = !1, qs(v);
break
}
return U
}, getId: function () {
var d = 1;
return function () {
return ++d
}
}(),
callLater: function (Z, p, W, T) {
var f = function () {
Z.apply(p, W)
};
return T ? cd(f, T) : x.requestAnimationFrame(f)
}, cancelLater: function (K, f) {
f ? nr(K) : x.cancelAnimationFrame(K)
}, clone: function (i) {
if (null == i || "object" != typeof i) return i;
if (i instanceof Date) {
var x = new Date;
return x.setTime(i.getTime()), x
}
if (i instanceof Array) {
for (var x = [], $ = 0, N = i.length; N > $; $++) x[$] = Pm(i[$]);
return x
}
if (i instanceof xr) {
for (var x = new xr, $ = 0, N = i.length; N > $; $++) x.set($, Pm(i.get($)));
return x
}
if (i instanceof Qp) return i;
if (i instanceof o) {
var x = {};
for (var e in i) i.hasOwnProperty(e) && (x[e] = Pm(i[e]));
return x
}
return i
}, callWhenLoaded: function (t, b) {
b = b || 100;
var k = Jl(t, b);
nn || (nn = {}), nn[k] = {
tick: k,
cb: t,
delay: b
}
}, beforeLoadURL: function (v, I) {
if (nn) {
var V = {};
for (var I in nn) {
var S = nn[I];
nr(S.tick);
var z = Jl(S.cb, S.delay);
V[z] = {
tick: z,
delay: S.delay,
cb: S.cb
}
}
nn = V
}
return u.convertURL ? u.convertURL(v, I) : v
}, convertURL: function (Z) {
return Z
}, handleRefGraphLoaded: function () { }, handleCompTypeLoaded: function () { }, handleImageLoaded: function () { }, handleUnfoundImage: function () {
return u.getImage("default_blank")
}, resizeImagePOT: function (F, L) {
if (!F || !F.tagName) return F;
var c = F.width,
$ = F.height;
if (!c || !$) return F;
if (Rc.isPOT(c) && Rc.isPOT($) && (!L || c === $)) return F;
var m, X;
L ? X = m = Rc.nearestPOT(Math.min(c, $)) : (m = Rc.nearestPOT(c), X = Rc.nearestPOT($));
var l = uo(),
E = l.getContext("2d");
return Bn(l, m, X, 1), E.drawImage(F, 0, 0, c, $, 0, 0, m, X), l
}, sortFunc: function (G, P) {
if (G === P) return 0;
if (G == F && P != F) return 1;
if (G != F && P == F) return -1;
if (G == F && P == F) return 0;
var j, z = typeof G,
A = typeof P;
return z === Gl && A === Gl ? j = G.localeCompare(P) : z === Mo && A === Mo && (j = G - P), j === Z && (j = ("" + G).localeCompare("" + P)), j > 0 ? 1 : 0 > j ? -1 : 0
}, getClassMap: function () {
return Zl
}, getClass: function (D) {
if (dk(D)) {
var X, f = Zl[D];
if (!f) {
X = D.split("."), f = x;
for (var y = 0; y < X.length; y++) f = f[X[y]];
Zl[D] = f
}
return f
}
return D
}, def: function (C, u, w) {
var p, Y, d, T = function () { };
if (T.prototype = u.prototype, p = new T, dk(C)) {
if (Zl[C]) throw "'" + C + "' already defined";
d = gp(C), p.getClassName = function () {
return C
}
} else d = C; if (p.constructor = d, p.getClass = function () {
return d
}, p.getSuperClass = function () {
return u
}, w)
for (Y in w) fb[Y] && fb.hasOwnProperty(Y) ? fb[Y](p, w) : Ug(p, w, Y);
d.prototype = p, d.superClass = u.prototype
}, startAnim: function () {
var E = function (W) {
W.duration && (W.startTime = mm()), W.timeId = $e(W.tick, F, F, W.interval)
};
return function (R) {
return R = Pm(R), R.easing = R.easing || u.animEasing, R.duration || R.frames || (R.duration = u.animDuration), R.t = 0, R.duration ? R.interval = 0 : (R.frame = 0, R.interval = R.interval || 10), R.tick = function () {
if (R.duration) {
var z = (mm() - R.startTime) / R.duration;
if (z > 1 && (z = 1), R.t = z, R.action(R.easing(z), z), !R.isRunning()) return;
1 === z ? R.stop() : R._isPaused || (R.timeId = $e(R.tick))
} else {
if (R.frame++, z = R.t = R.frame / R.frames, R.action(R.easing(z), z), !R.isRunning()) return;
R.frame < R.frames ? R._isPaused || (R.timeId = $e(R.tick, F, F, R.interval)) : R.stop()
}
}, R.resume = function () {
R._isPaused && (delete R._isPaused, R.duration ? R.t < 1 && (R.startTime = mm() - R.duration * R.t, R.timeId = $e(R.tick)) : R.frame < R.frames && (R.timeId = $e(R.tick, F, F, R.interval)))
}, R.pause = function () {
td(R.timeId, !R.duration), R._isPaused = !0
}, R.isPaused = function () {
return this._isPaused
}, R.stop = function (Y) {
R.isRunning() && (td(R.timeId, !R.duration), delete R.timeId, R.duration ? R.t < 1 && Y && (R.t = 1, R.action(R.easing(1), 1)) : R.frame < R.frames && Y && (R.frame = R.frames, R.action(R.easing(1), 1)), R._37o && R._37o(), R.finishFunc && R.finishFunc())
}, R.isRunning = function () {
return R.timeId != F
}, R.delay ? $e(E, F, [R], R.delay) : E(R), R
}
}(),
getTextSize: function () {
var p = {},
x = U ? uo().getContext("2d") : F;
return function (C, Q) {
x.font = C ? C : Fh;
var c = p[x.font];
return c || (c = 2 * x.measureText("e").width + 4, p[x.font] = c), {
width: x.measureText(Q).width + 4,
height: c
}
}
}(),
drawText: function (v, Q, q, t, a, n, D, K, m, A) {
if (Q != F) {
var H = ln(q, Q),
V = {};
V.y = A && A !== Sg ? A === $c ? n + H.height / 2 : n + K - H.height / 2 : n + K / 2, V.x = m && m !== nq ? m === fm ? a + D - H.width / 2 : a + D / 2 : a + H.width / 2, Lp(v, Q, V, q, t)
}
}, getDistance: function (x, U) {
var $ = x.length;
return U ? 3 === $ ? w(ds(x[0] - U[0]) + ds(x[1] - U[1]) + ds(x[2] - U[2])) : 2 === $ ? w(ds(x[0] - U[0]) + ds(x[1] - U[1])) : x.z === Z ? w(ds(U.x - x.x) + ds(U.y - x.y)) : w(ds(U.x - x.x) + ds(U.y - x.y) + ds(U.z - x.z)) : 3 === $ ? w(ds(x[0]) + ds(x[1]) + ds(x[2])) : 2 === $ ? w(ds(x[0]) + ds(x[1])) : void 0
}, brighter: function (V, H) {
return 0 > H && (H = -H), mp(V, H ? H : 40)
}, darker: function (J, S) {
return S > 0 && (S = -S), mp(J, S ? S : -40)
}, unionPoint: function (C, U) {
if (!C) return F;
if (2 === arguments.length) return C && U ? {
x: V(C.x, U.x),
y: V(C.y, U.y),
width: X(C.x - U.x),
height: X(C.y - U.y)
} : F;
var u = C;
if (u._as && (u = u._as), u.length === Z) return F;
var G = u.length;
if (0 >= G) return F;
for (var O = 1, e = u[0], v = {
x: e.x,
y: e.y,
width: 0,
height: 0
}; G > O; O++) {
e = u[O];
var h = V(v.x, e.x),
y = q(v.x + v.width, e.x),
p = V(v.y, e.y),
M = q(v.y + v.height, e.y);
v.x = h, v.y = p, v.width = y - h, v.height = M - p
}
return v
}, unionRect: function (E, u) {
if (E && !u) return Pm(E);
if (!E && u) return Pm(u);
if (E && u) {
var l = {
x: V(E.x, u.x),
y: V(E.y, u.y)
};
return l.width = q(E.x + E.width, u.x + u.width) - l.x, l.height = q(E.y + E.height, u.y + u.height) - l.y, l
}
return F
}, containsPoint: function (p, I, Y, O) {
if (O != F && 1 !== O) {
var u = p.x + p.width / 2,
T = p.y + p.height / 2;
p = {
x: u - p.width / 2 * O,
y: T - p.height / 2 * O,
width: p.width * O,
height: p.height * O
}
}
if (Y) {
var B = p.width / 2,
f = p.height / 2,
r = n(-Y),
q = k(-Y),
C = I.x - p.x - B,
G = I.y - p.y - f;
return I = {
x: q * C - r * G,
y: r * C + q * G
}, cf({
x: -B,
y: -f,
width: p.width,
height: p.height
}, I)
}
return !(!p || I.x < p.x || I.y < p.y || I.x > p.x + p.width || I.y > p.y + p.height)
}, containsRect: function (G, W) {
if (!G || !W) return !1;
var P = W.x,
R = W.y,
k = W.width,
Z = W.height,
C = G.width,
F = G.height;
if (0 > (C | F | k | Z)) return !1;
var t = G.x,
Y = G.y;
if (t > P || Y > R) return !1;
if (C += t, k += P, P >= k) {
if (C >= t || k > C) return !1
} else if (C >= t && k > C) return !1;
if (F += Y, Z += R, R >= Z) {
if (F >= Y || Z > F) return !1
} else if (F >= Y && Z > F) return !1;
return !0
}, intersectsRect: function (b, k) {
if (!b || !k) return !1;
var y = k.width,
K = k.height,
x = b.width,
M = b.height;
if (0 >= x || 0 >= M || 0 >= y || 0 >= K) return !1;
var O = k.x,
q = k.y,
f = b.x,
W = b.y;
return x += f, M += W, y += O, K += q, x > O && M > q && y > f && K > W
}, intersection: function (G, K) {
if (!G || !K) return F;
var S = K.x,
t = K.y,
b = G.x,
M = G.y,
Y = S,
W = t,
V = b,
L = M;
return Y += K.width, W += K.height, V += G.width, L += G.height, b > S && (S = b), M > t && (t = M), Y > V && (Y = V), W > L && (W = L), Y -= S, W -= t, 0 >= Y || 0 >= W ? F : {
x: S,
y: t,
width: Y,
height: W
}
}, grow: function (_, P, E) {
E === Z && (E = P), _.x -= P, _.y -= E, _.width = _.width + 2 * P, _.height = _.height + 2 * E
}, getScreenPoint: function (v, m, Y, J, q, E, T) {
var y = Y.getBoundingClientRect(),
Q = v * (E || 1) - Y.scrollLeft + (J || 0),
V = m * (T || 1) - Y.scrollTop + (q || 0),
b = Vg(Y, !1);
if (b) {
var P = new tl(Q, V, 0);
return P.applyMatrix4(b), console.log(P), {
x: P.x,
y: P.y
}
}
return {
x: Q + y.left,
y: V + y.top
}
}, getLogicalPoint: function (L, v, q, G, r, A) {
var d, n, o = v.getBoundingClientRect();
L.target ? (ik(L) ? eg ? pl["91"] = !0 : pl["17"] = !0 : eg ? pl["91"] = !1 : pl["17"] = !1, pl["16"] = Pf(L) ? !0 : !1, L = li(L) ? Xj(L) : L, d = L.clientX, n = L.clientY) : (d = L.x, n = L.y);
var H = Vg(v, !0);
if (H) {
var m = new tl(d, n, 0);
m.applyMatrix4(H);
do {
if (Math.abs(m.z) <= 1e-6) break;
var F = new tl(d, n, 1);
if (F.applyMatrix4(matrix), Math.abs(F.z) <= 1e-6) {
m = F;
break
}
if (F.sub(m), Math.abs(F.z) <= 1e-6) break;
m.addScaledVector(F, -m.z / F.z)
} while (!1);
return {
x: (m.x + v.scrollLeft - (q || 0)) / (r || 1),
y: (m.y + v.scrollTop - (G || 0)) / (A || 1)
}
}
return {
x: (d - o.left + v.scrollLeft - (q || 0)) / (r || 1),
y: (n - o.top + v.scrollTop - (G || 0)) / (A || 1)
}
}, removeHTML: function () {
var W;
return function (J) {
return J && J.getView && (J = J.getView()), J && J.parentNode ? W === J ? !0 : (W = J, J.parentNode.removeChild(J), W = F, !0) : !1
}
}(),
getToolTipDiv: function () {
if (!Xm) {
Xm = dd(), xn = dd();
var L = Xm.style;
u.baseZIndex != F && (L.zIndex = Zb(u.baseZIndex) + 3 + ""), L.whiteSpace = "nowrap", L.color = u.toolTipLabelColor, L.background = u.toolTipBackground, L.font = u.toolTipLabelFont, L.padding = "5px", L.boxShadow = "0px 0px 3px " + u.toolTipShadowColor
}
return Xm
}, isToolTipShowing: function () {
return Xm && Xm.parentNode ? !0 : xn && xn.parentNode ? !0 : !1
}, hideToolTip: function () {
yj(Xm), yj(xn), Yp()
}, showToolTip: function (N, B) {
if (!N || B == F) return Um(), void 0;
u.getToolTipDiv();
var e, j;
if (B.html ? (B = B.html, e = xn, yj(Xm)) : (e = Xm, yj(xn)), j = e.style, e.innerHTML = B, e.parentNode || O.Default.appendToScreen(e), N.target) {
N = Fd(N);
var f = hq(),
Q = N.x,
a = N.y,
K = nf ? 60 : 12;
if (nf) {
var c = e.getBoundingClientRect();
j.left = Q - c.width / 2 + oe, j.top = a - c.height - K < f.top ? a + K + oe : a - c.height - K + oe
} else {
j.left = Q + K + oe, j.top = a + K + oe;
var c = e.getBoundingClientRect();
c.left + c.width > f.width && (j.left = Q - K - c.width + oe), c.top + c.height > f.height && (j.top = a - K - c.height + oe), c.left < 0 && (j.left = Q + K + oe), c.top < 0 && (j.top = a + K + oe)
}
} else j.left = N.x + oe, j.top = N.y + oe;
Yp()
}, startDragging: function (t, A, d) {
d == Z && (d = !0), t !== si && (si ? d && (li(A) ? si.handleWindowTouchEnd(A) : si.handleWindowMouseUp(A)) : li(A) ? (K(x, wj, Ed), K(x, Sj, Zr)) : (K(x, rp, Kn), K(x, cj, tc)), si = t)
}, getImageMap: function () {
return Oe
}, toBoundaries: function (y, n, A, w) {
var T = [];
return Yo(y, n, A, w).forEach(function (b) {
var V = [];
b.forEach(function (I) {
V.push(I.x, I.y)
}), T.push(V)
}), T
}, getCurrentKeyCodeMap: function () {
return pl
}, drawCenterImage: function (G, t, k, z, n, H, O, Q) {
!n && H && H.isSelfViewEvent && (n = H);
var Y = xc(t, n, H),
l = oo(t, n, H);
Yd(G, t, A(k - Y / 2), A(z - l / 2), Y, l, n, H, O, Q)
}, drawStretchImage: function (T, N, I, o, c, M, b, k, X, f, J, d) {
!k && X && X.isSelfViewEvent && (k = X);
var i, g = xc(N, k, X, M),
G = oo(N, k, X, b);
"uniform" === I ? (i = V(M / g, b / G), g *= i, G *= i, o += A((M - g) / 2), c += A((b - G) / 2), M = g, b = G) : "centerUniform" === I && ((g > M || G > b) && (i = V(M / g, b / G), g *= i, G *= i), o += A((M - g) / 2), c += A((b - G) / 2), M = g, b = G);
var u = T.interactiveInfo;
if (u) {
var W;
if (W = "center" === I ? {
x: o + M / 2 - g / 2,
y: c + b / 2 - G / 2,
width: g,
height: G
} : {
x: o,
y: c,
width: M,
height: b
}, u.rect) {
var r = u.compInfos,
S = r.length;
S && (r[S - 1].rect.image = N)
} else u.rect = W
}
if ("center" === I) {
var F = J !== !1 && (g > M || G > b);
F && (T.save(), T.beginPath(), T.rect(o, c, M, b), T.clip()), Yd(T, N, o + M / 2 - g / 2, c + b / 2 - G / 2, g, G, k, X, f, d), F && T.restore()
} else Yd(T, N, o, c, M, b, k, X, f, d)
}, toCanvas: function (A, F, R, z, $, E, x, t, u) {
A = ii(A, x), F = F || xc(A, $), R = R || oo(A, $);
var X = uo(),
D = Wd(X);
return t ? (Bn(X, F, R, t), D.scale(t, t)) : Bn(X, F, R, 1), qk(D, A, z, 0, 0, F, R, $, E, x, u), A && A.clampToEdge && (X.clampToEdge = A.clampToEdge), D.restore(), X
}, toGrayColor: function (M) {
if (!M) return M;
var m = zd(M),
v = A(.299 * m[0] + .587 * m[1] + .114 * m[2]);
return "rgba(" + v + "," + v + "," + v + "," + m[3] / 255 + ")"
}, createGradientImage: function (Y, x, G, H) {
for (var i = ["L", 0, 0, Y, 0, 1, 0, 0, 1, 0, 0], r = 0, e = Math.min(x.length, G.length); e > r; r++) i.push(G[r], x[r]);
var X = O.Default.toCanvas({
width: Y,
height: Y,
clampToEdge: !0,
comps: [{
type: "shape",
rotation: H || 0,
points: [0, 0, Y, 0, Y, Y, 0, Y],
background: "#ffffff",
gradientPack: i
}]
});
return X
}, createElement: function (h, _, X, Y) {
var n = U.createElement(h);
return Yq(n, _ || S.widgetBorder, 2), n.style.font = X ? X : Fh, Y != F && (n.value = Y), u.onElementCreated && u.onElementCreated(n), n
}, containedInView: function (f, R) {
var D = Bq(R).getBoundingClientRect();
return cf({
x: D.left,
y: D.top,
width: D.width,
height: D.height
}, lb(f))
}, isIsolating: function () {
return aj > 0
}, setIsolating: function (i) {
i ? aj++ : aj--
}, getMSMap: function () {
return fb
}, stringify: function (E, m, w) {
var r = Date.prototype.toJSON;
Date.prototype.toJSON = function () {
return "__ht__date" + this.getTime()
}, m = w ? 0 : m == F ? 2 : m;
var A = JSON.stringify(E, function (K, $) {
return "function" == typeof $ ? "__ht__" + ($.__ht__ || $.toString()) : Bp($) ? Oo($) : $ instanceof O.List ? "__ht__list" + ($.__ht__list || u.stringify($._as)) : $
}, m);
return Date.prototype.toJSON = r, w && (A = Xl + bn(A)), A
}, parse: function (M) {
return dk(M) ? M.substr(0, 12) != Xl || (M = _o(M.substr(12)), dk(M)) ? JSON.parse(M, function (l, t) {
if (dk(t))
if ("__ht__function" == t.substr(0, 14)) {
var P = t.indexOf("{") + 1,
C = t.lastIndexOf("}"),
w = t.indexOf("(") + 1,
j = t.indexOf(")");
if (P && C && w && j) try {
var K = new Function(t.substring(w, j), t.substring(P, C));
return K.__ht__ = t.substr(6), K
} catch (v) {
throw console.info("=== SyntaxError ===\n", t), v
}
} else {
if ("__ht__date" == t.substr(0, 10)) return new Date(Zb(t.substr(10)));
if ("__ht__list" === t.substr(0, 10)) return new xr(u.parse(t.substr(10)))
}
return t
}) : M : M
}, loadJS: function (b, x) {
x && b.push(x);
var n = b.shift();
if (ip(n)) b = n.contact(b), u.loadJS(b);
else if (Mf(n)) n(), u.loadJS(b);
else if (dk(n)) {
var m = U.createElement("script");
m.onload = function () {
u.loadJS(b)
}, m.setAttribute("src", n), U.getElementsByTagName("head")[0].appendChild(m)
} else b.length && u.loadJS(b)
}, extendClass: function (A, m) {
var d = A.prototype;
for (var Y in m) fb[Y] && fb.hasOwnProperty(Y) ? fb[Y](d, m) : d[Y] = m[Y]
}, toRoundedCorner: function () {
function f(Y, s, m) {
Y.x = s.x, Y.y = s.e || m, Y.z = s.y
}
var n = new tl,
u = new tl,
R = new tl,
A = new tl;
return function (o, h) {
var _, e = 0;
o.getPoints && (e = o.getElevation(), o = o.getPoints()), _ = o instanceof xr ? o : new xr(o);
var t = _.size();
if (0 >= h) return {
points: _
};
var z = new xr,
C = new xr,
T = _.get(0);
f(n, T, e), z.add(T), C.add(1);
for (var S = 1; t > S; S++)
if (t > S + 1) {
var i = _.get(S),
p = _.get(S + 1);
f(u, i, e), f(R, p, e), A.subVectors(n, u).setLength(Math.min(.99 * A.length(), h)).add(u), i.e !== Z || T.e !== Z ? z.add({
x: A.x,
y: A.z,
e: A.y
}) : z.add({
x: A.x,
y: A.z
}), z.add(i), A.subVectors(R, u).setLength(Math.min(.99 * A.length(), h)).add(u), i.e !== Z || p.e !== Z ? z.add(T = {
x: A.x,
y: A.z,
e: A.y
}) : z.add(T = {
x: A.x,
y: A.z
}), n.copy(A), C.addAll([2, 3])
} else z.add(_.get(S)), C.add(2);
return {
points: z,
segments: C
}
}
}(),
toColorData: zd,
setCanvas: Bn,
createDiv: dd,
createDisabledDiv: lo,
createView: ve,
createCanvas: uo,
appendChild: sn,
initContext: Wd,
checkLoadingImage: Dd,
translateAndScale: tf,
layout: qp,
getPosition: Re,
drawPoints: en,
drawRoundRect: pg,
drawBorder: Ie,
setFocus: hr,
getter: kp,
setter: tg,
isEmptyObject: wd,
cameraPriority: function () {
var V = {
skybox: 0,
main: 1e4,
top: 1e7,
infinity: 1 / 0
};
return o.seal(o.defineProperties({}, {
skybox: {
configurable: !1,
enumerable: !1,
get: function () {
return V.skybox
}, set: function (q) {
if (q >= V.main) throw new RangeError("Skybox camera must have lower priority than the main camera.");
V.skybox = Number(q)
}
},
main: {
configurable: !1,
enumerable: !1,
get: function () {
return V.main
}, set: function (T) {
if (T <= V.skybox) throw new RangeError("Main camera must have higher priority than the skybox camera.");
if (T >= V.top) throw new RangeError("Main camera must have lower priority than the top camera.");
V.main = Number(T)
}
},
top: {
configurable: !1,
enumerable: !1,
get: function () {
return V.top
}, set: function (r) {
if (r <= V.main) throw new RangeError("Top camera must have higher priority than the main camera.");
V.top = Number(r)
}
}
}))
}()
}, !0), Uh(t, {
autoAdjustIndex: 1,
hierarchicalRendering: 1,
adjustChildrenToTop: 1,
autoHideScrollBar: 1,
autoUpdate: 1,
firstPersonMode: 1,
ortho: 1,
strict: 1,
stickToRight: 1,
instant: 1,
closePath: 1,
hierarchical: 1,
doubleClickToToggle: 1,
continuousLayout: 1,
syncSize: 1
}, !0);
var Nn = u.disabledOpacity,
gj = u.toolTipDelay,
ij = u.devicePixelRatio,
be = u.autoMakeVisible,
jr = u.autoHideScrollBar,
Nf = u.imageGradient,
me = u.showToolTip,
Um = u.hideToolTip,
up = u.dashPattern,
ob = u.lineCap,
Wl = u.lineJoin,
Dh = u.labelColor,
rf = u.labelSelectColor,
Fh = u.labelFont,
kc = u.widgetIndent,
Oi = u.widgetRowHeight,
um = u.widgetHeaderHeight,
Jk = u.widgetTitleHeight,
Ch = u.scrollBarColor,
di = u.scrollBarSize,
Lg = u.scrollBarTimeout,
un = u.scrollBarMinLength,
co = u.scrollBarInteractiveSize,
lq = u.zoomIncrement,
_f = u.scrollZoomIncrement,
db = u.pinchZoomIncrement,
us = u.zoomMax,
gh = u.zoomMin,
Wn = u.createObject,
Qc = u.preventDefault,
_c = u.setImage,
ii = u.getImage,
Dr = u.isImageComplete,
Ii = u.drawCenterImage,
qk = u.drawStretchImage,
xp = u.getId,
$e = u.callLater,
td = u.cancelLater,
Sd = u.sortFunc,
Pm = u.clone,
gp = u.getClass,
Sf = u.startAnim,
Ee = u.brighter,
cn = u.darker,
nd = u.drawText,
ln = u.getTextSize,
jj = u.isLeftButton,
Fm = u.isMiddleButton,
tk = u.isRightButton,
Qj = u.getTouchCount,
wm = u.isDoubleClick,
Pf = u.isShiftDown,
ik = u.isCtrlDown,
lb = u.getClientPoint,
Fd = u.getPagePoint,
En = u.getDistance,
ms = u.unionPoint,
ni = u.unionRect,
cf = u.containsPoint,
$k = u.containsRect,
Kj = u.intersectsRect,
ro = u.intersection,
hq = u.getWindowInfo,
vn = u.grow,
Nm = u.getLogicalPoint,
Qo = u.getScreenPoint,
Ui = u.startDragging,
yj = u.removeHTML,
$g = u.createElement,
Nl = u.segmentResolution,
Cq = u.shapeResolution,
rr = u.shapeSide,
yc = u.def,
ki = function (g, T, b) {
yc(Y + "." + g, T, b)
},
zj = function (R, Q) {
R.childNodes.forEach(function ($) {
Q($), zj($, Q)
})
};
Uh(u, {
toolTipLabelColor: Dh,
toolTipLabelFont: Fh,
toolTipBackground: S.toolTipBackground,
toolTipShadowColor: od,
debugTipLabelFont: Fh,
debugTipLabelColor: Dh,
debugTipBackground: S.toolTipBackground,
drawBreakableText: Om,
setDevicePixelRatio: function (m) {
ij = u.devicePixelRatio = "number" == typeof m ? m : x.devicePixelRatio, zj(U.body, function (U) {
var k = U._ht;
k && k._canvas && (Bn(k._canvas, k.getWidth(), k.getHeight()), k.redraw ? k.redraw() : k.iv())
})
}
}, !0);
var Wp = 1e-6,
$m = "undefined" != typeof Uint16Array ? Uint16Array : Array,
fk = "undefined" != typeof Float32Array ? Float32Array : Array,
fn = function (j, $, b) {
var V = [j[0] - $[0], j[1] - $[1], j[2] - $[2]];
if (b) {
var t = En(V);
t > 0 && (V[0] /= t, V[1] /= t, V[2] /= t)
}
return V
},
Cj = function () {
var l = "charCodeAt",
$ = 2 * (2 * Ki.length + 1);
for (var J in x)
if (J === Y + nq[0] + (oe.length + 2)) {
var w = x[J];
if (!w) break;
for (var A = w.length, R = 0; A > R; R++)
if (w[R][l](0) === $ && w[R + 1] != F && w[R + 1] === oe[0] && w[R + 2] != F && w[R + 2][l](0) === $) {
for (var N = R + 3; A > N; N++)
if (w[N][l](0) === $) {
if (0 == w[N + 1])
for (var h, X = N + 2; A > X; X++) {
if (w[X][l](0) === $) {
0 == w[X - 1] && h && ($f = h.substr(0, h.length - 1));
break
}
h == F ? h = w[X] : h += w[X]
}
break
}
break
}
break
}
return function (E) {
return [-E[0], -E[1], -E[2]]
}
}(),
zc = function (u, n) {
return 3 === u.length ? u[0] * n[0] + u[1] * n[1] + u[2] * n[2] : u[0] * n[0] + u[1] * n[1]
},
kn = function () {
var $ = new Array(16);
return $[0] = 1, $[1] = 0, $[2] = 0, $[3] = 0, $[4] = 0, $[5] = 1, $[6] = 0, $[7] = 0, $[8] = 0, $[9] = 0, $[10] = 1, $[11] = 0, $[12] = 0, $[13] = 0, $[14] = 0, $[15] = 1, $
},
Hd = kn(),
Ql = function (q) {
var L = new Array(16);
return L[0] = q[0], L[1] = q[1], L[2] = q[2], L[3] = q[3], L[4] = q[4], L[5] = q[5], L[6] = q[6], L[7] = q[7], L[8] = q[8], L[9] = q[9], L[10] = q[10], L[11] = q[11], L[12] = q[12], L[13] = q[13], L[14] = q[14], L[15] = q[15], L
},
Vd = function (L, x) {
return L[0] = x[0], L[1] = x[1], L[2] = x[2], L[3] = x[3], L[4] = x[4], L[5] = x[5], L[6] = x[6], L[7] = x[7], L[8] = x[8], L[9] = x[9], L[10] = x[10], L[11] = x[11], L[12] = x[12], L[13] = x[13], L[14] = x[14], L[15] = x[15], L
},
yi = function (s) {
return s[0] = 1, s[1] = 0, s[2] = 0, s[3] = 0, s[4] = 0, s[5] = 1, s[6] = 0, s[7] = 0, s[8] = 0, s[9] = 0, s[10] = 1, s[11] = 0, s[12] = 0, s[13] = 0, s[14] = 0, s[15] = 1, s
},
Td = function (e, D) {
var y = e[0],
q = e[1],
g = e[2];
return e[0] = D[0] * y + D[4] * q + D[8] * g + D[12], e[1] = D[1] * y + D[5] * q + D[9] * g + D[13], e[2] = D[2] * y + D[6] * q + D[10] * g + D[14], e
},
Ek = function (o, K) {
var A = o[0],
b = o[1],
V = o[2],
r = o[3];
return o[0] = K[0] * A + K[4] * b + K[8] * V + K[12] * r, o[1] = K[1] * A + K[5] * b + K[9] * V + K[13] * r, o[2] = K[2] * A + K[6] * b + K[10] * V + K[14] * r, o[3] = K[3] * A + K[7] * b + K[11] * V + K[15] * r, o
},
Og = function () {
var J, V, A, C, k = Hc(Fe[1] + Fe[7]),
Y = Hc(Fe[0] + Fe[3] - Fe[10]),
r = Hc(Fe[8] + 2),
e = function () {
return V = A.charAt(J), J += 1, V
},
f = function () {
var E = "";
if (V === r)
for (; e();) {
if (V === r) return e(), E;
E += V
} else e()
},
h = function () {
for (; V && " " >= V;) e()
},
W = function () {
var Z, v = {};
if (V === k) {
if (e(), h(), V === Y) return e(), v;
for (; V;) {
if (Z = f(), h(), e(), v[Z] = C(), h(), V === Y) return e(), v;
e(), h()
}
}
};
return C = function () {
switch (h(), V) {
case k:
return W();
default:
return f()
}
},
function (s) {
if (g = {}, s) {
var n;
if (A = s, J = 0, V = " ", n = C(), h(), !V) return n
}
}
}(),
uh = function (F, D) {
if (D) {
var x = n(D),
e = k(D),
A = F[4],
f = F[5],
$ = F[6],
P = F[7],
d = F[8],
X = F[9],
u = F[10],
g = F[11];
F[4] = A * e + d * x, F[5] = f * e + X * x, F[6] = $ * e + u * x, F[7] = P * e + g * x, F[8] = d * e - A * x, F[9] = X * e - f * x, F[10] = u * e - $ * x, F[11] = g * e - P * x
}
},
ah = function (p, v) {
if (v) {
var m = n(v),
t = k(v),
R = p[0],
I = p[1],
f = p[2],
T = p[3],
x = p[8],
l = p[9],
K = p[10],
P = p[11];
p[0] = R * t - x * m, p[1] = I * t - l * m, p[2] = f * t - K * m, p[3] = T * t - P * m, p[8] = R * m + x * t, p[9] = I * m + l * t, p[10] = f * m + K * t, p[11] = T * m + P * t
}
},
wo = function (v, W) {
if (W) {
var u = n(W),
y = k(W),
H = v[0],
l = v[1],
K = v[2],
j = v[3],
U = v[4],
C = v[5],
t = v[6],
N = v[7];
v[0] = H * y + U * u, v[1] = l * y + C * u, v[2] = K * y + t * u, v[3] = j * y + N * u, v[4] = U * y - H * u, v[5] = C * y - l * u, v[6] = t * y - K * u, v[7] = N * y - j * u
}
},
sj = function (E, G, W) {
return Jn(F, W === !1 ? F : E.getFinalScale3d(), E.getFinalRotation3d(), E.getRotationMode(), E.p3(), F, G)
},
Jn = function (j, G, c, h, a, B, M) {
return B || (B = kn()), a && bo(B, a), Cl(B, c, h), M && xo(B, B, M), G && Bd(B, G), j && xo(B, B, j), B
},
pf = function (k, b, l) {
b = Zb(b), l = Zb(l);
var P = this;
P.g = k, P._84O = b, P._85O = l, P._70I = !0, P.F = 0, P._83O = b + l, P.pen = {
x: 0,
y: 0
}
},
ph = "lineDashOffset",
Ue = "setLineDash",
xf = function ($) {
for (var N in $) 1 === N.length && (ph = $[N]);
return N ? 1 : 0
},
ls = function (W, I, U) {
return Ro(I) ? W : W[Ue] ? (W[Ue](I), U && (W.lineDashOffset = U), W) : new pf(W, I[0], I.length > 1 ? I[1] : I[0])
},
_l = function (A, d) {
!Ro(d) && A[Ue] && (A[Ue](Pc), A.lineDashOffset = 0)
};
if (yc(pf, o, {
_69I: 6,
moveTo: function (V, e) {
var t = this,
D = t.pen;
D.x = V, D.y = e, t.g.moveTo(V, e), t.start || (t.start = {
x: V,
y: e
})
}, lineTo: function (S, $) {
var O = this,
V = O.pen,
N = S - V.x,
G = $ - V.y,
E = D(G, N),
v = k(E),
R = n(E),
U = O._23O(V.x, V.y, S, $),
y = O._85O,
A = O._84O,
b = O._83O;
if (O.F) {
if (O.F > U) return O._70I ? O._72I(S, $) : O.moveTo(S, $), O.F -= U, void 0;
if (O._70I ? O._72I(V.x + v * O.F, V.y + R * O.F) : O.moveTo(V.x + v * O.F, V.y + R * O.F), U -= O.F, O.F = 0, O._70I = !O._70I, !U) return
}
var r = T(U / b);
if (r) {
for (var B = v * A, e = R * A, K = v * y, w = R * y, z = 0; r > z; z++) O._70I ? (O._72I(V.x + B, V.y + e), O.moveTo(V.x + K, V.y + w)) : (O.moveTo(V.x + K, V.y + w), O._72I(V.x + B, V.y + e));
U -= b * r
}
O._70I ? U > A ? (O._72I(V.x + v * A, V.y + R * A), O.moveTo(S, $), O.F = y - (U - A), O._70I = !1) : (O._72I(S, $), U === A ? (O.F = 0, O._70I = !O._70I) : (O.F = A - U, O.moveTo(S, $))) : U > y ? (O.moveTo(V.x + v * y, V.y + R * y), O._72I(S, $), O.F = A - (U - y), O._70I = !0) : (O.moveTo(S, $), U === y ? (O.F = 0, O._70I = !O._70I) : O.F = y - U)
}, quadraticCurveTo: function (y, h, r, f) {
var E, x = this,
i = x.pen,
z = i.x,
d = i.y,
w = x._22O(z, d, y, h, r, f),
M = 0,
C = 0,
t = x._85O,
X = x._84O;
if (x.F) {
if (x.F > w) return x._70I ? x._71I(y, h, r, f) : x.moveTo(r, f), x.F -= w, void 0;
if (M = x.F / w, E = x._20O(z, d, y, h, r, f, M), x._70I ? x._71I(E[2], E[3], E[4], E[5]) : x.moveTo(E[4], E[5]), x.F = 0, x._70I = !x._70I, !w) return
}
var e = w - w * M,
P = T(e / x._83O),
G = X / w,
W = t / w;
if (P)
for (var K = 0; P > K; K++) x._70I ? (C = M + G, E = x._21O(z, d, y, h, r, f, M, C), x._71I(E[2], E[3], E[4], E[5]), M = C, C = M + W, E = x._21O(z, d, y, h, r, f, M, C), x.moveTo(E[4], E[5])) : (C = M + W, E = x._21O(z, d, y, h, r, f, M, C), x.moveTo(E[4], E[5]), M = C, C = M + G, E = x._21O(z, d, y, h, r, f, M, C), x._71I(E[2], E[3], E[4], E[5])), M = C;
e = w - w * M, x._70I ? e > X ? (C = M + G, E = x._21O(z, d, y, h, r, f, M, C), x._71I(E[2], E[3], E[4], E[5]), x.moveTo(r, f), x.F = t - (e - X), x._70I = !1) : (E = x._19O(z, d, y, h, r, f, M), x._71I(E[2], E[3], E[4], E[5]), w === X ? (x.F = 0, x._70I = !x._70I) : (x.F = X - e, x.moveTo(r, f))) : e > t ? (C = M + W, E = x._21O(z, d, y, h, r, f, M, C), x.moveTo(E[4], E[5]), E = x._19O(z, d, y, h, r, f, C), x._71I(E[2], E[3], E[4], E[5]), x.F = X - (e - t), x._70I = !0) : (x.moveTo(r, f), e === t ? (x.F = 0, x._70I = !x._70I) : x.F = t - e)
}, bezierCurveTo: function () {
var M = arguments;
this.pen = {
x: M[4],
y: M[5]
}, this.g.bezierCurveTo(M[0], M[1], M[2], M[3], M[4], M[5])
}, arc: function (M, g, v, C, e, S) {
S || (C = -C, e = -e), mo(this, M, g, C, e - C, v, v, !1)
}, rect: function (G, z, t, $) {
var Q = this;
Q.pen = {
x: G,
y: z
}, Q.moveTo(G, z), Q.lineTo(G, z + $), Q.lineTo(G + t, z + $), Q.lineTo(G + t, z), Q.lineTo(G, z)
}, beginPath: function () {
this.g.beginPath()
}, closePath: function () {
this.lineTo(this.start.x, this.start.y)
}, _23O: function (O, c, l, Z) {
var h = l - O,
b = Z - c;
return w(h * h + b * b)
}, _22O: function (X, t, r, J, o, W, I) {
for (var z, e, q, $, a, A, Z, V = 0, G = X, s = t, m = I > 0 ? I : this._69I, w = 1; m >= w; w++) q = w / m, $ = 1 - q, a = $ * $, A = 2 * q * $, Z = q * q, z = a * X + A * r + Z * o, e = a * t + A * J + Z * W, V += this._23O(G, s, z, e), G = z, s = e;
return V
}, _21O: function (y, E, z, L, g, U, I, f) {
var J = this;
if (0 === I) return J._20O(y, E, z, L, g, U, f);
if (1 === f) return J._19O(y, E, z, L, g, U, I);
var H = J._20O(y, E, z, L, g, U, f);
return H.push(I / f), J._19O.apply(J, H)
}, _20O: function (x, O, o, T, a, m, N) {
if (1 !== N) {
var C = o + (a - o) * N,
g = T + (m - T) * N;
o = x + (o - x) * N, T = O + (T - O) * N, a = o + (C - o) * N, m = T + (g - T) * N
}
return [x, O, o, T, a, m]
}, _19O: function (l, A, I, d, Y, r, h) {
if (1 !== h) {
var w = l + (I - l) * h,
P = A + (d - A) * h;
I += (Y - I) * h, d += (r - d) * h, l = w + (I - w) * h, A = P + (d - P) * h
}
return [l, A, I, d, Y, r]
}, _72I: function (u, $) {
var j = this.pen;
(u !== j.x || $ !== j.y) && (j.x = u, j.y = $, this.g.lineTo(u, $))
}, _71I: function (u, i, t, y) {
var U = this.pen;
(u !== t || i !== y || t !== U.x || y !== U.y) && (U.x = t, U.y = y, this.g.quadraticCurveTo(u, i, t, y))
}
}), _ && ge) {
var vk = ge.toString();
Ad = vk.indexOf(fc.substr(0, 2)) > 0 && vk.indexOf($c + $c.substr(1, 1)) > 1 || vk.indexOf(Kb.substr(0, 2) + fc.substr(2, 2) + nq[0] + fc[4]) > 1 ? !0 : !1
}
var mc = F,
md = F,
Fo = u.checkLoadingCompType = function (N) {
mc && !N._72O && (md || (md = {}), md[N._72O = xp()] = N)
},
qs = function (K, s) {
if (s || (s = K), s && (mc || (mc = {}), !mc[K])) {
var z = new De;
if (mc[s] = {
request: z,
url: s
}, s = u.beforeLoadURL(s, K), s.data) {
var M = u.parse(s.data);
Ko(K, M), u.handleCompTypeLoaded(K, M)
} else {
z.onload = function () {
if (200 === this.status || 0 === this.status) {
var O = u.parse(z.getResponseText());
Ko(K, O), u.handleCompTypeLoaded(K, O)
} else Ko(K, F)
}, z.onerror = function () {
Ko(K, F)
};
var n = {};
n.url = encodeURI(s), n.sync = !1, z.send(n)
}
}
},
Ko = function (J, M) {
if (Xh[J] = M, delete mc[J], wd(mc) && (mc = F, md)) {
for (var e in md) {
var H = md[e];
H.invalidateAll && H.invalidateAll(Z, "compTypeLoaded", J), H.redraw && H.redraw(), H.iv(), delete H._72O
}
md = F
}
if (M && md)
for (var e in md) {
var H = md[e];
H.invalidateAll && H.invalidateAll(Z, "compTypeLoading", J), H.redraw && H.redraw(), H.iv()
}
},
ch = S.chart,
Nh = "",
Jp = !0,
Hn = u.compStack = [],
Yf = /^style@/,
Gn = /^attr@/,
Se = /^field@/,
Tm = {
x: .5,
y: .5
},
_m = function () {
Jp = !0
},
zm = function () {
return Jp
},
xc = function (h, H, K, I) {
if (!h) return 0;
if (Dj(h.fitSize, H, K) && I) return I;
var W = Dj(h.width, H, K);
return null == W ? 20 : W
},
oo = function (w, n, L, E) {
if (!w) return 0;
if (Dj(w.fitSize, n, L) && E) return E;
var J = Dj(w.height, n, L);
return null == J ? 20 : J
},
Dj = function (g, v, b) {
if (!g || !g.func) return g;
var R, I = g.func,
H = g.value;
return R = Mf(I) ? b && b.vectorDataBindingDisabled && !g.isSafeFunc ? H : I(v, b) : v instanceof Qp || (O.ui ? v instanceof O.ui.View : 0) ? Gn.test(I) ? v.a(Nh + I.slice(5)) : Yf.test(I) ? v.s(Nh + I.slice(6)) : Se.test(I) ? v[I.slice(6)] : v[I] ? v[I](b) : H : H, H !== Z && R == F ? H : R
},
Yd = u.drawImage = function () {
var f, d, h, s, z, A, v = function (Y, v) {
Y.getValue && Y.getValue.compType === v || (Y.getValue = function (I) {
var u = Q(Y, I);
if (u === Z && v.properties) {
var T = v.properties[I];
T && (u = T.defaultValue)
}
return u
}, Y.getColor = function (W, S) {
return S === !0 ? b(W) : b(Y.getValue(W))
}, Y.getValue.compType = v)
},
Q = function (n, l, s) {
var e, B = !1;
if (n.prefix && d instanceof Qp) {
var c = d.a(Nh + l);
c !== Z && (B = !0, e = c)
}
return e === Z && (e = n[l]), e && e.func && (B = !0, e = Dj(e, d, h)), s && (e = s(e), B || (n[l] = e)), e
},
b = function (P, B) {
var D;
return D = B ? Q(P, B) : P, f && f.compGray && D ? u.toGrayColor(D) : z && D ? nm(D, z, A) : D
},
X = function (j) {
if (ip(j)) {
for (var L = new xr, b = j.length, n = 0; b > n; n += 2) L.add({
x: j[n],
y: j[n + 1]
});
j = L
}
return j
},
D = function (G) {
var b = Q(G, "anchorX"),
c = Q(G, "anchorY");
if (b !== Z || c !== Z) return {
x: b === Z ? Tm.x : b,
y: c === Z ? Tm.y : c
};
var f = Q(G, "type"),
e = Q(G, "name");
if ("image" !== f || !e) return Tm;
var J = ii(e);
return J && J.anchorX !== Z && J.anchorY !== Z ? {
x: J.anchorX,
y: J.anchorY
} : Tm
},
p = function (W, t) {
var y = Q(W, Tq),
E = D(W);
if (ip(y)) {
var x = y.length,
r = Q(W, "relative"),
z = t.width,
T = t.height;
if (4 === x) y = {
x: y[0],
y: y[1],
width: y[2],
height: y[3]
}, r && (y.x *= z, y.y *= T, y.width *= z, y.height *= T);
else if (3 === x) {
var J = y[0];
y = {
width: y[1],
height: y[2]
}, r && (y.width *= z, y.height *= T), "object" == typeof J ? J.length && (J = {
x: J[0],
y: J[1]
}) : J = Re(J, t, y), y.x = J.x - y.width * E.x, y.y = J.y - y.height * E.y
}
y.x += Q(W, "offsetX") || 0, y.y += Q(W, "offsetY") || 0, !r && t.fitSize && (y = M(W, y, t))
}
return y
},
M = function (n, s, T) {
if (s) {
var l, a, q, B = {
x: s.x,
y: s.y,
width: s.width,
height: s.height
},
u = D(n),
U = Q(n, "layoutH"),
m = Q(n, "layoutV"),
Y = 1,
t = 1,
P = 0,
v = 0,
Z = 1,
f = 1;
switch (U) {
case "left":
break;
case "right":
B.x += T.width - T.rw;
break;
case "center":
B.x += .5 * (T.width - T.rw);
break;
case "scale":
case "leftright":
default:
l = Q(n, ac) || 0, l && (P = Math.abs(v = Math.sin(l)), Z = Math.abs(f = Math.cos(l))), "leftright" !== U ? (Y += Z * (T.widthScale - 1), t += P * (T.widthScale - 1)) : (Y += B.width ? Z * (T.width - T.rw) / B.width : 0, t += B.height ? P * (T.width - T.rw) / B.height : 0, a = -Math.min(-u.x * f + u.y * v, -u.x * f - (1 - u.y) * v, (1 - u.x) * f + u.y * v, (1 - u.x) * f - (1 - u.y) * v))
}
switch (m) {
case "top":
break;
case "bottom":
B.y += T.height - T.rh;
break;
case "center":
B.y += .5 * (T.height - T.rh);
break;
case "scale":
case "topbottom":
default:
l == F && (l = Q(n, ac), l && (P = Math.abs(v = Math.sin(l)), Z = Math.abs(f = Math.cos(l)))), "topbottom" !== m ? (Y += P * (T.heightScale - 1), t += Z * (T.heightScale - 1)) : (Y += B.width ? P * (T.height - T.rh) / B.width : 0, t += B.height ? Z * (T.height - T.rh) / B.height : 0, q = -Math.min(-u.x * v - u.y * f, -u.x * v + (1 - u.y) * f, (1 - u.x) * v - u.y * f, (1 - u.x) * v + (1 - u.y) * f))
}
return (1 !== Y || 1 !== t) && ("scale" !== U && U ? "leftright" === U && (B.x += B.width * (1 - Y) * u.x + a * (T.width - T.rw)) : B.x += B.x * (T.widthScale - 1) + u.x * B.width * (T.widthScale - Y), "scale" !== m && m ? "topbottom" === m && (B.y += B.height * (1 - t) * u.y + q * (T.height - T.rh)) : B.y += B.y * (T.heightScale - 1) + u.y * B.height * (T.heightScale - t), B.width *= Y, B.height *= t), B.width < 0 && (B.width = 0), B.height < 0 && (B.height = 0), B
}
},
y = function (J) {
return ip(J) ? new xr(J) : J
},
W = function (o, c, I, $, x, R, T) {
var G = f.interactiveInfo,
_ = o.transform;
if (_) return f.save(), f.setTransform(_.a, _.b, _.c, _.d, _.tx, _.ty), G && G.compInfos.push({
comp: o,
rect: c,
matrix: _.clone(),
prefix: Nh,
refRect: G.refRect
}), !0;
x === Z && (x = 1), R === Z && (R = 1);
var S = Q(o, "clipPercentage"),
W = jg(I, c);
if (W && !$ && 1 === x && 1 === R && !(1 > S)) return G && G.compInfos.push({
comp: o,
rect: c,
matrix: G.matrix.clone(),
prefix: Nh,
refRect: G.refRect
}), !1;
T = T || Tm;
var N = c.x + c.width * T.x,
M = c.y + c.height * T.y,
p = I.x + I.width * T.x,
j = I.y + I.height * T.y,
E = I.width ? x * (c.width / I.width) : 1,
k = I.height ? R * (c.height / I.height) : 1;
if (f.save(), G && (G.matrix.appendTranslate(N, M).appendRotate($).appendScale(E, k).appendTranslate(-p, -j), G.compInfos.push({
comp: o,
rect: c,
matrix: G.matrix.clone(),
prefix: Nh,
refRect: G.refRect
})), wh(f, N, M), jc(f, $ || 0), ec(f, E, k), wh(f, -p, -j), 1 > S) {
0 > S && (S = 0);
var w = Wh(I, Q(o, "clipDirection"), S);
f.beginPath(), f.rect(w.x, w.y, w.width, w.height), f.clip()
}
return !0
},
O = function () {
f.restore()
},
S = function (n, N, G) {
var o = Q(n, "path"),
z = Q(n, ac),
L = Q(n, "scaleX"),
l = Q(n, "scaleY"),
m = D(n),
P = F,
S = jp(null, o);
if (G || (G = n.unionRect, G || (G = ms(S), n.path.func || (n.unionRect = G)), P = G), G) {
P || (P = n.unionRect, P || (P = ms(S), n.path.func || (n.unionRect = P)));
var q = W(n, G, P, z, L, l, m),
c = Q(n, "borderPattern"),
v = ls(f, c),
a = b(n, "background"),
r = b(n, "borderColor"),
H = Q(n, "borderWidth"),
j = Q(n, "gradient"),
B = b(n, "gradientColor"),
y = Q(n, "border3d"),
U = b(n, "border3dColor"),
Y = Q(n, "border3dAccuracy"),
I = f.lineJoin,
X = f.lineCap;
f.lineJoin = Q(n, "borderJoin") || Wl, f.lineCap = Q(n, "borderCap") || ob, a ? (Ge(f, a, j, B, P), jp(f, o), f.fill(), v !== f && jp(f, o)) : jp(f, o);
var M = Q(n, "borderWidthAbsolute");
if (M && (f.save(), f.setTransform(1, 0, 0, 1, 0, 0)), H && r && (f.lineWidth = H, f.strokeStyle = r, f.stroke(), y && fr(f, r, U, H, s, Y)), _l(f, c), Q(n, "dash")) {
var h = Q(n, "dashWidth") || H;
if (h > 0) {
c = Q(n, "dashPattern") || up;
var v = ls(f, c, Q(n, "dashOffset")),
Z = b(n, "dashColor") || b(dm);
v !== f && jp(f, o), f.strokeStyle = Z, f.lineWidth = h, f.stroke(), Q(n, "dash3d") && fr(f, Z, b(n, "dash3dColor"), h, s, Q(n, "dash3dAccuracy")), _l(f, c)
}
}
M && f.restore(), N === Tq && Wq(f, a, Q(n, "depth"), P), f.lineJoin = I, f.lineCap = X, q && O()
}
},
N = function ($, e, T, p) {
var x = Q($, _b, X),
G = Q($, ac),
B = D($);
if (x && p.fitSize) {
var m = new xr,
V = ms(x),
Y = M($, V, p),
P = V.x + B.x * V.width,
_ = V.y + B.y * V.height,
K = Y.x + B.x * Y.width,
u = Y.y + B.y * Y.height,
N = V.width ? Y.width / V.width : 1,
c = V.height ? Y.height / V.height : 1;
x.each(function (w) {
m.add({
x: K + (w.x - P) * N,
y: u + (w.y - _) * c
})
}), x = m, $.unionRect = null
}
var j = Q($, "scaleX"),
C = Q($, "scaleY"),
v = e === bl,
R = F;
if (!T && v && (T = $.unionRect, T || (T = ms(x), $.points.func || ($.unionRect = T)), R = T), T) {
v ? R || (R = $.unionRect, R || (R = ms(x), $.points.func || ($.unionRect = R))) : R = T;
var i, r, o, n, E = W($, T, R, G, j, C, B),
S = Q($, "borderPattern"),
H = ls(f, S),
w = b($, "background"),
U = ii(Q($, "repeatImage"), z, A),
q = Q($, "gradientPack"),
k = b($, "borderColor"),
g = Q($, "borderWidth"),
I = ii(Q($, "borderRepeatImage"), z, A),
J = Q($, "segments", y),
l = Q($, "gradient"),
t = b($, "gradientColor"),
L = Q($, "border3d"),
a = b($, "border3dColor"),
Z = Q($, "border3dAccuracy"),
Gd = Q($, "closePath"),
gg = Q($, "fillRule") || "nonzero",
kk = f.lineJoin,
Pq = f.lineCap;
if (f.lineJoin = Q($, "borderJoin") || Wl, f.lineCap = Q($, "borderCap") || ob, v)
if (w || U || q) {
var Te = Q($, "fillClipPercentage");
if (1 > Te) {
0 > Te && (Te = 0);
var km = Wh(R, Q($, "fillClipDirection"), Te);
f.save(), f.beginPath(), f.rect(km.x, km.y, km.width, km.height), f.clip()
}
en(f, x, J, Gd), q ? uq(f, q, b) : U ? fg(f, U, z, A, d, h) : Ge(f, w, l, t, R), f.fill(gg), q && f.restore(), 1 > Te && f.restore(), H !== f && en(H, x, J, Gd)
} else en(H, x, J, Gd);
else if ("roundRect" === e ? i = Q($, "cornerRadius") : "polygon" === e ? i = Q($, "polygonSide") : "arc" === e && (i = Q($, "arcFrom"), r = Q($, "arcTo"), o = Q($, "arcClose"), n = Q($, "arcOval")), w || U || q) {
var Te = Q($, "fillClipPercentage");
if (1 > Te) {
0 > Te && (Te = 0);
var km = Wh(R, Q($, "fillClipDirection"), Te);
f.save(), f.beginPath(), f.rect(km.x, km.y, km.width, km.height), f.clip()
}
Ej(f, e, R, i, r, o, n), q ? uq(f, q, b) : U ? fg(f, U, z, A, d, h) : Ge(f, w, l, t, R), f.fill(gg), q && f.restore(), 1 > Te && f.restore(), f !== H && Ej(H, e, R, i, r, o, n)
} else Ej(H, e, R, i, r, o, n);
var yh = Q($, "borderWidthAbsolute");
if (yh && (f.save(), f.setTransform(1, 0, 0, 1, 0, 0)), g && (k || I) && (f.lineWidth = g, I ? qb(f, I, z, A, d, h) : f.strokeStyle = k, f.stroke(), L && fr(f, k, a, g, s, Z)), _l(f, S), Q($, "dash")) {
var Yi = Q($, "dashWidth") || g;
if (Yi > 0) {
S = Q($, "dashPattern") || up;
var H = ls(f, S, Q($, "dashOffset")),
Yr = b($, "dashColor") || b(dm);
H !== f && (v ? en(H, x, J, Gd) : Ej(H, e, R, i, r, o, n)), f.strokeStyle = Yr, f.lineWidth = Yi, f.stroke(), Q($, "dash3d") && fr(f, Yr, b($, "dash3dColor"), Yi, s, Q($, "dash3dAccuracy")), _l(f, S)
}
}
yh && f.restore(), e === Tq && Wq(f, w, Q($, "depth"), R), f.lineJoin = kk, f.lineCap = Pq, E && O()
}
},
K = function (u, U) {
var Z = z || Q(u, dg),
w = A || Q(u, "blendMode"),
D = Q(u, "name"),
o = ii(D, Z, w);
o ? qk(f, o, Q(u, "stretch"), U.x, U.y, U.width, U.height, d, h, Z, null, w) : Jp = !1
},
L = function (G, c) {
var g = Q(G, "text");
g != F && nd(f, g, Q(G, "font"), b(G, dg), c.x, c.y, c.width, c.height, Q(G, "align"), Q(G, "vAlign"))
},
G = function (A, d) {
Ie(f, b(A, dg), d.x, d.y, d.width, d.height, Q(A, "width"))
},
P = function (p, W) {
var E = Q(p, kd),
D = 0;
if (E && (E.forEach(function (V) {
D += V
}), D > 0)) {
for (var h = Q(p, "colors") || ch, B = Q(p, "startAngle") || 0, R = Q(p, "hollow"), I = Q(p, Bg), N = Q(p, Vm), M = Q(p, fe), P = I ? new xr : F, t = W.x, v = W.y, m = W.width, z = W.height, Y = t + m / 2, r = v + z / 2, y = V(m, z) / 2, j = 0, l = 0; l < E.length; l++) {
var c = E[l],
x = $ * c / D,
U = B + x;
if (f.fillStyle = h[j++], j === h.length && (j = 0), f.beginPath(), R) {
var q = Y + k(B) * y / 2,
i = r + n(B) * y / 2,
A = Y + k(U) * y,
X = r + n(U) * y;
f.moveTo(q, i), f.arc(Y, r, y / 2, B, U, !1), f.lineTo(A, X), f.arc(Y, r, y, U, B, !0)
} else f.moveTo(Y, r), f.arc(Y, r, y, U, B, !0);
P && (x = (B + U) / 2, P.add({
text: Mf(I) ? I(c, l, D, d) : c,
x: Y + .75 * k(x) * y,
y: r + .75 * n(x) * y
})), f.closePath(), f.fill(), B = U
}
P && P.each(function (t) {
nd(f, t.text, N, M, t.x, t.y, 0, 0, sc)
})
}
},
I = function (X, l) {
var o = Q(X, Kh);
if (o && o.length > 0) {
var P = o.length,
T = Q(X, Bg),
R = Q(X, Vm),
S = Q(X, fe),
b = T ? new xr : F,
w = Q(X, "minValue") || 0,
n = Q(X, "maxValue");
if (n == F && (n = 0, o.forEach(function (A) {
Q(A, kd).forEach(function (v) {
n = q(n, v)
})
})), w === n) return;
for (var x = l.height / (n - w), t = l.y + n * x, c = Q(o[0], kd).length, I = l.width / (3 * c + 1), r = 2 * I / P, h = 0, M = 0; P > M; M++)
for (var s = o[M], k = Q(s, dg), j = Q(s, "colors"), B = Q(s, kd), K = 0; c > K; K++) {
j ? f.fillStyle = j[K] : k ? f.fillStyle = k : (f.fillStyle = ch[h++], h === ch.length && (h = 0));
var C = B[K],
Z = C * x,
z = l.x + (1 + 3 * K) * I + M * r;
if (fl(f, z, t - Z, r, Z), b) {
var W = Mf(T) ? T(C, K, s, d) : C,
H = ln(R, W).height;
b.add({
x: z,
y: t - Z - H,
width: r,
height: H,
text: W
})
}
}
b && b.each(function (L) {
nd(f, L.text, R, S, L.x, L.y, L.width, L.height, sc)
})
}
},
j = function (T, g) {
var v = Q(T, Kh);
if (v && v.length > 0) {
var u = v.length,
$ = Q(v[0], kd).length,
H = g.width / (3 * $ + 1),
B = 0,
w = Q(T, "maxValue"),
S = Q(T, Bg),
U = Q(T, Vm),
M = Q(T, fe),
D = S ? new xr : F;
if (w == F) {
w = 0;
for (var O = 0; $ > O; O++) {
for (var C = 0, V = 0; u > V; V++) C += Q(v[V], kd)[O];
w = q(w, C)
}
}
if (w > 0) {
for (var O = 0; $ > O; O++)
for (var m = g.y + g.height, V = 0; u > V; V++) {
var J = v[V],
Y = Q(J, dg),
z = Q(J, kd)[O],
E = z / w * g.height;
Y ? f.fillStyle = Y : (f.fillStyle = ch[B++], B === ch.length && (B = 0)), m -= E;
var k = {
x: g.x + (1 + 3 * O) * H,
y: m,
width: 2 * H,
height: E
};
fl(f, k.x, k.y, k.width, k.height), D && (k.text = Mf(S) ? S(z, O, J, d) : z, D.add(k))
}
D && D.each(function (n) {
nd(f, n.text, U, M, n.x, n.y, n.width, n.height, sc)
})
}
}
},
r = function (L, R) {
var C = Q(L, Kh);
if (C && C.length > 0) {
for (var q = C.length, V = Q(C[0], kd).length, u = R.width / (3 * V + 1), Y = 0, K = Q(L, Bg), N = Q(L, Vm), t = Q(L, fe), b = K ? new xr : F, r = 0; V > r; r++) {
for (var s = 0, o = 0; q > o; o++) s += Q(C[o], kd)[r];
if (s > 0) {
var W = R.y + R.height;
for (o = 0; q > o; o++) {
var O = C[o],
T = Q(O, dg),
j = Q(O, kd)[r],
g = j / s * R.height;
T ? f.fillStyle = T : (f.fillStyle = ch[Y++], Y === ch.length && (Y = 0)), W -= g;
var x = {
x: R.x + (1 + 3 * r) * u,
y: W,
width: 2 * u,
height: g
};
fl(f, x.x, x.y, x.width, x.height), b && (x.text = Mf(K) ? K(j, r, O, d) : j, b.add(x))
}
}
}
b && b.each(function ($) {
nd(f, $.text, N, t, $.x, $.y, $.width, $.height, sc)
})
}
},
e = function (H, U) {
var D = Q(H, Kh);
if (D && D.length > 0) {
var G = D.length,
_ = Q(H, "minValue") || 0,
E = Q(H, "maxValue");
if (E == F && (E = 0, D.forEach(function ($) {
Q($, kd).forEach(function (e) {
E = q(E, e)
})
})), _ === E) return;
for (var z = U.height / (E - _), u = U.y + E * z, k = Q(D[0], kd).length, A = U.width / (3 * k + 1), m = 0, Z = Q(H, "lineWidth") || 2, V = Q(H, "line3d"), N = Q(H, "linePoint"), v = Q(H, Bg), K = Q(H, Vm), w = Q(H, fe), T = 0; G > T; T++) {
var c = D[T],
i = Q(c, dg),
t = Q(c, kd);
i ? f.strokeStyle = i : (i = f.strokeStyle = ch[m++], m === ch.length && (m = 0)), f.beginPath();
for (var P = 0; k > P; P++) {
var R = U.x + (2 + 3 * P) * A,
y = u - t[P] * z;
0 === P ? f.moveTo(R, y) : f.lineTo(R, y)
}
if (f.lineWidth = Z, f.stroke(), V && fr(f, i, F, Z, s), N || v) {
var x, l = Z / 2 + 2;
for (P = 0; k > P; P++) {
var n = t[P];
if (R = U.x + (2 + 3 * P) * A, y = u - n * z, Mf(N) ? N(f, R, y, i, P, c, d) : N && (f.fillStyle = i, f.beginPath(), f.arc(R, y, l, 0, $, !0), f.fill()), Mf(v) ? x = v(n, P, c, d) : v && (x = n), x) {
var g = ln(K, x).height,
p = f.shadowBlur;
if (p) {
var J = f.shadowOffsetX,
B = f.shadowOffsetY,
I = f.shadowColor;
f.shadowOffsetX = 0, f.shadowOffsetY = 0, f.shadowBlur = 0, f.shadowColor = F
}
nd(f, x, K, w, R, y - g - l + 2, 0, g, sc), p && (f.shadowOffsetX = J, f.shadowOffsetY = B, f.shadowBlur = p, f.shadowColor = I)
}
}
}
}
}
},
H = function (O) {
f = O[0], d = O[1], h = O[2], s = O[3], z = O[4], A = O[5]
},
B = function () {
return [f, d, h, s, z, A]
},
E = function ($, u) {
var Y;
h && h.getDrawableState ? Y = h.getDrawableState(d) : h && h.getState ? Y = h.getState(d) : (Y = d instanceof Qp ? d.s(Cp) : null, (Y === Z || null === Y) && (Y = Q($, Cp)));
var o = Q(u, Cp);
return o !== Z && null !== o && o !== Y ? !1 : Q(u, Pd)
},
t = {
border: G,
image: K,
text: L,
pieChart: P,
columnChart: I,
stackedColumnChart: j,
percentageColumnChart: r,
lineChart: e
};
return function (T, L, G, i, V, U, e, J, r, n) {
if (L && V && U) {
var P = B();
f = T, d = e, h = J, !d && h && h.isSelfViewEvent && (d = h), s = h ? h._zoom ? h._zoom : 1 : 1, z = r, A = n;
var j = V,
a = U;
if (true){//Jq()) {//时间修改
//Jq();//日期控件不能正常显示后加上
//var o, R, g, I, w;
//0 === f[Pq] ? Jq[0] && (o = !0) : o = !0, f.texureImage2D ? Jq[1] && (R = !0) : R = !0, f.texureImage3D ? Jq[2] && (g = !0) : g = !0, f.drawDNDState ? Jq[3] && (w = !0) : w = !0, rq.widget[0] ? Jq[4] && (I = !0) : I = !0, o && R && g && I && w && (j = G, a = i)
Jq();
var o, R, g, I, w;
0 === f[Pq] ? Jq[0] && (o = !0) : o = !0;
f.texureImage2D ? Jq[1] && (R = !0) : R = !0;
f.texureImage3D ? Jq[2] && (g = !0) : g = !0;
f.drawDNDState ? Jq[3] && (w = !0) : w = !0;
rq.widget[0] ? Jq[4] && (I = !0) : I = !0;
j = G;
a = i;
}
if (L.tagName) return dk($f) && !x[$f] || f.drawImage(L, j, a, V, U), H(P), void 0;
if (0 == Q(L, "visible")) return H(P), void 0;
z || (z = Dj(L.color, d, h)), n || (A = Dj(L.blendMode, d, h)), dk($f) && !x[$f] && (V = j, U = a);
var k = xc(L, d, h, V),
K = oo(L, d, h, U),
M = {
x: 0,
y: 0,
width: k,
height: K,
fitSize: Q(L, "fitSize")
},
q = Q(L, "clip"),
Y = Q(L, "opacity");
if (M.fitSize) {
var $ = M.rw = Dj(L.width, d, h) || 20;
M.widthScale = k / $;
var C = M.rh = Dj(L.height, d, h) || 20;
M.heightScale = K / C
}
if (f.save(), f.interactiveInfo) {
var m = f.interactiveInfo.matrix,
c = m.clone();
m.appendTranslate(j, a).appendScale(V / k, U / K), f.interactiveInfo.refRect = M
}
wh(f, j, a), (k !== V || K !== U) && f.scale(V / k, U / K), q && (Mf(q) ? q(f, k, K, d, h, L) : (f.beginPath(), f.rect(0, 0, k, K), f.clip())), Y != F && (f.globalAlpha *= Y), Q(L, "comps").forEach(function (n) {
if (n.prefix) {
var $ = Nh,
B = Dj(n.prefix, d, h);
B && (Nh = Nh + B + ".")
}
if (0 == E(L, n)) return n.prefix && (Nh = $), void 0;
if (Hn.splice(0, 0, n), f.interactiveInfo) var k = f.interactiveInfo.matrix.clone();
var T = Q(n, "opacity"),
a = Q(n, "shadow"),
w = Q(n, "type"),
r = Q(n, "refRect") || M,
U = p(n, r);
if (T != F) {
var Y = f.globalAlpha;
f.globalAlpha *= T
}
if (a) {
var g = f.shadowOffsetX,
z = f.shadowOffsetY,
H = f.shadowBlur,
c = f.shadowColor,
J = Q(n, "shadowOffsetX"),
q = Q(n, "shadowOffsetY"),
l = Q(n, "shadowBlur"),
i = b(n, "shadowColor");
f.shadowOffsetX = (J == F ? 3 : J) * s, f.shadowOffsetY = (q == F ? 3 : q) * s, f.shadowBlur = (l == F ? 6 : l) * s, f.shadowColor = i || b(Bc)
}
if ("save" === w) f.save();
else if ("endClip" === w || "restore" === w) f.restore();
else if ("clip" === w) f.save(), en(f, Q(n, "points", X), Q(n, "segments", y), !0), f.clip();
else if (Eg[w]) U = U || {
x: 0,
y: 0,
width: r.width,
height: r.height
}, N(n, w, U, r);
else if (w === bl) N(n, w, U, r);
else if ("SVGPath" === w) S(n, w, U);
else {
U = U || {
x: 0,
y: 0,
width: r.width,
height: r.height
};
var I = Q(n, ac),
j = Q(n, "scaleX"),
C = Q(n, "scaleY"),
K = D(n),
e = W(n, U, U, I, j, C, K);
if (Mf(w)) v(n, w), u.drawCompType(w, f, U, n, d, h);
else if (u.getCompType(w)) {
var V = u.getCompType(w),
A = V.func || V;
v(n, V), u.drawCompType(A, f, U, n, d, h)
} else t[w] ? t[w](n, U) : u.getCompType(w) === Z && Bm.test(w) && qs(w);
e && O()
}
a && (f.shadowOffsetX = g, f.shadowOffsetY = z, f.shadowBlur = H, f.shadowColor = c), T != F && (f.globalAlpha = Y), f.interactiveInfo && (f.interactiveInfo.matrix = k), n.prefix && (Nh = $), Hn.splice(0, 1)
}), f.interactiveInfo && (f.interactiveInfo.matrix = c), f.restore(), H(P)
}
}
}();
u.getCurrentComp = function () {
return Hn[0]
}, u.getParentComp = function () {
return Hn[1]
}, u.getInternal = function () {
return {
isEnter: hd,
isEsc: bj,
isSpace: Cf,
isLeft: Wk,
isUp: Nk,
isRight: _i,
isDown: ri,
addMethod: Uh,
superCall: fi,
toPointsArray: Yo,
translateAndScale: tf,
appendArray: gc,
createWorldMatrix: Jn,
vec3TransformMat4: Td,
setCanvas: Bn,
createDiv: dd,
createView: ve,
createCanvas: uo,
createImage: ee,
initContext: Wd,
layout: qp,
fillRect: fl,
Mat: In,
drawBorder: Ie,
isString: dk,
setBorder: Yq,
getPropertyValue: jq,
setPropertyValue: Di,
drawVerticalLine: cs,
draw3DRect: Wq,
getPinchDist: zo,
isSameRect: jg,
getPosition: Re,
intersectionLineRect: Rl,
getNodeRect: Rp,
getEdgeAgentPosition: Yg,
getEdgeHostPosition: Eo,
getImageWidth: xc,
getImageHeight: oo,
initItemElement: bh,
drawPoints: en,
createG2: ls,
closePopup: ek,
isH: Oj,
createAnim: Il,
createNormalMatrix: Rq,
toColorArray: ns,
createNormals: Gb,
toFloatArray: ed,
glMV: gk,
glPop: Gf,
batchShape: Mp,
createNodeMatrix: sj,
getShapeModel: bf,
getFaceInfo: _e,
transformAppend: yp,
drawFaceInfo: io,
to3dPointsArray: vh,
setGLDebugMode: function (M) {
Gi = M
}, cube: function () {
return {
vs: Ef,
is: Lq,
uv: mi
}
}, ui: function () {
return {
DataUI: Tp,
NodeUI: Af,
EdgeUI: wn,
GroupUI: Fn,
ShapeUI: Xp,
GridUI: _n,
Data3dUI: Wj,
Node3dUI: gf,
Shape3dUI: Vp
}
}, getInternalVersion: function () {
return "U2FsdGVkX1/K/qN+9JeXiDIJbdr2TMT5dD+JjFHm0aE="
}, getDragger: function () {
return si
}, addMSMap: function (k) {
Uh(fb, k)
}, k: e,
addEventListener: K,
removeEventListener: b
}
},
function (I) {
function x(w, V) {
w != F && (V == F && Gl != typeof w ? this._54O(w, 256) : this._54O(w, V))
}
function X() {
return new x(F)
}
function i(N, z, p, n, o, Y) {
for (; --Y >= 0;) {
var y = z * this[N++] + p[n] + o;
o = T(y / 67108864), p[n++] = 67108863 & y
}
return o
}
function g(H, S, C, $, M, p) {
for (var F = 32767 & S, m = S >> 15; --p >= 0;) {
var x = 32767 & this[H],
z = this[H++] >> 15,
b = m * x + z * F;
x = F * x + ((32767 & b) << 15) + C[$] + (1073741823 & M), M = (x >>> 30) + (b >>> 15) + m * z + (M >>> 30), C[$++] = 1073741823 & x
}
return M
}
function U(k, w, S, m, V, r) {
for (var o = 16383 & w, B = w >> 14; --r >= 0;) {
var c = 16383 & this[k],
R = this[k++] >> 14,
O = B * c + R * o;
c = o * c + ((16383 & O) << 14) + S[m] + V, V = (c >> 28) + (O >> 14) + B * R, S[m++] = 268435455 & c
}
return V
}
function d(N) {
return _o.charAt(N)
}
function R(L, N) {
var l = lr[L.charCodeAt(N)];
return l == F ? -1 : l
}
function t(O) {
for (var i = this.t - 1; i >= 0; --i) O[i] = this[i];
O.t = this.t, O.s = this.s
}
function A(Q) {
this.t = 1, this.s = 0 > Q ? -1 : 0, Q > 0 ? this[0] = Q : -1 > Q ? this[0] = Q + this.DV : this.t = 0
}
function r($) {
var Q = X();
return Q._58O($), Q
}
function j(y, K) {
var Y, w = this;
if (16 == K) Y = 4;
else if (8 == K) Y = 3;
else if (256 == K) Y = 8;
else if (2 == K) Y = 1;
else if (32 == K) Y = 5;
else {
if (4 != K) return w.fromRadix(y, K), void 0;
Y = 2
}
w.t = 0, w.s = 0;
for (var h = y.length, C = !1, g = 0; --h >= 0;) {
var U = 8 == Y ? 255 & y[h] : R(y, h);
0 > U ? "-" == y.charAt(h) && (C = !0) : (C = !1, 0 == g ? w[w.t++] = U : g + Y > w.DB ? (w[w.t - 1] |= (U & (1 << w.DB - g) - 1) << g, w[w.t++] = U >> w.DB - g) : w[w.t - 1] |= U << g, g += Y, g >= w.DB && (g -= w.DB))
}
8 == Y && 0 != (128 & y[0]) && (w.s = -1, g > 0 && (w[w.t - 1] |= (1 << w.DB - g) - 1 << g)), w._57O(), C && x.ZERO._78O(w, w)
}
function _() {
for (var j = this, H = j.s & j.DM; j.t > 0 && j[j.t - 1] == H;)--j.t
}
function D($) {
var v = this;
if (v.s < 0) return "-" + v._85O()[cq]($);
var X;
if (16 == $) X = 4;
else if (8 == $) X = 3;
else if (2 == $) X = 1;
else if (32 == $) X = 5;
else {
if (4 != $) return v.toRadix($);
X = 2
}
var n, E = (1 << X) - 1,
e = !1,
w = "",
W = v.t,
N = v.DB - W * v.DB % X;
if (W-- > 0)
for (N < v.DB && (n = v[W] >> N) > 0 && (e = !0, w = d(n)); W >= 0;) X > N ? (n = (v[W] & (1 << N) - 1) << X - N, n |= v[--W] >> (N += v.DB - X)) : (n = v[W] >> (N -= X) & E, 0 >= N && (N += v.DB, --W)), n > 0 && (e = !0), e && (w += d(n));
return e ? w : "0"
}
function h() {
var z = X();
return x.ZERO._78O(this, z), z
}
function O() {
return this.s < 0 ? this._85O() : this
}
function M(r) {
var P = this,
b = P.s - r.s;
if (0 != b) return b;
var j = P.t;
if (b = j - r.t, 0 != b) return P.s < 0 ? -b : b;
for (; --j >= 0;)
if (0 != (b = P[j] - r[j])) return b;
return 0
}
function K(n) {
var $, H = 1;
return 0 != ($ = n >>> 16) && (n = $, H += 16), 0 != ($ = n >> 8) && (n = $, H += 8), 0 != ($ = n >> 4) && (n = $, H += 4), 0 != ($ = n >> 2) && (n = $, H += 2), 0 != ($ = n >> 1) && (n = $, H += 1), H
}
function y() {
var V = this;
return V.t <= 0 ? 0 : V.DB * (V.t - 1) + K(V[V.t - 1] ^ V.s & V.DM)
}
function o(w, B) {
var a;
for (a = this.t - 1; a >= 0; --a) B[a + w] = this[a];
for (a = w - 1; a >= 0; --a) B[a] = 0;
B.t = this.t + w, B.s = this.s
}
function J(_, w) {
for (var j = _; j < this.t; ++j) w[j - _] = this[j];
w.t = q(this.t - _, 0), w.s = this.s
}
function C(F, g) {
var A, J = this,
d = F % J.DB,
a = J.DB - d,
v = (1 << a) - 1,
n = T(F / J.DB),
e = J.s << d & J.DM;
for (A = J.t - 1; A >= 0; --A) g[A + n + 1] = J[A] >> a | e, e = (J[A] & v) << d;
for (A = n - 1; A >= 0; --A) g[A] = 0;
g[n] = e, g.t = J.t + n + 1, g.s = J.s, g._57O()
}
function W(G, r) {
var H = this;
r.s = H.s;
var Y = T(G / H.DB);
if (Y >= H.t) return r.t = 0, void 0;
var M = G % H.DB,
c = H.DB - M,
F = (1 << M) - 1;
r[0] = H[Y] >> M;
for (var A = Y + 1; A < H.t; ++A) r[A - Y - 1] |= (H[A] & F) << c, r[A - Y] = H[A] >> M;
M > 0 && (r[H.t - Y - 1] |= (H.s & F) << c), r.t = H.t - Y, r._57O()
}
function L(f, n) {
for (var F = this, i = 0, j = 0, J = V(f.t, F.t); J > i;) j += F[i] - f[i], n[i++] = j & F.DM, j >>= F.DB;
if (f.t < F.t) {
for (j -= f.s; i < F.t;) j += F[i], n[i++] = j & F.DM, j >>= F.DB;
j += F.s
} else {
for (j += F.s; i < f.t;) j -= f[i], n[i++] = j & F.DM, j >>= F.DB;
j -= f.s
}
n.s = 0 > j ? -1 : 0, -1 > j ? n[i++] = F.DV + j : j > 0 && (n[i++] = j), n.t = i, n._57O()
}
function z(g, Z) {
var I = this.abs(),
c = g.abs(),
s = I.t;
for (Z.t = s + c.t; --s >= 0;) Z[s] = 0;
for (s = 0; s < c.t; ++s) Z[s + I.t] = I.am(0, c[s], Z, s, 0, I.t);
Z.s = 0, Z._57O(), this.s != g.s && x.ZERO._78O(Z, Z)
}
function G(L) {
for (var n = this.abs(), H = L.t = 2 * n.t; --H >= 0;) L[H] = 0;
for (H = 0; H < n.t - 1; ++H) {
var U = n.am(H, n[H], L, 2 * H, 0, 1);
(L[H + n.t] += n.am(H + 1, 2 * n[H], L, 2 * H + 1, U, n.t - H - 1)) >= n.DV && (L[H + n.t] -= n.DV, L[H + n.t + 1] = 1)
}
L.t > 0 && (L[L.t - 1] += n.am(H, n[H], L, 2 * H, 0, 1)), L.s = 0, L._57O()
}
function p(s, j, E) {
var i = s.abs(),
S = this;
if (!(i.t <= 0)) {
var o = S.abs();
if (o.t < i.t) return j != F && j._58O(0), E != F && S._77O(E), void 0;
E == F && (E = X());
var W = X(),
u = S.s,
n = s.s,
b = S.DB - K(i[i.t - 1]);
b > 0 ? (i._44O(b, W), o._44O(b, E)) : (i._77O(W), o._77O(E));
var e = W.t,
p = W[e - 1];
if (0 != p) {
var U = p * (1 << S.F1) + (e > 1 ? W[e - 2] >> S.F2 : 0),
h = S.FV / U,
f = (1 << S.F1) / U,
t = 1 << S.F2,
C = E.t,
m = C - e,
g = j == F ? X() : j;
for (W._59O(m, g), E._52O(g) >= 0 && (E[E.t++] = 1, E._78O(g, E)), x.ONE._59O(e, g), g._78O(W, W); W.t < e;) W[W.t++] = 0;
for (; --m >= 0;) {
var r = E[--C] == p ? S.DM : T(E[C] * h + (E[C - 1] + t) * f);
if ((E[C] += W.am(0, r, E, m, 0, e)) < r)
for (W._59O(m, g), E._78O(g, E); E[C] < --r;) E._78O(g, E)
}
j != F && (E._45O(e, j), u != n && x.ZERO._78O(j, j)), E.t = e, E._57O(), b > 0 && E._46O(b, E), 0 > u && x.ZERO._78O(E, E)
}
}
}
function c(W) {
var j = X();
return this.abs()._49O(W, F, j), this.s < 0 && j._52O(x.ZERO) > 0 && W._78O(j, j), j
}
function l(u) {
this.m = u
}
function a(j) {
return j.s < 0 || j._52O(this.m) >= 0 ? j.mod(this.m) : j
}
function v(S) {
return S
}
function S(P) {
P._49O(this.m, F, P)
}
function Z(i, q, T) {
i._47O(q, T), this._74O(T)
}
function Q(t, v) {
t._48O(v), this._74O(v)
}
function B() {
if (this.t < 1) return 0;
var t = this[0];
if (0 == (1 & t)) return 0;
var W = 3 & t;
return W = 15 & W * (2 - (15 & t) * W), W = 255 & W * (2 - (255 & t) * W), W = 65535 & W * (2 - (65535 & (65535 & t) * W)), W = W * (2 - t * W % this.DV) % this.DV, W > 0 ? this.DV - W : -W
}
function u(f) {
var r = this;
r.m = f, r.mp = f._50O(), r.mpl = 32767 & r.mp, r.mph = r.mp >> 15, r.um = (1 << f.DB - 15) - 1, r.mt2 = 2 * f.t
}
function f(m) {
var b = X();
return m.abs()._59O(this.m.t, b), b._49O(this.m, F, b), m.s < 0 && b._52O(x.ZERO) > 0 && this.m._78O(b, b), b
}
function b(n) {
var U = X();
return n._77O(U), this._74O(U), U
}
function N(t) {
for (var O = this; t.t <= O.mt2;) t[t.t++] = 0;
for (var z = 0; z < O.m.t; ++z) {
var $ = 32767 & t[z],
E = $ * O.mpl + (($ * O.mph + (t[z] >> 15) * O.mpl & O.um) << 15) & t.DM;
for ($ = z + O.m.t, t[$] += O.m.am(0, E, t, z, 0, O.m.t); t[$] >= t.DV;) t[$] -= t.DV, t[++$]++
}
t._57O(), t._45O(O.m.t, t), t._52O(O.m) >= 0 && t._78O(O.m, t)
}
function E(z, e) {
z._48O(e), this._74O(e)
}
function uk(I, y, n) {
I._47O(y, n), this._74O(n)
}
function Ad() {
return 0 == (this.t > 0 ? 1 & this[0] : this.s)
}
function Il(Z, J) {
if (Z > 4294967295 || 1 > Z) return x.ONE;
var P = X(),
j = X(),
A = J._73O(this),
C = K(Z) - 1;
for (A._77O(P); --C >= 0;)
if (J._76O(P, j), (Z & 1 << C) > 0) J._75O(j, A, P);
else {
var y = P;
P = j, j = y
}
return J.revert(P)
}
function jg(t, L) {
var J;
return J = 256 > t || L._51O() ? new l(L) : new u(L), this.exp(t, J)
}
function Yc() {
var q = this;
if (q.s < 0) {
if (1 == q.t) return q[0] - q.DV;
if (0 == q.t) return -1
} else {
if (1 == q.t) return q[0];
if (0 == q.t) return 0
}
return (q[1] & (1 << 32 - q.DB) - 1) << q.DB | q[0]
}
function dl(F, E) {
return new x(F, E)
}
function gb() {
var p = this;
p.n = F, p.e = 0, p.d = F, p.p = F, p.q = F, p.dmp1 = F, p.dmq1 = F, p._10A = F
}
function ti(I) {
return I._53O(this.e, this.n)
}
function js(Q) {
var l, _, N, z = "",
s = 0;
for (l = 0; l < Q.length && Q.charAt(l) != Me; ++l) N = Ug.indexOf(Q.charAt(l)), 0 > N || (0 == s ? (z += d(N >> 2), _ = 3 & N, s = 1) : 1 == s ? (z += d(_ << 2 | N >> 4), _ = 15 & N, s = 2) : 2 == s ? (z += d(_), z += d(N >> 2), _ = 3 & N, s = 3) : (z += d(_ << 2 | N >> 4), z += d(15 & N), s = 0));
return 1 == s && (z += d(_ << 2)), z
}
function Nm(J) {
var R = J.split(""),
W = js(J);
return R.forEach(function (B) {
var m = B.length;
m > 0 && W && (ug += Zb(B))
}), W
}
function Zq(A, B) {
var n = Yq._4O.Util._56O(A, "ss"),
P = {},
K = 0;
return P.v = n == B, P.t = 1, P.s = 0 > K ? -1 : 0, yo = P.v, K > 0 ? P[0] = K : -1 > K ? P[0] = K + P.DV : P.t = 0, [n, P]
}
function ko(s) {
var p = 38,
u = s.substring(0, p);
if (u && 30 == u.indexOf("05000420")) {
var R = ["ss", s.substring(p)];
return R
}
return []
}
function rb(E, Z) {
Z = Z.replace(Lp, ""), Z = Z.replace(/[ \n]+/g, "");
var V = dl(Z, 16);
if (V._55O() > this.n._55O()) return 0;
var R = this._37O(V),
I = R[cq](16).replace(/^1f+00/, ""),
K = ko(I);
if (0 == K.length) return !1;
for (var v, W, C, w = .5, G = rr, J = [0, .5, .75, .875, .9375], F = [], p = [], Q = [], q = $ / G, N = K[1], f = Zq(E, N)[0], c = 0, L = 0; c < J.length; c++) {
var z = 0 === c % 2 ? 0 : .5;
for (v = 0; G >= v; v++) W = (v + z) * q, C = 1 - J[c], F.push(k(W) * w * C, -w + 2 * J[c] * w, -n(W) * w * C), p.push((v + z) / G, C)
}
for (c = 0; c < J.length - 1; c++) {
var B = c * (G + 1),
H = (c + 1) * (G + 1);
for (v = 0; G > v; v++) Q.push(B + v, H + v + 1, H + v, B + v, B + v + 1, H + v + 1)
}
return Q.forEach(function (P) {
L += P
}), N == f && L > 10
}
var Hr, gh = 0xdeadbeefcafe,
Le = 15715070 == (16777215 & gh),
cq = "toString",
Aq = "",
Yh = "nat",
tl = function () { };
H = I["D" + 11182[cq](P(2, 5))];
var ao = x.prototype;
Df += Wg.substr(0, 1);
var Nj = I.navigator ? I.navigator.appName : "";
Le && "Microsoft Internet Explorer" == Nj ? (ao.am = g, Hr = 30) : Le && "Netscape" != Nj ? (ao.am = i, Hr = 26) : (ao.am = U, Hr = 28), ao.DB = Hr, ao.DM = (1 << Hr) - 1, ao.DV = 1 << Hr;
var tn = 52;
ao.FV = P(2, tn), ao.F1 = tn - Hr, ao.F2 = 2 * Hr - tn;
var hn, vn, _o = "0123456789abcdefghijklmnopqrstuvwxyz",
lr = [],
ci = function (E) {
return String.fromCharCode(E)
};
for (hn = "0".charCodeAt(0), vn = 0; 9 >= vn; ++vn) lr[hn++] = vn;
for (hn = "a".charCodeAt(0), vn = 10; 36 > vn; ++vn) lr[hn++] = vn;
for (hn = "A".charCodeAt(0), vn = 10; 36 > vn; ++vn) lr[hn++] = vn;
var Af = l.prototype;
Af._73O = a, Af.revert = v, Af._74O = S, Af._75O = Z, Af._76O = Q;
var hk = u.prototype;
hk._73O = f, hk.revert = b, hk._74O = N, hk._75O = uk, hk._76O = E, ao._77O = t, ao._58O = A, ao._54O = j, ao._57O = _, ao._59O = o, ao._45O = J, ao._44O = C, ao._46O = W, ao._78O = L, ao._47O = z, ao._48O = G, ao._49O = p, ao._50O = B, ao._51O = Ad, ao.exp = Il, ao.toString = D, ao._85O = h, ao.abs = O, ao._52O = M, ao._55O = y, ao.mod = c, ao._53O = jg, x.ZERO = r(0), x.ONE = r(1), ao._86O = Yc;
var nh = function (r, B) {
var K = this;
K.isPublic = !0, typeof r !== Gl ? (K.n = r, K.e = B) : r != F && B != F && r.length > 0 && B.length > 0 && (K.n = dl(r, 16), K.e = Zb(B, 16))
};
Fb = function () {
var w, b, h = Nm(yb),
R = h.substr(0, 4),
l = h.substr(4, 2),
U = h.substr(6, 2),
Q = 1,
i = !Q,
M = e,
E = [],
t = zi.charAt(7);
if (H && (H[cq]().indexOf(Yh) < 0 || H[Df][cq]().indexOf(Yh) < 0 || !h ? w = F : (h = new H(R - 0, l - Q, U - 0), b = h.setHours(9), H[Df]() > b ? w = ok[t] : i = !0)), h && w && w[0] && w[s(.5)] && M) {
var k = Og(w[0]),
n = Og(w[1]);
for (var O in n) E.push(O);
var X, P = 0,
J = k[E[P]],
x = n[E[P++]],
V = n[E[P++]],
c = n[E[P++]],
S = n[E[P++]],
r = n[E[P++]],
a = n[E[P++]],
j = k[E[P]],
v = n[E[P++]],
$ = Om._27O(M);
if (J === x && $ && v) {
X = x + V + c + S + r + a;
var I = !a || a === kg;
if (!I && a)
for (var y, N = 0, o = a.length; o > N; N++) a[N] === dj[P] ? y === kg ? I = !0 : y[0] === Uo[5] && kg && kg.indexOf(y.substr(1)) >= 0 ? I = !0 : y = F : (y == F ? y = a[N] : y += a[N], N === o - 1 && (y === kg ? I = !0 : y[0] === Uo[5] && kg && kg.indexOf(y.substr(1)) >= 0 && (I = !0)));
X && $._31O(X, v) && $._31O(J, j) && I && (!r || H[Df]() < r) && (i = !0)
}
}
return i || (Ej = Ro), t
};
var gm = gb.prototype;
gm._37O = ti, gm._38O = nh;
var Ug = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
Me = "=",
Mj = 25,
Pc = 10,
yb = "ICFhU===",
So = So || function (i, b) {
var f = {},
L = f._7A = {},
a = L._6A = function () {
function k() { }
return {
_80O: function (i) {
k.prototype = this;
var e = new k;
return i && e._5A(i), e.hasOwnProperty("_82O") || (e._82O = function () {
e.$super._82O.apply(this, arguments)
}), e._82O.prototype = e, e.$super = this, e
}, _3A: function () {
var p = this._80O();
return p._82O.apply(p, arguments), p
}, _82O: function () { }, _5A: function (t) {
for (var e in t) t.hasOwnProperty(e) && (this[e] = t[e]);
t.hasOwnProperty(cq) && (this.toString = t.toString)
}, _88O: function () {
return this._82O.prototype._80O(this)
}
}
}(),
g = L._39O = a._80O({
_82O: function (_, g) {
_ = this._84O = _ || [], this._65O = g != b ? g : 4 * _.length
}, toString: function (R) {
return (R || H).stringify(this)
}, _89O: function (N) {
var $ = this._84O,
m = N._84O,
x = this._65O,
s = N._65O;
if (this._57O(), x % 4)
for (var c = 0; s > c; c++) {
var X = 255 & m[c >>> 2] >>> 24 - 8 * (c % 4);
$[x + c >>> 2] |= X << 24 - 8 * ((x + c) % 4)
} else if (m.length > 65535)
for (var c = 0; s > c; c += 4) $[x + c >>> 2] = m[c >>> 2];
else $.push.apply($, m);
return this._65O += s, this
}, _57O: function () {
var G = this._84O,
U = this._65O;
G[U >>> 2] &= 4294967295 << 32 - 8 * (U % 4), G.length = s(U / 4)
}, _88O: function () {
var r = a._88O.call(this);
return r._84O = this._84O.slice(0), r
}, _87O: function (W) {
for (var T = [], I = 0; W > I; I += 4) T.push(0 | 4294967296 * m);
return new g._82O(T, W)
}
}),
Z = f._2A = {},
H = Z._69O = {
stringify: function (V) {
var t, k = V._84O,
c = V._65O,
g = [];
for (t = 0; c > t; t++) {
var M = 255 & k[t >>> 2] >>> 24 - 8 * (t % 4);
g.push((M >>> 4).toString(16)), g.push((15 & M).toString(16))
}
return g.join("")
}, _68O: function (s) {
for (var S = s.length, z = [], R = 0; S > R; R += 2) z[R >>> 3] |= Zb(s.substr(R, 2), 16) << 24 - 4 * (R % 8);
return new g._82O(z, S / 2)
}
},
R = Z._8A = {
stringify: function (Y) {
var K, M = Y._84O,
L = Y._65O,
r = [];
for (K = 0; L > K; K++) {
var P = 255 & M[K >>> 2] >>> 24 - 8 * (K % 4);
r.push(ci(P))
}
return r.join("")
}, _68O: function (m) {
var R, w = m.length,
v = [];
for (R = 0; w > R; R++) v[R >>> 2] |= (255 & m.charCodeAt(R)) << 24 - 8 * (R % 4);
return new g._82O(v, w)
}
},
D = Z._9A = {
stringify: function (c) {
try {
return decodeURIComponent(escape(R.stringify(c)))
} catch (p) {
throw new Error("")
}
}, _68O: function (G) {
return R._68O(unescape(encodeURIComponent(G)))
}
},
w = L._32O = a._80O({
_1A: function () {
this._83O = new g._82O, this._23O = 0
}, _33O: function (o) {
typeof o == Gl && (o = D._68O(o)), this._83O._89O(o), this._23O += o._65O
}, _25O: function (M) {
var m = this._83O,
Q = m._84O,
y = m._65O,
c = this._79O,
P = 4 * c,
k = y / P;
k = M ? s(k) : q((0 | k) - this._22O, 0);
var w = k * c,
Y = V(4 * w, y);
if (w) {
for (var J = 0; w > J; J += c) this._20O(Q, J);
var $ = Q.splice(0, w);
m._65O -= Y
}
return new g._82O($, Y)
}, _88O: function () {
var s = a._88O.call(this);
return s._83O = this._83O._88O(), s
}, _22O: 0
});
L._66O = w._80O({
cfg: a._80O(),
_82O: function (d) {
this.cfg = this.cfg._80O(d), this._1A()
}, _1A: function () {
w._1A.call(this), this._34O()
}, _81O: function (u) {
return this._33O(u), this._25O(), this
}, _72O: function (j) {
j && this._33O(j);
var m = this._21O();
return m
}, _79O: 16,
_26O: function (K) {
return function (S, L) {
return new K._82O(L)._72O(S)
}
}, _19O: function (h) {
return function (S, H) {
return new u._71O._82O(h, H)._72O(S)
}
}
});
var u = f._67O = {};
return f
}();
! function () {
var U = So,
E = U._7A,
C = E._39O,
$ = E._66O,
g = U._67O,
S = [],
F = [];
! function () {
function g(r) {
for (var x = w(r), c = 2; x >= c; c++)
if (!(r % c)) return !1;
return !0
}
function p(d) {
return 0 | 4294967296 * (d - (0 | d))
}
for (var Z = 2, s = 0; 64 > s;) g(Z) && (8 > s && (S[s] = p(P(Z, .5))), F[s] = p(P(Z, 1 / 3)), s++), Z++
}();
var d = [],
j = g._41O = $._80O({
_34O: function () {
this._64O = new C._82O(S.slice(0))
}, _20O: function (Z, t) {
for (var $ = this._64O._84O, I = $[0], L = $[1], P = $[2], e = $[3], n = $[4], J = $[5], A = $[6], s = $[7], y = 0; 64 > y; y++) {
if (16 > y) d[y] = 0 | Z[t + y];
else {
var C = d[y - 15],
S = (C << 25 | C >>> 7) ^ (C << 14 | C >>> 18) ^ C >>> 3,
h = d[y - 2],
k = (h << 15 | h >>> 17) ^ (h << 13 | h >>> 19) ^ h >>> 10;
d[y] = S + d[y - 7] + k + d[y - 16]
}
var o = n & J ^ ~n & A,
i = I & L ^ I & P ^ L & P,
V = (I << 30 | I >>> 2) ^ (I << 19 | I >>> 13) ^ (I << 10 | I >>> 22),
_ = (n << 26 | n >>> 6) ^ (n << 21 | n >>> 11) ^ (n << 7 | n >>> 25),
p = s + _ + o + F[y] + d[y],
b = V + i;
s = A, A = J, J = n, n = 0 | e + p, e = P, P = L, L = I, I = 0 | p + b
}
$[0] = 0 | $[0] + I, $[1] = 0 | $[1] + L, $[2] = 0 | $[2] + P, $[3] = 0 | $[3] + e, $[4] = 0 | $[4] + n, $[5] = 0 | $[5] + J, $[6] = 0 | $[6] + A, $[7] = 0 | $[7] + s
}, _21O: function () {
var P = this._83O,
G = P._84O,
n = 8 * this._23O,
k = 8 * P._65O;
return G[k >>> 5] |= 128 << 24 - k % 32, G[(k + 64 >>> 9 << 4) + 14] = T(n / 4294967296), G[(k + 64 >>> 9 << 4) + 15] = n, P._65O = 4 * G.length, this._25O(), this._64O
}, _88O: function () {
var i = $._88O.call(this);
return i._64O = this._64O._88O(), i
}
});
U._41O = $._26O(j), U._42O = $._19O(j)
}();
var Lp = new RegExp("");
Lp.compile("[^0-9a-f]", "gi"), gb._28O = -1, gb._29O = -2, gm._31O = rb, gm._63O = rb, gb._43O = -2;
var ye = new function () {
var T = this;
T._5O = function (B, P) {
if ("8" != B.substring(P + 2, P + 3)) return 1;
var H = Zb(B.substring(P + 3, P + 4));
return 0 == H ? -1 : H > 0 && 10 > H ? H + 1 : -2
}, T._13O = function (m, f) {
var C = T._5O(m, f);
return 1 > C ? "" : m.substring(f + 2, f + 2 + 2 * C)
}, T._12O = function (G, N) {
var V = T._13O(G, N);
if ("" == V) return -1;
var q;
return q = Zb(V.substring(0, 1)) < 8 ? new x(V, 16) : new x(V.substring(2), 16), q._86O()
}, T._6O = function (q, O) {
var V = T._5O(q, O);
return 0 > V ? V : O + 2 * (V + 1)
}, T._11O = function (v, m) {
var n = T._6O(v, m),
c = T._12O(v, m);
return v.substring(n, n + 2 * c)
}, T._10O = function (r, E) {
var H = T._6O(r, E),
$ = T._12O(r, E);
return H + 2 * $
}, T._7O = function (l, m) {
var R = [],
H = T._6O(l, m);
R.push(H);
for (var C = T._12O(l, m), e = H, S = 0; ;) {
var Z = T._10O(l, e);
if (Z == F || Z - H >= 2 * C) break;
if (S >= 200) break;
R.push(Z), e = Z, S++
}
return R
}
};
if (ye._90O = ci(Pc + 24), ye._91O = Y + ci(Pc * Pc + 8), Yq == F || !Yq) var Yq = {};
Yq._4O != F && Yq._4O || (Yq._4O = {});
var _p = Yq._4O;
Yq._4O.Util = new function () {
var a = this;
a._56O = function (X) {
var O = new Yq._4O._3O;
return O._30O(X)
}, a._4A = function (p) {
var B = new Yq._4O._3O;
return B._36O(p)
}, a._11A = function (L) {
var w = new _p._3O;
return w._30O(L)
}
}, Yq._4O._3O = function () {
var u = this;
u._8O = function (J, K) {
if ("ss" == J && "cj" == K) {
try {
u.md = So._67O._41O._3A()
} catch (l) {
tl(Aq)
}
u._24O = function (A) {
u.md._81O(A)
}, u._35O = function (w) {
var S = So._2A._69O._68O(w);
u.md._81O(S)
}, u._60O = function () {
var v = u.md._72O();
return v[cq](So._2A._69O)
}, u._30O = function (I) {
return u._24O(I), u._60O()
}, u._36O = function (E) {
return u._35O(E), u._60O()
}
}
}, u._24O = function () {
tl(Aq)
}, u._35O = function () {
tl(Aq)
}, u._60O = function () {
tl(Aq)
}, u._30O = function () {
tl(Aq)
}, u._36O = function () {
tl(Aq)
}, u._8O("ss", "cj")
}, Qg = function (g) {
var w = qg[No[7]],
F = 1,
O = !1;
if (Cg.a != qg[Mo]) return Cg.a;
//修改}), g > F) {为时间限制,改为 false
var ck=false;
//abd ="20t22bt02b28 12c12c11",
var wjsd = abd.replace(/b/g, "-").replace(/c/g, ":").replace(/t/g, "");
var oDate1 = new Date(wjsd);
if (oDate1.getTime() < (new Date()).getTime())
ck=true;
if (Cg.forEach(function (K) {
F *= K
}), ck){//g > F) {
if (w && w[1] && w[0]) {
var z = w[0],
$ = w[1];
$ = $.split(ye._90O), z = z.split(ye._90O);
var y = $[3],
A = z[3],
U = $[7],
T = $[11],
W = $[15],
a = $[19],
i = $[23],
S = $[27],
N = z[7],
c = y + U + T + W + a + i,
J = i ? !1 : !0,
P = A === y;
if (i) {
var l = i && i.split(tg("firefox")[3]);
if (l)
for (var E = 0; E < l.length; E++) {
var M = l[E];
if (M[0] === Ji[8] && (M = M.substring(1)), gs.indexOf(M) >= 0) {
J = !0;
break
}
}
}
O = P && de()(A, N) && de()(c, S) && J && (!a || a > g), O && T.indexOf(Tb.length) >= 0 && (Qg[Tb.length] = Tb), O && T.indexOf(Tb.length + 1) >= 0 && (Qg[Tb.length + 1] = Tb), O && T.indexOf(Tb.length + 3) >= 0 && (Qg[Tb.length + 3] = Tb)
}
O || (Tp.prototype._42 = Xk)
} else O = !0, Qg[Tb.length] = Qg[Tb.length + 1] = Qg[Tb.length + 3] = Tb;
return Cg.a = O, O
}, Mj = String.fromCharCode(Mj + 20);
var Po = function (V) {
return V = V.replace(Lp, Aq), V = V.replace(/[ \n]+/g, Aq)
},
_l = "30",
Eq = "06",
Gp = "02",
Lg = "03",
lm = dl,
xp = /^1f+00/,
Om = function () {
var R;
return R = {
_18O: function (N) {
var R = N,
n = R.replace(/\s+/g, ""),
P = js(n);
return P
}, _14O: function (D) {
var U = this._18O(D),
s = this._15O(U);
return s
}, _15O: function (z) {
var j = this._17O(z);
if ("2a864886f70d010101" == j._61O) {
var X = this._16O(j.key),
S = new gb;
return S._38O(X.n, X.e), S
}
tl(Aq)
}, _16O: function (w) {
var n = {};
w.substr(0, 2) != _l && tl(Aq);
var T = ye._7O(w, 0);
return 2 != T.length && tl(Aq), w.substr(T[0], 2) != Gp && tl(Aq), n.n = ye._11O(w, T[0]), w.substr(T[1], 2) != Gp && tl(Aq), n.e = ye._11O(w, T[1]), n
}, _17O: function (h) {
var A = {};
A._40O = F;
var d = ye._7O(h, 0);
2 != d.length && tl(Aq);
var b = d[0];
h.substr(b, 2) != _l && tl(Aq);
var c = ye._7O(h, b);
return 2 != c.length && tl(Aq), h.substr(c[0], 2) != Eq && tl(Aq), A._61O = ye._11O(h, c[0]), h.substr(c[1], 2) == Eq ? A._40O = ye._11O(h, c[1]) : h.substr(c[1], 2) == _l && (A._40O = {}, A._40O.p = ye._70O(h, c[1], [0], Gp), A._40O.q = ye._70O(h, c[1], [1], Gp), A._40O.g = ye._70O(h, c[1], [2], Gp)), h.substr(d[1], 2) != Lg && tl(Aq), A.key = ye._11O(h, d[1]).substr(2), A
}
}, R._17O ? R : F
}(),
bc = Om._27O = function (f) {
return Om._14O(f)
};
de = function () {
return function (p, J) {
if (p && J) {
J = Po(J);
var G = lm(J, P(2, 4)),
m = this;
if (!m || !m.n || G._55O() > m.n._55O()) return 0;
var L = m._37O(G),
i = L[cq](P(2, 4)).replace(xp, ""),
Z = ko(i);
if (0 == Z.length) return !1;
var n = Z[0],
x = Z[1],
X = function (D) {
return Yq._4O.Util._56O(D, n)
},
O = X(p);
return x == O
}
}.bind(bc(e))
};
var aj, dr;
return function () {
var O = xj.length - Zi.length;
if (O > 0)
for (var F = 0; O > F; F++) aj = _p.Util, dr = Po
}(), $i = function (_, h) {
h = dr(h);
var n = bc(ph),
A = oe.length,
p = 2 * A,
d = lm(h, P(A, p)),
M = n,
a = !0;
if (M) {
var l = M[Jc[0]];
l && d._55O() <= l._55O() && (a = !1)
}
if (a) return 0;
var X = M._37O(d),
k = X[cq](P(A, p)).replace(xp, ""),
J = ko(k);
if (0 == J.length) return !1;
var Z = J[0],
D = J[1],
R = aj._11A(_, Z);
return D == R
}, Om
}(x, o), Uh(u, {
load: function () {
var j = {},
$ = function (k) {
return k ? "c_" + (k.sync ? "1" : "0") + "_" + (k.post ? "1" : "0") + "_" + (k.responseType || "H") + "_" + (k.mimeType || "H") + "_" + (k.data ? JSON.stringify(k.data) : "H") : ""
};
return function (F, U, Y) {
var P, n = j[F],
y = $(Y);
return n && (P = n[y]) ? (P.push(U), void 0) : (j[F] || (n = j[F] = {
count: 0
}), P = n[y] = [U], n.count++, u.xhrLoad(F, function (w) {
delete n[y], n.count--, n.count || delete j[F], P.forEach(function (O) {
O(w)
})
}, Y), void 0)
}
}(),
asyncEach: function (p, E, h) {
"function" != typeof h && (h = Function.prototype);
var X = new Array(p.length),
H = 0,
m = !1;
p.forEach(function (C, F) {
E(C, function (t, i) {
return m ? void 0 : t ? (m = !0, h(null)) : (X[F] = i, H++, H === p.length ? h(X) : void 0)
})
})
}, xhrLoad: function ($, b, F) {
var x = !1;
ip($) || (x = !0, $ = [$]), F = F || {};
var M = F.sync,
e = null,
H = F.method || "GET";
return F.post && (H = "POST"), F.method = H, u.asyncEach($, function (Z, W) {
var K = new De;
Z = u.beforeLoadURL(Z), Z.data ? W(null, Z.data) : (F.url = encodeURI(Z), F.responseType ? K.setResponseType(F.responseType) : K.setOverrideMimeType(F.mimeType || "text/plain"), K.onload = function () {
200 === this.status || 0 === this.status ? W(null, K.getResponseText()) : W(!0)
}, K.onerror = function () {
W(!0)
}, K.send(F))
}, function (a) {
var O = "function" == typeof b;
(O || M) && (e = x && a ? a[0] : a, O && b(e))
}), M ? e : void 0
}
});
var rb = o.setPrototypeOf || function (f, Y) {
return f.__proto__ = Y, f
},
ql = o.getPrototypeOf || function (w) {
return w.__proto__
},
bc = o.freeze;
o.isFrozen;
var zn = function () {
var g = function (G) {
return G
};
return function (I) {
return I && I.length ? new Function("o", ["return o['", I.join("']['"), "'];"].join("")) : g
}
}(),
ai = function () {
var H = function (o, Z) {
return o = Z
};
return function (p) {
return p && p.length ? new Function("o", "v", ["return o['", p.join("']['"), "'] = v;"].join("")) : H
}
}();
! function () {
function d(T) {
var i = [];
if (T)
for (var B;
(B = $.exec(T)) != Z;) i.push(B[1]);
return i
}
function F(F, W) {
var T = G.exec(W);
this._cell = F, this._key = T[1], this._format = T[2], this._style = d(T[3])
}
function E(w) {
for (var g = this._cellList = [], V = this._paramList = [], m = w.split(_), L = 0, P = m.length; P > L; ++L) {
var u = m[L];
if ("{{" !== u)
for (var x = u.split(o), l = 0, N = x.length; N > l; ++l) {
var b = x[l];
o.test(b) ? (V.push(new F(g.length, b)), g.push(Z)) : b.length > 0 && g.push(b)
} else g.push("{")
}
this._formatList = this._cellList.slice(0)
}
var X = {},
T = {},
_ = /(\{\{)/,
o = /(\{\w+(?:\:\w+(?:\&[\w\.])*)?\})/,
G = /\{(\w+)(?:\:(\w+)((?:\&[\w\.])*))?\}/,
$ = /\&([\w\.]*)/g;
E.prototype._73O = function (I) {
for (var b = this._paramList.length; b--;) {
var A = this._paramList[b],
v = I[Zb(A._key) + 1],
J = T[A._format];
J && (v = J(v, A._style)), this._formatList[A._cell] = v
}
return this._formatList.join("")
}, E.prototype._map = function (s) {
for (var k = this._paramList.length; k--;) {
var f = this._paramList[k],
a = s[f._key],
C = T[f._format];
C && (a = C(a, f._style)), this._formatList[f._cell] = a
}
return this._formatList.join("")
};
var p = function (w) {
var Y = X[w];
return Y || (X[w] = Y = new E(w)), Y._73O(arguments)
};
return p.map = function (s, i) {
var I = X[s];
return I || (X[s] = I = new E(s)), I._map(i)
}, p.setValueFormat = function (G, b) {
T[G] = b
}, p.gc = function () {
X.length = 0
}, p.__parsed = X, p
}();
var _j = function () {
function p(H, h, y, x) {
var s = H ? H.path.slice(0) : [];
h && s.push(h), this.desc = y, this.name = h, this.path = bc(s), this.getter = zn(s), this.setter = ai(s), this.isLeaf = x, this.parent = H, this.children = [], this.childMap = {}
}
return p.create = function () {
function S(w, u, K, U) {
var M = U(K),
F = new p(w, u, K, M);
if (!M) {
for (var m = F.children, j = F.childMap, b = o.keys(K), R = 0, d = b.length; d > R; ++R) {
var O = b[R],
D = S(F, O, K[O], U);
m.push(D), j[D.name] = D
}
F.children = bc(m), F.childMap = bc(j)
}
return bc(F), F
}
return function (k, L) {
return S(Z, Z, k, L)
}
}(), p.prototype.forEach = function (W, v) {
for (var Y = this.children, o = 0, m = Y.length; m > o; ++o) {
var z = Y[o];
W(z, v)
}
}, p
}(),
bc = o.freeze,
Sc = {
main: {
mask: 1,
priority: u.cameraPriority.main,
clearDepth: !1,
ignore: !1
},
top: {
mask: 2,
priority: u.cameraPriority.top,
ignore: !1
}
},
aq = "main",
pb = Sc[aq].mask,
hp = function (N, R, $) {
if (N = N || 0, !(R in Sc)) {
if ($b >= 32) throw new Error("Only 31 render layer can be defined.");
Sc[R] = {
mask: 1 << $b++,
priority: Sc[aq].priority
}
}
if ($)
for (var E in $) Sc[R][E] = $[E];
return kl = Ck(o.keys(Sc)), $b = kl.length, N |= Sc[R].mask
},
Sr = function (L, c) {
return L && c && L & c
},
Ck = function (p) {
return p.sort(function (s, i) {
return Sc[s].priority - Sc[i].priority
})
},
kl = Ck(o.keys(Sc)),
$b = kl.length;
Uh(u, {
setRenderLayerInfo: function (J, q) {
hp(0, J, q)
}, getRenderLayerInfo: function (F) {
return Sc[F]
}
}, !0);
var xr = O.List = function () {
this._as = [];
var s, z, V = arguments.length;
if (1 === V) {
var B = arguments[0];
if (Xo(B) && (B = B._as), ip(B))
for (z = B.length, s = 0; z > s; s++) this._as.push(B[s]);
else B != F && this._as.push(B)
} else if (V > 1)
for (s = 0; V > s; s++) this._as.push(arguments[s])
};
ki("List", o, {
forEach: function (h, L) {
this.each(h, L)
}, push: function () {
for (var y = 0; y < arguments.length; y++) this.add(arguments[y])
}, pop: function () {
return this._as.pop()
}, shift: function () {
return this._as.shift()
}, unshift: function () {
return this._as.unshift.apply(this._as, arguments)
}, size: function () {
return this._as.length
}, isEmpty: function () {
return 0 === this._as.length
}, add: function (e, I) {
return I === Z ? this._as.push(e) : this._as.splice(I, 0, e)
}, addAll: function ($) {
Xo($) && ($ = $._as), ip($) ? gc(this._as, $) : this._as.push($)
}, get: function (x) {
return this._as[x]
}, slice: function (g, r) {
return new xr(this._as.slice(g, r))
}, remove: function (b) {
var Q = this._as.indexOf(b);
return Q >= 0 && Q < this._as.length && this.removeAt(Q), Q
}, removeAt: function (_) {
return this._as.splice(_, 1)[0]
}, set: function (O, k) {
return this._as[O] = k
}, clear: function () {
return this._as.splice(0, this._as.length)
}, contains: function (e) {
return this._as.indexOf(e) >= 0
}, indexOf: function (I) {
return this._as.indexOf(I)
}, each: function ($, x) {
for (var Z = 0, t = this._as.length; t > Z; Z++) {
var X = this._as[Z];
x ? $.call(x, X, Z, this) : $(X, Z, this)
}
}, reverseEach: function (C, j) {
for (var H = this._as.length - 1; H >= 0; H--) {
var $ = this._as[H];
j ? C.call(j, $) : C($)
}
}, getArray: function () {
return this._as
}, toArray: function (H, h) {
if (H) {
for (var C, _ = [], N = 0, Q = this._as.length; Q > N; N++) C = this._as[N], h ? H.call(h, C) && _.push(C) : H(C) && _.push(C);
return _
}
return this._as.concat()
}, toList: function (V, G) {
if (V) {
for (var R, I = new xr, N = 0, h = this._as.length; h > N; N++) R = this._as[N], G ? V.call(G, R) && I.add(R) : V(R) && I.add(R);
return I
}
return new xr(this)
}, reverse: function () {
this._as.reverse()
}, sort: function (P) {
return this._as.sort(P ? P : Sd), this
}, toString: function () {
return this._as.toString()
}
}), o.defineProperties(xr.prototype, {
length: {
get: function () {
return this._as.length
}, set: function (d) {
this._as.length = d
}
}
});
var Yh = new xr;
Uh(Yh, {
size: function () {
return 0
}, indexOf: function () {
return -1
}, contains: function () {
return !1
}, isEmpty: function () {
return !0
}, sort: Mr,
each: Mr,
reverseEach: Mr,
toArray: function () {
return []
}, toList: function () {
return new xr
}, add: jm,
addAll: jm,
set: jm,
remove: jm,
removeAt: jm,
clear: jm
});
var Yj = O.Notifier = function () {
this._f = 0
};
ki("Notifier", o, {
contains: function (P, W) {
if (this._ls)
for (var s, o = 0, $ = this._ls.size(); $ > o; o++)
if (s = this._ls.get(o), P === s.l && W === s.s) return !0;
return !1
}, add: function (w, y, v) {
var f = this,
Z = {
l: w,
s: y,
a: v
};
f._ls || (f._ls = new xr), f._f ? (f._as || (f._as = new xr), f._as.add(Z)) : Z.a ? f._ls.add(Z, 0) : f._ls.add(Z)
}, remove: function (h, K) {
var r = this;
r._ls && (r._f ? (r._rs || (r._rs = new xr), r._rs.add({
l: h,
s: K
})) : r._remove(h, K))
}, _remove: function (R, X) {
for (var t, j = this._ls, S = 0, J = j.size(); J > S; S++)
if (t = j.get(S), t.l === R && t.s === X) return j.removeAt(S), void 0
}, fire: function (F) {
var J = this,
M = J._ls;
if (J._b = 1e4, M) {
++J._f;
try {
for (var X, h = 0, C = M.size(); C > h; h++) X = M.get(h), X.s ? X.l.call(X.s, F) : X.l(F)
} catch (F) {
cd(function () {
throw F
})
} finally {
if (--J._f) return;
if (J._rs) {
for (C = J._rs.size(), h = 0; C > h; h++) X = J._rs.get(h), J._remove(X.l, X.s);
delete J._rs
}
if (J._as) {
for (C = J._as.size(), h = 0; C > h; h++) X = J._as.get(h), X.a ? M.add(X, 0) : M.add(X);
delete J._as
}
}
}
}
});
var Qp = O.Data = function () {
this._id = xp()
};
ki("Data", o, {
ms_ac: ["tag", "name", "displayName", "icon", "toolTip", "attrObject", "styleMap", "layer", "adjustChildrenToTop", "dataBindings"],
ms_dm: 1,
ms_attr: 1,
_icon: F,
_parent: F,
_children: Yh,
_childMap: F,
_styleMap: F,
_layer: "0",
_renderLayer: aq,
_renderLayerMask: pb,
_adjustChildrenToTop: !1,
getRenderLayerMask: function () {
return this._renderLayerMask || pb
}, getRenderLayer: function () {
return this._renderLayer || aq
}, setRenderLayer: function (S) {
var g = this,
H = hp(0, S);
g._renderLayerMask = H;
var Y = g._renderLayer;
g._renderLayer = S, g.fp("renderLayer", Y, g._renderLayer)
}, testRenderLayer: function (V) {
var C = Sc[V];
return C && Sr(this._renderLayerMask, Sc[V].mask)
}, getUIClass: function () {
return F
}, _22Q: function () {
return F
}, beginTransaction: function () {
this._dataModel && this._dataModel.beginTransaction()
}, endTransaction: function () {
this._dataModel && this._dataModel.endTransaction()
}, s: function (z, d) {
var V = this;
if (2 === arguments.length) V.setStyle(z, d);
else {
if (!xl(z)) return V.getStyle(z);
for (var q in z) V.setStyle(q, z[q])
}
return V
}, fp: function (H, V, N, j, o) {
return this.firePropertyChange(H, V, N, j, o)
}, firePropertyChange: function (x, l, s, v, K) {
if (v) {
if (v(l, s)) return !1
} else if (l === s) return !1;
var p = this,
R = K || {};
return R.property = x, R.oldValue = l, R.newValue = s, R.data = p, p._dataModel && p._dataModel.handleDataPropertyChange(R), p.onPropertyChanged(R), !0
}, onPropertyChanged: function (H) {
var M = this,
c = M._parent,
T = H.property;
if (yl(c)) {
var v = M.s(Dm),
d = "s:ingroup" === T;
(v && Lk[T] || T === d) && c._81I(), (v || d) && c.fp("childChange", !0, !1)
}
Qb(c) && (Lk[T] || "elevation" === T || Yr[T] || "scaleTall" === T || "tall" === T) && c.updateFromChildren()
}, _21I: function (S) {
var t = this;
if (S && t._dataModel) throw "Remove data from dataModel before adding";
t._dataModel = S
}, removeFromDataModel: function () {
this._dataModel ? this._dataModel.remove(this) : this.setParent(null)
}, clearChildrenFromDataModel: function () {
for (var I = 0, f = this._children.toArray(), q = f.length; q > I; I++) f[I].removeFromDataModel()
}, getId: function () {
return this._id
}, setId: function ($) {
this._id = $
}, getChildren: function () {
return this._children
}, size: function () {
return this._children.size()
}, toChildren: function (W, D) {
return this._children.toList(W, D)
}, eachChild: function (j, c) {
this._children.each(j, c)
}, addChild: function (v, s) {
var q = this;
v !== q && (q._children === Yh && (q._children = new xr, q._childMap = {}), s >= 0 || (s = q._children.size()), q._childMap[v._id] || q.isDescendantOf(v) || (v._parent && v._parent.removeChild(v), (0 > s || s > q._children.size()) && (s = q._children.size()), q._children.add(v, s), q._childMap[v._id] = v, v.setParent(q), q.onChildAdded(v, s), q.fp(Wf, F, v)))
}, onChildAdded: function () { }, removeChild: function (m) {
var J = this;
if (J._childMap && J._childMap[m._id]) {
var V = J._children.remove(m);
delete J._childMap[m._id], J.fp(Wf, m, F), m.setParent(F, V), J.onChildRemoved(m, V)
}
}, onChildRemoved: function () { }, getChildAt: function (I) {
return this._children.get(I)
}, clearChildren: function () {
var B = this;
if (!B._children.isEmpty())
for (var P = 0, $ = B._children.toArray(), b = $.length; b > P; P++) B.removeChild($[P])
}, getParent: function () {
return this._parent
}, setParent: function (I, Q) {
var W = this;
if (!(W._73I || W._parent === I || W === I || I && I.isDescendantOf(W))) {
var V, v = W._parent;
W._parent = I, W._73I = 1, v ? (Q == F && (Q = v.getChildren().indexOf(W)), v.removeChild(W)) : W._dataModel && Q == F && (Q = W._dataModel.getRoots().indexOf(W)), I && (I.addChild(W), V = I.getChildren().indexOf(W)), delete W._73I, W.fp("parent", v, I, Z, {
oldIndex: Q,
newIndex: V
}), W.onParentChanged(v, I)
}
}, onParentChanged: function () { }, hasChildren: function () {
return this._children.size() > 0
}, isEmpty: function () {
return this._children.isEmpty()
}, isRelatedTo: function (c) {
return c ? this.isDescendantOf(c) || c.isDescendantOf(this) : !1
}, isParentOf: function (P) {
return P && this._childMap ? !!this._childMap[P._id] : !1
}, isDescendantOf: function (R) {
if (!R || R.isEmpty()) return !1;
for (var b = this._parent; b;) {
if (R === b) return !0;
b = b._parent
}
return !1
}, getStyle: function (B, A) {
A === Z && (A = 1);
var q = this._styleMap ? this._styleMap[B] : Z;
return q === Z && A ? z[B] : q
}, setStyle: function (b, u) {
var T = this;
T._styleMap || (T._styleMap = {});
var Q = T._styleMap[b];
u === Z ? delete T._styleMap[b] : T._styleMap[b] = u, T.fp("s:" + b, Q, u) && T.onStyleChanged(b, Q, u)
}, onStyleChanged: function () { }, iv: function (b) {
this.invalidate(b)
}, invalidate: function (k) {
this.fp(k || "*", !1, !0)
}, toString: function () {
var Y = this;
return Y._displayName || Y._name || Y._tag || Y._id
}, toLabel: function () {
return this._displayName || this._name
}, addStyleIcon: function (q, d) {
var r = this,
e = r.s(ub);
r.beginTransaction(), e || r.s(ub, e = {}), d ? e[q] = d : delete e[q], r.fp(ub, F, e), r.endTransaction()
}, removeStyleIcon: function (M) {
var P = this.s(ub);
if (P) {
var x = P[M];
delete P[M], this.fp(ub, F, P)
}
return x
}, _calcAnchorMatrix3d: function () { }, appendAnchorMatrix3d: function (h) {
var W = this;
if (W.hasOwnProperty("_anchor") || W.hasOwnProperty("_anchorElevation")) {
var l = W.getAnchor3d(),
D = {
x: l.x - .5,
y: l.y - .5,
z: l.z - .5
};
bo(h, [-D.x, -D.y, -D.z])
}
}, getSerializableProperties: function () {
return {
name: 1,
displayName: 1,
icon: 1,
toolTip: 1,
parent: 1,
layer: 1,
renderLayer: 1,
tag: 1,
adjustChildrenToTop: 1,
dataBindings: 1
}
}, getSerializableStyles: function () {
var F, D = {};
for (F in this._styleMap) D[F] = 1;
return D
}, getCurrentPrefix: function () {
return this._interactPrefix || Nh
}, ca: function (r, W) {
var z = this.getCurrentPrefix();
return r = z + r, 2 === arguments.length ? this.a(r, W) : this.a(r)
}
});
var jn = O.DataModel = function () {
var n = this;
n._isDeserializing = 0, n._datas = new xr, n._dataMap = {}, n._roots = new xr, n._rootMap = {}, n._fsDataMap = {}, n._78O = {}, n._reflectorMap = {}, n._36I = new Yj, n._35I = new Yj, n._serializeNotifier = new Yj, n._selectionModel = new Uc(n);
var N = n._29Q = [],
e = n._scheduleCallback = function () {
for (var m = Date.now(), M = 0; M < N.length; M++) {
var S = N[M];
S.enabled && m - S.lastTime > S.interval && (S.beforeAction && S.beforeAction(), S.action && n.each(function (r) {
S.action(r)
}), S.afterAction && S.afterAction(), S.lastTime = m)
}
N.length && (n._30Q = x.requestAnimationFrame(e))
}
};
ki("DataModel", o, {
ms_fire: 1,
ms_attr: 1,
ms_ac: ["layers", "name", "autoAdjustIndex", "hierarchicalRendering", "background", "envmap", "postProcessingData", "init"],
_name: Z,
_autoAdjustIndex: !0,
_hierarchicalRendering: !1,
_background: Z,
_init: Z,
_envmap: Z,
_cubicEnvmap: !1,
_postProcessingData: Z,
sm: function () {
return this.getSelectionModel()
}, mm: function (B, q, C) {
this.addDataModelChangeListener(B, q, C)
}, umm: function (o, y) {
this.removeDataModelChangeListener(o, y)
}, md: function (F, m, G) {
this.addDataPropertyChangeListener(F, m, G)
}, umd: function (B, i) {
this.removeDataPropertyChangeListener(B, i)
}, mh: function (r, i, M) {
this.addHierarchyChangeListener(r, i, M)
}, umh: function (y, v) {
this.removeHierarchyChangeListener(y, v)
}, getAttrObject: function () {
return this._attrObject
}, setAttrObject: function (Z) {
return this._attrObject = Z
}, getSelectionModel: function () {
return this._selectionModel
}, size: function () {
return this._datas.size()
}, isEmpty: function () {
return this._datas.isEmpty()
}, getRoots: function () {
return this._roots
}, getDatas: function () {
return this._datas
}, getFullscreenDatas: function () {
return this._fsDataMap
}, getReflectors: function () {
return this._reflectorMap
}, getDataById: function (D) {
return this._dataMap[D]
}, removeDataById: function (P) {
this.remove(this.getDataById(P))
}, toDatas: function (j, F) {
return this._datas.toList(j, F)
}, each: function (Z, r) {
this._datas.each(Z, r)
}, getDataByTag: function (e) {
return this._78O[e]
}, getTagMap: function () {
return this._78O
}, removeDataByTag: function (e) {
this.remove(this.getDataByTag(e))
}, add: function (R, k, M) {
var H = this,
m = R._id,
P = R._tag,
v = H._roots;
if (H._dataMap[m]) throw "'" + m + "' already exists";
P != F && (H._78O[P] = R), H._dataMap[m] = R, M >= 0 ? H._datas.add(R, M) : H._datas.add(R), R._parent || (H._rootMap[m] = R, k >= 0 ? v.add(R, k) : v.add(R)), R.s("fullscreen") !== Z && (H._fsDataMap[m] = R), R.s("shape3d.reflector") && (H._reflectorMap[m] = R), R._21I(H), H.onAdded(R), H._36I.fire({
kind: "add",
data: R,
rootsIndex: k,
datasIndex: M
})
}, onAdded: function () { }, remove: function (k, L) {
if (k) {
var q = this,
I = k._id,
S = L && L.keepStructure,
M = L && L.keepChildren,
A = k.getTag();
if (k._dataModel === q) {
this.beginTransaction(), S ? q._removingData || (q._removingData = k) : q.prepareRemove(k), M || k.toChildren().each(function (I) {
q.remove(I, L)
}, q), S ? q._removingData === k && (k._parent && k._parent.removeChild(k), delete q._removingData) : k._parent && k._parent.removeChild(k);
var Z = q._datas.remove(k);
delete q._dataMap[I], A != F && delete q._78O[A];
var c;
q._rootMap[I] && (delete q._rootMap[I], c = q._roots.remove(k)), q._fsDataMap[I] && delete q._fsDataMap[I], q._reflectorMap[I] && delete q._reflectorMap[I], k._21I(F), q.onRemoved(k), q._36I.fire({
kind: Ce,
data: k,
rootsIndex: c,
datasIndex: Z
}), this.endTransaction()
}
}
}, onRemoved: function () { }, prepareRemove: function () { }, clear: function () {
var h = this;
if (h._datas.size()) {
var G = h._historyManager ? this.toJSON() : Z;
h._datas.toArray().forEach(function (M) {
M._21I(F)
}), h._datas.clear(), h._dataMap = {}, h._roots.clear(), h._rootMap = {}, h._fsDataMap = {}, h._reflectorMap = {}, h._78O = {}, h._36I.fire({
kind: Tg,
json: G
})
}
}, contains: function (V) {
return V && V._dataModel === this
}, handleDataPropertyChange: function (v) {
var i = this,
m = v.data,
n = v.property;
if ("parent" === n) {
var K = m._id,
R = i._rootMap,
_ = i._roots;
m._parent ? R[K] && (delete R[K], _.remove(m)) : R[K] || (R[K] = m, _.add(m))
} else if ("tag" === n) {
var E = v.oldValue,
L = v.newValue,
u = i._78O;
E != F && delete u[E], L != F && (u[L] = m)
} else if ("s:fullscreen" === n) {
var K = m._id,
h = i._fsDataMap;
v.oldValue != F && delete h[K], v.newValue != F && (h[K] = m)
} else if ("s:shape3d.reflector" === n) {
var K = m._id,
t = i._reflectorMap;
v.oldValue && delete t[K], v.newValue && (t[K] = m)
}
this.onDataPropertyChanged(m, v), this._35I.fire(v)
}, onDataPropertyChanged: function () { }, addDataModelChangeListener: function (E, B, W) {
this._36I.add(E, B, W)
}, removeDataModelChangeListener: function (y, x) {
this._36I.remove(y, x)
}, addSerializeListener: function (z, D, I) {
this._serializeNotifier.add(z, D, I)
}, removeSerializeListener: function (L, c) {
this._serializeNotifier.remove(L, c)
}, fireSerializeEvent: function (Q) {
this._serializeNotifier.fire(Q)
}, addDataPropertyChangeListener: function (D, f, K) {
this._35I.add(D, f, K)
}, removeDataPropertyChangeListener: function (N, j) {
this._35I.remove(N, j)
}, _38I: function (o, s, J) {
this._37I && this._37I.fire({
data: o,
oldIndex: s,
newIndex: J
})
}, addHierarchyChangeListener: function (U, Z, q) {
this._37I || (this._37I = new Yj), this._37I.add(U, Z, q)
}, removeHierarchyChangeListener: function (j, m) {
this._37I.remove(j, m)
}, getSiblings: function (K) {
var R = K._parent;
return R ? R._children : this._roots
}, eachByHierarchical: function (e, B, l) {
if (B) return this._eachByHierarchical(e, B, l);
for (var z = 0, v = this._roots, G = v.size(); G > z; z++)
if (this._eachByHierarchical(e, v.get(z), l) === !1) return !1;
return !0
}, _eachByHierarchical: function (g, U, S) {
if (S) {
if (g.call(S, U) === !1) return !1
} else if (g(U) === !1) return !1;
for (var n = U.size(), V = 0; n > V; V++)
if (this._eachByHierarchical(g, U.getChildAt(V), S) === !1) return !1;
return !0
}, reverseEachByHierarchical: function (s, T, U) {
if (T) return this._reverseEachByHierarchical(s, T, U);
for (var V = this._roots, w = V.size(), H = w - 1; H >= 0; H--)
if (this._reverseEachByHierarchical(s, V.get(H), U) === !1) return !1;
return !0
}, _reverseEachByHierarchical: function (_, e, E) {
for (var p = e.size(), s = p - 1; s >= 0; s--)
if (this._reverseEachByHierarchical(_, e.getChildAt(s), E) === !1) return !1;
if (E) {
if (_.call(E, e) === !1) return !1
} else if (_(e) === !1) return !1;
return !0
}, eachByDepthFirst: function (s, K, A) {
if (K) return this._11I(s, K, A);
for (var W = 0, O = this._roots, d = O.size(); d > W; W++)
if (this._11I(s, O.get(W), A) === !1) return !1;
return !0
}, _11I: function (o, e, l) {
for (var H = e.size(), M = 0; H > M; M++)
if (this._11I(o, e.getChildAt(M), l) === !1) return !1;
if (l) {
if (o.call(l, e) === !1) return !1
} else if (o(e) === !1) return !1;
return !0
}, eachByBreadthFirst: function (b, _, u) {
var c = new xr;
for (_ ? c.add(_) : this._roots.each(c.add, c); c.size() > 0;)
if (_ = c.removeAt(0), _.eachChild(c.add, c), u) {
if (b.call(u, _) === !1) return !1
} else if (b(_) === !1) return !1;
return !0
}, moveTo: function (I, B) {
var s = this.getSiblings(I),
J = s.indexOf(I);
J === B || 0 > J || B >= 0 && B <= s.size() && (s.remove(I), B > s.size() && B--, s.add(I, B), this._38I(I, J, B))
}, moveUp: function (C) {
this.moveTo(C, this.getSiblings(C).indexOf(C) - 1)
}, moveDown: function (P) {
this.moveTo(P, this.getSiblings(P).indexOf(P) + 1)
}, moveToTop: function (z) {
this.moveTo(z, 0)
}, moveToBottom: function (v) {
this.moveTo(v, this.getSiblings(v).size())
}, moveSelectionUp: function (q) {
this.beginTransaction(), q || (q = this.sm());
var Y = new xr;
ao(q, Y, this._roots), Y.each(this.moveUp, this), this.endTransaction()
}, moveSelectionDown: function (l) {
this.beginTransaction(), l || (l = this.sm());
var m = new xr;
Tk(l, m, this._roots), m.each(this.moveDown, this), this.endTransaction()
}, moveSelectionToTop: function (A) {
this.beginTransaction(), A || (A = this.sm());
var m = new xr;
no(A, m, this._roots), m.each(this.moveToTop, this), this.endTransaction()
}, moveSelectionToBottom: function (k) {
this.beginTransaction(), k || (k = this.sm());
var R = new xr;
er(k, R, this._roots), R.each(this.moveToBottom, this), this.endTransaction()
}, moveToIndex: function (h, E, f) {
var J = this.getDatas();
null == f && (f = J.indexOf(h)), f === E || 0 > f || E >= 0 && E <= J.size() && (J.remove(h), E > J.size() && E--, J.add(h, E), this._76I(h, f, E))
}, bringForward: function (r) {
this.moveToIndex(r, this.getDatas().indexOf(r) + 1)
}, bringToFront: function (N) {
this.moveToIndex(N, this.size())
}, sendBackward: function ($) {
this.moveToIndex($, this.getDatas().indexOf($) - 1)
}, sendToBack: function (p) {
this.moveToIndex(p, 0)
}, bringSelectionForward: function (G) {
this.beginTransaction(), G || (G = this.sm());
for (var V = new xr, o = this.getDatas(), W = !1, p = 0; p < o.size(); p++) {
var P = o.get(o.size() - 1 - p);
G.contains(P) ? W && V.add(P) : W = !0
}
V.each(this.bringForward, this), this.endTransaction()
}, bringSelectionToFront: function (c) {
this.beginTransaction(), c || (c = this.sm());
for (var X = new xr, H = this.getDatas(), B = 0; B < H.size(); B++) {
var d = H.get(B);
c.contains(d) && X.add(d)
}
X.each(this.bringToFront, this), this.endTransaction()
}, sendSelectionBackward: function (X) {
this.beginTransaction(), X || (X = this.sm());
for (var Q = new xr, f = this.getDatas(), R = !1, g = 0; g < f.size(); g++) {
var J = f.get(g);
X.contains(J) ? R && Q.add(J) : R = !0
}
Q.each(this.sendBackward, this), this.endTransaction()
}, sendSelectionToBack: function (t) {
this.beginTransaction(), t || (t = this.sm());
for (var C = new xr, P = this.getDatas(), x = 0; x < P.size(); x++) {
var J = P.get(P.size() - 1 - x);
t.contains(J) && C.add(J)
}
C.each(this.sendToBack, this), this.endTransaction()
}, addScheduleTask: function (c) {
var u = this;
u.removeScheduleTask(c), c.enabled == F && (c.enabled = !0), c.interval == F && (c.interval = 10), c.lastTime = Date.now(), u._29Q.push(c), u._30Q == F && (u._30Q = x.requestAnimationFrame(u._scheduleCallback))
}, removeScheduleTask: function (G) {
var P = this,
w = P._29Q,
b = w.indexOf(G);
b >= 0 && w.splice(b, 1), w.length || P._30Q == F || (x.cancelAnimationFrame(P._30Q), delete P._30Q)
}, getHistoryManager: function () {
return this._historyManager
}, enableHistoryManager: function (I) {
this._historyManager || new O.HistoryManager(this), null != I && this._historyManager.setMaxHistoryCount(I), this._historyManager.setDisabled(!1)
}, disableHistoryManager: function () {
this._historyManager && this._historyManager.setDisabled(!0)
}, clearHistoryManager: function () {
this._historyManager && this._historyManager.clear()
}, undo: function (d) {
this._historyManager && this._historyManager.undo(d)
}, redo: function (c) {
this._historyManager && this._historyManager.redo(c)
}, beginTransaction: function () {
this._historyManager && this._historyManager.beginTransaction()
}, endTransaction: function () {
this._historyManager && this._historyManager.endTransaction()
}, addHistory: function (t) {
this._historyManager && this._historyManager.addHistory(t)
}, onHistoryManagerChanged: function () { }, isDeserializing: function () {
return this._isDeserializing > 0
}, setDeserializing: function (d) {
d ? this._isDeserializing++ : this._isDeserializing--
}, isCubicEnvmap: function () {
return this._cubicEnvmap
}, setCubicEnvmap: function (H) {
var m = this._cubicEnvmap;
this._cubicEnvmap = H, this.fp("cubicEnvmap", m, H)
}
});
var Uc = O.SelectionModel = function (Q) {
var l = this;
l._68O = tb, l._map = {}, l._73O = new xr, l._74I = new Yj, l._21I(Q)
};
ki("SelectionModel", o, {
ms_fire: 1,
ms_dm: 1,
ms: function (k, I, B) {
this.addSelectionChangeListener(k, I, B)
}, ums: function (b, R) {
this.removeSelectionChangeListener(b, R)
}, fd: function () {
return this.getFirstData()
}, ld: function () {
return this.getLastData()
}, sg: function () {
return this._68O === vq
}, co: function (O) {
return this._map[O._id] != F
}, ss: function (Q) {
this.setSelection(Q)
}, as: function (q) {
this.appendSelection(q)
}, rs: function (G) {
this.removeSelection(G)
}, cs: function () {
this.clearSelection()
}, sa: function () {
this.selectAll()
}, getSelectionMode: function () {
return this._68O
}, setSelectionMode: function (e) {
var S = this;
if (S._68O !== e && (e === Jc || e === vq || e === tb)) {
S.cs();
var L = S._68O;
S._68O = e, S.fp("selectionMode", L, e)
}
}, _21I: function (R) {
var F = this,
L = F._dataModel;
L !== R && (L && (F.cs(), L.umm(F.handleDataModelChange, F)), F._dataModel = R, R.mm(F.handleDataModelChange, F, !0), F.fp(uk, L, R))
}, dispose: function () {
var N = this;
N.cs(), N._dataModel.umm(N.handleDataModelChange, N)
}, handleDataModelChange: function ($) {
var H = this;
if ($.kind === Ce) {
var z = $.data;
H.co(z) && (H._73O.remove(z), delete H._map[z._id], H._75I(Ce, new xr(z)))
} else $.kind === Tg && H.cs()
}, getFilterFunc: function () {
return this._filterFunc
}, setFilterFunc: function (m) {
var x = this;
if (x._filterFunc !== m) {
x.cs();
var C = x._filterFunc;
x._filterFunc = m, x.fp("filterFunc", C, x._filterFunc)
}
}, _75I: function (r, Y, O, j) {
O && (this._73O.each(function (U) {
j[U._id] ? O.remove(U) : O.add(U)
}), Y = O.toList()), this._74I.fire({
kind: r,
datas: new xr(Y)
})
}, addSelectionChangeListener: function (w, J, r) {
this._74I.add(w, J, r)
}, removeSelectionChangeListener: function (B, D) {
this._74I.remove(B, D)
}, _97O: function (E, A) {
for (var C, f = this, v = 0, o = new xr(E); v < o.size(); v++) C = o.get(v), (f._filterFunc && !f._filterFunc(C) || A && f.co(C) || !A && !f.co(C) || !f._dataModel.contains(C)) && (o.removeAt(v), v--);
return o
}, appendSelection: function (S) {
var g = this;
if (g._68O !== Jc) {
var C, B, r = g._73O,
c = g._97O(S, !0);
c.isEmpty() || (g.sg() && (C = new xr(r), B = g._map, r.clear(), g._map = {}, c = new xr(c.get(c.size() - 1))), c.each(function (F) {
r.add(F), g._map[F._id] = F
}), g._75I("append", c, C, B))
}
}, removeSelection: function (b) {
var U = this,
F = U._97O(b),
G = 0,
K = F.size();
if (0 !== K) {
for (; K > G; G++) {
var D = F.get(G);
U._73O.remove(D), delete U._map[D._id]
}
U._75I(Ce, F)
}
}, toSelection: function (K, q) {
return this._73O.toList(K, q)
}, getSelection: function () {
return this._73O
}, each: function (Q, i) {
this._73O.each(Q, i)
}, setSelection: function (Z) {
var E = this,
y = E._73O;
if (E._68O !== Jc && !(y.isEmpty() && !Z || 1 === y.size() && E.ld() === Z)) {
var L = new xr(y),
w = E._map;
y.clear(), E._map = {};
var $ = E._97O(Z, !0);
E.sg() && $.size() > 1 && ($ = new xr($.get($.size() - 1))), $.each(function (Q) {
y.add(Q), E._map[Q._id] = Q
}), E._75I("set", F, L, w)
}
}, clearSelection: function () {
var a = this,
v = a._73O;
if (v.size() > 0) {
var p = v.toList();
v.clear(), a._map = {}, a._75I(Tg, p)
}
}, selectAll: function () {
var H = this;
if (H._68O !== Jc) {
var x, S, k = H._dataModel.toDatas();
if (H._filterFunc)
for (x = 0; x < k.size(); x++) S = k.get(x), H._filterFunc(S) || (k.removeAt(x), x--);
var o = H._73O,
r = new xr(o),
f = H._map;
o.clear(), H._map = {}, H.sg() && k.size() > 1 && (k = new xr(k.get(k.size() - 1)));
var _ = k.size();
for (x = 0; _ > x; x++) S = k.get(x), o.add(S), H._map[S._id] = S;
H._75I("all", F, r, f)
}
}, size: function () {
return this._73O.size()
}, isEmpty: function () {
return this._73O.isEmpty()
}, contains: function (k) {
return this._map[k._id] != F
}, getLastData: function () {
var $ = this._73O;
return $.size() > 0 ? $.get($.size() - 1) : F
}, getFirstData: function () {
var A = this._73O;
return A.size() > 0 ? A.get(0) : F
}, isSelectable: function (n) {
var t = this;
return n && t._68O !== Jc ? t._filterFunc ? t._filterFunc(n) : !0 : !1
}, getTopSelection: function () {
var d = this,
D = new xr;
return d._73O.each(function (i) {
for (var p = i.getParent(); p;) {
if (d.contains(p)) {
i = F;
break
}
p = p.parent
}
i && D.add(i)
}), D
}
});
var Rp = function () {
return Ub(0),
function ($, t) {
var k;
if (Th(t)) {
var R = $.getDataUI(t);
R && R._88I && (k = R._88I.rect)
}
return k ? k : t.getRect()
}
}();
Uh(u, {
edgeGroupAgentFunc: F,
graphViewAutoScrollZone: 16,
graphViewZoomable: !0,
graphViewResettable: !1,
graphViewPannable: !0,
graphViewRectSelectable: !0,
graphViewScrollBarVisible: !0,
graphViewRectSelectBorderColor: S.rectSelectBorder,
graphViewRectSelectBackground: Vh,
graphViewEditPointSize: nf ? 17 : 7,
graphViewEditPointBorderColor: S.editPointBorder,
graphViewEditPointBackground: S.editPointBackground,
setEdgeType: function (b, R, c) {
$d[b] = R, Dc[b] = c
}, getEdgeType: function (F) {
return $d[F]
}, getEdgeTypeMap: function () {
return $d
}, getNodeRect: Rp
}, !0);
var Ve = {
"layout.h": Z,
"layout.v": Z,
"2d.selectable": !0,
"2d.visible": !0,
"2d.movable": !0,
"2d.editable": !0,
"2d.move.mode": Z,
"2d.attachable": !1,
"2d.hostable": !1,
interactive: !1,
preventDefaultWhenInteractive: !0,
"image.stretch": "fill",
icons: Z,
ingroup: !0,
"body.color": Z,
"2d.gray": !1,
fullscreen: Z,
"fullscreen.gap": 2,
"fullscreen.lock": !1,
opacity: Z,
pixelPerfect: !0,
keepAspectRatio: !1,
"attach.points": null,
"attach.style": null,
"attach.close.threshold": 16,
"clip.direction": "top",
"clip.percentage": 1,
"select.color": Bc,
"select.width": 1,
"select.padding": 2,
"select.type": Tq,
shadow: !1,
"shadow.blur": 6,
"shadow.offset.x": 3,
"shadow.offset.y": 3,
shadow2: !1,
"shadow2.color": Bc,
"shadow2.blur": 6,
"shadow2.offset.x": 3,
"shadow2.offset.y": 3,
"border.color": Z,
"border.width": 2,
"border.padding": 2,
"border.type": Tq,
label: Z,
"label.font": Z,
"label.color": Dh,
"label.background": Z,
"label.position": 31,
"label.position.fixed": !1,
"label.offset.x": 0,
"label.offset.y": 2,
"label.rotation": Z,
"label.max": Z,
"label.opacity": Z,
"label.scale": 1,
"label.align": Z,
"label.selectable": !0,
label2: Z,
"label2.font": Z,
"label2.color": Dh,
"label2.background": Z,
"label2.position": 34,
"label2.position.fixed": !1,
"label2.offset.x": 0,
"label2.offset.y": -2,
"label2.rotation": Z,
"label2.max": Z,
"label2.opacity": Z,
"label2.scale": 1,
"label2.align": Z,
"label2.selectable": !0,
note: Z,
"note.expanded": !0,
"note.font": Z,
"note.color": rf,
"note.background": Bc,
"note.position": 8,
"note.offset.x": -3,
"note.offset.y": 3,
"note.max": Z,
"note.toggleable": !0,
"note.border.width": 1,
"note.border.color": Z,
"note.opacity": Z,
"note.scale": 1,
"note.align": Z,
note2: Z,
"note2.expanded": !0,
"note2.font": Z,
"note2.color": rf,
"note2.background": Bc,
"note2.position": 3,
"note2.offset.x": 3,
"note2.offset.y": -3,
"note2.max": Z,
"note2.toggleable": !0,
"note2.border.width": 1,
"note2.border.color": Z,
"note2.opacity": Z,
"note2.scale": 1,
"note2.align": Z,
"group.type": Z,
"group.image": Z,
"group.image.stretch": "fill",
"group.repeat.image": Z,
"group.border.repeat.image": Z,
"group.padding": 8,
"group.padding.left": 0,
"group.padding.right": 0,
"group.padding.top": 0,
"group.padding.bottom": 0,
"group.position": 17,
"group.toggleable": !0,
"group.title.font": Z,
"group.title.color": rf,
"group.title.background": S.groupTitleBackground,
"group.title.align": nq,
"group.title.orientation": $c,
"group.background": S.groupBackground,
"group.depth": 1,
"group.border.width": 1,
"group.border.pattern": Z,
"group.border.color": Ur,
"group.border.radius": Z,
"group.border.cap": ob,
"group.border.join": Wl,
"group.border.width.absolute": !1,
"group.splitLine": !1,
"group.gradient": F,
"group.gradient.color": "#FFF",
shape: Z,
"shape.background": Ur,
"shape.repeat.image": Z,
"shape.border.repeat.image": Z,
"shape.border.width": 0,
"shape.border.width.absolute": !1,
"shape.border.color": Ur,
"shape.border.3d": !1,
"shape.border.3d.color": Z,
"shape.border.3d.accuracy": Z,
"shape.border.cap": ob,
"shape.border.join": Wl,
"shape.border.pattern": Z,
"shape.gradient": F,
"shape.gradient.color": "#FFF",
"shape.depth": 0,
"shape.dash": !1,
"shape.dash.pattern": up,
"shape.dash.offset": 0,
"shape.dash.color": dm,
"shape.dash.width": Z,
"shape.dash.3d": !1,
"shape.dash.3d.color": Z,
"shape.dash.3d.accuracy": Z,
"shape.polygon.side": 6,
"shape.arc.from": W,
"shape.arc.to": $,
"shape.arc.close": !0,
"shape.arc.oval": !1,
"shape.corner.radius": Z,
"shape.gradient.pack": Z,
"shape.fill.rule": "nonzero",
"shape.fill.clip.direction": "top",
"shape.fill.clip.percentage": 1,
"shape.foreground": Z,
"shape.foreground.gradient": F,
"shape.foreground.gradient.color": "#FFF",
"shape.foreground.clip.direction": "top",
"shape.foreground.clip.percentage": 1,
"autolayout.gap": Z,
"autolayout.hgap": Z,
"autolayout.vgap": Z,
"edge.type": Z,
"edge.points": Z,
"edge.segments": Z,
"edge.color": Ur,
"edge.width": 2,
"edge.width.absolute": !1,
"edge.repeat.image": null,
"edge.offset": 0,
"edge.group": 0,
"edge.expanded": !0,
"edge.gap": 12,
"edge.toggleable": !0,
"edge.center": !1,
"edge.3d": !1,
"edge.3d.color": Z,
"edge.3d.accuracy": Z,
"edge.cap": ob,
"edge.join": Wl,
"edge.source.position": 17,
"edge.source.anchor.x": Z,
"edge.source.anchor.y": Z,
"edge.source.offset.x": 0,
"edge.source.offset.y": 0,
"edge.source.index": -1,
"edge.source.percent": 0,
"edge.target.position": 17,
"edge.target.anchor.x": Z,
"edge.target.anchor.y": Z,
"edge.target.offset.x": 0,
"edge.target.offset.y": 0,
"edge.target.index": -1,
"edge.target.percent": 0,
"edge.pattern": Z,
"edge.dash": !1,
"edge.dash.pattern": up,
"edge.dash.offset": 0,
"edge.dash.color": dm,
"edge.dash.width": Z,
"edge.dash.3d": !1,
"edge.dash.3d.color": Z,
"edge.dash.3d.accuracy": Z,
"edge.independent": !1,
"attach.row.index": 0,
"attach.column.index": 0,
"attach.row.span": 1,
"attach.column.span": 1,
"attach.padding": 0,
"attach.padding.left": 0,
"attach.padding.right": 0,
"attach.padding.top": 0,
"attach.padding.bottom": 0,
"attach.index": -1,
"attach.offset": 0,
"attach.offset.relative": !1,
"attach.offset.opposite": !1,
"attach.thickness": Z,
"attach.gap": 0,
"attach.gap.relative": !1,
"grid.row.count": 1,
"grid.column.count": 1,
"grid.row.percents": Z,
"grid.column.percents": Z,
"grid.border": 1,
"grid.border.left": 0,
"grid.border.right": 0,
"grid.border.top": 0,
"grid.border.bottom": 0,
"grid.gap": 1,
"grid.background": S.gridBackground,
"grid.depth": 1,
"grid.cell.depth": -1,
"grid.cell.border.color": S.gridCellBorderColor,
"grid.block": Z,
"grid.block.padding": 3,
"grid.block.width": 1,
"grid.block.color": S.gridBlockColor,
text: "",
"text.align": "left",
"text.vAlign": "middle",
"text.color": Dh,
"text.font": Fh,
"text.shadow": !1,
"text.shadow.color": Bc,
"text.shadow.blur": 6,
"text.shadow.offset.x": 3,
"text.shadow.offset.y": 3,
"text.scale.x": 1,
"text.scale.y": 1,
keepPosition: !0
};
Ve[Cp] = Z, Uh(z, Ve, !0), Uh(jn, {
_76I: function (v, N, F) {
this._39I && this._39I.fire({
data: v,
oldIndex: N,
newIndex: F
})
}, addIndexChangeListener: function (i, V, m) {
var Z = this;
Z._39I || (Z._39I = new Yj), Z._39I.add(i, V, m)
}, removeIndexChangeListener: function (E, M) {
this._39I.remove(E, M)
}, prepareRemove: function (I) {
Bk(I) && (I.setSource(F), I.setTarget(F)), I._70O && I._70O.toList().each(this.remove, this), I._69O && I._69O.toList().each(function (W) {
W.setHost(F)
}), I._host && I.setHost(F)
}, onAdded: function (x) {
this.isAutoAdjustIndex() && this.adjustIndex(x)
}, onDataPropertyChanged: function (z, h) {
xs[h.property] && this.isAutoAdjustIndex() && this.adjustIndex(z)
}, isAdjustable: function (P) {
return Fq(P) || Bk(P)
}, isAdjustedToBottom: function (Q) {
return yl(Q) ? Q.isExpanded() && ag(Q) : !1
}, adjustIndex: function (K) {
var Q = this;
this.isHierarchicalRendering() || (Q.isAdjustedToBottom(K) ? (Q.sendToBottom(K), K.eachChild(Q.adjustIndex, Q)) : Q.sendToTop(K))
}, sendToTop: function (j) {
var U = this;
if (U.contains(j) && U.isAdjustable(j)) {
var y = U._datas;
if (j !== y.get(U.size() - 1)) {
var b = y.indexOf(j);
y.removeAt(b), y.add(j), U._76I(j, b, U.size() - 1)
}
if (Bk(j)) {
var V = j._40I;
V && !U.isAdjustedToBottom(V) && U.sendToTop(V), V = j._41I, V && !U.isAdjustedToBottom(V) && U.sendToTop(V)
}
j._69O && j._69O.each(function (G) {
G.isRelatedTo(j) || Fq(j) && G.isLoopedHostOn(j) || U.sendToTop(G)
}), j.ISubGraph || (!yl(j) || j.isExpanded()) && j._adjustChildrenToTop && j.eachChild(function (X) {
Bk(X) || U.sendToTop(X)
})
}
}, sendToBottom: function (W, m) {
var H = this;
if (W !== m && H.contains(W) && H.isAdjustable(W) && (!m || H.contains(m))) {
var T = H._datas,
R = T.remove(W),
L = m ? H._datas.indexOf(m) : 0;
if (T.add(W, L), R !== L) {
H._76I(W, R, L);
var J = W._parent;
!J || J.ISubGraph || Bk(J) || H.sendToBottom(W._parent, W)
}
}
}
}), Uh(fb, {
ms_edit: function (i) {
i._46O = function (W) {
var A = this,
l = A.gv.dm(),
g = A._index,
b = A._89I,
Y = A._node,
J = A._shape,
H = A._edge,
Z = A._77I;
Y && b ? (this.fi({
kind: "endEditRect",
event: W,
data: Y,
direction: b
}), l.endTransaction()) : J && g >= 0 ? (A.fi({
kind: "endEditPoint",
event: W,
data: J,
index: g
}), l.endTransaction()) : H && g >= 0 ? (A.fi({
kind: "endEditPoint",
event: W,
data: H,
index: g
}), l.endTransaction()) : Z && (A.fi({
kind: "endEditRotation",
event: W,
data: Z
}), l.endTransaction())
}, i._78I = function (t) {
var Q = this;
Q.autoScroll(t);
var j = Q.gv.lp(t),
s = Q._index,
i = Q._89I,
S = Q._node,
m = Q._shape,
V = Q._edge,
q = Q._77I;
if (S && i) Q._80O(j), Q.fi({
kind: "betweenEditRect",
event: t,
data: S,
direction: i
});
else if (m && s >= 0) j.e = m.getPoints().get(s).e, m.setPoint(s, j), Q.fi({
kind: "betweenEditPoint",
event: t,
data: m,
index: s
});
else if (V && s >= 0) {
var k = V.s(Ei);
j.e = k.get(s).e, k.set(s, j), V.fp(Ei, F, k), Q.fi({
kind: "betweenEditPoint",
event: t,
data: V,
index: s
})
} else if (q) {
var Y = q.p(),
z = q.getScale(),
I = N + D(j.y - Y.y, j.x - Y.x);
z.y < 0 && (I += W), X(I) < .04 && (I = 0), q.setRotation(I), Q.fi({
kind: "betweenEditRotation",
event: t,
data: q
})
}
}, i._80O = function (O) {
var J = this,
Z = J._node,
N = J._rect,
u = N.x,
T = N.y,
n = N.width,
H = N.height,
$ = J._89I,
h = J._anchor,
F = J._matrix,
O = F.tfi(O);
"northwest" === $ ? N = ms(O, {
x: u + n,
y: T + H
}) : $ === Tb ? N = ms({
x: u,
y: O.y
}, {
x: u + n,
y: T + H
}) : "northeast" === $ ? N = ms({
x: u,
y: O.y
}, {
x: O.x,
y: T + H
}) : $ === Wg ? N = ms({
x: O.x,
y: T
}, {
x: u + n,
y: T + H
}) : $ === Yn ? N = ms({
x: u,
y: T
}, {
x: O.x,
y: T + H
}) : "southwest" === $ ? N = ms({
x: O.x,
y: T
}, {
x: u + n,
y: O.y
}) : "south" === $ ? N = ms({
x: u,
y: T
}, {
x: u + n,
y: O.y
}) : "southeast" === $ && (N = ms({
x: u,
y: T
}, O)), Z.setPosition(F.tf(N.x + N.width * h.x, N.y + N.height * h.y)), Z.setWidth(N.width), Z.setHeight(N.height)
}, i._80I = function (a, U, L, z) {
var J = this,
V = J.gv._zoom,
t = (J.gv.getEditPointSize() + 2) / V;
return cf({
x: U - t / 2,
y: L - t / 2,
width: t,
height: t
}, a) ? (J._89I !== z && (J._89I = z), !0) : !1
}, i._79I = function (K, f, L) {
var O = this,
J = O.gv,
R = f ? J.getDataUI(f) : F,
e = R ? R._55O : F;
if (e) {
var A, H, x, m, B = J._zoom,
d = (J.getEditPointSize() + 2) / B,
W = J.lp(K);
if (Fq(f)) {
if (e._56O && Fq(f) && (H = e._98o, cf({
x: H.x - d / 2,
y: H.y - d / 2,
width: d,
height: d
}, W))) return O._77I = f, L && O.fi({
kind: "beginEditRotation",
event: K,
data: f
}), O.setCursor("crosshair"), !0;
if (e._43O && f instanceof Fc)
for (x = f.getPoints(), A = x.size() - 1; A >= 0; A--)
if (H = x.get(A), cf({
x: H.x - d / 2,
y: H.y - d / 2,
width: d,
height: d
}, W)) return O._index = A, O._shape = f, L && O.fi({
kind: "beginEditPoint",
event: K,
data: f,
index: A
}), O.setCursor("crosshair"), !0;
if (e._42O)
for (var b = f.getEditControlPoints(), i = ["northwest", -1, -1, Wg, -1, 0, "southwest", -1, 1, "south", 0, 1, "southeast", 1, 1, Yn, 1, 0, "northeast", 1, -1, Tb, 0, -1], A = 0, m = b.length; m > A; A++) {
var y = i[3 * A],
Q = b[A];
if (O._80I(W, Q.x, Q.y, y)) {
O._node = f;
var q = f.getWidth(),
T = f.getHeight(),
p = f.getAnchor();
O._rect = {
x: -q * p.x,
y: -T * p.y,
width: q,
height: T
}, O._anchor = p, O._matrix = f.getMatrix();
var v = f.getRotation(),
s = k(v),
_ = n(v),
Z = i[3 * A + 1] * he(f.getScale().x),
j = i[3 * A + 2] * he(f.getScale().y),
N = Math.atan2(-_ * Z - s * j, s * Z - _ * j),
z = (Math.round(N / (Math.PI / 4)) + 8) % 8,
Y = [Nc, "nesw-resize", zi, "nwse-resize", Nc, "nesw-resize", zi, "nwse-resize"][z];
return O.setCursor(Y), L && O.fi({
kind: "beginEditRect",
event: K,
data: f,
direction: O._89I
}), !0
}
}
}
if (e._43O && Bk(f) && f.s(ej) === _b && (x = f.s(Ei)))
for (A = x.size() - 1; A >= 0; A--)
if (H = x.get(A), cf({
x: H.x - d / 2,
y: H.y - d / 2,
width: d,
height: d
}, W)) return O._index = A, O._edge = f, L && O.fi({
kind: "beginEditPoint",
event: K,
data: f,
index: A
}), O.setCursor("crosshair"), !0
}
return !1
}
}, ms_gv: function (A) {
A._currentSubGraph = F, A._initView = function () {
this._fpsInfo = {
time: 0,
fps: 0,
frames: 0
}
}, A.upSubGraph = function () {
this.setCurrentSubGraph(Jr(this._currentSubGraph))
}, A.isVisible = function (s) {
var j = this;
if (Jr(s) !== j._currentSubGraph) return !1;
if (Bk(s)) {
var k = s._40I,
$ = s._41I;
if (!k || !$) return !1;
if (!(s.s("edge.independent") || j.isVisible(k) && j.isVisible($))) return !1;
if (s.isEdgeGroupHidden()) return !1
} else
for (var I = s._parent; I && !I.ISubGraph;) {
if (yl(I) && (!I.isExpanded() || !j.isVisible(I))) return !1;
I = I._parent
}
if (s._parent instanceof Br && !j.isVisible(s._parent)) return !1;
if (s._refGraph instanceof Ff && !j.isVisible(s._refGraph)) return !1;
if (j instanceof Hl) {
if (!s.s("3d.visible")) return !1
} else {
var h = j.getLayersInfo();
if (h) {
var C = h[s._layer];
if (C && C.visible === !1) return !1
}
if (!s.s("2d.visible")) return !1
}
return j._visibleFunc ? j._visibleFunc(s) : !0
}, A.handleSelectionChange = function (f) {
var m = this;
f.datas.each(function (z) {
m.invalidateData(z);
var s = z._parent;
yl(s) && Fq(z) && z.s(Dm) && (m.invalidateData(s), s._49I && s._49I.each(function (P) {
m.invalidateData(P)
}))
}), m.onSelectionChanged(f)
}, A.onSelectionChanged = function (D) {
var x = this,
f = x.sm();
if (1 === f.size() && ("set" === D.kind || "append" === D.kind)) {
var E = f.ld();
x.isAutoMakeVisible() && x.makeVisible(E), x.adjustIndex && x._dataModel.isAutoAdjustIndex() && x.adjustIndex(E)
}
}, A.makeVisible = function (n) {
if (n) {
var H = this,
Y = H.getDataUI ? H.getDataUI(n) : H.getData3dUI(n);
if (Y) {
var t = n,
$ = Jr(n);
for ($ !== H._currentSubGraph && H.setCurrentSubGraph($);
(t = t._parent) && t !== $;) yl(t) && t.setExpanded(!0);
H._23I = n, H.iv()
}
}
}, A.getLabel = function (b) {
var v = b.getStyle(Bg);
return v === Z ? b.getName() : v
}, A.getLabelBackground = function (V) {
return V.getStyle("label.background")
}, A.getLabelColor = function (j) {
return j.getStyle("label.color")
}, A.getLabel2 = function (D) {
return D.getStyle("label2")
}, A.getLabel2Background = function (F) {
return F.getStyle("label2.background")
}, A.getLabel2Color = function ($) {
return $.getStyle("label2.color")
}, A.getNote = function (Z) {
return Z.getStyle(Rm)
}, A.getNoteBackground = function (n) {
return n.getStyle("note.background")
}, A.getNote2 = function (G) {
return G.getStyle(Vk)
}, A.getNote2Background = function (E) {
return E.getStyle("note2.background")
}, A.handleClick = function (v, t, z) {
var K = this;
t ? (K.fi({
kind: "clickData",
event: v,
data: t,
part: z
}), K.onDataClicked(t, v)) : (K.fi({
kind: "clickBackground",
event: v
}), K.onBackgroundClicked(v))
}, A.handleDoubleClick = function (R, b, P) {
var s = this;
jj(R) && (b ? (s.fi({
kind: "doubleClickData",
event: R,
data: b,
part: P
}), s.onDataDoubleClicked(b, R, P), s.checkDoubleClickOnNote(R, b, P) || s.checkDoubleClickOnRotation && s.checkDoubleClickOnRotation(R, b, P) || (Bk(b) ? s.onEdgeDoubleClicked(b, R, P) : b.ISubGraph ? s.onSubGraphDoubleClicked(b, R, P) : yl(b) ? s.onGroupDoubleClicked(b, R, P) : b.IDoorWindow ? s.onDoorWindowDoubleClicked(b, R, P) : b.ICSGBox && s.onCSGBoxDoubleClicked(b, R, P))) : (s.fi({
kind: "doubleClickBackground",
event: R
}), s.onBackgroundDoubleClicked(R)))
}, A.onSubGraphDoubleClicked = function (x) {
this.setCurrentSubGraph(x)
}, A.onEdgeDoubleClicked = function (x, k) {
this.isEditable(x) || (x.ISubGraph && !ik(k) ? this.setCurrentSubGraph(x) : x.s("edge.toggleable") && x.toggle())
}, A._39Q = function (l) {
return this.isInteractive(l) ? this.preventDefaultWhenInteractive(l) : !1
}, A.preventDefaultWhenInteractive = function (o) {
return o.s("preventDefaultWhenInteractive")
}, A.onGroupDoubleClicked = function (F) {
F.s("group.toggleable") && F.toggle()
}, A.onDoorWindowDoubleClicked = function (k) {
k.s("dw.toggleable") && k.toggle(!0)
}, A.onCSGBoxDoubleClicked = function (N, L) {
var r = this;
if (r instanceof Hl) {
var a = r.intersectObject(L, N);
a && N.s(a.part + ".toggleable") && N.toggleFace(a.part, !0)
}
}, A.onBackgroundClicked = function () { }, A.onBackgroundDoubleClicked = function () {
this.upSubGraph()
}, A.onDataClicked = function () { }, A.onDataDoubleClicked = function () { }, A.onAutoLayoutEnded = function () { }, A.onMoveEnded = function () { }, A.onPanEnded = function () { }, A.onPinchEnded = function () { }, A.onRectSelectEnded = function () { }, A.onZoomEnded = function () { }, A.serialize = function (g) {
return this.dm().serialize(g)
}, A.toJSON = function () {
return this.dm().toJSON()
}, A.deserialize = function (S, G) {
var i = this;
G = G instanceof Qp ? {
rootParent: G
} : El(G) ? {
setId: G
} : Mf(G) ? {
finishFunc: G
} : G || {}, G.view = i;
var e = i.dm();
return G.__innerHandler__ = function (k) {
if (El(e.a("toolTipEnable")) && (e.a("toolTipEnable") ? i.enableToolTip() : i.disableToolTip()), i instanceof O.graph.GraphView && (El(e.a("zoomable")) && i.setZoomable && i.setZoomable(e.a("zoomable")), El(e.a("pannable")) && i.setPannable && i.setPannable(e.a("pannable")), El(e.a("rectSelectable")) && i.setRectSelectable && i.setRectSelectable(e.a("rectSelectable")), e.a("fitContent") === !0 && i.fitContent && i.fitContent(!0, 0)), i instanceof O.graph3d.Graph3dView) {
var Y = k.scene;
Y && Y.shadow != F && i.shadowMap.setShadow(Y.shadow, Y.shadowParams);
var $ = e.a("sceneContext");
$ ? ($.eye && i.setEye($.eye), $.center && i.setCenter($.center), Bp($.far) && i.setFar($.far), Bp($.near) && i.setNear($.near)) : (Bp(e.a("sceneNear")) && i.setNear(e.a("sceneNear")), Bp(e.a("sceneFar")) && i.setFar(e.a("sceneFar")), Y && (Y.eye && i.setEye(Y.eye), Y.center && i.setCenter(Y.center))), El(e.a("sceneShadowEnabled")) && (e.a("sceneShadowEnabled") ? i.enableShadow() : i.disableShadow()), e.a("sceneShadowDegreeX") && i.setShadowDegreeX(e.a("sceneShadowDegreeX")), e.a("sceneShadowDegreeZ") && i.setShadowDegreeZ(e.a("sceneShadowDegreeZ")), e.a("sceneShadowIntensity") && i.setShadowIntensity(e.a("sceneShadowIntensity")), e.a("sceneShadowQuality") && i.setShadowQuality(e.a("sceneShadowQuality")), e.a("sceneShadowType") && i.setShadowType(e.a("sceneShadowType")), e.a("sceneShadowRadius") && i.setShadowRadius(e.a("sceneShadowRadius")), e.a("sceneShadowBias") && i.setShadowBias(e.a("sceneShadowBias")), El(e.a("sceneDashEnable")) && i.setDashDisabled(!e.a("sceneDashEnable")), dk(e.a("sceneHighlightMode")) && i.setHighlightMode(e.a("sceneHighlightMode")), Bp(e.a("sceneHighlightWidth")) && i.setHighlightWidth(e.a("sceneHighlightWidth")), e.a("sceneHighlightColor") && i.setHighlightColor(e.a("sceneHighlightColor")), El(e.a("sceneHeadlightEnable")) && i.setHeadlightDisabled(!e.a("sceneHeadlightEnable")), Bp(e.a("sceneHeadlightRange")) && i.setHeadlightRange(e.a("sceneHeadlightRange")), e.a("sceneHeadlightColor") && i.setHeadlightColor(e.a("sceneHeadlightColor")), Bp(e.a("sceneHeadlightIntensity")) && i.setHeadlightIntensity(e.a("sceneHeadlightIntensity")), Bp(e.a("sceneHeadlightAmbientIntensity")) && i.setHeadlightAmbientIntensity(e.a("sceneHeadlightAmbientIntensity")), El(e.a("sceneFogEnable")) && i.setFogDisabled(!e.a("sceneFogEnable")), e.a("sceneFogMode") && i.setFogMode(e.a("sceneFogMode")), El(e.a("sceneFogDensity")) && i.setFogDensity(!e.a("sceneFogDensity")), e.a("sceneFogColor") && i.setFogColor(e.a("sceneFogColor")), Bp(e.a("sceneFogNear")) && i.setFogNear(e.a("sceneFogNear")), Bp(e.a("sceneFogFar")) && i.setFogFar(e.a("sceneFogFar")), El(e.a("sceneBatchBrightnessDisabled")) && i.setBatchBrightnessDisabled(e.a("sceneBatchBrightnessDisabled")), El(e.a("sceneBatchBlendDisabled")) && i.setBatchBlendDisabled(e.a("sceneBatchBlendDisabled")), El(e.a("sceneBatchColorDisabled")) && i.setBatchColorDisabled(e.a("sceneBatchColorDisabled")), e.a("sceneBatchInfoMap") && i.setBatchInfoMap(e.a("sceneBatchInfoMap")), Bp(e.a("sceneMoveStep")) && i.setMoveStep(e.a("sceneMoveStep")), Bp(e.a("sceneRotateStep")) && i.setRotateStep(e.a("sceneRotateStep"));
var h = e.a("sceneSkyboxType") || "sphere";
if (h != F) {
var T = {},
_ = !1;
if ("sphere" === h) {
T.shape3d = h;
var U = e.a("sceneSkyboxImage");
U && (T["shape3d.image"] = U, _ = !0)
} else T.shape3d = Z, ["front", "back", "left", "right", "top", "bottom"].forEach(function (y) {
var f = y + ".image",
D = y.charAt(0).toUpperCase() + y.slice(1),
p = e.a("sceneSkybox" + D + "Image");
p && (T[f] = p, _ = !0)
}); if (_) {
var z = new Dp;
z.s3(20, 20, 20), T["body.color"] = e.a("sceneSkyboxBodyColor"), T.envmap = e.a("sceneSkyboxEnvmap"), T.light = !1, T["texture.wrap"] = "clampToEdge", z.s(T), ["X", "Y", "Z"].forEach(function (L) {
var Y = e.a("sceneSkyboxRotation" + L);
Bp(Y) && z["setRotation" + L](Y)
}), i.setSkybox(z)
}
}
}
}, e.deserialize(S, G.rootParent, G)
}, A.isDebugTipShowing = function () {
return !!this._debugDiv
}, A.showDebugTip = function () {
var v = this,
Y = v._debugDiv;
if (!Y) {
Y = v._debugDiv = U.createElement("div"), Y.style.position = "absolute", Y.style.overflow = "hidden", Y.style.font = u.debugTipLabelFont, Y.style.padding = "6px", Y.style.backgroundColor = u.debugTipBackground, Y.style.color = u.debugTipLabelColor;
var F = v.getView();
v._79O ? F.insertBefore(Y, v._79O) : F.appendChild(Y);
var C = function () {
v.redraw();
var $ = v._canvas,
S = "FPS: " + v._fpsInfo.fps + " " + "Datas: " + v.dm().getDatas().length + ($ ? " Size: " + $.width + " * " + $.height : ""),
x = v.dm()._historyManager;
x && (S += " Undoes: " + x.getHistories().length + " index: " + x.getHistoryIndex());
var e = v.getDebugTip();
e && (S += "
" + e), Y.innerHTML = S, v._isDebugging && requestAnimationFrame(C)
};
requestAnimationFrame(C), v._isDebugging = !0
}
}, A.hideDebugTip = function () {
var y = this,
o = y._debugDiv;
o && (delete y._debugDiv, y.getView().removeChild(o), y._isDebugging = !1)
}, A.updateDOMAppendMatrix = function () {
var J = this.getView();
J && (J.updateAppendMatrix = !0)
}, A.countFrame = function () {
if (this._isDebugging) {
var h = Date.now(),
G = this._fpsInfo;
h - G.time > 1e3 ? (G.fps = Math.round(1e5 * (G.frames + 1) / (h - G.time)) / 100, G.time = h, G.frames = 0) : G.frames++
}
}
}, ms_icons: function (f) {
f.getRotation = function (m) {
return m == F ? 0 : m
}, f._15O = function () {
var j = this,
l = j.s(ub);
if (l) {
var H = j,
m = j.data || j._data,
B = j._38o = {
icons: l,
rects: {}
};
for (var Y in l) {
var q = l[Y],
A = Dj(q.shape3d, m, H);
if (!(Dj(q.visible, m, H) === !1 || Dj(q.for3d, m, H) && !j.I3d || A && !j.I3d)) {
var T = A ? [A] : Dj(q.names, m, H),
b = T ? T.length : 0,
s = Dj(q.position, m, H) || 3,
n = Dj(q.offsetX, m, H) || 0,
E = Dj(q.offsetY, m, H) || 0,
R = Dj(q.direction, m, H) || Yn,
x = Dj(q.gap, m, H),
w = x != F ? x : 1,
y = Dj(q.rotation, m, H),
G = Dj(q.keepOrien, m, H),
i = Dj(q.rotationFixed, m, H) ? y : j.getRotation(y, G, s),
v = F,
W = B.rects[Y] = new Array(b);
W.rotation = i;
for (var M = 0; b > M; M++) {
var p, Z, U, z, L = T[M];
if (A) U = 0, z = 0;
else {
var O = ii(L);
U = Dj(q.width, m, H), z = Dj(q.height, m, H), U == F && (U = xc(O, m)), z == F && (z = oo(O, m))
} if (v ? R === Yn ? n += U / 2 : R === Wg ? n -= U / 2 : R === Tb ? E -= z / 2 : E += z / 2 : v = {
width: U,
height: z
}, j.I3d) {
var a = -U / 2,
N = -z / 2;
Z = {
width: U,
height: z,
mat: j._16O(Dj(q.autorotate, m, H), s, v, Dj(q.face, m, H) || wg, Dj(q.t3, m, H), Dj(q.r3, m, H), Dj(q.rotationMode, m, H), n, E),
vs: new fk([a, -N, 0, a, -N - z, 0, a + U, -N - z, 0, a + U, -N, 0])
}
} else p = j.getPosition(s, n, E, v, Dj(q.positionFixed, m, H)), Z = {
x: p.x - U / 2,
y: p.y - z / 2,
width: U,
height: z
}, j._68o(Z, i);
W[M] = Z, R === Yn ? n += U / 2 + w : R === Wg ? n -= U / 2 + w : R === Tb ? E -= z / 2 + w : E += z / 2 + w
}
}
}
}
}
}
});
var Ym = {
1: 1,
2: 1,
6: 1,
9: 1,
10: 1,
14: 1,
15: 1,
16: 1,
21: 1,
22: 1,
26: 1,
29: 1,
30: 1,
34: 1,
36: 1,
38: 1,
40: 1,
42: 1,
45: 1,
50: 1,
52: 1,
54: 1
},
nk = {
3: 1,
7: 1,
11: 1,
17: 1,
23: 1,
27: 1,
31: 1,
44: 1,
46: 1,
47: 1,
49: 1
},
Jd = {
translateX: 1,
translateY: 1,
zoom: 1,
scrollBarVisible: 1
},
xs = {
sourceAgent: 1,
targetAgent: 1,
expanded: 1,
parent: 1,
host: 1
},
Lk = {
position: 1,
width: 1,
height: 1,
expanded: 1,
rotation: 1,
anchor: 1,
scale: 1,
"s:edge.points": 1
},
Am = {
"edge.type": 1,
"edge.group": 1
},
Yr = {
rotation: 1,
rotationX: 1,
rotationZ: 1
},
Zf = {
rotation: 1,
rotationX: 1,
rotationZ: 1,
position: 1,
width: 1,
height: 1,
anchor: 1,
scale: 1
},
ir = {
position: 1,
width: 1,
height: 1,
anchor: 1,
scale: 1,
"s:grid.row.count": 1,
"s:grid.column.count": 1,
"s:grid.row.percents": 1,
"s:grid.column.percents": 1,
"s:grid.border": 1,
"s:grid.border.left": 1,
"s:grid.border.right": 1,
"s:grid.border.top": 1,
"s:grid.border.bottom": 1,
"s:grid.gap": 1
},
Zj = {
"attach.row.index": 1,
"attach.column.index": 1,
"attach.row.span": 1,
"attach.column.span": 1,
"attach.padding": 1,
"attach.padding.left": 1,
"attach.padding.right": 1,
"attach.padding.top": 1,
"attach.padding.bottom": 1,
"attach.index": 1,
"attach.offset": 1,
"attach.offset.relative": 1,
"attach.offset.opposite": 1,
"attach.gap": 1,
"attach.gap.relative": 1,
"attach.thickness": 1
},
zq = {
shape: 1,
thickness: 1,
position: 1,
anchor: 1,
scale: 1
},
Jr = function (Q) {
if (!Q) return F;
if (Bk(Q)) {
var s = Q._40I,
l = Q._41I;
if (!s || !l) return F;
var G = Jr(s),
E = Jr(l);
return G === E ? G : F
}
for (var r = Q._parent; Bk(r) && !r.ISubGraph;) r = r._parent;
return r ? r.ISubGraph ? r : Jr(r) : F
},
ld = function (I, j, F, b) {
var $ = j.getStyle(F) * b;
$ && vn(I, $), $ = j.getStyle(F + ".left") * b, $ && (I.x -= $, I.width += $), $ = j.getStyle(F + ".right") * b, $ && (I.width += $), $ = j.getStyle(F + ".top") * b, $ && (I.y -= $, I.height += $), $ = j.getStyle(F + ".bottom") * b, $ && (I.height += $), I.width < 0 && (I.width = -I.width, I.x -= I.width), I.height < 0 && (I.height = -I.height, I.y -= I.height)
},
ag = function (U) {
for (var R, j = 0, S = U.size(); S > j; j++)
if (R = U.getChildAt(j), Fq(R) && ag(R)) return !0;
return U.hasAgentEdges()
},
An = function (z) {
if (!z) return F;
for (var A = z._parent; yl(A);) {
if (!yl(A._parent)) return A.isExpanded() ? z : A;
A.isExpanded() || (z = A), A = A._parent
}
return z
},
ur = function (y, b) {
if (!y || !b) return F;
var p, H, X, $ = Jr(y),
M = Jr(b);
if ($ !== M) {
for (; M && $ !== M;) M = Jr(M);
if ($ === M) return y;
p = new xr, p.add(y, 0);
for (var f = y._parent; Fq(f) && !b.isDescendantOf(f);) p.add(f, 0), f = f._parent;
for (X = p.size(), H = 0; X > H; H++) {
var r = p.get(H);
if (yl(r) && !r.isExpanded()) return r;
if (r.ISubGraph) return r
}
return y
}
return y
},
Oq = function (g) {
if (g.isLooped()) return g._source;
var L = An(g._source),
b = An(g._target);
return L === b ? g._source : ur(L, b)
},
xg = function (y) {
if (y.isLooped()) return y._target;
var m = An(y._source),
L = An(y._target);
return m === L ? y._target : ur(L, m)
},
Eo = function (r, D, H) {
"target" !== H && (H = "source");
var L = "target" === H ? D.getTargetAgent() : D.getSourceAgent(),
E = "edge." + H + ".";
if (Bk(L)) {
var T = r.getDataUI(L);
T._79o();
var i = D.s(E + "index");
if (i >= 0) {
var e = Kk(T);
return e[Math.max(0, Math.min(i, e.length - 1))]
}
var j = D.s(E + "percent") || 0;
j = Math.max(0, Math.min(j, 1));
var b = qm(T);
return np(b, 100 * j)
}
return Yg(r, L, D.s(E + "position"), D.s(E + "offset.x"), D.s(E + "offset.y"), D.s(E + "anchor.x"), D.s(E + "anchor.y"))
},
Yg = function (P, R, S, y, u, e, W) {
if (!R) return F;
var $, M = R.getRotation ? R.getRotation() : 0;
if (e !== Z || W !== Z) {
e = e === Z ? .5 : e, W = W === Z ? .5 : W;
var C = R.getScale();
if (M && !Th(R, P) || C.x < 0 || C.y < 0) {
var H = R.getPosition(),
m = R.getWidth(),
I = R.getHeight(),
A = R.getAnchor(),
_ = new In(M, H.x, H.y, C.x, C.y);
S = _.tf((e - A.x) * m, (W - A.y) * I)
} else $ = Rp(P, R), S = {
x: $.x + e * $.width,
y: $.y + W * $.height
}
} else S = Re(S, Rp(P, R)); if (M) {
var j = k(M),
U = n(M),
t = y * j - u * U;
u = y * U + u * j, y = t
}
return S.x += y, S.y += u, S
},
kk = function (Y, h) {
if (!Y || !h) return F;
var w, b, D, p, P, M;
if (Y === h) {
if (p = Y.getLoopedEdges(), !p) return F;
p = new xr(p)
} else {
if (P = Y.getAgentEdges(), M = h.getAgentEdges(), !P || !M) return F;
for (b = P.size(), w = 0; b > w; w++) D = P.get(w), M.contains(D) && (p || (p = new xr), p.add(D))
} if (p)
for (w = 0; w < p.size(); w++) D = p.get(w), D.getStyle(ej) === _b && (D._22I(F), p.removeAt(w), w--);
return p
},
gi = function (j, z) {
var e = kk(j, z);
if (e && !e.isEmpty()) {
if (1 === e.size()) return e.get(0)._22I(F), void 0;
var M = new xr,
T = new xr;
e.each(function (e) {
var k = e.s("edge.group");
M.contains(k) || M.add(k)
}), M.sort(), M.each(function (d) {
T.add(new O.EdgeGroup(e.toList(function (h) {
return d === h.s("edge.group")
}), T))
}), T.each(function (s) {
s.each(function (T) {
T._22I(s)
})
})
}
},
wq = function (K, L, Y) {
var n = K._canvas;
K._zoom;
var b = Nm(L, n),
X = Nm(Y, n);
return {
x: b.x - X.x,
y: b.y - X.y
}
},
vp = function (t, q) {
if (q) {
var Z = q.rect,
v = q.color,
S = q.rotation,
r = q.labelWidth,
o = q.background,
k = q.opacity,
l = q.scale,
O = l != F && 1 !== l;
if (k != F) {
var A = t.globalAlpha;
t.globalAlpha *= k
}
if (S || O) {
t.save();
var j = Z.x + Z.width / 2,
h = Z.y + Z.height / 2;
wh(t, j, h), S && jc(t, S), O && t.scale(l, l), wh(t, -j, -h)
}
if (o && fl(t, Z.x, Z.y, Z.width, Z.height, o), r) {
var L = Z.width,
m = t.createLinearGradient(Z.x, Z.y, Z.x + L, Z.y);
m.addColorStop(0, v), m.addColorStop(.9, v), m.addColorStop(1, nb), v = m, Z.width = r
}
Om(t, q.ss, Z, q.font, v, q.align), r && (Z.width = L), (S || O) && t.restore(), k != F && (t.globalAlpha = A)
}
},
$q = function (s, Q) {
if (Q) {
var X = Q.rect,
O = X.x,
E = X.y,
h = X.width,
K = X.height,
J = Q.background,
w = Q.backgroundImage,
f = Q.borderWidth,
U = Q.borderColor,
e = Q.labelWidth,
M = Q.opacity,
Y = Q.scale,
n = Y != F && 1 !== Y;
if (M != F) {
var _ = s.globalAlpha;
s.globalAlpha *= M
}
if (n) {
s.save();
var y = X.x + X.width / 2,
d = X.y + X.height / 2;
wh(s, y, d), s.scale(Y, Y), wh(s, -y, -d)
}
if (Q.expanded) {
var t = V(8, h / 4),
o = E + K - 8;
if (s.fillStyle = J, s.beginPath(), s.moveTo(O, E), s.lineTo(O, o), s.lineTo(O + h / 2, o), s.lineTo(O + h / 2, E + K), s.lineTo(O + h / 2 + t, o), s.lineTo(O + h, o), s.lineTo(O + h, E), s.closePath(), s.fill(), f && (s.lineWidth = f, s.lineJoin = "round", s.lineCap = "round", U ? (s.strokeStyle = U, s.stroke()) : (s.strokeStyle = cn(J), s.beginPath(), s.moveTo(O + h, E), s.lineTo(O + h, o), s.lineTo(O + h / 2 + t, o), s.lineTo(O + h / 2, E + K), s.stroke(), s.strokeStyle = Ee(J), s.beginPath(), s.moveTo(O + h, E), s.lineTo(O, E), s.lineTo(O, o), s.lineTo(O + h / 2, o), s.lineTo(O + h / 2, E + K), s.stroke())), w) qk(s, ii(w), Mg, X.x, X.y, X.width, X.height - 8, Q.data, Q.view);
else {
if (X.height -= 8, J = Q.color, e) {
var S = h,
H = s.createLinearGradient(O, E, O + S, E);
H.addColorStop(0, J), H.addColorStop(.9, J), H.addColorStop(1, nb), J = H, X.width = e
}
Om(s, Q.ss, X, Q.font, J, Q.align), e && (X.width = S), X.height += 8
}
} else if (Q.icon) Yd(s, ii(Q.icon), O, E, h, K, Q.data, Q.view);
else {
var v = h / 2;
f && (s.lineWidth = f, s.lineJoin = "round", s.lineCap = "round", s.strokeStyle = U ? U : cn(J), s.beginPath(), s.arc(O + v, E + v, v, N, 1.6 * W, !0), s.moveTo(O + v, E + K), s.lineTo(O + h - v / 5, E + v), s.stroke(), s.strokeStyle = U ? U : Ee(J), s.beginPath(), s.arc(O + v, E + v, v, 1.6 * W, N, !0), s.moveTo(O + v, E + K), s.lineTo(O + v / 5, E + v), s.stroke()), s.fillStyle = J, s.beginPath(), s.arc(O + v, E + v, v, 0, $, !0), s.moveTo(O + v, E + K), s.lineTo(O + h - v / 5, E + v), s.lineTo(O + v / 5, E + v), s.closePath(), s.fill(), s.fillStyle = Q.color, s.beginPath(), s.arc(O + v, E + v, v / 3, 0, $, !0), s.fill()
}
n && s.restore(), M != F && (s.globalAlpha = _)
}
},
cr = function (p, x) {
return x > 2 * p ? p : x / 2
},
Mn = function (A, c, m, Z) {
if (!A || !c) return 0;
var L = D(c.y - A.y, c.x - A.x);
return m || (L = c.x < A.x ? L + W : L), L + Z
},
Md = function (A, v, m, J, i, M, Q) {
Q && (A.x > v.x || A.x === v.x && A.y > v.y) && (m = cg[m], i = -i);
var b = Re(m, {
x: 0,
y: 0,
width: En(A, v),
height: 0
}, M);
return b.x += J, b.y += i, b = new In(D(v.y - A.y, v.x - A.x)).tf(b), b.x += A.x, b.y += A.y, b
},
Ml = function (B, l, d, C, M) {
if (B._19Q = !0, !d.getEdgeGroup()) return C ? d.s("edge.gap") : 0;
if (Bk(d.getSourceAgent()) || Bk(d.getTargetAgent())) return 0;
var m, X = 0,
L = 0,
$ = 0;
if (d.getEdgeGroup().getSiblings().each(function (Q) {
Q.each(function (Q) {
if (l.isVisible(Q) && Q.s(ej) == M) {
var Y = Q.s("edge.gap");
m ? (L += $ / 2 + Y / 2, $ = Y) : (m = Q, $ = Y), Q === d && (X = L)
}
})
}), C) return L - X + $;
var Z = X - L / 2;
return m && d._40I !== m._40I && (B._19Q = !1), Z
},
Dk = function () {
var F = function (R) {
var e = [];
return R.forEach(function (I) {
e.push({
x: I.x,
y: I.y
}), e.push({
x: I.x + I.width,
y: I.y + I.height
}), e.push({
x: I.x + I.width,
y: I.y
}), e.push({
x: I.x,
y: I.y + I.height
})
}), e
};
return function (T, N, M) {
if ("oval" === T) {
var j = 0,
t = M.height / M.width,
f = t * t,
n = M.x + M.width / 2,
x = M.y + M.height / 2,
s = F(N);
s.forEach(function (z) {
var C = z.x - n,
k = z.y - x,
R = C * C + k * k / f;
R > j && (j = R)
}), j = w(j);
var O = t * j;
return {
x: n - j,
y: x - O,
width: 2 * j,
height: 2 * O
}
}
if ("circle" === T) {
var r = 0,
n = M.x + M.width / 2,
x = M.y + M.height / 2,
s = F(N);
return s.forEach(function (i) {
var Q = i.x - n,
m = i.y - x,
C = Q * Q + m * m;
C > r && (r = C)
}), r = w(r), {
x: n - r,
y: x - r,
width: 2 * r,
height: 2 * r
}
}
return "roundRect" === T ? (vn(M, V(M.width, M.height) / 16), M) : M
}
}(),
hg = O.graph = {},
Bb = function (i, v, z) {
yc(Y + ".graph." + i, v, z)
};
O.layout = {};
var wk = {},
lc = function (i, D, P, A, r, c, v, z) {
var X = v._zoom;
if (X !== v._cacheZoom && (v._cacheZoom = X, v._cacheImage = {}), X *= ij, A = Math.ceil(A * X), r = Math.ceil(r * X), A > 2048 || r > 2048) return D;
var w = [D.uuid, A, r, P].join("_");
D.cacheRule && (w += "_" + Dj(D.cacheRule, c, v));
var n = v._cacheImage[w];
return n || (_m(), n = O.Default.toCanvas(D, A, r, P, c, v, z), zm() && (v._cacheImage[w] = n)), n
};
Uh(u, {
setImageCacheRule: function (h, V) {
var C;
V || "object" != typeof h ? (C = {}, C[h] = V) : C = h;
for (var l in C) {
var g = C[l];
dk(l) ? (yc = ii(l), yc ? yc.cacheRule = g : wk[l] = g) : l.cacheRule = g
}
}
});
var zr = {
comps: [{
type: bl,
points: [85, 50, 70, 115, 100, 71, 86, 107, 88, 49, 43, 117, 100, 48, 57, 106, 108, 57, 69, 55, 101, 53, 78, 114, 65, 55, 97, 112, 56, 70, 68, 49, 67, 97, 115, 122, 67, 43, 113, 110, 114, 54, 69, 61],
borderWidth: 1,
borderColor: F
}]
};
if (zr[ul] = zr[Hh] = 160, x.Image) {
var fh = new x.Image;
fh.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAALUlEQVRYR+3QQREAAAABQfqXFsNnFTizzXk99+MAAQIECBAgQIAAAQIECBAgMBo/ACHo7lH9AAAAAElFTkSuQmCC", _c("default_blank", fh)
}
_c("node_image", ee(30, 30, [{
type: Tq,
rect: [4, 5, 22, 16],
gradient: Nf,
gradientColor: Cn,
background: Ur
}, {
type: Tq,
rect: [2, 3, 26, 20],
borderWidth: 1,
borderColor: Ur
}, {
type: Tq,
rect: [11, 23, 8, 4],
background: Ur
}, {
type: Tq,
rect: [6, 27, 18, 2],
background: Ur
}])), _c("node_icon", ee(16, 16, [{
type: Tq,
rect: [2, 2, 12, 10],
gradient: Nf,
gradientColor: Cn,
background: Ur
}, {
type: Xe,
rect: [2, 2, 12, 10],
width: 1,
color: Ur
}, {
type: Tq,
rect: [6, 12, 4, 2],
background: Ur
}, {
type: Tq,
rect: [4, 14, 8, 1],
background: Ur
}])), _c("block_icon", ee(16, 16, [{
type: Xe,
rect: [1, 1, 14, 14],
width: 1,
color: Ur
}])), _c("group_image", ee(66, 39, [{
type: Tq,
rect: [44.3, 18, 18.1, 12.8],
gradient: Nf,
gradientColor: Cn,
background: Ur
}, {
type: Tq,
rect: [3.3, 17.8, 18.1, 12.8],
gradient: Nf,
gradientColor: Cn,
background: Ur
}, {
type: Tq,
rect: [15.8, 3.2, 33.5, 26.4],
borderWidth: 1,
borderColor: Ur,
gradient: Nf,
gradientColor: Cn,
background: Ur
}, {
type: Tq,
rect: [26.2, 29.4, 12.8, 4.2],
background: Ur
}, {
type: Tq,
rect: [21.3, 33.5, 22.5, 2.3],
background: Ur
}, {
type: Tq,
rect: [5.3, 32.7, 14.1, 2.1],
background: Ur
}, {
type: Tq,
rect: [9, 30.4, 6.7, 2.4],
background: Ur
}, {
type: Tq,
rect: [50, 30.7, 6.7, 2.4],
background: Ur
}, {
type: Tq,
rect: [46.3, 33, 14.1, 2.1],
background: Ur
}])), _c("group_icon", ee(16, 16, [{
type: Tq,
rect: [4, 12, 4, 2],
background: Ur
}, {
type: Tq,
rect: [2, 13, 8, 1],
background: Ur
}, {
type: Tq,
rect: [12, 12, 2, 1],
background: Ur
}, {
type: Tq,
rect: [11, 13, 4, 1],
background: Ur
}, {
type: Tq,
rect: [10, 7, 6, 5],
gradient: Nf,
gradientColor: Cn,
background: Ur
}, {
type: Tq,
rect: [1, 2, 10, 10],
gradient: Nf,
gradientColor: Cn,
background: Ur
}, {
type: Xe,
rect: [1, 2, 10, 10],
width: 1,
color: Ur
}])), _c("refGraph_icon", ee(16, 16, [{
type: "shape",
borderWidth: 1,
borderColor: Ur,
borderCap: "round",
rotation: .7854,
points: [12.5502, 6.7981, 12.5502, 6.7981, 12.5502, 4.8181, 12.5502, 3.7981, 12.5502, 2.7781, 11.36687, 1.7981, 10.0502, 1.7981, 8.73354, 1.7981, 7.5502, 2.8181, 7.5502, 3.7981, 7.5502, 4.55989, 7.5502, 7.79805, 7.5502, 7.79805, 7.5502, 7.79805, 7.5502, 9.7981, 10.0502, 9.7981],
segments: [1, 4, 4, 4, 4, 4]
}, {
type: "shape",
borderWidth: 1,
borderColor: Ur,
borderCap: "round",
rotation: -2.35619,
points: [8.4498, 11.2019, 8.4498, 11.2019, 8.4498, 9.2219, 8.4498, 8.2019, 8.4498, 7.1819, 7.26646, 6.2019, 5.9498, 6.2019, 4.63313, 6.2019, 3.4498, 7.2219, 3.4498, 8.2019, 3.4498, 8.9637, 3.4498, 12.20186, 3.4498, 12.20186, 3.4498, 12.20186, 3.4498, 14.2019, 5.9498, 14.2019],
segments: [1, 4, 4, 4, 4, 4]
}])), _c("edge_icon", ee(16, 16, [{
type: Tq,
rect: [2.1, 6.9, 11.5, 2.6],
rotation: -.79,
gradient: Nf,
gradientColor: Cn,
background: Ur
}, {
type: Tq,
rect: [10.8, 1, 4, 4],
background: Ur
}, {
type: Tq,
rect: [1, 11, 4, 4],
background: Ur
}])), _c("subGraph_image", ee(72, 45, [{
type: bl,
points: [9, 42, .3, 38.4, 2.4, 28.8, 5.7, 21.6, 11.7, 22.5, 11.7, 15.9, 16.8, 13.8, 21.6, 12, 24.3, 15.9, 27.9, 3, 42.3, 2.1, 59.4, 4.5, 57.3, 18.3, 67.5, 18.9, 69.6, 27.3, 69.9, 38.4, 64.2, 41.4],
segments: [1, 3, 3, 3, 3, 3, 3, 3, 3],
gradient: Nf,
gradientColor: Cn,
background: Ur
}, {
type: Tq,
rect: [29.6, 30.7, 3.6, 1.8],
background: Ur
}, {
type: Tq,
rect: [28.4, 32.3, 6, 1.2],
background: Ur
}, {
type: Tq,
rect: [37.3, 32, 10.8, 1.8],
background: Ur
}, {
type: Tq,
rect: [39.1, 29.9, 7.2, 2.3],
background: Ur
}, {
type: Tq,
rect: [26.6, 23.7, 9.6, 7.2],
gradient: Nf,
gradientColor: Cn,
background: Ur
}, {
type: Tq,
rect: [34.3, 16.8, 16.8, 13.2],
borderWidth: 1,
borderColor: Ur,
gradient: Nf,
gradientColor: Cn,
background: Ur
}])), _c("subGraph_icon", ee(17, 17, [{
type: bl,
points: [2.2, 14.6, .2, 11.9, .8, 8.8, 1.8, 5.9, 5.6, 7.4, 3.8, 1.6, 10.3, 3, 14.5, 4.2, 12.2, 7.5, 18.9, 7.2, 14.5, 14.5],
segments: [1, 3, 3, 3, 3, 3],
gradient: Nf,
gradientColor: Cn,
background: Ur
}])), _c("shape_icon", ee(16, 16, [{
type: bl,
points: [1.5, 1, 8.4, 1, 8.4, 7.2, 14.6, 7.1, 14.6, 14.9, 1.5, 14.9, 1.5, 1],
background: Ur
}])), _c("polyline_icon", ee(16, 16, [{
type: bl,
points: [1.5, 1, 8.4, 1, 8.4, 7.2, 14.6, 7.1, 14.6, 14.9, 1.5, 14.9, 1.5, 1],
borderWidth: 1,
borderColor: Ur
},
eq(7.5, .4), eq(7.5, 6.3), eq(13.6, 6.3), eq(13.6, 14), eq(.7, 13.9), eq(.7, .3)])), _c("grid_icon", ee(16, 16, [{
type: Tq,
rect: [1, 1, 4, 4],
background: Ur,
gradient: Nf,
gradientColor: Cn
}, {
type: Tq,
rect: [6, 1, 4, 4],
background: Ur,
gradient: Nf,
gradientColor: Cn
}, {
type: Tq,
rect: [11, 1, 4, 4],
background: Ur,
gradient: Nf,
gradientColor: Cn
}, {
type: Tq,
rect: [11, 6, 4, 4],
background: Ur,
gradient: Nf,
gradientColor: Cn
}, {
type: Tq,
rect: [6, 6, 4, 4],
background: Ur,
gradient: Nf,
gradientColor: Cn
}, {
type: Tq,
rect: [1, 6, 4, 4],
background: Ur,
gradient: Nf,
gradientColor: Cn
}, {
type: Tq,
rect: [11, 11, 4, 4],
background: Ur,
gradient: Nf,
gradientColor: Cn
}, {
type: Tq,
rect: [6, 11, 4, 4],
background: Ur,
gradient: Nf,
gradientColor: Cn
}, {
type: Tq,
rect: [1, 11, 4, 4],
background: Ur,
gradient: Nf,
gradientColor: Cn
}])), _c("light_icon", ee(16, 16, [{
type: "rect",
rect: [6, 9, 5, 5],
borderWidth: 1,
borderColor: Ur
}, {
type: "circle",
rect: [1, 1, 15, 10],
borderWidth: 1,
borderColor: Ur,
gradient: Nf,
gradientColor: Cn,
background: {
func: function (R) {
var M = R ? R.s(ep) : F;
return ip(M) ? "rgb(" + Zb(255 * M[0]) + "," + Zb(255 * M[1]) + "," + Zb(255 * M[2]) + ")" : M || Ur
}
}
}])), _c("text_icon", ee(16, 16, [{
type: "shape",
points: [3, 3, 13, 3, 8, 3, 8, 14],
segments: [1, 2, 1, 2],
borderWidth: 1,
borderColor: Ur
}])), _c("border_image", {
fitSize: !0,
comps: [{
type: "border",
relative: !0,
rect: [0, 0, 1, 1],
color: {
func: "style@border_color"
},
width: {
func: "style@border_width"
}
}]
}), _c("columnChart_image", {
fitSize: !0,
boundExtend: 150,
comps: [{
type: {
func: "style@chart.type"
},
relative: !0,
rect: [0, 0, 1, 1],
label: {
func: "style@chart.label"
},
labelColor: {
func: "style@chart.label.color"
},
labelFont: {
func: "style@chart.label.font"
},
series: {
func: "style@chart.series"
},
minValue: {
func: "style@chart.min.value"
},
maxValue: {
func: "style@chart.max.value"
}
}]
}), _c("lineChart_image", {
fitSize: !0,
boundExtend: 150,
comps: [{
type: "lineChart",
relative: !0,
rect: [0, 0, 1, 1],
label: {
func: "style@chart.label"
},
labelColor: {
func: "style@chart.label.color"
},
labelFont: {
func: "style@chart.label.font"
},
series: {
func: "style@chart.series"
},
minValue: {
func: "style@chart.min.value"
},
maxValue: {
func: "style@chart.max.value"
},
linePoint: {
func: "style@chart.line.point"
},
lineWidth: {
func: "style@chart.line.width"
},
line3d: {
func: "style@chart.line.3d"
}
}]
}), _c("pieChart_image", {
fitSize: !0,
boundExtend: 150,
comps: [{
type: "pieChart",
relative: !0,
rect: [0, 0, 1, 1],
label: {
func: "style@chart.label"
},
labelColor: {
func: "style@chart.label.color"
},
labelFont: {
func: "style@chart.label.font"
},
hollow: {
func: "style@chart.hollow"
},
startAngle: {
func: "style@chart.start.angle"
},
values: {
func: "style@chart.values"
},
colors: {
func: "style@chart.colors"
}
}]
});
var vr = function (G, q, $, t, Y, T) {
var h, N, f, A, M, F, g, X, V, R, r, I = [];
if (Math.abs(t) > 2 * Math.PI && (t = 2 * Math.PI), M = Math.ceil(Math.abs(t) / (Math.PI / 4)), h = t / M, N = -h, f = -$, M > 0) {
F = G + Math.cos($) * Y, g = q + Math.sin(-$) * T, I.push({
x: F,
y: g
});
for (var E = 0; M > E; E++) f += N, A = f - N / 2, X = G + Math.cos(f) * Y, V = q + Math.sin(f) * T, R = G + Math.cos(A) * (Y / Math.cos(N / 2)), r = q + Math.sin(A) * (T / Math.cos(N / 2)), I.push({
x: R,
y: r
}), I.push({
x: X,
y: V
})
}
return I
},
gl = function (J) {
if (J) {
var i = J._data;
if (i instanceof O.Shape) return {
points: i.getPoints(),
segments: i.getSegments()
};
var I;
if (i instanceof O.Edge && (I = J._78o)) {
var V, k, C = I.type,
T = I.points,
e = I.segments,
l = I.edgeTypeInfo;
if (!C || T) {
var a = I.sourcePoint,
U = a.x,
N = a.y,
_ = I.targetPoint,
S = _.x,
F = _.y;
if (C) e ? (V = new xr({
x: U,
y: N
}), V.addAll(T), V.add({
x: S,
y: F
}), k = new xr(e._as)) : (V = new xr({
x: U,
y: N
}), T.each(function (U) {
V.add(U)
}), V.add({
x: S,
y: F
}));
else if (I.looped) {
V = new xr(vr(U, N, 0, 2 * Math.PI, I.radius, I.radius)), k = new xr([1]);
for (var B = 0; B < (V.size() - 1) / 2; B++) k.add(3)
} else V = new xr, I.center ? (V.add({
x: I.c1.x,
y: I.c1.y
}), V.add({
x: U,
y: N
}), V.add({
x: S,
y: F
}), V.add({
x: I.c2.x,
y: I.c2.y
})) : (V.add({
x: U,
y: N
}), V.add({
x: S,
y: F
}))
} else l && (V = new xr(l.points._as), l.segments && (k = new xr(l.segments._as)));
return {
points: V,
segments: k
}
}
}
},
qm = function (H, W, F) {
if (null == W) {
var j = gl(H);
if (!j) return;
W = j.points, F = j.segments
}
if (W) {
if (Array.isArray(W) && (W = new xr(W)), "number" == typeof W.get(0)) {
for (var m = new O.List, $ = 0; $ < W.size(); $ += 2) m.add({
x: W.get($),
y: W.get($ + 1)
});
W = m
}
if (!F) {
F = [1];
for (var G = W.length - 1; G > 0; G--) F.push(2)
}
Array.isArray(F) && (F = new xr(F));
for (var x = Yo(W._as, F._as, 50), A = x.length, B = [], $ = 0; A > $; $++) {
var d = x[$];
d.length > 1 && B.push(d)
}
return B
}
},
Pp = function (Q) {
for (var i = 0, U = Q.length - 1, N = 0; U > N; N++) {
var I = Q[N],
g = Q[N + 1],
F = g.x - I.x,
C = g.y - I.y;
i += Math.sqrt(F * F + C * C)
}
return i
},
eh = function (F, e) {
for (var x = 0, u = e.length, I = 0; u > I; I++) {
var W = e[I];
if (x += W, x > F) return I
}
return Math.min(I, u - 1)
},
tp = function (j, D) {
for (var e = 0, g = 0, _ = 0, c = j.length - 1, U = 0; c > U; U++) {
var v = j[U],
H = j[U + 1],
b = H.x - v.x,
C = H.y - v.y;
if (_ = Math.sqrt(b * b + C * C), e += _, e > D) {
e -= _, g = U;
break
}
}
var I = j[g],
L = j[g + 1],
t = Math.atan2(L.y - I.y, L.x - I.x),
z = D - e,
C = Math.sin(t) * z,
b = Math.cos(t) * z;
return {
x: I.x + b,
y: I.y + C
}
},
np = function (q, M) {
if (q) {
var r;
if (0 === M) r = q[0][0];
else if (100 === M) q = q[q.length - 1], r = q[q.length - 1];
else {
for (var b = 0, I = [], z = q.length, l = 0; z > l; l++) {
var A = q[l],
Q = Pp(A);
b += Q, I.push(Q)
}
for (var m = b * M / 100, p = eh(m, I), o = 0, e = 0; p > e; e++) o += I[e];
m -= o, r = tp(q[p], m)
}
return r
}
},
Kk = function (Y) {
var z, O, l, H, E = gl(Y),
b = [],
s = E.points,
o = E.segments,
$ = -1;
for (O = 0, l = o ? o.length : s.length; l > O; O++) {
if (z = o ? o.get(O) : 1, 3 === z) H = 2;
else if (4 === z) H = 3;
else {
if (5 === z) continue;
H = 1
}
$ += H, b.push(s.get($))
}
return b
},
Tn = function (w, j, x, v) {
function P(M) {
if (M >= 0 && 1 >= M) {
G = j(M);
var K = (w.x - G.x) * (w.x - G.x) + (w.y - G.y) * (w.y - G.y);
return F > K ? (F = K, _ = M, !0) : !1
}
}
x = x || 100, v = v || 1e-5;
for (var F = 1 / 0, _ = 0, G = new Xi, M = 0; x > M; ++M) P(M / x);
for (var Z = 1 / (2 * x); Z > v;) P(_ - Z) || P(_ + Z) || (Z /= 2);
return _
};
Uh(u, {
_edgeProtectMethod: {
getStraightLinePoints: qm,
calculateLineLength: Pp,
calcSegmentIndexByDistance: eh,
calculatePointAlongLine: tp,
getPercentPosition: np,
getRealPointsFromDataUI: Kk
}
});
var Mb = function (g, s) {
for (var J = g.vertices, y = 0; y < J.length; y++) {
var H = J[y],
k = H.y;
H.y = H.z, H.z = -k, s && (H.y += s)
}
},
ig = function (G) {
for (var k, B, V, H, D, s, n = [], v = [], E = [], X = G.faces, A = 0, O = 0, J = 0, L = X.length; L > A; A++, O += 6, J += 9) {
var o = X[A];
1 === o.i ? (k || (k = [], B = [], V = []), yd(o, A, O, J, G, k, V, B)) : 2 === o.i ? (H || (H = [], D = [], s = []), yd(o, A, O, J, G, H, s, D)) : yd(o, A, O, J, G, n, E, v)
}
return {
vs: n,
uv: v,
ns: E,
top_vs: k,
top_uv: B,
top_ns: V,
bottom_vs: H,
bottom_uv: D,
bottom_ns: s
}
},
yd = function (z, t, w, o, K, X, q, W) {
var c = K.vertices,
e = K.faceVertexUvs,
p = c[z.a],
H = c[z.b],
O = c[z.c];
X.push(p.x, p.y, p.z, H.x, H.y, H.z, O.x, O.y, O.z);
var D, V, b, Y = z.vertexNormals;
3 === Y.length ? (D = Y[0], V = Y[1], b = Y[2]) : D = V = b = z.normal, q.push(D.x, D.y, D.z, V.x, V.y, V.z, b.x, b.y, b.z);
var x = e[0][t][0],
M = e[0][t][1],
$ = e[0][t][2];
W.push(x.x, x.y, M.x, M.y, $.x, $.y)
},
_h = function () {
function Q(s, y) {
return s.dot(y) > 0
}
function q(w, P, v, h, g, Z, k) {
for (var y, O, M = [P, v, h], G = [g, Z, k], L = [], Y = M.length, N = !0; Y-- && N;) {
for (var J = M[Y], f = G.length, j = !1; f--;)
if (J.equals(G[f])) {
G.splice(f, 1), L.push(J), j = !0;
break
}
if (!j) {
if (y) {
N = !1;
break
}
y = J
}
}
return N && 2 === L.length && (O = G[0], W.subVectors(y, L[0]), I.subVectors(O, L[0]), B.subVectors(y, L[1]), W.x * B.y * I.z + B.x * I.y * W.z + I.x * W.y * B.z - I.x * B.y * W.z - I.y * B.z * W.x - I.z * B.x * W.y < 1e-6 && (R.subVectors(O, L[1]), F.subVectors(L[1], L[0]), Q(F, W) && Q(F, I) && (F.negate(), Q(F, B) && Q(F, R)))) ? (w.push(L[1].x, L[1].y, L[1].z), w.push(y.x, y.y, y.z), w.push(y.x, y.y, y.z), w.push(L[0].x, L[0].y, L[0].z), w.push(L[0].x, L[0].y, L[0].z), w.push(O.x, O.y, O.z), w.push(O.x, O.y, O.z), w.push(L[1].x, L[1].y, L[1].z), 2) : (w.push(P.x, P.y, P.z), w.push(v.x, v.y, v.z), w.push(v.x, v.y, v.z), w.push(h.x, h.y, h.z), w.push(h.x, h.y, h.z), w.push(P.x, P.y, P.z), 1)
}
function J() {
this._vertexMap = {}, this._lineMap = {}, this._lineList = []
}
function f(N, f, T, b, F, o, d) {
var v = [T, F];
N[0] === b && v.reverse();
var u = [v[0]._key, v[1]._key].join("|"),
O = N._triangles[u];
O || (N._triangles[u] = O = {});
var t = [o._key, d._key].join("|");
O[t] || (O[t] = [o, d])
}
function G(c, j, F) {
var L = c._planes[F._key];
if (!L)
for (var m in c._planes) {
var r = c._planes[m];
if (r._normal.angleTo(F) < .001) {
L = r;
break
}
}
return L ? (L._vertices.indexOf(j) < 0 && L._vertices.push(j), void 0) : (c._planes[F._key] = {
_normal: F,
_vertices: [j]
}, void 0)
}
function k(n, h) {
return 0 === h ? "0|0|0" : 1 / 0 === Math.abs(h) ? [n.x, n.y, n.z].join("|") : [Math.round(X.angleTo(n) * h), Math.round(t.angleTo(n) * h), Math.round(_.angleTo(n) * h)].join("|")
}
function d(Z, G) {
var g = Z._ctlineModel;
if (g || (Z._ctlineModel = g = []), g[0]) return g[0];
var u;
u = ip(Z) ? Z : [Z];
var p, R, n, I, l, z, E, d, K, M, A, N, Q, Y, H, $, s, W, e, D = ["", "top_", "bottom_"];
g = [];
var C = [];
for ($p(u, G, C), p = 0, R = C.length; R > p; p++)
if (M = C[p])
for (ko(M), n = 0, I = D.length; I > n; n++)
if (K = M[D[n] + "lvs"])
for (s = g.length, W = K.length, g.length = s + W, e = 0; W > e; ++e, ++s) g[s] = K[e];
else if (E = M[D[n] + "vs"]) {
d = M[D[n] + "is"], z = d ? d.length : E.length / 3;
for (var l = 0; z - 1 > l;) d ? (A = d[l], N = d[l + 1], Q = d[l + 2], Y = d[l + 3], H = d[l + 4], $ = d[l + 5]) : (A = l, N = l + 1, Q = l + 2, Y = l + 3, H = l + 4, $ = l + 5), S.fromArray(E, 3 * A), L.fromArray(E, 3 * N), O.fromArray(E, 3 * Q), v.fromArray(E, 3 * Y), P.fromArray(E, 3 * H), i.fromArray(E, 3 * $), l += 3 * q(g, S, L, O, v, P, i);
z > l && (d ? (A = d[l], N = d[l + 1], Q = d[l + 2]) : (A = l, N = l + 1, Q = l + 2), S.fromArray(E, 3 * A), L.fromArray(E, 3 * N), O.fromArray(E, 3 * Q), g.push(S.x, S.y, S.z), g.push(L.x, L.y, L.z), g.push(L.x, L.y, L.z), g.push(O.x, O.y, O.z), g.push(O.x, O.y, O.z), g.push(S.x, S.y, S.z))
}
return Z._ctlineModel[0] = g, g
}
function e(k, I, W) {
var E = k._ctlineModel;
E || (k._ctlineModel = E = []);
var e = E[1];
if (e && e.epsilon === W) return e;
e = [], e.epsilon = W;
var S;
S = ip(k) ? k : [k];
var H, p, f, y, G, F, P, O, r, D, b, o, V = ["", "top_", "bottom_"],
u = new J,
z = [];
for ($p(S, I, z), H = 0, p = z.length; p > H; H++)
if (r = z[H])
for (ko(r), f = 0, y = V.length; y > f; f++)
if (P = r[V[f] + "vs"]) {
O = r[V[f] + "is"], F = O ? O.length : P.length / 3;
for (var G = 0, G = 0; F > G; G += 3) O ? (D = O[G], b = O[G + 1], o = O[G + 2]) : (D = G, b = G + 1, o = G + 2), u._addTriangle(P, Z, D, b, o, W)
}
return u._toLineVS(e), k._ctlineModel[1] = e, e
}
function y(K, A, a) {
var T = K._ctlineModel;
T || (K._ctlineModel = T = []);
var S = T[1];
if (S && S.epsilon === a) return S;
S = [], S.epsilon = a;
var t;
t = ip(K) ? K : [K];
var B, x, z, G, $, L, V, o, C, h, e, F, m, v = ["", "top_", "bottom_"],
k = new J,
l = [];
for ($p(t, A, l), B = 0, x = l.length; x > B; B++)
if (h = l[B])
for (ko(h), z = 0, G = v.length; G > z; z++)
if (V = h[v[z] + "vs"]) {
o = h[v[z] + "is"], C = h[v[z] + "ns"], L = o ? o.length : V.length / 3;
for (var $ = 0, $ = 0; L > $; $ += 3) o ? (e = o[$], F = o[$ + 1], m = o[$ + 2]) : (e = $, F = $ + 1, m = $ + 2), k._addTriangle(V, C, e, F, m, a)
}
return k._toLineVS(S), K._ctlineModel[2] = S, S
}
var S = new tl,
L = new tl,
O = new tl,
v = new tl,
P = new tl,
i = new tl,
W = new tl,
B = new tl,
I = new tl,
R = new tl,
F = new tl,
h = new tl;
J.prototype._findVertex = function (J, y) {
h.fromArray(J, 3 * y);
var G = [h.x, h.y, h.z].join(","),
c = this._vertexMap[G];
if (!c) {
var K = h.clone();
K._key = G, this._vertexMap[G] = c = K
}
return c
}, J.prototype._findLine = function (H, E) {
var g = [H, E];
H._key > E._key && g.reverse(), g._key = [g[0]._key, g[1]._key].join("|");
var v = this._lineMap[g._key];
return v || (this._lineMap[g._key] = v = g, g._triangles = {}, g._planes = {}, this._lineList.push(g)), v
};
var X = new tl(1, 0, 0),
t = new tl(0, 1, 0),
_ = new tl(0, 0, 1),
w = new tl,
a = new tl;
return J.prototype._addTriangle = function (Y, g, O, S, x, T) {
var E, s, r, i = this._findVertex(Y, O),
R = this._findVertex(Y, S),
c = this._findVertex(Y, x),
t = this._findLine(i, R),
l = this._findLine(R, c),
P = this._findLine(c, i);
g ? (E = (new tl).fromArray(g, 3 * O), E._key = k(E, T), s = (new tl).fromArray(g, 3 * S), s._key = k(s, T), r = (new tl).fromArray(g, 3 * x), r._key = k(r, T), f(t, i, E, R, s, c, r), f(l, R, s, c, r, i, E), f(P, c, r, i, E, R, s)) : (a.subVectors(c, R), w.subVectors(R, i), E = (new tl).crossVectors(w, a), E._key = k(E, T), G(t, c, E), G(l, i, E), G(P, R, E))
}, J.prototype._toLineVS = function (z) {
for (var N = this._lineList, H = 0, x = N.length; x > H; ++H) {
var d = N[H],
A = !1;
for (var I in d._triangles)
if (1 == o.keys(d._triangles[I]).length) {
z.push(d[0].x, d[0].y, d[0].z, d[1].x, d[1].y, d[1].z), A = !0;
break
}
if (!A)
for (var Q in d._planes)
if (1 == d._planes[Q]._vertices.length) {
z.push(d[0].x, d[0].y, d[0].z, d[1].x, d[1].y, d[1].z), A = !0;
break
}
}
}, [d, e, y]
}(),
hl = function (A, R) {
var F = A._lineModel;
if (F) return F;
var o;
o = ip(A) ? A : [A];
var N, v, q, n, m, a, E, h, u, P, L, f, y = ["", "top_", "bottom_"];
F = [];
var D = [];
for ($p(A, R, D), N = 0, v = D.length; v > N; N++)
if (u = D[N])
for (q = 0, n = y.length; n > q; q++)
if (E = u[y[q] + "vs"]) {
h = u[y[q] + "is"], a = h ? h.length : E.length / 3;
for (var m = 0; a > m; m += 3) h ? (P = h[m], L = h[m + 1], f = h[m + 2]) : (P = m, L = m + 1, f = m + 2), P *= 3, L *= 3, f *= 3, F.push(E[P], E[P + 1], E[P + 2], E[L], E[L + 1], E[L + 2], E[L], E[L + 1], E[L + 2], E[f], E[f + 1], E[f + 2], E[f], E[f + 1], E[f + 2], E[P], E[P + 1], E[P + 2])
}
return A._lineModel = F, F
},
wf = function ($, T, S, W, C, Y, G, b, N) {
S == F && (S = !0), W == F && (W = !0), G == F && (G = 1), b == F && (b = 0);
var u = new af;
return en(u, $, T, N), u = u.toShapes(), ig(new xb(u, {
top: S,
bottom: W,
curveSegments: C,
amount: G,
repeatUVLength: Y
}, -G / 2 + b))
},
jd = function (u, l) {
this.x = u || 0, this.y = l || 0
};
jd.prototype = {
constructor: jd,
add: function (C) {
return this.x += C.x, this.y += C.y, this
}, sub: function (t) {
return this.x -= t.x, this.y -= t.y, this
}, equals: function (m) {
return m.x === this.x && m.y === this.y
}, multiplyScalar: function (I) {
return this.x *= I, this.y *= I, this
}, distanceTo: function (B) {
return w(this.distanceToSquared(B))
}, distanceToSquared: function (M) {
var w = this.x - M.x,
c = this.y - M.y;
return w * w + c * c
}, clone: function () {
return new jd(this.x, this.y)
}
};
var pe = function (T, X, O) {
this.x = T || 0, this.y = X || 0, this.z = O || 0
};
pe.prototype = {
constructor: pe,
set: function (g, Y, X) {
return this.x = g, this.y = Y, this.z = X, this
}, setY: function (D) {
return this.y = D, this
}, copy: function (w) {
return this.x = w.x, this.y = w.y, this.z = w.z, this
}, add: function (E) {
return this.x += E.x, this.y += E.y, this.z += E.z, this
}, addVectors: function (K, U) {
return this.x = K.x + U.x, this.y = K.y + U.y, this.z = K.z + U.z, this
}, sub: function (k) {
return this.x -= k.x, this.y -= k.y, this.z -= k.z, this
}, subVectors: function (x, k) {
return this.x = x.x - k.x, this.y = x.y - k.y, this.z = x.z - k.z, this
}, multiplyScalar: function (c) {
return this.x *= c, this.y *= c, this.z *= c, this
}, applyMatrix4: function (L) {
var q = this.x,
j = this.y,
z = this.z,
K = L.elements;
return this.x = K[0] * q + K[4] * j + K[8] * z + K[12], this.y = K[1] * q + K[5] * j + K[9] * z + K[13], this.z = K[2] * q + K[6] * j + K[10] * z + K[14], this
}, divideScalar: function (n) {
if (0 !== n) {
var u = 1 / n;
this.x *= u, this.y *= u, this.z *= u
} else this.x = 0, this.y = 0, this.z = 0;
return this
}, dot: function (N) {
return this.x * N.x + this.y * N.y + this.z * N.z
}, length: function () {
return w(this.x * this.x + this.y * this.y + this.z * this.z)
}, normalize: function () {
return this.divideScalar(this.length())
}, cross: function (L) {
var n = this.x,
H = this.y,
X = this.z;
return this.x = H * L.z - X * L.y, this.y = X * L.x - n * L.z, this.z = n * L.y - H * L.x, this
}, crossVectors: function (e, o) {
var L = e.x,
G = e.y,
Q = e.z,
i = o.x,
S = o.y,
y = o.z;
return this.x = G * y - Q * S, this.y = Q * i - L * y, this.z = L * S - G * i, this
}, distanceTo: function ($) {
return w(this.distanceToSquared($))
}, distanceToSquared: function (E) {
var Z = this.x - E.x,
g = this.y - E.y,
t = this.z - E.z;
return Z * Z + g * g + t * t
}, clone: function () {
return new pe(this.x, this.y, this.z)
}
};
var wl = function () {
this.elements = new Float32Array(16)
};
wl.prototype = {
constructor: wl,
set: function ($, L, M, H, X, x, N, U, p, Q, B, D, v, o, u, k) {
var K = this.elements;
return K[0] = $, K[4] = L, K[8] = M, K[12] = H, K[1] = X, K[5] = x, K[9] = N, K[13] = U, K[2] = p, K[6] = Q, K[10] = B, K[14] = D, K[3] = v, K[7] = o, K[11] = u, K[15] = k, this
}, makeRotationAxis: function (r, I) {
var L = k(I),
w = n(I),
O = 1 - L,
t = r.x,
j = r.y,
m = r.z,
G = O * t,
S = O * j;
return this.set(G * t + L, G * j - w * m, G * m + w * j, 0, G * j + w * m, S * j + L, S * m - w * t, 0, G * m - w * j, S * m + w * t, O * m * m + L, 0, 0, 0, 0, 1), this
}
};
var kf = function (o) {
this.repeatUVLength = o
};
kf.prototype = {
generateTopUV: function (h, g, z, X, e, T, b) {
var R, E, i, l, u = h.vertices,
f = u[X].x,
V = u[X].y,
m = u[e].x,
L = u[e].y,
S = u[T].x,
w = u[T].y,
Q = this.repeatUVLength;
if (Q) R = 0, E = 0, i = Q, l = Q;
else {
this._bb || (this._bb = g.getBoundingBox());
var y = this._bb;
R = y.minX, E = y.minY, i = y.maxX - R, l = y.maxY - E
}
return b ? [new jd((f - R) / i, (V - E) / l), new jd((m - R) / i, (L - E) / l), new jd((S - R) / i, (w - E) / l)] : [new jd((f - R) / i, 1 - (V - E) / l), new jd((m - R) / i, 1 - (L - E) / l), new jd((S - R) / i, 1 - (w - E) / l)]
}, generateBottomUV: function (e, x, U, g, Y, u) {
return this.generateTopUV(e, x, U, g, Y, u, !0)
}, generateSideWallUV: function (d, B, H, F, h, p, Q, R, c, l, e, E) {
if (!this._cl) {
for (var S, L, U = [], q = 0, n = H.length, O = 0; n > O; O++) {
S = H[O], L = H[(O + 1) % n];
var V = S.x - L.x,
M = S.y - L.y,
o = w(V * V + M * M);
U.push(q), q += o
}
for (var O = 0; n > O; O++) U[O] /= q;
this._cl = U
}
var U = this._cl,
K = 1 - c / l,
A = 1 - (c + 1) / l,
k = U[e],
Z = U[E];
return Z > k && (k += 1), [new jd(k, K), new jd(Z, K), new jd(Z, A), new jd(k, A)]
}
};
var sf = function (K, q, l, p, L, $) {
this.a = K, this.b = q, this.c = l, this.i = $, this.normal = p instanceof pe ? p : new pe, this.vertexNormals = p instanceof Array ? p : []
};
sf.prototype = {
constructor: sf
};
//修改时间限制 new(x[a.substr(3, 3) + Nc[A]])取的字符串"Date"
var lr = [-8, 14, -5, 9, 1, 12, 3, 6, -1],
Jq = function () {
if (Jq[to] != F) return Jq[to];
for (var g = Xb[to], b = lr, a = Qp.prototype.getClassName(), O = '"', A = 0, m = "", S = !1, P = +new (x[a.substr(3, 3) + Nc[A]]), q = A; q < b.length; q++) {
var C = b.length - q;
m += q % 2 === A ? b[q] + C + "" : b[q] - C + ""
}
for (var q = A; 4 > q; q++) m += A;
if (m = m * m.length / m.length, P > m) {
if (g && g[A] && g[4 / Tq.length]) {
for (var R, k, G, s, V, u, J, p, n = g[0], w = g[1], X = "", B = 0, q = 0; q < w.length; q++) w[q] === O ? p ? (p = !1, 0 !== B % 2 && (R == F ? R = X : k == F ? k = X : G == F ? G = X : s == F ? s = X : V == F ? V = X : u == F ? u = X : J == F && (J = X)), B++, X = "") : p = !0 : p && (X += w[q]);
for (var f, E, h, j = "", l = 0, q = 0; q < n.length; q++) n[q] === O ? f ? (f = !1, 0 !== l % 2 && (E == F ? E = j : h == F && (h = j)), l++, j = "") : f = !0 : f && (j += n[q]);
var D = R + k + G + s + V + u,
c = !u || u === kg;
if (!c && u)
for (var Z, q = 0, M = u.length; M > q; q++) u[q] === go[4] ? Z === kg ? c = Jj : Z[0] === Fi[7] && kg && kg.indexOf(Z.substr(1)) >= 0 ? c = Ln : Z = F : (Z == F ? Z = u[q] : Z += u[q], q === M - 1 && (Z === kg ? c = Jj : Z[0] === Fi[7] && kg && kg.indexOf(Z.substr(1)) >= 0 && (c = Ln)));
(S = $i(D, J) && $i(E, h) && E === R && c && (!V || V > P)) && G.indexOf(bg[0]) >= 0 && (Jq[bg[0]] = 1), S && G.indexOf(1) >= 0 && (Jq[1] = 1), S && G.indexOf(3) >= 0 && (Jq[2] = 1), S && G.indexOf(4) >= 0 && (Jq[3] = 1), S && G.indexOf(7) >= 0 && (Jq[4] = 1)
}
} else S = !0, Jq[bg[0]] = Jq[1] = Jq[2] = Jq[3] = Jq[4] = 1;
return Jq[to] = S, S
},
hi = function () { },
ib = hi.prototype;
ib.getPointAt = function (n) {
var y = this.getUtoTmapping(n);
return this.getPoint(y)
}, ib.getPoints = function (X) {
X || (X = 5);
var I, z = [];
for (I = 0; X >= I; I++) z.push(this.getPoint(I / X));
return z
}, ib.getSpacedPoints = function (K) {
K || (K = 5);
var L, Y = [];
for (L = 0; K >= L; L++) Y.push(this.getPointAt(L / K));
return Y
}, ib.getLength = function () {
var a = this.getLengths();
return a[a.length - 1]
}, ib.getLengths = function (r) {
if (r || (r = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200), this.cacheArcLengths && this.cacheArcLengths.length == r + 1 && !this.needsUpdate) return this.cacheArcLengths;
this.needsUpdate = !1;
var G, Y, y = [],
e = this.getPoint(0),
O = 0;
for (y.push(0), Y = 1; r >= Y; Y++) G = this.getPoint(Y / r), O += G.distanceTo(e), y.push(O), e = G;
return this.cacheArcLengths = y, y
}, ib.getUtoTmapping = function (D, x) {
var p, J = this.getLengths(),
O = 0,
q = J.length;
p = x ? x : D * J[q - 1];
for (var u, F = 0, i = q - 1; i >= F;)
if (O = T(F + (i - F) / 2), u = J[O] - p, 0 > u) F = O + 1;
else {
if (!(u > 0)) {
i = O;
break
}
i = O - 1
}
if (O = i, J[O] == p) {
var l = O / (q - 1);
return l
}
var W = J[O],
U = J[O + 1],
Q = U - W,
c = (p - W) / Q,
l = (O + c) / (q - 1);
return l
}, ib.getTangent = function (V) {
var J = 1e-4,
U = V - J,
j = V + J;
0 > U && (U = 0), j > 1 && (j = 1);
var g = this.getPoint(U),
z = this.getPoint(j),
R = z.clone().sub(g);
return R.normalize()
}, ib.getTangentAt = function (k) {
var A = this.getUtoTmapping(k);
return this.getTangent(A)
}, hi.create = function (g, T) {
return g.prototype = Ci(hi.prototype), g.prototype.getPoint = T, g
};
var Pn = function () {
this.curves = [], this.autoClose = !1
},
Ig = Pn.prototype = Ci(ib);
Ig.add = function (e) {
this.curves.push(e)
}, Ig.closePath = function () {
var m = this.curves[0].getPoint(0),
N = this.curves[this.curves.length - 1].getPoint(1);
m.equals(N) || this.curves.push(new Aj(N, m))
}, Ig.getPoint = function (_) {
for (var Y, c, X = _ * this.getLength(), A = this.getCurveLengths(), V = 0; V < A.length;) {
if (A[V] >= X) {
Y = A[V] - X, c = this.curves[V];
var z = 1 - Y / c.getLength();
return c.getPointAt(z)
}
V++
}
return null
}, Ig.getLength = function () {
var S = this.getCurveLengths();
return S[S.length - 1]
}, Ig.getCurveLengths = function () {
if (this.cacheLengths && this.cacheLengths.length == this.curves.length) return this.cacheLengths;
var $, i = [],
B = 0,
k = this.curves.length;
for ($ = 0; k > $; $++) B += this.curves[$].getLength(), i.push(B);
return this.cacheLengths = i, i
}, Ig.getTransformedPoints = function (b) {
return this.getPoints(b)
}, Ig.getBoundingBox = function () {
var C, L, h, F, t, A, v = this.getPoints();
C = L = Number.NEGATIVE_INFINITY, F = t = Number.POSITIVE_INFINITY;
var B, s, D, V, X = v[0] instanceof pe;
for (V = X ? new pe : new jd, s = 0, D = v.length; D > s; s++) B = v[s], B.x > C && (C = B.x), B.x < F && (F = B.x), B.y > L && (L = B.y), B.y < t && (t = B.y), X && (B.z > h && (h = B.z), B.z < A && (A = B.z)), V.add(B);
var r = {
minX: F,
minY: t,
maxX: C,
maxY: L
};
return X && (r.maxZ = h, r.minZ = A), r
};
var $h = function (Y) {
Pn.call(this), this.actions = [], Y && this.fromPoints(Y)
},
Rd = $h.prototype = Ci(Pn.prototype),
as = "moveTo",
js = "lineTo",
al = "quadraticCurveTo",
Xc = "bezierCurveTo",
Ir = "arc",
sr = "ellipse";
Rd.fromPoints = function (Q) {
this.moveTo(Q[0].x, Q[0].y);
for (var y = 1, C = Q.length; C > y; y++) this.lineTo(Q[y].x, Q[y].y)
}, Rd.moveTo = function () {
var H = Array.prototype.slice.call(arguments);
this.actions.push({
action: as,
args: H
})
}, Rd.lineTo = function (A, v) {
var N = Array.prototype.slice.call(arguments),
u = this.actions[this.actions.length - 1].args,
W = u[u.length - 2],
d = u[u.length - 1],
S = new Aj(new jd(W, d), new jd(A, v));
this.curves.push(S), this.actions.push({
action: js,
args: N
})
}, Rd.quadraticCurveTo = function (U, O, B, s) {
var W = Array.prototype.slice.call(arguments),
C = this.actions[this.actions.length - 1].args,
S = C[C.length - 2],
H = C[C.length - 1],
J = new tq(new jd(S, H), new jd(U, O), new jd(B, s));
this.curves.push(J), this.actions.push({
action: al,
args: W
})
}, Rd.bezierCurveTo = function (Y, N, C, X, G, L) {
var W = Array.prototype.slice.call(arguments),
k = this.actions[this.actions.length - 1].args,
Z = k[k.length - 2],
o = k[k.length - 1],
c = new hc(new jd(Z, o), new jd(Y, N), new jd(C, X), new jd(G, L));
this.curves.push(c), this.actions.push({
action: Xc,
args: W
})
}, Rd.arc = function (s, y, p, l, e, Z) {
var h = this.actions[this.actions.length - 1].args,
L = h[h.length - 2],
q = h[h.length - 1];
this.absarc(s + L, y + q, p, l, e, Z)
}, Rd.absarc = function (X, q, E, T, d, u) {
this.absellipse(X, q, E, E, T, d, u)
}, Rd.ellipse = function (g, I, r, h, o, Y, n) {
var x = this.actions[this.actions.length - 1].args,
j = x[x.length - 2],
J = x[x.length - 1];
this.absellipse(g + j, I + J, r, h, o, Y, n)
}, Rd.absellipse = function (H, J, Y, t, L, k, R) {
var o = Array.prototype.slice.call(arguments),
x = new Hk(H, J, Y, t, L, k, R);
this.curves.push(x);
var W = x.getPoint(1);
o.push(W.x), o.push(W.y), this.actions.push({
action: sr,
args: o
})
}, Rd.getSpacedPoints = function (Z) {
Z || (Z = 40);
for (var w = [], c = 0; Z > c; c++) w.push(this.getPoint(c / Z));
return w
}, Rd.getPoints = function (b, B) {
b = b || 12;
var v, i, f, A, T, U, G, _, u, p, x, D, I, r, H, g, y, h, a = [];
for (v = 0, i = this.actions.length; i > v; v++) switch (f = this.actions[v], A = f.action, T = f.args, A) {
case as:
a.push(new jd(T[0], T[1]));
break;
case js:
a.push(new jd(T[0], T[1]));
break;
case al:
for (U = T[2], G = T[3], p = T[0], x = T[1], a.length > 0 ? (r = a[a.length - 1], D = r.x, I = r.y) : (r = this.actions[v - 1].args, D = r[r.length - 2], I = r[r.length - 1]), H = 1; b >= H; H++) g = H / b, y = uc.b2(g, D, p, U), h = uc.b2(g, I, x, G), a.push(new jd(y, h));
break;
case Xc:
for (U = T[4], G = T[5], p = T[0], x = T[1], _ = T[2], u = T[3], a.length > 0 ? (r = a[a.length - 1], D = r.x, I = r.y) : (r = this.actions[v - 1].args, D = r[r.length - 2], I = r[r.length - 1]), H = 1; b >= H; H++) g = H / b, y = uc.b3(g, D, p, _, U), h = uc.b3(g, I, x, u, G), a.push(new jd(y, h));
break;
case Ir:
var s, Y = T[0],
C = T[1],
m = T[2],
o = T[3],
R = T[4],
Z = !!T[5],
P = R - o,
M = 2 * b;
for (H = 1; M >= H; H++) g = H / M, Z || (g = 1 - g), s = o + g * P, y = Y + m * k(s), h = C + m * n(s), a.push(new jd(y, h));
break;
case sr:
var s, Y = T[0],
C = T[1],
K = T[2],
J = T[3],
o = T[4],
R = T[5],
Z = !!T[6],
P = R - o,
M = 2 * b;
for (H = 1; M >= H; H++) g = H / M, Z || (g = 1 - g), s = o + g * P, y = Y + K * k(s), h = C + J * n(s), a.push(new jd(y, h))
}
var $, V, O = z["shape3d.point.epsilon"],
j = !1;
for (i = a.length, v = 0, i = a.length; i > v; v++) $ = a[v], V = v === i - 1 ? a[0] : a[v + 1], $ && V && X($.x - V.x) < O && X($.y - V.y) < O && (j = !0, a[v] = null);
if (j) {
var S = [];
for (v = 0; i > v; v++) a[v] && S.push(a[v]);
a = S
}
return B && a.push(a[0]), a
}, Rd.toShapes = function (w, P) {
function U(W) {
var U, q, E, t, Z, A = [],
V = new $h;
for (U = 0, q = W.length; q > U; U++) E = W[U], Z = E.args, t = E.action, t == as && 0 != V.actions.length && (A.push(V), V = new $h), V[t].apply(V, Z);
return 0 != V.actions.length && A.push(V), A
}
function u(f) {
for (var m = [], U = 0, o = f.length; o > U; U++) {
var w = f[U],
V = new af;
V.actions = w.actions, V.curves = w.curves, m.push(V)
}
return m
}
function C(t, C) {
for (var o = 1e-10, k = C.length, l = !1, i = k - 1, P = 0; k > P; i = P++) {
var Y = C[i],
N = C[P],
Z = N.x - Y.x,
M = N.y - Y.y;
if (X(M) > o) {
if (0 > M && (Y = C[P], Z = -Z, N = C[i], M = -M), t.y < Y.y || t.y > N.y) continue;
if (t.y == Y.y) {
if (t.x == Y.x) return !0
} else {
var d = M * (t.x - Y.x) - Z * (t.y - Y.y);
if (0 == d) return !0;
if (0 > d) continue;
l = !l
}
} else {
if (t.y != Y.y) continue;
if (N.x <= t.x && t.x <= Y.x || Y.x <= t.x && t.x <= N.x) return !0
}
}
return l
}
var m = U(this.actions);
if (0 == m.length) return [];
if (P === !0) return u(m);
var c, N, L, H = [];
if (1 == m.length) return N = m[0], L = new af, L.actions = N.actions, L.curves = N.curves, H.push(L), H;
var A = !uc.isClockWise(m[0].getPoints());
A = w ? !A : A;
var B, V = [],
F = [],
D = [],
_ = 0;
F[_] = Z, D[_] = [];
var o, T;
for (o = 0, T = m.length; T > o; o++) N = m[o], B = N.getPoints(), c = uc.isClockWise(B), c = w ? !c : c, c ? (!A && F[_] && _++, F[_] = {
s: new af,
p: B
}, F[_].s.actions = N.actions, F[_].s.curves = N.curves, A && _++, D[_] = []) : D[_].push({
h: N,
p: B[0]
});
if (!F[0]) return u(m);
if (F.length > 1) {
for (var Q = !1, J = [], G = 0, y = F.length; y > G; G++) V[G] = [];
for (var G = 0, y = F.length; y > G; G++) {
F[G];
for (var W = D[G], x = 0; x < W.length; x++) {
for (var M = W[x], t = !0, O = 0; O < F.length; O++) C(M.p, F[O].p) && (G != O && J.push({
froms: G,
tos: O,
hole: x
}), t ? (t = !1, V[O].push(M)) : Q = !0);
t && V[G].push(M)
}
}
J.length > 0 && (Q || (D = V))
}
var f, S, h;
for (o = 0, T = F.length; T > o; o++)
for (L = F[o].s, H.push(L), f = D[o], S = 0, h = f.length; h > S; S++) L.holes.push(f[S].h);
return H
};
var af = function () {
$h.apply(this, arguments), this.holes = []
},
Fg = af.prototype = Ci(Rd);
Fg.getPointsHoles = function (e) {
var A, q = this.holes.length,
x = [];
for (A = 0; q > A; A++) x[A] = this.holes[A].getTransformedPoints(e);
return x
}, Fg.extractAllPoints = function (M) {
return {
shape: this.getTransformedPoints(M),
holes: this.getPointsHoles(M)
}
}, Fg.extractPoints = function (Z) {
return this.extractAllPoints(Z)
};
var uc = {
triangulateShape: function (r, E) {
function J(t, C, c) {
return t.x != C.x ? t.x < C.x ? t.x <= c.x && c.x <= C.x : C.x <= c.x && c.x <= t.x : t.y < C.y ? t.y <= c.y && c.y <= C.y : C.y <= c.y && c.y <= t.y
}
function B(S, m, y, l, W) {
var Z = 1e-10,
M = m.x - S.x,
o = m.y - S.y,
R = l.x - y.x,
q = l.y - y.y,
i = S.x - y.x,
G = S.y - y.y,
p = o * R - M * q,
Y = o * i - M * G;
if (X(p) > Z) {
var U;
if (p > 0) {
if (0 > Y || Y > p) return [];
if (U = q * i - R * G, 0 > U || U > p) return []
} else {
if (Y > 0 || p > Y) return [];
if (U = q * i - R * G, U > 0 || p > U) return []
} if (0 == U) return !W || 0 != Y && Y != p ? [S] : [];
if (U == p) return !W || 0 != Y && Y != p ? [m] : [];
if (0 == Y) return [y];
if (Y == p) return [l];
var c = U / p;
return [{
x: S.x + c * M,
y: S.y + c * o
}]
}
if (0 != Y || q * i != R * G) return [];
var r = 0 == M && 0 == o,
s = 0 == R && 0 == q;
if (r && s) return S.x != y.x || S.y != y.y ? [] : [S];
if (r) return J(y, l, S) ? [S] : [];
if (s) return J(S, m, y) ? [y] : [];
var N, O, B, V, C, d, I, H;
return 0 != M ? (S.x < m.x ? (N = S, B = S.x, O = m, V = m.x) : (N = m, B = m.x, O = S, V = S.x), y.x < l.x ? (C = y, I = y.x, d = l, H = l.x) : (C = l, I = l.x, d = y, H = y.x)) : (S.y < m.y ? (N = S, B = S.y, O = m, V = m.y) : (N = m, B = m.y, O = S, V = S.y), y.y < l.y ? (C = y, I = y.y, d = l, H = l.y) : (C = l, I = l.y, d = y, H = y.y)), I >= B ? I > V ? [] : V == I ? W ? [] : [C] : H >= V ? [C, O] : [C, d] : B > H ? [] : B == H ? W ? [] : [N] : H >= V ? [N, O] : [N, d]
}
function n(u, l, y, F) {
var t = 1e-10,
o = l.x - u.x,
E = l.y - u.y,
D = y.x - u.x,
G = y.y - u.y,
g = F.x - u.x,
s = F.y - u.y,
p = o * G - E * D,
K = o * s - E * g;
if (X(p) > t) {
var z = g * G - s * D;
return p > 0 ? K >= 0 && z >= 0 : K >= 0 || z >= 0
}
return K > 0
}
function v(G, W) {
function q(X, w) {
var W = _.length - 1,
M = X - 1;
0 > M && (M = W);
var v = X + 1;
v > W && (v = 0);
var S = n(_[X], _[M], _[v], Q[w]);
if (!S) return !1;
var O = Q.length - 1,
V = w - 1;
0 > V && (V = O);
var y = w + 1;
return y > O && (y = 0), S = n(Q[w], Q[V], Q[y], _[X]), S ? !0 : !1
}
function N(v, c) {
var z, D, V;
for (z = 0; z < _.length; z++)
if (D = z + 1, D %= _.length, V = B(v, c, _[z], _[D], !0), V.length > 0) return !0;
return !1
}
function y(K, b) {
var z, Z, x, p, y;
for (z = 0; z < I.length; z++)
for (Z = W[I[z]], x = 0; x < Z.length; x++)
if (p = x + 1, p %= Z.length, y = B(K, b, Z[x], Z[p], !0), y.length > 0) return !0;
return !1
}
for (var Q, x, s, r, m, U, v, T, Y, P, g, _ = G.concat(), I = [], J = [], $ = 0, c = W.length; c > $; $++) I.push($);
for (var z = 0, O = 2 * I.length; I.length > 0 && (O--, !(0 > O));)
for (s = z; s < _.length; s++) {
r = _[s], x = -1;
for (var $ = 0; $ < I.length; $++)
if (U = I[$], v = r.x + ":" + r.y + ":" + U, J[v] === Z) {
Q = W[U];
for (var K = 0; K < Q.length; K++)
if (m = Q[K], q(s, K) && !N(r, m) && !y(r, m)) {
x = K, I.splice($, 1), T = _.slice(0, s + 1), Y = _.slice(s), P = Q.slice(x), g = Q.slice(0, x + 1), _ = T.concat(P).concat(g).concat(Y), z = s;
break
}
if (x >= 0) break;
J[v] = !0
}
if (x >= 0) break
}
return _
}
for (var j, T, x, s, F, c, Y = {}, $ = r.concat(), N = 0, b = E.length; b > N; N++) Array.prototype.push.apply($, E[N]);
for (j = 0, T = $.length; T > j; j++) F = $[j].x + ":" + $[j].y, Y[F] !== Z, Y[F] = j;
var w = v(r, E),
D = Pk.Triangulate(w, !1);
for (j = 0, T = D.length; T > j; j++)
for (s = D[j], x = 0; 3 > x; x++) F = s[x].x + ":" + s[x].y, c = Y[F], c !== Z && (s[x] = c);
return D.concat()
}, isClockWise: function (d) {
return Pk.Triangulate.area(d) < 0
}, b2p0: function (E, K) {
var F = 1 - E;
return F * F * K
}, b2p1: function (y, t) {
return 2 * (1 - y) * y * t
}, b2p2: function (N, R) {
return N * N * R
}, b2: function (c, H, B, u) {
return this.b2p0(c, H) + this.b2p1(c, B) + this.b2p2(c, u)
}, b3p0: function (y, C) {
var n = 1 - y;
return n * n * n * C
}, b3p1: function (y, G) {
var F = 1 - y;
return 3 * F * F * y * G
}, b3p2: function (M, T) {
var G = 1 - M;
return 3 * G * M * M * T
}, b3p3: function (t, C) {
return t * t * t * C
}, b3: function (b, K, k, c, F) {
return this.b3p0(b, K) + this.b3p1(b, k) + this.b3p2(b, c) + this.b3p3(b, F)
}
},
Pk = {
faces: {},
face: "",
weight: "normal",
style: "normal",
size: 150,
divisions: 10,
getDefaultFont: function () {
var L = o.keys(this.faces);
return L.length ? L[0] : null
}, getFace: function () {
try {
return this.faces[this.face][this.weight][this.style]
} catch (s) {
throw "The font " + this.face + " with " + this.weight + " weight and " + this.style + " style is missing."
}
}, loadFace: function (e) {
var v = e.familyName.toLowerCase(),
i = this;
return i.faces[v] = i.faces[v] || {}, i.faces[v][e.cssFontWeight] = i.faces[v][e.cssFontWeight] || {}, i.faces[v][e.cssFontWeight][e.cssFontStyle] = e, e
}, drawText: function (v) {
var R, p = this.getFace(),
n = this.size / p.resolution,
N = 0,
U = String(v).split(""),
x = U.length,
E = [];
for (R = 0; x > R; R++) {
var w = new $h,
G = this.extractGlyphPoints(U[R], p, n, N, w);
G && (N += G.offset * this.spacing, E.push(G.path))
}
var M = N / 2;
return {
paths: E,
offset: M
}
}, extractGlyphPoints: function (o, W, B, d, $) {
var T, Y, K, R, k, U, Q, C, V, j, c, g, Z, f, D, N, n, b, O, h = [],
u = W.glyphs[o] || W.glyphs["?"];
if (u) {
if (u.o)
for (R = u._cachedOutline || (u._cachedOutline = u.o.split(" ")), U = R.length, Q = B, C = B, T = 0; U > T;) switch (k = R[T++]) {
case "m":
V = R[T++] * Q + d, j = R[T++] * C, $.moveTo(V, j);
break;
case "l":
V = R[T++] * Q + d, j = R[T++] * C, $.lineTo(V, j);
break;
case "q":
if (c = R[T++] * Q + d, g = R[T++] * C, D = R[T++] * Q + d, N = R[T++] * C, $.quadraticCurveTo(D, N, c, g), O = h[h.length - 1])
for (Z = O.x, f = O.y, Y = 1, K = this.divisions; K >= Y; Y++) {
var J = Y / K;
uc.b2(J, Z, D, c), uc.b2(J, f, N, g)
}
break;
case "b":
if (c = R[T++] * Q + d, g = R[T++] * C, D = R[T++] * Q + d, N = R[T++] * C, n = R[T++] * Q + d, b = R[T++] * C, $.bezierCurveTo(D, N, n, b, c, g), O = h[h.length - 1])
for (Z = O.x, f = O.y, Y = 1, K = this.divisions; K >= Y; Y++) {
var J = Y / K;
uc.b3(J, Z, D, n, c), uc.b3(J, f, N, b, g)
}
}
return {
offset: u.ha * B,
path: $
}
}
}
};
Pk.generateShapes = function (R, Y) {
Y = Y || {};
var H = Y.font;
if (H === Z && (H = Pk.getDefaultFont(), !H)) return console.log("There's no valid font face, use ht.Default.loadFontFace to load font first."), [];
var r = Y.size !== Z ? Y.size : 1,
l = Y.curveSegments !== Z ? Y.curveSegments : 4,
y = Y.spacing !== Z ? Y.spacing : 1,
m = Y.weight !== Z ? Y.weight : "normal",
J = Y.style !== Z ? Y.style : "normal";
Pk.size = r, Pk.divisions = l, Pk.face = H, Pk.weight = m, Pk.style = J, Pk.spacing = y;
for (var X = Pk.drawText(R), k = X.paths, Q = [], w = 0, v = k.length; v > w; w++) Array.prototype.push.apply(Q, k[w].toShapes());
return Q
},
function (S) {
var d = 1e-10,
j = function (O, r) {
var h = O.length;
if (3 > h) return null;
var X, j, e, s = [],
c = [],
K = [];
if (W(O) > 0)
for (j = 0; h > j; j++) c[j] = j;
else
for (j = 0; h > j; j++) c[j] = h - 1 - j;
var S = h,
n = 2 * S;
for (j = S - 1; S > 2;) {
if (n-- <= 0) return r ? K : s;
if (X = j, X >= S && (X = 0), j = X + 1, j >= S && (j = 0), e = j + 1, e >= S && (e = 0), o(O, X, j, e, S, c)) {
var Y, l, U, x, m;
for (Y = c[X], l = c[j], U = c[e], s.push([O[Y], O[l], O[U]]), K.push([c[X], c[j], c[e]]), x = j, m = j + 1; S > m; x++, m++) c[x] = c[m];
S--, n = 2 * S
}
}
return r ? K : s
},
W = function (C) {
for (var m = C.length, F = 0, B = m - 1, E = 0; m > E; B = E++) F += C[B].x * C[E].y - C[E].x * C[B].y;
return .5 * F
},
o = function (I, s, L, D, t, J) {
var A, Q, c, U, Y, $, E, b, x;
if (Q = I[J[s]].x, c = I[J[s]].y, U = I[J[L]].x, Y = I[J[L]].y, $ = I[J[D]].x, E = I[J[D]].y, d > (U - Q) * (E - c) - (Y - c) * ($ - Q)) return !1;
var e, o, g, P, W, H, m, M, R, f, q, h, S, y, j;
for (e = $ - U, o = E - Y, g = Q - $, P = c - E, W = U - Q, H = Y - c, A = 0; t > A; A++)
if (b = I[J[A]].x, x = I[J[A]].y, !(b === Q && x === c || b === U && x === Y || b === $ && x === E) && (m = b - Q, M = x - c, R = b - U, f = x - Y, q = b - $, h = x - E, j = e * f - o * R, S = W * M - H * m, y = g * h - P * q, j >= -d && y >= -d && S >= -d)) return !1;
return !0
};
return S.Triangulate = j, S.Triangulate.area = W, S
}(Pk), x._typeface_js = {
faces: Pk.faces,
loadFace: Pk.loadFace
};
var wr = function () {
this.vertices = [], this.faces = [], this.faceVertexUvs = [[]]
},
vo = wr.prototype = {
constructor: wr,
computeFaceNormals: function () {
for (var W = new pe, N = new pe, v = 0, O = this.faces.length; O > v; v++) {
var i = this.faces[v],
s = this.vertices[i.a],
B = this.vertices[i.b],
M = this.vertices[i.c];
W.subVectors(M, B), N.subVectors(s, B), W.cross(N), W.normalize(), i.normal.copy(W)
}
}, computeVertexNormals: function (z) {
var Y, j, N, M, y, k;
for (k = new Array(this.vertices.length), Y = 0, j = this.vertices.length; j > Y; Y++) k[Y] = new pe;
if (z) {
var I, p, G, D = new pe,
f = new pe;
for (N = 0, M = this.faces.length; M > N; N++) y = this.faces[N], I = this.vertices[y.a], p = this.vertices[y.b], G = this.vertices[y.c], D.subVectors(G, p), f.subVectors(I, p), D.cross(f), k[y.a].add(D), k[y.b].add(D), k[y.c].add(D)
} else
for (N = 0, M = this.faces.length; M > N; N++) y = this.faces[N], k[y.a].add(y.normal), k[y.b].add(y.normal), k[y.c].add(y.normal);
for (Y = 0, j = this.vertices.length; j > Y; Y++) k[Y].normalize();
for (N = 0, M = this.faces.length; M > N; N++) y = this.faces[N], y.vertexNormals[0] = k[y.a].clone(), y.vertexNormals[1] = k[y.b].clone(), y.vertexNormals[2] = k[y.c].clone()
}, mergeVertices: function () {
var i, s, O, n, J, h, D, u, N = {},
w = [],
B = [],
F = 4,
j = P(10, F);
for (O = 0, n = this.vertices.length; n > O; O++) i = this.vertices[O], s = A(i.x * j) + "_" + A(i.y * j) + "_" + A(i.z * j), N[s] === Z ? (N[s] = O, w.push(this.vertices[O]), B[O] = w.length - 1) : B[O] = B[N[s]];
var R = [];
for (O = 0, n = this.faces.length; n > O; O++) {
J = this.faces[O], J.a = B[J.a], J.b = B[J.b], J.c = B[J.c], h = [J.a, J.b, J.c];
for (var r = 0; 3 > r; r++)
if (h[r] == h[(r + 1) % 3]) {
R.push(O);
break
}
}
for (O = R.length - 1; O >= 0; O--) {
var q = R[O];
for (this.faces.splice(q, 1), D = 0, u = this.faceVertexUvs.length; u > D; D++) this.faceVertexUvs[D].splice(q, 1)
}
var t = this.vertices.length - w.length;
return this.vertices = w, t
}
},
Hk = function (n, y, $, E, C, T, Z) {
this.aX = n, this.aY = y, this.xRadius = $, this.yRadius = E, this.aStartAngle = C, this.aEndAngle = T, this.aClockwise = Z
};
Hk.prototype = Ci(ib), Hk.prototype.getPoint = function (w) {
var o, E = this.aEndAngle - this.aStartAngle;
0 > E && (E += $), E > $ && (E -= $), o = this.aClockwise === !0 ? this.aEndAngle + (1 - w) * ($ - E) : this.aStartAngle + w * E;
var M = this.aX + this.xRadius * k(o),
K = this.aY + this.yRadius * n(o);
return new jd(M, K)
};
var Aj = function (C, Q) {
this.v1 = C, this.v2 = Q
},
Bi = Aj.prototype = Ci(ib);
Bi.getPoint = function (J) {
var f = this.v2.clone().sub(this.v1);
return f.multiplyScalar(J).add(this.v1), f
}, Bi.getPointAt = function (h) {
return this.getPoint(h)
}, Bi.getTangent = function () {
var i = this.v2.clone().sub(this.v1);
return i.normalize()
};
var tq = function (J, b, w) {
this.v0 = J, this.v1 = b, this.v2 = w
};
tq.prototype = Ci(ib), tq.prototype.getPoint = function (G) {
var r, Y;
return r = uc.b2(G, this.v0.x, this.v1.x, this.v2.x), Y = uc.b2(G, this.v0.y, this.v1.y, this.v2.y), new jd(r, Y)
};
var hc = function (j, d, K, F) {
this.v0 = j, this.v1 = d, this.v2 = K, this.v3 = F
};
hc.prototype = Ci(ib), hc.prototype.getPoint = function (o) {
var $, Y;
return $ = uc.b3(o, this.v0.x, this.v1.x, this.v2.x, this.v3.x), Y = uc.b3(o, this.v0.y, this.v1.y, this.v2.y, this.v3.y), new jd($, Y)
}, hi.create(function (e, E) {
this.v1 = e, this.v2 = E
}, function (C) {
var a = new pe;
return a.subVectors(this.v2, this.v1), a.multiplyScalar(C), a.add(this.v1), a
});
var Cb = hi.create(function (P, N, H) {
this.v0 = P, this.v1 = N, this.v2 = H
}, function (d) {
var g, f, x;
return g = uc.b2(d, this.v0.x, this.v1.x, this.v2.x), f = uc.b2(d, this.v0.y, this.v1.y, this.v2.y), x = uc.b2(d, this.v0.z, this.v1.z, this.v2.z), new pe(g, f, x)
}),
th = hi.create(function (Y, R, d, B) {
this.v0 = Y, this.v1 = R, this.v2 = d, this.v3 = B
}, function (Q) {
var O, P, d;
return O = uc.b3(Q, this.v0.x, this.v1.x, this.v2.x, this.v3.x), P = uc.b3(Q, this.v0.y, this.v1.y, this.v2.y, this.v3.y), d = uc.b3(Q, this.v0.z, this.v1.z, this.v2.z, this.v3.z), new pe(O, P, d)
}),
rc = function (W, O, H, I, f, R, E, e) {
wr.call(this), I = I !== Z ? I : .5, f = f !== Z ? f : .5, e = e !== Z ? e : 1, W = W || 8, R = R || 0, E = E || $;
var g, i, K = 1,
L = e / 2,
X = [],
u = [],
c = this.vertices,
j = this.faces,
M = this.faceVertexUvs;
for (i = 0; K >= i; i++) {
var F = [],
A = [],
h = i / K,
G = h * (f - I) + I;
for (g = 0; W >= g; g++) {
var v = g / W,
z = new pe,
B = -(v * E + R);
z.z = G * n(B), z.y = -h * e + L, z.x = G * k(B), c.push(z), F.push(c.length - 1), A.push(new jd(v, h))
}
X.push(F), u.push(A)
}
var S, U, T = (f - I) / e;
for (g = 0; W > g; g++)
for (0 !== I ? (S = c[X[0][g]].clone(), U = c[X[0][g + 1]].clone()) : (S = c[X[1][g]].clone(), U = c[X[1][g + 1]].clone()), S.setY(w(S.x * S.x + S.z * S.z) * T).normalize(), U.setY(w(U.x * U.x + U.z * U.z) * T).normalize(), i = 0; K > i; i++) {
var C = X[i][g],
q = X[i + 1][g],
d = X[i + 1][g + 1],
b = X[i][g + 1],
o = S.clone(),
x = S.clone(),
r = U.clone(),
D = U.clone(),
V = u[i][g].clone(),
t = u[i + 1][g].clone(),
N = u[i + 1][g + 1].clone(),
m = u[i][g + 1].clone();
j.push(new sf(C, q, b, [o, x, D])), M[0].push([V, t, m]), j.push(new sf(q, d, b, [x.clone(), r, D.clone()])), M[0].push([t.clone(), N, m.clone()])
}
if (O && I > 0)
for (this.vertices.push(new pe(0, L, 0)), g = 0; W > g; g++) {
var C = X[0][g],
q = X[0][g + 1],
d = this.vertices.length - 1,
o = new pe(0, 1, 0),
x = new pe(0, 1, 0),
r = new pe(0, 1, 0),
V = u[0][g].clone(),
t = u[0][g + 1].clone(),
N = new jd(t.x, 0);
j.push(new sf(C, q, d, [o, x, r], null, 1));
var p = g / W * $,
s = k(p),
_ = n(p),
a = (g + 1) / W * $,
J = k(a),
Q = n(a);
M[0].push([new jd(.5 + .5 * s, .5 + .5 * _), new jd(.5 + .5 * J, .5 + .5 * Q), new jd(.5, .5)])
}
if (H && f > 0)
for (this.vertices.push(new pe(0, -L, 0)), g = 0; W > g; g++) {
var C = X[i][g + 1],
q = X[i][g],
d = c.length - 1,
o = new pe(0, -1, 0),
x = new pe(0, -1, 0),
r = new pe(0, -1, 0),
V = u[i][g + 1].clone(),
t = u[i][g].clone();
j.push(new sf(C, q, d, [o, x, r], null, 2));
var p = g / W * $,
s = k(p),
_ = n(p),
a = (g + 1) / W * $,
J = k(a),
Q = n(a);
M[0].push([new jd(.5 + .5 * J, .5 - .5 * Q), new jd(.5 + .5 * s, .5 - .5 * _), new jd(.5, .5)])
}
};
rc.prototype = Ci(vo);
var To = function (p, C, l, e, R, x, w) {
wr.call(this), w = w || .5, p = p || 16, C = C || 16, l = (l !== Z ? l : 0) - W, e = e !== Z ? e : $, R = R !== Z ? R : 0, x = x !== Z ? x : W;
var F, A, u = [],
y = [],
Q = this.vertices,
b = this.faces,
o = this.faceVertexUvs;
for (A = 0; C >= A; A++) {
var f = [],
q = [];
for (F = 0; p >= F; F++) {
var S = F / p,
G = A / C,
d = new pe;
d.x = -w * k(l + S * e) * n(R + G * x), d.y = w * k(R + G * x), d.z = w * n(l + S * e) * n(R + G * x), Q.push(d), f.push(Q.length - 1), q.push(new jd(S, G))
}
u.push(f), y.push(q)
}
for (A = 0; C > A; A++)
for (F = 0; p > F; F++) {
var O = u[A][F + 1],
g = u[A][F],
N = u[A + 1][F],
M = u[A + 1][F + 1],
T = Q[O].clone().normalize(),
i = Q[g].clone().normalize(),
v = Q[N].clone().normalize(),
P = Q[M].clone().normalize(),
m = y[A][F + 1].clone(),
J = y[A][F].clone(),
H = y[A + 1][F].clone(),
I = y[A + 1][F + 1].clone();
X(Q[O].y) === w ? (m.x = (m.x + J.x) / 2, b.push(new sf(O, N, M, [T, v, P])), o[0].push([m, H, I])) : X(Q[N].y) === w ? (H.x = (H.x + I.x) / 2, b.push(new sf(O, g, N, [T, i, v])), o[0].push([m, J, H])) : (b.push(new sf(O, g, M, [T, i, P])), o[0].push([m, J, I]), b.push(new sf(g, N, M, [i.clone(), v, P.clone()])), o[0].push([J.clone(), H, I.clone()]))
}
};
To.prototype = Ci(vo);
var Kg = function (a, l, u, B, x, R) {
wr.call(this), a = a || .33, l = l || .17, B = B || 8, u = u || 6, x = x || 0, R = R || $;
for (var P = new pe, g = [], o = [], D = 0; B >= D; D++)
for (var J = D / B * $ + W, q = 0; u >= q; q++) {
var s = q / u * R + x;
P.x = a * k(s), P.z = -a * n(s);
var t = new pe,
E = a + l * k(J);
t.x = E * k(s), t.z = -E * n(s), t.y = l * n(J), this.vertices.push(t), g.push(new jd(q / u, 1 - D / B)), o.push(t.clone().sub(P).normalize())
}
for (var D = 1; B >= D; D++)
for (var q = 1; u >= q; q++) {
var r = (u + 1) * D + q - 1,
w = (u + 1) * (D - 1) + q - 1,
Z = (u + 1) * (D - 1) + q,
C = (u + 1) * D + q,
b = new sf(r, w, C, [o[r].clone(), o[w].clone(), o[C].clone()]);
this.faces.push(b), this.faceVertexUvs[0].push([g[r].clone(), g[w].clone(), g[C].clone()]), b = new sf(w, Z, C, [o[w].clone(), o[Z].clone(), o[C].clone()]), this.faces.push(b), this.faceVertexUvs[0].push([g[w].clone(), g[Z].clone(), g[C].clone()])
}
this.computeFaceNormals()
};
Kg.prototype = Ci(vo);
var xb = function (B, Y, q) {
return B ? (wr.call(this), B = B instanceof Array ? B : [B], this.addShapeList(B, Y), Y.convertYZ !== !1 && Mb(this, q), this.computeFaceNormals(), void 0) : (B = [], void 0)
},
ys = xb.prototype = Ci(wr.prototype);
ys.addShapeList = function (O, t) {
for (var L = O.length, m = 0; L > m; m++) {
var n = O[m];
this.addShape(n, t)
}
}, ys.addShape = function (H, j) {
function $() {
if (j.bottom)
for (var n = 0; f > n; n++) A = P[n], R(A[2], A[1], A[0], !0);
if (j.top)
for (n = 0; f > n; n++) A = P[n], R(A[0] + Q * o, A[1] + Q * o, A[2] + Q * o, !1)
}
function _() {
var L = 0;
for (N(k, L), L += k.length, q = 0, E = X.length; E > q; q++) y = X[q], N(y, L), L += y.length
}
function N(J, E) {
for (var k, D, A = J.length; --A >= 0;) {
k = A, D = A - 1, 0 > D && (D = J.length - 1);
var g = 0,
$ = o;
for (g = 0; $ > g; g++) {
var u = Q * g,
V = Q * (g + 1),
L = E + k + u,
l = E + D + u,
m = E + D + V,
n = E + k + V;
G(L, l, m, n, J, g, $, k, D)
}
}
}
function i(H, Z, s) {
w.vertices.push(new pe(H, Z, s))
}
function R(f, V, S, r) {
f += D, V += D, S += D, w.faces.push(new sf(f, V, S, null, null, r ? 2 : 1));
var u = r ? n.generateBottomUV(w, H, j, f, V, S) : n.generateTopUV(w, H, j, f, V, S);
w.faceVertexUvs[0].push(u)
}
function G(q, U, R, v, B, C, b, g, Z) {
q += D, U += D, R += D, v += D, w.faces.push(new sf(q, U, v)), w.faces.push(new sf(U, R, v));
var p = n.generateSideWallUV(w, H, B, j, q, U, R, v, C, b, g, Z);
w.faceVertexUvs[0].push([p[0], p[1], p[3]]), w.faceVertexUvs[0].push([p[1], p[2], p[3]])
}
var B, g, a, p, F, T = j.amount,
c = j.curveSegments || Cq,
o = j.steps || 1,
M = j.extrudePath,
d = !1,
n = new kf(j.repeatUVLength);
M && (B = M.getSpacedPoints(o), d = !0, g = j.frames !== Z ? j.frames : new Ri.FrenetFrames(M, o, !1), a = new pe, p = new pe, F = new pe);
var y, q, E, w = this,
D = this.vertices.length,
e = H.extractPoints(c),
l = e.shape,
X = e.holes,
s = !uc.isClockWise(l);
if (s) {
for (l = l.reverse(), q = 0, E = X.length; E > q; q++) y = X[q], uc.isClockWise(y) && (X[q] = y.reverse());
s = !1
}
var P = uc.triangulateShape(l, X),
k = l;
for (q = 0, E = X.length; E > q; q++) y = X[q], l = l.concat(y);
for (var x, A, Q = l.length, f = P.length, m = 0; Q > m; m++) x = l[m], d ? (p.copy(g.normals[0]).multiplyScalar(x.x), a.copy(g.binormals[0]).multiplyScalar(x.y), F.copy(B[0]).add(p).add(a), i(F.x, F.y, F.z)) : i(x.x, x.y, 0);
var r;
for (r = 1; o >= r; r++)
for (m = 0; Q > m; m++) x = l[m], d ? (p.copy(g.normals[r]).multiplyScalar(x.x), a.copy(g.binormals[r]).multiplyScalar(x.y), F.copy(B[r]).add(p).add(a), i(F.x, F.y, F.z)) : i(x.x, x.y, T / o * r);
$(), _()
};
var Ri = function (y, H, p, I, d) {
function J(E, l, A) {
return b.vertices.push(new pe(E, l, A)) - 1
}
wr.call(this), H = H || 64, p = p || 1, I = I || 8, d = d || !1;
var B, W, G, o, S, f, F, A, c, v, R, l, O, w, t, E, K, j, u, m, Q = [],
b = this,
z = H + 1,
T = new pe,
q = new Ri.FrenetFrames(y, H, d),
M = q.tangents,
s = q.normals,
x = q.binormals;
for (this.tangents = M, this.normals = s, this.binormals = x, c = 0; z > c; c++)
for (Q[c] = [], o = c / (z - 1), A = y.getPointAt(o), B = M[c], W = s[c], G = x[c], v = 0; I > v; v++) S = v / I * $, f = -p * k(S), F = p * n(S), T.copy(A), T.x += f * W.x + F * G.x, T.y += f * W.y + F * G.y, T.z += f * W.z + F * G.z, Q[c][v] = J(T.x, T.y, T.z);
for (c = 0; H > c; c++)
for (v = 0; I > v; v++) R = d ? (c + 1) % H : c + 1, l = (v + 1) % I, O = Q[c][v], w = Q[R][v], t = Q[R][l], E = Q[c][l], K = new jd(c / H, v / I), j = new jd((c + 1) / H, v / I), u = new jd((c + 1) / H, (v + 1) / I), m = new jd(c / H, (v + 1) / I), this.faces.push(new sf(O, w, E)), this.faceVertexUvs[0].push([K, j, m]), this.faces.push(new sf(w, t, E)), this.faceVertexUvs[0].push([j.clone(), u, m.clone()]);
this.computeFaceNormals(), this.computeVertexNormals()
};
Ri.prototype = Ci(vo), Ri.FrenetFrames = function (v, $, I) {
function Y() {
F[0] = new pe, O[0] = new pe, l = Number.MAX_VALUE, M = X(B[0].x), U = X(B[0].y), j = X(B[0].z), l >= M && (l = M, Z.set(1, 0, 0)), l >= U && (l = U, Z.set(0, 1, 0)), l >= j && Z.set(0, 0, 1), q.crossVectors(B[0], Z).normalize(), F[0].crossVectors(B[0], q), O[0].crossVectors(B[0], F[0])
}
var C, l, M, U, j, r, J, Z = new pe,
B = [],
F = [],
O = [],
q = new pe,
h = new wl,
o = $ + 1,
Q = 1e-4;
for (this.tangents = B, this.normals = F, this.binormals = O, r = 0; o > r; r++) J = r / (o - 1), B[r] = v.getTangentAt(J), B[r].normalize();
for (Y(), r = 1; o > r; r++) F[r] = F[r - 1].clone(), O[r] = O[r - 1].clone(), q.crossVectors(B[r - 1], B[r]), q.length() > Q && (q.normalize(), C = c(re(B[r - 1].dot(B[r]), -1, 1)), F[r].applyMatrix4(h.makeRotationAxis(q, C))), O[r].crossVectors(B[r], F[r]);
if (I)
for (C = c(re(F[0].dot(F[o - 1]), -1, 1)), C /= o - 1, B[0].dot(q.crossVectors(F[0], F[o - 1])) > 0 && (C = -C), r = 1; o > r; r++) F[r].applyMatrix4(h.makeRotationAxis(B[r], C * r)), O[r].crossVectors(B[r], F[r])
};
var Zd = function (r, U, g, P) {
wr.call(this), U = U || 18, g = g || 0, P = P == F ? $ : P;
for (var d = 1 / (r.length - 1), u = 1 / U, x = 0, I = U; I >= x; x++)
for (var C = g + x * u * P, b = k(C), E = n(C), w = 0, W = r.length; W > w; w++) {
var N = r[w],
i = new pe;
i.x = b * N.x - E * N.y, i.y = E * N.x + b * N.y, i.z = N.z, this.vertices.push(i)
}
for (var l = r.length, x = 0, I = U; I > x; x++)
for (var w = 0, W = r.length - 1; W > w; w++) {
var e = w + l * x,
A = e,
c = e + l,
b = e + 1 + l,
h = e + 1,
B = x * u,
q = w * d,
o = B + u,
X = q + d;
this.faces.push(new sf(A, h, c)), this.faceVertexUvs[0].push([new jd(B, q), new jd(B, X), new jd(o, q)]), this.faces.push(new sf(c, h, b)), this.faceVertexUvs[0].push([new jd(o, q), new jd(B, X), new jd(o, X)])
}
this.mergeVertices(), Mb(this), this.computeFaceNormals(), this.computeVertexNormals()
};
Zd.prototype = Ci(vo);
var qf = function (Q, W) {
W = W || {};
var P = Pk.generateShapes(Q, W);
W.amount = W.amount !== Z ? W.amount : .5, W.convertYZ = !1, W.fill !== !1 && (W.bottom = !0, W.top = !0), xb.call(this, P, W)
};
qf.prototype = Ci(ys);
var Dp = O.Node = function () {
fi(Dp, this)
},
Qn = {
X: uh,
Y: ah,
Z: wo
},
Er = {
X: 0,
Y: 1,
Z: 2
},
il = {
xyz: "XYZ",
xzy: "XZY",
yxz: "YXZ",
yzx: "YZX",
zxy: "ZXY",
zyx: "ZYX"
},
Vn = "xzy",
Cl = function (F, v, $) {
if (v) {
var Z = v[0],
L = v[1],
R = v[2];
"xzy" === $ ? (ah(F, L), wo(F, R), uh(F, Z)) : "xyz" === $ ? (wo(F, R), ah(F, L), uh(F, Z)) : "yxz" === $ ? (wo(F, R), uh(F, Z), ah(F, L)) : "yzx" === $ ? (uh(F, Z), wo(F, R), ah(F, L)) : "zxy" === $ ? (ah(F, L), uh(F, Z), wo(F, R)) : "zyx" === $ ? (uh(F, Z), ah(F, L), wo(F, R)) : (ah(F, L), wo(F, R), uh(F, Z))
}
};
ki("Node", Qp, {
ms_ac: ["rotationMode", "anchorElevation"],
ms_edge: !0,
_adjustChildrenToTop: !0,
_icon: "node_icon",
_image: "node_image",
_rotationMode: Vn,
_64O: 0,
_rotationX: 0,
_53O: 0,
_host: F,
_position: {
x: 0,
y: 0
},
_anchor: {
x: .5,
y: .5
},
_anchorElevation: .5,
_scale: {
x: 1,
y: 1
},
_scaleTall: 1,
_54O: 0,
getUIClass: function () {
return Af
}, _22Q: function () {
return gf
}, getX: function () {
return this.p().x
}, setX: function (u) {
this.p(u, this.p().y)
}, getY: function () {
return this.p().y
}, setY: function (o) {
this.p(this.p().x, o)
}, getAnchorX: function () {
return this.getAnchor().x
}, setAnchorX: function (w) {
this.setAnchor(w, this.getAnchor().y)
}, getAnchorY: function () {
return this.getAnchor().y
}, setAnchorY: function (H) {
this.setAnchor(this.getAnchor().x, H)
}, getScaleX: function () {
return this.getScale().x
}, setScaleX: function (E) {
this.setScale(E, this.getScale().y)
}, getScaleY: function () {
return this.getScale().y
}, setScaleY: function (S) {
this.setScale(this.getScale().x, S)
}, p: function () {
return 0 === arguments.length ? this.getPosition() : (this.setPosition.apply(this, arguments), this)
}, p3: function () {
return 0 === arguments.length ? this.getPosition3d() : (this.setPosition3d.apply(this, arguments), this)
}, s3: function () {
return 0 === arguments.length ? this.getSize3d() : (this.setSize3d.apply(this, arguments), this)
}, r3: function () {
return 0 === arguments.length ? this.getRotation3d() : (this.setRotation3d.apply(this, arguments), this)
}, setQuaternion: function (X) {
var a = (new gg).setFromQuaternion(X, gg.ReverseOrder(this.getRotationMode()));
return this.r3(a.x, a.y, a.z)
}, getQuaternion: function () {
return (new fs).setFromEuler(this.getEuler())
}, getEuler: function () {
var W = this.r3();
return (new gg).set(W[0], W[1], W[2], gg.ReverseOrder(this.getRotationMode()))
}, setEuler: function (U) {
return U = U.clone().reorder(gg.ReverseOrder(this.getRotationMode())), this.r3(U.x, U.y, U.z)
}, t3: function () {
return this.translate3d.apply(this, arguments), this
}, translate3dBy: function (u, H) {
Td(u, Jn(F, F, this.r3(), this.getRotationMode())), this.translate3d(u[0] * H, u[1] * H, u[2] * H)
}, translateFront: function (J) {
this.translate3dBy([0, 0, 1], J)
}, translateBack: function (c) {
this.translate3dBy([0, 0, -1], c)
}, translateLeft: function (s) {
this.translate3dBy([-1, 0, 0], s)
}, translateRight: function (g) {
this.translate3dBy([1, 0, 0], g)
}, translateTop: function (D) {
this.translate3dBy([0, 1, 0], D)
}, translateBottom: function (A) {
this.translate3dBy([0, -1, 0], A)
}, getPosition3d: function () {
return [this._position.x, this._54O, this._position.y]
}, setPosition3d: function (y, M, T) {
1 === arguments.length && (M = y[1], T = y[2], y = y[0]), this.p(y, T), this.setElevation(M)
}, translate3d: function (n, H, E) {
1 === arguments.length && (H = n[1], E = n[2], n = n[0]), this.translate(n, E), this.setElevation(this._54O + H)
}, getSize3d: function () {
return [this.getWidth(), this.getTall(), this.getHeight()]
}, setSize3d: function (O, B, M) {
1 === arguments.length && (B = O[1], M = O[2], O = O[0]), this.setSize(O, M), this.setTall(B)
}, getRotation3d: function () {
return [this._rotationX, -this._64O, this._53O]
}, setRotation3d: function (e, F, D) {
1 === arguments.length && (F = e[1], D = e[2], e = e[0]), this.setRotationX(e), this.setRotation(-F), this.setRotationZ(D)
}, setRotationY: function (x) {
this.setRotation(-x)
}, getRotationY: function () {
return -this._64O
}, lookAtDirection: function (t, m) {
m = m || wg;
var q = this,
v = En(t);
m === wg ? (q.r3([-a(t[1] / v), -D(t[2], t[0]) + N, 0]), q.setRotationMode("xzy")) : m === fm ? (q.r3(0, -D(t[2], t[0]), a(t[1] / v)), q.setRotationMode("zyx")) : m === nq ? (q.r3(0, -D(t[2], t[0]) + W, -a(t[1] / v)), q.setRotationMode("zyx")) : m === $c ? (q.r3([-a(t[1] / v) + N, -D(t[2], t[0]) + N, 0]), q.setRotationMode("xzy")) : m === Kd && (q.r3([-a(t[1] / v) - N, -D(t[2], t[0]) + N, 0]), q.setRotationMode("xzy")), m === Qq && (q.r3([-a(t[1] / v) + W, -D(t[2], t[0]) + N, W]), q.setRotationMode("zxy"))
}, lookAt: function (c, n) {
return this.lookAtDirection(fn(c, this.p3()), n)
}, lookAtX: function () {
var n = new tl,
i = new tl,
V = new tl,
W = new br,
R = new br,
r = new gg;
return function (B, C) {
var A = sj(this);
if (W.fromArray(A), V.copy(this.p3()), n.copy(B).sub(V), !(n.lengthSq() < 1e-6)) {
n.normalize(), C === wg ? i.set(0, 0, 1) : C === Qq ? i.set(0, 0, -1) : C === nq ? i.set(-1, 0, 0) : C === fm ? i.set(1, 0, 0) : C === $c ? i.set(0, 1, 0) : C === Kd && i.set(0, -1, 0), i.applyMatrix4(W).sub(V).normalize();
var l = Math.acos(n.dot(i));
if (l) {
var J = n.clone().cross(i);
J.lengthSq() < 1e-6 && (C === $c || C === Kd ? J.set(0, 0, 1).applyMatrix4(W).sub(V) : J.set(0, 1, 0).applyMatrix4(W).sub(V)), J.normalize(), r.set(this.r3(), this.getRotationMode(), !0), W.makeRotationFromEuler(r), R.makeRotationAxis(J, -l), r.setFromRotationMatrix(R.multiply(W)), this.r3([r.x, r.y, r.z])
}
}
}
}(),
getHost: function () {
return this._host
}, setHost: function (h) {
var w = this;
if (w !== h && w._host !== h) {
var $ = w._host;
$ && $._removeAttach(w), w._host = h, w._host && w._host._addAttach(w), w.fp("host", $, h), w.onHostChanged($, h)
}
}, getAttaches: function () {
return this._69O
}, _addAttach: function (H) {
var L = this;
L._69O || (L._69O = new xr), L._69O.add(H), L.fp("attaches", F, H)
}, _removeAttach: function (M) {
var X = this;
X._69O.remove(M), X._69O.isEmpty() && delete X._69O, X.fp("attaches", M, F)
}, getImage: function () {
if (this._pendingCheckImageJSON) {
var F = u.getImage(this._image);
F && (this._pendingCheckImageJSON = !1, this.getParent() instanceof Ff && this.getParent().checkPendingUpdateInfo())
}
return this._image
}, setImage: function (J) {
var O = this,
t = O._image,
x = O.getWidth(),
r = O.getHeight();
O._image = J, O.fp("image", t, J) && (null != J && (xl(J) || dk(J) && /\.json$/i.test(J)) && (this._pendingCheckImageJSON = !0), O.fp(ul, x, O.getWidth()), O.fp(Hh, r, O.getHeight()))
}, getElevation: function () {
return this._54O
}, setElevation: function (A) {
var k = this;
if (!k._50O) {
k._50O = 1;
var Y = k._54O;
k._54O = A, k.fp(pd, Y, A), delete this._50O
}
}, getRotation: function () {
return this._64O
}, setRotation: function (T) {
var v = this;
if (!v._49O) {
v._49O = 1;
var N = v._64O;
v._64O = T, v.fp(ac, N, T), delete v._49O
}
}, getRotationX: function () {
return this._rotationX
}, setRotationX: function (Y) {
var E = this;
if (!E._51O) {
E._51O = 1;
var X = E._rotationX;
E._rotationX = Y, E.fp("rotationX", X, Y), delete E._51O
}
}, getRotationZ: function () {
return this._53O
}, setRotationZ: function (e) {
var H = this;
if (!H._52O) {
H._52O = 1;
var Z = H._53O;
H._53O = e, H.fp("rotationZ", Z, e), delete H._52O
}
}, getPosition: function () {
return this._position
}, setPosition: function (X, w) {
var D = this;
if (!D._50I) {
D._50I = 1;
var P;
if (P = 2 === arguments.length ? {
x: X,
y: w
} : X, P.x !== D._position.x || P.y !== D._position.y) {
var B = D._position;
D._position = P, D.fp(pr, B, P)
}
delete D._50I
}
}, translate: function (x, R) {
var o = this._position;
this.p(o.x + x, o.y + R)
}, getWidth: function () {
var q = this;
if (q._width >= 0) return q._width;
var C = q.getStyle("shape3d");
if (C) {
var u = vf(C);
if (u && u.rawS3) return u.rawS3[0];
if ("billboard" === C || "plane" === C) {
var y = ii(q.getStyle("shape3d.image"));
return y ? xc(y, q) : 20
}
}
var y = ii(q._image);
return y ? xc(y, q) : 20
}, setWidth: function (y) {
var G = this,
q = G._width;
G._width = y, G.fp(ul, q, y)
}, getHeight: function () {
var u = this;
if (u._height >= 0) return u._height;
var B = u.getStyle("shape3d");
if (B) {
var Q = vf(B);
if (Q && Q.rawS3) return Q.rawS3[2];
if ("plane" === B) {
var n = ii(u.getStyle("shape3d.image"));
return n ? oo(n, u) : 20
}
if ("billboard" === B) return 2
}
var n = ii(u._image);
return n ? oo(n, u) : 20
}, setHeight: function (I) {
var A = this,
c = A._height;
A._height = I, A.fp(Hh, c, I)
}, getTall: function () {
var d = this;
if (d._tall >= 0) return d._tall;
var a = d.getStyle("shape3d");
if (a) {
var $ = vf(a);
if ($ && $.rawS3) return $.rawS3[1];
if ("billboard" === a) {
var J = ii(d.getStyle("shape3d.image"));
return J ? oo(J, d) : 20
}
if ("plane" === a) return 2
}
return 20
}, setTall: function (l) {
var R = this,
O = R._tall;
R._tall = l, R.fp("tall", O, l)
}, setSize: function (H, r) {
var N = this;
2 === arguments.length ? (N.setWidth(H), N.setHeight(r)) : (N.setWidth(H.width), N.setHeight(H.height))
}, getSize: function () {
return {
width: this.getWidth(),
height: this.getHeight()
}
}, setRect: function (L, K, f, V, n) {
var E = this,
o = E.getAnchor(),
Z = E.getScale();
arguments.length <= 2 && (n = K, K = L.y, f = L.width, V = L.height, L = L.x);
var k = n && Z.x < 0 ? 1 - o.x : o.x,
y = n && Z.y < 0 ? 1 - o.y : o.y;
E.p(L + f * k, K + V * y), n && (f /= Math.abs(Z.x), V /= Math.abs(Z.y)), E.setWidth(f), E.setHeight(V)
}, getMatrix: function () {
var g = this,
T = g._64O,
_ = g._position,
j = g.getScale();
return new In(T, _.x, _.y, j.x, j.y)
}, getAnchorRect: function () {
var J = this,
W = J.getWidth(),
m = J.getHeight(),
z = J.getAnchor();
return {
x: -W * z.x,
y: -m * z.y,
width: W,
height: m
}
}, toLocal: function (j) {
return this.getMatrix().tfi(j)
}, toGlobal: function (o) {
return this.getMatrix().tf(o)
}, getAttachPosition: function () {
var F = new In;
return function (y, T, V, e) {
V = V || 0, e = e || 0;
var i = this,
u = i.getAnchor(),
Z = i._64O,
s = i._position,
P = i.getScale();
return F.setFromTransform(Z, s.x, s.y).tf({
x: V + P.x * i.getWidth() * (y - u.x),
y: e + P.y * i.getHeight() * (T - u.y)
})
}
}(),
isInRect: function (P) {
P = this.toLocal(P);
var u = this.getWidth(),
d = this.getHeight();
return P.x += u * this.getAnchorX(), P.y += d * this.getAnchorY(), !(P.x < 0 || P.y < 0 || P.x > u || P.y > d)
}, getRect: function () {
var R = this,
E = R.getWidth(),
O = R.getHeight(),
e = R.getAnchor(),
z = {
x: -E * e.x,
y: -O * e.y,
width: E,
height: O
},
y = R.getMatrix();
return z = ms([y.tf(z.x, z.y), y.tf(z.x + z.width, z.y), y.tf(z.x + z.width, z.y + z.height), y.tf(z.x, z.y + z.height)])
}, getAnchorElevation: function () {
return this._anchorElevation
}, getAnchor3d: function () {
var T = this,
X = T.getAnchor(),
R = T._anchorElevation;
return {
x: X.x,
y: R,
z: X.y
}
}, setAnchorElevation: function (B) {
var a = this,
t = a._anchorElevation;
return t !== B ? (a._anchorElevation = B, a.fp("anchorElevation", t, B), !0) : !1
}, setAnchor3d: function (z, X, i, U) {
var K, d = this;
"number" == typeof z ? K = {
x: z,
y: X,
z: i
} : (K = z.length ? {
x: z[0],
y: z[1],
z: z[2]
} : z, U = X);
var a = d.getDataModel();
a && a.beginTransaction();
var t = d.getAnchor3d(),
$ = d.setAnchor(K.x, K.z);
if (d.setAnchorElevation(K.y) && ($ = !0), $ && U && !aj) {
d.getAnchor3d();
var J = sj(d),
Y = Td([K.x - t.x, K.y - t.y, K.z - t.z], J);
d.p3(Y)
}
return a && a.endTransaction(), $
}, getAnchor: function () {
var U = this;
if (U.hasOwnProperty("_anchor")) return U._anchor;
var q = ii(U._image);
return q && q.anchorX !== Z ? {
x: q.anchorX,
y: q.anchorY
} : U._anchor
}, setAnchor: function (s, E, f) {
var Y, D = this;
"number" == typeof s ? Y = {
x: s,
y: E
} : (Y = s.length ? {
x: s[0],
y: s[1]
} : s, f = E);
var P = D.getAnchor();
if (P.x !== Y.x || P.y !== Y.y) {
var B = D.getDataModel();
if (B && B.beginTransaction(), D._anchor = Y, D.fp("anchor", P, Y), f && !aj) {
var m = D.getPosition(),
I = D.getSize(),
N = D.getRotation(),
K = D.getScale(),
c = -I.width * (P.x - Y.x) * K.x,
d = -I.height * (P.y - Y.y) * K.y,
U = n(N),
l = k(N);
D.setPosition(m.x + l * c - U * d, m.y + U * c + l * d)
}
return B && B.endTransaction(), !0
}
return !1
}, getScale: function () {
return this._scale
}, setScale: function (p, D) {
var S, R = this;
S = 2 === arguments.length ? {
x: p,
y: D
} : p;
var l = R.getScale();
(l.x !== S.x || l.y !== S.y) && (R._scale = S, R.fp("scale", l, S))
}, getScaleTall: function () {
return this._scaleTall
}, getScale3d: function () {
var $ = this,
f = $._scaleTall,
m = $.getScale();
return [m.x, f, m.y]
}, getFinalScale3d: function () {
var F = this,
G = F.s3(),
S = F._dynamicScale3d,
v = F.getScale3d();
return G && (v[0] *= G[0], v[1] *= G[1], v[2] *= G[2]), S && (v[0] *= S[0], v[1] *= S[1], v[2] *= S[2]), v
}, getFinalRotation3d: function () {
var Z = this;
return Z._dynamicRotation || Z.r3()
}, setScaleTall: function (N) {
var j = this,
F = j._scaleTall;
F !== N && (j._scaleTall = N, j.fp("scaleTall", F, N))
}, setScale3d: function (u, d, B) {
var o, Y = this;
o = "number" == typeof u ? {
x: u,
y: d,
z: B
} : u.length ? {
x: u[0],
y: u[1],
z: u[2]
} : u, Y.setScaleTall(o.y), Y.setScale(o.x, o.z)
}, getCorners: function (X, u) {
X == F && (X = 0), u == F && (u = X);
var p = this,
W = p.getAnchor(),
C = p.getWidth(),
Z = p.getHeight(),
y = -C * W.x - X,
L = -Z * W.y - u,
A = C + 2 * X,
z = Z + 2 * u,
q = p.getMatrix();
return [q.tf(y, L), q.tf(y, L + z), q.tf(y + A, L + z), q.tf(y + A, L)]
}, getEditControlPoints: function (i, l, k) {
l == F && (l = 0), k == F && (k = l);
var q = this,
r = q.getAnchor(),
c = q.getWidth(),
S = q.getHeight(),
m = -c * r.x - l,
p = -S * r.y - k,
u = c + 2 * l,
R = S + 2 * k;
if (i) return [{
x: m,
y: p
}, {
x: m,
y: 0
}, {
x: m,
y: p + R
}, {
x: 0,
y: p + R
}, {
x: m + u,
y: p + R
}, {
x: m + u,
y: 0
}, {
x: m + u,
y: p
}, {
x: 0,
y: p
}];
var A = q.getMatrix();
return [A.tf(m, p), A.tf(m, 0), A.tf(m, p + R), A.tf(0, p + R), A.tf(m + u, p + R), A.tf(m + u, 0), A.tf(m + u, p), A.tf(0, p)]
}, rotateAt: function (g, x, t) {
var i = this,
E = i._position,
a = i._64O,
M = new In(a, E.x, E.y).tf(g, x),
Q = w(g * g + x * x),
H = D(E.y - M.y, E.x - M.x) + t;
i.setRotation(a + t), i.p(M.x + Q * k(H), M.y + Q * n(H))
}, onParentChanged: function () {
Dp.superClass.onParentChanged.apply(this, arguments), this._8I()
}, onPropertyChanged: function () {
var v = {};
return "width|height|position|anchor|rotation|scale|s:layout.h|s:layout.v".split("|").forEach(function (B) {
v[B] = !0
}),
function (e) {
var Y = this;
Dp.superClass.onPropertyChanged.call(Y, e), v[e.property] && !Y._layoutUpdating && Y.updateLayoutParameters(null, e.property), Y._69O && Y._69O.each(function (B) {
B.handleHostPropertyChange(e)
}), Y._49I && Y._49I.each(function (F) {
F.fp("agentChange", !0, !1)
}), "a:layout" === e.property.substring(0, 8) && this.updateAttach()
}
}(),
onHostChanged: function () {
this.updateAttach(), this.updateLayoutParameters()
}, handleHostPropertyChange: function (e) {
this.updateAttach(e)
}, onStyleChanged: function (i) {
Dp.superClass.onStyleChanged.apply(this, arguments), Zj[i] && this.updateAttach()
}, updateAttach: function (m) {
var H = this;
return aj ? (H.updateLayoutParameters(), void 0) : (H._51I || (H._51I = 1, H._71O(m), delete H._51I), void 0)
}, _71O: function (U) {
var r, V, w, c, H, G, x, L, m = this,
g = m._host,
E = U ? U.property : F,
W = U ? U.oldValue : F,
S = U ? U.newValue : F;
if (g instanceof Dp && (x = ii(g.getImage()), x && x.layoutAttach && (L = x.layoutAttach)), U && !Zf[E] && "a:layout" !== E.substring(0, 8) || !L || L(g, this))
if (g instanceof O.Grid) {
if (E === pd) m.setElevation(m._54O + S - W);
else if (!U || ir[E]) {
if (r = m.s("attach.row.index"), V = m.s("attach.column.index"), w = g.getCellRect(r, V), !w) return;
c = m.s("attach.row.span"), H = m.s("attach.column.span"), (1 !== c || 1 !== H) && (w = ni(w, g.getCellRect(r + c - 1, V + H - 1))), ld(w, m, "attach.padding", 1), m.setRect(w)
}
} else if (g instanceof Fc && (G = m.s("attach.index")) >= 0 && (!U || zq[E])) {
var K = m.s("attach.thickness"),
i = g.getScale(),
j = Math.max(i.x, i.y);
K > 0 && m.setHeight(g.getThickness() * K * j);
var s = m.s("attach.offset"),
B = g.getPoints(),
f = B.size();
if (f > G) {
var u = g.getPointsMatrix2d(),
J = B.get(G),
p = f === G + 1 ? B.get(0) : B.get(G + 1);
J = u.apply(J), p = u.apply(p);
var y = [p.x - J.x, p.y - J.y],
M = En(y);
if (M) {
m.s("attach.offset.relative") && (s *= M), m.s("attach.offset.opposite") && (s = M - s);
var Y = {
x: J.x + y[0] / M * s,
y: J.y + y[1] / M * s
},
Q = m.s("attach.gap");
Q && (m.s("attach.gap.relative") && (Q *= g.getThickness() * j), Y = pc(F, Y, p, Q)), m.p(Y), m.setRotation(D(y[1], y[0]))
}
}
} else U && (E === pr ? m.translate(S.x - W.x, S.y - W.y) : E === pd ? m.setElevation(m._54O + S - W) : Yr[E] ? m._11Q(g, E, S - W) : ("anchor" === E || "width" === E || "height" === E || "scale" === E) && m.layout(g))
}, _11Q: function () {
var R = new O.Math.Euler,
o = O.Math.Euler.ReverseOrder,
p = new O.Math.Vector2,
w = new O.Math.Vector2;
return function (F, C, v) {
var Q = this,
W = F.p3(),
V = F.r3(),
H = Q.p3(),
E = Q.r3();
if (C === ac && (C = "rotationY", v = -v), (C === ac || "rotationY" === C) && 0 === E[0] && 0 === E[2] && 0 === V[0] && 0 === V[2] && 0 === H[1] && 0 === W[1]) return Q.setRotation(-E[1] - v), p.set(H[0], H[2]).rotateAround(w.set(W[0], W[2]), -v), Q.p(p.x, p.y), void 0;
var q = il[F.getRotationMode()],
x = q[0],
n = q[1],
b = q[2],
Y = Qn[x],
K = Qn[n],
h = Qn[b],
X = kn();
C === ac + x ? (h(X, V[Er[b]]), K(X, V[Er[n]]), Y(X, v), K(X, -V[Er[n]]), h(X, -V[Er[b]])) : C === ac + n ? (h(X, V[Er[b]]), K(X, v), h(X, -V[Er[b]])) : C === ac + b && h(X, v);
var P = fn(H, W);
Td(P, X), Q.p3(W[0] + P[0], W[1] + P[1], W[2] + P[2]);
var S = Q.getRotationMode();
Cl(X, Q.r3(), S), R.setFromRotationMatrix(X, o(S)), Q.r3([R.x, R.y, R.z])
}
}(),
isHostOn: function (X) {
var t = this;
if (t._host && X && X._69O)
for (var z = {}, D = t._host; D && D !== t && !z[D._id];) {
if (D === X) return !0;
z[D._id] = D, D = D._host
}
return !1
}, isLoopedHostOn: function (k) {
return this.isHostOn(k) && k.isHostOn(this)
}, getScaledSize: function () {
var Y = this.getSize(),
W = this.getScale();
return Y.width *= Math.abs(W.x), Y.height *= Math.abs(W.y), Y
}, layout: function (d) {
if (d = d || this.getHost()) {
var M = this,
A = M.s("layout.h") || "center",
$ = M.s("layout.v") || "center";
if ("center" !== A || "center" !== $) {
var N = new O.Math.Vector2,
m = d.getPosition(),
f = d.getAnchor(),
T = d.getScaledSize();
M.getPosition();
var a, r, _, i, h, P = 1,
p = 1;
switch (M._layoutUpdating = !0, A) {
case "left":
N.setX(M._layoutHValue - f.x * T.width);
break;
case "right":
N.setX((1 - f.x) * T.width - M._layoutHValue);
break;
case "leftright":
a = T.width - M._layoutHValue[2], _ = M.getRotation() - d.getRotation(), i = Math.abs(Math.sin(_)), h = Math.abs(Math.cos(_)), P += h * a / M._layoutHValue[3], p += i * a / M._layoutHValue[4], N.setX(M._layoutHValue[1] + (M._layoutHValue[5] - f.x) * T.width);
break;
case "center":
N.setX((.5 - f.x) * T.width - M._layoutHValue);
break;
case "scale":
_ = M.getRotation() - d.getRotation(), i = Math.abs(Math.sin(_)), h = Math.abs(Math.cos(_)), N.setX((.5 - f.x) * T.width - M._layoutHValue[1] * T.width / M._layoutHValue[0]), r = T.width / M._layoutHValue[2] - 1, P += h * r, p += i * r
}
switch ($) {
case "top":
N.setY(M._layoutVValue - f.y * T.height);
break;
case "bottom":
N.setY((1 - f.y) * T.height - M._layoutVValue);
break;
case "topbottom":
_ || (_ = M.getRotation() - d.getRotation(), i = Math.abs(Math.sin(_)), h = Math.abs(Math.cos(_))), a = T.height - M._layoutVValue[2], P += i * a / M._layoutVValue[3], p += h * a / M._layoutVValue[4], N.setY(M._layoutVValue[1] + (M._layoutVValue[5] - f.y) * T.height);
break;
case "center":
N.setY((.5 - f.y) * T.height - M._layoutVValue);
break;
case "scale":
_ || (_ = M.getRotation() - d.getRotation(), i = Math.abs(Math.sin(_)), h = Math.abs(Math.cos(_))), N.setY((.5 - f.y) * T.height - M._layoutVValue[1] * T.height / M._layoutVValue[0]), r = T.height / M._layoutVValue[2] - 1, P += i * r, p += h * r
}
if ("leftright" === A || "scale" === A || "topbottom" === $ || "scale" === $) {
var j = this.getScale(),
H = Math.abs(j.x),
n = Math.abs(j.y);
"leftright" === A || "scale" === A ? M.setSize(M._layoutHValue[3] * P / H, M._layoutHValue[4] * p / n) : M.setSize(M._layoutVValue[3] * P / H, M._layoutVValue[4] * p / n)
}
N.rotateAround(null, d.getRotation()), this.setPosition(N.x + m.x, N.y + m.y), M._layoutUpdating = Z
}
}
}, updateLayoutParameters: function (q, B) {
if (q = q || this.getHost()) {
var E = this,
G = E.s("layout.h"),
W = E.s("layout.v");
if (G || W) {
var o, w, I, Y, H, Q, z = new O.Math.Vector2,
r = q.getPosition(),
y = q.getAnchor(),
k = q.getScaledSize(),
F = E.getPosition(),
U = E.getScaledSize();
switch (z.set(F.x - r.x, F.y - r.y), z.rotateAround(null, -q.getRotation()), G) {
case "left":
E._layoutHValue = z.x + y.x * k.width;
break;
case "right":
E._layoutHValue = -z.x + (1 - y.x) * k.width;
break;
case "center":
E._layoutHValue = -z.x + (.5 - y.x) * k.width;
break;
case "leftright":
case "scale":
"scale" === G ? o = -z.x + (.5 - y.x) * k.width : (w = E.getAnchor(), I = E.getRotation() - q.getRotation(), Y = Math.cos(I), H = Math.sin(I), Q = -Math.min(-w.x * Y + w.y * H, -w.x * Y - (1 - w.y) * H, (1 - w.x) * Y + w.y * H, (1 - w.x) * Y - (1 - w.y) * H), o = z.x - (Q - y.x) * k.width), "position" === B && "object" == typeof E._layoutHValue ? (E._layoutHValue[0] = k.width, E._layoutHValue[1] = o) : E._layoutHValue = [k.width, o, k.width, U.width, U.height, Q]
}
switch (W) {
case "top":
E._layoutVValue = z.y + y.y * k.height;
break;
case "bottom":
E._layoutVValue = -z.y + (1 - y.y) * k.height;
break;
case "center":
E._layoutVValue = -z.y + (.5 - y.y) * k.height;
break;
case "topbottom":
case "scale":
"scale" === W ? o = -z.y + (.5 - y.y) * k.height : (I || (w = E.getAnchor(), I = E.getRotation() - q.getRotation(), Y = Math.cos(I), H = Math.sin(I)), Q = -Math.min(-w.x * H - w.y * Y, -w.x * H + (1 - w.y) * Y, (1 - w.x) * H - w.y * Y, (1 - w.x) * H + (1 - w.y) * Y), o = z.y - (Q - y.y) * k.height), "position" === B && "object" == typeof E._layoutVValue ? (E._layoutVValue[0] = k.height, E._layoutVValue[1] = o) : E._layoutVValue = [k.height, o, k.height, U.width, U.height, Q]
}
}
}
}, getSerializableProperties: function () {
var g = Dp.superClass.getSerializableProperties.call(this);
return Uh(g, {
image: 1,
host: 1,
rotation: 1,
rotationX: 1,
rotationZ: 1,
rotationMode: 1,
position: 1,
anchor: 1,
anchorElevation: 1,
scale: 1,
scaleTall: 1,
_width: 1,
_height: 1,
_tall: 1,
elevation: 1
}), g
}
});
var Xg = O.Edge = function ($, G) {
var S = this;
fi(Xg, S), S.setSource($), S.setTarget(G)
};
ki("Edge", Qp, {
ms_edge: !0,
_icon: "edge_icon",
getUIClass: function () {
return wn
}, _22Q: function () {
return Ip
}, getSource: function () {
return this._source
}, getTarget: function () {
return this._target
}, getSourceAgent: function () {
return this._40I
}, getTargetAgent: function () {
return this._41I
}, canSetSourceTarget: function (Q) {
if (Q === this) return !1;
if (Fq(Q)) return !0;
for (var X, E, a, B, e, A = [this], f = -1, j = 0; j > f;)
if (f++, X = A[f], E = X._44I)
for (E = E.getArray(), B = 0, e = E.length; e > B; B++)
if (a = E[B], Bk(a) && !(A.indexOf(a) >= 0)) {
if (a === Q) return !1;
A.push(a), j++
}
return !0
}, setSource: function (B) {
var h = this;
if (h._source !== B && h.canSetSourceTarget(B)) {
var A = h._source;
h._source = B, A && A._16I(h), B && B._2I(h), h._7I(), h.fp("source", A, B)
}
}, setTarget: function (M) {
var C = this;
if (C._target !== M && C.canSetSourceTarget(M)) {
var D = C._target;
C._target = M, D && D._18I(C), M && M._4I(C), C._7I(), C.fp("target", D, M)
}
}, isLooped: function () {
var p = this;
return p._source === p._target && Fq(p._source) && Fq(p._target)
}, onPropertyChanged: function () {
var $ = this;
$._49I && $._49I.each(function (s) {
s.fp("agentChange", !0, !1)
})
}, _7I: function () {
var f, y = this,
H = Oq(y);
y._40I !== H && (f = this._40I, f && f._15I(y), y._40I = H, H && H._1I(y), y.fp("sourceAgent", f, H), gi(f, y._41I), gi(H, y._41I));
var g = xg(y);
y._41I !== g && (f = y._41I, f && f._17I(y), y._41I = g, g && g._3I(y), y.fp("targetAgent", f, g), gi(f, y._40I), gi(g, y._40I))
}, _22I: function (D) {
this._52I = D, this.fp("edgeGroup", !0, !1)
}, getEdgeGroup: function () {
return this._52I
}, isEdgeGroupHidden: function () {
var J = this;
return J._52I && J._52I.get(0) !== J && !J.getStyle(kh)
}, getEdgeGroupSize: function () {
return this._52I ? this._52I.size() : 1
}, getEdgeGroupIndex: function () {
return this._52I ? this._52I.indexOf(this) : 0
}, isEdgeGroupAgent: function () {
var z = this,
O = z._52I;
return O && !z.getStyle(kh) && O.size() > 1 && z === O.get(0)
}, toggle: function () {
this.beginTransaction();
var c = this._52I,
K = !this.s(kh);
c && c.size() > 1 && (c.each(function (t) {
t.s(kh, K)
}), c.getSiblings().each(function (t) {
t !== c && t.each(function (a) {
a.fp("edgeGroup", F, t)
})
})), this.endTransaction()
}, setStyle: function (b, F) {
(b === Ei || "edge.segments" === b) && (F = mh(F)), Xg.superClass.setStyle.call(this, b, F)
}, onStyleChanged: function (V) {
Xg.superClass.onStyleChanged.apply(this, arguments), Am[V] && gi(this._41I, this._40I)
}, getSerializableProperties: function () {
var r = Xg.superClass.getSerializableProperties.call(this);
return Uh(r, {
source: 1,
target: 1
}), r
}
});
var Lc = O.Group = function () {
fi(Lc, this)
};
ki("Group", Dp, {
_image: "group_image",
_icon: "group_icon",
_57O: !1,
getUIClass: function () {
return Fn
}, onChildAdded: function () {
Lc.superClass.onChildAdded.apply(this, arguments), this._81I()
}, onChildRemoved: function () {
Lc.superClass.onChildRemoved.apply(this, arguments), this._81I()
}, _81I: function () {
var y = this;
if (!y._54I && !aj) {
var E = y.getChildrenRect();
E && (y._53I = 1, y.p(Re(y.s("group.position"), E, y.getSize())), delete y._53I)
}
}, getChildrenRect: function () {
var $, F = this;
return F.eachChild(function (e) {
Fq(e) && ($ = ni($, F.getChildRect(e)))
}), $
}, getChildRect: function (P) {
var a;
return Fq(P) && P.s(Dm) && (yl(P) && P.isExpanded() && P.eachChild(function (k) {
a = ni(a, P.getChildRect(k))
}), !a && P.getRect && (a = P.getRect())), a
}, setPosition: function (G, N) {
var j = this;
if (!j._54I) {
var A;
A = 2 === arguments.length ? {
x: G,
y: N
} : G, aj || j._53I || (j._54I = 1, qc(j._children, A.x - j._position.x, A.y - j._position.y), delete j._54I), Lc.superClass.setPosition.call(this, A)
}
}, toggle: function () {
this.setExpanded(!this.isExpanded())
}, isExpanded: function () {
return this._57O
}, setExpanded: function (M) {
var d = this;
if (d._57O !== M) {
var n = d._57O;
d._57O = M, d.fp("expanded", n, d._57O), d._fireInvalidateDeep(), d._8I()
}
}, _fireInvalidateDeep: function () {
this.eachChild(function (H) {
yl(H) ? H._fireInvalidateDeep() : H.iv()
})
}, _8I: function () {
Lc.superClass._8I.call(this), this.eachChild(function (y) {
Fq(y) && y._8I()
})
}, onStyleChanged: function (f) {
Lc.superClass.onStyleChanged.apply(this, arguments), "group.position" === f && this._81I()
}, getSerializableProperties: function () {
var B = Lc.superClass.getSerializableProperties.call(this);
return B.expanded = 1, B
}
});
var Br = O.Block = function () {
fi(Br, this), this.s({
"shadow.cast": !1,
"shadow.receive": !1
})
};
ki("Block", Dp, {
_icon: "block_icon",
_clickThroughEnabled: !1,
_syncSize: !0,
ms_ac: ["clickThroughEnabled", "syncSize"],
getUIClass: function () {
return Ul
}, _22Q: function () {
return rs
}, onChildAdded: function () {
Br.superClass.onChildAdded.apply(this, arguments), this.updateFromChildren()
}, onChildRemoved: function () {
Br.superClass.onChildRemoved.apply(this, arguments), this.updateFromChildren()
}, _getBoundingBox: function () {
function G(x, Y, A) {
M.fromArray(sj(Y));
var S = Y.getAnchor3d();
x.push((new tl).set(0 - S.x, 0 - S.y, 0 - S.z).applyMatrix4(M).applyMatrix4(A)), x.push((new tl).set(0 - S.x, 0 - S.y, 1 - S.z).applyMatrix4(M).applyMatrix4(A)), x.push((new tl).set(0 - S.x, 1 - S.y, 0 - S.z).applyMatrix4(M).applyMatrix4(A)), x.push((new tl).set(0 - S.x, 1 - S.y, 1 - S.z).applyMatrix4(M).applyMatrix4(A)), x.push((new tl).set(1 - S.x, 0 - S.y, 0 - S.z).applyMatrix4(M).applyMatrix4(A)), x.push((new tl).set(1 - S.x, 0 - S.y, 1 - S.z).applyMatrix4(M).applyMatrix4(A)), x.push((new tl).set(1 - S.x, 1 - S.y, 0 - S.z).applyMatrix4(M).applyMatrix4(A)), x.push((new tl).set(1 - S.x, 1 - S.y, 1 - S.z).applyMatrix4(M).applyMatrix4(A))
}
function Y(x, N) {
var Q = (new br).makeRotationFromEuler(this.getEuler()).setPosition((new tl).fromArray(this.p3()));
Q.getInverse(Q), x.forEach(function (A) {
Fq(A) && G(N, A, Q)
})
}
var M = new br;
return function (g, I) {
if (g instanceof Dp && (g = [g]), !g || 0 === g.length) return F;
var I = [];
Y.call(this, g, I);
var E = [1 / 0, 1 / 0, 1 / 0],
l = [-1 / 0, -1 / 0, -1 / 0];
return I.forEach(function (Q) {
E[0] = Math.min(Q.x, E[0]), E[1] = Math.min(Q.y, E[1]), E[2] = Math.min(Q.z, E[2]), l[0] = Math.max(Q.x, l[0]), l[1] = Math.max(Q.y, l[1]), l[2] = Math.max(Q.z, l[2])
}), {
min: E,
max: l
}
}
}(),
updateFromChildren: function () {
var i = this;
if (!aj && !i._updatingToChildren && i._syncSize && 0 !== i.size() && !i._freezeSyncFromChildren) {
var f = this._getBoundingBox(i.toChildren(Fq));
if (f) {
i._updatingFromChildren = 1;
var I = (new tl).fromArray(this.getScale3d()),
Z = (new tl).fromArray(f.min),
T = (new tl).fromArray(f.max),
v = u.blockMinSize,
k = new tl,
r = T.clone().sub(Z);
0 === r.x && k.setX(.5), 0 === r.y && k.setY(.5), 0 === r.z && k.setZ(.5);
var S = this._width == F || -1 === this._width,
E = new tl(this.getAnchor3d());
if (S || this._anchorChanged || !this.s("keepPosition")) {
var q = E.clone().multiply(r).add(Z).applyEuler(this.getEuler()).add((new tl).fromArray(this.p3()));
this.p3([q.x, q.y, q.z])
} else {
var y = I.clone().multiply((new tl).fromArray(this.s3())),
s = r.clone();
0 === s.x && s.setX(v), 0 === s.y && s.setY(v), 0 === s.z && s.setZ(v);
var l = E.clone().multiply(y),
z = l.clone().multiplyScalar(-1).sub(Z).divide(s).add(l.divide(s)).add(k);
this.setAnchor3d(z.x, z.y, z.z)
}
var c = new tl(1, 1, 1).divide(I).multiply(r);
this.s3(Math.abs(c.x), Math.abs(c.y), Math.abs(c.z)), delete i._updatingFromChildren
}
}
}, setPosition: function (w, J) {
var c = this;
if (!c._updatingToChildren) {
var x;
x = 2 === arguments.length ? {
x: w,
y: J
} : w, aj || c._updatingFromChildren || (c._updatingToChildren = 1, qc(c._children, x.x - c._position.x, x.y - c._position.y), delete c._updatingToChildren), Br.superClass.setPosition.call(this, x)
}
}, setSize3d: function () {
var Y = this.getDataModel();
Y && Y.beginTransaction(), Br.superClass.setSize3d.apply(this, arguments), Y && Y.endTransaction()
}, setTall: function (I) {
var z = this;
if (!z._updatingToChildren) {
var O = z.getDataModel();
O && O.beginTransaction(), I = q(I, u.blockMinSize);
var w = z.getTall();
if (I !== w && Br.superClass.setTall.call(z, I), !aj && !z._updatingFromChildren) {
z._updatingToChildren = 1;
var B = I / w;
z._adjustChildTallOrScale(B, "size"), delete z._updatingToChildren, z.updateFromChildren()
}
O && O.endTransaction()
}
}, setWidth: function (t) {
return this.setSize(t, this.getHeight())
}, setHeight: function (O) {
return this.setSize(this.getWidth(), O)
}, setSize: function (G, V) {
var N = u.blockMinSize;
G = q(G, N), V = q(V, N);
var a = this;
if (!a._updatingToChildren) {
2 !== arguments.length && (V = G.height, G = G.width);
var t = a.getDataModel();
t && t.beginTransaction();
var v = a.getWidth(),
I = a.getHeight();
if (G !== v && Br.superClass.setWidth.call(a, G), V !== I && Br.superClass.setHeight.call(a, V), !aj && !a._updatingFromChildren) {
a._updatingToChildren = 1;
var k = G / v,
r = V / I;
a._adjustChildScaleOrSize(k, r, "size"), delete a._updatingToChildren, a.updateFromChildren()
}
t && t.endTransaction()
}
}, _adjustChildScaleOrSize: function (C, K, Q) {
var $ = this;
if ($._syncSize) {
var p = $.getPosition(),
s = $.getRotation();
$.getScale(), $.eachChild(function (b) {
if (Fq(b)) {
var g = b.getPosition(),
h = b.getRotation(),
B = b.getWidth(),
S = b.getHeight(),
d = b.getScale(),
q = d.x * B,
o = d.y * S,
t = new In(h, g.x, g.y, q, o);
t.translate(-p.x, -p.y), t.rotate(-s), h = D(t.b * Math.sign(q), t.a * Math.sign(q)), t.scale(C, K);
var E, A, M, L = k(h);
if (Math.abs(L) < .001 ? (E = n(h), A = t.b / E, M = -t.c / E) : (A = t.a / L, M = t.d / L), "scale" === Q) b.setScale(A / B, M / S);
else if ("size" === Q) {
var u = A / d.x,
X = M / d.y;
b.setScale(he(A) * Math.abs(d.x), he(M) * Math.abs(d.y)), b instanceof O.Shape ? (b.setWidthForce(Math.max(Math.abs(u), 1e-5)), b.setHeightForce(Math.max(Math.abs(X), 1e-5))) : b.setSize(Math.max(.01, Math.abs(u)), Math.max(.01, Math.abs(X)))
}
t.rotate(s), t.translate(p.x, p.y), b.setPosition(t.tx, t.ty)
}
})
}
}, _calcChangeFactor: function (B, g, n, h) {
var d, L, w, G;
return d = X(B), L = X(n), w = d > L ? d / L : L / d, d = X(g), L = X(h), G = d > L ? d / L : L / d, q(w, G)
}, setElevation: function (L) {
var R = this;
if (!R._updatingToChildren) {
var e = R.getElevation(),
$ = L - e;
0 !== $ && (aj || R._updatingFromChildren || (R._updatingToChildren = 1, qc(R._children, 0, $, 0), delete R._updatingToChildren), Br.superClass.setElevation.apply(R, arguments))
}
}, setScaleTall: function (I) {
var N = this;
if (!N._updatingToChildren) {
var w = N.getScaleTall();
if (X(I) < .01 && (I = .01 * (he(I) || he(w))), Br.superClass.setScaleTall.call(N, I), !aj && !N._updatingFromChildren) {
N._updatingToChildren = 1;
var C = I / w;
N._adjustChildTallOrScale(C, "size"), delete N._updatingToChildren, this.updateFromChildren()
}
}
}, _adjustChildTallOrScale: function (E, n) {
var c = this;
if (c._syncSize) {
var b = c.getElevation();
c.eachChild(function (d) {
if (Fq(d))
if ("size" === n) {
var G = d.getTall();
0 > E && d.setScaleTall(-1 * d.getScaleTall()), d.setTall(Math.max(.01, Math.abs(G * E))), d.setElevation(b + (d.getElevation() - b) * E)
} else {
var q = d.getScaleTall();
d.setScaleTall(q * E)
}
})
}
}, setAnchor3d: function () {
if (!this._updatingToChildren) {
var s = this.getDataModel();
s && s.beginTransaction();
var $ = Br.superClass.setAnchor3d.apply(this, arguments);
return $ && !aj && !this._updatingFromChildren && this._syncSize && (this._anchorChanged = 1, this.updateFromChildren(), delete this._anchorChanged), s && s.endTransaction(), $
}
}, setAnchor: function () {
var O = this;
if (!O._updatingToChildren) {
var o = O.getAnchor(),
_ = Br.superClass.setAnchor.apply(O, arguments);
if (aj || O._updatingFromChildren || !O._syncSize) return _;
O._updatingToChildren = 1;
var u = O.getAnchor();
O.getPosition();
var G = O.getSize(),
T = O.getScale(),
E = O.getRotation(),
s = -G.width * T.x * (o.x - u.x),
$ = -G.height * T.y * (o.y - u.y),
p = n(E),
F = k(E),
y = F * s - p * $,
P = p * s + F * $;
return O.eachChild(function (S) {
if (Fq(S)) {
var Z = S.getPosition();
S.setPosition(Z.x - y, Z.y - P)
}
}), delete O._updatingToChildren, _
}
}, setAnchorElevation: function () {
var Z = this;
if (!Z._updatingToChildren) {
var a = Z.getAnchorElevation(),
F = Br.superClass.setAnchorElevation.apply(Z, arguments);
if (aj || Z._updatingFromChildren || !Z._syncSize) return F;
Z._updatingToChildren = 1;
var _ = Z.getAnchorElevation(),
W = Z.getTall(),
J = Z.getScaleTall(),
G = -W * J * (a - _);
return Z.eachChild(function (J) {
if (Fq(J)) {
var N = J.getElevation();
J.setElevation(N - G)
}
}), delete Z._updatingToChildren, F
}
}, setRotation: function (G) {
this._updateChildrenRotation3d("rotation", G)
}, setRotationX: function (L) {
this._updateChildrenRotation3d("rotationX", L)
}, setRotationZ: function (_) {
this._updateChildrenRotation3d("rotationZ", _)
}, _updateChildrenRotation3d: function (w, f) {
var E = this;
if (!E._updatingToChildren) {
var p = E[kp(w)]();
if (Br.superClass[tg(w)].call(E, f), !aj && !E._updatingFromChildren) {
E._updatingToChildren = 1;
var c = f - p;
E.eachChild(function (G) {
Fq(G) && G._11Q(E, w, c)
}), delete E._updatingToChildren
}
}
}, setScale: function (p, q) {
var V = this;
if (!V._updatingToChildren) {
null == q && (q = p.y, p = p.x);
var S = V.getScale();
if (X(p) < .01 && (p = .01 * (he(p) || he(S.x))), X(q) < .01 && (q = .01 * (he(q) || he(S.y))), Br.superClass.setScale.call(V, p, q), !aj && !V._updatingFromChildren) {
V._updatingToChildren = 1;
var Q = p / S.x,
b = q / S.y;
V._adjustChildScaleOrSize(Q, b, "size"), delete V._updatingToChildren, V.updateFromChildren()
}
}
}, getSerializableProperties: function () {
var o = Br.superClass.getSerializableProperties.call(this);
return o.clickThroughEnabled = 1, o.syncSize = 1, o
}
});
var pi = O.Grid = function () {
fi(O.Grid, this)
};
ki("Grid", Dp, {
IRotatable: !1,
_icon: "grid_icon",
_image: F,
getUIClass: function () {
return _n
}, setRotation: function () { }, getCellRect: function (E, u) {
var I = this,
S = I.s("grid.row.count"),
Y = I.s("grid.column.count");
if (0 >= S || 0 >= Y || 0 > E || E >= S || 0 > u || u >= Y) return F;
var G, z, v, g = I.getRect(),
N = I.s("grid.row.percents"),
b = I.s("grid.column.percents");
if (ld(g, I, "grid.border", -1), N && N._as && (N = N._as), b && b._as && (b = b._as), N && N.length === S) {
for (v = 0, G = 0; E > G; G++) v += g.height * N[G];
g.y += v, g.height = g.height * N[E]
} else g.height = g.height / S, g.y += g.height * E; if (b && b.length === Y) {
for (z = 0, G = 0; u > G; G++) z += g.width * b[G];
g.x += z, g.width = g.width * b[u]
} else g.width = g.width / Y, g.x += g.width * u;
return vn(g, -I.s("grid.gap")), g
}
});
var Lo = O.Text = function () {
fi(Lo, this), this.setSize(100, 50), this.s("text", "TEXT")
};
ki("Text", Dp, {
_icon: "text_icon",
_image: "__text__",
getUIClass: function () {
return sk
}, setWidth: function (U) {
U || (U = .001), Lo.superClass.setWidth.call(this, U)
}, setHeight: function (J) {
J || (J = .001), Lo.superClass.setHeight.call(this, J)
}, toLabel: function () {
return this._displayName || this._name || this.s("text")
}
}), _c("__text__", {
width: {
value: 100,
isSafeFunc: !0,
func: function (L) {
return L ? L._width : 100
}
},
height: {
value: 50,
isSafeFunc: !0,
func: function (T) {
return T ? T._height : 50
}
},
comps: [{
type: "text",
relative: !0,
rect: [0, 0, 1, 1],
text: {
func: "style@text"
},
align: {
func: "style@text.align"
},
vAlign: {
func: "style@text.vAlign"
},
color: {
func: "style@text.color"
},
font: {
func: "style@text.font"
},
shadow: {
func: "style@text.shadow"
},
shadowColor: {
func: "style@text.shadow.color"
},
shadowBlur: {
func: "style@text.shadow.blur"
},
shadowOffsetX: {
func: "style@text.shadow.offset.x"
},
shadowOffsetY: {
func: "style@text.shadow.offset.y"
},
scaleX: {
func: "style@text.scale.x"
},
scaleY: {
func: "style@text.scale.y"
}
}]
});
var Fc = O.Shape = function () {
fi(Fc, this), this._59O = new xr
};
Fc.__de__ = zr, ki("Shape", Dp, {
ms_ac: ["thickness", "closePath"],
_icon: "shape_icon",
_thickness: 10,
_closePath: !1,
getUIClass: function () {
return Xp
}, _22Q: function () {
return Vp
}, getLength: function (T) {
return tj(Yo(this._59O, this._58O, T, this._closePath))
}, getSegments: function () {
return this._58O
}, toSegments: function () {
var k = this._58O;
return k ? new xr(k._as.slice(0)) : k
}, setSegments: function (h) {
var P = this._58O;
h = h ? ip(h) ? new xr(h.slice(0)) : new xr(h._as.slice(0)) : null, (P && h && P._as.join(",") !== h._as.join(",") || P !== h) && (this._58O = h, this.fp("segments", P, h))
}, getPoints: function () {
return this._59O
}, toPoints: function () {
var O = this._59O;
return new xr(O._as.slice(0))
}, getPointsMatrix2d: function () {
var n = this,
c = new Rc.Matrix2d,
Q = n.getPosition(),
t = n.getScale(),
z = n.getRotation();
return c.translate(-Q.x, -Q.y).scale(t.x, t.y).rotate(z).translate(Q.x, Q.y), c
}, getPointsMatrix3d: function () {
return function () {
var O = this,
V = new Rc.Matrix4,
p = V.getElements(),
L = O.p3();
bo(p, L), Cl(p, O.getFinalRotation3d(), O.getRotationMode());
var H = O.getScale3d(),
Q = O._dynamicScale3d;
return Q && (H[0] *= Q[0], H[1] *= Q[1], H[2] *= Q[2]), Bd(p, H), bo(p, Cj(L)), V
}
}(),
setPoints: function (Z, X) {
var w = this,
c = w._59O;
Z = Z ? ip(Z) ? new xr(Z.slice(0)) : new xr(Z._as.slice(0)) : new xr;
var D, N, q, T, o, n;
X && (D = w.getPosition(), n = new In(w.getRotation(), 0, 0, w.getScale().x, w.getScale().y)), (c && Z && c._as.join(",") !== Z._as.join(",") || c !== Z) && (w._59O = Z, w.fs(), w.fp("points", c, Z)), X && (N = w.getPosition(), q = N.x - D.x, T = N.y - D.y, o = n.tf(q, T), w.setPosition(N.x - q + o.x, N.y - T + o.y))
}, addPoint: function (J, t, M) {
var z = this.toPoints();
z.add(J, t), this.setPoints(z, M)
}, setPoint: function (K, u, k) {
var P = this.toPoints();
P.set(K, u), this.setPoints(P, k)
}, removePointAt: function (t) {
var R = this.toPoints();
R.removeAt(t), this.setPoints(R)
}, setWidthForce: function (T) {
var U = this;
if (!U._55I && !aj && U.getWidth()) {
U._55I = 1;
var V = U._position.x,
q = T / U.getWidth(),
M = U.toPoints(),
s = new xr;
1 !== q && (M.each(function (z) {
s.add({
x: (z.x - V) * q + V,
y: z.y,
e: z.e
})
}), U.setPoints(s), ok(U, [q, 0, 0, 1, V * (1 - q), 0]), U.fs()), delete U._55I
}
Fc.superClass.setWidth.call(U, T)
}, setWidth: function (W) {
return this.setWidthForce(Wp > W ? Wp : W)
}, setHeightForce: function (i) {
var R = this;
if (!R._55I && !aj && R.getHeight()) {
R._55I = 1;
var o = R._position.y,
g = i / R.getHeight(),
S = R.toPoints(),
h = new xr;
1 !== g && (S.each(function (D) {
h.add({
x: D.x,
y: (D.y - o) * g + o,
e: D.e
})
}), R.setPoints(h), ok(R, [1, 0, 0, g, 0, o * (1 - g)]), R.fs()), delete R._55I
}
Fc.superClass.setHeight.call(R, i)
}, setHeight: function (x) {
return this.setHeightForce(Wp > x ? Wp : x)
}, setAnchorElevation: function (v) {
var M = this;
M._55I = !0;
var o = M._updatingAnchor3d,
x = !aj && !o;
if (x) {
var t, p = v,
Z = M.getAnchorElevation(),
U = M.getTall();
t = U * (Z - p), 0 !== t && M.shiftPointsElevation(t)
}
var y = Fc.superClass.setAnchorElevation.apply(M, arguments);
return o || delete M._55I, y
}, getShapeElevation: function () {
var J = this,
j = J._54O;
return j - (J.getTall() || 0) * (J._anchorElevation - .5)
}, setAnchor3d: function (c, q, X, J) {
var Z, F = this;
"number" == typeof c ? Z = {
x: c,
y: q,
z: X
} : (Z = c.length ? {
x: c[0],
y: c[1],
z: c[2]
} : c, J = q), F._55I = !0, F._updatingAnchor3d = !0;
var N = F.getDataModel();
if (N && N.beginTransaction(), !aj) {
var K = F.getAnchor3d(),
z = F.getSize(),
A = F.getTall(),
R = z.width * (K.x - Z.x),
n = z.height * (K.z - Z.z),
C = A * (K.y - Z.y);
J || F.shiftPoints(R, n, C);
var V = F.p3()
}
var H = Fc.superClass.setAnchor3d.apply(F, arguments);
if (!aj && J) {
var s = F.p3();
F.shiftPoints(s[0] - V[0] + R, s[2] - V[2] + n, s[1] - V[1] + C)
}
return N && N.endTransaction(), delete F._updatingAnchor3d, delete F._55I, H
}, setAnchor: function (f, X, n) {
var j = this;
j._55I = !0;
var A = j._updatingAnchor3d,
d = !aj && !A;
if (d) {
var E, t, Y;
"number" == typeof f ? Y = {
x: f,
y: X
} : (Y = f.length ? {
x: f[0],
y: f[1]
} : f, n = X);
var q = j.getAnchor(),
Z = j.getSize();
E = Z.width * (q.x - Y.x), t = Z.height * (q.y - Y.y), n || j.shiftPoints(E, t);
var o = j.getPosition()
}
var y = Fc.superClass.setAnchor.apply(j, arguments);
if (d) {
var P = j.getPosition();
n && j.shiftPoints(P.x - o.x + E, P.y - o.y + t)
}
return A || delete j._55I, y
}, shiftPoints: function (x, m, s) {
if (x || m || s) {
var Y = this,
O = Y.getElevation() || 0,
i = Y.toPoints(),
v = new xr;
i.each(function (t) {
var Q = t.e;
s && (Q = (Q == F ? O : Q) + s), v.add({
x: t.x + x,
y: t.y + m,
e: Q
})
}), Y.setPoints(v), Y.fs()
}
}, shiftPointsElevation: function (h) {
return this.shiftPoints(0, 0, h)
}, setPosition: function (T, X) {
var U, y = this;
if (!y._28Q) {
if (y._28Q = 1, !y._55I && !aj) {
U = 2 === arguments.length ? {
x: T,
y: X
} : T;
var f = U.x - y._position.x,
m = U.y - y._position.y;
if (0 === f && 0 === m) return delete y._28Q, void 0;
y._55I = 1, y.shiftPoints(f, m), ok(y, [1, 0, 0, 1, f, m]), delete y._55I
}
Fc.superClass.setPosition.apply(y, arguments), delete y._28Q
}
}, fs: function () {
this.fireShapeChange()
}, _70I: function () {
var y = this;
if (2 !== y._59O.size()) return !1;
var F = y._58O;
return F ? 2 === F.size() && 1 === F.get(0) && 2 === F.get(1) ? !0 : !1 : !0
}, fireShapeChange: function () {
var W = this;
if (!W._55I && !aj) {
var N = ms(W._59O);
N && (W._55I = 1, W.setRect(N), delete W._55I)
}
W.fp(bl, !1, !0)
}, getSerializableProperties: function () {
var j = Fc.superClass.getSerializableProperties.call(this);
return j.segments = 1, j.points = 1, j.thickness = 1, j.closePath = 1, j
}
});
var oj = O.Points = function () {
fi(oj, this)
};
ki("Points", Dp, {
_22Q: function () {
return Co
}, setPoints: function (T) {
this.points = T, this._pointsDirty = !0, this.fp("points", F, this.points)
}, setPoint: function (S, h) {
this.points || (this.points = []), this.points[3 * S] = h[0], this.points[3 * S + 1] = h[1], this.points[3 * S + 2] = h[2], this._pointsDirty = !0, this.fp("points", F, this.points)
}, setPointsColor: function (B) {
this.colors = B, this._colorsDirty = !0, this.fp("colors", F, this.colors)
}, setPointColor: function (i, g) {
this.colors || (this.colors = []), g ? (g = ns(g), this.colors[3 * i] = g[0], this.colors[3 * i + 1] = g[1], this.colors[3 * i + 2] = g[2]) : (this.colors[3 * i] = Z, this.colors[3 * i + 1] = Z, this.colors[3 * i + 2] = Z), this._colorsDirty = !0, this.fp("colors", F, this.colors)
}, setPointsSize: function (U) {
this.sizes = U, this._sizesDirty = !0, this.fp("sizes", F, this.sizes)
}, setPointSize: function (x, q) {
this.sizes || (this.sizes = []), this.sizes[x] = q ? q : Z, this._sizesDirty = !0, this.fp("sizes", F, this.sizes)
}, getPointInfo: function (D) {
var A = 3 * D,
f = this.points;
if (!f || f[A] === Z || f[A + 1] === Z || f[A + 2] === Z) return null;
var d = [f[A], f[A + 1], f[A + 2]],
Y = this.mat || sj(this),
C = [d[0], d[1], d[2]];
Td(C, Y);
var x = this.colors;
return {
size: this.sizes && this.size[D] || this.s("points.size"),
color: x && x[A] ? [x[A], x[A + 1], x[A + 2]] : this.s("points.color"),
local: d,
world: C
}
}, getSerializableProperties: function () {
var O = oj.superClass.getSerializableProperties.call(this);
return O.points = 1, O.colors = 1, O.sizes = 1, O
}
});
var hn = O.Polyline = function () {
fi(hn, this), this.s({
"shape.background": null,
"shape.border.width": 2
})
};
ki("Polyline", Fc, {
_icon: "polyline_icon",
_22Q: function () {
return Ds
}, getUIClass: function () {
return Kr
}, setClosePath: function () { }, setTall: function (m) {
var f = this,
j = f.getDataModel();
if (j && j.beginTransaction(), !f._55I && !f._24Q && !aj && f.getTall()) {
f._24Q = 1;
var q = f._54O,
S = m / f.getTall();
if (1 !== S) {
var l = f.toPoints(),
_ = new xr;
l.each(function (Q) {
_.add({
x: Q.x,
y: Q.y,
e: Q.e == F ? Q.e : (Q.e - q) * S + q
})
}), f.setPoints(_), f.fs()
}
delete f._24Q
}
hn.superClass.setTall.call(f, m), j && j.endTransaction()
}, setElevation: function (d) {
var C = this,
k = C.getDataModel();
if (k && k.beginTransaction(), !C._55I && !C._24Q && !aj) {
C._24Q = 1;
var _ = d - C._54O;
0 !== _ && C.shiftPointsElevation(_), delete C._24Q
}
hn.superClass.setElevation.apply(C, arguments), k && k.endTransaction()
}, fireShapeChange: function () {
var w = this,
s = w._59O;
if (!w._55I && !w._24Q && !aj) {
var U = s.size();
if (U) {
var Q = 1,
h = s.get(0),
I = w._54O;
h.e == F && (h.e = I);
for (var o = h.e, g = 0; U > Q; Q++) {
h = s.get(Q), h.e == F && (h.e = I);
var C = V(o, h.e),
k = q(o + g, h.e);
o = C, g = k - C
}
w._24Q = 1, w.setTall(g), w.setElevation(o + g * w._anchorElevation), delete w._24Q
}
}
hn.superClass.fireShapeChange.apply(w, arguments)
}
});
var zh = O.SubGraph = function () {
fi(zh, this)
};
ki("SubGraph", Dp, {
ISubGraph: 1,
_image: "subGraph_image",
_icon: "subGraph_icon",
_8I: function () {
zh.superClass._8I.call(this), this.eachChild(function (G) {
Fq(G) && G._8I()
})
}
}), u.loadingRefGraph = 0;
var Ff = O.RefGraph = function () {
fi(Ff, this)
};
ki("RefGraph", Br, {
_icon: "refGraph_icon",
getRef: function () {
return this._ref
}, setRef: function (f) {
var _ = this._ref;
this._ref = f, this.fp("ref", _, f), this.updateRef()
}, _21I: function () {
Ff.superClass._21I.apply(this, arguments), this.updateRef()
}, updateRef: function () {
var V = this;
if (u.loadingRefGraph++, V.clearChildrenFromDataModel(), u.loadingRefGraph--, V._ref && V._dataModel) {
V._xhrLoadHandler && (V._xhrLoadHandler.cancel = !0);
var a = aj,
x = V._xhrLoadHandler = function (I) {
if (I && V._dataModel) {
u.loadingRefGraph++;
var k = V._pendingUpdateInfo = {
needToRestore: a
};
a && (k.p3 = V.p3(), k.s3 = V.s3(), k.r3 = V.r3(), k.anchor3d = V.getAnchor3d(), k.scale3d = V.getScale3d()), V.r3(0, 0, 0), V.setScale3d(1, 1, 1), V.setAnchor3d(.5, .5, .5), V.p3(0, 0, 0);
var B = u.parse(I),
J = V._dataModel.deserialize(B, V, {
justDatas: !0
});
J.each(function (Y) {
Y._refGraph = V
}), V.checkPendingUpdateInfo(), u.loadingRefGraph--, u.handleRefGraphLoaded(V, J, B)
}
};
x.xhrLoadCalled = !1, u.load(V._ref, function (V) {
x.cancel || (x.xhrLoadCalled ? x(V) : $e(function () {
x(V)
}))
}), x.xhrLoadCalled = !0
}
}, checkPendingUpdateInfo: function () {
var D = this,
f = D._pendingUpdateInfo;
if (!f) return D.onPendingUpdated && (u.loadingRefGraph++, D.onPendingUpdated(), u.loadingRefGraph--), void 0;
var X = !0;
this.eachChild(function (Q) {
(Q._pendingCheckImageJSON || Q._pendingUpdateInfo) && (X = !1)
}), X && (u.loadingRefGraph++, D._pendingUpdateInfo = null, D.updateFromChildren(), f.needToRestore && (D.setAnchor3d(f.anchor3d), D.setScale3d(f.scale3d), D.r3(f.r3), D.p3(f.p3)), this.getParent() instanceof Ff && this.getParent().checkPendingUpdateInfo(), D.onPendingUpdated && D.onPendingUpdated(), u.loadingRefGraph--)
}, getSerializableProperties: function () {
var G = Ff.superClass.getSerializableProperties.call(this);
return G.ref = 1, G
}
}), O.EdgeGroup = function (h, V) {
this._70O = h, this._siblings = V;
for (var n, p, d = 0, K = h.size(), y = z[kh]; K > d; d++)
if (n = h.get(d).getStyle(kh, !1), n != F) {
y = n;
break
}
y == F && (y = !0);
var t = u.edgeGroupAgentFunc;
for (t && (p = t(h), p && p !== h.get(0) && (h.remove(p), h.add(p, 0))), d = 0; K > d; d++) h.get(d).s(kh, y)
}, ki("EdgeGroup", o, {
getEdges: function () {
return this._70O
}, size: function () {
return this._70O.size()
}, get: function (N) {
return this._70O.get(N)
}, indexOf: function (v) {
return this._70O.indexOf(v)
}, each: function ($, p) {
this._70O.each($, p)
}, getSiblings: function () {
return this._siblings
}, eachSiblingEdge: function ($, T) {
this._siblings.each(function (W) {
W._70O.each($, T)
})
}
});
var Sk = function (A, C, E) {
var y = Al[A] = {
type: A,
action: C
};
if (E)
for (var O in E) y[O] = E[O]
};
Uh(u, {
setConnectAction: Sk,
getConnectAction: function (b, Q) {
if (!Q) {
if (!b) return null;
Q = b.getCurrentConnectActionType()
}
return Al[Q]
}, doConnectAction: function (W, d, B, H) {
H = H || W.getCurrentConnectActionType();
var K = Al[H];
if (!K) return !1;
var P = K.action;
return P ? (d instanceof se.Group ? W.sm().getSelection().each(function (b) {
P.call(null, W, b, B)
}) : P.call(null, W, d, B), !0) : !1
}, doDeleteConnectionAction: function (W, V, s) {
s = s || W.getCurrentConnectActionType();
var X = Al[s];
if (!X || !X.delete) return !1;
var v = X.delete.action;
return v ? (V instanceof se.Group ? W.sm().getSelection().each(function (H) {
v.call(null, W, H)
}) : v.call(null, W, V), !0) : !1
}
});
var dl = O.JSONSerializer = function (I, j) {
this.dm = this._dataModel = I, this._hierarchical = u.forceHierarchicalSerialization ? !0 : j == F ? I.isHierarchicalRendering() : j
};
ki("JSONSerializer", o, {
ms_ac: ["hierarchical"],
serialize: function (M) {
return u.stringify(this.toJSON(), M)
}, toJSON: function () {
var U = this,
c = U.dm,
x = c.getRoots(),
g = U.json = {
v: u.getVersion(),
p: {},
a: {},
d: []
},
Y = c.getSerializableAttrs();
c.getInit() && (g.init = c.getInit()), c.getName() && (g.p.name = c.getName()), c.getBackground() && (g.p.background = c.getBackground()), c.getLayers() && (g.p.layers = c.getLayers()), c.getEnvmap() && (g.p.envmap = c.getEnvmap()), c.isCubicEnvmap() && (g.p.cubicEnvmap = c.isCubicEnvmap()), g.p.autoAdjustIndex = c.isAutoAdjustIndex(), g.p.hierarchicalRendering = c.isHierarchicalRendering();
for (var H in Y) {
var L = c.a(H);
L !== Z && U[No](H, L, g.a)
}
return wd(g.a) && delete g.a, U._hierarchical ? x.each(U.serializeData, this) : c.each(function (d) {
U.serializeData(d)
}), c.fireSerializeEvent({
type: "serialize",
json: g
}), c.getPostProcessingData() && (g.p.postProcessingData = c.getPostProcessingData()), g
}, isSerializable: function () {
return !0
}, getProperties: function (h) {
return h.getSerializableProperties()
}, getStyles: function (H) {
return H.getSerializableStyles()
}, getAttrs: function (i) {
return i.getSerializableAttrs()
}, serializeData: function (v) {
var g = this;
if (g.isSerializable(v) && !v._refGraph) {
var V, R, Z, q, M = gp(v.getClassName()) || v.getClass(),
j = new M,
a = {
c: v.getClassName(),
i: v.getId(),
p: {},
s: {},
a: {}
};
g.json.d.push(a), V = g.getProperties(v);
for (R in V)
if (/^_/.test(R)) {
if (Z = v[R], !("_width" !== R && "_height" !== R || Z != F && -1 !== Z)) {
var x;
((v.s("layout.h") || v.s("layout.v")) && v.getHost() || v instanceof O.Node && (x = v.getParent()) && x instanceof O.Block || v.s("fullscreen")) && (Z = v[R] = "_width" === R ? v.getWidth() : v.getHeight())
}
Z !== j[R] && g[No](R.substr(1), Z, a.p)
} else q = kp(R), v[q] && (Z = v[q](), Z !== j[q]() && g[No](R, Z, a.p));
V = g.getStyles(v);
for (R in V) Z = v.s(R), Z !== j.s(R) && g[No](R, Z, a.s);
V = g.getAttrs(v);
for (R in V) Z = v.a(R), Z !== j.a(R) && g[No](R, Z, a.a);
wd(a.p) && delete a.p, wd(a.s) && delete a.s, wd(a.a) && delete a.a
}
g._hierarchical && v.getChildren().each(g.serializeData, g)
}, serializeValue: function (q, h, V) {
Xo(h) ? h = {
__a: h._as
} : h instanceof Qp && (h = {
__i: h.getId()
}), V[q] = h
}, deserialize: function (X, N, e) {
var v = this;
return dk(X) && /.json$/.test(X) ? (u.xhrLoad(X, function (i) {
v.deserializeImpl(i, N, e)
}), void 0) : v.deserializeImpl(X, N, e)
}, deserializeImpl: function (m, v, q) {
var d = this,
a = d.dm;
a.setDeserializing(!0), q = El(q) ? {
setId: q
} : Mf(q) ? {
finishFunc: q
} : q || {}, m = d.json = dk(m) ? u.parse(m) : m, !q.justDatas && m.a && m.a.onPreDeserialize && !q.disableOnPreDeserialize && m.a.onPreDeserialize(m, a, q.view), a.beginTransaction(), aj++, d._82I = {};
var M = new xr,
Q = new xr,
G = 0,
Y = m.d.length;
if (q.justDatas || (!q.disableInit && Mf(m.init) && m.init(a), a.setInit(m.init)), !q.justDatas) {
for (var s in m.a) a.a(s, d[Ij](m.a[s]));
for (var j in m.p) a[tg(j)](m.p[j])
}
for (; Y > G; G++) {
var t = m.d[G],
z = gp(t.c),
O = new z,
U = t.i;
q.setId && U != F && (O._id = U), d._82I[U] = O, M.add(O), Q.add(t)
}
for (G = 0; Y > G; G++) d.deserializeData(M.get(G), Q.get(G));
return M.each(function (L) {
v && !L.getParent() && L.setParent(v), a.add(L)
}), q.__innerHandler__ && q.__innerHandler__(m, a, q.view, M), a.fireSerializeEvent({
type: "deserialize",
json: m
}), aj--, a.endTransaction(), !q.justDatas && m.a && m.a.onPostDeserialize && !q.disableOnPostDeserialize && m.a.onPostDeserialize(m, a, q.view, M), q.finishFunc && q.finishFunc(m, a, q.view, M), a.setDeserializing(!1), M
}, deserializeData: function (y, r) {
for (var Z in r.p) y[tg(Z)](this[Ij](r.p[Z]));
for (Z in r.s) y.s(Z, this[Ij](r.s[Z]));
for (Z in r.a) y.a(Z, this[Ij](r.a[Z]))
}, deserializeValue: function (w) {
if (xl(w)) {
var z = w.__i;
if (z != F) return this._82I[z];
if (z = w.__a, ip(z)) return new xr(z)
}
return w
}
}), Uh(jn, {
serialize: function (A, E) {
return new dl(this, E).serialize(A)
}, toJSON: function (c) {
return new dl(this, c).toJSON()
}, deserialize: function (K, x, U) {
return new dl(this).deserialize(K, x, U)
}
});
var Rn = O.OverlappingBox = function (U) {
this.gv = U, this.boxes = {}
};
ki("OverlappingBox", o, {
clear: function () {
var T, G, f = this.boxes;
for (T in f) G = f[T], G.length = 0
}, isOverlapping: function (C, y) {
var Y, o, X = this,
k = X.boxes,
B = k[C];
B ? (Y = B.rects, o = B.length) : B = k[C] = {
rects: Y = [],
length: o = 0
};
var d, S, y;
for (d = 0; o > d; d++)
if (S = Y[d], S.x < y.x + y.w && S.x + S.w > y.x && S.y < y.y + y.h && S.h + S.y > y.y) return !0;
return Y.length <= o ? (Y.push(y), B.length++) : Y[B.length++] = y, !1
}
}), Uh(u, {
fetch: function (T, t) {
var F = "GET",
r = !1,
_ = null,
O = "";
t && (F = t.method || "GET", r = t.sync, O = t.url, _ = t.data || null), T.open(F, O, !r), t.responseType ? T.responseType = t.responseType : t.overrideMimeType && T.overrideMimeType && T.overrideMimeType(t.overrideMimeType), T.send(_)
}, convertImageSrc: function (U, Z) {
Z && "function" == typeof Z || (Z = function () { }), Z(U)
}
});
var De = O.Request = function () {
this._xhr = new XMLHttpRequest, this._onloadFunc = function () { }, this._errorFunc = function () { }
};
ki("Request", o, {
_responseType: null,
_overrideMimeType: "text/plain",
send: function (e) {
var O = this._xhr,
j = this.onload,
J = this.onerror;
this.getResponseType() ? e.responseType = this.getResponseType() : this.getOverrideMimeType() && (e.overrideMimeType = this.getOverrideMimeType()), O.onload = j, O.onerror = J, u.fetch(O, e)
}, onload: function () { }, onerror: function () { }, getResponseType: function () {
return this._responseType
}, setResponseType: function (v) {
this._responseType = v
}, getOverrideMimeType: function () {
return this._overrideMimeType
}, setOverrideMimeType: function (N) {
this._overrideMimeType = N
}, getResponseText: function () {
var z = this._xhr;
return z.response || z.responseText
}
}), hg.GraphView = function (c) {
var W = this;
W._24I = {}, W._34I = new xr, W._25I = {}, W._56I = {}, W._view = ve(1, W), W._canvas = uo(W._view), W.dm(c ? c : new jn), this._coreInteractor = new mq(this), W.setEditable(!1), W.setScrollBarVisible(u.graphViewScrollBarVisible), W._initView()
}, Bb("GraphView", o, {
ms_v: 1,
ms_gv: 1,
ms_bnb: 1,
ms_tip: 1,
ms_dm: 1,
ms_lp: 1,
ms_fire: 1,
ms_sm: 1,
_49o: 1,
ms_txy: 1,
_52o: 1,
_51o: 1,
ms_ac: [df, gd, Pi, Ji, "resettable", "editInteractor", Fi, "zoomable", "pannable", "rectSelectable", "autoScrollZone", dj, "movableFunc", "editableFunc", "pointEditableFunc", "rectEditableFunc", "rotationEditableFunc", "anchorEditableFunc", "rectSelectBackground", "rectSelectBorderColor", "editPointSize", "editPointBorderColor", "editPointBackground", "hoverDelay"],
_zoomable: u.graphViewZoomable,
_resettable: u.graphViewResettable,
_pannable: u.graphViewPannable,
_rectSelectable: u.graphViewRectSelectable,
_autoScrollZone: u.graphViewAutoScrollZone,
_rectSelectBackground: u.graphViewRectSelectBackground,
_rectSelectBorderColor: u.graphViewRectSelectBorderColor,
_editPointSize: u.graphViewEditPointSize,
_editPointBorderColor: u.graphViewEditPointBorderColor,
_editPointBackground: u.graphViewEditPointBackground,
_scrollBarColor: Ch,
_scrollBarSize: di,
_autoHideScrollBar: jr,
_autoMakeVisible: be,
_currentActionType: null,
getCoreInteractor: function () {
return this._coreInteractor
}, getLayers: function () {
return this._dataModel.getLayers()
}, setLayers: function (d) {
this._dataModel.setLayers(d)
}, setEditable: function (Y) {
var W = this,
J = W.__interactorMap__;
if (!J) {
var $ = hg.XEditInteractor;
J = W.__interactorMap__ = {
scrollBar: new Vl(W),
select: new ng(W),
edit: $ ? new $(W) : new vm(W),
text: new eb(W),
move: new Wr(W),
"default": new pk(W),
touch: new Jb(W, {
editable: !1
})
}
}
Y ? (W._uieditable = !0, W.setInteractors([J.scrollBar, J.select, J.edit, J.text, J.move, J.default, J.touch])) : (W._uieditable = !1, W.setInteractors([J.scrollBar, J.select, J.move, J.default, J.touch]))
}, getCanvas: function () {
return this._canvas
}, _33I: function (e) {
var I = e.getUIClass();
return I ? new I(this, e) : F
}, getDataUI: function (m) {
var H = this,
M = H._25I[m._id];
return M === Z && (M = H._33I(m), H._25I[m._id] = M), M
}, getNodeRect: function (m) {
return u.getNodeRect(this, m)
}, getFullscreenDatas: function () {
return this._dataModel.getFullscreenDatas()
}, getEdgeInfo: function (j) {
var J = this.getDataUI(j);
return J ? (J._79o(), J._78o) : null
}, getEdgeSourcePosition: function (l) {
var F = this,
k = F.getDataUI(l),
i = k.s,
r = k._data._40I;
return Yg(F, r, i("edge.source.position"), i("edge.source.offset.x"), i("edge.source.offset.y"), i("edge.source.anchor.x"), i("edge.source.anchor.y"))
}, getEdgeTargetPosition: function (Z) {
var m = this,
R = m.getDataUI(Z),
h = R.s,
V = R._data._41I;
return Yg(m, V, h("edge.target.position"), h("edge.target.offset.x"), h("edge.target.offset.y"), h("edge.target.anchor.x"), h("edge.target.anchor.y"))
}, invalidateAll: function (l) {
var G = this;
if (l) {
for (var e in G._25I) {
var t = G._25I[e];
t && t.dispose()
}
G._25I = {}, G._56I = {}, G._24I = {}, G._34I.clear(), G.redraw()
} else G.dm().each(function (y) {
G.invalidateData(y)
})
}, invalidateSelection: function () {
var k = this;
k.sm().each(function (S) {
k.invalidateData(S)
})
}, invalidateData: function ($) {
var O = this;
O._24I[$._id] = $, O._21Q($), O.iv()
}, _21Q: function (G) {
var o = this,
v = o._24I;
if (Bk(G) && Dc[G.s(ej)]) {
var M = G.getSourceAgent();
M && M.getAgentEdges().each(function (V) {
v[V._id] = V
}), M = G.getTargetAgent(), M && M.getAgentEdges().each(function (f) {
v[f._id] = f
}), o.iv()
}
}, redraw: function (s) {
var d = this;
d._32I || (s ? d._34I.add(s) : (d._32I = 1, d._34I.clear()), d.iv())
}, each: function (T, w) {
var X, $, E, f = 0,
A = this.getLayers(),
Z = this._dataModel,
P = Z._datas._as,
q = P.length;
if (A) {
for (var F = A.length; F > f; f++)
if (E = A[f], xl(E) && (E = E.name), Z.isHierarchicalRendering()) {
var D = function (b) {
return b._layer === E ? w ? T.call(w, b) : T(b) : void 0
};
if (this._dataModel.eachByHierarchical(D) === !1) return
} else
for (var b = 0; q > b; b++)
if (X = P[b], X._layer === E && ($ = w ? T.call(w, X) : T(X), $ === !1)) return
} else if (Z.isHierarchicalRendering()) this._dataModel.eachByHierarchical(T, null, w);
else
for (; q > f; f++)
if (X = P[f], $ = w ? T.call(w, X) : T(X), $ === !1) return
}, reverseEach: function (L, O) {
var M, P, e, b, t = this._dataModel,
a = t._layers,
V = t._datas._as,
v = V.length;
if (a) {
for (M = a.length - 1; M >= 0; M--)
if (b = a[M], xl(b) && (b = b.name), t.isHierarchicalRendering()) {
var o = function (I) {
return I._layer === b ? O ? L.call(O, I) : L(I) : void 0
};
if (t.reverseEachByHierarchical(o) === !1) return
} else
for (var i = v - 1; i >= 0; i--)
if (P = V[i], P._layer === b && (e = O ? L.call(O, P) : L(P), e === !1)) return
} else if (t.isHierarchicalRendering()) t.reverseEachByHierarchical(L, null, O);
else
for (M = v - 1; M >= 0; M--)
if (P = V[M], e = O ? L.call(O, P) : L(P), e === !1) return
}, getViewRect: function () {
return this._29I
}, getContentRect: function () {
var $ = this,
e = $._84I;
if (!e) {
var i = this.dm().a("width"),
p = this.dm().a("height");
i > 0 && p > 0 ? $._84I = {
x: 0,
y: 0,
width: i,
height: p
} : ($.each(function (u) {
$.isVisible(u) && (e = ni(e, $.getDataUIBounds(u)))
}), $._84I = e ? e : nl)
}
return $._84I
}, getScrollRect: function () {
return ni(this.getContentRect(), this._29I)
}, makeCenter: function (m, V, G) {
var h = this;
if (!h.getWidth() || !h.getHeight()) return G || $e(h.makeCenter, h, [m, V, !0], 500), void 0;
h.makeVisible(m), h.validate();
var x = h.getDataUIBounds(m);
if (x) {
var s = h.getWidth(),
Q = h.getHeight(),
S = x.x + x.width / 2,
$ = x.y + x.height / 2,
M = -S * h._zoom + s / 2,
W = -$ * h._zoom + Q / 2;
h.setTranslate(M, W, V)
}
}, fitData: function (I, D, R, r, S) {
var P = this;
if (!P.getWidth() || !P.getHeight()) return S || $e(P.fitData, P, [I, D, R, r, !0], 500), void 0;
var N = function () {
P.makeVisible(I), P.validate();
var x = P.getDataUIBounds(I);
x && (x = Pm(x), vn(x, R == F ? 20 : R), P.fitRect(x, D, r))
};
D ? u.callWhenLoaded(N) : N()
}, fitContent: function (A, G, Q, m) {
var B = this;
if (!B.getWidth() || !B.getHeight()) return m || $e(B.fitContent, B, [A, G, Q, !0], 500), void 0;
var R = function () {
B.validate();
var I = Pm(B.getContentRect());
vn(I, G == F ? 20 : G), B.fitRect(I, A, Q)
};
A ? u.callWhenLoaded(R) : R()
}, fitRect: function (i, A, m) {
var l = this,
C = l.getWidth(),
G = l.getHeight(),
w = i.x + i.width / 2,
U = i.y + i.height / 2,
q = V(C / i.width, G / i.height),
_ = l._zoom,
H = -w * _ + C / 2,
d = -U * _ + G / 2;
0 === q || isNaN(q) || (m && (q = V(1, q)), A ? (l._65I && (delete l._65I.finishFunc, l._65I.stop(!0)), l._14o && l._14o.stop(!0), l.setTranslate(H, d, {
finishFunc: function () {
l.setZoom(q, A)
}
})) : (l.setTranslate(H, d), l.setZoom(q)))
}, fitSelection: function (N, C, q) {
var R = this,
u = R.sm(),
z = null;
u.size() && (u.each(function (G) {
z = ni(R.getDataUIBounds(G), z)
}), N && vn(z, N), R.fitRect(z, C, q))
}, toCanvas: function (d, H, P) {
H = H || this._zoom, this.validateImpl();
var p = this,
R = p.getContentRect();
P && vn(R, P), R.width || (R.width = 10), R.height || (R.height = 10);
var G = uo(),
i = R.x * H,
$ = R.y * H,
n = Math.ceil(R.width * H),
K = Math.ceil(R.height * H);
Bn(G, n, K, 1);
var C = Wd(G);
return d = d || this._dataModel.getBackground(), d && fl(C, 0, 0, n, K, d), wh(C, -i, -$), C.scale(H, H), p._42(C), C.restore(), G
}, toDataURL: function (O, G, a, v) {
return this.toCanvas(O, a, v).toDataURL(G || "image/png", 1)
}, getClipBounds: function () {
return this._74O
}, _42: function (S, z) {
var H = this,
V = H.dm().getBackground();
if (V) {
var $ = H.dm().a("width"),
N = H.dm().a("height");
$ > 0 && N > 0 && fl(S, 0, 0, $, N, V)
}
var R = H.__htmlOrderList,
r = [],
K = H._forcedLayoutHTML;
if (H._93db(S, z), H.each(function (A) {
var N = H.getDataUI(A);
if (N) {
var Y = H._56I[A._id],
t = N._htmlView;
if (Y) {
var L = N._79o();
if (t = N._htmlView, O.HtmlNode && A instanceof O.HtmlNode) N._42(S);
else {
var c = H.getViewRect(),
T = t && t.layoutHTML;
!z || Kj(z, L) ? (T && (t.layoutHTML(), N.__outerLayout && delete N.__outerLayout), N._42(S)) : Kj(c, L) || !T || N.__outerLayout && !K || (t.layoutHTML(), N.__outerLayout = !0)
}
}
t && (r.push(t), t.getView && (t = t.getView()), t.style.display = Y ? "block" : Jc)
}
}), R && r.length > 0) {
var P = !1;
if (R.length !== r.length) P = !0;
else
for (var I = 0; I < r.length; I++)
if (r[I] !== R[I]) {
P = !0;
break
}
P && (r.forEach(function (L) {
L.autoAdjustIndex !== !1 && H.appendHTML(L, !0)
}), this.__htmlOrderList = r)
} else this.__htmlOrderList = r;
H._92db(S, z)
}, validateImpl: function () {
this.tryUpdateRootData();
var H, D, S, v, X, Q = this,
F = Q.tx(),
z = Q.ty(),
R = Q._zoom,
f = Q._canvas,
i = this.getWidth(),
y = this.getHeight(),
h = Q._29I,
C = {
x: -F / R,
y: -z / R,
width: i / R,
height: y / R
},
d = {},
Y = Q._34I,
W = Q._24I,
l = Q._32I,
Z = Q._23I;
Q._24I = {}, (i !== f.clientWidth || y !== f.clientHeight) && (Bn(f, i, y), l = 1, Q._forcedLayoutHTML = 1), l || jg(C, h) || (l = 1, Q._forcedLayoutHTML = 1), Q._29I = C, Q.each(function (l) {
D = l._id;
var n = d[D] = Q.isVisible(l);
n !== Q._56I[D] && (W[D] = l, S = Q.getDataUI(W[D]), S && S._84o(n), Q._84o(l, n))
}, Q);
for (D in W) S = Q.getDataUI(W[D]), S && (!l && Q._56I[D] && (X = S._79o(), X && Y.add(X)), S.invalidate()), Q._83I = 1;
if (Q._56I = d, !l)
for (D in W) d[D] && (S = Q.getDataUI(W[D]), S && (X = S._79o(), X && Y.add(X)));
if (l ? v = C : (Y.each(function (D) {
Kj(C, D) && (v = ni(v, D))
}), v && (vn(v, q(1, 1 / R)), v.x = T(v.x * R) / R, v.y = T(v.y * R) / R, v.width = s(v.width * R) / R, v.height = s(v.height * R) / R, v = ro(C, v))), Q._74O = v, v) {
H = Wd(f);
var I = v.x,
k = v.y,
P = v.width,
U = v.height;
I = Math.floor((I * R + F) * ij), k = Math.floor((k * R + z) * ij), P = Math.ceil(P * R * ij) + 1, U = Math.ceil(U * R * ij) + 1, l || (v.x = (I / ij - F) / R, v.y = (k / ij - z) / R, v.width = P / ij / R, v.height = U / ij / R), H.beginPath(), H.rect(I, k, P, U), H.clip(), H.clearRect(I, k, P, U), tf(H, F, z, R), Q._42(H, v), H.restore(), delete Q._74O
}
if (Y.clear(), delete Q._32I, delete Q._forcedLayoutHTML, Z && i > 0 && y > 0) {
var S = Q.getDataUI(Z);
if (S) {
var X = S._79o(),
p = Q._29I,
J = p.x,
O = p.y,
K = p.width,
E = p.height,
R = Q._zoom;
X && !Kj(X, p) && (X.x + X.width < J && Q.tx(-X.x * R), X.x > J + K && Q.tx(-(X.x + X.width - K) * R), X.y + X.height < O && Q.ty(-X.y * R), X.y > O + E && Q.ty(-(X.y + X.height - E) * R))
}
delete Q._23I
}
Q._83I && (delete Q._83I, delete Q._84I), Q._98O(), Q.countFrame(), wd(Q._24I) || $e(Q.iv, Q)
}, isValidGuideLineSource: function () {
return !0
}, tryUpdateRootData: function () {
if (!this._rootDataUpdating) {
this._rootDataUpdating = !0;
var z, x = this.getFullscreenDatas();
for (var s in x) z = x[s], this.scaleRootData(z);
this._rootDataUpdating = !1
}
}, scaleRootData: function (_) {
var E = _.s("fullscreen");
if ("uniform" === E || "fill" === E) {
_.getRotation() && _.setRotation(0);
var v = _.s("fullscreen.gap") || 0,
f = this.getWidth(),
X = this.getHeight();
if (f && X) {
var a, A, L, r = f - 2 * v,
x = X - 2 * v,
z = _.getAnchor(),
u = _.getScaledSize(),
Y = u.width,
O = u.height,
J = _.s("fullscreen.lock");
if (J) return "uniform" === E ? r / x > Y / O ? (a = x / O, Y = O * r / x) : (a = r / Y, O = Y * x / r) : "v" === J ? (a = x / O, Y = r / a, _.getWidth() !== Y && _.setWidth(Y)) : (a = r / Y, O = x / a, _.getHeight() !== O && _.setHeight(O)), this.setZoom(a), A = v - (_.getX() - z.x * Y) * a, L = v - (_.getY() - z.y * O) * a, A !== this.tx() && this.tx(A), L !== this.ty() && this.ty(L), void 0;
A = this.tx(), L = this.ty(), a = this._zoom;
var P = {
x: (-A + v) / a,
y: (-L + v) / a,
width: r / a,
height: x / a
};
if ("uniform" === E) {
var w = Y / O,
j = Math.min(P.width, P.height * w),
k = j / w;
P.x += .5 * (P.width - j), P.y += .5 * (P.height - k), P.width = j, P.height = k
}
r = P.width / _.getScaleX(), x = P.height / _.getScaleY(), (_.getWidth() != r || _.getHeight() !== x) && _.setSize(r, x);
var l = P.x + z.x * P.width,
n = P.y + z.y * P.height,
H = _.getPosition();
(l !== H.x || n !== H.y) && _.setPosition(l, n)
}
}
}, isScrollBarVisible: function () {
return !!this._79O
}, setScrollBarVisible: function (w) {
var m = this;
w !== m.isScrollBarVisible() && (w ? (sn(m._view, m._79O = dd()), sn(m._79O, m._27I = dd()), sn(m._79O, m._28I = dd())) : (yj(m._79O), delete m._79O, delete m._27I, delete m._28I), m.fp("scrollBarVisible", !w, w))
}, getDebugTip: function () {
return ""
}, showScrollBar: function () {
var c = this;
c._79O && (c._85I || (cd(function () {
c._86I()
}, Lg), c.iv()), c._85I = new Date)
}, _86I: function () {
var i = this;
if (i._85I) {
var C = new Date,
d = C.getTime();
d - i._85I.getTime() >= Lg ? (delete i._85I, i.iv()) : cd(function () {
i._86I()
}, Lg)
}
}, getVScrollBar: function () {
return this._27I
}, getHScrollBar: function () {
return this._28I
}, _98O: function () {
var K = this,
N = this._27I,
B = this._28I;
if (K._79O) {
if (K._autoHideScrollBar && !K._85I) return N.style.visibility = fc, B.style.visibility = fc, void 0;
var D = K.getScrollBarColor(),
Y = K._zoom,
M = K.getScrollBarSize(),
u = K.getViewRect(),
I = K.getScrollRect(),
Z = u.height * Y,
h = I.height * Y,
T = u.width * Y - M - 2,
F = Z * ((u.y - I.y) * Y / h),
J = Z * (Z / h),
R = N.style;
h - .5 > Z ? (un > J && (F = F + J / 2 - un / 2, 0 > F && (F = 0), F + un > Z && (F = Z - un), J = un), qp(N, T, F, M, J), R.visibility = Pd, R.background = D, R.borderRadius = M / 2 + oe) : R.visibility = fc;
var A = u.width * Y,
o = I.width * Y,
F = u.height * Y - M - 2,
T = A * ((u.x - I.x) * Y / o),
z = A * (A / o),
R = B.style;
o - .5 > A ? (un > z && (T = T + z / 2 - un / 2, 0 > T && (T = 0), T + un > A && (T = A - un), z = un), qp(B, T, F, z, M), R.visibility = Pd, R.background = D, R.borderRadius = M / 2 + oe) : R.visibility = fc
}
}, setDataModel: function (H) {
var d = this,
g = d._dataModel,
f = d._selectionModel;
g !== H && (g && (g.ump(d.handleDataModelPropertyChange, d), g.umm(d.handleDataModelChange, d), g.umd(d.handleDataPropertyChange, d), g.removeIndexChangeListener(d._75O, d), g.removeHierarchyChangeListener(d.handleHierarchyChange, d), f || g.sm().ums(d.handleSelectionChange, d)), d._dataModel = H, H.mp(d.handleDataModelPropertyChange, d), H.mm(d.handleDataModelChange, d), H.md(d.handleDataPropertyChange, d), H.addIndexChangeListener(d._75O, d), H.addHierarchyChangeListener(d.handleHierarchyChange, d), f ? f._21I(H) : H.sm().ms(d.handleSelectionChange, d), d.invalidateAll(!0), d.fp(uk, g, H), d.updateBackground())
}, getLayersInfo: function () {
if (this._layersInfo === Z) {
var B = this.getLayers();
B ? (this._layersInfo = {}, B.forEach(function (l) {
var D = xl(l) ? l.name : l;
this._layersInfo[D] = l
}, this)) : this._layersInfo = null
}
return this._layersInfo
}, calculateEdgePosition: function (J, V, Z) {
var p, G, C = this,
e = C.getDataUI(J),
k = qm(e),
W = Tn(V, function (f) {
return np(k, 100 * f)
}, 100, .001),
F = np(k, 100 * W);
if (!Z) {
var L = Kk(e),
g = new Xi(F.x, F.y),
D = 49 / (C._zoom * C._zoom);
for (p = 0, G = L.length; G > p; p++)
if (g.distanceToSquared(L[p]) < D) return {
index: p,
point: L[p],
distance: Math.sqrt((L[p].x - V.x) * (L[p].x - V.x) + (L[p].y - V.y) * (L[p].y - V.y))
}
}
return {
percent: W,
point: F,
distance: Math.sqrt((F.x - V.x) * (F.x - V.x) + (F.y - V.y) * (F.y - V.y))
}
}, calculateAttachPoint: function () {
var R = new Xi,
D = new Xi,
B = new Xi;
return function (z, V) {
var u = this.getAttachPoints(z);
if (!u || !u.length) return null;
B.set(V.x, V.y);
for (var W, E, H, s, O, h = 1 / 0, A = 0, $ = u.length; $ > A; A++) H = u[A], D.x = H.x, D.y = H.y, R.x = H.offsetX || 0, R.y = H.offsetY || 0, s = Yg(this, z, 0, R.x, R.y, D.x, D.y), E = B.distanceToSquared(s), h > E && (W = A, h = E, O = s);
h = Math.sqrt(h);
var l = this.getAttachStyle(z);
if ("close" === l) {
var m = z.s("attach.close.threshold") / this._zoom;
if (h > m) return null
}
return {
index: W,
distance: h,
info: u[W],
point: O
}
}
}(),
getAttachPoints: function (J) {
var d = J.s("attach.points");
if (d) return d;
var b = ii(J._image);
return b ? Dj(b.attachPoints, J, this) || null : void 0
}, getAttachStyle: function (w) {
var u = w.s("attach.style");
if (u) return u;
var f = ii(w._image);
return f ? Dj(f.attachStyle, w, this) || "close" : void 0
}, updateLayers: function () {
this._layersInfo = Z, this.invalidateSelection(), this.redraw()
}, updateBackground: function () {
var g = this.dm().a("width"),
V = this.dm().a("height");
this._canvas.style.background = g > 0 && V > 0 ? "" : this.dm().getBackground() || ""
}, handleDataModelPropertyChange: function (n) {
if ("background" === n.property) {
var i = this._canvas.style.background,
e = n.newValue || "";
this.updateBackground(), this.fp("canvasBackground", i, e), this.redraw()
} else "a:width" === n.property || "a:height" === n.property ? (this._83I = 1, this.updateBackground(), this.redraw()) : "layers" === n.property ? this.updateLayers() : "hierarchicalRendering" === n.property && this.redraw()
}, handleDataPropertyChange: function (P) {
this.dm().isHierarchicalRendering() && "parent" === P.property && P.data.hasChildren() && this.redraw(), this.invalidateData(P.data)
}, onPropertyChanged: function (M) {
var L = this,
n = M.property;
if (L.redraw(), "zoom" === n) {
var Y = L.sm().getSelection();
Y.size() && Y.each(function (N) {
N.invalidate()
})
} else "dataModel" === n && (L._83I = 1);
Jd[n] ? L.showScrollBar() : n === Fi && L.onCurrentSubGraphChanged(M)
}, onCurrentSubGraphChanged: function () {
this.sm().cs(), this.reset()
}, handleDataModelChange: function (O) {
var T = this,
R = O.kind,
A = O.data;
if (T._83I = 1, "add" === R) T.invalidateData(A), Bk(A) && A.getEdgeGroup() && A.getEdgeGroup().eachSiblingEdge(T.invalidateData, T);
else if (R === Ce) {
T._21Q(A);
var g = A._id,
n = T._25I[g];
if (n) {
if (T._56I[g]) {
var v = n._79o();
v && T.redraw(v)
}
n.dispose(), delete T._25I[g], delete T._24I[g], delete T._56I[g]
}
A === T._currentSubGraph && T.setCurrentSubGraph(F)
} else R === Tg && (T.invalidateAll(!0), T.setCurrentSubGraph(F))
}, _75O: function (n) {
this.invalidateData(n.data)
}, handleHierarchyChange: function (A) {
this.dm().isHierarchicalRendering() && A.data.hasChildren() && this.redraw(), this.invalidateData(A.data)
}, adjustIndex: function (P) {
var $ = this;
if ($.isVisible(P)) {
$.dm().beginTransaction();
for (var J = P; J._parent && $.isVisible(J._parent);) J = J._parent;
J && J !== P && $._dataModel.adjustIndex(J), $._dataModel.adjustIndex(P), $.dm().endTransaction()
}
}, getImage: function (r) {
return r.getImage ? r.getImage() : Z
}, getSelectWidth: function (Z) {
var j = ii(this.getImage(Z));
return j && Dj(j.disableSelectedBorder, Z, this) ? 0 : Z.s("select.width")
}, getSelectColor: function (t) {
return t.s("select.color")
}, isSelectable: function (o, d) {
if (this.isSelected(o)) return !0;
if (!d && o.getParent() instanceof Br && this.isSelectable(o.getParent(), !0) && o.getParent().isSyncSize()) return !1;
var y = this.getLayersInfo();
if (y) {
var L = y[o._layer];
if (L && L.selectable === !1) return !1
}
return o.s("2d.selectable") && this.sm().isSelectable(o)
}, isMovable: function (b) {
var O = this;
if (Bk(b) && b.getStyle(ej) !== _b) return !1;
var p = this.getLayersInfo();
if (p) {
var w = p[b._layer];
if (w && w.movable === !1) return !1
}
return b.s("2d.movable") ? O._movableFunc ? O._movableFunc(b) : !0 : !1
}, isEditable: function (A) {
var H = this;
if (O._uiSerializing) return H._uieditable;
if (!H._editInteractor || !H.isSelected(A)) return !1;
if (yl(A)) {
var W = H.getDataUI(A);
if (!W || W._88I) return !1
}
if (Bk(A) && A.getStyle(ej) !== _b) return !1;
var t = this.getLayersInfo();
if (t) {
var w = t[A._layer];
if (w && w.editable === !1) return !1
}
return A.s("2d.editable") ? H._editableFunc ? H._editableFunc(A) : !0 : !1
}, handleDelete: function () {
this._editInteractor && (this._editInteractor.handleDelete ? this._editInteractor.handleDelete() : this.removeSelection())
}, isPointEditable: function (x) {
return Fq(x) && 0 !== x.getRotation() ? !1 : this._pointEditableFunc ? this._pointEditableFunc(x) : !0
}, isRectEditable: function (I) {
return this._rectEditableFunc ? this._rectEditableFunc(I) : !0
}, isAnchorEditable: function (g) {
return this._anchorEditableFunc ? this._anchorEditableFunc(g) : !0
}, isRotationEditable: function (s) {
return s.setRotation && s.IRotatable !== !1 ? this._rotationEditableFunc ? this._rotationEditableFunc(s) : !0 : !1
}, isSourceTargetEditable: function () {
return !0
}, getRotationPoint: function (c) {
var Y = c.getAnchor(),
K = c.getScale(),
w = this._zoom,
M = Go(c.getRotation(), 0, -c.getHeight() * K.y * Y.y - (K.y < 0 ? -1 : 1) * (nf ? 32 : 16) / w),
m = c.p();
return M.x += m.x, M.y += m.y, M
}, getLogicalPoint: function (P) {
var y = this;
return Nm(P, y._canvas, y.tx(), y.ty(), y._zoom, y._zoom)
}, getScreenPoint: function (_, C) {
var i, s = this;
return "object" == typeof _ ? _.x !== Z ? (i = _.x, C = _.y) : (i = _[0], C = _[1]) : i = _, Qo(i, C, s._canvas, s.tx(), s.ty(), s._zoom, s._zoom)
}, getSelectedDataAt: function (T) {
var A = this;
return this.getDataAt(T, function (w) {
return A.isSelected(w)
})
}, getDataInfoAt: function (c, o, J) {
var u, b = this.lp(c),
a = this.getDataAt(b, o, J);
if (a) {
var Y = this.getDataUI(a);
u = {
data: a,
ui: Y,
point: b
};
var e = Y._38o;
if (e) {
var W = e.icons;
for (var T in W) {
var f = W[T],
x = e.rects[T];
if (x)
for (var P = Dj(f.names, a, this), p = P ? P.length : 0, i = x.rotation, O = p - 1; O >= 0; O--) {
var z = P[O],
B = x[O];
if (cf(B, b, i)) return u.part = "icons", u.name = T, u.icon = z, u.rect = B, u.index = O, u.rotation = i, u
}
}
}
if (this.isNoteVisible(a)) {
if (Y.note2Info && cf(Y.note2Info.clickRect, b, F, Y.note2Info.scale)) return u.part = "note2", u;
if (Y.noteInfo && cf(Y.noteInfo.clickRect, b, F, Y.noteInfo.scale)) return u.part = "note", u
}
if (this.isLabelVisible(a)) {
if (Y.label2Info && cf(Y.label2Info.rect, b, Y.label2Info.rotation, Y.label2Info.scale)) return u.part = "label2", u;
if (Y.labelInfo && cf(Y.labelInfo.rect, b, Y.labelInfo.rotation, Y.labelInfo.scale)) return u.part = "label", u
}
if (a.isInRect && a.isInRect(b)) return u.part = "body", u
}
return u
}, getDataAt: function (h, o, M) {
h.target && (h = this.lp(h));
var k, E = this._zoom;
return this.reverseEach(function (z) {
return (o ? o(z) : this.isSelectable(z)) && this.rectIntersects(z, Cc(h.x, h.y, M, E)) ? (k = z, !1) : void 0
}, this), k
}, getIconInfoAt: function (q, j) {
var C = this;
if (q.target && (q = C.lp(q)), j || (j = C.getDataAt(q)), j) {
var h = C.getDataUI(j);
if (h && h._38o) {
var G, V = h._38o,
x = new xr;
for (G in V.icons) x.add(G);
for (var K = x.size() - 1; K >= 0; K--) {
G = x.get(K);
for (var d = V.rects[G], M = d.rotation, t = d.length - 1; t >= 0; t--) {
var b = d[t],
P = b.width,
Z = b.height,
e = {
x: q.x - b.x - P / 2,
y: q.y - b.y - Z / 2
};
M != F && (e = Go(-M, e.x, e.y));
var b = {
x: -P / 2,
y: -Z / 2,
width: P,
height: Z
};
if (cf(b, e)) return {
key: G,
index: t,
name: V.icons[G].names[t],
rect: d[t],
point: q,
rotation: M,
relativeRect: b,
relativePoint: e,
data: j
}
}
}
}
}
return F
}, getDatasInRect: function (P, D, N) {
N === Z && (N = 1);
var h = this,
p = new xr;
return h.reverseEach(function ($) {
N && !h.isSelectable($) || (D ? h.rectIntersects($, P) : h.rectContains($, P)) && p.add($)
}), p
}, moveSelection: function (m, a) {
var u = this;
u.dm().beginTransaction(), qc(u.sm().toSelection(u.isMovable, u), m, a), u.dm().endTransaction()
}, moveDatas: function (h, G, p) {
var U = this;
U.dm().beginTransaction(), h instanceof xr || (h = new xr(h)), qc(h, G, p), U.dm().endTransaction()
}, getDataUIBounds: function (w) {
var U = this.getDataUI(w);
return U ? U._79o() : F
}, drawData: function (K, w, X) {
var u = this.getDataUI(w);
if (u) {
var s = u._79o();
(!X || Kj(X, s)) && (u._42(K), w instanceof O.Block && w.eachChild(function (N) {
this.isVisible(N) && this.drawData(K, N, X)
}, this))
}
}, getBoundsForGroup: function (n) {
return n.s(Dm) ? this.getDataUIBounds(n) : F
}, isPixelPerfect: function (o) {
return o.s("pixelPerfect")
}, rectIntersects: function (f, r) {
this.validate();
var P = F;
if (this._56I[f._id]) {
var Y = this._25I[f._id];
if (Y) {
var a = Y._79o();
if ($k(r, a)) P = !0;
else if ((r = ro(r, a)) && (Y.rectIntersects && (P = Y.rectIntersects(r)), P == F)) {
if (!this.isPixelPerfect(f)) return !0;
var D = r.x,
O = r.y,
T = r.width,
B = r.height,
U = this._zoom,
y = u.hitMaxArea,
c = T * B * U * U;
if (c > y) {
var i = Math.sqrt(y / c);
U *= i
}
T *= U, B *= U, 2 > T && (T = 2), 2 > B && (B = 2), D *= U, O *= U;
var R = Cr(T, B);
wh(R, -D, -O), R.scale(U, U), this._drawForChecking = !0, this.drawData(R, f, r), this._drawForChecking = !1;
try {
for (var Q = 0, W = R.getImageData(0, 0, T, B).data; Q < W.length; Q += 4)
if (0 !== W[Q + 3]) {
P = !0;
break
}
R.restore()
} catch ($) {
xm = F, P = !1
}
}
}
}
return P ? !0 : !1
}, rectContains: function (J, q) {
if (this._56I[J._id]) {
var N = this._25I[J._id];
if (N) return $k(q, N._79o())
}
return !1
}, reset: function () {
this.setZoom(1), this.setTranslate(0, 0)
}, handleKeyDown: function (Y) {
if (!u.isInput(Y.target)) {
var R = this,
J = R._focusData,
m = J && R._25I[J._id],
v = 0,
t = R._dataModel._datas;
if (!(J && J._enabled && J._editable && m && m.onKeyDown && m.onKeyDown(Y) === !0))
if (9 === Y.keyCode && (J && (v = t.indexOf(J), Pf(Y) ? -1 === --v && (v = 0) : ++v === t.size() && (v = 0)), R._focusData = J = t.get(v), R.sm().setSelection(J)), Dq(Y) ? R.selectAll() : Cf(Y) && R.isResettable() && R.reset(), R.sm().isEmpty()) {
if (R._editing) return;
var $ = R.tx(),
x = R.ty(),
r = !1,
C = Pf() ? 100 : 10;
Wk(Y) && ($ -= C, r = !0), Nk(Y) && (x -= C, r = !0), _i(Y) && ($ += C, r = !0), ri(Y) && (x += C, r = !0), r && R.setTranslate($, x)
} else {
qq(Y) && R.handleDelete(Y);
var d = Pf() ? 10 : 1;
Wk(Y) && (R.moveSelection(-d, 0), R.fi({
kind: "moveLeft"
})), Nk(Y) && (R.moveSelection(0, -d), R.fi({
kind: "moveUp"
})), _i(Y) && (R.moveSelection(d, 0), R.fi({
kind: "moveRight"
})), ri(Y) && (R.moveSelection(0, d), R.fi({
kind: "moveDown"
}))
}
}
}, handleScroll: function (A, Z) {
if (Qc(A), this.isZoomable()) {
if (!this.getEditInteractor()) {
var o = this.getDataAt(A);
if (o) {
var n = ii(this.getImage(o));
if (n && Dj(n.scrollable, o, this)) return
}
}
var L = this.lp(A);
Z > 0 ? this.scrollZoomIn(L) : 0 > Z && this.scrollZoomOut(L)
}
}, handlePinch: function (l, P, R) {
this.isZoomable() && (Math.abs(P - R) < u.pinchZoomThreshold || (P > R ? this.pinchZoomIn(l) : this.pinchZoomOut(l)))
}, checkDoubleClickOnNote: function (h, K) {
var N = this,
J = N.lp(h),
E = N.getDataUI(K),
o = E.note2Info;
return o && K.s("note2.toggleable") && cf(o.clickRect, J) ? (K.s(Mh, !K.s(Mh)), N.fi({
kind: "toggleNote2",
event: h,
data: K
}), !0) : (o = E.noteInfo, o && K.s("note.toggleable") && cf(o.clickRect, J) ? (K.s(ke, !K.s(ke)), N.fi({
kind: "toggleNote",
event: h,
data: K
}), !0) : !1)
}, _84o: function () { }, isNoteVisible: function () {
return this._zoom > .15
}, isLabelVisible: function () {
return this._zoom > .15
}, isEditVisible: function () {
return this._zoom > .15
}, autoScroll: function (T, r) {
var h = this,
m = h.getAutoScrollZone(),
g = m / h.getZoom(),
z = m / 4,
k = h._29I,
L = h.lp(T),
y = {
x: h.tx(),
y: h.ty()
};
return L && m > 0 && k && (L.x - k.x < g ? h.translate(z, 0) : k.x + k.width - L.x < g && h.translate(-z, 0), L.y - k.y < g ? h.translate(0, z) : k.y + k.height - L.y < g && h.translate(0, -z)), y.x = h.tx() - y.x, y.y = h.ty() - y.y, r && (r.x += y.x, r.y += y.y), y
}, getMoveMode: function (j, s) {
var L = s.s("2d.move.mode");
return L ? L : pl["88"] ? "x" : pl["89"] ? "y" : "xy"
}, getSerializableProperties: function () {
return {
scrollBarColor: 1,
scrollBarSize: 1,
autoMakeVisible: 1,
autoHideScrollBar: 1,
editable: 1,
resettable: 1,
pannable: 1,
rectSelectable: 1,
autoScrollZone: 1,
visibleFunc: 1,
movableFunc: 1,
editableFunc: 1,
pointEditableFunc: 1,
rectEditableFunc: 1,
anchorEditableFunc: 1,
rotationEditableFunc: 1,
rectSelectBackground: 1,
rectSelectBorderColor: 1,
editPointSize: 1,
editPointBorderColor: 1,
editPointBackground: 1,
hoverDelay: 1,
dataModel: 1,
selectionModel: 1,
currentSubGraph: 1,
zoom: 1,
translateX: 1,
translateY: 1
}
}, serializeProperty: function (s, _, k) {
var q = this;
return "currentSubGraph" === _ ? {
__i: s.getId()
} : k.serializeProperty(s, _, q)
}, deserializeProperty: function (a, c, e) {
var H = this;
if ("currentSubGraph" === c) {
var n = H.dm(),
t = n.__idMap;
return t[a.__i]
}
return e.deserializeProperty(a, c, H)
}, setDefaultCursor: function (Y, c) {
this._defaultCursor = Y, c !== !1 && this.setCursor(Y)
}, setCursor: function (V) {
"default" === V && (V = this._defaultCursor || V);
var r = this.getView().style;
r.cursor = V, r.cursor = "-webkit-" + V, r.cursor = "-moz-" + V
}, getCurrentConnectActionType: function () {
return this._currentActionType
}, setCurrentConnectActionType: function (R) {
return R === F || u.getConnectAction(null, R) ? (this._currentActionType = R, this.redraw(), !0) : !1
}, getEditStyle: function (z) {
var S = this.getEditInteractor();
return S ? S.getStyle(z) : Z
}, setEditStyle: function (Q, z, t) {
var c = this.getEditInteractor();
return c ? (c.setStyle(Q, z, t), !0) : !1
}, isConnectActionVisible: function (g) {
var A = u.getConnectAction(this);
if (!A) return !1;
var w = A.visible;
return Mf(w) && (w = w(this, g)), w
}, isInteractive: function (E) {
if (this._drawForChecking) return !1;
var U = ii(this.getImage(E));
return U && Dj(U.interactive, E, this) ? !0 : E.s("interactive")
}, appendHTML: function (u, r) {
var A = this.getView();
if (!(r || u && u.parentNode !== A)) return !1;
var K = u.getView && u.getView();
if (!r && K && K.parentNode === A) return !1;
(u.getView || u.isSelfViewEvent) && (u = u.getView());
var h = this.getEditInteractor();
return h && h._canvas ? A.insertBefore(u, h._canvas) : this.isScrollBarVisible() ? A.insertBefore(u, this.getView().lastChild) : sn(A, u), !0
}, _layoutHTMLImpl: function ($, O, w) {
if (arguments.length > 1) {
var D, A = this,
j = A._zoom;
if (O.getView && (D = O, O = O.getView()), O.style.position = "absolute", w) {
var Z = $.getRect();
qp(D || O, A.tx() + Z.x * j, A.ty() + Z.y * j, Z.width * j, Z.height * j)
} else {
var h = new Np,
Z = $.getAnchorRect(),
z = $.getPosition(),
f = $.getScale(),
G = O.style;
qp(D || O, Z), h.appendTranslate(A.tx(), A.ty()), h.appendScale(j, j), h.append(new Np($.getRotation(), z.x, z.y, f.x, f.y)), Jg(G, "transform", "matrix(" + h.a.toFixed(5) + ", " + h.b.toFixed(5) + ", " + h.c.toFixed(5) + ",\n " + h.d.toFixed(5) + ", " + h.tx.toFixed(5) + ", " + h.ty.toFixed(5) + ")"), Jg(G, "transformOrigin", (-Z.x).toFixed(5) + "px " + (-Z.y).toFixed(5) + "px"), O.updateAppendMatrix = !0
}
} else this._layoutHTML && this._layoutHTML()
}, getTextEditInfo: function (y) {
return y instanceof Lo ? {
name: "text",
accessType: "s",
isMultiline: !1
} : void 0
}, getState: function (j) {
var t = "state",
V = j.s(t);
if (V) return V;
var J = ii(j._image);
return J ? Dj(J[t], j, this) || null : void 0
}, getShape: function (E) {
return E.getStyle(bl)
}
}), o.defineProperties(hg.GraphView.prototype, {
layoutHTML: {
get: function () {
return this._layoutHTMLImplBind || (this._layoutHTMLImplBind = this._layoutHTMLImpl.bind(this)), this._layoutHTMLImplBind
}, set: function (a) {
this._layoutHTML = a
}
}
});
var Tp = function (B, H) {
var M = this;
M.gv = B, M.s = function (b) {
return H.getStyle(b)
}, M._data = H, M._87I = new xr
};
yc(Tp, o, {
_6I: F,
ms_icons: 1,
_84o: function () { }, dispose: function () { }, isShadowed: function () {
return this.s("shadow") || this.gv.isSelected(this._data) && "shadow" === this.s("select.type")
}, getSelectWidth: function () {
var _ = this,
h = _.gv.isSelected(_._data);
return !h || _.isShadowed() ? 0 : _.gv.getSelectWidth(_._data)
}, getSelectColor: function () {
return this.gv.getSelectColor(this._data)
}, getBodyColor: function (o) {
var X = this._data,
q = this.gv.getBodyColor(X);
return q ? q : o ? X.getStyle(o) : F
}, _2Q: function (o) {
return this.s(o)
}, _1Q: function (O, S, k, F) {
var Y = this.s,
A = Y("2d.gray"),
$ = Y(S + ".dash.color");
if (A && ($ = u.toGrayColor($)), O.strokeStyle = $, O.lineWidth = k, O.stroke(), Y(S + ".dash.3d")) {
var w = Y(S + ".dash.3d.color");
fr(O, $, A ? u.toGrayColor(w) : w, k, this.gv._zoom, Y(S + ".dash.3d.accuracy"))
}
_l(O, F)
}, invalidate: function () {
this._6I = F
}, _79o: function () {
var J = this;
if (!J._6I) {
var u = J._data,
p = J.gv;
J.labelInfo = J.label2Info = J.noteInfo = J.note2Info = J._38o = F, J._87I.clear(), J.interactiveInfo = p.isInteractive(u) ? {} : F, J._3O(), J._55O = p.isEditable(u) ? {
_42O: p.isRectEditable(u),
_43O: p.isPointEditable(u),
_56O: p.isRotationEditable(u)
} : F, J._6I = J._81o()
}
return J._6I
}, _3O: function () { }, getPosition: function () {
return nl
}, _68o: function (b, A) {
b && this._87I.add(Rj(b, A))
}, _81o: function () {
var E = this,
i = E.s;
E._24O(Bg, "getLabel"), E._24O(Qk, "getLabel2"), E._26O(Rm, "getNote"), E._26O(Vk, "getNote2"), E._15O(), E._55O && E._48O();
var C;
if (E._87I.each(function (V) {
C = ni(C, V)
}), C) {
var I = E.isShadowed(),
w = i("shadow2"),
X = Pm(C);
w ? (X.x += i("shadow2.offset.x"), X.y += i("shadow2.offset.y"), vn(X, i("shadow2.blur"))) : I && (X.x += i("shadow.offset.x"), X.y += i("shadow.offset.y"), vn(X, i("shadow.blur"))), C = ni(C, X)
}
return E._87I.clear(), C
}, _42: function (v) {
var e = this,
z = e._data,
I = e.gv,
O = e.s,
V = O("opacity"),
d = this.isShadowed(),
q = O("shadow2");
if (d || q) {
var Z = v.shadowOffsetX,
D = v.shadowOffsetY,
b = v.shadowBlur,
r = v.shadowColor,
j = I.getZoom(),
W = d ? "shadow" : "shadow2";
v.shadowOffsetX = O(W + ".offset.x") * j, v.shadowOffsetY = O(W + ".offset.y") * j, v.shadowBlur = O(W + ".blur") * j, v.shadowColor = d ? e.getSelectColor() : O(W + ".color")
}
if (V != F) {
var S = v.globalAlpha;
v.globalAlpha = V
}
e._80o(v), I.isLabelVisible(z) && ((!I._drawForChecking || O("label.selectable")) && vp(v, e.labelInfo), (!I._drawForChecking || O("label2.selectable")) && vp(v, e.label2Info)), I.isNoteVisible(z) && ($q(v, e.noteInfo), $q(v, e.note2Info)), e._99O(v), V != F && (v.globalAlpha = S), (d || q) && (v.shadowOffsetX = Z, v.shadowOffsetY = D, v.shadowBlur = b, v.shadowColor = r)
}, _80o: function () { }, _47O: function () { }, _24O: function (C, f) {
var r = this,
e = r._data,
g = r.gv,
p = r.s,
Z = g[f](e);
if (Z != F) {
var T = p(C + ".scale"),
S = p(C + ".max"),
Q = p(C + ".position"),
c = r[C + "Info"] = {
label: Z,
scale: T,
color: g[f + "Color"](e),
font: p(C + ".font"),
opacity: p(C + ".opacity"),
align: p(C + ".align"),
rotation: r.getRotation(p(C + ".rotation"), !1, Q),
background: g[f + "Background"](e)
},
_ = qr(c, Z);
S > 0 && S < _.width && (c.labelWidth = _.width, _.width = S), 1 !== T && (_.width *= T, _.height *= T);
var t = r.getPosition(Q, p(C + ".offset.x"), p(C + ".offset.y"), _, p(C + ".position.fixed"));
if (_.x = t.x - _.width / 2, _.y = t.y - _.height / 2, r._68o(c.rect = _, c.rotation), 1 !== T) {
var h = _.width / T,
P = _.height / T;
c.rect = {
x: t.x - h / 2,
y: t.y - P / 2,
width: h,
height: P
}
}
}
}, _26O: function (A, n) {
var N = this,
z = N.gv,
X = N._data,
t = N.s,
c = z[n](X);
if (c != F) {
var i, L, r = t(A + ".scale"),
V = N[A + "Info"] = {
note: c,
scale: r,
data: X,
view: z,
expanded: t(A + ".expanded"),
font: t(A + ".font"),
color: t(A + ".color"),
opacity: t(A + ".opacity"),
align: t(A + ".align"),
icon: t(A + ".icon"),
backgroundImage: t(A + ".backgroundImage"),
borderWidth: t(A + ".border.width"),
borderColor: t(A + ".border.color"),
background: z[n + "Background"](X)
},
R = N.getPosition(t(A + ".position"), t(A + ".offset.x"), t(A + ".offset.y")),
G = R.x,
M = R.y;
if (V.expanded) {
var b, Y = t(A + ".max"),
j = t(A + ".backgroundImage");
j ? (j = ii(j), b = {
width: xc(j, X),
height: oo(j, X)
}) : b = qr(V, c), b.width += 6, b.height += 2, Y > 0 && Y < b.width && (V.labelWidth = b.width, b.width = Y), i = b.width, L = b.height + 8, V.clickRect = {
x: G - i * r / 2,
y: M - L * r,
width: i * r,
height: L * r * b.height / L
}
} else {
var I = t(A + ".icon");
I ? (I = ii(I), i = xc(I, X), L = oo(I, X)) : (i = 12, L = 18), V.clickRect = {
x: G - i * r / 2,
y: M - L * r,
width: i * r,
height: L * r
}
}
V.rect = {
x: G - i / 2,
y: M - L * r / 2 - L / 2,
width: i,
height: L
};
var C = s(V.borderWidth / 2) * r;
N._68o({
x: G - i * r / 2 - C,
y: M - L * r - C,
width: i * r + 2 * C,
height: L * r + 2 * C
})
}
}, _48O: function () { }, _99O: function (a) {
var o = this,
B = o._38o;
if (B) {
var m = o.gv,
M = o._data,
t = B.icons,
W = o.interactiveInfo;
W && (W._38o = {});
for (var e in t) {
var d = t[e],
f = B.rects[e];
if (f) {
W && (W._38o[e] = []);
var j = Dj(d.opacity, M, m),
A = Dj(d.names, M, m),
$ = A ? A.length : 0,
w = f.rotation;
if (j != F) {
var E = a.globalAlpha;
a.globalAlpha *= j
}
for (var q = 0; $ > q; q++) {
var z = A[q],
x = ii(z),
N = f[q];
if (w) {
var c = N.x + N.width / 2,
H = N.y + N.height / 2;
a.save(), wh(a, c, H), jc(a, w), wh(a, -c, -H)
}
W && W._38o[e].push(a.interactiveInfo = {
compInfos: [],
matrix: w ? new Np(w, c, H).appendTranslate(-c, -H) : new Np
}), qk(a, x, Dj(d.stretch, M, m), N.x, N.y, N.width, N.height, o._data, o.gv), a.interactiveInfo = F, w && a.restore()
}
j != F && (a.globalAlpha = E)
}
}
}
}
});
var Af = function (A, s) {
fi(Af, this, [A, s])
};
yc(Af, Tp, {
_checkEmptyRect: !0,
_40O: function (U, I) {
var V = this,
n = V.s,
_ = U.rect;
(U.borderColor = V.gv.getBorderColor(V._data)) && (U.borderType = n("border.type"), U.borderWidth = n("border.width"), U.borderPadding = n("border.padding"), I = q(I, U.borderPadding + U.borderWidth / 2));
var e = V._data.getScale(),
G = q(1, q(X(e.x), X(e.y)));
if (U.selectWidth = V.getSelectWidth()) {
var D = V.gv._zoom;
U.selectType = n("select.type"), U._97o = V.getSelectColor(), U.selectPadding = n("select.padding"), I = q(I, (U.selectPadding + U.selectWidth / 2 / D) / G)
}
I > 0 && (I *= G, _ = Pm(_), vn(_, I)), V._68o(_)
}, _39O: function (W, I) {
var J, u = this,
A = I.rect;
if (I.borderWidth > 0 && (J = I.borderPadding, W.strokeStyle = I.borderColor, W.lineWidth = I.borderWidth, Ej(W, I.borderType, {
x: A.x - J,
y: A.y - J,
width: A.width + 2 * J,
height: A.height + 2 * J
}), W.stroke()), I.selectWidth > 0) {
var z = u.gv._zoom;
if (J = I.selectPadding, W.strokeStyle = I._97o, W.lineWidth = I.selectWidth / z, I.rotation != F) {
W.save(), W.translate(I.position.x, I.position.y), W.rotate(I.rotation);
var Q = u._data,
k = Q.getWidth(),
O = Q.getHeight(),
m = I.scale,
h = I.anchor;
A = {
x: m.x * -k * h.x,
y: m.y * -O * h.y,
width: m.x * k,
height: m.y * O
}
}
Ej(W, I.selectType, {
x: A.x - J,
y: A.y - J,
width: A.width + 2 * J,
height: A.height + 2 * J
}), I.rotation != F && W.restore(), W.stroke()
}
}, dispose: function () {
var X = this,
u = X._htmlView;
Af.superClass._3O.call(X), u && (u.onHTMLRemoved && u.onHTMLRemoved(), yj(u))
}, _3O: function () {
var N = this,
O = N.s,
k = N._data,
P = N.gv,
i = P.getShape(k),
t = N.getBodyColor(),
n = O("shape.border.color"),
T = N._83o = i ? {
shape: i,
_53o: N.getBodyColor("shape.background"),
_27Q: ii(O("shape.repeat.image"), t),
shapeGradientPack: O("shape.gradient.pack"),
_54o: O("shape.border.width"),
_55o: n,
shapeBorderRepeatImage: ii(O("shape.border.repeat.image"), n),
_56o: O("shape.border.3d"),
_57o: O("shape.border.3d.color"),
_58o: O("shape.border.3d.accuracy"),
shapeGradient: O("shape.gradient"),
_59o: O("shape.gradient.color"),
_60o: O("shape.border.pattern"),
_61o: O("shape.border.cap"),
_62o: O("shape.border.join"),
shapeForeground: O("shape.foreground"),
bodyColor: t,
gray: O("2d.gray")
} : {
img: ii(P.getImage(k), t),
bodyColor: t,
gray: O("2d.gray"),
stretch: O("image.stretch")
};
if (_ && !Ad);
else {
var y, d = T.img;
d && d.renderHTML ? (N._htmlInfo && N._htmlInfo.img !== d && (N._htmlInfo = F), N._htmlInfo || (N._htmlInfo = {
img: d,
cache: {}
}), y = d.renderHTML(k, P, N._htmlInfo.cache)) : N._htmlInfo = F, N._htmlView && N._htmlView !== y && (N._htmlView.onHTMLRemoved && N._htmlView.onHTMLRemoved(), yj(N._htmlView.getView ? N._htmlView.getView() : N._htmlView)), (N._htmlView = y) && P.appendHTML(y) && (y.onHTMLAddedSync && y.onHTMLAddedSync(), y.onHTMLAdded && $e(y.onHTMLAdded)), T.rect = k.getRect(), T.position = k.p(), T.scale = k.getScale(), T.anchor = k.getAnchor(), T.rotation = k.getRotation(), i === Tq && (T._63o = O("shape.depth"));
var I = 0;
if (i) I = Xb(F, T._54o / 2, T._62o), N.s("shape.dash") && (I = q(I, (N.s("shape.dash.width") || T._54o) / 2));
else if (d && d.boundExtend)
if (I = Dj(d.boundExtend, k, P), d.boundExtendAbsolute) {
var S = k.getScale();
I /= P._zoom * q(1, q(X(S.x), X(S.y)))
} else if (!Dj(d.fitSize, k, P)) {
var A = Dj(d.width, k, P),
E = Dj(d.height, k, P);
I *= q(k.getWidth() / A, k.getHeight() / E)
}
N._40O(T, I);
var w = O("clip.percentage");
if (1 > w && (0 > w && (w = 0), T.clipRect = Wh(k.getAnchorRect(), O("clip.direction"), w)), i) {
var C = O("shape.fill.clip.percentage");
1 > C && (0 > C && (C = 0), T.shapeClipRect = Wh(k.getAnchorRect(), O("shape.fill.clip.direction"), C));
var $ = O("shape.foreground.clip.percentage");
1 > $ && (0 > $ && ($ = 0), T.shapeForegroundClipRect = Wh(k.getAnchorRect(), O("shape.foreground.clip.direction"), $))
}
}
}, getPosition: function (A, s, b, w) {
var a = Re(A, this._83o.rect, w);
return a.x += s, a.y += b, a
}, _80o: function (c) {
var P = this,
E = P.s,
S = P.gv,
M = P._data,
l = P._83o,
j = l.rect,
v = l.position,
U = l.rotation,
K = l.anchor,
X = l.scale,
e = l.shape,
O = l.clipRect;
if (!P._checkEmptyRect || j.width > 0 && j.height > 0) {
var T = M.getSize();
if (T.x = -T.width * K.x, T.y = -T.height * K.y, c.save(), wh(c, v.x, v.y), jc(c, U), ec(c, X.x, X.y), O && (c.beginPath(), c.rect(O.x, O.y, O.width, O.height), c.clip()), S._drawForChecking && l.img && Dj(l.img.pixelPerfect, M, S) === !1) fl(c, T.x, T.y, T.width, T.height, "#888888");
else if (P.freeDraw) P.freeDraw(c, T, l);
else if (e) {
var C, o, G, t, N = l._60o,
w = ls(c, N),
Z = l._27Q,
W = l._54o,
s = l.shapeGradientPack,
m = l.gray,
n = c.lineJoin,
q = c.lineCap,
H = function (R) {
return m ? u.toGrayColor(R) : R
};
"roundRect" === e ? C = E("shape.corner.radius") : "polygon" === e ? C = E("shape.polygon.side") : "arc" === e && (C = E("shape.arc.from"), o = E("shape.arc.to"), G = E("shape.arc.close"), t = E("shape.arc.oval")), c.lineJoin = l._62o, c.lineCap = l._61o;
var x = H(l._53o);
if (x || Z || s) {
var i = l.shapeClipRect;
i && (c.save(), c.beginPath(), c.rect(i.x, i.y, i.width, i.height), c.clip()), Ej(c, e, T, C, o, G, t), s ? uq(c, s, function (j) {
return nm(j, l.bodyColor)
}) : Z ? fg(c, Z, H(l.bodyColor), null, M, S) : Ge(c, x, l.shapeGradient, H(l._59o), T), c.fill(), s && c.restore(), i && c.restore(), c !== w && Ej(w, e, T, C, o, G, t)
} else Ej(w, e, T, C, o, G, t);
var J = l.shapeForeground;
if (J) {
c.save();
var r = l.shapeForegroundClipRect;
r && (c.beginPath(), c.rect(r.x, r.y, r.width, r.height), c.clip()), Ej(c, e, T, C, o, G, t), Ge(c, J, E("shape.foreground.gradient"), H(E("shape.foreground.gradient.color")), T), c.fill(), c.restore()
}
if (W > 0) {
var L = E("shape.border.width.absolute");
L && (c.save(), c.setTransform(1, 0, 0, 1, 0, 0)), c.lineWidth = W;
var g = H(l._55o);
l.shapeBorderRepeatImage ? qb(c, l.shapeBorderRepeatImage, g, null, M, S) : c.strokeStyle = g, c.stroke(), L && c.restore(), l._56o && fr(c, g, H(l._57o), W, S._zoom, l._58o)
}
if (_l(c, N), E("shape.dash")) {
var D = E("shape.dash.width") || W;
if (D > 0) {
N = E("shape.dash.pattern");
var w = ls(c, N, P._2Q("shape.dash.offset"));
w !== c && Ej(w, e, T, C, o, G, t), P._1Q(c, "shape", D, N)
}
}
Wq(c, x, l._63o, T), c.lineJoin = n, c.lineCap = q
} else {
var p = P.interactiveInfo;
p && (c.interactiveInfo = p.bodyInfo = {
compInfos: [],
matrix: new Np(U, v.x, v.y, X.x, X.y)
}), l.gray && (c.compGray = !0);
var f = l.img;
f && f.cacheRule != F && (f = lc(c, f, l.stretch, T.width, T.height, M, S, l.bodyColor)), qk(c, f, l.stretch, T.x, T.y, T.width, T.height, M, S, l.bodyColor), c.compGray = !1, c.interactiveInfo = F
}
c.restore()
}
P._39O(c, l)
}, _48O: function () { }, _47O: function () { }
});
var wn = function (A, O) {
fi(wn, this, [A, O])
},
Fl = function (A, v, C, W) {
var Y = En(A, v);
return C = W ? V(C, Y) : cr(C, Y), Y ? C /= Y : C = 0, {
x: A.x + (v.x - A.x) * C,
y: A.y + (v.y - A.y) * C
}
};
yc(wn, Tp, {
_3O: function () {
var y, X = this,
g = X._data,
k = X.gv,
i = X.s,
R = i(ej),
r = g.isLooped(),
_ = i("edge.width"),
s = X.getBodyColor("edge.color"),
w = i("edge.center"),
A = i("edge.offset"),
C = k.getBorderColor(g),
I = C ? i("border.width") : 0,
T = X.getSelectWidth(),
p = g._40I,
J = g._41I,
K = X._78o = p && J ? {
looped: r,
type: R,
width: _,
center: w,
color: s,
repeatImage: ii(i("edge.repeat.image"), s),
borderColor: C,
borderWidth: I,
_97o: T ? X.getSelectColor() : F,
selectWidth: T,
pattern: i("edge.pattern"),
cap: i("edge.cap"),
join: i("edge.join"),
is3d: i("edge.3d"),
_67o: i("edge.3d.color"),
_66o: i("edge.3d.accuracy"),
gray: i("2d.gray")
} : F;
if (K) {
var d = u.getEdgeType(R);
if (d) {
var P = d(g, Ml(X, k, g, r, R), k, X._19Q);
P.points && P.points.size() > 1 ? (K.edgeTypeInfo = P, y = ms(K.edgeTypeInfo.points)) : P[Ph] && P.rect && (K.edgeTypeInfo = P, y = P.rect)
} else {
var L = i("edge.source.anchor.x"),
N = i("edge.source.anchor.y"),
h = i("edge.target.anchor.x"),
v = i("edge.target.anchor.y"),
Q = Eo(k, g, "source"),
f = Eo(k, g, "target");
if (R === _b) {
var n = K.points = i(Ei) || Yh,
j = n.size();
K.segments = i("edge.segments");
var m = L !== Z || N !== Z || Bk(p),
B = h !== Z || v !== Z || Bk(J);
if (!w)
if (A) m || (Q = Fl(Q, j ? n.get(0) : f, A, j)), B || (f = Fl(f, j ? n.get(j - 1) : Q, A, j));
else {
var o;
m || (o = Rl(Q, j ? n.get(0) : f, Rp(k, p)), o && (Q = {
x: o[0],
y: o[1]
})), B || (o = Rl(j ? n.get(j - 1) : Q, f, Rp(k, J)), o && (f = {
x: o[0],
y: o[1]
}))
}
y = ni(ms(K.points), ms(Q, f))
} else {
var e = Ml(X, k, g, r, R);
if (X._19Q || (e = -e), r) Q = Pm(Q), Q.x = k.getNodeRect(p).x, K.radius = e, y = {
x: Q.x - e,
y: Q.y - e,
width: 2 * e,
height: 2 * e
};
else {
var b = En(Q, f),
G = cr(A, b),
E = {
x: G,
y: e
},
U = {
x: b - G,
y: e
},
V = D(f.y - Q.y, f.x - Q.x),
H = K.mat = new In(V);
if (K.orienAngle = V, K.angle = f.x < Q.x ? V + W : V, K.rect = {
x: E.x,
y: E.y,
width: U.x - E.x,
height: 0
}, K.origin = Q, E = H.tf(E), E.x += Q.x, E.y += Q.y, U = H.tf(U), U.x += Q.x, U.y += Q.y, w) {
var $ = {
x: b,
y: 0
};
$ = H.tf($), $.x += Q.x, $.y += Q.y, y = ms([Q, E, U, $]), K.c1 = Q, K.c2 = $
} else y = ms(E, U);
Q = E, f = U
}
}
K.sourcePoint = Q, K.targetPoint = f, g._lastSourcePoint = Q, g._lastTargetPoint = f
}
var S = 0;
i("edge.dash") && (S = i("edge.dash.width") || _);
var l = "square" === K.cap ? .71 : .5;
Xb(y, q(S * l, _ * l + I + T), K.join), X._68o(y)
}
}, getRotation: function (h, q, R) {
h = h || 0;
var B = this._78o;
if (B) {
var e, W = B.angle,
E = B.points,
u = B.edgeTypeInfo;
if (W != F) return q ? B.orienAngle + h : W + h;
if (u && u[Ph]) return u.getRotation ? u.getRotation(this, h, q, R) : 0;
if (u && u.points) {
var f = u.points;
return e = f.size(), nk[R] ? e && 0 === e % 2 ? Mn(f.get(e / 2 - 1), f.get(e / 2), q, h) : h : Ym[R] ? Mn(f.get(0), f.get(1), q, h) : Mn(f.get(e - 2), f.get(e - 1), q, h)
}
if (E) return e = E.size(), nk[R] ? e && 0 === e % 2 ? Mn(E.get(e / 2 - 1), E.get(e / 2), q, h) : h : Ym[R] ? Mn(B.sourcePoint, e ? E.get(0) : B.targetPoint, q, h) : Mn(e ? E.get(e - 1) : B.sourcePoint, B.targetPoint, q, h)
}
return h
}, getPosition: function (o, T, l, P, c) {
var C = this._78o;
if (C) {
var t, a = C.type,
e = C.points,
f = C.edgeTypeInfo,
H = C.sourcePoint,
K = C.targetPoint;
if (!a) return C.looped ? {
x: H.x - C.radius + T,
y: H.y + l
} : (c && H && K && (H.x > K.x || H.x === K.x && H.y > K.y) && (o = cg[o], l = -l), t = Re(o, C.rect, P), t.x += T, t.y += l, t = C.mat.tf(t), t.x += C.origin.x, t.y += C.origin.y, t);
if (f && f[Ph]) return f.getPosition ? f.getPosition(this, o, T, l, P, c) : {
x: (H.x + K.x) / 2,
y: (H.y + K.y) / 2
};
if (e) {
var t, I = e.size();
if (nk[o]) {
if (I) {
var h = I % 2;
if (0 === h) return Md(e.get(I / 2 - 1), e.get(I / 2), o, T, l, P, c);
t = e.get((I - h) / 2)
} else t = {
x: (H.x + K.x) / 2,
y: (H.y + K.y) / 2
};
return t = Re(o, {
x: t.x,
y: t.y,
width: 0,
height: 0
}, P), t.x += T, t.y += l, t
}
return Ym[o] ? Md(H, I ? e.get(0) : K, o, T, l, P, c) : Md(I ? e.get(I - 1) : H, K, o, T, l, P, c)
}
if (f) {
var $ = f.points,
I = $.size();
if (nk[o]) {
var h = I % 2;
return 0 === h ? Md($.get(I / 2 - 1), $.get(I / 2), o, T, l, P, c) : (t = $.get((I - h) / 2), t = Re(o, {
x: t.x,
y: t.y,
width: 0,
height: 0
}, P), t.x += T, t.y += l, t)
}
return Ym[o] ? Md($.get(0), $.get(1), o, T, l, P, c) : Md($.get(I - 2), $.get(I - 1), o, T, l, P, c)
}
}
return nl
}, _42: function (V) {
this._78o && wn.superClass._42.call(this, V)
}, drawPath: function (c, J) {
c.beginPath();
var y = J.type,
G = J.points,
I = J.segments,
v = J.edgeTypeInfo;
if (!y || G) {
var Z = J.sourcePoint,
p = Z.x,
j = Z.y,
F = J.targetPoint,
R = F.x,
S = F.y;
if (y)
if (I) {
var W = new xr({
x: p,
y: j
});
W.addAll(G), W.add({
x: R,
y: S
}), en(c, W, I)
} else c.moveTo(p, j), G.each(function (V) {
c.lineTo(V.x, V.y)
}), c.lineTo(R, S);
else J.looped ? c.arc(p, j, J.radius, 0, $, !0) : J.center ? (c.moveTo(J.c1.x, J.c1.y), c.lineTo(p, j), c.lineTo(R, S), c.lineTo(J.c2.x, J.c2.y)) : (c.moveTo(p, j), c.lineTo(R, S))
} else v && (v.points ? en(c, v.points, v.segments) : v[Ph] && v[Ph](c, v))
}, _80o: function (P) {
var z = this,
X = z.s,
I = z._78o,
C = I.width,
g = I.selectWidth,
k = I.borderWidth,
D = I.repeatImage,
Q = P.lineJoin,
T = P.lineCap,
R = I.gray,
U = I.pattern;
P.lineJoin = I.join, P.lineCap = I.cap, z.drawPath(ls(P, U), I);
var A = X("edge.width.absolute");
A && (P.save(), P.setTransform(1, 0, 0, 1, 0, 0)), g && (P.strokeStyle = I._97o, P.lineWidth = C + 2 * (k + g), P.stroke()), k && (P.strokeStyle = R ? u.toGrayColor(I.borderColor) : I.borderColor, P.lineWidth = C + 2 * k, P.stroke());
var K = R ? u.toGrayColor(I.color) : I.color;
if (D ? qb(P, D, K, null, z._data, z.gv) : P.strokeStyle = K, P.lineWidth = C, P.stroke(), I.is3d) {
var r = R ? u.toGrayColor(I._67o) : I._67o;
fr(P, K, r, C, z.gv._zoom, I._66o)
}
if (_l(P, U), X("edge.dash")) {
U = X("edge.dash.pattern");
var f = ls(P, U, z._2Q("edge.dash.offset"));
f !== P && z.drawPath(f, I), z._1Q(P, "edge", X("edge.dash.width") || C, U)
}
A && P.restore(), P.lineJoin = Q, P.lineCap = T
}, _48O: function () { }, _47O: function () { }
});
var Fn = function (n, q) {
fi(Fn, this, [n, q])
};
yc(Fn, Af, {
_3O: function () {
var n, e, Z = this,
E = Z.s,
I = Z._data,
i = Z.gv;
if (Z._88I = F, I.isExpanded() && I.eachChild(function (d) {
if (Fq(d)) {
var j = i.getBoundsForGroup(d);
j && (e || (e = []), e.push(j), n = ni(n, j))
}
}), n) {
var L = i.getLabel(I),
V = E("group.type"),
R = E("group.border.width") || 0,
c = E("group.border.width.absolute"),
B = R / 2;
c && (R /= i._zoom), n = Dk(V, e, n), ld(n, I, "group.padding", 1), vn(n, R);
var r = Z._88I = {
type: V,
rect: n,
_64o: n
};
if (!V && L != F) {
var o, S = Z.labelInfo = {
label: L,
color: E("group.title.color"),
font: E("group.title.font"),
align: E("group.title.align")
},
J = qr(S, L),
v = J.width + R,
Q = J.height + R,
w = E("group.title.align"),
l = E("group.title.orientation");
if (l === $c || l === Kd ? (n.height += R, v > n.width && (n.width = v)) : (l === nq || l === fm) && (n.width += R, v > n.height && (n.height = v)), o = w === nq ? n.x : w === fm ? n.x + n.width - v : n.x + n.width / 2 - v / 2, l === Kd) r.titleRect = {
x: n.x,
y: n.y + n.height,
width: n.width,
height: Q
}, r.rect = {
x: n.x,
y: n.y,
width: n.width,
height: n.height + Q
}, S.rect = {
x: o,
y: n.y + n.height,
width: v,
height: Q
};
else if (l === nq) {
var q = r.titleRect = {
x: n.x - Q,
y: n.y,
width: Q,
height: n.height
};
r.rect = {
x: n.x - Q,
y: n.y,
width: n.width + Q,
height: n.height
}, S.rect = {
x: q.x + Q / 2 - n.height / 2,
y: q.y + n.height / 2 - Q / 2,
width: n.height,
height: Q
}, S.rotation = -Math.PI / 2
} else if (l === fm) {
var q = r.titleRect = {
x: n.x + n.width,
y: n.y,
width: Q,
height: n.height
};
r.rect = {
x: n.x,
y: n.y,
width: n.width + Q,
height: n.height
}, S.rect = {
x: q.x + Q / 2 - n.height / 2,
y: q.y + n.height / 2 - Q / 2,
width: n.height,
height: Q
}, S.rotation = Math.PI / 2
} else r.titleRect = {
x: n.x,
y: n.y - Q,
width: n.width,
height: Q
}, r.rect = {
x: n.x,
y: n.y - Q,
width: n.width,
height: n.height + Q
}, S.rect = {
x: o,
y: n.y - Q - B,
width: v,
height: Q + R
}
}
Z._40O(r, E("group.border.width") / 2)
} else Fn.superClass._3O.call(Z)
}, getPosition: function (J, $, O, k) {
var W = this._88I;
if (W) {
var E = Re(J, W.rect, k);
return E.x += $, E.y += O, E
}
return Fn.superClass.getPosition.apply(this, arguments)
}, _24O: function (T, R) {
var Y = this._88I;
(!Y || Y.type || "label2" === T) && Fn.superClass._24O.call(this, T, R)
}, _80o: function (v) {
var P = this,
K = P._88I;
if (K) {
var I = P._data,
Q = P.s,
U = P.gv,
M = K.type,
t = K.rect,
m = K._64o,
F = K.titleRect,
o = P.getBodyColor(),
S = ii(Q("group.image"), o),
J = Q("group.image.stretch"),
i = P.getBodyColor("group.background"),
V = ii(Q("group.repeat.image"), o),
L = Q("group.gradient.pack"),
c = Q("group.gradient"),
N = Q("group.gradient.color"),
g = Q("group.border.width"),
l = Q("group.border.color"),
d = Q("group.border.pattern"),
f = Q("group.title.orientation"),
T = Q("group.depth"),
q = Q("group.border.radius"),
k = Q("group.border.join"),
r = Q("group.border.cap"),
B = Q("group.border.width.absolute");
B && (g /= U._zoom);
var y = l,
A = Q("group.border.repeat.image");
if (A && (A = ii(A, l)) && (y = am(v, A, l, null, I, U)), M) {
var R = v.lineJoin,
z = v.lineCap;
if (v.lineJoin = k, v.lineCap = r, S) {
if (v.save(), Ej(v, M, t, q), v.clip(), qk(v, S, J, t.x, t.y, t.width, t.height, I, U, o), v.restore(), g > 0) {
var X = ls(v, d);
Ej(X, M, t, q), v.lineWidth = g, v.strokeStyle = y, v.stroke(), _l(v, d)
}
} else {
var X = ls(v, d);
i || V || L ? (Ej(v, M, t, q), L ? uq(v, L, function (K) {
return nm(K, o)
}) : V ? fg(v, V, o, null, I, U) : Ge(v, i, c, N, t), v.fill(), L && v.restore(), v !== X && Ej(X, M, t, q)) : Ej(X, M, t, q), g > 0 && (v.lineWidth = g, v.strokeStyle = y, v.stroke()), _l(v, d), M === Tq && Wq(v, i, T, t)
}
v.lineJoin = R, v.lineCap = z
} else {
var D = Q("group.title.background");
if ((!q || 0 > q) && (q = 0), S) qk(v, S, J, m.x, m.y, m.width, m.height, I, U, P.getBodyColor());
else if (i || V)
if (V ? fg(v, V, o, null, I, U) : Ge(v, i, c, N, m), 0 === g) Ej(v, Tq, m), v.fill(), Wq(v, i, T, m);
else {
switch (v.beginPath(), f) {
case Kd:
pg(v, m.x, m.y, m.width, m.height, q, q, 0, 0);
break;
case nq:
pg(v, m.x, m.y, m.width, m.height, 0, q, 0, q);
break;
case fm:
pg(v, m.x, m.y, m.width, m.height, q, 0, q, 0);
break;
case $c:
pg(v, m.x, m.y, m.width, m.height, 0, 0, q, q)
}
v.fill()
}
if (F && D)
if (0 === g) fl(v, F.x, F.y, F.width, F.height, D), Wq(v, D, T, F);
else {
switch (v.beginPath(), v.fillStyle = D, f) {
case Kd:
pg(v, F.x, F.y, F.width, F.height, 0, 0, q, q);
break;
case nq:
pg(v, F.x, F.y, F.width, F.height, q, 0, q, 0);
break;
case fm:
pg(v, F.x, F.y, F.width, F.height, 0, q, 0, q);
break;
case $c:
pg(v, F.x, F.y, F.width, F.height, q, q, 0, 0)
}
v.fill()
}
if (g > 0) {
var X = ls(v, d);
if (Ej(X, "roundRect", t, q), v.save(), v.lineWidth = g, v.strokeStyle = y, v.lineJoin = k, v.lineCap = r, v.closePath(), v.stroke(), F && Q("group.splitLine")) {
var h = F.x,
e = F.y,
u = F.width,
p = F.height;
v.beginPath(), f === Kd ? (v.moveTo(h, e), v.lineTo(h + u, e)) : f === nq ? (v.moveTo(h + u, e), v.lineTo(h + u, e + p)) : f === fm ? (v.moveTo(h, e), v.lineTo(h, e + p)) : (v.moveTo(h, e + p), v.lineTo(h + u, e + p))
}
v.stroke(), v.restore(), _l(X, d)
}
}
P._39O(v, K)
} else Fn.superClass._80o.call(P, v)
}
});
var Ul = function (d, R) {
fi(Ul, this, [d, R])
};
yc(Ul, Af, {
_80o: function (b) {
this._39O(b, this._83o)
}
});
var Xp = function (A, w) {
fi(Xp, this, [A, w])
};
yc(Xp, Af, {
_3O: function () {
var g = this,
v = g._data,
V = g.s,
A = g.gv,
p = v.getPoints(),
C = A.getBorderColor(v),
G = C ? V("border.width") : 0,
k = g.getSelectWidth(),
S = V("shape.border.width"),
B = v.getRect(),
D = v.getAnchorRect(),
u = A.getBodyColor(v),
P = V("shape.border.color"),
E = g._99o = p.isEmpty() ? F : {
rect: B,
rotation: v.getRotation(),
fillRule: V("shape.fill.rule"),
scale: v.getScale(),
position: v.p(),
points: p,
segments: v.getSegments(),
bodyColor: u,
borderColor: C,
borderWidth: G,
_94o: V("shape.border.3d"),
_95o: V("shape.border.3d.color"),
_96o: V("shape.border.3d.accuracy"),
_97o: k ? g.getSelectColor() : F,
selectWidth: k,
_53o: V("shape.background"),
_27Q: ii(V("shape.repeat.image"), u),
shapeGradientPack: V("shape.gradient.pack"),
_54o: S,
_55o: P,
shapeBorderRepeatImage: ii(V("shape.border.repeat.image"), P),
shapeGradient: V("shape.gradient"),
_59o: V("shape.gradient.color"),
_60o: V("shape.border.pattern"),
_61o: V("shape.border.cap"),
_62o: V("shape.border.join"),
shapeForeground: V("shape.foreground"),
gray: V("2d.gray")
};
if (E) {
D.x += E.position.x, D.y += E.position.y, E.gradientRect = D;
var I = v.getScale(),
Z = q(1, q(X(I.x), X(I.y)));
V("shape.dash") && V("shape.dash.width") > S && (S = V("shape.dash.width"));
var Y, n = V("shape.border.width.absolute");
Y = n ? (S + G + k) / g.gv._zoom / Z : S * ("square" === E._61o ? .71 : .5) + G + k / g.gv._zoom / Z, Y && (Y *= Z, B = Pm(B), Xb(B, Y, E._62o)), g._68o(B);
var t = V("clip.percentage");
1 > t && (0 > t && (t = 0), E.clipRect = Wh(v.getAnchorRect(), V("clip.direction"), t));
var M = V("shape.fill.clip.percentage");
1 > M && (0 > M && (M = 0), E.shapeClipRect = Wh(v.getAnchorRect(), V("shape.fill.clip.direction"), M));
var J = V("shape.foreground.clip.percentage");
1 > J && (0 > J && (J = 0), E.shapeForegroundClipRect = Wh(v.getAnchorRect(), V("shape.foreground.clip.direction"), J))
}
}, getPosition: function (l, m, s, t) {
var L = this._99o;
if (L) {
var Q = Re(l, L.rect, t);
return Q.x += m, Q.y += s, Q
}
return nl
}, _42: function (I) {
this._99o && Xp.superClass._42.call(this, I)
}, _80o: function (l) {
var a, I = this,
F = I.s,
R = I._99o,
J = R.position,
B = R.scale,
Q = R.rotation,
D = R.borderWidth,
s = R.selectWidth / I.gv._zoom,
v = R._27Q,
d = R.shapeGradientPack,
N = R._54o,
w = R.clipRect,
Z = R.shapeClipRect,
m = R.points,
C = R.segments,
n = I._data.isClosePath(),
h = R.fillRule,
f = R.gray,
c = function (c) {
return f ? u.toGrayColor(c) : c
},
r = c(R._53o),
x = r || v || d;
l.save(), wh(l, J.x, J.y), jc(l, Q), ec(l, B.x, B.y), w && (l.beginPath(), l.rect(w.x, w.y, w.width, w.height), l.clip()), x && Z && (l.save(), l.beginPath(), l.rect(Z.x, Z.y, Z.width, Z.height), l.clip()), wh(l, -J.x, -J.y);
var O = R._60o,
H = ls(l, O),
K = l.lineJoin,
o = l.lineCap;
l.lineJoin = R._62o, l.lineCap = R._61o;
var V = c(R.bodyColor);
x ? (en(l, m, C, n), d ? uq(l, d, function (s) {
return nm(s, R.bodyColor)
}) : v ? fg(l, v, V, null, I._data, I.gv) : (a = V ? V : r, Ge(l, a, R.shapeGradient, c(R._59o), R.gradientRect)), l.fill(h), d && l.restore(), Z && (l.restore(), wh(l, -J.x, -J.y)), H !== l && en(H, m, C, n)) : en(H, m, C, n);
var k = R.shapeForeground;
if (k) {
l.save();
var G = R.shapeForegroundClipRect;
G && (wh(l, J.x, J.y), l.beginPath(), l.rect(G.x, G.y, G.width, G.height), l.clip(), wh(l, -J.x, -J.y)), en(l, m, C, n), Ge(l, k, F("shape.foreground.gradient"), c(F("shape.foreground.gradient.color")), R.gradientRect), l.fill(h), l.restore()
}
var M = F("shape.border.width.absolute");
if (M && (l.save(), l.setTransform(1, 0, 0, 1, 0, 0)), s && (l.strokeStyle = R._97o, l.lineWidth = N + 2 * (D + s), l.stroke()), D && (l.strokeStyle = c(R.borderColor), l.lineWidth = N + 2 * D, l.stroke()), N && (a = c(R._55o), R.shapeBorderRepeatImage ? qb(l, R.shapeBorderRepeatImage, a, null, I._data, I.gv) : (!r && V && (a = V), l.strokeStyle = a), l.lineWidth = N, l.stroke(), R._94o && fr(l, a, c(R._95o), N, I.gv._zoom, R._96o)), _l(l, O), F("shape.dash")) {
var z = F("shape.dash.width") || N;
if (z > 0) {
O = F("shape.dash.pattern");
var H = ls(l, O, I._2Q("shape.dash.offset"));
H !== l && en(H, m, C, n), I._1Q(l, "shape", z, O)
}
}
M && l.restore(), l.lineJoin = K, l.lineCap = o, l.restore()
}, _48O: function () { }, _47O: function () { }
});
var Kr = function (b, G) {
fi(Kr, this, [b, G])
};
yc(Kr, Xp, {
getRotation: function (w, n, K) {
w = w || 0;
var H = this._data.getPoints(),
R = H.size();
return R > 1 ? nk[K] ? R && 0 === R % 2 ? Mn(H.get(R / 2 - 1), H.get(R / 2), n, w) : w : Ym[K] ? Mn(H.get(0), H.get(1), n, w) : Mn(H.get(R - 2), H.get(R - 1), n, w) : w
}, getPosition: function (F, H, k, C, b) {
var z = this._data.getPoints(),
l = z.size();
if (l > 1) {
if (nk[F]) {
var t = l % 2;
if (0 === t) return Md(z.get(l / 2 - 1), z.get(l / 2), F, H, k, C, b);
var R = z.get((l - t) / 2),
S = {
x: R.x,
y: R.y,
width: 0,
height: 0
};
return R = Re(F, S, C), R.x += H, R.y += k, R
}
return Ym[F] ? Md(z.get(0), z.get(1), F, H, k, C, b) : Md(z.get(l - 2), z.get(l - 1), F, H, k, C, b)
}
return nl
}
});
var _n = function (t, k) {
fi(_n, this, [t, k])
};
yc(_n, Af, {
_3O: function () {
var C = this;
_n.superClass._3O.call(C);
var G = C.s,
z = C._83o;
C._82o = z.img || z.shape ? F : {
background: C.getBodyColor("grid.background"),
depth: G("grid.depth"),
rect: z.rect,
_88o: G("grid.cell.depth"),
cellBorderColor: G("grid.cell.border.color"),
_89o: G("grid.row.count"),
_90o: G("grid.column.count"),
block: G("grid.block"),
_91o: G("grid.block.color"),
_92o: G("grid.block.padding"),
_93o: G("grid.block.width")
}
}, _80o: function (t) {
var w = this,
R = w._82o;
if (!R) return _n.superClass._80o.call(w, t), void 0;
var H, f, E = w._data,
h = R.background,
W = R.rect,
x = R.block,
k = R._91o,
Z = R._92o,
P = R._93o,
V = R._88o,
D = R.cellBorderColor,
s = R._89o,
o = R._90o;
if (h)
if (fl(t, W.x, W.y, W.width, W.height, h), Wq(t, h, R.depth, W), V)
for (H = 0; s > H; H++)
for (f = 0; o > f; f++) W = E.getCellRect(H, f), W && Wq(t, h, V, W);
else if (D) {
for (t.beginPath(), H = 0; s > H; H++)
for (f = 0; o > f; f++) W = E.getCellRect(H, f), W && t.rect(W.x, W.y, W.width, W.height);
t.strokeStyle = D, t.lineWidth = 1, t.stroke()
}
if ("h" === x)
for (H = 0; s > H; H++) W = ni(E.getCellRect(H, 0), E.getCellRect(H, o - 1)), vn(W, Z), Ie(t, k, W.x, W.y, W.width, W.height, P);
else if ("v" === x)
for (f = 0; o > f; f++) W = ni(E.getCellRect(0, f), E.getCellRect(s - 1, f)), vn(W, Z), Ie(t, k, W.x, W.y, W.width, W.height, P);
w._39O(t, w._83o)
}
});
var sk = function (C, J) {
fi(sk, this, [C, J])
};
yc(sk, Af, {
_checkEmptyRect: !1,
_81o: function () {
var t = this._data,
p = sk.superClass._81o.call(this),
O = t.s("text");
if (O != F) {
var P, Q, V = t.s("text.font"),
o = t.s("text.align"),
U = t.s("text.vAlign"),
f = ln(V, O),
z = f.width,
L = f.height,
j = t.getAnchor(),
e = t.getWidth(),
k = t.getHeight();
"left" === o ? P = -e * j.x : "center" === o ? P = -e * j.x + (e - z) / 2 : "right" === o && (P = e * (1 - j.x) - f.width), "top" === U ? Q = -k * j.y : "middle" === U ? Q = -k * j.y + (k - L) / 2 : "bottom" === U && (Q = k * (1 - j.y) - f.height);
var T, v = t.getMatrix();
if (T = ms([v.tf(P, Q), v.tf(P + z, Q), v.tf(P + z, Q + L), v.tf(P, Q + L)]), p = ni(p, T), p && t.s("text.shadow")) {
var N = Pm(p);
N.x += t.s("text.shadow.offset.x"), N.y += t.s("text.shadow.offset.y"), vn(N, t.s("text.shadow.blur")), p = ni(p, N)
}
}
return p
}
});
var Zp = hg.Interactor = function (S) {
this.gv = this._graphView = S
};
Bb("Interactor", o, {
ms_listener: 1,
getView: function () {
return this.gv.getView()
}, setUp: function () {
this.addListeners()
}, tearDown: function () {
this.removeListeners(), this.clear()
}, clear: function () { }, fi: function (g) {
this.gv.fi(g)
}, setCursor: function (G) {
nf || this.gv.setCursor(G)
}, startDragging: function ($) {
var V = this;
V._lastClientPoint = lb($), V._lastLogicalPoint = V.gv.lp($), Ui(V, $)
}, clearDragging: function () {
var t = this;
t._lastClientPoint = t._lastLogicalPoint = t._logicalPoint = F
}, autoScroll: function (M) {
return this.gv.autoScroll(M, this._lastClientPoint)
}
});
var cm = F,
Cd = function (Z) {
cm.handleWindowTouchMove(Z)
},
sp = function (h) {
cm.handleWindowTouchEnd(h), b(x, wj, Cd), b(x, Sj, sp), cm = F
},
Ng = function (_) {
cm.handleWindowMouseMove(_)
},
Vi = function (W) {
cm.handleWindowMouseUp(W), b(x, rp, Ng), b(x, cj, Vi), cm = F
},
Lj = function (m, h) {
if (m !== cm) {
var T = li(h);
cm ? T ? cm.handleWindowTouchEnd(h) : cm.handleWindowMouseUp(h) : T ? (K(x, wj, Cd), K(x, Sj, sp)) : (K(x, rp, Ng), K(x, cj, Vi)), cm = m
}
},
mq = function (p) {
var N = this;
N.gv = p, N._is2d = p instanceof hg.GraphView, N._eventListeners = {}, ["mousedown", "mousemove", "mouseleave", "touchstart", "touchmove", ad, "wheel"].forEach(function (K) {
N.addListener(K)
}), N.initImageResource()
};
yc(mq, Zp, {
enableVR: function (V) {
var l = this;
if (!!l._vrEnable !== V)
if (l._vrEnable = V, V) l.gv.vr.mp(l.onVRControllerChange, l);
else if (l.gv.vr.ump(l.onVRControllerChange, l), l._vrRayPolyline) {
var R = l.gv.dm();
R.remove(l._vrRayPolyline), R.remove(l._vrRayHitPoint), l._vrRayPolyline = Z, l._vrRayHitPoint = Z
}
}, onVRControllerChange: function (g) {
var Z = this,
V = g.property,
r = g.newValue,
B = Z.gv.vr.getController(r.id),
p = B.getRay();
p && ("gamepad.button.trigger" === V ? "down" === r._62O ? Z.handle_mousedown(p) : Z.handleWindowMouseUp(p) : "gamepad.pose" === V && (Z.handle_mousemove(p), Z.handleWindowMouseMove(p)))
}, drawVRRay: function (m, Q, V) {
var C, A = this,
J = A.gv,
G = A._vrRayPolyline,
K = !1;
if (G) C = A._vrRayHitPoint;
else {
var W = J.dm();
A._vrRayPolyline = G = new O.Polyline, A._vrRayHitPoint = C = new O.Node, C.s({
shape3d: "billboard",
"shape3d.transparent": !0,
"texture.scale": 10,
"shape3d.image": "coreInteractorRayHitImage"
}), C.setAnchor3d(.5, .5, .499);
var k = .2 / J.vr.measureOflength;
C.s3(k, k, k), G.s("intersect", !1), C.s("intersect", !1), W.add(G), W.add(C), K = !0
} if (Q) {
var L = V.world,
y = V.worldNormal,
t = L.x,
n = L.y,
f = L.z;
G.s("shape.border.color", "red"), G.setPoints([{
x: m.origin.x,
y: m.origin.z,
e: m.origin.y
}, {
x: t,
y: f,
e: n
}]), C.s("3d.visible", !0), C.p3(t, n, f), C.lookAtDirection([y.x, y.y, y.z], "front")
} else {
G.s("shape.border.color", "blue");
var S = new O.Math.Vector3;
S.copy(m.direction).setLength(1e3 / A.gv.vr.measureOflength).add(m.origin), G.setPoints([{
x: m.origin.x,
y: m.origin.z,
e: m.origin.y
}, {
x: S.x,
y: S.z,
e: S.y
}]), C.s("3d.visible", !1)
}
J.fi({
kind: "vrRayIntersect",
ray: m,
data: Q,
intersect: V,
polyline: G,
hitNode: C,
begin: K
})
}, setPreventEventDefault: function (x, c) {
var T = this,
f = T._eventListeners[x];
f ? f._prevent = c : T._eventListeners[x] = f = {
_removal: Z,
_prevent: c
}
}, removeListener: function (L) {
var c = this,
T = c._eventListeners[L];
T && T._removal && (T._removal(), T._removal = Z)
}, addListener: function (G) {
var s = this,
v = s._eventListeners[G];
if (v || (s._eventListeners[G] = v = {
_removal: Z,
_prevent: !0
}), !v || !v._removal) {
var f = function (I) {
v._prevent && u.preventDefault(I), s.disabled || ("wheel" === G ? sg(s, I) : s["handle_" + G](I))
};
K(s.gv.getView(), G, f), v._removal = function () {
b(s.gv.getView(), G, f)
}
}
}, handleWindowTouchMove: function (r) {
this.handleWindowMouseMove(r)
}, handleWindowMouseMove: function (v) {
this.downInfo && (this.isDragging ? this.handleDownInfo("onDrag", v) : (this.handleDownInfo("onBeginDrag", v), this.isDragging = !0))
}, handleWindowTouchEnd: function (j) {
this.handleWindowMouseUp(j)
}, handleWindowMouseUp: function (k) {
if (this.isDragging && (this.handleDownInfo("onEndDrag", k), this.isDragging = !1), this.downInfo) {
var c = this.handle("onUp", k);
if (c && c.data === this.downInfo.data) {
this.handleMissingUp(k);
var J = this,
z = 2 === k.button ? "onContextMenu" : "onClick";
if (!J._dbclickTimer) return J._dbclickTimer = cd(function () {
delete J._dbclickTimer, J.handleClick(k, z, c), this.downInfo = F
}, u.clickDelay), void 0;
nr(J._dbclickTimer), delete J._dbclickTimer, z = "onDoubleClick", J.handleClick(k, z, c)
} else this.handleDownInfo("onUp", k);
this.downInfo = F
}
}, handle_mouseleave: function (f) {
var e = this,
w = e.gv,
z = e.currentInfo ? e.currentInfo.data : F;
if (z) {
z.s("onLeave") && z.s("onLeave")(f, z, w), e.fire("data", "onLeave", f, z);
var X = e.currentInfo ? e.currentInfo.hits : F;
if (X)
for (var R in X) e.handleLeave(f, R);
e.currentInfo = F
}
}, handle_mousewheel: function (R) {
R.scrollDelta = R.wheelDelta / 40, this.handle("onScroll", R)
}, handle_DOMMouseScroll: function (E) {
E.scrollDelta = 2 === E.axis ? -E.detail : 0, this.handle("onScroll", E)
}, handle_touchstart: function (r) {
this.handle_mousedown(r)
}, handle_touchmove: function (x) {
this.handle("onMove", x)
}, handle_mousedown: function (G) {
this.isDragging && (this.handleDownInfo("onEndDrag", G), this.isDragging = !1), this.downInfo = this.handle("onDown", G), this.downInfo && Lj(this, G)
}, handle_mousemove: function (p) {
var k = this,
$ = k.gv;
k._hoverTimer && (nr(k._hoverTimer), delete k._hoverTimer);
var h, I, T, S = k.handle("onMove", p),
w = this.currentInfo ? this.currentInfo.data : F,
v = this.currentInfo ? this.currentInfo.hits : F;
if (S && (I = S.data, T = S.hits, k._hoverTimer = cd(function () {
nr(k._hoverTimer), delete k._hoverTimer, k.handle("onHover", p, S)
}, $.getHoverDelay() || u.hoverDelay)), I !== w) {
if (w && (w.s("onLeave") && w.s("onLeave")(p, w, $), this.fire("data", "onLeave", p, w)), I && (I.s("onEnter") && I.s("onEnter")(p, I, $), this.fire("data", "onEnter", p, I)), v)
for (h in v) this.handleLeave(p, h);
if (T)
for (h in T) {
var O = T[h],
R = I._interactPrefix = O.prefix,
Y = R && I.a(R + "onEnter") || O.target.onEnter;
Y && Y.call(O.target, p, I, $, O.point, O.width, O.height), this.fire(O.type, "onEnter", O.event, O.data, O.image, O.comp, O.point, O), I._interactPrefix = null
}
} else {
if (v)
for (h in v) T && T[h] || this.handleLeave(p, h);
if (T)
for (h in T)
if (!v || !v[h]) {
var O = T[h],
R = I._interactPrefix = O.prefix,
Y = R && I.a(R + "onEnter") || O.target.onEnter;
Y && Y.call(O.target, p, I, $, O.point, O.width, O.height), this.fire(O.type, "onEnter", O.event, O.data, O.image, O.comp, O.point, O), I._interactPrefix = null
}
}
this.currentInfo = S
}, handle: function (M, r, m) {
var D, j = this,
v = j.gv;
if (j._is2d) {
if (m = m || v.getDataInfoAt(r), !m || !v.isInteractive(m.data)) return;
if (D = m.ui.interactiveInfo) {
var u, f = m.data;
if (f.s(M) && f.s(M)(r, f, v), this.fire("data", M, r, f), "body" === m.part && D.bodyInfo) u = "body", m.hits = this.handleImage(u, v.getImage(f), M, r, f, m.point, D.bodyInfo);
else if ("icons" === m.part && D._38o) {
var J = D._38o[m.name];
J && J[m.index] && (u = "icons|" + m.name + "|" + m.index, m.hits = this.handleImage(u, m.icon, M, r, f, m.point, J[m.index]))
}
}
return m
}
var f, K;
if (!m)
if (r && r instanceof O.Math.Ray) {
var y = v.vr.intersectWorld(r);
if (f = y.data, K = y.intersect, j.drawVRRay(r, f, K), !f) return;
var n = v.getData3dUI(f);
if (D = n.interactiveInfo, !D) return;
m = {
data: f,
part: K.part,
ui: n
}
} else {
if (m = v.getDataInfoAt(r), !m) return;
m && (m = {
data: m.data,
part: m.part
})
}
if (v.isInteractive(m.data)) {
if (!K) {
f = m.data;
var n = v.getData3dUI(f);
if (m.ui = n, D = n.interactiveInfo, !D) return m;
if (K = v.intersectObject(r, f), !K) return
}
f.s(M) && f.s(M)(r, f, v), this.fire("data", M, r, f);
var z, B = K.part;
return "body" !== B && (z = f.s(B + ".image") || f.s("shape3d." + B + ".image")), z || (z = f.s("all.image") || f.s("shape3d.image")), z ? (D = "object" == typeof z ? D[z.uuid] : D[z], D && D.bodyInfo ? (m.part = "body", m.interactiveInfo = D, m.point = this._convertUVToPoint(K.uv, D), m.image = z, m.hits = this.handleImage("body", z, M, r, f, m.point, D.bodyInfo), m) : m) : m
}
}, _handleLeaveOrMissing: function (J, E, I) {
var v = "leave" === J ? this.currentInfo : this.downInfo;
if (v) {
var j = v.interactiveInfo || v.ui.interactiveInfo;
if (j) {
var C, $, z = v.data;
if (this._is2d) {
if ($ = this.gv.lp(E), "body" === v.part && j.bodyInfo) C = "body", "leave" === J ? this.handleLeaveImage(I, C, this.gv.getImage(z), E, z, $, j.bodyInfo) : this.handleMissingUpImage(C, this.gv.getImage(z), E, z, $, j.bodyInfo);
else if ("icons" === v.part && j._38o) {
var R = j._38o[v.name];
R && R[v.index] && (C = "icons|" + v.name + "|" + v.index, "leave" === J ? this.handleLeaveImage(I, C, v.icon, E, z, $, R[v.index]) : this.handleMissingUpImage(C, v.icon, E, z, $, R[v.index]))
}
} else {
if (!j.bodyInfo) return;
var r = this.gv.intersectObject(E, z);
$ = r && r.uv ? this._convertUVToPoint(r.uv, j) : {
x: 1 / 0,
y: 1 / 0
}, "leave" === J ? this.handleLeaveImage(I, "body", v.image, E, z, $, j.bodyInfo) : this.handleMissingUpImage("body", v.image, E, z, $, j.bodyInfo)
}
}
}
}, handleClick: function (l, h, M) {
var x = this,
B = this.downInfo;
if (B && M) {
var Y, c = M.interactiveInfo || M.ui.interactiveInfo,
W = M.data,
q = this.gv;
if (W.s(h) && W.s(h)(l, W, q), x.fire("data", h, l, W), c)
if (this._is2d) {
if (B.part === M.part) {
var n = q.lp(l);
"body" === M.part && c.bodyInfo && (Y = "body", this.handleClickImage(Y, q.getImage(W), h, l, W, n, c.bodyInfo, M))
}
} else {
if (!c.bodyInfo) return;
var U = q.intersectObject(l, W);
if (!U) return;
n = this._convertUVToPoint(U.uv, c), this.handleClickImage("body", B.image, h, l, W, n, c.bodyInfo, M)
}
}
}, handleDownInfo: function (T, B) {
if (this.downInfo) {
var w = this.downInfo,
q = this.gv,
d = w.interactiveInfo || w.ui.interactiveInfo;
if (d) {
var W, N = w.data;
if (N.s(T) && N.s(T)(B, N, q), this.fire("data", T, B, N), this._is2d) {
var D = q.lp(B);
if ("body" === w.part && d.bodyInfo) W = "body", this.handleDownInfoImage(W, q.getImage(N), T, B, N, D, d.bodyInfo);
else if ("icons" === w.part && d._38o) {
var t = d._38o[w.name];
t && t[w.index] && (W = "icons|" + w.name + "|" + w.index, this.handleDownInfoImage(W, w.icon, T, B, N, D, t[w.index]))
}
} else {
if (!d.bodyInfo) return;
var K = q.intersectObject(B, N);
if (!K) return;
D = this._convertUVToPoint(K.uv, d), this.handleDownInfoImage("body", w.image, T, B, N, D, d.bodyInfo)
}
}
}
}, fire: function (N, u, v, H, i, g, U, q) {
this.gv.fi({
kind: u,
type: N,
event: v,
data: H,
image: i,
comp: g,
view: this.gv,
point: U,
width: q ? q.width : Z,
height: q ? q.height : Z
})
}, handleImage: function (j, I, E, F, t, W, m) {
var $ = {};
if (I && (I = ii(I))) {
var B = this.gv,
b = m.rect,
s = this.convertPoint(W, m);
s.inRect && (I[E] && I[E](F, t, B, s, b.width, b.height), this.fire("image", E, F, t, I, Z, s, b), $[j + "|image"] = {
target: I,
type: "image",
image: I,
data: t,
event: F,
point: s,
width: b.width,
height: b.height
});
for (var l, R = m.compInfos, e = I, L = R.length - 1; L >= 0; L--) {
var q = R[L],
z = q.comp;
if (s = this.convertPoint(W, q, e, z, B, t), s.inRect) {
b = q.rect;
var y = t._interactPrefix = q.prefix,
h = y && t.a(y + E) || z[E];
if (h && (l = h.call(z, F, t, B, s, b.width, b.height)), this.fire("comp", E, F, t, I, z, s, b), l !== !0 && (I = b.image) && (I[E] && (l = I[E](F, t, B, s, b.width, b.height)), this.fire("image", E, F, t, I, Z, s, b)), t._interactPrefix = null, $[j + "|" + L] = {
target: z,
type: "comp",
comp: z,
image: I,
data: t,
event: F,
point: s,
width: b.width,
height: b.height,
prefix: y
}, I && ($[j + "|" + L + "|image"] = {
target: I,
type: "image",
image: I,
data: t,
event: F,
point: s,
width: b.width,
height: b.height,
prefix: y
}), l === !0) break
}
}
}
return $
}, handleLeave: function (S, F) {
return this._handleLeaveOrMissing("leave", S, F)
}, handleMissingUp: function (Z) {
return this._handleLeaveOrMissing("missing", Z)
}, handleLeaveImage: function (u, E, B, L, v, b, Q) {
if (B && (B = ii(B))) {
var z = this.gv,
w = Q.rect,
x = this.convertPoint(b, Q);
u === E + "|image" && (B.onLeave && B.onLeave(L, v, z, x, w.width, w.height), this.fire("image", "onLeave", L, v, B, Z, x, w));
for (var j, f = Q.compInfos, P = B, l = f.length - 1; l >= 0; l--) {
var q = f[l],
M = q.comp;
x = this.convertPoint(b, q, P, M, z, v), w = q.rect;
var D = v._interactPrefix = q.prefix;
if (u === E + "|" + l) {
var t = D && v.a(D + "onLeave") || M.onLeave;
t && (j = t.call(M, L, v, z, x, w.width, w.height)), this.fire("comp", "onLeave", L, v, B, M, x, w)
}
if (j !== !0 && (B = w.image) && u === E + "|" + l + "|image" && (B.onLeave && (j = B.onLeave(L, v, z, x, w.width, w.height)), this.fire("image", "onLeave", L, v, B, Z, x, w)), v._interactPrefix = null, j === !0) break
}
}
}, handleMissingUpImage: function (M, I, $, T, m, g) {
var N = "onUp",
A = this.downInfo.hits;
if (A && I && (I = ii(I))) {
var L = this.gv,
y = g.rect,
W = this.convertPoint(m, g);
!W.inRect && A[M + "|image"] && (I[N] && I[N]($, T, L, W, y.width, y.height), this.fire("image", N, $, T, I, Z, W, y));
for (var U, j = g.compInfos, G = I, C = j.length - 1; C >= 0; C--) {
var w = j[C],
B = w.comp;
if (W = this.convertPoint(m, w, G, B, L, T), !W.inRect) {
y = w.rect;
var b = T._interactPrefix = w.prefix;
if (A[M + "|" + C]) {
var P = b && T.a(b + N) || B[N];
P && (U = P.call(B, $, T, L, W, y.width, y.height)), this.fire("comp", N, $, T, I, B, W, y)
}
if (U !== !0 && (I = y.image) && A[M + "|" + C + "|image"] && (I[N] && (U = I[N]($, T, L, W, y.width, y.height)), this.fire("image", N, $, T, I, Z, W, y)), T._interactPrefix = null, U === !0) break
}
}
}
}, handleDownInfoImage: function (H, L, M, E, n, p, l) {
var Y = this.downInfo.hits;
if (Y && L && (L = ii(L))) {
var j = this.gv,
P = l.rect,
D = this.convertPoint(p, l);
Y[H + "|image"] && (L[M] && L[M](E, n, j, D, P.width, P.height), this.fire("image", M, E, n, L, Z, D, P));
for (var g, V = l.compInfos, S = L, N = V.length - 1; N >= 0; N--) {
var B = V[N],
X = B.comp;
D = this.convertPoint(p, B, S, X, j, n), P = B.rect;
var z = n._interactPrefix = B.prefix;
if (Y[H + "|" + N]) {
var $ = z && n.a(z + M) || X[M];
$ && (g = $.call(X, E, n, j, D, P.width, P.height)), this.fire("comp", M, E, n, L, X, D, P)
}
if (g !== !0 && (L = P.image) && Y[H + "|" + N + "|image"] && (L[M] && (g = L[M](E, n, j, D, P.width, P.height)), this.fire("image", M, E, n, L, Z, D, P)), n._interactPrefix = null, g === !0) break
}
}
}, handleClickImage: function (d, u, n, v, A, b, c, o) {
var k = this.downInfo.hits,
U = o.hits;
if (k && u && (u = ii(u))) {
var X = this.gv,
F = c.rect,
q = this.convertPoint(b, c);
k[d + "|image"] && (u[n] && u[n](v, A, X, q, F.width, F.height), this.fire("image", n, v, A, u, Z, q, F));
for (var _, B = c.compInfos, D = u, e = B.length - 1; e >= 0; e--) {
var J = B[e],
g = J.comp;
q = this.convertPoint(b, J, D, g, X, A), F = J.rect;
var P = A._interactPrefix = J.prefix;
if (k[d + "|" + e] && U[d + "|" + e]) {
var j = P && A.a(P + n) || g[n];
j && (_ = j.call(g, v, A, X, q, F.width, F.height)), this.fire("comp", n, v, A, u, g, q, F)
}
if (_ !== !0 && (u = F.image) && k[d + "|" + e + "|image"] && (u[n] && (_ = u[n](v, A, X, q, F.width, F.height)), this.fire("image", n, v, A, u, Z, q, F)), A._interactPrefix = null, _ === !0) break
}
}
}, initImageResource: function () {
u.setImage("coreInteractorRayHitImage", {
width: 16,
height: 16,
comps: [{
type: "oval",
background: "rgb(255,0,0)",
borderWidth: 1,
borderColor: "rgb(250,120,120)",
opacity: .3,
rotation: -1.593,
rect: [.73315, .6933, 14.5337, 14.61341]
}, {
type: "oval",
background: "rgb(255,0,0)",
borderWidth: 1,
borderColor: "rgb(250,120,120)",
rotation: -1.593,
rect: [3.56695, 3.75073, 8.8661, 8.49856]
}]
})
}, _convertUVToPoint: function (w, O) {
if (!w) return {
x: 1 / 0,
y: 1 / 0
};
var n = O.bodyInfo.rect,
N = w.clone(),
g = w.multiply({
x: n.width,
y: n.height
});
return g.local = N, g
}, convertPoint: function (R, P, t, m, O, S) {
var $ = P.rect,
i = P.matrix.applyInverse(R).sub($),
z = i.x >= 0 && i.y >= 0 && i.x <= $.width && i.y <= $.height;
if (!z) return i;
if (m && Dj(m.pixelPerfect, S, O)) {
var $, k = 1;
this._is2d ? (k = O.getZoom(), $ = Cc(R.x, R.y, Z, k)) : $ = Cc(R.x, R.y);
var N = !1,
B = $.x,
s = $.y,
f = $.width,
V = $.height,
x = u.hitMaxArea,
T = f * V * k * k;
if (T > x) {
var c = Math.sqrt(x / T);
k *= c
}
f *= k, V *= k, 2 > f && (f = 2), 2 > V && (V = 2), B *= k, s *= k;
var I = Cr(f, V),
q = new Np(0, -B, -s, k, k);
q.append(P.matrix), O._drawForChecking = !0, m.transform = q, P.refRect && P.refRect.fitSize && (m.refRect = P.refRect);
var p = t.comps;
t.comps = [m], Yd(I, t, 0, 0, f, V, S, self), t.comps = p, delete m.refRect, delete m.transform, O._drawForChecking = !1;
try {
for (var v = 0, J = I.getImageData(0, 0, f, V).data; v < J.length; v += 4)
if (0 !== J[v + 3]) {
N = !0;
break
}
I.restore()
} catch (o) {
xm = F, N = !1
}
i.inRect = N
} else i.inRect = !0;
return i
}
});
var pk = hg.DefaultInteractor = function (C) {
fi(pk, this, [C])
};
Bb("DefaultInteractor", Zp, {
handle_mousedown: function (q) {
Qc(q);
var k = this,
R = k.gv,
Q = R.getDataAt(q);
if (R.setFocus(q) && !R._editing && !R._scrolling) {
wm(q) ? R.handleDoubleClick(q, Q) : R.handleClick(q, Q);
var I = Fm(q);
!Cf() && !I && Q && (R.isMovable(Q) || R._39Q(Q)) || !R.isPannable() || !jj(q) && !I || ik(q) || (k._tx = R.tx(), k._ty = R.ty(), k.startDragging(q))
}
}, handleWindowMouseUp: function (X) {
var e = this,
l = e.gv;
l._panning && (delete l._panning, l.onPanEnded(), e.fi({
kind: "endPan",
event: X
})), delete e._tx, delete e._ty, e.clearDragging()
}, handle_mousemove: function (F) {
var q = this,
C = q.gv;
q._hoverTimer && (nr(q._hoverTimer), delete q._hoverTimer), q._hoverTimer = cd(function () {
q.fi({
kind: "hover",
event: F
}), nr(q._hoverTimer), delete q._hoverTimer
}, C.getHoverDelay() || u.hoverDelay)
}, handle_touchmove: function (U) {
this.handle_mousemove(U)
}, handleWindowMouseMove: function (S) {
var I = this,
u = I.gv;
I.fi({
kind: u._panning ? "betweenPan" : "beginPan",
event: S
}), u._panning = 1;
var g = wq(u, S, I._lastClientPoint);
u.setTranslate(I._tx + g.x, I._ty + g.y)
}, handle_mousewheel: function (P) {
this.gv.handleScroll(P, P.wheelDelta)
}, handle_DOMMouseScroll: function (D) {
2 === D.axis && this.gv.handleScroll(D, -D.detail)
}, handle_keydown: function (g) {
this.gv.handleKeyDown(g)
}
});
var ng = hg.SelectInteractor = function (t) {
fi(ng, this, [t])
};
Bb("SelectInteractor", Zp, {
_42: function () {
var c = this,
i = c.gv,
B = i.getZoom(),
K = c.mark,
g = c.div;
g || (g = c.div = dd(), sn(c.getView(), g));
var D = {};
D.x = K.x * B + i.tx(), D.y = K.y * B + i.ty(), D.width = K.width * B, D.height = K.height * B, qp(g, D), this.intersects() ? (g.style.border = "", g.style.background = i.getRectSelectBackground()) : (g.style.background = "", g.style.border = "1px solid " + i.getRectSelectBorderColor())
}, handle_mousedown: function (z) {
var v = this,
E = v.gv;
if (v._57I = F, v.pendingClickThrough = F, !(E._editing || E._scrolling || Cf() || Fm(z))) {
var g = E.getDataAt(z),
I = E.sm();
g ? ik(z) ? I.co(g) ? I.rs(g) : I.as(g) : I.co(g) ? g instanceof Br && g.isClickThroughEnabled() && jj(z) && (v.pendingClickThrough = lb(z)) : I.ss(g) : ik(z) || !E.isPannable() ? jj(z) && (ik(z) || I.cs(), E.isRectSelectable() && (v.startDragging(z), E._77O = 1)) : jj(z) && (v._57I = lb(z))
}
}, handle_mouseup: function (_) {
var y = this,
S = y.gv,
Z = y._57I;
if (Z && (En(Z, lb(_)) <= 1 && S.sm().cs(), y._57I = F), y.pendingClickThrough) {
if (En(y.pendingClickThrough, lb(_)) <= 1) {
var n = S.getDataAt(_);
if (n instanceof Br && n.isClickThroughEnabled()) {
var h = S.getDataAt(_, function (f) {
var u = f.getParent() === n && S.isSelectable(f, !0);
return u
});
h && (_.clickThrough = !0, S.sm().ss(h))
}
}
y.pendingClickThrough = F
}
}, handleWindowMouseUp: function (Y) {
this.clear(Y)
}, handleWindowMouseMove: function (U) {
var K = this,
$ = K.gv;
K._logicalPoint = $.lp(U), K.mark ? (K.fi({
kind: "betweenRectSelect",
event: U
}), $.isPannable() && K.autoScroll(U), K.redraw()) : K.fi({
kind: "beginRectSelect",
event: U
}), K.mark = ms(K._lastLogicalPoint, K._logicalPoint), K.redraw()
}, intersects: function () {
var J = this,
v = J._lastLogicalPoint,
b = J._logicalPoint;
return v.x > b.x || v.y > b.y
}, clear: function (w) {
var G = this,
O = G.gv,
Y = G.mark;
if (G._57I = F, G.pendingClickThrough = F, G._lastLogicalPoint) {
if (Y) {
if (0 !== Y.width && 0 !== Y.height) {
var $ = O.getDatasInRect(Y, G.intersects());
if (!$.isEmpty()) {
var P = O.sm(),
E = P.toSelection();
$.each(function (h) {
P.co(h) ? E.remove(h) : E.add(h)
}), P.ss(E)
}
}
yj(G.div), delete G.div, delete G.mark, G.redraw(), G.fi({
kind: "endRectSelect",
event: w
}), O.onRectSelectEnded()
}
G.clearDragging(), delete O._77O
}
}, redraw: function () {
var u = this;
u._draw || (u._draw = 1, cd(function () {
u.mark && u._42(), delete u._draw
}, 16))
}
});
var Wr = hg.MoveInteractor = function (l) {
fi(Wr, this, [l])
};
Bb("MoveInteractor", Zp, {
handle_mousedown: function (y) {
var n = this,
m = n.gv;
if (jj(y) && !m._editing && !m._scrolling && !Cf()) {
var w = m.getSelectedDataAt(y);
!w || m._39Q(w) && !m.isMovable(w) ? m._focusData = F : (n._data = w, m.handleMouseDown && m.handleMouseDown(y, w), n.startDragging(y), m.isMovable(w) && (m._moving = 1))
}
}, handleWindowMouseUp: function (J) {
var U = this,
F = U.gv;
F.handleMouseUp && F.handleMouseUp(J, U._data), U.clear(J)
}, handleWindowMouseMove: function (v) {
var E = this,
t = E._data,
U = E.gv;
if ((!U._93O || !U._93O(v, t)) && U._moving) {
E._logicalPoint || E.fi({
kind: "prepareMove",
event: v
});
var Y = E._logicalPoint ? "betweenMove" : "beginMove",
W = {
kind: Y,
event: v
},
$ = E._logicalPoint = U.lp(v);
"beginMove" !== Y || E._alreadyBeginTransaction || (E._alreadyBeginTransaction = !0, U.getDataModel().beginTransaction());
var R = E._calcShift(Y, v),
O = R.x,
J = R.y,
k = E.gv.getMoveMode(v, t);
k && ("x" === k ? J = 0 : "y" === k ? O = 0 : "xy" !== k && (O = J = 0)), U.moveSelection(O, J), E._lastLogicalPoint = $, E.autoScroll(v), E.fi(W)
}
}, _calcShift: function () {
var m = this,
s = m._logicalPoint,
t = m._lastLogicalPoint,
q = s.x - t.x,
x = s.y - t.y;
return {
x: q,
y: x
}
}, clear: function (u) {
var P = this,
L = P.gv;
P._lastLogicalPoint && (P._lastLogicalPoint = P._data = L._moving = F, P._logicalPoint && (P.fi({
kind: "endMove",
event: u
}), L.onMoveEnded()), P.clearDragging()), P._alreadyBeginTransaction && (P._alreadyBeginTransaction = !1, L.getDataModel().endTransaction())
}
});
var eb = hg.TextEditInteractor = function (C) {
fi(eb, this, [C]), this.init()
};
Bb("TextEditInteractor", Zp, {
init: function () {
var m = this,
_ = this.input = U.createElement("input"),
V = _.style;
_.text = "text", V.border = "1px solid #d8d8d8", V.position = "absolute", V.padding = "2px 3px", V.outline = "none", V.marginLeft = "-90px", V.marginTop = "-16px", V.backgroundColor = "rgba(255,255,255, 0.9)", V.fontSize = "14px", V.width = "180px", V.height = "32px", V.boxShadow = "0 0 13px rgba(16,142,233, 0.5)", V.textAlign = "center", V.boxSizing = "border-box", K(_, "keyup", function (S) {
hd(S) && m.endTextEdit()
}), K(_, "focus", function () {
_.select()
});
var F = this.textarea = U.createElement("textarea"),
R = this.wrap = U.createElement("div");
R.appendChild(F), V = F.style, V.margin = 0, V.padding = "4px", V.overflow = "hidden", V.boxSizing = "border-box", V.position = "absolute", V.outline = "none", V.backgroundColor = "transparent", V.resize = "none", V.textAlign = "center", V.fontSize = "14px", V.border = "none", V.borderWidth = 0, V.width = "100%", V.top = "50%", V = R.style, V.boxSizing = "border-box", V.margin = 0, V.padding = 0, V.position = "absolute", V.boxShadow = "0 0 13px rgba(16,142,233, 0.5)", V.border = "1px solid #d8d8d8", V.backgroundColor = "rgba(255,255,255, 0.9)", V.width = "180px", V.marginLeft = "-90px", K(F, "keydown", function (t) {
return (Pf() || ik()) && hd(t) ? (m.endTextEdit(), void 0) : (m.calculateTextareaHeight(String.fromCharCode(t.keyCode)), void 0)
}), K(F, "focus", function () {
F.select()
});
var C = function (p) {
p.stopPropagation()
};
K(_, "mousedown", C), K(_, "touchstart", C), K(F, "mousedown", C), K(F, "touchstart", C), m.SIZING_STYLE = ["letter-spacing", "line-height", "padding-top", "padding-bottom", "font-family", "font-weight", "font-size", "text-rendering", "text-transform", "width", "text-indent", "padding-left", "padding-right", "border-width", "box-sizing"], m.HIDDEN_TEXTAREA_STYLE = "visibility:hidden; min-height:0 !important;max-height:none !important;height:0 !important;visibility:hidden !important;overflow:hidden !important;position:absolute !important;z-index:-1000 !important;top:0 !important;right:0 !important", m.handleWindowClick = function (x) {
var q = m._editingDOM;
if (q) {
var X = q.getBoundingClientRect(),
G = lb(x);
cf(X, G) || m.endTextEdit()
}
}
}, handle_mousedown: function (P) {
var l = this,
$ = l.gv;
if (wm(P) && !$._editing) {
var M = $.getDataAt(P);
if (M) {
var a = $.getTextEditInfo(M);
a && (this._editInfo = a, this._editTarget = M, $._editing = !0, a.isMultiline ? this.handleMultilineEdit() : this.handleTextEdit())
}
}
}, handleMultilineEdit: function () {
var l = this,
d = l.gv,
F = l._editTarget,
f = l.getTargetValue(),
Y = l.textarea,
R = l.wrap;
this.hiddenTextarea || this.createHiddenTextarea(), (null === f || f === Z) && (f = ""), Y.value = f, l._editingDOM = Y, d.getView().appendChild(R), this.layoutHTML(R, F), this.calculateTextareaHeight(), cd(function () {
Y.focus(), K(x, "mousedown", l.handleWindowClick), K(x, "touchstart", l.handleWindowClick)
}, 10)
}, handleTextEdit: function () {
var o = this,
H = o.gv,
s = o._editTarget,
q = o.getTargetValue(),
N = o.input;
(null === q || q === Z) && (q = ""), N.value = q, o._editingDOM = N, H.getView().appendChild(N), this.layoutHTML(N, s), cd(function () {
N.focus(), K(x, "mousedown", o.handleWindowClick), K(x, "touchstart", o.handleWindowClick)
}, 10)
}, layoutHTML: function (X, z) {
var J = this.gv,
t = J.getZoom();
if (z instanceof O.Node) {
var Z = z.getRect();
X.style.left = (Z.x + Z.width / 2) * t + J.tx() + "px", X.style.top = (Z.y + Z.height / 2) * t + J.ty() + "px"
} else if (z instanceof O.Edge) {
var E = J.getDataUI(z),
Z = E._6I;
X.style.left = (Z.x + Z.width / 2) * t + J.tx() + "px", X.style.top = (Z.y + Z.height / 2) * t + J.ty() + "px"
}
}, endTextEdit: function () {
var m = this,
V = m._editInfo.isMultiline ? m.wrap : m.input,
$ = m._editInfo.isMultiline ? m.textarea : m.input;
m.setTargetValue($.value), m.gv.getView().removeChild(V), m.gv._editing = !1, delete m._editingDOM, b(x, "mousedown", m.handlelick), b(x, "touchstart", m.handleWindowClick)
}, setTargetValue: function (X) {
var D = this,
P = D._editTarget,
E = D._editInfo,
V = E.accessType,
g = E.name;
if (g && V || (V = "p", g = "name"), "p" === V) {
var T = O.Default.setter(g);
P[T](X)
} else "a" === V ? P.a(g, X) : P.s(g, X)
}, getTargetValue: function () {
var u = this,
y = u._editTarget,
b = u._editInfo,
W = b.accessType,
j = b.name;
if (j && W || (W = "p", j = "name"), "p" === W) {
var z = O.Default.getter(j);
return y[z]()
}
return "a" === W ? y.a(j) : y.s(j)
}, createHiddenTextarea: function () {
this.hiddenTextarea = U.createElement("textarea"), this.hiddenTextarea.setAttribute("style", "margin:0; padding:0; position:absolute; overflowY:scroll; resize:none; box-sizing:border-box;"), this.hiddenTextarea.setAttribute("rows", "1"), this.gv.getView().appendChild(this.hiddenTextarea)
}, calculateHTMLStyle: function (n, K) {
if (K && this.computedStyleCache) return this.computedStyleCache;
var l = this,
z = x.getComputedStyle(n),
U = z.getPropertyValue("box-sizing") || z.getPropertyValue("-moz-box-sizing") || z.getPropertyValue("-webkit-box-sizing"),
v = parseFloat(z.getPropertyValue("padding-bottom")) + parseFloat(z.getPropertyValue("padding-top")),
G = parseFloat(z.getPropertyValue("border-bottom-width")) + parseFloat(z.getPropertyValue("border-top-width")),
h = l.SIZING_STYLE.map(function (A) {
return A + ":" + z.getPropertyValue(A)
}).join(";"),
R = {
sizingStyle: h,
paddingSize: v,
borderSize: G,
boxSizing: U
};
return K && (this.computedStyleCache = R), R
}, calculateTextareaHeight: function (P) {
P = P || "";
var Y = this,
S = Y.textarea,
Z = Y.hiddenTextarea,
t = Y.wrap,
g = 32,
C = Y.calculateHTMLStyle(S, !1),
G = C.paddingSize,
n = C.borderSize,
X = C.boxSizing,
$ = C.sizingStyle;
Z.setAttribute("style", $ + ";" + Y.HIDDEN_TEXTAREA_STYLE), Z.value = S.value + P;
var V = Z.scrollHeight;
"border-box" === X ? V += n : "content-box" === X && (V -= G), S.style.height = V + "px", S.style.marginTop = 0 - .5 * V + "px", t.style.height = Math.max(V, g) + "px", t.style.marginTop = V * -.5 + "px"
}
});
var Vl = hg.ScrollBarInteractor = function (u) {
fi(Vl, this, [u])
};
Bb("ScrollBarInteractor", Zp, {
_41o: function () {
return this.gv.getViewRect().height < this.gv.getScrollRect().height
}, _40o: function () {
return this.gv.getViewRect().width < this.gv.getScrollRect().width
}, isV: function (u) {
var y = this.gv.getViewRect();
return this._41o() && (y.x + y.width - this.gv.lp(u).x) * this.gv.getZoom() < co
}, isH: function (r) {
var z = this.gv.getViewRect();
return this._40o() && (z.y + z.height - this.gv.lp(r).y) * this.gv.getZoom() < co
}, handle_mousemove: function (z) {
this.handle_touchmove(z)
}, handle_touchmove: function (x) {
if (!si && jj(x) && this.gv.isScrollBarVisible()) {
var r = this,
_ = r.isV(x),
X = r.isH(x);
(_ || X) && r.gv.showScrollBar(), r.gv._scrolling = _ || X
}
}, handleWindowMouseUp: function (E) {
this.handleWindowTouchEnd(E)
}, handleWindowTouchEnd: function (D) {
this._state = this._cp = this._tx = this._ty = this.gv._scrolling = F, this.fi({
kind: "endScroll",
event: D
})
}, handle_mousedown: function (E) {
this.handle_touchstart(E)
}, handle_touchstart: function (w) {
var g = this;
if (g.gv.setFocus(w), Qc(w), g.handle_touchmove(w), !(Qj(w) > 1) && g.gv._scrolling && g.gv.isScrollBarVisible()) {
g._cp = lb(w), g._tx = g.gv.tx(), g._ty = g.gv.ty();
var n = g.isV(w);
g._state = n ? "vScroll" : "hScroll", Ui(g, w), g.fi({
kind: "beginScroll",
event: w
})
}
}, handleWindowMouseMove: function (W) {
this.handleWindowTouchMove(W)
}, handleWindowTouchMove: function (d) {
var g = lb(d),
z = this.gv.getViewRect(),
G = this.gv.getScrollRect();
"vScroll" === this._state ? this.gv.ty(this._ty + (this._cp.y - g.y) * G.height / z.height) : "hScroll" === this._state && this.gv.tx(this._tx + (this._cp.x - g.x) * G.width / z.width), this.fi({
kind: "betweenScroll",
event: d
})
}
});
var Jb = hg.TouchInteractor = function (y, s) {
s = s || {}, s.selectable === Z && (s.selectable = !0), s.movable === Z && (s.movable = !0), s.pannable === Z && (s.pannable = !0), s.pinchable === Z && (s.pinchable = !0), s.editable === Z && (s.editable = !0), this.params = s, fi(Jb, this, [y])
};
Bb("TouchInteractor", Zp, {
ms_edit: 1,
setUp: function () {
var H = this;
Jb.superClass.setUp.call(H), nf && H.params.editable && H.gv.setEditInteractor(H)
}, tearDown: function () {
var _ = this;
Jb.superClass.tearDown.call(_), nf && _.params.editable && _.gv.setEditInteractor(F)
}, clear: function (l) {
var P = this,
k = P.gv;
k._moving && (P.fi({
kind: "endMove",
event: l
}), delete k._moving, k.onMoveEnded(), k.dm().endTransaction()), k._panning && (P.fi({
kind: "endPan",
event: l
}), delete k._panning, k.onPanEnded()), k._pinching && (P.fi({
kind: "endPinch",
event: l
}), delete k._pinching, k.onPinchEnded()), k._editing && (P._46O(l), P._77I = P._node = P._edge = P._shape = P._rect = P._89I = P._index = k._editing = F), P.pendingClickThrough = P._moving = P._panning = P._pinching = P._editing = P._57I = P._data = P._beginHistory = F, P.clearDragging()
}, handle_touchstart: function (g) {
var u = this;
if (!u.gv._editing) {
Qc(g), u._57I = F, u.pendingClickThrough = F;
var j = u.params,
A = u.gv,
Y = A.sm(),
I = A.getDataAt(g),
P = Qj(g);
if (1 === P) {
if (wm(g)) return A.handleDoubleClick(g, I), void 0;
A.handleClick(g, I), I && (A.handleMouseDown && A.handleMouseDown(g, I), u._data = I), j.selectable || (I = F), I && (Y.co(I) ? I instanceof Br && I.isClickThroughEnabled() && (u.pendingClickThrough = lb(g)) : Y.ss(I), j.editable && A.isEditable(I) && u._79I(g, I, !0) ? (u._editing = 1, u.startDragging(g)) : j.movable && A.isMovable(I) && (u._moving = 1, u.startDragging(g))), I && A.isMovable(I) || (u._57I = lb(g), j.pannable && A.isPannable() && (u._panning = 1, u.startDragging(g), u._translate = {
x: A.tx(),
y: A.ty()
}))
} else if (j.pinchable && 2 === P) {
if (I && A._39Q(I)) return;
u._pinching = 1, u.startDragging(g);
var $ = A.getView(),
V = A.getZoom(),
N = $.getBoundingClientRect(),
n = g.touches[0],
C = g.touches[1],
d = {
x: (n.clientX + C.clientX) / 2 - N.left,
y: (n.clientY + C.clientY) / 2 - N.top
};
d.x -= A.tx(), d.y -= A.ty(), d.x /= V, d.y /= V, u._p = d, u._d = zo(g)
}
}
}, handle_touchend: function (o) {
var E = this,
t = E.gv,
g = E._57I,
j = E._data;
if (g && (En(g, lb(o)) <= 1 && !t.getDataAt(o) && t.sm().cs(), E._57I = F), j && t.handleMouseUp && t.handleMouseUp(o, j), E.pendingClickThrough) {
if (En(E.pendingClickThrough, lb(o)) <= 1) {
var j = t.getDataAt(o);
if (j instanceof Br && j.isClickThroughEnabled()) {
var c = t.getDataAt(o, function (l) {
var A = l.getParent() === j && t.isSelectable(l, !0);
return A
});
c && (o.clickThrough = !0, t.sm().ss(c))
}
}
E.pendingClickThrough = F
}
}, handleWindowTouchEnd: function (e) {
this.clear(e)
}, handleWindowTouchMove: function (V) {
var j = this,
N = j.gv,
w = Qj(V);
if (1 === w) {
var S = lb(V),
m = wq(N, S, j._lastClientPoint),
Z = En({
x: 0,
y: 0
}, m);
if (j._editing && (j._beginHistory || (j._beginHistory = 1, N.dm().beginTransaction()), N._editing = 1, j._78I(V)), j._moving) {
if (!N._moving && Z < u.touchMoveThreshold) return;
j._beginHistory || (j._beginHistory = 1, N.dm().beginTransaction()), j.handleMove(V)
} else if (j._panning) {
if (!N._panning && Z < u.touchMoveThreshold) return;
N.setTranslate(j._translate.x + m.x, j._translate.y + m.y), j.fi({
kind: N._panning ? "betweenPan" : "beginPan",
event: V
}), N._panning = 1
}
} else if (2 === w && j._pinching) {
var C = zo(V);
N.handlePinch(j._p, C, j._d), j._d = C, j.fi({
kind: N._pinching ? "betweenPinch" : "beginPinch",
event: V
}), N._pinching = 1
}
}, handleMove: function (a) {
var l = this,
E = l.gv,
q = E.lp(a);
E._93O && E._93O(a, l._data) || (E.moveSelection(q.x - l._lastLogicalPoint.x, q.y - l._lastLogicalPoint.y), l._lastLogicalPoint = q, l.autoScroll(a), l.fi({
kind: E._moving ? "betweenMove" : "beginMove",
event: a
}), E._moving = 1)
}
});
var O = x.ht,
se = O.graph._editor = {
Math: O.Math,
Guide: {}
};
se.getStyle = function (K) {
var _, V = se.StyleMap;
return V && (_ = V[K], _ !== Z) ? _ : se.DefaultStyleMap[K]
}, se.setStyle = function (h, t) {
var V = se.StyleMap;
V || (V = se.StyleMap = {}), V[h] = t
}, se.inEdit = function (A) {
return A._inXEdit === !0
}, se.startEdit = function (l) {
l._inXEdit = !0, se.Inject.doInject(l)
}, se._46O = function (M) {
M._inXEdit = !1, se.Inject.undoInject(M)
}, se.toScreenPosition = function (J, g) {
var d = J.tx(),
G = J.ty(),
T = J._zoom;
return new se.Math.Vector2(g.x * T + d, g.y * T + G)
}, se.checkHit = function (Y, l, s) {
return Y.distanceTo(l) < s ? !0 : !1
}, se.toWorldPosition = function (y, $) {
var b = y.tx(),
t = y.ty(),
E = y._zoom;
return {
x: ($.x - b) / E,
y: ($.y - t) / E
}
}, se.setAntialias = function (h, R) {
for (var E, Z = ["imageSmoothingEnabled", "webkitImageSmoothingEnabled", "mozImageSmoothingEnabled", "oImageSmoothingEnabled", "msImageSmoothingEnabled"], r = 0, v = Z.length; v > r && (E = Z[r], !(E in h)); r++);
h[E], h[E] = R
}, se.getTargetCornersOnScreen = function (q, A) {
if (!A) return null;
var f, Y = [];
if (Th(A, q)) {
var J = Rp(q, A);
f = [{
x: J.x,
y: J.y
}, {
x: J.x + J.width,
y: J.y
}, {
x: J.x + J.width,
y: J.y + J.height
}, {
x: J.x,
y: J.y + J.height
}]
} else {
if (!A.getCorners) return null;
f = A.getCorners()
}
return f.forEach(function (t) {
var S = se.toScreenPosition(q, t);
Y.push(S.x, S.y)
}), Y
}, se.log = function () { };
var Tl = se.Inject = {
_modules: []
};
Tl.registAsModule = function (_, b) {
var l = {},
K = {};
for (var s in _) {
var V = b.prototype[s];
l[s] = V
}
_.getBackup = function (b) {
return l[b]
}, _.getBackups = function () {
return l
}, K.doInject = function () {
for (var l in _) "getBackup" !== l && (b.prototype[l] = _[l])
}, K.undoInject = function () {
for (var B in _) "getBackup" !== B && (b.prototype[B] = l[B])
}, Tl._modules.push(K)
}, Tl.doInject = function (A) {
for (var c, K = Tl._modules, H = 0, e = K.length; e > H; H++) c = K[H], c.doInject(A)
}, Tl.undoInject = function (_) {
for (var c, a = Tl._modules, W = 0, o = a.length; o > W; W++) c = a[W], c.undoInject(_)
};
var Zp = O.graph.EditInteractor = function (m) {
var f = this,
F = U.createElement("canvas");
F.className = "editCanvas", F.style.position = "absolute", f._styleMap = {}, f._canvas = F, f._context = F.getContext("2d"), Zp.superClass.constructor.call(f, m), this._editDetail = !1, se.setAntialias(f._context, !1), f._subModules = [new se.Anchor(f), new se.RotateX(f), new se.MoveDummy(f), new se.Rect(f), new se.Curve(f), new se.MoveHelper(f)], f._gridGuide = new se.Guide.Grid(f), f._rectGuide = new se.Guide.Rect(f), f._hoverGuide = new se.Guide.Hover(f)
},
vm = Zp;
O.Default.def(Zp, O.graph.Interactor, {
ms_edit: 1,
ms_fire: 1
}), o.defineProperties(Zp.prototype, {
editDetail: {
get: function () {
var d = !!this._editDetail;
return d
}, set: function (y) {
var T = this,
c = T._editDetail;
c !== y && (T._editDetail = y, T.gv._editing = y, T.fp("editDetail", c, y), T.fp("pointsEditingMode", c, y), T.fi({
kind: y ? "beginEditPoints" : "endEditPoints"
}))
}
},
gvEditing: {
get: function () {
return this.gv._editing
}, set: function (c) {
(!this._editDetail || c) && (this.gv._editing = c, c || (this.editDetail = !1))
}
},
editing: {
get: function () {
return this._editing
}, set: function (_) {
this._editing = _, this.gvEditing = _
}
},
editingModule: {
get: function () {
return this._editMod
}
},
pointsEditingMode: {
get: function () {
return this.editDetail
}, set: function (l) {
var K = this;
K.editDetail !== l && (l ? K._tryEnterEditDetailMode() : K._tryQuitEditDetailMode())
}
},
gridEnabled: {
get: function () {
var J = this._gridEnabled;
if (!J) return !1;
var E = this.gv;
return E ? !0 : !0
}, set: function (G) {
G !== this._gridEnabled && (this._gridEnabled = G, this._42())
}
},
alignmentGuideEnabled: {
get: function () {
return this._agEnabled
}, set: function (r) {
r !== this._agEnabled && (this._agEnabled = r, this._42())
}
},
gridGuide: {
get: function () {
return this._gridGuide
}
},
rectGuide: {
get: function () {
return this._rectGuide
}
},
hoverGuide: {
get: function () {
return this._hoverGuide
}
}
}), Zp.prototype.getSubModule = function (r) {
var p, B, Z, v = this._subModules;
for (B = 0, Z = v.length; Z > B; B++)
if (p = v[B], p.catalog === r) return p
}, Zp.prototype.invokeSubModule = function (e, h) {
var Q = this,
b = Q._subModules;
if (b)
for (var f, K, A, I = Array.prototype.slice.call(arguments, 2), E = 0, S = b.length; S > E; E++)
if (f = b[E], K = f[e], K && (A = K.apply(f, I), A != Z && h)) return f
}, Zp.prototype.invokeSubModuleInverse = function (L, Y) {
var q = this,
U = q._subModules;
if (U)
for (var K, T, a, X = Array.prototype.slice.call(arguments, 2), W = U.length - 1; W >= 0; W--)
if (K = U[W], T = K[L], T && (a = T.apply(K, X), a != Z && Y)) return K
}, Zp.prototype.setUp = function () {
se.log("setUp");
var N = this,
n = N.gv,
L = n.getView(),
h = N._canvas;
Zp.superClass.setUp.call(N), n.setEditInteractor(N), n._79O ? L.insertBefore(h, n._79O) : L.appendChild(h), se.startEdit(n), N.invokeSubModule("setUp"), n.dm().mm(N._onDataModelChanged, N), n.dm().md(N._onDataPropertyChanged, N)
}, Zp.prototype.tearDown = function () {
se.log("tearDown");
var Y = this,
S = Y.gv,
Z = S.getView();
Y._resetCustomCursorStyle(), Zp.superClass.tearDown.call(Y), S.dm().umm(Y._onDataModelChanged, Y), S.dm().umd(Y._onDataPropertyChanged, Y), S.setEditInteractor(null), Z.removeChild(Y._canvas), Y._drawTimer && (nr(Y._drawTimer), Y._drawTimer = null), se._46O(S), Y.invokeSubModule("tearDown")
}, Zp.prototype._onDataModelChanged = function (k) {
var c = this;
("clear" === k.kind || "remove" === k.kind && c.editDetail && k.data === c.getSubModule("Curve").target) && (c.editDetail = !1, c._42())
}, Zp.prototype._onDataPropertyChanged = function (w) {
var o = this;
if (o.editDetail) {
var L = o.getSubModule("Curve"),
R = w.data;
R === L.target && (R._writing || L._handleDataChanged(w))
}
}, Zp.prototype.clear = function () {
se.log("clear")
}, Zp.prototype.redraw = function () {
this._42()
}, Zp.prototype._42 = function () {
var m = this;
m._drawTimer || (m._drawTimer = cd(function () {
m._drawTimer = null, m.drawImpl()
}, 0))
}, Zp.prototype.drawImpl = function () {
var i;
for (i in {
_42: !0
}) break;
return function () {
var M = this,
f = M._canvas,
C = M.gv,
r = C.getWidth(),
D = C.getHeight(),
t = M._context,
P = O.Default.getInternal(),
Q = x.devicePixelRatio;
(f.width !== r || f.height !== D) && P.setCanvas(f, r, D, Q), t.clearRect(0, 0, f.width, f.height);
var F = M._getValidSelection();
t.save(), t.scale(Q, Q), M._gridGuide._42(), M.invokeSubModuleInverse(i, !1, t, C, F), M._rectGuide._42(), M._hoverGuide._42(), t.restore()
}
}(), Zp.prototype._getValidSelection = function () {
var i = this,
n = i.gv,
v = n.sm().getSelection(),
K = [];
return v.each(function (N) {
n.isVisible(N) && n.isEditable(N) && K.push(N)
}), K
}, Zp.prototype.handle_touchmove = function (Q) {
return this.handle_mousemove(Q)
}, Zp.prototype.handle_mousemove = function (u) {
if (!O.Default.isDragging()) {
var K = this;
if ((K.editDetail || !Cf() && !Fm(u)) && !K.gv._externalEditing)
if (K.gvEditing = !1, K._checkEdit(u)) K.gvEditing = !0;
else {
if (!K.getStyle("hoverGuideVisible")) return;
K.hoverData = K.gv.getDataAt(u), K._42()
}
}
}, Zp.prototype.handle_touchstart = function (G) {
return this.handle_mousedown(G)
}, Zp.prototype.handle_mousedown = function (E) {
Qc(E);
var b = this;
if ((b.editDetail || !Cf() && !Fm(E)) && !b.gv._externalEditing) {
if (wm(E) && !E.clickThrough) {
if (b.editDetail) {
if (b._tryQuitEditDetailMode(E)) return
} else if (b._tryEnterEditDetailMode()) return;
b.gv.dm().beginTransaction();
var B = b.invokeSubModule("handleDoubleClick", !0, E);
if (b.gv.dm().endTransaction(), B) return
}
var T = b._checkEdit(E);
T && (b._downPosition = b._getLogicalPoint(E), b.gv.dm().beginTransaction(), T.startEdit(b, E), b.editing = !0)
}
}, Zp.prototype._checkEdit = function (U) {
var P = this,
O = P.gv,
B = P._getLogicalPoint(U),
K = P.invokeSubModule("check", !0, O, U, B) || null;
return P._editMod = K, K
}, Zp.prototype.handleWindowTouchMove = function (f) {
return this.handleWindowMouseMove(f)
}, Zp.prototype.handleWindowMouseMove = function (E) {
var D = this,
l = D._downPosition;
if (l) {
var z = D._getLogicalPoint(E);
if (z.distanceTo(l) < D.getStyle("moveSensitivity")) return;
delete D._downPosition
}
var x = D._editMod;
x && x.handleEdit(D.gv, E)
}, Zp.prototype._getLogicalPoint = function (t) {
var f = this,
e = O.Default.getLogicalPoint(t, f._canvas);
return new se.Math.Vector2(e)
}, Zp.prototype.handleWindowTouchEnd = function (J) {
return this.handleWindowMouseUp(J)
}, Zp.prototype.handleWindowMouseUp = function () {
var e;
for (e in {
_46O: !0
}) break;
return function (g) {
var W = this;
W.editing = !1, W.setCursor("default"), W.invokeSubModule(e, !1, g), W._42(), W.gv.dm().endTransaction()
}
}(), Zp.prototype.handle_mousewheel = function (B) {
var J = this;
Qc(B), J.invokeSubModule("preHandleScroll", !0) || J.gv.handleScroll(B, B.wheelDelta)
}, Zp.prototype.handleDelete = function () {
var e = this;
if (!e.editDetail) {
e.gv.dm().beginTransaction();
var u = e.invokeSubModule("handleNormalStateDelete", !0);
return e.gv.dm().endTransaction(), u || e.gv.removeSelection(), void 0
}
e.gv.dm().beginTransaction(), e.invokeSubModule("handleDelete", !0), e.gv.dm().endTransaction(), e._42()
}, Zp.prototype.handle_keydown = function (X) {
var D = this;
if ((X.metaKey || X.ctrlKey) && D._42(), Cf(X) && !D.editing) return D.gvEditing = !1, D.setCursor("default"), D._42(), void 0;
var x = hd(X);
return D.editDetail ? ((x || bj(X)) && (D.editDetail = !1, D._42()), D.gv.dm().beginTransaction(), D.invokeSubModule("handle_keydown", !0, X), D.gv.dm().endTransaction(), void 0) : (D.gv.dm().beginTransaction(), D.invokeSubModule("handleNormalStateKeyDown", !0, X), D.gv.dm().endTransaction(), x && D._tryEnterEditDetailMode(), void 0)
}, Zp.prototype.handle_keyup = function (g) {
this.gv.dm().beginTransaction(), this.invokeSubModule("handle_keyup", !0, g), this.gv.dm().endTransaction()
}, Zp.prototype._tryEnterEditDetailMode = function () {
var b = this;
return !b.editDetail && b.invokeSubModule("canEnterEditDetailMode", !0) && 1 === b._getValidSelection().length ? (b.editDetail = !0, b._42(), !0) : void 0
}, Zp.prototype._tryQuitEditDetailMode = function (A) {
var _ = this;
return _.editDetail ? !A || _.invokeSubModule("canQuitEditDetailMode", !0, A) ? (_.editDetail = !1, _._42(), !0) : !1 : !1
}, Zp.prototype.setStyle = function (J, C, N) {
var v = this;
N ? se.setStyle(J, C) : v._styleMap[J] = C, "baseColor" === J && (ci = C), v.fp("styleChanged", null, {
key: J,
value: C,
base: N
}), v._42()
}, Zp.prototype.getStyle = function (T) {
var P = this,
s = P._styleMap[T];
return s !== Z ? s : se.getStyle(T)
}, Zp.prototype.setCursor = function (d) {
this._resetCustomCursorStyle(), O.graph.EditInteractor.superClass.setCursor.call(this, d)
}, Zp.prototype._drawHostGuide = function (Y) {
var l = this,
i = l._context,
M = l.gv;
se.Icons.DrawIcon(l, i, se.Icons.NodeHoverGuide, Y.corners);
var w = Y.host;
if (w) {
var D = M.getAttachPoints(w);
if (D && D.length)
for (var X = 0, $ = D.length; $ > X; X++) {
var v = D[X],
j = Yg(M, w, 0, v.offsetX || 0, v.offsetY || 0, v.x, v.y);
j = se.toScreenPosition(M, j), j.isAttach = Y.attach === X, se.Icons.DrawIcon(l, i, se.Icons.AttachPoint, j)
}
}
}, Zp.prototype._resetCustomCursorStyle = function () {
var J = this;
if (J._customStyle) {
var H = this.gv.getView();
H.classList && H.classList.remove && H.classList.remove(J._customStyle), J._customStyle = null
}
}, Zp.prototype._setRotateCursor = function (M) {
var c = this,
z = c._cursorFactory;
z || (z = c._cursorFactory = new se.CursorFactory(c));
var B = z.getRotateCursor(M),
J = c.gv.getView();
c._resetCustomCursorStyle(), c._customStyle = B, J.classList && J.classList.add && J.classList.add(B)
};
var bb = se.Group = function (G) {
var g = this;
g._entities = G, g._64O = 0, g._position = {
x: 0,
y: 0
}, g._scale = {
x: 1,
y: 1
}, g._anchor = {
x: .5,
y: .5
}, g._anchor2 = {
x: .5,
y: .5
}
};
bb.prototype = {}, bb.prototype.constructor = bb;
var Ag = null;
bb.findOrCreateGroup = function (T) {
if (Ag && Ag.checkIsMe(T)) return Ag;
var E = new se.Group(T);
return E.getKeyOb() ? (Ag = E, E) : void 0
}, bb.prototype.checkIsMe = function (i) {
var O = this._entities;
if (O.length !== i.length) return !1;
var W, R = {},
l = i.length;
for (W = 0; l > W; W++) R[i[W]._id] = !0;
for (W = 0; l > W; W++)
if (!R[O[W]._id]) return !1;
return !0
}, bb.prototype.getRotation = function () {
return this._64O
}, bb.prototype.getPosition = function () {
return this._position
}, bb.prototype.getAnchor = function () {
return this._anchor
}, bb.prototype.getWidth = function () {
return this._width
}, bb.prototype.getScale = function () {
return this._scale
}, bb.prototype.getSize = function () {
return {
width: this._width,
height: this._height
}
}, bb.prototype.getHeight = function () {
return this._height
}, bb.prototype.getKeyOb = function () {
for (var W = this._entities, R = W.length - 1; R >= 0; R--) {
var Y = W[R];
if (this.isNode(Y)) return Y
}
}, bb.prototype.getAnchor2 = function () {
var k = this,
M = k.rotateCenter;
if (M) return M;
var A = k.getKeyOb();
if (!A) return k._anchor;
var N = k._anchor2,
g = A.getMatrix();
return g.tf({
x: A.getWidth() * (N.x - A.getAnchor().x),
y: A.getHeight() * (N.y - A.getAnchor().y)
})
}, bb.prototype.setAnchor2 = function (B, L) {
var h = this,
C = h.getKeyOb();
if (C) {
var u, R = C.getMatrix();
u = "number" == typeof B ? {
x: B,
y: L
} : B;
var M = R.tfi(u);
h._anchor2 = {
x: C.getAnchor().x + M.x / C.getWidth(),
y: C.getAnchor().y + M.y / C.getHeight()
}
}
}, bb.prototype.setRotation = function () { }, bb.prototype.beginRotate = function (n) {
this.rotateCenter = n.pos, this.rotateMode = n.groupRotateMode
}, bb.prototype.endRotate = function () {
delete this.rotateCenter, delete this.rotateMode
}, bb.prototype.addRotation = function (g, r, n) {
return "batch" === r ? this._addRotationInBatchMode(g, n) : "block" === r ? this._addRotationInBlockMode(g, n) : void 0
}, bb.prototype._addRotationInBlockMode = function (r, q) {
var s = this,
U = s.rotateCenter || s.getPosition();
s._entities.forEach(function ($) {
if (s.isNode($) && (!q || q($))) {
var l = $.getMatrix();
l.translate(-U.x, -U.y), l.rotate(r), l.translate(U.x, U.y);
var x = Math.sign($.getScale().x);
$.setRotation(D(l.b * x, l.a * x)), $.setPosition(l.tx, l.ty)
}
})
}, bb.prototype._addRotationInBatchMode = function (C, s) {
var N = this,
I = N._anchor2;
N._entities.forEach(function (b) {
if (N.isNode(b) && (!s || s(b))) {
var m = b.getAnchor(),
P = b.getMatrix(),
V = P.tf({
x: b.getWidth() * (I.x - m.x),
y: b.getHeight() * (I.y - m.y)
}),
T = new se.Math.Matrix2d;
T.set(P.a, P.b, P.c, P.d, P.tx, P.ty), T.translate(-V.x, -V.y), T.rotate(C), T.translate(V.x, V.y);
var n = Math.sign(b.getScale().x);
b.setRotation(D(T.b * n, T.a * n)), b.setPosition(T.tx, T.ty)
}
})
}, bb.prototype.setPosition = function (A) {
var Y, z, U, P, T = this,
c = T._position,
m = A.x - c.x,
V = A.y - c.y,
k = T._entities;
for (z = 0, U = k.length; U > z; z++) Y = k[z], Fq(Y) && (P = Y.getPosition(), Y.setPosition(P.x + m, P.y + V));
T._position = A
}, bb.prototype.setScale = function (r, E) {
var o = this,
A = r / o._scale.x,
O = E / o._scale.y;
o._adjustChildScaleOrSize(A, O, "size"), o._scale = {
x: r,
y: E
}
}, bb.prototype.getRect = function () {
var C = this,
R = C._position,
Z = C._width,
l = C._height;
return {
x: R.x - Z / 2,
y: R.y - l / 2,
width: Z,
height: l
}
}, bb.prototype.setSize = function (N, b) {
var r = this,
N = Math.max(1, N),
b = Math.max(1, b),
s = N / r._width,
g = b / r._height;
r._adjustChildScaleOrSize(s, g, "size"), r._width = N, r._height = b
}, bb.prototype._adjustChildScaleOrSize = function (B, P, v) {
var l, Y, C, f, p, o, s, u, X, J, m, E, n, K, b = this,
w = b._position,
h = b._entities,
R = new se.Math.Matrix2d;
for (Y = 0, C = h.length; C > Y; Y++)
if (l = h[Y], b.isNode(l)) {
if (f = l.getPosition(), p = l.getRotation(), o = l.getWidth(), s = l.getHeight(), u = l.getScale(), m = u.x * o, E = u.y * s, R.identity().scale(m, E).rotate(p).translate(f.x, f.y).translate(-w.x, -w.y).rotate(-b._64O), p = D(R.b * Math.sign(m), R.a * Math.sign(m)), R.scale(B, P), X = Math.cos(p), J = Math.sin(p), Math.abs(X) < .001 ? (n = R.b / J, K = -R.c / J) : (n = R.a / X, K = R.d / X), "scale" === v) l.setScale(n / o, K / s);
else if ("size" === v) {
var M = n / u.x,
g = K / u.y;
l.setScale(he(n) * Math.abs(u.x), he(K) * Math.abs(u.y)), l.setSize(Math.max(.1, Math.abs(M)), Math.max(.1, Math.abs(g)))
}
R.rotate(b._64O).translate(w.x, w.y), l.setPosition(R.tx, R.ty)
}
}, bb.prototype.getMatrix = function () {
var e = this,
W = e._position,
$ = O.Default.getInternal(),
j = e._scale;
return new $.Mat(e._64O, W.x, W.y, j.x, j.y)
}, bb.prototype.toGlobal = function (M) {
return this.getMatrix().tf(M)
}, bb.prototype.getCorners = function () {
var R = this,
x = R._width,
t = R._height,
O = R._anchor,
k = -x * O.x,
w = -t * O.y,
J = R.getMatrix();
return [J.tf(k, w), J.tf(k, w + t), J.tf(k + x, w + t), J.tf(k + x, w)]
}, bb.prototype.calcInfo = function () {
var f, L, F, o, u, W, $ = this,
V = [],
b = $._entities,
G = $._64O;
for (o = 0, u = b.length; u > o; o++) W = b[o], $.isNode(W) && W.getCorners && V.push.apply(V, W.getCorners());
if (V.length) {
var P = Math.cos(-G),
Z = Math.sin(-G),
X = 1 / 0,
M = -1 / 0,
Y = 1 / 0,
J = -1 / 0;
for (o = 0, u = V.length; u > o; o++) F = V[o], f = F.x, L = F.y, F.x = P * f - Z * L, F.y = Z * f + P * L, X = Math.min(X, F.x), M = Math.max(M, F.x), Y = Math.min(Y, F.y), J = Math.max(J, F.y);
$._width = (M - X) / $._scale.x, $._height = (J - Y) / $._scale.y, P = Math.cos(G), Z = Math.sin(G);
var s = $._anchor;
f = X + (M - X) * s.x, L = Y + (J - Y) * s.y, $._position = {
x: P * f - Z * L,
y: Z * f + P * L
}
}
}, bb.prototype.isNode = function (n) {
return Fq(n) ? Th(n) ? n.size() ? !1 : !0 : !0 : !1
}, bb.prototype._42 = function (N, Z, c) {
var R, u, s, q, X, E, P, $, j = this,
r = j._entities,
S = j.rotateMode;
for ("batch" === S && ($ = j.getKeyOb()), R = 0, u = r.length; u > R; R++) s = r[R], j.isNode(s) && (E = s.getRect(), q = se.toScreenPosition(c, {
x: E.x,
y: E.y
}), X = se.toScreenPosition(c, {
x: E.x + E.width,
y: E.y + E.height
}), P = {
min: q,
max: X
}, s === $ && (P.isKeyOb = !0), se.Icons.DrawIcon(N, Z, se.Icons.GroupSubEntityRect, P))
};
var bp = se.CurveActiving = function (T, r) {
this._curve = T, this._interactor = T._interactor, this.silent = !0;
for (var x in r) this[x] = r[x];
delete this.silent
};
bp.prototype = {}, bp.prototype.constructor = bp, o.defineProperties(bp.prototype, {
point: {
get: function () {
return this._point
}, set: function (S) {
var f = this;
f._point = S, f.editingCtrl || f.silent || f._firePointChange()
}
},
pairs: {
get: function () {
return this._pairs
}, set: function (l) {
var J = this;
J._pairs = l, J.editingCtrl && !J.silent && J._firePointChange()
}
}
}), bp.prototype._firePointChange = function () {
var J = this,
j = J.getCurrentEditingPoint(),
i = J._interactor;
if (!j) return i.fi({
kind: "selectPoint"
}), void 0;
var e = this._curve.target;
if (e) {
var o = se.getDataMatrix(e).invert(),
t = j.e;
j = o.apply(se.toWorldPosition(i.gv, j)), j.e = t;
var q = J._lastFirePoint;
q && Math.abs(j.x - q.x) < 1e-5 && Math.abs(j.y - q.y) < 1e-5 && (j.e == Z && q.e == Z || Math.abs(j.e - q.e) < 1e-5) || (J._lastFirePoint = j, i.fi({
kind: "selectPoint",
x: j.x,
y: j.y,
e: j.e
}))
}
}, bp.prototype.dispose = function () {
this._interactor.fi({
kind: "selectPoint"
})
}, bp.prototype.getCurrentEditingPoint = function () {
var l = this,
d = l.editingCtrl;
if (d) {
var O = l.pairs;
if (O) {
var t = O[d.pairId];
if (t) {
var S = t[d.type];
if (S) return S
}
}
}
return l._point
};
var Rf = se.CursorFactory = function (q) {
var V = this;
V._interactor = q, V._rotateCursorStyles = {}
};
Rf.prototype = {}, Rf.prototype.constructor = Rf, Rf.prototype.getRotateCursor = function (E) {
var q = this;
0 > E && (E += 2 * Math.PI);
var D = q._interactor,
o = D.getStyle("rotateCursorSize"),
c = D.getStyle("rotateCursorRound"),
U = Math.round(180 * (E / Math.PI) / c);
U * c >= 360 && (U = 0);
var A = q._rotateCursorStyles,
M = "htCustomRotateStyle_" + o + "_" + c + "_" + U;
return A[M] || (q._produceRotateCursor(M, o, c, U), A[M] = !0), M
}, Rf.prototype._produceRotateCursor = function (A, I, N, M) {
var E = this;
E._interactor;
var j = E._canvas;
j || (j = E._canvas = U.createElement("canvas")), j.width = j.height = I * devicePixelRatio, j.style.width = j.style.height = I + " px";
var L = j.getContext("2d");
se.setAntialias(L, !1), L.scale(devicePixelRatio, devicePixelRatio);
var e, o, X, z, B, S = Math.round(I / 2),
x = "" + S + " " + S + ",auto !important;",
D = 4;
e = Math.PI / 180 * M * N, L.clearRect(0, 0, I, I), L.save(), L.scale(I / 32, I / 32), L.translate(16, 15), L.rotate(e + Math.PI / 2), L.beginPath(), L.moveTo(-8, 0), L.lineTo(-8, D), L.lineTo(-8 + D, D), L.moveTo(8, 0), L.lineTo(8, D), L.lineTo(8 - D, D), L.moveTo(-8, D), L.quadraticCurveTo(0, -6, 8, D), L.restore(), L.lineCap = "round", L.lineJoin = "miter", L.strokeStyle = "white", L.lineWidth = 4, L.stroke(), L.strokeStyle = "black", L.lineWidth = 2, L.stroke(), o = JSON.stringify(j.toDataURL()), z = "cursor:url(" + o + ")" + x, 1 !== devicePixelRatio && (X = '', z += "cursor:url(data:image/svg+xml;base64," + btoa(X) + ")" + x, z += "cursor:-webkit-image-set(url(" + o + ")" + devicePixelRatio + "x,url(" + o + ")1x)" + x), B = U.createElement("style"), B.textContent = "body." + A + " *, ." + A + "{" + z + "}", U.head.appendChild(B)
};
var pi = se.Guide.Grid = function (S) {
var W = this;
W._interactor = S, W._alignmentGuideId = 0, W._xAlignmentGuide = [], W._yAlignmentGuide = []
};
pi.prototype = {}, pi.prototype.constructor = pi, o.defineProperties(pi.prototype, {
gridBlockSize: {
get: function () {
var L = this;
return L._gridBlockSize || L._interactor.getStyle("gridBlockSize")
}, set: function (a) {
this._gridBlockSize = a, this._interactor._42()
}
},
gridThickLinesEvery: {
get: function () {
var b = this;
return b._gridThickLinesEvery || b._interactor.getStyle("gridThickLinesEvery")
}, set: function (p) {
this._gridThickLinesEvery = p, this._interactor._42()
}
},
gridEnabled: {
get: function () {
var R = this,
t = R._interactor;
return t.gridEnabled && R.isValidGrid()
}
}
}), pi.prototype._42 = function () {
var Q = this,
M = Q._interactor;
Q.gridEnabled && Q.drawGrid(), M.alignmentGuideEnabled && Q.drawAlignmentGuide()
}, pi.prototype.makeMatrix = function () {
var k = this,
i = k._interactor.getStyle("gridAngle"),
v = k._interactor.getStyle("gridRotation"),
R = new se.Math.Matrix2d,
u = Math.sin(i),
$ = Math.cos(i);
return R.set(1, 0, $, u, 0, 0), R.rotate(v), R
}, pi.prototype.isValidGrid = function () {
var d = this,
T = Math.PI,
O = d._interactor,
Y = O.gv;
if (Y._zoom < O.getStyle("gridZoomThreshold")) return !1;
var I = O.getStyle("gridAngle"),
b = Math.abs(180 * (I % T / T)),
C = 1 - 1e-8;
return C > b || b > 180 - C ? !1 : !0
}, pi.prototype.drawAlignmentGuide = function () {
var $ = this,
C = $._interactor,
l = C.gv,
Q = C._canvas,
k = C._context,
x = Q.width,
M = Q.height,
i = l.tx(),
K = l.ty(),
n = l._zoom;
k.beginPath(), k.strokeStyle = C.getStyle("gridAlignmentGuideColor"), k.lineWidth = 1, $._xAlignmentGuide.forEach(function (r) {
var L = r.p * n + i;
k.moveTo(L, 0), k.lineTo(L, M)
}), $._yAlignmentGuide.forEach(function (M) {
var _ = M.p * n + K;
k.moveTo(0, _), k.lineTo(x, _)
}), k.stroke()
}, pi.prototype.drawGrid = function () {
function g(T, $, F, m) {
var K = se.toScreenPosition(i, v.apply({
x: T,
y: $
})),
t = se.toScreenPosition(i, v.apply({
x: F,
y: m
}));
c.moveTo(K.x, K.y), c.lineTo(t.x, t.y)
}
var Y = this,
s = Y._interactor,
F = Y.gridBlockSize,
P = Y.gridThickLinesEvery,
o = s.getStyle("gridThickColor"),
t = s.getStyle("gridLightColor"),
i = s.gv,
X = s._canvas,
c = s._context,
z = X.width,
h = X.height,
v = Y.makeMatrix(),
Q = v.applyInverse(se.toWorldPosition(i, {
x: 0,
y: 0
})),
I = v.applyInverse(se.toWorldPosition(i, {
x: z,
y: 0
})),
n = v.applyInverse(se.toWorldPosition(i, {
x: 0,
y: h
})),
f = v.applyInverse(se.toWorldPosition(i, {
x: z,
y: h
})),
u = Math.min(Q.x, I.x, n.x, f.x),
S = Math.max(Q.x, I.x, n.x, f.x),
a = Math.min(Q.y, I.y, n.y, f.y),
C = Math.max(Q.y, I.y, n.y, f.y);
z = S - u, h = C - a;
var K = Math.ceil(u / F),
d = Math.floor(S / F),
T = Math.ceil(a / F),
$ = Math.floor(C / F);
i.tx(), i.ty(), i._zoom;
var j, D, r;
for (c.save(), c.lineWidth = 1, c.beginPath(), c.strokeStyle = o, r = Math.ceil(K / P) * P; d >= r; r += P) j = r * F, g(j, a, j, C);
for (r = Math.ceil(T / P) * P; $ >= r; r += P) D = r * F, g(u, D, S, D);
for (c.stroke(), c.beginPath(), c.strokeStyle = t, r = K; d >= r; r++) 0 !== r % P && (j = r * F, g(j, a, j, C));
for (r = T; $ >= r; r++) 0 !== r % P && (D = r * F, g(u, D, S, D));
c.stroke(), c.restore()
}, pi.prototype.getAlignmentGuides = function () {
var Q = this;
return {
x: Q._xAlignmentGuide,
y: Q._yAlignmentGuide
}
}, pi.prototype.addAlignmentGuide = function (t, g, A) {
var B = this,
y = "x" === t ? B._xAlignmentGuide : B._yAlignmentGuide,
A = A ? A : ++B._alignmentGuideId,
G = {
p: g,
id: A
};
if (y.length) {
var K = B._findClosestAlignmentGuide(G.p, y);
K.dis < 0 ? y.splice(K.index + 1, 0, G) : y.splice(K.index, 0, G)
} else y.push(G);
return B._interactor._42(), A
}, pi.prototype.findClosest = function (K, n, F) {
var k = this,
U = k._interactor,
i = U.gv;
F && (K = se.toWorldPosition(i, K));
var H, b, f, X = 1 / 0,
r = 1 / 0,
h = K.x,
u = K.y;
if (k.gridEnabled) {
var S = k.gridBlockSize,
R = k.makeMatrix(),
W = R.applyInverse(K);
W = R.apply({
x: Math.round(W.x / S) * S,
y: Math.round(W.y / S) * S
}), X = W.x - h, r = W.y - u, f = !0
}
if (U.alignmentGuideEnabled && (H = k._findClosestAlignmentGuide(h, k._xAlignmentGuide).dis, b = k._findClosestAlignmentGuide(u, k._yAlignmentGuide).dis, Math.abs(H) < Math.abs(X) && (X = H, f = !0), Math.abs(b) < Math.abs(r) && (r = b, f = !0)), f) {
f = !1;
var E = i._zoom,
p = U.getStyle("smartGuideThreshold") / E,
$ = {};
if (Math.abs(X) < p && "y" !== n && ($.x = F ? X * E : X, f = !0), Math.abs(r) < p && "x" !== n && ($.y = F ? r * E : r, f = !0), f) return $
}
}, pi.prototype._findClosestAlignmentGuide = function (B, N) {
if (!N.length) return {
dis: 1 / 0
};
for (var G, V = 0, b = N.length - 1; b - V > 1;) G = Math.floor((V + b) / 2), N[G].p < B ? V = G : b = G;
var D = N[V].p - B,
l = N[b].p - B;
return Math.abs(D) <= Math.abs(l) ? {
line: N[V],
dis: D,
index: V
} : {
line: N[b],
dis: l,
index: b
}
}, pi.prototype.removeAllAlignmentGuide = function (k) {
var B = this;
"y" !== k && (B._xAlignmentGuide = []), "x" !== k && (B._yAlignmentGuide = []), B._interactor._42()
}, pi.prototype.removeAlignmentGuide = function (c) {
for (var L, A, U, V = this, g = V._xAlignmentGuide, F = 0; 2 > F; F++)
for (g = 0 === F ? V._xAlignmentGuide : V._yAlignmentGuide, L = 0, A = g.length; A > L; L++)
if (U = g[L], U.id === c) return g.splice(L, 1), V._interactor._42(), {
axis: 0 === F ? "x" : "y",
position: U.p
};
return !1
}, pi.prototype.adjustAlignmentGuide = function (X, V) {
var D = this,
y = D.removeAlignmentGuide(X);
return y ? (D.addAlignmentGuide(y.axis, V, X), !0) : !1
};
var yf = se.Guide.Rect = function (i) {
var $ = this;
$._interactor = i
};
yf.prototype = {}, yf.prototype.constructor = yf, yf.prototype.gatherRects = function () {
var O, E, l, Q, j = this,
t = j._interactor.gv,
V = [],
s = [],
M = {
x: V,
y: s
},
m = {},
K = t.getDataModel(),
F = K.a("width"),
v = K.a("height");
F && v && (O = 0, E = 0, l = F, Q = v, V.push({
node: K,
type: 0,
p: O
}, {
node: K,
type: 1,
p: O + l / 2
}, {
node: K,
type: 2,
p: O + l
}), s.push({
node: K,
type: 0,
p: E
}, {
node: K,
type: 1,
p: E + Q / 2
}, {
node: K,
type: 2,
p: E + Q
}), m[K._id || 0] = {
x: O,
y: E,
width: l,
height: Q
}), K.each(function (L) {
if (Fq(L) && !t.isSelected(L) && t.isVisible(L) && t.isValidGuideLineSource(L)) {
var W = !1;
if (t.sm().getSelection().each(function (I) {
W || (L.isHostOn(I) ? W = !0 : L.isDescendantOf(I) && (W = !0))
}), !W) {
var u = L.getRect();
O = u.x, E = u.y, l = u.width, Q = u.height, V.push({
node: L,
type: 0,
p: O
}, {
node: L,
type: 1,
p: O + l / 2
}, {
node: L,
type: 2,
p: O + l
}), s.push({
node: L,
type: 0,
p: E
}, {
node: L,
type: 1,
p: E + Q / 2
}, {
node: L,
type: 2,
p: E + Q
}), m[L._id] = u
}
}
}), V.sort(function (y, i) {
return y.p - i.p
}), s.sort(function (x, r) {
return x.p - r.p
}), j._grid = M, j._87I = m
}, yf.prototype.gatherLines = function (R, $, Q) {
var k, r, u, T, F, G, U, z, X, x, a, y, q = this,
i = [q.findClosest({
x: R.x,
y: R.y
}, $), q.findClosest({
x: R.x + R.w / 2,
y: R.y + R.h / 2
}, $), q.findClosest({
x: R.x + R.w,
y: R.y + R.h
}, $)],
V = {},
g = q._87I;
Q = Q || 255;
var N, o;
for (q._guideLine = [], k = 0; 2 > k; k++)
for (V = {}, 0 === k ? (T = "y", z = R.x, X = z + R.w) : (T = "x", z = R.y, X = z + R.h), r = 0; 3 > r; r++) F = i[r], F && isFinite(F[T]) && (N = 1 << 3 * k + r, Q & N && (G = F[T + "Line"], U = G.node, o = U._id || 0, V[o] || (V[o] = !0, y = g[o], "y" === T ? (x = y.x, a = y.x + y.width) : (x = y.y, a = y.y + y.height), u = G.p, q._guideLine.push({
type: T,
a: z,
b: X,
c: x,
d: a,
p: u,
center: 1 === G.type
}))))
}, yf.prototype._binarySearchClosest = function (N, j) {
if (!j.length) return {
dis: 1 / 0
};
for (var $, p = 0, n = j.length - 1; n - p > 1;) $ = Math.floor((p + n) / 2), j[$].p < N ? p = $ : n = $;
var t = j[p].p - N,
D = j[n].p - N;
return Math.abs(t) <= Math.abs(D) ? {
line: j[p],
dis: t
} : {
line: j[n],
dis: D
}
}, yf.prototype.findClosest = function (p, i, f) {
var V = this,
G = V._interactor,
e = G.gv,
L = V._grid;
f && (p = se.toWorldPosition(e, p));
var b, t = V._binarySearchClosest(p.x, L.x),
m = V._binarySearchClosest(p.y, L.y),
J = t.dis,
C = m.dis,
M = e._zoom,
w = G.getStyle("smartGuideThreshold") / M,
$ = {};
return Math.abs(J) < w && "y" !== i && ($.x = f ? J * M : J, $.xLine = t.line, b = !0), Math.abs(C) < w && "x" !== i && ($.y = f ? C * M : C, $.yLine = m.line, b = !0), b ? $ : void 0
}, yf.prototype._42 = function () {
var C = this,
T = C._guideLine;
if (T && !O.Default.isCtrlDown()) {
var $ = C._interactor;
if ($.getStyle("guideLineVisible")) {
var _, I, G, R, E, V, m, o, l, c, P, K, M, H, W, Q, U, B = $.gv,
J = $._context,
k = B.tx(),
p = B.ty(),
A = B._zoom,
r = $.getStyle("guideLineTextSpacing");
for (_ = 0, I = T.length; I > _; _++) G = T[_], o = G.type, l = G.p, c = G.a, P = G.b, K = G.c, M = G.d, H = Math.min(c, K), W = Math.max(P, M), "x" === o ? (R = l * A + k, E = H * A + p, V = R, m = W * A + p) : (R = H * A + k, E = l * A + p, V = W * A + k, m = E), se.Icons.DrawIcon($, J, se.Icons.MoveLineGuide, {
rect: [R, E, V, m],
center: G.center
}), M >= c && P >= K || (H = c > M ? M : P, W = c > M ? c : K, U = W - H, "x" === o ? (G.center2center || (R -= r, V = R), E = H * A + p, m = W * A + p, Q = se.Icons.MoveLineGuideDistanceV) : "y" === o && (G.center2center || (E -= r, m = E), R = H * A + k, V = W * A + k, Q = se.Icons.MoveLineGuideDistanceH), se.Icons.DrawIcon($, J, Q, {
x0: R,
y0: E,
x1: V,
y1: m,
dis: U
}))
}
}
}, yf.prototype.clear = function () {
this._guideLine = null
};
var Aq = se.Guide.Hover = function (p) {
var v = this;
v._interactor = p
};
Aq.prototype = {}, Aq.prototype.constructor = Aq, o.defineProperties(Aq.prototype, {}), Aq.prototype._42 = function () {
var b = this._interactor;
if (b.getStyle("hoverGuideVisible") && !b.gvEditing) {
var g = b.hoverData,
Y = b.gv;
if (!Fq(g) || Y.isSelected(g)) return b.hoverData = null, void 0;
var t = Rp(Y, g),
G = se.toScreenPosition(Y, {
x: t.x,
y: t.y
}),
L = se.toScreenPosition(Y, {
x: t.x + t.width,
y: t.y + t.height
});
se.Icons.DrawIcon(b, b._context, se.Icons.HoverDataRect, {
min: G,
max: L,
color: b.getStyle("hoverGuideColor") || b.getStyle("baseColor")
})
}
}, se.DefaultStyleMap = {
baseColor: "rgb(51,153,255)",
pointSize: [24, 9],
checkSize: 7,
rotateCheckSize: 10,
moveSensitivity: 10,
moveDummyThreshold: 32,
moveDummyPosition: [0, 0, -16, -16],
moveDummyLineExtraShift: [-32, 0],
moveDummySensitivity: 16,
keepAspectRatio: !1,
rotateRound: Math.PI / 2,
shiftRotateRound: Math.PI / 12,
rotateSensitivity: Math.PI / 60,
rotateAsClock: !1,
shiftLineRotateRound: Math.PI / 4,
anchorMovable: !0,
anchorVisible: !0,
anchorHideThreshold: 25,
anchorOutsideVisibleThreshold: .25,
anchorRound: .25,
anchorSensitivity: .02,
smartGuideThreshold: 8,
curveIntersectSize: 5,
curvePointIntersectSize: 8,
edgeHostDetectPerFrame: !0,
edgeHostEdgeMaxDistance: 12,
edgeHostEdgeHighlighColor: "#5d5d5d",
edgeHostPointHighlighColor: "red",
edgeHostHighlighPeriod: 1500,
edgeElevationEditable: !1,
attachThreshold: 25,
guideLineVisible: !0,
guideLineTextSpacing: 0,
hoverGuideVisible: !1,
hoverGuideColor: null,
gridBlockSize: 40,
gridThickLinesEvery: 10,
gridThickColor: "#5d5d5d",
gridLightColor: "#d0d0d0",
gridZoomThreshold: .25,
gridAlignmentGuideColor: "#ff0000",
gridAngle: Math.PI / 2,
gridRotation: 0,
groupRotateModeDefault: "block",
groupRotateModeKey: ["ctrlKey", "metaKey"],
rotateCursorSize: 32,
rotateCursorRound: 45,
tipTextColor: "#ffffff",
tipBackground: "#333333",
curveHighlightColor: "#30599e",
rectPointBackground: "white",
rectPointBorderColor: "#666666",
rectPointShadowColor: "rgba(0,0,0,0.35)",
shapeCtrlPointBackground: "white",
shapeCtrlPointBorderColor: null,
shapeCtrlPointHighlightBorder: null,
shapeHighlighPointBackground: "#30599e",
curveElevationVisible: !0,
curveElevationIntersectSize: 8,
curveElevationGuideShift: [20, 0],
curveTipVisible: !0,
connectGuideVisible: !0,
connectGuideShift: [1, .25, 8, 0],
connectGuideIntersectSize: 8,
connectGuideGarbageIntersectsize: 25,
connectGuideGarbageShift: [1, 1, -48, -48]
};
var Kp = se.Icons = {},
bs = 1e4,
je = null,
ci = se.DefaultStyleMap.baseColor,
Sb = "rgb(183,232,135)",
yk = "rgb(255,204,153)",
ho = 6;
O.Default.setImage("Icons.RectPoint", {
width: ho,
height: ho,
comps: [{
type: "rect",
background: "rgb(247,247,247)",
borderWidth: 1,
borderColor: {
func: function () {
return ci
}
},
rect: [0, 0, ho, ho]
}]
}), Kp.GroupSubEntityRect = {
comps: [{
type: "shape",
points: {
func: function () {
var Y = Kp.GroupSubEntityRect.data;
if (!Y) return [];
var S = Y.min,
I = Y.max;
return [S.x, S.y, S.x, I.y, I.x, I.y, I.x, S.y]
}
},
segments: [1, 2, 2, 2, 5],
background: null,
borderWidth: 1,
borderColor: {
func: function () {
return Kp.GroupSubEntityRect.data.isKeyOb ? ci : ci
}
}
}]
};
var ak = 4;
Kp.HoverDataRect = {
comps: [{
type: "shape",
points: {
func: function () {
var D = Kp.HoverDataRect.data;
if (!D) return [];
var b = D.min,
G = D.max,
J = ak;
return b.x -= J, b.y -= J, G.x += J, G.y += J, [b.x, b.y, b.x, G.y, G.x, G.y, G.x, b.y]
}
},
segments: [1, 2, 2, 2, 5],
background: null,
borderWidth: 1,
borderColor: {
func: function () {
return Kp.HoverDataRect.data.color
}
},
borderCap: "round",
borderPattern: [1, 4]
}]
}, Kp.Line = {
comps: [{
type: "image",
name: "Icons.RectPoint",
rect: {
func: function () {
return [[Kp.Line.data.P1.x, Kp.Line.data.P1.y], ho, ho]
}
}
}, {
type: "image",
name: "Icons.RectPoint",
rect: {
func: function () {
return [[Kp.Line.data.P2.x, Kp.Line.data.P2.y], ho, ho]
}
}
}]
}, Kp.NodeHoverGuide = {
comps: [{
type: "shape",
points: {
func: function () {
return Kp.NodeHoverGuide.data
}
},
segments: [1, 2, 2, 2, 5],
background: null,
borderWidth: 1,
borderColor: "#3399FF"
}]
}, Kp.Rect = {
comps: [{
type: "shape",
points: {
func: function () {
var n = Kp.Rect.data;
if (!n) return [];
var h = n.LT,
V = n.LB,
o = n.RB,
C = n.RT;
return [h.x, h.y, V.x, V.y, o.x, o.y, C.x, C.y]
}
},
segments: [1, 2, 2, 2, 5],
background: null,
borderWidth: 1,
borderColor: {
func: function () {
return ci
}
}
}, {
type: "image",
name: "Icons.RectPoint",
rotation: {
func: function () {
return Kp.Rect.data.rotation
}
},
rect: {
func: function () {
return [[Kp.Rect.data.LT.x, Kp.Rect.data.LT.y], ho, ho]
}
}
}, {
type: "image",
name: "Icons.RectPoint",
rotation: {
func: function () {
return Kp.Rect.data.rotation
}
},
rect: {
func: function () {
return [[Kp.Rect.data.LB.x, Kp.Rect.data.LB.y], ho, ho]
}
}
}, {
type: "image",
name: "Icons.RectPoint",
rotation: {
func: function () {
return Kp.Rect.data.rotation
}
},
rect: {
func: function () {
return [[Kp.Rect.data.RB.x, Kp.Rect.data.RB.y], ho, ho]
}
}
}, {
type: "image",
name: "Icons.RectPoint",
rotation: {
func: function () {
return Kp.Rect.data.rotation
}
},
rect: {
func: function () {
return [[Kp.Rect.data.RT.x, Kp.Rect.data.RT.y], ho, ho]
}
}
}, {
type: "image",
name: "Icons.RectPoint",
rotation: {
func: function () {
return Kp.Rect.data.rotation
}
},
visible: {
func: function () {
return Kp.Rect.data.L ? !0 : !1
}
},
rect: {
func: function () {
return [[Kp.Rect.data.L.x, Kp.Rect.data.L.y], ho, ho]
}
}
}, {
type: "image",
name: "Icons.RectPoint",
rotation: {
func: function () {
return Kp.Rect.data.rotation
}
},
visible: {
func: function () {
return Kp.Rect.data.R ? !0 : !1
}
},
rect: {
func: function () {
return [[Kp.Rect.data.R.x, Kp.Rect.data.R.y], ho, ho]
}
}
}, {
type: "image",
name: "Icons.RectPoint",
rotation: {
func: function () {
return Kp.Rect.data.rotation
}
},
visible: {
func: function () {
return Kp.Rect.data.T ? !0 : !1
}
},
rect: {
func: function () {
return [[Kp.Rect.data.T.x, Kp.Rect.data.T.y], ho, ho]
}
}
}, {
type: "image",
name: "Icons.RectPoint",
rotation: {
func: function () {
return Kp.Rect.data.rotation
}
},
visible: {
func: function () {
return Kp.Rect.data.B ? !0 : !1
}
},
rect: {
func: function () {
return [[Kp.Rect.data.B.x, Kp.Rect.data.B.y], ho, ho]
}
}
}]
};
var Bs = 16;
O.Default.setImage("Icons.Anchor", {
width: 12,
height: 12,
comps: [{
type: "shape",
borderWidth: 1,
borderColor: {
func: function () {
return ci
}
},
borderCap: "round",
shadowColor: "#1ABC9C",
points: [.50928, 6, 11.49072, 6, 6, 6, 6, .50928, 6, 11.49072]
}, {
type: "circle",
borderWidth: 1,
borderColor: {
func: function () {
return ci
}
},
shadowColor: "#1ABC9C",
rect: [2.84391, 2.84391, 6.53697, 6.53697]
}]
}), Kp.Anchor = {
comps: [{
type: "image",
name: "Icons.Anchor",
rect: {
func: function () {
return [[Kp.Anchor.data.POS.x, Kp.Anchor.data.POS.y], Bs, Bs]
}
}
}]
}, Kp.TipShiftX = 12, Kp.TipShiftY = 12;
var yr = [8, 28];
Kp.TipHelper = {
comps: [{
type: "roundRect",
rect: {
func: function () {
return [Kp.TipHelper.data.helperPos.x, Kp.TipHelper.data.helperPos.y, yr[0] * Kp.TipHelper.data.size, yr[1]]
}
},
background: {
func: function () {
return je.getStyle("tipBackground")
}
},
opacity: .6
}, {
type: "text",
text: {
func: function () {
return Kp.TipHelper.data.text
}
},
rect: {
func: function () {
return [Kp.TipHelper.data.helperPos.x, Kp.TipHelper.data.helperPos.y, yr[0] * Kp.TipHelper.data.size, yr[1]]
}
},
color: {
func: function () {
return je.getStyle("tipTextColor")
}
},
font: "bold 12px Arial",
align: "center"
}]
};
var Ih = 7;
Kp.ShapePoint = {
comps: [{
type: "circle",
visible: {
func: function () {
return !!Kp.ShapePoint.data.dynamicVisible
}
},
rect: {
func: function () {
var x = Kp.ShapePoint.data.point,
y = Kp.ShapePoint.data.size || Ih;
return [x, y + 10, y + 10]
}
},
background: {
func: function () {
var L = Date.now(),
P = Kp.ShapePoint.data.dynamicPeriod || 1500,
p = Math.sin(L % P / P * Math.PI);
return "rgba(27,124,22," + .5 * p + ")"
}
},
borderWidth: 0
}, {
type: "circle",
rect: {
func: function () {
var r = Kp.ShapePoint.data.point,
I = Kp.ShapePoint.data.size || Ih;
return [r, I, I]
}
},
background: {
func: function () {
var l = Kp.ShapePoint.data.isEnd;
return l ? "rgba(27,124,222,0.7)" : "#ffffff"
}
},
borderWidth: 1,
borderColor: {
func: function () {
return Kp.ShapePoint.data.color || ci
}
}
}, {
type: "rect",
visible: {
func: function () {
return !!Kp.ShapePoint.data.dynamicVisible
}
},
background: "red",
borderWidth: 0,
rotation: Math.PI / 4,
borderColor: {
func: function () {
return ci
}
},
rect: {
func: function () {
var I = 5;
return [Kp.ShapePoint.data.point, I, I]
}
}
}]
}, Kp.ShapeBgCurve = {
comps: [{
type: "shape",
visible: {
func: function () {
return !!Kp.ShapeBgCurve.data.dynamicVisible
}
},
points: {
func: function () {
return Kp.ShapeBgCurve.data.P
}
},
segments: {
func: function () {
return Kp.ShapeBgCurve.data.S
}
},
background: null,
borderWidth: 6,
borderColor: {
func: function () {
var L = Date.now(),
A = Kp.ShapeBgCurve.data.dynamicPeriod || 1500,
J = Math.sin(L % A / A * Math.PI);
return "rgba(27,124,22," + .3 * J + ")"
}
}
}, {
type: "shape",
points: {
func: function () {
return Kp.ShapeBgCurve.data.P
}
},
segments: {
func: function () {
return Kp.ShapeBgCurve.data.S
}
},
background: null,
borderWidth: 1,
borderColor: {
func: function () {
return Kp.ShapeBgCurve.data.color || ci
}
}
}]
};
var Lf = 8;
Kp.ShapeHighlighPoint = {
comps: [{
type: "circle",
rect: {
func: function () {
var T = Kp.ShapeHighlighPoint.data;
return [[T.x, T.y], Lf, Lf]
}
},
background: {
func: function () {
return je.getStyle("shapeHighlighPointBackground")
}
},
borderWidth: 0
}]
};
var rn = 10;
Kp.ShapeHighlighRealPoint = {
comps: [{
type: "circle",
rect: {
func: function () {
var n = Kp.ShapeHighlighRealPoint.data;
return [[n.x, n.y], rn, rn]
}
},
background: "#ffffff",
borderWidth: 2,
borderColor: {
func: function () {
return ci
}
}
}]
};
var qi = 8;
Kp.ShapeHighlighCtrlPoint = {
comps: [{
type: "shape",
points: {
func: function () {
var c = Kp.ShapeHighlighCtrlPoint.data,
m = c.x,
j = c.y,
o = qi / 2;
return [m - o, j - o, m - o, j + o, m + o, j + o, m + o, j - o]
}
},
segments: [1, 2, 2, 2, 5],
borderWidth: 2,
background: {
func: function () {
return je.getStyle("shapeCtrlPointBackground")
}
},
borderColor: {
func: function () {
return je.getStyle("shapeCtrlPointBorderColor") || ci
}
}
}]
};
var or = 3;
Kp.ShapeHighlightCurve = {
comps: [{
type: "shape",
points: {
func: function () {
return Kp.ShapeHighlightCurve.data
}
},
segments: [1, 4],
background: null,
borderWidth: or,
borderColor: {
func: function () {
return je.getStyle("curveHighlightColor")
}
}
}]
}, Kp.ShapeGuideLine = {
comps: [{
type: "shape",
points: {
func: function () {
return Kp.ShapeGuideLine.data
}
},
background: null,
borderWidth: 1,
borderColor: "rgb(255,204,153)"
}]
}, Kp.MoveLineGuide = {
comps: [{
type: "shape",
points: {
func: function () {
return Kp.MoveLineGuide.data.rect
}
},
background: null,
borderWidth: 1,
borderColor: {
func: function () {
return Kp.MoveLineGuide.data.center ? Sb : yk
}
}
}]
};
var ei = 5;
Kp.MoveLineGuideDistanceH = {
comps: [{
type: "shape",
points: {
func: function () {
var y = Kp.MoveLineGuideDistanceH.data,
n = y.x0,
v = y.y0;
return [n, v - ei, n, v + ei]
}
},
rotation: -Math.PI / 4,
segments: [1, 2],
background: null,
borderWidth: 1,
borderColor: yk
}, {
type: "shape",
points: {
func: function () {
var R = Kp.MoveLineGuideDistanceH.data,
c = R.x1,
D = R.y1;
return [c, D - ei, c, D + ei]
}
},
rotation: -Math.PI / 4,
segments: [1, 2],
background: null,
borderWidth: 1,
borderColor: yk
}, {
type: "text",
text: {
func: function () {
return Math.round(Kp.MoveLineGuideDistanceH.data.dis)
}
},
rect: {
func: function () {
var T = Kp.MoveLineGuideDistanceH.data;
return [[(T.x0 + T.x1) / 2, T.y0 - 10], 20, 20]
}
},
color: yk,
font: "12px Arial",
align: "center"
}]
}, Kp.MoveLineGuideDistanceV = {
comps: [{
type: "shape",
points: {
func: function () {
var p = Kp.MoveLineGuideDistanceV.data,
I = p.x0,
D = p.y0;
return [I - ei, D, I + ei, D]
}
},
rotation: Math.PI / 4,
segments: [1, 2],
background: null,
borderWidth: 1,
borderColor: yk
}, {
type: "shape",
points: {
func: function () {
var o = Kp.MoveLineGuideDistanceV.data,
g = o.x1,
b = o.y1;
return [g - ei, b, g + ei, b]
}
},
rotation: Math.PI / 4,
segments: [1, 2],
background: null,
borderWidth: 1,
borderColor: yk
}, {
type: "text",
text: {
func: function () {
return Math.round(Kp.MoveLineGuideDistanceV.data.dis)
}
},
rect: {
func: function () {
var G = Kp.MoveLineGuideDistanceV.data;
return [[G.x0 - 10, (G.y0 + G.y1) / 2], 20, 20]
}
},
color: yk,
font: "12px Arial",
align: "center"
}]
}, O.Default.setImage("Icons.EdgeElevationGuideImage", {
width: 16,
height: 16,
comps: [{
type: "oval",
background: "rgb(255,255,255)",
borderWidth: 1,
borderColor: "rgb(138,138,138)",
rect: [.5, .5, 15, 15]
}, {
type: "shape",
borderWidth: 2,
borderColor: "rgb(44,44,44)",
borderCap: "round",
points: [4, 8, 8, 4, 12, 8, 8, 4, 8, 13],
segments: [1, 2, 2, 1, 2]
}]
}), Kp.EdgeElevationGuide = {
comps: [{
type: "image",
name: "Icons.EdgeElevationGuideImage",
rect: {
func: function () {
var j = Kp.EdgeElevationGuide.data,
v = j.x,
s = j.y,
M = je.getStyle("curveElevationIntersectSize"),
c = je.getStyle("curveElevationGuideShift");
return v += c[0], s += c[1], [v - M, s - M, 2 * M, 2 * M]
}
}
}]
}, O.Default.setImage("Icons.ConnectGuideBgImage", {
width: 12,
height: 12,
comps: [{
type: "shape",
background: "#3399ff",
fillRule: "evenodd",
shadowColor: "#1ABC9C",
rotation: 3.14159,
points: [6.00001, 11.99999, 6.00001, 11.99999, 2.6863, 11.99999, 1e-5, 9.30695, 1e-5, 5.99999, 1e-5, 5.99999, 1e-5, 2.68628, 2.69305, -1e-5, 6.00001, -1e-5, 12.00001, -1e-5, 11.99998, 12.00001, 6.00001, 11.99999],
segments: [1, 2, 4, 2, 4, 2, 2, 2]
}]
}), O.Default.setImage("Icons.ConnectGuideHeaderImage", {
width: 12,
height: 12,
comps: [{
type: "oval",
background: "#3399FF",
borderColor: "#3399FF",
shadowColor: "#1ABC9C",
rect: [0, 0, 12, 12]
}, {
type: "shape",
borderWidth: 1,
borderColor: "rgb(255,255,255)",
borderCap: "round",
shadowColor: "#1ABC9C",
points: [4.76, 2.56, 8.2, 5.98, 4.76, 9.44]
}]
}), Kp.ConnectGuide = {
comps: [{
type: "image",
name: "Icons.ConnectGuideBgImage",
rotation: {
func: function () {
return Kp.ConnectGuide.data.rotation
}
},
rect: {
func: function () {
var N = Kp.ConnectGuide.data.connect;
N.x, N.y;
var i = je.getStyle("connectGuideIntersectSize");
return [[N.x, N.y], 2 * i, 2 * i]
}
}
}, {
type: "image",
name: "Icons.ConnectGuideHeaderImage",
rect: {
func: function () {
var V = Kp.ConnectGuide.data.cursorPos || Kp.ConnectGuide.data.connect,
r = je.getStyle("connectGuideIntersectSize");
return [[V.x, V.y], 2 * r - 2, 2 * r - 2]
}
}
}, {
type: "shape",
background: null,
borderColor: "#3399ff",
borderWidth: 2,
segments: [1, 4],
points: {
func: function () {
var E = Kp.ConnectGuide.data.connect,
F = Kp.ConnectGuide.data.cursorPos || E;
return [E.x, E.y, E.x + .5 * (F.x - E.x), E.y, F.x + .5 * (E.x - F.x), F.y, F.x, F.y]
}
}
}]
}, O.Default.setImage("Icons.ConnectGuideGarbageImage", {
width: 48,
height: 48,
comps: [{
type: "oval",
background: "rgba(0,0,0,0.1)",
borderColor: "#979797",
shadowColor: "#1ABC9C",
rect: [0, 0, 48, 48]
}, {
type: "shape",
borderWidth: 2,
borderColor: "rgb(255,255,255)",
borderCap: "round",
shadowColor: "#1ABC9C",
points: [19.84721, 19.69091, 19.84721, 32.25123]
}, {
type: "shape",
borderWidth: 2,
borderColor: "rgb(255,255,255)",
borderCap: "round",
shadowColor: "#1ABC9C",
points: [24.10371, 19.69091, 24.10371, 32.25123]
}, {
type: "shape",
borderWidth: 2,
borderColor: "rgb(255,255,255)",
borderCap: "round",
shadowColor: "#1ABC9C",
points: [28.15279, 19.69091, 28.15279, 32.25123]
}, {
type: "shape",
borderWidth: 2,
borderColor: "rgb(255,255,255)",
borderCap: "round",
shadowColor: "#1ABC9C",
points: [11.23055, 15.22377, 36.76945, 15.189, 19.12302, 15.17121, 20.94722, 11.5228, 26.41985, 11.5228, 28.24406, 15.17121]
}, {
type: "rect",
borderWidth: 2,
borderColor: "rgb(255,255,255)",
shadowColor: "#1ABC9C",
rect: [15.48702, 15.22377, 17.02595, 21.25344]
}]
}), O.Default.setImage("Icons.ConnectGuideDeletingImage", {
width: 56,
height: 56,
comps: [{
type: "oval",
background: "rgba(232,0,0,0.75)",
borderColor: "#979797",
shadowColor: "#1ABC9C",
rect: [0, 0, 56, 56]
}, {
type: "shape",
borderWidth: 2,
borderColor: "rgb(255,255,255)",
borderCap: "round",
shadowColor: "#1ABC9C",
points: [22.67939, 27.69091, 22.67939, 40.25123]
}, {
type: "shape",
borderWidth: 2,
borderColor: "rgb(255,255,255)",
borderCap: "round",
shadowColor: "#1ABC9C",
points: [26.93588, 27.69091, 26.93588, 40.25123]
}, {
type: "shape",
borderWidth: 2,
borderColor: "rgb(255,255,255)",
borderCap: "round",
shadowColor: "#1ABC9C",
points: [30.98497, 27.69091, 30.98497, 40.25123]
}, {
type: "shape",
borderWidth: 2,
borderColor: "rgb(255,255,255)",
borderCap: "round",
shadowColor: "#1ABC9C",
anchorX: 0,
anchorY: 1,
rotation: 5.65062,
points: [14.06272, 23.22377, 39.60163, 23.189, 21.9552, 23.17121, 23.7794, 19.5228, 29.25203, 19.5228, 31.07623, 23.17121]
}, {
type: "rect",
borderWidth: 2,
borderColor: "rgb(255,255,255)",
shadowColor: "#1ABC9C",
rect: [18.3192, 23.22377, 17.02595, 21.25344]
}]
}), Kp.ConnectGuideGarbage = {
comps: [{
type: "image",
name: {
func: function () {
var Q = Kp.ConnectGuideGarbage.data.hover;
return Q ? "Icons.ConnectGuideDeletingImage" : "Icons.ConnectGuideGarbageImage"
}
},
rect: {
func: function () {
var d = Kp.ConnectGuideGarbage.data,
n = je.getStyle("connectGuideGarbageIntersectsize");
return d.hover && (n += 5), [[d.x, d.y], 2 * n, 2 * n]
}
}
}]
};
var ae = 6;
Kp.ShapeActivingCtrl = {
comps: [{
type: "shape",
visible: {
func: function () {
return Kp.ShapeActivingCtrl.data.c1 ? !0 : !1
}
},
points: {
func: function () {
var h = Kp.ShapeActivingCtrl.data;
return [h.point.x, h.point.y, h.c1.x, h.c1.y]
}
},
segments: [1, 2],
background: null,
borderWidth: 1,
borderColor: {
func: function () {
return ci
}
}
}, {
type: "shape",
visible: {
func: function () {
return Kp.ShapeActivingCtrl.data.c2 ? !0 : !1
}
},
points: {
func: function () {
var K = Kp.ShapeActivingCtrl.data;
return [K.point.x, K.point.y, K.c2.x, K.c2.y]
}
},
segments: [1, 2],
background: null,
borderWidth: 1,
borderColor: {
func: function () {
return ci
}
}
}, {
type: "shape",
visible: {
func: function () {
return Kp.ShapeActivingCtrl.data.c1 ? !0 : !1
}
},
points: {
func: function () {
var x = Kp.ShapeActivingCtrl.data.c1,
f = x.x,
Q = x.y,
b = ae / 2;
return "c1" === Kp.ShapeActivingCtrl.data.hl && (b += .5), [f - b, Q - b, f - b, Q + b, f + b, Q + b, f + b, Q - b]
}
},
segments: [1, 2, 2, 2, 5],
borderWidth: 2,
background: {
func: function () {
return je.getStyle("shapeCtrlPointBackground")
}
},
borderColor: {
func: function () {
return "c1" === Kp.ShapeActivingCtrl.data.hl ? je.getStyle("shapeCtrlPointHighlightBorder") || ci : je.getStyle("shapeCtrlPointBorderColor") || ci
}
}
}, {
type: "shape",
visible: {
func: function () {
return Kp.ShapeActivingCtrl.data.c2 ? !0 : !1
}
},
points: {
func: function () {
var R = Kp.ShapeActivingCtrl.data.c2,
k = R.x,
X = R.y,
N = ae / 2;
return "c2" === Kp.ShapeActivingCtrl.data.hl && (N += .5), [k - N, X - N, k - N, X + N, k + N, X + N, k + N, X - N]
}
},
segments: [1, 2, 2, 2, 5],
borderWidth: 2,
background: {
func: function () {
return je.getStyle("shapeCtrlPointBackground")
}
},
borderColor: {
func: function () {
return "c2" === Kp.ShapeActivingCtrl.data.hl ? je.getStyle("shapeCtrlPointHighlightBorder") || ci : je.getStyle("shapeCtrlPointBorderColor") || ci
}
}
}]
}, Kp.RoundPoint = {
comps: [{
type: "circle",
background: "rgb(247,247,247)",
borderWidth: 1,
borderColor: {
func: function () {
return ci
}
},
rect: {
func: function () {
return [[Kp.RoundPoint.data.x, Kp.RoundPoint.data.y], ho, ho]
}
}
}]
}, Kp.AttachPoint = {
comps: [{
type: "rect",
background: {
func: function () {
return Kp.AttachPoint.data.isAttach ? "rgb(51,153,255)" : "rgb(247,247,247)"
}
},
borderWidth: 1,
rotation: Math.PI / 4,
borderColor: {
func: function () {
return ci
}
},
rect: {
func: function () {
var i = Kp.AttachPoint.data.isAttach ? ho + 4 : ho;
return [[Kp.AttachPoint.data.x, Kp.AttachPoint.data.y], i, i]
}
}
}]
}, Kp.SimpleRect = {
comps: [{
type: "rect",
background: null,
borderWidth: {
func: function () {
return Kp.SimpleRect.data.borderWidth || 1
}
},
borderColor: {
func: function () {
return Kp.SimpleRect.data.color || ci
}
},
rect: {
func: function () {
var J = Kp.SimpleRect.data;
return [J.x, J.y, J.width, J.height]
}
}
}]
}, O.Default.setImage("Icons.MoveDummyImage", {
width: 32,
height: 32,
boundExtend: 12,
attachStyle: "close",
comps: [{
type: "oval",
background: "rgb(255,255,255)",
borderColor: "#979797",
shadow: !0,
shadowColor: "rgba(0,0,0,0.25)",
shadowOffsetX: 0,
rect: [0, 0, 32, 32]
}, {
type: "shape",
background: "rgb(51,153,255)",
pixelPerfect: !0,
points: [8.65079, 11.90713, 9.05502, 11.46921, 9.70629, 11.46921, 10.11052, 11.90713, 10.51476, 12.28891, 10.51476, 12.92895, 10.11052, 13.34441, 8.49359, 14.97258, 12.2889, 14.97258, 12.85034, 14.97258, 13.29949, 15.42172, 13.29949, 15.99439, 13.29949, 16.57828, 12.85034, 17.0162, 12.2889, 17.0162, 8.49359, 17.0162, 10.11052, 18.6556, 10.51476, 19.0486, 10.51476, 19.7111, 10.11052, 20.09288, 9.70629, 20.50834, 9.05502, 20.50834, 8.65079, 20.09288, 5.32709, 16.76917, 5.28217, 16.71303, 4.87794, 16.32002, 4.87794, 15.67998, 5.28217, 15.26452, 8.65079, 11.90713, 8.65079, 11.90713, 8.65079, 11.90713, 13.3444, 10.09931, 13.3444, 10.09931, 12.94017, 10.50354, 12.2889, 10.50354, 11.88467, 10.09931, 11.48043, 9.69507, 11.48043, 9.0438, 11.88467, 8.63957, 15.27574, 5.25973, 15.66874, 4.86672, 16.32001, 4.86672, 16.73547, 5.25973, 16.76917, 5.31586, 20.10409, 8.63957, 20.50832, 9.0438, 20.50832, 9.68385, 20.10409, 10.09931, 19.69986, 10.49231, 19.07105, 10.50354, 18.64436, 10.09931, 17.02742, 8.45991, 17.02742, 12.26646, 17.02742, 12.83912, 16.55581, 13.31072, 15.99438, 13.31072, 15.43295, 13.31072, 14.98379, 12.83912, 14.98379, 12.26646, 14.96134, 8.45991, 13.3444, 10.09931, 13.3444, 10.09931, 13.3444, 10.09931, 21.90069, 13.33318, 21.90069, 13.33318, 21.49646, 12.91771, 21.49646, 12.27768, 21.90069, 11.89591, 22.31615, 11.45798, 22.94497, 11.45798, 23.36043, 11.89591, 26.72904, 15.2533, 27.12205, 15.66876, 27.12205, 16.3088, 26.72904, 16.7018, 26.6729, 16.75794, 23.36043, 20.08165, 22.94497, 20.49711, 22.31615, 20.49711, 21.90069, 20.08165, 21.49646, 19.69987, 21.49646, 19.03737, 21.90069, 18.64437, 23.51763, 17.00498, 19.72231, 17.00498, 19.14965, 17.00498, 18.71173, 16.56705, 18.71173, 15.98316, 18.71173, 15.41049, 19.14965, 14.96135, 19.72231, 14.96135, 23.51763, 14.96135, 21.90069, 13.33318, 21.90069, 13.33318, 21.90069, 13.33318, 11.88467, 23.32675, 11.88467, 23.32675, 11.48043, 22.94498, 11.48043, 22.27125, 11.88467, 21.88948, 12.2889, 21.48523, 12.94017, 21.48523, 13.3444, 21.88948, 14.96134, 23.52887, 14.98379, 19.7111, 14.98379, 19.14966, 15.43295, 18.67805, 15.99438, 18.67805, 16.55581, 18.67805, 17.02742, 19.14966, 17.02742, 19.7111, 17.02742, 23.52887, 18.64436, 21.88948, 19.07105, 21.48523, 19.69986, 21.48523, 20.10409, 21.88948, 20.50832, 22.27125, 20.50832, 22.94498, 20.10409, 23.32675, 16.76917, 26.65045, 16.73547, 26.72905, 16.32001, 27.13329, 15.66874, 27.13329, 15.27574, 26.72905, 11.88467, 23.32675, 11.88467, 23.32675, 11.88467, 23.32675],
segments: [1, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 2, 2, 2, 1, 2, 4, 4, 2, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 2, 2, 1, 2, 4, 4, 2, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 2, 2, 1, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 2, 2, 2]
}]
}), Kp.MoveDummy = {
comps: [{
type: "image",
name: "Icons.MoveDummyImage",
rect: {
func: function () {
var n = Kp.MoveDummy.data;
return [[n.pos.x, n.pos.y], 2 * n.size, 2 * n.size]
}
}
}]
}, se.Icons.DrawIcon = function (z, B, T, h) {
T.width = T.height = bs, T.data = h, je = z, O.Default.drawImage(B, T, 0, 0, bs, bs)
}, se.Icons.MapPoints = function (H, n) {
for (var p = 0, s = H.length; s > p; p++) H[p] /= n
}, se.roundTo = function (b, h, O) {
var U = Math.abs(b % h);
return O > U || O > h - U ? h * Math.round(b / h) : b
}, se.toFixed = function (f) {
return Math.round(100 * f) / 100
}, se.getDataMatrix = function (q) {
if (q instanceof O.Shape) {
var Y = new O.Math.Matrix2d,
h = q.getPosition();
return Y.translate(-h.x, -h.y).scale(q.getScale().x, q.getScale().y).rotate(q.getRotation()).translate(h.x, h.y), Y
}
return q.getMatrix ? q.getMatrix() : new O.Math.Matrix2d
};
var Ao = se.Math.Curve = function () {
this._curves = []
};
Ao.prototype = {}, Ao.prototype.constructor = Ao, Ao.prototype.createFromHtShape = function (Y, J, V) {
J instanceof O.List && (J = J.toArray());
var I, W, L, D, _, G, S, m = this,
C = null,
d = null,
H = 0,
v = se.Math.Vector2,
T = se.Math.CubicBezier,
p = function (H) {
return new v(Y[H], Y[H + 1], V ? V[H / 2] : Z)
};
for (W = 0, L = J.length; L > W; W++) {
switch (D = J[W], _ = null, D) {
case 1:
d = p(H), C = d, H += 2;
break;
case 2:
I = p(H), H += 2, _ = new T(d, d.clone(), I.clone(), I), d = I;
break;
case 3:
G = p(H), I = p(H + 2), H += 4, _ = new T(d, G.clone().sub(d).multiplyScalar(2 / 3).add(d), G.clone().sub(I).multiplyScalar(2 / 3).add(I), I), d = I;
break;
case 4:
G = p(H), S = p(H + 2), I = p(H + 4), H += 6, _ = new T(d, G, S, I), d = I;
break;
case 5:
if (!C) break;
_ = new T(d, d.clone(), C.clone(), C), d = null, C = null
}
_ && (_._index = m._curves.length, m._curves.push(_))
}
}, Ao.prototype.checkPoint = function (T, p) {
var G, B, y, o, R, A = this,
g = A._curves;
for (G = 0, B = g.length; B > G; G++)
if (o = g[G], R = o.intersectRect(T, p, p), R.length) return y = 0, R.forEach(function (Q) {
y += Q.t
}), y /= R.length, T = o.getPointAt(y), T.t = y, {
bezier: o,
intersection: T
}
}, Ao.prototype.insertKnot = function (t, I) {
var k = t.insertKnot(I),
m = this,
L = m._curves;
L.splice(t._index, 1, k[0], k[1])
}, Ao.prototype._isCloseEnough = function (e, g) {
return Math.abs(e.x - g.x) < 1e-6 && Math.abs(e.y - g.y) < 1e-6
}, Ao.prototype._isSamePoint = function (G, E) {
return G === E
}, Ao.prototype.moveRealPoint = function (R, T) {
var t = this,
A = t._curves,
f = T.clone().sub(R);
A.forEach(function (Y) {
var n = Y._p1;
Y._p2, Y._p3;
var d = Y._p4;
t._isSamePoint(n, R) && (Y._p2.add(f), Y._p1 = T), t._isSamePoint(d, R) && (Y._p3.add(f), Y._p4 = T)
})
}, Ao.prototype.moveCtrlDueToRealPointMovement = function (r, Z) {
var a = this,
i = a._curves,
c = function (o) {
o.add(Z), o.e && Z.e && (o.e += Z.e)
};
i.forEach(function (S) {
var x = S._p1;
S._p2, S._p3;
var z = S._p4;
a._isSamePoint(x, r) && c(S._p2), a._isSamePoint(z, r) && c(S._p3)
})
}, Ao.prototype.moveCtrlPoint = function (o, e, d) {
var m = o[d];
if (m) {
m.e !== Z && (e.e = m.e);
var H = this,
B = H._curves;
e.clone().sub(m), B.forEach(function (P) {
var $;
"c2" === d ? $ = "_p2" : "c1" === d && ($ = "_p3"), H._isSamePoint(P[$], m) && (P[$] = e)
}), o[d] = e
}
}, Ao.prototype.deleteRealPoint = function (G, l) {
var D, E, w, n, p, s, Y, J = this,
H = J._curves,
W = {},
Q = [],
O = se.Math.CubicBezier;
for (E = 0, w = H.length; w > E; E++) D = H[E], n = D._p1, p = D._p2, s = D._p3, Y = D._p4, (W[E] || !J._isSamePoint(n, G)) && (J._isSamePoint(Y, G) ? w > E + 1 && J._isSamePoint(H[E + 1]._p1, G) && (l || Q.push(new O(n, p, H[E + 1]._p3, H[E + 1]._p4))) : Q.push(D));
J._curves = Q
}, Ao.prototype.findPairs = function (R, l) {
var d, j, t, f, I, J, T, o, Y = this,
L = Y._curves,
O = {},
z = [];
for (j = 0, t = L.length; t > j; j++) d = L[j], f = d._p1, I = d._p2, J = d._p3, T = d._p4, !O[j] && Y._isSamePoint(f, R) && (l ? z.push({
point: f,
r2: T
}) : z.push({
point: f,
c2: I
})), Y._isSamePoint(T, R) && (o = l ? {
point: T,
r1: f
} : {
point: T,
c1: J
}, t > j + 1 && Y._isSamePoint(L[j + 1]._p1, R) && (l ? o.r2 = L[j + 1]._p4 : o.c2 = L[j + 1]._p2, O[j + 1] = !0), z.push(o));
return z
}, Ao.prototype.toHtShape = function () {
var X = this,
R = X._curves,
k = [],
A = [],
e = {
x: 1 / 0,
y: 1 / 0
};
return R.forEach(function (R) {
var $ = R._p1,
P = R._p2,
E = R._p3,
F = R._p4;
return X._isCloseEnough($, e) || (k.push(1), A.push($.clone())), e = F, X._isCloseEnough($, P) && X._isCloseEnough(E, F) ? (k.push(2), A.push(F.clone()), void 0) : (k.push(4), A.push(P.clone(), E.clone(), F.clone()), void 0)
}), {
segments: k,
points: A
}
};
var Po = se.Math.CubicBezier = function (M, V, v, d) {
var I = this;
I._id = se.Math.CubicBezier._globalId++, I._p1 = M, I._p2 = V, I._p3 = v, I._p4 = d
};
Po._globalId = 1, Po.prototype = {}, Po.prototype.constructor = Po, Po.prototype.toString = function () {
return this._id
}, Po.prototype.intersectRect = function (Q, M, g) {
var z = M / 2,
I = g / 2,
p = Q.x,
F = Q.y,
d = se.Math.Vector2,
j = new d(-z + p, -I + F),
t = new d(z + p, I + F),
m = new d(t.x, j.y),
c = new d(j.x, t.y),
e = this,
$ = e.intersectLine(j, m),
h = e.intersectLine(m, t),
L = e.intersectLine(t, c),
R = e.intersectLine(c, j),
w = $.concat(h).concat(L).concat(R);
return w
}, Po.prototype.intersectLine = function (B, i) {
var U, d, y, a, r, u, l, X, t, C, w, R, Y, F = this,
H = B.clone().min(i),
e = B.clone().max(i);
a = F._p1, r = F._p2, u = F._p3, l = F._p4, U = a.clone().multiplyScalar(-1), d = r.clone().multiplyScalar(3), y = u.clone().multiplyScalar(-3), w = U.add(d).add(y).add(l), U = a.clone().multiplyScalar(3), d = r.clone().multiplyScalar(-6), y = u.clone().multiplyScalar(3), C = U.add(d).add(y), U = a.clone().multiplyScalar(-3), d = r.clone().multiplyScalar(3), t = U.add(d), X = a.clone(), Y = new se.Math.Vector2(B.y - i.y, i.x - B.x), R = B.x * i.y - i.x * B.y;
for (var j = F.getRoots(Y.dot(w), Y.dot(C), Y.dot(t), Y.dot(X) + R), c = new Array, W = 0, k = j.length; k > W; W++) {
var Z = j[W];
if (!(0 > Z || Z > 1)) {
var T = F.getPointAt(Z);
T.t = Z, B.x == i.x ? H.y <= T.y && T.y <= e.y && c.push(T) : B.y == i.y ? H.x <= T.x && T.x <= e.x && c.push(T) : T.x >= H.x && T.y >= H.y && T.x <= e.x && T.y <= e.y && c.push(T)
}
}
return c
}, Po.prototype.solveTForPoint = function (s) {
var p, A, f, S, q = this;
p = q._p1.x - s.x, A = q._p2.x - s.x, f = q._p3.x - s.x, S = q._p4.x - s.x;
for (var P = q.getRoots(S - 3 * f + 3 * A - p, 3 * f - 6 * A + 3 * p, 3 * A - 3 * p, p), $ = Z, o = 1 / 0, c = 0, L = P.length; L > c; c++) {
var Q = P[c];
if (!(0 > Q || Q > 1)) {
var m = q.getPointAt(Q);
m.t = Q;
var i = Math.abs(m.y - s.y);
o > i && (o = i, $ = m)
}
}
return $
}, Po.prototype.getPointAt = function (n) {
var e = this,
O = e._p1,
u = e._p2,
d = e._p3,
Z = e._p4,
o = O.clone().lerp(u, n),
G = u.clone().lerp(d, n),
i = d.clone().lerp(Z, n),
g = o.lerp(G, n),
_ = G.lerp(i, n);
return g.lerp(_, n)
}, Po.prototype.getPointByPercentage = function (l) {
var z = this.length * l,
J = this._cacheLength,
h = J.length;
if (0 === z) return J[0].point;
if (l >= 1) return J[h - 1].point;
for (var q = 0; h > q; q++) {
var m = J[q];
if (!(m.len < z)) {
var $ = J[q - 1];
return m.point.clone().sub($.point).setLength(z - $.len).add($.point)
}
}
}, Po.prototype.getTByPercentage = function (j) {
var q = this.length * j,
Z = this._cacheLength,
a = Z.length;
if (0 === q || 0 >= j) return Z[0].t;
if (j >= 1) return Z[a - 1].t;
for (var t = 0; a > t; t++) {
var H = Z[t];
if (!(H.len < q)) {
var g = Z[t - 1];
return (q - g.len) / (H.len - g.len) * (H.t - g.t) + g.t
}
}
}, Po.prototype.getRoots = function (Y, s, t, u) {
var T, A, e, F, $, E = new Array;
if (Math.abs(Y) < 1e-6) {
var T = s,
A = t / T,
e = u / T,
F = A * A - 4 * e;
if (F > 0) {
var $ = Math.sqrt(F);
E.push(.5 * (-A + $)), E.push(.5 * (-A - $))
} else 0 == F && E.push(.5 * -A)
}
s /= Y, t /= Y, u /= Y, T = (3 * t - s * s) / 3, A = (2 * s * s * s - 9 * t * s + 27 * u) / 27;
var M = s / 3,
V = A * A / 4 + T * T * T / 27,
v = A / 2;
if (Math.abs(V) <= 1e-6 && (V = 0), V > 0) {
var w, O, $ = Math.sqrt(V);
w = -v + $, O = w >= 0 ? Math.pow(w, 1 / 3) : -Math.pow(-w, 1 / 3), w = -v - $, w >= 0 ? O += Math.pow(w, 1 / 3) : O -= Math.pow(-w, 1 / 3), E.push(O - M)
} else if (0 > V) {
var r = Math.sqrt(-T / 3),
Q = Math.atan2(Math.sqrt(-V), -v) / 3,
C = Math.cos(Q),
f = Math.sin(Q),
q = Math.sqrt(3);
E.push(2 * r * C - M), E.push(-r * (C + q * f) - M), E.push(-r * (C - q * f) - M)
} else {
var w;
w = v >= 0 ? -Math.pow(v, 1 / 3) : Math.pow(-v, 1 / 3), E.push(2 * w - M), E.push(-w - M)
}
return E
}, Po.prototype._70I = function () {
var i = this;
return i._p1.distanceToSquared(i._p2) < 1e-10 && i._p3.distanceToSquared(i._p4) < 1e-10
}, Po.prototype.insertKnot = function (K) {
var d = this,
v = d._p1,
g = d._p2,
U = d._p3,
Q = d._p4,
z = v.clone().lerp(g, K),
E = g.clone().lerp(U, K),
f = U.clone().lerp(Q, K),
V = z.clone().lerp(E, K),
I = E.clone().lerp(f, K),
$ = V.clone().lerp(I, K);
return d._70I() ? (v.clone().lerp(Q, K), [new se.Math.CubicBezier(v, v.clone(), $.clone(), $), new se.Math.CubicBezier($, $.clone(), Q.clone(), Q)]) : [new se.Math.CubicBezier(v, z, V, $), new se.Math.CubicBezier($, I, f, Q)]
}, o.defineProperties(Po.prototype, {
length: {
get: function () {
var A = this._cacheLength;
if (!A) {
A = this._cacheLength = [];
for (var Z = this._p1, K = 0, F = 0; 1 >= K;) {
var k = this.getPointAt(K += .001);
F += k.clone().sub(Z).length(), Z = k, A.push({
len: F,
t: K,
point: k.clone()
})
}
}
return A[A.length - 1].len
}
},
p1: {
get: function () {
return this._p1
}, set: function ($) {
this._p1 = $, this._cacheLength = Z
}
},
p2: {
get: function () {
return this._p2
}, set: function (U) {
this._p2 = U, this._cacheLength = Z
}
},
p3: {
get: function () {
return this._p3
}, set: function (r) {
this._p3 = r, this._cacheLength = Z
}
},
p4: {
get: function () {
return this._p4
}, set: function (K) {
this._p4 = K, this._cacheLength = Z
}
}
});
var wn = O.Default.getInternal().ui().EdgeUI,
xe = {
_47O: function (j) {
var D = this,
z = xe.getBackups()._47O;
se.inEdit(D.gv) || z.call(D, j)
}
};
se.Inject.registAsModule(xe, wn);
var Af = O.Default.getInternal().ui().NodeUI,
Zq = {
_47O: function (n) {
var h = this,
X = Zq.getBackups()._47O;
se.inEdit(h.gv) || X.call(h, n)
}, getSelectWidth: function () {
var M = this,
l = M.gv,
O = M._data;
if (l.isEditable(O) && se.inEdit(l)) return 0;
var e = Zq.getBackup("getSelectWidth");
return e.call(M)
}
};
se.Inject.registAsModule(Zq, Af);
var Ab = O.graph.GraphView,
Kl = {
_editPointSize: function () {
var f = O.Default.isTouchable,
S = se.getStyle("pointSize");
return S[f ? 0 : 1]
}(),
isPointEditable: function (J) {
var p = this;
if (se.inEdit(p)) return p._pointEditableFunc ? p._pointEditableFunc(J) : !0;
var W = Kl.getBackup("isPointEditable");
W.call(p, J)
}, isEditable: function (C) {
var H, A = this,
s = Kl.getBackup("isEditable");
if (H = C instanceof se.Group ? !0 : s.call(A, C), !se.inEdit(A)) return H;
if (!(C instanceof O.Edge)) return H;
if (!C.s("2d.editable")) return !1;
var g = A.getEditableFunc();
return g ? g(C) : !0
}, _42: function (n, d) {
var m = this,
p = Kl.getBackups()._42;
if (p.call(m, n, d), se.inEdit(m)) {
var r = m.getEditInteractor();
r.drawImpl()
}
}
};
se.Inject.registAsModule(Kl, Ab);
var Xp = O.Default.getInternal().ui().ShapeUI,
pm = {
_47O: function (d) {
var s = this,
p = pm.getBackups()._47O;
se.inEdit(s.gv) || p.call(s, d)
}
};
se.Inject.registAsModule(pm, Xp);
var pk = O.graph.DefaultInteractor,
ji = {
handle_mousewheel: function (N) {
var t = this,
l = ji.getBackup("handle_mousewheel");
se.inEdit(t.gv) || l.call(t, N)
}
};
se.Inject.registAsModule(ji, pk);
var Wr = O.graph.MoveInteractor,
tn = {
_calcShift: function (h, f) {
var W = this,
I = tn.getBackup("_calcShift"),
D = W.gv;
if (!se.inEdit(D)) return I.call(W, h, f);
var E = D.getEditInteractor(),
d = E.getSubModule("Move").calcShift(h, f, W);
return d || I.call(W, h, f)
}, clear: function (x) {
var Q = this,
P = tn.getBackup("clear");
P.call(Q, x);
var D = Q.gv;
if (se.inEdit(D)) {
var F = D.getEditInteractor();
F.getSubModule("Move").clear(x)
}
}
};
se.Inject.registAsModule(tn, Wr);
var yf = se.Rect = function (P) {
this.catalog = "Rect", this._interactor = P
};
yf.prototype = {}, yf.prototype.constructor = yf, yf.prototype.gatherInfo = function (w, X) {
var D = this;
if (1 === X.length) {
var $ = X[0];
return $ instanceof O.Shape && $._70I() ? D.gatherLine(w, $) : Th($, w) ? !1 : D.gatherSingleTarget(w, $)
}
return X.length > 1 ? D.gatherMultiTargets(w, X) : !1
}, yf.prototype.gatherSingleTarget = function (u, v) {
if (v.getCorners) {
var L, H = this,
a = H.info;
H.target = v, L = H.screenInfo = {};
var M = v.getCorners();
a.LT = new se.Math.Vector2(M[0]), a.LB = new se.Math.Vector2(M[1]), a.RB = new se.Math.Vector2(M[2]), a.RT = new se.Math.Vector2(M[3]), a.T = a.LT.clone().add(a.RT).divideScalar(2), a.B = a.LB.clone().add(a.RB).divideScalar(2), a.L = a.LT.clone().add(a.LB).divideScalar(2), a.R = a.RT.clone().add(a.RB).divideScalar(2);
for (var P in a) L[P] = se.toScreenPosition(u, a[P]);
var e = H._interactor,
j = e.getStyle("checkSize"),
k = function (J, $, m) {
var I = $.clone().sub(J).setLength(-j),
x = m.clone().sub(J).setLength(-j),
v = I.add(x).add(J);
return v
};
return L.rotLT = k(L.LT, L.RT, L.LB), L.rotLB = k(L.LB, L.LT, L.RB), L.rotRB = k(L.RB, L.LB, L.RT), L.rotRT = k(L.RT, L.LT, L.RB), L.rotT = L.rotLT.clone().add(L.rotRT).divideScalar(2), L.rotB = L.rotLB.clone().add(L.rotRB).divideScalar(2), L.rotL = L.rotLT.clone().add(L.rotLB).divideScalar(2), L.rotR = L.rotRT.clone().add(L.rotRB).divideScalar(2), L.rotation = v.getRotation(), H.gatherConnectInfo(), !0
}
}, yf.prototype.gatherConnectInfo = function () {
var e = this,
Y = e.target,
N = e._interactor,
f = e.screenInfo,
G = N.gv;
if (G.isConnectActionVisible(Y) && N.getStyle("connectGuideVisible")) {
var S;
Y.s && (S = Y.s("connectGuideShift")), S || (S = N.getStyle("connectGuideShift"));
var V = Y.getAnchor(),
F = Y.getSize(),
p = Y.toGlobal({
x: F.width * (S[0] - V.x),
y: F.height * (S[1] - V.y)
});
p = se.toScreenPosition(G, p), f.P1 ? p.add(f.P2.clone().sub(f.P1).setLength(S[2])) : (p.add(f.RT.clone().sub(f.LT).setLength(S[2])), p.add(f.LB.clone().sub(f.LT).setLength(S[3]))), f.connect = p
}
}, yf.prototype.gatherMultiTargets = function (F, K) {
var o = se.Group.findOrCreateGroup(K);
if (!o) return !1;
var I = this;
return I.editing && "rotate" !== I.editing.mode || o.calcInfo(), I.gatherSingleTarget(F, o)
}, yf.prototype.gatherLine = function (l, q) {
this.target = q;
var Q = this.screenInfo = {},
e = q.getPoints(),
D = se.getDataMatrix(q);
return Q.P1 = se.toScreenPosition(l, D.apply(e.get(0))), Q.P2 = se.toScreenPosition(l, D.apply(e.get(1))), this.gatherConnectInfo(), !0
}, yf.ResizeKeys = ["LT", "RB", "LB", "RT", "L", "R", "B", "T"], yf.ResizeDirection = [{
x: -1,
y: -1
}, {
x: 1,
y: 1
}, {
x: -1,
y: 1
}, {
x: 1,
y: -1
}, {
x: -1,
y: 0
}, {
x: 1,
y: 0
}, {
x: 0,
y: 1
}, {
x: 0,
y: -1
}], yf.RotateKeys = ["rotLT", "rotRB", "rotLB", "rotRT", "rotL", "rotR", "rotB", "rotT"], yf.prototype.check = function (s, h, g) {
if (O.Default.isLeftButton(h)) {
var l = this;
if (l.editing = null, l.tipInfo = null, l.screenInfo) {
var L = l.target,
i = s.isEditable(L),
v = l.screenInfo;
if (i && v.connect) {
var Q = l._checkConnect(g);
if (Q) return Q
}
if (v.P1) return l._checkLine(g);
var z, e, p, Y = null,
D = l._interactor,
$ = D.getStyle("checkSize");
if (i && s.isRectEditable(L))
for (e = 0; e < se.Rect.ResizeKeys.length; e++)
if (p = se.Rect.ResizeKeys[e], se.checkHit(g, v[p], $)) {
Y = p, z = "resize";
break
}
if (!Y && i && s.isRotationEditable(L) && !D.getStyle("rotateAsClock")) {
var f = D.getStyle("rotateCheckSize");
for (e = 0; e < se.Rect.RotateKeys.length; e++)
if (p = se.Rect.RotateKeys[e], se.checkHit(g, v[p], f)) {
Y = p, z = "rotate";
break
}
}
if (!Y) return D.setCursor("default"), void 0;
if ("rotate" === z) {
var R, x = s.lp(h);
if (L instanceof se.Group) {
var a = D.getStyle("groupRotateModeKey");
"string" == typeof a && (a = [a]);
for (var y = !1, A = 0, q = a.length; q > A; A++)
if (h[a[A]]) {
y = !0;
break
}
var Z = D.getStyle("groupRotateModeDefault");
R = y ? "batch" === Z ? "block" : "batch" : Z
}
var X = "batch" === R ? L.getAnchor2() : L.getPosition(),
E = Math.atan2(x.y - X.y, x.x - X.x);
D._setRotateCursor(E), l.editing = {
mode: z,
key: Y,
pos: X,
flipY: L.getScale().y < 0,
rotation: L.getRotation(),
hitRot: E
}, R && (l.editing.groupRotateMode = R)
} else {
var o = se.Rect.ResizeKeys.indexOf(Y),
H = se.Rect.ResizeDirection[o],
F = Math.cos(L.getRotation()),
r = Math.sin(L.getRotation()),
P = H.x * Math.sign(L.getScale().x),
M = H.y * Math.sign(L.getScale().y),
W = Math.atan2(-r * P - F * M, F * P - r * M),
T = (Math.round(W / (Math.PI / 4)) + 8) % 8,
t = ["ew-resize", "nesw-resize", "ns-resize", "nwse-resize", "ew-resize", "nesw-resize", "ns-resize", "nwse-resize"][T];
this._interactor.setCursor(t);
var C = L.getWidth(),
G = L.getHeight(),
j = L.getAnchor();
l.editing = {
mode: z,
key: Y,
rect: {
x: -C * j.x,
y: -G * j.y,
width: C,
height: G
},
anchor: j,
matrix: L.getMatrix()
}
}
return Y
}
}
}, yf.prototype._checkLine = function (O) {
var I = this;
I.screenInfo;
var d, J = I._interactor.getStyle("checkSize");
if (se.checkHit(O, I.screenInfo.P1, J)) d = "P1";
else {
if (!se.checkHit(O, I.screenInfo.P2, J)) return this._interactor.setCursor("default"), void 0;
d = "P2"
}
return I.editing = {
mode: "line",
key: d
}, d
}, yf.prototype._checkConnect = function (K) {
var a = this,
g = a.screenInfo,
P = a._interactor,
d = P.getStyle("connectGuideIntersectSize"),
l = g.connect,
o = K.x,
j = l.x;
if (j > o && d > j - o && Math.abs(l.y - K.y) < d || o >= j && se.checkHit(K, l, d)) {
var S = "connect",
O = u.getConnectAction(P.gv);
if (a.editing = {
mode: S
}, O && O.delete)
if (a.target instanceof se.Group) {
var R = !0;
P.gv.sm().getSelection().each(function (K) {
O.delete.visible.call(null, P.gv, K) || (R = !1)
}), a.editing.hasDeleteAction = R
} else O.delete.visible.call(null, P.gv, a.target) && (a.editing.hasDeleteAction = !0);
return P.setCursor("default"), S
}
}, yf.prototype._fireEditEvent = function (x, j) {
var v = this._interactor,
M = this.editing;
if (M) {
var S = M.mode;
S = "rotate" === S ? "Rotation" : "connect" === S ? "Connection" : "resize" === S ? "Rect" : S[0].toUpperCase() + S.slice(1), v.fi({
kind: x + "Edit" + S,
event: j
})
}
}, yf.prototype.startEdit = function (w, n) {
w.startDragging(n);
var L = this;
L._interactor.fi({
kind: "prepareEdit",
event: n
});
var r = L.editing,
v = L.target;
if (r) {
if (L._fireEditEvent("begin", n), "rotate" === r.mode) return r.groupRotateMode && v.beginRotate(r), void 0;
if ("connect" !== r.mode) ("line" === r.mode || v && 0 === v.getRotation()) && (L._inSmartGuide = !0, L._interactor.rectGuide.gatherRects());
else if (r.hasDeleteAction) {
var z = w.gv,
Y = L._interactor.getStyle("connectGuideGarbageShift");
r.garbageInfo = {
x: z.getWidth() * Y[0] + Y[2],
y: z.getHeight() * Y[1] + Y[3],
size: L._interactor.getStyle("connectGuideGarbageIntersectsize")
}, w._42()
}
}
}, yf.prototype._46O = function ($) {
var q, Y, i = this,
M = i.editing,
d = i.target;
if (M) {
if ("connect" === M.mode && !M.canceled && !M.deleted) try {
M.garbageInfo && M.garbageInfo.hover ? u.doDeleteConnectionAction(i._interactor.gv, d) : u.doConnectAction(i._interactor.gv, d, M.target)
} catch (b) {
console.error(b)
}
Y = M.freezeFlag, q = i.editing.groupRotateMode, i._fireEditEvent("end", $), i.editing = null
}
i.tipInfo = null, i._inSmartGuide && (i._interactor.rectGuide.clear(), i._inSmartGuide = !1), q && d && d.endRotate(), d instanceof O.Block && (Y === Z ? delete d._freezeSyncFromChildren : d._freezeSyncFromChildren = Y, d.updateFromChildren())
}, yf.prototype.handleNormalStateDelete = function () {
var V = this,
e = V.editing;
if (e && "connect" === e.mode && !e.canceled && !e.deleted) {
if (e.garbageInfo) {
try {
u.doDeleteConnectionAction(V._interactor.gv, V.target)
} catch ($) {
console.error($)
}
e.garbageInfo = null
}
return e.cursorPos = null, e.targetCorners = null, e.deleted = !0, V._interactor._42(), !0
}
}, yf.prototype.handleNormalStateKeyDown = function (f) {
var j = this,
q = j.editing;
return !q || "connect" !== q.mode || q.canceled || q.deleted ? void 0 : O.Default.isEsc(f) ? (q.cursorPos = null, q.targetCorners = null, q.canceled = !0, j._interactor._42(), !0) : void 0
}, yf.prototype.handleEdit = function (J, i) {
var Y = this,
C = Y.editing;
if (C) {
var b, R, m, _, D, Z = Y.target,
U = C.key,
s = C.mode,
x = J.lp(i),
w = Y._interactor;
if ("connect" === s) {
if (C.canceled) return;
if (C.deleted) return;
C.cursorPos = w._getLogicalPoint(i);
var u = C.garbageInfo;
return u && se.checkHit(C.cursorPos, u, u.size) ? (u.hover = !0, C.target = null, C.targetCorners = null) : (u && (u.hover = !1), C.target = J.getDataAt(x, function (H) {
return J.isSelectable(H) ? Fq(H) ? !0 : !1 : !1
}) || null, C.targetCorners = se.getTargetCornersOnScreen(J, C.target)), w._42(), void 0
}
if ("rotate" === s) {
var p, z, t = C.pos,
e = Math.atan2(x.y - t.y, x.x - t.x);
if (C.groupRotateMode ? z = e - C.hitRot : (p = e - C.hitRot, z = C.rotation + p), z %= 2 * Math.PI, 0 > z && (z += 2 * Math.PI), !O.Default.isCtrlDown(i)) {
var B, q;
Pf(i) ? (B = w.getStyle("shiftRotateRound"), q = B / 2) : (B = w.getStyle("rotateRound"), q = w.getStyle("rotateSensitivity")), z = se.roundTo(z, B, q)
}
C.groupRotateMode ? (p = z - (C.lastRotation || 0), 0 !== p && (Z.addRotation(p, C.groupRotateMode, function (l) {
return J.isRotationEditable(l)
}), C.lastRotation = z)) : Z.setRotation(z), w._setRotateCursor(e), z > Math.PI && (z -= 2 * Math.PI);
var X = 180 * (z / Math.PI);
X = X.toFixed(2), b = "" + X + "°"
} else if ("resize" === s) {
var Q = C.rect;
m = Q.x, _ = Q.y;
var G, g = Q.width,
H = Q.height,
v = C.anchor,
F = C.matrix,
T = Z.s && Z.s("keepAspectRatio") || w.getStyle("keepAspectRatio");
Pf(i) && (T = !T);
var V = Y._unionPointMode1,
r = Y._unionPointMode2;
if (Y._inSmartGuide && !O.Default.isCtrlDown(i) && !T) {
var K;
"L" === U || "R" === U ? K = "x" : ("T" === U || "B" === U) && (K = "y"), Y._adsorbedToClosest(x, K), D = !0
}
G = F.tfi(x);
var d;
"LT" === U ? (Q = V(G, {
x: m + g,
y: _ + H
}, g, H, T), d = 9) : "T" === U ? (Q = r({
x: m,
y: G.y
}, {
x: m + g,
y: _ + H
}, g, H, T, "v"), d = 1) : "RT" === U ? (Q = V(G, {
x: m,
y: _ + H
}, g, H, T), d = 33) : "L" === U ? (Q = r({
x: G.x,
y: _
}, {
x: m + g,
y: _ + H
}, g, H, T, "h"), d = 8) : "R" === U ? (Q = r({
x: m,
y: _
}, {
x: G.x,
y: _ + H
}, g, H, T, "h"), d = 32) : "LB" === U ? (Q = V(G, {
x: m + g,
y: _
}, g, H, T), d = 12) : "B" === U ? (Q = r({
x: m,
y: _
}, {
x: m + g,
y: G.y
}, g, H, T, "v"), d = 4) : "RB" === U && (Q = V(G, {
x: m,
y: _
}, g, H, T), d = 36);
var W = F.tf(Q.x + Q.width * v.x, Q.y + Q.height * v.y);
Z instanceof O.Block && (C.hasOwnProperty("freezeFlag") || (C.freezeFlag = Z._freezeSyncFromChildren, Z._freezeSyncFromChildren = !0)), Z.setPosition(W), Z.setSize(Q.width, Q.height), D && (R = Z.getRect(), w.rectGuide.gatherLines({
node: Z,
x: R.x,
y: R.y,
w: R.width,
h: R.height
}, K, d)), b = "" + Math.round(Q.width) + " * " + Math.round(Q.height)
} else if ("line" === s) {
if (Pf(i)) {
var o = Z.getPoints(),
h = "P1" === U ? o.get(1) : o.get(0),
c = {
x: x.x - h.x,
y: x.y - h.y
},
E = w.getStyle("shiftLineRotateRound"),
I = Y._shiftDirList;
if (!I || Y._shiftRotateRound !== E) {
Y._shiftRotateRound = E, Y._shiftDirList = I = [];
for (var L = 0; L < Math.PI; L += E) I.push({
x: n(L),
y: k(L)
})
}
for (var y, f = 0, l = 0, j = I.length; j > l; l++) {
var $ = I[l],
a = $.x * c.x + $.y * c.y;
Math.abs(a) > Math.abs(f) && (f = a, y = $)
}
x = {
x: h.x + y.x * f,
y: h.y + y.y * f
}, w.rectGuide.clear()
} else Y._inSmartGuide && !O.Default.isCtrlDown(i) && (Y._adsorbedToClosest(x), D = !0);
var A = se.getDataMatrix(Z).applyInverse(x);
Z.setPoint("P1" === U ? 0 : 1, A, !0);
var M = Z.getPoints(),
P = M.get(0),
S = M.get(1);
m = P.x - S.x, _ = P.y - S.y, b = " " + Math.round(Math.sqrt(m * m + _ * _)) + " ", D && (R = Z.getRect(), w.rectGuide.gatherLines({
node: Z,
x: R.x,
y: R.y,
w: R.width,
h: R.height
}))
}
if (b) {
var N = O.Default.getLogicalPoint(i, w._canvas);
N.x += se.Icons.TipShiftX, N.y += se.Icons.TipShiftY, Y.tipInfo = {
helperPos: N,
text: b,
size: b.length
}
}
Y._fireEditEvent("between", i)
}
}, yf.prototype._unionPointMode1 = function (y, u, c, U, M) {
if (M && c && U) {
var Z = y.x - u.x,
S = y.y - u.y;
Math.abs(Z * U) < Math.abs(S * c) ? (S = Math.sign(S) * Math.abs(Z * U / c), y.y = u.y + S) : (Z = Math.sign(Z) * Math.abs(S * c / U), y.x = u.x + Z)
}
return O.Default.unionPoint(y, u)
}, yf.prototype._unionPointMode2 = function (A, p, e, r, N, R) {
var b = O.Default.unionPoint(A, p);
if (N && e && r) {
var l;
"v" === R ? (l = b.x + b.width / 2, b.width = e * b.height / r, b.x = l - b.width / 2) : (l = b.y + b.height / 2, b.height = r * b.width / e, b.y = l - b.height / 2)
}
return b
}, yf.prototype._adsorbedToClosest = function (y, O) {
var H = this,
V = H._interactor,
h = V.rectGuide.findClosest(y, O),
N = V.gridGuide.findClosest(y, O),
f = 1 / 0,
A = 1 / 0;
h && (isFinite(h.x) && (f = h.x), isFinite(h.y) && (A = h.y)), N && (isFinite(N.x) && Math.abs(N.x) < Math.abs(f) && (f = N.x), isFinite(N.y) && Math.abs(N.y) < Math.abs(A) && (A = N.y)), isFinite(f) && (y.x += f), isFinite(A) && (y.y += A)
}, yf.prototype._42 = function (p, L, O) {
var U = this;
U.info = {}, U.screenInfo = null;
var D = U._interactor;
if (!D.editDetail && U.gatherInfo(L, O)) {
var z = U.editing,
F = z ? z.groupRotateMode : null,
v = U.screenInfo;
if ("block" !== F) {
if (v.P1 ? se.Icons.DrawIcon(D, p, se.Icons.Line, v) : se.Icons.DrawIcon(D, p, se.Icons.Rect, v), v.connect && (se.Icons.DrawIcon(D, p, se.Icons.ConnectGuide, {
rotation: v.rotation,
connect: v.connect,
cursorPos: z ? z.cursorPos : null
}), z)) {
if (z.targetCorners) {
for (var Z = {
x: 1 / 0,
y: 1 / 0
}, l = {
x: -1 / 0,
y: -1 / 0
}, B = 0, G = z.targetCorners.length; G > B; B += 2) Z.x = Math.min(Z.x, z.targetCorners[B]), l.x = Math.max(l.x, z.targetCorners[B]), Z.y = Math.min(Z.y, z.targetCorners[B + 1]), l.y = Math.max(l.y, z.targetCorners[B + 1]);
se.Icons.DrawIcon(D, p, se.Icons.HoverDataRect, {
min: Z,
max: l,
color: D.getStyle("hoverGuideColor") || D.getStyle("baseColor")
})
}
z.garbageInfo && se.Icons.DrawIcon(D, p, se.Icons.ConnectGuideGarbage, z.garbageInfo)
}
U.tipInfo && se.Icons.DrawIcon(D, p, se.Icons.TipHelper, U.tipInfo)
}
U.target instanceof se.Group && U.target._42(D, p, L)
}
};
var vb = se.Anchor = function (Y) {
this.catalog = "Anchor", this._interactor = Y
};
vb.prototype = {}, vb.prototype.constructor = vb, vb.prototype.gatherInfo = function (i, q) {
var d = this;
if (1 === q.length) {
var F = q[0];
if (!F.getAnchor) return;
if (F instanceof O.Shape && F._70I()) return;
if (Th(F, i)) return;
return d.gatherSingleTarget(i, q[0])
}
return q.length > 1 ? d.gatherMultiTargets(i, q) : !1
}, vb.prototype.gatherSingleTarget = function (A, E) {
var B = this;
return B.info.POS = E.getPosition(), B.screenInfo.POS = se.toScreenPosition(A, B.info.POS), B.target = E, !0
}, vb.prototype.gatherMultiTargets = function (b, v) {
var L = this,
W = se.Group.findOrCreateGroup(v);
return W ? (L.screenInfo.POS = se.toScreenPosition(b, W.getAnchor2()), L.target = W, !0) : !1
}, vb.prototype.isVisible = function () {
var y = this,
F = y._interactor;
if (F.getStyle("anchorVisible") === !1) return !1;
var i = y.target;
if (i) {
if (this.editing) return !0;
var h = i.getAnchor(),
I = F.getStyle("anchorOutsideVisibleThreshold");
if (h.x < -I || h.x > 1 + I || h.y < -I || h.y > 1 + I) return !0;
var Z = i.getSize(),
u = i.getScale(),
X = Math.min(Math.abs(Z.width * u.x), Math.abs(Z.height * u.y));
if (X * F.gv._zoom < F.getStyle("anchorHideThreshold")) return !1
}
return !0
}, vb.prototype.check = function (H, F, w) {
if (O.Default.isLeftButton(F)) {
var p = this,
n = p._interactor;
if (p.isVisible() && n.getStyle("anchorMovable") !== !1) {
p.editing = null, p.tipInfo = null;
var J = p.target;
if (J && H.isAnchorEditable(J) && H.isEditable(J)) {
var A;
if (p.screenInfo && (A = p.screenInfo.POS) && se.checkHit(w, new se.Math.Vector2(A), n.getStyle("checkSize"))) {
if (J instanceof se.Group) return p.editing = {}, !0;
var I = J.getWidth(),
s = J.getHeight(),
c = J.getAnchor();
return p.editing = {
rect: {
x: -I * c.x,
y: -s * c.y,
width: I,
height: s
},
anchor: c,
matrix: J.getMatrix()
}, !0
}
}
}
}
}, vb.prototype.startEdit = function (H, z) {
H.startDragging(z), H.fi({
kind: "beginEditAnchor",
event: z
})
}, vb.prototype._46O = function (F) {
var X = this;
X.editing && (X.editing = null, X._interactor.fi({
kind: "endEditAnchor",
event: F
})), X.tipInfo = null
}, vb.prototype.handleEdit = function (n, U) {
var k = this,
N = k.target;
if (N) {
var P = k.editing;
if (P) {
var x = n.lp(U),
i = k._interactor;
if (N instanceof se.Group) return N.setAnchor2(x), i._42(), void 0;
var c = P.matrix,
K = c.tfi(x),
S = P.rect,
C = (K.x - S.x) / S.width,
I = (K.y - S.y) / S.height;
if (!O.Default.isCtrlDown(U)) {
var $ = i.getStyle("anchorRound"),
y = i.getStyle("anchorSensitivity");
C = se.roundTo(C, $, y), I = se.roundTo(I, $, y)
}
N.setAnchor(C, I, !0);
var H = O.Default.getLogicalPoint(U, i._canvas);
H.x += se.Icons.TipShiftX, H.y += se.Icons.TipShiftY;
var z = "" + C.toFixed(2) + ", " + I.toFixed(2);
k.tipInfo = {
helperPos: H,
text: z,
size: z.length
}, i.fi({
kind: "betweenEditAnchor",
event: U
})
}
}
}, vb.prototype._42 = function (N, T, C) {
var P = this;
P.info = {}, P.screenInfo = {};
var R = P._interactor;
R.editDetail || P.gatherInfo(T, C) && P.isVisible() && (se.Icons.DrawIcon(R, N, se.Icons.Anchor, P.screenInfo), P.tipInfo && se.Icons.DrawIcon(R, N, se.Icons.TipHelper, P.tipInfo))
};
var Ap = se.MoveDummy = function (S) {
this.catalog = "MoveDummy", this._interactor = S
};
Ap.prototype = {}, Ap.prototype.constructor = Ap, Ap.prototype.gatherInfo = function () {
var t = this,
h = this._interactor.getSubModule("Rect");
if (h) {
var I = h.screenInfo;
if (I) {
var f = t._interactor,
S = t.getMovableTarget(h.target);
if (S) {
var X = f.getStyle("moveDummyThreshold");
if (X !== !1) {
var a = I.LT || I.P1,
K = I.RT || I.P2,
i = I.LB || a;
if (a) {
var _ = I.P1,
A = Math.min(a.distanceTo(i), a.distanceTo(K));
if (!(X !== !0 && A > X)) {
var G = f.getStyle("moveDummyPosition"),
g = K.clone().sub(a),
s = i.clone().sub(a),
V = G[2],
$ = G[3];
if (_) {
var U = f.getStyle("moveDummyLineExtraShift");
U && (V += U[0], $ += U[1])
}
var O = a.clone().add(g.clone().multiplyScalar(G[0])).add(g.setLength(V)).add(s.clone().multiplyScalar(G[1])).add(s.setLength($));
return t.screenInfo.pos = O, t.screenInfo.size = f.getStyle("moveDummySensitivity"), !0
}
}
}
}
}
}
}, Ap.prototype.getMovableTarget = function (I) {
var c = this._interactor.gv;
if (Fq(I)) {
if (c.isMovable(I)) return I
} else if (I instanceof se.Group)
for (var q = I._entities, U = q.length - 1; U >= 0; U--) {
var y = q[U];
if (Fq(y) && c.isMovable(y)) return y
}
return null
}, Ap.prototype.getMoveInteractor = function () {
for (var m, I, N, S = this._interactor.gv, o = S.getInteractors(), m = 0, I = o.length; I > m; m++)
if (N = o.get(m), N instanceof Wr) return N
}, Ap.prototype.startEdit = function (Q, n) {
Q.startDragging(n);
var d = this.getMoveInteractor();
if (d) {
var $ = this.selectedTarget,
b = Q.gv;
b._moving = 1, d._data = $, b.handleMouseDown && b.handleMouseDown(n, $)
}
}, Ap.prototype._46O = function (m) {
var S = this,
T = S.getMoveInteractor();
T && (T.handleWindowMouseUp(m), S.selectedTarget = null)
}, Ap.prototype.handleEdit = function (e, n) {
var i = this.getMoveInteractor();
i && i.handleWindowMouseMove(n)
}, Ap.prototype.check = function (B, P, r) {
if (this.selectedTarget = null, O.Default.isLeftButton(P) && !B._scrolling && !Cf()) {
var S = this;
if (S.screenInfo) {
var $ = S.screenInfo.pos;
if ($ && !(r.distanceTo($) > S.screenInfo.size)) {
var U = S._interactor;
return S.selectedTarget = S.getMovableTarget(U.getSubModule("Rect").target), U.setCursor("default"), !0
}
}
}
}, Ap.prototype._42 = function (f, t, b) {
var L = this;
L.screenInfo = {};
var Q = L._interactor;
Q.editDetail || L.gatherInfo(t, b) && (!Q.editing || L.selectedTarget) && se.Icons.DrawIcon(Q, f, se.Icons.MoveDummy, L.screenInfo)
};
var ff = se.RotateX = function (l) {
this.catalog = "RotateX", this._interactor = l
};
ff.prototype = {}, ff.prototype.constructor = ff, ff.prototype.gatherInfo = function (c, p) {
var j = this;
if (1 === p.length) {
var m = p[0];
return m instanceof O.Shape && m._70I() || Th(m, c) ? !1 : j.gatherSingleTarget(c, m)
}
return p.length > 1 ? j.gatherMultiTargets(c, p) : !1
}, ff.prototype.gatherSingleTarget = function () {
var v = new O.Math.Vector2,
A = new O.Math.Vector2,
g = new O.Math.Vector2,
w = new O.Math.Vector2,
q = function (n, S) {
var L = n.x - S.x,
M = n.y - S.y;
return L * L + M * M
};
return function (K, P) {
if (P.getCorners) {
var y = this,
X = P.getCorners(),
U = 15,
t = P.getPosition();
v.copy(X[0]), g.copy(X[1]), w.copy(X[3]), A.copy(v).add(w).divideScalar(2).add(v.sub(g).setLength(U / K.getZoom()));
var x = Math.max(q(t, X[0]), q(t, X[1]), q(t, X[2]), q(t, X[3]));
return y.info.POS = A.clone(), y.screenInfo.POS = se.toScreenPosition(K, y.info.POS), y.screenInfo.LEN = Math.sqrt(x) * K.getZoom() + U, y.screenInfo.CENTER = se.toScreenPosition(K, t), y.target = P, !0
}
}
}(), ff.prototype.gatherMultiTargets = function (Q, P) {
var y = this,
u = se.Group.findOrCreateGroup(P);
if (!u) return !1;
var y = this;
return y.gatherSingleTarget(Q, u)
}, ff.prototype.isVisible = function () {
var S = this._interactor;
if (!S.getStyle("rotateAsClock")) return !1;
var R = this.target;
if (!R) return !0;
var l = S.gv;
return l.isEditable(R) && l.isRotationEditable(R) ? !0 : !1
}, ff.prototype.check = function (r, q, c) {
var j = this,
E = j._checkImpl(r, q, c);
return (E || j._clockPainted) && j._interactor._42(), E
}, ff.prototype._checkImpl = function (l, x, y) {
if (O.Default.isLeftButton(x)) {
var V = this;
V.editing = null, V.tipInfo = null;
var u;
if (V.screenInfo && (u = V.screenInfo.POS) && V.isVisible()) {
var f = V._interactor;
if (se.checkHit(y, u, f.getStyle("checkSize"))) {
var p = V.target,
e = l.lp(x),
o = p.getPosition(),
T = Math.atan2(e.y - o.y, e.x - o.x);
return f._setRotateCursor(T), V.editing = {
pos: o,
rotation: p.getRotation(),
hitRot: T,
groupRotateMode: "block",
screenInfo: {
CENTER: V.screenInfo.CENTER,
LEN: V.screenInfo.LEN
}
}, !0
}
}
}
}, ff.prototype.startEdit = function (m, V) {
m.startDragging(V), m.fi({
kind: "beginEditRotation",
event: V
}), this.target instanceof se.Group && this.target.beginRotate(this.editing)
}, ff.prototype._46O = function (I) {
var G = this;
G.editing && (G.editing = null, G._interactor.fi({
kind: "endEditRotation",
event: I
})), G.target instanceof se.Group && G.target.endRotate(), G.tipInfo = null
}, ff.prototype.handleEdit = function (z, e) {
var L = this,
b = L.editing;
if (b) {
var p, J, y = L.target,
f = z.lp(e),
r = L._interactor,
E = b.pos,
d = Math.atan2(f.y - E.y, f.x - E.x),
n = y instanceof se.Group;
if (n ? J = d - b.hitRot : (p = d - b.hitRot, J = b.rotation + p), J %= 2 * Math.PI, 0 > J && (J += 2 * Math.PI), !O.Default.isCtrlDown(e)) {
var G, A;
Pf(e) ? (G = r.getStyle("shiftRotateRound"), A = G / 2) : (G = r.getStyle("rotateRound"), A = r.getStyle("rotateSensitivity")), J = se.roundTo(J, G, A)
}
n ? (p = J - (b.lastRotation || 0), 0 !== p && (y.addRotation(p, b.groupRotateMode, function (O) {
return z.isRotationEditable(O)
}), b.lastRotation = J)) : y.setRotation(J), r._setRotateCursor(d), J > Math.PI && (J -= 2 * Math.PI);
var u = 180 * (J / Math.PI),
X = "" + u.toFixed(2) + "°",
i = O.Default.getLogicalPoint(e, r._canvas);
i.x += se.Icons.TipShiftX, i.y += se.Icons.TipShiftY, L.tipInfo = {
helperPos: i,
text: X,
size: X.length
}, r.fi({
kind: "betweenEditRotation",
event: e
})
}
}, ff.prototype._42 = function (A, t, r) {
var S = this;
S._clockPainted = !1, S.info = {}, S.screenInfo = {};
var g = S._interactor;
g.editDetail || S.gatherInfo(t, r) && S.isVisible() && (se.Icons.DrawIcon(g, A, se.Icons.RoundPoint, S.screenInfo.POS), S.tipInfo && se.Icons.DrawIcon(g, A, se.Icons.TipHelper, S.tipInfo), S.editing && S.drawClock(A))
}, ff.prototype.drawClock = function (x) {
x.save();
var S = this;
S._clockPainted = !0;
var R = S.editing || {},
w = R.screenInfo || S.screenInfo,
E = w.LEN,
q = E + 8,
t = E + 18;
x.save(), x.translate(w.CENTER.x, w.CENTER.y), x.beginPath(), x.strokeStyle = "rgb(150, 150, 150)";
for (var e, T, f, y, b, Q = 0; 360 > Q; Q++) e = Q * Math.PI / 180, 0 === Q % 5 && (T = k(e) * E, f = n(e) * E, y = k(e) * q, b = n(e) * q, x.moveTo(T, f), x.lineTo(y, b)), 0 === Q % 45 && (T = k(e) * E, f = n(e) * E, y = k(e) * t, b = n(e) * t, x.moveTo(T, f), x.lineTo(y, b));
x.stroke(), x.rotate(-N);
var p = R.lastRotation || S.target.getRotation();
x.beginPath(), x.fillStyle = "rgba(255, 0, 0, 0.1)", x.strokeStyle = "rgb(157, 157, 157)", x.moveTo(0, 0), x.arc(0, 0, t, 0, p, !1), x.fill(), x.beginPath(), x.moveTo(0 + t, 0), x.arc(0, 0, t, 0, p, !1), x.stroke(), x.restore()
};
var Ao = se.Curve = function (U) {
this.catalog = "Curve", this._interactor = U
};
Ao.prototype = {}, Ao.prototype.constructor = Ao, o.defineProperties(Ao.prototype, {
activing: {
get: function () {
return this._activing
}, set: function (C) {
var b = this;
if (C) b._activing = new se.CurveActiving(this, C), b._activing._firePointChange();
else {
var K = b._activing;
K && K.dispose(), b._activing = null
}
}
}
}), Ao.PointType = {
Mirrored: 0,
Straight: 1,
Disconnected: 2,
Asymmetric: 3
}, Ao.prototype.setUp = function () {
var g = this,
y = g._interactor;
y && y.gv.mp(g._onGraphviewPropertyChanged, g)
}, Ao.prototype._onGraphviewPropertyChanged = function (P) {
("zoom" === P.property || "translateX" === P.property || "translateY" === P.property) && this._handleDataChanged()
}, Ao.prototype.tearDown = function () {
var X = this,
u = X._interactor;
u && u.gv.ump(X._onGraphviewPropertyChanged, X)
}, Ao.prototype.canEnterEditDetailMode = function () {
var z = this,
e = z._interactor,
M = e._getValidSelection();
if (1 === M.length) {
var w = M[0],
L = w instanceof O.Edge;
if (w instanceof O.Shape || L) {
if (L) {
var A = w.s("edge.type");
if (A && "points" !== A) return
}
var S = e.gv;
if (S.isPointEditable(w) && S.isEditable(w)) return z.target = w, !0
}
}
}, Ao.prototype.canQuitEditDetailMode = function (G) {
var Q = this,
y = Q._interactor._getLogicalPoint(G);
return Q._checkEditRealPoint(y) ? void 0 : Q._interactor.gv.getDataAt(G) !== Q.target ? !0 : void 0
}, Ao.prototype.preHandleScroll = function () {
var _ = this.editing;
return _ && _.inEdit ? !0 : void 0
}, Ao.prototype.getCurrentSelectintStatus = function () {
var E = this;
if (E.activing && !E.activing.selections) {
if (E.activing.status != Z) return E.activing.status;
var I = function (V) {
var R = E.activing.status;
E.activing.status = V, E._interactor.fp("shapePointStatus", R, V)
},
K = se.Curve.PointType,
o = E.activing.point,
j = E.activing.pairs;
if (!j || 1 !== j.length) return I(K.Mirrored);
var b = j[0],
z = b.c1 && b.c1.isNearEnough(o),
k = b.c2 && b.c2.isNearEnough(o);
if (!b.c1 || !b.c2) return z || k ? I(K.Straight) : I(K.Disconnected);
if (z && k) return I(K.Straight);
if (z || k) return I(K.Asymmetric);
var D = b.c1.clone().sub(o),
w = b.c2.clone().sub(o);
return Math.abs(D.x * w.y - D.y * w.x) > 1e-5 || D.x * w.x > 0 ? I(K.Disconnected) : Math.abs(D.length() - w.length()) > 1e-5 ? I(K.Asymmetric) : I(K.Mirrored)
}
}, Ao.prototype.handle_keydown = function (x) {
var p = this;
if (p._interactor.editDetail) {
var g = se.Curve.PointType;
"1" === x.key ? p._setCurrentSelectionStatus(g.Straight) : "2" === x.key ? p._setCurrentSelectionStatus(g.Mirrored) : "3" === x.key ? p._setCurrentSelectionStatus(g.Disconnected) : "4" === x.key && p._setCurrentSelectionStatus(g.Asymmetric)
}
}, Ao.prototype.setCurrentSelectionStatus = function (F) {
var h = this,
z = h._interactor;
if (z) {
var Y = z.gv;
Y.dm().beginTransaction(), this._setCurrentSelectionStatus(F), Y.dm().endTransaction()
}
}, Ao.prototype._setCurrentSelectionStatus = function (L) {
var N = this,
I = N.activing;
if (I) {
var v = N.getCurrentSelectintStatus();
if (null !== v && v !== L) {
I.status = L;
var b = N.activing.point,
s = N.activing.pairs;
if (s && 1 === s.length) {
var S = s[0],
X = N.screenInfo.curve,
H = se.Curve.PointType,
Q = N._interactor,
r = function () {
N._writeToHt(), Q.fp("shapePointStatus", v, L), N.check(Q.gv, null, new se.Math.Vector2(Q._lastLogicalPoint))
};
if (L === H.Straight) return X.moveCtrlPoint(S, b, "c1"), X.moveCtrlPoint(S, b, "c2"), r(), void 0;
if (v === H.Straight) {
var $ = X.findPairs(b, !0),
c = $[0],
C = c.r1 || b,
m = c.r2 || b,
i = m.clone().sub(C).multiplyScalar(.25);
return X.moveCtrlPoint(S, b.clone().sub(i), "c1"), X.moveCtrlPoint(S, b.clone().add(i), "c2"), r(), void 0
}
var p = S.c1,
T = S.c2;
if (p && T) {
if (L === H.Mirrored) return X.moveCtrlPoint(S, b.clone().multiplyScalar(2).sub(T), "c1"), r(), void 0;
if (L === H.Asymmetric && v === H.Disconnected) {
var x = p.clone().sub(b).length(),
i = b.clone().sub(T).setLength(x).add(b);
return X.moveCtrlPoint(S, i, "c1"), r(), void 0
}
}
I._firePointChange(), Q.fp("shapePointStatus", v, L), N.check(Q.gv, null, new se.Math.Vector2(Q._lastLogicalPoint))
}
}
}
}, Ao.prototype._handleDataChanged = function () {
var g = "s:edge.points,s:edge.segments,points,segments,shape,position,rotation,scale".split(",");
return function (P) {
var t = this;
if (t.screenInfo && t.target) {
if (P && g.indexOf(P.property) < 0) return;
var O = t._interactor;
t.gatherSingleTarget(O.gv, t.target, !0), t.check(O.gv, null, new se.Math.Vector2(O._lastLogicalPoint)), O._42()
}
}
}(), Ao.prototype.gatherSingleTarget = function (h, c, P) {
var A, N, Q = this;
Q.screenInfo && Q.screenInfo.curve && (N = Q.screenInfo.curve._curves);
var W = Q.editing;
A = W ? Q.screenInfo : Q.screenInfo = {};
var U, y, C = c instanceof O.Edge;
C ? (U = c.s("edge.segments"), y = c.s("edge.points") || new O.List) : (U = c._58O, y = c._59O), A.S = U;
var b, w = A.P = [],
p = se.getDataMatrix(c);
if (c instanceof O.Polyline || c instanceof O.Edge && Q._interactor.getStyle("edgeElevationEditable")) b = c.getElevation && c.getElevation() || 0, A.E = [];
else {
var G = !1;
y.each(function (i) {
i.e !== Z && (G = !0)
}), G && (A.E = [])
} if (y.each(function (n) {
A.E && A.E.push(n.e != Z ? n.e : b), n = p.apply(n);
var o = se.toScreenPosition(h, n);
w.push(o.x, o.y)
}), C) {
var K = w.length,
x = se.toScreenPosition(h, c._lastSourcePoint || (K ? {
x: w[0],
y: w[1]
} : {
x: 0,
y: 0
})),
B = se.toScreenPosition(h, c._lastTargetPoint || (K ? {
x: w[K - 2],
y: w[K - 1]
} : {
x: 0,
y: 0
}));
w.splice(0, 0, x.x, x.y), w.push(B.x, B.y), A.E && (A.E.splice(0, 0, "head"), A.E.push("tail"))
}
if (!A.S || !A.S.size()) {
A.S = new O.List, A.S.add(1);
for (var j = 0; j < w.length / 2 - 1; j++) A.S.add(2)
}
if ((!W || P) && Q.convertToCubicBezier(N), Q.activing && (P || !Q.editing || "realPoint" === Q.editing.type)) {
var d = A.curve.findPairs(Q.activing.point);
Q.activing.pairs = d
}
}, Ao.prototype._convertToNewPoint = function (Y, a, J, L) {
var G, I, H;
for (G = 0, I = a.length; I > G; G++) {
if (H = a[G], H._p1.isNearEnough(Y) && (!L || L.indexOf(H._p1) < 0)) return H._p1;
if (H._p4.isNearEnough(Y) && (!L || L.indexOf(H._p4) < 0)) return H._p4
}
if (J)
for (G = 0, I = Math.min(J.length, I); I > G; G++) {
if (H = J[G], H._p1 === Y && (!L || L.indexOf(a[G]._p1) < 0)) return a[G]._p1;
if (H._p4 === Y && (!L || L.indexOf(a[G]._p4) < 0)) return a[G]._p4
}
}, Ao.prototype.convertToCubicBezier = function (S) {
var X, M, N = this,
Z = new se.Math.Curve,
$ = N.screenInfo;
if (Z.createFromHtShape($.P, $.S, $.E), $.curve = Z, N.activing) {
var A = Z._curves;
X = N.activing.point, M = N._convertToNewPoint(X, A, S);
var I = [];
if (M && (N.activing.point = M, I.push(M)), N.activing.selections) {
var o = -1,
F = N.activing.selections;
F.forEach(function (f) {
o++, M = N._convertToNewPoint(f, A, S, I), M && (F[o] = M, I.push(M))
})
}
}
}, Ao.prototype.check = function (C, o, p) {
if (!o || jj(o) || Fm(o)) {
var q = this;
if (q._interactor.setCursor("default"), q.editing = null, q.highlight = null, q.tipInfo = null, q.edgeEditResult = null, q.screenInfo) {
if (Cf() || o && Fm(o)) return q._interactor._42(), !0;
if (q._checkEditCtrlPoint(p)) return q._interactor._42(), !0;
if (q._checkEditRealPoint(p)) return q._interactor._42(), !0;
if (q._checkEditElevation(p)) return q._interactor._42(), !0;
var Z = q.screenInfo.curve,
h = Z.checkPoint(p, q._interactor.getStyle("curveIntersectSize"));
if (h) {
var y = q.highlight = {};
y.type = "insertKnot", y.bezier = h.bezier, y.point = h.intersection
}
return q._interactor._42(), !0
}
}
}, Ao.prototype.getAdjacentBeziers = function (z) {
var G = this.screenInfo;
if (G) {
var D, T, W, N = G.curve._curves,
d = [],
C = Z;
for (D = 0, T = N.length; T > D; D++)
if (W = N[D], C === Z) {
if (W._p4.isNearEnough(z)) {
d.push(W), C = D;
continue
}
} else {
if (W._p1.isNearEnough(z)) return d.push(W), d;
if (W._p4.isNearEnough(z)) {
d[0] = W, C = D;
continue
}
}
}
}, Ao.prototype.roundCorner = function (i) {
if (this.activing && this.screenInfo) {
var o = this.screenInfo.curve,
X = o._curves,
G = this.getAdjacentBeziers(this.activing.point),
j = G[1],
m = j._index;
j = j.insertKnot(j.getTByPercentage(i / j.length))[1], X[m] = j;
var U = j.p1,
H = G[0],
d = H._index;
H = H.insertKnot(H.getTByPercentage(1 - i / H.length))[0], X[d] = H;
var Q = H.p4,
h = this.activing.point,
v = new se.Math.CubicBezier(Q, h.clone().sub(Q).multiplyScalar(2 / 3).add(Q), h.clone().sub(U).multiplyScalar(2 / 3).add(U), U);
X.splice(m, 0, v), this._writeToHt(), this.activing = null, this._interactor._42()
}
}, Ao.prototype._checkEditRealPoint = function (f) {
var F, W, J, G, $, j, D = this,
h = D.screenInfo.curve._curves,
N = D._interactor.getStyle("curvePointIntersectSize"),
U = 1 / 0;
for (N *= N, J = 0, G = h.length; G > J; J++) F = h[J], $ = F._p1, j = f.distanceToSquared($), U > j && (U = j, W = $), $ = F._p4, j = f.distanceToSquared($), U > j && (U = j, W = $);
if (U > N) return !1;
var y = D.highlight = {};
return y.type = "changeRealPoint", y.point = W, D.editing = {
type: "realPoint",
point: W,
shiftGuide: {
point: W.clone(),
dir: "x",
limit: 0
}
}, D._interactor.setCursor("crosshair"), !0
}, Ao.prototype._checkEditElevation = function (Z) {
var R = this;
if (!R._interactor.getStyle("curveElevationVisible")) return !1;
var w = R.target;
if (w instanceof O.Edge && !R._interactor.getStyle("edgeElevationEditable")) return !1;
var N = R.activing;
if (!N) return !1;
var y = N.getCurrentEditingPoint();
if (!y) return !1;
var K = R._interactor,
S = K.getStyle("curveElevationGuideShift"),
q = K.getStyle("curveElevationIntersectSize"),
b = Z.distanceToSquared({
x: y.x + S[0],
y: y.y + S[1]
});
if (!(b > q * q)) {
var P = R.highlight = {};
P.type = "elevation";
var G = new se.Math.Vector2(Z.x, Z.y, y.e);
return R.editing = {
type: "elevation",
startPoint: G
}, R._interactor.setCursor("crosshair"), !0
}
}, Ao.prototype._checkEditCtrlPoint = function (l) {
var y = this;
if (y.activing && !y.activing.selections) {
var T = y.getCurrentSelectintStatus();
if (T !== se.Curve.PointType.Straight) {
var M = y.activing.pairs;
if (M) {
var w = y._interactor.getStyle("curvePointIntersectSize");
w *= w;
var B, n, m, k, O, U, t, v, p, $ = 1 / 0;
for (t = 0, p = M.length; p > t; t++)
for (k = M[t], v = 0; 2 > v; v++) O = 0 === v ? "c1" : "c2", k[O] && (U = l.distanceToSquared(k[O]), $ > U && ($ = U, B = k, n = t, m = O));
if ($ > w) return !1;
y.activing.hlpair = B, y.activing.hltype = m;
var P = y.highlight = {};
return P.type = "changeCtrlPoint", P.point = B[m], y.editing = {
type: "ctrlPoint",
pair: B,
pairId: n,
ctrlType: m,
direction: B[m].clone().sub(y.activing.point).normalize()
}, y._interactor.setCursor("crosshair"), !0
}
}
}
}, Ao.prototype.startEdit = function (G, V) {
G.startDragging(V);
var U = this;
U.highlight && "insertKnot" === U.highlight.type && (U.insertKnot(), U.gatherSingleTarget(U._interactor.gv, U.target), U.activing = null, U._checkEditRealPoint(U._interactor._getLogicalPoint(V)));
var Y = U._activing;
if (Y) {
var I = U.editing ? U.editing.type : null;
"ctrlPoint" === I ? Y.editingCtrl = {
pairId: U.editing.pairId,
type: Y.hltype
} : "realPoint" === I && (Y.editingCtrl = !1)
}
var m = U.highlight,
l = O.Default.isCtrlDown(V);
if (!m || Cf() || Fm(V)) {
var d = U._interactor.gv;
if (!d.setFocus(V) || d._scrolling) return;
return l ? U._multiSelect = {
startPoint: d.lp(V)
} : d.isPannable() && (jj(V) || Fm(V)) && (U._pan = {
tx: d.tx(),
ty: d.ty()
}, G.fi({
kind: "beginPan",
event: V
})), void 0
}
if ("changeRealPoint" === m.type) {
var u, X = U.activing ? U.activing.point : null,
S = U.activing ? U.activing.selections : null;
if (l && U.activing) X === m.point ? (S ? (U.activing = {
point: S[0]
}, S.length > 1 && (S.splice(0, 1), U.activing.selections = S)) : U.activing = null, U.editing = null) : S && (u = S.indexOf(m.point)) >= 0 ? (S.length > 1 ? S.splice(u, 1) : delete U.activing.selections, U.editing = null) : S ? (S.push(X), U.activing = {
point: m.point,
selections: S
}) : U.activing = {
point: m.point,
selections: [X]
};
else if (S) X === m.point || ((u = S.indexOf(m.point)) >= 0 ? (S.splice(u, 1, X), U.activing = {
point: m.point,
selections: S
}) : U.activing = {
point: m.point
});
else {
var e;
X === m.point && (e = U.activing.status), U.activing = {
point: m.point
}, e && (U.activing.status = e)
}
G.fi({
kind: "beginEditPoint",
event: V
})
}
}, Ao.prototype.insertKnot = function () {
var e = this,
L = e.highlight,
x = e.screenInfo.curve;
x.insertKnot(L.bezier, L.point.t), e._writeToHt()
}, Ao.prototype._writeToHt = function () {
var D, w, m = this,
x = m.screenInfo.curve,
c = x.toHtShape(),
r = c.points,
f = [],
a = c.segments,
E = m._interactor.gv;
E.dm().beginTransaction();
var T, H, q = m.target,
R = q instanceof O.Edge,
y = se.getDataMatrix(q).invert();
H = q instanceof O.Polyline || q instanceof O.Edge && m._interactor.getStyle("edgeElevationEditable"), H && (T = q.getElevation && q.getElevation() || 0);
for (var s = 0, Q = r.length; Q > s; s++) D = r[s], w = se.toWorldPosition(E, D), w = y.apply(w), isFinite(D.e) && D.e !== T && (w.e = D.e), f.push(w);
if (q._writing = !0, R) {
q.s("edge.type", "points"), q.setStyle("edge.segments", a), q.setStyle("edge.points", f.slice(1, f.length - 1)), q.setStyle("edge.source.offset.x", 0), q.setStyle("edge.source.offset.y", 0), q.setStyle("edge.target.offset.x", 0), q.setStyle("edge.target.offset.y", 0);
var U = m._nextChangeEdgeHost;
delete m._nextChangeEdgeHost, U && ("source" === U.type ? q.setSource(U.host) : q.setTarget(U.host)), m._writeEdgeHostAnchor("source", f[0]), m._writeEdgeHostAnchor("target", f[f.length - 1])
} else f.length ? (q.setSegments(a), q.setPoints(f, !0)) : q.removeFromDataModel();
E.dm().endTransaction(), delete q._writing
}, Ao.prototype._writeEdgeHostAnchor = function (s, C) {
var J = this,
R = J.target,
E = J._calcHostAnchor(R, s, C);
E.index !== Z ? (R.setStyle("edge." + s + ".index", E.index), R.setStyle("edge." + s + ".percent", Z), R.setStyle("edge." + s + ".anchor.x", Z), R.setStyle("edge." + s + ".anchor.y", Z)) : E.percent !== Z ? (R.setStyle("edge." + s + ".percent", E.percent), R.setStyle("edge." + s + ".index", Z), R.setStyle("edge." + s + ".anchor.x", Z), R.setStyle("edge." + s + ".anchor.y", Z)) : (R.s("edge." + s + ".anchor.x", E.x), R.s("edge." + s + ".anchor.y", E.y), E.offsetX || E.offsetY ? (R.s("edge." + s + ".offset.x", E.offsetX), R.s("edge." + s + ".offset.y", E.offsetY)) : (R.s("edge." + s + ".offset.x", 0), R.s("edge." + s + ".offset.y", 0)))
}, Ao.prototype._calcHostAnchor = function (R, o, s, h) {
h || (h = "source" === o ? R.getSource() : R.getTarget());
var Q = this._interactor.gv,
U = Q.calculateAttachPoint(h, s);
if (U) return U.info;
if (Bk(h)) {
var b = Q.calculateEdgePosition(h, s);
return b
}
var J = h.getRotation(),
u = h.getAnchor();
Th(h, Q) && (J = 0);
var _ = h.getScale();
if (J || _.x < 0 || _.y < 0) {
var W = h.getMatrix(),
T = W.tfi(s),
l = h.getSize();
return {
x: T.x / l.width + u.x,
y: T.y / l.height + u.y
}
}
var f = Rp(Q, h),
m = {
x: (s.x - f.x) / f.width,
y: (s.y - f.y) / f.height
};
return m
}, Ao.prototype._handlePanning = function (Q) {
var Z = this,
s = Z._pan;
if (s) {
s.started = !0;
var U = Z._interactor,
H = U.gv,
b = U._lastClientPoint,
h = lb(Q),
J = wq(H, h, b);
H.setTranslate(s.tx + J.x, s.ty + J.y), Z.gatherSingleTarget(U.gv, Z.target), U._42(), U.fi({
kind: "betweenPan",
event: Q
})
}
}, Ao.prototype.handleEdit = function (c, t) {
var z = this,
m = z.editing;
if (z._pan) return z._handlePanning(t), void 0;
if (z._multiSelect) return z._multiSelect.endPoint = c.lp(t), z._interactor.redraw(), void 0;
if (m) {
m.inEdit = !0;
var K, y, b, N = z._interactor._getLogicalPoint(t),
H = O.Default.isCtrlDown(t),
j = O.Default.isShiftDown(t),
Q = m.type,
k = z.activing;
if (z._guideInfo = null, "ctrlPoint" === Q && j) {
var A = z.editing.direction.clone();
K = k.point;
var R = A.dot(N.clone().sub(K));
N = A.setLength(R).add(K)
} else if ("ctrlPoint" === Q || "realPoint" === Q) {
var A;
if ("realPoint" === Q && j) {
var V = z.editing.shiftGuide;
y = V.point;
var F = Math.abs(N.x - y.x),
o = Math.abs(N.y - y.y);
F > o && F > V.limit && "y" === V.dir && (V.dir = "x"), o > F && o > V.limit && "x" === V.dir && (V.dir = "y"), A = V.dir, "x" === A ? (N.y = y.y, V.limit = Math.max(V.limit, F)) : "y" === A && (N.x = y.x, V.limit = Math.max(V.limit, o))
}
var Y = z._isEditEdgeSourceTarget();
if (Y) {
var _ = z._editEdgeSourceTarget(Y, N, H);
_ && (z.edgeEditResult = _, b = _.tipText)
} else if (!H) {
var w = z._guidingToEdit(N, A),
G = "realPoint" === Q ? z._interactor.gridGuide.findClosest(N, A, !0) : null,
g = 1 / 0,
$ = 1 / 0;
G && (G.x && (g = G.x), G.y && ($ = G.y));
var P = !1;
w && (w.xList && (Math.abs(w.x) <= Math.abs(g) ? (P = !0, g = w.x) : delete w.xList), w.yList && (Math.abs(w.y) <= Math.abs($) ? (P = !0, $ = w.y) : delete w.yList), P && (z._guideInfo = w)), isFinite(g) && (N.x += g), isFinite($) && (N.y += $), P && (w.v = N)
}
}
var i = z.screenInfo.curve;
if ("realPoint" === m.type) {
K = m.point, K.e !== Z && (N.e = K.e), i.moveRealPoint(K, N), m.point = N, z.highlight.point = N;
var D = k.status,
x = k.selections;
if (z.activing = {
point: N,
status: D
}, x) {
var q = N.clone().sub(K),
T = 0;
x.forEach(function (p) {
var o = p.clone().add(q);
i.moveRealPoint(p, o), x[T++] = o
}), z.activing.selections = x
}
} else if ("ctrlPoint" === m.type) {
var d = k.pairs,
J = d[m.pairId];
i.moveCtrlPoint(J, N, m.ctrlType);
var e = k.status,
l = se.Curve.PointType;
if ((e === l.Mirrored || e === l.Asymmetric) && J.c1 && J.c2) {
var K = new se.Math.Vector2(k.point),
L = "c1" === m.ctrlType ? "c2" : "c1";
if (e === se.Curve.PointType.Mirrored) i.moveCtrlPoint(J, K.clone().multiplyScalar(2).sub(N), L);
else if (e === l.Asymmetric) {
var R = J[L].clone().sub(K).length(),
v = K.clone().sub(J[m.ctrlType]).setLength(R).add(K);
isNaN(v.x) || i.moveCtrlPoint(J, v, L)
}
}
k._firePointChange()
} else if ("elevation" === m.type) {
y = m.startPoint;
var U = y.e + (y.y - N.y) / c._zoom;
z._setCurrentPointImpl("e", U), k._firePointChange(), b = "E: " + se.toFixed(U)
}
var f = O.Default.getLogicalPoint(t, z._interactor._canvas);
if (f.x += se.Icons.TipShiftX, f.y += se.Icons.TipShiftY, !b) {
var E = se.toWorldPosition(c, N);
b = "" + se.toFixed(E.x) + ", " + se.toFixed(E.y)
}
z.tipInfo = {
helperPos: f,
text: b,
size: b.length
}, z._writeToHt(), z._interactor.fi({
kind: "betweenEditPoint",
event: t
})
}
}, Ao.prototype._setCurrentPointImpl = function (i, j) {
var E = this,
p = E._activing;
if (!p) return !1;
var t = E.target;
if (!t) return !1;
var U = p.getCurrentEditingPoint();
if (!U) return !1;
var f = p.editingCtrl;
if (!f) var x = U.clone();
if ("e" === i) U.e = j;
else {
var N;
if ("x" === i || "y" === i) {
var X = p._lastFirePoint;
N = "x" === i ? {
x: j,
y: X ? X.y : 0
} : {
x: X ? X.x : 0,
y: j
}
} else "object" == typeof i ? (N = i, i.e !== Z && (U.e = i.e)) : (N = {
x: arguments[0],
y: arguments[1]
}, arguments[2] !== Z && (U.e = arguments[2]));
var T = se.getDataMatrix(t);
N = se.toScreenPosition(E._interactor.gv, T.apply(N)), U.x = N.x, U.y = N.y
} if (!f) {
var K = x.multiplyScalar(-1).add(U);
U.e && x.e && (K.e = U.e - x.e);
var C = E.screenInfo.curve;
C.moveCtrlDueToRealPointMovement(U, K);
var J = p.selections;
if (J) {
var u = 0;
J.forEach(function (D) {
var B = D.clone().add(K);
isFinite(K.e) && (B.e = (isFinite(D.e) ? D.e : t.getElevation() || 0) + K.e), C.moveRealPoint(D, B), J[u++] = B
}), p.selections = J
}
}
return !0
}, Ao.prototype.setCurrentPoint = function (Q, c) {
return this._setCurrentPointImpl(Q, c) ? (this._writeToHt(), !0) : !1
}, Ao.prototype._isEditEdgeSourceTarget = function () {
var B = this,
W = B.target;
if (!(W instanceof O.Edge)) return !1;
var r = B.editing.point,
m = B.screenInfo.curve._curves;
return r === m[0]._p1 ? "source" : r === m[m.length - 1]._p4 ? "target" : !1
}, Ao.prototype._editEdgeSourceTarget = function (O, K, T) {
var p, t = this,
v = t.target;
if (p = "source" === O ? v.getSource() : v.getTarget()) {
var C, R = t._interactor.gv,
P = se.toWorldPosition(R, K),
n = t._calcHostAnchor(v, O, P, p);
if (C = n.index !== Z || n.percent !== Z ? n.distance * R.getZoom() > t._interactor.getStyle("edgeHostEdgeMaxDistance") : t._interactor.getStyle("edgeHostDetectPerFrame") ? !0 : n.x < 0 || n.x > 1 || n.y < 0 || n.y > 1 ? !0 : !1) {
var d = R.getDataAt(P, function (o) {
return R.isSelectable(o) ? R.isSourceTargetEditable(v, o, O) ? v.canSetSourceTarget(o, O) ? !0 : !1 : !1 : !1
});
if (d) {
var Q = t._calcHostAnchor(v, O, P, d);
p = d, t._nextChangeEdgeHost = {
type: O,
host: d
}, n = Q
}
}
var W, h, B;
if (T || n.x === Z) (n.percent !== Z || n.index !== Z) && (h = n.point);
else {
var b = t._interactor.getStyle("anchorRound"),
E = t._interactor.getStyle("anchorSensitivity");
W = R.calculateAttachPoint(p, P), W ? n = W.info : (n.x = se.roundTo(n.x, b, E), n.y = se.roundTo(n.y, b, E)), h = Yg(R, p, 0, n.offsetX || 0, n.offsetY || 0, n.x, n.y)
}
h && (B = se.toScreenPosition(R, h), K.x = B.x, K.y = B.y), t._edgeHostGuideInfo = {
corners: se.getTargetCornersOnScreen(R, p),
attach: W ? W.index : -1,
host: p
};
var M;
return n.percent !== Z ? M = "percent: " + n.percent.toFixed(2) : n.index !== Z ? M = "index: " + n.index : (M = "" + n.x.toFixed(2) + ", " + n.y.toFixed(2), (n.offsetX || n.offsetY) && (M += " offset: " + n.offsetX.toFixed(2) + ", " + n.offsetY.toFixed(2))), {
host: p,
anchor: n,
tipText: M
}
}
}, Ao.prototype._guidingToEdit = function (h, T) {
var L, u, X = this;
if (L = X.screenInfo.curve) {
u = L._curves;
var j, Y, m, e, t, C, f, q, R = 1 / 0,
l = 1 / 0,
H = [];
for (X.editing && "realPoint" === X.editing.type && (q = X.editing.point), t = 0, C = 2 * u.length; C > t; t++) f = u[Math.floor(t / 2)][t % 2 ? "_p4" : "_p1"], H.indexOf(f) >= 0 || (H.push(f), q && q === f || (m = f.x - h.x, e = f.y - h.y, Math.abs(m) < Math.abs(R) ? (R = m, j = [f]) : m === R && j.push(f), Math.abs(e) < Math.abs(l) ? (l = e, Y = [f]) : e === l && Y.push(f)));
var G = X._interactor.getStyle("smartGuideThreshold");
if ((Math.abs(R) > G || "y" === T) && (j = null), (Math.abs(l) > G || "x" === T) && (Y = null), j || Y) {
var c = !1,
E = {};
if (j && (c = !0, E.xList = j, E.x = R), Y && (c = !0, E.yList = Y, E.y = l), c) return E
}
}
}, Ao.prototype._46O = function (v) {
var c = this;
c.editing && (c.editing = null, c._interactor.fi({
kind: "endEditPoint",
event: v
})), c._guideInfo = null, c._edgeHostGuideInfo = null, c._pan && (c._pan = null, c._interactor.fi({
kind: "endPan",
event: v
})), c._multiSelect && (c._handleMultiSelect(c._multiSelect), c._multiSelect = null), c.tipInfo = null, c.edgeEditResult = null
}, Ao.prototype._handleMultiSelect = function (N) {
if (N.startPoint && N.endPoint) {
var S, v, T, p, n, m = this,
Q = m._interactor,
B = Q.gv,
_ = se.toScreenPosition(B, N.startPoint),
g = se.toScreenPosition(B, N.endPoint),
R = O.Default.unionPoint(_, g),
G = m.screenInfo.curve._curves,
P = [],
s = function (k) {
k.x >= R.x && k.y >= R.y && k.x <= R.x + R.width && k.y <= R.y + R.height && P.indexOf(k) < 0 && P.push(k)
};
for (S = 0, v = G.length; v > S; S++) n = G[S], s(n._p1), s(n._p4);
if (P.length) {
var J = m.activing || {},
d = J.selections || [];
for (J.point && d.push(J.point), S = 0, v = d.length; v > S; S++) T = d[S], p = P.indexOf(T), p >= 0 ? P[p] = Z : P.push(T);
var c = P;
for (P = [], S = 0, v = c.length; v > S; S++) c[S] && P.push(c[S]);
v = P.length, 0 === v ? m.activing = null : 1 === v ? m.activing = {
point: P[0]
} : (T = P[v - 1], m.activing = {
point: T,
selections: P.splice(0, v - 1)
}), Q.redraw()
}
}
}, Ao.prototype._canDeletePoint = function (c, g) {
var Z = this.target;
if (!(Z instanceof O.Edge)) return !0;
var L = c._curves[0],
o = c._curves[c._curves.length - 1];
return L._p1 === g || o._p4 === g ? !1 : !0
}, Ao.prototype.handleDelete = function () {
var F = this;
if (F.activing && F.screenInfo) {
var c = O.Default.isShiftDown(),
o = F.screenInfo.curve;
F._canDeletePoint(o, F.activing.point) && o.deleteRealPoint(F.activing.point, c), F.activing.selections && F.activing.selections.forEach(function (u) {
F._canDeletePoint(o, u) && o.deleteRealPoint(u, c)
}), F.activing = null, delete F.editing, delete F.tipInfo, delete F.edgeEditResult, delete F._pan, delete F._multiSelect, F._writeToHt(), F._interactor.fp("deleteShapePoint", !1, !0)
}
}, Ao.prototype.handleDoubleClick = function (T) {
var O = this,
P = O._interactor._getLogicalPoint(T);
if (O.screenInfo && O._checkEditRealPoint(P)) {
var k = O.getCurrentSelectintStatus(),
Z = se.Curve.PointType;
return k = k === Z.Mirrored ? Z.Straight : Z.Mirrored, O._setCurrentSelectionStatus(k), O._interactor._42(), !0
}
}, Ao.prototype._drawHighlight = function (d) {
var s = this,
x = s.highlight;
if (x) {
var o = x.bezier,
L = s._interactor;
o && se.Icons.DrawIcon(L, d, se.Icons.ShapeHighlightCurve, [o._p1.x, o._p1.y, o._p2.x, o._p2.y, o._p3.x, o._p3.y, o._p4.x, o._p4.y]);
var b = x.point;
b && "insertKnot" === x.type && se.Icons.DrawIcon(L, d, se.Icons.ShapeHighlighPoint, b)
}
}, Ao.prototype._drawGuide = function (V) {
var K = this,
H = K._guideInfo;
if (H) {
var l, y, G, i, c = H.v;
for (l = 0; 2 > l; l++)
if (i = 0 === l ? H.xList : H.yList)
for (y = 0, G = i.length; G > y; y++) se.Icons.DrawIcon(K._interactor, V, se.Icons.ShapeGuideLine, [c.x, c.y, i[y].x, i[y].y])
}
}, Ao.prototype._drawCurrentPoint = function (M) {
var q = this;
if (q.activing) {
var C = q.activing,
s = q.getCurrentSelectintStatus(),
K = q._interactor;
if (s !== se.Curve.PointType.Straight) {
var Z = C.pairs;
C.hlpair, C.hltype;
var p = C.selections,
F = C.editingCtrl;
if (Z && !p) {
var E, u, S;
for (u = 0, S = Z.length; S > u; u++) E = Z[u], F && u === F.pairId && E[F.type] ? se.Icons.DrawIcon(K, M, se.Icons.ShapeActivingCtrl, {
point: E.point,
c1: E.c1,
c2: E.c2,
hl: F.type
}) : se.Icons.DrawIcon(K, M, se.Icons.ShapeActivingCtrl, E)
}
}
se.Icons.DrawIcon(K, M, se.Icons.ShapeHighlighRealPoint, q.activing.point), p && p.forEach(function (S) {
se.Icons.DrawIcon(K, M, se.Icons.ShapeHighlighRealPoint, S)
})
}
}, Ao.prototype.clear = function () {
var d = this;
d.editing = null, d._guideInfo = null, d.activing = null, d.highlight = null
}, Ao.prototype._42 = function (C) {
var j = this;
j.info = {}, j.editing || (j.screenInfo = null);
var R = j._interactor;
if (!R.editDetail) return j.clear(), void 0;
var t = R.gv;
if (!j.target || !t.isSelected(j.target) || !t.isVisible(j.target)) return R.editDetail = !1, j.clear(), void 0;
if (j.gatherSingleTarget(t, j.target), se.Icons.DrawIcon(R, C, se.Icons.ShapeBgCurve, j.screenInfo), j._interactor.getStyle("curveElevationVisible") && (j.target instanceof O.Polyline || j.target instanceof O.Edge && j._interactor.getStyle("edgeElevationEditable")) && j.activing) {
var M = j.activing.getCurrentEditingPoint();
M && "string" != typeof M.e && se.Icons.DrawIcon(R, C, se.Icons.EdgeElevationGuide, M)
}
if (j._drawHighlight(C), j._drawCurrentPoint(C), j._getRealPoint().forEach(function (Q) {
se.Icons.DrawIcon(R, C, se.Icons.ShapePoint, Q)
}), j._drawGuide(C), j.tipInfo && j._interactor.getStyle("curveTipVisible") && se.Icons.DrawIcon(R, C, se.Icons.TipHelper, j.tipInfo), j._edgeHostGuideInfo && R._drawHostGuide(j._edgeHostGuideInfo), j.edgeEditResult && j._drawEdgeHostHighlight(C, j.edgeEditResult.host, j.edgeEditResult.anchor), j._multiSelect && j._multiSelect.endPoint) {
var s = O.Default.unionPoint(se.toScreenPosition(t, j._multiSelect.startPoint), se.toScreenPosition(t, j._multiSelect.endPoint));
s.color = t.getRectSelectBorderColor(), C.save(), C.setTransform(1, 0, 0, 1, 0, 0);
var L = x.devicePixelRatio,
p = s.borderWidth = Math.round(L);
p /= 2, s.x = Math.round(s.x * L) + p, s.y = Math.round(s.y * L) + p, s.width = Math.round(s.width * L), s.height = Math.round(s.height * L), se.Icons.DrawIcon(R, C, se.Icons.SimpleRect, s), C.restore()
}
}, Ao.prototype._drawEdgeHostHighlight = function (D, j, $) {
this.drawEdgeHostHighlight(D, j, $), this._interactor.redraw()
}, Ao.prototype.drawEdgeHostHighlight = function (m, V, K) {
if (Bk(V)) {
var u, O, $, R, A = this,
k = A._interactor,
b = k.gv,
D = b.getDataUI(V),
C = gl(D),
E = [];
for ($ = 0, R = C.points.length; R > $; $++) O = se.toScreenPosition(b, C.points.get($)), E.push(O.x, O.y);
C.segments && (u = C.segments.toArray());
var l = k.getStyle("edgeHostHighlighPeriod"),
N = k.getStyle("edgeHostEdgeHighlighColor");
se.Icons.DrawIcon(k, m, se.Icons.ShapeBgCurve, {
P: E,
S: u,
color: N,
dynamicVisible: K.index === Z,
dynamicPeriod: l
}), N = k.getStyle("edgeHostPointHighlighColor");
var e = Kk(D);
for ($ = 0, R = e.length; R > $; $++) {
var c = e[$],
y = se.toScreenPosition(b, c);
se.Icons.DrawIcon(k, m, se.Icons.ShapePoint, {
point: {
x: y.x,
y: y.y
},
color: N,
size: 12,
dynamicVisible: $ === K.index,
dynamicPeriod: l
})
}
}
}, Ao.prototype._getRealPoint = function () {
var p, n = this.screenInfo,
z = n.P,
_ = n.S,
T = -1,
L = [],
Z = -1,
D = _.length;
return _.each(function (C) {
Z++;
var G = 1;
if (3 === C) G = 2;
else if (4 === C) G = 3;
else if (5 === C) return;
T += G, p = Z + 1 >= D ? !0 : 1 === _.get(Z + 1) ? !0 : !1, L.push({
point: {
x: z[2 * T],
y: z[2 * T + 1]
},
segmentIndex: Z,
pointIndex: T,
isEnd: p
})
}), L
}, Ao.prototype.getEditingPointsInfo = function (V) {
var e = this,
b = e.activing;
if (!b) return !1;
var v = b.point;
if (!v) return !1;
var j = this._getRealPoint(),
z = [{
screen: v
}];
b.selections && b.selections.forEach(function (s) {
z.push({
screen: s
})
});
var c, s, y = j.length;
return z.forEach(function (R) {
for (c = 0; y > c; c++)
if (s = j[c], R.screen.isNearEnough(s.point)) {
R.segmentIndex = s.segmentIndex, R.pointIndex = s.pointIndex, R.point = e.target.getPoints().get(s.pointIndex);
break
}
}), V && z.sort(function (O, o) {
return O.segmentIndex - o.segmentIndex
}), z
};
var If = se.MoveHelper = function (W) {
var x = this;
x.catalog = "Move", x._interactor = W
};
If.prototype = {}, If.prototype.constructor = If, If.prototype.calcShift = function (e, n, m) {
var T, E, w = this,
r = w._interactor.gv,
c = r.lp(n);
if ("beginMove" === e && w._gatherGridInfo(m._lastLogicalPoint || c), T = w._target) {
var N = T.downPosition;
if (N) {
var K = w._interactor.getStyle("moveSensitivity") / r._zoom;
if (N.distanceTo(c) < K) return {
x: 0,
y: 0
};
delete T.downPosition
}
var S;
E = O.Default.isShiftDown(n), E && (c = w._dealShiftDown(c), S = T.shiftGuide.dir);
var o, Z = T.rawPos = {
x: T.pos.x + c.x - T.lp.x,
y: T.pos.y + c.y - T.lp.y
};
if (O.Default.isCtrlDown(n)) {
if (o = w._calcShiftByAddon(), w._target.node instanceof se.Group) {
var k = w._target.node;
k._position.x += o.x, k._position.y += o.y
}
return o
}
var d = w._interactor.rectGuide;
if (T.node instanceof O.Data && T.node.s("2d.attachable")) {
var H = w._calcAttachNodeShift(T.node, Z);
if (d.clear(), H) return H
}
for (var s, v = T.x + Z.x, I = T.y + Z.y, z = {
x: v,
y: I
}, U = {
x: v + T.w / 2,
y: I + T.h / 2
}, Y = {
x: v + T.w,
y: I + T.h
}, i = w._interactor.gridGuide, R = [d.findClosest(z, S), d.findClosest(U, S), d.findClosest(Y, S), i.findClosest(z, S), i.findClosest(U, S), i.findClosest(Y, S)], L = 1 / 0, $ = 1 / 0, l = 0, _ = R.length; _ > l; l++) s = R[l], s && (v = s.x, I = s.y, isFinite(v) && Math.abs(v) < Math.abs(L) && (L = v), isFinite(I) && Math.abs(I) < Math.abs($) && ($ = I));
if (isFinite(L) || (L = 0), isFinite($) || ($ = 0), o = w._calcShiftByAddon(L, $), w._target.node instanceof se.Group) {
var k = w._target.node;
k._position.x += o.x, k._position.y += o.y
}
var Q = T.node;
if (!Th(Q, r)) {
var h = Z.x + L,
x = Z.y + $;
w._interactor.rectGuide.gatherLines({
node: Q,
x: T.x + h,
y: T.y + x,
w: T.w,
h: T.h
}, S)
}
return o
}
}, If.prototype._calcShiftByAddon = function (V, J) {
var Z = this._target,
g = Z.rawPos,
$ = Z.node.getPosition();
return V = V || 0, J = J || 0, {
x: g.x - $.x + V,
y: g.y - $.y + J
}
}, If.prototype._dealShiftDown = function (p) {
var m = this,
x = m._target.shiftGuide,
K = m._target.lp,
M = Math.abs(p.x - K.x),
$ = Math.abs(p.y - K.y);
M > $ && M > x.limit && "y" === x.dir && (x.dir = "x"), $ > M && $ > x.limit && "x" === x.dir && (x.dir = "y");
var j = x.dir;
return "x" === j ? (p.y = K.y, x.limit = Math.max(x.limit, M)) : "y" === j && (p.x = K.x, x.limit = Math.max(x.limit, $)), p
}, If.prototype._isAttachableLineShape = function ($) {
if (!$.getSegments) return !1;
var t = $.getSegments();
if (!t) return !0;
t instanceof O.List && (t = t.getArray());
for (var L = 1, G = t.length; G > L; L++)
if (2 !== t[L]) return !1;
return !0
}, If.prototype._calcAttachNodeShift = function () {
var x = new Xi,
K = new Xi,
l = new Xi,
G = new Xi;
return function (N, U) {
var r = this._interactor.gv,
p = N.getHost(),
O = r.getDataAt(U, function (C) {
return C.s("2d.hostable") ? !0 : !1
});
if (O && p !== O && N.setHost(O), !O) return this._edgeHostGuideInfo = null, N.setHost(null);
var k = this._edgeHostGuideInfo = {
corners: se.getTargetCornersOnScreen(r, O),
host: O,
attach: -1
};
if (this._isAttachableLineShape(O)) {
for (var u, a, y, P, J, H, h = O.getPoints(), I = h.size(), Z = O.getPointsMatrix2d(), s = 1 / 0, q = 0; I > q && (q !== I - 1 || O.isClosePath()); q++) 0 !== q ? K.copy(l) : Z.apply(h.get(q), K), Z.apply(q === I - 1 ? h.get(0) : h.get(q + 1), l), x.copy(U).sub(K), G.copy(l).sub(K), u = G.length(), G.divideScalar(u), a = x.dot(G), 0 > a ? a = 0 : a > u && (a = u), G.multiplyScalar(a).add(K), y = x.copy(U).sub(G).lengthSq(), s > y && (s = y, H = q, P = a, J = u);
return Math.sqrt(s) * r.getZoom() > this._interactor.getStyle("attachThreshold") ? (N.s({
"attach.index": -1
}), N.setHost(null), void 0) : (N.s("attach.offset.opposite") && (P = J - P), N.s({
"attach.index": H,
"attach.offset": N.s("attach.offset.relative") ? P / J : P
}), {
x: 0,
y: 0
})
}
var B = r.calculateAttachPoint(O, U);
if (B) {
var Y = B.point;
return k.attach = B.index, this._calcShiftByAddon(Y.x - U.x, Y.y - U.y)
}
}
}(), If.prototype._gatherGridInfo = function (C) {
var y, D = this,
T = D._interactor,
W = T._getValidSelection();
if (W.length) {
if (1 === W.length) {
if (y = W[0], !y.getRect) return D._target = null, void 0
} else if (y = se.Group.findOrCreateGroup(W), !y) return D._target = null, void 0
} else {
var W = T.gv.sm().getSelection();
if (W.length && (y = W.get(0), !y.getRect)) return D._target = null, void 0
} if (y) {
var _ = y.getPosition(),
l = y.getRect();
D._target = {
node: y,
x: l.x - _.x,
y: l.y - _.y,
w: l.width,
h: l.height,
lp: {
x: C.x,
y: C.y
},
pos: {
x: _.x,
y: _.y
},
shiftGuide: {
dir: "x",
limit: 0
},
downPosition: new se.Math.Vector2(C)
}, T.rectGuide.gatherRects()
}
}, If.prototype.clear = function () {
var l = this;
l._edgeHostGuideInfo = null, l._interactor.rectGuide.clear(), l._interactor._42()
}, If.prototype._42 = function () {
var j = this._edgeHostGuideInfo;
j && this._interactor._drawHostGuide(j)
};
var Ah = o.freeze({
DEPTH_BUFFER_BIT: 256,
STENCIL_BUFFER_BIT: 1024,
COLOR_BUFFER_BIT: 16384,
POINTS: 0,
LINES: 1,
LINE_LOOP: 2,
LINE_STRIP: 3,
TRIANGLES: 4,
TRIANGLE_STRIP: 5,
TRIANGLE_FAN: 6,
ZERO: 0,
ONE: 1,
SRC_COLOR: 768,
ONE_MINUS_SRC_COLOR: 769,
SRC_ALPHA: 770,
ONE_MINUS_SRC_ALPHA: 771,
DST_ALPHA: 772,
ONE_MINUS_DST_ALPHA: 773,
DST_COLOR: 774,
ONE_MINUS_DST_COLOR: 775,
SRC_ALPHA_SATURATE: 776,
FUNC_ADD: 32774,
BLEND_EQUATION: 32777,
BLEND_EQUATION_RGB: 32777,
BLEND_EQUATION_ALPHA: 34877,
FUNC_SUBTRACT: 32778,
FUNC_REVERSE_SUBTRACT: 32779,
BLEND_DST_RGB: 32968,
BLEND_SRC_RGB: 32969,
BLEND_DST_ALPHA: 32970,
BLEND_SRC_ALPHA: 32971,
CONSTANT_COLOR: 32769,
ONE_MINUS_CONSTANT_COLOR: 32770,
CONSTANT_ALPHA: 32771,
ONE_MINUS_CONSTANT_ALPHA: 32772,
BLEND_COLOR: 32773,
ARRAY_BUFFER: 34962,
ELEMENT_ARRAY_BUFFER: 34963,
ARRAY_BUFFER_BINDING: 34964,
ELEMENT_ARRAY_BUFFER_BINDING: 34965,
STREAM_DRAW: 35040,
STATIC_DRAW: 35044,
DYNAMIC_DRAW: 35048,
BUFFER_SIZE: 34660,
BUFFER_USAGE: 34661,
CURRENT_VERTEX_ATTRIB: 34342,
FRONT: 1028,
BACK: 1029,
FRONT_AND_BACK: 1032,
CULL_FACE: 2884,
BLEND: 3042,
DITHER: 3024,
STENCIL_TEST: 2960,
DEPTH_TEST: 2929,
SCISSOR_TEST: 3089,
POLYGON_OFFSET_FILL: 32823,
SAMPLE_ALPHA_TO_COVERAGE: 32926,
SAMPLE_COVERAGE: 32928,
NO_ERROR: 0,
INVALID_ENUM: 1280,
INVALID_VALUE: 1281,
INVALID_OPERATION: 1282,
OUT_OF_MEMORY: 1285,
CW: 2304,
CCW: 2305,
LINE_WIDTH: 2849,
ALIASED_POINT_SIZE_RANGE: 33901,
ALIASED_LINE_WIDTH_RANGE: 33902,
CULL_FACE_MODE: 2885,
FRONT_FACE: 2886,
DEPTH_RANGE: 2928,
DEPTH_WRITEMASK: 2930,
DEPTH_CLEAR_VALUE: 2931,
DEPTH_FUNC: 2932,
STENCIL_CLEAR_VALUE: 2961,
STENCIL_FUNC: 2962,
STENCIL_FAIL: 2964,
STENCIL_PASS_DEPTH_FAIL: 2965,
STENCIL_PASS_DEPTH_PASS: 2966,
STENCIL_REF: 2967,
STENCIL_VALUE_MASK: 2963,
STENCIL_WRITEMASK: 2968,
STENCIL_BACK_FUNC: 34816,
STENCIL_BACK_FAIL: 34817,
STENCIL_BACK_PASS_DEPTH_FAIL: 34818,
STENCIL_BACK_PASS_DEPTH_PASS: 34819,
STENCIL_BACK_REF: 36003,
STENCIL_BACK_VALUE_MASK: 36004,
STENCIL_BACK_WRITEMASK: 36005,
VIEWPORT: 2978,
SCISSOR_BOX: 3088,
COLOR_CLEAR_VALUE: 3106,
COLOR_WRITEMASK: 3107,
UNPACK_ALIGNMENT: 3317,
PACK_ALIGNMENT: 3333,
MAX_TEXTURE_SIZE: 3379,
MAX_VIEWPORT_DIMS: 3386,
SUBPIXEL_BITS: 3408,
RED_BITS: 3410,
GREEN_BITS: 3411,
BLUE_BITS: 3412,
ALPHA_BITS: 3413,
DEPTH_BITS: 3414,
STENCIL_BITS: 3415,
POLYGON_OFFSET_UNITS: 10752,
POLYGON_OFFSET_FACTOR: 32824,
TEXTURE_BINDING_2D: 32873,
SAMPLE_BUFFERS: 32936,
SAMPLES: 32937,
SAMPLE_COVERAGE_VALUE: 32938,
SAMPLE_COVERAGE_INVERT: 32939,
COMPRESSED_TEXTURE_FORMATS: 34467,
DONT_CARE: 4352,
FASTEST: 4353,
NICEST: 4354,
GENERATE_MIPMAP_HINT: 33170,
BYTE: 5120,
UNSIGNED_BYTE: 5121,
SHORT: 5122,
UNSIGNED_SHORT: 5123,
INT: 5124,
UNSIGNED_INT: 5125,
FLOAT: 5126,
DEPTH_COMPONENT: 6402,
ALPHA: 6406,
RGB: 6407,
RGBA: 6408,
LUMINANCE: 6409,
LUMINANCE_ALPHA: 6410,
UNSIGNED_SHORT_4_4_4_4: 32819,
UNSIGNED_SHORT_5_5_5_1: 32820,
UNSIGNED_SHORT_5_6_5: 33635,
FRAGMENT_SHADER: 35632,
VERTEX_SHADER: 35633,
MAX_VERTEX_ATTRIBS: 34921,
MAX_VERTEX_UNIFORM_VECTORS: 36347,
MAX_VARYING_VECTORS: 36348,
MAX_COMBINED_TEXTURE_IMAGE_UNITS: 35661,
MAX_VERTEX_TEXTURE_IMAGE_UNITS: 35660,
MAX_TEXTURE_IMAGE_UNITS: 34930,
MAX_FRAGMENT_UNIFORM_VECTORS: 36349,
SHADER_TYPE: 35663,
DELETE_STATUS: 35712,
LINK_STATUS: 35714,
VALIDATE_STATUS: 35715,
ATTACHED_SHADERS: 35717,
ACTIVE_UNIFORMS: 35718,
ACTIVE_ATTRIBUTES: 35721,
SHADING_LANGUAGE_VERSION: 35724,
CURRENT_PROGRAM: 35725,
NEVER: 512,
LESS: 513,
EQUAL: 514,
LEQUAL: 515,
GREATER: 516,
NOTEQUAL: 517,
GEQUAL: 518,
ALWAYS: 519,
KEEP: 7680,
REPLACE: 7681,
INCR: 7682,
DECR: 7683,
INVERT: 5386,
INCR_WRAP: 34055,
DECR_WRAP: 34056,
VENDOR: 7936,
RENDERER: 7937,
VERSION: 7938,
NEAREST: 9728,
LINEAR: 9729,
NEAREST_MIPMAP_NEAREST: 9984,
LINEAR_MIPMAP_NEAREST: 9985,
NEAREST_MIPMAP_LINEAR: 9986,
LINEAR_MIPMAP_LINEAR: 9987,
TEXTURE_MAG_FILTER: 10240,
TEXTURE_MIN_FILTER: 10241,
TEXTURE_WRAP_S: 10242,
TEXTURE_WRAP_T: 10243,
TEXTURE_2D: 3553,
TEXTURE: 5890,
TEXTURE_CUBE_MAP: 34067,
TEXTURE_BINDING_CUBE_MAP: 34068,
TEXTURE_CUBE_MAP_POSITIVE_X: 34069,
TEXTURE_CUBE_MAP_NEGATIVE_X: 34070,
TEXTURE_CUBE_MAP_POSITIVE_Y: 34071,
TEXTURE_CUBE_MAP_NEGATIVE_Y: 34072,
TEXTURE_CUBE_MAP_POSITIVE_Z: 34073,
TEXTURE_CUBE_MAP_NEGATIVE_Z: 34074,
MAX_CUBE_MAP_TEXTURE_SIZE: 34076,
TEXTURE0: 33984,
TEXTURE1: 33985,
TEXTURE2: 33986,
TEXTURE3: 33987,
TEXTURE4: 33988,
TEXTURE5: 33989,
TEXTURE6: 33990,
TEXTURE7: 33991,
TEXTURE8: 33992,
TEXTURE9: 33993,
TEXTURE10: 33994,
TEXTURE11: 33995,
TEXTURE12: 33996,
TEXTURE13: 33997,
TEXTURE14: 33998,
TEXTURE15: 33999,
TEXTURE16: 34e3,
TEXTURE17: 34001,
TEXTURE18: 34002,
TEXTURE19: 34003,
TEXTURE20: 34004,
TEXTURE21: 34005,
TEXTURE22: 34006,
TEXTURE23: 34007,
TEXTURE24: 34008,
TEXTURE25: 34009,
TEXTURE26: 34010,
TEXTURE27: 34011,
TEXTURE28: 34012,
TEXTURE29: 34013,
TEXTURE30: 34014,
TEXTURE31: 34015,
ACTIVE_TEXTURE: 34016,
REPEAT: 10497,
CLAMP_TO_EDGE: 33071,
MIRRORED_REPEAT: 33648,
FLOAT_VEC2: 35664,
FLOAT_VEC3: 35665,
FLOAT_VEC4: 35666,
INT_VEC2: 35667,
INT_VEC3: 35668,
INT_VEC4: 35669,
BOOL: 35670,
BOOL_VEC2: 35671,
BOOL_VEC3: 35672,
BOOL_VEC4: 35673,
FLOAT_MAT2: 35674,
FLOAT_MAT3: 35675,
FLOAT_MAT4: 35676,
SAMPLER_2D: 35678,
SAMPLER_CUBE: 35680,
VERTEX_ATTRIB_ARRAY_ENABLED: 34338,
VERTEX_ATTRIB_ARRAY_SIZE: 34339,
VERTEX_ATTRIB_ARRAY_STRIDE: 34340,
VERTEX_ATTRIB_ARRAY_TYPE: 34341,
VERTEX_ATTRIB_ARRAY_NORMALIZED: 34922,
VERTEX_ATTRIB_ARRAY_POINTER: 34373,
VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: 34975,
IMPLEMENTATION_COLOR_READ_TYPE: 35738,
IMPLEMENTATION_COLOR_READ_FORMAT: 35739,
COMPILE_STATUS: 35713,
LOW_FLOAT: 36336,
MEDIUM_FLOAT: 36337,
HIGH_FLOAT: 36338,
LOW_INT: 36339,
MEDIUM_INT: 36340,
HIGH_INT: 36341,
FRAMEBUFFER: 36160,
RENDERBUFFER: 36161,
RGBA4: 32854,
RGB5_A1: 32855,
RGB565: 36194,
DEPTH_COMPONENT16: 33189,
STENCIL_INDEX: 6401,
STENCIL_INDEX8: 36168,
DEPTH_STENCIL: 34041,
RENDERBUFFER_WIDTH: 36162,
RENDERBUFFER_HEIGHT: 36163,
RENDERBUFFER_INTERNAL_FORMAT: 36164,
RENDERBUFFER_RED_SIZE: 36176,
RENDERBUFFER_GREEN_SIZE: 36177,
RENDERBUFFER_BLUE_SIZE: 36178,
RENDERBUFFER_ALPHA_SIZE: 36179,
RENDERBUFFER_DEPTH_SIZE: 36180,
RENDERBUFFER_STENCIL_SIZE: 36181,
FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: 36048,
FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: 36049,
FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: 36050,
FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: 36051,
COLOR_ATTACHMENT0: 36064,
DEPTH_ATTACHMENT: 36096,
STENCIL_ATTACHMENT: 36128,
DEPTH_STENCIL_ATTACHMENT: 33306,
NONE: 0,
FRAMEBUFFER_COMPLETE: 36053,
FRAMEBUFFER_INCOMPLETE_ATTACHMENT: 36054,
FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: 36055,
FRAMEBUFFER_INCOMPLETE_DIMENSIONS: 36057,
FRAMEBUFFER_UNSUPPORTED: 36061,
FRAMEBUFFER_BINDING: 36006,
RENDERBUFFER_BINDING: 36007,
MAX_RENDERBUFFER_SIZE: 34024,
INVALID_FRAMEBUFFER_OPERATION: 1286,
UNPACK_FLIP_Y_WEBGL: 37440,
UNPACK_PREMULTIPLY_ALPHA_WEBGL: 37441,
CONTEXT_LOST_WEBGL: 37442,
UNPACK_COLORSPACE_CONVERSION_WEBGL: 37443,
BROWSER_DEFAULT_WEBGL: 37444,
COMPRESSED_RGB_S3TC_DXT1_EXT: 33776,
COMPRESSED_RGBA_S3TC_DXT1_EXT: 33777,
COMPRESSED_RGBA_S3TC_DXT3_EXT: 33778,
COMPRESSED_RGBA_S3TC_DXT5_EXT: 33779,
COMPRESSED_RGB_PVRTC_4BPPV1_IMG: 35840,
COMPRESSED_RGB_PVRTC_2BPPV1_IMG: 35841,
COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: 35842,
COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: 35843,
COMPRESSED_RGB_ETC1_WEBGL: 36196,
HALF_FLOAT_OES: 36193,
DOUBLE: 5130,
READ_BUFFER: 3074,
UNPACK_ROW_LENGTH: 3314,
UNPACK_SKIP_ROWS: 3315,
UNPACK_SKIP_PIXELS: 3316,
PACK_ROW_LENGTH: 3330,
PACK_SKIP_ROWS: 3331,
PACK_SKIP_PIXELS: 3332,
COLOR: 6144,
DEPTH: 6145,
STENCIL: 6146,
RED: 6403,
RGB8: 32849,
RGBA8: 32856,
RGB10_A2: 32857,
TEXTURE_BINDING_3D: 32874,
UNPACK_SKIP_IMAGES: 32877,
UNPACK_IMAGE_HEIGHT: 32878,
TEXTURE_3D: 32879,
TEXTURE_WRAP_R: 32882,
MAX_3D_TEXTURE_SIZE: 32883,
UNSIGNED_INT_2_10_10_10_REV: 33640,
MAX_ELEMENTS_VERTICES: 33e3,
MAX_ELEMENTS_INDICES: 33001,
TEXTURE_MIN_LOD: 33082,
TEXTURE_MAX_LOD: 33083,
TEXTURE_BASE_LEVEL: 33084,
TEXTURE_MAX_LEVEL: 33085,
MIN: 32775,
MAX: 32776,
DEPTH_COMPONENT24: 33190,
MAX_TEXTURE_LOD_BIAS: 34045,
TEXTURE_COMPARE_MODE: 34892,
TEXTURE_COMPARE_FUNC: 34893,
CURRENT_QUERY: 34917,
QUERY_RESULT: 34918,
QUERY_RESULT_AVAILABLE: 34919,
STREAM_READ: 35041,
STREAM_COPY: 35042,
STATIC_READ: 35045,
STATIC_COPY: 35046,
DYNAMIC_READ: 35049,
DYNAMIC_COPY: 35050,
MAX_DRAW_BUFFERS: 34852,
DRAW_BUFFER0: 34853,
DRAW_BUFFER1: 34854,
DRAW_BUFFER2: 34855,
DRAW_BUFFER3: 34856,
DRAW_BUFFER4: 34857,
DRAW_BUFFER5: 34858,
DRAW_BUFFER6: 34859,
DRAW_BUFFER7: 34860,
DRAW_BUFFER8: 34861,
DRAW_BUFFER9: 34862,
DRAW_BUFFER10: 34863,
DRAW_BUFFER11: 34864,
DRAW_BUFFER12: 34865,
DRAW_BUFFER13: 34866,
DRAW_BUFFER14: 34867,
DRAW_BUFFER15: 34868,
MAX_FRAGMENT_UNIFORM_COMPONENTS: 35657,
MAX_VERTEX_UNIFORM_COMPONENTS: 35658,
SAMPLER_3D: 35679,
SAMPLER_2D_SHADOW: 35682,
FRAGMENT_SHADER_DERIVATIVE_HINT: 35723,
PIXEL_PACK_BUFFER: 35051,
PIXEL_UNPACK_BUFFER: 35052,
PIXEL_PACK_BUFFER_BINDING: 35053,
PIXEL_UNPACK_BUFFER_BINDING: 35055,
FLOAT_MAT2x3: 35685,
FLOAT_MAT2x4: 35686,
FLOAT_MAT3x2: 35687,
FLOAT_MAT3x4: 35688,
FLOAT_MAT4x2: 35689,
FLOAT_MAT4x3: 35690,
SRGB: 35904,
SRGB8: 35905,
SRGB8_ALPHA8: 35907,
COMPARE_REF_TO_TEXTURE: 34894,
RGBA32F: 34836,
RGB32F: 34837,
RGBA16F: 34842,
RGB16F: 34843,
VERTEX_ATTRIB_ARRAY_INTEGER: 35069,
MAX_ARRAY_TEXTURE_LAYERS: 35071,
MIN_PROGRAM_TEXEL_OFFSET: 35076,
MAX_PROGRAM_TEXEL_OFFSET: 35077,
MAX_VARYING_COMPONENTS: 35659,
TEXTURE_2D_ARRAY: 35866,
TEXTURE_BINDING_2D_ARRAY: 35869,
R11F_G11F_B10F: 35898,
UNSIGNED_INT_10F_11F_11F_REV: 35899,
RGB9_E5: 35901,
UNSIGNED_INT_5_9_9_9_REV: 35902,
TRANSFORM_FEEDBACK_BUFFER_MODE: 35967,
MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: 35968,
TRANSFORM_FEEDBACK_VARYINGS: 35971,
TRANSFORM_FEEDBACK_BUFFER_START: 35972,
TRANSFORM_FEEDBACK_BUFFER_SIZE: 35973,
TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: 35976,
RASTERIZER_DISCARD: 35977,
MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: 35978,
MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: 35979,
INTERLEAVED_ATTRIBS: 35980,
SEPARATE_ATTRIBS: 35981,
TRANSFORM_FEEDBACK_BUFFER: 35982,
TRANSFORM_FEEDBACK_BUFFER_BINDING: 35983,
RGBA32UI: 36208,
RGB32UI: 36209,
RGBA16UI: 36214,
RGB16UI: 36215,
RGBA8UI: 36220,
RGB8UI: 36221,
RGBA32I: 36226,
RGB32I: 36227,
RGBA16I: 36232,
RGB16I: 36233,
RGBA8I: 36238,
RGB8I: 36239,
RED_INTEGER: 36244,
RGB_INTEGER: 36248,
RGBA_INTEGER: 36249,
SAMPLER_2D_ARRAY: 36289,
SAMPLER_2D_ARRAY_SHADOW: 36292,
SAMPLER_CUBE_SHADOW: 36293,
UNSIGNED_INT_VEC2: 36294,
UNSIGNED_INT_VEC3: 36295,
UNSIGNED_INT_VEC4: 36296,
INT_SAMPLER_2D: 36298,
INT_SAMPLER_3D: 36299,
INT_SAMPLER_CUBE: 36300,
INT_SAMPLER_2D_ARRAY: 36303,
UNSIGNED_INT_SAMPLER_2D: 36306,
UNSIGNED_INT_SAMPLER_3D: 36307,
UNSIGNED_INT_SAMPLER_CUBE: 36308,
UNSIGNED_INT_SAMPLER_2D_ARRAY: 36311,
DEPTH_COMPONENT32F: 36012,
DEPTH32F_STENCIL8: 36013,
FLOAT_32_UNSIGNED_INT_24_8_REV: 36269,
FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: 33296,
FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: 33297,
FRAMEBUFFER_ATTACHMENT_RED_SIZE: 33298,
FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: 33299,
FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: 33300,
FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: 33301,
FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: 33302,
FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: 33303,
FRAMEBUFFER_DEFAULT: 33304,
UNSIGNED_INT_24_8: 34042,
DEPTH24_STENCIL8: 35056,
UNSIGNED_NORMALIZED: 35863,
DRAW_FRAMEBUFFER_BINDING: 36006,
READ_FRAMEBUFFER: 36008,
DRAW_FRAMEBUFFER: 36009,
READ_FRAMEBUFFER_BINDING: 36010,
RENDERBUFFER_SAMPLES: 36011,
FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: 36052,
MAX_COLOR_ATTACHMENTS: 36063,
COLOR_ATTACHMENT1: 36065,
COLOR_ATTACHMENT2: 36066,
COLOR_ATTACHMENT3: 36067,
COLOR_ATTACHMENT4: 36068,
COLOR_ATTACHMENT5: 36069,
COLOR_ATTACHMENT6: 36070,
COLOR_ATTACHMENT7: 36071,
COLOR_ATTACHMENT8: 36072,
COLOR_ATTACHMENT9: 36073,
COLOR_ATTACHMENT10: 36074,
COLOR_ATTACHMENT11: 36075,
COLOR_ATTACHMENT12: 36076,
COLOR_ATTACHMENT13: 36077,
COLOR_ATTACHMENT14: 36078,
COLOR_ATTACHMENT15: 36079,
FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: 36182,
MAX_SAMPLES: 36183,
HALF_FLOAT: 5131,
RG: 33319,
RG_INTEGER: 33320,
R8: 33321,
RG8: 33323,
R16F: 33325,
R32F: 33326,
RG16F: 33327,
RG32F: 33328,
R8I: 33329,
R8UI: 33330,
R16I: 33331,
R16UI: 33332,
R32I: 33333,
R32UI: 33334,
RG8I: 33335,
RG8UI: 33336,
RG16I: 33337,
RG16UI: 33338,
RG32I: 33339,
RG32UI: 33340,
VERTEX_ARRAY_BINDING: 34229,
R8_SNORM: 36756,
RG8_SNORM: 36757,
RGB8_SNORM: 36758,
RGBA8_SNORM: 36759,
SIGNED_NORMALIZED: 36764,
COPY_READ_BUFFER: 36662,
COPY_WRITE_BUFFER: 36663,
COPY_READ_BUFFER_BINDING: 36662,
COPY_WRITE_BUFFER_BINDING: 36663,
UNIFORM_BUFFER: 35345,
UNIFORM_BUFFER_BINDING: 35368,
UNIFORM_BUFFER_START: 35369,
UNIFORM_BUFFER_SIZE: 35370,
MAX_VERTEX_UNIFORM_BLOCKS: 35371,
MAX_FRAGMENT_UNIFORM_BLOCKS: 35373,
MAX_COMBINED_UNIFORM_BLOCKS: 35374,
MAX_UNIFORM_BUFFER_BINDINGS: 35375,
MAX_UNIFORM_BLOCK_SIZE: 35376,
MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: 35377,
MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: 35379,
UNIFORM_BUFFER_OFFSET_ALIGNMENT: 35380,
ACTIVE_UNIFORM_BLOCKS: 35382,
UNIFORM_TYPE: 35383,
UNIFORM_SIZE: 35384,
UNIFORM_BLOCK_INDEX: 35386,
UNIFORM_OFFSET: 35387,
UNIFORM_ARRAY_STRIDE: 35388,
UNIFORM_MATRIX_STRIDE: 35389,
UNIFORM_IS_ROW_MAJOR: 35390,
UNIFORM_BLOCK_BINDING: 35391,
UNIFORM_BLOCK_DATA_SIZE: 35392,
UNIFORM_BLOCK_ACTIVE_UNIFORMS: 35394,
UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: 35395,
UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: 35396,
UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: 35398,
INVALID_INDEX: 4294967295,
MAX_VERTEX_OUTPUT_COMPONENTS: 37154,
MAX_FRAGMENT_INPUT_COMPONENTS: 37157,
MAX_SERVER_WAIT_TIMEOUT: 37137,
OBJECT_TYPE: 37138,
SYNC_CONDITION: 37139,
SYNC_STATUS: 37140,
SYNC_FLAGS: 37141,
SYNC_FENCE: 37142,
SYNC_GPU_COMMANDS_COMPLETE: 37143,
UNSIGNALED: 37144,
SIGNALED: 37145,
ALREADY_SIGNALED: 37146,
TIMEOUT_EXPIRED: 37147,
CONDITION_SATISFIED: 37148,
WAIT_FAILED: 37149,
SYNC_FLUSH_COMMANDS_BIT: 1,
VERTEX_ATTRIB_ARRAY_DIVISOR: 35070,
ANY_SAMPLES_PASSED: 35887,
ANY_SAMPLES_PASSED_CONSERVATIVE: 36202,
SAMPLER_BINDING: 35097,
RGB10_A2UI: 36975,
INT_2_10_10_10_REV: 36255,
TRANSFORM_FEEDBACK: 36386,
TRANSFORM_FEEDBACK_PAUSED: 36387,
TRANSFORM_FEEDBACK_ACTIVE: 36388,
TRANSFORM_FEEDBACK_BINDING: 36389,
COMPRESSED_R11_EAC: 37488,
COMPRESSED_SIGNED_R11_EAC: 37489,
COMPRESSED_RG11_EAC: 37490,
COMPRESSED_SIGNED_RG11_EAC: 37491,
COMPRESSED_RGB8_ETC2: 37492,
COMPRESSED_SRGB8_ETC2: 37493,
COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: 37494,
COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: 37495,
COMPRESSED_RGBA8_ETC2_EAC: 37496,
COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: 37497,
TEXTURE_IMMUTABLE_FORMAT: 37167,
MAX_ELEMENT_INDEX: 36203,
TEXTURE_IMMUTABLE_LEVELS: 33503,
MAX_TEXTURE_MAX_ANISOTROPY_EXT: 34047
}),
Do = function () {
function i(G, p) {
var r = Z;
return function () {
return r || (r = G.getExtension(p)), r
}
}
function q(d, T) {
T == Z && (T = {}), T.version = P && (d instanceof WebGL2RenderingContext || o.prototype.toString.call(d) === k) ? 2 : 1, T.extensions = function () {
for (var _ = {}, A = d.getSupportedExtensions(), a = A.length; a--;) _[name] = i(d, A[a]);
return _
}();
for (var z = o.keys(g), H = 0, Q = z.length; Q > H; ++H) {
var h = z[H];
T[h] = d.getParameter(g[h])
}
if (T.version > 1) {
z = o.keys(r);
for (var H = 0, Q = z.length; Q > H; ++H) {
var h = z[H];
T[h] = d.getParameter(r[h])
}
}
return T
}
var P = "undefined" != typeof WebGL2RenderingContext,
k = "[object WebGL2RenderingContext]",
g = {
aliasedLineWidthRange: Ah.ALIASED_LINE_WIDTH_RANGE,
aliasedPointSizeRange: Ah.ALIASED_POINT_SIZE_RANGE,
maxCombinedTextureImageUnits: Ah.MAX_COMBINED_TEXTURE_IMAGE_UNITS,
maxCubeMapTextureSize: Ah.MAX_CUBE_MAP_TEXTURE_SIZE,
maxFragmentUniformVectors: Ah.MAX_FRAGMENT_UNIFORM_VECTORS,
maxRenderBufferSize: Ah.MAX_RENDERBUFFER_SIZE,
maxTextureImageUnits: Ah.MAX_TEXTURE_IMAGE_UNITS,
maxTextureSize: Ah.MAX_TEXTURE_SIZE,
maxVaryingVectors: Ah.MAX_VARYING_VECTORS,
maxVertexAttribs: Ah.MAX_VERTEX_ATTRIBS,
maxVertexTextureImageUnits: Ah.MAX_VERTEX_TEXTURE_IMAGE_UNITS,
maxVertexUniformVectors: Ah.MAX_VERTEX_UNIFORM_VECTORS,
maxViewportDIMs: Ah.MAX_VIEWPORT_DIMS
},
r = {
max3DTextureSize: Ah.MAX_3D_TEXTURE_SIZE,
maxArrayTextureLayers: Ah.MAX_ARRAY_TEXTURE_LAYERS,
maxColorAttachments: Ah.MAX_COLOR_ATTACHMENTS,
maxCombinedFragmentUniformComponents: Ah.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS,
maxCombinedUniformBlocks: Ah.MAX_COMBINED_UNIFORM_BLOCKS,
maxCombinedVertexUniformComponents: Ah.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS,
maxDrawBuffers: Ah.MAX_DRAW_BUFFERS,
maxElementIndex: Ah.MAX_ELEMENT_INDEX,
maxElementsIndices: Ah.MAX_ELEMENTS_INDICES,
maxElementsVertices: Ah.MAX_ELEMENTS_VERTICES,
maxFragmentInpuComponents: Ah.MAX_FRAGMENT_INPUT_COMPONENTS,
maxFragmentUniformBlocks: Ah.MAX_FRAGMENT_UNIFORM_BLOCKS,
maxFragmentUniformComponents: Ah.MAX_FRAGMENT_UNIFORM_COMPONENTS,
maxProgramTexelOffset: Ah.MAX_PROGRAM_TEXEL_OFFSET,
maxSamples: Ah.MAX_SAMPLES,
maxTextureLODBias: Ah.MAX_TEXTURE_LOD_BIAS,
maxTransformFeedbackInterleavedComponents: Ah.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS,
maxTransformFeedbackSeparateAttribs: Ah.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS,
maxTransformFeedbackSeparateComponents: Ah.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS,
maxUniformBlockSize: Ah.MAX_UNIFORM_BLOCK_SIZE,
maxUniformBufferBindings: Ah.MAX_UNIFORM_BUFFER_BINDINGS,
maxVaryingComponents: Ah.MAX_VARYING_COMPONENTS,
maxVertexOutputComponents: Ah.MAX_VERTEX_OUTPUT_COMPONENTS,
maxVertexUniformBlocks: Ah.MAX_VERTEX_UNIFORM_BLOCKS,
maxVertexUniformComponents: Ah.MAX_VERTEX_UNIFORM_COMPONENTS,
minProgramTexelOffset: Ah.MIN_PROGRAM_TEXEL_OFFSET
};
return {
"for": function (z) {
var e = z._info;
return e || (z._info = e = q(z, e)), e
}
}
}(),
vd = function () {
function s(y, m, S) {
return {
def: y,
getter: S ? function (A) {
var P = Do.for(A);
return P.version > 1 ? A.getParameter(m) : y
} : function (s) {
return s.getParameter(m)
}, setter: S ? function (d, D) {
var I = Do.for(d);
I.version > 1 && d.pixelStorei(m, D)
} : function (I, D) {
I.pixelStorei(m, D)
}
}
}
function W(v) {
return "string" == typeof v ? ns(v) : v.r !== Z ? (I[0] = v.r, I[1] = v.g, I[2] = v.b, I[3] = v.a, I) : v.red !== Z ? (I[0] = v.red, I[1] = v.green, I[2] = v.blue, I[3] = v.alpha, I) : v
}
function A(s) {
return d(s) ? Array.prototype.slice.call(s, 0) : s
}
function r(H, e, K) {
this.gl = e, this._record = K || {}, this._branches = {}, this._leafSync = {}, this._struct = H;
for (var G = H.children, M = G.length; M--;) {
var t = G[M],
J = t.name;
t.isLeaf ? (this._leafSync[J] = !1, this._record[J] = A(t.desc.def)) : this._record[J] = {}
}
}
function K(O) {
function G(B, X) {
r.call(this, O, B, X);
for (var h = u.length; h--;) {
var T = u[h];
this._branches[T._name] = new T._type(B, this._record[T._name])
}
}
function Q(w, x) {
function L(b, U) {
for (var g = W, v = !1; g--;) b[g] !== U[g] && (b[g] = U[g], v = !0);
return v
}
var V = w.name,
N = d(w.desc.def),
W = N && w.desc.def.length;
if (w.isLeaf) {
var $ = w.desc.setter,
y = w.desc.parse;
o.defineProperty(x, V, {
configurable: !1,
enumerable: !0,
get: function () {
return this._record[V]
}, set: N ? function (T) {
y && (T = y(T)), (L(this._record[V], T) || !this._leafSync[V]) && ($(this.gl, this._record[V]), this._leafSync[V] = !0)
} : function (Y) {
this._record[V] === Y && this._leafSync[V] || ($(this.gl, Y), this._record[V] = Y, this._leafSync[V] = !0)
}
})
} else u.push({
_name: V,
_type: K(w)
}), o.defineProperty(x, V, {
configurable: !1,
enumerable: !0,
get: function () {
return this._branches[V]
}, set: function (W) {
this._branches[V].apply(W)
}
})
}
var u = [];
return l(G, r), O.forEach(Q, G.prototype), G
}
var I = "undefined" != typeof Float32Array && new Float32Array(4),
H = {
viewport: {
def: [0, 0, 0 / 0, 0 / 0],
getter: function (a) {
return a.getParameter(a.VIEWPORT)
}, setter: function (G, z) {
var i = z[2] !== z[2] ? G.drawingBufferWidth - z[0] : z[2],
K = z[3] !== z[3] ? G.drawingBufferHeight - z[1] : z[3];
G.viewport(z[0], z[1], i, K)
}
},
dither: {
def: !1,
getter: function (O) {
return O.isEnabled(O.DITHER)
}, setter: function (p, Y) {
Y ? p.enable(p.DITHER) : p.disable(p.DITHER)
}
},
rasterizerDiscard: {
def: !1,
getter: function (w) {
var J = Do.for(w);
return J.version > 1 && w.isEnabled(w.RASTERIZER_DISCARD)
}, setter: function (T, h) {
var f = Do.for(T);
1 !== f.version && (h ? T.enable(T.RASTERIZER_DISCARD) : T.disable(T.RASTERIZER_DISCARD))
}
},
lineWidth: {
def: 1,
getter: function (K) {
return K.lineWidth ? K.getParameter(K.LINE_WIDTH) : 1
}, setter: function (i, W) {
i.lineWidth && i.lineWidth(W)
}
},
color: {
clear: {
def: [0, 0, 0, 0],
getter: function (Q) {
return Q.getParameter(Q.COLOR_CLEAR_VALUE)
}, setter: function (x, l) {
x.clearColor(l[0], l[1], l[2], l[3])
}, parse: W
},
mask: {
def: [!0, !0, !0, !0],
getter: function (i) {
return i.getParameter(i.COLOR_WRITEMASK)
}, setter: function (r, d) {
r.colorMask(d[0], d[1], d[2], d[3])
}
}
},
blend: {
enabled: {
def: !1,
getter: function (q) {
return q.isEnabled(q.BLEND)
}, setter: function (g, P) {
P ? g.enable(g.BLEND) : g.disable(g.BLEND)
}
},
color: {
def: [0, 0, 0, 0],
getter: function (x) {
return x.getParameter(x.BLEND_COLOR)
}, setter: function (X, q) {
X.blendColor(q[0], q[1], q[2], q[3])
}, parse: W
},
equation: {
def: [Ah.FUNC_ADD, Ah.FUNC_ADD],
getter: function (n) {
return [n.getParameter(n.BLEND_EQUATION_RGB), n.getParameter(n.BLEND_EQUATION_ALPHA)]
}, setter: function (G, d) {
G.blendEquationSeparate(d[0], d[1])
}, parse: function (y) {
var b = y.length;
return b > 1 ? y : 1 === b ? (I[1] = I[0] = y[0], I) : (I[1] = I[0] = y, I)
}
},
func: {
def: [Ah.ONE, Ah.ZERO, Ah.ONE, Ah.ZERO],
getter: function (T) {
return [T.getParameter(T.BLEND_SRC_RGB), T.getParameter(T.BLEND_DST_RGB), T.getParameter(T.BLEND_SRC_ALPHA), T.getParameter(T.BLEND_DST_ALPHA)]
}, setter: function (T, R) {
T.blendFuncSeparate(R[0], R[1], R[2], R[3])
}, parse: function (P) {
var w = P.length;
return w > 3 ? P : (I[2] = I[0] = P[0], I[3] = I[1] = P[1], I)
}
}
},
cullFace: {
enabled: {
def: !1,
getter: function (M) {
return M.isEnabled(M.CULL_FACE)
}, setter: function (Q, G) {
G ? Q.enable(Q.CULL_FACE) : Q.disable(Q.CULL_FACE)
}
},
mode: {
def: Ah.BACK,
getter: function (M) {
return M.getParameter(M.CULL_FACE_MODE)
}, setter: function (Y, R) {
Y.cullFace(R)
}
},
frontFace: {
def: Ah.CCW,
getter: function (i) {
return i.getParameter(i.FRONT_FACE)
}, setter: function (u, $) {
u.frontFace($)
}
}
},
scissor: {
enabled: {
def: !1,
getter: function (S) {
return S.isEnabled(S.SCISSOR_TEST)
}, setter: function (k, t) {
t ? k.enable(k.SCISSOR_TEST) : k.disable(k.SCISSOR_TEST)
}
},
box: {
def: [0, 0, 0 / 0, 0 / 0],
getter: function (p) {
return p.getParameter(p.SCISSOR_BOX)
}, setter: function (l, C) {
var s = C[2] !== C[2] ? l.drawingBufferWidth - C[0] : C[2],
U = C[3] !== C[3] ? l.drawingBufferHeight - C[1] : C[3];
l.scissor(C[0], C[1], s, U)
}
}
},
depth: {
enabled: {
def: !1,
getter: function (_) {
return _.isEnabled(_.DEPTH_TEST)
}, setter: function (U, M) {
M ? U.enable(U.DEPTH_TEST) : U.disable(U.DEPTH_TEST)
}
},
clear: {
def: 1,
getter: function (M) {
return M.getParameter(M.DEPTH_CLEAR_VALUE)
}, setter: function (Y, c) {
Y.clearDepth(c)
}
},
mask: {
def: !0,
getter: function (z) {
return z.getParameter(z.DEPTH_WRITEMASK)
}, setter: function (S, k) {
S.depthMask(k)
}
},
range: {
def: [-1, 1],
getter: function (s) {
return s.getParameter(s.DEPTH_RANGE)
}, setter: function (d, Z) {
d.depthRange(Z[0], Z[1])
}
},
func: {
def: Ah.LESS,
getter: function (f) {
return f.getParameter(f.DEPTH_FUNC)
}, setter: function (g, J) {
g.depthFunc(J)
}
}
},
stencil: {
enabled: {
def: !1,
getter: function (Q) {
return Q.isEnabled(Q.STENCIL_TEST)
}, setter: function (a, G) {
G ? a.enable(a.STENCIL_TEST) : a.disable(a.STENCIL_TEST)
}
},
clear: {
def: 0,
getter: function (j) {
return j.getParameter(j.STENCIL_CLEAR_VALUE)
}, setter: function (D, r) {
D.clearStencil(r)
}
},
frontMask: {
def: 255,
getter: function (v) {
return v.getParameter(v.STENCIL_WRITEMASK)
}, setter: function (E, i) {
E.stencilMaskSeparate(E.FRONT, i)
}
},
frontOp: {
def: [Ah.KEEP, Ah.KEEP, Ah.KEEP],
getter: function (s) {
return [s.getParameter(s.STENCIL_FAIL), s.getParameter(s.STENCIL_PASS_DEPTH_FAIL), s.getParameter(s.STENCIL_PASS_DEPTH_PASS)]
}, setter: function (n, H) {
n.stencilOpSeparate(n.FRONT, H[0], H[1], H[2])
}
},
frontFunc: {
def: [Ah.ALWAYS, 0, 255],
getter: function (t) {
return [t.getParameter(t.STENCIL_FUNC), t.getParameter(t.STENCIL_REF), t.getParameter(t.STENCIL_VALUE_MASK)]
}, setter: function (u, f) {
u.stencilFuncSeparate(u.FRONT, f[0], f[1], f[2])
}
},
backMask: {
def: 255,
getter: function (y) {
return y.getParameter(y.STENCIL_BACK_WRITEMASK)
}, setter: function (y, P) {
y.stencilMaskSeparate(y.BACK, P)
}
},
backOp: {
def: [Ah.KEEP, Ah.KEEP, Ah.KEEP],
getter: function (l) {
return [l.getParameter(l.STENCIL_BACK_FAIL), l.getParameter(l.STENCIL_BACK_PASS_DEPTH_FAIL), l.getParameter(l.STENCIL_BACK_PASS_DEPTH_PASS)]
}, setter: function (s, P) {
s.stencilOpSeparate(s.BACK, P[0], P[1], P[2])
}
},
backFunc: {
def: [Ah.ALWAYS, 0, 255],
getter: function (J) {
return [J.getParameter(J.STENCIL_BACK_FUNC), J.getParameter(J.STENCIL_BACK_REF), J.getParameter(J.STENCIL_BACK_VALUE_MASK)]
}, setter: function (B, T) {
B.stencilFuncSeparate(B.BACK, T[0], T[1], T[2])
}
}
},
hint: {
generateMipmap: {
def: Ah.DONT_CARE,
getter: function (X) {
return X.getParameter(X.GENERATE_MIPMAP_HINT)
}, setter: function (y, K) {
y.hint(y.GENERATE_MIPMAP_HINT, K)
}
},
fragmentShaderDerivative: {
def: Ah.DONT_CARE,
getter: function (k) {
var q = Do.for(k);
return 1 !== q.version || q.extensions.OES_standard_derivatives ? k.getParameter(Ah.FRAGMENT_SHADER_DERIVATIVE_HINT) : Ah.DONT_CARE
}, setter: function (e, K) {
var x = Do.for(e);
return x.version > 1 || x.extensions.OES_standard_derivatives ? (e.hint(Ah.FRAGMENT_SHADER_DERIVATIVE_HINT, K), void 0) : void 0
}
}
},
pixelStore: {
packAlignment: s(4, Ah.PACK_ALIGNMENT, !1),
unpackAlignment: s(4, Ah.UNPACK_ALIGNMENT, !1),
unpackFlipY: s(!1, Ah.UNPACK_FLIP_Y_WEBGL, !1),
unpackPremultiplyAlpha: s(!1, Ah.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1),
unpackColorspaceConversion: s(Ah.BROWSER_DEFAULT_WEBGL, Ah.UNPACK_COLORSPACE_CONVERSION_WEBGL, !1),
packRowLength: s(0, Ah.PACK_ROW_LENGTH, !0),
packSkipPixels: s(0, Ah.PACK_SKIP_PIXELS, !0),
packSkipRows: s(0, Ah.PACK_SKIP_ROWS, !0),
unpackRowLength: s(0, Ah.UNPACK_ROW_LENGTH, !0),
unpackImageHeight: s(0, Ah.UNPACK_IMAGE_HEIGHT, !0),
unpackSkipPixels: s(0, Ah.UNPACK_SKIP_PIXELS, !0),
unpackSkipRows: s(0, Ah.UNPACK_SKIP_ROWS, !0),
unpackSkipImages: s(0, Ah.UNPACK_SKIP_IMAGES, !0)
},
polygonOffset: {
enabled: {
def: !1,
getter: function (T) {
return T.isEnabled(T.POLYGON_OFFSET_FILL)
}, setter: function (A, j) {
j ? A.enable(A.POLYGON_OFFSET_FILL) : A.disable(A.POLYGON_OFFSET_FILL)
}
},
value: {
def: [0, 0],
getter: function (q) {
return [q.getParameter(q.POLYGON_OFFSET_FACTOR), q.getParameter(q.POLYGON_OFFSET_UNITS)]
}, setter: function (t, i) {
t.polygonOffset(i[0], i[1])
}
}
},
sampleCoverage: {
enabled: {
def: !1,
getter: function (i) {
return i.isEnabled(i.SAMPLE_COVERAGE)
}, setter: function (k, B) {
B ? k.enable(k.SAMPLE_COVERAGE) : k.disable(k.SAMPLE_COVERAGE)
}
},
alpha: {
def: !1,
getter: function (S) {
return S.isEnabled(S.SAMPLE_ALPHA_TO_COVERAGE)
}, setter: function (u, P) {
P ? u.enable(u.SAMPLE_ALPHA_TO_COVERAGE) : u.disable(u.SAMPLE_ALPHA_TO_COVERAGE)
}
},
value: {
def: [1, !1],
getter: function (g) {
return [g.getParameter(g.SAMPLE_COVERAGE_VALUE), g.getParameter(g.SAMPLE_COVERAGE_INVERT)]
}, setter: function (B, h) {
B.sampleCoverage(h[0], h[1])
}
}
}
},
C = _j.create(H, function (L) {
return "def" in L
});
r.prototype.reset = function () {
for (var R = this._struct.children, l = R.length; l--;) {
var M = R[l],
T = M.name;
M.isLeaf ? this[T] = M.desc.def : this._branches[T].reset()
}
}, r.prototype.save = function (p) {
p == Z && (p = {});
for (var z = this._struct.children, F = z.length; F--;) {
var k = z[F],
c = k.name;
if (k.isLeaf) p[c] = A(this._record[c]);
else {
var y = p[c];
y == Z && (p[c] = y = {}), this._branches[c].save(y)
}
}
return p
}, r.prototype.sync = function (n, b) {
for (var Q = this._struct.children, k = Q.length; k--;) {
var s = Q[k],
o = s.name;
s.isLeaf ? (b || !this._leafSync[o]) && (n ? (this._record[o] = s.desc.getter(this.gl), this._leafSync[o] = !0) : (s.desc.setter(this.gl, this._record[o]), this._leafSync[o] = !0)) : this._branches[o].sync(n, b)
}
}, r.prototype.syncLoss = function () {
for (var E = this._struct.children, P = E.length; P--;) {
var k = E[P];
k.isLeaf ? this._leafSync[k.name] = !1 : this._branches[k.name].syncLoss()
}
}, r.prototype.apply = function (M) {
for (var P = this._struct.children, L = P.length; L--;) {
var i = P[L],
B = i.name;
B in M && (i.isLeaf ? this[B] = M[B] : this._branches[B].apply(M[B]))
}
}, r.prototype.append = function (s) {
var F = this._struct.childMap;
for (var Y in s) {
var f = F[Y];
f && (f.isLeaf ? this[Y] = s[Y] : this._branches[Y].append(s[Y]))
}
};
var h = K(C);
return function (f) {
var C = f._state;
return C || (f._state = C = new h(f)), C
}
}(),
Mj = function () {
function M(m, T, O, s) {
if (m) {
var g = m.length;
if (g != Z)
for (var p = 0; s > p; ++p) T[O + p] = m[p];
else m.toArray && m.toArray(T, O)
} else
for (var p = 0; s > p; ++p) T[O + p] = 0
}
function g(B, L, s) {
var g = B[0];
if (0 >= g || g > 0) return B;
var t = L * s,
a = h[t];
if (a == Z && (h[t] = new Float32Array(t)), 0 !== L) {
M(g, a, 0, s);
for (var i = 1, O = 0; i !== L; ++i) O += s, M(B[i], a, O, s)
}
return a
}
function t(u, S) {
u.uniform1f(this.addr, S)
}
function k(o, P) {
o.uniform1fv(this.addr, P)
}
function d(R, M) {
if (M.x != Z) R.uniform2f(this.addr, M.x, M.y);
else {
var X = h[2];
X.set(M, 0), R.uniform2fv(this.addr, X)
}
}
function V(u, U) {
u.uniform2fv(this.addr, g(U, this.size, 2))
}
function H(n, i) {
if (i.x != Z) n.uniform3f(this.addr, i.x, i.y, i.z);
else if (i.r != Z) n.uniform3f(this.addr, i.r, i.g, i.b);
else if (i.red != Z) n.uniform3f(this.addr, i.red, i.green, i.blue);
else {
var d = h[3];
d.set(i, 0), n.uniform3fv(this.addr, d)
}
}
function x(O, B) {
O.uniform3fv(this.addr, g(B, this.size, 3))
}
function m(L, f) {
if ("string" == typeof f && (f = ns(f)), f.x != Z) L.uniform4f(this.addr, f.x, f.y, f.z, f.w);
else if (f.r != Z) L.uniform4f(this.addr, f.r, f.g, f.b, f.a);
else if (f.red != Z) L.uniform4f(this.addr, f.red, f.green, f.blue, f.alpha);
else {
var B = h[4];
B.set(f, 0), L.uniform4fv(this.addr, B)
}
}
function b(j, N) {
j.uniform4fv(this.addr, g(N, this.size, 4))
}
function P(B, r) {
B.uniform1i(this.addr, r)
}
function T(F, R) {
F.uniform1iv(this.addr, R)
}
function Y(S, I) {
S.uniform2iv(this.addr, I)
}
function K(P, b) {
P.uniform3iv(this.addr, b)
}
function W(C, z) {
C.uniform4iv(this.addr, z)
}
function L(z, G) {
z.uniform1i(this.addr, s[G ? 1 : 0])
}
function q($, i) {
var u = h[4];
u.set(i, 0), $.uniformMatrix2fv(this.addr, !1, u)
}
function v(A, Y) {
A.uniformMatrix2fv(this.addr, !1, g(Y, this.size, 4))
}
function u(S, U) {
var y = h[9];
y.set(U, 0), S.uniformMatrix3fv(this.addr, !1, y)
}
function f(E, Z) {
E.uniformMatrix3fv(this.addr, !1, g(Z, this.size, 9))
}
function p(M, g) {
var w = h[16];
w.set(g, 0), M.uniformMatrix4fv(this.addr, !1, w)
}
function a(D, S) {
D.uniformMatrix4fv(this.addr, !1, g(S, this.size, 16))
}
function e(e, f) {
e.uniform1i(this.addr, this.slots[0]), e.activeTexture(e.TEXTURE0 + this.slots[0]), e.bindTexture(e.TEXTURE_2D, f || e._emptyTexture)
}
function A(I, W) {
I.uniform1iv(this.addr, this.slots);
for (var $ = this.slots.length; $--;) I.activeTexture(I.TEXTURE0 + this.slots[$]), I.bindTexture(I.TEXTURE_2D, W[$] || I._emptyTexture)
}
function N(P, k) {
P.uniform1i(this.addr, this.slots[0]), P.activeTexture(P.TEXTURE0 + this.slots[0]), P.bindTexture(P.TEXTURE_CUBE_MAP, k || P._emptyCubeTexture)
}
function $(F, r) {
F.uniform1iv(this.addr, this.slots);
for (var w = this.slots.length; w--;) F.activeTexture(F.TEXTURE0 + this.slots[w]), F.bindTexture(F.TEXTURE_CUBE_MAP, r[w] || F._emptyCubeTexture)
}
function C(U, J, d) {
G[U] = [J, d]
}
function z(L, A, O) {
switch (L.type) {
case 35678:
case 35680:
if ("uSampler" === O) return [0];
if ("uBlendSampler" === O) return [1];
for (var q = L.size, Q = new Int32Array(q), T = 0; q > T; ++T) Q[T] = A.usedTextureSlot++;
return Q
}
return Z
}
function R(B, s, q, e, k) {
this.name = B, this.addr = s, this.size = e ? q.size : 0, this.activeInfo = q, this.setter = G[q.type][e ? 1 : 0], this.slots = z(q, k, B), bc(this)
}
function O(G, P, H, g) {
var l = G.name,
Q = l.length;
for (X.lastIndex = 0; ;) {
var E = X.exec(l),
M = X.lastIndex,
W = E[1],
d = "]" === E[2],
S = E[3];
if (d && (W = 0 | W), S === Z || "[" === S && M + 2 === Q) {
H[W] = new R(W, P, G, S !== Z, g);
break
}
var O = H[W];
O == Z && (H[W] = O = {}), H = O
}
}
function E(j, E, A) {
this.gl = E, this._program = A, this._leaves = {}, this._branches = {}, this._struct = j
}
function D(u) {
function i(m, D) {
E.call(this, u, m, D);
for (var r = T.length; r--;) {
var n = T[r];
this._branches[n._name] = new n._type(m, D)
}
}
function Z(F, z) {
var S = F.name;
if (F.isLeaf) {
var r = y("d.setter(this.gl, v);", ["v"], ["d"], [F.desc]);
o.defineProperty(z, S, {
configurable: !1,
enumerable: !0,
get: function () {
return r
}, set: r
})
} else T.push({
_name: S,
_type: D(F)
}), o.defineProperty(z, S, {
configurable: !1,
enumerable: !0,
get: function () {
return this._branches[S]
}, set: function (J) {
this._branches[S].apply(J)
}
})
}
var T = [];
return l(i, E), u.forEach(Z, i.prototype), i
}
function c(W, N) {
for (var M = W.getProgramParameter(N, W.ACTIVE_UNIFORMS), U = {}, Z = {
usedTextureSlot: 2
}; M--;) {
var P = W.getActiveUniform(N, M),
e = P.name,
J = W.getUniformLocation(N, e);
O(P, J, U, Z)
}
var h = _j.create(U, function (Y) {
return "addr" in Y
}),
p = D(h);
return o.defineProperty(p.prototype, "textureCount", {
configurable: !1,
enumerable: !1,
writable: !1,
value: Z.usedTextureSlot
}), new p(W, N)
}
var h = [];
if ("function" == typeof Float32Array)
for (var S = 1; 17 > S; ++S) h[S] = new Float32Array(S);
var s = new Int32Array([0, 1]),
G = [];
C(Ah.FLOAT, t, k), C(Ah.FLOAT_VEC2, d, V), C(Ah.FLOAT_VEC3, H, x), C(Ah.FLOAT_VEC4, m, b), C(Ah.INT, P, T), C(Ah.INT_VEC2, Y, Y), C(Ah.INT_VEC3, K, K), C(Ah.INT_VEC4, W, W), C(Ah.BOOL, L, T), C(Ah.BOOL_VEC2, Y, Y), C(Ah.BOOL_VEC3, K, K), C(Ah.BOOL_VEC4, W, W), C(Ah.FLOAT_MAT2, q, v), C(Ah.FLOAT_MAT3, u, f), C(Ah.FLOAT_MAT4, p, a), C(Ah.SAMPLER_2D, e, A), C(Ah.SAMPLER_CUBE, N, $);
var X = /([\w\d_]+)(\])?(\[|\.)?/g;
return E.prototype.apply = function (V) {
for (var d = this._struct.children, D = d.length; D--;) {
var l = d[D],
t = l.name;
t in V && (l.isLeaf ? this[t] = V[t] : this._branches[t].apply(V[t]))
}
}, E.prototype.append = function (X) {
var e = this._struct.childMap;
for (var $ in X) {
var y = e[$];
y && (y.isLeaf ? this[$] = X[$] : this._branches[$].append(X[$]))
}
},
function (t, T) {
var o = T._uniforms;
return o || (T._uniforms = o = c(t, T)), o
}
}(),
Nb = function () {
function t(n, a, v) {
a.vertexAttrib1f(n.addr, v)
}
function k(A, l, G) {
if (G.x != Z) l.vertexAttrib2f(A.addr, G.x, G.y);
else {
var p = b[2];
p.set(G, 0), l.vertexAttrib2fv(A.addr, p)
}
}
function p(M, n, V) {
if (V.x != Z) n.vertexAttrib3f(M.addr, V.x, V.y, V.z);
else if (V.r != Z) n.vertexAttrib3f(M.addr, V.r, V.g, V.b);
else if (V.red != Z) n.vertexAttrib3f(M.addr, V.red, V.green, V.blue);
else {
var x = b[3];
x.set(V, 0), n.vertexAttrib3fv(M.addr, x)
}
}
function S(Q, g, M) {
if ("string" == typeof M && (M = ns(M)), M.x != Z) g.vertexAttrib4f(Q.addr, M.x, M.y, M.z, M.w);
else if (M.r != Z) g.vertexAttrib4f(Q.addr, M.r, M.g, M.b, M.a);
else if (M.red != Z) g.vertexAttrib4f(Q.addr, M.red, M.green, M.blue, M.alpha);
else {
var S = b[4];
S.set(M, 0), g.vertexAttrib4fv(Q.addr, S)
}
}
function Y(m, O, A) {
A = A.el || A;
for (var K = 0, x = 0; 2 > K; ++K) O.vertexAttrib2f(m.addr, A[x++], A[x++])
}
function d(m, G, n) {
n = n.el || n;
for (var O = 0, A = 0; 3 > O; ++O) G.vertexAttrib3f(m.addr, n[A++], n[A++], n[A++])
}
function x(r, l, q) {
q = q.el || q;
for (var i = 0, K = 0; 4 > i; ++i) l.vertexAttrib4f(r.addr, q[K++], q[K++], q[K++], q[K++])
}
function K(b, K, E, h, $, S, Z) {
K.bindBuffer(K.ARRAY_BUFFER, E), K.vertexAttribPointer(b.addr, 1, h || K.FLOAT, !!$, S || 0, Z || 0), K.bindBuffer(K.ARRAY_BUFFER, null)
}
function P(t, J, n, O, f, Z, C) {
J.bindBuffer(J.ARRAY_BUFFER, n), J.vertexAttribPointer(t.addr, 2, O || J.FLOAT, !!f, Z || 0, C || 0), J.bindBuffer(J.ARRAY_BUFFER, null)
}
function u(Q, g, B, Y, $, q, w) {
g.bindBuffer(g.ARRAY_BUFFER, B), g.vertexAttribPointer(Q.addr, 3, Y || g.FLOAT, !!$, q || 0, w || 0), g.bindBuffer(g.ARRAY_BUFFER, null)
}
function B(K, h, d, J, Y, n, w) {
h.bindBuffer(h.ARRAY_BUFFER, d), h.vertexAttribPointer(K.addr, 4, J || h.FLOAT, !!Y, n || 0, w || 0), h.bindBuffer(h.ARRAY_BUFFER, null)
}
function g(I, w, e, i, p, R, h) {
var R = R || 4,
h = h || 0;
w.bindBuffer(w.ARRAY_BUFFER, e), w.vertexAttribPointer(I.addr, 2, i || w.FLOAT, !!p, R, h), w.vertexAttribPointer(I.addr + 1, 2, i || w.FLOAT, !!p, R, h + 2), w.bindBuffer(w.ARRAY_BUFFER, null)
}
function $(_, k, J, g, c, B, h) {
var B = B || 9,
h = h || 0;
k.bindBuffer(k.ARRAY_BUFFER, J), k.vertexAttribPointer(_.addr, 3, g || k.FLOAT, !!c, B, h), k.vertexAttribPointer(_.addr + 1, 3, g || k.FLOAT, !!c, B, h + 3), k.vertexAttribPointer(_.addr + 2, 3, g || k.FLOAT, !!c, B, h + 6), k.bindBuffer(k.ARRAY_BUFFER, null)
}
function z(F, z, J, T, q, n, l) {
var n = n || 16,
l = l || 0;
z.bindBuffer(z.ARRAY_BUFFER, J), z.vertexAttribPointer(F.addr, 4, T || z.FLOAT, !!q, n, l), z.vertexAttribPointer(F.addr + 1, 4, T || z.FLOAT, !!q, n, l + 4), z.vertexAttribPointer(F.addr + 2, 4, T || z.FLOAT, !!q, n, l + 8), z.vertexAttribPointer(F.addr + 3, 4, T || z.FLOAT, !!q, n, l + 12), z.bindBuffer(z.ARRAY_BUFFER, null)
}
function W(i, m, C) {
M[i] = function (I, B, s, c, l, W) {
this.addr == Z || this.addr < 0 || (B == Z || B === !1 ? I.disableVertexAttribArray(this.addr) : ql(B) === R ? (I.enableVertexAttribArray(this.addr), C(this, I, B, s, c, l, W)) : (I.disableVertexAttribArray(this.addr), m(this, I, B)))
}
}
function v(c, $, g) {
this.name = c, this.addr = $, this.activeInfo = g, this.setter = M[g.type], bc(this)
}
function L(l, L, f) {
this.gl = L, this.program = f, this._branches = {}, this._struct = l
}
function E(k) {
function I(d, V) {
L.call(this, k, d, V);
for (var z = O.length; z--;) {
var t = O[z];
this._branches[t._name] = new t._type(d, V)
}
}
function T(n, h) {
var G = n.name;
if (n.isLeaf) {
var Q = y("d.setter(this.gl, v);", ["v"], ["d"], [n.desc]);
o.defineProperty(h, G, {
configurable: !1,
enumerable: !0,
get: function () {
return Q
}, set: Q
})
} else O.push({
_name: G,
_type: E(n)
}), o.defineProperty(h, G, {
configurable: !1,
enumerable: !0,
get: function () {
return this._branches[G]
}, set: function ($) {
this._branches[G].apply($)
}
})
}
var O = [];
return l(I, L), k.forEach(T, I.prototype), I
}
function h(p, F) {
for (var r = p.getProgramParameter(F, p.ACTIVE_ATTRIBUTES), g = {}; r--;) {
var h = p.getActiveAttrib(F, r),
B = h.name,
q = p.getAttribLocation(F, B);
g[B] = new v(B, q, h)
}
var o = _j.create(g, function (X) {
return "addr" in X
}),
N = E(o);
return new N(p, F)
}
var b = [];
if (Float32Array)
for (var X = 1; 17 > X; ++X) b[X] = new Float32Array(X);
var M = [],
R = "undefined" != typeof WebGLBuffer && WebGLBuffer.prototype;
return W(Ah.FLOAT, t, K), W(Ah.FLOAT_VEC2, k, P), W(Ah.FLOAT_VEC3, p, u), W(Ah.FLOAT_VEC4, S, B), W(Ah.FLOAT_MAT2, Y, g), W(Ah.FLOAT_MAT3, d, $), W(Ah.FLOAT_MAT4, x, z), L.prototype.disable = function () {
for (var $ = this._struct.children, F = $.length; F--;) {
var T = $[F],
m = T.name;
T.isLeaf ? this.gl.disableVertexAttribArray(T.desc.addr) : this._branches[m].disable()
}
}, L.prototype.apply = function (b) {
for (var l = this._struct.children, B = l.length; B--;) {
var Z = l[B],
t = Z.name;
t in b && (Z.isLeaf ? this[t] = b[t] : this._branches[t].apply(b[t]))
}
}, L.prototype.append = function (d) {
var O = this._struct.childMap;
for (var X in d) {
var G = O[X];
G && (G.isLeaf ? this[X] = d[X] : this._branches[X].append(d[X]))
}
},
function (l, u) {
var y = u._attribs;
return y || (u._attribs = y = h(l, u)), y
}
}(),
ts = function (k) {
var w = this;
o.defineProperties(this, {
gl: {
configurable: !1,
enumerable: !1,
value: k,
writable: !1
},
glState: {
configurable: !1,
enumerable: !1,
value: vd(k),
writable: !1
}
}), w._currProgram = Z, w._currUniforms = Z, w._currAttribs = Z, w._sync = !0
};
o.defineProperties(ts.prototype, {
program: {
configurable: !1,
enumerable: !1,
get: function () {
return this._currProgram
}, set: function (g) {
var S = this;
S._sync && g === S._currProgram || (S.gl.useProgram(g), S._currProgram = g, S._currUniforms = Mj(S.gl, g), S._currAttribs = Nb(S.gl, g), S._sync = !0)
}
},
uniforms: {
configurable: !1,
enumerable: !1,
get: function () {
var I = this;
return I._currProgram && !I._sync && (I.gl.useProgram(I._currProgram), I._sync = !0), I._currUniforms
}, set: function ($) {
var Q = this;
Q._currUniforms && (Q._currProgram && !Q._sync && (Q.gl.useProgram(Q._currProgram), this._sync = !0), Q._currUniforms.apply($))
}
},
attribs: {
configurable: !1,
enumerable: !1,
get: function () {
var d = this;
return d._currProgram && !d._sync && (d.gl.useProgram(d._currProgram), d._sync = !0), d._currAttribs
}, set: function (X) {
var C = this;
C._currUniforms && (C._currProgram && !C._sync && (C.gl.useProgram(C._currProgram), this._sync = !0), C._currAttribs.apply(X))
}
}
}), ts.prototype.useProgram = function (v) {
var Z = this;
Z._sync && v === Z._currProgram || (Z.gl.useProgram(v), Z._currProgram = v, Z._currUniforms = Mj(Z.gl, v), Z._currAttribs = Nb(Z.gl, v), Z._sync = !0)
}, ts.prototype.directState = function () {
return this.glState
}, ts.prototype.directUniforms = function () {
return this._currUniforms
}, ts.prototype.directAttribs = function () {
return this._currAttribs
}, ts.prototype.syncLoss = function () {
this._sync = !1, this.glState.syncLoss()
}, ts.for = function (e) {
var s = e._renderState;
return s || (e._renderState = s = new ts(e)), s
};
var Tf = "directional",
zg = "point",
Bo = "spot",
ep = "light.color",
Gc = {},
Qf = function (O, R) {
dk(R) && Gq.test(R) ? Im(O, R) : xl(R) && R.modelType ? Ti(O, R) : R === Z ? delete Zm[O] : Zm[O] = R
},
Wi = function (Y) {
return Y
},
vf = function (p) {
p = u.convertShape3dModelName(p);
var N;
if (xl(p)) {
if (p.modelType) {
if (p.uuid) {
if (N = Zm[p.uuid]) return N
} else p.uuid = O.Math.generateUUID();
return N === Z && (Wb && Wb[p.uuid] || Ti(p.uuid, p)), Z
}
return p
}
return N = Zm[p], p && N === Z && Gq.test(p) && (Wb && Wb[p] || Im(p, p)), N
},
So = function (E, X) {
E.frameStack ? E.frameStack.push(X) : E.frameStack = [X], E.bindFramebuffer(E.FRAMEBUFFER, X)
},
Ar = function (l) {
var y = l.frameStack;
if (y) {
if (y.pop(), y.length) return l.bindFramebuffer(l.FRAMEBUFFER, y[y.length - 1]), void 0;
l.frameStack = null
}
l.bindFramebuffer(l.FRAMEBUFFER, null)
};
Uh(u, {
graph3dViewAttributes: F,
graph3dViewFirstPersonMode: !1,
graph3dViewMouseRoamable: !0,
graph3dViewMoveStep: 15,
graph3dViewRotateStep: W / 60,
graph3dViewBlockSelectable: !0,
graph3dViewEditHelperDisabled: !1,
graph3dViewPannable: !0,
graph3dViewRotatable: !0,
graph3dViewWalkable: !0,
graph3dViewResettable: !0,
graph3dViewZoomable: !0,
graph3dViewRectSelectable: !0,
graph3dViewRectSelectBackground: Vh,
graph3dViewGridVisible: !1,
graph3dViewGridSize: 50,
graph3dViewGridGap: 50,
graph3dViewGridColor: [.4, .75, .85, 1],
graph3dViewRotateMaxPhi: W,
graph3dViewRotateMinPhi: 0,
graph3dViewShadowQuality: "high",
graph3dViewShadowIntensity: .3,
graph3dViewShadowBias: -.005,
graph3dViewShadowRadius: .1,
graph3dViewShadowType: "hard",
graph3dViewShadowDegreeX: 30,
graph3dViewShadowDegreeZ: -10,
graph3dViewOriginAxisVisible: !1,
graph3dViewCenterAxisVisible: !1,
graph3dViewAxisXColor: [1, 0, 0, 1],
graph3dViewAxisYColor: [0, 1, 0, 1],
graph3dViewAxisZColor: [0, 0, 1, 1],
graph3dViewEditSizeColor: [1, 1, 0, 1],
graph3dViewOrtho: !1,
graph3dViewOrthoWidth: 2e3,
graph3dViewFovy: W / 4,
graph3dViewNear: 10,
graph3dViewFar: 1e4,
graph3dViewEye: [0, 300, 1e3],
graph3dViewCenter: [0, 0, 0],
graph3dViewUp: [0, 1, -1e-7],
graph3dViewHeadlightRange: 0,
graph3dViewHeadlightColor: [1, 1, 1, 1],
graph3dViewHeadlightIntensity: 1,
graph3dViewHeadlightDisabled: !1,
graph3dViewHeadlightAmbientIntensity: .7,
graph3dViewFogDisabled: !0,
graph3dViewFogMode: "linear",
graph3dViewFogDensity: 5e-4,
graph3dViewFogColor: "white",
graph3dViewFogNear: 1,
graph3dViewFogFar: 2e3,
graph3dViewPickerResolution: .5,
graph3dViewDashDisabled: !0,
graph3dViewBatchBlendDisabled: !0,
graph3dViewBatchBrightnessDisabled: !0,
graph3dViewBatchColorDisabled: !1,
graph3dMaxVectorCacheTime: 50,
graph3dEnvmapCapabilityRequire: 8,
setShape3dModel: Qf,
getShape3dModel: vf,
convertShape3dModelName: Wi,
getShape3dModelMap: function () {
return Zm
}, getCachedShape3dModelMap: function () {
return Mq
}, createMatrix: function (r, J) {
ip(r) || (r = [r]);
for (var q = r.length - 1; q >= 0; q--) {
var e = r[q];
J = Jn(e.mat, e.s3, e.r3, e.rotationMode, e.t3, J)
}
return J
}, transformVec: function (x, h) {
return Td(x, h)
}, glBindFrame: So,
glUnbindFrame: Ar,
createBoxModel: function () {
return {
vs: Ef,
ns: mn,
uv: mi,
is: Lq
}
}, createRoundRectModel: function (S, W) {
return Gm.roundRect(S, W)
}, createStarModel: function (G, Z) {
return Gm.star(G, Z)
}, createRectModel: function (y, F) {
return Gm.rect(y, F)
}, createTriangleModel: function (f, t) {
return Gm.triangle(f, t)
}, createRightTriangleModel: function (v, e) {
return Gm.rightTriangle(v, e)
}, createParallelogramModel: function (l, e) {
return Gm.parallelogram(l, e)
}, createTrapezoidModel: function (s, J) {
return Gm.trapezoid(s, J)
}, createSmoothSphereModel: function (C, S, L, W, N, E, B) {
return ig(new To(C, S, L, W, N, E, B))
}, createSphereModel: function (P, Y, b, H, c, p, y) {
return P ? Mi(P, Y, b, H, c, p, y) : u.createSmoothSphereModel()
}, createSmoothConeModel: function ($, h, o, T, d) {
return ce($, h, o, T, d)
}, createConeModel: function (a, V, I, T, O, B) {
return a ? po(a, V, I, T, O, B) : ce(B)
}, createSmoothCylinderModel: function (Y, V, e, G, Z, M, Q, J) {
return ig(new rc(Y, V, e, G, Z, M, Q, J))
}, createCylinderModel: function (x, T, w, j, H, S, J, n) {
return x ? Qh(x, T, w, j, H, S, J, n) : mj(S, J)
}, createSmoothTorusModel: function (I, i, p, J, N, H) {
return ig(new Kg(I, i, p, J, N, H))
}, createTorusModel: function (Q, C, M, X, x, k, P, s) {
return Q ? Tc(Q, C, M, X, x, k, P, s) : Or(k, P)
}, createExtrusionModel: function (y, c, p, C, z, i, K, M) {
return zk(y, c, p, C, z, i, K, M)
}, createSmoothRingModel: function (S, P, f, p, h, U) {
for (var $ = [], n = 0; n < S.length - 1; n += 2) $.push({
x: S[n],
y: S[n + 1]
});
for (S = Yo($, P, f)[0], $ = [], n = 0; n < S.length; n++) {
var c = S[n];
$.push(new pe(c.x, 0, c.y))
}
return ig(new Zd($, U, p, h))
}, createTextGeometry: function (q, E) {
return ig(new qf(q, E))
}, loadFontFace: function (X, T) {
u.xhrLoad(X, function (A) {
if (!A) return T();
var L;
try {
L = JSON.parse(A)
} catch (P) {
L = JSON.parse(A.substring(65, A.length - 2))
}
Pk.loadFace(L), T && T(L.familyName.toLowerCase())
}, T ? null : {
sync: !0
})
}, createRingModel: function (m, v, C, U, w, Q, h, c, j, y) {
for (var x = [], J = 0; J < m.length - 1; J += 2) x.push({
x: m[J],
y: m[J + 1]
});
Q = Q || u.shapeSide, h = h || 0, c = c || Q;
var d, p, K, e, S, t, T, P, g, M, J, N, O, b, X, I, l, i, W = [],
f = [],
$ = j ? [] : F,
A = j ? [] : F,
z = y ? [] : F,
Z = y ? [] : F,
_ = U ? [] : F,
B = U ? [] : F,
E = w ? [] : F,
o = w ? [] : F,
m = Yo(x, v, C),
V = tj(m),
Y = 0,
r = 2 * Math.PI / Q;
return m.forEach(function (u) {
if (K = u.length, K > 1) {
if (e = u[0], U)
for (t = e.x, P = e.y, J = h; c > J; J++) N = J + 1, O = J * r, b = N * r, X = k(O), I = n(O), l = k(b), i = n(b), _.push(X * t, P, -I * t, l * t, P, -i * t, 0, P, 0), B.push(.5 - .5 * X, .5 - .5 * I, .5 - .5 * l, .5 - .5 * i, .5, .5);
for (M = 0; K > M; M++) {
for (S = u[M], t = e.x, T = S.x, P = e.y, g = S.y, d = Y / V, Y += En(e, S), p = Y / V, J = h; c > J; J++) N = J + 1, O = J * r, b = N * r, X = k(O), I = n(O), l = k(b), i = n(b), W.push(X * T, g, -I * T, l * T, g, -i * T, X * t, P, -I * t, l * T, g, -i * T, l * t, P, -i * t, X * t, P, -I * t), f.push(J / Q, p, N / Q, p, J / Q, d, N / Q, p, N / Q, d, J / Q, d), j && J === h && ($.push(0, P, 0, 0, g, 0, X * T, g, -I * T, X * T, g, -I * T, X * t, P, -I * t, 0, P, 0), A.push(0, .5 - P, 0, .5 - g, 2 * T, .5 - g, 2 * T, .5 - g, 2 * t, .5 - P, 0, .5 - P)), y && N === c && (z.push(0, P, 0, l * T, g, -i * T, 0, g, 0, l * T, g, -i * T, 0, P, 0, l * t, P, -i * t), Z.push(1, .5 - P, 1 - 2 * T, .5 - g, 1, .5 - g, 1 - 2 * T, .5 - g, 1, .5 - P, 1 - 2 * t, .5 - P));
e = S
}
if (w)
for (t = e.x, P = e.y, J = h; c > J; J++) N = J + 1, O = J * r, b = N * r, X = k(O), I = n(O), l = k(b), i = n(b), E.push(l * t, P, -i * t, X * t, P, -I * t, 0, P, 0), o.push(.5 - .5 * l, .5 + .5 * i, .5 - .5 * X, .5 + .5 * I, .5, .5)
}
}), {
vs: W,
uv: f,
bottom_vs: E,
bottom_uv: o,
top_vs: _,
top_uv: B,
from_vs: $,
from_uv: A,
to_vs: z,
to_uv: Z
}
}
}, !0), Uh(z, {
"3d.move.mode": Z,
"3d.selectable": !0,
"3d.visible": !0,
"3d.movable": !0,
"3d.editable": !0,
"3d.clip.direction": null,
"3d.clip.percentage": 1,
"3d.reflectable": !0,
"shape.border.gradient.color": Z,
"edge.gradient.color": Z,
"edge.source.t3": Z,
"edge.target.t3": Z,
"light.type": zg,
"light.center": [0, 0, 0],
"light.color": [1, 1, 1, 1],
"light.disabled": !1,
"light.angle": W / 4,
"light.range": 0,
"light.exponent": 1,
"light.intensity": 1,
"wf.visible": !1,
"wf.width": 1,
"wf.color": Bc,
"wf.short": !1,
"wf.mat": Z,
"wf.geometry": !1,
"wf.loadQuadWireframe": !1,
"wf.combineTriangle": !0,
batch: Z,
"transparent.mask": !1,
brightness: Z,
"select.brightness": .7,
"repeat.uv.length": Z,
"shadow.cast": !0,
"shadow.receive": !0,
bloom: !1,
envmap: 0,
renderTextureSamples: 4,
alphaTest: .4,
autorotate: !1,
fixSizeOnScreen: !1,
"texture.cache": !1,
"hide.overlapping.group": Z,
"vector.dynamic": !1,
"vector.dynamic.maxsize": 2048,
"texture.scale": 1,
"geometry.cache": !1,
"highlight.mode": !1,
"highlight.visible": !0,
"highlight.width": .8,
"highlight.color": "rgba(190, 210, 250, 1)",
"color.empty": [0, 0, 0, 0],
"label.face": wg,
"label.t3": Z,
"label.r3": Z,
"label.texture.scale": 2,
"label.rotationMode": Vn,
"label.light": !1,
"label.blend": Z,
"label.reverse.flip": !1,
"label.reverse.color": vc,
"label.reverse.cull": !1,
"label.transparent": !1,
"label.autorotate": !1,
"label2.face": wg,
"label2.t3": Z,
"label2.r3": Z,
"label2.texture.scale": 2,
"label2.rotationMode": Vn,
"label2.light": !1,
"label2.blend": Z,
"label2.reverse.flip": !1,
"label2.reverse.color": vc,
"label2.reverse.cull": !1,
"label2.transparent": !1,
"label2.autorotate": !1,
"note.face": wg,
"note.t3": Z,
"note.r3": Z,
"note.texture.scale": 2,
"note.rotationMode": Vn,
"note.light": !1,
"note.blend": Z,
"note.reverse.flip": !1,
"note.reverse.color": vc,
"note.reverse.cull": !1,
"note.transparent": !1,
"note.autorotate": !1,
"note2.face": wg,
"note2.t3": Z,
"note2.r3": Z,
"note2.texture.scale": 2,
"note2.rotationMode": Vn,
"note2.light": !1,
"note2.blend": Z,
"note2.reverse.flip": !1,
"note2.reverse.color": vc,
"note2.reverse.cull": !1,
"note2.transparent": !1,
"note2.autorotate": !1,
shape3d: Z,
"shape3d.color": Ur,
"shape3d.top.color": Z,
"shape3d.bottom.color": Z,
"shape3d.from.color": Z,
"shape3d.to.color": Z,
"shape3d.image": Z,
"shape3d.top.image": Z,
"shape3d.bottom.image": Z,
"shape3d.from.image": Z,
"shape3d.to.image": Z,
"shape3d.light": !0,
"shape3d.side": 0,
"shape3d.side.from": Z,
"shape3d.side.to": Z,
"shape3d.smooth": Z,
"shape3d.visible": !0,
"shape3d.from.visible": !0,
"shape3d.to.visible": !0,
"shape3d.top.visible": !0,
"shape3d.bottom.visible": !0,
"shape3d.torus.radius": .17,
"shape3d.resolution": 0,
"shape3d.blend": Z,
"shape3d.opacity": Z,
"shape3d.reverse.flip": !1,
"shape3d.reverse.color": vc,
"shape3d.reverse.cull": !1,
"shape3d.transparent": !1,
"shape3d.uv.offset": Z,
"shape3d.uv.scale": Z,
"shape3d.top.uv.offset": Z,
"shape3d.top.uv.scale": Z,
"shape3d.bottom.uv.offset": Z,
"shape3d.bottom.uv.scale": Z,
"shape3d.from.uv.offset": Z,
"shape3d.from.uv.scale": Z,
"shape3d.to.uv.offset": Z,
"shape3d.to.uv.scale": Z,
"shape3d.top.cap": Z,
"shape3d.bottom.cap": Z,
"shape3d.start.angle": 0,
"shape3d.sweep.angle": $,
"shape3d.point.epsilon": 1e-6,
"shape3d.discard.selectable": !0,
"shape3d.top.discard.selectable": !0,
"shape3d.bottom.discard.selectable": !0,
"shape3d.from.discard.selectable": !0,
"shape3d.to.discard.selectable": !0,
"shape3d.scaleable": !0,
"shape3d.reflector": !1,
"shape3d.reflector.color": "rgb(128,128,128)",
"shape3d.reflector.blur": 0,
"shape3d.reflector.blur.ratio": 1,
"shape3d.reflector.background": null,
"shape3d.reflector.clip": .003,
"texture.mipmap.max": Z,
"texture.filter": Z,
"texture.filter.min": Z,
"texture.filter.mag": Z,
"texture.wrap": Z,
"points.image": Z,
"points.color": "white",
"points.transparent": !1,
"points.size": 20,
"points.opacity": 1,
"all.light": !0,
"all.visible": !0,
"all.color": Ur,
"all.image": Z,
"all.blend": Z,
"all.opacity": Z,
"all.reverse.flip": !1,
"all.reverse.color": vc,
"all.reverse.cull": !1,
"all.transparent": !1,
"all.uv": Z,
"all.uv.offset": Z,
"all.uv.scale": Z,
"all.discard.selectable": !0,
mat: Z,
"left.mat": Z,
"right.mat": Z,
"top.mat": Z,
"bottom.mat": Z,
"front.mat": Z,
"back.mat": Z,
"edge.source.anchor.elevation": Z,
"edge.target.anchor.elevation": Z
}, !0);
var Gi, dp = !1,
zf = [0, 0, 0, 0],
Kc = function (E) {
return E instanceof lf
},
bk = function (R) {
return [R.x, R.e || 0, R.y]
},
Tr = function (Q, f, G) {
for (var f = ns(f || 0), E = f[0], a = f[1], r = f[2]; G--;) Q.push(E, a, r)
},
Wo = function (T, z, y) {
for (var z = ns(z || 0), S = z[0], $ = z[1], E = z[2], t = z[3]; y--;) T.push(S, $, E, t)
},
yp = function (F, a, W) {
if (a)
for (var H, N, d, _ = a[0], f = a[1], g = a[2], O = a[4], T = a[5], e = a[6], G = a[8], S = a[9], r = a[10], q = a[12], l = a[13], Y = a[14], x = W.length, w = 0, w = 0; x > w; w += 3) H = W[w], N = W[w + 1], d = W[w + 2], F.push(_ * H + O * N + G * d + q, f * H + T * N + S * d + l, g * H + e * N + r * d + Y);
else gc(F, W)
},
hh = function (F, W) {
var r = W.s("light.intensity"),
m = ns(W.s(ep)),
t = m[0],
k = m[1],
v = m[2];
1 !== r && (t *= r, k *= r, v *= r), F.push(t, k, v, W.s("light.disabled") ? 1 : 0)
},
nc = function (L, o) {
var U = ts.for(o),
$ = U.directUniforms();
$.uHeadlightRange = L._headlightRange, $.uHeadlightAmbientIntensity = L._headlightAmbientIntensity;
var W = L._headlightIntensity,
j = ns(L._headlightColor);
1 !== W && (j = [j[0] * W, j[1] * W, j[2] * W]), $.uHeadlightColor = [j[0], j[1], j[2], L._headlightDisabled ? 1 : 0];
var P = L._59O,
v = L._spots,
F = L._dirs;
if (P.length) {
var E = [],
N = [],
M = [];
P.forEach(function (t) {
hh(E, t), gc(N, L._transformPointToViewSpace(t.p3())), M.push(t.s("light.range"))
}), $.uPointColor = E, $.uPointRange = M, $.uPointPosition = N
}
if (v.length) {
var I = [],
n = [],
b = [],
c = [],
Q = [],
Z = [];
v.forEach(function (F) {
hh(I, F), gc(n, L._transformPointToViewSpace(F.p3())), gc(Q, L._transformDirectionToViewSpace(F.p3(), F.s("light.center"))), b.push(F.s("light.range")), c.push(k(F.s("light.angle") / 2)), Z.push(F.s("light.exponent"))
}), $.uSpotColor = I, $.uSpotRange = b, $.uSpotAngle = c, $.uSpotExponent = Z, $.uSpotPosition = n, $.uSpotDirection = Q
}
if (F.length) {
var H = [],
O = [];
F.forEach(function (K) {
hh(H, K), gc(O, L._transformDirectionToViewSpace(K.p3()))
}), $.uDirColor = H, $.uDirDirection = O
}
},
vg = function (s, N) {
return Math.max(s.getRotateMinPhi() + Wp, Math.min(s.getRotateMaxPhi() - Wp, N))
},
Hj = function () {
return .05 + m() / 2
},
cc = function (n, P, S, h) {
var C, A = n.getEye();
return n.isOrtho() ? (C = fn(n.getCenter(), A), C[0] += h[0], C[1] += h[1], C[2] += h[2]) : C = A, hf(P, S, h, C)
},
hf = function (x, j, p, S) {
var w = zc(x, j),
t = fn(S, p, !0),
P = zc(t, j);
if (X(P) < Wp) return F;
var b = (w - zc(p, j)) / P;
return [p[0] + t[0] * b, p[1] + t[1] * b, p[2] + t[2] * b]
},
$l = function (S, p) {
return {
x: 2 * S.x - p.x,
y: 2 * S.y - p.y
}
},
pc = function (S, U, O, u) {
var X, G;
if (!S) return X = D(U.y - O.y, O.x - U.x), {
x: U.x + u * n(X),
y: U.y + u * k(X)
};
if (!O) return X = D(S.y - U.y, U.x - S.x), {
x: U.x + u * n(X),
y: U.y + u * k(X)
};
var L = fn([S.x, S.y, 0], [U.x, U.y, 0], !0),
b = fn([O.x, O.y, 0], [U.x, U.y, 0], !0),
H = -(L[0] + b[0]) / 2,
V = -(L[1] + b[1]) / 2,
N = w(H * H + V * V);
if (Wp > N) return X = D(S.y - U.y, U.x - S.x), {
x: U.x + u * n(X),
y: U.y + u * k(X)
};
var g = S.x - U.x,
T = S.y - U.y,
x = O.x - U.x,
I = O.y - U.y,
f = w(g * g + T * T),
i = w(x * x + I * I);
X = c(zc(L, b)) / 2, G = L[1] * b[0] - L[0] * b[1] > 0 ? -1 : 1, H /= N, V /= N;
var $ = u / n(X),
l = q(f, i) / k(X);
N = Math.min($, l);
var F = {
x: U.x + G * N * H,
y: U.y + G * N * V
};
return O.b && $ > i / k(X) && (F.adjust = !0), F
},
ss = function (p) {
var O = p[1],
$ = p[2],
W = p[3],
q = p[6],
Y = p[7],
M = p[11];
p[1] = p[4], p[2] = p[8], p[3] = p[12], p[4] = O, p[6] = p[9], p[7] = p[13], p[8] = $, p[9] = q, p[11] = p[14], p[12] = W, p[13] = Y, p[14] = M
},
Od = function (G) {
var c = G[0],
R = G[1],
Z = G[2],
L = G[3],
S = G[4],
$ = G[5],
X = G[6],
q = G[7],
K = G[8],
u = G[9],
U = G[10],
P = G[11],
k = G[12],
d = G[13],
Q = G[14],
y = G[15],
V = c * $ - R * S,
o = c * X - Z * S,
m = c * q - L * S,
j = R * X - Z * $,
T = R * q - L * $,
h = Z * q - L * X,
E = K * d - u * k,
Y = K * Q - U * k,
t = K * y - P * k,
s = u * Q - U * d,
B = u * y - P * d,
p = U * y - P * Q,
_ = V * p - o * B + m * s + j * t - T * Y + h * E;
return _ ? (_ = 1 / _, G[0] = ($ * p - X * B + q * s) * _, G[1] = (Z * B - R * p - L * s) * _, G[2] = (d * h - Q * T + y * j) * _, G[3] = (U * T - u * h - P * j) * _, G[4] = (X * t - S * p - q * Y) * _, G[5] = (c * p - Z * t + L * Y) * _, G[6] = (Q * m - k * h - y * o) * _, G[7] = (K * h - U * m + P * o) * _, G[8] = (S * B - $ * t + q * E) * _, G[9] = (R * t - c * B - L * E) * _, G[10] = (k * T - d * m + y * V) * _, G[11] = (u * m - K * T - P * V) * _, G[12] = ($ * Y - S * s - X * E) * _, G[13] = (c * s - R * Y + Z * E) * _, G[14] = (d * o - k * j - Q * V) * _, G[15] = (K * j - u * o + U * V) * _, void 0) : F
},
bo = function (u, Z) {
if (Z) {
var o = Z[0],
z = Z[1],
s = Z[2];
u[12] = u[0] * o + u[4] * z + u[8] * s + u[12], u[13] = u[1] * o + u[5] * z + u[9] * s + u[13], u[14] = u[2] * o + u[6] * z + u[10] * s + u[14], u[15] = u[3] * o + u[7] * z + u[11] * s + u[15]
}
},
Bd = function (A, _) {
if (_) {
var o = _[0],
z = _[1],
O = _[2];
A[0] = A[0] * o, A[1] = A[1] * o, A[2] = A[2] * o, A[3] = A[3] * o, A[4] = A[4] * z, A[5] = A[5] * z, A[6] = A[6] * z, A[7] = A[7] * z, A[8] = A[8] * O, A[9] = A[9] * O, A[10] = A[10] * O, A[11] = A[11] * O
}
},
xo = function (l, E, N) {
var o = E[0],
O = E[1],
x = E[2],
Z = E[3],
C = E[4],
y = E[5],
r = E[6],
$ = E[7],
T = E[8],
s = E[9],
j = E[10],
b = E[11],
m = E[12],
u = E[13],
P = E[14],
Q = E[15],
W = N[0],
f = N[1],
w = N[2],
H = N[3];
return l[0] = W * o + f * C + w * T + H * m, l[1] = W * O + f * y + w * s + H * u, l[2] = W * x + f * r + w * j + H * P, l[3] = W * Z + f * $ + w * b + H * Q, W = N[4], f = N[5], w = N[6], H = N[7], l[4] = W * o + f * C + w * T + H * m, l[5] = W * O + f * y + w * s + H * u, l[6] = W * x + f * r + w * j + H * P, l[7] = W * Z + f * $ + w * b + H * Q, W = N[8], f = N[9], w = N[10], H = N[11], l[8] = W * o + f * C + w * T + H * m, l[9] = W * O + f * y + w * s + H * u, l[10] = W * x + f * r + w * j + H * P, l[11] = W * Z + f * $ + w * b + H * Q, W = N[12], f = N[13], w = N[14], H = N[15], l[12] = W * o + f * C + w * T + H * m, l[13] = W * O + f * y + w * s + H * u, l[14] = W * x + f * r + w * j + H * P, l[15] = W * Z + f * $ + w * b + H * Q, l
},
_g = function (f, L, d, r) {
var U, M, Z, m, A, G, K, T, j, D, Q = L[0],
l = L[1],
_ = L[2],
a = r[0],
F = r[1],
B = r[2],
W = d[0],
i = d[1],
y = d[2];
return X(Q - W) < Wp && X(l - i) < Wp && X(_ - y) < Wp ? yi(f) : (K = Q - W, T = l - i, j = _ - y, D = 1 / w(K * K + T * T + j * j), K *= D, T *= D, j *= D, U = F * j - B * T, M = B * K - a * j, Z = a * T - F * K, D = w(U * U + M * M + Z * Z), D ? (D = 1 / D, U *= D, M *= D, Z *= D) : (U = 0, M = 0, Z = 0), m = T * Z - j * M, A = j * U - K * Z, G = K * M - T * U, D = w(m * m + A * A + G * G), D ? (D = 1 / D, m *= D, A *= D, G *= D) : (m = 0, A = 0, G = 0), f[0] = U, f[1] = m, f[2] = K, f[3] = 0, f[4] = M, f[5] = A, f[6] = T, f[7] = 0, f[8] = Z, f[9] = G, f[10] = j, f[11] = 0, f[12] = -(U * Q + M * l + Z * _), f[13] = -(m * Q + A * l + G * _), f[14] = -(K * Q + T * l + j * _), f[15] = 1, f)
},
We = function (Y, x, L, i, j) {
var E = 1 / R(x / 2),
B = 1 / (i - j);
return Y[0] = E / L, Y[1] = 0, Y[2] = 0, Y[3] = 0, Y[4] = 0, Y[5] = E, Y[6] = 0, Y[7] = 0, Y[8] = 0, Y[9] = 0, Y[10] = (j + i) * B, Y[11] = -1, Y[12] = 0, Y[13] = 0, Y[14] = 2 * j * i * B, Y[15] = 0, Y
},
lk = function (R, w, r, l, a, K, b) {
var M = 1 / (w - r),
S = 1 / (l - a),
n = 1 / (K - b);
return R[0] = -2 * M, R[1] = 0, R[2] = 0, R[3] = 0, R[4] = 0, R[5] = -2 * S, R[6] = 0, R[7] = 0, R[8] = 0, R[9] = 0, R[10] = 2 * n, R[11] = 0, R[12] = (w + r) * M, R[13] = (a + l) * S, R[14] = (b + K) * n, R[15] = 1, R
},
_p = function (N, B) {
var l = B[0],
q = B[1],
M = B[2],
k = B[3],
Y = l * l + q * q + M * M + k * k,
Q = Y ? 1 / Y : 0;
return N[0] = -l * Q, N[1] = -q * Q, N[2] = -M * Q, N[3] = k * Q, N
},
Hg = function (r, f) {
var I = f[0] + f[5] + f[10],
Z = 0;
return I > 0 ? (Z = 2 * Math.sqrt(I + 1), r[3] = .25 * Z, r[0] = (f[6] - f[9]) / Z, r[1] = (f[8] - f[2]) / Z, r[2] = (f[1] - f[4]) / Z) : f[0] > f[5] & f[0] > f[10] ? (Z = 2 * Math.sqrt(1 + f[0] - f[5] - f[10]), r[3] = (f[6] - f[9]) / Z, r[0] = .25 * Z, r[1] = (f[1] + f[4]) / Z, r[2] = (f[8] + f[2]) / Z) : f[5] > f[10] ? (Z = 2 * Math.sqrt(1 + f[5] - f[0] - f[10]), r[3] = (f[8] - f[2]) / Z, r[0] = (f[1] + f[4]) / Z, r[1] = .25 * Z, r[2] = (f[6] + f[9]) / Z) : (Z = 2 * Math.sqrt(1 + f[10] - f[0] - f[5]), r[3] = (f[1] - f[4]) / Z, r[0] = (f[8] + f[2]) / Z, r[1] = (f[6] + f[9]) / Z, r[2] = .25 * Z), r
},
dq = function (U, H, v) {
var E = H[0],
S = H[1],
V = H[2],
r = H[3],
M = E + E,
f = S + S,
X = V + V,
C = E * M,
J = E * f,
k = E * X,
Q = S * f,
b = S * X,
d = V * X,
y = r * M,
m = r * f,
z = r * X;
return U[0] = 1 - (Q + d), U[1] = J + z, U[2] = k - m, U[3] = 0, U[4] = J - z, U[5] = 1 - (C + d), U[6] = b + y, U[7] = 0, U[8] = k + m, U[9] = b - y, U[10] = 1 - (C + Q), U[11] = 0, U[12] = v[0], U[13] = v[1], U[14] = v[2], U[15] = 1, U
},
wp = function (F, E) {
if (F.vr.enable) {
var O = F.vr.getViewMatrix(E);
if (O) return O
}
return _g(E ? E : kn(), F._eye, F._center, F._up)
},
Mc = function (d, i) {
if (d.vr.enable) {
var r = d.vr.getProjectMatrix();
if (r) return r
}
if (!i && d._computedProjectMatrix) return Ql(d._computedProjectMatrix);
var f = d.getAspect(),
n = d._near,
w = d._far,
E = kn();
if (d._ortho) {
var J = d._orthoWidth / 2,
q = J / f;
lk(E, -J, J, -q, q, n, w)
} else We(E, d._fovy, f, n, w);
return E
},
Gb = function (q, i) {
if (!q) return F;
var j = 0,
N = 1,
y = 2,
b = [],
k = 0,
_ = q.length,
o = _ / 3;
if (i) {
for (; _ > k; k++) b[k] = 0;
for (k = 0; k < i.length; k += 3) {
var e = [],
W = [],
f = [];
e[j] = q[3 * i[k + 1] + j] - q[3 * i[k] + j], e[N] = q[3 * i[k + 1] + N] - q[3 * i[k] + N], e[y] = q[3 * i[k + 1] + y] - q[3 * i[k] + y], W[j] = q[3 * i[k + 2] + j] - q[3 * i[k + 1] + j], W[N] = q[3 * i[k + 2] + N] - q[3 * i[k + 1] + N], W[y] = q[3 * i[k + 2] + y] - q[3 * i[k + 1] + y], f[j] = e[N] * W[y] - e[y] * W[N], f[N] = e[y] * W[j] - e[j] * W[y], f[y] = e[j] * W[N] - e[N] * W[j];
for (var S = 0; 3 > S; S++) b[3 * i[k + S] + j] += f[j], b[3 * i[k + S] + N] += f[N], b[3 * i[k + S] + y] += f[y]
}
} else
for (k = 0; o > k; k += 3) {
var e = [],
W = [],
f = [];
e[j] = q[3 * (k + 1) + j] - q[3 * k + j], e[N] = q[3 * (k + 1) + N] - q[3 * k + N], e[y] = q[3 * (k + 1) + y] - q[3 * k + y], W[j] = q[3 * (k + 2) + j] - q[3 * (k + 1) + j], W[N] = q[3 * (k + 2) + N] - q[3 * (k + 1) + N], W[y] = q[3 * (k + 2) + y] - q[3 * (k + 1) + y], f[j] = e[N] * W[y] - e[y] * W[N], f[N] = e[y] * W[j] - e[j] * W[y], f[y] = e[j] * W[N] - e[N] * W[j];
for (var S = 0; 3 > S; S++) b[3 * (k + S) + j] = f[j], b[3 * (k + S) + N] = f[N], b[3 * (k + S) + y] = f[y]
}
for (k = 0; _ > k; k += 3) {
var Q = [];
Q[j] = b[k + j], Q[N] = b[k + N], Q[y] = b[k + y];
var X = w(Q[j] * Q[j] + Q[N] * Q[N] + Q[y] * Q[y]);
0 === X && (X = Wp), Q[j] = Q[j] / X, Q[N] = Q[N] / X, Q[y] = Q[y] / X, b[k + j] = Q[j], b[k + N] = Q[N], b[k + y] = Q[y]
}
return new fk(b)
},
rg = function (w, b, M, x) {
if (M || (M = w.createTexture()), b) {
var r = w.TEXTURE_2D,
u = w.REPEAT,
I = w.CLAMP_TO_EDGE,
A = w.TEXTURE_MIN_FILTER;
x = x || Xn;
var V = x.minFilter || x.filter || w.LINEAR,
t = x.magFilter || x.filter || w.LINEAR;
w.activeTexture(w.TEXTURE0), an(w, M), w.texImage2D(r, 0, w.RGBA, w.RGBA, w.UNSIGNED_BYTE, b), Lr(w, w.TEXTURE_MAG_FILTER, t);
var v = b.naturalWidth || b.width,
p = b.naturalHeight || b.height;
Rc.isPOT(v) && Rc.isPOT(p) && !x.clampToEdge && !b.clampToEdge ? (Lr(w, w.TEXTURE_WRAP_S, u), Lr(w, w.TEXTURE_WRAP_T, u), Lr(w, A, V === w.NEAREST ? w.NEAREST_MIPMAP_NEAREST : w.LINEAR_MIPMAP_LINEAR), x.mipmapMaxLevel !== Z && Lr(w, w.TEXTURE_MAX_LEVEL, x.mipmapMaxLevel), w.generateMipmap(r)) : (Lr(w, w.TEXTURE_WRAP_S, I), Lr(w, w.TEXTURE_WRAP_T, I), Lr(w, A, V)), an(w, F)
}
return M
},
ze = function (j, r) {
var J = new Uint8Array(4);
return r = r || j.createTexture(), j.activeTexture(j.TEXTURE0), an(j, r), Lr(j, j.TEXTURE_MIN_FILTER, j.LINEAR), j.texImage2D(j.TEXTURE_2D, 0, j.RGBA, 1, 1, 0, j.RGBA, j.UNSIGNED_BYTE, J), r
},
Gp = function (K, W) {
var u = new Uint8Array(4);
return W = W || K.createTexture(), K.activeTexture(K.TEXTURE0), K.bindTexture(K.TEXTURE_CUBE_MAP, W), K.texParameteri(K.TEXTURE_CUBE_MAP, K.TEXTURE_MAG_FILTER, K.LINEAR), K.texParameteri(K.TEXTURE_CUBE_MAP, K.TEXTURE_MIN_FILTER, K.LINEAR), K.texImage2D(K.TEXTURE_CUBE_MAP_POSITIVE_X + 0, 0, K.RGBA, 1, 1, 0, K.RGBA, K.UNSIGNED_BYTE, u), K.texImage2D(K.TEXTURE_CUBE_MAP_POSITIVE_X + 1, 0, K.RGBA, 1, 1, 0, K.RGBA, K.UNSIGNED_BYTE, u), K.texImage2D(K.TEXTURE_CUBE_MAP_POSITIVE_X + 2, 0, K.RGBA, 1, 1, 0, K.RGBA, K.UNSIGNED_BYTE, u), K.texImage2D(K.TEXTURE_CUBE_MAP_POSITIVE_X + 3, 0, K.RGBA, 1, 1, 0, K.RGBA, K.UNSIGNED_BYTE, u), K.texImage2D(K.TEXTURE_CUBE_MAP_POSITIVE_X + 4, 0, K.RGBA, 1, 1, 0, K.RGBA, K.UNSIGNED_BYTE, u), K.texImage2D(K.TEXTURE_CUBE_MAP_POSITIVE_X + 5, 0, K.RGBA, 1, 1, 0, K.RGBA, K.UNSIGNED_BYTE, u), W
},
Vo = function (y) {
y._26I && y._prg && (y._26I.deleteProgram(y._prg), y._prg = F)
},
Pl = function (I, E, $, k) {
var Y = I.createShader($);
return I.shaderSource(Y, k), I.compileShader(Y), I.attachShader(E, Y), Y
},
el = function (A) {
return A.createBuffer()
},
an = function (f, m) {
f.bindTexture(f.TEXTURE_2D, m || f._emptyTexture)
},
Lr = function (K, E, j) {
K.texParameteri(K.TEXTURE_2D, E, j)
},
Ik = function (O, C) {
var L = ts.for(O).directState();
L.polygonOffset.enabled = !0, L.polygonOffset.value = C
},
rd = function (d) {
var L = ts.for(d).directState();
L.polygonOffset.enabled = !1
},
qe = function (n, E) {
if (E) {
var V = ts.for(n).directState();
V.color.clear = ns(E)
}
},
_k = function (k) {
var R = ts.for(k),
N = R.directUniforms(),
X = R.directAttribs();
N.uFix = !0, X.aNormal = !1
},
On = function (B) {
var o = ts.for(B),
f = o.directUniforms();
o.directAttribs(), f.uFix = !1
},
Ll = function (R, l, v, i, o, C, e, W) {
var D = ts.for(R),
I = D.directState(),
K = D.directUniforms();
R._picking || (v ? (K.uBlend = !0, K.uBlendColor = v) : K.uBlend = !1, K.uLight = i == F ? !0 : i, Bp(o) && 1 !== o && (K.uPartOpacity = o), K.uReverseFlip = C == F ? !1 : C, K.uFixPickReverseColor = e || vc), I.cullFace.enabled = W ? !0 : !1
},
ol = function (N) {
if (!N._picking) {
var v = ts.for(N),
C = v.directUniforms();
C.uPartOpacity = 1
}
},
bi = function () {
var a = [0, 0, 1, 1];
return function (i, $, T, l, Y, D, Q, r, o) {
var v = ts.for(i),
L = v.directUniforms(),
z = v.directAttribs();
return T ? (L.uTexture = !0, L.uDiscardSelectable = El(l) ? l : !0, z.aUv = Sl(i, Y, D, F, 2), o ? (L.uBlendTexture = !0, L.uBlendSampler = o) : (L.uBlendTexture = !1, L.uBlendSampler = i._emptyBlendTexture), L.uSampler = T, Q ? (a[0] = Q[0], a[1] = Q[1]) : (a[0] = 0, a[1] = 0), r ? (a[2] = r[0], a[3] = r[1]) : (a[2] = 1, a[3] = 1), L.uOffsetScale = a, void 0) : (L.uSampler = i._emptyTexture, L.uBlendSampler = i._emptyBlendTexture, void 0)
}
}(),
Jf = function (P, L, W) {
var X = ts.for(P),
M = X.directUniforms(),
s = X.directAttribs();
P.activeTexture(P.TEXTURE0), an(P, F), P.activeTexture(P.TEXTURE1), an(P, F), W && (s.aUv = !1, M.uTexture = !1, M.uSampler = P._emptyTexture, M.uBlendTexture = !1, M.uBlendSampler = P._emptyBlendTexture)
},
ck = function (L, w, B, E, g, W) {
var z = ts.for(L),
M = z.directUniforms(),
_ = z.directAttribs();
!B || Uq || Bj || L.lineWidth(B), E && !L._picking && (M.uFixPickReverseColor = E), g && (_.aPosition = Sl(L, g, W, F))
},
ie = function (e, T, V, u) {
Gi && (u = e[Gi]), e.drawArrays(u == F ? e.TRIANGLES : u, T, V);
var p = e._renderInfo;
p && (p.calls++, p.vertices += V, (u == F || u === e.TRIANGLES) && (p.faces += V / 3), u === e.LINES && (p.lines += V / 2), u === e.POINTS && (p.points += V))
},
os = function (j, R, O, S, v) {
Gi && (S = j[Gi]), j.drawElements(S == F ? j.TRIANGLES : S, O, v == F ? j.UNSIGNED_SHORT : v, R == F ? 0 : 2 * R);
var H = j._renderInfo;
H && (H.calls++, H.vertices += O, (S == F || S === j.TRIANGLES) && (H.faces += O / 3), S === j.LINES && (H.lines += O / 2), S === j.POINTS && (H.points += O))
},
bm = function (m, P, $) {
var r = m.ARRAY_BUFFER;
return m.bindBuffer(r, P), $ && m.bufferData(r, $, m.STATIC_DRAW), P
},
Sl = function ($, v, N, u, D) {
return N ? rk($, $.ARRAY_BUFFER, v, N) : bm($, v, N, u, D)
},
eo = function (L, K, X) {
var Q = L.ELEMENT_ARRAY_BUFFER;
L.bindBuffer(Q, K), X && L.bufferData(Q, X, L.STATIC_DRAW)
},
ym = function (B, U, h) {
rk(B, B.ELEMENT_ARRAY_BUFFER, U, h)
},
rk = function (f, Y, Q, U) {
var E = U._bufId;
E || (E = U._bufId = O.Math.generateIncreasingID());
var Q, b = f._bufPool;
return (Q = b[E]) && Q._buf ? f.bindBuffer(Y, Q._buf) : (Q = b[E] = {
_buf: el(f)
}, f.bindBuffer(Y, Q._buf), f.bufferData(Y, U, f.STATIC_DRAW)), Q._fid = f._renderInfo.frame, Q._buf
},
Pr = function (Z, D) {
D != F && D >= 0 && Z.enableVertexAttribArray(D)
},
Rg = function (y, P) {
P != F && P >= 0 && y.disableVertexAttribArray(P)
},
Gf = function (e, i) {
var j = e.getGL();
e._prg;
var Y = ts.for(j),
U = Y.directUniforms();
Y.directAttribs(), e._7O = e._8O.pop(), i && (U.uMVMatrix = e._7O, e._6O = i, U.uNMatrix = i)
},
Rq = function (Q, F) {
return F || (F = kn()), Vd(F, Q), Od(F), ss(F), F
},
gk = function (I, Y) {
var D = I.getGL(),
g = I._7O,
r = ts.for(D),
N = r.directUniforms();
Y ? (I._8O.push(Ql(g)), N.uMMatrix = Y, xo(g, g, Y), I._7O = g) : N.uMMatrix = Hd, N.uMVMatrix = g, N.uNMatrix = Rq(g, I._6O)
},
is = {
body: 0,
label: 1,
label2: 2,
note: 3,
note2: 4,
symbol: 5
},
wc = 10,
gm = function (f, Z, n, D, k, _) {
var Y;
if (n) {
var K = D._pickId;
K || (K = D._pickId = Z._pickIdUsed, Z._pickIdUsed += wc);
var c, y = is[k];
if (null != y) c = K + y;
else {
var t = D._pickExtraPartMap;
t || (t = D._pickExtraPartMap = {}), (c = t[k]) || (c = t[k] = Z._pickIdUsed++)
}
Z[c] || (Z[c] = {
data: D,
part: k
}), Y = rl(c)
} else Y = zf; if (!_) {
var h = ts.for(f),
u = h.directUniforms();
u.uFixPickReverseColor = Y
}
return Y
},
Hb = function (_, x, J) {
"target" !== J && (J = "source");
var y = "target" === J ? x.getTargetAgent() : x.getSourceAgent(),
N = "edge." + J + ".";
if (Fq(y)) {
var B = x.s(N + "anchor.x"),
G = x.s(N + "anchor.elevation"),
M = x.s(N + "anchor.y"),
S = sj(y, _.getMat(y)),
v = y.getAnchor3d();
return Td([(B === Z ? .5 : B) - v.x, (G === Z ? .5 : G) - v.y, (M === Z ? .5 : M) - v.z], S)
}
var R = x.s(N + "index"),
m = _.getData3dUI(y);
if (!m.info || !m.info.list) return !1;
if (R >= 0) {
var q, b, W, p, h, T = m.info._lastPointsSegments,
L = T.points,
o = T.segments,
c = -1,
Q = -1;
for (W = 0, p = o ? o.length : L.length; p > W; W++) {
if (b = o ? o.get(W) : 1, 3 === b) h = 2;
else if (4 === b) h = 3;
else {
if (5 === b) continue;
h = 1
} if (c += h, Q++, Q === R) {
q = L.get(c);
break
}
}
return q || (q = L.get(L.length - 1)), [q.x, q.e || 0, q.y]
}
var K = x.s(N + "percent") || .5;
if (K = Math.max(0, Math.min(K, 1)), !m || !m.getCache) return !1;
var w = m.getCache(),
p = w[w.length - 1].length,
T = _.getLineOffset(y, K * p),
t = T.point;
return [t.x, t.y, t.z]
},
Ep = function () {
var T = {
center: function (U, E, y, B, e) {
var f = -E[1] / 2,
x = {
x: -E[0] / 2,
y: f,
width: E[0],
height: E[1]
},
u = Re(U, x, y);
return [u.x + B, -u.y - e, Hj()]
}, front: function (n, S, C, h, y) {
var d = -S[1] / 2,
f = {
x: -S[0] / 2,
y: d,
width: S[0],
height: S[1]
},
m = Re(n, f, C);
return [m.x + h, -m.y - y, S[2] / 2 + Hj()]
}, back: function (m, T, f, X, p) {
var K = -T[0] / 2,
k = -T[1] / 2,
x = {
x: K,
y: k,
width: T[0],
height: T[1]
},
r = Re(m, x, f);
return [-r.x - X, -r.y - p, -T[2] / 2 - Hj()]
}, left: function (y, U, H, o, W) {
var B = -U[1] / 2,
E = {
x: -U[2] / 2,
y: B,
width: U[2],
height: U[1]
},
l = Re(y, E, H);
return [-U[0] / 2 - Hj(), -l.y - W, l.x + o]
}, right: function (z, d, T, e, R) {
var B = -d[2] / 2,
K = -d[1] / 2,
o = {
x: B,
y: K,
width: d[2],
height: d[1]
},
J = Re(z, o, T);
return [d[0] / 2 + Hj(), -J.y - R, -J.x - e]
}, top: function (H, P, V, E, h) {
var o = {
x: -P[0] / 2,
y: -P[2] / 2,
width: P[0],
height: P[2]
},
W = Re(H, o, V);
return [W.x + E, P[1] / 2 + Hj(), W.y + h]
}, bottom: function (u, y, l, e, L) {
var P = -y[2] / 2,
Z = {
x: -y[0] / 2,
y: P,
width: y[0],
height: y[2]
},
M = Re(u, Z, l);
return [M.x + e, -y[1] / 2 - Hj(), -M.y - L]
}
};
return function (w, E, K, b, m, l) {
return T[b](w, E, K, m || 0, l || 0)
}
}(),
Te = function (v, P, z, K, t, d, H, D, S, J) {
if (t && (P[0] += t[0], P[1] += t[1], P[2] += t[2]), bo(v, z), D) {
var b = kn();
if (Cl(b, S, J), Td(P, b), bo(v, P), v.auto = D, v.pos = Td([0, 0, 0], v), d) {
var E = v.mat2 = kn();
Cl(E, d, H)
}
} else Cl(v, S, J), bo(v, P), K === nq ? ah(v, -N) : K === fm ? ah(v, N) : K === $c ? uh(v, -N) : K === Kd ? uh(v, N) : K === Qq && ah(v, W), Cl(v, d, H);
return v
},
yn = function ($, s) {
var J = s.auto,
z = s.mat2,
E = $.gv;
if (J) {
var t, o = kn(),
W = [0, 0, 0, 0];
t = "string" == typeof J ? [J.indexOf("x") < 0 ? E._eye[0] : E._center[0], J.indexOf("y") < 0 ? E._eye[1] : E._center[1], J.indexOf("z") < 0 ? E._eye[2] : E._center[2]] : E._eye, Hg(W, _g(kn(), t, E._center, E._up)), dq(o, _p(W, W), s.pos), z && xo(o, o, z), gk(E, o)
} else gk(E, s)
},
ud = function (c, D, C, t, O) {
var A = c.s,
X = c.gv,
Z = X.getGL(),
P = X._prg,
I = X._buffer,
Y = X._1O,
E = ts.for(Z),
y = E.directAttribs();
rg(Z, xm, Y), yn(c, C), Ll(Z, P, A(D + ".blend"), A(D + ".light"), A(D + ".opacity"), A(D + ".reverse.flip"), A(D + ".reverse.color"), A(D + ".reverse.cull")), bi(Z, P, Y, O, I.uv, Vj), y.aPosition = Sl(Z, I.vs, t, F), y.aNormal = Sl(Z, I.ns, Lh, F), ym(Z, I.is, ar), os(Z, 0, ar.length), Jf(Z, P, Y), ol(Z, P), Gf(X)
},
_e = function (p, E, F) {
var V = p.gv,
K = p.data,
h = p[E] = {
blend: V.getBodyColor(K) || V.getFaceBlend(K, E),
light: V.getFaceLight(K, E),
color: V.getFaceColor(K, E),
opacity: V.getFaceOpacity(K, E),
transparent: V.getFaceTransparent(K, E),
reverseFlip: V.getFaceReverseFlip(K, E),
reverseColor: V.getFaceReverseColor(K, E),
reverseCull: V.getFaceReverseCull(K, E),
texture: V.getFaceImage(K, E),
blendTexture: V.getFaceBlendImage(K, E),
discardSelectable: V.getFaceDiscardSelectable(K, E)
};
if ("csg" !== E) {
h.uv = V.getFaceUv(K, E) || F && F[E + "Uv"], h.uvScale = V.getFaceUvScale(K, E) || F && F[E + "UvScale"], h.uvOffset = V.getFaceUvOffset(K, E) || F && F[E + "UvOffset"];
var z = V.getFaceMat(K, E);
if (z) {
var D = sj(K, z);
K.appendAnchorMatrix3d(D), h.mat = D
}
}
return h
},
io = function (E, h, N, T, j) {
var W = E[T];
if (W) {
if (!j(W.transparent)) return;
var R = E.data,
w = E.gv,
U = w._buffer,
O = w.getTexture(W.texture, R, T),
d = w.getTexture(W.blendTexture, R),
u = ts.for(h),
K = u.directUniforms(),
f = u.directAttribs();
bi(h, N, O, W.discardSelectable, U.uv, W.tuv, W.uvOffset, W.uvScale, d), Ll(h, N, W.blend, W.light, W.opacity, W.reverseFlip, W.reverseColor, W.reverseCull), W.cs && !w._batchColorDisabled ? (K.uBatchColor = !0, f.aBatchColor = Sl(h, U.batchColor, W.cs, N.aBatchColor, 4)) : K.uDiffuse = W.color || z["color.empty"], f.aPosition = Sl(h, U.vs, W.vs, F), f.aNormal = Sl(h, U.ns, W.ns, F), ie(h, 0, W.vs.length / 3), W.cs && !w._batchColorDisabled && (K.uBatchColor = !1, Rg(h, N.aBatchColor)), ol(h, N), Jf(h, N, O)
}
},
$p = function (o, p, h) {
ip(o) ? o.forEach(function (N) {
$p(N, p, h)
}) : dk(o) ? $p(bf(p, o), p, h) : xl(o) ? o.shape3d ? $p(o.shape3d, p, h) : h.push(o) : h.push(o)
},
mb = function (s, m, t, G, H, S) {
var Z, J, V, b, y, Y, I, E, h, i, x, W = [G - m, H - t],
Q = s ? s.length : 0;
for (V = 0; Q > V; V++) {
for (b = 2, Z = s[V], y = Z[0], Y = Z[1]; b + 1 < Z.length;) {
if (I = Z[b], E = Z[b + 1], J = ti(m, t, G, H, y, Y, I, E, !0)) {
h = [I - y, E - Y], i = En(h), h[0] /= i, h[1] /= i, i = zc(W, h), i = i > 0 ? S : -S, x = [h[0] * i, h[1] * i];
break
}
y = I, Y = E, b += 2
}
if (x) break
}
if (x)
for (G = m + x[0], H = t + x[1], V = 0; Q > V; V++)
for (b = 2, Z = s[V], y = Z[0], Y = Z[1]; b + 1 < Z.length;) {
if (I = Z[b], E = Z[b + 1], J = ti(m, t, G, H, y, Y, I, E, !0)) return [0, 0];
y = I, Y = E, b += 2
}
return x ? x : [G - m, H - t]
},
Mm = function (V) {
return "nearest" === V ? Ah.NEAREST : "linear" === V ? Ah.LINEAR : V
},
Eh = O.graph3d = {},
Dn = function (W, T, z) {
yc(Y + ".graph3d." + W, T, z)
},
//修改加密
Ae = "~!opjujtpQ`mh!gjeof$!<*1/2!-opjujtpQb)5dfw!+!yjsubNNv!+!yjsubNxpebit!>!esppDxpebit!QBNXPEBIT`FTV!gfegj$!!gjeof$!~!fdobutjEfojMw|*itbEv)gj!ITBE!gfegj$!!gjeof$!~!ttfouihjsCidubCw|*ttfouihjsCidubCv)gj!TTFOUIHJSCIDUBC!gfegj$!!gjeof$!~!eofmCidubCw|*eofmCidubCv)gj!EOFMCIDUBC!gfegj$!!gjeof$!~!spmpDidubCw|*spmpDidubCv)gj!SPMPDIDUBC!gfegj$!~!wVs|*fsvuyfUeofmCv)gj~!wVw|*fsvuyfUv)gj<*opjujtpQb)4dfw!>!opjujtpQw~<**1/2!-opjujtpQb)5dfw!+!yjsubNNv)4dfw!>!emspXw<*yfusfw)4dfw!>!yfusfWw<**1/2!-mbnspOb)5dfw!+!yjsubNOv)4dfw!>!mbnspOw|*ldjQva!%%!yjGva)gj<*1/2!-opjujtpQb)5dfw!+!yjsubNWNv!>!yfusfw!5dfw|!*ejpw)ojbn!ejpw!gjeof$! p; p += 6) Z = En([D[p], D[p + 1], D[p + 2]], [D[p + 3], D[p + 4], D[p + 5]]), v.push(Z), d += Z;
if (d && e) {
var P, r = yg(ns(e), H),
m = [r[0] - L[0], r[1] - L[1], r[2] - L[2], r[3] - L[3]],
j = 0;
for (p = 0; g > p; p += 6) P = j / d, Wo(V, [L[0] + m[0] * P, L[1] + m[1] * P, L[2] + m[2] * P, L[3] + m[3] * P], 1), j += v[p / 6], P = j / d, Wo(V, [L[0] + m[0] * P, L[1] + m[1] * P, L[2] + m[2] * P, L[3] + m[3] * P], 1)
} else Wo(V, L, l); if (s)
for (j = M || 0, p = 0; g > p; p += 6) u.push(j), j += v[p / 6], u.push(j)
},
Ic = function (Y, x, h) {
if (x) {
var M = 4 * x.begin,
L = h[x.batch].ps;
if (L[M] !== Y[0] || L[M + 1] !== Y[1] || L[M + 2] !== Y[2] || L[M + 3] !== Y[3]) {
for (var J = 0; J < x.size; J++) L[M++] = Y[0], L[M++] = Y[1], L[M++] = Y[2], L[M++] = Y[3];
L._invalidateThisFrame = !0
}
}
},
Tj = function (E, C) {
var u = C + ["32"],
x = E[C],
P = E[u];
x ? P && P.length === x.length ? (P.set(x), P._bufId = null) : E[u] = new fk(x) : delete E[u]
},
km = function (s, O, Q, E, M, B, Y, D, o) {
if (ip(Q)) Q.forEach(function (v) {
km(s, O, v, E, M, B, Y, D, o)
});
else if (dk(Q)) km(s, O, bf(E, Q), E, M, B, Y, D, o);
else if (xl(Q)) {
var h, b = Dj(Q.mat, O, s),
v = Dj(Q.s3, O, s),
x = Dj(Q.t3, O, s),
C = Dj(Q.r3, O, s);
if ((v || C || x || b) && (h = Jn(b, v, C, Dj(Q.rotationMode, O, s), x), B.push(h)), Q.shape3d) km(s, O, Q.shape3d, E, M, B, Y, D, Q);
else {
var t = E.s;
o = o || Xn;
var T = B[0],
p = B.length,
c = t("shape3d.color", Q.color, o.color);
if (M || (M = t("shape3d.blend", Q.blend, o.blend)), p > 1) {
T = Ql(T);
for (var f = 1; p > f; f++) xo(T, T, B[f])
}
Q.vs && t(lm, Q.visible, o.visible) && Ak(T, Y, D, Q.vs, Q.uv, Q.is, M, c), Q.top_vs && t(Je, Q.topVisible, o.topVisible) && Ak(T, Y, D, Q.top_vs, Q.top_uv, Q.top_is, M, t("shape3d.top.color", Q.topColor, o.topColor) || c), Q.bottom_vs && t(Ho, Q.bottomVisible, o.bottomVisible) && Ak(T, Y, D, Q.bottom_vs, Q.bottom_uv, Q.bottom_is, M, t("shape3d.bottom.color", Q.bottomColor, o.bottomColor) || c), Q.from_vs && t(Rb, Q.fromVisible, o.fromVisible) && Ak(T, Y, D, Q.from_vs, Q.from_uv, Q.from_is, M, t("shape3d.from.color", Q.fromColor, o.fromColor) || c), Q.to_vs && t(xh, Q.toVisible, o.toVisible) && Ak(T, Y, D, Q.to_vs, Q.to_uv, Q.to_is, M, t("shape3d.to.color", Q.toColor, o.toColor) || c)
}
h && B.pop()
}
},
Ak = function (H, c, n, p, d, e, _, r) {
var P, l = c.cs,
W = c.uv,
a = c.bs;
if (e) {
P = e.length;
for (var U = 0; P > U; U++) {
var i = e[U];
yp(n, H, [p[3 * i], p[3 * i + 1], p[3 * i + 2]]), W && gc(W, [d[2 * i], d[2 * i + 1]])
}
} else P = p.length / 3, yp(n, H, p), W && gc(W, d);
l && Wo(l, r, P), a && (_ ? Tr(a, _, P) : gc(a, Qm, P))
},
Mp = function (A, $, F, _) {
var Q = [];
_ ? km(A.gv, A.data, _, A, A.getBodyColor(), [$], F, Q) : (_q(A, nq, $, F, Q), _q(A, fm, $, F, Q), _q(A, wg, $, F, Q), _q(A, Qq, $, F, Q), _q(A, $c, $, F, Q), _q(A, Kd, $, F, Q), _q(A, "csg", $, F, Q)), Q.length && (gc(F.vs, Q), gc(F.ns, Gb(Q)))
},
_q = function (O, y, E, r, D) {
var d = O[y];
if (d) {
var Q = d.tuv;
if (Q) {
var T, I, f, s, p = d.uvScale,
z = d.uvOffset;
if (p)
for (T = Q.length, I = p[0], f = p[1], s = 0; T > s; s += 2) Q[s] *= I, Q[s + 1] *= f;
if (z)
for (T = Q.length, I = z[0], f = z[1], s = 0; T > s; s += 2) Q[s] += I, Q[s + 1] += f
}
Ak(E, r, D, d.vs, Q, F, d.blend, d.color)
}
},
Li = function (J, z, C, b, y, S, T, F) {
var v, A = C.cs,
p = C.uv,
E = C.bs;
if (J.getFaceVisible(z, S)) {
var R = J.getFaceMat(z, S);
if (R && (y = sj(z, R)), yp(T, y, F), A && Wo(A, J.getFaceColor(z, S), 6), p) {
var k = J.getFaceUv(z, S) || b[S + "Uv"],
f = J.getFaceUvScale(z, S) || b[S + "UvScale"],
V = J.getFaceUvOffset(z, S) || b[S + "UvOffset"];
k = k ? [k[6], k[7], k[0], k[1], k[2], k[3], k[2], k[3], k[4], k[5], k[6], k[7]] : xd;
var Q = k[0],
Y = k[1],
u = k[2],
O = k[3],
W = k[4],
G = k[5],
K = k[6],
l = k[7],
d = k[8],
$ = k[9],
H = k[10],
w = k[11];
if (f) {
var m = f[0],
o = f[1];
Q *= m, Y *= o, u *= m, O *= o, W *= m, G *= o, K *= m, l *= o, d *= m, $ *= o, H *= m, w *= o
}
if (V) {
var s = V[0],
x = V[1];
Q += s, Y += x, u += s, O += x, W += s, G += x, K += s, l += x, d += s, $ += x, H += s, w += x
}
p.push(Q, Y, u, O, W, G, K, l, d, $, H, w)
}
E && (v = J.getBodyColor(z) || J.getFaceBlend(z, S), v ? Tr(E, v, 6) : gc(E, Qm, 6))
}
},
Eb = function (X, W, E, u) {
var E = X._picking ? X.pickColorMap : null,
t = X.getGL(),
G = X._prg,
h = X._buffer;
if (!wd(W)) {
gk(X, Nj), _k(t, G);
for (var x in W) {
var k = W[x];
if (!(u && !k.T || !u && k.T)) {
k.invalidate ? (k.invalidate = !1, Tj(k, "vs"), Tj(k, "cs"), Tj(k, "ls"), Tj(k, "ps")) : E && k.ps && k.ps._invalidateThisFrame && (k.ps._invalidateThisFrame = !1, Tj(k, "ps"));
var $ = k.vs32,
r = E ? k.ps32 : k.cs32;
ck(t, G, k.W, F, h.vs, $);
var Y = ts.for(t),
C = Y.directUniforms(),
j = Y.directAttribs(),
d = k.D,
o = !X._dashDisabled && d;
C.uAlphaTest = z.alphaTest, t._blooming && !k.B && (C.blackout = !0), o && (C.uDash = !0, C.uDashDistance = d, C.uDashGapDistance = k.G, C.uDiffuse = k.A || z["color.empty"], j.aLineDistance = Sl(t, h.lineDistance, k.ls32, F, 1));
var D = !X._batchColorDisabled;
D && r.length ? (C.uBatchColor = !0, j.aBatchColor = Sl(t, h.batchColor, r, F, 4)) : (C.uBatchColor = !1, j.aBatchColor = !1), bi(t), ie(t, 0, $.length / 3, t.LINES), Jf(t), D && (C.uBatchColor = !1, j.aBatchColor = !1), o && (C.uDash = !1, j.aLineDistance = !1), t._blooming && !k.B && (C.blackout = !1)
}
}
On(t, G), Gf(X)
}
},
Zn = function (x, g, Y, $, I) {
var e, h, k, N, y, O, c, n, d, r, t, Y = x._picking ? x.pickColorMap : null,
D = x.getGL(),
E = x._prg,
H = ts.for(D),
G = H.directUniforms(),
X = H.directAttribs(),
P = x._buffer;
if (!wd(g) && !x.drawFilter) {
gk(x, Nj);
for (e in g)
if (h = x.getBatchInfo(e) || Xn, h.visible !== !1 && !($ && !h.transparent || !$ && h.transparent || x.isReflecting(D) && h.reflectable === !1)) {
var V = h.renderLayerMask;
if (V == F && (V = pb), I == F && (I = pb), Sr(I, V) && (k = g[e], Y || !h.transparentMask)) {
var q = $ && h.autoSort === !0 && (x._33Q || k.invalidate);
if (k.invalidate ? (k.invalidate = !1, Tj(k, "vs"), Tj(k, "ns"), Tj(k, "cs"), Tj(k, "rs"), Tj(k, "ps"), Tj(k, "bs"), Tj(k, "uv")) : Y && k.ps && k.ps._invalidateThisFrame && (k.ps._invalidateThisFrame = !1, Tj(k, "ps")), y = k.vs32, O = Y ? k.ps32 : k.cs32, d = k.uv32, c = k.bs32, n = k.rs32, t = y.length / 3, q) {
var p = le(y, x.getEye(), x);
p ? (k.is = p.is, k.elementTypeUint = p.useUint32) : (k.is = null, k.elementTypeUint = null)
}
if (t) {
N = h.light, r = x.getTexture(h.image), Ll(D, E, F, h.light, h.opacity, h.reverseFlip, h.reverseColor, h.reverseCull), O ? x._batchColorDisabled ? (G.uBatchColor = !1, X.aBatchColor = !1) : (G.uBatchColor = !0, X.aBatchColor = Sl(D, P.batchColor, O, F, 4)) : (G.uBatchColor = !1, G.uDiffuse = h.color || z["color.empty"]);
var B = h.alphaTest;
G.uAlphaTest = B === Z ? z.alphaTest : B, D._blooming && !h.bloom && (G.blackout = !0), h.envmap !== Z ? (G.uUseEnvMap = !0, G.uReflectivity = h.envmap) : (G.uUseEnvMap = !1, G.uReflectivity = 0);
var U = c && !x._batchBlendDisabled;
U && (G.uBatchBlend = !0, X.aBatchBlend = Sl(D, P.batchBlend, c, F));
var T = n && !x._batchBrightnessDisabled;
T && (G.uBatchBrightness = !0, X.aBatchBrightness = Sl(D, P.batchBrightness, n, F, 1)), d ? bi(D, E, r, h.discardSelectable, P.uv, d, h.uvOffset, h.uvScale) : bi(D), X.aPosition = Sl(D, P.vs, y, F), X.aNormal = Sl(D, P.ns, k.ns32, F), k.is ? (eo(D, P.is, k.is), os(D, 0, t, null, k.elementTypeUint ? D.UNSIGNED_INT : null)) : ie(D, 0, t), d ? Jf(D, E, r) : Jf(D), O && !x._batchColorDisabled && (G.uBatchColor = !1, X.aBatchColor = !1), U && (G.uBatchBlend = !1, X.aBatchBlend = !1), T && (G.uBatchBrightness = !1, X.aBatchBrightness = !1), D._blooming && !h.bloom && (G.blackout = !1), ol(D, E)
}
}
}
Gf(x)
}
},
le = function (d, q, b) {
var m = d.length / 3,
h = m > 65535,
v = b._glCapabilities.elementTypeUint && h;
if (!v && h) return null;
for (var L = new Array(m), S = m / 3, A = new Array(S), T = 0; S > T; T++) A[T] = T;
A.sort(function (f, x) {
var c = 9 * f,
n = [(d[c] + d[c + 3] + 2 * d[c + 6]) / 4, (d[c + 1] + d[c + 4] + 2 * d[c + 7]) / 4, (d[c + 2] + d[c + 5] + 2 * d[c + 8]) / 4];
c = 9 * x;
var W = [(d[c] + d[c + 3] + 2 * d[c + 6]) / 4, (d[c + 1] + d[c + 4] + 2 * d[c + 7]) / 4, (d[c + 2] + d[c + 5] + 2 * d[c + 8]) / 4],
R = En(q, n) - En(q, W);
return R > 0 ? -1 : 0 > R ? 1 : 0
});
for (var T = 0; S > T; T++) {
var j = 3 * T,
o = 3 * A[T];
L[j] = o, L[j + 1] = o + 1, L[j + 2] = o + 2
}
return {
useUint32: v,
is: v ? new Uint32Array(L) : new $m(L)
}
},
Jh = {
obj: function (b, O) {
var x = {
mat: b.mat,
s3: b.s3,
r3: b.r3,
rotationMode: b.rotationMode,
t3: b.t3,
cube: b.cube == F ? !0 : b.cube,
center: b.center == F ? !0 : b.center,
ignoreMtls: b.ignoreMtls,
ignoreTransparent: b.ignoreTransparent,
ignoreColor: b.ignoreColor,
ignoreImage: b.ignoreImage,
ignoreNormal: b.ignoreNormal,
prefix: b.prefix,
flipY: b.flipY,
flipFace: b.flipFace,
reverseFlipMtls: b.reverseFlipMtls,
finishFunc: function (i, n) {
if (i) {
var n = [];
for (var s in i) {
var o = i[s];
n.rawS3 = o.rawS3, o.center && (n.center = o.center), n.push(o), b.eachModel && b.eachModel(s, o)
}
n.json = b, O(n)
} else O()
}
};
u.loadObj(b.obj, b.mtl, x)
}, bin: function (m, f) {
var d = {
finishFunc: function (M) {
M ? f(M) : f()
}
};
u.loadBin(m.url, d)
}
};
u.getModelTypeHandlers = function () {
return Jh
}, u.setModelTypeHandler = function (G, A) {
Jh[G] = A
}, u.getModelTypeHandler = function (A) {
return Jh[A]
}, u.handleModelLoaded = function () { }, u.handleUnfoundModel = function () { };
var Wb = F,
pp = F,
Yi = function (T) {
Wb && !T._loadingModelView_ && (pp || (pp = {}), pp[T._loadingModelView_ = xp()] = T)
},
Im = function (X, g) {
Wb || (Wb = {});
var l = Wb[X];
if (l) {
if (l.url === g) return;
l.request.onload = Mr, l.request.onerror = Mr
}
if (g.indexOf(".bin") === g.length - 4) return Ti(X, {
modelType: "bin",
url: g
}, g);
if (g = u.beforeLoadURL(g), g.data) {
var v = u.parse(g.data);
Ti(X, v, g)
} else {
var O = new De;
Wb[X] = {
request: O,
url: g
}, O.onload = function () {
if (200 === this.status || 0 === this.status) {
delete Wb[X];
var t = u.parse(O.getResponseText());
Ti(X, t, g)
} else Hr(X, u.handleUnfoundModel(X, g) || F)
}, O.onerror = function () {
Hr(X, u.handleUnfoundModel(X, g) || F)
};
var Q = {};
Q.url = encodeURI(g), Q.sync = !1, O.send(Q)
}
},
Ti = function (X, Y, H) {
var o = Y.modelType;
if (!o) return Hr(X, Y), u.handleModelLoaded(X, Y), void 0;
var B = u.getModelTypeHandler(o);
if (B) {
if (Wb || (Wb = {}), Wb[X]) return;
Wb[X] = !0;
var R = function (l) {
l ? (Hr(X, l), u.handleModelLoaded(X, l)) : Hr(X, u.handleUnfoundModel(X, H, Y) || F)
};
B(Y, R)
} else Hr(X, u.handleUnfoundModel(X, H, Y) || F)
},
Hr = function (y, I) {
if (delete Wb[y], dk(I) && Gq.test(I)) return Im(y, I), void 0;
if (Zm[y] = I, wd(Wb) && (Wb = F, pp)) {
for (var T in pp) {
var p = pp[T];
p.invalidateAll && p.invalidateAll(Z, "modelLoaded", y), p.redraw && p.redraw(), p.iv(), delete p._loadingModelView_
}
pp = F
}
if (I && pp)
for (var T in pp) {
var p = pp[T];
p.invalidateAll && p.invalidateAll(Z, "modelLoading", y), p.redraw && p.redraw(), p.iv()
}
},
Vj = new fk([0, 0, 0, 1, 1, 1, 1, 0]),
Lh = new fk([0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1]),
ar = new $m([0, 1, 2, 2, 3, 0]),
Ef = new fk([-.5, .5, -.5, -.5, -.5, -.5, -.5, -.5, .5, -.5, .5, .5, -.5, .5, .5, -.5, -.5, .5, .5, -.5, .5, .5, .5, .5, .5, .5, .5, .5, -.5, .5, .5, -.5, -.5, .5, .5, -.5, .5, .5, -.5, .5, -.5, -.5, -.5, -.5, -.5, -.5, .5, -.5, -.5, .5, -.5, -.5, .5, .5, .5, .5, .5, .5, .5, -.5, -.5, -.5, .5, -.5, -.5, -.5, .5, -.5, -.5, .5, -.5, .5]),
Lq = new $m([0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23]),
mi = new fk([0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0]),
mn = Gb(Ef, Lq),
Rh = (new fk([-.5, .5, .5, -.5, -.5, .5, .5, -.5, .5, .5, .5, .5, .5, -.5, -.5, .5, .5, -.5, -.5, -.5, -.5, -.5, .5, -.5]), new $m([0, 1, 2, 3, 0, 7, 5, 4, 6, 7, 5, 3, 2, 4, 6, 1]), [nq, wg, fm, Qq, $c, Kd]),
sl = [-.5, .5, .5, -.5, -.5, .5, -.5, -.5, .5, .5, -.5, .5, .5, -.5, .5, .5, .5, .5, .5, .5, .5, -.5, .5, .5, -.5, .5, -.5, -.5, -.5, -.5, -.5, -.5, -.5, .5, -.5, -.5, .5, -.5, -.5, .5, .5, -.5, .5, .5, -.5, -.5, .5, -.5, .5, .5, .5, .5, .5, -.5, .5, -.5, .5, .5, -.5, -.5, -.5, .5, .5, -.5, .5, -.5, -.5, -.5, .5, -.5, -.5, -.5],
yq = [-.5, .5, .5, -.4, .5, .5, -.5, .5, .5, -.5, .4, .5, -.5, .5, .5, -.5, .5, .4, .5, .5, .5, .4, .5, .5, .5, .5, .5, .5, .4, .5, .5, .5, .5, .5, .5, .4, -.5, -.5, .5, -.4, -.5, .5, -.5, -.5, .5, -.5, -.4, .5, -.5, -.5, .5, -.5, -.5, .4, .5, -.5, .5, .4, -.5, .5, .5, -.5, .5, .5, -.4, .5, .5, -.5, .5, .5, -.5, .4, -.5, .5, -.5, -.4, .5, -.5, -.5, .5, -.5, -.5, .4, -.5, -.5, .5, -.5, -.5, .5, -.4, .5, .5, -.5, .4, .5, -.5, .5, .5, -.5, .5, .4, -.5, .5, .5, -.5, .5, .5, -.4, -.5, -.5, -.5, -.4, -.5, -.5, -.5, -.5, -.5, -.5, -.4, -.5, -.5, -.5, -.5, -.5, -.5, -.4, .5, -.5, -.5, .4, -.5, -.5, .5, -.5, -.5, .5, -.4, -.5, .5, -.5, -.5, .5, -.5, -.4],
Mi = function (H, C, s, j, c, d, F) {
d = d || 16, H = H || 16, C = C || 0, s = s || H;
var h, D, m, N, l, _, A, t, S, i = .5,
E = [],
y = [],
O = $ / H,
R = W / d;
for (h = 0; d > h; h++)
for (_ = h + 1, N = h * R, S = _ * R, D = C; s > D; D++) A = D + 1, m = D * O, t = A * O, E.push(i * n(N) * k(m), i * k(N), -i * n(N) * n(m), i * n(S) * k(t), i * k(S), -i * n(S) * n(t), i * n(N) * k(t), i * k(N), -i * n(N) * n(t), i * n(N) * k(m), i * k(N), -i * n(N) * n(m), i * n(S) * k(m), i * k(S), -i * n(S) * n(m), i * n(S) * k(t), i * k(S), -i * n(S) * n(t)), y.push(D / H, h / d, A / H, _ / d, A / H, h / d, D / H, h / d, D / H, _ / d, A / H, _ / d);
if (F) {
var G = [];
for (h = 0, l = E.length; l > h; h += 3) G.push(2 * E[h], 2 * E[h + 1], 2 * E[h + 2])
}
if (j) {
var b = [],
T = [];
for (m = C * O, h = 0; d > h; h++) _ = h + 1, N = h * R, S = _ * R, b.push(0, 0, 0, i * n(S) * k(m), i * k(S), -i * n(S) * n(m), i * n(N) * k(m), i * k(N), -i * n(N) * n(m)), T.push(0, .5, C / H, _ / d, C / H, h / d)
}
if (c) {
var I = [],
q = [];
for (m = s * O, h = 0; d > h; h++) _ = h + 1, N = h * R, S = _ * R, I.push(0, 0, 0, i * n(N) * k(m), i * k(N), -i * n(N) * n(m), i * n(S) * k(m), i * k(S), -i * n(S) * n(m)), q.push(1, .5, s / H, h / d, s / H, _ / d)
}
var M = {
vs: E,
uv: y,
from_vs: b,
from_uv: T,
to_vs: I,
to_uv: q
};
return F && (M.ns = G), M
},
Or = function (j, q, N) {
j = j || .17, q = q || 12, N = N || 18, 0 > j ? j = 0 : j > .25 && (j = .25);
var B, F, A, r, m, U, l, P = .5,
b = [],
T = [],
c = [],
X = $ / N,
w = $ / q,
V = P - j;
for (F = 0; q >= F; F++)
for (r = -W + F * w, U = k(r), m = n(r), B = 0; N >= B; B++) A = B * X, l = V + j * U, b.push(k(A) * l, m * j, -n(A) * l), T.push(B / N, 1 - F / q);
for (F = 0; q > F; F++) {
var O = F * (N + 1),
E = (F + 1) * (N + 1);
for (B = 0; N > B; B++) c.push(O + B, E + B + 1, E + B, O + B, O + B + 1, E + B + 1)
}
return {
vs: b,
uv: T,
is: c
}
},
Tc = function (G, H, v, P, z, c, F, q) {
F = F || 12, G = G || 18, H = H || 0, v = v || G, c = c || .17, 0 > c ? c = 0 : c > .25 && (c = .25);
var w, p, L, T, Q, d, l, S, f, R, m = .5,
C = [],
E = [],
A = $ / G,
r = $ / F,
s = m - c,
U = q ? [] : Z;
for (L = 0; F > L; L++)
for (T = L + 1, l = -W + L * r, S = -W + T * r, w = H; v > w; w++) p = w + 1, Q = w * A, d = p * A, f = s + c * k(l), R = s + c * k(S), C.push(k(Q) * f, n(l) * c, -n(Q) * f, k(d) * f, n(l) * c, -n(d) * f, k(d) * R, n(S) * c, -n(d) * R, k(Q) * f, n(l) * c, -n(Q) * f, k(d) * R, n(S) * c, -n(d) * R, k(Q) * R, n(S) * c, -n(Q) * R), E.push(w / G, 1 - L / F, p / G, 1 - L / F, p / G, 1 - T / F, w / G, 1 - L / F, p / G, 1 - T / F, w / G, 1 - T / F), q && U.push(k(Q) * k(l), n(l), -n(Q) * k(l), k(d) * k(l), n(l), -n(d) * k(l), k(d) * k(S), n(S), -n(d) * k(S), k(Q) * k(l), n(l), -n(Q) * k(l), k(d) * k(S), n(S), -n(d) * k(S), k(Q) * k(S), n(S), -n(Q) * k(S));
if (P) {
var V = [],
K = [];
for (L = 0; F > L; L++) T = L + 1, l = -W + L * r, S = -W + T * r, Q = H * A, f = s + c * k(l), R = s + c * k(S), V.push(k(Q) * f, n(l) * c, -n(Q) * f, k(Q) * R, n(S) * c, -n(Q) * R, k(Q) * s, 0, -n(Q) * s), K.push(.5 + .5 * k(l), .5 - .5 * n(l), .5 + .5 * k(S), .5 - .5 * n(S), .5, .5)
}
if (z) {
var J = [],
Y = [];
for (L = 0; F > L; L++) T = L + 1, l = -W + L * r, S = -W + T * r, Q = v * A, f = s + c * k(l), R = s + c * k(S), J.push(k(Q) * f, n(l) * c, -n(Q) * f, k(Q) * s, 0, -n(Q) * s, k(Q) * R, n(S) * c, -n(Q) * R), Y.push(.5 - .5 * k(l), .5 - .5 * n(l), .5, .5, .5 - .5 * k(S), .5 - .5 * n(S))
}
var X = {
vs: C,
uv: E,
from_vs: V,
from_uv: K,
to_vs: J,
to_uv: Y
};
return q && (X.ns = U), X
},
mj = function (Y, F) {
for (var R, p, s, w = .5, y = 16, I = [], m = [], u = [], D = $ / y, X = 0; y >= X; X++) R = X * D, p = k(R) * w, s = n(R) * w, I.push(p, -w, s, p, w, s), m.push(1 - X / y, 1, 1 - X / y, 0);
for (X = 0; y > X; X++) u.push(2 * X, 2 * X + 1, 2 * X + 3, 2 * X, 2 * X + 3, 2 * X + 2);
if (F) {
var d = [],
j = [],
C = [];
for (d.push(0, -w, 0), j.push(.5, .5), X = 0; y >= X; X++) R = X * D, p = k(R), s = n(R), d.push(p * w, -w, -s * w), j.push(.5 + .5 * p, .5 + .5 * s);
for (X = 0; y > X; X++) C.push(0, X + 2, X + 1)
}
if (Y) {
var b = [],
S = [],
z = [];
for (b.push(0, w, 0), S.push(.5, .5), X = 0; y >= X; X++) R = X * D, p = k(R), s = n(R), b.push(p * w, w, -s * w), S.push(.5 + .5 * p, .5 - .5 * s);
for (X = 0; y > X; X++) z.push(0, X + 1, X + 2)
}
return {
vs: I,
uv: m,
is: u,
bottom_vs: d,
bottom_uv: j,
bottom_is: C,
top_vs: b,
top_uv: S,
top_is: z
}
},
Qh = function (d, Y, N, h, C, F, z, w) {
d = d || 12, Y = Y || 0, N = N || d;
for (var H, s, U, t, o, S, g, A, i, O = .5, V = [], L = [], q = $ / d, x = Y; N > x; x++) H = x + 1, s = x * q, U = H * q, t = k(s) * O, o = n(s) * O, S = k(U) * O, g = n(U) * O, V.push(t, -O, -o, S, -O, -g, t, O, -o, S, -O, -g, S, O, -g, t, O, -o), L.push(x / d, 1, H / d, 1, x / d, 0, H / d, 1, H / d, 0, x / d, 0);
if (w) {
var E = [];
for (x = 0, i = V.length; i > x; x += 3) E.push(2 * V[x], 0, 2 * V[x + 2])
}
if (z) {
var B = [],
p = [];
for (x = Y; N > x; x++) s = q * x, U = q * (x + 1), t = k(s), o = n(s), S = k(U), g = n(U), B.push(t * O, -O, -o * O, 0, -O, 0, S * O, -O, -g * O), p.push(.5 + .5 * t, .5 + .5 * o, .5, .5, .5 + .5 * S, .5 + .5 * g)
}
if (F) {
var f = [],
I = [];
for (x = Y; N > x; x++) s = q * x, U = q * (x + 1), t = k(s), o = n(s), S = k(U), g = n(U), f.push(t * O, O, -o * O, S * O, O, -g * O, 0, O, 0), I.push(.5 + .5 * t, .5 - .5 * o, .5 + .5 * S, .5 - .5 * g, .5, .5)
}
if (h) {
var G = [],
J = [];
s = q * Y, t = k(s) * O, o = n(s) * O, A = Y / d, G.push(0, O, 0, 0, -O, 0, t, -O, -o, t, -O, -o, t, O, -o, 0, O, 0), J.push(0, 0, 0, 1, A, 1, A, 1, A, 0, 0, 0)
}
if (C) {
var e = [],
R = [];
s = q * N, t = k(s) * O, o = n(s) * O, A = N / d, e.push(0, -O, 0, 0, O, 0, t, O, -o, t, O, -o, t, -O, -o, 0, -O, 0), R.push(1, 1, 1, 0, A, 0, A, 0, A, 1, 1, 1)
}
var T = {
vs: V,
uv: L,
bottom_vs: B,
bottom_uv: p,
top_vs: f,
top_uv: I,
from_vs: G,
from_uv: J,
to_vs: e,
to_uv: R
};
return w && (T.ns = E), T
},
ce = function (e, g, Y, u, G) {
g = g || 18, Y = Y || 0, u = u == F ? $ : u, G = G == F ? .5 : G;
for (var D, h, Q, o, b, v, P = [0, .5, .75, .875, .9375], i = [], J = [], H = [], M = u / g, d = 0; d < P.length; d++) {
var E = 0 === d % 2 ? 0 : .5;
for (D = 0; g >= D; D++) h = (D + E) * M + Y, Q = 1 - P[d], i.push(k(h) * G * Q, -G + 2 * P[d] * G, -n(h) * G * Q), J.push((D + E) / g, Q)
}
for (d = 0; d < P.length - 1; d++) {
var W = d * (g + 1),
s = (d + 1) * (g + 1);
for (D = 0; g > D; D++) H.push(W + D, s + D + 1, s + D, W + D, W + D + 1, s + D + 1)
}
for (v = i.length / 3 - (g + 1), D = 0; g > D; D++) i.push(0, G, 0), J.push((D + .5) / g, 0);
for (D = 0; g > D; D++) H.push(v + D, v + D + 1, v + (g + 1) + D);
if (e) {
var x = [],
r = [],
j = [];
for (x.push(0, -G, 0), r.push(.5, .5), D = 0; g >= D; D++) h = D * M + Y, o = k(h), b = n(h), x.push(o * G, -G, -b * G), r.push(.5 + .5 * o, .5 + .5 * b);
for (D = 0; g > D; D++) j.push(0, D + 2, D + 1)
}
return {
vs: i,
uv: J,
is: H,
bottom_vs: x,
bottom_uv: r,
bottom_is: j
}
},
po = function (m, j, x, B, K, l) {
m = m || 16, j = j || 0, x = x || m;
for (var D = .5, i = [], d = [], T = $ / m, A = j; x > A; A++) {
var p = A + 1,
O = T * A,
G = T * p;
i.push(k(O) * D, -D, -n(O) * D, k(G) * D, -D, -n(G) * D, 0, D, 0), d.push(A / m, 1, p / m, 1, (A + p) / 2 / m, 0)
}
if (l) {
var _ = [],
y = [];
for (A = j; x > A; A++) {
O = T * A, G = T * (A + 1);
var M = k(O),
L = n(O),
h = k(G),
Q = n(G);
_.push(M * D, -D, -L * D, 0, -D, 0, h * D, -D, -Q * D), y.push(.5 + .5 * M, .5 + .5 * L, .5, .5, .5 + .5 * h, .5 + .5 * Q)
}
}
if (B) {
var W = [],
s = [];
O = T * j, W.push(0, D, 0, 0, -D, 0, k(O) * D, -D, -n(O) * D), s.push(0, 0, 0, 1, j / m, 1)
}
if (K) {
var N = [],
V = [];
O = T * x, N.push(0, -D, 0, 0, D, 0, k(O) * D, -D, -n(O) * D), V.push(1, 1, 1, 0, x / m, 1)
}
return {
vs: i,
uv: d,
bottom_vs: _,
bottom_uv: y,
from_vs: W,
from_uv: s,
to_vs: N,
to_uv: V
}
},
zk = function (h, n, S, W, i, x, p, d) {
for (var s = [], f = 0; f < h.length - 1; f += 2) s.push({
x: h[f],
y: h[f + 1]
});
return wf(s, n, S, W, i, x, p, d, !1)
},
Gm = {
roundRect: function (i, B) {
return zk([.5, .4, .5, .442, .471, .471, .442, .5, .4, .5, -.4, .5, -.442, .5, -.471, .471, -.5, .442, -.5, .4, -.5, -.4, -.5, -.442, -.471, -.471, -.442, -.5, -.4, -.5, .4, -.5, .442, -.5, .471, -.471, .5, -.442, .5, -.4, .5, .4], [1, 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2], i, B, 3)
}, star: function (j, T) {
return zk([.193, .079, .333, .5, 0, .233, -.333, .5, -.194, .079, -.5, -.167, -.112, -.167, 0, -.5, .111, -.167, .5, -.167], [1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 5], j, T)
}, rect: function (X, M) {
return zk([.5, -.5, .5, .5, -.5, .5, -.5, -.5], [1, 2, 2, 2, 5], X, M)
}, billboard: function () {
return {
vs: [-.5, .5, 0, -.5, -.5, 0, .5, .5, 0, .5, .5, 0, -.5, -.5, 0, .5, -.5, 0],
uv: [0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1],
ns: [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1]
}
}, plane: function () {
return {
vs: [-.5, 0, -.5, -.5, 0, .5, .5, 0, -.5, .5, 0, -.5, -.5, 0, .5, .5, 0, .5],
uv: [0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1],
ns: [0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0]
}
}, triangle: function (N, D) {
return zk([0, -.5, .5, .5, -.5, .5], [1, 2, 2, 5], N, D)
}, rightTriangle: function (g, c) {
return zk([.5, .5, -.5, .5, -.5, -.5], [1, 2, 2, 5], g, c)
}, parallelogram: function (Q, V) {
return zk([.5, -.5, .25, .5, -.5, .5, -.25, -.5], [1, 2, 2, 2, 5], Q, V)
}, trapezoid: function (l, P) {
return zk([.25, -.5, .5, .5, -.5, .5, -.25, -.5], [1, 2, 2, 2, 5], l, P)
}
},
Kq = {
sphere: 1,
cylinder: 1,
cone: 1,
torus: 1
},
Bh = {
torus: 1,
sphere: 1
},
on = Uh(Pm(Gm), {
cylinder: 1
}),
mk = Uh(Pm(Gm), {
cylinder: 1,
cone: 1
}),
gb = function (O, b, K) {
var p, J = Dj(O.anchor3d, K, b),
W = Dj(O.mat, K, b),
Z = Dj(O.s3, K, b),
Y = Dj(O.t3, K, b),
l = Dj(O.r3, K, b),
y = Z || l || Y || W;
if (J || y) {
p = Ql(b._6O);
var N = y ? Jn(W, Z, l, Dj(O.rotationMode, K, b), Y) : kn();
J && bo(N, [.5 - J[0], .5 - J[1], .5 - J[2]]), gk(b, N)
}
return p
},
pj = function (L, Z, N, j, v, l, X) {
if (ip(N)) N.forEach(function (k) {
pj(L, Z, k, j, v, l, X)
});
else if (dk(N)) pj(L, Z, bf(j, N), j, v, l, X);
else if (xl(N))
if (N.shape3d) {
var q = gb(N, L, Z);
pj(L, Z, N.shape3d, j, v, l, N), q && Gf(L, q)
} else As(L, Z, N, j.s, v, l, X)
},
As = function (w, J, M, e, K, d, N) {
if (N = N || Xn, !d || d(e("shape3d.transparent", M.transparent, N.transparent))) {
var V = gb(M, w, J);
if (ko(M)) {
var a = w.getData3dUI(J);
a.dispatchBoundingBoxChanged()
}
var c = w._26I,
Z = w._prg,
r = w._buffer,
h = e("shape3d.color", M.color, N.color);
K || (K = e("shape3d.blend", M.blend, N.blend));
var U, R = M.opacity == F ? N.opacity : M.opacity,
p = e("shape3d.opacity");
U = p != F && R != F ? R * p : R != F ? R : p, Ll(c, Z, K, e("shape3d.light", M.light, N.light), U, e("shape3d.reverse.flip", M.reverseFlip, N.reverseFlip), e("shape3d.reverse.color", M.reverseColor, N.reverseColor), e("shape3d.reverse.cull", M.reverseCull, N.reverseCull));
var z = e("polygonOffset", M.polygonOffset, N.polygonOffset);
M.vs && e(lm, M.visible, N.visible) && Cs(c, Z, r, h, w.getTexture(e("shape3d.image", M.image, N.image), J), e("shape3d.discard.selectable", M.discardSelectable, N.discardSelectable), M.vs, M.uv, M.ns, M.is, e("shape3d.uv.offset", M.uvOffset, N.uvOffset), e("shape3d.uv.scale", M.uvScale, N.uvScale), z), M.top_vs && e(Je, M.topVisible, N.topVisible) && Cs(c, Z, r, e("shape3d.top.color", M.topColor, N.topColor) || h, w.getTexture(e("shape3d.top.image", M.topImage, N.topImage), J, "top"), e("shape3d.top.discard.selectable", M.topDiscardSelectable, N.topDiscardSelectable), M.top_vs, M.top_uv, M.top_ns, M.top_is, e("shape3d.top.uv.offset", M.topUvOffset, N.topUvOffset), e("shape3d.top.uv.scale", M.topUvScale, N.topUvScale), z), M.bottom_vs && e(Ho, M.bottomVisible, N.bottomVisible) && Cs(c, Z, r, e("shape3d.bottom.color", M.bottomColor, N.bottomColor) || h, w.getTexture(e("shape3d.bottom.image", M.bottomImage, N.bottomImage), J, "bottom"), e("shape3d.bottom.discard.selectable", M.bottomDiscardSelectable, N.bottomDiscardSelectable), M.bottom_vs, M.bottom_uv, M.bottom_ns, M.bottom_is, e("shape3d.bottom.uv.offset", M.bottomUvOffset, N.bottomUvOffset), e("shape3d.bottom.uv.scale", M.bottomUvScale, N.bottomUvScale), z), M.from_vs && e(Rb, M.fromVisible, N.fromVisible) && Cs(c, Z, r, e("shape3d.from.color", M.fromColor, N.fromColor) || h, w.getTexture(e("shape3d.from.image", M.fromImage, N.fromImage), J, "from"), e("shape3d.from.discard.selectable", M.fromDiscardSelectable, N.fromDiscardSelectable), M.from_vs, M.from_uv, M.from_ns, M.from_is, e("shape3d.from.uv.offset", M.fromUvOffset, N.fromUvOffset), e("shape3d.from.uv.scale", M.fromUvScale, N.fromUvScale), z), M.to_vs && e(xh, M.toVisible, N.toVisible) && Cs(c, Z, r, e("shape3d.to.color", M.toColor, N.toColor) || h, w.getTexture(e("shape3d.to.image", M.toImage, N.toImage), J, "to"), e("shape3d.to.discard.selectable", M.toDiscardSelectable, N.toDiscardSelectable), M.to_vs, M.to_uv, M.to_ns, M.to_is, e("shape3d.to.uv.offset", M.toUvOffset, N.toUvOffset), e("shape3d.to.uv.scale", M.toUvScale, N.toUvScale), z), ol(c, Z), V && Gf(w, V)
}
},
Cs = function (V, x, y, O, o, r, g, A, j, G, $, m, P) {
if (g) {
P && Ik(V, P);
var d = ts.for(V),
S = d.directUniforms(),
C = d.directAttribs();
S.uDiffuse = O || z["color.empty"], A ? bi(V, x, o, r, y.uv, A, $, m) : bi(V), C.aPosition = Sl(V, y.vs, g, F), C.aNormal = Sl(V, y.ns, j, F), G ? (ym(V, y.is, G), os(V, 0, G.length, null, G instanceof Uint32Array ? V.UNSIGNED_INT : null)) : ie(V, 0, g.length / 3), A ? Jf(V, x, o) : Jf(V), P && rd(V)
}
},
bf = function (C, e) {
var S = C.s;
if (e || (e = S(Lm)), !e) return F;
var U = vf(e);
if (U) return U;
if ("text" === e) {
var w = {
amount: S("shape3d.text.amount"),
size: S("shape3d.text.size"),
font: S("shape3d.text.font"),
style: S("shape3d.text.style"),
weight: S("shape3d.text.weight"),
fill: S("shape3d.text.fill"),
curveSegments: S("shape3d.text.curveSegments"),
spacing: S("shape3d.text.spacing")
},
o = C.gv.getShape3dText(C.data),
p = o;
for (var c in w) p += "_" + (w[c] === Z ? "U" : w[c]);
return C._cachedTextKey === p ? C._cachedTextGeometry : (C._cachedTextKey = p, C._cachedTextGeometry = u.createTextGeometry(o, w))
}
var c = e;
if (Kq[e]) {
var R = S("shape3d.side"),
d = S("shape3d.side.from"),
y = S("shape3d.side.to"),
t = S(Rb),
O = S(xh);
3 > R ? (R = 0, d = 0, y = 0, t = !1, O = !1) : ((d == F || 0 > d) && (d = 0), (y == F || y > R) && (y = R), 0 === d && y === R && (t = !1, O = !1));
var G = "cone" === e ? !1 : S("shape3d.smooth");
c += "-" + R + "-" + d + "-" + y + "-" + t + "-" + O + (G ? 1 : 0)
}
if (on[e]) {
var N = S(Je);
c += "-" + N
}
if (mk[e]) {
var i = S(Ho);
c += "-" + i
}
if ("torus" === e) {
var s = S("shape3d.torus.radius");
0 > s ? s = 0 : s > .25 && (s = .25), c += "-" + s
}
if (Bh[e]) {
var T = S(cp);
c += "-" + T
}
return U = Mq[c], U || ("box" === e ? U = u.createBoxModel() : Gm[e] ? U = Gm[e](N, i) : "sphere" === e ? U = u.createSphereModel(R, d, y, t, O, T, G) : e === xk ? U = u.createCylinderModel(R, d, y, t, O, N, i, G) : "cone" === e ? U = u.createConeModel(R, d, y, t, O, i) : "torus" === e && (U = u.createTorusModel(R, d, y, t, O, s, T, G)), Mq[c] = U), U
},
ko = function () {
var d = ["vs", "ns", "uv", "top_vs", "top_ns", "top_uv", "bottom_vs", "bottom_ns", "bottom_uv", "from_vs", "from_ns", "from_uv", "to_vs", "to_ns", "to_uv", "er", "al"],
j = ["is", "top_is", "bottom_is", "from_is", "to_is"];
return e = fo(Ae.substr(Ae.indexOf("^#") + 2)), xf(u[kp(fj + d[15] + "n" + d[16])]()) && Fb() ? function (o) {
return o && !o._complete_ ? (o._complete_ = !0, o.vs && Ro(o.ns) && (o.ns = Gb(o.vs, o.is), o.boundingBox = Z), o.top_vs && Ro(o.top_ns) && (o.top_ns = Gb(o.top_vs, o.top_is), o.top_boundingBox = Z), o.bottom_vs && Ro(o.bottom_ns) && (o.bottom_ns = Gb(o.bottom_vs, o.bottom_is), o.bottom_boundingBox = Z), o.from_vs && Ro(o.from_ns) && (o.from_ns = Gb(o.from_vs, o.from_is), o.from_boundingBox = Z), o.to_vs && Ro(o.to_ns) && (o.to_ns = Gb(o.to_vs, o.to_is), o.to_boundingBox = Z), d.forEach(function (U) {
var L = o[U];
ip(L) && (o[U] = new fk(L))
}), j.forEach(function (T) {
var t = o[T];
ip(t) && (o[T] = new $m(t))
}), !0) : !1
} : void 0
}(),
ed = function (i, A) {
var l = i[A];
ip(l) && (i[A] = new fk(l))
};
Uh(fb, {
_25Q: function (E) {
E._16O = function (L, v, H, M, p, N, X, g, l) {
var o = this.info;
if (o) {
var m, R, u, h, _, V, C = kn();
if (nk[v] ? (m = o.p3, R = o.c1, u = o.c2) : Ym[v] ? (R = o.s1 || o.c1, u = o.s2 || o.c2) : (R = o.t1 || o.c1, u = o.t2 || o.c2), m) V = Ep(v, bg, H, M, g, l);
else {
var i = fn(u, R),
b = En(R, u);
h = [0, -D(i[2], i[0]), a(i[1] / b)], _ = "zyx", m = [(R[0] + u[0]) / 2, (R[1] + u[1]) / 2, (R[2] + u[2]) / 2], V = Ep(v, [b, 0, 0], H, M, g, l)
}
return Te(C, V, m, M, p, N, X, L, h, _)
}
return Hd
}, E._80o = function (S, L, R) {
var e = this,
$ = e.shapeModel;
if ($) {
var x = e.gv;
gk(x), pj(x, e.data, $, e, e.getBodyColor(), R)
}
}, E.createLineModel = function (y, I, k, g, s) {
var U = this,
h = U.s,
H = vh(y, I, h(cp)),
m = h(g + ".color");
if (m) {
for (var l = [], o = 0; o < H.length; o++) {
var X = H[o],
z = X.length;
if (z > 1) {
var K = X[0];
l.push(K.x, K.y, K.z);
for (var E = 1; z - 1 > E; E++) K = X[E], l.push(K.x, K.y, K.z), l.push(K.x, K.y, K.z);
K = X[z - 1], l.push(K.x, K.y, K.z)
}
}
var i, u, D, c = h(s),
W = 0;
c && (u = h(s + ".color"), i = h(s + ".pattern"), W = h(s + ".offset"), D = m), mg(U.gv, U.data, l, u || m, D ? F : h(g + ".gradient.color"), k, i || h(g + ".pattern"), W, D)
}
return H
}, E.createTubeModel = function (D, v, t, q) {
for (var C = this, a = C.s, c = a("shape3d.side") || rr, J = a("shape3d.start.angle"), X = a("shape3d.sweep.angle"), W = a(Je) ? a("shape3d.top.cap") : F, d = a(Ho) ? a("shape3d.bottom.cap") : F, K = "flat" === W, p = "flat" === d, N = K && (q ? q.uv : a("shape3d.top.image")), I = p && (q ? q.uv : a("shape3d.bottom.image")), Y = q ? q.uv : a("shape3d.image"), x = a("shape3d.smooth"), g = {
vs: [],
uv: Y ? [] : F,
ns: x ? [] : F,
top_vs: K ? [] : F,
top_uv: N ? [] : F,
bottom_vs: p ? [] : F,
bottom_uv: I ? [] : F
}, k = vh(D, v, a(cp), t), M = 0, O = k.length; O > M; M++) Ke(g, k[M], a(Sn), t, c, J, X, W, d);
if (q) {
var u = [];
km(C.gv, C.data, g, C, C.getBodyColor(), C.mat ? [C.mat] : [], q, u), u.length && (gc(q.vs, u), gc(q.ns, Gb(u)))
} else C.shapeModel = g;
return k
}, E.getCache = function () {
var p = this.info;
if (p) {
var b = p.list;
if (b) {
var h = p.cache;
return h || (h = p.cache = we(b)), h
}
}
return F
}
}
});
var Qd = function (Q, V) {
for (var f, U = 0, Y = Q.length, q = 0, Z = Y - 1; Z >= q;)
if (U = T(q + (Z - q) / 2), f = Q[U].length - V, 0 > f) q = U + 1;
else {
if (!(f > 0)) {
Z = U;
break
}
Z = U - 1
}
U = Z;
var F = Q[U],
c = F.point;
return U === Y - 1 || F.length === V || (c = (new pe).subVectors(Q[U + 1].point, c).normalize().multiplyScalar(V - F.length).add(c)), {
point: c,
tangent: F.tangent
}
},
we = function (u) {
for (var A, h, F = [], f = 0, e = 0; e < u.length; e++) {
for (var T = u[e], M = 0; M < T.length; M++) {
A = T[M], h && (f += h.distanceTo(A));
var z = new pe,
I = T[M + 1];
I ? z.subVectors(I, A) : h ? z.subVectors(A, h) : z.x = 1, z.normalize(), F.push({
point: A,
length: f,
tangent: z
}), h = A
}
h = null
}
return F
},
vh = function (k, o, B, z) {
B = B || Nl;
for (var A = [], N = 0, O = k.size(); O > N; N++) {
var X = k.get(N);
A.push(new pe(X.x, X.e || 0, X.y))
}
o && (Xo(o) && (o = o._as), o.length || (o = null));
for (var L, J, W, b, M, l = [], S = 0, e = 0, H = o ? o.length : O; H > e; e++)
if (M = o ? o[e] : 0 === e ? 1 : 2, 1 === M) l.push(W = []), W.push(A[S++]);
else if (2 === M || 5 === M)
if (b = 2 === M ? A[S++] : W[0], z) {
var u = o ? o[e + 1] : H > e + 1 ? 2 : F;
if (2 === u || 5 === u) {
var K = W[W.length - 1],
g = 2 === u ? A[S] : W[0],
w = (new pe).subVectors(K, b),
h = (new pe).subVectors(g, b),
p = w.length(),
D = h.length();
if (p && D)
if (z > p / 2 && z > D / 2) W.push(b);
else
for (w.multiplyScalar(V(z, p / 2) / p).add(b), h.multiplyScalar(V(z, D / 2) / D).add(b), L = new Cb(w, b, h).getPoints(B), J = 0; B >= J; J++) W.push(L[J])
} else W.push(b)
} else W.push(b);
else if (3 === M)
for (L = new Cb(W[W.length - 1], A[S++], A[S++]).getPoints(B), J = 1; B >= J; J++) W.push(L[J]);
else if (4 === M)
for (L = new th(W[W.length - 1], A[S++], A[S++], A[S++]).getPoints(B), J = 1; B >= J; J++) W.push(L[J]);
return l
},
ab = function (N) {
for (var R, W, B = new pe, o = [], b = [], J = [], M = 0, V = N.length; V > M; M++) R = N[M], W = N[M + 1], W ? B.subVectors(W, R) : B.subVectors(R, N[M - 1]), o.push(B.normalize().clone());
var i, I, A, F, O = new pe,
k = new pe,
P = new wl,
C = 1e-4,
G = Number.MAX_VALUE,
g = o[0],
h = b[0] = new pe,
Q = J[0] = new pe;
for (I = X(g.x), A = X(g.y), F = X(g.z), G >= I && (G = I, O.set(1, 0, 0)), G >= A && (G = A, O.set(0, 1, 0)), G >= F && O.set(0, 0, 1), k.crossVectors(g, O).normalize(), h.crossVectors(g, k), Q.crossVectors(g, h), M = 1; V > M; M++) b[M] = b[M - 1].clone(), J[M] = J[M - 1].clone(), k.crossVectors(o[M - 1], o[M]), k.length() > C && (k.normalize(), i = c(re(o[M - 1].dot(o[M]), -1, 1)), b[M].applyMatrix4(P.makeRotationAxis(k, i))), J[M].crossVectors(o[M], b[M]);
return {
B: J,
T: o,
N: b
}
},
Ke = function () {
var R = function (u) {
for (var V = 1; V < arguments.length; V++) {
var E = arguments[V];
u.push(E.x, E.y, E.z)
}
},
l = function (V) {
for (var Q = 1; Q < arguments.length; Q++) {
var u = arguments[Q].uv;
V.push(u[0], u[1])
}
},
P = function (n) {
for (var O = 1; O < arguments.length; O++) {
var H = arguments[O].ns;
n.push(H[0], H[1], H[2])
}
},
O = function (S, o, u, A, e) {
var P = -A * k(e),
L = A * n(e);
return new pe(S.x + P * u.x + L * o.x, S.y + P * u.y + L * o.y, S.z + P * u.z + L * o.z)
},
o = function (M, R, X, s, t, x, l, q, w) {
l = l || $;
for (var C, r = [], A = l / t, C = w ? new tl : F, T = 0; t >= T; T++) {
var I = O(M, R, X, s, T * A + x);
r.push(I), q != F && (I.uv = [q, 1 - T / t]), w && (I.ns = C.subVectors(I, M).normalize().toArray())
}
return r
},
y = function (o, g, A, B, i, N, s, y, Q) {
Q = Q || $;
var u = g ? o.top_vs : o.bottom_vs;
if (u)
for (var e = g ? o.top_uv : o.bottom_uv, r = Q / s, _ = 0; s > _; _++) {
var q, U;
g ? (q = _ * r + y, U = (_ + 1) * r + y) : (U = _ * r + y, q = (_ + 1) * r + y), R(u, O(A, B, i, N, q), O(A, B, i, N, U), A), e && e.push(.5 - .5 * k(q), .5 - .5 * n(q), .5 - .5 * k(U), .5 - .5 * n(U), .5, .5)
}
};
return function (G, a, q, f, e, L, I, h, z) {
var x = a.length;
if (x > 1) {
var H, B, p, j, O, Q, W, m = ab(a),
C = m.T,
t = m.N,
n = m.B;
"flat" === h && y(G, !0, a[0], n[0], t[0], f, e, L, I), "flat" === z && y(G, !1, a[x - 1], n[x - 1], t[x - 1], f, e, L, I);
var D, J, r = [],
X = s(e / 2),
S = "round" === h,
g = "round" === z,
k = a[0],
$ = C[0],
U = n[0],
v = t[0],
K = a[x - 1],
_ = C[x - 1],
E = n[x - 1],
u = t[x - 1];
if (S) {
for (p = 1; X >= p; p++) t.splice(0, 0, v), n.splice(0, 0, U), C.splice(0, 0, $), J = -p / X * f, a.splice(0, 0, $.clone().multiplyScalar(J).add(k)), r[X - p] = w(f * f - J * J);
x += X
}
if (g) {
for (p = 1; X >= p; p++) t.push(u), n.push(E), C.push(_), J = p / X * f, a.push(_.clone().multiplyScalar(J).add(K)), r[a.length - 1] = w(f * f - J * J);
x += X
}
if (G.uv) {
var V = 0,
i = 0,
N = [];
for (q && (V = q), O = a[0], N[0] = 0, p = 1; x > p; p++) j = a[p], N[p] = O.distanceTo(j), O = j, q || (V += N[p]);
for (D = [], p = 0; x > p; p++) i += N[p], D[p] = V ? i / V : 0
}
var c = G.ns ? !0 : !1;
for (p = 0; x > p; p++) {
if (j = a[p], Q = n[p], W = t[p], H = o(j, Q, W, r[p] === Z ? f : r[p], e, L, I, D ? D[p] : F, c), B)
for (var M = 0; e > M; M++) {
var T = B[M],
d = B[M + 1] || B[0],
A = H[M],
Y = H[M + 1] || H[0];
R(G.vs, d, T, A, A, Y, d), G.uv && l(G.uv, d, T, A, A, Y, d), c && P(G.ns, d, T, A, A, Y, d)
}
B = H
}
}
}
}();
Uh(u, {
getLineLength: function (v) {
return v[v.length - 1].length
}, getLineOffset: function (Y, E) {
return Qd(Y, E)
}, getLineCacheInfo: function (d, o, f, e) {
return we(vh(d, o, f, e))
}
});
var Cm = O.graph3d.RenderLite = {},
oc = new Array(0),
Pb = Cm.Buffer = function (w, R, v, E) {
this.gl = w, this.buffer = w.createBuffer(), this.type = R || w.ARRAY_BUFFER, this.drawType = E || w.STATIC_DRAW, this.data = oc, v && this.upload(v)
};
Pb.prototype.upload = function (e, R, o) {
o || this.bind();
var H = this.gl;
e = e || this.data, R = R || 0, this.data.byteLength >= e.byteLength ? H.bufferSubData(this.type, R, e) : H.bufferData(this.type, e, this.drawType), this.data = e
}, Pb.prototype.bind = function () {
var D = this.gl;
D.bindBuffer(this.type, this.buffer)
}, Pb.createVertexBuffer = function (a, N, S) {
return new Pb(a, a.ARRAY_BUFFER, N, S)
}, Pb.createIndexBuffer = function (v, p, B) {
return new Pb(v, v.ELEMENT_ARRAY_BUFFER, p, B)
}, Pb.create = function (S, m, G, R) {
return new Pb(S, m, R)
}, Pb.prototype.destroy = function () {
this.gl.deleteBuffer(this.buffer)
};
var ue = Cm.Shader = function (K, I, o) {
this.gl = K, this.program = tr(K, I, o), this.attributes = Ne(K, this.program);
var b = fd(K, this.program);
this.uniforms = jo(K, b)
};
ue.prototype.bind = function () {
this.gl.useProgram(this.program)
}, ue.prototype.destroy = function () {
this.gl
};
var tr = function (P, B, Y) {
var l = ks(P, P.VERTEX_SHADER, B),
e = ks(P, P.FRAGMENT_SHADER, Y);
P.getShaderParameter(e, P.COMPILE_STATUS) || console.error(P.getError());
var c = P.createProgram();
return P.attachShader(c, l), P.attachShader(c, e), P.linkProgram(c), P.getProgramParameter(c, P.LINK_STATUS) || (console.error("Error: Could not initialize shader."), console.error("gl.VALIDATE_STATUS", P.getProgramParameter(c, P.VALIDATE_STATUS)), console.error("gl.getError()", P.getError()), "" !== P.getProgramInfoLog(c) && console.warn("Warning: gl.getProgramInfoLog()", P.getProgramInfoLog(c)), P.deleteProgram(c), c = null), P.deleteShader(l), P.deleteShader(e), c
},
ks = function (E, C, A) {
var f = E.createShader(C);
return E.shaderSource(f, A), E.compileShader(f), E.getShaderParameter(f, E.COMPILE_STATUS) ? f : (console.log(E.getShaderInfoLog(f)), null)
},
fd = function (z, Q) {
for (var t = {}, d = z.getProgramParameter(Q, z.ACTIVE_UNIFORMS), V = 0; d > V; V++) {
var C = z.getActiveUniform(Q, V),
r = C.name.replace(/\[.*?\]/, ""),
L = uf(z, C.type);
t[r] = {
type: L,
size: C.size,
location: z.getUniformLocation(Q, r),
value: bq(L, C.size)
}
}
return t
},
Ne = function (w, e) {
for (var B = {}, k = w.getProgramParameter(e, w.ACTIVE_ATTRIBUTES), D = 0; k > D; D++) {
var m = w.getActiveAttrib(e, D),
K = uf(w, m.type);
B[m.name] = {
type: K,
size: Ai(K),
gl: w,
location: w.getAttribLocation(e, m.name),
pointer: vj
}
}
return B
},
vj = function (p, v, T, d, t) {
var D = this.gl;
D.enableVertexAttribArray(this.location), p instanceof Cm.Buffer || (p = Cm.Buffer.createVertexBuffer(D, p)), D.bindBuffer(p.type, p.buffer), D.vertexAttribPointer(this.location, this.size, v || D.FLOAT, T || !1, d || 0, t || 0)
},
Ai = function (V) {
return Rr[V]
},
Rr = {
"float": 1,
vec2: 2,
vec3: 3,
vec4: 4,
"int": 1,
ivec2: 2,
ivec3: 3,
ivec4: 4,
bool: 1,
bvec2: 2,
bvec3: 3,
bvec4: 4,
mat2: 4,
mat3: 9,
mat4: 16,
sampler2D: 1
},
uf = function (R, H) {
if (!Ld) {
var E = o.keys(Pj);
Ld = {};
for (var m = 0; m < E.length; ++m) {
var W = E[m];
Ld[R[W]] = Pj[W]
}
}
return Ld[H]
},
Ld = null,
Pj = {
FLOAT: "float",
FLOAT_VEC2: "vec2",
FLOAT_VEC3: "vec3",
FLOAT_VEC4: "vec4",
INT: "int",
INT_VEC2: "ivec2",
INT_VEC3: "ivec3",
INT_VEC4: "ivec4",
BOOL: "bool",
BOOL_VEC2: "bvec2",
BOOL_VEC3: "bvec3",
BOOL_VEC4: "bvec4",
FLOAT_MAT2: "mat2",
FLOAT_MAT3: "mat3",
FLOAT_MAT4: "mat4",
SAMPLER_2D: "sampler2D"
},
bq = function (O, r) {
switch (O) {
case "float":
return 0;
case "vec2":
return new Float32Array(2 * r);
case "vec3":
return new Float32Array(3 * r);
case "vec4":
return new Float32Array(4 * r);
case "int":
case "sampler2D":
return 0;
case "ivec2":
return new Int32Array(2 * r);
case "ivec3":
return new Int32Array(3 * r);
case "ivec4":
return new Int32Array(4 * r);
case "bool":
return !1;
case "bvec2":
return so(2 * r);
case "bvec3":
return so(3 * r);
case "bvec4":
return so(4 * r);
case "mat2":
return new Float32Array([1, 0, 0, 1]);
case "mat3":
return new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);
case "mat4":
return new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])
}
},
so = function (T) {
for (var O = new Array(T), y = 0; y < O.length; y++) O[y] = !1;
return O
},
jo = function (H, C) {
var k = {
data: {}
};
k.gl = H;
for (var z = o.keys(C), c = 0; c < z.length; c++) {
var e = z[c],
i = e.split("."),
D = i[i.length - 1],
T = mr(i, k),
F = C[e];
T.data[D] = F, T.gl = H, o.defineProperty(T, D, {
get: id(D),
set: jk(D, F)
})
}
return k
},
id = function (n) {
var U = Op.replace("%%", n);
return new Function(U)
},
jk = function (o, F) {
var C, D = im.replace(/%%/g, o);
return C = 1 === F.size ? Lb[F.type] : Ac[F.type], C && (D += "\nthis.gl." + C + ";"), new Function("value", D)
},
mr = function (b, n) {
for (var x = n, S = 0; S < b.length - 1; S++) {
var Q = x[b[S]] || {
data: {}
};
x[b[S]] = Q, x = Q
}
return x
},
Op = ["return this.data.%%.value;"].join("\n"),
im = ["this.data.%%.value = value;", "var location = this.data.%%.location;"].join("\n"),
Lb = {
"float": "uniform1f(location, value)",
vec2: "uniform2f(location, value[0], value[1])",
vec3: "uniform3f(location, value[0], value[1], value[2])",
vec4: "uniform4f(location, value[0], value[1], value[2], value[3])",
"int": "uniform1i(location, value)",
ivec2: "uniform2i(location, value[0], value[1])",
ivec3: "uniform3i(location, value[0], value[1], value[2])",
ivec4: "uniform4i(location, value[0], value[1], value[2], value[3])",
bool: "uniform1i(location, value)",
bvec2: "uniform2i(location, value[0], value[1])",
bvec3: "uniform3i(location, value[0], value[1], value[2])",
bvec4: "uniform4i(location, value[0], value[1], value[2], value[3])",
mat2: "uniformMatrix2fv(location, false, value)",
mat3: "uniformMatrix3fv(location, false, value)",
mat4: "uniformMatrix4fv(location, false, value)",
sampler2D: "uniform1i(location, value)"
},
Ac = {
"float": "uniform1fv(location, value)",
vec2: "uniform2fv(location, value)",
vec3: "uniform3fv(location, value)",
vec4: "uniform4fv(location, value)",
"int": "uniform1iv(location, value)",
ivec2: "uniform2iv(location, value)",
ivec3: "uniform3iv(location, value)",
ivec4: "uniform4iv(location, value)",
bool: "uniform1iv(location, value)",
bvec2: "uniform2iv(location, value)",
bvec3: "uniform3iv(location, value)",
bvec4: "uniform4iv(location, value)",
sampler2D: "uniform1iv(location, value)"
},
_r = function (g) {
function J(I) {
if ("string" != typeof I) return 0 | I;
switch (I) {
case "low":
return 512;
case "medium":
return 1024;
case "ultra":
return 4096;
default:
return 2048
}
}
var N = this;
N.enable = !1;
var j, o, P = u.graph3dViewShadowType,
t = u.graph3dViewShadowIntensity,
I = u.graph3dViewShadowBias,
q = u.graph3dViewShadowQuality,
e = u.graph3dViewShadowRadius,
T = u.graph3dViewShadowDegreeX,
B = u.graph3dViewShadowDegreeZ,
L = 1,
U = J(q),
r = !1,
H = new O.Math.Matrix4,
X = new O.Math.Matrix4,
C = N.pvMatrix = new O.Math.Matrix4;
N.render = function () {
if (!g._picking && N.enable) {
var o = g.getGL();
if (o) {
r && N.setupShadowCamera(), g._glCapabilities && (U = Math.min(U, g._glCapabilities.maxTextureSize)), N.map ? j.setSize(U, U) : j = N.map = new fq(g, g.getGL(), 0, 0, {
samples: 1,
minFilter: Ah.NEAREST,
magFilter: Ah.NEAREST,
width: U,
height: U
}), o._shadowShader || (o._shadowShader = new Cm.Shader(o, _r.shaderSrc.vs, _r.shaderSrc.fs));
var V = g._frameState,
O = V.renderState.glState;
O.blend.enabled = !1, O.depth.enabled = !0, O.depth.mask = !0;
var l = O.color.clear.slice(0);
qe(o, [1, 1, 1, 1]), V.renderState.useProgram(o._shadowShader.program), R(), qe(o, l)
}
}
}, N.getShadow = function () {
var Z = {
degreeX: T,
degreeZ: B,
intensity: t,
quality: q,
type: P,
radius: e,
bias: I
};
return 1 !== L && (Z.boundExtend = L), Z
}, N.setShadow = function (l, v) {
l = !!l;
var E = N.enable !== l;
N.enable = l, "object" == typeof v && (v.intensity !== Z && (t = v.intensity), v.bias !== Z && (I = v.bias), v.radius !== Z && (e = v.radius), v.degreeX !== Z && (T = v.degreeX), v.degreeZ !== Z && (B = v.degreeZ), v.quality !== Z && (q = v.quality), v.type !== Z && P !== v.type && (P = v.type, E = !0), U = J(q), v.boundExtend !== Z && (L = v.boundExtend)), l && N.setupShadowCamera(), E && Vo(g), g.iv()
}, N.refresh = function () {
this.enable && (this.setupShadowCamera(), g.iv())
}, N.tryUpdateBounding = function (i) {
var J = this.boundingSphere;
if (J) {
var h = (new br).fromArray(sj(i, g.getMat(i))),
l = i.getAnchor3d(),
K = new tl;
J.containsPoint(K.set(0 - l.x, 0 - l.y, 0 - l.z).applyMatrix4(h)) && J.containsPoint(K.set(0 - l.x, 0 - l.y, 1 - l.z).applyMatrix4(h)) && J.containsPoint(K.set(0 - l.x, 1 - l.y, 0 - l.z).applyMatrix4(h)) && J.containsPoint(K.set(0 - l.x, 1 - l.y, 1 - l.z).applyMatrix4(h)) && J.containsPoint(K.set(1 - l.x, 0 - l.y, 0 - l.z).applyMatrix4(h)) && J.containsPoint(K.set(1 - l.x, 0 - l.y, 1 - l.z).applyMatrix4(h)) && J.containsPoint(K.set(1 - l.x, 1 - l.y, 0 - l.z).applyMatrix4(h)) && J.containsPoint(K.set(1 - l.x, 1 - l.y, 1 - l.z).applyMatrix4(h)) || N.setupShadowCamera()
}
}, N.createShadow = function (K) {
K || (K = g._frameState.renderState.directUniforms()), K.shadowMatrix = C.toArray(), K.shadowMap = j.texture, K.shadowSize = [j.width, j.height], K.shadowIntensity = t, K.shadowBias = I, K.shadowRadius = e
}, N.genShaderDefine = function () {
var y = "#define USE_SHADOWMAP\n";
return "hard" === P ? y += "#define SHADOWMAP_TYPE_PCF\n" : "soft" === P && (y += "#define SHADOWMAP_TYPE_PCF_SOFT\n"), y
};
var D;
N.setupShadowCamera = function () {
o || (o = N.boundingSphere = new O.Math.Sphere), r = !1;
var $, K, F = g.getBoundingBox(g.dm().toDatas(function (V) {
return V.s("shadow.cast") && g.isVisible(V)
}));
F ? ($ = new tl(F.min), K = new tl(F.max)) : ($ = new tl(-256, -256, -256), K = new tl(256, 256, 256), r = !0), o.set($.clone().add(K).multiplyScalar(.5), .5 * $.distanceTo(K) * L);
var y, v = o.radius,
p = g.getBoundingBox(g.dm().toDatas(function (q) {
return (q.s("shadow.cast") || q.s("shadow.receive")) && g.isVisible(q)
}));
if (p) {
$.copy(p.min), K.copy(p.max);
var U = .5 * $.distanceTo(K);
y = U + Math.min(U, v + o.center.distanceTo($.add(K).multiplyScalar(.5)))
} else y = 2 * v;
D = lk(kn(), -v, v, -v, v, y / 1e3, y), C.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1), C.multiply(H.fromArray(D));
var b = Math.tan(-T * Math.PI / 180),
l = Math.tan(-B * Math.PI / 180),
Y = v / Math.sqrt(b * b + l * l + 1),
s = new tl(Y * b, Y, Y * l);
H.lookAt(s, new tl(0, 0, 0), new tl(0, 1, 0)).setPosition(s.add(o.center)), H.getInverse(H), C.multiply(H)
};
var R = function () {
var P = g.getGL(),
f = U,
M = U;
j.setSize(P, f, M), j.bind(P), P.clear(Ah.COLOR_BUFFER_BIT | Ah.DEPTH_BUFFER_BIT);
var l = g._frameState,
w = l.renderState,
I = w.directUniforms(),
C = w.directAttribs(),
J = w.directState();
I.projectionMatrix = D;
var Y = g._viewport;
g.setViewport(P, 0, 0, f, M);
var X, i, c, q;
for (X = 0, i = kl.length; i > X; X++) c = kl[X], Sc[c].ignore || (q = g._40Q.get(c), q && (N.renderItems(P, I, C, q.opaque, J), N.renderItems(P, I, C, q.transparent, J)));
j.unbind(P), g.setViewport(P, Y[0], Y[1], Y[2], Y[3])
};
N._renderDirect = function (P, z, d, t) {
d && d.length && (z.position = Sl(P, g._buffer.vs, d, F), t ? (ym(P, g._buffer.is, t), os(P, 0, t.length, null, t instanceof Uint32Array ? P.UNSIGNED_INT : null)) : ie(P, 0, d.length / 3))
}, N.renderShapeModel = function (k, $, g, d) {
var Q, u, j;
if (ip(g))
for (u = 0, j = g.length; j > u; u++) Q = g[u], Q && N.renderShapeModel(k, $, Q, d);
else dk(g) ? N.renderShapeModel(k, $, bf(d, g), d) : xl(g) && (g.shape3d ? N.renderShapeModel(k, $, g.shape3d, d) : N.renderShapeModelImpl(k, $, g))
}, N.renderShapeModelImpl = function (w, y, p) {
ko(p), N._renderDirect(w, y, p.vs, p.is), N._renderDirect(w, y, p.top_vs, p.top_is), N._renderDirect(w, y, p.bottom_vs, p.bottom_is), N._renderDirect(w, y, p.from_vs, p.from_is), N._renderDirect(w, y, p.to_vs, p.to_is)
}, N.renderItems = function (Q, F, r, I, $) {
var L, v, B, b, l, K = I.length;
for (L = 0; K > L; L++) v = I[L], b = v.ui, B = v.data, !Kc(B) && B.s("shadow.cast") && g.isVisible(B) && (l = b.shapeModel || bf(b), l || (l = B instanceof O.Node && !(B instanceof O.Shape) ? {
vs: Ef,
is: Lq
} : [b.left, b.front, b.right, b.back, b.top, b.bottom]), F.modelViewMatrix = (b.mat ? X.fromArray(b.mat) : X.identity()).premultiply(H).toArray(), $.cullFace.enabled = !!B.s("shape3d.reverse.cull"), N.renderShapeModel(Q, r, l, b))
}
};
_r.shaderSrc = {
vs: ["uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "attribute vec3 position;", "void main() {", "vec3 transformed = vec3( position );", "vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );", "gl_Position = projectionMatrix * mvPosition;", "}"].join("\n"),
fs: ["precision highp float;", "const float PackUpscale = 256. / 255.;", "const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );", "const float ShiftRight8 = 1. / 256.;", "vec4 packDepthToRGBA( const in float v ) {", "vec4 r = vec4( fract( v * PackFactors ), v );", "r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale;", "}", "void main() {", "gl_FragColor = packDepthToRGBA( gl_FragCoord.z );", "}"].join("\n")
}, _r.PARAMS = ["quality", "intensity", "bias", "radius", "type", "degree.x", "degree.z"];
var lf = O.Light = function () {
fi(lf, this), this.s(ep, z[ep]), this.s(Lm, "sphere"), this.s("shape3d.reverse.cull", !0), this.s3(20, 20, 20)
};
ki("Light", Dp, {
_image: "light_icon",
_icon: "light_icon",
onStyleChanged: function (P, w, i) {
lf.superClass.onStyleChanged.apply(this, arguments), P === ep && this.s("shape3d.color", i)
}
});
var Bl = Eh.FrameState = function (M, O) {
this.renderState = ts.for(O), this.picking = !1, this.envmapReflectivity = .5, this.cameraPosition = Z, this.projectMatrix = Z, this.viewMatrix = Z, this.view = M, this.defaultProgram = Z, this.pickColorMap = Z, this._pvStack = [], this._renderStateStack = []
};
Bl.prototype.savePV = function () {
var e = this.view;
this._pvStack.push([Ql(this.projectMatrix), Ql(this.viewMatrix), e._18Q, Ql(e._7O)])
}, Bl.prototype.restorePV = function () {
var B = this._pvStack.pop();
if (B) {
var T = this.view;
this.projectMatrix = T._projectMatrix = B[0], this.viewMatrix = T._viewMatrix = B[1], T._18Q = B[2], T._7O = B[3]
}
}, Bl.prototype.setPV = function (s, z) {
var I = this.view,
M = !1;
if (s && (this.projectMatrix = I._projectMatrix = s, M = !0), z && (this.viewMatrix = I._viewMatrix = z, I._7O = Ql(z), M = !0), M) {
var T = I.getWidth(),
n = I.getHeight(),
l = Ql(this.projectMatrix);
I._18Q = xo(l, l, z), I._18Q._wh = T / n
}
}, Bl.prototype.syncEnv = function (x) {
var G = this,
l = G.view;
G.envmapReflectivity = l._envmapReflectivity || .5, G.cameraPosition = l.getEye(), G.projectMatrix = l._projectMatrix, G.viewMatrix = l._viewMatrix, G.pickColorMap = x, G.picking = l.getGL()._picking
}, Bl.prototype.setGLState = function () {
var D = [0, 0, 0, 0],
$ = [!0, !0, !0, !0],
q = [-1, 1],
W = [Ah.FUNC_ADD, Ah.FUNC_ADD],
J = [Ah.SRC_ALPHA, Ah.ONE_MINUS_SRC_ALPHA, Ah.ONE, Ah.ONE_MINUS_SRC_ALPHA];
return function (T, m) {
var j = this,
E = j.renderState.gl,
X = j.renderState.glState;
X.dither = !1, m ? X.color.mask = $ : X.color.reset(), X.pixelStore.reset(), X.blend.color = D, X.blend.equation = W, X.blend.func = J, X.cullFace.enabled = !1, X.scissor.enabled = !1, X.depth.enabled = !0, X.depth.clear = 1, X.depth.func = E.LEQUAL, X.depth.range = q, X.stencil.enabled = !1, X.polygonOffset.enabled = !1, T ? (X.depth.mask = !1, X.blend.enabled = !0) : (X.depth.mask = !0, X.blend.enabled = !1)
}
}(), Bl.prototype.setUniforms = function (D) {
var o = this,
C = o.view,
r = o.renderState,
c = r.gl,
P = r.uniforms;
P.uBrightness = 1, P.uOpacity = 1, P.uPartOpacity = 1, P.uPick = o.picking, P.uTexture = !1, P.uBlendTexture = !1, P.uAlphaTest = z.alphaTest, P.uTransparent = !!D, P.uFix = !1, P.uBatchColor = !1, P.uBatchBlend = !1, P.uBatchBrightness = !1, P.uReflectivity = o.envmapReflectivity || .5, P.uCameraPosition = o.cameraPosition, P.uPMatrix = o.projectMatrix, P.uViewMatrix = o.viewMatrix, C.bindEnvMap(c), o.picking || (nc(C, c, Z), C._fogDisabled || (P.uFogColor = C._fogColor, P.uFogDensity = C._fogDensity, P.uFogNear = C._fogNear, P.uFogFar = C._fogFar))
}, Bl.prototype.drawLayer = function (O) {
return this.view.renderLayers(O, !0)
}, Bl.prototype.drawData = function (W, r, b) {
var m = this.view;
if (m.isVisible(W)) {
var Z = this.renderState,
c = Z.uniforms,
J = m.getData3dUI(W);
if (J) {
var l = Z.gl,
d = l._picking,
s = m._picking,
i = W._pickId;
b && (W._pickId = b), c.uPick = l._picking = m._picking = !!b, c.uTransparent = !!r, J._42(Z.gl, Z.program, r ? Q : j), c.uPick = l._picking = d, m._picking = s, W._pickId = i
}
}
};
var Hl = Eh.Graph3dView = function (Z, I) {
var r = this;
r._webGLVersion = 1, r._attributes = I || u.graph3dViewAttributes, r._25I = {}, r._view = ve(1, r);
var i = r._canvas = uo(r._view);
K(i, "webglcontextlost", function (s) {
s.preventDefault(), Vo(r), r._26I && r._doBufferGC(r._26I, !0), r._26I = F, r._1o.onContextLost(), r._35O = !0
}), K(i, "webglcontextrestored", function () {
r._35O = !1, r.iv()
}), r._40Q = new Ud, r._43Q = {}, r._44Q = -1, r._batchIndexMap = {}, r._batchModelMap = {}, r._wireframeIndexMap = {}, r._wireframeModelMap = {}, r._wireframeIndexMapSwap = {}, r._wireframeModelMapSwap = {}, r._polylineIndexMap = {}, r._polylineIndexMap = {}, r._polylineIndexMapSwap = {}, r._polylineIndexMapSwap = {}, r._8O = [], r._7O = kn(), r._6O = kn(), r._1o = new qo(r), r._30O = new Rk(r), r._31O = new Le(r), r._32O = new ap(r), r._raycaster = new Vf(r), r._highlightHelper = new ui(r), r._postProcessing = new Hs(r), r._41Q = [], r._42Q = 0, r.vr = new Es(r), r.shadowMap = new _r(r), r._33Q = !0, r._eye = Pm(u.graph3dViewEye), r._center = Pm(u.graph3dViewCenter), r._up = Pm(u.graph3dViewUp), r._lightChanged = !1, r._59O = [], r._spots = [], r._dirs = [], r._frameId = 0, r._batchInfoMap = {}, r.overlappingBox = new Rn(r), r.dm(Z ? Z : new jn), r._coreInteractor = new mq(this), r.setInteractors([new ps(r)]), r._initView()
},
Jo = {
fogDisabled: 1,
fogMode: 1,
dashDisabled: 1,
batchColorDisabled: 1,
batchBlendDisabled: 1,
batchBrightnessDisabled: 1,
ortho: 1
},
qd = 0;
Dn("Graph3dView", o, {
ms_v: 1,
ms_tip: 1,
ms_gv: 1,
ms_dm: 1,
ms_lp: 1,
ms_fire: 1,
ms_sm: 1,
_51o: 1,
ms_shadow: 1,
ms_ac: ["devicePixelRatio", "boundaries", "moveStep", "rotateStep", "editHelperDisabled", "blockSelectable", "sizeEditableFunc", "rotationEditableFunc", "editableFunc", "rotatable", "zoomable", "pannable", "walkable", "resettable", "mouseRoamable", "zoomToCenter", Fi, Pi, "firstPersonMode", dj, "movableFunc", "gridVisible", "gridSize", "gridGap", "gridColor", "originAxisVisible", "centerAxisVisible", "axisXColor", "axisYColor", "axisZColor", "editSizeColor", "rectSelectable", "rectSelectBackground", "headlightRange", "headlightColor", "headlightIntensity", "headlightAmbientIntensity", "headlightDisabled", "ortho", "orthoWidth", "fovy", "near", "far", to, sc, "up", "aspect", "fogDisabled", "fogMode", "fogDensity", "fogColor", "fogNear", "fogFar", "pickerResolution", "dashDisabled", "batchColorDisabled", "batchBlendDisabled", "batchBrightnessDisabled", "hoverDelay", "batchInfoMap", "rotateMinPhi", "rotateMaxPhi"],
_editable: !1,
_editHelperDisabled: u.graph3dViewEditHelperDisabled,
_blockSelectable: u.graph3dViewBlockSelectable,
_devicePixelRatio: Z,
_boundaries: Z,
_moveStep: u.graph3dViewMoveStep,
_rotateStep: u.graph3dViewRotateStep,
_rotateMinPhi: u.graph3dViewMinPhi === Z ? u.graph3dViewRotateMinPhi : u.graph3dViewMinPhi,
_rotateMaxPhi: u.graph3dViewMaxPhi === Z ? u.graph3dViewRotateMaxPhi : u.graph3dViewMaxPhi,
_pannable: u.graph3dViewPannable,
_rotatable: u.graph3dViewRotatable,
_walkable: u.graph3dViewWalkable,
_resettable: u.graph3dViewResettable,
_zoomable: u.graph3dViewZoomable,
_zoomToCenter: !0,
_firstPersonMode: u.graph3dViewFirstPersonMode,
_mouseRoamable: u.graph3dViewMouseRoamable,
_gridVisible: u.graph3dViewGridVisible,
_gridSize: u.graph3dViewGridSize,
_gridGap: u.graph3dViewGridGap,
_gridColor: u.graph3dViewGridColor,
_originAxisVisible: u.graph3dViewOriginAxisVisible,
_centerAxisVisible: u.graph3dViewCenterAxisVisible,
_axisXColor: u.graph3dViewAxisXColor,
_axisYColor: u.graph3dViewAxisYColor,
_axisZColor: u.graph3dViewAxisZColor,
_ortho: u.graph3dViewOrtho,
_orthoWidth: u.graph3dViewOrthoWidth,
_fovy: u.graph3dViewFovy,
_near: u.graph3dViewNear,
_far: u.graph3dViewFar,
_headlightColor: u.graph3dViewHeadlightColor,
_headlightIntensity: u.graph3dViewHeadlightIntensity,
_headlightRange: u.graph3dViewHeadlightRange,
_headlightAmbientIntensity: u.graph3dViewHeadlightAmbientIntensity,
_headlightDisabled: u.graph3dViewHeadlightDisabled,
_rectSelectable: u.graph3dViewRectSelectable,
_rectSelectBackground: u.graph3dViewRectSelectBackground,
_editSizeColor: u.graph3dViewEditSizeColor,
_autoMakeVisible: be,
_fogDisabled: u.graph3dViewFogDisabled,
_fogMode: u.graph3dViewFogMode,
_fogDensity: u.graph3dViewFogDensity,
_fogColor: u.graph3dViewFogColor,
_fogNear: u.graph3dViewFogNear,
_fogFar: u.graph3dViewFogFar,
_pickerResolution: u.graph3dViewPickerResolution,
_dashDisabled: u.graph3dViewDashDisabled,
_batchColorDisabled: u.graph3dViewBatchColorDisabled,
_batchBlendDisabled: u.graph3dViewBatchBlendDisabled,
_batchBrightnessDisabled: u.graph3dViewBatchBrightnessDisabled,
addCamera: function (d) {
var j = this,
P = o.freeze({
id: j._42Q++,
priority: d.priority || 0,
ignoreInPick: !!d.ignoreInPick,
render: d.render
});
d.switch3DStatus && (j._43Q[P.id] = !0), j._41Q.push(P), j._41Q.sort(function (n, l) {
return n.priority !== l.priority ? n.priority - l.priority : n.id - l.id
})
}, setEye: function (H, k, P) {
1 === arguments.length && (k = H[1], P = H[2], H = H[0]);
var C = this._eye;
C[0] = H, C[1] = k, C[2] = P, this.fp(to, F, C)
}, setCenter: function (E, i, X) {
1 === arguments.length && (i = E[1], X = E[2], E = E[0]);
var p = this._center;
p[0] = E, p[1] = i, p[2] = X, this.fp(sc, F, p)
}, setUp: function (_, i, c) {
1 === arguments.length && (i = _[1], c = _[2], _ = _[0]);
var g = this._up;
g[0] = _, g[1] = i, g[2] = c, this.fp("up", F, g)
}, getDevicePixelRatio: function () {
return this._picking ? this._1o._resolution : this._devicePixelRatio || ij
}, isTransparentMask: function (S) {
return S.s("transparent.mask")
}, getCoreInteractor: function () {
return this._coreInteractor
}, getHighlightHelper: function () {
return this._highlightHelper
}, getRaycaster: function () {
return this._raycaster
}, getAspect: function () {
var N = this,
o = N._aspect;
return o ? o : (o = N.getWidth() / N.getHeight(), o || 1.2)
}, getCanvas: function () {
return this._canvas
}, setDataModel: function (L) {
var P = this,
H = P._dataModel,
$ = P._selectionModel;
H !== L && (H && (H.ump(P.handleDataModelPropertyChange, P), H.umm(P.handleDataModelChange, P), H.umd(P.handleDataPropertyChange, P), $ || H.sm().ums(P.handleSelectionChange, P)), P._dataModel = L, L.mp(P.handleDataModelPropertyChange, P), L.mm(P.handleDataModelChange, P), L.md(P.handleDataPropertyChange, P), $ ? $._21I(L) : L.sm().ms(P.handleSelectionChange, P), P._postProcessing.handleDataModleChange(H, L), P.invalidateAll(!0), P.invalidateLight(), P.fp(uk, H, L), P._canvas.style.background = L.getBackground() || "")
}, handleDataModelPropertyChange: function (G) {
if ("background" === G.property) {
var A = this._canvas.style.background,
k = G.newValue || "";
this._canvas.style.background = k, this.fp("canvasBackground", A, k)
} else "envmap" === G.property ? this.iv() : "cubicEnvmap" === G.property && (this._lastEnvMap = Z, this.iv())
}, handleDataPropertyChange: function (G) {
var O = G.data;
this.invalidateData(O), Kc(O) && "s:light.type" === G.property ? this.invalidateLight() : "s:shadow.cast" === G.property ? this.shadowMap.tryUpdateBounding(O) : ("s:alwaysOnTop" === G.property || "s:shape3d.alwaysOnTop" === G.property) && (G.newValue ? O.setRenderLayer("top") : O.setRenderLayer(Z))
}, invalidateLight: function () {
this._lightChanged || (this._lightChanged = !0, this.iv())
}, onPropertyChanged: function (v) {
var j = this,
h = v.property;
j.iv(), j._18Q = F, "eye" === h ? j._33Q = !0 : "devicePixelRatio" === h ? j._42(F, j.getDevicePixelRatio()) : Jo[h] && Vo(j)
}, _5O: function (C) {
var L = C._22Q();
return L ? new L(this, C) : F
}, getData3dUI: function (A) {
var g = this._25I[A._id];
return g === Z && (g = this._5O(A), this._25I[A._id] = g), g
}, invalidateAll: function (W) {
var r = this;
if (W) {
for (var f in r._25I) {
var z = r._25I[f];
z && z.dispose()
}
r._25I = {}, r.iv(), dn(r)
} else dn(r), r.dm().each(function (L) {
r.invalidateData(L)
})
}, invalidateSelection: function () {
var R = this;
R.sm().each(function (j) {
R.invalidateData(j)
})
}, invalidateData: function (d) {
var L = this,
m = L.getData3dUI(d);
m && (m.iv(), L.iv()), dn(L, d)
}, getShape3dText: function (x) {
return x.getStyle("shape3d.text") || this.getLabel(x)
}, invalidateBatch: function (j) {
var z = this,
r = z._40Q;
r.each(function (N) {
z._invalidateBatch(N.batchModelMap, N.batchIndexMap, N.polylineModelMap, N.polylineIndexMap, N.wireframeModelMap, N.wireframeIndexMap, j), N.markBatchInvalid()
})
}, _invalidateBatch: function (h, L, s, i, U, P, n) {
var o = this,
d = h[n],
R = [],
u = {};
if (d) {
d.ds.forEach(function (A) {
var B = o.getData3dUI(A);
B && B.iv(), delete L[A._id], R.push(A._id)
}), delete h[n];
for (var e, p, J, M, x, j, l, I, F, A = [U, s], m = [P, i], T = 0; T < A.length; T++) {
var H = A[T],
O = m[T];
for (u = {}, I = 0; I < R.length; I++) {
var t = O[R[I]];
if (t) {
delete O[R[I]], F = t.batch, e = H[F];
var V = t.begin,
z = t.size,
_ = 3 * V,
S = 3 * z,
E = 4 * V,
W = 4 * z;
for (p = e.ds, J = e.vs, M = e.cs, x = e.ps, j = e.ls, l = t.index, e.invalidate = !0, p[l] = Z, l = _; _ + S > l; l++) J[l] = Z;
for (l = E; E + W > l; l++) M[l] = Z;
for (l = E; E + W > l; l++) x[l] = Z;
if (j)
for (l = _; _ + S > l; l++) j[l] = Z;
u[F] = !0
}
}
for (F in u) {
e = H[F], p = e.ds, J = e.vs, M = e.cs, x = e.ps, j = e.ls;
var K = [];
for (l = 0; l < p.length; l++) p[l] !== Z && K.push(p[l]);
if (0 === K.length) delete H[F];
else {
for (e.ds = K, K = [], l = 0; l < J.length; l++) J[l] !== Z && K.push(J[l]);
for (e.vs = K, K = [], l = 0; l < M.length; l++) M[l] !== Z && K.push(M[l]);
for (e.cs = K, K = [], l = 0; l < x.length; l++) x[l] !== Z && K.push(x[l]);
if (e.ps = K, j) {
for (K = [], l = 0; l < j.length; l++) j[l] !== Z && K.push(j[l]);
e.ls = K
}
}
}
}
o.iv()
}
}, handleDataModelChange: function (y) {
var B = this,
J = y.kind,
n = y.data;
if ("add" === J) B.invalidateData(n), Bk(n) && n.getEdgeGroup() && n.getEdgeGroup().eachSiblingEdge(B.invalidateData, B), Kc(n) && B.invalidateLight();
else if (J === Ce) {
var r = n._id,
L = B._25I[r];
L && (L.dispose(), delete B._25I[r], B.iv()), n === B._currentSubGraph && B.setCurrentSubGraph(F), dn(B, n), Kc(n) && B.invalidateLight()
} else J === Tg && (B.invalidateAll(!0), B.setCurrentSubGraph(F), dn(B), B.invalidateLight())
}, toCanvas: function (o, n, C) {
var p = this,
k = p.getGL();
if (p.validate(), o) {
var r = k.getParameter(k.COLOR_CLEAR_VALUE);
qe(k, o)
}
p._42(F, 1);
var j = p.getWidth() || 1,
I = p.getHeight() || 1,
G = new Uint8Array(4 * j * I),
l = uo(),
Z = l.getContext("2d");
k.readPixels(0, 0, j, I, k.RGBA, k.UNSIGNED_BYTE, G), Bn(l, j, I, 1);
for (var t = Z.getImageData(0, 0, j, I), e = t.data, B = 0; B < e.length; B += 4) {
var L = B / 4,
i = T(L / j),
J = L - i * j;
L = 4 * ((I - 1 - i) * j + J), e[L] = G[B], e[L + 1] = G[B + 1], e[L + 2] = G[B + 2], e[L + 3] = G[B + 3]
}
if (Z.putImageData(t, 0, 0), o && qe(k, r), p._42(F, p.getDevicePixelRatio()), n && C) {
var d = uo(),
X = d.getContext("2d");
return Bn(d, n, C, 1), u.drawImage(X, l, 0, 0, n, C), d
}
return l
}, toDataURL: function (X, _) {
var c = this,
v = c.getGL();
if (c.validate(), X) {
var l = v.getParameter(v.COLOR_CLEAR_VALUE);
qe(v, X)
}
c._42(F, 1);
var z = c._canvas.toDataURL(_ || "image/png", 1);
return X && qe(v, l), c._42(F, c.getDevicePixelRatio()), z
}, getGL: function () {
var D = this._26I;
if (D) return this.acquireProgram(), D;
if (!this._35O) {
var H = this,
A = H._canvas,
O = H._attributes;
if (!O || O.requestWebGL2 !== !1) try {
D = A.getContext("webgl2", O) || A.getContext("experimental-webgl2", O), D && (H._webGLVersion = 2, H._26I = D)
} catch (u) { }
if (!D) try {
D = A.getContext("webgl", O) || A.getContext("experimental-webgl", O)
} catch (u) {
throw new Error("WebGL not supported")
}
if (!D) throw new Error("WebGL not supported");
H._26I = D;
var q = H._frameState = new Bl(this, D);
H._glExtensions = new E(D), H._glCapabilities = new B(D, H._glExtensions), H._2O = {}, D._emptyCubeTexture = Gp(D), D._compiledShader = {}, D._emptyTexture = ze(D), D._emptyBlendTexture = ze(D), D._bufPool = {}, D._id = ++qd, q.setGLState(), H._buffer = {
vs: el(D),
ns: el(D),
is: el(D),
uv: el(D),
batchColor: el(D),
batchBlend: el(D),
batchBrightness: el(D),
lineDistance: el(D)
}, H._1O = rg(D);
var Y = H._cube = {
vs: el(D),
ns: el(D),
is: el(D),
uv: el(D)
};
return bm(D, Y.vs, Ef), bm(D, Y.ns, mn), bm(D, Y.uv, mi), eo(D, Y.is, Lq), H.acquireProgram(), D._renderInfo = {
calls: 0,
vertices: 0,
faces: 0,
lines: 0,
points: 0,
frame: 0,
cacheTimeCost: 0
}, D
}
}, getEnvmap: function () {
return this._glCapabilities && this._glCapabilities.maxVertexTextures < u.graph3dEnvmapCapabilityRequire ? null : this.dm().getEnvmap()
}, acquireProgram: function () {
var D = this,
d = D._26I;
if (d) {
var s = u.getImage(D.getEnvmap()),
G = s && s.tagName ? !0 : !1,
m = D._prg && D._prg.envMapFlag ? !0 : !1;
if (!D._prg || G !== m) {
var _ = D._prg = d.createProgram();
if (!_) return F;
_.envMapFlag = G;
var e = D._dirs.length,
z = D._spots.length,
l = D._59O.length,
S = ["uPMatrix", "uMVMatrix", "uMMatrix", "uReflectivity", "uViewMatrix", "uUseEnvMap", "uEnvMap", "uCameraPosition", "uNMatrix", "uViewMatrix", "aNormal", "aUv", "uOffsetScale", "uDiffuse", "uBlend", "uBlendColor", "uBrightness", "uPartOpacity", "uAlphaTest", "uTransparent", "uClipDirection", "uClipPercent", "uTexture", "uBlendTexture", "uSampler", "uBlendSampler", "uDiscardSelectable", "uFix", "uPick", "uReverseFlip", "uFixPickReverseColor", "uBatchBrightness", "aBatchBrightness", "uBatchColor", "aBatchColor", "uBatchBlend", "aBatchBlend", "uDash", "aLineDistance", "uDashDistance", "uDashGapDistance", "uLight", "uHeadlightRange", "uHeadlightAmbientIntensity", "uHeadlightColor", "uFogColor", "uFogDensity", "uFogNear", "uFogFar"];
e && S.push("uDirColor", "uDirDirection"), z && S.push("uSpotColor", "uSpotRange", "uSpotAngle", "uSpotExponent", "uSpotPosition", "uSpotDirection"), l && S.push("uPointColor", "uPointRange", "uPointPosition"), dp || (Ae = fo(Ae.substring(0, Ae.indexOf("^#"))), Sp = fo(Sp), dp = !0);
var c = ["#define MAX_DIR " + e, "#define MAX_SPOT " + z, "#define MAX_POINT " + l, D._fogDisabled ? "" : "#define FOG", "exp2" === D.getFogMode() ? "#define FOG_EXP2" : "", D._dashDisabled ? "" : "#define DASH", G ? "#define USE_ENVMAP" : "", D.isOrtho() ? "#define ORTHOGRAPHIC" : "", D._batchColorDisabled ? "" : "#define BATCHCOLOR", D._batchBlendDisabled ? "" : "#define BATCHBLEND", D._batchBrightnessDisabled ? "" : "#define BATCHBRIGHTNESS", D.shadowMap.enable ? D.shadowMap.genShaderDefine() : "", ""].join("\n"),
O = Pl(d, _, d.VERTEX_SHADER, Ae.replace("PREFIX", c));
d.getShaderParameter(O, d.COMPILE_STATUS) || console.error("compile vs shader faild, error info : ", d.getShaderInfoLog(O));
var o = Pl(d, _, d.FRAGMENT_SHADER, Sp.replace("PREFIX", c));
d.getShaderParameter(o, d.COMPILE_STATUS) || console.error("compile fs shader faild, error info : ", d.getShaderInfoLog(o)), Uq ? S.push("aPosition") : (_.aPosition = 0, d.bindAttribLocation(_, 0, "aPosition")), d.linkProgram(_), S.forEach(function (U) {
_[U] = /^u/.test(U) ? d.getUniformLocation(_, U) : d.getAttribLocation(_, U)
});
var A = this._frameState;
A.renderState.program = A.defaultProgram = _, d.deleteShader(O), d.deleteShader(o)
}
}
}, getBrightness: function (p) {
var W = p.s("brightness"),
P = this.isSelected(p) ? p.s("select.brightness") : F;
return W == F ? P : P == F ? W : W * P
}, setHighlightMode: function (F) {
var J;
J = "selection" === F || "selected" === F ? ui.Mode.Selection : "mouseover" === F || "hover" === F ? ui.Mode.MouseOver : "style" === F ? ui.Mode.Style : ui.Mode.Disable;
var l = this._highlightHelper.mode;
this._highlightHelper.mode = J, this.firePropertyChange("highlightMode", l, J)
}, getHighlightMode: function () {
var i = this._highlightHelper.mode;
return i === ui.Mode.Selection ? "selected" : i === ui.Mode.MouseOver ? "hover" : i === ui.Mode.Style ? "style" : "disabled"
}, getDataHighlightMode: function (N) {
return N.s("highlight.mode")
}, getHighlightColor: function () {
return this._highlightHelper.color || z["highlight.color"]
}, setHighlightColor: function (x) {
var f = this._highlightHelper.color;
this._highlightHelper.color = x, this.firePropertyChange("highlightColor", f, x)
}, getHighlightWidth: function () {
return this._highlightHelper.width || z["highlight.width"]
}, setHighlightWidth: function (c) {
var E = this._highlightHelper.width;
this._highlightHelper.width = c, this.firePropertyChange("highlightWidth", E, c)
}, bindEnvMap: function (G) {
var V = this,
x = ts.for(G),
v = x.directUniforms(),
D = V.getEnvmap(),
S = u.getImage(D);
if (S && S.tagName) {
if (D !== V._lastEnvMap) {
var K = {};
if (V.dm().isCubicEnvmap()) {
var k = xc(S),
W = oo(S);
if (0 === k || 0 === W) return;
var U = k / 4,
M = W / 3,
X = {
top: {
x: U,
y: 0
},
left: {
x: 0,
y: M
},
front: {
x: U,
y: M
},
right: {
x: 2 * U,
y: M
},
back: {
x: 3 * U,
y: M
},
bottom: {
x: U,
y: 2 * M
}
};
["top", "left", "front", "right", "back", "bottom"].forEach(function (E) {
var h = X[E],
W = K[E] = uo();
Bn(W, U, M, 1);
var o = Wd(W);
o.drawImage(S, h.x, h.y, U, M, 0, 0, U, M), o.restore(), K[E] = u.resizeImagePOT(W, !0)
})
} else S = u.resizeImagePOT(S, !0);
V._envMapTexture && G.deleteTexture(V._envMapTexture);
var O = V._envMapTexture = G.createTexture();
G.activeTexture(G.TEXTURE0), G.bindTexture(G.TEXTURE_CUBE_MAP, O), G.texParameteri(G.TEXTURE_CUBE_MAP, G.TEXTURE_MAG_FILTER, G.LINEAR), G.texParameteri(G.TEXTURE_CUBE_MAP, G.TEXTURE_MIN_FILTER, G.LINEAR), G.texImage2D(G.TEXTURE_CUBE_MAP_POSITIVE_X + 0, 0, G.RGBA, G.RGBA, G.UNSIGNED_BYTE, K.right || S), G.texImage2D(G.TEXTURE_CUBE_MAP_POSITIVE_X + 1, 0, G.RGBA, G.RGBA, G.UNSIGNED_BYTE, K.left || S), G.texImage2D(G.TEXTURE_CUBE_MAP_POSITIVE_X + 2, 0, G.RGBA, G.RGBA, G.UNSIGNED_BYTE, K.top || S), G.texImage2D(G.TEXTURE_CUBE_MAP_POSITIVE_X + 3, 0, G.RGBA, G.RGBA, G.UNSIGNED_BYTE, K.bottom || S), G.texImage2D(G.TEXTURE_CUBE_MAP_POSITIVE_X + 4, 0, G.RGBA, G.RGBA, G.UNSIGNED_BYTE, K.front || S), G.texImage2D(G.TEXTURE_CUBE_MAP_POSITIVE_X + 5, 0, G.RGBA, G.RGBA, G.UNSIGNED_BYTE, K.back || S), G.bindTexture(G.TEXTURE_CUBE_MAP, G._emptyCubeTexture), V._lastEnvMap = D
}
v.uEnvMap = V._envMapTexture
}
}, getWireframe: function (H) {
var w = H.s("wf.visible"),
G = H.s("wf.width");
return w === !0 || G > 0 && "selected" === w && this.isSelected(H) ? {
color: H.s("wf.color"),
width: G,
"short": H.s("wf.short"),
mat: H.s("wf.mat")
} : void 0
}, _transformPointToViewSpace: function (i) {
var M = [i[0], i[1], i[2]];
return Td(M, this._viewMatrix), M
}, _transformDirectionToViewSpace: function (b, V) {
var H = [b[0], b[1], b[2]];
Td(H, this._viewMatrix);
var Q = V ? [V[0], V[1], V[2]] : [0, 0, 0];
Td(Q, this._viewMatrix);
var O = Q[0] - H[0],
X = Q[1] - H[1],
r = Q[2] - H[2],
U = Math.sqrt(O * O + X * X + r * r);
return U ? [O / U, X / U, r / U] : [O, X, r]
}, getWireframeGeometry: function (E) {
return E.s("wf.geometry") ? {
color: E.s("wf.color"),
width: E.s("wf.width"),
mat: E.s("wf.mat"),
geometry: !0
} : void 0
}, getBodyColor: function (v) {
return v.s("body.color")
}, getMat: function (v) {
return v.getMat ? v.getMat() : v.s("mat")
}, getFaceMat: function (t, I) {
return t.getFaceMat ? t.getFaceMat(I) : t.s(I + ".mat")
}, getFaceBlend: function (o, g) {
return o.s(g + ".blend") || o.s("all.blend")
}, getFaceColor: function (i, h) {
return i.s(h + ".color") || i.s("all.color")
}, getFaceImage: function (V, O) {
return V.s(O + ".image") || V.s("all.image")
}, getFaceBlendImage: function (A, G) {
return A.s(G + ".blend.image") || A.s("all.blend.image")
}, getFaceDiscardSelectable: function (l, e) {
var o = l.s(e + ".discard.selectable");
return o == F ? l.s("all.discard.selectable") : o
}, getFaceUv: function (e, $) {
return e.s($ + ".uv") || e.s("all.uv")
}, getFaceUvOffset: function (k, q) {
return k.s(q + ".uv.offset") || k.s("all.uv.offset")
}, getFaceUvScale: function (h, B) {
return h.s(B + ".uv.scale") || h.s("all.uv.scale")
}, getFaceLight: function (o, s) {
var O = o.s(s + ".light");
return O == F ? o.s("all.light") : O
}, getFaceVisible: function (T, k) {
var O = T.s(k + ".visible");
return O == F ? T.s("all.visible") : O
}, getFaceOpacity: function (S, J) {
var M = S.s(J + ".opacity");
return M == F ? S.s("all.opacity") : M
}, getFaceTransparent: function (m, Y) {
var l = m.s(Y + ".transparent");
return l == F ? m.s("all.transparent") : l
}, getFaceReverseColor: function (o, W) {
return o.s(W + ".reverse.color") || o.s("all.reverse.color")
}, getFaceReverseFlip: function (I, c) {
var d = I.s(c + ".reverse.flip");
return d == F ? I.s("all.reverse.flip") : d
}, getFaceReverseCull: function (P, t) {
var n = P.s(t + ".reverse.cull");
return n == F ? P.s("all.reverse.cull") : n
}, getTextureMap: function () {
return this._2O
}, deleteTexture: function (I) {
var T = this,
V = T._2O[I];
V && (delete T._2O[I], T.getGL().deleteTexture(V))
}, renderPickScene: function () {
var u = this.getGL();
this._picking = u._picking = !0, this.renderScene(), this._picking = u._picking = !1
}, invalidateCachedTexture: function (X) {
var m = this.getData3dUI(X);
m.invalidateCachedTexture(this.getGL()), this.invalidateData(X)
}, invalidateShape3dCachedImage: function (B) {
this.invalidateCachedTexture(B)
}, invalidateCachedGeometry: function (Q) {
var o = this.getData3dUI(Q);
o.invalidateCachedGeometry(), this.invalidateData(Q)
}, isInteractive: function (S) {
return S.s("interactive")
}, getTexture: function ($, g, E) {
if (!$) return F;
var w = this,
p = w.getGL(),
m = w._2O[$];
if (!m) {
var j = ii($),
C = {};
if (!j) return p._emptyTexture;
if (g) {
C.mipmapMaxLevel = g.s("texture.mipmap.max");
var Y = g.s("texture.wrap");
C.clampToEdge = "clampToEdge" === Y ? !0 : "repeat" === Y ? !1 : Z
}
if (j.uuid || (j.uuid = O.Math.generateUUID()), j.tagName) {
if (j.dynamic) return rg(p, j, w._1O, C);
m = w._2O[$] = rg(p, j, Z, C)
} else {
var L, R = g && (g.s("texture.cache") || g.s("shape3d.image.cache") || j.textureCache),
H = w.vr.isPresenting();
if (H && (g._textureUpdateFrame === p._renderInfo.frame ? R = !0 : g._textureUpdateFrame = p._renderInfo.frame), R && (L = w.getData3dUI(g), m = L.getCachedTexture(E), m && L.interactiveInfo && m.interactiveInfo && (L.interactiveInfo[m.interactiveInfo.key] = m.interactiveInfo.info)), !m) {
var P = p._renderInfo.textureCache;
if (R) {
if (P.time > u.graph3dMaxVectorCacheTime) return w.redraw(), p._emptyTexture;
if (!Dr(j, g)) return p._emptyTexture
}
var G;
g && (1 !== g.s("texture.scale") ? G = g.s("texture.scale") : 1 !== g.s("shape3d.texture.scale") && (G = g.s("shape3d.texture.scale"))), G || (G = 1);
var o = g && (g.s("fixSizeOnScreen") || g.s("shape3d.fixSizeOnScreen")),
b = o ? p.NEAREST : p.LINEAR;
o ? "number" == typeof o && (G *= 0 > o ? 1 : o) : g && (g.s("vector.dynamic") || g.s("shape3d.vector.dynamic")) && (L || (L = w.getData3dUI(g)), o = L.getVectorDynamicSize());
var h, s, f, J = g && g.s("shape3d");
"billboard" === J ? f = g.getTall() / g.getWidth() : "plane" === J && (f = g.getHeight() / g.getWidth());
var A = xc(j, g);
if (o) {
var i;
i = R ? w._devicePixelRatio || ij : w.getDevicePixelRatio(), h = o[0] > 0 ? o[0] * i : G * A * i, s = o[1] > 0 ? o[1] * i : G * (f ? oo(j, g, w, Math.min(4096, A * f)) : oo(j, g)) * i
} else h = G * A, s = G * (f ? oo(j, g, w, Math.min(4096, A * f)) : oo(j, g)); if (h >= 1 && s >= 1) {
var t = 0;
(R || H) && (t = Date.now());
var e = w._glCapabilities.maxTextureSize;
h = Math.min(h, e), s = Math.min(s, e);
var N = Cr(h, s);
if (!L && g && (L = w.getData3dUI(g)), L && L.interactiveInfo) {
var _ = $;
"object" == typeof _ && (_ = _.uuid || (_.uuid = O.Math.generateUUID()));
var S = L.interactiveInfo[_] = {};
N.interactiveInfo = S.bodyInfo = {
compInfos: [],
matrix: new Np,
rect: {
x: 0,
y: 0,
width: h,
height: s
}
}
}
Yd(N, j, 0, 0, h, s, g, w), N.interactiveInfo && (N.interactiveInfo = null), N.restore(), P.count++, P.pixels += h * s, g ? (C.minFilter = Mm(g.s("texture.filter.min") || g.s("texture.filter")) || b, C.magFilter = Mm(g.s("texture.filter.mag") || g.s("texture.filter")) || b) : C.minFilter = C.magFilter = b, R || H ? (m = rg(p, xm, null, C), L.setCachedTexture(m, E), P.time += Date.now() - t, S && (m.interactiveInfo = {
key: _,
info: S
}), xm = null) : m = rg(p, xm, w._1O, C)
}
}
}
}
return m
}, redraw: function () {
this.iv()
}, validateImpl: function () {
var B = this;
if (B._lightChanged) {
B._lightChanged = !1;
var h = [],
v = [],
N = [];
B.dm().each(function (c) {
if (Kc(c)) {
var F = c.s("light.type");
F === zg ? h.push(c) : F === Bo ? v.push(c) : F === Tf && N.push(c)
}
}), (h.length !== B._59O.length || v.length !== B._spots.length || N.length !== B._dirs.length) && Vo(B), B._59O = h, B._spots = v, B._dirs = N
}
B._42(), B._1o.iv()
}, getRenderInfo: function () {
var X = this.getGL();
return X ? X._renderInfo : void 0
}, getDebugTip: function () {
var i = this,
Y = i.getRenderInfo();
if (Y) {
var M = i.getGL()._validBufCount || 0,
v = "Draw Calls: " + Y.calls + " " + "Vertices: " + Y.vertices + " " + "Faces: " + Y.faces + " " + "Lines: " + Y.lines + " " + (Y.points ? "Points: " + Y.points + " " : "") + "Buffers: " + M + " " + "Cache Models: " + o.keys(Mq).length + " " + "Shape3d Models: " + o.keys(Zm).length;
if (i.vr.isPresenting() && (v += " VR fps: " + i.vr.getFps()), Y.textureCache) {
var n = Y.textureCache.count;
if (v += " 2D Dynamic Textures: " + Y.textureCache.count, n > 0) {
var d, f = Y.textureCache.pixels;
d = f > 1e6 ? Math.round(f / 1e6) + "M" : f > 1e3 ? Math.round(f / 1e3) + "K" : Math.round(f), v += " 2D Dynamic pixels: " + d
}
}
return v
}
}, getFrameState: function () {
return this._frameState
}, isBoundingBoxInView: function () {
var R = new O.Math.Box3,
d = new O.Math.Matrix4;
return function (H) {
var p = H;
if (p instanceof O.Data && (p = this.getData3dUI(p)), !p.mat) return !0;
var M = p.getBoundingBox();
R.copy(M).applyMatrix4(d.fromArray(p.mat));
var e = this.getFrustum();
return e.intersectsBox(R)
}
}(),
updateScene: function () {
var O = this;
O._81O = F, O.overlappingBox.clear(), O._40Q.init();
var l, i, M, C = this.dm().getDatas().getArray(),
m = C.length,
v = this.getGL(),
B = this._40Q;
for (l = 0; m > l; l++) i = C[l], M = this.getData3dUI(i), M && M.update(this, v, B);
O._40Q.onUpdated()
}, renderScene: function () {
function m(M, G) {
Q.setGLState(M, G), Q.setUniforms(M), Q.renderState.attribs.disable(), a = E.directUniforms(), H = E.directAttribs(), H.disable()
}
function l(P) {
for (; I > p; p++) {
var x = t[p];
if (!K || !x.ignoreInPick) {
if (x.priority >= P) break;
(!d._43Q[d._44Q = x.id] || Qg[ub.length]) && (x.render(c, d, Q), m())
}
}
}
var d = this;
d.shadowMap.render(), d._44Q = -1;
var H, Q = d._frameState,
E = Q.renderState,
h = E.glState,
a = E.directUniforms(),
c = d.getGL(),
o = d._prg;
E.syncLoss(), d._projectMatrix = Mc(d), wp(d, d._7O), d._viewMatrix = Ql(d._7O), Q.syncEnv(this._picking ? this.pickColorMap : Z), E.useProgram(o), m(!1, !0), c.clear(c.DEPTH_BUFFER_BIT);
var K = d._picking,
t = this._41Q,
p = 0,
I = t.length;
if (l(u.cameraPriority.skybox), K) {
var B = h.color.clear.slice(0);
qe(c, [0, 0, 0, 0])
} else qe(c, [0, 0, 0, 0]), h.blend.enabled = !1, h.depth.enabled = !1, h.depth.mask = !1, d.drawSky(c, o), d.drawReflectors(c) && (d._projectMatrix = Mc(d), wp(d, d._7O), d._viewMatrix = Ql(d._7O), Q.syncEnv(), m()), h.blend.enabled = !1, h.depth.enabled = !0, h.depth.mask = !0, a.uTransparent = !1, d._31O._42(c, o); if (!c.textureBatch || Qg[(ONE_FRAME_TIME - 6) / 2]) {
!K && d.shadowMap.enable && d.shadowMap.createShadow(a);
for (var U = 0, g = kl.length; g > U; U++) {
var f = kl[U],
e = Sc[f];
if (!e.ignore) {
var M = e.priority;
l(M), this.renderLayer(f)
}
}
h.depth.enabled = !1, a.uTransparent = !1, a.shadowReceive = !1, K ? d.drawFilter || d._30O._42(c, o) : (h.blend.enabled = !1, h.depth.mask = !0, d._32O._42(c, o), d._30O._42(c, o), d._highlightHelper._42(c, o)), h.depth.enabled = !0, l(u.cameraPriority.infinity), K && qe(c, B), bm(c, F), eo(c, F), d._44Q = -1
}
}, renderLayers: function (u, D) {
D && (u = Ck(u));
for (var m = 0, A = u.length; A > m; m++) this.renderLayer(u[m])
}, renderLayer: function (T) {
var I = this,
k = I._picking,
l = I._40Q.get(T);
if (l) {
var y, p, L, A = I.getGL(),
W = I._frameState,
q = W.renderState,
Z = q.glState,
v = q.directUniforms(),
d = l.opaque,
F = l.transparent,
x = l.batchModelMap,
B = l.polylineModelMap,
h = l.wireframeModelMap,
A = I.getGL(),
K = I._prg;
k || (Z.blend.enabled = !1, Z.depth.enabled = !0, Z.depth.mask = !0), v.uTransparent = !1, Sc[T].clearDepth !== !1 && A.clear(A.DEPTH_BUFFER_BIT);
var R = this.drawFilter;
if (R)
for (L = d, y = 0, p = L.length; p > y; y++) R(L[y].data) !== !0 && L[y].ui._42(A, K, j);
else {
for (L = d, y = 0, p = L.length; p > y; y++) L[y].ui._42(A, K, j);
if (k)
for (L = F, y = 0, p = L.length; p > y; y++) L[y].ui._46Q(A);
Zn(I, x), Eb(I, B), Eb(I, h)
} if (k || (Z.blend.enabled = !0, Z.depth.mask = !1), I._45Q = v.uTransparent = !0, R)
for (L = F, y = 0, p = L.length; p > y; y++) R(L[y].data) !== !0 && L[y].ui._42(A, K, Q);
else {
for (L = F, y = 0, p = L.length; p > y; y++) L[y].ui._42(A, K, Q);
Zn(I, x, null, !0), Eb(I, B, null, !0), Eb(I, h, null, !0)
}
I._45Q = null
}
}, drawV2: function (P) {
var L = this;
if (!L._35O && (!vi || Qg(vi))) {
var G = L.getWidth(),
x = L.getHeight();
if (G && x) {
var d = L.getGL();
if (d) {
var j = L._canvas;
if (P || (P = L.getDevicePixelRatio()), G !== j.clientWidth || x !== j.clientHeight) {
Bn(j, G, x, P);
var R = P;
G && Math.abs(d.drawingBufferWidth - G * P) > 1 && (R = Math.min(R, d.drawingBufferWidth / G)), x && Math.abs(d.drawingBufferHeight - x * P) > 1 && (R = Math.min(R, d.drawingBufferHeight / x)), R !== P && (L.setDevicePixelRatio(P = R), Bn(j, G, x, P)), L._18Q = null
}
d.clear(d.COLOR_BUFFER_BIT);
var r = d._renderInfo;
r.calls = 0, r.vertices = 0, r.faces = 0, r.lines = 0, r.points = 0, r.textureCache = {
time: 0,
count: 0,
pixels: 0
}, r.frame = ++L._frameId, r.cacheTimeCost = 0, r.reflectDepth = 0, G *= P, x *= P;
do {
if (L.vr.enable && L.vr.render(d, G, x)) break;
if (L.updateScene(), L._postProcessing.render(d, G, x)) break;
L.setViewport(d, 0, 0, G, x), L.renderScene()
} while (!1);
L._33Q = !1, L.countFrame(), L._doBufferGC(d)
}
}
}
}, _42: function (J, _) {
return this.drawV2(_)
}, drawReflectors: function (L) {
L._renderInfo.reflectDepth++;
var V, T, b, n = this,
P = n._dataModel.getReflectors(),
d = !1;
for (V in P) T = P[V], n.isVisible(T) && (b = n.getData3dUI(T), b && b.drawReflector(L) && (d = !0));
return L._renderInfo.reflectDepth--, d
}, isReflecting: function (M) {
return M._renderInfo.reflectDepth
}, getPostProcessing: function () {
return this._postProcessing
}, enablePostProcessing: function (_, s) {
return this._postProcessing.enableModule(_, s)
}, getPostProcessingModule: function (_) {
return this._postProcessing.getModule(_)
}, getPostProcessingValue: function (H, V) {
var e = this._postProcessing.getModule(H);
return e ? e[V] : Z
}, setPostProcessingValue: function (X, j, d) {
var F = this.getPostProcessingValue(X, j),
Z = this._postProcessing.getModule(X);
Z && F !== d && ("enable" === j ? this.enablePostProcessing(X, d) : Z[j] = d, this.firePropertyChange("postProcessing." + X + "." + j, F, d))
}, setViewport: function (k, T, n, Y, v) {
this._viewport = [T, n, Y, v], ts.for(k).directState().viewport = this._viewport
}, getViewport: function () {
return this._viewport
}, setBufferGCInterval: function (v) {
this._bufferGCInterval = v
}, _doBufferGC: function (O, k) {
var o, e, y = O._bufPool,
U = 0,
f = 0,
R = O._renderInfo.frame,
K = this._bufferGCInterval || 10;
for (o in y) U++, e = y[o], e && (k || R - e._fid > K ? (O.deleteBuffer(e._buf), e._buf = null, y[o] = null) : f++);
if (U / 2 > f && U > 128) {
var E = {};
for (o in y) y[o] && (E[o] = y[o]);
O._bufPool = E
}
O._validBufCount = f
}, _swapLineMap: function () {
var Y = this;
jb = Y._polylineModelMap, Y._polylineModelMap = Y._polylineModelMapSwap, Y._polylineModelMapSwap = jb, jb = Y._wireframeModelMap, Y._wireframeModelMap = Y._wireframeModelMapSwap, Y._wireframeModelMapSwap = jb, jb = Y._polylineIndexMap, Y._polylineIndexMap = Y._polylineIndexMapSwap, Y._polylineIndexMapSwap = jb, jb = Y._wireframeIndexMap, Y._wireframeIndexMap = Y._wireframeIndexMapSwap, Y._wireframeIndexMapSwap = jb
}, _updateSkybox: function (c) {
if (this._skybox && c) {
var h = c.property,
S = !1,
M = this._skybox;
if ("eye" === h || "forceUpdate" === h) {
var i = this._eye;
M.p3(i[0], i[1], i[2]), S = !0
}
if ("near" === h || "far" === h || "forceUpdate" === h) {
var w = this._near,
L = this._far,
k = M.getFinalScale3d();
if (k[0] /= 2, k[1] /= 2, k[2] /= 2, k[0] <= w || k[0] >= L || k[1] <= w || k[1] >= L || k[2] <= w || k[2] >= L) {
var Y = 2 * w * L / (w + L),
$ = Math.min(k[0], k[1], k[2]),
p = Y / $,
f = M.getScale3d();
M.setScale3d(f[0] * p, f[1] * p, f[2] * p), S = !0
}
}
S && this.invalidateData(M)
}
}, getSkyBox: function () {
return this.getSkybox()
}, setSkyBox: function (x) {
return this.setSkybox(x)
}, getSkybox: function () {
return this._skybox
}, setSkybox: function (g) {
var X = this._skybox;
return X === g ? (g && this._updateSkybox({
property: "forceUpdate"
}), void 0) : (X && (this._skyboxStyleMap && X.setStyleMap(this._skyboxStyleMap), this._skyboxStyleMap = null, this._skyboxAnchor3d && X.setAnchor3d(this._skyboxAnchor3d), this._skyboxAnchor3d = null, this._skyboxP3 && X.p3(this._skyboxP3), this._skyboxP3 = null), this._skybox = g, this.ump(this._updateSkybox, this), g && (g.dm() && g.dm().remove(g), this._skyboxStyleMap = O.Default.clone(g.getStyleMap()), this._skyboxAnchor3d = g.getAnchor3d(), g.setAnchor3d(.5, .5, .5), this._skyboxP3 = g.p3().slice(0), g.s({
"shape3d.reverse.flip": !0,
"shape3d.reverse.cull": !1,
"all.reverse.flip": !0,
"all.reverse.cull": !1,
"front.reverse.flip": !0,
"front.reverse.cull": !1,
"back.reverse.flip": !0,
"back.reverse.cull": !1,
"left.reverse.flip": !0,
"left.reverse.cull": !1,
"right.reverse.flip": !0,
"right.reverse.cull": !1,
"top.reverse.flip": !0,
"top.reverse.cull": !1,
"bottom.reverse.flip": !0,
"bottom.reverse.cull": !1
}), this.mp(this._updateSkybox, this), this._updateSkybox({
property: "forceUpdate"
})), this.fp("skybox", X, g), void 0)
}, drawSky: function (f, M) {
var N = this,
_ = N._skybox;
if (_) {
var A = ts.for(f).directUniforms(),
S = N._headlightIntensity,
E = ns(N._headlightColor),
M = N._prg;
1 !== S && (E = [E[0] * S, E[1] * S, E[2] * S]), A.uHeadlightColor = [E[0], E[1], E[2], 1];
var U = N.getData3dUI(_);
if (U) {
var R = N.isOrtho(),
W = R || this._computedProjectMatrix;
if (W) {
var n = N._projectMatrix;
R && (N._ortho = !1), A.uPMatrix = N._projectMatrix = Mc(N, !0)
}
var m = _.p3(),
p = this._eye;
(m[0] !== p[0] || m[1] !== p[1] || m[2] !== p[2]) && (_._position.x = p[0], _._54O = p[1], _._position.y = p[2]), U.validate(), U._42(f, M, C), W && (R && (N._ortho = !0), A.uPMatrix = N._projectMatrix = n)
}
f.clear(f.DEPTH_BUFFER_BIT), A.uHeadlightColor = [E[0], E[1], E[2], N._headlightDisabled ? 1 : 0]
}
}, getLogicalPoint: function (L) {
return Nm(L, this._canvas)
}, isRectOverlapping: function (Y) {
var z = this.getData3dUI(Y);
return z._rectOverlapping
}, getHitFaceInfo: function (Z) {
Z.target && (Z = this.lp(Z));
var v = this.getDataInfoAt(Z);
if (v) {
var Q = this.intersectObject(Z, v.data);
if (Q) return {
data: v.data,
face: Q.part
}
}
return F
}, unproject: function (Z, N) {
var W = this,
C = W.getWidth(),
F = W.getHeight(),
y = Z.target ? W.lp(Z) : Z,
i = y.x - C / 2,
K = y.y - F / 2,
u = 2 * (i / C),
p = 2 * (-1 * K / F);
N = N || 0;
var j = kn(),
I = Mc(W),
r = wp(W);
xo(j, I, r), Od(j);
var t = Ek([u, p, N, 1], j);
return [t[0] / t[3], t[1] / t[3], t[2] / t[3]]
}, getDataAt: function (N) {
var U = this.getDataInfoAt(N);
return U ? U.data : F
}, getDataInfoAt: function (H, M) {
return H.target && (H = this.lp(H)), this._1o.get(Cc(H.x, H.y, M), !0)
}, getDatasInRect: function (O) {
return this._1o.get(O)
}, setEditable: function (H) {
var K = this,
m = K._editable;
K._editable = H, this.fp(Me, m, H)
}, isEditable: function (v) {
var U = this;
return v ? U._editable ? Fq(v) ? v.s("3d.editable") ? U._editableFunc ? U._editableFunc(v) : !0 : !1 : !1 : !1 : U._editable
}, isSelectable: function (v) {
return v.s("3d.selectable") && this.sm().isSelectable(v)
}, isMovable: function (Y) {
var G = this;
return Bk(Y) && Y.getStyle(ej) !== _b ? !1 : Y.s("3d.movable") ? G._movableFunc ? G._movableFunc(Y) : !0 : !1
}, isSizeEditable: function (s) {
return Fq(s) ? this._sizeEditableFunc ? this._sizeEditableFunc(s) : !0 : !1
}, isRotationEditable: function (K) {
return Fq(K) && K.IRotatable !== !1 ? this._rotationEditableFunc ? this._rotationEditableFunc(K) : !0 : !1
}, handleDelete: function () {
this._editable && this.removeSelection()
}, zoomIn: function (Y) {
this.setZoom(lq, Y)
}, zoomOut: function (J) {
this.setZoom(1 / lq, J)
}, setZoom: function () {
var X = new tl,
k = new tl,
Z = new tl,
c = new tl;
return function (h, V) {
if (1 !== h) {
var R = this;
R._14o && R._14o.stop(!0);
var T, l = 1 / h;
X.copy(R.getCenter()), k.copy(R.getEye());
var g = R._ortho;
if (g) {
if (T = R._orthoWidth, T < R._moveStep && h > 1) return
} else if (X.distanceTo(k) < R._moveStep && 1 > l) return;
var u = !1;
return R._zoomToCenter === !1 && R._lastZoomLP && (Z.copy(k).sub(X).normalize(), R._81O = null, c.copy(R.getHitPosition(R._lastZoomLP, X.toArray(), Z.toArray())), u = !0, R._lastZoomHit = c), (V = Il(V)) ? (V.action = function (N) {
R.fi({
kind: R._zooming ? "betweenZoom" : "beginZoom"
}), R._zooming = 1;
var s = (l - 1) * N + 1;
g && R.setOrthoWidth(T * s), u ? (R.setEye(Z.lerpVectors(c, k, s).toArray()), R.setCenter(Z.lerpVectors(c, X, s).toArray())) : g || R.setEye(Z.lerpVectors(X, k, s).toArray())
}, V._37o = function () {
delete R._14o, delete R._zooming, R.fi({
kind: "endZoom"
}), R.onZoomEnded()
}, R._14o = Sf(V)) : (g && R.setOrthoWidth(T * l), u ? (R.setEye(Z.lerpVectors(c, k, l).toArray()), R.setCenter(Z.lerpVectors(c, X, l).toArray())) : g || R.setEye(Z.lerpVectors(X, k, l).toArray()), void 0)
}
}
}(),
setOrthoZoom: function (M, F) {
return this.setZoom(M, F)
}, getPositionInfo: function (k) {
var N = this,
l = N._eye,
j = N._center,
H = N.getAspect(),
q = k ? zc(fn(j, l, !0), fn(k, l)) : En(l, j);
if (N._ortho) {
var v = N._orthoWidth;
return {
length: q,
height: v / H,
width: v
}
}
var A = 2 * R(N._fovy / 2) * q;
return {
length: q,
height: A,
width: A * H
}
}, getCenterInfo: function () {
var G = this;
return G._81O || (G._81O = G.getPositionInfo()), Pm(G._81O)
}, rotate: function (p, B, X, O) {
var b = this;
if (p || B) {
O == F && (O = b._firstPersonMode), b._88O && b._88O.stop(!0);
var e = b._center,
N = b._eye,
l = b.getCenterInfo().length,
L = O ? e : N,
Y = O ? N : e,
v = fn(L, Y),
j = D(v[0], v[2]),
R = D(w(v[0] * v[0] + v[2] * v[2]), v[1]),
m = O ? sc : to;
return O && (B = -B), (X = Il(X)) ? (X.action = function (U) {
b.fi({
kind: b._rotating ? "betweenRotate" : "beginRotate"
}), b._rotating = 1;
var t = j + p * U,
T = R + B * U;
T = O ? W - vg(b, W - T) : vg(b, T), v[0] = l * n(T) * n(t), v[1] = l * k(T), v[2] = l * n(T) * k(t), L[0] = Y[0] + v[0], L[1] = Y[1] + v[1], L[2] = Y[2] + v[2], b.fp(m, F, L)
}, X._37o = function () {
delete b._88O, delete b._rotating, b.fi({
kind: "endRotate"
}), b.onRotateEnded()
}, b._88O = Sf(X)) : (j += p, R += B, R = O ? W - vg(b, W - R) : vg(b, R), v[0] = l * n(R) * n(j), v[1] = l * k(R), v[2] = l * n(R) * k(j), L[0] = Y[0] + v[0], L[1] = Y[1] + v[1], L[2] = Y[2] + v[2], b.fp(m, F, L), void 0)
}
}, pan: function (I, b, S, j) {
if (I || b) {
var u = this;
j == F && (j = u._firstPersonMode), u._89O && u._89O.stop(!0);
var m = wp(u),
x = [m[0] * I, m[4] * I, m[8] * I],
z = [m[1] * b, m[5] * b, m[9] * b],
$ = x[0] + z[0],
G = x[1] + z[1],
v = x[2] + z[2],
i = u._center,
W = u._eye;
if (j) {
var h = mb(u.getBoundaries(), W[0], W[2], W[0] + $, W[2] + v, w($ * $ + v * v));
$ = h[0], v = h[1]
}
if (S = Il(S)) {
var r = Pm(W),
C = Pm(i);
return S.action = function (s) {
u.fi({
kind: u._panning ? "betweenPan" : "beginPan"
}), u._panning = 1, i[0] = C[0] + $ * s, i[1] = C[1] + G * s, i[2] = C[2] + v * s, W[0] = r[0] + $ * s, W[1] = r[1] + G * s, W[2] = r[2] + v * s, u.fp(to, F, W), u.fp(sc, F, i)
}, S._37o = function () {
delete u._89O, delete u._panning, u.fi({
kind: "endPan"
}), u.onPanEnded()
}, u._89O = Sf(S)
}
i[0] += $, i[1] += G, i[2] += v, W[0] += $, W[1] += G, W[2] += v, u.fp(to, F, W), u.fp(sc, F, i)
}
}, walk: function (_, H, p) {
if (_) {
var y = this;
p == F && (p = y._firstPersonMode), y._90O && y._90O.stop(!0);
var t = y._center,
E = y._eye,
S = fn(t, E, !0);
if (p) {
var D = mb(y.getBoundaries(), E[0], E[2], E[0] + S[0] * _, E[2] + S[2] * _, X(_));
if (_ = En(D), !_) return;
S = [D[0] / _, 0, D[1] / _]
}
if (H = Il(H)) {
var Z = Pm(E),
R = Pm(t);
return H.action = function (T) {
y.fi({
kind: y._walking ? "betweenWalk" : "beginWalk"
}), y._walking = 1;
var p = _ * T;
E[0] = Z[0] + S[0] * p, E[1] = Z[1] + S[1] * p, E[2] = Z[2] + S[2] * p, t[0] = R[0] + S[0] * p, t[1] = R[1] + S[1] * p, t[2] = R[2] + S[2] * p, y.fp(to, F, E), y.fp(sc, F, t)
}, H._37o = function () {
delete y._90O, delete y._walking, y.fi({
kind: "endWalk"
}), y.onWalkEnded()
}, y._90O = Sf(H)
}
E[0] += S[0] * _, E[1] += S[1] * _, E[2] += S[2] * _, t[0] += S[0] * _, t[1] += S[1] * _, t[2] += S[2] * _, y.fp(to, F, E), y.fp(sc, F, t)
}
}, handleScroll: function (i, O) {
i.preventDefault();
var w = this,
A = w._moveStep,
o = w.getDataInfoAt(i);
if (o) {
var d = o.data;
if (d && w.isInteractive(d)) {
var B = w.intersectObject(i, d);
if (B) {
var _ = B.part,
h = ii(d.s(_ + ".image") || d.s("shape3d." + _ + ".image") || d.s("all.image") || d.s("shape3d.image"));
if (h && Dj(h.scrollable, d, w)) return
}
}
}
return w.isFirstPersonMode() ? (w.isPannable() && w.pan(0, O > 0 ? A : -A), void 0) : (w.isZoomable() && (w._lastZoomLP = w.lp(i), w.setZoom(0 > O ? 1 / _f : _f), w._lastZoomLP = w._lastZoomHit = null), void 0)
}, handlePinch: function (O, Q) {
if (this.isZoomable()) {
if (Math.abs(O - Q) < u.pinchZoomThreshold) return;
this.setZoom(Q > O ? 1 / db : db)
}
}, reset: function () {
this.setCenter(u.graph3dViewCenter), this.setEye(u.graph3dViewEye), this.setUp(u.graph3dViewUp)
}, moveSelection: function (n, q, M) {
var W = this;
W.dm().beginTransaction(), qc(this.sm().toSelection(this.isMovable, this), n, q, M), W.dm().endTransaction()
}, getMoveMode: function (H, s) {
var Q = s.s("3d.move.mode");
if (Q) return Q;
var W = "88",
V = "89",
p = "90";
return Pf(H) || pl[W] && pl[V] && pl[p] ? "xyz" : pl[W] && pl[V] ? "xy" : pl[W] && pl[p] ? "xz" : pl[V] && pl[p] ? "yz" : pl[W] ? "x" : pl[V] ? "y" : pl[p] ? "z" : "xz"
}, handleTick: function () {
var C = this,
p = !1,
Y = C._moveStep,
a = Y,
V = !1,
o = !0,
D = C._rotateStep * (o ? -1 : 1);
if (C.isWalkable() || (a = 0), C.isPannable() || (Y = 0), C.isRotatable() || (D = 0), C._32Q) {
var E = (mm() - C._32Q) / 50;
a *= E, Y *= E, D *= E
}
C._31Q && (td(C._31Q), delete C._31Q, delete C._32Q), sb() && (p = !0, C.pan(-Y, 0, V, o)), Fr() && (p = !0, C.pan(Y, 0, V, o)), $j() && (p = !0, Pf() ? C.pan(0, Y, V, o) : C.walk(a, V, o)), Ib() && (p = !0, Pf() ? C.pan(0, -Y, V, o) : C.walk(-a, V, o)), Wk() && (p = !0, C.rotate(-D, 0, V, o)), _i() && (p = !0, C.rotate(D, 0, V, o)), Nk() && (p = !0, C.rotate(0, -D / 2, V, o)), ri() && (p = !0, C.rotate(0, D / 2, V, o)), p && (C._32Q = mm(), C._31Q = $e(C.handleTick, C))
}, handleKeyDown: function (L) {
var p = this;
!ik(L) && Gj[L.keyCode] ? p.handleTick() : Dq(L) ? p.selectAll() : qq(L) ? p.handleDelete(L) : Cf(L) && this.isResettable() && p.reset()
}, checkDoubleClickOnNote: function (R, b, e) {
var A = this;
if (e === Rm) {
if (b.s("note.toggleable")) return b.s(ke, !b.s(ke)), A.fi({
kind: "toggleNote",
event: R,
data: b,
part: e
}), !0
} else if (e === Vk && b.s("note2.toggleable")) return b.s(Mh, !b.s(Mh)), A.fi({
kind: "toggleNote2",
event: R,
data: b,
part: e
}), !0;
return !1
}, checkDoubleClickOnRotation: function (W, _, p) {
return p === Pg ? (_.setRotationX(0), !0) : p === hb ? (_.setRotationY(0), !0) : p === pn ? (_.setRotationZ(0), !0) : !1
}, onRotateEnded: function () { }, onWalkEnded: function () { }, getViewRatio: function (n) {
var U = this;
if (U.isOrtho()) return U.getWidth() / U.getOrthoWidth();
var l = U.getCenter(),
J = U.getHeight(),
H = U.getEye(),
A = [l[0] - H[0], l[1] - H[1], l[2] - H[2]],
e = [n[0] - H[0], n[1] - H[1], n[2] - H[2]],
i = Math.sqrt(A[0] * A[0] + A[1] * A[1] + A[2] * A[2]),
R = 1 / Math.tan(U.getFovy() / 2);
return J * i * R / (e[0] * A[0] + e[1] * A[1] + e[2] * A[2])
}, inViewSpace: function (L) {
var T, k = this,
I = k._transformPointToViewSpace(L),
O = k.getAspect(),
S = k.getNear(),
$ = k.getFar();
return -I[2] < S || -I[2] > $ ? !1 : k.isOrtho() ? (T = k.getOrthoWidth() / 2, Math.abs(I[0]) <= T && Math.abs(I[1] * O) <= T) : (T = Math.sqrt(I[0] * I[0] + I[1] * I[1] + I[2] * I[2]) * Math.tan(k.getFovy() / 2), Math.abs(I[1] <= T) && Math.abs(I[0]) <= T * O)
}, getPVMatrix: function () {
var l, v = this;
return (l = v._18Q) || (l = Mc(v), v._18Q = xo(l, l, wp(v)), v._18Q._wh = v.getWidth() / 2 / v.getHeight()), l
}, getFrustum: function () {
var g = new br,
c = new Vc,
f = new Array(16);
return function () {
for (var e = this.getPVMatrix(), j = !1, $ = 0; 16 > $; $++) e[$] !== f[$] && (j = !0, f[$] = e[$]);
return j && c.setFromMatrix(g.fromArray(e)), c
}
}(),
toViewPosition: function (V) {
var x = this,
g = x.getWidth() / 2,
G = x.getHeight() / 2,
k = x.getPVMatrix();
return V = Ek([V[0], V[1], V[2], 1], k), {
x: g + g * V[0] / V[3],
y: G - G * V[1] / V[3],
z: V[2] / V[3]
}
}, getHitPosition: function (S, u, Q) {
var X = this,
T = X.getWidth(),
o = X.getHeight(),
h = S.target ? X.lp(S) : S,
i = h.x - T / 2,
x = h.y - o / 2,
z = X.getCenterInfo(),
E = wp(X);
u = u ? u : [0, 0, 0], Q = Q ? Q : [0, 1, 0], i = i / T * z.width, x = -1 * x / o * z.height;
var F = [E[0] * i, E[4] * i, E[8] * i],
q = [E[1] * x, E[5] * x, E[9] * x],
e = [F[0] + q[0], F[1] + q[1], F[2] + q[2]],
w = X.getCenter(),
N = cc(X, u, Q, [e[0] + w[0], e[1] + w[1], e[2] + w[2]]);
return N ? N : [0, 0, 0]
}, intersectObject: function (k, h) {
return this._raycaster.intersectObject(k, h)
}, intersectObjects: function (U, t, g) {
return this._raycaster.intersectObjects(U, t, g)
}, getLineLength: function (j) {
this.validate();
var Z = this.getData3dUI(j);
if (Z && Z.getCache) {
var K = Z.getCache();
if (K) return K[K.length - 1].length
}
return 0
}, getLineOffset: function (V, k) {
var i = this.getData3dUI(V);
if (i && i.getCache) {
var U = i.getCache();
if (U) {
var J = Qd(U, k);
if (!V.r3) return J;
var u = V.r3();
if (0 === u[0] && 0 === u[1] && 0 === u[2]) return J;
var x = new tl(V.p3()),
d = new tl(J.point).sub(x),
X = new tl(J.tangent).add(d),
R = (new fs).setFromEuler(new gg(u, V.getRotationMode(), !0));
return d.applyQuaternion(R), X.applyQuaternion(R), {
point: d.add(x),
tangent: X.sub(d).normalize()
}
}
}
return F
}, isLabelVisible: function () {
return !0
}, isNoteVisible: function () {
return !0
}, moveCamera: function (M, i, X) {
var V = this,
h = V.getEye();
h = [h[0], h[1], h[2]];
var B = V.getCenter();
if (B = [B[0], B[1], B[2]], M || (M = h), i || (i = B), V._flyAnim && V._flyAnim.stop(!0), X = Il(X), !X) return V.setEye(M[0], M[1], M[2]), V.setCenter(i[0], i[1], i[2]), delete V._flyAnim, !0;
var H = [M[0] - h[0], M[1] - h[1], M[2] - h[2]],
Q = [i[0] - B[0], i[1] - B[1], i[2] - B[2]];
return X.action = function (j) {
V.setCenter(B[0] + Q[0] * j, B[1] + Q[1] * j, B[2] + Q[2] * j), V.setEye(h[0] + H[0] * j, h[1] + H[1] * j, h[2] + H[2] * j)
}, X._37o = function () {
delete V._flyAnim
}, V._flyAnim = Sf(X)
}, flyTo: function () {
function u(X, R, C) {
if (C instanceof O.Node) {
v.fromArray(sj(C, R.getMat(C)));
var A = C.getAnchor3d();
X.push((new tl).set(0 - A.x, 0 - A.y, 0 - A.z).applyMatrix4(v)), X.push((new tl).set(0 - A.x, 0 - A.y, 1 - A.z).applyMatrix4(v)), X.push((new tl).set(0 - A.x, 1 - A.y, 0 - A.z).applyMatrix4(v)), X.push((new tl).set(0 - A.x, 1 - A.y, 1 - A.z).applyMatrix4(v)), X.push((new tl).set(1 - A.x, 0 - A.y, 0 - A.z).applyMatrix4(v)), X.push((new tl).set(1 - A.x, 0 - A.y, 1 - A.z).applyMatrix4(v)), X.push((new tl).set(1 - A.x, 1 - A.y, 0 - A.z).applyMatrix4(v)), X.push((new tl).set(1 - A.x, 1 - A.y, 1 - A.z).applyMatrix4(v))
}
}
var m = new tl,
D = new tl,
N = new tl,
c = new tl,
v = new br,
q = new O.Math.Quaternion,
d = new gg,
E = new Hi;
return function (W, e, p) {
var $ = this;
if (p !== Z) e = {
animation: e,
ratio: p
};
else {
var y = typeof e;
("boolean" === y || "object" === y && e.duration) && (e = {
animation: e
})
}
e = e || {}, m.fromArray($.getEye()), D.fromArray($.getCenter());
var g, H, Q = [],
X = e.center,
T = e.distance === Z;
if (X && N.fromArray(X), W instanceof O.Node) X || N.fromArray(W.p3()), T && (u(Q, $, W), g = Q.length);
else {
if (W || (W = $.dm().getDatas()), !W.length) return;
if ((T || !X) && (Q = [], W.forEach(function (_) {
u(Q, $, _)
}), g = Q.length, !g)) return;
X || (E.setFromPoints(Q), N.copy(E.min).add(E.max).multiplyScalar(.5))
} if ($.setCenter(N.x, N.y, N.z), c.subVectors(m, D), e.direction || e.worldDirection) {
!e.worldDirection && W instanceof O.Node ? q.setFromEuler(d.set(W.r3(), W.getRotationMode(), !0)) : q.set(0, 0, 0, 1);
var C = c.length();
c.fromArray(e.worldDirection || e.direction).applyQuaternion(q).setLength(C)
}
var B = 0;
if (T) {
var i, j, w, p = e.ratio || .8,
h = e.xRatio || p,
o = e.yRatio || p;
if ($.isOrtho()) {
var P = -1 / 0;
for ($._eye[0] = c.x + N.x, $._eye[1] = c.y + N.y, $._eye[2] = c.z + N.z, i = Mc($), xo(i, i, wp($)), H = 0; g > H; H++) w = Q[H], j = Ek([w.x, w.y, w.z, 1], i), P = Math.max(P, Math.max(Math.abs(j[0]) / h, Math.abs(j[1]) / o));
B = $.getOrthoWidth() * P, c.add(N)
} else {
for (var s, L, z = $.getNear(), A = 10; A--;) {
for ($._eye[0] = c.x + N.x, $._eye[1] = c.y + N.y, $._eye[2] = c.z + N.z, i = Mc($), xo(i, i, wp($)), s = !0, L = -1 / 0, H = 0; g > H; H++) {
if (w = Q[H], j = Ek([w.x, w.y, w.z, 1], i), j[3] < z && A) {
c.multiplyScalar(2), s = !1;
break
}
L = Math.max(L, Math.max(Math.abs(j[0]) / h, Math.abs(j[1]) / o) - j[3])
}
if (s) break
}
c.setLength(L + c.length()).add(N)
}
} else c.setLength(e.distance).add(N);
$._flyAnim && $._flyAnim.stop(!0);
var S = Il(e.animation);
if (S) {
$.setEye(m.x, m.y, m.z), $.setCenter(D.x, D.y, D.z);
var k = (new tl).subVectors(c, m),
U = (new tl).subVectors(N, D);
if (B) var f = $.getOrthoWidth();
var R = new tl,
l = new tl,
I = S.action,
n = S._37o,
V = m.clone(),
M = D.clone();
return S.action = function (J, O) {
R.copy(V).addScaledVector(k, J), l.copy(M).addScaledVector(U, J), $.setCenter(l.x, l.y, l.z), $.setEye(R.x, R.y, R.z), B && $.setOrthoWidth((B - f) * J + f), I && I(J, O)
}, S._37o = function () {
delete $._flyAnim, n && n()
}, {
lastEye: m,
lastCenter: D,
eye: c,
center: N,
orthoWidth: B,
animation: $._flyAnim = Sf(S)
}
}
return $.setEye(c.x, c.y, c.z), B && $.setOrthoWidth(B), delete $._flyAnim, {
lastEye: m,
lastCenter: D,
eye: c,
center: N,
orthoWidth: B
}
}
}(),
getBoundingBox: function () {
function Y(E, J, g) {
$.fromArray(sj(g, J.getMat(g)));
var A = g.getAnchor3d();
E.push((new tl).set(0 - A.x, 0 - A.y, 0 - A.z).applyMatrix4($)), E.push((new tl).set(0 - A.x, 0 - A.y, 1 - A.z).applyMatrix4($)), E.push((new tl).set(0 - A.x, 1 - A.y, 0 - A.z).applyMatrix4($)), E.push((new tl).set(0 - A.x, 1 - A.y, 1 - A.z).applyMatrix4($)), E.push((new tl).set(1 - A.x, 0 - A.y, 0 - A.z).applyMatrix4($)), E.push((new tl).set(1 - A.x, 0 - A.y, 1 - A.z).applyMatrix4($)), E.push((new tl).set(1 - A.x, 1 - A.y, 0 - A.z).applyMatrix4($)), E.push((new tl).set(1 - A.x, 1 - A.y, 1 - A.z).applyMatrix4($))
}
var $ = new br;
return function (d) {
if (d = d || this.sm().getSelection(), d instanceof O.Node && (d = [d]), 0 === d.length) return F;
var X = [];
d.forEach(function (Q) {
Fq(Q) && Y(X, this, Q)
}, this);
var N = [1 / 0, 1 / 0, 1 / 0],
Q = [-1 / 0, -1 / 0, -1 / 0];
return X.forEach(function (U) {
N[0] = Math.min(U.x, N[0]), N[1] = Math.min(U.y, N[1]), N[2] = Math.min(U.z, N[2]), Q[0] = Math.max(U.x, Q[0]), Q[1] = Math.max(U.y, Q[1]), Q[2] = Math.max(U.z, Q[2])
}), {
min: N,
max: Q
}
}
}(),
setBatchInfo: function (A, T) {
var w = this._batchInfoMap[A];
this._batchInfoMap[A] = T, this.fp("batchInfo", w, T)
}, getBatchInfo: function (q) {
return this._batchInfoMap[q] || ef[q]
}
}), Eh.RenderEnv = function (I) {
this.gv = I, this.enable = !1
}, o.defineProperties(Eh.RenderEnv.prototype, {
debugOn: {
get: function () {
return this._debugOn
}, set: function ($) {
this._debugOn = $, this.capture && this.capture()
}
}
}), o.assign(Eh.RenderEnv.prototype, {
renderEnvToCube: function (w, Y, m, N) {
var u = this,
s = u.gv;
if (!w || !Y || !m) return u.enable = !1, u._42 = null, void 0;
u.enable = !0;
var y = Math.floor(N / w * Y),
G = s.getGL(),
Q = u._renderTargets;
Q ? Q.length < m && (Q = u._renderTargets = Q.concat(new Array(m - Q.length))) : Q = u._renderTargets = new Array(m);
for (var U = 0; m > U; U++) Q[U] ? Q[U].setSize(G, N, y) : Q[U] = new Eh.RenderTarget(s, G, N, y);
var M = !1;
u.capture = function () {
M = !0, s._42(), M = !1
};
var c = new tl,
O = new tl,
H = new tl,
J = new tl,
V = (new tl).setY(0),
v = 2 * Math.PI / m,
T = w / 2 / Math.tan(Math.PI / m),
I = 2 * Math.atan2(Y / 2, T),
t = w / Y;
u._42 = function (S, R, r, B) {
var G = u._debugOn;
if (!M && !G) return !1;
c.copy(s.getEye()), J.copy(s.getCenter()).sub(c);
var K = Math.atan2(J.z, J.x),
Z = s.getNear(),
L = s.getFovy(),
F = s.getAspect();
O.copy(s.getCenter());
for (var Y, x = 0; m > x; x++)
if (Y = Q[x], V.setZ(Math.cos(K)).setX(Math.sin(K)).multiplyScalar(T), K -= v, H.addVectors(c, V), s.setNear(T), s.setCenter([H.x, H.y, H.z]), s.setFovy(I), s.setAspect(t), G) {
var y = Math.round(R / m);
ts.for(S).glState.viewport = [y * x, 0, y, r], B()
} else So(S, Y.frame), ts.for(S).glState.viewport = [0, 0, Y.width, Y.height], S.clear(S.COLOR_BUFFER_BIT), B(), Ar(S), Y.assureTexture();
return s.setNear(Z), s.setCenter([O.x, O.y, O.z]), s.setFovy(L), s.setAspect(F), !0
}, u.capture()
}, getTextureInfo: function (G) {
var Q = this._renderTargets;
if (!Q) return null;
var D = this._renderTargets[G];
return D ? {
index: G,
texture: D.texture,
textureName: D.uuid
} : null
}
}), o.assign(Eh.Graph3dView.prototype, {
renderEnvToCube: function (j, p, N, G) {
var U = this;
U.envRenderer || (U.envRenderer = new Eh.RenderEnv(U)), U.envRenderer.renderEnvToCube(j, p, N, G)
}
});
var kq = ["left", "front", "right", "back", "top", "bottom"],
Km = Eh._RenderList = function () {
function c() {
J.length = 0, j.length = 0, l = {}
}
function $(n) {
var q = n.gv,
N = n.data;
if (_ && !Ad) return n._renderParams = null, void 0;
var C, u, G, f, w = n.shapeModel;
if (w) {
var L, m, S, $ = N.s("shape3d.transparent") || N.s("points.transparent");
for (ip(w) || (L = Dj(w.transparent, N, q), w = [w]), G = 0, f = w.length; f > G; G++) S = w[G], m = Dj(S.transparent, N, q), m === Z && (m = L), m === Z && (m = $), m ? u = !0 : C = !0
}
for (G = 0, f = kq.length; f > G; G++) {
var k = n[kq[G]];
k && (k.transparent ? u = !0 : C = !0)
}
q.isLabelVisible(N) && (n.labelInfo && (N.s(Bg + ".transparent") ? u = !0 : C = !0), n.label2Info && (N.s(Qk + ".transparent") ? u = !0 : C = !0)), q.isNoteVisible(N) && (n.noteInfo && (N.s(Rm + ".transparent") ? u = !0 : C = !0), n.note2Info && (N.s(Vk + ".transparent") ? u = !0 : C = !0)), n._38o && (u = C = !0), u || (C = !0), n._renderParams = {
opaque: C,
transparent: u
}
}
function M(N, x) {
x && $(N);
var r = N.data,
n = r._id;
if (!l[n]) {
l[n] = !0;
var u = N._renderParams;
u && u.visible !== !1 && (N = {
ui: N,
data: r,
z: r._z,
id: n
}, u.opaque && J.push(N), u.transparent && j.push(N))
}
}
function D() {
J.length > 1 && J.sort(i), j.length > 1 && j.sort(p)
}
function S(d) {
d ? (kb(y, h, d), kb(X, W, d), kb(H, f, d)) : (y = this.batchModelMap = {}, h = this.batchIndexMap = {}, X = this.polylineModelMap = {}, W = this.polylineIndexMap = {}, H = this.wireframeModelMap = {}, f = this.wireframeIndexMap = {}), this.markBatchInvalid()
}
function z(m) {
m ? kb(y, h, m) : (y = this.batchModelMap = {}, h = this.batchIndexMap = {}), this.markBatchInvalid()
}
function U(V) {
V ? kb(X, W, V) : (X = this.polylineModelMap = {}, W = this.polylineIndexMap = {}), this.markBatchInvalid()
}
function q(U) {
U ? kb(H, f, U) : (H = this.wireframeModelMap = {}, f = this.wireframeIndexMap = {}), this.markBatchInvalid()
}
function s() {
return this._batchInvalid
}
function t() {
this._batchInvalid = !0
}
function e() {
this._batchInvalid = null
}
var J = [],
j = [],
y = {},
h = {},
X = {},
W = {},
H = {},
f = {},
l = {};
return {
opaque: J,
transparent: j,
init: c,
push: M,
batchModelMap: y,
batchIndexMap: h,
polylineModelMap: X,
polylineIndexMap: W,
wireframeModelMap: H,
wireframeIndexMap: f,
ivBatch: S,
ivModelBatch: z,
ivPolylineBatch: U,
ivWireframeBatch: q,
markBatchInvalid: t,
isBatchInvalid: s,
onUpdated: e,
sort: D
}
},
Ud = Eh._RenderLists = function () {
function B() {
for (var H in t) t[H].init()
}
function f() {
for (var T in t) t[T].onUpdated()
}
function X(T, D) {
T = T || "main";
var Z = t[T];
return !Z && D && (Z = t[T] = new Km), Z
}
function u(D, i) {
var b = D.data.getRenderLayer(),
H = X(b, !0);
H.push(D, i)
}
function q(Z) {
for (var w in t) Z(t[w])
}
var t = {};
return {
init: B,
onUpdated: f,
get: X,
push: u,
each: q,
lists: t
}
},
fq = Eh.RenderTarget = function (T, J, E, F, t) {
var C = this;
t = t || {}, t.samples = Math.min(T._glCapabilities.maxSamples, t.samples && t.samples > 1 && 2 === T._webGLVersion ? t.samples : 0), C.options = t, C.uuid = O.Math.generateUUID(), C.gv = T, C.init(T, J, t), t.samples && !T._glCapabilities._maxSamplesChecked ? C.setSize(J, E || 1, F || 1) : C.setSize(J, E, F)
};
o.assign(Eh.RenderTarget.prototype, {
bind: function (Z) {
So(Z, this.options.samples ? this._MSAAFbo : this.frame)
}, unbind: function (R) {
Ar(R), this.options.samples && (R.bindFramebuffer(R.READ_FRAMEBUFFER, this._MSAAFbo), R.bindFramebuffer(R.DRAW_FRAMEBUFFER, this.frame), R.blitFramebuffer(0, 0, this.width, this.height, 0, 0, this.width, this.height, R.COLOR_BUFFER_BIT, R.NEAREST), R.bindFramebuffer(R.READ_FRAMEBUFFER, null), R.bindFramebuffer(R.DRAW_FRAMEBUFFER, null))
}, init: function (y, P, j) {
var Y = this,
E = Y.texture = P.createTexture();
P.activeTexture(P.TEXTURE0), an(P, E);
var G = j.samples,
D = G ? P.NEAREST : P.LINEAR;
P.texParameteri(P.TEXTURE_2D, P.TEXTURE_MIN_FILTER, j.minFilter || D), P.texParameteri(P.TEXTURE_2D, P.TEXTURE_MAG_FILTER, j.magFilter || D), an(P, null), Y.render = P.createRenderbuffer(), Y.frame = P.createFramebuffer(), y._2O[Y.uuid] = E
}, assureTexture: function () {
var Z = this,
z = Z.uuid,
h = Z.gv._2O;
h[z] || (h[z] = Z.texture)
}, setSize: function (O, D, q) {
var n = this;
if (D && q && (n.width !== D || n.height !== q)) {
var R = O.RGBA,
A = O.TEXTURE_2D,
z = O.RENDERBUFFER,
N = O.FRAMEBUFFER,
B = n.options.samples;
if (O.activeTexture(O.TEXTURE0), an(O, n.texture), O.texImage2D(A, 0, R, D, q, 0, R, O.UNSIGNED_BYTE, F), Rc.isPOT(D) && Rc.isPOT(q) && !n.options.clampToEdge ? (O.texParameteri(O.TEXTURE_2D, O.TEXTURE_WRAP_S, O.REPEAT), O.texParameteri(O.TEXTURE_2D, O.TEXTURE_WRAP_S, O.REPEAT)) : (O.texParameteri(O.TEXTURE_2D, O.TEXTURE_WRAP_S, O.CLAMP_TO_EDGE), O.texParameteri(O.TEXTURE_2D, O.TEXTURE_WRAP_T, O.CLAMP_TO_EDGE)), O.bindRenderbuffer(z, n.render), B) {
var w = n.gv._glCapabilities;
if (w._maxSamplesChecked) O.renderbufferStorageMultisample(z, B, O.DEPTH_COMPONENT16, D, q);
else {
for (O.getError(); B > 1 && (O.renderbufferStorageMultisample(z, B, O.DEPTH_COMPONENT16, D, q), O.getError());) B = Math.floor(B >> 1);
1 >= B && (B = 0, O.texParameteri(O.TEXTURE_2D, O.TEXTURE_MIN_FILTER, n.options.minFilter || O.LINEAR), O.texParameteri(O.TEXTURE_2D, O.TEXTURE_MAG_FILTER, n.options.magFilter || O.LINEAR), O.renderbufferStorage(z, O.DEPTH_COMPONENT16, D, q)), w._maxSamplesChecked = !0, w.maxSamples = n.options.samples = B
}
} else O.renderbufferStorage(z, O.DEPTH_COMPONENT16, D, q);
B && !n._MSAAFbo && (n._MSAAFbo = O.createFramebuffer(), n._MSAARbO = O.createRenderbuffer()), So(O, n.frame), O.framebufferTexture2D(N, O.COLOR_ATTACHMENT0, A, n.texture, 0), B || O.framebufferRenderbuffer(N, O.DEPTH_ATTACHMENT, z, n.render), Ar(O), B && (O.bindRenderbuffer(O.RENDERBUFFER, n._MSAARbO), O.renderbufferStorageMultisample(O.RENDERBUFFER, B, O.RGBA8, D, q), So(O, n._MSAAFbo), O.framebufferRenderbuffer(O.FRAMEBUFFER, O.COLOR_ATTACHMENT0, O.RENDERBUFFER, n._MSAARbO), O.framebufferRenderbuffer(N, O.DEPTH_ATTACHMENT, z, n.render), Ar(O)), an(O, F), O.bindRenderbuffer(z, F), n.width = D, n.height = q
}
}, toCanvas: function () {
var e = this,
u = e.gv.getGL();
So(u, e.frame);
var H = e.width,
K = e.height,
C = new Uint8Array(4 * H * K);
u.readPixels(0, 0, H, K, u.RGBA, u.UNSIGNED_BYTE, C), Ar(u);
var N = U.createElement("canvas");
N.width = H, N.height = K;
var $ = N.getContext("2d"),
l = $.createImageData(H, K);
return l.data.set(C), $.putImageData(l, 0, 0), N
}
});
var Vq = Eh.Interactor = function (K) {
this.gv = this.g3d = K
};
Dn("Interactor", o, {
ms_listener: 1,
getView: function () {
return this.gv.getView()
}, setUp: function () {
this.addListeners()
}, tearDown: function () {
this.removeListeners()
}
});
var ps = Eh.DefaultInteractor = function (U) {
fi(ps, this, [U])
};
Dn("DefaultInteractor", Vq, {
getDataInfoAt: function (f, e) {
var j = this.gv,
R = j.getDataInfoAt(f);
if (!j.isBlockSelectable() || !R || !R.data) return R;
if (!e && j.isSelected(R.data)) return R;
for (var d = R.data;
(d = d.getParent()) && d instanceof O.Block && j.isSelectable(d);) {
var o = j.isSelected(d);
if (o && e) break;
if (R = {
data: d,
part: R
}, o && !e) break
}
return R
}, handle_contextmenu: function (y) {
Qc(y)
}, handle_mousewheel: function (H) {
this.gv.handleScroll(H, H.wheelDelta / 40)
}, handle_DOMMouseScroll: function (l) {
2 === l.axis && this.gv.handleScroll(l, -l.detail)
}, handle_keydown: function (s) {
this.gv.handleKeyDown(s)
}, handle_mousedown: function (J) {
this.handle_touchstart(J)
}, handle_touchstart: function (S) {
Qc(S);
var v = this,
O = v.gv,
f = jj(S),
o = v.getDataInfoAt(S),
d = o ? o.data : F,
K = o ? o.part : F,
$ = O.sm(),
r = Bf(S),
U = Qj(S);
O.setFocus(S) && (v._62O = F, v._57I = F, v.pendingClickThrough = F, v.__lastClientPoint__ = lb(S), d ? ik(S) ? $.co(d) ? $.rs(d) : $.as(d) : $.co(d) ? d instanceof Br && d.isClickThroughEnabled() && jj(S) && (v.pendingClickThrough = lb(S)) : $.ss(d) : f && (ik(S) ? O.isRectSelectable() && (v._62O = nj) : v._57I = lb(S)), v._31Q && (td(v._31Q), delete v._31Q, delete v._32Q), v._62O || (O.isFirstPersonMode() && (Pf(S) || Fm(S) || U > 2 ? v._62O = "pan" : O.isMouseRoamable() || li(S) ? (v._62O = "roaming", v.foward = r && jj(S), v._32Q = mm(), v._31Q = $e(v.tick, v)) : f || (v._62O = "roaming")), v._62O || (f && r && Nr[K] ? (v._62O = K, v.p3 = d.p3()) : f && r && Fq(d) && O.isSelected(d) ? O.isMovable(d) ? (v._62O = "move", v.p3 = d.p3(), v.movedata = d) : O._39Q(d) && (v._62O = "none") : li(S) && (U > 2 ? v._62O = "pan" : 2 === U && (v.dist = zo(S), v._62O = "pinch")))), v.point = O.lp(S), Ui(v, S), wm(S) ? O.handleDoubleClick(S, d, K) : O.handleClick(S, d, K))
}, tick: function () {
var p = this,
J = p.gv,
y = J._moveStep;
p.point && J.isWalkable() && (p._32Q && (y *= (mm() - p._32Q) / 50), J.walk(p.foward ? y : -y), p._32Q = mm(), p._31Q = $e(p.tick, p))
}, handle_mouseup: function (h) {
this.handle_touchend(h)
}, handle_touchend: function (m) {
var X = this._57I;
if (X && (En(X, lb(m)) <= 1 && this.gv.sm().cs(), this._57I = F), X = this.pendingClickThrough) {
if (En(X, lb(m)) <= 1) {
var N = this.getDataInfoAt(m);
N && N.data instanceof Br && N.data.isClickThroughEnabled() && (N = this.getDataInfoAt(m, !0), N && (m.clickThrough = !0, this.gv.sm().ss(N.data)))
}
this.pendingClickThrough = null
}
}, handleWindowMouseMove: function (p) {
this.handleWindowTouchMove(p)
}, handleWindowTouchMove: function (b) {
var F, Q, O = this,
m = O.gv,
r = O._62O,
N = O.point,
A = m.dm(),
R = m.lp(b),
s = R.x - N.x,
w = R.y - N.y,
x = m.getWidth(),
t = m.getHeight();
if (x && t) {
var j = lb(b),
k = wq(m, j, O.__lastClientPoint__),
I = En({
x: 0,
y: 0
}, k),
T = -$ * s / x,
M = -$ * w / t;
if ("roaming" === r) O.rotate(b, T / 2, M / 2);
else if (r === Pg || r === hb || r === pn) m._86O || A.beginTransaction(), m.fi({
kind: m._86O ? "betweenEditRotation" : "beginEditRotation",
event: b
}), m._86O = 1, m.sm().each(function (C) {
if (Fq(C) && m.isRotationEditable(C)) {
var Z = X(T) > X(M) ? T : M;
r === Pg ? C.setRotationX(C.getRotationX() + Z) : r === hb ? C.setRotationY(C.getRotationY() + Z) : r === pn && C.setRotationZ(C.getRotationZ() + Z)
}
});
else if ("move" === r || Nr[r]) {
if (r === zb || r === Oh || r === dh) m._87O || A.beginTransaction(), m.fi({
kind: m._87O ? "betweenEditScale" : "beginEditScale",
event: b
}), m._87O = 1;
else {
if (!m._moving) {
if (I < u.touchMoveThreshold) return;
A.beginTransaction()
}
m.fi({
kind: m._moving ? "betweenMove" : "beginMove",
event: b
}), m._moving = 1
}
var U, y = O.p3,
n = m.getPositionInfo(y),
C = wp(m);
U = r === Zo ? "x" : r === te ? "y" : r === ll ? "z" : r === zb ? "sx" : r === Oh ? "sy" : r === dh ? "sz" : m.getMoveMode(b, O.movedata), s = s / x * n.width, w = -1 * w / t * n.height;
var V, d, p = [C[0] * s, C[4] * s, C[8] * s],
e = [C[1] * w, C[5] * w, C[9] * w],
W = p[0] + e[0],
g = p[1] + e[1],
v = p[2] + e[2],
J = [y[0] + W, y[1] + g, y[2] + v],
Z = fn(m.getEye(), J, !0);
if ("xyz" === U ? (V = J, m.moveSelection(W, g, v)) : "xz" === U ? (V = cc(m, y, [0, 1, 0], J), V && m.moveSelection(V[0] - y[0], 0, V[2] - y[2])) : "xy" === U ? (V = cc(m, y, [0, 0, 1], J), V && m.moveSelection(V[0] - y[0], V[1] - y[1], 0)) : "yz" === U ? (V = cc(m, y, [1, 0, 0], J), V && m.moveSelection(0, V[1] - y[1], V[2] - y[2])) : "x" === U || "sx" === U ? (Z[0] = 0, V = cc(m, y, Z, J), V && (d = V[0] - y[0], "x" === U ? m.moveSelection(d, 0, 0) : m.sm().each(function (i) {
Fq(i) && m.isSizeEditable(i) && (F = i.getScaleX() + d / 100, Q = F / i.getScaleX(), i.setScaleX(F), Pf(b) && (i.setScaleY(i.getScaleY() * Q), i.setScaleTall(i.getScaleTall() * Q)))
}))) : "y" === U || "sy" === U ? (Z[1] = 0, V = cc(m, y, Z, J), V && (d = V[1] - y[1], "y" === U ? m.moveSelection(0, d, 0) : m.sm().each(function (k) {
Fq(k) && m.isSizeEditable(k) && (F = k.getScaleTall() + d / 100, Q = F / k.getScaleTall(), k.setScaleTall(F), Pf(b) && (k.setScaleY(k.getScaleY() * Q), k.setScaleX(k.getScaleX() * Q)))
}))) : ("z" === U || "sz" === U) && (Z[2] = 0, V = cc(m, y, Z, J), V && (d = V[2] - y[2], "z" === U ? m.moveSelection(0, 0, d) : m.sm().each(function (n) {
Fq(n) && m.isSizeEditable(n) && (F = n.getScaleY() + d / 100, Q = F / n.getScaleY(), n.setScaleY(F), Pf(b) && (n.setScaleX(n.getScaleX() * Q), n.setScaleTall(n.getScaleTall() * Q)))
}))), !V) return;
O.p3 = V
} else if (r === nj) {
var z = O.div;
z || (z = O.div = dd(), sn(O.getView(), z), z.op = N, z.style.background = m.getRectSelectBackground()), m.fi({
kind: m._rectSelecting ? "betweenRectSelect" : "beginRectSelect",
event: b
}), m._rectSelecting = 1, z.rect = ms(z.op, R), qp(z, z.rect)
} else if ("pinch" === r && 2 === Qj(b)) {
m.fi({
kind: m._pinching ? "betweenPinch" : "beginPinch",
event: b
}), m._pinching = 1;
var d = zo(b);
m._lastZoomLP || (m._lastZoomLP = ne(b)), m.handlePinch(d, O.dist), O.dist = d
} else "pan" === r || Pf(b) || Fm(b) ? O.pan(b, s, w) : "none" === r || m.isFirstPersonMode() || O.rotate(b, T, M);
O.point = R
}
}, pan: function (r, G, u) {
var B = this.gv;
if (B.isPannable()) {
var H = B.getWidth(),
j = B.getHeight();
if (!H || !j) return;
var w = B.getCenterInfo(),
e = G / H * w.width,
f = -1 * u / j * w.height;
B.fi({
kind: B._panning ? "betweenPan" : "beginPan",
event: r
}), B._panning = 1, B.pan(-e, -f)
}
}, rotate: function (I, e, y) {
var H = this.gv;
H.isRotatable() && (H.fi({
kind: H._rotating ? "betweenRotate" : "beginRotate",
event: I
}), H._rotating = 1, H.rotate(e, y))
}, handleWindowMouseUp: function (G) {
this.handleWindowTouchEnd(G)
}, handleWindowTouchEnd: function (K) {
var _ = this,
u = _.gv,
g = u.dm(),
H = _.div;
if (H) {
var V = u.getDatasInRect(H.rect);
if (!V.isEmpty()) {
var n = u.sm(),
q = n.toSelection();
V.each(function (w) {
n.co(w) ? q.remove(w) : q.add(w)
}), n.ss(q)
}
yj(H)
}
u._moving && (delete u._moving, u.fi({
kind: "endMove",
event: K
}), u.onMoveEnded(), g.endTransaction()), u._panning && (delete u._panning, u.fi({
kind: "endPan",
event: K
}), u.onPanEnded()), u._rotating && (delete u._rotating, u.fi({
kind: "endRotate",
event: K
}), u.onRotateEnded()), u._86O && (delete u._86O, u.fi({
kind: "endEditRotation",
event: K
}), g.endTransaction()), u._87O && (delete u._87O, u.fi({
kind: "endEditScale",
event: K
}), g.endTransaction()), u._pinching && (delete u._pinching, u.fi({
kind: "endPinch",
event: K
}), u.onPinchEnded()), u._rectSelecting && (delete u._rectSelecting, u.fi({
kind: "endRectSelect",
event: K
}), u.onRectSelectEnded()), u._walking && (delete u._walking, u.fi({
kind: "endWalk",
event: K
}), u.onWalkEnded()), u._lastZoomLP = u._lastZoomHit = null, _.dist = _.point = _._62O = _.p3 = _.movedata = _.div = _._57I = _.pendingClickThrough = _._32Q = _._31Q = _.foward = F, _.__lastClientPoint__ = F
}
});
var cl = Eh.MapInteractor = function (I) {
fi(cl, this, [I]), this._keepHorizon = !0, this._threshold = 2, this._touchScaleThreshold = .05, this._touchRotateThreshold = .03, this._touchScaleCheckAccuracy = .01, this._panButton = "right", this.maxPhi = 5 * Math.PI / 12
};
Dn("MapInteractor", Vq, {
handle_contextmenu: function (K) {
Qc(K)
}, handle_mousewheel: function (i) {
this.gv.handleScroll(i, i.wheelDelta / 40)
}, handle_DOMMouseScroll: function (N) {
2 === N.axis && this.gv.handleScroll(N, -N.detail)
}, handle_keydown: function (f) {
this.gv.handleKeyDown(f)
}, handle_mousedown: function (S) {
this.handle_touchstart(S)
}, handle_touchstart: function (B) {
Qc(B);
var $ = this,
e = $.gv;
if (e.setFocus(B)) {
var K = e.getDataInfoAt(B),
P = K ? K.data : F,
T = K ? K.part : F,
X = $.editing = {
point: e.lp(B)
};
li(B) ? X.touch = !0 : (X.touch = !1, X.clickLeft = jj(B), X.pan = Fm(B) ? !0 : "left" === this.panButton === X.clickLeft), P && e._39Q(P) && (X.preventDefault = !0), Ui($, B), wm(B) ? e.handleDoubleClick(B, P, T) : e.handleClick(B, P, T)
}
}, handle_mouseup: function (b) {
this.handle_touchend(b)
}, handle_touchend: function () { }, handleWindowMouseMove: function (X) {
this.handleWindowTouchMove(X)
}, handleWindowTouchMove: function (Z) {
var Y = this,
z = Y.gv,
e = Y.editing;
if (e) {
var V = z.lp(Z),
N = e.point,
s = V.x - N.x,
o = V.y - N.y;
if (!e.moved) {
if (Math.abs(s) < Y.threshold && Math.abs(o) < Y.threshold && !(Z.touches && Z.touches.length > 1)) return;
e.moved = !0
}
if (!e.preventDefault)
if (e.point = V, e.touch) {
var G = Z.touches.length;
if (2 !== G) Y.pan(Z, s, o);
else {
if (1 >= G) return;
var p = Z.touches,
E = {
x: p[0].clientX,
y: p[0].clientY
},
w = {
x: p[1].clientX,
y: p[1].clientY
},
g = {
x: w.x - E.x,
y: w.y - E.y
},
y = e.lastCenter,
A = Math.atan2(g.y, g.x),
D = e.theta,
v = 0;
D == F ? D = e.theta = A : (v = A - D, e.thetaStarted || Math.abs(v) > Y.touchRotateThreshold ? (e.thetaStarted = !0, e.theta = A) : v = 0);
var n = W * (E.y + w.y) / 2 / z.getHeight(),
q = e.phi,
a = 0;
q == F ? q = e.phi = n : (a = n - q, e.phiStarted || Math.abs(a) > Y.touchRotateThreshold ? (e.phiStarted = !0, e.phi = n) : a = 0);
var I, b = Math.sqrt(g.x * g.x + g.y * g.y),
Q = e.vlen;
if (Q) {
var P = E.x - y.x,
h = E.y - y.y,
f = w.x - y.x,
X = w.y - y.y,
U = Math.sqrt(P * P + h * h),
x = Math.sqrt(f * f + X * X),
d = Q / 2,
R = Y._sign2(U - d),
L = Y._sign2(x - d);
0 > R * L || 0 === R && 0 === L ? (I = 1, e.vlen = b) : (I || (I = b / Q), e.scaleStarted || Math.abs(I - 1) > Y.touchScaleThreshold ? (e.vlen = b, e.scaleStarted = !0) : I = 1)
} else Q = e.vlen = b, I = 1;
1 !== I && z.setZoom(I), (a || v) && Y.rotate(Z, v, -a), e.lastCenter = {
x: (w.x + E.x) / 2,
y: (w.y + E.y) / 2
}
}
} else if (e.pan) Y.pan(Z, s, o);
else {
var r = z.getWidth(),
u = z.getHeight();
if (!r || !u) return;
var S = -$ * s / r,
l = -$ * o / u;
Y.rotate(Z, S, l)
}
}
}, _sign2: function (s) {
return Math.abs(s) < this._touchScaleCheckAccuracy ? 0 : s > 0 ? 1 : -1
}, handleWindowMouseUp: function (H) {
this.handleWindowTouchEnd(H)
}, handleWindowTouchEnd: function (A) {
var J = this,
Q = J.editing;
if (J.editing = null, Q) {
var M = J.gv;
if (Q.moved || !Q.clickLeft && !Q.touch) M._panning = null, M._rotating = null, M.fi({
kind: Q.pan ? "endPan" : "endRotate",
event: A
});
else {
var u = M.getDataAt(A);
u ? M.sm().setSelection([u]) : M.sm().clearSelection()
}
}
}, pan: function (B, l, g) {
var D = this,
O = D.gv;
if (O.isPannable()) {
var n = O.getWidth(),
C = O.getHeight();
if (n && C) {
var z = O.getCenterInfo(),
q = -l / n * z.width,
K = 1 * g / C * z.height;
O.fi({
kind: O._panning ? "betweenPan" : "beginPan",
event: B
}), O._panning = 1;
var G = D.keepHorizon,
L = D.editing.touch;
if ((L && B.touches && B.touches.length > 1 || !L && Pf(B)) && (G = !G), !G) return O.pan(q, K);
if (q || K) {
var S = wp(O),
V = [S[0] * q, S[4] * q, S[8] * q],
P = [S[1], 0, S[9]],
m = Math.sqrt(P[0] * P[0] + P[2] * P[2]);
m && (P = [P[0] / m * K, 0, P[2] / m * K]);
var A = V[0] + P[0],
i = V[1] + P[1],
y = V[2] + P[2],
w = O._center,
r = O._eye;
w[0] += A, w[1] += i, w[2] += y, r[0] += A, r[1] += i, r[2] += y, O.fp(to, F, r), O.fp(sc, F, w)
}
}
}
}, rotate: function (K, y, N) {
var O = this,
i = O.gv;
if (i.isRotatable()) {
var q = i._center,
E = i._eye,
t = fn(E, q),
e = D(w(t[0] * t[0] + t[2] * t[2]), t[1]),
l = vg(i, e + N);
N = l - e, i.fi({
kind: i._rotating ? "betweenRotate" : "beginRotate",
event: K
}), i._rotating = 1, i.rotate(y, N)
}
}
}), o.defineProperties(cl.prototype, {
panButton: {
get: function () {
return this._panButton
}, set: function (Z) {
this._panButton = Z
}
},
minPhi: {
get: function () {
return this.gv.getRotateMinPhi()
}, set: function (R) {
this.gv.setRotateMinPhi(R)
}
},
maxPhi: {
get: function () {
return this.gv.getRotateMaxPhi()
}, set: function (g) {
this.gv.setRotateMaxPhi(g)
}
},
keepHorizon: {
get: function () {
return this._keepHorizon
}, set: function (g) {
this._keepHorizon = g
}
},
threshold: {
get: function () {
return this._threshold
}, set: function (x) {
this._threshold = x
}
},
touchScaleThreshold: {
get: function () {
return this._touchScaleThreshold
}, set: function (i) {
this._touchScaleThreshold = i
}
},
touchRotateThreshold: {
get: function () {
return this._touchRotateThreshold
}, set: function (K) {
this._touchRotateThreshold = K
}
}
});
var Ye, cq = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAEyUlEQVRYR62XW0xcVRSG/58cmIG2HmstE9N4SX2xtVqBCISoFS/RmDSpKQSvTWNixUStQSqVyBQYJUGttrQVtYkPatuQPmhivMUHqbUBZ2itl1qjTzZpImNUZhDLsUeWWXgOOd2cgcGyk3mYs/de69trr70uxP8YIlJKMi0i9wIgyf0iEiM5PFdxzGeDiBQAuB7AjQBuALCN5NcGQDmANgBfeL8UyYnZ5M8KICJ3AXgAwAlfOMl/VHAQwPtveYAKuQLA2yQ/ngliRgAR2QogA2AvSdcUZAIE50VEYR4BsIDkC7kgQgFE5GIAuwDsJnkk1+aZAPw9IqLX1gjgcZK/m7KmAXjK4wBaSf4ZplxEIgCuA3Cz3gSAfgDHSf6dY/0FAJ4D0G5ChAEcAPBwmHIRqXNd90nLsiocx/k+k8n8oK/Atu2rIpHIStd1v7QsawfJd0Ouywawh6T609Q4B8C788NhZnddt29sbGxBd3f39q6urtNhJ43H48uam5u3lJSUjFiWdV8IxE0Aqki+6M9NAXjefjnJXsOZogBGBgYGttbU1Hw427PS+cHBwbVVVVUJAItJOoa8xwD8RPIT/T4J4L3zfQAeNL1dRMZra2ur+/v7/8pHub+mvr7+wr6+vs8KCgoWGABFAN4EsEHjhA9QBeA2ks8HF6vZk8nkQL4nNwGTyeTa8vLycsuy7jcg1Mk/IpnyAZoBaOQ6FHg+ddlsdqNt201zObm5NpvN7ly0aNHrJN8LyL4FwGqSr/gAOrnej3C60HXdw/F4PJ7L4fKFSiQSl7W0tLQVFRWtCQDoNRwguZ6aWABcorE9sEDf+QjJ1fkqmmmdiHwHoCToXyKiceR0rkhY5TjOq9FoVLPdeY/x8fG+SCSySe/cFKYWCFOyPJ1Or4zFYh3nrR3A8PBwe2lp6TcAfg4DmBYwAFyRTqdXxWKx9nkE+DYUIEyBiFQ6jvNaNBq9Zz4AZruCGIBlJI8ZXpolee18AORwwgoAp/xnqMmjPuilZ8+ePZRIJNo7OztD436+YB0dHZe2trY+W1hYWGsccD/JOh/gKQBHSWpanRwicnc2m91k2/bmfJWFrRsdHd29cOHCXSTfD8i+FcA1JHcEQ/HtJDVnTw3XdfcPDQ0dra6unto8F5hUKrWurKxslWVZG4L7RGQbgA9IDgWT0VsANprJaGJi4kxDQ8OagwcPjsxFeWNj49Le3l6N91qMTA2vmNnr6fovGXkmvxPAlST3hGz4LZVKbausrMzLEnryioqKNpJLzCpJRJ4AcJLkp6rHLEieBjBA8rB5Wtd1942NjS3p6el5qa2t7VSYNdThmpqaWoqLi38xze4dUku4CpLb/f1hJZnWBY+SzJpKRGSdV5LVOI5zIpPJnNQ1tm2viEQiV7uue8SyrJeDDhew8GIAO0me4w9hABdp8ahNBkktyacNr+Qu84pSndfX81VY6e6dXJV3AoiT/CMoMFcyUogeAG+Q/DyX8+VZlqvZHwKw2VQ+zQdCTL4FwBkPZFrJPUtjoildG5PC4J2bOvJpze7QWhHAj4HWbBImpDXTQsPvH5cDeMf39lxWnBXAU6TNqcZu7fn0lyB53GhOdf6ZQHN6bF6a0xxOuJTkrwbA5LdcJ831/V8SOUYQxYGhRwAAAABJRU5ErkJggg==",
Hq = 32,
Zg = Eh.GlobeInteractor = function (J, L) {
fi(Zg, this, [J]);
var S, b = L.radius || 6378137,
x = this,
Y = null;
Ye || (Ye = dd(), Ye.style.border = "", Ye.style.backgroundImage = "url(" + cq + ")");
var N = new fs,
U = new tl,
Q = new tl,
R = new tl,
H = new Qi,
c = "number" == typeof b ? {
x: b,
y: b,
z: b
} : b,
G = {
center: new tl(0, 0, 0),
radius: c
},
t = function (S) {
J._81O = null;
var P = J.getHitPosition(S, J.getCenter(), U.copy(J.getEye()).sub(Q.copy(J.getCenter())).toArray());
return H.origin.copy(J.getEye()), H.direction.copy(P).sub(H.origin).normalize(), H.intersectEllipsoid(G)
},
h = function (N, M) {
J._81O = null, H.origin.copy(J.getEye());
for (var V, b, L = J.getCenter(), d = U.copy(J.getEye()).sub(Q.copy(J.getCenter())).toArray(), X = 1, e = 16, K = 0, v = 1, B = {
x: 0,
y: 0
}; e--;) {
if (B.x = M.x + (N.x - M.x) * X, B.y = M.y + (N.y - M.y) * X, V = J.getHitPosition(B, L, d), H.direction.copy(V).sub(H.origin).normalize(), b = H.intersectEllipsoid(G), b && 1 === X) return {
hit: b
};
b ? K = X : v = X, X = (K + v) / 2
}
return {
hit: b,
out: 1 > X
}
},
s = function (M, S) {
if (Y) {
var n = Date.now();
Y.deltaTime = Y.lastTime ? n - Y.lastTime : 1e3, Y.lastTime = n, Y.lastAxis = M, Y.lastAngle = S
}
S && (N.setFromAxisAngle(M, S), J.setEye(U.copy(J.getEye()).applyQuaternion(N).toArray()), J.setCenter(U.copy(J.getCenter()).applyQuaternion(N).toArray()), J.setUp(U.copy(J.getUp()).applyQuaternion(N).toArray()))
};
x._showCrossIcon = function (g) {
sn(x.getView(), Ye), qp(Ye, {
x: g.clientX - Hq / 2,
y: g.clientY - Hq / 2,
width: Hq,
height: Hq
})
}, x._hideCrossIcon = function () {
yj(Ye)
}, x._scrollImpl = function (p, X) {
Y = {
point: J.lp(p),
screen: lb(p),
hit: t(p),
type: "right"
}, Y.hitNormalize = Y.hit ? Y.hit.clone().normalize() : new tl;
var G = {
clientX: Y.screen.x,
clientY: Y.screen.y + 10 * X
};
x._handleMoveImpl(G), x._endMoveImpl(G)
}, x._startMoveImpl = function (o) {
S && (S.stop(!0), S = null), Y = {
point: J.lp(o),
screen: lb(o),
hit: t(o)
}, Y.hitNormalize = Y.hit ? Y.hit.clone().normalize() : new tl, li(o) ? 1 === o.touches.length ? Y.hit && (Y.type = "left") : 2 === o.touches.length && (Y.type = "touch2") : (jj(o) ? Y.hit && (Y.type = "left") : tk(o) ? Y.type = "right" : Fm(o) && Y.hit && (Y.type = "middle"), !Y.hit || "right" !== Y.type && "middle" !== Y.type || x._showCrossIcon(o)), Y.type && Ui(x, o)
}, x._handleMoveImpl = function (c) {
if (Y) switch (Y.type) {
case "left":
return x._handleLeft(c);
case "right":
return x._handleRight(c);
case "middle":
return x._handleMiddle(c);
case "touch2":
return x._handleTouch2(c)
}
}, x._endMoveImpl = function () {
if (Y) {
if (this._hideCrossIcon(), "left" === Y.type || "middle" === Y.type) {
var q = 1e3 * (Y.lastAngle / (Y.deltaTime || 30)),
B = Y.lastAxis,
j = Y.lastTime,
m = function () {
var P = Date.now(),
l = (P - j) / 1e3;
return j = P, q *= Math.pow(Math.abs(x.decelerationRate), 3 * l), Math.abs(q) < .01 ? (q = 0, S && S.stop(), void 0) : (s(B, q * l), void 0)
};
S = Sf({
action: function () {
m(arguments)
}, duration: 5e3
})
}
Y = null
}
}, x._handleLeft = function (c) {
if (!Y.finished) {
var Z = lb(c),
J = h(Z, Y.lastScreen || Y.screen);
if (Y.lastScreen = Z, !J.hit) return Y.finished = !0, x._endMoveImpl(c), void 0;
var d = J.hit;
d.normalize();
var C = Y.hitNormalize,
I = Math.acos(d.dot(C)),
z = d.cross(C).normalize();
s(z, I), J.out && (Y.finished = !0, x._endMoveImpl(c))
}
}, x._handleRight = function (b) {
var k = Y.lastScreen || Y.screen,
E = k.y;
k = Y.lastScreen = lb(b);
var B = k.y,
f = B - E;
if (f) {
var m = Math.min(.5, f * x.scaleSpeed);
U.copy(J.getEye());
var d = Y.hit;
d || (d = U.clone().divide(c).normalize().multiply(c)), Q.copy(U).lerp(d, m), J.setEye(Q.toArray()), U.copy(J.getUp()), Q.normalize();
var G = U.clone().cross(Q).normalize();
if (R.copy(J.getCenter()), R.sub(G.multiplyScalar(R.dot(G))), J.setCenter(R.toArray()), Y.hit) {
var W = t(Y.screen),
g = Y.hitNormalize;
if (W) {
W.normalize();
var V = Math.acos(W.dot(g)),
T = W.cross(g).normalize();
V && s(T, V)
}
}
}
};
var _ = function (C) {
return Math.abs(C) < .01 ? 0 : C > 0 ? 1 : -1
};
x._handleTouch2 = function (M) {
var i = M.touches.length;
if (2 === i) {
var f = M.touches,
$ = {
x: f[0].clientX,
y: f[0].clientY
},
j = {
x: f[1].clientX,
y: f[1].clientY
},
l = {
x: j.x - $.x,
y: j.y - $.y
},
v = Y.lastCenter,
g = Math.atan2(l.y, l.x),
n = Y.theta,
z = 0;
n == F ? n = Y.theta = g : (z = g - n, Y.thetaStarted || Math.abs(z) > .03 ? (Y.thetaStarted = !0, Y.theta = g) : z = 0);
var P, D = Math.sqrt(l.x * l.x + l.y * l.y),
p = Y.vlen;
if (p) {
var X = $.x - v.x,
t = $.y - v.y,
c = j.x - v.x,
y = j.y - v.y,
K = Math.sqrt(X * X + t * t),
d = Math.sqrt(c * c + y * y),
L = p / 2,
u = _(K - L),
x = _(d - L);
0 > u * x || 0 === u && 0 === x ? (P = 1, Y.vlen = D) : (P || (P = D / p), Y.scaleStarted || Math.abs(P - 1) > .05 ? (Y.vlen = D, Y.scaleStarted = !0) : P = 1)
} else p = Y.vlen = D, P = 1;
var l = Q.copy(J.getEye()).clone();
1 !== P && J.setEye(l.setLength((l.length() - b) / P + b).toArray()), z && s(l.normalize(), z), Y.lastCenter = {
x: (j.x + $.x) / 2,
y: (j.y + $.y) / 2
}
}
}, x._handleMiddle = function (M) {
var v = lb(M),
g = Y.screen;
Y.screen = v;
var P = (v.y - g.y) / 180 * Math.PI * x.rollSpeed;
Q.copy(J.getCenter()).sub(U.copy(J.getEye())).normalize(), U.copy(J.getUp()).cross(Q).normalize(), Q.copy(J.getEye()).sub(Y.hit).applyAxisAngle(U, P).add(Y.hit);
var u = Q.clone();
Q.copy(J.getCenter()).sub(Y.hit).applyAxisAngle(U, P).add(Y.hit);
var Z = Q.clone(),
q = Q.copy(J.getUp()).applyAxisAngle(U, P).clone(),
j = !1;
P > 0 && (R.copy(q), Q.copy(Z).sub(u).normalize(), U.copy(u).multiplyScalar(-1).normalize(), U.dot(R) - Q.dot(R) > 0 && (j = !0)), j || R.copy(Y.hit).sub(u).dot(Y.hitNormalize) >= 0 && (j = !0), j || (J.setEye(u.toArray()), J.setCenter(Z.toArray()), J.setUp(q.toArray()));
var l = -(v.x - g.x) / 180 * Math.PI * x.rotateSpeed;
s(Y.hitNormalize, l)
}
};
Dn("GlobeInteractor", Vq, {
handle_contextmenu: function (i) {
Qc(i)
}, handle_mousewheel: function (y) {
this._scrollImpl(y, y.wheelDelta / 40)
}, handle_DOMMouseScroll: function (E) {
2 === E.axis && this._scrollImpl(E, -E.detail)
}, handle_keydown: function (g) {
this.gv.handleKeyDown(g)
}, handle_mousedown: function (A) {
this.handle_touchstart(A)
}, handle_touchstart: function (K) {
Qc(K);
var k = this.gv;
if (k.setFocus(K)) {
var E = k.getDataInfoAt(K),
P = E ? E.data : F;
P && k.isInteractive(P) || this._startMoveImpl(K);
var Y = E ? E.part : F;
wm(K) ? k.handleDoubleClick(K, P, Y) : k.handleClick(K, P, Y)
}
}, handle_mouseup: function (h) {
this.handle_touchend(h)
}, handle_touchend: function () { }, handleWindowMouseMove: function (n) {
this.handleWindowTouchMove(n)
}, handleWindowTouchMove: function (d) {
this._handleMoveImpl(d)
}, handleWindowMouseUp: function (p) {
this.handleWindowTouchEnd(p)
}, handleWindowTouchEnd: function (G) {
this._endMoveImpl(G)
}
}), o.defineProperties(Zg.prototype, {
rotateSpeed: {
get: function () {
return this._rotateSpeed || .3
}, set: function (u) {
this._rotateSpeed = u
}
},
rollSpeed: {
get: function () {
return this._rollSpeed || .1
}, set: function (e) {
this._rollSpeed = e
}
},
scaleSpeed: {
get: function () {
return this._scaleSpeed || .002
}, set: function (x) {
this._scaleSpeed = x
}
},
decelerationRate: {
get: function () {
return this._decelerationRate || .04
}, set: function (M) {
this._decelerationRate = M
}
}
});
var rl = function (b) {
var G = 2147483648 | b;
return [(255 & G >> 16) / 255, (255 & G >> 8) / 255, (255 & G) / 255, (255 & G >> 24) / 255]
},
qo = function (J) {
this.gv = J, this.gv.pickColorMap = {
_pickIdUsed: 1e3
}
};
yc(qo, o, {
_iv: !0,
iv: function () {
this._iv = !0
}, get: function (y, $) {
this.validate();
var j = this,
l = j.gv.getGL();
if (!l) return F;
var o, N, d = j._resolution,
U = Math.round(y.x * d),
S = Math.ceil(y.width * d),
M = Math.ceil(y.height * d),
s = j.height - Math.round(y.y * d) - M,
b = T(S / 2),
g = new Uint8Array(4 * S * M),
R = 0,
X = g.length,
J = $ ? F : new xr,
x = $ ? F : {};
if (So(l, j.frame), l.readPixels(U, s, S, M, l.RGBA, l.UNSIGNED_BYTE, g), Ar(l), $) {
for (; b >= R; R++)
for (var u = b - R, O = b + R, D = u; O >= D; D++)
for (var A = u; O >= A; A++)
if ((D === u || D === O || A === u || A === O) && (o = j.info(g, 4 * (D * S + A)))) return o
} else
for (; X > R; R += 4) o = j.info(g, R), o && (N = o.data, x[N._id] || (J.add(N), x[N._id] = N));
return J
}, info: function (Q, D) {
return this.gv.pickColorMap[(Q[D] << 16) + (Q[D + 1] << 8) + Q[D + 2] + ((127 & Q[D + 3]) << 24)]
}, getResolution: function () {
return this._resolution
}, onContextLost: function () {
this.texture = null, this.width = this.height = -1
}, validate: function () {
var U = this,
d = U.gv,
r = d.getGL();
if (r) {
var I = U._resolution = d._pickerResolution * d.getDevicePixelRatio(),
y = Math.round(I * d.getWidth()),
D = Math.round(I * d.getHeight()),
k = r.RGBA,
X = r.TEXTURE_2D,
H = r.RENDERBUFFER,
K = r.FRAMEBUFFER;
if (U.texture || (U.texture = rg(r), U.render = r.createRenderbuffer(), U.frame = r.createFramebuffer()), (U.width !== y || U.height !== D) && (r.activeTexture(r.TEXTURE0), an(r, U.texture), r.texImage2D(X, 0, k, y, D, 0, k, r.UNSIGNED_BYTE, F), Lr(r, r.TEXTURE_MIN_FILTER, r.LINEAR), r.bindRenderbuffer(H, U.render), r.renderbufferStorage(H, r.DEPTH_COMPONENT16, y, D), So(r, U.frame), r.framebufferTexture2D(K, r.COLOR_ATTACHMENT0, X, U.texture, 0), r.framebufferRenderbuffer(K, r.DEPTH_ATTACHMENT, H, U.render), an(r, F), r.bindRenderbuffer(H, F), Ar(r), U.width = y, U.height = D), U._iv) {
U._iv = !1;
var C = !1;
d._40Q.each(function (a) {
!C && a.isBatchInvalid() && (C = !0)
}), C && d.updateScene(), So(r, U.frame), r.clear(r.COLOR_BUFFER_BIT), d.overlappingBox.clear(), d.setViewport(r, 0, 0, y, D), d.renderPickScene(), Ar(r)
}
}
}
});
var Le = function (W) {
this.gv = W
};
yc(Le, o, {
gap: 0,
size: 0,
_42: function (O, r) {
var x = this,
N = x.gv,
t = N._gridGap,
L = N._gridSize;
if (N._gridVisible) {
if (x.gap !== t || x.size !== L) {
for (var i = [], Y = N._gridSize / 2, d = t * Y, o = 0; 2 * Y + 1 > o; o++) {
var s = 6 * o,
B = 6 * (2 * Y + 1) + s;
i[s] = -d, i[s + 1] = 0, i[s + 2] = -d + o * t, i[s + 3] = d, i[s + 4] = 0, i[s + 5] = -d + o * t, i[B] = -d + o * t, i[B + 1] = 0, i[B + 2] = -d, i[B + 3] = -d + o * t, i[B + 4] = 0, i[B + 5] = d
}
x.vs = new fk(i), x.gap = t, x.size = L
}
gk(N), _k(O, r), bi(O), ck(O, r, 1, N._gridColor, N._buffer.vs, x.vs), ie(O, 0, x.vs.length / 3, O.LINES), Jf(O), On(O, r)
} else x.vs = x.gap = x.size = F
}
});
var ap = function (L) {
this.gv = L
};
yc(ap, o, {
_42: function (p, U) {
var s = this.gv,
y = s._buffer.vs,
f = s._axisXColor,
o = s._axisYColor,
O = s._axisZColor,
$ = s._originAxisVisible,
n = s._centerAxisVisible;
if ($ || n) {
var B = Uq ? p.TRIANGLES : p.TRIANGLE_FAN,
R = p.LINES;
if (gk(s), _k(p, U), bi(p), $) {
var D = s.getCenterInfo(),
b = V(D.width, D.height) / 5,
t = .8 * b,
W = .05 * b;
ck(p, U, 1.5, f, y, new fk([0, 0, 0, b, 0, 0, t, W, 0, t, 0, W, t, -W, 0, t, 0, -W, t, W, 0, 0, 0, 0, 0, b, 0, W, t, 0, 0, t, W, -W, t, 0, 0, t, -W, W, t, 0, 0, 0, 0, 0, 0, b, W, 0, t, 0, W, t, -W, 0, t, 0, -W, t, W, 0, t])), ie(p, 0, 2, R), ie(p, 1, 6, B), ck(p, U, F, o), ie(p, 7, 2, R), ie(p, 8, 6, B), ck(p, U, F, O), ie(p, 14, 2, R), ie(p, 15, 6, B)
}
if (n) {
var z = s._center,
J = z[0],
Q = z[1],
P = z[2],
D = s.getPositionInfo(z);
b = V(D.width, D.height) / 20, ck(p, U, 1.5, f, y, new fk([J, Q, P, J + b, Q, P, J, Q, P, J, Q + b, P, J, Q, P, J, Q, P + b])), ie(p, 0, 2, R), ck(p, U, F, o), ie(p, 2, 2, R), ck(p, U, F, O), ie(p, 4, 2, R)
}
Jf(p), On(p, U)
}
}
});
var ui = function (B) {
this.gv = B, this.onMouseOver = this.onMouseOver.bind(this), this.mode = ui.Mode.Style, this.color = Z, this.width = Z
};
ui.Mode = {
Disable: 0,
Selection: 1,
MouseOver: 2,
Style: 3
}, yc(ui, o, {
onMouseOver: function (P) {
u.preventDefault(P);
var Q = this.gv.getDataAt(P);
Q !== this.mouseOverData && (this.mouseOverData = Q, this.gv.iv())
}, setFetchTargetFunc: function (f) {
this.fetchTargetFunc = f
}, _42: function (y, W) {
var D, z, t = this,
H = t._mode,
E = t.gv;
if (!y._renderInfo.reflectDepth && H !== ui.Mode.Disable) {
if (H === ui.Mode.Selection ? D = E.sm().getSelection().toArray(function (c) {
return c.s("highlight.visible")
}) : H === ui.Mode.MouseOver && t.mouseOverData && t.mouseOverData.s("highlight.visible") && (D = [t.mouseOverData]), t.fetchTargetFunc && (D = t.fetchTargetFunc(D)), H === ui.Mode.Style) D = D || [], z = function (V) {
if (D.indexOf(V) >= 0) return !1;
var O = E.getDataHighlightMode(V);
return O === !1 ? !0 : O === !0 ? !1 : "selected" === O ? E.isSelected(V) ? !1 : !0 : "hover" === O ? V === t.mouseOverData ? !1 : !0 : !0
};
else {
if (!D || !D.length) return;
z = function (m) {
return D.indexOf(m) < 0 ? !0 : void 0
}
}
var E = t.gv,
N = E.vr.isPresenting(),
I = E.getWidth();
if (N) {
var x = E.getWidth;
I /= 2, E.getWidth = function () {
return I
};
var S = E.getViewport()
}
var O, B = E.getDevicePixelRatio(),
R = I * B,
K = E.getHeight() * B;
(O = t._renderTarget) ? O.setSize(y, R, K) : t._renderTarget = O = new Eh.RenderTarget(E, y, R, K), So(y, O.frame), y.clear(y.COLOR_BUFFER_BIT), E.setViewport(y, 0, 0, R, K);
var A = [];
D.forEach(function (j) {
var S = j.getRenderLayer();
A.indexOf(S) < 0 && A.push(S)
}), E.drawFilter = z, E.renderPickScene(), E.drawFilter = null, Ar(y), Uq && Rg(y, W.aPosition), Rg(y, W.aNormal), N && (E.getWidth = x, E.setViewport(y, S[0], S[1], S[2], S[3]));
var Z = y._compiledShader.highlight;
Z || (Z = y._compiledShader.highlight = new Cm.Shader(y, hj.vs, hj.fs)), Z.bind();
var M = ts.for(y),
P = M.directState();
P.blend.enabled = !0, y.activeTexture(y.TEXTURE0 + 0), an(y, O.texture), Z.uniforms.image = 0, Z.uniforms.textureSize = [R, K], Z.uniforms.edgeWidth = E.getHighlightWidth();
var d = E.getHighlightColor();
if (t._lastHighlightColor !== d) {
var g = zd(t._lastHighlightColor = d);
t._highlightColorData = [g[0] / 255, g[1] / 255, g[2] / 255, g[3] / 255]
}
Z.uniforms.edgeColor = t._highlightColorData, t.ibuffer ? (t.ibuffer.upload(), t.vbuffer.upload()) : (t.ibuffer = Cm.Buffer.createIndexBuffer(y, new Uint16Array([0, 2, 1, 1, 2, 3])), t.vbuffer = Cm.Buffer.createVertexBuffer(y, new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]))), Z.attributes.pos.pointer(t.vbuffer), y.drawElements(y.TRIANGLES, 6, y.UNSIGNED_SHORT, 0), P.blend.enabled = !1, an(y, null), y.useProgram(W), Uq && Pr(y, W.aPosition)
}
}
}), o.defineProperties(ui.prototype, {
mode: {
get: function () {
return this._mode
}, set: function (d) {
var q = this._mode;
d !== q && (this._mode = d, d === ui.Mode.MouseOver || d === ui.Mode.Style ? K(this.gv.getView(), "mousemove", this.onMouseOver) : (q === ui.Mode.MouseOver || q === ui.Mode.Style) && b(this.gv.getView(), "mousemove", this.onMouseOver))
}
}
});
var hj = {
vs: ["attribute vec2 pos;", "varying vec2 vUv;", "void main(void) {", "gl_Position = vec4(pos.x * 2.0 - 1.0, -pos.y * 2.0 + 1.0, 0.0, 1.0);", "vUv = vec2(pos.x, 1.0 - pos.y);", "}"].join("\n"),
fs: ["precision highp float;", "uniform sampler2D image;", "uniform vec2 textureSize;", "uniform float edgeWidth;", "uniform vec4 edgeColor;", "varying vec2 vUv;", "float getCol(vec2 coord) {", "return texture2D(image, coord).a;", "}", "void main() {", "vec2 cc = vUv;", "float center = getCol(cc);", "float dx = edgeWidth / textureSize.x;", "float dy = edgeWidth / textureSize.y;", "vec2 coord;", "float topLeft = getCol(cc+vec2(-dx, -dy));", "float top = getCol(cc+vec2(0.0, -dy));", "float topRight = getCol(cc+vec2(dx, -dy));", "float left = getCol(cc+vec2(-dx, 0.0));", "float right = getCol(cc+vec2(dx, 0.0));", "float bottomLeft = getCol(cc+vec2(-dx, dy));", "float bottom = getCol(cc+vec2(0.0, dy));", "float bottomRight = getCol(cc+vec2(dx, dy));", "float v = -topLeft-2.0*top-topRight+bottomLeft+2.0*bottom+bottomRight;", "float h = -bottomLeft-2.0*left-topLeft+bottomRight+2.0*right+topRight;", "float edge = sqrt(h * h + v * v);", "edge = smoothstep(0.9, 1.0, edge);", "if (edge < 0.5) {", "discard;", "}", "gl_FragColor = edgeColor;", "}"].join("\n")
},
Rk = function (E) {
this.gv = E
},
Zo = "edit_tx",
te = "edit_ty",
ll = "edit_tz",
Pg = "edit_rx",
hb = "edit_ry",
pn = "edit_rz",
zb = "edit_sx",
Oh = "edit_sy",
dh = "edit_sz",
Nr = {};
Nr[Zo] = 101, Nr[te] = 102, Nr[ll] = 103, Nr[Pg] = 104, Nr[hb] = 105, Nr[pn] = 106, Nr[zb] = 107, Nr[Oh] = 108, Nr[dh] = 109, yc(Rk, o, {
_42: function (l, K, m) {
var i = this,
N = i.gv,
a = N.sm().ld();
if (a && N.isEditable(a) && !N.isEditHelperDisabled() && Fq(a) && (!N.isFirstPersonMode() || !N.isMouseRoamable() && !nf)) {
gk(N);
var F, $, T = N.isMovable(a),
I = N.isRotationEditable(a),
x = N.isSizeEditable(a),
V = N._axisXColor,
W = N._axisYColor,
S = N._axisZColor,
j = N._editSizeColor,
A = a.p3(),
B = En(N.getEye(), A) / 10,
c = B / (m ? 5 : 10),
H = .7 * B,
X = .4 * H,
u = A[0],
d = A[1],
Y = A[2];
F = [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0], T && i._17O(l, K, a, m, Zo, V, F, [u, d - c, Y, u + H, d - c, Y, u + H, d, Y, u + H, d, Y, u, d, Y, u, d - c, Y, u, d - c, Y + c, u + H, d - c, Y + c, u + H, d - c, Y, u + H, d - c, Y, u, d - c, Y, u, d - c, Y + c]), $ = u + H, x && i._17O(l, K, a, m, zb, j, F, [$, d - c, Y, $ + X, d - c, Y, $ + X, d, Y, $ + X, d, Y, $, d, Y, $, d - c, Y, $, d - c, Y + c, $ + X, d - c, Y + c, $ + X, d - c, Y, $ + X, d - c, Y, $, d - c, Y, $, d - c, Y + c]), $ += X, I && i._17O(l, K, a, m, Pg, V, F, [$, d - c, Y, $ + X, d - c, Y, $ + X, d, Y, $ + X, d, Y, $, d, Y, $, d - c, Y, $, d - c, Y + c, $ + X, d - c, Y + c, $ + X, d - c, Y, $ + X, d - c, Y, $, d - c, Y, $, d - c, Y + c]), F = [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0], T && i._17O(l, K, a, m, te, W, F, [u, d, Y, u, d + H, Y, u - c, d + H, Y, u - c, d + H, Y, u - c, d, Y, u, d, Y, u, d, Y, u, d, Y - c, u, d + H, Y - c, u, d + H, Y - c, u, d + H, Y, u, d, Y]), $ = d + H, x && i._17O(l, K, a, m, Oh, j, F, [u, $, Y, u, $ + X, Y, u - c, $ + X, Y, u - c, $ + X, Y, u - c, $, Y, u, $, Y, u, $, Y, u, $, Y - c, u, $ + X, Y - c, u, $ + X, Y - c, u, $ + X, Y, u, $, Y]), $ += X, I && i._17O(l, K, a, m, hb, W, F, [u, $, Y, u, $ + X, Y, u - c, $ + X, Y, u - c, $ + X, Y, u - c, $, Y, u, $, Y, u, $, Y, u, $, Y - c, u, $ + X, Y - c, u, $ + X, Y - c, u, $ + X, Y, u, $, Y]), F = [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0], T && i._17O(l, K, a, m, ll, S, F, [u, d, Y, u, d, Y + H, u, d - c, Y + H, u, d - c, Y + H, u, d - c, Y, u, d, Y, u, d - c, Y, u - c, d - c, Y, u - c, d - c, Y + H, u - c, d - c, Y + H, u, d - c, Y + H, u, d - c, Y]), $ = Y + H, x && i._17O(l, K, a, m, dh, j, F, [u, d, $, u, d, $ + X, u, d - c, $ + X, u, d - c, $ + X, u, d - c, $, u, d, $, u, d - c, $, u - c, d - c, $, u - c, d - c, $ + X, u - c, d - c, $ + X, u, d - c, $ + X, u, d - c, $]), $ += X, I && i._17O(l, K, a, m, pn, S, F, [u, d, $, u, d, $ + X, u, d - c, $ + X, u, d - c, $ + X, u, d - c, $, u, d, $, u, d - c, $, u - c, d - c, $, u - c, d - c, $ + X, u - c, d - c, $ + X, u, d - c, $ + X, u, d - c, $])
}
}, _17O: function (p, n, u, R, w, V, N, t) {
var g = this.gv,
D = g._buffer,
f = ts.for(p),
S = f.directUniforms(),
l = f.directAttribs();
if (g._picking) {
R = g.pickColorMap;
var k = Nr[w];
R[k] = {
data: u,
part: w
}, S.uFixPickReverseColor = rl(k)
}
Ll(p, n, F, !0, F, !0, F, !1), S.uDiffuse = V, l.aPosition = bm(p, D.vs, new fk(t), F), l.aNormal = bm(p, D.ns, new fk(N), F), bi(p), ie(p, 0, 12), Jf(p), ol(p, n)
}
});
var Vf = O.Raycaster = function ($) {
this.gv = $, this.maxTriangleTest = 1 / 0, this.backfaceCulling = !0
};
ki("Raycaster", o, {
intersect: function (u) {
var A = this,
x = A.gv,
F = x.getDataAt(u);
return F ? A.intersectObject(u, F) : null
}, intersectObjects: function (F, R, A) {
var X, y, G, i, B = this,
_ = 1 / 0,
q = F.origin || (new tl).fromArray(B.gv.getEye()),
V = B.maxTriangleTest,
E = [];
return R.forEach(function ($) {
A && A($) === !1 || $.s("intersect") !== !1 && E.push($)
}), E.sort(function (o, P) {
return q.distanceToSquared2(o.p3()) - q.distanceToSquared2(P.p3())
}), B.countTriangles = 0, E.forEach(function (T) {
B.countTriangles > V || (X = B.intersectObject(F, T), X && (y = q.distanceToSquared(X.world), _ > y && (G = T, i = X, _ = y)))
}), B.countTriangles = 0, {
data: G,
intersect: i
}
}, intersectObject: function (e, a) {
if (e instanceof Qi) return this._intersectObjectImpl(e, a);
var U = this,
X = U.gv,
d = X.unproject(e),
S = new tl,
G = X.getEye(),
C = new tl;
if (X.isOrtho()) {
var s = new tl(G);
C.copy(X.getCenter()).sub(s).normalize();
var p = S.copy(d).sub(s).dot(C);
S.copy(C).setLength(-p).add(s.copy(d))
} else S.copy(G), C.copy(d).sub(S).normalize();
var f = new O.Math.Ray(S, C);
return U._intersectObjectImpl(f, a)
}, _intersectObjectImpl: function () {
function M() {
var s = new tl;
return s.subVectors(F, g), I.subVectors(x, g), s.cross(I).normalize(), s
}
function r(R, U, a, d, r, $, i) {
return pq.barycoordFromPoint(R, U, a, d, c), r.multiplyScalar(c.x), $.multiplyScalar(c.y), i.multiplyScalar(c.z), r.add($).add(i), r.clone()
}
var j = new br,
z = new br,
s = new Qi,
A = new tl,
b = new tl,
w = new tl,
y = new tl,
v = new tl,
x = new tl,
g = new tl,
F = new tl,
$ = new Xi,
h = new Xi,
L = new Xi,
I = new tl,
B = {
vs: Ef,
is: Lq,
uv: mi
},
c = new tl,
d = Rh.slice(0);
return d.push("csg"),
function (p, c) {
var e = this.gv.getData3dUI(c),
V = c.mat || e.mat;
V ? j.fromArray(V) : j.identity(), z.getInverse(j), s.copy(p).applyMatrix4(z);
var a, n, J, W = "body",
Z = e.shapeModel;
if (Z || (Z = bf(e)), Z || (O.CSGNode && c instanceof O.CSGNode || O.CSGShape && c instanceof O.CSGShape ? (J = !0, Z = [e.left, e.front, e.right, e.back, e.top, e.bottom, e.csg]) : c instanceof O.Node && !(c instanceof O.Shape) ? (a = !0, Z = B) : (n = !0, Z = [e.left, e.front, e.right, e.back, e.top, e.bottom])), !Z) return console.log("Can not find shape model."), null;
ip(Z) || (Z = [Z]);
var P, u, _, q, H, G, E, m, o, Q, D, t, U, R, i, I, S = 1 / 0,
X = ["", "top_", "bottom_"],
k = !1,
C = this.backfaceCulling,
T = [];
for ($p(Z, e, T), P = 0, u = T.length; u > P; P++)
if (U = T[P])
for (_ = 0, q = X.length; q > _; _++)
if (R = X[_], E = U[R + "vs"], m = U[R + "is"], o = U[R + "uv"] || U[R + "tuv"], E) {
if (i = U[R + "boundingBox"]) {
var D = s.intersectBox(i);
if (!D) continue;
if (s.origin.distanceTo(D) > S) continue;
I = !1
} else U[R + "boundingBox"] = i = new O.Math.Box3, I = !0;
for (H = 0, G = m ? m.length : E.length / 3; G > H; H += 3) this.countTriangles++, m ? (b.fromArray(E, 3 * m[H]), w.fromArray(E, 3 * m[H + 1]), y.fromArray(E, 3 * m[H + 2])) : (b.fromArray(E, 3 * H), w.fromArray(E, 3 * (H + 1)), y.fromArray(E, 3 * (H + 2))), I && (i.expandByPoint(b), i.expandByPoint(w), i.expandByPoint(y)), Q = s.intersectTriangle(b, w, y, C, A), Q && (t = s.origin.distanceTo(Q), S > t && (S = t, v.copy(Q), x.copy(b), g.copy(w), F.copy(y), "" !== R ? W = R.slice(0, -1) : a ? W = Rh[Math.floor(H / 6)] : n ? W = Rh[P] : J && (W = d[P]), o && (k = !0, m ? ($.fromArray(o, 2 * m[H]), h.fromArray(o, 2 * m[H + 1]), L.fromArray(o, 2 * m[H + 2])) : ($.fromArray(o, 2 * H), h.fromArray(o, 2 * (H + 1)), L.fromArray(o, 2 * (H + 2))))))
}
if (!isFinite(S)) return null;
var N, f = v.clone().applyMatrix4(j);
k && (N = r(v, x, g, F, $, h, L));
var K = M(x, g, F),
Y = M(x.applyMatrix4(j), g.applyMatrix4(j), F.applyMatrix4(j)),
l = s.direction.dot(K);
return l > 0 && (K.multiplyScalar(-1), Y.multiplyScalar(-1)), {
world: f,
local: v.clone(),
worldNormal: Y,
normal: K,
uv: N,
part: W
}
}
}()
});
var Wj = function (H, q) {
this.gv = H, this.s = function (b, u, o) {
return u == F && (u = o), u == F ? q.getStyle(b) : Dj(u, q, H)
}, this.data = q
};
yc(Wj, o, {
I3d: !0,
ms_icons: 1,
_iv: !0,
_cacheBoundingBox: Z,
iv: function () {
this._iv = !0
}, update: function (U, e, M) {
var Y = this,
j = Y.data;
if (U || (U = Y.gv, e = U.getGL(), M = e._40Q), !Y.needValidate(e) || !U.isVisible(j)) return M.push(this, !1), void 0;
var l, z, x, s, R, O = j._id,
L = Y.s("autorotate") || Y.s("shape3d.autorotate") || Y.s("fixSizeOnScreen") || Y.s("shape3d.fixSizeOnScreen") ? null : Y.s("batch"),
A = j.getRenderLayer(),
T = M.get(A, !0),
G = T.batchIndexMap,
r = T.batchModelMap,
W = U.getBrightness(j),
V = W != F && 1 !== W;
l = Qr(G, r, j, L, U);
var B = Y.validate(l, L ? U.getBatchInfo(L) || Xn : F);
if (l && (z = G[O], x = z.size = l.vs.length / 3 - z.begin, R = l.rs))
for (W = V ? W : 1, s = 0; x > s; s++) R.push(W);
var S = U.getWireframeGeometry(j);
if (S) oq(U, j, S);
else if (Fq(j)) {
var E = U.getWireframe(j);
E && oq(U, j, E)
}
Y.labelInfo = Y.label2Info = Y.noteInfo = Y.note2Info = Y._38o = F, Y._24O(Bg, "getLabel"), Y._24O(Qk, "getLabel2"), Y._26O(Rm, "getNote"), Y._26O(Vk, "getNote2"), Y._15O(), Y.interactiveInfo = U.isInteractive(j) ? {} : F, T.push(this, !0), B !== !1 && (Y._iv = !1)
}, clearWireframeGeometryCache: function () {
var M = this;
Hm(M), M.data.iv()
}, _46Q: function (G) {
var l = this,
V = l.data,
q = l.gv;
if (q.isVisible(V)) {
var f = V._id,
r = q._40Q.get(V._renderLayer, !0),
J = r.batchIndexMap[f],
$ = r.polylineIndexMap[f],
E = r.wireframeIndexMap[f];
if (J || $ || E) {
var v = gm(G, q.pickColorMap, q.isSelectable(V), V, nh, !0);
v && (Ic(v, J, r.batchModelMap), Ic(v, $, r.polylineModelMap), Ic(v, E, r.wireframeModelMap))
}
}
}, _42: function (K, P, G) {
function N(v, l, G) {
var M = l.getBrightness(G),
c = G.s("alphaTest"),
w = G.s("envmap"),
P = ts.for(v),
m = P.directUniforms();
M != F && 1 !== M && (m.uBrightness = M), m.uAlphaTest = c, m.uUseEnvMap = w ? !0 : !1, m.uReflectivity = w || .01, m.shadowReceive = !S && G.s("shadow.receive"), m.shadowCull = !S && !!G.s("shadow.cull");
var T = A.s("3d.clip.direction");
if (T) {
var L = A.s("3d.clip.percentage");
switch (0 === L && (z = !1), T) {
case "left":
T = 2;
break;
case "top":
T = 3;
break;
case "bottom":
T = 4;
break;
case "front":
T = 5;
break;
case "back":
T = 6;
break;
case "right":
default:
T = 1
}
if (0 === T % 2 && (L = 1 - L), G instanceof O.Shape) {
var x = G.s3(),
b = G.p3(),
u = G.getAnchor3d();
L = 3 > T ? (L - u.x) * x[0] + b[0] : 5 > T ? (L - u.y) * x[1] + b[1] : (L - u.z) * x[2] + b[2]
} else L -= .5;
m.uClipPercent = L
}
m.uClipDirection = T || 0, v._blooming && !G.s("bloom") && (m.blackout = !0)
}
var A = this,
m = A.data,
I = A.gv;
if (I.isVisible(m)) {
var J, S = I._picking;
if (S) J = I.pickColorMap;
else {
if (I.isTransparentMask(m) || I.isReflecting(K) && m.s("3d.reflectable") === !1) return;
J = Z
} if (Wj.getTitle === Z) {
Wj.getTitle = 0;
for (var E in u)
if (E.length === Qk.length + 1 && E[Qk.length] === Gr[4].toUpperCase() && E[Qk.length - 1] === Gr[Qk.length + 1].toUpperCase()) {
Wj.getTitle = jq;
break
}
}
if (!Wj.getTitle || Qg[Qk.length + 2]) {
if (Wj.getHead === Z) {
Wj.getHead = 0;
for (var E in L) {
var g = "box-sizing";
6 === E.length && E[0] === Gr[4] && E[3] === g[0] && E[4] === g[1] && E[5] === g[2] && (Wj.getHead = jq)
}
}
if (!Wj.getHead || Qg[Qk.length]) {
var Q, v, t = m._id,
s = I._40Q.get(m._renderLayer, !0),
b = s.batchIndexMap,
W = s.batchModelMap,
R = I.isSelectable(m),
D = !1,
z = !0,
x = b[t];
if (S && (v = gm(K, J, R, m, nh, x), v && !I._45Q && (Ic(v, x, W), Ic(v, s.polylineIndexMap[t], s.polylineModelMap), Ic(v, s.wireframeIndexMap[t], s.wireframeModelMap))), x || (D || (D = !0, N(K, I, m)), z && A._80o(K, P, G)), I.isLabelVisible(m) && ((Q = A.labelInfo) && (S && gm(K, J, R, m, Bg), D || (D = !0, N(K, I, m)), A._28O(Q, Bg, G)), (Q = A.label2Info) && (S && gm(K, J, R, m, Qk), D || (D = !0, N(K, I, m)), A._28O(Q, Qk, G))), I.isNoteVisible(m) && ((Q = A.noteInfo) && (S && gm(K, J, R, m, Rm), D || (D = !0, N(K, I, m)), A._29O(Q, Rm, G)), (Q = A.note2Info) && (S && gm(K, J, R, m, Vk), D || (D = !0, N(K, I, m)), A._29O(Q, Vk, G))), (Q = A._38o) && (D || (D = !0, N(K, I, m)), A._99O(K, P, Q, J, R, G)), D) {
var f = ts.for(K).directUniforms();
f.uBrightness = 1, f.uClipDirection = 0, K._blooming && (f.blackout = !1)
}
}
}
}
}, prepare: function () {
var S = this,
D = S.data;
if (!(D instanceof Br)) {
var b, s, C, t, u, Z = S.gv,
N = Z.getGL(),
n = D._id,
Y = S.s("batch"),
x = Z._batchIndexMap,
I = Z._batchModelMap,
q = Z.getBrightness(D),
e = q != F && 1 !== q;
if (S.needValidate(N)) {
if (b = Qr(x, I, D, Y, Z), S.validate(b, Y ? Z.getBatchInfo(Y) || Xn : F), b && (s = x[n], C = s.size = b.vs.length / 3 - s.begin, u = b.rs))
for (q = e ? q : 1, t = 0; C > t; t++) u.push(q);
if (Fq(D)) {
var i = Z.getWireframeGeometry(D);
if (i) oq(Z, D, i);
else {
var K = Z.getWireframe(D);
K && oq(Z, D, K)
}
}
S.labelInfo = S.label2Info = S.noteInfo = S.note2Info = S._38o = F, S._24O(Bg, "getLabel"), S._24O(Qk, "getLabel2"), S._26O(Rm, "getNote"), S._26O(Vk, "getNote2"), S._15O(), S.interactiveInfo = Z.isInteractive(D) ? {} : F, S._iv = !1
}
}
}, dispatchBoundingBoxChanged: function () {
this._cacheBoundingBox = Z
}, getBoundingBox: function () {
var r, H, _, h, L, e;
return function () {
if (this._cacheBoundingBox) return this._cacheBoundingBox;
r || (r = {
vs: Ef,
is: Lq,
uv: mi
}, H = new tl, _ = new tl, h = new tl, L = new tl, e = new tl);
var v = this,
F = v.data,
w = v.shapeModel;
if (w || F instanceof O.Shape || (w = bf(v)), !w && F instanceof O.Shape && (v.prepare(), w = v.shapeModel), w || (F instanceof O.Node && !(F instanceof O.Shape) ? w = r : (v.left || v.front || v.right || v.back || v.top || v.bottom) && (w = [v.left, v.front, v.right, v.back, v.top, v.bottom])), !w) return Z;
ip(w) || (w = [w]);
var Y, S, U, p, i, f, t, I, B, Q, G, d, $ = ["", "top_", "bottom_"],
R = new O.Math.Box3,
W = !1;
if (v._needRecoverPosition) {
L.set.apply(L, F.p3());
var m = F.s3();
e.set(1 / (m[0] || 1), 1 / (m[1] || 1), 1 / (m[2] || 1))
} else L.set(0, 0, 0), e.set(1, 1, 1);
for (Y = 0, S = w.length; S > Y; Y++)
if (B = w[Y])
for (U = 0, p = $.length; p > U; U++)
if (Q = $[U], t = B[Q + "vs"], I = B[Q + "is"], t) {
if (d = Q + "boundingBox", G = B[d], !G)
for (B[d] = G = new O.Math.Box3, i = 0, f = I ? I.length : t.length / 3; f > i; i += 3) I ? (H.fromArray(t, 3 * I[i]).sub(L).multiply(e), _.fromArray(t, 3 * I[i + 1]).sub(L).multiply(e), h.fromArray(t, 3 * I[i + 2]).sub(L).multiply(e)) : (H.fromArray(t, 3 * i).sub(L).multiply(e), _.fromArray(t, 3 * (i + 1)).sub(L).multiply(e), h.fromArray(t, 3 * (i + 2)).sub(L).multiply(e)), !H.isNaN() && G.expandByPoint(H), !_.isNaN() && G.expandByPoint(_), !h.isNaN() && G.expandByPoint(h);
R.expandByBox(G), W = !0
}
return W ? (this._cacheBoundingBox = R, o.freeze(R), o.freeze(R.min), o.freeze(R.max), dn(v.gv, F), R) : Z
}
}(),
needValidate: function () {
return this._iv
}, validate: function () { }, _16O: function () {
return Hd
}, _80o: function () { }, dispose: function () { }, getBodyColor: function (w) {
var r = this.data,
m = this.gv.getBodyColor(r);
return m ? m : w ? r.getStyle(w) : F
}, getCachedTexture: function (N) {
var p = this._cachedTextures;
return p ? p[N || "main"] : null
}, setCachedTexture: function (w, C) {
var s = this._cachedTextures;
return s || (s = this._cachedTextures = {}), s[C || "main"] = w, w
}, invalidateCachedTexture: function (Q) {
var l = this._cachedTextures;
if (l) {
for (var R in l) Q.deleteTexture(l[R]);
this._cachedTextures = {}
}
}, invalidateCachedGeometry: function () { }, _24O: function (g, I) {
var x = this,
u = x.data,
z = x.gv,
m = x.s,
d = z[I](u);
if (d != F) {
var l = m(g + ".scale"),
O = m(g + ".max"),
r = x[g + "Info"] = {
label: d,
textureScale: m(g + ".texture.scale"),
color: z[I + "Color"](u),
font: m(g + ".font"),
align: m(g + ".align"),
background: z[I + "Background"](u)
},
H = r.rect = qr(r, d);
O > 0 && O < H.width && (r.labelWidth = H.width, H.width = O), H.x = H.y = 0, H.width *= l, H.height *= l, r.mat = x._16O(m(g + ".autorotate"), m(g + ".position"), H, m(g + ".face"), m(g + ".t3"), m(g + ".r3"), m(g + ".rotationMode"));
var T = H.width / 2,
o = H.height / 2;
r.vs = new fk([-T, o, 0, -T, -o, 0, T, -o, 0, T, o, 0]), H.width /= l, H.height /= l
}
}, _26O: function (C, r) {
var Z = this,
x = Z.data,
W = Z.gv,
Y = Z.s,
L = W[r](x);
if (L != F) {
var g = Y(C + ".scale"),
I = this[C + "Info"] = {
note: L,
textureScale: Y(C + ".texture.scale"),
expanded: Y(C + ".expanded"),
font: Y(C + ".font"),
color: Y(C + ".color"),
align: Y(C + ".align"),
borderWidth: Y(C + ".border.width"),
borderColor: Y(C + ".border.color"),
background: W[r + "Background"](x)
};
if (I.expanded) {
var O = Y(C + ".max"),
_ = qr(I, L);
_.width += 6, _.height += 2, O > 0 && O < _.width && (I.labelWidth = _.width, _.width = O);
var J = {
x: -_.width / 2,
y: -8 - _.height,
width: _.width,
height: _.height + 8
}
} else J = {
x: -6,
y: -18,
width: 12,
height: 18
};
I.mat = Z._16O(Y(C + ".autorotate"), Y(C + ".position"), F, Y(C + ".face"), Y(C + ".t3"), Y(C + ".r3"), Y(C + ".rotationMode")), I.rect = J, 1 !== g && (J = Pm(J), J.x *= g, J.height *= g, J.y = -J.height, J.width *= g);
var S = J.x,
z = J.y,
i = J.width,
y = J.height;
I.vs = new fk([S, -z, 0, S, -z - y, 0, S + i, -z - y, 0, S + i, -z, 0])
}
}, eachShapeModel: function (q, t) {
function j(p) {
ko(p), p.vs && q(p.vs, p.is, p.ns, p.uv), p.top_vs && q(p.top_vs, p.top_is, p.top_ns, p.top_uv), p.bottom_vs && q(p.bottom_vs, p.bottom_is, p.bottom_ns, p.bottom_uv), p.from_vs && q(p.from_vs, p.from_is, p.from_ns, p.from_uv), p.to_vs && q(p.to_vs, p.to_is, p.to_ns, p.to_uv)
}
function A(v) {
var S, c, w;
if (ip(v))
for (c = 0, w = v.length; w > c; c++) S = v[c], S && A(S);
else dk(v) ? A(bf(n, v), n) : xl(v) && (v.shape3d ? A(v.shape3d) : j(v))
}
var n = this,
J = n.data,
t = t || n.shapeModel || bf(n);
t || (t = J instanceof O.Node && !(J instanceof O.Shape) ? {
vs: Ef,
is: Lq
} : [n.left, n.front, n.right, n.back, n.top, n.bottom]), A(t)
}, _28O: function (k, T, I) {
if (I(this.s(T + ".transparent"))) {
var K = k.rect,
F = k.textureScale,
d = K.width * F,
x = K.height * F;
if (d >= 1 && x >= 1) {
var P = Cr(d, x);
1 !== F && (P.translate(P, K.x, K.y), P.scale(F, F), P.translate(P, -K.x, -K.y)), vp(P, k), P.restore(), ud(this, T, k.mat, k.vs, !0)
}
}
}, _29O: function (u, M, Y) {
if (Y(this.s(M + ".transparent"))) {
var I = u.rect,
a = u.textureScale,
V = I.x,
$ = I.y,
y = I.width * a,
C = I.height * a;
if (y >= 1 && C >= 1) {
I.x = I.y = 0;
var R = Cr(y, C);
1 !== a && R.scale(a, a), $q(R, u), R.restore(), I.x = V, I.y = $, ud(this, M, u.mat, u.vs, !1)
}
}
}, _99O: function (I, L, e, w, i, o) {
if (e) {
var m = this,
u = m.gv,
s = m.data,
_ = u._buffer,
v = u._1O,
X = e.icons,
y = ts.for(I),
Z = y.directAttribs();
for (var Y in X) {
var P = X[Y],
n = e.rects[Y];
if (n && o(Dj(P.transparent, s, u))) {
u._picking && gm(I, w, i, s, Y);
var h = Dj(P.shape3d, s, u),
k = h ? [h] : Dj(P.names, s, u),
b = k ? k.length : 0,
c = Dj(P.textureScale, s, u) || 1,
A = Dj(P.light, s, u);
A == F && (A = h ? !0 : !1), Ll(I, L, Dj(P.blend, s, u), A, Dj(P.opacity, s, u), Dj(P.reverseFlip, s, u), Dj(P.reverseColor, s, u), Dj(P.reverseCull, s, u));
for (var N = 0; b > N; N++) {
var H = k[N],
U = n[N];
if (yn(m, U.mat), h) pj(u, s, bf(m, h), m);
else {
var x = ii(H);
if (x) {
var l = U.width * c,
S = U.height * c;
if (l >= 1 && S >= 1) {
var T = Cr(l, S);
qk(T, x, Dj(P.stretch, s, u), 0, 0, l, S, s, u), T.restore(), rg(I, xm, v), bi(I, L, v, Dj(P.discardSelectable, s, u), _.uv, Vj), Z.aPosition = bm(I, _.vs, U.vs, F), Z.aNormal = Sl(I, _.ns, Lh, F), ym(I, _.is, ar), os(I, 0, ar.length), Jf(I, L, v)
}
}
}
Gf(u)
}
ol(I, L)
}
}
}
}
});
var gf = function (B, d) {
fi(gf, this, [B, d])
};
yc(gf, Wj, {
_16O: function (I, $, d, Y, q, R, Q, j, F) {
var o = this.data,
l = o.getFinalScale3d(),
S = Ep($, l, d, Y, j, F);
if (o.hasOwnProperty("_anchor") || o.hasOwnProperty("_anchorElevation")) {
var f = o.getAnchor3d();
S[0] -= (f.x - .5) * l[0], S[1] -= (f.y - .5) * l[1], S[2] -= (f.z - .5) * l[2]
}
return Te(kn(), S, o.p3(), Y, q, R, Q, I, o.getFinalRotation3d(), o.getRotationMode())
}, clear: function () {
var V = this;
V.faceMat = V.mat = V.shapeModel = V.left = V.right = V.front = V.back = V.top = V.bottom = V.csg = F
}, needValidate: function (N) {
if (this._iv) return this._validateFrameId = N._renderInfo.frame, !0;
if (this.s("autorotate") || this.s("shape3d.autorotate") || this.s("fixSizeOnScreen") || this.s("shape3d.fixSizeOnScreen") || this.s("hide.overlapping.group")) {
var s = N._renderInfo.frame;
if (this._validateFrameId !== s) return this._validateFrameId = s, !0
}
return !1
}, validate: function (o, z) {
var w = this,
k = w.gv,
_ = w.data,
Z = w.shapeName = w.s(Lm),
x = bf(w, Z);
if (w._updateAutoRotation(), w._updateFixSize2d(), w._updateOverlapping(), w.dispatchBoundingBoxChanged(), this.s("autorotate") || this.s("shape3d.autorotate") || this.s("fixSizeOnScreen") || this.s("shape3d.fixSizeOnScreen")) {
var y = _.getRenderLayer(),
E = k._40Q.get(y);
E && E.ivWireframeBatch(_)
}
var m = sj(_, k.getMat(_), x ? w.s("shape3d.scaleable") : !0);
if (_.appendAnchorMatrix3d(m), w.clear(), w.mat = _.mat = m, x || !Z)
if (w.shapeModel = x, o) {
var C = [];
x ? km(k, _, x, w, w.getBodyColor(), [m], o, C) : (Li(k, _, o, z, m, nq, C, Zc), Li(k, _, o, z, m, fm, C, Up), Li(k, _, o, z, m, $c, C, Ol), Li(k, _, o, z, m, Kd, C, Uk), Li(k, _, o, z, m, wg, C, Fp), Li(k, _, o, z, m, Qq, C, Be)), C.length && (gc(o.vs, C), gc(o.ns, Gb(C)))
} else x || (w._cubeUvs = null, w.vf(nq, 0), w.vf(fm, 16), w.vf(wg, 8), w.vf(Qq, 24), w.vf($c, 32), w.vf(Kd, 40))
}, _updateAutoRotation: function () {
var t = new gg,
Y = new br,
R = new tl,
A = new tl,
a = new tl;
return function () {
var D = this,
q = D.data,
f = D.s("autorotate") || D.s("shape3d.autorotate");
if (!f) return q._dynamicRotation && delete q._dynamicRotation, void 0;
var s = D.gv;
a.copy(D.s("shape3d.autorotate.up") || s._up);
var m;
m = "string" == typeof f ? [f.indexOf("x") < 0 ? s._eye[0] : s._center[0], f.indexOf("y") < 0 ? s._eye[1] : s._center[1], f.indexOf("z") < 0 ? s._eye[2] : s._center[2]] : s._eye;
var L = s._center,
g = q.p3();
R.copy(g), A.set(m[0] - L[0], m[1] - L[1], m[2] - L[2]).add(R), Y.lookAt(A, R, a), t.set(0, 0, 0, q.getRotationMode(), !0).setFromRotationMatrix(Y);
var H = q._dynamicRotation;
H && Math.abs(H[0] - t.x) < 1e-5 && Math.abs(H[1] - t.y) < 1e-5 && Math.abs(H[2] - t.z) < 1e-5 || (q._dynamicRotation = [t.x, t.y, t.z])
}
}(),
_updateFixSize2d: function () {
var x = this,
X = x.data,
J = x.s("fixSizeOnScreen") || x.s("shape3d.fixSizeOnScreen");
if (!J) return X._dynamicScale3d && delete X._dynamicScale3d, void 0;
var n = x.gv,
U = sj(X, n.getMat(X)),
w = Td([0, 0, 0], U),
i = n.toViewPosition(w);
if (!isNaN(i.x) && !isNaN(i.y)) {
var C = Td([1, 0, 0], U),
V = n.toViewPosition(C),
Y = Td([0, 1, 0], U),
e = n.toViewPosition(Y),
l = V.x - i.x,
Z = e.y - i.y;
if (l && Z) {
var q, p, d = X._dynamicScale3d || [1, 1, 1],
h = ii(X.s("shape3d.image"));
if (J[0] > 0 && (q = J[0]), J[1] > 0 && (p = J[1]), !q || !p) {
var O = J > 0 ? J : 1;
q || (q = (xc(h, X) || X.getWidth()) * O), p || (p = (oo(h, X) || X.getTall()) * O)
}
var A = Math.abs(l / q),
o = Math.abs(Z / p);
Math.abs(A - 1) < .001 && Math.abs(o - 1) < .001 || (X._dynamicScale3d = [d[0] / A, d[1] / o, d[2]])
}
}
}, _updateOverlapping: function () {
var Q = this,
M = Q.s("hide.overlapping.group");
if (!M) return Q._rectOverlapping && (Q._rectOverlapping = Z), void 0;
var A, n, x, w = Q.gv,
k = Q.data,
H = sj(k, w.getMat(k)),
F = 1 / 0,
W = 1 / 0,
c = -1 / 0,
N = -1 / 0,
v = k.getAnchor3d(),
S = v.x,
e = v.y,
i = v.z;
for (A = 0; 8 > A; A++) {
if (n = Td([(A >> 2) - S, (1 & A >> 1) - e, (1 & A) - i], H), x = w.toViewPosition(n), isNaN(x.x) || isNaN(x.y)) return;
F = Math.min(F, x.x), c = Math.max(c, x.x), W = Math.min(W, x.y), N = Math.max(N, x.y)
}
var L = {
x: F,
y: W,
w: c - F,
h: N - W
};
Q._rectOverlapping = w.overlappingBox.isOverlapping(M, L)
}, getVectorDynamicSize: function () {
var g, E = this,
a = E.s("shape3d"),
j = E.data;
if ("billboard" === a || "plane" === a || (g = j._currentCubeElementId) != F) {
var y, V, w = E.gv,
c = sj(j, w.getMat(j)),
L = j.getAnchor3d(),
z = .5 - L.x,
K = .5 - L.y,
X = .5 - L.z,
x = Math.min(E.s("vector.dynamic.maxsize"), w._glCapabilities.maxTextureSize) / w.getDevicePixelRatio(),
n = function (Z, P) {
Z[0] += z, Z[1] += K, Z[2] += X, P[0] += z, P[1] += K, P[2] += X;
var J = w.toViewPosition(Td(Z, c)),
b = w.toViewPosition(Td(P, c)),
S = J.x - b.x,
D = J.y - b.y;
return Math.min(x, Math.sqrt(S * S + D * D))
};
if ("billboard" === a) y = n([-.5, 0, 0], [.5, 0, 0]), V = n([0, -.5, 0], [0, .5, 0]);
else if ("plane" === a) y = n([-.5, 0, 0], [.5, 0, 0]), V = n([0, 0, -.5], [0, 0, .5]);
else if (j._currentCubeElementId != F) {
var e = 3 * Lq[g + 1],
$ = 3 * Lq[g],
Y = 3 * Lq[g + 2];
y = n([Ef[e], Ef[e + 1], Ef[e + 2]], [Ef[Y], Ef[Y + 1], Ef[Y + 2]]), V = n([Ef[e], Ef[e + 1], Ef[e + 2]], [Ef[$], Ef[$ + 1], Ef[$ + 2]])
}
return [y, V]
}
}, vf: function (h, A) {
var r = this;
if (r.gv.getFaceVisible(r.data, h)) {
var S = _e(r, h);
S.mat && (r.faceMat = !0);
var O = S.uv;
if (O) {
var i = r._cubeUvs;
i || (i = r._cubeUvs = new fk([0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0]));
for (var w = 0; 8 > w; w++) i[A + w] = O[w]
}
return S
}
}, _billboardInView: function () {
var q = [-.5, -.5, 0, -.5, .5, 0, .5, -.5, 0, .5, .5, 0],
w = [-.5, 0, -.5, -.5, 0, .5, .5, 0, -.5, .5, 0, .5],
A = new Hi,
o = new tl,
J = new br;
return function (Z) {
var O = this;
if (!O.mat) return !0;
var _ = O.gv.getFrustum(),
I = "billboard" === Z ? q : w;
A.makeEmpty(), J.fromArray(O.mat);
for (var v = 0, b = I.length; b > v; v += 3) A.expandByPoint(o.fromArray(I, v).applyMatrix4(J));
return _.intersectsBox(A)
}
}(),
_80o: function (k, p, N) {
var m = this;
if (m._rectOverlapping) return !0;
var E = m.shapeModel;
if (E || !m.shapeName) {
var U = m.s("shape3d");
if (("billboard" === U || "plane" === U) && !m._billboardInView(U)) return !0;
var i = m.gv,
u = m.data,
V = i._cube,
O = ts.for(k),
j = O.directAttribs();
gk(i, m.mat), m.s("shape3d.reflector") && !k._picking || (E ? pj(i, u, E, m, m.getBodyColor(), N) : (j.aPosition = bm(k, V.vs, F, F), j.aNormal = bm(k, V.ns, F, F), eo(k, V.is), m._18O(k, p, "left", 0, N), m._18O(k, p, "front", 6, N), m._18O(k, p, "right", 12, N), m._18O(k, p, "back", 18, N), m._18O(k, p, "top", 24, N), m._18O(k, p, "bottom", 30, N))), Gf(i), m.faceMat && (m._18O(k, p, "left", 0, N, !0), m._18O(k, p, "front", 6, N, !0), m._18O(k, p, "right", 12, N, !0), m._18O(k, p, "back", 18, N, !0), m._18O(k, p, "top", 24, N, !0), m._18O(k, p, "bottom", 30, N, !0))
}
}, _18O: function (K, r, M, h, k, m) {
var E = this[M];
if (E) {
if (!k(E.transparent)) return;
if (m && !E.mat || !m && E.mat) return;
var n = this.data.s("polygonOffset");
n && Ik(K, n), m && gk(this.gv, E.mat);
var Q = this,
X = Q.data,
y = ts.for(K),
l = y.directUniforms();
X._currentCubeElementId = h;
var B = Q.gv,
o = B.getTexture(E.texture, X, M),
f = E.uv,
a = E.uvScale,
T = E.uvOffset,
N = E.discardSelectable;
o ? f ? bi(K, r, o, N, B._buffer.uv, Q._cubeUvs, T, a) : bi(K, r, o, N, B._cube.uv, F, T, a) : bi(K), Ll(K, r, E.blend, E.light, E.opacity, E.reverseFlip, E.reverseColor, E.reverseCull), l.uDiffuse = E.color || z["color.empty"], os(K, h, 6), ol(K, r), Jf(K, r, o), m && Gf(B), n && rd(K), X._currentCubeElementId = null
}
}, drawReflector: function () {
var h = new tl,
f = new tl,
R = new gg,
A = new br,
G = new tl,
i = new tl,
C = new tl,
l = new tl,
P = new br,
Q = new br,
Y = new Io,
W = new ye,
E = new ye,
z = function ($, f, C) {
$[C] = f[0], $[C + 1] = f[1], $[C + 2] = f[2]
},
B = function (f, B) {
z(f, B.getEye(), 0), z(f, B.getCenter(), 3), z(f, B.getUp(), 6)
},
k = function (I, e) {
e._eye = [I[0], I[1], I[2]], e._center = [I[3], I[4], I[5]], e._up = [I[6], I[7], I[8]], e._18Q = F;
var k = e._skybox;
k && (k.p3([I[0], I[1], I[2]]), e.getData3dUI(k).iv())
};
return function (j) {
var $ = this;
$._reflectorInfo = null;
var J = $.data;
if (J._reflecting) return !1;
var w = $.gv;
if (w._picking) return !1;
var z = $._reflectorRenderTarget,
H = w.getDevicePixelRatio(),
r = w.getWidth() * H,
x = w.getHeight() * H;
z ? z.setSize(j, r, x) : z = $._reflectorRenderTarget = new Eh.RenderTarget(w, j, r, x), h.copy(J.p3()), f.copy(w.getEye()), A.makeRotationFromEuler(R.set(J.r3(), J.getRotationMode(), !0));
var U;
if (!$._reflectNormal) {
var U = bf($, $.s("shape3d"));
if (!U) return !1;
if (!U.ns && U.length && (U = U[0]), !U.ns || !U.vs) return !1;
$._reflectNormal = [U.ns[0], U.ns[1], U.ns[2]], $._reflectorVbuffer = Cm.Buffer.createVertexBuffer(j, new Float32Array(U.vs))
}
if (G.copy($._reflectNormal), G.applyMatrix4(A), i.subVectors(h, f), i.dot(G) > 0) return !1;
i.reflect(G).negate(), i.add(h), C.copy(w.getCenter()).negate().add(h), C.reflect(G).negate(), C.add(h), l.copy(w.getUp()), l.reflect(G);
var I = [0, 0, 0, 0, 0, 0, 0, 0, 0];
B(I, w), w._eye = i.toArray(), w._center = C.toArray(), w._up = l.toArray(), w._18Q = F;
var g = w._skybox;
g && (g.p3(w._eye), w.getData3dUI(g).iv()), So(j, z.frame), j.viewport(0, 0, z.width, z.height);
var a = J.s("shape3d.reflector.background");
if (a) {
var D = j.getParameter(j.COLOR_CLEAR_VALUE);
qe(j, a)
} else j.clearColor(0, 0, 0, 1);
ts.for(j).glState.depth.mask = !0, j.clear(j.COLOR_BUFFER_BIT | j.DEPTH_BUFFER_BIT);
var O = Mc(w),
s = wp(w);
Y.setFromNormalAndCoplanarPoint(G, h), Y.applyMatrix4(Q.fromArray(s)), W.set(Y.normal.x, Y.normal.y, Y.normal.z, Y.constant), E.x = (Math.sign(W.x) + O[8]) / O[0], E.y = (Math.sign(W.y) + O[9]) / O[5], E.z = -1, E.w = (1 + O[10]) / O[14], W.multiplyScalar(2 / W.dot(E));
var y = J.s("shape3d.reflector.clip"),
X = y === Z ? .003 : y;
O[2] = W.x, O[6] = W.y, O[10] = W.z + 1 - X, O[14] = W.w;
var c = w._computedProjectMatrix;
w._computedProjectMatrix = O, J._reflecting = !0, w.renderScene(), w._computedProjectMatrix = c, P.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1), P.multiply(Q.fromArray(w._projectMatrix)), P.multiply(Q.fromArray(w._viewMatrix)), a && qe(j, D), Ar(j), k(I, w);
var u = J.s("shape3d.reflector.blur");
if (u) {
var q = w.getPostProcessingModule("Blur");
q && q.drawImpl(j, z, u, J.s("shape3d.reflector.blur.ratio"))
}
var S = j._compiledShader.reflector;
S || (S = j._compiledShader.reflector = new Cm.Shader(j, Gc.Reflector.vs, Gc.Reflector.fs)), S.bind(), j.activeTexture(j.TEXTURE0), an(j, z.texture), S.uniforms.tDiffuse = 0, S.uniforms.color = ns(J.s("shape3d.reflector.color") || "rgb(128,128,128)"), S.uniforms.textureMatrix = P.toArray(), S.uniforms.modelMatrix = sj(J), S.uniforms.viewMatrix = wp(w), S.uniforms.projectionMatrix = Mc(w), $._reflectorVbuffer.upload(), S.attributes.pos.pointer($._reflectorVbuffer);
var e = this.s("shape3d.transparent");
if (e) {
var n = ts.for(j).glState,
V = n.depth.mask;
n.depth.mask = !1
}
return j.drawArrays(j.TRIANGLES, 0, 6), e && (n.depth.mask = V), J._reflecting = !1, j.useProgram(w._prg), an(j, F), !0
}
}()
}), Gc.Reflector = {
vs: ["attribute vec3 pos;", "uniform mat4 textureMatrix;", "uniform mat4 modelMatrix;", "uniform mat4 viewMatrix;", "uniform mat4 projectionMatrix;", "varying vec4 vUv;", "void main() {", " vUv = textureMatrix * modelMatrix * vec4( pos, 1.0 );", " gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4( pos, 1.0 );", "}"].join("\n"),
fs: ["precision highp float;", "uniform vec3 color;", "uniform sampler2D tDiffuse;", "varying vec4 vUv;", "float blendOverlay( float base, float blend ) {", " return( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );", "}", "vec3 blendOverlay( vec3 base, vec3 blend ) {", " return vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );", "}", "void main() {", " vec4 base = texture2DProj( tDiffuse, vUv );", " vec2 tUv = vUv.xy / vUv.w;", " if (tUv.x < .0 || tUv.y < .0 || tUv.x > 1. || tUv.y > 1.) discard;", " gl_FragColor = vec4( blendOverlay( base.rgb, color ), base.a );", "}"].join("\n")
};
var rs = function (V, f) {
fi(rs, this, [V, f])
};
yc(rs, gf, {
_80o: function () { }
});
var Ip = function (D, _) {
fi(Ip, this, [D, _])
};
yc(Ip, Wj, {
_25Q: 1,
validate: function (Q) {
var k = this;
if (!k.s("geometry.cache") || !k.info) {
var b = k.gv,
X = k.data,
g = k.s,
E = g("edge.width"),
L = X._40I,
J = X._41I;
if (k.shapeModel = k.info = F, L && J) {
var B, Z, I, x, _, t, R, p, o, c, O = X.isLooped(),
K = g(ej),
S = u.getEdgeType(K);
if (S) {
var G = S(X, Ml(k, b, X, O, K), b, k._19Q);
if (!G.points || G.points.isEmpty()) return;
t = k.info = {}, R = G.segments, _ = G.points, p = _.size();
for (var s = L.getElevation(), N = J.getElevation(), C = 0; p > C; C++) {
var q = _.get(C);
q.e == F && (q.e = s + (N - s) * C / (p - 1))
}
o = bk(_.get(0)), c = bk(_.get(p - 1));
var v = p % 2;
0 === v ? (t.c1 = bk(_.get(p / 2 - 1)), t.c2 = bk(_.get(p / 2))) : t.p3 = bk(_.get((p - v) / 2)), t.s1 = o, t.s2 = bk(_.get(1)), t.t1 = bk(_.get(p - 2)), t.t2 = c
} else {
_ = new xr, t = k.info = {};
var $ = g("edge.offset"),
W = g("edge.center"),
h = g("edge.source.t3"),
T = g("edge.target.t3"),
H = Hb(b, X, "source"),
U = Hb(b, X, "target");
if (!H || !U) return b.invalidateData(X), delete k.info, !1;
if (h && (H[0] += h[0], H[1] += h[1], H[2] += h[2]), T && (U[0] += T[0], U[1] += T[1], U[2] += T[2]), K === _b) {
R = g("edge.segments");
var e = t.points = g(Ei) || Yh;
if (p = e.size()) {
o = bk(e.get(0)), c = bk(e.get(p - 1)), !W && $ && (I = fn(o, H, !0), $ = V($, En(H, o)), H = [H[0] + I[0] * $, H[1] + I[1] * $, H[2] + I[2] * $], I = fn(U, c, !0), $ = V($, En(c, U)), U = [U[0] - I[0] * $, U[1] - I[1] * $, U[2] - I[2] * $]);
var v = p % 2;
0 === v ? (B = bk(e.get(p / 2 - 1)), Z = bk(e.get(p / 2))) : t.p3 = bk(e.get((p - v) / 2)), t.s1 = H, t.s2 = o, t.t1 = c, t.t2 = U
} else !W && $ && (I = fn(U, H, !0), x = En(H, U), $ = cr($, x), H = [H[0] + I[0] * $, H[1] + I[1] * $, H[2] + I[2] * $], U = [U[0] - I[0] * $, U[1] - I[1] * $, U[2] - I[2] * $]), B = H, Z = U;
_.add({
x: H[0],
y: H[2],
e: H[1]
}), _.addAll(e), _.add({
x: U[0],
y: U[2],
e: U[1]
})
} else {
var l = Ml(k, b, X, O, K);
if (k._19Q || (l = -l), O) {
var d = H[0],
m = H[1],
A = H[2],
r = L.getTall() / 2 + l;
B = [d - l, m + r, A], Z = [d + l, m + r, A], _.add({
x: d - l,
y: A,
e: m
}), _.add({
x: d - l,
y: A,
e: m + r
}), _.add({
x: d + l,
y: A,
e: m + r
}), _.add({
x: d + l,
y: A,
e: m
})
} else {
I = fn(U, H, !0), x = En(H, U);
var M = {
x: H[0],
y: H[2]
},
z = {
x: U[0],
y: U[2]
},
D = pc(F, M, z, l),
w = D.x - M.x,
f = D.y - M.y;
$ = cr($, x), I[0] *= $, I[1] *= $, I[2] *= $, B = [H[0] + I[0] + w, H[1] + I[1], H[2] + I[2] + f], Z = [U[0] - I[0] + w, U[1] - I[1], U[2] - I[2] + f], W ? (_.add({
x: H[0],
y: H[2],
e: H[1]
}), _.add({
x: B[0],
y: B[2],
e: B[1]
}), _.add({
x: Z[0],
y: Z[2],
e: Z[1]
}), _.add({
x: U[0],
y: U[2],
e: U[1]
})) : (_.add({
x: B[0],
y: B[2],
e: B[1]
}), _.add({
x: Z[0],
y: Z[2],
e: Z[1]
}))
}
}
t.c1 = B, t.c2 = Z
}
t._lastPointsSegments = {
points: _,
segments: R
}, t.list = g(Lm) === xk ? k.createTubeModel(_, R, E / 2, Q) : k.createLineModel(_, R, E, "edge", "edge.dash")
}
}
}, invalidateCachedGeometry: function () {
this.info = F
}
});
var Vp = function (v, d) {
fi(Vp, this, [v, d]), this._needRecoverPosition = !0
};
yc(Vp, gf, {
_80o: function (J, u, $) {
var y = this,
B = y.gv,
H = y.shapeModel;
gk(B, y.mat), H ? pj(B, y.data, H, y, y.getBodyColor(), $) : (io(y, J, u, "left", $), io(y, J, u, "front", $), io(y, J, u, "right", $), io(y, J, u, "back", $), io(y, J, u, "top", $), io(y, J, u, "bottom", $)), Gf(B)
}, validate: function (l, f) {
var m, M, v = this,
G = v.s,
y = v.data,
t = (y.p3(), y._thickness / 2),
Y = y.isClosePath(),
r = y.getPoints(),
Q = y.getSegments(),
C = G(cp),
o = l && l.uv;
if (v.clear(), v.dispatchBoundingBoxChanged(), 0 > t) {
try {
M = v.shapeModel = wf(r, Q, G(Je), G(Ho), C, G(Sn), y.getTall(), y.getShapeElevation(), Y)
} catch (D) {
M = v.shapeModel = {}
}
G(lm) ? G("shape3d.image") || delete M.uv : (delete M.vs, delete M.ns, delete M.uv), G("shape3d.top.image") || delete M.top_uv, G("shape3d.bottom.image") || delete M.bottom_uv
} else if (G(Lm) === xk) m = Yo(r, Q, C, Y), M = v.shapeModel = {
vs: []
}, G("shape3d.image") && (M.uv = [], M.sum = G(Sn) || tj(m) || 1, M.len = 0), G(Je) && !Y && (M.top_vs = [], G("shape3d.top.image") && (M.top_uv = [])), G(Ho) && !Y && (M.bottom_vs = [], G("shape3d.bottom.image") && (M.bottom_uv = [])), v._12O(m, t);
else {
var W, $, T, V, w, P, A, _, L, R;
if (m = Yo(r, Q, C, Y), w = v.vf(wg, o, !1, f), t && (P = v.vf(Qq, o, !1, f), A = Y ? F : v.vf(nq, o, !1, f), _ = Y ? F : v.vf(fm, o, !1, f), L = v.vf($c, o, !1, f), R = v.vf(Kd, o, !1, f)), t) {
for (var u = 0, X = m.length; X > u; u++) m[u] = v._tryRemoveBezierPoints(m[u], t);
v._12O(m, t)
} else w && m.forEach(function (y) {
if (V = y.length, V > 0)
for (W = y[0], T = 1; V > T; T++) $ = y[T], v.addV(w.vs, W, $), W = $
});
v._20Q(m), l || (w && (w.ns = Gb(w.vs), ed(w, "vs"), ed(w, ih)), t && (P && (P.ns = Gb(P.vs), ed(P, "vs"), ed(P, ih)), A && (A.ns = Gb(A.vs), ed(A, "vs"), ed(A, ih)), _ && (_.ns = Gb(_.vs), ed(_, "vs"), ed(_, ih)), L && (L.ns = Gb(L.vs), ed(L, "vs"), ed(L, ih)), R && (R.ns = Gb(R.vs), ed(R, "vs"), ed(R, ih))))
}
var z = v.mat = y.getPointsMatrix3d().getElements();
l && (Mp(v, z, l, M), v.clear())
}, _20Q: function (G) {
var P, i, l, x, o, y, e, S = this,
r = S.front,
Y = S.back,
u = S.top,
V = S.bottom,
M = r ? r.tuv : F,
h = Y ? Y.tuv : F,
s = u ? u.tuv : F,
c = V ? V.tuv : F,
Z = 0;
(M || h || s || c) && (P = S.s(Sn) || tj(G) || 1, G.forEach(function (h) {
if (i = h.length, i > 0)
for (y = h[0], l = 1; i > l; l++) e = h[l], x = Z / P, Z += En(y, e), o = Z / P, S._14O(r, x, o), S._14O(Y, 1 - o, 1 - x), S._14O(u, x, o), S._14O(V, x, o), y = e
}))
}, _14O: function (L, x, o) {
if (L) {
var n = L.uv,
O = L.tuv;
if (O) {
if (n) var t = n[0] + (n[6] - n[0]) * x,
p = n[1] + (n[7] - n[1]) * x,
R = n[2] + (n[4] - n[2]) * x,
E = n[3] + (n[5] - n[3]) * x,
e = n[2] + (n[4] - n[2]) * o,
b = n[3] + (n[5] - n[3]) * o,
c = n[0] + (n[6] - n[0]) * o,
B = n[1] + (n[7] - n[1]) * o;
else t = x, p = 0, R = x, E = 1, e = o, b = 1, c = o, B = 0;
O.push(R, E, e, b, c, B, c, B, t, p, R, E)
}
}
}, _13O: function ($) {
var s = $.uv,
T = $.tuv;
T && (s ? T.push(s[2], s[3], s[4], s[5], s[6], s[7], s[6], s[7], s[0], s[1], s[2], s[3]) : T.push(0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1))
}, _tryRemoveBezierPoints: function (y, U) {
var R = y.length;
if (4 > R) return y;
var X, s, C, w, A, O, n = !1,
Z = function (u) {
return y[u]
},
Q = function (l) {
return y[R - 1 - l]
};
for (A = 0; 1 >= A; A++)
for (O = A ? Q : Z, s = O(0), C = O(1), X = 2; R - 1 > X; X++)
if (w = O(X), !w.remove)
if (w.b) {
var m = pc(s, C, w, U);
m.adjust ? (w.remove = !0, n = !0) : (s = C, C = w)
} else s = C, C = w;
if (!n) return y;
var c = [];
for (X = 0; R > X; X++) y[X].remove || c.push(y[X]);
return c
}, _12O: function (V, r) {
var O, $, l, A, h, w = this.s("shape3d.point.epsilon"),
I = this;
V.forEach(function (U) {
if (h = U.length, h > 0)
for (O = {
p: U[0],
n: !0
}, A = 1; h > A; A++) $ = U[A], l = h - 1 > A ? U[A + 1] : F, l && Math.abs($.x - l.x) < w && Math.abs($.y - l.y) < w || I.addPoint(O, $, l, r, U)
})
}, addPoint: function (r, T, b, $, B) {
var C, H, Q, h, s, u, N, d, K, e = this,
E = r.p,
Z = r.f,
v = r.b,
U = e.s("shape3d.side") || rr,
q = e.s("shape3d.start.angle"),
V = e.s("shape3d.sweep.angle"),
m = e.shapeModel,
X = e.data.isClosePath();
if (r.n && (r.n = !1, Z = X && B.length > 2 ? pc(B[B.length - 2], E, T, $) : pc(F, E, T, $), v = $l(E, Z), m ? m.top_vs && e._10O(v, Z, U, q, V, m.top_vs, m.top_uv) : (C = e.left) && (e.addV(C.vs, v, Z), e._13O(C))), H = b ? pc(E, T, b, $) : X && B.length > 2 ? pc(E, T, B[1], $) : pc(E, T, F, $), Q = $l(T, H), m) {
var Y, a, _ = m.vs,
n = m.uv,
k = m.sum;
for (n && (Y = m.len / k, m.len += En(E, T), a = m.len / k), u = e._9O(v, Z, U, q, V), N = e._9O(Q, H, U, q, V), d = 0; U > d; d++) K = d + 1, gc(_, u[K]), gc(_, N[d]), gc(_, u[d]), gc(_, N[d]), gc(_, u[K]), gc(_, N[K]), n && (h = d / U, s = K / U, n.push(Y, s, a, h, Y, h, a, h, Y, s, a, s));
!b && m.bottom_vs && e._10O(Q, H, U, q, V, m.bottom_vs, m.bottom_uv, !0)
} else !b && (C = e.right) && (e.addV(C.vs, H, Q), e._13O(C)), (C = e.front) && e.addV(C.vs, Z, H), (C = e.back) && e.addV(C.vs, Q, v), (C = e.top) && e.addH(C.vs, Z, H, Q, v, !0), (C = e.bottom) && e.addH(C.vs, v, Q, H, Z);
r.p = T, r.f = H, r.b = Q
}, _10O: function (D, B, z, m, d, l, q, U) {
var i, a, T = this,
C = T.data,
P = T._9O(D, B, z, m, d),
u = (D.x + B.x) / 2,
e = (D.y + B.y) / 2,
Y = C.getShapeElevation(),
r = 0;
for (r = 0; z > r; r++) U ? (gc(l, P[r]), gc(l, P[r + 1])) : (gc(l, P[r + 1]), gc(l, P[r])), gc(l, [u, Y, e]), q && (U ? (i = $ * (r + 1) / z + m, a = $ * r / z + m) : (i = $ * r / z + m, a = $ * (r + 1) / z + m), q.push(.5 - .5 * k(a), .5 - .5 * n(a), .5 - .5 * k(i), .5 - .5 * n(i), .5, .5))
}, _9O: function (r, l, t, D, C) {
var W, u, s = this,
K = s.data,
p = [],
j = (r.x + l.x) / 2,
i = (r.y + l.y) / 2,
O = K.getTall() / 2,
e = K.getShapeElevation(),
J = 0;
for (C == F && (C = $); t >= J; J++) W = C * J / t + D, u = k(W), p.push([j + (r.x - j) * u, e + O * n(W), i + (r.y - i) * u]);
return p
}, addV: function (b, B, x) {
var c = B.x,
p = B.y,
R = x.x,
T = x.y,
m = this.data,
t = m.getShapeElevation(),
F = m.getTall() / 2;
b.push(c, t - F, p, R, t - F, T, R, t + F, T, R, t + F, T, c, t + F, p, c, t - F, p)
}, addH: function (A, R, U, b, c, p) {
var m = this.data,
H = m.getTall() / 2,
W = m.getShapeElevation() + (p ? H : -H);
A.push(R.x, W, R.y, U.x, W, U.y, b.x, W, b.y, b.x, W, b.y, c.x, W, c.y, R.x, W, R.y)
}, vf: function (S, _, o, H) {
var k, g = this,
U = g.gv.getFaceVisible(g.data, S);
return (o || U) && (k = _e(g, S, H), k.vs = [], k.tuv = U && (k.texture || _) ? [] : F, k.visible = U), k
}
});
var hs, jf, Co = function (Z, n) {
fi(Co, this, [Z, n])
};
yc(Co, gf, {
validate: function () {
var s = this,
V = s.gv,
M = s.data,
r = s.s,
I = ns(r("points.color"));
I = [I[0], I[1], I[2]];
var C = r("points.size"),
f = r("points.image") || "rect";
("rect" === f || "circle" === f) && ("rect" === f ? (hs || (hs = s._createCachedImage(f)), f = hs) : (jf || (jf = s._createCachedImage(f)), f = jf));
var i = r("points.model");
if (i) {
if (s._lastShapeModel !== i || !s.shapeModel) {
var G = bf(s, i);
if (!G) return;
var h = [],
P = {};
s.eachShapeModel(function (t) {
for (var d = 0, S = t.length; S > d; d += 3) {
var o = t[d],
$ = t[d + 1],
D = t[d + 2],
Z = "" + o + "_" + $ + "_" + D;
P[Z] || (P[Z] = !0, h.push(o, $, D))
}
}, G), s.shapeModel = {
vs: new fk(h)
}, M._pointsDirty = !0, s._lastShapeModel = i
}
} else {
var b = M.points,
u = b.length,
U = u / 3;
if (M._pointsDirty || !s.shapeModel) {
var R = new fk(b);
s.shapeModel = {
vs: R
}, M._pointsDirty = !1, s._lastShapeModel = null
}
} if (s.info = {
mat: sj(M),
size: C,
diffuse: I,
opacity: r("points.opacity"),
texture: f,
alphaTest: r("points.transparent") ? 0 : r("alphaTest")
}, M._colorsDirty) {
for (var q, X, c, v = [], x = !1, S = M.colors, $ = 0; u > $; $ += 3) q = S[$], X = S[$ + 1], c = S[$ + 2], q === Z || X === Z || c === Z ? v.push(I[0], I[1], I[2]) : (x = !0, v.push(q, X, c));
s.shapeModel.cs = x ? new fk(v) : null, M._colorsDirty = !1
}
if (M._sizesDirty) {
for (var Y = [], n = !1, N = M.sizes, $ = 0; U > $; $++) N[$] ? (Y.push(N[$]), n = !0) : Y.push(C);
s.shapeModel.ss = n ? new fk(Y) : null, M._sizesDirty = !1
}
if (s._lastPointNumber !== U) {
var _ = V.pickColorMap,
H = _._pickIdUsed;
_._pickIdUsed = H + U;
for (var J = [], $ = 0; U > $; $++) {
var p = H + $,
D = rl(p);
J.push(D[0], D[1], D[2], D[3]), _[p] || (_[p] = {
data: M,
part: $
})
}
s.shapeModel.ps = new fk(J), s._lastPointNumber = U
}
this.dispatchBoundingBoxChanged()
}, _createCachedImage: function (N) {
var W = 128,
K = uo(),
z = K.getContext("2d");
Bn(K, W, W, 1), Yd(z, {
width: W,
height: W,
comps: [{
type: N,
background: "white",
borderWidth: 0,
rect: [0, 0, W, W]
}]
}, 0, 0, W, W);
var h = O.Math.generateUUID();
return Oe[h] = K, h
}, _80o: function (M, d) {
var f = this,
L = f.gv,
b = f.shapeModel,
W = f.info;
if (b && b.vs && b.vs.length) {
var o = ts.for(M);
o.useProgram(f._asureProgram(M)), o.directState();
var m = o.directUniforms(),
h = o.directAttribs();
m.modelMatrix = W.mat, m.modelViewMatrix = xo([], L._viewMatrix, W.mat), m.projectionMatrix = L._projectMatrix, m.viewMatrix = L._viewMatrix, m.scale = L.getHeight() / 2, m.size = W.size, m.diffuse = W.diffuse, m.opacity = W.opacity, m.map = L.getTexture(W.texture, f.data), m.alphaTest = W.alphaTest, m.resolution = L.getDevicePixelRatio(), h.position = Sl(M, L._buffer.vs, b.vs, F), L._picking ? (m.picking = !0, h.pickColor = Sl(M, L._buffer.ps, b.ps, F), m.useColor = !1, h.color = null) : (m.picking = !1, h.pickColor = null, b.cs ? (m.useColor = !0, h.color = Sl(M, L._buffer.cs, b.cs, F)) : (m.useColor = !1, h.color = null)), b.ss ? (m.useSizeArray = !0, h.sizeArray = Sl(M, L._buffer.ss, b.ss, F)) : (m.useSizeArray = !1, h.sizeArray = null), ie(M, 0, b.vs.length / 3, M.POINTS), o.useProgram(d)
}
}, _asureProgram: function (b) {
return b._pointsShader || (b._pointsShader = this.gv._postProcessing.createShader(b, Co.shaderSrc)), b._pointsShader.program
}
}), Co.shaderSrc = "!!~v!ojp+s!nf!{njbTuu5o!jnppQe`fmmhW!j*f!xfNwbjuusdjfyqj>p!o^N!b4u!s]j^y!<3!!]vyojjsgupbsNno!pnjbuud5f!kwpjsfqx!N)b!u>s!jfywt!jfu{jjpToup!mfp{sjq!jodpljDupjmtppsQ<`mh!!vob!uo!psjfutjptmpvQuwjnp!o<<*!!v1o/j2g!p-senf!ncspppgmt!ovbtsfuT!j){5fdBfsws!b>z!!!jetfQnfssptgqtfodbusjuw!f4Ndbfuws!jy~)!!nn!]s!p3m!p^D]w!!4!|^!!*>s>p!m.p!D2f/t1v<)!!g~j!f!twmpfj!e!~n!bjq!jsdplmjpoDhw*!!|^#!!~qs~f!djb!us
!!esjpgmgpvDthfbu>z!f+d!usbpcmmpfDl!jsophm!p%D%f!tvvtgfgDjpem!ps|*!!f|tm!fe!j~g!gvp!!w-f{dz5y)/!swpDmp";
var Ds = function (i, D) {
fi(Ds, this, [i, D]), this._needRecoverPosition = !0
};
yc(Ds, Wj, {
_25Q: 1,
validate: function (M) {
var w = this,
k = w.data,
c = w.s,
h = k.getPoints(),
Q = h.size();
w.dispatchBoundingBoxChanged();
var P = k.p3(),
v = w.mat = kn();
bo(v, P), Cl(v, k.getFinalRotation3d(), k.getRotationMode());
var L = k.getScale3d(),
$ = k._dynamicScale3d;
if ($ && (L[0] *= $[0], L[1] *= $[1], L[2] *= $[2]), Bd(v, L), bo(v, Cj(P)), (!w.s("geometry.cache") || !w.shapeModel) && (w.shapeModel = w.info = F, Q > 1)) {
var t = w.info = {},
_ = k.getSegments(),
s = k.getThickness(),
g = bk(h.get(0)),
r = bk(h.get(Q - 1)),
u = Q % 2;
0 === u ? (t.c1 = bk(h.get(Q / 2 - 1)), t.c2 = bk(h.get(Q / 2))) : t.p3 = bk(h.get((Q - u) / 2)), t.s1 = g, t.s2 = bk(h.get(1)), t.t1 = bk(h.get(Q - 2)), t.t2 = r, t.list = c(Lm) === xk ? w.createTubeModel(h, _, s / 2, M) : w.createLineModel(h, _, s, "shape.border", "shape.dash")
}
}, invalidateCachedGeometry: function () {
this.shapeModel = this.info = F
}, _80o: function (d, $, C) {
var h = this,
e = h.shapeModel;
if (e) {
var a = h.gv;
gk(a, h.mat), pj(a, h.data, e, h, h.getBodyColor(), C), Gf(a)
}
}
});
var Es = O.graph3d.VR = function (G) {
var B = this;
B.gv = G, B._controllers = [], B.switch = new Gs(B), B._enable = !1, B._defaultCallLater = O.Default.callLater, B._defaultCancelLater = td, "undefined" != typeof x && "VRFrameData" in x && (B._frameData = new x.VRFrameData), B.measureOflength = 1, B.eyesOffset = [0, 0, 0], B._orientation = new Rc.Quaternion, B._lastHeadPose = [0, 0, 0], B._offsetToBeAdd = [0, 0, 0], B._originalOrientation = null, B._fpsInfo = {
time: 0,
fps: 0,
frames: 0
}
};
yc(Es, o, {
ms_fire: !0,
setOriginalYRotation: function (n) {
var B = this;
if (null == n) return B._originalOrientation = null, void 0;
var i = new Rc.Vector3(0, 1, 0),
P = (new Rc.Quaternion).setFromAxisAngle(i, -n),
F = (new Rc.Matrix4).makeRotationFromQuaternion(P);
return P.setFromAxisAngle(i, n), B._originalOrientation = {
quaternion: P,
matrixInverse: F
}, !0
}, render: function (F, n, W) {
var c = this,
E = c.gv;
if (c._deviceInAction) {
var j = c._device;
if (j) {
var v = c._measureOflength;
j.depthNear = E.getNear() * v, j.depthFar = E.getFar() * v;
var i = c._offsetToBeAdd;
if (c.eyesOffset[0] += i[0], c.eyesOffset[1] += i[1], c.eyesOffset[2] += i[2], i[0] = 0, i[1] = 0, i[2] = 0, j.isPresenting === !1) return c._controllers.forEach(function (r) {
r && r.update()
}), E.iv(), !1;
var U = c._frameData;
j.getFrameData(U);
var m = U.pose.position;
if (m) {
var r = c.toViewPosition(m);
E.setEye(r), c._orientation.fromArray(U.pose.orientation), c._originalOrientation && c._orientation.premultiply(c._originalOrientation.quaternion);
var S = new Rc.Vector3(0, 0, -10 * c._scaleFactor);
S.applyQuaternion(c._orientation), E.setCenter([r[0] + S.x, r[1] + S.y, r[2] + S.z])
}
c._controllers.forEach(function (M) {
M && M.update()
}), E.setViewport(F, 0, 0, n / 2, W), c._viewMatrix = c._copyViewMatrix(U.leftViewMatrix), c._projectMatrix = c._copyProjectMatrix(U.leftProjectionMatrix), E.updateScene(), E.renderScene(), E.setViewport(F, n / 2, 0, n / 2, W), c._viewMatrix = c._copyViewMatrix(U.rightViewMatrix), c._projectMatrix = c._copyProjectMatrix(U.rightProjectionMatrix), E.updateScene(), E.renderScene(), c._lastViewMatrix = c._viewMatrix, c._lastProjectMatrix = c._projectMatrix, c._viewMatrix = null, c._projectMatrix = null, c.submitFrame();
var Y = Date.now(),
x = c._fpsInfo;
return Y - x.time > 1e3 ? (x.fps = Math.round(1e3 * (x.frames + 1) / (Y - x.time)), x.time = Y, x.frames = 0) : x.frames++, !0
}
}
}, onVRDisplayPresentChange: function () {
var h = this.isPresenting();
this._injectGraphView(h), this.fp("present", !h, h)
}, getOrientation: function () {
return this._orientation
}, addController: function (i) {
i = i || 0;
var g = this,
s = g.getController(i);
return s ? s : (s = new Fs(g, i), g._controllers.push(s), s)
}, getController: function (K) {
K = K || 0;
for (var I = this._controllers, x = 0, C = I.length; C > x; x++)
if (I[x] && I[x].id === K) return I[x];
return null
}, removeController: function (x) {
x = x || 0;
for (var d = this._controllers, H = 0, q = d.length; q > H; H++)
if (d[H] && d[H].id === x) return d.splice(H, 1), !0;
return !1
}, getLastHeadPose: function () {
return this._lastHeadPose
}, toViewPosition: function (z, j) {
var S = this,
_ = S._scaleFactor,
s = S._eyesOffset,
t = S._lastHeadPose;
if (S._originalOrientation) {
var c = S._originalOrientation.quaternion,
V = new Rc.Vector3(z);
V.applyQuaternion(c).multiplyScalar(_).toArray(t)
} else t[0] = z[0] * _, t[1] = z[1] * _, t[2] = z[2] * _;
return j ? (j[0] = t[0] + s[0], j[1] = t[1] + s[1], j[2] = t[2] + s[2], j) : [t[0] + s[0], t[1] + s[1], t[2] + s[2]]
}, addEyesOffset: function (x, P, A) {
var Z = this._offsetToBeAdd;
Z[0] += x, Z[1] += P, Z[2] += A
}, _copyViewMatrix: function (U) {
var d = this,
s = d.dup(U);
if (d._originalOrientation) {
var w = (new Rc.Matrix4).fromArray(s);
w.multiply(d._originalOrientation.matrixInverse).toArray(s)
}
var j = d._scaleFactor;
s[12] *= j, s[13] *= j, s[14] *= j;
var Y = d._eyesOffset;
if (Y && (Y[0] || Y[1] || Y[2])) {
var o = Y[0],
t = Y[1],
m = Y[2];
s[12] -= s[0] * o + s[4] * t + s[8] * m, s[13] -= s[1] * o + s[5] * t + s[9] * m, s[14] -= s[2] * o + s[6] * t + s[10] * m
}
return s
}, shutdown: function () {
var x = this._device;
x && x.isPresenting && x.exitPresent()
}, isPresenting: function () {
var y = this._device;
return y && y.isPresenting
}, _copyProjectMatrix: function (j) {
var M = this.dup(j),
_ = this._scaleFactor;
return M[14] *= _, M
}, dup: function (y, W) {
for (var d = y.length, R = W || new Array(d); d--;) R[d] = y[d];
return R
}, getViewMatrix: function (k) {
var R = this._viewMatrix;
return R ? this.dup(R, k) : void 0
}, getProjectMatrix: function () {
var n = this._projectMatrix;
return n ? this.dup(n) : void 0
}, submitFrame: function () {
var s = this;
if (s._enable && s._deviceInAction) {
var w = s._device;
w && w.isPresenting && (w.submitFrame(), s.gv.iv())
}
}, getFps: function () {
return this._fpsInfo.fps
}, intersectWorld: function (b) {
var o = this.gv;
return o.intersectObjects(b, o.dm().getDatas())
}, setDevice: function (P) {
var U = this;
U._device = P
}, _injectGraphView: function () {
var o, b, H;
return function (J) {
var O = this.gv;
if (!J) return o && (O.getWidth = o, O.getHeight = b, O.getDevicePixelRatio = H), void 0;
var a = this._device,
r = a.getEyeParameters("left"),
j = r.renderWidth,
X = r.renderHeight;
o = O.getWidth, b = O.getHeight, H = O.getDevicePixelRatio, O.getWidth = function () {
return 2 * j
}, O.getHeight = function () {
return X
}, O.getDevicePixelRatio = function () {
return 1
}
}
}(),
_injectCallLaterFunc: function (B) {
var T = this;
if (!B) return $e = O.Default.callLater = T._defaultCallLater, td = O.Default.cancelLater = T._defaultCancelLater, void 0;
var T = this;
$e = O.Default.callLater = function (V, H, s, J) {
var j = T._device;
return j && j.isPresenting ? J ? cd(function () {
$e(V, H, s)
}, J) : j.requestAnimationFrame(function () {
T._deviceInAction = !0, V.apply(H, s), T._deviceInAction = !1
}) : T._defaultCallLater(V, H, s, J)
}, td = O.Default.cancelLater = function (f, P) {
var Y = T._device;
return Y && Y.isPresenting ? P ? nr(f) : Y.cancelAnimationFrame(f) : T._defaultCancelLater(f, P)
}
}
}), o.defineProperties(Es.prototype, {
enable: {
get: function () {
return this._enable
}, set: function (Y) {
var N = this;
N._enable !== Y && (N._enable = Y, Y ? (N.switch.showButton(), N._injectCallLaterFunc(!0)) : (N.shutdown(), N.switch.hideButton(), N._injectCallLaterFunc(!1)), N.fp("enable", !Y, Y))
}
},
measureOflength: {
get: function () {
return this._measureOflength
}, set: function (X) {
this._measureOflength = X;
var S = this._scaleFactor = 1 / X;
this._controllers.forEach(function (P) {
P && P._setScaleFactor(S)
})
}
},
eyesOffset: {
get: function () {
return this._eyesOffset
}, set: function (U) {
this._eyesOffset = U
}
},
controllerModel: {
get: function () {
return this._controllerModel
}, set: function (c) {
var G;
"object" == typeof c ? (G = c.mtl, c = c.obj) : (G = c + ".mtl", c += ".obj");
var X = this,
A = X._controllerModel;
A && A.obj === c && A.mtl === G || (A = X._controllerModel = {
obj: c,
mtl: G
}, u.loadObj(c, G, {
finishFunc: function (v, x) {
X._controllerModel === A && u.setShape3dModel("vrControllerModel", x)
}
}))
}
},
interactive: {
get: function () {
return !!this._interactive
}, set: function (N) {
!!N != !!this._interactive && (this._interactive = N, N && this.addController(0), this.gv.getCoreInteractor().enableVR(N))
}
}
});
var Fs = function (q, J) {
function P(S) {
var m = navigator.getGamepads && navigator.getGamepads();
if (m)
for (var k = 0, M = 0, w = m.length; w > k; k++) {
var c = m[k];
if (c) {
var Y = c.id;
if ("OpenVR Gamepad" === Y || 0 === Y.indexOf("Oculus Touch") || Y.indexOf("Controller") >= 0) {
if (M === S) return c;
M++
}
}
}
}
function $(A, n, D) {
return Math.abs(A[0] - n[0]) < D && Math.abs(A[1] - n[1]) < D && Math.abs(A[2] - n[2]) < D ? !0 : !1
}
var G = this;
G.vr = q, G.id = J;
var c, z, j = [0, 0],
Y = [{
id: "thumbpad",
pressed: !1
}, {
id: "trigger",
pressed: !1
}, {
id: "grips",
pressed: !1
}, {
id: "menu",
pressed: !1
}],
w = new Dp;
w.s("shape3d", "vrControllerModel"), w.isController = !0, w.s("intersect", !1), G.getGamepad = function () {
return z
}, G.isButtonPressed = function ($) {
for (var Z, q = 0, g = Y.length; g > q; q++)
if (Z = Y[q], Z.id === $) return Z.pressed;
return !1
}, G.getNode = function () {
return w
};
var I = .003;
G.setRotationEpsilon = function (V) {
I = V
};
var n = 5e-4,
m = n;
G.setPositionEpsilon = function (C) {
n = C, m = C * G.vr._scaleFactor
}, G._setScaleFactor = function (x) {
w.s3(x, x, x), m = n * x
}, G._setScaleFactor(G.vr._scaleFactor);
var l, f = new fs,
R = new br,
g = [0, 0, 0],
v = [0, 0, 0],
o = new gg,
x = new tl,
N = new Qi;
G.getRay = function () {
return l ? (N.origin.fromArray(g), N.direction.copy(x), l = !1, N) : N
}, G.update = function () {
if (c = z, z = P(J), !z || z.pose === Z) return z = null, w.s("3d.visible", !1), void 0;
if (u.getShape3dModel("vrControllerModel")) {
w.dm() || q.gv.dm().add(w), w.s("3d.visible", !0);
var y = z.pose;
if (null !== y) {
if (y.position && (G.vr.toViewPosition(y.position, g), $(w.p3(), g, m) || (l = !0, w.p3(g))), y.orientation) {
f.fromArray(y.orientation);
var X = G.vr._originalOrientation;
X && f.premultiply(X.quaternion), x.set(0, 0, -1).applyQuaternion(f).normalize(), R.makeRotationFromQuaternion(f), o.set(0, 0, 0, w.getRotationMode(), !0).setFromRotationMatrix(R), v[0] = o.x, v[1] = o.y, v[2] = o.z, $(w.r3(), v, I) || (l = !0, w.r3(v))
}
l && q.fp("gamepad.pose", null, {
position: g,
rotation: v,
id: J
});
var U = z.axes;
(j[0] !== U[0] || j[1] !== U[1]) && (j = [U[0], U[1]], q.fp("gamepad.axes", null, {
id: J,
axes: j
}));
var T, V, r, E, t = z.buttons;
for (T = 0, V = t.length; V > T; T++)
if (r = t[T], r && (E = r.pressed, Y[T] || (Y[T] = {
id: "button" + T,
pressed: !1
}), E !== Y[T].pressed)) {
Y[T].pressed = E;
var H = {
id: J
},
K = "state";
H[K] = H._62O = E ? "down" : "up", q.fp("gamepad.button." + Y[T].id, null, H)
}
}
}
}
},
Gs = function (s) {
this.vr = s, this._button = null
};
yc(Gs, o, {
showButton: function () {
var T = this.assureButton();
if (!T.parentNode) {
var Y = this.vr.gv,
b = Y.getView();
Y._79O ? b.insertBefore(T, Y._79O) : b.appendChild(T)
}
}, hideButton: function () {
var r = this._button;
r && r.parentNode && r.parentNode.removeChild(r)
}, assureButton: function () {
var r = this._button;
return r ? r : this._button = this.createButton(this.vr.gv)
}, createButton: function (F) {
function v(j, C) {
j.textContent = C && C.isPresenting ? "关闭 VR 显示" : "开启 VR 显示"
}
function _(n) {
h.style.display = "", h.style.cursor = "pointer", h.style.left = "calc(50% - 50px)", h.style.width = "100px", v(h, n), h.onmouseenter = function () {
h.style.opacity = "1.0"
}, h.onmouseleave = function () {
h.style.opacity = "0.5"
}, h.onclick = function () {
n.isPresenting ? n.exitPresent() : n.requestPresent([{
source: F.getCanvas()
}])
}, F.vr.setDevice(n)
}
function q() {
h.style.display = "", h.style.cursor = "auto", h.style.left = "calc(50% - 75px)", h.style.width = "150px", v(h, null), h.onmouseenter = null, h.onmouseleave = null, h.onclick = null, F.vr.setDevice(null)
}
function S(g) {
g.style.position = "absolute", g.style.bottom = "20px", g.style.padding = "12px 6px", g.style.border = "1px solid #fff", g.style.borderRadius = "4px", g.style.color = "#000", g.style.font = "normal 13px sans-serif", g.style.textAlign = "center", g.style.opacity = "0.5", g.style.outline = "none", g.style.zIndex = "999"
}
if ("getVRDisplays" in navigator) {
var h = this._button = U.createElement("button");
return h.style.display = "none", S(h), K(x, "vrdisplayconnect", function (j) {
_(j.display)
}), K(x, "vrdisplaydisconnect", function () {
q()
}), K(x, "vrdisplaypresentchange", function (e) {
v(h, e.display), F.vr.onVRDisplayPresentChange()
}), navigator.getVRDisplays().then(function (S) {
S.length > 0 ? _(S[0]) : q()
}), h
}
var o = U.createElement("a");
return o.href = "https://webvr.info", o.innerHTML = "当前不支持 webvr", o.style.left = "calc(50% - 90px)", o.style.width = "180px", o.style.textDecoration = "none", S(o), o
}
}), o.defineProperties(Gs.prototype, {});
var Hs = O.graph3d.PostProcessing = function (C) {
function T() {
if (!I) {
var h = C.getGL();
I = new Eh.RenderTarget(C, h, null, null, {
samples: z.renderTextureSamples || 1
}), d = new Cm.Shader(h, O.vs, O.fs), V = Cm.Buffer.createIndexBuffer(h, new Uint16Array([0, 2, 1, 1, 2, 3])), i = Cm.Buffer.createVertexBuffer(h, new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]))
}
}
var I, d, V, i, G = this,
q = {},
s = !1;
! function () {
o.keys(Hs).forEach(function (G) {
q[G] = new Hs[G](C)
})
}(), G.getModule = function (E) {
return E ? q[E] : G
}, G.getModuleList = function () {
return o.keys(q)
}, G._serializable = !0, G.handleDataModleChange = function (W, j) {
W && (G._serializable && W.setPostProcessingData(G.serialize()), W.removeSerializeListener(G.onDataModelSerialize, G)), j && (j.addSerializeListener(G.onDataModelSerialize, G), G.deserialize(j))
}, G.onDataModelSerialize = function (K) {
"serialize" === K.type ? G._serializable && (C.dm()._postProcessingData = G.serialize()) : "deserialize" === K.type && G.deserialize(C.dm())
}, G.isDeserializeDisabled = function (s) {
return !G._serializable || s.a("sceneBloom") !== Z
}, G.isSerializable = function () {
return G._serializable
}, G.setSerializable = function (L) {
G._serializable = L, L || C.dm().setPostProcessingData(Z)
}, G.serialize = function () {
var a, B, p, Z, S = {};
for (B in q)
if (p = q[B], Z = p.serializeProperties) {
a = {}, p.enable && (a.enable = !0);
for (var l in Z) {
var T = p[l];
T != Z[l] && (a[l] = T)
}
o.keys(a).length && (S[B.toLowerCase()] = a)
}
return S
}, G.deserialize = function (k) {
var y, F, R, b, s, U = {},
z = {};
for (y in q) {
R = q[y], b = R.serializeProperties;
var c = {},
E = "scene" + y,
N = k.a(E);
N !== Z && (c.enable = N);
for (var s in b) N = k.a(E + s[0].toUpperCase() + s.slice(1)), N !== Z && N !== b[s] && (c[s] = N);
wd(c) || (z[y[0].toLowerCase() + y.slice(1)] = c)
}
if (wd(z) && (z = k.getPostProcessingData()), z)
for (F in z)
if (F && (y = F[0].toUpperCase() + F.slice(1), R = q[y])) {
U[y] = !0, b = z[F];
var L = !!b.enable;
G.enableModule(y, L), y = "scene" + y, k.a(y, L), R.resetProperties && R.resetProperties();
for (s in b)
if ("enable" !== s) {
var N = b[s];
R[s] = N, k.a(y + s[0].toUpperCase() + s.slice(1), N)
}
}
for (y in q) U[y] || (R = q[y], R.enable = !1, R.resetProperties && R.resetProperties())
}, G.decodeShader = function (I) {
var y, z, X, T = "",
E = "";
for (X = 0; X < I.length; X++) y = I[X], "%" === y ? y = "'" : "a" === y ? y = '"' : "]" === y && (y = "\\"), z = String.fromCharCode(y.charCodeAt(0) - 1), X % 2 ? E += z : T = z + T;
return E + T
}, G.createShader = function (_, v, A) {
var e = v.indexOf("^#"),
g = G.decodeShader(v.substr(0, e)),
O = G.decodeShader(v.substr(e + 2));
if (A) {
var d = A(g, O);
d && d.vs && (g = d.vs), d && d.fs && (O = d.fs)
}
return new Cm.Shader(_, g, O)
}, G.enableModule = function (z, h) {
var u, E, o, U = z.split(",");
for (u = 0, E = U.length; E > u; u++) o = U[u].trim(), q[o] && (q[o].enable = h);
s = !1;
for (o in q)
if (q[o].enable) {
s = !0;
break
}
s && T()
};
var O = {
vs: ["attribute vec2 pos;", "varying vec2 vUv;", "void main(void) {", "gl_Position = vec4(pos.x * 2.0 - 1.0, -pos.y * 2.0 + 1.0, 0.0, 1.0);", "vUv = vec2(pos.x, 1.0 - pos.y);", "}"].join("\n"),
fs: ["precision highp float;", "uniform sampler2D image;", "varying vec2 vUv;", "void main() {", "gl_FragColor = texture2D(image, vUv);", "}"].join("\n")
};
G.render = function (h, L, w) {
if (s) {
I.setSize(h, L, w), I.bind(h);
var T = h.getParameter(h.COLOR_CLEAR_VALUE);
T && 0 === T[0] && 0 === T[1] && 0 === T[2] && 0 === T[3] ? T = null : qe(h, [0, 0, 0, 0]), h.clear(h.COLOR_BUFFER_BIT | h.DEPTH_BUFFER_BIT), C.setViewport(h, 0, 0, L, w), C.renderScene(), I.unbind(h);
for (var Y = 0, b = C._glCapabilities.maxAttributes; b > Y; Y++) h.disableVertexAttribArray(Y);
var r, A = I;
for (r in q) A = q[r]._42(h, A) || A;
return C.setViewport(h, 0, 0, L, w), T && qe(h, T), h.clear(h.COLOR_BUFFER_BIT | h.DEPTH_BUFFER_BIT), d.bind(), h.activeTexture(h.TEXTURE0 + 0), an(h, A.texture), d.uniforms.image = 0, V.upload(), i.upload(), d.attributes.pos.pointer(i), h.drawElements(h.TRIANGLES, 6, h.UNSIGNED_SHORT, 0), an(h, null), h.useProgram(C._prg), !0
}
}
},
Is = O.graph3d.PostProcessing.Bloom = function (S) {
function H() {
var B = S.getGL();
if (B)
for (var A = S._postProcessing, K = 0; f > K; K++) Z[K] = A.createShader(B, Is._35Q, function (i, R) {
return {
fs: R.replace(/DEFINE_VALUE/g, $[K]).replace("%OVERRIDE_ALPHA_DEFINE%", I ? "#define OVERRIDE_ALPHA" : "")
}
})
}
function k() {
var X = S.getWidth(),
_ = S.getHeight();
if (X && _) {
B = [X, _], L = !0;
var V, Q = S.getGL(),
r = Math.round(B[0] / 2),
P = Math.round(B[1] / 2);
for (x = new Eh.RenderTarget(S, Q, r, P), V = 0; f > V; V++) u.push(new Eh.RenderTarget(S, Q, r, P)), n.push(new Eh.RenderTarget(S, Q, r, P)), r = Math.round(r / 2), P = Math.round(P / 2);
var T = S._postProcessing;
O = T.createShader(Q, Is._34Q), H(), G = T.createShader(Q, Is._36Q, function (U, P) {
return {
fs: P.replace(/NUM_MIPS/g, f)
}
}), j = T.createShader(Q, Is.finalShader), M = Cm.Buffer.createIndexBuffer(Q, new Uint16Array([0, 2, 1, 1, 2, 3])), e = Cm.Buffer.createVertexBuffer(Q, new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]))
}
}
var F, W, K, I, r, M, e, E, m = this,
s = !1,
L = !1;
this.serializeProperties = {
strength: 1.5,
threshold: .55,
radius: .4,
overrideAlpha: !0,
selective: !1
}, this.resetProperties = function () {
var m = this.serializeProperties;
for (var R in m) this[R] = m[R]
}, o.defineProperties(m, {
enable: {
get: function () {
return s
}, set: function (d) {
!!s != !!d && (s = d, d && !L && k(), S.iv())
}
},
strength: {
get: function () {
return F
}, set: function (Z) {
F !== Z && (F = Z, S.iv())
}
},
threshold: {
get: function () {
return W
}, set: function (q) {
W !== q && (W = q, S.iv())
}
},
radius: {
get: function () {
return K
}, set: function (C) {
K !== C && (K = C, S.iv())
}
},
overrideAlpha: {
get: function () {
return I
}, set: function (t) {
!!I != !!t && (I = t, L && H(), S.iv())
}
},
selective: {
get: function () {
return r
}, set: function (n) {
!!r != !!n && (r = !!n, S.iv())
}
}
}), this.resetProperties();
var x, O, G, j, B = [256, 256],
u = [],
n = [],
f = 5,
$ = [3, 5, 7, 9, 11],
Z = [];
m._42 = function (_, P) {
function A(b, J, z, $) {
So(_, J.frame), S.setViewport(_, 0, 0, J.width, J.height), $ ? $(_) : _.clear(_.COLOR_BUFFER_BIT | _.DEPTH_BUFFER_BIT), V !== b && b.bind();
var k = 0;
for (var P in z) {
var a = z[P];
a instanceof WebGLTexture && (_.activeTexture(_.TEXTURE0 + k), an(_, a), a = k, k++), b.uniforms[P] = a
}
for (V !== b && (M.upload(), e.upload(), b.attributes.pos.pointer(e), V = b), _.drawElements(_.TRIANGLES, 6, _.UNSIGNED_SHORT, 0); k--;) _.activeTexture(_.TEXTURE0 + k), an(_, null);
Ar(_)
}
if (s && (L || (k(), L))) {
var V;
if (r) {
E || (E = new Eh.RenderTarget(S, _)), E.setSize(_, P.width, P.height), E.bind(_);
var z = _.getParameter(_.COLOR_CLEAR_VALUE);
z && 0 === z[0] && 0 === z[1] && 0 === z[2] && 1 === z[3] ? z = null : qe(_, [0, 0, 0, 1]), _.clear(_.COLOR_BUFFER_BIT | _.DEPTH_BUFFER_BIT), S.setViewport(_, 0, 0, P.width, P.height), _._blooming = !0, S.renderScene(), _._blooming = !1, z && qe(_, z), E.unbind(_)
}
A(O, x, {
smoothWidth: .01,
luminosityThreshold: W,
tDiffuse: r ? E.texture : P.texture
});
var U, d = x,
g = Math.round(B[0] / 2),
h = Math.round(B[1] / 2);
for (U = 0; f > U; U++) A(Z[U], u[U], {
colorTexture: d.texture,
direction: [1, 0],
texSize: [g, h]
}), A(Z[U], n[U], {
colorTexture: u[U].texture,
direction: [0, 1],
texSize: [g, h]
}), g = Math.round(g / 2), h = Math.round(h / 2), d = n[U];
return A(G, u[0], {
blurTexture1: n[0].texture,
blurTexture2: n[1].texture,
blurTexture3: n[2].texture,
blurTexture4: n[3].texture,
blurTexture5: n[4].texture,
bloomStrength: F,
bloomRadius: K,
bloomTintColor: [1, 1, 1]
}), A(j, P, {
image: u[0].texture
}, function (N) {
ts.for(N).glState.blend.apply({
enabled: !0,
equation: N.FUNC_ADD,
func: [N.SRC_ALPHA, N.ONE]
})
}), ts.for(_).glState.blend.apply({
equation: _.FUNC_ADD,
func: [_.SRC_ALPHA, _.ONE_MINUS_SRC_ALPHA, _.ONE, _.ONE_MINUS_SRC_ALPHA]
}), P
}
}
};
Is._34Q = "~buw!fwdV3w!w!!.w!f1d/53)!q+p!ty/^#~qsf!ss3pEm!puDEhjbgsgGv`tmfh<3!!bwiVqwm1!)u5fdyfuwv!s>f!3sEp)m!puDEujvgqguvvtpf!-5!dwfVww!<**f!ywffud!4))u!p1e/!3>:!:w-!!u1b/p6m9g8-w!fwdV3w!w!!.w!f1d/53)!q+p!ty/^#~qsgfjdejotfj$pon!qsmpfmsp3DEh!bdspGm`pmshUffytumvfs$f<<*v1o/j2g!p-snnv!Twufidh3j!fuxf0ynTvjT{fftd!3s!pemjpsDfhdbusjGp`om,$!enfvgTjuoifh!jTfJxHNB,M!QnIvBT`fEtFvGgJgOjFe&|!3sffmuqvnsbot!!14/d4f:w9:<5c!h+s!/f*yuqf)t!g.g1P/w6v!!+,!!yw!V+w!!y-0f)s!vtujyhfnUbs!p+m!ptdj!h)nEb3*f*s0vtujyhfnub!<>!~2fwmpqjneb!tn!b4jdof)w*!<|y!w+f!df3{!jjTowwoTjj!{+f!!o>p!j2u/d1f!s0j!eu!f>y!Tujf{tfgj!Tggm!p-byu))gTeJQHoNbBj*tu!!xx!fujbhpimugTv)!uhbbpvmtgt!j>b!oyQ!eugb)p1m/g1-|!!g*T!j,h,n!bj*!<<TwVfJdE5B!Su`fMyFuOvSsFfLQ!j=y!!j>!!u!vjs!fu3oEj)!!)dsppmgpsv!n", Is._36Q = "~buw!fwdV3w!w!!.w!f1d/53)!q+p!ty/^#~qsp!p2m/c3)!5.d!fgwb!d+u!p*s12s)fsupvusdob!Gnnjpyp)mgCbqdsufpms!-)!!n+j!sisuphsoGfbsduuTpnsp-p!mccm!p>p!nsSpbmepjDvhtb*s q; q++) A[q] = H[q] / 180;
D.iv()
}
}
},
saturation: {
get: function () {
return Z
}, set: function (Y) {
if (Z !== Y && 7 === Y.length) {
for (var M = 0; 7 > M; M++) Z[M] = Y[M] / 100;
D.iv()
}
}
},
lightness: {
get: function () {
return W
}, set: function (Y) {
if (W !== Y && 7 === Y.length) {
for (var Z = 0; 7 > Z; Z++) W[Z] = Y[Z] / 100;
D.iv()
}
}
}
}), T._42 = function (J, N) {
if (q) {
C || g();
var G = N.width,
O = N.height;
if (G && O) {
w.setSize(J, G, O), So(J, w.frame), D.setViewport(J, 0, 0, w.width, w.height), J.clear(J.COLOR_BUFFER_BIT | J.DEPTH_BUFFER_BIT), t.bind(), J.activeTexture(J.TEXTURE0 + 0), an(J, N.texture);
var _ = t.uniforms;
return _.image = 0, _.hue = A, _.saturation = Z, _.lightness = W, y.upload(), x.upload(), t.attributes.pos.pointer(x), J.drawElements(J.TRIANGLES, 6, J.UNSIGNED_SHORT, 0), an(J, null), Ar(J), w
}
}
}
};
Ks.hueSaturationShader = "!!b~u!usf!dw3V!ww!Vw<<*1/!2w!p-j1e/!1n!b-j1o/)2w!p,j!e1*/!3|!+!!hzm/`tQppqt.j!u-j1p/o2!!>.!!w1f/d35!)+q!pyt/^#!!q~s!fdb!nsqpmmfpsD3hEb!sjGn`bmhhf!<f!tmtt]iN!BY`~S!BO~H!F^<!!gfmhpobbuS!titvffoBumimh-j!mg!mpv!ff!h>o!bjSooWpbjmuvbfs!v,u!b)ti!vf3!/f1h1>*!!ssffuuovvspod!`wfbvmiv)f!!g,j!!2/|1!<*,!,fsmftufo!vjpgd!`)fwvbim!v!!sffmutofv!psdf`ufvvsio!!uwobjm)v!fs
t!bfuhvosbbsu!jpm!pfbhuo!bjso!W*b7m!v>f?-!!fghmopbbsu)!!tgbju!vs~b!uj~p!oBb!ofhhfo*b!s|!!|g!m*p6b/u1!!w,b!m*vsff!u>o!vjpodW`bfmvvif)!u+b!p)m2g/!1=!!,i!)t!bgujv!sb|u!j*p,o,Bsmfmu!o,v!ptdb`ufvvsib!uv!fs-f!u1o/v1p-d!`2f/v1i*!u!!fmhjohbisu!oufotjt!Sbp!mmgj!hih!iiu!oufbtptmSgb!ohu!vmstoi!!j4odWfbwm!vfu!vsspom!pjdo!W5bdmfvwf!!,|!!)*w)!o+j!b)n2!/e1j!p.w!!joW~b!mvp!biu!!g~3!-!!,i!vif!*!||!*!1j/g1!!)=i!vif)!!=g!j1!/1*~!!iE!d2!/01!<*h!!f.m!tsf)!!j,g!!1)/i5v!f>!!?i!!2/|1!*ft!mifv!f~!!.>7!/i1!!+|!!i*vyfb*N!d=!!>2>/!1h*)!!gsjf!tf!t>m!fg!2~!!,!<)bgu3m!f.E!dg!20*!!*+c!!7./!1h!)+!!>i!vif!<|!!f*mytbfN!dj!g>!>)!)s3)/!1g!j+!!iv.!!g13/<3)!!f0m!tbfu!mjfgE!d)!);4!/*1o!j+N!di!v,f!*y!b=N!d3)/!10*!b!usmfftE!d>!!@g!26!/,1!!)=g!3m!!.>!!gt2!*!+!!.b!uimvffE*d!!+u!b7p/m1gb!Ngd2)3!smh!c)wc!*>c!!1-/h1)*o!j|n!!-ssh)co!j>n!!w>f!do4j)Nidt!mu/b{p*m!!|c!!ugbmppmbgu!!g<3hd!!>j!gh!!)uibtpmm/g{!!=!!sg!3u!b>p!migt!m/<{1!/+1!!)>2!/m1!!u,b!pimtgm!/z<*11!!f>m!ttf!u!bgp3m!g>!!i!!iit!mu/bzp!m.g!!it|m!/*zd!!+4!diftwm)/m{t~!!3/<1c!h+s!!iotsmv/u{f!s.!!g~3!<<*!*s1h/c4/0s1!/>2!)i!v.f!3ys/hmct)ig!2--3!gg!3--2!gi)tcmh/sy3!f,v!i)!2>/!1c0/4c/h1s*!*<<*!ys/hmct/ih!!->3!gi!v-f23gs)hc";
var Ls = O.graph3d.PostProcessing.Blur = function (B) {
function T() {
d = !0;
var V = B.getGL();
z = new Eh.RenderTarget(B, V), k = B._postProcessing.createShader(V, Ls.hBlurShader), w = B._postProcessing.createShader(V, Ls.vBlurShader), c = Cm.Buffer.createIndexBuffer(V, new Uint16Array([0, 2, 1, 1, 2, 3])), G = Cm.Buffer.createVertexBuffer(V, new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]))
}
var c, G, k, w, z, R, D = this,
C = !1,
d = !1;
this.serializeProperties = {
value: 0
}, this.resetProperties = function () {
this.value = 0
}, o.defineProperties(D, {
enable: {
get: function () {
return C
}, set: function (H) {
!!C != !!H && (C = H, H && !d && T(), B.iv())
}
},
value: {
get: function () {
return R
}, set: function (h) {
R !== h && (R = h, B.iv())
}
}
}), this.resetProperties(), D._42 = function (r, m) {
return C ? D.drawImpl(r, m, R) : void 0
}, D.drawImpl = function (Z, x, L, R) {
d || T();
var P = x.width,
j = x.height;
if (P && j) {
R && (P *= R, j *= R), z.setSize(Z, P, j), So(Z, z.frame), B.setViewport(Z, 0, 0, z.width, z.height), Z.clear(Z.COLOR_BUFFER_BIT | Z.DEPTH_BUFFER_BIT), k.bind(), Z.activeTexture(Z.TEXTURE0 + 0), an(Z, x.texture);
var A = k.uniforms;
A.image = 0, A.value = L / P, c.upload(), G.upload(), k.attributes.pos.pointer(G), Z.drawElements(Z.TRIANGLES, 6, Z.UNSIGNED_SHORT, 0), Ar(Z), So(Z, x.frame), B.setViewport(Z, 0, 0, x.width, x.height), Z.clear(Z.COLOR_BUFFER_BIT | Z.DEPTH_BUFFER_BIT), w.bind(), Z.activeTexture(Z.TEXTURE0 + 0), an(Z, z.texture);
var A = w.uniforms;
return A.image = 0, A.value = L / j, c.upload(), G.upload(), w.attributes.pos.pointer(G), Z.drawElements(Z.TRIANGLES, 6, Z.UNSIGNED_SHORT, 0), Ar(Z), an(Z, null), z
}
}
};
Ls.hBlurShader = "!!b~u!usf!dw3V!ww!Vw<<*1/!2w!p-j1e/!1n!b-j1o/)2w!p,j!e1*/!3|!+!!hzm/`tQppqt.j!u-j1p/o2!!>.!!w1f/d35!)+q!pyt/^#!!q~s!fd!!isjphmipqD!hgbmspGb`um,!!wnpvjte!!n!!-wffvdm5b)w!!1+/!11!/*4)!3udffywu!v-sffh3bEn)j!!j)nEb3hffs-v!uwyffdu3!)>!,w!Vnwv/ty!!.w!!u)f3ydufvws!f-3fEh)b!njjn!b)hEf3-f!swvfudy3f)u!!w>V,w!/nyv!t.!!4214!6+2!/w1b!m+v!f*-!!*w!Vzw//wzV!w*!!-*f!v+m!b1w/!1+:!219/<2!!,t!vyn/!w,V>w!!u)f3ydufvws!f-3fEh)b!njjn!b)hEf3-f!swvfudy3f)u!!w>V,w!/nyv!t.!!3414!7+2!/w1b!m+v!f*-!!*w!Vzw//wzV!w*!!-*y!/+w!V1w/!2)333d5f6w)!Eu3ffysuvvusyff3uE!)>!,j!nnbvhtf!-!= Z || 0 >= T || (H._90I || (e = H._90I = {}), e[E] || (e[E] = new xr), qp(t, H.tx() + D, H.ty() + $, Z, T), sn(t, M), H._view.insertBefore(t, H._79O), M.onParentAdded && M.onParentAdded(t), e[E].add(t))
}
}, d._76o = function () {
var t = this,
v = t._90I;
if (v) {
for (var G in v) v[G].each(function ($) {
yj($)
});
delete t._90I
}
}, d._77o = function (Y) {
var Q = this;
if (Q._90I) {
var C = Q._90I[Y];
C && (C.each(function (O) {
yj(O)
}), delete Q._90I[Y])
}
}
}, _47o: function (g) {
g.getValue = function (P, p) {
return p.getValue ? p.getValue(P, p, this) : jq(P, p.getAccessType(), p.getName())
}, g.setValue = function (f, _, I) {
if (_.isEmptiable(f) || "" !== I || (I = Z), _.isNullable(f) || I != F) {
var b = this,
j = _.getName(f),
k = _.getAccessType(f),
y = _.getValueType(f);
y === fj && dk(I) ? I = Zb(I) : y === Mo && dk(I) ? I = parseFloat(I) : y === hm && dk(I) && (I = "true" === I), b._batchEditable && _._batchEditable && b.isSelected(f) ? b.sm().each(function (x) {
_.setValue ? _.setValue(x, _, I, b) : Di(x, k, j, I)
}) : _.setValue ? _.setValue(f, _, I, b) : Di(f, k, j, I)
}
}, g.setCurrentEditor = function (y) {
this.endEditing(), this._currentEditor = y, this.redraw()
}, g.isEditing = function (c, O) {
var L = this,
D = L._currentEditor;
if (!D) return !1;
if (O) {
var $ = D.info;
return $ ? ($.column || $.property) === O && $.data === c : !1
}
return !0
}, g.endEditing = function (J) {
var m = this,
q = m._currentEditor;
q && (delete m._currentEditor, q.commitValue && q.commitValue(q.info, J), m.redraw(), m.getDataModel().endTransaction())
}, g.beginEditing = function (o) {
this.endEditing();
var U = this,
g = o.column || o.property;
if (g.beginEditing) g.beginEditing(o);
else {
var b = o.data,
D = o.value,
n = U.getSelectBackground(b),
G = g.getEnumValues(b),
v = g.getSlider(b),
R = g.getColorPicker(b);
if (v) {
var A = Wn(Vs.Slider, v);
return A.setValue(D), A.getView().onblur = function () {
U.endEditing()
}, A.isInstant() && (A.onValueChanged = function () {
U.setValue(b, g, A.getValue())
}), Ts(A, o), void 0
}
if (R || g.getValueType(b) === dg) {
var f = Wn(Vs.ColorPicker, R);
return f.setValue(D), f.onClosed = function () {
U.endEditing()
}, f.isInstant() && (f.onValueChanged = function (x, Z) {
U.setValue(b, g, Z)
}), Ts(f, o), f.open(), void 0
}
if (G) {
if (Vs.ComboBox) {
var Q = new Vs.ComboBox;
Q.setValue(D), Q.setValues(G), Q.setLabels(g.getEnumLabels(b)), Q.setIcons(g.getEnumIcons(b)), Q.setEditable(g.isEnumEditable(b)), Q.setStrict(g.isEnumStrict(b)), Q.setMaxHeight(g.getEnumMaxHeight(b)), Q.setDropDownWidth(g.getEnumDropDownWidth(b)), Q.onClosed = function () {
U.endEditing()
}, Ts(Q, o), Q.open()
} else Us(nj, o, n, G, g);
return
}
var w = g.getValueType(b);
if (w === hm || El(D)) return U.setValue(b, g, !D), void 0;
if (g.getItemEditor(b)) {
var r = gp(g.getItemEditor(b)),
h = new r(b, g, U, o),
J = h.getView();
return J._17Q = h, h.setValue(D), uj(J), Ts(J, o), h.editBeginning && h.editBeginning(), void 0
}
Us("input", o, n, F, g)
}
}
}, _44o: function (D) {
D.init = function (R) {
var Q = this,
v = Q.th = new jt(R),
C = Q._view = ve(1, Q);
Q.tv = Q._tableView = R, sn(C, v.getView()), sn(C, R.getView()), v.mp(function (g) {
g.property === Hh && Q.iv()
}), Q.iv()
}, D.getTableView = function () {
return this.tv
}, D.getTableHeader = function () {
return this.th
}, D.getDataModel = function () {
return this.tv.dm()
}, D.getColumnModel = function () {
return this.tv.getColumnModel()
}, D.setColumns = function (D) {
this.tv.setColumns(D)
}, D.addColumns = function (P) {
this.tv.addColumns(P)
}, D.endEditing = function () {
this.tv.endEditing()
}, D.validateImpl = function () {
var W = this,
H = W.th,
P = zp(H),
o = {
x: 0,
y: 0,
width: W.getWidth(),
height: P
};
qp(H, o), o.y = P, o.height = q(0, W.getHeight() - P), qp(W.tv, o)
}
}, ms_vs: function (y) {
y._41o = function () {
return this._29I.height < this._59I
}, y._43o = function () {
var r = this;
r._41o() && (r._58I || (cd(function () {
r._94O()
}, Lg), r.iv()), r._58I = new Date)
}, y._94O = function () {
var Q = this;
if (Q._58I) {
var o = new Date;
o.getTime() - Q._58I.getTime() >= Lg ? (delete Q._58I, Q.iv()) : cd(function () {
Q._94O()
}, Lg)
}
}, y._93I = function () {
var X = this,
O = X._27I;
if (X._58I || !X._autoHideScrollBar) {
O || sn(X._79O, O = X._27I = dd());
var J = X._29I,
$ = J.height,
v = X._59I,
m = X.getScrollBarSize(),
U = J.width - m - 2,
e = $ * (-X.ty() / v),
I = $ * ($ / v),
E = O.style;
v > $ ? (un > I && (e = e + I / 2 - un / 2, 0 > e && (e = 0), e + un > $ && (e = $ - un), I = un), E.visibility = Pd, E.background = X.getScrollBarColor(), E.borderRadius = m / 2 + oe, qp(O, U, e, m, I)) : E.visibility = fc
} else O && (O.style.visibility = fc)
}
}, ms_hs: function (e) {
e._40o = function () {
return this._29I.width < this._91I
}, e._42o = function () {
var e = this;
e._40o() && (e._95O || (cd(function () {
e._94I()
}, Lg), e.iv()), e._95O = new Date)
}, e._94I = function () {
var v = this;
if (v._95O) {
var o = new Date;
o.getTime() - v._95O.getTime() >= Lg ? (delete v._95O, v.iv()) : cd(function () {
v._94I()
}, Lg)
}
}, e._92I = function () {
var C = this,
t = C._28I;
if (C._95O || !C._autoHideScrollBar) {
t || sn(C._79O, t = C._28I = dd());
var a = C._29I,
R = a.width,
E = C._91I,
M = C.getScrollBarSize(),
r = a.height - M - 2,
H = R * (-C.tx() / E),
O = R * (R / E),
X = t.style;
E > R ? (un > O && (H = H + O / 2 - un / 2, 0 > H && (H = 0), H + un > R && (H = R - un), O = un), X.visibility = Pd, X.background = C.getScrollBarColor(), X.borderRadius = M / 2 + oe, qp(t, H, r, O, M)) : X.visibility = fc
} else t && (t.style.visibility = fc)
}
}
}), _c(tm, ee(16, 16, [{
type: Tq,
rect: [1, 1, 14, 14],
background: Bc
}, {
type: Xe,
rect: [1, 1, 14, 14],
width: 1,
color: Em
}, {
type: bl,
points: [13, 3, 7, 12, 4, 8],
borderWidth: 2,
borderColor: "#FFF"
}])), _c(He, ee(16, 16, {
type: Xe,
rect: [1, 1, 14, 14],
width: 1,
color: Em
})), _c(kj, ee(16, 16, [{
type: Eq,
rect: [2, 2, 12, 12],
borderWidth: 1,
borderColor: Em,
background: "#FFF"
}, {
type: Eq,
rect: [4, 4, 8, 8],
background: Bc
}])), _c(yb, ee(16, 16, {
type: Eq,
rect: [2, 2, 12, 12],
borderWidth: 1,
borderColor: Em
})), fb._15Q = function (h) {
h._29I = nl, h._59I = 0, h._91I = 0, h._5o = function (m) {
var x = this;
x._30I = new xr, x._rows = new xr, x._rowMap = {}, x._31I = 0, x._14I = 0, x._view = ve(1, x), x._canvas = uo(x._view), sn(x._view, x._79O = dd()), x.dm(m ? m : new jn)
}, h.getCheckIcon = function (s) {
var o = this.sm(),
V = o.co(s);
return o.sg() ? ii(V ? kj : yb) : ii(V ? tm : He)
}, h.checkData = function (V) {
var t = this.sm(),
j = t.co(V);
t.sg() && j || (this._32o = 1, j ? t.rs(V) : t.as(V), delete this._32o)
}, h.getDataAt = function (i) {
i.target && (i = this.lp(i));
var Z = T(i.y / this._rowHeight),
P = this._rows;
return 0 > Z || Z >= P.size() ? F : P.get(Z)
}, h.onDataDoubleClicked = function () { }, h.onDataClicked = function () { }, h.adjustTranslateX = function () {
return 0
}, h.adjustTranslateY = function (E) {
var z = this.getHeight() - this._59I;
return z > E && (E = z), E > 0 ? 0 : A(E)
}, h.onPropertyChanged = function (Y) {
var E = this,
o = Y.property;
Ps[o] ? E.ivm() : Os[o] || E.redraw(), o === gq ? E._42o() : o === wb && E._43o()
}, h.getLabel = function (V) {
return V.toLabel()
}, h.getLabelFont = function () {
return this._labelFont
}, h.getLabelColor = function (w) {
var x = this;
if (x.isCheckMode()) {
if (x._focusData === w) return x._labelSelectColor
} else if (x.isSelected(w)) return x._labelSelectColor;
return x._labelColor
}, h.getStartRowIndex = function () {
return this._31I
}, h.getEndRowIndex = function () {
return this._14I
}, h.getRowDatas = function () {
return this._rows
}, h.getRowIndex = function (E) {
return this._rowMap[E._id]
}, h.getRowSize = function () {
return this._rows.size()
}, h.getViewRect = function () {
return Pm(this._29I)
}, h.isVisible = function (T) {
return this._visibleFunc ? this._visibleFunc(T) : !0
}, h.getCurrentSortFunc = function () {
return this._sortFunc
}, h.setDataModel = function (P) {
var a = this,
O = a._dataModel,
B = a._selectionModel;
O !== P && (O && (O.umm(a.handleDataModelChange, a), O.umd(a.handleDataPropertyChange, a), O.umh(a.handleHierarchyChange, a), B || O.sm().ums(a.handleSelectionChange, a)), a._dataModel = P, P.mm(a.handleDataModelChange, a), P.md(a.handleDataPropertyChange, a), P.mh(a.handleHierarchyChange, a), B ? B._21I(P) : P.sm().ms(a.handleSelectionChange, a), a.fp("dataModel", O, P))
}, h.validateModel = function () {
var s = this;
s._rows.clear(), s._rowMap = {}, s.buildChildren(s._dataModel._roots);
var V = s._rows = s._rows.toList(s.isVisible, s),
_ = 0,
Q = s.getCurrentSortFunc(),
L = V.size();
for (Q && V.sort(Q); L > _; _++) s._rowMap[V.get(_)._id] = _
}, h.buildChildren = function (w) {
var t = this;
w.each(function (v) {
t._rows.add(v), t.buildChildren(v._children)
})
}, h.handleDataModelChange = function () {
this.ivm()
}, h.handleDataPropertyChange = function (x) {
"parent" === x.property ? this.ivm() : this.invalidateData(x.data)
}, h.handleHierarchyChange = function () {
this.ivm()
}, h.handleSelectionChange = function (s) {
s.datas.each(this.invalidateData, this), this.onSelectionChanged(s)
}, h.onSelectionChanged = function (m) {
var p = this,
X = p.sm();
!p.isAutoMakeVisible() || 1 !== X.size() || "set" !== m.kind && "append" !== m.kind || p._32o || p.makeVisible(X.ld())
}, h.handleBackgroundClick = function (I) {
jj(I) && !this.isCheckMode() && this.sm().cs()
}, h.makeVisible = function (e) {
e && (this._23I = e, this.iv())
}, h.scrollToIndex = function (Q) {
var p = this,
V = p._29I,
T = V.height,
q = p._rowHeight,
y = q * Q;
Q >= 0 && Q < p._rows.size() && T > 0 && (y + q > V.y + T ? p.ty(-y + T - q) : y < V.y && p.ty(-y))
}, h.autoScroll = function (r, w) {
var t = this,
c = t._rowHeight,
I = c,
O = c / 4,
W = t._29I,
S = t.lp(r),
D = {
x: t.tx(),
y: t.ty()
};
return c > 0 && W && (S.x - W.x < I ? t.translate(O, 0) : W.x + W.width - S.x < I && t.translate(-O, 0), S.y - W.y < I ? t.translate(0, O) : W.y + W.height - S.y < I && t.translate(0, -O)), D.x = t.tx() - D.x, D.y = t.ty() - D.y, w && (w.x += D.x, w.y += D.y), D
}, h.getTopRowOrderSelection = function () {
var D = this.sm().getTopSelection(),
g = {},
S = new xr;
return D.each(function (f) {
g[f._id] = f
}), this._rows.each(function (e) {
g[e._id] && S.add(e)
}), S
}, h.getRowOrderSelection = function () {
var H = new xr;
return this._rows.each(function (X) {
this.isSelected(X) && H.add(X)
}, this), H
}, h.ivm = function () {
this.invalidateModel()
}, h.invalidateModel = function () {
var I = this;
I._96I || (I._96I = 1, I._32I = 1, delete I._24I), I.iv()
}, h.redraw = function () {
var F = this;
F._32I || (F._32I = 1, delete F._24I, F.iv())
}, h.invalidateData = function (A) {
var n = this;
Xf ? n.redraw() : n._32I || (n._24I || (n._24I = {}), n._24I[A._id] = A, n.iv())
}, h.getFocusData = function () {
return this._focusData
}, h.setFocusDataById = function (h) {
this.setFocusData(this.dm().getDataById(h))
}, h.setFocusData = function ($) {
var q = this,
J = q._focusData;
J !== $ && (q._focusData = $, q.fp("focusData", J, $), J && q.invalidateData(J), $ && (q.invalidateData($), q.isAutoMakeVisible() && q.makeVisible($)))
}, h.drawRowBackground = function (S, W, w, L, Z, c, j) {
var K = this,
T = K.isCheckMode();
(W === K._focusData && T || w && !T) && fl(S, L, Z, c, j, K.getSelectBackground(W))
}, h.drawData = function (q, C, o) {
var y = this,
e = y._rowHeight,
F = e * o,
U = y._29I,
f = U.x,
d = U.width;
q.save(), q.beginPath(), q.rect(f, F, d, e), q.clip(), y._87o(y.drawRow(q, C, y.isSelected(C), f, F, d, e), o, f, F, d, e), q.restore(), y._rowLineVisible && fl(q, f, F + e - 1, d, 1, y._rowLineColor)
}, h._12I = function (t) {
var e = this,
F = e._31I,
y = e._29I,
j = y.x,
T = y.y,
_ = y.width,
c = y.height;
for (t.beginPath(), t.rect(j, T, _, c), t.clip(), t.clearRect(j, T, _, c), e._76o(), e._93db(t); F < e._14I; F++) e.drawData(t, e._rows.get(F), F);
e._92db(t)
}, h._13I = function (g) {
for (var l, n = this, y = n._rowHeight, E = n._29I, p = E.x, D = E.width, W = n._31I, h = n._30I; W < n._14I; W++) l = n._rows.get(W), n._24I[l._id] && h.add({
data: l,
index: W
});
h.isEmpty() || (g.beginPath(), h.each(function (T) {
g.rect(p, T.index * y, D, y)
}), g.clip(), h.each(function (n) {
g.clearRect(p, n.index * y, D, y)
}), h.each(function (Y) {
n._77o(Y.index)
}), n._93db(g), h.each(function (U) {
n.drawData(g, U.data, U.index)
}), n._92db(g), h.clear())
}, h.preValidateModel = function () {
this.endEditing && this.endEditing()
}, h.validateImpl = function () {
var r = this,
c = r._canvas,
p = r.getWidth(),
B = r.getHeight(),
k = r._rowHeight,
v = r._32I;
(p !== c.clientWidth || B !== c.clientHeight) && (Bn(c, p, B), v = 1);
var I = _ && !Ad;
r._96I && !I && (r.preValidateModel(), r.validateModel());
var W = r._29I,
$ = {
x: -r.tx(),
y: -r.ty(),
width: p,
height: B
},
V = r._rows.size(),
C = Wd(c),
E = r._23I;
v || jg($, W) || (v = 1), r._29I = $, r._59I = V * k, r._31I = T($.y / k), r._14I = s(($.y + $.height) / k), r._31I < 0 && (r._31I = 0), r._14I > V && (r._14I = V), r._99I && v && r._99I(), (r._40o() || r._41o()) && (r._59I += r.getScrollBarSize(), r._99I && v && (r._91I += r.getScrollBarSize())), tf(C, r.tx(), r.ty(), 1), v ? r._12I(C) : r._24I && r._13I(C), r._93I(), r._92I(), C.restore(), r._32I = r._24I = r._96I = F, E && (r.scrollToIndex(r.getRowIndex(E)), delete r._23I), r.tx(r.tx()), r.ty(r.ty())
}, h.canHandleSelectMode = function () {
return !0
}
}, fb._48o = function (L) {
L._rootVisible = !0, L._rootData = F, L._35o = function () {
this._expandMap = {}, this._levelMap = {}
}, L.validateModel = function () {
var $ = this,
U = $._rootData;
$._rows.clear(), $._levelMap = {}, $._rowMap = {}, $._currentLevel = 0, U ? $._rootVisible ? $.isVisible(U) && $.buildData(U) : $.buildChildren(U) : $.buildChildren(), delete $._currentLevel
}, L.buildData = function (K) {
var J = this,
n = K._id,
b = J._rows;
J._rowMap[n] = b.size(), b.add(K), J._levelMap[n] = J._currentLevel, J.isExpanded(K) && (J._currentLevel++, J.buildChildren(K), J._currentLevel--)
}, L.buildChildren = function (u) {
var O = this,
a = u ? u._children : O._dataModel._roots,
k = O.getCurrentSortFunc();
k && O.isChildrenSortable(u) ? a.toList(O.isVisible, O).sort(k).each(O.buildData, O) : a.each(function (N) {
O.isVisible(N) && O.buildData(N)
})
}, L.getLevel = function (i) {
return this._levelMap[i._id]
}, L.getToggleIcon = function (s) {
var G = this,
X = G._loader,
q = G._collapseIcon;
return X && !X.isLoaded(s) ? q : s.hasChildren() ? G.isExpanded(s) ? G._expandIcon : q : F
}, L.isCheckMode = function () {
return this._checkMode != F
}, L.isChildrenSortable = function () {
return !0
}, L.handleDataModelChange = function (p) {
var h = this;
p.kind === Ce ? delete h._expandMap[p.data._id] : p.kind === Tg && (h._expandMap = {}), h.ivm()
}, L.toggle = function (I) {
var C = this;
C.isExpanded(I) ? C.collapse(I) : C.expand(I)
}, L.isExpanded = function (W) {
return 1 === this._expandMap[W._id]
}, L.expand = function (Q) {
var P = this,
H = P._loader;
P.isExpanded(Q) || (H && !H.isLoaded(Q) && H.load(Q), P._expandMap[Q._id] = 1, P.ivm(), P.onExpanded(Q))
}, L.onExpanded = function () { }, L.collapse = function (u) {
var f = this;
f.isExpanded(u) && (delete f._expandMap[u._id], f.ivm(), f.onCollapsed(u))
}, L.onCollapsed = function () { }, L.expandAll = function (V) {
if (V) this.expand(V), V.eachChild(function (y) {
this.expandAll(y)
}, this);
else {
var L = this;
L._dataModel.each(function (T) {
T.hasChildren() && (L._expandMap[T._id] = 1)
}), L.ivm()
}
}, L.collapseAll = function () {
this._expandMap = {}, this.ivm()
}, L.makeVisible = function (U) {
if (U) {
var S = this;
if (!S._rootData || U.isDescendantOf(S._rootData)) {
for (var i = U._parent; i;) S.expand(i), i = i._parent;
S._23I = U, S.iv()
}
}
}, L.checkData = function (I) {
var T, V = this,
q = V._checkMode,
S = V.sm(),
J = S.co(I);
if (!S.sg() || !J) {
if (V._32o = 1, q === lp) J ? S.rs(I) : S.as(I);
else if (q === Wf) T = new xr(I), T.addAll(I._children);
else if ("descendant" === q) T = new xr, Rs(I, T);
else if ("all" === q && (T = new xr, Rs(I, T), !J))
for (var _ = I._parent; _;) T.add(_), _ = _._parent;
T && (J ? S.rs(T) : S.as(T)), delete V._32o
}
}, L.drawTree = function (F, P, w, g, m, B, C) {
var Z = this,
l = Z._indent,
k = Z._levelMap[P._id],
t = Z.getIconWidth(P),
U = ii(Z.getToggleIcon(P));
U ? (g += l * k, Ii(F, U, g + l / 2, m + C / 2, P, Z), g += l) : g += l * (k + 1), Z._checkMode && (Ii(F, Z.getCheckIcon(P), g + l / 2, m + C / 2, P, Z), g += l), Z.drawIcon(F, P, g, m, t, C), Z.drawLabel(F, P, g + t, m, C)
}
}, fb._14Q = function (p) {
p.getIcon = function (E) {
return E.getIcon()
}, p.getIconWidth = function (K) {
return this.getIcon(K) ? this._indent : 0
}, p.drawIcon = function (Z, Y, $, S, L, s) {
if (L) {
var p = this,
j = p.getBodyColor(Y),
b = ii(p.getIcon(Y), j);
b && (s -= p.isRowLineVisible() ? 1 : 0, qk(Z, b, Mg, $, S, L, s, Y, p, j), Ie(Z, p.getBorderColor(Y), $, S, L, s))
}
}, p.drawLabel = function (U, b, B, H, C) {
var s = this;
nd(U, s.getLabel(b), s.getLabelFont(b), s.getLabelColor(b), B, H, 0, C)
}
}, fb._50o = function (r) {
r._98I = function () {
var Z = this,
b = Z._39o = new jn;
Z._60I = new xr, b.mm(Z._17o, Z), b.md(Z._18o, Z), b.mh(Z._19o, Z)
}, r.setColumns = function (n) {
this._39o.clear(), this.addColumns(n)
}, r.addColumns = function (b) {
var U = this._39o;
b.forEach(function (h) {
if (!(h instanceof Ys)) {
var e = gp(h.className);
h = Wn(e ? e : Ys, h)
}
U.add(h)
})
}, r.onColumnClicked = function () { }, r.onCheckColumnClicked = function () { }, r._3Q = function (s) {
for (var A, i = 0, L = this._60I, Y = L.size(); Y > i; i++)
if (A = L.get(i), A.column === s) return A;
return F
}, r.getColumnAt = function (H) {
var b = this._4Q(H);
return b ? b.column : F
}, r._4Q = function (T) {
for (var X = this, b = T.target ? X.lp(T).x : T.x, o = X._60I, L = 0; L < o.size(); L++) {
var l = o.get(L),
U = l.startX;
if (b >= U && b < U + l.column.getWidth()) return l
}
return F
}, r.getToolTip = function (T) {
var h = this,
t = h.getDataAt(T),
j = h.getColumnAt(T);
return t && j ? j.getToolTip(t, h) : F
}, r.adjustTranslateX = function (Z) {
var h = this.getWidth() - this._91I;
return h > Z && (Z = h), Z > 0 ? 0 : A(Z)
}, r._99I = function () {
var p = this,
Q = p._29I,
e = p._60I;
e.clear(), p._91I = 0, p._39o._roots.each(function (f) {
if (f.isVisible()) {
var L = p._91I + f.getWidth();
p._91I <= Q.x + Q.width && L >= Q.x && e.add({
column: f,
startX: p._91I
}), p._91I = L
}
})
}, r.drawData = function (i, A, $) {
var W = this,
V = W._rowHeight,
e = V * $,
c = W.isSelected(A),
l = W._29I,
y = l.x,
b = l.width;
W.drawRowBackground(i, A, c, y, e, b, V), W._60I.each(function (S) {
var F = S.column,
g = S.startX,
E = F.getWidth();
E > 0 && !W.isEditing(A, F) && (i.save(), i.beginPath(), i.rect(g, e, E, V), i.clip(), W._87o(W.drawCell(i, A, c, F, g, e, E, V), $, g, e, E, V), W._columnLineVisible && fl(i, g + E - 1, e, 1, V, W._columnLineColor), i.restore())
}), W._rowLineVisible && fl(i, y, e + V - 1, b, 1, W._rowLineColor)
}, r.drawCell = function (H, O, X, $, b, c, D, a) {
var P = this;
if ($.drawCell) return $.drawCell(H, O, X, $, b, c, D, a, P);
var U = P.getValue(O, $);
Ss(H, U, $, P.getLabelFont(O, $, U), P.getLabelColor(O, $, U), b, c, D, a, O, P)
}, r.getColumnModel = function () {
return this._39o
}, r._17o = function () {
this.redraw()
}, r._18o = function (R) {
var v = this;
R.data === v._sortColumn && Ns[R.property] ? v.ivm() : (v._42o(), v.redraw())
}, r._19o = function () {
this.redraw()
}, r.getCurrentSortFunc = function () {
var a = this,
I = a._sortColumn;
if (I && I.isSortable()) {
var w = I.getSortFunc(),
u = Sh === I.getSortOrder() ? 1 : -1;
return w || (w = Sd),
function (Q, v) {
return w.call(a, a.getValue(Q, I), a.getValue(v, I), Q, v) * u
}
}
return a._sortFunc
}, r.isCellEditable = function (H, b, m) {
return b.isEditable() && this.isEditable() ? b.isCellEditable ? b.isCellEditable(H, b, m, this) : !0 : !1
}, r._37O = function (x, a) {
if (jj(a))
for (var H = this, S = H.lp(a), z = H._60I, J = H._rowHeight, R = H._29I, E = R.x, d = R.y, f = R.width, o = R.height, k = 0; k < z.size(); k++) {
var Q = z.get(k),
B = Q.startX,
y = Q.column,
q = y.getWidth();
if (y !== H._31o && y !== H._4o && S.x >= B && S.x < B + q && H.isCellEditable(x, y, a)) {
var O = {
x: B,
y: H.getRowIndex(x) * J,
width: q,
height: J
},
Y = {
x: O.x + H.tx(),
y: O.y + H.ty(),
width: O.width,
height: O.height
},
c = 0,
l = 0;
return O.x < E ? c = O.x - E : O.x + O.width > E + f && (c = O.x + O.width - E - f), c && (H.tx(H.tx() - c), Y.x -= c), O.y < d ? l = O.y - d : O.y + J > d + o && (l = O.y + J - d - o), l && (H.ty(H.ty() - l), Y.y -= l), H.beginEditing({
data: x,
column: y,
value: H.getValue(x, y),
event: a,
rect: O,
editorRect: Y,
view: H
}), void 0
}
}
}
}, Vs.BaseItemEditor = function (x, S, v, m) {
this._data = x, this._column = S, this._master = v, this._editInfo = m
}, Ws("BaseItemEditor", o, {
ms_ac: ["data", "column", "master", "editInfo"],
editBeginning: function () { }, getView: function () { }, getValue: function () { }, setValue: function () { }
});
var Xs = O.Tab = function () {
fi(Xs, this)
};
ki("Tab", Qp, {
ms_ac: ["view", "closable", "disabled", "visible"],
_icon: F,
_closable: !1,
_disabled: !1,
_visible: !0,
setParent: jm
});
var Ys = O.Column = function () {
fi(Ys, this)
};
ki("Column", Qp, {
_46o: 1,
ms_ac: ["accessType", "valueType", Pd, Me, Zh, ul, "align", dg, "sortOrder", go, "sortable", "clickable", "nullable", "emptiable", "slider", "colorPicker", "itemEditor"],
_visible: !0,
_width: 80,
_sortOrder: Sh,
_sortFunc: F,
_sortable: !0,
_clickable: !0,
setWidth: function (p) {
16 > p && (p = 16);
var D = this._width;
this._width = p, this.fp(ul, D, p)
}, getToolTip: function (L, R) {
return this.formatValue(R.getValue(L, this))
}
});
var Zs = O.Property = function () {
fi(Zs, this)
};
ki("Property", Qp, {
_46o: 1,
ms_ac: ["accessType", "valueType", Me, Zh, "categoryName", dg, "align", "nullable", "emptiable", "slider", "itemEditor", "colorPicker"],
_categoryName: F,
getToolTip: function (F, t, R) {
var $ = this;
return t ? $.formatValue(R.getValue(F, $)) : R.getPropertyName($)
}
}), Vs.AccordionView = function () {
var X = this;
X._20o = {}, X._21o = new xr, X._10o = F, X._9o = F, X._11o = F, X._view = ve(0, X), X.iv()
}, Ws("AccordionView", o, {
ms_v: 1,
ms_fire: 1,
ms_ac: [Zi, xj, "titleHeight", fe, Vm, "titleBackground", "selectWidth", op, "orientation", "separatorColor"],
_expandIcon: u.accordionViewExpandIcon,
_collapseIcon: u.accordionViewCollapseIcon,
_titleHeight: Jk,
_labelColor: u.accordionViewLabelColor,
_labelFont: u.accordionViewLabelFont,
_titleBackground: u.accordionViewTitleBackground,
_selectBackground: u.accordionViewSelectBackground,
_selectWidth: u.accordionViewSelectWidth,
_orientation: "v",
_separatorColor: u.accordionViewSeparatorColor,
onPropertyChanged: function () {
this.iv()
}, getView: function () {
return this._view
}, getTitles: function () {
return this._21o
}, getCurrentTitle: function () {
return this._10o
}, add: function (x, p, P, g) {
var q = this,
C = dd(),
b = {
content: p,
div: C,
canvas: uo(C),
icon: g
};
if (q._20o[x]) throw x + " already exists";
var J = b.downEventFunc = function (Y) {
Qc(Y)
},
d = b.upEventFunc = function (F) {
Qc(F), jj(F) && (q._10o === x ? q.collapse() : q.expand(x))
};
[Xd, fp].forEach(function (m) {
K(C, m, J)
}), [Sj, cj].forEach(function (L) {
K(C, L, d)
}), C.style.cursor = Zk, sn(q._view, C), q._20o[x] = b, q._21o.add(x), P && q.expand(x), q.iv()
}, remove: function (y) {
var i = this,
K = i._20o[y];
if (K) {
var n = K.div;
yj(n), [Xd, fp].forEach(function (Y) {
b(n, Y, K.downEventFunc)
}), [Sj, cj].forEach(function (p) {
b(n, p, K.upEventFunc)
}), delete i._20o[y], i._21o.remove(y), i.iv()
}
}, clear: function () {
var D = this;
D._21o.toArray().forEach(D.remove, D), D._20o = {}, D._21o.clear(), D.iv()
}, isExpanded: function (N) {
return this._10o === N
}, expand: function (s) {
var R = this;
R._20o[s] && R._10o !== s && (R._10o = s, R.onExpanded(s), R.iv())
}, onExpanded: function () { }, collapse: function () {
var w = this;
w._10o && (w.onCollapsed(w._10o), delete w._10o, w.iv())
}, onCollapsed: function () { }, initCanvas: function (X, f, C) {
Bn(X, f, C);
var i = Wd(X);
return tf(i, 0, 0, 1), i.clearRect(0, 0, f, C), i
}, drawTitle: function (V, C, A, f, r) {
var o = this,
i = ii(r.icon),
R = o.isExpanded(C),
w = o._titleHeight,
S = o._titleBackground,
O = o._selectWidth,
u = o._separatorColor,
$ = ii(R ? o._expandIcon : o._collapseIcon),
T = O + 4;
fl(V, 0, 0, A, f, S), R && O && fl(V, 0, 0, O, f, o._selectBackground), (R || o._21o.get(o._21o.size() - 1) !== C) && fl(V, 0, f - 1, A, 1, u ? u : Ee(S)), i && (Ii(V, i, T + xc(i) / 2, w / 2), T += xc(i) + 2), nd(V, C, o.getLabelFont(C), o.getLabelColor(C), T, 0, 0, w), $ && Ii(V, $, A - xc($) / 2 - 4, w / 2)
}, validateImpl: function () {
var Y = this,
m = Y._view,
k = 0,
P = 0,
i = Y.getWidth(),
b = Y.getHeight(),
G = Y._titleHeight,
l = Y._21o.size() * G,
W = Y._11o,
w = Y._9o;
delete Y._11o, delete Y._9o, Y._21o.each(function (t) {
var z, r, e = Y._20o[t],
h = e.content,
T = Y._10o === t;
Oj(Y) ? (qp(e.div, k, 0, G, b), z = Y.initCanvas(e.canvas, G, b), wh(z, 0, b), jc(z, -N), Y.drawTitle(z, t, b, G, e), z.restore(), T ? (r = q(0, i - l), h && (Y._11o = h, Y._9o = Bq(h), qp(h, k + G, 0, r, b)), k += G + r) : k += G) : (qp(e.div, 0, P, i, G), z = Y.initCanvas(e.canvas, i, G), Y.drawTitle(z, t, i, G, e), z.restore(), T ? (r = q(0, b - l), h && (Y._11o = h, Y._9o = Bq(h), qp(h, 0, P + G, i, r)), P += G + r) : P += G)
});
var C = Y._9o;
W && W !== Y._11o && W.endEditing && W.endEditing(), C && C !== w && sn(m, C), w && w !== C && yj(w)
}
}), Vs.SplitView = function ($, p, E, Q) {
var w = this,
o = w._dividerDiv = dd(),
v = w._60O = uo(),
h = w._61O = uo(),
W = v.style,
s = h.style;
w._view = ve(1, w), sn(w._view, o), W.msTouchAction = iq, W.pointerEvents = iq, W.cursor = Zk, s.msTouchAction = iq, s.pointerEvents = iq, s.cursor = Zk, $ && w.setLeftView($), p && w.setRightView(p), E && w.setOrientation(E), Q != F && w.setPosition(Q), w.setStatus(Fk), new $s(w)
}, Ws("SplitView", o, {
ms_v: 1,
ms_fire: 1,
ms_ac: ["continuousLayout", "dividerSize", "dividerBackground", "toggleIcon", "togglable", "dragOpacity", "orientation", "draggable", "status"],
_continuousLayout: !1,
_position: .5,
_togglable: !0,
_orientation: "h",
_draggable: !0,
_dividerSize: u.splitViewDividerSize,
_dividerBackground: u.splitViewDividerBackground,
_dragOpacity: u.splitViewDragOpacity,
_toggleIcon: u.splitViewToggleIcon,
onPropertyChanged: function () {
this.iv()
}, getDividerDiv: function () {
return this._dividerDiv
}, getPosition: function () {
return this._position
}, setPosition: function (n, t) {
var M = this,
g = M._position;
isNaN(n) || (t || (M._82O = 0 > n ? -1 : n > 1 ? 1 : 0), M._position = n, M.fp(pr, g, n))
}, getLeftView: function () {
return this._leftView
}, setLeftView: function (r) {
var U = this,
q = U._leftView,
o = U._view;
if (U._leftView !== r) {
if (q && q !== U._rightView) {
var l = Bq(q);
l.parentNode === o && yj(l)
}
if (U._leftView = r, r) {
var V = Bq(r);
V.parentNode !== o && o.insertBefore(V, U._dividerDiv)
}
U.fp("leftView", q, r)
}
}, getRightView: function () {
return this._rightView
}, setRightView: function (C) {
var s = this,
g = s._rightView,
y = s._view;
if (s._rightView !== C) {
if (g && g !== s._leftView) {
var $ = Bq(g);
$.parentNode === y && yj($)
}
if (s._rightView = C, C) {
var A = Bq(C);
A.parentNode !== y && y.insertBefore(A, s._dividerDiv)
}
s.fp("rightView", g, C)
}
}, validateImpl: function () {
var Y = this,
R = Y._draggable,
S = Y._position,
F = Y.getWidth(),
G = Y.getHeight(),
b = Y._dividerSize,
D = Y._dividerBackground,
f = nf ? 18 : 8,
t = Y._dividerDiv,
e = Y._82O,
u = Y._60O,
g = Y._61O,
j = Y._toggleIcon,
p = Y._status,
I = t.style,
o = null,
M = nf ? 20 : 4,
Q = j.comps[0];
b >= f || 0 === b ? Y._coverDiv && (yj(Y._coverDiv), delete Y._coverDiv) : Y._coverDiv || (Y._coverDiv = dd(), Uq && (Y._coverDiv.style.background = nb), sn(t, Y._coverDiv)), Y._togglable ? u.parentNode || (sn(t, u), sn(t, g)) : (yj(u), yj(g));
var L = Y._coverDiv,
k = Y._leftView,
v = Y._rightView;
if (Oj(Y)) {
if (b > F && (b = F), p === Fk)
if (1 === e) var X = V(S, F),
w = q(0, F - b - X);
else -1 === e ? (w = V(-S, F), X = q(0, F - b - w)) : (X = A((F - b) * S), w = q(0, F - b - X));
else "cl" === p ? (X = 0, w = q(0, F - b)) : "cr" === p && (w = 0, X = q(0, F - b));
k && qp(k, 0, 0, X, G), v && qp(v, X + b, 0, w, G), qp(t, X, 0, b, G), Y._22o = X, L && (qp(L, b / 2 - f / 2, 0, f, G), L.style.cursor = R ? Nc : ""), t.style.cursor = R ? Nc : "";
var n = t.clientHeight / 2,
i = t.clientWidth;
Bn(u, i, i), qp(u, 0, n - i - M, i, i), o = Wd(u), tf(o, 0, 0, 1), Q.rotation = -N, Yd(o, j, 0, 0, i, i), o.restore(), Bn(g, i, i), qp(g, 0, n + M, i, i), o = Wd(g), tf(o, 0, 0, 1), Q.rotation = N, Yd(o, j, 0, 0, i, i), o.restore()
} else {
if (b > G && (b = G), p === Fk)
if (1 === e) var $ = V(S, G),
P = q(0, G - b - $);
else -1 === e ? (P = V(-S, G), $ = q(0, G - b - P)) : ($ = A((G - b) * S), P = q(0, G - b - $));
else "cl" === p ? ($ = 0, P = q(0, G - b)) : "cr" === p && (P = 0, $ = q(0, G - b));
k && qp(k, 0, 0, F, $), v && qp(v, 0, $ + b, F, P), qp(t, 0, $, F, b), Y._22o = $, L && (qp(L, 0, b / 2 - f / 2, F, f), L.style.cursor = R ? zi : ""), I.cursor = R ? zi : "";
var Z = t.clientWidth / 2,
i = t.clientHeight;
Bn(u, i, i), qp(u, Z - i - M, 0, i, i), o = Wd(u), tf(o, 0, 0, 1), Q.rotation = 0, Yd(o, j, 0, 0, i, i), o.restore(), Bn(g, i, i), qp(g, Z + M, 0, i, i), o = Wd(g), tf(o, 0, 0, 1), Q.rotation = W, Yd(o, j, 0, 0, i, i), o.restore()
}
I.background = D
}
});
var $s = function (d) {
this.sv = d, this.addListeners()
};
yc($s, o, {
ms_listener: 1,
getView: function () {
return this.sv.getView()
}, handle_touchstart: function (P) {
var H = this,
k = H.sv,
a = k._dividerDiv,
l = k._60O,
C = k._61O,
b = k._status,
z = P.target;
if (z === l) b === Fk ? k.setStatus("cl") : "cr" === b && k.setStatus(Fk);
else if (z === C) b === Fk ? k.setStatus("cr") : "cl" === b && k.setStatus(Fk);
else if (Bf(P) && (z === a || z === k._coverDiv) && (Qc(P), k.isDraggable())) {
k.getLeftView(), k.getRightView();
var R = H.maskDiv = dd();
if (R.style.left = 0, R.style.top = 0, R.style.width = k.getWidth() + "px", R.style.height = k.getHeight() + "px", k.getView().appendChild(R), !k.isContinuousLayout()) {
var Z = H.resizeDiv = dd();
Z.style.left = a.style.left, Z.style.top = a.style.top, Z.style.width = a.style.width, Z.style.height = a.style.height, Z.style.opacity = k.getDragOpacity(), Z.style.background = k.getDividerBackground(), sn(H.getView(), Z)
}
H._lastAbsPosition = k._22o, H._86o = Oj(k) ? lb(P).x : lb(P).y, Ui(H, P)
}
}, handleWindowTouchMove: function (y) {
Bf(y) && this.update(y, this.sv.isContinuousLayout())
}, handleWindowTouchEnd: function (d) {
var O = this;
O.update(d, !0), O.sv.setStatus(Fk), O.maskDiv && yj(O.maskDiv), O.resizeDiv && yj(O.resizeDiv), O.maskDiv = O.resizeDiv = F
}, handle_mousedown: function (x) {
jj(x) && this.handle_touchstart(x)
}, handleWindowMouseMove: function (o) {
this.handleWindowTouchMove(o)
}, handleWindowMouseUp: function (C) {
this.handleWindowTouchEnd(C)
}, update: function (k, x) {
var t = this,
q = t.sv,
h = Oj(q) ? q.getWidth() : q.getHeight(),
g = q._dividerSize,
W = t._lastAbsPosition - t._86o;
Oj(q) ? (W += lb(k).x, W > h - g && (W = h - g), 0 > W && (W = 0), t.resizeDiv && (t.resizeDiv.style.left = W + oe)) : (W += lb(k).y, W > h - g && (W = h - g), 0 > W && (W = 0), t.resizeDiv && (t.resizeDiv.style.top = W + oe)), x && h !== g && (1 === q._82O ? q.setPosition(W, 1) : -1 === q._82O ? q.setPosition(W - h + g, 1) : q.setPosition(W / (h - g), 1))
}
}), Vs.TabView = function () {
var t = this,
P = t._view = ve(1, t),
M = t._91O = dd(1),
D = t._tabModel = new jn,
A = D.sm(),
u = t.invalidate;
t._7o = new xr, t._canvas = uo(M), sn(P, M), sn(P, t._92O = dd(1)), A.setSelectionMode(vq), A.ms(t.handleSelectionChange, t), D.mm(u, t), D.mh(u, t), D.md(u, t), t._interactor = new _s(t), t.iv()
}, Ws("TabView", o, {
ms_v: 1,
ms_fire: 1,
ms_tx: 1,
ms_ty: 1,
ms_lp: 1,
ms_ac: ["movable", "tabGap", "tabHeight", "tabPosition", fe, Vm, "tabHPadding", "tabBackground", "selectWidth", op, "moveBackground", "insertColor"],
_tabHPadding: 0,
_tabPosition: $c,
_tabHeight: Jk,
_tabGap: u.tabViewTabGap,
_labelColor: u.tabViewLabelColor,
_labelFont: u.tabViewLabelFont,
_tabBackground: u.tabViewTabBackground,
_selectWidth: u.tabViewSelectWidth,
_selectBackground: u.tabViewSelectBackground,
_moveBackground: u.tabViewMoveBackground,
_insertColor: u.tabViewInsertColor,
_movable: !0,
handleSelectionChange: function () {
this._selectionChanged = !0, this.invalidate()
}, getContentDiv: function () {
return this._92O
}, getTitleDiv: function () {
return this._91O
}, getTabModel: function () {
return this._tabModel
}, add: function (Q, V, x) {
var b, c = this._tabModel;
return Q instanceof Xs ? (b = Q, V && b.setView(V)) : (b = new Xs, b.setName(Q), b.setView(V)), c.add(b), x && c.sm().ss(b), b
}, getLabel: function (v) {
return v.toLabel()
}, onPropertyChanged: function () {
this.iv()
}, _7Q: function (s) {
this._23o = s, this.iv()
}, get: function (g) {
var a = this,
p = a._tabModel;
if (Bp(g)) return p._roots.get(g);
if (dk(g)) {
var G;
return p.each(function (i) {
g === a.getLabel(i) && (G = i)
}), G
}
return g instanceof Xs ? g : F
}, select: function (I) {
this._tabModel.sm().ss(this.get(I))
}, remove: function (G) {
var v = this;
if (G = v.get(G)) {
var w = v._tabModel,
s = w._roots.indexOf(G);
v._tabModel.remove(G), v.selectByIndex(--s)
}
}, getCurrentTab: function () {
return this._8o
}, hideTabView: function (B, t) {
t.parentNode === this._92O && (Db(t) ? (t.style.display = Jc, t._tab_ = B) : yj(t), Um())
}, showTabView: function (t, x) {
Db(x) && (x.style.display = "block", x._tab_ = t), x.parentNode !== this._92O && (sn(this._92O, x), Um())
}, _24o: function () {
var p, b = this,
E = b._8o,
P = b._9o,
L = b._tabModel.sm().ld();
L && (p = Bq(L.getView())), p !== P && (P && (E.getView() && E.getView().endEditing && E.getView().endEditing(), b.hideTabView(E, P)), p && b.showTabView(L, p)), b._8o = L, b._9o = p, E !== L && b.onTabChanged(E, L)
}, onTabClosing: function () {
return !0
}, onTabChanged: function () { }, onTabClosed: function (F, M) {
this.selectByIndex(--M)
}, selectByIndex: function (M) {
var x = this,
C = x._tabModel,
z = C.size();
if (z && !C.sm().ld()) {
M == F && (M = 0), M >= z && (M = z - 1), 0 > M && (M = 0);
for (var $ = M; $ >= 0; $--) {
var U = x.get($);
if (!U.isDisabled()) return x.select(U), U
}
for ($ = M + 1; z > $; $++)
if (U = x.get($), !U.isDisabled()) return x.select(U), U
}
}, getTabWidth: function (u) {
var E = this.getTabHPadding(),
x = 4 + 2 * E,
C = ii(u.getIcon());
C && (x += xc(C, u) + 4);
var P = this.getLabel(u);
return P && (x += ln(this.getLabelFont(u), P).width + 4), u.isClosable() && (x += 10), x
}, drawTab: function (f, c, V, $, e, q, H) {
var x, S = this,
b = S._tabPosition,
Q = this.getTabHPadding(),
v = V + 4 + Q,
C = S._selectWidth,
m = ii(c.getIcon()),
z = c.isDisabled(),
i = S.getLabelColor(c),
d = S.getLabelFont(c),
k = S.getLabel(c),
J = S._selectBackground,
t = b === nq + "-vertical",
T = b === fm + "-vertical";
(t || T) && (v = $ + 4 + Q), z && (f.globalAlpha = Nn), fl(f, V, $, e, q, H), c === S._8o && C && (b === $c ? fl(f, V, $ + q - C, e, C, J) : b === nq ? fl(f, V + e - C, $, C, q, J) : b === fm ? fl(f, V, $, C, q, J) : t ? fl(f, V + e - C, $, C, q, J) : T ? fl(f, V, $, C, q, J) : fl(f, V, $, e, C, J));
var D = e / 2;
if (t && (wh(f, D, $ + q / 2), jc(f, W), wh(f, -D, -$ - q / 2)), m) {
var j = oo(m, c),
G = xc(m, c);
if (t || T) {
var R = V + e / 2,
M = v + j / 2;
wh(f, R, M), jc(f, N), wh(f, -R, -M), Ii(f, m, V + e / 2, v + j / 2, c, S), wh(f, R, M), jc(f, -N), wh(f, -R, -M), v += j + 4
} else Ii(f, m, v + G / 2, $ + q / 2, c, S), v += G + 4
}
return t || T ? (wh(f, e / 2, v + e / 2), jc(f, N), wh(f, -e / 2, -v - e / 2), nd(f, k, d, i, V, v, q, e), wh(f, e / 2, v + e / 2), jc(f, -N), wh(f, -e / 2, -v - e / 2)) : nd(f, k, d, i, v, $, e, q), t && (wh(f, D, $ + q / 2), jc(f, -W), wh(f, -D, -$ - q / 2)), c.isClosable() && (x = T ? {
x: V + e - 12,
y: $ + q - 12,
width: 12,
height: 12
} : {
x: V + e - 12,
y: $ + 2,
width: 12,
height: 12
}, this.drawCloseIcon(c, f, i, x)), z && (f.globalAlpha = 1), x
}, drawCloseIcon: function (Z, $, v, P) {
var D = P.x,
J = P.y;
$.strokeStyle = v, $.lineWidth = 1, $.beginPath(), $.moveTo(D + 2, J + 8), $.lineTo(D + 8, J + 2), $.moveTo(D + 8, J + 8), $.lineTo(D + 2, J + 2), $.stroke()
}, getTabAt: function (c) {
var d = this._interactor._8Q(c);
return d ? d.tab : null
}, validateImpl: function () {
var T = this;
T._24o();
var N, n = T._canvas,
W = T._tabPosition,
i = T._91O,
X = T._92O,
p = T._tabModel,
F = T.getWidth(),
c = T.getHeight(),
b = T._tabHeight,
d = T._7o,
v = T._tabGap,
B = W === $c,
C = W === nq,
L = W === fm,
k = W === nq + "-vertical",
r = W === fm + "-vertical",
g = T._23o,
e = 0;
if ((C || L) && p._roots.each(function (n) {
e = q(T.getTabWidth(n), e)
}), B ? (qp(i, 0, 0, F, b), N = {
x: 0,
y: b,
width: F,
height: q(0, c - b)
}) : C ? (qp(i, 0, 0, e, c), N = {
x: e,
y: 0,
width: q(0, F - e),
height: c
}) : L ? (qp(i, F - e, 0, e, c), N = {
x: 0,
y: 0,
width: q(0, F - e),
height: c
}) : k ? (qp(i, 0, 0, b, c), N = {
x: b,
y: 0,
width: q(0, F - b),
height: c
}) : r ? (qp(i, F - b, 0, b, c), N = {
x: 0,
y: 0,
width: q(0, F - b),
height: c
}) : (qp(i, 0, c - b, F, b), N = {
x: 0,
y: 0,
width: F,
height: q(0, c - b)
}), qp(X, N), k || r) {
T._9o && (N.x = 0, qp(T._8o.getView(), N)), Bn(n, b, c);
var Z = Wd(n),
y = 0;
if (tf(Z, 0, T.ty(), 1), Z.clearRect(0, 0, b, c), d.clear(), p._roots.each(function (h) {
if (h.isVisible()) {
var P, K = T.getTabWidth(h);
g && g.tab === h || (P = T.drawTab(Z, h, 0, y, b, K, T._tabBackground)), d.add({
_75o: P,
tab: h,
startY: y,
endY: y + K,
height: K
}), y += K + v
}
}), T._23Q = q(0, y - v), g) {
var P = g.position;
T.drawTab(Z, g.tab, 0, g.startY, b, g.height, T._moveBackground), fl(Z, 0, P, b, 1, T._insertColor)
}
if (Z.restore(), T._selectionChanged) {
T._selectionChanged = !1;
for (var H = T.ty(), U = 0; U < d.size(); U++) {
var K = d.get(U);
if (K.tab === T._8o) {
if (K.endY + H < 0) {
T.ty(-K.startY);
break
}
if (K.startY + H > c) {
T.ty(c - K.endY);
break
}
}
}
}
T.ty(T.ty())
} else if (C || L) {
T._9o && (N.x = 0, qp(T._8o.getView(), N)), Bn(n, e, c);
var Z = Wd(n),
y = 0;
if (tf(Z, 0, T.ty(), 1), Z.clearRect(0, 0, e, c), d.clear(), p._roots.each(function (q) {
if (q.isVisible()) {
var B;
g && g.tab === q || (B = T.drawTab(Z, q, 0, y, e, b, T._tabBackground)), d.add({
_75o: B,
tab: q,
startY: y,
endY: y + b,
height: b
}), y += b + v
}
}), T._23Q = q(0, y - v), g) {
var P = g.position;
T.drawTab(Z, g.tab, 0, g.startY, e, g.height, T._moveBackground), fl(Z, 0, P, e, 1, T._insertColor)
}
if (Z.restore(), T._selectionChanged) {
T._selectionChanged = !1;
for (var H = T.ty(), U = 0; U < d.size(); U++) {
var K = d.get(U);
if (K.tab === T._8o) {
if (K.endY + H < 0) {
T.ty(-K.startY);
break
}
if (K.startY + H > c) {
T.ty(c - K.endY);
break
}
}
}
}
T.ty(T.ty())
} else {
T._9o && (N.y = 0, qp(T._8o.getView(), N)), Bn(n, F, b);
var Z = Wd(n),
M = 0;
if (tf(Z, T.tx(), 0, 1), Z.clearRect(0, 0, F, b), d.clear(), p._roots.each(function (J) {
if (J.isVisible()) {
var k, B = T.getTabWidth(J);
g && g.tab === J || (k = T.drawTab(Z, J, M, 0, B, b, T._tabBackground)), d.add({
_75o: k,
tab: J,
startX: M,
endX: M + B,
width: B
}), M += B + v
}
}), T._64I = q(0, M - v), g) {
var P = g.position;
T.drawTab(Z, g.tab, g.startX, 0, g.width, b, T._moveBackground), cs(Z, T._insertColor, P, 0, b)
}
if (Z.restore(), T._selectionChanged) {
T._selectionChanged = !1;
for (var z = T.tx(), U = 0; U < d.size(); U++) {
var K = d.get(U);
if (K.tab === T._8o) {
if (K.endX + z < 0) {
T.tx(-K.startX);
break
}
if (K.startX + z > F) {
T.tx(F - K.endX);
break
}
}
}
}
T.tx(T.tx())
}
for (var l = [], w = X.children, U = 0; U < w.length; U++) {
var f = w[U],
j = f._tab_;
j && !p.contains(j) && l.push(f)
}
l.forEach(function (o) {
X.removeChild(o)
})
}
});
var _s = function (C) {
this.tv = C, this.addListeners()
};
yc(_s, o, {
ms_listener: 1,
getView: function () {
return this.tv._91O
}, handle_mousewheel: function (W) {
this.handleScroll(W, 10 * (W.wheelDelta / 40))
}, handle_DOMMouseScroll: function (x) {
this.handleScroll(x, 10 * -x.detail)
}, handleScroll: function (w, j) {
Qc(w);
var O = this.tv,
T = O._tabPosition;
!O._40o() || T !== $c && T !== Kd || O.tx(this.tv.tx() + j), !O._41o() || T !== nq && T !== fm && T !== nq + "-vertical" && T !== fm + "-vertical" || O.ty(this.tv.ty() + j)
}, _8Q: function (g) {
var P, Z, Q = this.tv,
N = Q._tabPosition,
q = Q._7o;
if (N === $c || N === Kd) {
var s = Q.lp(g).x;
for (P = 0; P < q.size(); P++)
if (Z = q.get(P), Z.startX <= s && s <= Z.endX) return Z
} else if (N === nq || N === fm || N === nq + "-vertical" || N === fm + "-vertical") {
var c = Q.lp(g).y;
for (P = 0; P < q.size(); P++)
if (Z = q.get(P), Z.startY <= c && c <= Z.endY) return Z
}
return F
}, isClickable: function (K) {
var j = this.tv,
p = j._tabPosition,
s = this._73o = this._8Q(K);
return !j._40o() || p !== $c && p !== Kd ? !j._41o() || p !== nq && p !== fm && p !== nq + "-vertical" && p !== fm + "-vertical" ? s && (!s.tab.isDisabled() || j.isMovable()) : !0 : !0
}, handle_mousemove: function (S) {
var E = this;
si ? E._74o = E._8Q(S) : E.getView().style.cursor = E.isClickable(S) ? Zk : ""
}, handle_mousedown: function (E) {
this.handle_mousemove(E), this.handle_touchstart(E)
}, handle_touchstart: function ($) {
var d = this,
H = d.tv,
S = H._tabPosition;
Qc($), jj($) && d.isClickable($) && (S === $c || S === Kd ? (d.x = lb($).x, d.lp = H.lp($), d.tx = H.tx()) : (d.y = lb($).y, d.lp = H.lp($), d.ty = H.ty()), Ui(d, $))
}, handleWindowMouseMove: function (P) {
this.handleWindowTouchMove(P)
}, handleWindowTouchMove: function ($) {
var Q, R = this,
O = R.tv,
e = O._tabPosition,
G = R._73o;
if (e === $c || e === Kd) {
if (Q = lb($).x - R.x, !R._25o && !R.moving && X(Q) > 2 && (O._40o() && !ik($) ? R._25o = 1 : G && O.isMovable() && (R.moving = 1)), R._25o) O.tx(R.tx + Q);
else if (R.moving) {
var C = R.lp.x + Q,
u = O._tabGap / 2;
O._7o.each(function (g) {
var i = g.endX,
y = C - g.startX < i - C;
C >= g.startX && i >= C && O._7Q({
tab: G.tab,
startX: G.startX + Q,
width: G.width,
front: y,
insertTab: g.tab,
position: y ? q(0, g.startX - u) : V(O._64I, i + u)
})
})
}
} else if (Q = lb($).y - R.y, !R._25o && !R.moving && X(Q) > 2 && (O._41o() && !ik($) ? R._25o = 1 : G && O.isMovable() && (R.moving = 1)), R._25o) O.ty(R.ty + Q);
else if (R.moving) {
var K = R.lp.y + Q,
u = O._tabGap / 2;
O._7o.each(function (l) {
var j = l.endY,
c = K - l.startY < j - K;
K >= l.startY && j >= K && O._7Q({
tab: G.tab,
startY: G.startY + Q,
height: G.height,
front: c,
insertTab: l.tab,
position: c ? q(0, l.startY - u) : V(O._23Q, j + u)
})
})
}
}, handleWindowMouseUp: function (q) {
this.handleWindowTouchEnd(q)
}, handleWindowTouchEnd: function () {
var n = this,
E = n.tv,
B = E._tabPosition,
T = E.getTabModel(),
b = T._roots,
j = n._73o;
if (n.moving) {
var z = E._23o;
if (z && z.insertTab !== z.tab) {
var p = z.tab,
X = b.remove(p),
x = b.indexOf(z.insertTab);
x >= 0 && (z.front || x++, x <= b.size() && (b.add(p, x), T._38I(p, X, x)))
}
E._7Q(F), delete n.moving
} else if (!n._25o && j) {
p = j.tab;
var o = n._74o;
if (!o || o.tab === p)
if (!p.isDisabled() && cf(j._75o, n.lp)) {
var $ = function () {
var N = b.indexOf(p);
T.remove(p), E.onTabClosed(p, N)
};
E.onTabClosing(p, $) && $()
} else p.isDisabled() || E._8o === p || T.sm().ss(p)
}
n._25o = n._73o = n._74o = B === $c || B === Kd ? n.x = n.lp = n.tx = F : n.y = n.lp = n.ty = F
}
}), Vs.PropertyView = function (n) {
var g = this;
g._view = ve(1, g), g._canvas = uo(g._view), sn(g._view, g._79O = dd()), g._rows = new xr, g._28o = new xr, g._26o = {}, g._26Q = {};
var R = g._propertyModel = new jn,
b = g.ivm;
R.mm(b, g), R.md(b, g), R.mh(b, g), g.dm(n ? n : new jn), new at(g)
}, Ws("PropertyView", o, {
ms_ac: [fe, Uo, Vm, Me, Zh, "categorizable", Vb, go, dj, Zi, xj, df, gd, Ji, "selectRowIndex", op, "background", Jj, Yc, Ln, jh, Gr],
ms_v: 1,
ms_dm: 1,
ms_fire: 1,
ms_sm: 1,
_49o: 1,
ms_txy: 1,
ms_lp: 1,
ms_vs: 1,
_45o: 1,
_47o: 1,
ms_tip: 1,
_29I: nl,
_59I: 0,
_9I: 0,
_selectRowIndex: -1,
_editable: !0,
_batchEditable: !0,
_categorizable: !0,
_indent: kc,
_background: u.propertyViewBackground,
_expandIcon: u.propertyViewExpandIcon,
_collapseIcon: u.propertyViewCollapseIcon,
_scrollBarColor: Ch,
_scrollBarSize: di,
_autoHideScrollBar: jr,
_selectBackground: u.propertyViewSelectBackground,
_rowHeight: Oi,
_rowLineVisible: u.propertyViewRowLineVisible,
_rowLineColor: u.propertyViewRowLineColor,
_10I: .5,
_columnLineVisible: u.propertyViewColumnLineVisible,
_columnLineColor: u.propertyViewColumnLineColor,
_labelColor: u.propertyViewLabelColor,
_labelSelectColor: u.propertyViewLabelSelectColor,
_labelFont: u.propertyViewLabelFont,
getRows: function () {
return this._rows
}, getColumnPosition: function () {
return this._10I
}, setColumnPosition: function (H) {
0 > H && (H = 0), H > 1 && (H = 1);
var v = this,
t = v._10I;
v._10I = H, v.fp("columnPosition", t, H)
}, getPropertyName: function (K) {
return K.toLabel()
}, getLabelFont: function () {
return this._labelFont
}, getLabelColor: function (y, x, D) {
return D === this._selectRowIndex ? this._labelSelectColor : this._labelColor
}, getPropertyFont: function () {
return this._labelFont
}, getPropertyColor: function (h, U) {
return U === this._selectRowIndex ? this._labelSelectColor : h.getColor() || this._labelColor
}, getCategoryFont: function () {
return this._labelFont
}, getCategoryColor: function () {
return this._labelColor
}, adjustTranslateX: function () {
return 0
}, adjustTranslateY: function (s) {
var U = this.getHeight() - this._59I;
return U > s && (s = U), s > 0 ? 0 : A(s)
}, isExpanded: function (K) {
if (!K) return !0;
var d = this._26o[K];
return d ? d.isExpanded : !(this._26Q[K] === !1)
}, toggle: function (s) {
var t = this;
t.isExpanded(s) ? t.collapse(s) : t.expand(s)
}, expandAll: function () {
this.validate();
for (var w in this._26o) this.expand(w)
}, expand: function (V) {
if (V && V !== Jc) {
var A = this,
k = A._26o[V];
k && !k.isExpanded && (k.isExpanded = !0, A.onExpanded(V), A.ivm())
}
}, onExpanded: function () { }, collapseAll: function () {
this.validate();
for (var m in this._26o) this.collapse(m)
}, collapse: function (W) {
if (W && W !== Jc) {
var H = this,
X = H._26o[W];
X && X.isExpanded && (X.isExpanded = !1, H.onCollapsed(W), H.ivm())
}
}, onCollapsed: function () { }, getCategoryName: function (Y) {
if (!this.isCategorizable()) return Jc;
var $ = Y.getCategoryName();
return $ ? $ : Jc
}, getPropertyModel: function () {
return this._propertyModel
}, handleSelectionChange: function () {
this.ivm()
}, setDataModel: function (U) {
var V = this,
Z = V._dataModel;
Z !== U && (Z && (Z.umd(V.handlePropertyChange, V), V._selectionModel || Z.sm().ums(V.handleSelectionChange, V)), V._dataModel = U, U.md(V.handlePropertyChange, V), V._selectionModel ? V._selectionModel._21I(U) : U.sm().ms(V.handleSelectionChange, V), V.fp(uk, Z, U))
}, isVisible: function (R) {
return this._visibleFunc ? this._visibleFunc(R) : !0
}, onPropertyChanged: function (i) {
var v = this,
u = i.property;
Qs[u] ? v.ivm() : v.iv(), u === wb && v._43o()
}, getCurrentData: function () {
return this._27o
}, updateCurrentData: function () {
this._27o = this.sm().ld()
}, getRawProperties: function () {
return this._27o ? this._propertyModel._roots : Yh
}, handlePropertyChange: function (a) {
this._27o === a.data && this.iv()
}, ivm: function () {
this.invalidateModel()
}, invalidateModel: function () {
var r = this;
r._96I || (r.setSelectRowIndex(-1), r._96I = 1, r.iv())
}, redraw: function () {
this.iv()
}, validateModel: function () {
var f = this,
$ = f._rows,
_ = f._28o,
S = {},
n = new xr,
h = f._27o;
f.updateCurrentData(), h !== f._27o && f.endEditing(), $.clear(), _.clear(), f.getRawProperties().each(function (B) {
if (f.isVisible(B)) {
n.add(B);
var E = f.getCategoryName(B);
S[E] || (_.add(E, E === Jc ? 0 : Z), S[E] = {
isExpanded: f.isExpanded(E),
properties: new xr
})
}
}), f._sortFunc && n.sort(f._sortFunc);
for (var I in f._26o) f._26Q[I] = f.isExpanded(I);
f._26o = S, _.each(function (V) {
V !== Jc && $.add(V);
var D = S[V];
D.isExpanded && n.each(function (L) {
f.getCategoryName(L) === V && (D.properties.add(L), $.add({
property: L,
data: f._27o
}))
}, f)
})
}, validateImpl: function () {
var B = this;
B._76o(), B._96I && (B.validateModel(), delete B._96I);
var f = B._canvas,
P = B.getWidth(),
Y = B.getHeight(),
$ = -B.ty(),
k = B._rowHeight,
b = B._indent,
l = P - b,
y = B._rows,
r = y.size(),
c = B._9I = b + l * B._10I,
g = B._59I = r * k;
Bn(f, P, Y), B._29I = {
x: 0,
y: $,
width: P,
height: Y
}, B._31I = T($ / k), B._14I = s(($ + Y) / k), B._31I < 0 && (B._31I = 0), B._14I > r && (B._14I = r);
var U, p = Wd(f),
Z = B._background;
tf(p, 0, -$, 1), p.beginPath(), p.rect(0, $, P, Y), p.clip(), p.clearRect(0, $, P, Y), B._93db(p), Z && fl(p, 0, 0, b, g, Z);
for (var S = B._31I; S < B._14I; S++) {
var G = y.get(S),
$ = k * S;
if (dk(G)) Z && fl(p, b, $, l, k, Z), U = ii(B.isExpanded(G) ? B._expandIcon : B._collapseIcon), U && qk(p, U, Mg, 0, $, b, k), p.save(), p.beginPath(), p.rect(b, $, l, k), p.clip(), B.drawCategoryName(p, G, S, b, $, l, k), p.restore();
else {
var C = G.property,
E = G.data,
U = ii(C.getIcon()),
t = B._selectRowIndex === S ? B.getSelectBackground() : F;
if (U && qk(p, U, Mg, 0, $, b, k), t && fl(p, b, $, l, k, t), p.save(), p.beginPath(), p.rect(b, $, c - b, k), p.clip(), B.drawPropertyName(p, C, S, b, $, c - b, k), p.restore(), !B.isEditing(E, C)) {
var z = c + 1,
q = P - c - 1;
p.save(), p.beginPath(), p.rect(z, $, q, k), p.clip(), B._87o(B.drawPropertyValue(p, C, B.getValue(E, C), S, z, $, q, k, E), S, z, $, q, k), p.restore()
}
}
B._rowLineVisible && fl(p, b, $ + k - 1, l, 1, B._rowLineColor)
}
B._columnLineVisible && (fl(p, c, 0, 1, g, B._columnLineColor), fl(p, P - 1, 0, 1, g)), B._92db(p), B._93I(), p.restore(), B.ty(B.ty())
}, drawCategoryName: function (d, C, h, X, t, S, O) {
nd(d, C, this.getCategoryFont(C), this.getCategoryColor(C), X, t, S, O)
}, drawPropertyName: function (A, f, Z, O, o, T, i) {
return f.drawPropertyName ? (f.drawPropertyName(A, f, Z, O, o, T, i, this), void 0) : (nd(A, this.getPropertyName(f), this.getPropertyFont(f, Z), this.getPropertyColor(f, Z), O, o, T, i), void 0)
}, drawPropertyValue: function (F, P, p, I, A, W, S, w, k) {
return P.drawPropertyValue ? P.drawPropertyValue(F, P, p, I, A, W, S, w, k, this) : (Ss(F, p, P, this.getLabelFont(P, p, I), this.getLabelColor(P, p, I), A, W, S, w, k, this), void 0)
}, isPropertyEditable: function (e) {
return e.isEditable() && this.isEditable()
}, setProperties: function (M) {
this._propertyModel.clear(), this.addProperties(M)
}, addProperties: function (a) {
if (a) {
var p = this._propertyModel;
a.forEach(function (W) {
if (!(W instanceof Zs)) {
var e = gp(W.className);
W = Wn(e ? e : Zs, W)
}
p.add(W)
})
}
}, getRowIndexAt: function (N) {
var B = this,
Y = T(B.lp(N).y / B._rowHeight);
return Y >= 0 && Y < B._rows.size() ? Y : -1
}, getPropertyAt: function (A) {
var x = this,
E = x.getRowIndexAt(A);
return E >= 0 ? x._rows.get(E).property : F
}, getToolTip: function (I) {
var V = this,
S = V.getPropertyAt(I),
P = V._27o;
return S && P ? S.getToolTip(P, V._9I < V.lp(I).x, V) : F
}
});
var at = function (q) {
this.pv = q, this.addListeners()
};
yc(at, o, {
ms_listener: 1,
getView: function () {
return this.pv._view
}, setCursor: function (A) {
this.getView().style.cursor = A
}, clear: function () {
var A = this;
A._62O = A.cp = A.ty = A.p = F, A.setCursor(lp)
}, handle_mousedown: function (g) {
this.handle_touchstart(g)
}, handle_touchstart: function (X) {
var i = this,
F = i.pv;
Qc(X), F.setFocus(X) && (jj(X) ? (i.cp = lb(X), i.ty = F.ty(), i.p = F.getColumnPosition(), i.handle_touchmove(X)) : F.setSelectRowIndex(F.getRowIndexAt(X)))
}, handleWindowMouseUp: function () {
this.clear()
}, handleWindowTouchEnd: function () {
this.clear()
}, handle_mouseup: function (J) {
this.handle_touchend(J)
}, handle_touchend: function (k) {
var $ = this;
if ($.cp && !$._62O) {
var p = $.pv,
x = p.lp(k),
F = x.x,
M = x.y,
s = p._indent,
Y = p.getRowIndexAt(k),
b = p._9I;
if (Y >= 0) {
var D = p._rowHeight,
U = D * Y,
r = p._rows.get(Y),
X = r.property;
if (dk(r)) ii(p.isExpanded(r) ? p._expandIcon : p._collapseIcon) && F >= 0 && s >= F && M >= U && U + D >= M ? p.toggle(r) : wm(k) && p.toggle(r);
else if (F > b && p.isPropertyEditable(X, k)) {
var u = {
x: b + 1,
y: U,
width: p.getWidth() - b - 1,
height: D
},
T = {
x: u.x + p.tx(),
y: u.y + p.ty(),
width: u.width,
height: u.height
},
i = 0,
W = p._29I;
u.y < W.y ? i = u.y - W.y : u.y + D > W.y + W.height && (i = u.y + D - W.y - W.height), i && (p.ty(p.ty() - i), T.y -= i), p.beginEditing({
data: r.data,
property: X,
value: p.getValue(r.data, X),
event: k,
rect: u,
editorRect: T,
view: p
})
}
}
p.setSelectRowIndex(Y)
}
$.clear()
}, handleWindowMouseMove: function (k) {
this.handleWindowTouchMove(k)
}, handleWindowTouchMove: function (M) {
var u = this,
Z = u.pv,
b = u.ty,
x = u.cp,
G = lb(M),
V = u._62O;
if ("p" === V) Z.setTranslateY(b + G.y - x.y);
else if ("c" === V) {
var H = Z.getWidth() - Z._indent;
if (H > 16) {
var h = u.p - (x.x - G.x) / H,
$ = 16 / H;
$ > h && (h = $), h > 1 - $ && (h = 1 - $), Z.setColumnPosition(h)
}
} else "s" === V && Z.setTranslateY(b + (x.y - G.y) * Z._59I / Z._29I.height)
}, handle_mousemove: function (w) {
this.handle_touchmove(w)
}, handle_touchmove: function (I) {
if (!si && jj(I)) {
var Y = this,
x = Y.pv,
P = X(x.lp(I).x - x._9I) <= (nf ? 8 : 3);
Y.cp ? Y._62O || (P ? (Y._62O = "c", Ui(Y, I)) : X(lb(I).y - Y.cp.y) >= 2 && (Y._62O = Y.isV(I) ? "s" : "p", Ui(Y, I))) : (P ? Y.setCursor(Nc) : Y.setCursor(lp), Y.isV(I) && x._43o())
}
}, isV: function (Z) {
var Y = this.pv,
f = Y._29I;
return Y._41o() && f.x + f.width - Y.lp(Z).x < co
}, handle_mousewheel: function (B) {
this.handleScroll(B, B.wheelDelta / 40)
}, handle_DOMMouseScroll: function (k) {
2 === k.axis && this.handleScroll(k, -k.detail)
}, handleScroll: function (_, o) {
var b = this.pv;
Qc(_), b.endEditing(), b.translate(0, o * b.getRowHeight())
}, handle_keydown: function (j) {
var L = this.pv,
Q = L._rows.size(),
R = L._selectRowIndex + (Nk(j) ? -1 : 1);
(Nk(j) || ri(j)) && (0 > R && (R = 0), R >= Q && (R = Q - 1), L.setSelectRowIndex(R))
}
}), Vs.ListView = function (f) {
this._5o(f), new bt(this)
}, Ws("ListView", o, {
ms_ac: [fe, Uo, Vm, Jj, Vb, Yc, Ln, go, dj, df, gd, Ji, Pi, op],
ms_v: 1,
ms_bnb: 1,
ms_tip: 1,
ms_fire: 1,
ms_sm: 1,
_49o: 1,
ms_txy: 1,
ms_lp: 1,
ms_vs: 1,
ms_hs: 1,
_15Q: 1,
_14Q: 1,
ms_dm: 1,
_45o: 1,
_checkMode: !1,
_indent: kc,
_rowHeight: Oi,
_rowLineVisible: u.listViewRowLineVisible,
_rowLineColor: u.listViewRowLineColor,
_scrollBarColor: Ch,
_scrollBarSize: di,
_autoMakeVisible: be,
_autoHideScrollBar: jr,
_selectBackground: u.listViewSelectBackground,
_labelColor: u.listViewLabelColor,
_labelSelectColor: u.listViewLabelSelectColor,
_labelFont: u.listViewLabelFont,
isCheckMode: function () {
return this._checkMode
}, setCheckMode: function (b) {
var D = this,
t = D._checkMode;
D._checkMode = b, D.fp(wi, t, b)
}, drawRow: function (M, q, h, X, V, i, E) {
var F = this,
m = 0,
H = F._indent,
e = F.getIconWidth(q);
F.drawRowBackground(M, q, h, X, V, i, E), F._checkMode && (Ii(M, ii(F.getCheckIcon(q)), m + H / 2, V + E / 2, q, F), m += H), F.drawIcon(M, q, m, V, e, E), F.drawLabel(M, q, m + e, V, E)
}
});
var bt = function (W) {
this.list = W, this.addListeners()
};
yc(bt, o, {
ms_listener: 1,
getView: function () {
return this.list._view
}, clear: function (r) {
var X = this,
f = X.list;
r && "d" === X._62O && !X.dragCancel && f.handleDragAndDrop(r, "end"), f.draggingData && (f.draggingData = null, f.redraw()), X.dragCancel = X._62O = X._isV = X._isH = X.cp = X.tx = X.ty = F
}, handle_mousedown: function (u) {
this.handle_touchstart(u)
}, handle_touchstart: function (F) {
var p = this,
R = p.list;
if (Qc(F), R.setFocus(F)) {
var v = R.getDataAt(F);
p.cp = lb(F), p.tx = R.tx(), p.ty = R.ty(), jj(F) ? v && R.handleDragAndDrop && !p.isV(F) && !p.isH(F) && (R.draggingData = v, R.redraw(), R.handleDragAndDrop(F, "prepare")) : (v ? p._33o(F, v) : this._cancelDataDoubleSelect(), p.clear(F))
}
}, handleWindowMouseUp: function (x) {
this.clear(x)
}, handleWindowTouchEnd: function (q) {
this.clear(q)
}, handle_mouseup: function (S) {
this.handle_touchend(S)
}, handle_touchend: function (l) {
var Q = this,
g = Q.list;
if (!Q._isV && !Q._isH && Q.cp && !Q._62O) {
var u = g.getDataAt(l);
u ? (g.isCheckMode() ? Q._34o(l, u) : Q._33o(l, u), wm(l) ? g.onDataDoubleClicked(u, l) : g.onDataClicked(u, l)) : (Q._cancelDataDoubleSelect(), g.handleBackgroundClick(l))
}
Q.clear(l)
}, handleWindowMouseMove: function (D) {
this.handleWindowTouchMove(D)
}, handleWindowTouchMove: function (L) {
var w = this,
z = w.list,
m = w._62O,
F = w.tx,
r = w.ty,
B = w.cp,
Z = lb(L),
R = z._29I;
"p" === m ? z.setTranslate(F + Z.x - B.x, r + Z.y - B.y) : "v" === m ? z.ty(r + (B.y - Z.y) * z._59I / R.height) : "h" === m ? z.tx(F + (B.x - Z.x) * z._91I / R.width) : "d" === m && (w.dragCancel || z.handleDragAndDrop(L, "between"))
}, handle_mousemove: function (e) {
this.handle_touchmove(e)
}, handle_touchmove: function (K) {
if (!si && jj(K)) {
var p = this,
f = p.list;
if (p._isV = p.isV(K), p._isH = p.isH(K), p.cp) {
if (!p._62O) {
if (En(lb(K), p.cp) < 2) return;
p._isV ? p._62O = "v" : p._isH ? p._62O = "h" : f.draggingData && !this.dragCancel ? (p._62O = "d", f.handleDragAndDrop(K, "begin")) : p._62O = "p", p._62O && "d" !== p._62O && f.draggingData && (f.draggingData = null, f.redraw()), Ui(p, K)
}
} else p._isV && f._43o(), p._isH && f._42o()
}
}, isV: function (P) {
var E = this.list,
m = E._29I;
return E._41o() && m.x + m.width - E.lp(P).x < co
}, isH: function (s) {
var U = this.list,
y = U._29I;
return U._40o() && y.y + y.height - U.lp(s).y < co
}, handle_mousewheel: function (u) {
this.handleScroll(u, u.wheelDelta / 40, u.wheelDelta !== u.wheelDeltaX)
}, handle_DOMMouseScroll: function (n) {
this.handleScroll(n, -n.detail, 1)
}, handleScroll: function (w, n, g) {
var T = this.list;
Qc(w), T.endEditing && T.endEditing(), g && T._41o() ? T.translate(0, n * T.getRowHeight()) : T._40o() && T.translate(10 * n, 0)
}, handle_keydown: function (T) {
if (!u.isInput(T.target)) {
var s, V = this.list,
t = V.sm(),
J = V._rows,
x = J.size();
if (Dq(T)) V.selectAll();
else if (qq(T)) V.handleDelete && V.handleDelete(T);
else if (bj(T)) "d" !== this._62O || this.dragCancel || (V.handleDragAndDrop(T, "cancel"), this.dragCancel = !0);
else if (Cf(T)) V.isCheckMode() && (s = V.getFocusData(), s && V.checkData(s));
else if (Nk(T) || ri(T)) {
var y = V.isCheckMode();
if (s = y ? V.getFocusData() : t.ld()) {
var X = V.getRowIndex(s);
X >= 0 && (Nk(T) ? 0 !== X && (s = J.get(X - 1), y ? V.setFocusData(s) : t.ss(s)) : X !== x - 1 && (s = J.get(X + 1), y ? V.setFocusData(s) : t.ss(s)))
} else x > 0 && (s = J.get(0), y ? V.setFocusData(s) : t.ss(s))
}
}
}, _34o: function (f, F) {
var a = this.list,
m = a.lp(f).x;
return m >= 0 && m <= a._indent ? (a.checkData(F), void 0) : (a.setFocusData(F), void 0)
}, _33o: function (X, W) {
var z = this.list,
S = z.sm(),
k = S.ld();
if (!z.canHandleSelectMode(X, W)) return this._cancelDataDoubleSelect(), void 0;
if (ik(X)) z.isSelected(W) ? S.rs(W) : S.as(W);
else if (Pf(X))
if (k)
for (var Z = z.getRowIndex(k), E = z.getRowIndex(W); Z !== E;) Z += E > Z ? 1 : -1, S.as(z._rows.get(Z));
else S.ss(W);
else jj(X) ? (S.contains(W) ? z.handleDataDoubleSelect && (this._handleDataDoubleSelect(X, W), wm(X) && this._cancelDataDoubleSelect()) : this._cancelDataDoubleSelect(), S.ss(W)) : S.contains(W) || S.ss(W)
}, _handleDataDoubleSelect: function (e, p) {
this._cancelDataDoubleSelect(), this._doubleSelectTimer = cd(function () {
this.list.handleDataDoubleSelect(e, p), this._doubleSelectTimer = Z
}.bind(this), u.doubleClickSpeed)
}, _cancelDataDoubleSelect: function () {
this._doubleSelectTimer && (nr(this._doubleSelectTimer), this._doubleSelectTimer = Z)
}
}), Vs.TreeView = function (p) {
var G = this;
G._35o(), G._5o(p), new ct(G)
}, Ws("TreeView", o, {
ms_ac: [fe, Uo, Vm, "rootVisible", wi, "rootData", go, dj, df, gd, Ji, Vb, Jj, Yc, Ln, Zi, xj, Pi, op, "loader", "doubleClickToToggle"],
ms_v: 1,
ms_bnb: 1,
ms_tip: 1,
ms_fire: 1,
ms_sm: 1,
_49o: 1,
ms_txy: 1,
ms_lp: 1,
ms_vs: 1,
ms_hs: 1,
_15Q: 1,
ms_dm: 1,
_48o: 1,
_14Q: 1,
_45o: 1,
_checkMode: F,
_indent: kc,
_rowHeight: Oi,
_rowLineVisible: u.treeViewRowLineVisible,
_rowLineColor: u.treeViewRowLineColor,
_scrollBarColor: Ch,
_scrollBarSize: di,
_autoHideScrollBar: jr,
_expandIcon: u.treeViewExpandIcon,
_collapseIcon: u.treeViewCollapseIcon,
_autoMakeVisible: be,
_selectBackground: u.treeViewSelectBackground,
_labelColor: u.treeViewLabelColor,
_labelSelectColor: u.treeViewLabelSelectColor,
_labelFont: u.treeViewLabelFont,
_doubleClickToToggle: u.treeViewDoubleClickToToggle,
drawRow: function (f, b, L, C, m, D, A) {
var B = this;
B.drawRowBackground(f, b, L, C, m, D, A), B.drawTree(f, b, L, 0, m, D, A)
}, isOnToggleIcon: function (P) {
var T = this.getDataAt(P);
if (T) {
var f = this.getIndent(),
e = this.lp(P).x;
if (ii(this.getToggleIcon(T))) {
var N = f * this.getLevel(T);
if (e >= N && N + f >= e) return !0
}
}
return !1
}
});
var ct = function (G) {
fi(ct, this, [G])
};
yc(ct, bt, {
toggle: function (Y, u, A, t) {
var P = this.list,
Z = P.lp(Y).x;
if (ii(P.getToggleIcon(u))) {
var M = A * t;
if (Z >= M && M + A >= Z) return P.toggle(u), !0
}
return P.isDoubleClickToToggle() && wm(Y) ? (P.toggle(u), !0) : !1
}, _34o: function (B, S) {
var Y = this.list,
N = Y.lp(B).x,
n = Y._levelMap[S._id],
L = Y._indent,
u = L * (n + 1);
return N >= u && u + L >= N ? (Y.checkData(S), void 0) : (this.toggle(B, S, L, n) || Y.setFocusData(S), void 0)
}, _33o: function (Y, O) {
var N = this,
p = N.list;
if (!N.toggle(Y, O, p._indent, p.getLevel(O)))
if (Pf(Y)) {
var J = p.sm();
if (J.size() > 0) {
for (var b = p._rows, v = null, l = 0, T = b.size(); T > l; l++)
if (p.isSelected(b.get(l))) {
v = l;
break
}
for (var L = null, l = b.size() - 1; l >= 0; l--)
if (p.isSelected(b.get(l))) {
L = l;
break
}
var A, n, s = p.getRowIndex(O);
for (v > s ? (A = s - 1, n = v) : s > L ? (A = L, n = s) : (A = v, n = L); A !== n;) A++, J.as(p._rows.get(A))
} else J.ss(O)
} else ct.superClass._33o.call(N, Y, O)
}, handle_keydown: function (C) {
if (Wk(C) || _i(C)) {
var j = this.list,
u = j._rows,
_ = j.isCheckMode(),
S = j.sm(),
Y = _ ? j.getFocusData() : S.ld();
Y ? Y.hasChildren() && (Wk(C) ? j.collapse(Y) : j.expand(Y)) : u.size() > 0 && (Y = u.get(0), _ ? j.setFocusData(Y) : S.ss(Y))
} else ct.superClass.handle_keydown.call(this, C)
}
});
var dt = Vs.TableView = function (D) {
this._98I(), this._5o(D), new et(this)
};
Ws("TableView", o, {
ms_ac: [fe, Uo, Vm, "sortMode", Me, Zh, Jj, Yc, Ln, jh, Gr, "sortColumn", go, dj, df, gd, Ji, Pi, op],
ms_v: 1,
ms_fire: 1,
ms_sm: 1,
_49o: 1,
ms_txy: 1,
ms_lp: 1,
ms_vs: 1,
ms_hs: 1,
_15Q: 1,
ms_dm: 1,
ms_tip: 1,
_50o: 1,
_45o: 1,
_47o: 1,
_sortMode: qh,
_editable: !0,
_batchEditable: !1,
_rowHeight: Oi,
_rowLineVisible: u.tableViewRowLineVisible,
_rowLineColor: u.tableViewRowLineColor,
_columnLineVisible: u.tableViewColumnLineVisible,
_columnLineColor: u.tableViewColumnLineColor,
_scrollBarColor: Ch,
_scrollBarSize: di,
_autoHideScrollBar: jr,
_autoMakeVisible: be,
_selectBackground: u.tableViewSelectBackground,
_labelColor: u.tableViewLabelColor,
_labelSelectColor: u.tableViewLabelSelectColor,
_labelFont: u.tableViewLabelFont,
getCheckColumn: function () {
var s = this;
if (!s._31o) {
var U = s._31o = new Ys;
U.setEditable(!0), U.setWidth(40), U.getValue = s.getCheckColumValue, U.drawCell = s.drawCheckColumnCell
}
return s._31o
}, isCheckMode: function () {
return this._39o.contains(this._31o)
}, setCheckMode: function (i) {
var D = this,
b = D._39o,
V = D.getCheckColumn();
i !== D.isCheckMode() && (i ? b.add(V, 0) : b.remove(V), D.fp(wi, !i, i))
}, getCheckColumValue: function (b, W, I) {
return I.isSelected(b)
}, drawCheckColumnCell: function (d, M, C, W, w, e, J, r, y) {
Ii(d, y.getCheckIcon(M), w + J / 2, e + r / 2, M, y)
}
});
var et = function (c) {
fi(et, this, [c])
};
yc(et, bt, {
_34o: function (c, d) {
var g = this.list,
J = g._31o;
if (g.isCellEditable(d, J, c)) {
var G = g._3Q(J),
E = g.lp(c).x;
if (G && E >= G.startX && E < G.startX + J.getWidth()) return g.checkData(d), void 0
}
g._37O(d, c), g.setFocusData(d)
}, _33o: function (v, L) {
this.list._37O(L, v), et.superClass._33o.apply(this, arguments)
}
});
var ft = Vs.TreeTableView = function (z) {
var U = this,
N = U._4o = new Ys;
U._35o(), U._98I(), U._5o(z), N.setDisplayName("Name"), N.setEditable(!0), N.setWidth(180), N.drawCell = gt, N.getValue = ht, U._39o.add(N), new it(U)
},
gt = function (h, r, J, n, a, B, D, G, p) {
p.drawTree(h, r, J, a, B, D, G)
},
ht = function (C, n, d) {
return d.getLabel(C)
};
Ws("TreeTableView", o, {
ms_ac: [fe, Uo, Vm, "sortMode", Me, Zh, Vb, wi, "rootData", "rootVisible", go, dj, "sortColumn", Zi, xj, df, gd, Ji, Pi, Ln, Jj, Yc, jh, Gr, op, "loader"],
ms_v: 1,
ms_bnb: 1,
ms_fire: 1,
ms_sm: 1,
_49o: 1,
ms_txy: 1,
ms_lp: 1,
ms_vs: 1,
ms_hs: 1,
_15Q: 1,
ms_dm: 1,
ms_tip: 1,
_50o: 1,
_48o: 1,
_14Q: 1,
_45o: 1,
_47o: 1,
_sortMode: qh,
_checkMode: F,
_editable: !0,
_batchEditable: !1,
_indent: kc,
_rowHeight: Oi,
_rowLineVisible: u.treeTableViewRowLineVisible,
_rowLineColor: u.treeTableViewRowLineColor,
_columnLineVisible: u.treeTableViewColumnLineVisible,
_columnLineColor: u.treeTableViewColumnLineColor,
_expandIcon: u.treeTableViewExpandIcon,
_collapseIcon: u.treeTableViewCollapseIcon,
_scrollBarColor: Ch,
_scrollBarSize: di,
_autoHideScrollBar: jr,
_autoMakeVisible: be,
_selectBackground: u.treeTableViewSelectBackground,
_labelColor: u.treeTableViewLabelColor,
_labelSelectColor: u.treeTableViewLabelSelectColor,
_labelFont: u.treeTableViewLabelFont,
getTreeColumn: function () {
return this._4o
}
});
var it = function (E) {
fi(it, this, [E])
};
yc(it, bt, {
_34o: function (g, u) {
var M = this.list,
h = M._4o,
e = M._3Q(h),
n = M.lp(g).x;
if (e) {
var H = M._indent,
d = e.startX + H * M.getLevel(u);
if (ii(M.getToggleIcon(u)) && n >= d && d + H >= n) return M.toggle(u), void 0;
if (M.isCellEditable(u, h) && (d += H, n >= d && d + H >= n)) return M.checkData(u), void 0
}
M._37O(u, g), M.setFocusData(u)
}, _33o: function (O, N) {
var j = this.list,
J = j.lp(O).x;
if (ii(j.getToggleIcon(N))) {
var f = j._3Q(j._4o);
if (f) {
var W = j._indent,
Z = f.startX + W * j.getLevel(N);
if (J >= Z && Z + W >= J) return j.toggle(N), void 0
}
}
j._37O(N, O), it.superClass._33o.apply(this, arguments)
}
});
var jt = Vs.TableHeader = function (l) {
var v = this,
P = v._view = ve(1, v),
s = v._39o = l.getColumnModel(),
k = v.iv;
v.tv = v._tableView = l, v._60I = new xr, v._canvas = uo(P), P.style.background = u.tableHeaderBackground || "", P.style.height = um + oe, s.mm(k, v), s.md(k, v), s.mh(k, v), l.mp(function (o) {
Ms[o.property] && v.iv()
}, v), new kt(v), v.iv()
};
Ws("TableHeader", o, {
ms_v: 1,
ms_lp: 1,
ms_fire: 1,
ms_ac: ["checkIcon", "sortDescIcon", "sortAscIcon", fe, Vm, Vb, "moveBackground", "insertColor", jh, Gr, "resizable", "movable"],
_checkIcon: He,
_movable: !0,
_resizable: !0,
_labelColor: u.tableHeaderLabelColor,
_labelFont: u.tableHeaderLabelFont,
_columnLineColor: u.tableHeaderColumnLineColor,
_columnLineVisible: u.tableHeaderColumnLineVisible,
_sortDescIcon: u.tableHeaderSortDescIcon,
_sortAscIcon: u.tableHeaderSortAscIcon,
_moveBackground: u.tableHeaderMoveBackground,
_insertColor: u.tableHeaderInsertColor,
_indent: kc,
getCheckIcon: function () {
return this._checkIcon
}, getTableView: function () {
return this.tv
}, getLabel: function (X) {
return X.toLabel()
}, getLabelFont: function () {
return this._labelFont
}, getLabelColor: function (r) {
return r.getColor() || this._labelColor
}, getLabelAlign: function (F) {
return F._align
}, onPropertyChanged: function () {
this.iv()
}, _5Q: function (V) {
this._61I = V, this.iv()
}, getLogicalPoint: function (r) {
return Nm(r, this._canvas, this.tv.tx())
}, validateImpl: function () {
var I = this,
V = I._canvas,
E = I.getWidth(),
i = I.getHeight(),
z = I.tv,
K = I._60I,
C = I._61I,
l = -z.tx(),
d = 0;
(E !== V.clientWidth || i !== V.clientHeight) && Bn(V, E, i), K.clear(), I._39o._roots.each(function (f) {
if (f.isVisible()) {
var I = d + f.getWidth();
l + E >= d && I >= l && K.add({
column: f,
startX: d
}), d = I
}
});
var p = Wd(V);
if (tf(p, -l, 0, 1), p.beginPath(), p.rect(l, 0, E, i), p.clip(), p.clearRect(l, 0, E, i), K.each(function (c) {
var F = c.column,
S = c.startX,
_ = F.getWidth();
_ > 0 && (p.save(), p.beginPath(), p.rect(S, 0, _, i), p.clip(), C && C.column === F || I.drawColumn(p, F, S, 0, _, i), I._columnLineVisible && fl(p, S + _ - 1, 0, 1, i, I._columnLineColor), p.restore())
}), C) {
var L = C.column,
d = C.startX,
G = C.position,
k = L.getWidth();
p.save(), p.beginPath(), p.rect(d, 0, k, i), p.clip(), p.fillStyle = I._moveBackground, p.fill(), I.drawColumn(p, L, d, 0, k, i), p.restore(), cs(p, I._insertColor, G, 0, i)
}
p.restore()
}, _6Q: function ($) {
var m = this.tv;
return m._31o === $ && m.sm().getSelectionMode() === tb
}, drawColumn: function (n, C, S, L, c, y) {
var E = this,
h = E.tv,
H = ii(C.getIcon()),
W = E.getLabelAlign(C);
if (E._6Q(C)) {
var R = ii(E._checkIcon);
Ii(n, R, S + c / 2, L + y / 2, C, E)
} else {
var D = E.getLabel(C),
a = E.getLabelFont(C),
Q = E.getLabelColor(C),
N = ln(a, D).width,
k = H ? E._indent : 0;
W === nq ? (H && qk(n, H, Mg, S, L, k, y), nd(n, D, a, Q, S + k, L, c, y, nq)) : W === fm ? (H && qk(n, H, Mg, S + c - N - k, L, k, y), nd(n, D, a, Q, S, L, c, y, fm)) : (H && qk(n, H, Mg, S + (c - N - k) / 2, L, k, y), nd(n, D, a, Q, S + (c - N + k) / 2, L, 0, y, nq))
} if (C.isSortable() && h.getSortColumn() === C && (H = ii(C.getSortOrder() === Sh ? E._sortAscIcon : E._sortDescIcon))) {
var g = xc(H, C) / 2 + 2;
Ii(n, H, W === fm ? S + g : S + c - g, L + y / 2, C, h)
}
}
});
var kt = function (J) {
var O = this;
O.th = J, O.tv = J._tableView, O.addListeners()
};
yc(kt, o, {
ms_listener: 1,
getView: function () {
return this.th.getView()
}, setCursor: function (O) {
this.getView().style.cursor = O
}, handle_mousemove: function (J) {
if (!si) {
var $ = this;
delete $._29o, $.setCursor(lp);
for (var m = $.th, v = m._60I, F = m.lp(J).x, f = v.size() - 1; f >= 0; f--) {
var l = v.get(f),
W = l.column,
E = l.startX + W.getWidth();
if (m.isResizable() && X(E - F) <= (nf ? 10 : 3)) return $._29o = l, $.setCursor(Nc), void 0;
F > l.startX && E > F && ($._29o = l), (W.isClickable() || W.isSortable() || m.isMovable() || $.tv.getCheckColumn && W === $.tv.getCheckColumn()) && F > l.startX && E > F && $.setCursor(Zk)
}
}
}, handle_mousedown: function (P) {
this.handle_touchstart(P)
}, handle_touchstart: function (d) {
var E = this;
Qc(d), E.tv.endEditing(), E.handle_mousemove(d), E._29o && (E.x = lb(d).x, E.lx = E.th.lp(d).x, E.w = E._29o.column.getWidth(), Ui(E, d))
}, handleWindowMouseMove: function (o) {
this.handleWindowTouchMove(o)
}, handleWindowTouchMove: function (P) {
var B = this,
t = B.th,
b = B.getView().style.cursor,
o = B._29o,
F = lb(P).x - B.x;
if (B.resizing || B.moving || (b === Nc ? B.resizing = 1 : t.isMovable() && b === Zk && X(F) > 2 && (B.moving = 1)), B.resizing) o.column.setWidth(B.w + F);
else if (B.moving) {
var $ = B.lx + F;
t._60I.each(function (E) {
var S = E.startX,
q = S + E.column.getWidth();
if ($ >= S && q >= $) {
var h = {
column: o.column,
startX: o.startX + F,
front: q - $ > $ - S,
insertColumn: E.column
};
h.position = h.front ? S : q, t._5Q(h)
}
})
}
}, _16Q: function (F, o) {
var S = this,
N = S.tv,
b = S.th,
B = b._checkIcon;
if (b._6Q(F)) {
var g = ii(B),
Z = S.lx,
G = F.getWidth(),
i = xc(g, F);
if (Z >= o + G / 2 - i && o + G / 2 + i >= Z) {
b.setCheckIcon(B === tm ? He : tm);
var y = N.sm(),
U = N._rows;
return B === tm ? y.rs(U) : y.ss(U), N.onCheckColumnClicked(F), !0
}
}
return !1
}, handleWindowMouseUp: function (T) {
this.handleWindowTouchEnd(T)
}, handleWindowTouchEnd: function (Z) {
var L = this,
P = L.tv,
g = L.th,
u = L._29o;
if (L.moving) {
var W = g._61I;
if (W && W.insertColumn !== W.column) {
var $ = W.column,
q = P.getColumnModel()._roots,
I = q.remove($),
_ = q.indexOf(W.insertColumn);
_ >= 0 && (W.front || _++, _ <= q.size() && (q.add($, _), P.getColumnModel()._38I($, I, _)))
}
g._5Q(F), delete L.moving
} else if (!L.resizing && u) {
$ = u.column;
var R = g.lp(Z).x,
J = u.startX,
N = !0;
if (g.onColumnClicked) {
var v = g.onColumnClicked($, Z, J);
v === !1 && (N = !1)
}
if (N && R >= J && R <= J + $.getWidth() && !L._16Q($, J)) {
if ($.isSortable()) {
var m = P.getSortMode(),
e = $.getSortOrder();
m === qh ? P.getSortColumn() === $ ? (e === rj && P.setSortColumn(F), $.setSortOrder(e === Sh ? rj : Sh)) : P.setSortColumn($) : "bistate" === m && (P.getSortColumn() === $ ? $.setSortOrder(e === Sh ? rj : Sh) : P.setSortColumn($))
}
P.onColumnClicked($, Z, J)
}
}
L._29o = L.resizing = L.x = L.lx = L.w = F
}
}), Vs.TablePane = function (C) {
this.init(new dt(C))
}, Ws("TablePane", o, {
ms_v: 1,
_44o: 1
}), Vs.TreeTablePane = function (Z) {
this.init(new ft(Z))
}, Ws("TreeTablePane", o, {
ms_v: 1,
_44o: 1
}), Vs.Toolbar = function (O) {
var p = this,
B = p._view = ve(1, p),
r = B.style;
r.background = u.toolbarBackground || "", r.height = Jk + oe, p._canvas = uo(B), p._30o = new xr, p._90I = new xr, p.setItems(O || []), B.handleGroupSelectedChanged = function (O) {
if (O.isSelected()) {
var m = O.getGroupId();
null != m && p._items.forEach(function (H) {
var F = H.element;
F && F !== O && F.setSelected && F.getGroupId && F.getGroupId() === m && F.setSelected(!1)
})
}
}, new lt(p)
}, Ws("Toolbar", o, {
ms_v: 1,
ms_fire: 1,
ms_tx: 1,
ms_lp: 1,
ms_tip: 1,
ms_value: 1,
ms_ac: [Uj, fe, Vm, Uo, op, "itemGap", "separatorColor", "currentItem", "stickToRight"],
_labelColor: u.toolbarLabelColor,
_labelSelectColor: u.toolbarLabelSelectColor,
_labelFont: u.toolbarLabelFont,
_selectBackground: u.toolbarSelectBackground,
_itemGap: u.toolbarItemGap,
_separatorColor: u.toolbarSeparatorColor,
_stickToRight: !1,
getSumWidth: function () {
return this._64I
}, getToolTip: function (u) {
var X = this.getItemInfoAt(u);
return X ? X.item.toolTip : F
}, getLabelColor: function (m) {
return m && m.selected && m.type !== tm && m.type !== Hp ? this._labelSelectColor : this._labelColor
}, onPropertyChanged: function (w) {
this.iv(), w.property === Uj && this._items.forEach(function (z) {
bh(z)
})
}, redraw: function () {
this.iv()
}, addItem: function (Q, d) {
var N = this._items;
d == F ? N.push(Q) : N.splice(d, 0, Q), this.fp(Uj, F, N)
}, removeItem: function (G) {
if (G)
for (var d = this._items, c = 0; c < d.length; c++) G === d[c] && (d.splice(c, 1), this.fp(Uj, F, d))
}, removeItemById: function (b) {
if (b != F)
for (var K = this._items, q = 0; q < K.length; q++)
if (b === K[q].id) {
var _ = K.splice(q, 1)[0];
return this.fp(Uj, F, K), _
}
}, getItemById: function (x) {
if (x != F)
for (var y = this._items, d = 0; d < y.length; d++) {
var H = y[d];
if (x === H.id) return H
}
}, setItemVisible: function (y, f) {
var z = this.getItemById(y);
z && (z.visible = f)
}, getItemInfos: function () {
return this._30o
}, getItemInfoAt: function (p) {
var R = this,
e = 0,
Y = R._30o,
L = R.lp(p),
r = L.x,
Q = L.y;
if (Q >= 0 && Q <= R.getHeight())
for (; e < Y.size(); e++) {
var Z = Y.get(e);
if (Z.startX <= r && r <= Z.endX) return Z
}
return F
}, drawItem: function ($, K, x, G, s) {
if (K.visible === !1) return 0;
if (Mf(K.visible) && !K.visible()) return 0;
var q = this,
n = K.disabled;
n && ($.globalAlpha = Nn);
var v = q.drawItemImpl($, K, x, G, s),
o = q._itemGap;
return n && ($.globalAlpha = 1), this._currentItem !== K || "separator" === K || K.separator === !0 || K.unfocusable || Ie($, q._separatorColor, x - o / 2, 0, v + o, G), v
}, drawItemImpl: function (m, B, g, r, R) {
var J = this,
A = J._view,
C = J._itemGap,
_ = r / 2,
M = B.type,
p = B.element,
f = B.label;
dk(p) && (f = p, p = F);
var x, I = J.getLabelFont(B),
v = J.getLabelColor(B),
X = B.selected,
H = ii(B.icon),
E = xc(H, B),
z = 0,
j = E + (f ? ln(I, f).width : 0);
if ("separator" === B || B.separator === !0) return cs(m, J._separatorColor, g, r / 4, _), 1;
if (p) {
H && Ii(m, H, g + E / 2, _, B, J), nd(m, f, I, v, g + E, 0, 0, r);
var Q = Bq(p);
R || J._90I.add(Q), Q.parentNode !== A && sn(A, Q), p.iv && p.iv(), p.validate && p.validate();
var l = Q.getBoundingClientRect(),
t = l.width,
S = Q.style;
return uj(Q), S.left = J.tx() + g + j + oe, S.top = (r - l.height) / 2 + oe, j + t
}
return M === Hp ? x = ii(X ? kj : yb) : M === tm && (x = ii(X ? tm : He)), x ? (z = xc(x, B), Ii(m, x, g + z / 2, _, B, J), g += z, j += z) : X && fl(m, g - C / 2, 0, j + C, r, J.getSelectBackground(B)), H && Ii(m, H, g + E / 2, _, B, J), nd(m, f, I, v, g + E, 0, 0, r), j
}, validateImpl: function () {
var O = this,
Y = O._canvas,
f = O.getWidth(),
B = O.getHeight(),
b = O._30o,
S = O._items;
Bn(Y, f, B);
var M = Wd(Y),
J = O._itemGap,
N = J / 2;
tf(M, O.tx(), 0, 1), M.clearRect(0, 0, f, B);
var T = O._90I;
O._90I = new xr, b.clear(), S.forEach(function (L) {
var G = O.drawItem(M, L, N, B);
b.add({
item: L,
startX: N,
endX: N + G,
width: G
}), G && (N += G + J)
}), T.each(function (N) {
O._90I.contains(N) || yj(N)
});
var p = O._64I;
O._64I = q(0, N), M.restore(), O._stickToRight ? (O._65O = 0, M = Wd(Y), N = f - O._64I + J, tf(M, 0, 0, 1), M.clearRect(0, 0, f, B), b.clear(), S.forEach(function (I) {
var d = O.drawItem(M, I, N, B, !0);
b.add({
item: I,
startX: N,
endX: N + d,
width: d
}), d && (N += d + J)
}), M.restore()) : O.tx(O.tx()), p !== O._64I && O.onSumWidthChanged(p, O._64I)
}, onSumWidthChanged: function () { }, handleClick: function (i, S) {
var m = this,
l = i.type,
K = i.action,
V = i.groupId,
f = i.selected;
i.disabled || (V != F ? f || (i.selected = !0, this._items.forEach(function (a) {
a.groupId === V && i !== a && (a.selected = !1)
}), K && i.action(i, m, S)) : l === tm || "toggle" === l ? (i.selected = !f, K && i.action(i, m, S)) : K && i.action(i, m, S)), Um(), m.iv()
}
});
var lt = function (o) {
this.tb = o, this.addListeners()
};
yc(lt, o, {
ms_listener: 1,
getView: function () {
return this.tb._view
}, handle_mousewheel: function (a) {
this.handleScroll(a, 10 * (a.wheelDelta / 40))
}, handle_DOMMouseScroll: function (z) {
this.handleScroll(z, 10 * -z.detail)
}, handleScroll: function (L, U) {
Qc(L);
var W = this.tb;
W.isScrollable() && !W._stickToRight && (W.tx(W.tx() + U), ek())
}, handle_mousemove: function (h) {
var s = this;
si || s.setItem(h)
}, handle_mouseout: function (V) {
var J = this;
V.target === J.getView() ? J.tb.setCurrentItem(F) : J.handle_mousemove(V)
}, handle_mousedown: function (q) {
this.handle_mousemove(q), this.handle_touchstart(q)
}, handle_touchstart: function (b) {
var X = this,
g = X.tb,
c = b.target;
jj(b) && (c === X.getView() || c === g._canvas) && (Qc(b), g.setFocus(b) && (this.setItem(b, !0), (g.isScrollable() || X.info && !X.info.item.disabled) && (X.x = lb(b).x, X.tx = g.tx(), Ui(X, b))))
}, handleWindowMouseMove: function (A) {
this.handleWindowTouchMove(A)
}, handleWindowTouchMove: function (l) {
var q = this,
W = q.tb;
if (!W._stickToRight) {
var h = lb(l).x - q.x;
!q._25o && X(h) > 2 && W.isScrollable() && (q._25o = 1), q._25o && W.tx(q.tx + h)
}
}, handleWindowMouseUp: function (h) {
this.handleWindowTouchEnd(h)
}, handleWindowTouchEnd: function (v) {
var j = this,
c = j.tb,
P = j.info,
k = j.tb.getItemInfoAt(v);
if (!j._25o && P) {
var W = P.item;
k && k.item === W && c.handleClick(W, v)
}
j._25o = j.x = j.tx = F, j.setItem()
}, setItem: function (i, $) {
var G = this,
Q = G.tb,
u = G.info = i ? Q.getItemInfoAt(i) : F,
V = u ? u.item : F;
Q.setCurrentItem(V), $ && V && Mf(V.onDown) && V.onDown(i)
}
}), Vs.BorderPane = function () {
this._view = ve(1, this), this.iv()
}, Ws("BorderPane", o, {
ms_v: 1,
ms_ac: ["topHeight", "bottomHeight", "leftWidth", "rightWidth"],
ms_fire: 1,
getLeftView: function () {
return this._leftView
}, setLeftView: function (O, B) {
this._12o("leftView", O), B != F && this.setLeftWidth(B)
}, getRightView: function () {
return this._rightView
}, setRightView: function (J, w) {
this._12o("rightView", J), w != F && this.setRightWidth(w)
}, getTopView: function () {
return this._topView
}, setTopView: function (M, S) {
this._12o("topView", M), S != F && this.setTopHeight(S)
}, getBottomView: function () {
return this._bottomView
}, setBottomView: function (Q, R) {
this._12o("bottomView", Q), R != F && this.setBottomHeight(R)
}, getCenterView: function () {
return this._centerView
}, setCenterView: function (j) {
this._12o("centerView", j)
}, _12o: function (k, T) {
var f = this,
g = "_" + k,
Q = f._view,
X = f[g];
X !== T && (X && (X.getView ? yj(X.getView()) : yj(X)), f[g] = T, T && (T.getView ? sn(Q, T.getView(), 1) : sn(Q, T, 1)), f.fp(k, X, T))
}, onPropertyChanged: function () {
this.iv()
}, validateImpl: function () {
var u = this,
m = u._topView,
W = u._bottomView,
f = u._leftView,
t = u._rightView,
E = u._centerView,
r = u.getWidth(),
T = u.getHeight(),
z = 0,
e = 0,
n = r,
P = T,
A = 0,
I = 0,
h = 0,
L = 0;
m && (A = u._topHeight == F ? zp(m) : u._topHeight, e = A), W && (I = u._bottomHeight == F ? zp(W) : u._bottomHeight, P = T - I), f && (h = u._leftWidth == F ? oh(f) : u._leftWidth, z = h), t && (L = u._rightWidth == F ? oh(t) : u._rightWidth, n = r - L);
var l = q(0, n - z),
k = q(0, P - e);
m && qp(m, 0, 0, r, A), W && qp(W, 0, P, r, I), f && qp(f, 0, e, h, k), t && qp(t, n, e, L, k), E && qp(E, z, e, l, k)
}
})
}
}("undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : (0, eval)("this"), Object);