Created
September 21, 2018 12:08
-
-
Save pmaoui/fc736f1ad28c35fa5e5deeee13e49163 to your computer and use it in GitHub Desktop.
Go JS Mapping chart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const $ = go.GraphObject.make; // for conciseness in defining templates | |
myDiagram = $(go.Diagram, 'myDiagramDiv', // must name or refer to the DIV HTML element | |
{ | |
initialContentAlignment: go.Spot.Center, | |
layout: $(go.ForceDirectedLayout), | |
allowDelete: false, | |
allowCopy: false, | |
} | |
); | |
// define several shared Brushes | |
const bluegrad = $(go.Brush, 'Linear', { 0: 'rgb(150, 150, 250)', 0.5: 'rgb(86, 86, 186)', 1: 'rgb(86, 86, 186)' }); | |
const greengrad = $(go.Brush, 'Linear', { 0: 'rgb(158, 209, 159)', 1: 'rgb(67, 101, 56)' }); | |
const redgrad = $(go.Brush, 'Linear', { 0: 'rgb(206, 106, 100)', 1: 'rgb(180, 56, 50)' }); | |
const yellowgrad = $(go.Brush, 'Linear', { 0: 'rgb(254, 221, 50)', 1: 'rgb(254, 182, 50)' }); | |
const lightgrad = $(go.Brush, 'Linear', { 1: '#E6E6FA', 0: '#FFFAF0' }); | |
// the template for table attributes in DIAGRAM TABLE | |
const templateAttributesTable = $(go.Panel, 'Horizontal', | |
$(go.Shape, | |
{ desiredSize: new go.Size(10, 10) }, | |
new go.Binding('figure', 'figure'), | |
new go.Binding('fill', 'color')), | |
$(go.TextBlock, | |
{ stroke: '#333333', | |
font: '14px sans-serif', | |
margin: new go.Margin(2) | |
}, | |
new go.Binding('text', 'name')) | |
); | |
// NODE TEMPLATE, soit le carré au complet qui est composé de Panel | |
const csDbTableTemplate = $(go.Node, 'Auto', | |
$(go.Shape, 'Rectangle', { fill: lightgrad, stroke: '#756875', strokeWidth: 1 }), // ce carré a un contour | |
$(go.Panel, 'Table', { // et une table qui a un nombre d'arg specifique | |
margin: 8, | |
stretch: go.GraphObject.Fill | |
}, | |
$(go.RowColumnDefinition, { // disposer le contenu en ligne | |
row: 0, | |
sizing: go.RowColumnDefinition.None | |
}), | |
// contient un textblock bindé sur l'attribut clé | |
$(go.TextBlock, { | |
row: 0, | |
alignment: go.Spot.Center, | |
margin: new go.Margin(0, 14, 0, 2), | |
font: 'bold 16px sans-serif' | |
}, new go.Binding('text', 'key')), | |
// mais contient aussi ce bouton pour toggle le contenu identifié par le nom 'LIST' | |
$('PanelExpanderButton', 'LIST', { row: 0, alignment: go.Spot.TopRight }), | |
// viens la liste en disposition vertical | |
$(go.Panel, 'Vertical', | |
{ | |
name: 'LIST', | |
row: 1, // chaque element fait 1 ligne | |
padding: 3, | |
alignment: go.Spot.TopLeft, | |
defaultAlignment: go.Spot.Left, | |
stretch: go.GraphObject.Horizontal, | |
itemTemplate: templateAttributesTable // et une element de la list contient une figure et une couleur dans ce Panel | |
}, new go.Binding('itemArray', 'items')) | |
) | |
); | |
const csActionTemplate = $(go.Node, 'Auto', | |
$(go.Shape, 'RoundedRectangle', { fill: 'rgba(255,255,255,1)', parameter1: 14 }), | |
$(go.Panel, 'Table', { // et une table qui a un nombre d'arg specifique | |
margin: 8, | |
stretch: go.GraphObject.Fill | |
}, | |
$(go.RowColumnDefinition, { // disposer le contenu en ligne | |
row: 0, | |
sizing: go.RowColumnDefinition.None | |
}), | |
$(go.TextBlock, { row: 0, font: 'bold 16px sans-serif' }, new go.Binding('text', 'key')), | |
$(go.TextBlock, { row: 1, font: '14px sans-serif', margin: new go.Margin(3, 2, 0, 2) }, new go.Binding('text', 'csRoute')), | |
$(go.TextBlock, { row: 2, font: 'italic 12px sans-serif', margin: new go.Margin(2, 2, 0, 2) }, new go.Binding('text', 'csCodeLocation')), | |
$(go.TextBlock, { row: 4, width: 200, wrap: go.TextBlock.WrapDesiredSize, font: '14px sans-serif', margin: new go.Margin(10, 2, 0, 2)}, new go.Binding('text', 'csDetails')), | |
) | |
); | |
const mainGroupTemplate = $(go.Group, 'Auto', | |
$(go.Shape, 'Rectangle', { fill: 'rgba(255,0,0,0.10)' }), | |
$(go.TextBlock, { alignment: go.Spot.TopLeft, margin: 10, font: 'Bold 16px Sans-Serif' }, new go.Binding('text', 'key')), | |
$(go.TextBlock, { alignment: go.Spot.TopRight, margin: 10, font: 'Italic 14px Sans-Serif' }, new go.Binding('text', 'csCodeLocation')), | |
$(go.TextBlock, { font: 'Italic 14px Sans-Serif', margin: new go.Margin(15, 0, 0, 0), alignment: go.Spot.TopCenter }, | |
new go.Binding('visible', '', v => v.data.csDetails ? true:false).ofObject(), | |
new go.Binding('text', 'csDetails'), | |
), | |
$(go.Placeholder, { margin: new go.Margin(40,20,20,20) }), | |
); | |
myDiagram.groupTemplate = mainGroupTemplate; | |
const csObjectTemplate = $(go.Node, 'Auto', { locationSpot: go.Spot.Center }, | |
$(go.Shape, 'RoundedRectangle', { fill: 'rgba(128,128,128,0.33)' }), | |
$(go.TextBlock, { alignment: go.Spot.TopCenter, margin: 10 }, new go.Binding('text', 'key')) | |
); | |
const csSQSTemplate = $(go.Node, 'Auto', { locationSpot: go.Spot.Center }, | |
$(go.Shape, 'Ellipse', { fill: 'rgb(255,0,0,0.33)' }), | |
$(go.TextBlock, { alignment: go.Spot.TopCenter, margin: 10 }, new go.Binding('text', 'key')) | |
); | |
const temp1map = new go.Map('string', go.Node); | |
temp1map.add('cs-object', csObjectTemplate); | |
temp1map.add('cs-dbtable', csDbTableTemplate); | |
temp1map.add('cs-action', csActionTemplate); | |
temp1map.add('cs-sqs', csSQSTemplate); | |
myDiagram.nodeTemplateMap = temp1map; | |
// LINK TEMPLATE | |
const linkInsertTable = $(go.Link, | |
{ routing: go.Link.AvoidsNodes }, | |
$(go.Shape), | |
$(go.Shape, { toArrow: 'Standard' }), | |
$(go.TextBlock, new go.Binding('text', 'op'), { segmentOffset: new go.Point(10,0)}), | |
); | |
const sqsLink = $(go.Link, | |
{ routing: go.Link.AvoidsNodes }, | |
$(go.Shape), | |
$(go.Shape, { toArrow: 'Standard' }), | |
$(go.TextBlock, new go.Binding('text', 'queueName'), { segmentOffset: new go.Point(10,0)}), | |
) | |
const linkMap = new go.Map('string', go.Link); | |
linkMap.add('insert-table', linkInsertTable); | |
linkMap.add('sqs', sqsLink); | |
linkMap.add('', $(go.Link, $(go.Shape))); | |
myDiagram.linkTemplateMap = linkMap; | |
const linkDataArray = [ | |
{ from: 'Create mapping', to: 'mapping', category: 'insert-table', op: 'insert' }, | |
{ from: 'Create mapping', to: 'SQS', category: 'sqs', queueName: 'mapping:id:create' }, | |
]; | |
// create the model for the E-R diagram | |
myDiagram.model = new go.GraphLinksModel([ | |
{ | |
key: 'mapping', | |
category: 'cs-dbtable', | |
items: [ | |
{ name: 'ProductID', iskey: true, figure: 'Decision', color: yellowgrad }, | |
{ name: 'ProductName', iskey: false, figure: 'Cube1', color: bluegrad }, | |
{ name: 'SupplierID', iskey: false, figure: 'Decision', color: 'purple' }, | |
{ name: 'CategoryID', iskey: false, figure: 'Decision', color: 'purple' } | |
] | |
}, | |
{ key: 'Mapping', csDetails: 'I want to say something smart here', csCodeLocation: 'ProjectConfigurationBundle', category: 'cs-object', isGroup: true }, | |
{ key: 'Create mapping', category: 'cs-action', group: 'Mapping', csRoute: 'POST /api/projects/id/mappings', csCodeLocation: 'MappingController.php:159', csDetails: 'Mettre du texte libre, long et libre. Si je veux en mettre d\'avantage, rien ne doit s\'y opposer, veiller à cela de manière permanente.' }, | |
{ key: 'List mappings', category: 'cs-action', group: 'Mapping', csRoute: 'GET /api/projects/id/mappings', csCodeLocation: 'MappingController.php:40' }, | |
{ key: 'Update mapping', category: 'cs-action', group: 'Mapping', csRoute: 'PUT /api/projects/id/mappings/id', csCodeLocation: 'MappingController.php:232' }, | |
{ key: 'Delete mapping', category: 'cs-action', group: 'Mapping', csRoute: 'DELETE /api/projects/id/mappings/id', csCodeLocation: 'MappingController.php:268' }, | |
{ key: 'Duplicate mapping', category: 'cs-action', group: 'Mapping', csRoute: 'POST /api/projects/id/mappings/id/copy', csCodeLocation: 'MappingController.php:192' }, | |
{ key: 'Page', category: 'cs-object', group: 'Mapping', isGroup: true }, | |
{ key: 'Create page', category: 'cs-action', group: 'Page', csRoute: 'POST /api/project/blabla' }, | |
{ key: 'SQS', category: 'cs-sqs' }, | |
], linkDataArray); |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* GoJS v1.8.16 JavaScript Library for HTML Diagrams | |
* Northwoods Software, https://www.nwoods.com/ | |
* GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation. | |
* Copyright (C) 1998-2017 by Northwoods Software Corporation. All Rights Reserved. | |
* THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/1.8.16/doc/license.html. | |
*/ | |
(function(window) { | |
var f, ca = {}; | |
if (!window.document || void 0 === window.document.createElement("canvas").getContext) throw window.console && window.console.log("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode."), Error("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode."); | |
if (!Object.defineProperty) throw Error("GoJS requires a newer version of JavaScript"); | |
Function.prototype.bind || (Function.prototype.bind = function(a) { | |
function b() { | |
return g.apply(a, e.concat(d.call(arguments))) | |
} | |
function c() {} | |
var d = Array.prototype.slice, | |
e = d.call(arguments, 1), | |
g = this; | |
c.prototype = this.prototype; | |
b.prototype = new c; | |
return b | |
}); | |
(function() { | |
for (var a = 0, b = ["ms", "moz", "webkit", "o"], c = 0; c < b.length && !window.requestAnimationFrame; ++c) window.requestAnimationFrame = window[b[c] + "RequestAnimationFrame"], window.cancelAnimationFrame = window[b[c] + "CancelAnimationFrame"] || window[b[c] + "CancelRequestAnimationFrame"]; | |
window.requestAnimationFrame || (window.requestAnimationFrame = function(b) { | |
var c = (new Date).getTime(), | |
g = Math.max(8, 16 - (c - a)), | |
h = window.setTimeout(function() { | |
b(c + g) | |
}, g); | |
a = c + g; | |
return h | |
}); | |
window.cancelAnimationFrame || (window.cancelAnimationFrame = | |
function(a) { | |
window.clearTimeout(a) | |
}) | |
})(); | |
var v = { | |
Dj: !1, | |
UA: !1, | |
yF: !1, | |
HI: !1, | |
kM: !1, | |
YF: !1, | |
lu: null, | |
enableBoundsInfo: function(a) { | |
v.Dj = !0; | |
a && a.to() | |
}, | |
disableBoundsInfo: function(a) { | |
v.Dj = !1; | |
a && (a.dd.De(!0), a.to()) | |
}, | |
vF: function(a, b) { | |
void 0 === a && (a = v.lu); | |
void 0 === b && (b = a.qm("").rb); | |
var c = b.length, | |
d = a.dd; | |
d.fillStyle = "rgba(255,255,0,.3)"; | |
for (var e = 0; e < c; e++) { | |
var g = b.fa(e), | |
h = g.aa; | |
if (g instanceof x) v.vF(a, g.xa); | |
else { | |
var k = g.Ni.copy(); | |
k.FB(g.Nc); | |
d.save(); | |
d.transform(k.m11, k.m12, k.m21, k.m22, k.dx, k.dy); | |
d.fillRect(h.x, h.y, h.width, h.height); | |
d.restore() | |
} | |
} | |
}, | |
wF: function(a, | |
b) { | |
a || (a = v.lu); | |
b || (b = a.qm("").rb); | |
var c = a.dd, | |
d = b.length; | |
c.fillStyle = "rgba(0,0,255,.3)"; | |
for (var e = 0; e < d; e++) { | |
var g = b.fa(e), | |
h = g.Ga, | |
k = g.Ni; | |
g instanceof x ? v.wF(a, g.xa) : (c.save(), c.transform(k.m11, k.m12, k.m21, k.m22, k.dx, k.dy), c.fillRect(h.x, h.y, h.width, h.height), c.restore()) | |
} | |
}, | |
CI: function(a, b) { | |
a || (a = v.lu); | |
b || (b = a.qm("").rb); | |
var c = a.dd, | |
d = b.length; | |
c.fillStyle = "rgba(0,0,255,.3)"; | |
for (var e = 0; e < d; e++) { | |
var g = b.fa(e), | |
h = g.Fa, | |
k = g.Ni; | |
g instanceof x ? v.CI(a, g.xa) : (c.save(), c.transform(k.m11, k.m12, k.m21, k.m22, k.dx, | |
k.dy), c.fillRect(h.x || 0, h.y || 0, h.width, h.height), c.restore()) | |
} | |
}, | |
KL: function() { | |
v.wF(); | |
v.vF() | |
}, | |
LL: function(a) { | |
a || (a = v.lu); | |
var b = a.kd; | |
a = a.dd; | |
a.strokeStyle = "rgba(0,255,0,.9)"; | |
a.rect(b.x, b.y, b.width, b.height); | |
a.stroke() | |
}, | |
xF: function(a, b) { | |
b.fillStyle = "red"; | |
b.fillRect(0, 0, 8, 8); | |
b.lineWidth = 8; | |
b.strokeStyle = "rgba(255,255,0,.6)"; | |
var c = a.wb; | |
b.rect(c.x, c.y, c.width, c.height); | |
b.stroke(); | |
b.fillStyle = "rgba(0,255,0,.2)"; | |
b.fillRect(a.kd.x, a.kd.y, a.kd.width, a.kd.height) | |
}, | |
DI: function(a, b) { | |
b instanceof da || (a.lineWidth = | |
2, a.strokeStyle = "rgba(255,0,0,.5)", a.rect(b.cc.x, b.cc.y, b.cc.width, b.cc.height), a.stroke(), b instanceof z && (a.strokeStyle = b.stroke, a.lineWidth = b.mb), null !== b.R && b.R.type === fa && (a.lineWidth = 1, a.strokeStyle = "rgba(10,200,10,.6)", b instanceof z && (a.strokeStyle = b.stroke, a.lineWidth = b.mb))) | |
}, | |
EI: function(a, b) { | |
a.lineWidth = 1; | |
a.strokeStyle = "rgba(0,0,255,.5)"; | |
a.rect(b.Ga.x, b.Ga.y, b.Ga.width, b.Ga.height); | |
a.stroke(); | |
void 0 !== b.stroke && (a.strokeStyle = b.stroke); | |
void 0 !== b.Rg && (a.lineWidth = b.Rg) | |
}, | |
TA: function(a, b, | |
c) { | |
a.setTransform(1, 0, 0, 1, 0, 0); | |
a.scale(b.ud, b.ud); | |
a.transform(c.m11, c.m12, c.m21, c.m22, c.dx, c.dy); | |
c = b.dc.length; | |
for (var d = 0; d < c; d++) | |
for (var e = b.dc.fa(d), g = e.rb.length, h = 0; h < g; h++) { | |
var k = e.rb.fa(h); | |
if (void 0 !== k.location && null !== k.location) { | |
if (k.location.H()) { | |
var l = k.location.x, | |
m = k.location.y; | |
a.beginPath(); | |
a.strokeStyle = "limegreen"; | |
a.lineWidth = 2; | |
a.moveTo(l, m + 6); | |
a.lineTo(l, m); | |
a.lineTo(l + 6, m); | |
a.moveTo(l, m); | |
a.lineTo(l + 10, m + 20); | |
a.stroke() | |
} | |
l = k.position.x; | |
m = k.position.y; | |
a.beginPath(); | |
a.strokeStyle = "red"; | |
a.lineWidth = 2; | |
a.moveTo(l, m + 6); | |
a.lineTo(l, m); | |
a.lineTo(l + 6, m); | |
a.moveTo(l, m); | |
a.lineTo(l + 20, m + 10); | |
a.stroke() | |
} | |
} | |
a.setTransform(1, 0, 0, 1, 0, 0) | |
}, | |
ML: function(a, b, c) { | |
var d = a.length; | |
b.fillStyle = "rgba(255,0,0,.1)"; | |
for (var e = 0; e < d; e++) { | |
var g, h = a[e]; | |
g = c.Nc; | |
var k = h.x, | |
l = h.y, | |
m = k + h.width, | |
n = l + h.height, | |
p = g.m11, | |
q = g.m12, | |
r = g.m21, | |
s = g.m22, | |
u = g.dx, | |
t = g.dy, | |
y = k * p + l * r + u, | |
h = k * q + l * s + t; | |
g = m * p + l * r + u; | |
var l = m * q + l * s + t, | |
w = k * p + n * r + u, | |
k = k * q + n * s + t, | |
p = m * p + n * r + u, | |
m = m * q + n * s + t, | |
n = y, | |
q = h, | |
n = Math.min(n, g), | |
y = Math.max(y, g), | |
q = Math.min(q, l), | |
h = Math.max(h, l), | |
n = | |
Math.min(n, w), | |
y = Math.max(y, w), | |
q = Math.min(q, k), | |
h = Math.max(h, k), | |
n = Math.min(n, p), | |
y = Math.max(y, p), | |
q = Math.min(q, m), | |
h = Math.max(h, m); | |
g = new C(n, q, y - n, h - q); | |
b.fillRect(g.x, g.y, g.width, g.height) | |
} | |
}, | |
FI: function(a, b, c, d, e) { | |
a.fillStyle = "rgba(0,255,0,.2)"; | |
a.fillRect(b, c, d, e) | |
}, | |
GI: function(a, b, c) { | |
a.save(); | |
var d = b.Nc; | |
d.reset(); | |
1 !== b.scale && d.scale(b.scale); | |
b = b.position; | |
0 === b.x && 0 === b.y || d.translate(-b.x, -b.y); | |
a.setTransform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy); | |
c = c.gd.o; | |
d = c.length; | |
for (b = 0; b < d; b++) { | |
var e = c[b]; | |
a.beginPath(); | |
a.moveTo(e.x - 4, e.y); | |
a.lineTo(e.x + 4, e.y); | |
a.moveTo(e.x, e.y - 4); | |
a.lineTo(e.x, e.y + 4); | |
a.lineWidth = 2; | |
a.strokeStyle = "rgba(255,0,0,.9)"; | |
a.stroke() | |
} | |
a.restore() | |
}, | |
IL: function(a) { | |
a || (a = v.lu); | |
for (a = a.co; a.next();) D.trace(a.value.toString()) | |
}, | |
yM: function(a, b) { | |
var c = b.dp(a), | |
d = b.Vb; | |
d.Sd = b.wv(c); | |
d.ha = c; | |
return ga(b, d, a) | |
}, | |
tM: function(a, b) { | |
b.Je(a.ha) && (b.dd.fillStyle = "lime", b.dd.fillRect(a.Sd.x, a.Sd.y, 1 * b.scale, 1 * b.scale)) | |
}, | |
uM: function(a) { | |
var b = ha(a, !1, null, null); | |
if (!b.vq) { | |
var c = a.wb, | |
d = a.scale; | |
a = a.dd; | |
for (var e = 0; e <= b.Bn; e++) | |
for (var g = | |
0; g <= b.Cn; g++) { | |
var h = b.sd[e][g]; | |
if (0 !== h) { | |
var k = (e * b.ie + b.$f - c.x) * d, | |
l = (g * b.Td + b.ag - c.y) * d; | |
0 !== h && (a.fillStyle = "rgba(255, 0, 0, .2)", a.fillRect(k, l, b.ie * d, b.Td * d)); | |
999999 <= h || (h %= 10, a.fillStyle = "blue", a.fillText(h.toString(), k, l + b.Td)) | |
} | |
} | |
} | |
}, | |
dumpReferences: function(a) { | |
if (a instanceof E) | |
for (a = a.co; a.next();) { | |
var b = a.value; | |
D.trace(b.toString()); | |
for (b = b.Hi; b.next();) v.dumpReferences(b.value) | |
} else if (a instanceof F) { | |
D.trace("References for " + a); | |
null !== a.layer && D.trace(" " + a.layer.toString() + ' LayerName: "' + | |
a.Nf + '"'); | |
a.Cm !== a && D.trace(" SelectionObject: " + a.Cm.toString() + ' SelectionObjectName: "' + a.Py + '"'); | |
a.Df !== a && D.trace(" LocationObject: " + a.Df.toString() + ' LocationObjectName: "' + a.uy + '"'); | |
if (a.lh) { | |
for (var b = "", c = a.lh.j; c.next();) b += c.key + " "; | |
D.trace(" Adornments: " + b) | |
} | |
null !== a.Ka && D.trace(" ContainingGroup: " + a.Ka.toString()); | |
if (a instanceof G) { | |
if (0 < a.Pd.count) { | |
b = ""; | |
for (c = a.Pd; c.next();) b += c.value.toString() + ", "; | |
D.trace(" Links: " + b) | |
} | |
null !== a.Yb && D.trace(" LabeledLink: " + a.Yb.toString()); | |
if (a instanceof I) { | |
D.trace(" Placeholder: " + a.placeholder); | |
b = ""; | |
for (c = a.uc; c.next();) b += c.value.toString() + ", "; | |
D.trace(" Members: " + b); | |
b = ""; | |
for (c = a.jn.j; c.next();) b += c.value.toString() + ", "; | |
D.trace(" NestedGroups: " + b); | |
D.trace(" Layout: " + a.Zb) | |
} | |
} else if (a instanceof J) { | |
D.trace(" Path: " + a.path); | |
D.trace(" From: " + a.$ + " " + a.oc + ' "' + a.hg + '"'); | |
D.trace(" To: " + a.ba + " " + a.Gc + ' "' + a.jh + '"'); | |
b = ""; | |
for (a = a.Cf; a.next();) b += a.value.toString() + ", "; | |
D.trace(" LabelNodes: " + b) | |
} | |
} | |
}, | |
dumpVisualTree: function(a) { | |
if (a instanceof E) | |
for (a = a.co; a.next();) { | |
var b = a.value; | |
D.trace(b.toString()); | |
for (b = b.Hi; b.next();) v.dumpVisualTree(b.value) | |
} else a instanceof F && (b = " ", a.lF && (b += "c"), a.pF && (b += "d"), a.WF && (b += "g"), a.xG && (b += "m"), a.MG && (b += "h"), a.NG && (b += "z"), a.SG && (b += "o"), a.jl && (b += "s"), a.iH && (b += "t"), a.YG && (b += "A"), a.iy && (b += "B"), a.sB && (b += "L"), a.jb && (b += "S"), a.el && (b += "H"), v.qD(a, 1, b)) | |
}, | |
qD: function(a, b, c) { | |
for (var d = "", e = 0; e < b; e++) d += " "; | |
d += a.toString(); | |
c && (d += c); | |
c = a.name ? ' "' + a.name + '" ' : " "; | |
c = a.visible ? c + "v" : c + "!v"; | |
c = a.tg ? c + | |
"p" : c + "!p"; | |
a.Ve && (c += "m"); | |
a.Hu && (c += "a"); | |
d += c; | |
if (0 !== a.Tb || 0 !== a.column) d += " [" + a.Tb + "," + a.column + "]"; | |
d += " " + a.aa.toString(); | |
a.Ea.H() && (d += " d:" + a.Ea.toString()); | |
a.Ga.H() && (d += " n:" + a.Ga.toString()); | |
1 !== a.scale && (d += " s:" + a.scale); | |
0 !== a.angle && (d += " a:" + a.angle); | |
null !== a.background && (d += " b:" + a.background.toString()); | |
null !== a.hm && (d += " a:" + a.background.toString()); | |
a instanceof x && (d += " elts:" + a.xa.count, a.isEnabled || (d += " !ENABLED"), a.yq && (d += " CLIPPING"), 0 !== a.oH && (d += " top:" + a.oH), 0 !== a.qG && (d += | |
" left:" + a.qG), null !== a.fl && (d += " itemArray#:" + D.cb(a.fl)), a.mG && (d += " cat:" + a.mG), null !== a.data && (d += " data:" + a.data)); | |
null !== a.yd && (d += ' portId: "' + a.yd + '"'); | |
D.trace(d); | |
if (a instanceof x) | |
for (a = a.elements; a.next();) v.qD(a.value, b + 1, "") | |
}, | |
OL: function(a) { | |
D.trace("DelayedReferences (" + a.zg.count + ")"); | |
for (a = a.zg.j; a.next();) { | |
for (var b = "", c = a.value.j; c.next();) b += ia(c.value) + ", "; | |
D.trace(" " + a.key + ": " + b) | |
} | |
}, | |
dF: function(a, b) { | |
if (!D.Qa(b) || b instanceof Element || b instanceof CanvasRenderingContext2D || b instanceof ja || b instanceof ma) return ""; | |
var c = "", | |
d; | |
for (d in b) | |
if ("string" !== typeof d) "" === c && (c = b + "\n"), c += " " + d + " is not a string property\n"; | |
else if ("_" !== d.charAt(0) && !(2 >= d.length)) { | |
var e = D.xb(b, d); | |
if (null !== e && "function" !== typeof e) { | |
if (b.hasOwnProperty(d)) { | |
var g = Object.getPrototypeOf(b); | |
if (g && g.Sw && g.Sw[d]) continue | |
} else if (D.ey(b, d)) continue; | |
"" === c && (c = b + "\n"); | |
c += ' unknown property "' + d + '" has value: ' + e + " at " + a + "\n" | |
} | |
} | |
return c | |
}, | |
Ix: function(a, b) { | |
if (null !== b && void 0 !== b && "number" !== typeof b && "string" !== | |
typeof b && "boolean" !== typeof b && "function" !== typeof b) | |
if (void 0 !== D.Od(b)) { | |
if (!v.hx.contains(b)) | |
if (v.hx.add(b), v.Gw.add(v.dF(a, b)), b instanceof K || b instanceof L || b instanceof na) | |
for (var c = b.j; c.next();) v.Ix(a + "[" + c.key + "]", c.value); | |
else | |
for (c in b) { | |
var d = D.xb(b, c); | |
if (void 0 !== d && null !== d && D.Qa(d) && d !== b.Sw) { | |
if (b instanceof pa) { | |
if (d === b.uf) continue | |
} else if (b instanceof x) { | |
if ("data" === c || d === b.Ud) continue; | |
if ("itemArray" === c || d === b.ej) continue; | |
if (b instanceof F && d === b.Tl) continue | |
} else if (!(b instanceof E)) | |
if (b instanceof qa) { | |
if ("archetypeGroupData" === c || d === b.mz) continue | |
} else if (b instanceof ra) { | |
if ("archetypeLinkData" === c || d === b.oz) continue; | |
if ("archetypeLabelNodeData" === c || d === b.nz) continue | |
} else if (b instanceof ta) { | |
if ("archetypeNodeData" === c || d === b.zl) continue | |
} else if (b instanceof M) { | |
if ("nodeDataArray" === c || d === b.ze) continue; | |
if ("linkDataArray" === c || d === b.df || d === b.ki) continue; | |
if (d === b.Kc) continue; | |
if (d === b.zg) continue | |
} else if (b instanceof ua || b instanceof va || b instanceof wa) continue; | |
v.Ix(a + "." + | |
c, d) | |
} | |
} | |
} else if (Array.isArray(b)) | |
for (c = 0; c < b.length; c++) v.Ix(a + "[" + c + "]", b[c]); | |
else v.Gw.add(v.dF(a, b)) | |
}, | |
checkProperties: function(a) { | |
void 0 === v.hx ? v.hx = new L(Object) : v.hx.clear(); | |
v.Gw = new xa; | |
v.Ix("", a); | |
a = v.Gw.toString(); | |
v.Gw = null; | |
return a | |
} | |
}; | |
ca.Debug = v; | |
var D = { | |
Ad: 1, | |
bd: 2, | |
rd: 4, | |
qd: 8, | |
Zn: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("534.30") && 0 < window.navigator.userAgent.indexOf("Android"), | |
Mu: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("MSIE 9.0"), | |
zq: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("MSIE 10.0"), | |
Aq: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("Trident/7"), | |
pB: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("Edge/"), | |
Qh: void 0 !== window.navigator && void 0 !== | |
window.navigator.platform && 0 <= window.navigator.platform.toUpperCase().indexOf("MAC"), | |
gG: void 0 !== window.navigator && void 0 !== window.navigator.platform && null !== window.navigator.platform.match(/(iPhone|iPod|iPad)/i), | |
mF: function(a, b, c) { | |
var d = -1; | |
return function() { | |
var e = this, | |
g = arguments; - 1 !== d && D.clearTimeout(d); | |
d = D.setTimeout(function() { | |
d = -1; | |
c || a.apply(e, g) | |
}, b); | |
c && !d && a.apply(e, g) | |
} | |
}, | |
setTimeout: function(a, b) { | |
return window.setTimeout(a, b) | |
}, | |
clearTimeout: function(a) { | |
window.clearTimeout(a) | |
}, | |
createElement: function(a) { | |
return window.document.createElement(a) | |
}, | |
k: function(a) { | |
throw Error(a); | |
}, | |
qa: function(a, b) { | |
var c = "The object is frozen, so its properties cannot be set: " + a.toString(); | |
void 0 !== b && (c += " to value: " + b); | |
D.k(c) | |
}, | |
l: function(a, b, c, d) { | |
a instanceof b || (c = D.getTypeName(c), void 0 !== d && (c += "." + d), D.kc(a, b, c)) | |
}, | |
h: function(a, b, c, d) { | |
typeof a !== b && (c = D.getTypeName(c), void 0 !== d && (c += "." + d), D.kc(a, b, c)) | |
}, | |
p: function(a, b, c) { | |
"number" === typeof a && isFinite(a) || (b = D.getTypeName(b), void 0 !== c && (b += "." + c), D.k(b + " must be a real number type, and not NaN or Infinity: " + | |
a)) | |
}, | |
Da: function(a, b, c, d) { | |
a instanceof ya && a.Re === b || (c = D.getTypeName(c), void 0 !== d && (c += "." + d), D.kc(a, "a constant of class " + D.yf(b), c)) | |
}, | |
hu: function(a, b) { | |
"string" === typeof a ? za(a) || D.k('Color "' + a + '" is not a valid color string for ' + b) : a instanceof Ba || D.k("Value for " + b + " must be a color string or a Brush, not " + a) | |
}, | |
kc: function(a, b, c, d) { | |
b = D.getTypeName(b); | |
c = D.getTypeName(c); | |
void 0 !== d && (c += "." + d); | |
"string" === typeof a ? D.k(c + " value is not an instance of " + b + ': "' + a + '"') : D.k(c + " value is not an instance of " + | |
b + ": " + a) | |
}, | |
ua: function(a, b, c, d) { | |
c = D.getTypeName(c); | |
void 0 !== d && (c += "." + d); | |
D.k(c + " is not in the range " + b + ": " + a) | |
}, | |
zd: function(a) { | |
D.k(D.yf(a) + " constructor cannot take any arguments.") | |
}, | |
Va: function(a) { | |
D.k("Collection was modified during iteration: " + a.toString() + "\n Perhaps you should iterate over a copy of the collection,\n or you could collect items to be removed from the collection after the iteration.") | |
}, | |
ak: function(a, b) { | |
D.k("No property to set for this enum value: " + b + " on " + a.toString()) | |
}, | |
trace: function(a) { | |
window.console && window.console.log(a) | |
}, | |
Rx: {}, | |
Qn: function(a, b) { | |
!0 !== D.Rx[a] && (D.Rx[a] = !0, window.console && window.console.log(a + " is deprecated in " + b + ", see the GoJS change log for more information.")) | |
}, | |
Qa: function(a) { | |
return "object" === typeof a && null !== a | |
}, | |
isArray: function(a) { | |
return Array.isArray(a) || a instanceof NodeList || a instanceof HTMLCollection | |
}, | |
oJ: function(a) { | |
return Array.isArray(a) | |
}, | |
gu: function(a, b, c) { | |
D.isArray(a) || D.kc(a, "Array or NodeList or HTMLCollection", b, c) | |
}, | |
cb: function(a) { | |
return a.length | |
}, | |
lm: function(a) { | |
return Array.prototype.slice.call(a) | |
}, | |
La: function(a, b) { | |
Array.isArray(a); | |
return a[b] | |
}, | |
aF: function(a, b, c) { | |
Array.isArray(a) ? a[b] = c : D.k("Cannot replace an object in an HTMLCollection or NodeList at " + b) | |
}, | |
im: function(a, b) { | |
if (Array.isArray(a)) return a.indexOf(b); | |
for (var c = a.length, d = 0; d < c; d++) | |
if (a[d] === b) return d; | |
return -1 | |
}, | |
Ih: function(a, b, c) { | |
Array.isArray(a) ? b >= a.length ? a.push(c) : a.splice(b, 0, c) : D.k("Cannot insert an object into an HTMLCollection or NodeList: " + c + " at " + b) | |
}, | |
Vg: function(a, | |
b) { | |
Array.isArray(a) ? b >= a.length ? a.pop() : a.splice(b, 1) : D.k("Cannot remove an object from an HTMLCollection or NodeList at " + b) | |
}, | |
dz: [], | |
P: function() { | |
var a = D.dz.pop(); | |
return void 0 === a ? new N : a | |
}, | |
Fb: function(a, b) { | |
var c = D.dz.pop(); | |
if (void 0 === c) return new N(a, b); | |
c.x = a; | |
c.y = b; | |
return c | |
}, | |
A: function(a) { | |
D.dz.push(a) | |
}, | |
BC: [], | |
Im: function() { | |
var a = D.BC.pop(); | |
return void 0 === a ? new Ca : a | |
}, | |
$k: function(a) { | |
D.BC.push(a) | |
}, | |
ez: [], | |
Sf: function() { | |
var a = D.ez.pop(); | |
return void 0 === a ? new C : a | |
}, | |
vg: function(a, b, c, d) { | |
var e = D.ez.pop(); | |
if (void 0 === e) return new C(a, b, c, d); | |
e.x = a; | |
e.y = b; | |
e.width = c; | |
e.height = d; | |
return e | |
}, | |
Lb: function(a) { | |
D.ez.push(a) | |
}, | |
CC: [], | |
hh: function() { | |
var a = D.CC.pop(); | |
return void 0 === a ? new Ea : a | |
}, | |
nf: function(a) { | |
D.CC.push(a) | |
}, | |
fz: null, | |
v: function() { | |
var a = D.fz; | |
return null !== a ? (D.fz = null, a) : new Fa | |
}, | |
u: function(a) { | |
a.reset(); | |
D.fz = a | |
}, | |
AC: [], | |
nb: function() { | |
var a = D.AC.pop(); | |
return void 0 === a ? [] : a | |
}, | |
ya: function(a) { | |
a.length = 0; | |
D.AC.push(a) | |
}, | |
ml: Object.freeze([]), | |
Mm: 1, | |
xc: function(a) { | |
a.__gohashid = D.Mm++ | |
}, | |
sq: function(a) { | |
var b = a.__gohashid; | |
void 0 === b && (b = D.Mm++, a.__gohashid = b); | |
return b | |
}, | |
Od: function(a) { | |
return a.__gohashid | |
}, | |
ka: function(a, b) { | |
b.uz = a; | |
ca[a] = b | |
}, | |
Ta: function(a, b) { | |
function c() {} | |
c.prototype = b.prototype; | |
a.prototype = new c; | |
a.prototype.constructor = a | |
}, | |
Di: function(a) { | |
a.NH = !0 | |
}, | |
defineProperty: function(a, b, c, d, e) { | |
D.h(a, "function", "Util.defineProperty:classfunc"); | |
D.h(b, "object", "Util.defineProperty:propobj"); | |
D.h(c, "function", "Util.defineProperty:getter"); | |
D.h(d, "function", "Util.defineProperty:setter"); | |
for (var g in b) { | |
b = b[g]; | |
c = { | |
get: c, | |
set: d, | |
enumerable: !0 | |
}; | |
if (void 0 !== e) | |
for (var h in e) c[h] = e[h]; | |
Object.defineProperty(a.prototype, g, c); | |
e = Object.getOwnPropertyDescriptor(a.prototype, g); | |
b && e && Object.defineProperty(a.prototype, b, e); | |
break | |
} | |
}, | |
MK: !1, | |
w: function(a, b, c, d) { | |
D.h(a, "function", "Util.defineReadOnlyProperty:classfunc"); | |
D.h(b, "object", "Util.defineReadOnlyProperty:propobj"); | |
D.h(c, "function", "Util.defineReadOnlyProperty:getter"); | |
for (var e in b) { | |
var g = b[e]; | |
b = { | |
get: c, | |
set: function(a) { | |
D.k('The property "' + g + '" is read-only and cannot be set to ' + | |
a) | |
}, | |
enumerable: !0 | |
}; | |
if (void 0 !== d) | |
for (var h in d) b[h] = d[h]; | |
Object.defineProperty(a.prototype, e, b); | |
d = Object.getOwnPropertyDescriptor(a.prototype, e); | |
g && d && Object.defineProperty(a.prototype, g, d); | |
break | |
} | |
}, | |
ne: function(a, b) { | |
for (var c in b) b[c] = !0; | |
a.prototype.Sw = b | |
}, | |
getTypeName: function(a) { | |
return void 0 === a ? "" : "string" === typeof a ? a : "function" === typeof a ? D.yf(a) : null === a ? "*" : "" | |
}, | |
yf: function(a) { | |
if ("function" === typeof a) { | |
if (a.uz) return a.uz; | |
if (a.name) return a.name; | |
var b = a.toString(), | |
c = b.indexOf("("), | |
b = b.substring(9, | |
c).trim(); | |
if ("" !== b) return a.uz = b | |
} else if (D.Qa(a) && a.constructor) return D.yf(a.constructor); | |
return typeof a | |
}, | |
s: function(a, b, c) { | |
D.h(a, "function", "Util.defineEnumValue:classfunc"); | |
D.h(b, "string", "Util.defineEnumValue:name"); | |
D.h(c, "number", "Util.defineEnumValue:num"); | |
c = new ya(a, b, c); | |
Object.freeze(c); | |
a[b] = c; | |
var d = a.Av; | |
d instanceof na || (d = new na("string", ya), a.Av = d); | |
d.add(b, c); | |
return c | |
}, | |
xb: function(a, b) { | |
if (!a || !b) return null; | |
var c = void 0; | |
try { | |
"function" === typeof b ? c = b(a) : "function" === typeof a.getAttribute ? | |
(c = a.getAttribute(b), null === c && (c = void 0)) : c = a[b] | |
} catch (d) { | |
v && D.trace("property get error: " + d.toString()) | |
} | |
return c | |
}, | |
Ua: function(a, b, c) { | |
if (a && b) try { | |
"function" === typeof b ? b(a, c) : "function" === typeof a.setAttribute ? a.setAttribute(b, c) : a[b] = c | |
} catch (d) { | |
v && D.trace("property set error: " + d.toString()) | |
} | |
}, | |
nv: function(a, b) { | |
D.h(a, "object", "Setting properties requires Objects as arguments"); | |
D.h(b, "object", "Setting properties requires Objects as arguments"); | |
var c = a instanceof x, | |
d = a instanceof E, | |
e; | |
for (e in b) { | |
"" === | |
e && D.k("Setting properties requires non-empty property names"); | |
var g = a, | |
h = e; | |
if (c || d) { | |
var k = e.indexOf("."); | |
if (0 < k) { | |
var l = e.substring(0, k); | |
if (c) g = a.Nd(l); | |
else if (g = a[l], void 0 === g || null === g) g = a.ob[l]; | |
D.Qa(g) ? h = e.substr(k + 1) : D.k("Unable to find object named: " + l + " in " + a.toString() + " when trying to set property: " + e) | |
} | |
} | |
if ("_" !== h[0] && !D.ey(g, h)) | |
if (d && "ModelChanged" === h) { | |
a.XH(b[h]); | |
continue | |
} else if (d && "Changed" === h) { | |
a.Dn(b[h]); | |
continue | |
} else if (d && D.ey(a.ob, h)) g = a.ob; | |
else if (d && Ga(a, h)) { | |
a.yx(h, b[h]); | |
continue | |
} else if (a instanceof M && "Changed" === h) { | |
a.Dn(b[h]); | |
continue | |
} else D.k('Trying to set undefined property "' + h + '" on object: ' + g.toString()); | |
g[h] = b[e]; | |
"_" === h[0] && g instanceof O && g.UH(h) | |
} | |
}, | |
ey: function(a, b) { | |
if (a.hasOwnProperty(b)) return !0; | |
for (var c = Object.getPrototypeOf(a); c && c !== Function;) { | |
if (c.hasOwnProperty(b)) return !0; | |
var d = c.Sw; | |
if (d && d[b]) return !0; | |
c = Object.getPrototypeOf(c) | |
} | |
return !1 | |
}, | |
$J: function(a) { | |
for (var b = [], c = 0; 256 > c; c++) b[c] = c; | |
for (var d = 0, e = 0, c = 0; 256 > c; c++) d = (d + b[c] + 119) % 256, e = b[c], b[c] = b[d], b[d] = e; | |
for (var d = c = 0, | |
g = "", h = 0; h < a.length; h++) c = (c + 1) % 256, d = (d + b[c]) % 256, e = b[c], b[c] = b[d], b[d] = e, g += String.fromCharCode(a.charCodeAt(h) ^ b[(b[c] + b[d]) % 256]); | |
return g | |
}, | |
bJ: function(a) { | |
for (var b = {}, c = 0; 256 > c; c++) b["0123456789abcdef".charAt(c >> 4) + "0123456789abcdef".charAt(c & 15)] = String.fromCharCode(c); | |
a.length % 2 && (a = "0" + a); | |
for (var d = [], e = 0, c = 0; c < a.length; c += 2) d[e++] = b[a.substr(c, 2)]; | |
a = d.join(""); | |
return "" === a ? "0" : a | |
}, | |
Wg: function(a) { | |
return D.$J(D.bJ(a)) | |
}, | |
Km: null, | |
adym: "7da71ca0ad381e90", | |
vfo: "2be64efdb260", | |
pL: "@COLOR1", | |
qL: "@COLOR2", | |
nF: !1, | |
ju: null, | |
ku: null | |
}; | |
D.Km = function() { | |
var a = window.document.createElement("canvas"), | |
b = a.getContext("2d"), | |
c = ["5da73c80a36755dc038e4972187c3cae51fd22", | |
"32ab5ff3b26f42dc0ed90f224c2913b54ae6247590da4bb21c324ba3a84e385776", | |
"54a702f3e53909c447824c6706603faf4cfb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387", | |
"74bf19bce72555874c86" | |
]; | |
b[D.Wg("7ca11abfd022028846")] = D.Wg("398c3597c01238"); | |
for (d = 1; d<5; d++) { | |
if (D.Wg("7ca11abfd7330390") === 'fillText') { | |
continue; | |
} | |
b[D.Wg("7ca11abfd7330390")](D.Wg(c[d - 1]), 10, 15 * d + 0); | |
} | |
b[D.Wg("7ca11abfd022028846")] = D.Wg("39f046ebb36e4b"); | |
for (d = 1; 5 > d; d++) { | |
if (D.Wg("7ca11abfd7330390") === 'fillText') { | |
continue; | |
} | |
b[D.Wg("7ca11abfd7330390")](D.Wg(c[d - 1]), 10, 15 * d + 0); | |
} | |
if (4 !== c.length || "5" !== c[0][0] || "7" !== c[3][0]) D.s = function(a, b) { | |
var c = new ya(a, b, 2); | |
Object.freeze(c); | |
a[b] = c; | |
var d = a.Av; | |
d instanceof na || (d = new na("string", ya), a.Av = d); | |
d.add(b, c); | |
return c | |
}; | |
return a | |
}(); | |
function ya(a, b, c) { | |
D.xc(this); | |
this.MC = a; | |
this.ac = b; | |
this.RH = c | |
} | |
D.ka("EnumValue", ya); | |
ya.prototype.toString = function() { | |
return D.yf(this.MC) + "." + this.ac | |
}; | |
D.w(ya, { | |
Re: "classType" | |
}, function() { | |
return this.MC | |
}); | |
D.w(ya, { | |
name: "name" | |
}, function() { | |
return this.ac | |
}); | |
D.w(ya, { | |
value: "value" | |
}, function() { | |
return this.RH | |
}); | |
var Ha; | |
ya.findName = Ha = function(a, b) { | |
if (void 0 === b || null === b || "" === b) return null; | |
D.h(a, "function", "findName:classfunc"); | |
D.h(b, "string", "EnumValue.findName:name"); | |
var c = a.Av; | |
return c instanceof na ? c.oa(b) : null | |
}; | |
function xa() { | |
this.LC = [] | |
} | |
xa.prototype.toString = function() { | |
return this.LC.join("") | |
}; | |
xa.prototype.add = function(a) { | |
"" !== a && this.LC.push(a) | |
}; | |
function ma() {} | |
function Ia(a) { | |
void 0 === a && (a = 42); | |
this.seed = a; | |
this.$y = 48271; | |
this.zv = 2147483647; | |
this.zC = this.zv / this.$y; | |
this.zH = this.zv % this.$y; | |
this.yH = 1 / this.zv; | |
this.random() | |
} | |
Ia.prototype.random = function() { | |
var a = this.seed % this.zC * this.$y - this.seed / this.zC * this.zH; | |
this.seed = 0 < a ? a : a + this.zv; | |
return this.seed * this.yH | |
}; | |
function Ja() {} | |
D.w(Ja, { | |
j: "iterator" | |
}, function() { | |
return this | |
}); | |
Ja.prototype.reset = Ja.prototype.reset = function() {}; | |
Ja.prototype.next = Ja.prototype.next = function() { | |
return !1 | |
}; | |
Ja.prototype.hasNext = function() { | |
return !1 | |
}; | |
Ja.prototype.first = Ja.prototype.first = function() { | |
return null | |
}; | |
Ja.prototype.any = function() { | |
return !1 | |
}; | |
Ja.prototype.all = function() { | |
return !0 | |
}; | |
Ja.prototype.each = function() { | |
return this | |
}; | |
Ja.prototype.map = function() { | |
return this | |
}; | |
Ja.prototype.filter = function() { | |
return this | |
}; | |
Ja.prototype.concat = function(a) { | |
return a.j | |
}; | |
D.w(Ja, { | |
count: "count" | |
}, function() { | |
return 0 | |
}); | |
Ja.prototype.Vf = function() {}; | |
Ja.prototype.toString = function() { | |
return "EmptyIterator" | |
}; | |
var Ka = new Ja; | |
function Ma(a) { | |
this.key = -1; | |
this.value = a | |
} | |
D.ne(Ma, { | |
key: !0, | |
value: !0 | |
}); | |
D.w(Ma, { | |
j: "iterator" | |
}, function() { | |
return this | |
}); | |
Ma.prototype.reset = Ma.prototype.reset = function() { | |
this.key = -1 | |
}; | |
Ma.prototype.next = Ma.prototype.next = function() { | |
return -1 === this.key ? (this.key = 0, !0) : !1 | |
}; | |
Ma.prototype.hasNext = function() { | |
return this.next() | |
}; | |
Ma.prototype.first = Ma.prototype.first = function() { | |
this.key = 0; | |
return this.value | |
}; | |
Ma.prototype.any = function(a) { | |
this.key = -1; | |
return a(this.value) | |
}; | |
Ma.prototype.all = function(a) { | |
this.key = -1; | |
return a(this.value) | |
}; | |
Ma.prototype.each = function(a) { | |
this.key = -1; | |
a(this.value); | |
return this | |
}; | |
Ma.prototype.map = function(a) { | |
return new Ma(a(this.value)) | |
}; | |
Ma.prototype.filter = function(a) { | |
return a(this.value) ? new Ma(this.value) : Ka | |
}; | |
Ma.prototype.concat = function(a) { | |
return new Na(this, a.j) | |
}; | |
D.w(Ma, { | |
count: "count" | |
}, function() { | |
return 1 | |
}); | |
Ma.prototype.Vf = function() { | |
this.value = null | |
}; | |
Ma.prototype.toString = function() { | |
return "SingletonIterator(" + this.value + ")" | |
}; | |
function Na(a, b) { | |
this.Ml = a; | |
this.Nl = b; | |
this.Bv = !1 | |
} | |
D.ne(Na, { | |
key: !0, | |
value: !0 | |
}); | |
D.w(Na, { | |
j: "iterator" | |
}, function() { | |
return this | |
}); | |
Na.prototype.reset = Na.prototype.reset = function() { | |
this.Ml.reset(); | |
this.Nl.reset(); | |
this.Bv = !1 | |
}; | |
Na.prototype.next = Na.prototype.next = function() { | |
if (!this.Bv) { | |
var a = this.Ml; | |
if (a.next()) return this.key = a.key, this.value = a.value, !0; | |
this.Bv = !0 | |
} | |
return this.Bv && (a = this.Nl, a.next()) ? (this.key = a.key, this.value = a.value, !0) : !1 | |
}; | |
Na.prototype.hasNext = function() { | |
return this.next() | |
}; | |
Na.prototype.first = Na.prototype.first = function() { | |
this.reset(); | |
return this.next() ? this.value : null | |
}; | |
Na.prototype.any = function(a) { | |
return this.Ml.any(a) || this.Nl.any(a) ? !0 : !1 | |
}; | |
Na.prototype.all = function(a) { | |
return this.Ml.all(a) && this.Nl.all(a) ? !0 : !1 | |
}; | |
Na.prototype.each = function(a) { | |
this.Ml.each(a); | |
this.Nl.each(a); | |
return this | |
}; | |
Na.prototype.map = function(a) { | |
return new Na(this.Ml.map(a), this.Nl.map(a)) | |
}; | |
Na.prototype.filter = function(a) { | |
return new Na(this.Ml.filter(a), this.Nl.filter(a)) | |
}; | |
Na.prototype.concat = function(a) { | |
return new Na(this, a.j) | |
}; | |
D.w(Na, { | |
count: "count" | |
}, function() { | |
return this.Ml.count + this.Nl.count | |
}); | |
Na.prototype.Vf = function() { | |
this.value = this.key = null | |
}; | |
Na.prototype.toString = function() { | |
return "ConcatIterator()" | |
}; | |
function Qa(a) { | |
this.Jc = a; | |
this.pi = null; | |
a.$b = null; | |
this.$a = a.I; | |
this.Ic = -1 | |
} | |
D.ne(Qa, { | |
key: !0, | |
value: !0 | |
}); | |
D.w(Qa, { | |
j: "iterator" | |
}, function() { | |
return this | |
}); | |
D.defineProperty(Qa, { | |
Nq: "predicate" | |
}, function() { | |
return this.pi | |
}, function(a) { | |
this.pi = a | |
}); | |
Qa.prototype.reset = Qa.prototype.reset = function() { | |
var a = this.Jc; | |
a.$b = null; | |
this.$a = a.I; | |
this.Ic = -1 | |
}; | |
Qa.prototype.next = Qa.prototype.next = function() { | |
var a = this.Jc; | |
if (a.I !== this.$a) { | |
if (0 > this.key) return !1; | |
D.Va(a) | |
} | |
var a = a.o, | |
b = a.length, | |
c = ++this.Ic, | |
d = this.pi; | |
if (null !== d) | |
for (; c < b;) { | |
var e = a[c]; | |
if (d(e)) return this.key = this.Ic = c, this.value = e, !0; | |
c++ | |
} else { | |
if (c < b) return this.key = c, this.value = a[c], !0; | |
this.Vf() | |
} | |
return !1 | |
}; | |
Qa.prototype.hasNext = function() { | |
return this.next() | |
}; | |
Qa.prototype.first = Qa.prototype.first = function() { | |
var a = this.Jc; | |
this.$a = a.I; | |
this.Ic = 0; | |
var a = a.o, | |
b = a.length, | |
c = this.pi; | |
if (null !== c) { | |
for (var d = 0; d < b;) { | |
var e = a[d]; | |
if (c(e)) return this.key = this.Ic = d, this.value = e; | |
d++ | |
} | |
return null | |
} | |
return 0 < b ? (e = a[0], this.key = 0, this.value = e) : null | |
}; | |
Qa.prototype.any = function(a) { | |
var b = this.Jc; | |
b.$b = null; | |
var c = b.I; | |
this.Ic = -1; | |
for (var d = b.o, e = d.length, g = this.pi, h = 0; h < e; h++) { | |
var k = d[h]; | |
if (null === g || g(k)) { | |
if (a(k)) return !0; | |
b.I !== c && D.Va(b) | |
} | |
} | |
return !1 | |
}; | |
Qa.prototype.all = function(a) { | |
var b = this.Jc; | |
b.$b = null; | |
var c = b.I; | |
this.Ic = -1; | |
for (var d = b.o, e = d.length, g = this.pi, h = 0; h < e; h++) { | |
var k = d[h]; | |
if (null === g || g(k)) { | |
if (!a(k)) return !1; | |
b.I !== c && D.Va(b) | |
} | |
} | |
return !0 | |
}; | |
Qa.prototype.each = function(a) { | |
var b = this.Jc; | |
b.$b = null; | |
var c = b.I; | |
this.Ic = -1; | |
for (var d = b.o, e = d.length, g = this.pi, h = 0; h < e; h++) { | |
var k = d[h]; | |
if (null === g || g(k)) a(k), b.I !== c && D.Va(b) | |
} | |
return this | |
}; | |
Qa.prototype.map = function(a) { | |
var b = this.Jc; | |
b.$b = null; | |
var c = b.I; | |
this.Ic = -1; | |
for (var d = [], e = b.o, g = e.length, h = this.pi, k = 0; k < g; k++) { | |
var l = e[k]; | |
if (null === h || h(l)) d.push(a(l)), b.I !== c && D.Va(b) | |
} | |
a = new K; | |
a.o = d; | |
a.Uc(); | |
return a.j | |
}; | |
Qa.prototype.filter = function(a) { | |
var b = this.Jc; | |
b.$b = null; | |
var c = b.I; | |
this.Ic = -1; | |
for (var d = [], e = b.o, g = e.length, h = this.pi, k = 0; k < g; k++) { | |
var l = e[k]; | |
if (null === h || h(l)) a(l) && d.push(l), b.I !== c && D.Va(b) | |
} | |
a = new K(b.ca); | |
a.o = d; | |
a.Uc(); | |
return a.j | |
}; | |
Qa.prototype.concat = function(a) { | |
this.Jc.$b = null; | |
return new Na(this, a.j) | |
}; | |
D.w(Qa, { | |
count: "count" | |
}, function() { | |
var a = this.pi; | |
if (null !== a) { | |
for (var b = 0, c = this.Jc.o, d = c.length, e = 0; e < d; e++) a(c[e]) && b++; | |
return b | |
} | |
return this.Jc.o.length | |
}); | |
Qa.prototype.Vf = function() { | |
this.key = -1; | |
this.value = null; | |
this.$a = -1; | |
this.pi = null; | |
this.Jc.$b = this | |
}; | |
Qa.prototype.toString = function() { | |
return "ListIterator@" + this.Ic + "/" + this.Jc.count | |
}; | |
function Ua(a) { | |
this.Jc = a; | |
a.fj = null; | |
this.$a = a.I; | |
this.Ic = a.o.length | |
} | |
D.ne(Ua, { | |
key: !0, | |
value: !0 | |
}); | |
D.w(Ua, { | |
j: "iterator" | |
}, function() { | |
return this | |
}); | |
Ua.prototype.reset = Ua.prototype.reset = function() { | |
var a = this.Jc; | |
a.fj = null; | |
this.$a = a.I; | |
this.Ic = a.o.length | |
}; | |
Ua.prototype.next = Ua.prototype.next = function() { | |
var a = this.Jc; | |
if (a.I !== this.$a) { | |
if (0 > this.key) return !1; | |
D.Va(a) | |
} | |
var b = --this.Ic; | |
if (0 <= b) return this.key = b, this.value = a.o[b], !0; | |
this.Vf(); | |
return !1 | |
}; | |
Ua.prototype.hasNext = function() { | |
return this.next() | |
}; | |
Ua.prototype.first = Ua.prototype.first = function() { | |
var a = this.Jc; | |
this.$a = a.I; | |
var b = a.o; | |
this.Ic = a = b.length - 1; | |
return 0 <= a ? (b = b[a], this.key = a, this.value = b) : null | |
}; | |
Ua.prototype.any = function(a) { | |
var b = this.Jc; | |
b.fj = null; | |
var c = b.I, | |
d = b.o, | |
e = d.length; | |
this.Ic = e; | |
for (e -= 1; 0 <= e; e--) { | |
if (a(d[e])) return !0; | |
b.I !== c && D.Va(b) | |
} | |
return !1 | |
}; | |
Ua.prototype.all = function(a) { | |
var b = this.Jc; | |
b.fj = null; | |
var c = b.I, | |
d = b.o, | |
e = d.length; | |
this.Ic = e; | |
for (e -= 1; 0 <= e; e--) { | |
if (!a(d[e])) return !1; | |
b.I !== c && D.Va(b) | |
} | |
return !0 | |
}; | |
Ua.prototype.each = function(a) { | |
var b = this.Jc; | |
b.fj = null; | |
var c = b.I, | |
d = b.o, | |
e = d.length; | |
this.Ic = e; | |
for (e -= 1; 0 <= e; e--) a(d[e]), b.I !== c && D.Va(b); | |
return this | |
}; | |
Ua.prototype.map = function(a) { | |
var b = this.Jc; | |
b.fj = null; | |
var c = b.I, | |
d = [], | |
e = b.o, | |
g = e.length; | |
this.Ic = g; | |
for (g -= 1; 0 <= g; g--) d.push(a(e[g])), b.I !== c && D.Va(b); | |
a = new K; | |
a.o = d; | |
a.Uc(); | |
return a.j | |
}; | |
Ua.prototype.filter = function(a) { | |
var b = this.Jc; | |
b.fj = null; | |
var c = b.I, | |
d = [], | |
e = b.o, | |
g = e.length; | |
this.Ic = g; | |
for (g -= 1; 0 <= g; g--) { | |
var h = e[g]; | |
a(h) && d.push(h); | |
b.I !== c && D.Va(b) | |
} | |
a = new K(b.ca); | |
a.o = d; | |
a.Uc(); | |
return a.j | |
}; | |
Ua.prototype.concat = function(a) { | |
this.Jc.fj = null; | |
return new Na(this, a.j) | |
}; | |
D.w(Ua, { | |
count: "count" | |
}, function() { | |
return this.Jc.o.length | |
}); | |
Ua.prototype.Vf = function() { | |
this.key = -1; | |
this.value = null; | |
this.$a = -1; | |
this.Jc.fj = this | |
}; | |
Ua.prototype.toString = function() { | |
return "ListIteratorBackwards(" + this.Ic + "/" + this.Jc.count + ")" | |
}; | |
function K(a) { | |
D.xc(this); | |
this.J = !1; | |
this.o = []; | |
this.I = 0; | |
this.fj = this.$b = null; | |
void 0 === a || null === a ? this.ca = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a || "boolean" === a || "function" === a ? this.ca = a : D.ua(a, "the string 'object', 'number', 'string', 'boolean', or 'function'", "List constructor: type") : "function" === typeof a ? this.ca = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a === Boolean ? "boolean" : a === Function ? "function" : a : D.ua(a, "null, a primitive type name, or a class type", | |
"List constructor: type") | |
} | |
D.ka("List", K); | |
K.prototype.nh = function(a) { | |
null !== this.ca && ("string" === typeof this.ca ? typeof a === this.ca && null !== a || D.kc(a, this.ca) : a instanceof this.ca || D.kc(a, this.ca)) | |
}; | |
K.prototype.Uc = function() { | |
var a = this.I; | |
a++; | |
999999999 < a && (a = 0); | |
this.I = a | |
}; | |
K.prototype.freeze = K.prototype.freeze = function() { | |
this.J = !0; | |
return this | |
}; | |
K.prototype.thaw = K.prototype.Xa = function() { | |
this.J = !1; | |
return this | |
}; | |
K.prototype.toString = function() { | |
return "List(" + D.getTypeName(this.ca) + ")#" + D.Od(this) | |
}; | |
K.prototype.add = K.prototype.add = function(a) { | |
null !== a && (v && this.nh(a), this.J && D.qa(this, a), this.o.push(a), this.Uc()) | |
}; | |
K.prototype.push = K.prototype.push = function(a) { | |
this.add(a) | |
}; | |
K.prototype.addAll = K.prototype.Vc = function(a) { | |
if (null === a) return this; | |
this.J && D.qa(this); | |
var b = this.o; | |
if (D.isArray(a)) | |
for (var c = D.cb(a), d = 0; d < c; d++) { | |
var e = D.La(a, d); | |
v && this.nh(e); | |
b.push(e) | |
} else | |
for (a = a.j; a.next();) e = a.value, v && this.nh(e), b.push(e); | |
this.Uc(); | |
return this | |
}; | |
K.prototype.clear = K.prototype.clear = function() { | |
this.J && D.qa(this); | |
this.o.length = 0; | |
this.Uc() | |
}; | |
K.prototype.contains = K.prototype.contains = function(a) { | |
if (null === a) return !1; | |
v && this.nh(a); | |
return -1 !== this.o.indexOf(a) | |
}; | |
K.prototype.has = K.prototype.has = function(a) { | |
return this.contains(a) | |
}; | |
K.prototype.indexOf = K.prototype.indexOf = function(a) { | |
if (null === a) return -1; | |
v && this.nh(a); | |
return this.o.indexOf(a) | |
}; | |
K.prototype.elt = K.prototype.fa = function(a) { | |
v && D.p(a, K, "elt:i"); | |
var b = this.o; | |
(0 > a || a >= b.length) && D.ua(a, "0 <= i < length", K, "elt:i"); | |
return b[a] | |
}; | |
K.prototype.get = K.prototype.get = function(a) { | |
return this.fa(a) | |
}; | |
K.prototype.setElt = K.prototype.ug = function(a, b) { | |
v && (this.nh(b), D.p(a, K, "setElt:i")); | |
var c = this.o; | |
(0 > a || a >= c.length) && D.ua(a, "0 <= i < length", K, "setElt:i"); | |
this.J && D.qa(this, a); | |
c[a] = b | |
}; | |
K.prototype.set = K.prototype.set = function(a, b) { | |
this.ug(a, b) | |
}; | |
K.prototype.first = K.prototype.first = function() { | |
var a = this.o; | |
return 0 === a.length ? null : a[0] | |
}; | |
K.prototype.last = K.prototype.se = function() { | |
var a = this.o, | |
b = a.length; | |
return 0 < b ? a[b - 1] : null | |
}; | |
K.prototype.pop = K.prototype.pop = function() { | |
this.J && D.qa(this); | |
var a = this.o; | |
return 0 < a.length ? a.pop() : null | |
}; | |
K.prototype.any = function(a) { | |
for (var b = this.o, c = this.I, d = b.length, e = 0; e < d; e++) { | |
if (a(b[e])) return !0; | |
this.I !== c && D.Va(this) | |
} | |
return !1 | |
}; | |
K.prototype.all = function(a) { | |
for (var b = this.o, c = this.I, d = b.length, e = 0; e < d; e++) { | |
if (!a(b[e])) return !1; | |
this.I !== c && D.Va(this) | |
} | |
return !0 | |
}; | |
K.prototype.each = function(a) { | |
for (var b = this.o, c = this.I, d = b.length, e = 0; e < d; e++) a(b[e]), this.I !== c && D.Va(this); | |
return this | |
}; | |
K.prototype.map = function(a) { | |
for (var b = new K, c = [], d = this.o, e = this.I, g = d.length, h = 0; h < g; h++) c.push(a(d[h])), this.I !== e && D.Va(this); | |
b.o = c; | |
b.Uc(); | |
return b | |
}; | |
K.prototype.filter = function(a) { | |
for (var b = new K(this.ca), c = [], d = this.o, e = this.I, g = d.length, h = 0; h < g; h++) { | |
var k = d[h]; | |
a(k) && c.push(k); | |
this.I !== e && D.Va(this) | |
} | |
b.o = c; | |
b.Uc(); | |
return b | |
}; | |
K.prototype.concat = function(a) { | |
return this.copy().Vc(a) | |
}; | |
K.prototype.insertAt = K.prototype.ce = function(a, b) { | |
v && (this.nh(b), D.p(a, K, "insertAt:i")); | |
0 > a && D.ua(a, ">= 0", K, "insertAt:i"); | |
this.J && D.qa(this, a); | |
var c = this.o; | |
a >= c.length ? c.push(b) : c.splice(a, 0, b); | |
this.Uc(); | |
return !0 | |
}; | |
K.prototype.remove = K.prototype["delete"] = K.prototype.remove = function(a) { | |
if (null === a) return !1; | |
v && this.nh(a); | |
this.J && D.qa(this, a); | |
var b = this.o; | |
a = b.indexOf(a); | |
if (-1 === a) return !1; | |
a === b.length - 1 ? b.pop() : b.splice(a, 1); | |
this.Uc(); | |
return !0 | |
}; | |
K.prototype.removeAt = K.prototype.pd = function(a) { | |
v && D.p(a, K, "removeAt:i"); | |
var b = this.o; | |
(0 > a || a >= b.length) && D.ua(a, "0 <= i < length", K, "removeAt:i"); | |
this.J && D.qa(this, a); | |
a === b.length - 1 ? b.pop() : b.splice(a, 1); | |
this.Uc() | |
}; | |
K.prototype.removeRange = K.prototype.removeRange = function(a, b) { | |
v && (D.p(a, K, "removeRange:from"), D.p(b, K, "removeRange:to")); | |
var c = this.o, | |
d = c.length; | |
if (0 > a) a = 0; | |
else if (a >= d) return this; | |
if (0 > b) return this; | |
b >= d && (b = d - 1); | |
if (a > b) return this; | |
this.J && D.qa(this); | |
for (var e = a, g = b + 1; g < d;) c[e++] = c[g++]; | |
c.length = d - (b - a + 1); | |
this.Uc(); | |
return this | |
}; | |
K.prototype.copy = function() { | |
var a = new K(this.ca), | |
b = this.o; | |
0 < b.length && (a.o = Array.prototype.slice.call(b)); | |
return a | |
}; | |
K.prototype.toArray = K.prototype.Fc = function() { | |
for (var a = this.o, b = this.count, c = Array(b), d = 0; d < b; d++) c[d] = a[d]; | |
return c | |
}; | |
K.prototype.toSet = K.prototype.nH = function() { | |
for (var a = new L(this.ca), b = this.o, c = this.count, d = 0; d < c; d++) a.add(b[d]); | |
return a | |
}; | |
K.prototype.sort = K.prototype.sort = function(a) { | |
v && D.h(a, "function", K, "sort:sortfunc"); | |
this.J && D.qa(this); | |
this.o.sort(a); | |
this.Uc(); | |
return this | |
}; | |
K.prototype.sortRange = K.prototype.Zq = function(a, b, c) { | |
var d = this.o, | |
e = d.length; | |
void 0 === b && (b = 0); | |
void 0 === c && (c = e); | |
v && (D.h(a, "function", K, "sortRange:sortfunc"), D.p(b, K, "sortRange:from"), D.p(c, K, "sortRange:to")); | |
this.J && D.qa(this); | |
var g = c - b; | |
if (1 >= g) return this; | |
(0 > b || b >= e - 1) && D.ua(b, "0 <= from < length", K, "sortRange:from"); | |
if (2 === g) return c = d[b], e = d[b + 1], 0 < a(c, e) && (d[b] = e, d[b + 1] = c, this.Uc()), this; | |
if (0 === b) | |
if (c >= e) d.sort(a); | |
else | |
for (g = d.slice(0, c), g.sort(a), a = 0; a < c; a++) d[a] = g[a]; | |
else if (c >= e) | |
for (g = d.slice(b), | |
g.sort(a), a = b; a < e; a++) d[a] = g[a - b]; | |
else | |
for (g = d.slice(b, c), g.sort(a), a = b; a < c; a++) d[a] = g[a - b]; | |
this.Uc(); | |
return this | |
}; | |
K.prototype.reverse = K.prototype.reverse = function() { | |
this.J && D.qa(this); | |
this.o.reverse(); | |
this.Uc(); | |
return this | |
}; | |
D.w(K, { | |
count: "count" | |
}, function() { | |
return this.o.length | |
}); | |
D.w(K, { | |
size: "size" | |
}, function() { | |
return this.o.length | |
}); | |
D.w(K, { | |
length: "length" | |
}, function() { | |
return this.o.length | |
}); | |
D.w(K, { | |
j: "iterator" | |
}, function() { | |
if (0 >= this.o.length) return Ka; | |
var a = this.$b; | |
return null !== a ? (a.reset(), a) : new Qa(this) | |
}); | |
D.w(K, { | |
bo: "iteratorBackwards" | |
}, function() { | |
if (0 >= this.o.length) return Ka; | |
var a = this.fj; | |
return null !== a ? (a.reset(), a) : new Ua(this) | |
}); | |
function Va(a) { | |
this.ri = a; | |
a.$b = null; | |
this.$a = a.I; | |
this.bb = null | |
} | |
D.ne(Va, { | |
key: !0, | |
value: !0 | |
}); | |
D.w(Va, { | |
j: "iterator" | |
}, function() { | |
return this | |
}); | |
Va.prototype.reset = Va.prototype.reset = function() { | |
var a = this.ri; | |
a.$b = null; | |
this.$a = a.I; | |
this.bb = null | |
}; | |
Va.prototype.next = Va.prototype.next = function() { | |
var a = this.ri; | |
if (a.I !== this.$a) { | |
if (null === this.key) return !1; | |
D.Va(a) | |
} | |
var b = this.bb, | |
b = null === b ? a.Ma : b.gb; | |
if (null !== b) return this.bb = b, this.value = b.value, this.key = b.key, !0; | |
this.Vf(); | |
return !1 | |
}; | |
Va.prototype.hasNext = function() { | |
return this.next() | |
}; | |
Va.prototype.first = Va.prototype.first = function() { | |
var a = this.ri; | |
this.$a = a.I; | |
a = a.Ma; | |
if (null !== a) { | |
this.bb = a; | |
var b = a.value; | |
this.key = a.key; | |
return this.value = b | |
} | |
return null | |
}; | |
Va.prototype.any = function(a) { | |
var b = this.ri; | |
b.$b = null; | |
var c = b.I; | |
this.bb = null; | |
for (var d = b.Ma; null !== d;) { | |
if (a(d.value)) return !0; | |
b.I !== c && D.Va(b); | |
d = d.gb | |
} | |
return !1 | |
}; | |
Va.prototype.all = function(a) { | |
var b = this.ri; | |
b.$b = null; | |
var c = b.I; | |
this.bb = null; | |
for (var d = b.Ma; null !== d;) { | |
if (!a(d.value)) return !1; | |
b.I !== c && D.Va(b); | |
d = d.gb | |
} | |
return !0 | |
}; | |
Va.prototype.each = function(a) { | |
var b = this.ri; | |
b.$b = null; | |
var c = b.I; | |
this.bb = null; | |
for (var d = b.Ma; null !== d;) a(d.value), b.I !== c && D.Va(b), d = d.gb; | |
return this | |
}; | |
Va.prototype.map = function(a) { | |
var b = this.ri; | |
b.$b = null; | |
for (var c = new K, d = b.I, e = b.Ma; null !== e;) c.add(a(e.value)), b.I !== d && D.Va(b), e = e.gb; | |
return c.j | |
}; | |
Va.prototype.filter = function(a) { | |
var b = this.ri; | |
b.$b = null; | |
for (var c = new K(b.ca), d = b.I, e = b.Ma; null !== e;) { | |
var g = e.value; | |
a(g) && c.add(g); | |
b.I !== d && D.Va(b); | |
e = e.gb | |
} | |
return c.j | |
}; | |
Va.prototype.concat = function(a) { | |
this.ri.$b = null; | |
return new Na(this, a.j) | |
}; | |
D.w(Va, { | |
count: "count" | |
}, function() { | |
return this.ri.Cd | |
}); | |
Va.prototype.Vf = function() { | |
this.value = this.key = null; | |
this.$a = -1; | |
this.ri.$b = this | |
}; | |
Va.prototype.toString = function() { | |
return null !== this.bb ? "SetIterator@" + this.bb.value : "SetIterator" | |
}; | |
function L(a) { | |
D.xc(this); | |
this.J = !1; | |
void 0 === a || null === a ? this.ca = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a ? this.ca = a : D.ua(a, "the string 'object', 'number' or 'string'", "Set constructor: type") : "function" === typeof a ? this.ca = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a : D.ua(a, "null, a primitive type name, or a class type", "Set constructor: type"); | |
this.Dd = {}; | |
this.Cd = 0; | |
this.$b = null; | |
this.I = 0; | |
this.ii = this.Ma = null | |
} | |
D.ka("Set", L); | |
L.prototype.nh = function(a) { | |
null !== this.ca && ("string" === typeof this.ca ? typeof a === this.ca && null !== a || D.kc(a, this.ca) : a instanceof this.ca || D.kc(a, this.ca)) | |
}; | |
L.prototype.Uc = function() { | |
var a = this.I; | |
a++; | |
999999999 < a && (a = 0); | |
this.I = a | |
}; | |
L.prototype.freeze = L.prototype.freeze = function() { | |
this.J = !0; | |
return this | |
}; | |
L.prototype.thaw = L.prototype.Xa = function() { | |
this.J = !1; | |
return this | |
}; | |
L.prototype.toString = function() { | |
return "Set(" + D.getTypeName(this.ca) + ")#" + D.Od(this) | |
}; | |
L.prototype.add = L.prototype.add = function(a) { | |
if (null === a) return !1; | |
v && this.nh(a); | |
this.J && D.qa(this, a); | |
var b = a; | |
D.Qa(a) && (b = D.sq(a)); | |
return void 0 === this.Dd[b] ? (this.Cd++, a = new Wa(a, a), this.Dd[b] = a, b = this.ii, null === b ? this.Ma = a : (a.Ep = b, b.gb = a), this.ii = a, this.Uc(), !0) : !1 | |
}; | |
L.prototype.addAll = L.prototype.Vc = function(a) { | |
if (null === a) return this; | |
this.J && D.qa(this); | |
if (D.isArray(a)) | |
for (var b = D.cb(a), c = 0; c < b; c++) this.add(D.La(a, c)); | |
else | |
for (a = a.j; a.next();) this.add(a.value); | |
return this | |
}; | |
L.prototype.contains = L.prototype.contains = function(a) { | |
if (null === a) return !1; | |
v && this.nh(a); | |
var b = a; | |
return D.Qa(a) && (b = D.Od(a), void 0 === b) ? !1 : void 0 !== this.Dd[b] | |
}; | |
L.prototype.has = L.prototype.has = function(a) { | |
return this.contains(a) | |
}; | |
L.prototype.containsAll = function(a) { | |
if (null === a) return !0; | |
for (a = a.j; a.next();) | |
if (!this.contains(a.value)) return !1; | |
return !0 | |
}; | |
L.prototype.containsAny = function(a) { | |
if (null === a) return !0; | |
for (a = a.j; a.next();) | |
if (this.contains(a.value)) return !0; | |
return !1 | |
}; | |
L.prototype.first = L.prototype.first = function() { | |
var a = this.Ma; | |
return null === a ? null : a.value | |
}; | |
L.prototype.any = function(a) { | |
for (var b = this.I, c = this.Ma; null !== c;) { | |
if (a(c.value)) return !0; | |
this.I !== b && D.Va(this); | |
c = c.gb | |
} | |
return !1 | |
}; | |
L.prototype.all = function(a) { | |
for (var b = this.I, c = this.Ma; null !== c;) { | |
if (!a(c.value)) return !1; | |
this.I !== b && D.Va(this); | |
c = c.gb | |
} | |
return !0 | |
}; | |
L.prototype.each = function(a) { | |
for (var b = this.I, c = this.Ma; null !== c;) a(c.value), this.I !== b && D.Va(this), c = c.gb; | |
return this | |
}; | |
L.prototype.map = function(a) { | |
for (var b = new L, c = this.I, d = this.Ma; null !== d;) b.add(a(d.value)), this.I !== c && D.Va(this), d = d.gb; | |
return b | |
}; | |
L.prototype.filter = function(a) { | |
for (var b = new L(this.ca), c = this.I, d = this.Ma; null !== d;) { | |
var e = d.value; | |
a(e) && b.add(e); | |
this.I !== c && D.Va(this); | |
d = d.gb | |
} | |
return b | |
}; | |
L.prototype.concat = function(a) { | |
return this.copy().Vc(a) | |
}; | |
L.prototype.remove = L.prototype["delete"] = L.prototype.remove = function(a) { | |
if (null === a) return !1; | |
v && this.nh(a); | |
this.J && D.qa(this, a); | |
var b = a; | |
if (D.Qa(a) && (b = D.Od(a), void 0 === b)) return !1; | |
a = this.Dd[b]; | |
if (void 0 === a) return !1; | |
var c = a.gb, | |
d = a.Ep; | |
null !== c && (c.Ep = d); | |
null !== d && (d.gb = c); | |
this.Ma === a && (this.Ma = c); | |
this.ii === a && (this.ii = d); | |
delete this.Dd[b]; | |
this.Cd--; | |
this.Uc(); | |
return !0 | |
}; | |
L.prototype.removeAll = L.prototype.Iy = function(a) { | |
if (null === a) return this; | |
this.J && D.qa(this); | |
if (D.isArray(a)) | |
for (var b = D.cb(a), c = 0; c < b; c++) this.remove(D.La(a, c)); | |
else | |
for (a = a.j; a.next();) this.remove(a.value); | |
return this | |
}; | |
L.prototype.retainAll = function(a) { | |
if (null === a || 0 === this.count) return this; | |
this.J && D.qa(this); | |
var b = new L(this.ca); | |
b.Vc(a); | |
a = []; | |
for (var c = this.j; c.next();) { | |
var d = c.value; | |
b.contains(d) || a.push(d) | |
} | |
this.Iy(a); | |
return this | |
}; | |
L.prototype.clear = L.prototype.clear = function() { | |
this.J && D.qa(this); | |
this.Dd = {}; | |
this.Cd = 0; | |
this.ii = this.Ma = null; | |
this.Uc() | |
}; | |
L.prototype.copy = function() { | |
var a = new L(this.ca), | |
b = this.Dd, | |
c; | |
for (c in b) a.add(b[c].value); | |
return a | |
}; | |
L.prototype.toArray = L.prototype.Fc = function() { | |
var a = Array(this.Cd), | |
b = this.Dd, | |
c = 0, | |
d; | |
for (d in b) a[c] = b[d].value, c++; | |
return a | |
}; | |
L.prototype.toList = function() { | |
var a = new K(this.ca), | |
b = this.Dd, | |
c; | |
for (c in b) a.add(b[c].value); | |
return a | |
}; | |
D.w(L, { | |
count: "count" | |
}, function() { | |
return this.Cd | |
}); | |
D.w(L, { | |
size: "size" | |
}, function() { | |
return this.Cd | |
}); | |
D.w(L, { | |
j: "iterator" | |
}, function() { | |
if (0 >= this.Cd) return Ka; | |
var a = this.$b; | |
return null !== a ? (a.reset(), a) : new Va(this) | |
}); | |
function Xa(a) { | |
this.Na = a; | |
this.$a = a.I; | |
this.bb = null | |
} | |
D.ne(Xa, { | |
key: !0, | |
value: !0 | |
}); | |
D.w(Xa, { | |
j: "iterator" | |
}, function() { | |
return this | |
}); | |
Xa.prototype.reset = Xa.prototype.reset = function() { | |
this.$a = this.Na.I; | |
this.bb = null | |
}; | |
Xa.prototype.next = Xa.prototype.next = function() { | |
var a = this.Na; | |
if (a.I !== this.$a) { | |
if (null === this.key) return !1; | |
D.Va(a) | |
} | |
var b = this.bb, | |
b = null === b ? a.Ma : b.gb; | |
if (null !== b) return this.bb = b, this.value = this.key = a = b.key, !0; | |
this.Vf(); | |
return !1 | |
}; | |
Xa.prototype.hasNext = function() { | |
return this.next() | |
}; | |
Xa.prototype.first = Xa.prototype.first = function() { | |
var a = this.Na; | |
this.$a = a.I; | |
a = a.Ma; | |
return null !== a ? (this.bb = a, this.value = this.key = a = a.key) : null | |
}; | |
Xa.prototype.any = function(a) { | |
var b = this.Na, | |
c = b.I; | |
this.bb = null; | |
for (var d = b.Ma; null !== d;) { | |
if (a(d.key)) return !0; | |
b.I !== c && D.Va(b); | |
d = d.gb | |
} | |
return !1 | |
}; | |
Xa.prototype.all = function(a) { | |
var b = this.Na, | |
c = b.I; | |
this.bb = null; | |
for (var d = b.Ma; null !== d;) { | |
if (!a(d.key)) return !1; | |
b.I !== c && D.Va(b); | |
d = d.gb | |
} | |
return !0 | |
}; | |
Xa.prototype.each = function(a) { | |
var b = this.Na, | |
c = b.I; | |
this.bb = null; | |
for (var d = b.Ma; null !== d;) a(d.key), b.I !== c && D.Va(b), d = d.gb; | |
return this | |
}; | |
Xa.prototype.map = function(a) { | |
var b = this.Na, | |
c = b.I; | |
this.bb = null; | |
for (var d = new K, e = b.Ma; null !== e;) d.add(a(e.key)), b.I !== c && D.Va(b), e = e.gb; | |
return d.j | |
}; | |
Xa.prototype.filter = function(a) { | |
var b = this.Na, | |
c = b.I; | |
this.bb = null; | |
for (var d = new K(b.cf), e = b.Ma; null !== e;) { | |
var g = e.key; | |
a(g) && d.add(g); | |
b.I !== c && D.Va(b); | |
e = e.gb | |
} | |
return d.j | |
}; | |
Xa.prototype.concat = function(a) { | |
return new Na(this, a.j) | |
}; | |
D.w(Xa, { | |
count: "count" | |
}, function() { | |
return this.Na.Cd | |
}); | |
Xa.prototype.Vf = function() { | |
this.value = this.key = null; | |
this.$a = -1 | |
}; | |
Xa.prototype.toString = function() { | |
return null !== this.bb ? "MapKeySetIterator@" + this.bb.value : "MapKeySetIterator" | |
}; | |
function Ya(a) { | |
D.xc(this); | |
this.J = !0; | |
this.Na = a | |
} | |
D.Ta(Ya, L); | |
Ya.prototype.freeze = function() { | |
return this | |
}; | |
Ya.prototype.Xa = function() { | |
return this | |
}; | |
Ya.prototype.toString = function() { | |
return "MapKeySet(" + this.Na.toString() + ")" | |
}; | |
Ya.prototype.add = Ya.prototype.add = function() { | |
D.k("This Set is read-only: " + this.toString()); | |
return !1 | |
}; | |
Ya.prototype.set = Ya.prototype.set = function() { | |
D.k("This Set is read-only: " + this.toString()); | |
return !1 | |
}; | |
Ya.prototype.contains = Ya.prototype.contains = function(a) { | |
return this.Na.contains(a) | |
}; | |
Ya.prototype.has = Ya.prototype.has = function(a) { | |
return this.contains(a) | |
}; | |
Ya.prototype.remove = Ya.prototype["delete"] = Ya.prototype.remove = function() { | |
D.k("This Set is read-only: " + this.toString()); | |
return !1 | |
}; | |
Ya.prototype.clear = Ya.prototype.clear = function() { | |
D.k("This Set is read-only: " + this.toString()) | |
}; | |
Ya.prototype.first = Ya.prototype.first = function() { | |
var a = this.Na.Ma; | |
return null !== a ? a.key : null | |
}; | |
Ya.prototype.any = function(a) { | |
for (var b = this.Na.Ma; null !== b;) { | |
if (a(b.key)) return !0; | |
b = b.gb | |
} | |
return !1 | |
}; | |
Ya.prototype.all = function(a) { | |
for (var b = this.Na.Ma; null !== b;) { | |
if (!a(b.key)) return !1; | |
b = b.gb | |
} | |
return !0 | |
}; | |
Ya.prototype.each = function(a) { | |
for (var b = this.Na.Ma; null !== b;) a(b.key), b = b.gb; | |
return this | |
}; | |
Ya.prototype.map = function(a) { | |
for (var b = new L, c = this.Na.Ma; null !== c;) b.add(a(c.key)), c = c.gb; | |
return b | |
}; | |
Ya.prototype.filter = function(a) { | |
for (var b = new L(this.Na.cf), c = this.Na.Ma; null !== c;) { | |
var d = c.key; | |
a(d) && b.add(d); | |
c = c.gb | |
} | |
return b | |
}; | |
Ya.prototype.concat = function(a) { | |
return this.nH().Vc(a) | |
}; | |
Ya.prototype.copy = function() { | |
return new Ya(this.Na) | |
}; | |
Ya.prototype.toSet = Ya.prototype.nH = function() { | |
var a = new L(this.Na.cf), | |
b = this.Na.Dd, | |
c; | |
for (c in b) a.add(b[c].key); | |
return a | |
}; | |
Ya.prototype.toArray = Ya.prototype.Fc = function() { | |
var a = this.Na.Dd, | |
b = Array(this.Na.Cd), | |
c = 0, | |
d; | |
for (d in a) b[c] = a[d].key, c++; | |
return b | |
}; | |
Ya.prototype.toList = function() { | |
var a = new K(this.Na.cf), | |
b = this.Na.Dd, | |
c; | |
for (c in b) a.add(b[c].key); | |
return a | |
}; | |
D.w(Ya, { | |
count: "count" | |
}, function() { | |
return this.Na.Cd | |
}); | |
D.w(Ya, { | |
size: "size" | |
}, function() { | |
return this.Na.Cd | |
}); | |
D.w(Ya, { | |
j: "iterator" | |
}, function() { | |
return 0 >= this.Na.Cd ? Ka : new Xa(this.Na) | |
}); | |
function Za(a) { | |
this.Na = a; | |
a.gj = null; | |
this.$a = a.I; | |
this.bb = null | |
} | |
D.ne(Za, { | |
key: !0, | |
value: !0 | |
}); | |
D.w(Za, { | |
j: "iterator" | |
}, function() { | |
return this | |
}); | |
Za.prototype.reset = Za.prototype.reset = function() { | |
var a = this.Na; | |
a.gj = null; | |
this.$a = a.I; | |
this.bb = null | |
}; | |
Za.prototype.next = Za.prototype.next = function() { | |
var a = this.Na; | |
if (a.I !== this.$a) { | |
if (null === this.key) return !1; | |
D.Va(a) | |
} | |
var b = this.bb, | |
b = null === b ? a.Ma : b.gb; | |
if (null !== b) return this.bb = b, this.value = b.value, this.key = b.key, !0; | |
this.Vf(); | |
return !1 | |
}; | |
Za.prototype.hasNext = function() { | |
return this.next() | |
}; | |
Za.prototype.first = Za.prototype.first = function() { | |
var a = this.Na; | |
this.$a = a.I; | |
a = a.Ma; | |
if (null !== a) { | |
this.bb = a; | |
var b = a.value; | |
this.key = a.key; | |
return this.value = b | |
} | |
return null | |
}; | |
Za.prototype.any = function(a) { | |
var b = this.Na; | |
b.gj = null; | |
var c = b.I; | |
this.bb = null; | |
for (var d = b.Ma; null !== d;) { | |
if (a(d.value)) return !0; | |
b.I !== c && D.Va(b); | |
d = d.gb | |
} | |
return !1 | |
}; | |
Za.prototype.all = function(a) { | |
var b = this.Na; | |
b.gj = null; | |
var c = b.I; | |
this.bb = null; | |
for (var d = b.Ma; null !== d;) { | |
if (!a(d.value)) return !1; | |
b.I !== c && D.Va(b); | |
d = d.gb | |
} | |
return !0 | |
}; | |
Za.prototype.each = function(a) { | |
var b = this.Na; | |
b.gj = null; | |
var c = b.I; | |
this.bb = null; | |
for (var d = b.Ma; null !== d;) a(d.value), b.I !== c && D.Va(b), d = d.gb; | |
return this | |
}; | |
Za.prototype.map = function(a) { | |
var b = this.Na; | |
b.gj = null; | |
var c = b.I; | |
this.bb = null; | |
for (var d = new K, e = b.Ma; null !== e;) d.add(a(e.value)), b.I !== c && D.Va(b), e = e.gb; | |
return d.j | |
}; | |
Za.prototype.filter = function(a) { | |
var b = this.Na; | |
b.gj = null; | |
var c = b.I; | |
this.bb = null; | |
for (var d = new K(b.cf), e = b.Ma; null !== e;) { | |
var g = e.value; | |
a(g) && d.add(g); | |
b.I !== c && D.Va(b); | |
e = e.gb | |
} | |
return d.j | |
}; | |
Za.prototype.concat = function(a) { | |
this.Na.gj = null; | |
return new Na(this, a.j) | |
}; | |
D.w(Za, { | |
count: "count" | |
}, function() { | |
return this.Na.Cd | |
}); | |
Za.prototype.Vf = function() { | |
this.value = this.key = null; | |
this.$a = -1; | |
this.Na.gj = this | |
}; | |
Za.prototype.toString = function() { | |
return null !== this.bb ? "MapValueSetIterator@" + this.bb.value : "MapValueSetIterator" | |
}; | |
function Wa(a, b) { | |
this.key = a; | |
this.value = b; | |
this.Ep = this.gb = null | |
} | |
D.ne(Wa, { | |
key: !0, | |
value: !0 | |
}); | |
Wa.prototype.toString = function() { | |
return "{" + this.key + ":" + this.value + "}" | |
}; | |
function $a(a) { | |
this.Na = a; | |
a.$b = null; | |
this.$a = a.I; | |
this.bb = null | |
} | |
D.ne($a, { | |
key: !0, | |
value: !0 | |
}); | |
D.w($a, { | |
j: "iterator" | |
}, function() { | |
return this | |
}); | |
$a.prototype.reset = $a.prototype.reset = function() { | |
var a = this.Na; | |
a.$b = null; | |
this.$a = a.I; | |
this.bb = null | |
}; | |
$a.prototype.next = $a.prototype.next = function() { | |
var a = this.Na; | |
if (a.I !== this.$a) { | |
if (null === this.key) return !1; | |
D.Va(a) | |
} | |
var b = this.bb, | |
b = null === b ? a.Ma : b.gb; | |
if (null !== b) return this.bb = b, this.key = b.key, this.value = b.value, !0; | |
this.Vf(); | |
return !1 | |
}; | |
$a.prototype.hasNext = function() { | |
return this.next() | |
}; | |
$a.prototype.first = $a.prototype.first = function() { | |
var a = this.Na; | |
this.$a = a.I; | |
a = a.Ma; | |
return null !== a ? (this.bb = a, this.key = a.key, this.value = a.value, a) : null | |
}; | |
$a.prototype.any = function(a) { | |
var b = this.Na; | |
b.$b = null; | |
var c = b.I; | |
this.bb = null; | |
for (var d = b.Ma; null !== d;) { | |
if (a(d)) return !0; | |
b.I !== c && D.Va(b); | |
d = d.gb | |
} | |
return !1 | |
}; | |
$a.prototype.all = function(a) { | |
var b = this.Na; | |
b.$b = null; | |
var c = b.I; | |
this.bb = null; | |
for (var d = b.Ma; null !== d;) { | |
if (!a(d)) return !1; | |
b.I !== c && D.Va(b); | |
d = d.gb | |
} | |
return !0 | |
}; | |
$a.prototype.each = function(a) { | |
var b = this.Na; | |
b.$b = null; | |
var c = b.I; | |
this.bb = null; | |
for (var d = b.Ma; null !== d;) a(d), b.I !== c && D.Va(b), d = d.gb; | |
return this | |
}; | |
$a.prototype.map = function(a) { | |
var b = this.Na; | |
b.$b = null; | |
var c = b.I; | |
this.bb = null; | |
for (var d = new K, e = b.Ma; null !== e;) d.add(a(e)), b.I !== c && D.Va(b), e = e.gb; | |
return d.j | |
}; | |
$a.prototype.filter = function(a) { | |
var b = this.Na; | |
b.$b = null; | |
var c = b.I; | |
this.bb = null; | |
for (var d = new K, e = b.Ma; null !== e;) a(e) && d.add(e), b.I !== c && D.Va(b), e = e.gb; | |
return d.j | |
}; | |
$a.prototype.concat = function(a) { | |
this.Na.$b = null; | |
return new Na(this, a.j) | |
}; | |
D.w($a, { | |
count: "count" | |
}, function() { | |
return this.Na.Cd | |
}); | |
$a.prototype.Vf = function() { | |
this.value = this.key = null; | |
this.$a = -1; | |
this.Na.$b = this | |
}; | |
$a.prototype.toString = function() { | |
return null !== this.bb ? "MapIterator@" + this.bb : "MapIterator" | |
}; | |
function na(a, b) { | |
D.xc(this); | |
this.J = !1; | |
void 0 === a || null === a ? this.cf = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a ? this.cf = a : D.ua(a, "the string 'object', 'number' or 'string'", "Map constructor: keytype") : "function" === typeof a ? this.cf = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a : D.ua(a, "null, a primitive type name, or a class type", "Map constructor: keytype"); | |
void 0 === b || null === b ? this.Bi = null : "string" === typeof b ? "object" === b || "string" === b || "boolean" === b || "number" === | |
b || "function" === b ? this.Bi = b : D.ua(b, "the string 'object', 'number', 'string', 'boolean', or 'function'", "Map constructor: valtype") : "function" === typeof b ? this.Bi = b === Object ? "object" : b === String ? "string" : b === Number ? "number" : b === Boolean ? "boolean" : b === Function ? "function" : b : D.ua(b, "null, a primitive type name, or a class type", "Map constructor: valtype"); | |
this.Dd = {}; | |
this.Cd = 0; | |
this.gj = this.$b = null; | |
this.I = 0; | |
this.ii = this.Ma = null | |
} | |
D.ka("Map", na); | |
function bb(a, b) { | |
null !== a.cf && ("string" === typeof a.cf ? typeof b === a.cf && null !== b || D.kc(b, a.cf) : b instanceof a.cf || D.kc(b, a.cf)) | |
} | |
na.prototype.Uc = function() { | |
var a = this.I; | |
a++; | |
999999999 < a && (a = 0); | |
this.I = a | |
}; | |
na.prototype.freeze = na.prototype.freeze = function() { | |
this.J = !0; | |
return this | |
}; | |
na.prototype.thaw = na.prototype.Xa = function() { | |
this.J = !1; | |
return this | |
}; | |
na.prototype.toString = function() { | |
return "Map(" + D.getTypeName(this.cf) + "," + D.getTypeName(this.Bi) + ")#" + D.Od(this) | |
}; | |
na.prototype.add = na.prototype.add = function(a, b) { | |
v && (bb(this, a), null !== this.Bi && ("string" === typeof this.Bi ? typeof b === this.Bi && null !== b || D.kc(b, this.Bi) : b instanceof this.Bi || D.kc(b, this.Bi))); | |
this.J && D.qa(this, a); | |
var c = a; | |
D.Qa(a) && (c = D.sq(a)); | |
var d = this.Dd[c]; | |
if (void 0 === d) return this.Cd++, d = new Wa(a, b), this.Dd[c] = d, c = this.ii, null === c ? this.Ma = d : (d.Ep = c, c.gb = d), this.ii = d, this.Uc(), !0; | |
d.value = b; | |
return !1 | |
}; | |
na.prototype.set = na.prototype.set = function(a, b) { | |
return this.add(a, b) | |
}; | |
na.prototype.addAll = na.prototype.Vc = function(a) { | |
if (null === a) return this; | |
if (D.isArray(a)) | |
for (var b = D.cb(a), c = 0; c < b; c++) { | |
var d = D.La(a, c); | |
this.add(d.key, d.value) | |
} else | |
for (a = a.j; a.next();) this.add(a.key, a.value); | |
return this | |
}; | |
na.prototype.first = na.prototype.first = function() { | |
return this.Ma | |
}; | |
na.prototype.any = function(a) { | |
for (var b = this.I, c = this.Ma; null !== c;) { | |
if (a(c)) return !0; | |
this.I !== b && D.Va(this); | |
c = c.gb | |
} | |
return !1 | |
}; | |
na.prototype.all = function(a) { | |
for (var b = this.I, c = this.Ma; null !== c;) { | |
if (!a(c)) return !1; | |
this.I !== b && D.Va(this); | |
c = c.gb | |
} | |
return !0 | |
}; | |
na.prototype.each = function(a) { | |
for (var b = this.I, c = this.Ma; null !== c;) a(c), this.I !== b && D.Va(this), c = c.gb; | |
return this | |
}; | |
na.prototype.map = function(a) { | |
for (var b = new na(this.cf), c = this.I, d = this.Ma; null !== d;) b.add(d.key, a(d)), this.I !== c && D.Va(this), d = d.gb; | |
return b | |
}; | |
na.prototype.filter = function(a) { | |
for (var b = new na(this.cf, this.Bi), c = this.I, d = this.Ma; null !== d;) a(d) && b.add(d.key, d.value), this.I !== c && D.Va(this), d = d.gb; | |
return b | |
}; | |
na.prototype.concat = function(a) { | |
return this.copy().Vc(a) | |
}; | |
na.prototype.contains = na.prototype.contains = function(a) { | |
v && bb(this, a); | |
var b = a; | |
return D.Qa(a) && (b = D.Od(a), void 0 === b) ? !1 : void 0 !== this.Dd[b] | |
}; | |
na.prototype.has = na.prototype.has = function(a) { | |
return this.contains(a) | |
}; | |
na.prototype.getValue = na.prototype.oa = function(a) { | |
v && bb(this, a); | |
var b = a; | |
if (D.Qa(a) && (b = D.Od(a), void 0 === b)) return null; | |
a = this.Dd[b]; | |
return void 0 === a ? null : a.value | |
}; | |
na.prototype.get = na.prototype.get = function(a) { | |
return this.oa(a) | |
}; | |
na.prototype.remove = na.prototype["delete"] = na.prototype.remove = function(a) { | |
if (null === a) return !1; | |
v && bb(this, a); | |
this.J && D.qa(this, a); | |
var b = a; | |
if (D.Qa(a) && (b = D.Od(a), void 0 === b)) return !1; | |
a = this.Dd[b]; | |
if (void 0 === a) return !1; | |
var c = a.gb, | |
d = a.Ep; | |
null !== c && (c.Ep = d); | |
null !== d && (d.gb = c); | |
this.Ma === a && (this.Ma = c); | |
this.ii === a && (this.ii = d); | |
delete this.Dd[b]; | |
this.Cd--; | |
this.Uc(); | |
return !0 | |
}; | |
na.prototype.clear = na.prototype.clear = function() { | |
this.J && D.qa(this); | |
this.Dd = {}; | |
this.Cd = 0; | |
this.ii = this.Ma = null; | |
this.Uc() | |
}; | |
na.prototype.copy = function() { | |
var a = new na(this.cf, this.Bi), | |
b = this.Dd, | |
c; | |
for (c in b) { | |
var d = b[c]; | |
a.add(d.key, d.value) | |
} | |
return a | |
}; | |
na.prototype.toArray = na.prototype.Fc = function() { | |
var a = this.Dd, | |
b = Array(this.Cd), | |
c = 0, | |
d; | |
for (d in a) { | |
var e = a[d]; | |
b[c] = new Wa(e.key, e.value); | |
c++ | |
} | |
return b | |
}; | |
na.prototype.toKeySet = na.prototype.bk = function() { | |
return new Ya(this) | |
}; | |
D.w(na, { | |
count: "count" | |
}, function() { | |
return this.Cd | |
}); | |
D.w(na, { | |
size: "size" | |
}, function() { | |
return this.Cd | |
}); | |
D.w(na, { | |
j: "iterator" | |
}, function() { | |
if (0 >= this.count) return Ka; | |
var a = this.$b; | |
return null !== a ? (a.reset(), a) : new $a(this) | |
}); | |
D.w(na, { | |
nG: "iteratorKeys" | |
}, function() { | |
return 0 >= this.count ? Ka : new Xa(this) | |
}); | |
D.w(na, { | |
oG: "iteratorValues" | |
}, function() { | |
if (0 >= this.count) return Ka; | |
var a = this.gj; | |
return null !== a ? (a.reset(), a) : new Za(this) | |
}); | |
function N(a, b) { | |
void 0 === a ? this.N = this.M = 0 : "number" === typeof a && "number" === typeof b ? (this.M = a, this.N = b) : D.k("Invalid arguments to Point constructor: " + a + ", " + b); | |
this.J = !1 | |
} | |
D.ka("Point", N); | |
D.Di(N); | |
D.ne(N, { | |
x: !0, | |
y: !0 | |
}); | |
N.prototype.assign = function(a) { | |
this.M = a.M; | |
this.N = a.N | |
}; | |
N.prototype.setTo = N.prototype.n = function(a, b) { | |
v && (D.h(a, "number", N, "setTo:x"), D.h(b, "number", N, "setTo:y")); | |
this.M = a; | |
this.N = b; | |
return this | |
}; | |
N.prototype.set = N.prototype.set = function(a) { | |
v && D.l(a, N, N, "set:p"); | |
this.Sa(); | |
this.M = a.M; | |
this.N = a.N; | |
return this | |
}; | |
N.prototype.copy = function() { | |
var a = new N; | |
a.M = this.M; | |
a.N = this.N; | |
return a | |
}; | |
f = N.prototype; | |
f.Oa = function() { | |
this.J = !0; | |
Object.freeze(this); | |
return this | |
}; | |
f.V = function() { | |
return Object.isFrozen(this) ? this : this.copy().freeze() | |
}; | |
f.freeze = function() { | |
this.J = !0; | |
return this | |
}; | |
f.Xa = function() { | |
Object.isFrozen(this) && D.k("cannot thaw constant: " + this); | |
this.J = !1; | |
return this | |
}; | |
f.Sa = function(a) { | |
if (this.J) { | |
var b = "The Point is frozen, so its properties cannot be set: " + this.toString(); | |
void 0 !== a && (b += " to value: " + a); | |
D.k(b) | |
} | |
}; | |
N.parse = function(a) { | |
if ("string" === typeof a) { | |
a = a.split(" "); | |
for (var b = 0, c = 0; | |
"" === a[b];) b++; | |
var d = a[b++]; | |
d && (c = parseFloat(d)); | |
for (var e = 0; | |
"" === a[b];) b++; | |
(d = a[b++]) && (e = parseFloat(d)); | |
return new N(c, e) | |
} | |
return new N | |
}; | |
N.stringify = function(a) { | |
v && D.l(a, N); | |
return a.x.toString() + " " + a.y.toString() | |
}; | |
N.prototype.toString = function() { | |
return "Point(" + this.x + "," + this.y + ")" | |
}; | |
N.prototype.equals = N.prototype.O = function(a) { | |
return a instanceof N ? this.M === a.x && this.N === a.y : !1 | |
}; | |
N.prototype.equalTo = N.prototype.Ux = function(a, b) { | |
return this.M === a && this.N === b | |
}; | |
N.prototype.equalsApprox = N.prototype.Wc = function(a) { | |
return Q(this.M, a.x) && Q(this.N, a.y) | |
}; | |
N.prototype.add = N.prototype.add = function(a) { | |
v && D.l(a, N, N, "add:p"); | |
this.Sa(); | |
this.M += a.x; | |
this.N += a.y; | |
return this | |
}; | |
N.prototype.subtract = N.prototype.$j = function(a) { | |
v && D.l(a, N, N, "subtract:p"); | |
this.Sa(); | |
this.M -= a.x; | |
this.N -= a.y; | |
return this | |
}; | |
N.prototype.offset = N.prototype.offset = function(a, b) { | |
v && (D.p(a, N, "offset:dx"), D.p(b, N, "offset:dy")); | |
this.Sa(); | |
this.M += a; | |
this.N += b; | |
return this | |
}; | |
N.prototype.rotate = N.prototype.rotate = function(a) { | |
v && D.p(a, N, "rotate:angle"); | |
this.Sa(); | |
if (0 === a) return this; | |
var b = this.M, | |
c = this.N; | |
if (0 === b && 0 === c) return this; | |
var d = 0, | |
e = 0; | |
360 <= a ? a -= 360 : 0 > a && (a += 360); | |
90 === a ? (d = 0, e = 1) : 180 === a ? (d = -1, e = 0) : 270 === a ? (d = 0, e = -1) : (a = a * Math.PI / 180, d = Math.cos(a), e = Math.sin(a)); | |
this.M = d * b - e * c; | |
this.N = e * b + d * c; | |
return this | |
}; | |
N.prototype.scale = N.prototype.scale = function(a, b) { | |
v && (D.p(a, N, "scale:sx"), D.p(b, N, "scale:sy")); | |
this.M *= a; | |
this.N *= b; | |
return this | |
}; | |
N.prototype.distanceSquaredPoint = N.prototype.Kf = function(a) { | |
v && D.l(a, N, N, "distanceSquaredPoint:p"); | |
var b = a.x - this.M; | |
a = a.y - this.N; | |
return b * b + a * a | |
}; | |
N.prototype.distanceSquared = N.prototype.mq = function(a, b) { | |
v && (D.p(a, N, "distanceSquared:px"), D.p(b, N, "distanceSquared:py")); | |
var c = a - this.M, | |
d = b - this.N; | |
return c * c + d * d | |
}; | |
N.prototype.normalize = N.prototype.normalize = function() { | |
this.Sa(); | |
var a = this.M, | |
b = this.N, | |
c = Math.sqrt(a * a + b * b); | |
0 < c && (this.M = a / c, this.N = b / c); | |
return this | |
}; | |
N.prototype.directionPoint = N.prototype.Xb = function(a) { | |
v && D.l(a, N, N, "directionPoint:p"); | |
return cb(a.x - this.M, a.y - this.N) | |
}; | |
N.prototype.direction = N.prototype.direction = function(a, b) { | |
v && (D.p(a, N, "direction:px"), D.p(b, N, "direction:py")); | |
return cb(a - this.M, b - this.N) | |
}; | |
function cb(a, b) { | |
if (0 === a) return 0 < b ? 90 : 0 > b ? 270 : 0; | |
if (0 === b) return 0 < a ? 0 : 180; | |
if (isNaN(a) || isNaN(b)) return 0; | |
var c = 180 * Math.atan(Math.abs(b / a)) / Math.PI; | |
0 > a ? c = 0 > b ? c + 180 : 180 - c : 0 > b && (c = 360 - c); | |
return c | |
} | |
N.prototype.projectOntoLineSegment = function(a, b, c, d) { | |
v && (D.p(a, N, "projectOntoLineSegment:px"), D.p(b, N, "projectOntoLineSegment:py"), D.p(c, N, "projectOntoLineSegment:qx"), D.p(d, N, "projectOntoLineSegment:qy")); | |
db(a, b, c, d, this.M, this.N, this); | |
return this | |
}; | |
N.prototype.projectOntoLineSegmentPoint = function(a, b) { | |
v && (D.l(a, N, N, "projectOntoLineSegmentPoint:p"), D.l(b, N, N, "projectOntoLineSegmentPoint:q")); | |
db(a.x, a.y, b.x, b.y, this.M, this.N, this); | |
return this | |
}; | |
N.prototype.snapToGrid = function(a, b, c, d) { | |
v && (D.p(a, N, "snapToGrid:originx"), D.p(b, N, "snapToGrid:originy"), D.p(c, N, "snapToGrid:cellwidth"), D.p(d, N, "snapToGrid:cellheight")); | |
gb(this.M, this.N, a, b, c, d, this); | |
return this | |
}; | |
N.prototype.snapToGridPoint = function(a, b) { | |
v && (D.l(a, N, N, "snapToGridPoint:p"), D.l(b, Ca, N, "snapToGridPoint:q")); | |
gb(this.M, this.N, a.x, a.y, b.width, b.height, this); | |
return this | |
}; | |
N.prototype.setRectSpot = N.prototype.vo = function(a, b) { | |
v && (D.l(a, C, N, "setRectSpot:r"), D.l(b, S, N, "setRectSpot:spot")); | |
this.Sa(); | |
this.M = a.x + b.x * a.width + b.offsetX; | |
this.N = a.y + b.y * a.height + b.offsetY; | |
return this | |
}; | |
N.prototype.setSpot = N.prototype.pv = function(a, b, c, d, e) { | |
v && (D.p(a, N, "setSpot:x"), D.p(b, N, "setSpot:y"), D.p(c, N, "setSpot:w"), D.p(d, N, "setSpot:h"), (0 > c || 0 > d) && D.k("Point.setSpot:Width and height cannot be negative"), D.l(e, S, N, "setSpot:spot")); | |
this.Sa(); | |
this.M = a + e.x * c + e.offsetX; | |
this.N = b + e.y * d + e.offsetY; | |
return this | |
}; | |
N.prototype.transform = function(a) { | |
v && D.l(a, Ea, N, "transform:t"); | |
a.vb(this); | |
return this | |
}; | |
function kb(a, b) { | |
v && D.l(b, Ea, N, "transformInverted:t"); | |
b.Oh(a); | |
return a | |
} | |
var lb; | |
N.distanceLineSegmentSquared = lb = function(a, b, c, d, e, g) { | |
v && (D.p(a, N, "distanceLineSegmentSquared:px"), D.p(b, N, "distanceLineSegmentSquared:py"), D.p(c, N, "distanceLineSegmentSquared:ax"), D.p(d, N, "distanceLineSegmentSquared:ay"), D.p(e, N, "distanceLineSegmentSquared:bx"), D.p(g, N, "distanceLineSegmentSquared:by")); | |
var h = e - c, | |
k = g - d, | |
l = h * h + k * k; | |
c -= a; | |
d -= b; | |
var m = -c * h - d * k; | |
if (0 >= m || m >= l) return h = e - a, k = g - b, Math.min(c * c + d * d, h * h + k * k); | |
a = h * d - k * c; | |
return a * a / l | |
}; | |
var mb; | |
N.distanceSquared = mb = function(a, b, c, d) { | |
v && (D.p(a, N, "distanceSquared:px"), D.p(b, N, "distanceSquared:py"), D.p(c, N, "distanceSquared:qx"), D.p(d, N, "distanceSquared:qy")); | |
a = c - a; | |
b = d - b; | |
return a * a + b * b | |
}; | |
var wb; | |
N.direction = wb = function(a, b, c, d) { | |
v && (D.p(a, N, "direction:px"), D.p(b, N, "direction:py"), D.p(c, N, "direction:qx"), D.p(d, N, "direction:qy")); | |
a = c - a; | |
b = d - b; | |
if (0 === a) return 0 < b ? 90 : 0 > b ? 270 : 0; | |
if (0 === b) return 0 < a ? 0 : 180; | |
if (isNaN(a) || isNaN(b)) return 0; | |
d = 180 * Math.atan(Math.abs(b / a)) / Math.PI; | |
0 > a ? d = 0 > b ? d + 180 : 180 - d : 0 > b && (d = 360 - d); | |
return d | |
}; | |
D.defineProperty(N, { | |
x: "x" | |
}, function() { | |
return this.M | |
}, function(a) { | |
this.Sa(a); | |
v && D.h(a, "number", N, "x"); | |
this.M = a | |
}); | |
D.defineProperty(N, { | |
y: "y" | |
}, function() { | |
return this.N | |
}, function(a) { | |
this.Sa(a); | |
v && D.h(a, "number", N, "y"); | |
this.N = a | |
}); | |
N.prototype.isReal = N.prototype.H = function() { | |
return isFinite(this.x) && isFinite(this.y) | |
}; | |
function Ca(a, b) { | |
void 0 === a ? this.Ha = this.Ia = 0 : "number" === typeof a && (0 <= a || isNaN(a)) && "number" === typeof b && (0 <= b || isNaN(b)) ? (this.Ia = a, this.Ha = b) : D.k("Invalid arguments to Size constructor: " + a + ", " + b); | |
this.J = !1 | |
} | |
D.ka("Size", Ca); | |
D.Di(Ca); | |
D.ne(Ca, { | |
width: !0, | |
height: !0 | |
}); | |
Ca.prototype.assign = function(a) { | |
this.Ia = a.Ia; | |
this.Ha = a.Ha | |
}; | |
Ca.prototype.setTo = Ca.prototype.n = function(a, b) { | |
v && (D.h(a, "number", Ca, "setTo:w"), D.h(b, "number", Ca, "setTo:h"), 0 > a && D.ua(a, ">= 0", Ca, "setTo:w"), 0 > b && D.ua(b, ">= 0", Ca, "setTo:h")); | |
this.Ia = a; | |
this.Ha = b; | |
return this | |
}; | |
Ca.prototype.set = Ca.prototype.set = function(a) { | |
v && D.l(a, Ca, Ca, "set:s"); | |
this.Sa(); | |
this.Ia = a.Ia; | |
this.Ha = a.Ha; | |
return this | |
}; | |
Ca.prototype.copy = function() { | |
var a = new Ca; | |
a.Ia = this.Ia; | |
a.Ha = this.Ha; | |
return a | |
}; | |
f = Ca.prototype; | |
f.Oa = function() { | |
this.J = !0; | |
Object.freeze(this); | |
return this | |
}; | |
f.V = function() { | |
return Object.isFrozen(this) ? this : this.copy().freeze() | |
}; | |
f.freeze = function() { | |
this.J = !0; | |
return this | |
}; | |
f.Xa = function() { | |
Object.isFrozen(this) && D.k("cannot thaw constant: " + this); | |
this.J = !1; | |
return this | |
}; | |
f.Sa = function(a) { | |
if (this.J) { | |
var b = "The Size is frozen, so its properties cannot be set: " + this.toString(); | |
void 0 !== a && (b += " to value: " + a); | |
D.k(b) | |
} | |
}; | |
Ca.parse = function(a) { | |
if ("string" === typeof a) { | |
a = a.split(" "); | |
for (var b = 0, c = 0; | |
"" === a[b];) b++; | |
var d = a[b++]; | |
d && (c = parseFloat(d)); | |
for (var e = 0; | |
"" === a[b];) b++; | |
(d = a[b++]) && (e = parseFloat(d)); | |
return new Ca(c, e) | |
} | |
return new Ca | |
}; | |
Ca.stringify = function(a) { | |
v && D.l(a, Ca); | |
return a.width.toString() + " " + a.height.toString() | |
}; | |
Ca.prototype.toString = function() { | |
return "Size(" + this.width + "," + this.height + ")" | |
}; | |
Ca.prototype.equals = Ca.prototype.O = function(a) { | |
return a instanceof Ca ? this.Ia === a.width && this.Ha === a.height : !1 | |
}; | |
Ca.prototype.equalTo = Ca.prototype.Ux = function(a, b) { | |
return this.Ia === a && this.Ha === b | |
}; | |
Ca.prototype.equalsApprox = Ca.prototype.Wc = function(a) { | |
return Q(this.Ia, a.width) && Q(this.Ha, a.height) | |
}; | |
D.defineProperty(Ca, { | |
width: "width" | |
}, function() { | |
return this.Ia | |
}, function(a) { | |
this.Sa(a); | |
v && D.h(a, "number", Ca, "width"); | |
0 > a && D.ua(a, ">= 0", Ca, "width"); | |
this.Ia = a | |
}); | |
D.defineProperty(Ca, { | |
height: "height" | |
}, function() { | |
return this.Ha | |
}, function(a) { | |
this.Sa(a); | |
v && D.h(a, "number", Ca, "height"); | |
0 > a && D.ua(a, ">= 0", Ca, "height"); | |
this.Ha = a | |
}); | |
Ca.prototype.isReal = Ca.prototype.H = function() { | |
return isFinite(this.width) && isFinite(this.height) | |
}; | |
function C(a, b, c, d) { | |
void 0 === a ? this.Ha = this.Ia = this.N = this.M = 0 : a instanceof N ? b instanceof N ? (this.M = Math.min(a.M, b.M), this.N = Math.min(a.N, b.N), this.Ia = Math.abs(a.M - b.M), this.Ha = Math.abs(a.N - b.N)) : b instanceof Ca ? (this.M = a.M, this.N = a.N, this.Ia = b.Ia, this.Ha = b.Ha) : D.k("Incorrect arguments supplied to Rect constructor") : "number" === typeof a && "number" === typeof b && "number" === typeof c && (0 <= c || isNaN(c)) && "number" === typeof d && (0 <= d || isNaN(d)) ? (this.M = a, this.N = b, this.Ia = c, this.Ha = d) : D.k("Invalid arguments to Rect constructor: " + | |
a + ", " + b + ", " + c + ", " + d); | |
this.J = !1 | |
} | |
D.ka("Rect", C); | |
D.Di(C); | |
D.ne(C, { | |
x: !0, | |
y: !0, | |
width: !0, | |
height: !0 | |
}); | |
C.prototype.assign = function(a) { | |
this.M = a.M; | |
this.N = a.N; | |
this.Ia = a.Ia; | |
this.Ha = a.Ha | |
}; | |
function Cb(a, b, c) { | |
a.Ia = b; | |
a.Ha = c | |
} | |
C.prototype.setTo = C.prototype.n = function(a, b, c, d) { | |
v && (D.h(a, "number", C, "setTo:x"), D.h(b, "number", C, "setTo:y"), D.h(c, "number", C, "setTo:w"), D.h(d, "number", C, "setTo:h"), 0 > c && D.ua(c, ">= 0", C, "setTo:w"), 0 > d && D.ua(d, ">= 0", C, "setTo:h")); | |
this.M = a; | |
this.N = b; | |
this.Ia = c; | |
this.Ha = d; | |
return this | |
}; | |
C.prototype.set = C.prototype.set = function(a) { | |
v && D.l(a, C, C, "set:r"); | |
this.Sa(); | |
this.M = a.M; | |
this.N = a.N; | |
this.Ia = a.Ia; | |
this.Ha = a.Ha; | |
return this | |
}; | |
C.prototype.setPoint = C.prototype.gh = function(a) { | |
v && D.l(a, N, C, "setPoint:p"); | |
this.Sa(); | |
this.M = a.M; | |
this.N = a.N; | |
return this | |
}; | |
C.prototype.setSize = function(a) { | |
v && D.l(a, Ca, C, "setSize:s"); | |
this.Sa(); | |
this.Ia = a.Ia; | |
this.Ha = a.Ha; | |
return this | |
}; | |
C.prototype.copy = function() { | |
var a = new C; | |
a.M = this.M; | |
a.N = this.N; | |
a.Ia = this.Ia; | |
a.Ha = this.Ha; | |
return a | |
}; | |
f = C.prototype; | |
f.Oa = function() { | |
this.J = !0; | |
Object.freeze(this); | |
return this | |
}; | |
f.V = function() { | |
return Object.isFrozen(this) ? this : this.copy().freeze() | |
}; | |
f.freeze = function() { | |
this.J = !0; | |
return this | |
}; | |
f.Xa = function() { | |
Object.isFrozen(this) && D.k("cannot thaw constant: " + this); | |
this.J = !1; | |
return this | |
}; | |
f.Sa = function(a) { | |
if (this.J) { | |
var b = "The Rect is frozen, so its properties cannot be set: " + this.toString(); | |
void 0 !== a && (b += " to value: " + a); | |
D.k(b) | |
} | |
}; | |
C.parse = function(a) { | |
if ("string" === typeof a) { | |
a = a.split(" "); | |
for (var b = 0, c = 0; | |
"" === a[b];) b++; | |
var d = a[b++]; | |
d && (c = parseFloat(d)); | |
for (var e = 0; | |
"" === a[b];) b++; | |
(d = a[b++]) && (e = parseFloat(d)); | |
for (var g = 0; | |
"" === a[b];) b++; | |
(d = a[b++]) && (g = parseFloat(d)); | |
for (var h = 0; | |
"" === a[b];) b++; | |
(d = a[b++]) && (h = parseFloat(d)); | |
return new C(c, e, g, h) | |
} | |
return new C | |
}; | |
C.stringify = function(a) { | |
v && D.l(a, C); | |
return a.x.toString() + " " + a.y.toString() + " " + a.width.toString() + " " + a.height.toString() | |
}; | |
C.prototype.toString = function() { | |
return "Rect(" + this.x + "," + this.y + "," + this.width + "," + this.height + ")" | |
}; | |
C.prototype.equals = C.prototype.O = function(a) { | |
return a instanceof C ? this.M === a.x && this.N === a.y && this.Ia === a.width && this.Ha === a.height : !1 | |
}; | |
C.prototype.equalTo = C.prototype.Ux = function(a, b, c, d) { | |
return this.M === a && this.N === b && this.Ia === c && this.Ha === d | |
}; | |
C.prototype.equalsApprox = C.prototype.Wc = function(a) { | |
return Q(this.M, a.x) && Q(this.N, a.y) && Q(this.Ia, a.width) && Q(this.Ha, a.height) | |
}; | |
function Db(a, b) { | |
return Eb(a.M, b.x) && Eb(a.N, b.y) && Eb(a.Ia, b.width) && Eb(a.Ha, b.height) | |
} | |
C.prototype.containsPoint = C.prototype.Pa = function(a) { | |
v && D.l(a, N, C, "containsPoint:p"); | |
return this.M <= a.x && this.M + this.Ia >= a.x && this.N <= a.y && this.N + this.Ha >= a.y | |
}; | |
C.prototype.containsRect = C.prototype.Tk = function(a) { | |
v && D.l(a, C, C, "containsRect:r"); | |
return this.M <= a.x && a.x + a.width <= this.M + this.Ia && this.N <= a.y && a.y + a.height <= this.N + this.Ha | |
}; | |
C.prototype.contains = C.prototype.contains = function(a, b, c, d) { | |
v ? (D.p(a, C, "contains:x"), D.p(b, C, "contains:y"), void 0 === c ? c = 0 : D.p(c, C, "contains:w"), void 0 === d ? d = 0 : D.p(d, C, "contains:h"), (0 > c || 0 > d) && D.k("Rect.contains:Width and height cannot be negative")) : (void 0 === c && (c = 0), void 0 === d && (d = 0)); | |
return this.M <= a && a + c <= this.M + this.Ia && this.N <= b && b + d <= this.N + this.Ha | |
}; | |
C.prototype.reset = function() { | |
this.Sa(); | |
this.Ha = this.Ia = this.N = this.M = 0 | |
}; | |
C.prototype.offset = C.prototype.offset = function(a, b) { | |
v && (D.p(a, C, "offset:dx"), D.p(b, C, "offset:dy")); | |
this.Sa(); | |
this.M += a; | |
this.N += b; | |
return this | |
}; | |
C.prototype.inflate = C.prototype.ig = function(a, b) { | |
v && (D.p(a, C, "inflate:w"), D.p(b, C, "inflate:h")); | |
return Gb(this, b, a, b, a) | |
}; | |
C.prototype.addMargin = C.prototype.zx = function(a) { | |
v && D.l(a, Lb, C, "addMargin:m"); | |
return Gb(this, a.top, a.right, a.bottom, a.left) | |
}; | |
C.prototype.subtractMargin = C.prototype.yK = function(a) { | |
v && D.l(a, Lb, C, "subtractMargin:m"); | |
return Gb(this, -a.top, -a.right, -a.bottom, -a.left) | |
}; | |
C.prototype.grow = function(a, b, c, d) { | |
v && (D.p(a, C, "grow:t"), D.p(b, C, "grow:r"), D.p(c, C, "grow:b"), D.p(d, C, "grow:l")); | |
return Gb(this, a, b, c, d) | |
}; | |
function Gb(a, b, c, d, e) { | |
a.Sa(); | |
var g = a.Ia; | |
c + e <= -g ? (a.M += g / 2, a.Ia = 0) : (a.M -= e, a.Ia += c + e); | |
c = a.Ha; | |
b + d <= -c ? (a.N += c / 2, a.Ha = 0) : (a.N -= b, a.Ha += b + d); | |
return a | |
} | |
C.prototype.intersectRect = function(a) { | |
v && D.l(a, C, C, "intersectRect:r"); | |
return Nb(this, a.x, a.y, a.width, a.height) | |
}; | |
C.prototype.intersect = C.prototype.$F = function(a, b, c, d) { | |
v && (D.p(a, C, "intersect:x"), D.p(b, C, "intersect:y"), D.p(c, C, "intersect:w"), D.p(d, C, "intersect:h"), (0 > c || 0 > d) && D.k("Rect.intersect:Width and height cannot be negative")); | |
return Nb(this, a, b, c, d) | |
}; | |
function Nb(a, b, c, d, e) { | |
a.Sa(); | |
var g = Math.max(a.M, b), | |
h = Math.max(a.N, c); | |
b = Math.min(a.M + a.Ia, b + d); | |
c = Math.min(a.N + a.Ha, c + e); | |
a.M = g; | |
a.N = h; | |
a.Ia = Math.max(0, b - g); | |
a.Ha = Math.max(0, c - h); | |
return a | |
} | |
C.prototype.intersectsRect = C.prototype.jg = function(a) { | |
v && D.l(a, C, C, "intersectsRect:r"); | |
return this.aG(a.x, a.y, a.width, a.height) | |
}; | |
C.prototype.intersects = C.prototype.aG = function(a, b, c, d) { | |
v && (D.p(a, C, "intersects:x"), D.p(b, C, "intersects:y"), D.p(a, C, "intersects:w"), D.p(b, C, "intersects:h"), (0 > c || 0 > d) && D.k("Rect.intersects:Width and height cannot be negative")); | |
var e = this.Ia, | |
g = this.M; | |
if (Infinity !== e && Infinity !== c && (e += g, c += a, isNaN(c) || isNaN(e) || g > c || a > e)) return !1; | |
a = this.Ha; | |
c = this.N; | |
return Infinity !== a && Infinity !== d && (a += c, d += b, isNaN(d) || isNaN(a) || c > d || b > a) ? !1 : !0 | |
}; | |
function Ob(a, b) { | |
var c = a.Ia, | |
d = b.width + 10 + 10, | |
e = a.M, | |
g = b.x - 10; | |
if (e > d + g || g > c + e) return !1; | |
c = a.Ha; | |
d = b.height + 10 + 10; | |
e = a.N; | |
g = b.y - 10; | |
return e > d + g || g > c + e ? !1 : !0 | |
} | |
C.prototype.unionPoint = C.prototype.Mi = function(a) { | |
v && D.l(a, N, C, "unionPoint:p"); | |
return Ub(this, a.x, a.y, 0, 0) | |
}; | |
C.prototype.unionRect = C.prototype.Zh = function(a) { | |
v && D.l(a, C, C, "unionRect:r"); | |
return Ub(this, a.M, a.N, a.Ia, a.Ha) | |
}; | |
C.prototype.union = C.prototype.sH = function(a, b, c, d) { | |
this.Sa(); | |
v ? (D.p(a, C, "union:x"), D.p(b, C, "union:y"), void 0 === c ? c = 0 : D.p(c, C, "union:w"), void 0 === d ? d = 0 : D.p(d, C, "union:h"), (0 > c || 0 > d) && D.k("Rect.union:Width and height cannot be negative")) : (void 0 === c && (c = 0), void 0 === d && (d = 0)); | |
return Ub(this, a, b, c, d) | |
}; | |
function Ub(a, b, c, d, e) { | |
var g = Math.min(a.M, b), | |
h = Math.min(a.N, c); | |
b = Math.max(a.M + a.Ia, b + d); | |
c = Math.max(a.N + a.Ha, c + e); | |
a.M = g; | |
a.N = h; | |
a.Ia = b - g; | |
a.Ha = c - h; | |
return a | |
} | |
C.prototype.setSpot = C.prototype.pv = function(a, b, c) { | |
v && (D.p(a, C, "setSpot:x"), D.p(b, C, "setSpot:y"), D.l(c, S, C, "setSpot:spot")); | |
this.Sa(); | |
this.M = a - c.offsetX - c.x * this.Ia; | |
this.N = b - c.offsetY - c.y * this.Ha; | |
return this | |
}; | |
var Vb; | |
C.contains = Vb = function(a, b, c, d, e, g, h, k) { | |
v ? (D.p(a, C, "contains:rx"), D.p(b, C, "contains:ry"), D.p(c, C, "contains:rw"), D.p(d, C, "contains:rh"), D.p(e, C, "contains:x"), D.p(g, C, "contains:y"), void 0 === h ? h = 0 : D.p(h, C, "contains:w"), void 0 === k ? k = 0 : D.p(k, C, "contains:h"), (0 > c || 0 > d || 0 > h || 0 > k) && D.k("Rect.contains:Width and height cannot be negative")) : (void 0 === h && (h = 0), void 0 === k && (k = 0)); | |
return a <= e && e + h <= a + c && b <= g && g + k <= b + d | |
}; | |
C.intersects = function(a, b, c, d, e, g, h, k) { | |
v && (D.p(a, C, "intersects:rx"), D.p(b, C, "intersects:ry"), D.p(c, C, "intersects:rw"), D.p(d, C, "intersects:rh"), D.p(e, C, "intersects:x"), D.p(g, C, "intersects:y"), D.p(h, C, "intersects:w"), D.p(k, C, "intersects:h"), (0 > c || 0 > d || 0 > h || 0 > k) && D.k("Rect.intersects:Width and height cannot be negative")); | |
c += a; | |
h += e; | |
if (a > h || e > c) return !1; | |
a = d + b; | |
k += g; | |
return b > k || g > a ? !1 : !0 | |
}; | |
D.defineProperty(C, { | |
x: "x" | |
}, function() { | |
return this.M | |
}, function(a) { | |
this.Sa(a); | |
v && D.h(a, "number", C, "x"); | |
this.M = a | |
}); | |
D.defineProperty(C, { | |
y: "y" | |
}, function() { | |
return this.N | |
}, function(a) { | |
this.Sa(a); | |
v && D.h(a, "number", C, "y"); | |
this.N = a | |
}); | |
D.defineProperty(C, { | |
width: "width" | |
}, function() { | |
return this.Ia | |
}, function(a) { | |
this.Sa(a); | |
v && D.h(a, "number", C, "width"); | |
0 > a && D.ua(a, ">= 0", C, "width"); | |
this.Ia = a | |
}); | |
D.defineProperty(C, { | |
height: "height" | |
}, function() { | |
return this.Ha | |
}, function(a) { | |
this.Sa(a); | |
v && D.h(a, "number", C, "height"); | |
0 > a && D.ua(a, ">= 0", C, "height"); | |
this.Ha = a | |
}); | |
D.defineProperty(C, { | |
left: "left" | |
}, function() { | |
return this.M | |
}, function(a) { | |
this.Sa(a); | |
v && D.h(a, "number", C, "left"); | |
this.M = a | |
}); | |
D.defineProperty(C, { | |
top: "top" | |
}, function() { | |
return this.N | |
}, function(a) { | |
this.Sa(a); | |
v && D.h(a, "number", C, "top"); | |
this.N = a | |
}); | |
D.defineProperty(C, { | |
right: "right" | |
}, function() { | |
return this.M + this.Ia | |
}, function(a) { | |
this.Sa(a); | |
v && D.p(a, C, "right"); | |
this.M += a - (this.M + this.Ia) | |
}); | |
D.defineProperty(C, { | |
bottom: "bottom" | |
}, function() { | |
return this.N + this.Ha | |
}, function(a) { | |
this.Sa(a); | |
v && D.p(a, C, "top"); | |
this.N += a - (this.N + this.Ha) | |
}); | |
D.defineProperty(C, { | |
position: "position" | |
}, function() { | |
return new N(this.M, this.N) | |
}, function(a) { | |
this.Sa(a); | |
v && D.l(a, N, C, "position"); | |
this.M = a.x; | |
this.N = a.y | |
}); | |
D.defineProperty(C, { | |
size: "size" | |
}, function() { | |
return new Ca(this.Ia, this.Ha) | |
}, function(a) { | |
this.Sa(a); | |
v && D.l(a, Ca, C, "size"); | |
this.Ia = a.width; | |
this.Ha = a.height | |
}); | |
D.defineProperty(C, { | |
km: "center" | |
}, function() { | |
return new N(this.M + this.Ia / 2, this.N + this.Ha / 2) | |
}, function(a) { | |
this.Sa(a); | |
v && D.l(a, N, C, "center"); | |
this.M = a.x - this.Ia / 2; | |
this.N = a.y - this.Ha / 2 | |
}); | |
D.defineProperty(C, { | |
pa: "centerX" | |
}, function() { | |
return this.M + this.Ia / 2 | |
}, function(a) { | |
this.Sa(a); | |
v && D.p(a, C, "centerX"); | |
this.M = a - this.Ia / 2 | |
}); | |
D.defineProperty(C, { | |
va: "centerY" | |
}, function() { | |
return this.N + this.Ha / 2 | |
}, function(a) { | |
this.Sa(a); | |
v && D.p(a, C, "centerY"); | |
this.N = a - this.Ha / 2 | |
}); | |
C.prototype.isReal = C.prototype.H = function() { | |
return isFinite(this.x) && isFinite(this.y) && isFinite(this.width) && isFinite(this.height) | |
}; | |
C.prototype.isEmpty = function() { | |
return 0 === this.width && 0 === this.height | |
}; | |
function Lb(a, b, c, d) { | |
void 0 === a ? this.vh = this.mh = this.Dh = this.Eh = 0 : void 0 === b ? this.left = this.bottom = this.right = this.top = a : void 0 === c ? (d = b, this.top = a, this.right = b, this.bottom = a, this.left = d) : void 0 !== d ? (this.top = a, this.right = b, this.bottom = c, this.left = d) : D.k("Invalid arguments to Margin constructor: " + a + ", " + b + ", " + c + ", " + d); | |
this.J = !1 | |
} | |
D.ka("Margin", Lb); | |
D.Di(Lb); | |
D.ne(Lb, { | |
top: !0, | |
right: !0, | |
bottom: !0, | |
left: !0 | |
}); | |
Lb.prototype.assign = function(a) { | |
this.Eh = a.Eh; | |
this.Dh = a.Dh; | |
this.mh = a.mh; | |
this.vh = a.vh | |
}; | |
Lb.prototype.setTo = Lb.prototype.n = function(a, b, c, d) { | |
v && (D.h(a, "number", Lb, "setTo:t"), D.h(b, "number", Lb, "setTo:r"), D.h(c, "number", Lb, "setTo:b"), D.h(d, "number", Lb, "setTo:l")); | |
this.Sa(); | |
this.Eh = a; | |
this.Dh = b; | |
this.mh = c; | |
this.vh = d; | |
return this | |
}; | |
Lb.prototype.set = Lb.prototype.set = function(a) { | |
v && D.l(a, Lb, Lb, "assign:m"); | |
this.Sa(); | |
this.Eh = a.Eh; | |
this.Dh = a.Dh; | |
this.mh = a.mh; | |
this.vh = a.vh; | |
return this | |
}; | |
Lb.prototype.copy = function() { | |
var a = new Lb; | |
a.Eh = this.Eh; | |
a.Dh = this.Dh; | |
a.mh = this.mh; | |
a.vh = this.vh; | |
return a | |
}; | |
f = Lb.prototype; | |
f.Oa = function() { | |
this.J = !0; | |
Object.freeze(this); | |
return this | |
}; | |
f.V = function() { | |
return Object.isFrozen(this) ? this : this.copy().freeze() | |
}; | |
f.freeze = function() { | |
this.J = !0; | |
return this | |
}; | |
f.Xa = function() { | |
Object.isFrozen(this) && D.k("cannot thaw constant: " + this); | |
this.J = !1; | |
return this | |
}; | |
f.Sa = function(a) { | |
if (this.J) { | |
var b = "The Margin is frozen, so its properties cannot be set: " + this.toString(); | |
void 0 !== a && (b += " to value: " + a); | |
D.k(b) | |
} | |
}; | |
Lb.parse = function(a) { | |
if ("string" === typeof a) { | |
a = a.split(" "); | |
for (var b = 0, c = NaN; | |
"" === a[b];) b++; | |
var d = a[b++]; | |
d && (c = parseFloat(d)); | |
if (isNaN(c)) return new Lb; | |
for (var e = NaN; | |
"" === a[b];) b++; | |
(d = a[b++]) && (e = parseFloat(d)); | |
if (isNaN(e)) return new Lb(c); | |
for (var g = NaN; | |
"" === a[b];) b++; | |
(d = a[b++]) && (g = parseFloat(d)); | |
if (isNaN(g)) return new Lb(c, e); | |
for (var h = NaN; | |
"" === a[b];) b++; | |
(d = a[b++]) && (h = parseFloat(d)); | |
return isNaN(h) ? new Lb(c, e) : new Lb(c, e, g, h) | |
} | |
return new Lb | |
}; | |
Lb.stringify = function(a) { | |
v && D.l(a, Lb); | |
return a.top.toString() + " " + a.right.toString() + " " + a.bottom.toString() + " " + a.left.toString() | |
}; | |
Lb.prototype.toString = function() { | |
return "Margin(" + this.top + "," + this.right + "," + this.bottom + "," + this.left + ")" | |
}; | |
Lb.prototype.equals = Lb.prototype.O = function(a) { | |
return a instanceof Lb ? this.Eh === a.top && this.Dh === a.right && this.mh === a.bottom && this.vh === a.left : !1 | |
}; | |
Lb.prototype.equalTo = Lb.prototype.Ux = function(a, b, c, d) { | |
return this.Eh === a && this.Dh === b && this.mh === c && this.vh === d | |
}; | |
Lb.prototype.equalsApprox = Lb.prototype.Wc = function(a) { | |
return Q(this.Eh, a.top) && Q(this.Dh, a.right) && Q(this.mh, a.bottom) && Q(this.vh, a.left) | |
}; | |
D.defineProperty(Lb, { | |
top: "top" | |
}, function() { | |
return this.Eh | |
}, function(a) { | |
this.Sa(a); | |
v && D.p(a, Lb, "top"); | |
this.Eh = a | |
}); | |
D.defineProperty(Lb, { | |
right: "right" | |
}, function() { | |
return this.Dh | |
}, function(a) { | |
this.Sa(a); | |
v && D.p(a, Lb, "right"); | |
this.Dh = a | |
}); | |
D.defineProperty(Lb, { | |
bottom: "bottom" | |
}, function() { | |
return this.mh | |
}, function(a) { | |
this.Sa(a); | |
v && D.p(a, Lb, "bottom"); | |
this.mh = a | |
}); | |
D.defineProperty(Lb, { | |
left: "left" | |
}, function() { | |
return this.vh | |
}, function(a) { | |
this.Sa(a); | |
v && D.p(a, Lb, "left"); | |
this.vh = a | |
}); | |
Lb.prototype.isReal = Lb.prototype.H = function() { | |
return isFinite(this.top) && isFinite(this.right) && isFinite(this.bottom) && isFinite(this.left) | |
}; | |
function Ea() { | |
this.m11 = 1; | |
this.m21 = this.m12 = 0; | |
this.m22 = 1; | |
this.dy = this.dx = 0 | |
} | |
D.Di(Ea); | |
D.ne(Ea, { | |
m11: !0, | |
m12: !0, | |
m21: !0, | |
m22: !0, | |
dx: !0, | |
dy: !0 | |
}); | |
Ea.prototype.set = Ea.prototype.set = function(a) { | |
v && D.l(a, Ea, Ea, "set:t"); | |
this.m11 = a.m11; | |
this.m12 = a.m12; | |
this.m21 = a.m21; | |
this.m22 = a.m22; | |
this.dx = a.dx; | |
this.dy = a.dy; | |
return this | |
}; | |
Ea.prototype.copy = function() { | |
var a = new Ea; | |
a.m11 = this.m11; | |
a.m12 = this.m12; | |
a.m21 = this.m21; | |
a.m22 = this.m22; | |
a.dx = this.dx; | |
a.dy = this.dy; | |
return a | |
}; | |
Ea.prototype.toString = function() { | |
return "Transform(" + this.m11 + "," + this.m12 + "," + this.m21 + "," + this.m22 + "," + this.dx + "," + this.dy + ")" | |
}; | |
Ea.prototype.equals = Ea.prototype.O = function(a) { | |
return a instanceof Ea ? this.m11 === a.m11 && this.m12 === a.m12 && this.m21 === a.m21 && this.m22 === a.m22 && this.dx === a.dx && this.dy === a.dy : !1 | |
}; | |
Ea.prototype.isIdentity = Ea.prototype.Nu = function() { | |
return 1 === this.m11 && 0 === this.m12 && 0 === this.m21 && 1 === this.m22 && 0 === this.dx && 0 === this.dy | |
}; | |
Ea.prototype.reset = Ea.prototype.reset = function() { | |
this.m11 = 1; | |
this.m21 = this.m12 = 0; | |
this.m22 = 1; | |
this.dy = this.dx = 0; | |
return this | |
}; | |
Ea.prototype.multiply = Ea.prototype.multiply = function(a) { | |
v && D.l(a, Ea, Ea, "multiply:matrix"); | |
var b = this.m12 * a.m11 + this.m22 * a.m12, | |
c = this.m11 * a.m21 + this.m21 * a.m22, | |
d = this.m12 * a.m21 + this.m22 * a.m22, | |
e = this.m11 * a.dx + this.m21 * a.dy + this.dx, | |
g = this.m12 * a.dx + this.m22 * a.dy + this.dy; | |
this.m11 = this.m11 * a.m11 + this.m21 * a.m12; | |
this.m12 = b; | |
this.m21 = c; | |
this.m22 = d; | |
this.dx = e; | |
this.dy = g; | |
return this | |
}; | |
Ea.prototype.multiplyInverted = Ea.prototype.FB = function(a) { | |
v && D.l(a, Ea, Ea, "multiplyInverted:matrix"); | |
var b = 1 / (a.m11 * a.m22 - a.m12 * a.m21), | |
c = a.m22 * b, | |
d = -a.m12 * b, | |
e = -a.m21 * b, | |
g = a.m11 * b, | |
h = b * (a.m21 * a.dy - a.m22 * a.dx), | |
k = b * (a.m12 * a.dx - a.m11 * a.dy); | |
a = this.m12 * c + this.m22 * d; | |
b = this.m11 * e + this.m21 * g; | |
e = this.m12 * e + this.m22 * g; | |
g = this.m11 * h + this.m21 * k + this.dx; | |
h = this.m12 * h + this.m22 * k + this.dy; | |
this.m11 = this.m11 * c + this.m21 * d; | |
this.m12 = a; | |
this.m21 = b; | |
this.m22 = e; | |
this.dx = g; | |
this.dy = h; | |
return this | |
}; | |
Ea.prototype.invert = Ea.prototype.nB = function() { | |
var a = 1 / (this.m11 * this.m22 - this.m12 * this.m21), | |
b = -this.m12 * a, | |
c = -this.m21 * a, | |
d = this.m11 * a, | |
e = a * (this.m21 * this.dy - this.m22 * this.dx), | |
g = a * (this.m12 * this.dx - this.m11 * this.dy); | |
this.m11 = this.m22 * a; | |
this.m12 = b; | |
this.m21 = c; | |
this.m22 = d; | |
this.dx = e; | |
this.dy = g; | |
return this | |
}; | |
Ea.prototype.rotate = Ea.prototype.rotate = function(a, b, c) { | |
v && (D.p(a, Ea, "rotate:angle"), D.p(b, Ea, "rotate:rx"), D.p(c, Ea, "rotate:ry")); | |
360 <= a ? a -= 360 : 0 > a && (a += 360); | |
if (0 === a) return this; | |
this.translate(b, c); | |
var d = 0, | |
e = 0; | |
90 === a ? (d = 0, e = 1) : 180 === a ? (d = -1, e = 0) : 270 === a ? (d = 0, e = -1) : (e = a * Math.PI / 180, d = Math.cos(e), e = Math.sin(e)); | |
a = this.m12 * d + this.m22 * e; | |
var g = this.m11 * -e + this.m21 * d, | |
h = this.m12 * -e + this.m22 * d; | |
this.m11 = this.m11 * d + this.m21 * e; | |
this.m12 = a; | |
this.m21 = g; | |
this.m22 = h; | |
this.translate(-b, -c); | |
return this | |
}; | |
Ea.prototype.translate = Ea.prototype.translate = function(a, b) { | |
v && (D.p(a, Ea, "translate:x"), D.p(b, Ea, "translate:y")); | |
this.dx += this.m11 * a + this.m21 * b; | |
this.dy += this.m12 * a + this.m22 * b; | |
return this | |
}; | |
Ea.prototype.scale = Ea.prototype.scale = function(a, b) { | |
void 0 === b && (b = a); | |
v && (D.p(a, Ea, "translate:sx"), D.p(b, Ea, "translate:sy")); | |
this.m11 *= a; | |
this.m12 *= a; | |
this.m21 *= b; | |
this.m22 *= b; | |
return this | |
}; | |
Ea.prototype.transformPoint = Ea.prototype.vb = function(a) { | |
v && D.l(a, N, Ea, "transformPoint:p"); | |
var b = a.M, | |
c = a.N; | |
a.M = b * this.m11 + c * this.m21 + this.dx; | |
a.N = b * this.m12 + c * this.m22 + this.dy; | |
return a | |
}; | |
Ea.prototype.invertedTransformPoint = Ea.prototype.Oh = function(a) { | |
v && D.l(a, N, Ea, "invertedTransformPoint:p"); | |
var b = 1 / (this.m11 * this.m22 - this.m12 * this.m21), | |
c = -this.m12 * b, | |
d = this.m11 * b, | |
e = b * (this.m12 * this.dx - this.m11 * this.dy), | |
g = a.M, | |
h = a.N; | |
a.M = g * this.m22 * b + h * -this.m21 * b + b * (this.m21 * this.dy - this.m22 * this.dx); | |
a.N = g * c + h * d + e; | |
return a | |
}; | |
Ea.prototype.transformRect = Ea.prototype.rH = function(a) { | |
v && D.l(a, C, Ea, "transformRect:rect"); | |
var b = a.M, | |
c = a.N, | |
d = b + a.Ia, | |
e = c + a.Ha, | |
g = this.m11, | |
h = this.m12, | |
k = this.m21, | |
l = this.m22, | |
m = this.dx, | |
n = this.dy, | |
p = b * g + c * k + m, | |
q = b * h + c * l + n, | |
r = d * g + c * k + m, | |
c = d * h + c * l + n, | |
s = b * g + e * k + m, | |
b = b * h + e * l + n, | |
g = d * g + e * k + m, | |
d = d * h + e * l + n, | |
e = p, | |
h = q, | |
p = Math.min(p, r), | |
e = Math.max(e, r), | |
h = Math.min(h, c), | |
q = Math.max(q, c), | |
p = Math.min(p, s), | |
e = Math.max(e, s), | |
h = Math.min(h, b), | |
q = Math.max(q, b), | |
p = Math.min(p, g), | |
e = Math.max(e, g), | |
h = Math.min(h, d), | |
q = Math.max(q, d); | |
a.M = p; | |
a.N = h; | |
a.Ia = | |
e - p; | |
a.Ha = q - h; | |
return a | |
}; | |
function S(a, b, c, d) { | |
void 0 === a ? this.Ng = this.Mg = this.N = this.M = 0 : (void 0 === b && (b = 0), void 0 === c && (c = 0), void 0 === d && (d = 0), this.x = a, this.y = b, this.offsetX = c, this.offsetY = d); | |
this.J = !1 | |
} | |
D.ka("Spot", S); | |
D.Di(S); | |
D.ne(S, { | |
x: !0, | |
y: !0, | |
offsetX: !0, | |
offsetY: !0 | |
}); | |
S.prototype.assign = function(a) { | |
this.M = a.M; | |
this.N = a.N; | |
this.Mg = a.Mg; | |
this.Ng = a.Ng | |
}; | |
S.prototype.setTo = S.prototype.n = function(a, b, c, d) { | |
v && (Wb(a, "setTo:x"), Wb(b, "setTo:y"), Zb(c, "setTo:offx"), Zb(d, "setTo:offy")); | |
this.Sa(); | |
this.M = a; | |
this.N = b; | |
this.Mg = c; | |
this.Ng = d; | |
return this | |
}; | |
S.prototype.set = S.prototype.set = function(a) { | |
v && D.l(a, S, S, "set:s"); | |
this.Sa(); | |
this.M = a.M; | |
this.N = a.N; | |
this.Mg = a.Mg; | |
this.Ng = a.Ng; | |
return this | |
}; | |
S.prototype.copy = function() { | |
var a = new S; | |
a.M = this.M; | |
a.N = this.N; | |
a.Mg = this.Mg; | |
a.Ng = this.Ng; | |
return a | |
}; | |
f = S.prototype; | |
f.Oa = function() { | |
this.J = !0; | |
Object.freeze(this); | |
return this | |
}; | |
f.V = function() { | |
return Object.isFrozen(this) ? this : this.copy().freeze() | |
}; | |
f.freeze = function() { | |
this.J = !0; | |
return this | |
}; | |
f.Xa = function() { | |
Object.isFrozen(this) && D.k("cannot thaw constant: " + this); | |
this.J = !1; | |
return this | |
}; | |
f.Sa = function(a) { | |
if (this.J) { | |
var b = "The Spot is frozen, so its properties cannot be set: " + this.toString(); | |
void 0 !== a && (b += " to value: " + a); | |
D.k(b) | |
} | |
}; | |
function bc(a, b) { | |
a.M = NaN; | |
a.N = NaN; | |
a.Mg = b; | |
return a | |
} | |
function Wb(a, b) { | |
(isNaN(a) || 1 < a || 0 > a) && D.ua(a, "0 <= " + b + " <= 1", S, b) | |
} | |
function Zb(a, b) { | |
(isNaN(a) || Infinity === a || -Infinity === a) && D.ua(a, "real number, not NaN or Infinity", S, b) | |
} | |
var cc; | |
S.parse = cc = function(a) { | |
if ("string" === typeof a) { | |
a = a.trim(); | |
if ("None" === a) return dc; | |
if ("TopLeft" === a) return ec; | |
if ("Top" === a || "TopCenter" === a || "MiddleTop" === a) return jc; | |
if ("TopRight" === a) return kc; | |
if ("Left" === a || "LeftCenter" === a || "MiddleLeft" === a) return lc; | |
if ("Center" === a) return mc; | |
if ("Right" === a || "RightCenter" === a || "MiddleRight" === a) return nc; | |
if ("BottomLeft" === a) return tc; | |
if ("Bottom" === a || "BottomCenter" === a || "MiddleBottom" === a) return uc; | |
if ("BottomRight" === a) return vc; | |
if ("TopSide" === a) return wc; | |
if ("LeftSide" === | |
a) return xc; | |
if ("RightSide" === a) return yc; | |
if ("BottomSide" === a) return Dc; | |
if ("TopBottomSides" === a) return Ec; | |
if ("LeftRightSides" === a) return Jc; | |
if ("TopLeftSides" === a) return Kc; | |
if ("TopRightSides" === a) return Lc; | |
if ("BottomLeftSides" === a) return Mc; | |
if ("BottomRightSides" === a) return Nc; | |
if ("NotTopSide" === a) return Oc; | |
if ("NotLeftSide" === a) return Pc; | |
if ("NotRightSide" === a) return Sc; | |
if ("NotBottomSide" === a) return Tc; | |
if ("AllSides" === a) return Uc; | |
if ("Default" === a) return Vc; | |
a = a.split(" "); | |
for (var b = 0, c = 0; | |
"" === a[b];) b++; | |
var d = a[b++]; | |
void 0 !== d && 0 < d.length && (c = parseFloat(d)); | |
for (var e = 0; | |
"" === a[b];) b++; | |
d = a[b++]; | |
void 0 !== d && 0 < d.length && (e = parseFloat(d)); | |
for (var g = 0; | |
"" === a[b];) b++; | |
d = a[b++]; | |
void 0 !== d && 0 < d.length && (g = parseFloat(d)); | |
for (var h = 0; | |
"" === a[b];) b++; | |
d = a[b++]; | |
void 0 !== d && 0 < d.length && (h = parseFloat(d)); | |
return new S(c, e, g, h) | |
} | |
return new S | |
}; | |
S.stringify = function(a) { | |
v && D.l(a, S); | |
return a.Xc() ? a.x.toString() + " " + a.y.toString() + " " + a.offsetX.toString() + " " + a.offsetY.toString() : a.toString() | |
}; | |
S.prototype.toString = function() { | |
return this.Xc() ? 0 === this.Mg && 0 === this.Ng ? "Spot(" + this.x + "," + this.y + ")" : "Spot(" + this.x + "," + this.y + "," + this.offsetX + "," + this.offsetY + ")" : this.O(dc) ? "None" : this.O(ec) ? "TopLeft" : this.O(jc) ? "Top" : this.O(kc) ? "TopRight" : this.O(lc) ? "Left" : this.O(mc) ? "Center" : this.O(nc) ? "Right" : this.O(tc) ? "BottomLeft" : this.O(uc) ? "Bottom" : this.O(vc) ? "BottomRight" : this.O(wc) ? "TopSide" : this.O(xc) ? "LeftSide" : this.O(yc) ? "RightSide" : this.O(Dc) ? "BottomSide" : this.O(Ec) ? "TopBottomSides" : this.O(Jc) ? | |
"LeftRightSides" : this.O(Kc) ? "TopLeftSides" : this.O(Lc) ? "TopRightSides" : this.O(Mc) ? "BottomLeftSides" : this.O(Nc) ? "BottomRightSides" : this.O(Oc) ? "NotTopSide" : this.O(Pc) ? "NotLeftSide" : this.O(Sc) ? "NotRightSide" : this.O(Tc) ? "NotBottomSide" : this.O(Uc) ? "AllSides" : this.O(Vc) ? "Default" : "None" | |
}; | |
S.prototype.equals = S.prototype.O = function(a) { | |
return a instanceof S ? (this.M === a.x || isNaN(this.M) && isNaN(a.x)) && (this.N === a.y || isNaN(this.N) && isNaN(a.y)) && this.Mg === a.offsetX && this.Ng === a.offsetY : !1 | |
}; | |
S.prototype.opposite = S.prototype.BG = function() { | |
return new S(.5 - (this.M - .5), .5 - (this.N - .5), -this.Mg, -this.Ng) | |
}; | |
S.prototype.includesSide = S.prototype.Mj = function(a) { | |
if (!this.Pj()) return !1; | |
if (!a.Pj()) | |
if (a.O(Wc)) a = xc; | |
else if (a.O(Xc)) a = yc; | |
else if (a.O(Yc)) a = wc; | |
else if (a.O(Zc)) a = Dc; | |
else return !1; | |
a = a.offsetY; | |
return (this.Ng & a) === a | |
}; | |
D.defineProperty(S, { | |
x: "x" | |
}, function() { | |
return this.M | |
}, function(a) { | |
this.Sa(a); | |
v && Wb(a, "x"); | |
this.M = a | |
}); | |
D.defineProperty(S, { | |
y: "y" | |
}, function() { | |
return this.N | |
}, function(a) { | |
this.Sa(a); | |
v && Wb(a, "y"); | |
this.N = a | |
}); | |
D.defineProperty(S, { | |
offsetX: "offsetX" | |
}, function() { | |
return this.Mg | |
}, function(a) { | |
this.Sa(a); | |
v && Zb(a, "offsetX"); | |
this.Mg = a | |
}); | |
D.defineProperty(S, { | |
offsetY: "offsetY" | |
}, function() { | |
return this.Ng | |
}, function(a) { | |
this.Sa(a); | |
v && Zb(a, "offsetY"); | |
this.Ng = a | |
}); | |
S.prototype.isSpot = S.prototype.Xc = function() { | |
return !isNaN(this.x) && !isNaN(this.y) | |
}; | |
S.prototype.isNoSpot = S.prototype.ee = function() { | |
return isNaN(this.x) || isNaN(this.y) | |
}; | |
S.prototype.isSide = S.prototype.Pj = function() { | |
return isNaN(this.x) && isNaN(this.y) && 1 === this.offsetX && 0 !== this.offsetY | |
}; | |
S.prototype.isNone = S.prototype.qJ = function() { | |
return isNaN(this.x) && isNaN(this.y) && 0 === this.offsetX && 0 === this.offsetY | |
}; | |
S.prototype.isDefault = S.prototype.ld = function() { | |
return isNaN(this.x) && isNaN(this.y) && -1 === this.offsetX && 0 === this.offsetY | |
}; | |
var dc; | |
S.None = dc = bc(new S(0, 0, 0, 0), 0).Oa(); | |
var Vc; | |
S.Default = Vc = bc(new S(0, 0, -1, 0), -1).Oa(); | |
var ec; | |
S.TopLeft = ec = (new S(0, 0, 0, 0)).Oa(); | |
var jc; | |
S.TopCenter = jc = (new S(.5, 0, 0, 0)).Oa(); | |
var kc; | |
S.TopRight = kc = (new S(1, 0, 0, 0)).Oa(); | |
var lc; | |
S.LeftCenter = lc = (new S(0, .5, 0, 0)).Oa(); | |
var mc; | |
S.Center = mc = (new S(.5, .5, 0, 0)).Oa(); | |
var nc; | |
S.RightCenter = nc = (new S(1, .5, 0, 0)).Oa(); | |
var tc; | |
S.BottomLeft = tc = (new S(0, 1, 0, 0)).Oa(); | |
var uc; | |
S.BottomCenter = uc = (new S(.5, 1, 0, 0)).Oa(); | |
var vc; | |
S.BottomRight = vc = (new S(1, 1, 0, 0)).Oa(); | |
var $c; | |
S.MiddleTop = $c = jc; | |
var ed; | |
S.MiddleLeft = ed = lc; | |
var fd; | |
S.MiddleRight = fd = nc; | |
var gd; | |
S.MiddleBottom = gd = uc; | |
var Yc; | |
S.Top = Yc = jc; | |
var Wc; | |
S.Left = Wc = lc; | |
var Xc; | |
S.Right = Xc = nc; | |
var Zc; | |
S.Bottom = Zc = uc; | |
var wc; | |
S.TopSide = wc = bc(new S(0, 0, 1, D.Ad), 1).Oa(); | |
var xc; | |
S.LeftSide = xc = bc(new S(0, 0, 1, D.bd), 1).Oa(); | |
var yc; | |
S.RightSide = yc = bc(new S(0, 0, 1, D.rd), 1).Oa(); | |
var Dc; | |
S.BottomSide = Dc = bc(new S(0, 0, 1, D.qd), 1).Oa(); | |
var Ec; | |
S.TopBottomSides = Ec = bc(new S(0, 0, 1, D.Ad | D.qd), 1).Oa(); | |
var Jc; | |
S.LeftRightSides = Jc = bc(new S(0, 0, 1, D.bd | D.rd), 1).Oa(); | |
var Kc; | |
S.TopLeftSides = Kc = bc(new S(0, 0, 1, D.Ad | D.bd), 1).Oa(); | |
var Lc; | |
S.TopRightSides = Lc = bc(new S(0, 0, 1, D.Ad | D.rd), 1).Oa(); | |
var Mc; | |
S.BottomLeftSides = Mc = bc(new S(0, 0, 1, D.qd | D.bd), 1).Oa(); | |
var Nc; | |
S.BottomRightSides = Nc = bc(new S(0, 0, 1, D.qd | D.rd), 1).Oa(); | |
var Oc; | |
S.NotTopSide = Oc = bc(new S(0, 0, 1, D.bd | D.rd | D.qd), 1).Oa(); | |
var Pc; | |
S.NotLeftSide = Pc = bc(new S(0, 0, 1, D.Ad | D.rd | D.qd), 1).Oa(); | |
var Sc; | |
S.NotRightSide = Sc = bc(new S(0, 0, 1, D.Ad | D.bd | D.qd), 1).Oa(); | |
var Tc; | |
S.NotBottomSide = Tc = bc(new S(0, 0, 1, D.Ad | D.bd | D.rd), 1).Oa(); | |
var Uc; | |
S.AllSides = Uc = bc(new S(0, 0, 1, D.Ad | D.bd | D.rd | D.qd), 1).Oa(); | |
function hd() { | |
this.bc = [1, 0, 0, 1, 0, 0] | |
} | |
hd.prototype.copy = function() { | |
var a = new hd; | |
a.bc[0] = this.bc[0]; | |
a.bc[1] = this.bc[1]; | |
a.bc[2] = this.bc[2]; | |
a.bc[3] = this.bc[3]; | |
a.bc[4] = this.bc[4]; | |
a.bc[5] = this.bc[5]; | |
return a | |
}; | |
hd.prototype.translate = function(a, b) { | |
this.bc[4] += this.bc[0] * a + this.bc[2] * b; | |
this.bc[5] += this.bc[1] * a + this.bc[3] * b | |
}; | |
hd.prototype.scale = function(a, b) { | |
this.bc[0] *= a; | |
this.bc[1] *= a; | |
this.bc[2] *= b; | |
this.bc[3] *= b | |
}; | |
function id(a) { | |
this.type = a; | |
this.r2 = this.y2 = this.x2 = this.r1 = this.y1 = this.x1 = 0; | |
this.fF = []; | |
this.pattern = null | |
} | |
id.prototype.addColorStop = function(a, b) { | |
this.fF.push({ | |
offset: a, | |
color: b | |
}) | |
}; | |
function qd(a, b, c) { | |
this.fillStyle = "#000000"; | |
this.font = "10px sans-serif"; | |
this.globalAlpha = 1; | |
this.lineCap = "butt"; | |
this.eo = 0; | |
this.lineJoin = "miter"; | |
this.lineWidth = 1; | |
this.miterLimit = 10; | |
this.shadowBlur = 0; | |
this.shadowColor = "rgba(0, 0, 0, 0)"; | |
this.shadowOffsetY = this.shadowOffsetX = 0; | |
this.strokeStyle = "#000000"; | |
this.textAlign = "start"; | |
this.eq = !1; | |
this.Pg = this.Gt = this.Ft = 0; | |
this.document = b || document; | |
this.zF = c; | |
this.ny = null; | |
this.path = []; | |
this.Mh = new hd; | |
this.stack = []; | |
this.zf = []; | |
this.Sx = a; | |
this.VJ = "http://www.w3.org/2000/svg"; | |
this.width = this.Sx.width; | |
this.height = this.Sx.height; | |
this.Gm = rd(this, "svg", { | |
width: this.width + "px", | |
height: this.height + "px", | |
viewBox: "0 0 " + this.Sx.width + " " + this.Sx.height | |
}); | |
this.Gm.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "http://www.w3.org/2000/svg"); | |
this.Gm.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink"); | |
sd(this, 1, 0, 0, 1, 0, 0); | |
a = D.Mm++; | |
b = rd(this, "clipPath", { | |
id: "mainClip" + a | |
}); | |
b.appendChild(rd(this, "rect", { | |
x: 0, | |
y: 0, | |
width: this.width, | |
height: this.height | |
})); | |
this.Gm.appendChild(b); | |
this.zf[0].setAttributeNS(null, "clip-path", "url(#mainClip" + a + ")") | |
} | |
f = qd.prototype; | |
f.arc = function(a, b, c, d, e, g) { | |
td(this, a, b, c, d, e, g) | |
}; | |
f.beginPath = function() { | |
this.path = [] | |
}; | |
f.bezierCurveTo = function(a, b, c, d, e, g) { | |
this.path.push(["C", a, b, c, d, e, g]) | |
}; | |
f.clearRect = function() {}; | |
f.clip = function() { | |
ud(this, "clipPath", this.path, new hd) | |
}; | |
f.closePath = function() { | |
this.path.push(["z"]) | |
}; | |
f.createLinearGradient = function(a, b, c, d) { | |
var e = new id("linear"); | |
e.x1 = a; | |
e.y1 = b; | |
e.x2 = c; | |
e.y2 = d; | |
return e | |
}; | |
f.createPattern = function() { | |
return null | |
}; | |
f.createRadialGradient = function(a, b, c, d, e, g) { | |
var h = new id("radial"); | |
h.x1 = a; | |
h.y1 = b; | |
h.r1 = c; | |
h.x2 = d; | |
h.y2 = e; | |
h.r2 = g; | |
return h | |
}; | |
f.drawImage = function(a, b, c, d, e, g, h, k, l) { | |
var m = ""; | |
a instanceof HTMLCanvasElement && (m = a.toDataURL()); | |
a instanceof HTMLImageElement && (m = a.src); | |
void 0 === d && (g = b, h = c, k = d = a.naturalWidth, l = e = a.naturalHeight); | |
d = d || 0; | |
e = e || 0; | |
g = g || 0; | |
h = h || 0; | |
k = k || 0; | |
l = l || 0; | |
m = { | |
x: 0, | |
y: 0, | |
width: a.naturalWidth, | |
height: a.naturalHeight, | |
href: m, | |
preserveAspectRatio: "xMidYMid slice" | |
}; | |
Eb(d, k) && Eb(e, l) || (m.preserveAspectRatio = "none"); | |
var n = ""; | |
k /= d; | |
l /= e; | |
if (0 !== g || 0 !== h) n += " translate(" + g + ", " + h + ")"; | |
if (1 !== k || 1 !== l) n += " scale(" + k + ", " + l + ")"; | |
if (0 !== | |
b || 0 !== c) n += " translate(" + -b + ", " + -c + ")"; | |
if (0 !== b || 0 !== c || d !== a.naturalWidth || e !== a.naturalHeight) a = "CLIP" + D.Mm++, g = rd(this, "clipPath", { | |
id: a | |
}), g.appendChild(rd(this, "rect", { | |
x: b, | |
y: c, | |
width: d, | |
height: e | |
})), this.Gm.appendChild(g), m["clip-path"] = "url(#" + a + ")"; | |
Ed(this, "image", m, this.Mh, n); | |
this.addElement("image", m) | |
}; | |
f.fill = function() { | |
ud(this, "fill", this.path, this.Mh) | |
}; | |
f.Xg = function() { | |
this.eq ? this.clip() : this.fill() | |
}; | |
f.fillRect = function(a, b, c, d) { | |
Fd(this, "fill", [a, b, c, d], this.Mh) | |
}; | |
f.fillText = function(a, b, c) { | |
a = [a, b, c]; | |
b = this.textAlign; | |
"left" === b ? b = "start" : "right" === b ? b = "end" : "center" === b && (b = "middle"); | |
b = { | |
x: a[1], | |
y: a[2], | |
style: "font: " + this.font, | |
"text-anchor": b | |
}; | |
Ed(this, "fill", b, this.Mh); | |
this.addElement("text", b, a[0]) | |
}; | |
f.lineTo = function(a, b) { | |
this.path.push(["L", a, b]) | |
}; | |
f.moveTo = function(a, b) { | |
this.path.push(["M", a, b]) | |
}; | |
f.quadraticCurveTo = function(a, b, c, d) { | |
this.path.push(["Q", a, b, c, d]) | |
}; | |
f.rect = function(a, b, c, d) { | |
this.path.push(["M", a, b], ["L", a + c, b], ["L", a + c, b + d], ["L", a, b + d], ["z"]) | |
}; | |
f.restore = function() { | |
this.Mh = this.stack.pop(); | |
this.path = this.stack.pop(); | |
var a = this.stack.pop(); | |
this.fillStyle = a.fillStyle; | |
this.font = a.font; | |
this.globalAlpha = a.globalAlpha; | |
this.lineCap = a.lineCap; | |
this.eo = a.eo; | |
this.lineJoin = a.lineJoin; | |
this.lineWidth = a.lineWidth; | |
this.miterLimit = a.miterLimit; | |
this.shadowBlur = a.shadowBlur; | |
this.shadowColor = a.shadowColor; | |
this.shadowOffsetX = a.shadowOffsetX; | |
this.shadowOffsetY = a.shadowOffsetY; | |
this.strokeStyle = a.strokeStyle; | |
this.textAlign = a.textAlign | |
}; | |
f.save = function() { | |
this.stack.push({ | |
fillStyle: this.fillStyle, | |
font: this.font, | |
globalAlpha: this.globalAlpha, | |
lineCap: this.lineCap, | |
eo: this.eo, | |
lineJoin: this.lineJoin, | |
lineWidth: this.lineWidth, | |
miterLimit: this.miterLimit, | |
shadowBlur: this.shadowBlur, | |
shadowColor: this.shadowColor, | |
shadowOffsetX: this.shadowOffsetX, | |
shadowOffsetY: this.shadowOffsetY, | |
strokeStyle: this.strokeStyle, | |
textAlign: this.textAlign | |
}); | |
for (var a = [], b = 0; b < this.path.length; b++) a.push(this.path[b]); | |
this.stack.push(a); | |
this.stack.push(this.Mh.copy()) | |
}; | |
f.setTransform = function(a, b, c, d, e, g) { | |
1 === a && 0 === b && 0 === c && 1 === d && 0 === e && 0 === g || sd(this, a, b, c, d, e, g) | |
}; | |
f.scale = function(a, b) { | |
this.Mh.scale(a, b) | |
}; | |
f.translate = function(a, b) { | |
this.Mh.translate(a, b) | |
}; | |
f.transform = function() {}; | |
f.stroke = function() { | |
ud(this, "stroke", this.path, this.Mh) | |
}; | |
f.Zj = function() { | |
this.eq || this.stroke() | |
}; | |
f.strokeRect = function(a, b, c, d) { | |
Fd(this, "stroke", [a, b, c, d], this.Mh) | |
}; | |
function rd(a, b, c, d) { | |
a = a.document.createElementNS(a.VJ, b); | |
if (D.Qa(c)) | |
for (var e in c) a.setAttributeNS("href" === e ? "http://www.w3.org/1999/xlink" : "", e, c[e]); | |
void 0 !== d && (a.textContent = d); | |
return a | |
} | |
f.addElement = function(a, b, c) { | |
a = rd(this, a, b, c); | |
0 < this.zf.length ? this.zf[this.zf.length - 1].appendChild(a) : this.Gm.appendChild(a); | |
return this.ny = a | |
}; | |
function Ed(a, b, c, d, e) { | |
1 !== a.globalAlpha && (c.opacity = a.globalAlpha); | |
"fill" === b ? (a.fillStyle instanceof id ? c.fill = Gd(a, a.fillStyle) : (/^rgba\(/.test(a.fillStyle) && (b = /^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle), c.fill = "rgb(" + b[1] + "," + b[2] + "," + b[3] + ")", c["fill-opacity"] = b[4]), c.fill = a.fillStyle), c.stroke = "none") : "stroke" === b && (c.fill = "none", a.strokeStyle instanceof id ? c.stroke = Gd(a, a.strokeStyle) : (/^rgba\(/.test(a.strokeStyle) && (b = /^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.strokeStyle), | |
c.stroke = "rgb(" + b[1] + "," + b[2] + "," + b[3] + ")", c["stroke-opacity"] = b[4]), c.stroke = a.strokeStyle), c["stroke-width"] = a.lineWidth, c["stroke-linecap"] = a.lineCap, c["stroke-linejoin"] = a.lineJoin, c["stroke-miterlimit"] = a.miterLimit); | |
a = d.bc; | |
a = "matrix(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ")"; | |
void 0 !== e && (a += e); | |
c.transform = a | |
} | |
function Gd(a, b) { | |
var c = "GRAD" + D.Mm++, | |
d; | |
if ("linear" === b.type) d = rd(a, "linearGradient", { | |
x1: b.x1, | |
x2: b.x2, | |
y1: b.y1, | |
y2: b.y2, | |
id: c, | |
gradientUnits: "userSpaceOnUse" | |
}); | |
else if ("radial" === b.type) d = rd(a, "radialGradient", { | |
x1: b.x1, | |
x2: b.x2, | |
y1: b.y1, | |
y2: b.y2, | |
r1: b.r1, | |
r2: b.r2, | |
id: c | |
}); | |
else if ("pattern" === b.type) { | |
var e = b.pattern; | |
d = { | |
width: e.width, | |
height: e.height, | |
id: c, | |
patternUnits: "userSpaceOnUse" | |
}; | |
var g = ""; | |
e instanceof HTMLCanvasElement && (g = e.toDataURL()); | |
e instanceof HTMLImageElement && (g = e.src); | |
e = { | |
x: 0, | |
y: 0, | |
width: e.width, | |
height: e.height, | |
href: g | |
}; | |
d = rd(a, "pattern", d); | |
d.appendChild(rd(a, "image", e)) | |
} else throw Error("invalid gradient"); | |
for (var e = b.fF, g = e.length, h = [], k = 0; k < g; k++) { | |
var l = e[k], | |
m = l.color, | |
l = { | |
offset: l.offset, | |
"stop-color": m | |
}; | |
/^rgba\(/.test(m) && (m = /^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(m), l["stop-color"] = "rgb(" + m[1] + "," + m[2] + "," + m[3] + ")", l["stop-opacity"] = m[4]); | |
h.push(l) | |
} | |
h.sort(function(a, b) { | |
return a.offset > b.offset ? 1 : -1 | |
}); | |
for (k = 0; k < g; k++) d.appendChild(rd(a, "stop", h[k])); | |
a.Gm.appendChild(d); | |
return "url(#" + c + ")" | |
} | |
function Fd(a, b, c, d) { | |
c = { | |
x: c[0], | |
y: c[1], | |
width: c[2], | |
height: c[3] | |
}; | |
Ed(a, b, c, d); | |
a.addElement("rect", c) | |
} | |
function ud(a, b, c, d) { | |
for (var e = [], g = 0; g < c.length; g++) { | |
var h = D.lm(c[g]), | |
k = [h.shift()]; | |
if ("A" === k[0]) k.push(h.shift() + "," + h.shift(), h.shift(), h.shift() + "," + h.shift(), h.shift() + "," + h.shift()); | |
else | |
for (; h.length;) k.push(h.shift() + "," + h.shift()); | |
e.push(k.join(" ")) | |
} | |
c = { | |
d: e.join(" ") | |
}; | |
Ed(a, b, c, d); | |
"clipPath" === b ? (b = "CLIP" + D.Mm++, d = rd(a, "clipPath", { | |
id: b | |
}), d.appendChild(rd(a, "path", c)), a.Gm.appendChild(d), 0 < a.zf.length && a.zf[a.zf.length - 1].setAttributeNS(null, "clip-path", "url(#" + b + ")")) : a.addElement("path", | |
c) | |
} | |
function td(a, b, c, d, e, g, h) { | |
var k = Math.abs(e - g); | |
if (e !== g) { | |
var l = b + d * Math.cos(g); | |
g = c + d * Math.sin(g); | |
k >= 2 * Math.PI ? (td(a, b, c, d, e, e + Math.PI, h), td(a, b, c, d, e + Math.PI, e + 2 * Math.PI, h), a.path.push(["M", l, g])) : (b += d * Math.cos(e), c += d * Math.sin(e), k = 180 * k / Math.PI, e = h ? 0 : 1, h = 180 <= k === !!h ? 0 : 1, 0 !== a.path.length ? a.path.push(["L", b, c]) : a.path.push(["M", b, c]), a.path.push(["A", d, d, k, h, e, l, g])) | |
} | |
} | |
function sd(a, b, c, d, e, g, h) { | |
var k = new hd; | |
k.bc = [b, c, d, e, g, h]; | |
b = {}; | |
Ed(a, "g", b, k); | |
k = a.addElement("g", b); | |
a.zf.push(k) | |
} | |
f.kb = function() { | |
if (0 !== this.shadowOffsetX || 0 !== this.shadowOffsetY || 0 !== this.shadowBlur) { | |
var a = "SHADOW" + D.Mm++, | |
b = this.addElement("filter", { | |
id: a, | |
x: "-100%", | |
y: "-100%", | |
width: "300%", | |
height: "300%" | |
}, null), | |
c, d, e, g, h; | |
c = rd(this, "feGaussianBlur", { | |
"in": "SourceAlpha", | |
result: "blur", | |
GM: this.shadowBlur / 2 | |
}); | |
d = rd(this, "feFlood", { | |
"in": "blur", | |
result: "flood", | |
"flood-color": this.shadowColor | |
}); | |
e = rd(this, "feComposite", { | |
"in": "flood", | |
in2: "blur", | |
operator: "in", | |
result: "comp" | |
}); | |
g = rd(this, "feOffset", { | |
"in": "comp", | |
result: "offsetBlur", | |
dx: this.shadowOffsetX, | |
dy: this.shadowOffsetY | |
}); | |
h = rd(this, "feMerge", {}); | |
h.appendChild(rd(this, "feMergeNode", { | |
"in": "offsetBlur" | |
})); | |
h.appendChild(rd(this, "feMergeNode", { | |
"in": "SourceGraphic" | |
})); | |
b.appendChild(c); | |
b.appendChild(d); | |
b.appendChild(e); | |
b.appendChild(g); | |
b.appendChild(h); | |
0 < this.zf.length && this.zf[this.zf.length - 1].setAttributeNS(null, "filter", "url(#" + a + ")") | |
} | |
}; | |
f.eC = function(a, b, c) { | |
this.Ft = a; | |
this.Gt = b; | |
this.Pg = c | |
}; | |
f.Em = function() { | |
this.shadowBlur = this.shadowOffsetY = this.shadowOffsetX = 0 | |
}; | |
f.xo = function() { | |
this.shadowOffsetX = this.Ft; | |
this.shadowOffsetY = this.Gt; | |
this.shadowBlur = this.Pg | |
}; | |
f.WA = function() { | |
return !1 | |
}; | |
f.RA = function() {}; | |
f.De = function() {}; | |
f.Sy = function() {}; | |
qd.prototype.rotate = function() {}; | |
function ja(a, b) { | |
this.ownerDocument = void 0 === b ? document : b; | |
var c = this.ownerDocument.createElement("canvas"); | |
c.tabIndex = 0; | |
this.ae = c; | |
this.Uk = new Hd(c); | |
c.ea = a; | |
Object.seal(this) | |
} | |
f = ja.prototype; | |
f.toDataURL = function(a, b) { | |
return this.ae.toDataURL(a, b) | |
}; | |
f.getBoundingClientRect = function() { | |
return this.ae.getBoundingClientRect() | |
}; | |
f.focus = function() { | |
return this.ae.focus() | |
}; | |
f.addEventListener = function(a, b, c) { | |
this.ae.addEventListener(a, b, c) | |
}; | |
f.removeEventListener = function(a, b, c) { | |
this.ae.removeEventListener(a, b, c) | |
}; | |
D.defineProperty(ja, { | |
width: "width" | |
}, function() { | |
return this.ae.width | |
}, function(a) { | |
this.ae.width = a | |
}); | |
D.defineProperty(ja, { | |
height: "height" | |
}, function() { | |
return this.ae.height | |
}, function(a) { | |
this.ae.height = a | |
}); | |
D.w(ja, { | |
style: "style" | |
}, function() { | |
return this.ae.style | |
}); | |
function Hd(a) { | |
a.getContext && a.getContext("2d") || D.k("Browser does not support HTML Canvas Element"); | |
this.za = a.getContext("2d"); | |
this.pz = this.rz = this.qz = ""; | |
this.vr = !1; | |
this.Pg = this.Gt = this.Ft = 0; | |
Object.seal(this) | |
} | |
Hd.prototype.Sy = function(a) { | |
this.za.jB = a | |
}; | |
D.defineProperty(Hd, { | |
fillStyle: "fillStyle" | |
}, function() { | |
return this.za.fillStyle | |
}, function(a) { | |
this.pz !== a && (this.pz = this.za.fillStyle = a) | |
}); | |
D.defineProperty(Hd, { | |
font: "font" | |
}, function() { | |
return this.za.font | |
}, function(a) { | |
this.qz !== a && (this.qz = this.za.font = a) | |
}); | |
D.defineProperty(Hd, { | |
globalAlpha: "globalAlpha" | |
}, function() { | |
return this.za.globalAlpha | |
}, function(a) { | |
this.za.globalAlpha = a | |
}); | |
D.defineProperty(Hd, { | |
lineCap: "lineCap" | |
}, function() { | |
return this.za.lineCap | |
}, function(a) { | |
this.za.lineCap = a | |
}); | |
D.defineProperty(Hd, { | |
eo: "lineDashOffset" | |
}, function() { | |
return this.za.eo | |
}, function(a) { | |
this.za.eo = a | |
}); | |
D.defineProperty(Hd, { | |
lineJoin: "lineJoin" | |
}, function() { | |
return this.za.lineJoin | |
}, function(a) { | |
this.za.lineJoin = a | |
}); | |
D.defineProperty(Hd, { | |
lineWidth: "lineWidth" | |
}, function() { | |
return this.za.lineWidth | |
}, function(a) { | |
this.za.lineWidth = a | |
}); | |
D.defineProperty(Hd, { | |
miterLimit: "miterLimit" | |
}, function() { | |
return this.za.miterLimit | |
}, function(a) { | |
this.za.miterLimit = a | |
}); | |
D.defineProperty(Hd, { | |
shadowBlur: "shadowBlur" | |
}, function() { | |
return this.za.shadowBlur | |
}, function(a) { | |
this.za.shadowBlur = a | |
}); | |
D.defineProperty(Hd, { | |
shadowColor: "shadowColor" | |
}, function() { | |
return this.za.shadowColor | |
}, function(a) { | |
this.za.shadowColor = a | |
}); | |
D.defineProperty(Hd, { | |
shadowOffsetX: "shadowOffsetX" | |
}, function() { | |
return this.za.shadowOffsetX | |
}, function(a) { | |
this.za.shadowOffsetX = a | |
}); | |
D.defineProperty(Hd, { | |
shadowOffsetY: "shadowOffsetY" | |
}, function() { | |
return this.za.shadowOffsetY | |
}, function(a) { | |
this.za.shadowOffsetY = a | |
}); | |
D.defineProperty(Hd, { | |
strokeStyle: "strokeStyle" | |
}, function() { | |
return this.za.strokeStyle | |
}, function(a) { | |
this.rz !== a && (this.rz = this.za.strokeStyle = a) | |
}); | |
D.defineProperty(Hd, { | |
textAlign: "textAlign" | |
}, function() { | |
return this.za.textAlign | |
}, function(a) { | |
this.za.textAlign = a | |
}); | |
D.defineProperty(Hd, { | |
jB: "imageSmoothingEnabled" | |
}, function() { | |
return this.za.jB | |
}, function(a) { | |
this.za.jB = a | |
}); | |
f = Hd.prototype; | |
f.arc = function(a, b, c, d, e, g) { | |
this.za.arc(a, b, c, d, e, g) | |
}; | |
f.beginPath = function() { | |
this.za.beginPath() | |
}; | |
f.bezierCurveTo = function(a, b, c, d, e, g) { | |
this.za.bezierCurveTo(a, b, c, d, e, g) | |
}; | |
f.clearRect = function(a, b, c, d) { | |
this.za.clearRect(a, b, c, d) | |
}; | |
f.clip = function() { | |
this.za.clip() | |
}; | |
f.closePath = function() { | |
this.za.closePath() | |
}; | |
f.createLinearGradient = function(a, b, c, d) { | |
return this.za.createLinearGradient(a, b, c, d) | |
}; | |
f.createPattern = function(a, b) { | |
return this.za.createPattern(a, b) | |
}; | |
f.createRadialGradient = function(a, b, c, d, e, g) { | |
return this.za.createRadialGradient(a, b, c, d, e, g) | |
}; | |
f.drawImage = function(a, b, c, d, e, g, h, k, l) { | |
void 0 === d ? this.za.drawImage(a, b, c) : this.za.drawImage(a, b, c, d, e, g, h, k, l) | |
}; | |
f.fill = function() { | |
this.za.fill() | |
}; | |
f.fillRect = function(a, b, c, d) { | |
this.za.fillRect(a, b, c, d) | |
}; | |
f.fillText = function(a, b, c) { | |
this.za.fillText(a, b, c) | |
}; | |
f.getImageData = function(a, b, c, d) { | |
return this.za.getImageData(a, b, c, d) | |
}; | |
f.lineTo = function(a, b) { | |
this.za.lineTo(a, b) | |
}; | |
f.measureText = function(a) { | |
return this.za.measureText(a) | |
}; | |
f.moveTo = function(a, b) { | |
this.za.moveTo(a, b) | |
}; | |
f.quadraticCurveTo = function(a, b, c, d) { | |
this.za.quadraticCurveTo(a, b, c, d) | |
}; | |
f.rect = function(a, b, c, d) { | |
this.za.rect(a, b, c, d) | |
}; | |
f.restore = function() { | |
this.za.restore() | |
}; | |
Hd.prototype.rotate = function(a) { | |
this.za.rotate(a) | |
}; | |
f = Hd.prototype; | |
f.save = function() { | |
this.za.save() | |
}; | |
f.setTransform = function(a, b, c, d, e, g) { | |
this.za.setTransform(a, b, c, d, e, g) | |
}; | |
f.scale = function(a, b) { | |
this.za.scale(a, b) | |
}; | |
f.stroke = function() { | |
this.za.stroke() | |
}; | |
f.transform = function(a, b, c, d, e, g) { | |
1 === a && 0 === b && 0 === c && 1 === d && 0 === e && 0 === g || this.za.transform(a, b, c, d, e, g) | |
}; | |
f.translate = function(a, b) { | |
this.za.translate(a, b) | |
}; | |
f.Xg = function(a) { | |
if (a instanceof Ba && a.type === Id) { | |
var b = a.Mo; | |
a = a.wz; | |
a > b ? (this.scale(b / a, 1), this.translate((a - b) / 2, 0)) : b > a && (this.scale(1, a / b), this.translate(0, (b - a) / 2)); | |
this.vr ? this.clip() : this.fill(); | |
a > b ? (this.translate(-(a - b) / 2, 0), this.scale(1 / (b / a), 1)) : b > a && (this.translate(0, -(b - a) / 2), this.scale(1, 1 / (a / b))) | |
} else this.vr ? this.clip() : this.fill() | |
}; | |
f.Zj = function() { | |
this.vr || this.stroke() | |
}; | |
D.defineProperty(Hd, { | |
eq: "clipInsteadOfFill" | |
}, function() { | |
return this.vr | |
}, function(a) { | |
this.vr = a | |
}); | |
f = Hd.prototype; | |
f.eC = function(a, b, c) { | |
this.Ft = a; | |
this.Gt = b; | |
this.Pg = c | |
}; | |
f.Em = function() { | |
this.shadowBlur = this.shadowOffsetY = this.shadowOffsetX = 0 | |
}; | |
f.xo = function() { | |
this.shadowOffsetX = this.Ft; | |
this.shadowOffsetY = this.Gt; | |
this.shadowBlur = this.Pg | |
}; | |
f.WA = function(a, b) { | |
var c = this.za; | |
if (void 0 !== c.setLineDash) c.setLineDash(a), c.lineDashOffset = b; | |
else if (void 0 !== c.webkitLineDash) c.webkitLineDash = a, c.webkitLineDashOffset = b; | |
else return !1; | |
return !0 | |
}; | |
f.RA = function() { | |
var a = this.za; | |
void 0 !== a.setLineDash ? (a.setLineDash(D.ml), a.lineDashOffset = 0) : void 0 !== a.webkitLineDash && (a.webkitLineDash = D.ml, a.webkitLineDashOffset = 0) | |
}; | |
f.De = function(a) { | |
a && (this.qz = ""); | |
this.pz = this.rz = "" | |
}; | |
var Jd = (Math.sqrt(2) - 1) / 3 * 4, | |
Kd = (new N(0, 0)).Oa(), | |
Ld = (new C(0, 0, 0, 0)).Oa(), | |
Sd = (new Lb(0, 0, 0, 0)).Oa(), | |
Td = (new Lb(2, 2, 2, 2)).Oa(), | |
Ud = (new N(6, 6)).Oa(), | |
Vd = (new N(-Infinity, -Infinity)).Oa(), | |
Wd = (new N(Infinity, Infinity)).Oa(), | |
Xd = (new Ca(0, 0)).Oa(), | |
Yd = (new Ca(1, 1)).Oa(), | |
Zd = (new Ca(6, 6)).Oa(), | |
$d = (new Ca(8, 8)).Oa(), | |
ae = (new Ca(10, 10)).Oa(), | |
ge = (new Ca(Infinity, Infinity)).Oa(), | |
he = (new N(NaN, NaN)).Oa(), | |
ie = (new Ca(NaN, NaN)).Oa(), | |
je = (new C(NaN, NaN, NaN, NaN)).Oa(), | |
ke = (new S(.156, .156)).Oa(), | |
le = (new S(.844, .844)).Oa(), | |
me = new ma, | |
ne = new ma, | |
oe = null; | |
function pe(a) { | |
if (0 >= a) return 0; | |
var b = oe; | |
if (null === b) { | |
for (var b = [], c = 0; 2E3 >= c; c++) b[c] = Math.sqrt(c); | |
oe = b | |
} | |
return 1 > a ? (c = 1 / a, 2E3 >= c ? 1 / b[c | 0] : Math.sqrt(a)) : 2E3 >= a ? b[a | 0] : Math.sqrt(a) | |
} | |
function Q(a, b) { | |
var c = a - b; | |
return .5 > c && -.5 < c | |
} | |
function Eb(a, b) { | |
var c = a - b; | |
return 5E-8 > c && -5E-8 < c | |
} | |
function qe(a, b, c, d, e, g, h) { | |
0 >= e && (e = 1E-6); | |
var k = 0, | |
l = 0, | |
m = 0, | |
n = 0; | |
a < c ? (l = a, k = c) : (l = c, k = a); | |
b < d ? (n = b, m = d) : (n = d, m = b); | |
if (a === c) return n <= h && h <= m && a - e <= g && g <= a + e; | |
if (b === d) return l <= g && g <= k && b - e <= h && h <= b + e; | |
k += e; | |
l -= e; | |
if (l <= g && g <= k && (m += e, n -= e, n <= h && h <= m)) | |
if (k - l > m - n) | |
if (a - c > e || c - a > e) { | |
if (g = (d - b) / (c - a) * (g - a) + b, g - e <= h && h <= g + e) return !0 | |
} else return !0; | |
else if (b - d > e || d - b > e) { | |
if (h = (c - a) / (d - b) * (h - b) + a, h - e <= g && g <= h + e) return !0 | |
} else return !0; | |
return !1 | |
} | |
function re(a, b, c, d, e, g, h, k, l, m, n, p) { | |
if (qe(a, b, h, k, p, c, d) && qe(a, b, h, k, p, e, g)) return qe(a, b, h, k, p, m, n); | |
var q = (a + c) / 2, | |
r = (b + d) / 2, | |
s = (c + e) / 2, | |
u = (d + g) / 2; | |
e = (e + h) / 2; | |
g = (g + k) / 2; | |
d = (q + s) / 2; | |
c = (r + u) / 2; | |
var s = (s + e) / 2, | |
u = (u + g) / 2, | |
t = (d + s) / 2, | |
y = (c + u) / 2; | |
return re(a, b, q, r, d, c, t, y, l, m, n, p) || re(t, y, s, u, e, g, h, k, l, m, n, p) | |
} | |
function Ae(a, b, c, d, e, g, h, k, l, m) { | |
if (qe(a, b, h, k, l, c, d) && qe(a, b, h, k, l, e, g)) Ub(m, a, b, 0, 0), Ub(m, h, k, 0, 0); | |
else { | |
var n = (a + c) / 2, | |
p = (b + d) / 2, | |
q = (c + e) / 2, | |
r = (d + g) / 2; | |
e = (e + h) / 2; | |
g = (g + k) / 2; | |
d = (n + q) / 2; | |
c = (p + r) / 2; | |
var q = (q + e) / 2, | |
r = (r + g) / 2, | |
s = (d + q) / 2, | |
u = (c + r) / 2; | |
Ae(a, b, n, p, d, c, s, u, l, m); | |
Ae(s, u, q, r, e, g, h, k, l, m) | |
} | |
} | |
function Be(a, b, c, d, e, g, h, k, l, m) { | |
if (qe(a, b, h, k, l, c, d) && qe(a, b, h, k, l, e, g)) 0 === m.length && (m.push(a), m.push(b)), m.push(h), m.push(k); | |
else { | |
var n = (a + c) / 2, | |
p = (b + d) / 2, | |
q = (c + e) / 2, | |
r = (d + g) / 2; | |
e = (e + h) / 2; | |
g = (g + k) / 2; | |
d = (n + q) / 2; | |
c = (p + r) / 2; | |
var q = (q + e) / 2, | |
r = (r + g) / 2, | |
s = (d + q) / 2, | |
u = (c + r) / 2; | |
Be(a, b, n, p, d, c, s, u, l, m); | |
Be(s, u, q, r, e, g, h, k, l, m) | |
} | |
} | |
function Ce(a, b, c, d, e, g, h, k, l, m, n, p, q, r) { | |
var s = 1 - l; | |
a = a * s + c * l; | |
b = b * s + d * l; | |
c = c * s + e * l; | |
d = d * s + g * l; | |
e = e * s + h * l; | |
g = g * s + k * l; | |
k = a * s + c * l; | |
h = b * s + d * l; | |
c = c * s + e * l; | |
d = d * s + g * l; | |
m.x = a; | |
m.y = b; | |
n.x = k; | |
n.y = h; | |
p.x = k * s + c * l; | |
p.y = h * s + d * l; | |
q.x = c; | |
q.y = d; | |
r.x = e; | |
r.y = g | |
} | |
function De(a, b, c, d, e, g, h, k, l, m) { | |
if (qe(a, b, e, g, m, c, d)) return qe(a, b, e, g, m, k, l); | |
var n = (a + c) / 2, | |
p = (b + d) / 2; | |
c = (c + e) / 2; | |
d = (d + g) / 2; | |
var q = (n + c) / 2, | |
r = (p + d) / 2; | |
return De(a, b, n, p, q, r, h, k, l, m) || De(q, r, c, d, e, g, h, k, l, m) | |
} | |
function Ee(a, b, c, d, e, g, h, k) { | |
if (qe(a, b, e, g, h, c, d)) Ub(k, a, b, 0, 0), Ub(k, e, g, 0, 0); | |
else { | |
var l = (a + c) / 2, | |
m = (b + d) / 2; | |
c = (c + e) / 2; | |
d = (d + g) / 2; | |
var n = (l + c) / 2, | |
p = (m + d) / 2; | |
Ee(a, b, l, m, n, p, h, k); | |
Ee(n, p, c, d, e, g, h, k) | |
} | |
} | |
function Fe(a, b, c, d, e, g, h, k) { | |
if (qe(a, b, e, g, h, c, d)) 0 === k.length && (k.push(a), k.push(b)), k.push(e), k.push(g); | |
else { | |
var l = (a + c) / 2, | |
m = (b + d) / 2; | |
c = (c + e) / 2; | |
d = (d + g) / 2; | |
var n = (l + c) / 2, | |
p = (m + d) / 2; | |
Fe(a, b, l, m, n, p, h, k); | |
Fe(n, p, c, d, e, g, h, k) | |
} | |
} | |
function Ge(a, b, c, d, e, g, h, k, l, m, n, p, q, r) { | |
0 >= q && (q = 1E-6); | |
if (qe(a, b, h, k, q, c, d) && qe(a, b, h, k, q, e, g)) { | |
var s = (a - h) * (m - p) - (b - k) * (l - n); | |
if (0 === s) return !1; | |
q = ((a * k - b * h) * (l - n) - (a - h) * (l * p - m * n)) / s; | |
s = ((a * k - b * h) * (m - p) - (b - k) * (l * p - m * n)) / s; | |
if ((l > n ? l - n : n - l) < (m > p ? m - p : p - m)) { | |
if (h = l = 0, b < k ? (l = b, h = k) : (l = k, h = b), s < l || s > h) return !1 | |
} else if (a < h ? l = a : (l = h, h = a), q < l || q > h) return !1; | |
r.x = q; | |
r.y = s; | |
return !0 | |
} | |
var s = (a + c) / 2, | |
u = (b + d) / 2; | |
c = (c + e) / 2; | |
d = (d + g) / 2; | |
e = (e + h) / 2; | |
g = (g + k) / 2; | |
var t = (s + c) / 2, | |
y = (u + d) / 2; | |
c = (c + e) / 2; | |
d = (d + g) / 2; | |
var w = (t + c) / 2, | |
A = (y + d) / 2, | |
B = (n - l) * (n - l) + (p - m) * (p - m), | |
P = !1; | |
Ge(a, b, s, u, t, y, w, A, l, m, n, p, q, r) && (b = (r.x - l) * (r.x - l) + (r.y - m) * (r.y - m), b < B && (B = b, P = !0)); | |
a = r.x; | |
s = r.y; | |
Ge(w, A, c, d, e, g, h, k, l, m, n, p, q, r) && (b = (r.x - l) * (r.x - l) + (r.y - m) * (r.y - m), b < B ? P = !0 : (r.x = a, r.y = s)); | |
return P | |
} | |
function He(a, b, c, d, e, g, h, k, l, m, n, p, q) { | |
var r = 0; | |
0 >= q && (q = 1E-6); | |
if (qe(a, b, h, k, q, c, d) && qe(a, b, h, k, q, e, g)) { | |
q = (a - h) * (m - p) - (b - k) * (l - n); | |
if (0 === q) return r; | |
var s = ((a * k - b * h) * (l - n) - (a - h) * (l * p - m * n)) / q, | |
u = ((a * k - b * h) * (m - p) - (b - k) * (l * p - m * n)) / q; | |
if (s >= n) return r; | |
if ((l > n ? l - n : n - l) < (m > p ? m - p : p - m)) { | |
if (a = l = 0, b < k ? (l = b, a = k) : (l = k, a = b), u < l || u > a) return r | |
} else if (a < h ? (l = a, a = h) : l = h, s < l || s > a) return r; | |
0 < q ? r++ : 0 > q && r-- | |
} else { | |
var s = (a + c) / 2, | |
u = (b + d) / 2, | |
t = (c + e) / 2, | |
y = (d + g) / 2; | |
e = (e + h) / 2; | |
g = (g + k) / 2; | |
d = (s + t) / 2; | |
c = (u + y) / 2; | |
var t = (t + e) / 2, | |
y = (y + g) / 2, | |
w = (d + t) / 2, | |
A = (c + y) / 2, | |
r = r + He(a, b, s, u, d, c, w, A, l, m, n, p, q), | |
r = r + He(w, A, t, y, e, g, h, k, l, m, n, p, q) | |
} | |
return r | |
} | |
function db(a, b, c, d, e, g, h) { | |
if (Eb(a, c)) { | |
var k = 0; | |
c = 0; | |
b < d ? (k = b, c = d) : (k = d, c = b); | |
d = g; | |
if (d < k) return h.x = a, h.y = k, !1; | |
if (d > c) return h.x = a, h.y = c, !1; | |
h.x = a; | |
h.y = d; | |
return !0 | |
} | |
if (Eb(b, d)) { | |
a < c ? k = a : (k = c, c = a); | |
d = e; | |
if (d < k) return h.x = k, h.y = b, !1; | |
if (d > c) return h.x = c, h.y = b, !1; | |
h.x = d; | |
h.y = b; | |
return !0 | |
} | |
k = ((a - e) * (a - c) + (b - g) * (b - d)) / ((c - a) * (c - a) + (d - b) * (d - b)); | |
if (-5E-6 > k) return h.x = a, h.y = b, !1; | |
if (1.000005 < k) return h.x = c, h.y = d, !1; | |
h.x = a + k * (c - a); | |
h.y = b + k * (d - b); | |
return !0 | |
} | |
function Ie(a, b, c, d, e, g, h, k, l) { | |
if (Q(a, c) && Q(b, d)) return l.x = a, l.y = b, !1; | |
if (Eb(e, h)) { | |
if (Eb(a, c)) return db(a, b, c, d, e, g, l), !1; | |
g = (d - b) / (c - a) * (e - a) + b; | |
return db(a, b, c, d, e, g, l) | |
} | |
k = (k - g) / (h - e); | |
if (Eb(a, c)) { | |
g = k * (a - e) + g; | |
c = h = 0; | |
b < d ? (h = b, c = d) : (h = d, c = b); | |
if (g < h) return l.x = a, l.y = h, !1; | |
if (g > c) return l.x = a, l.y = c, !1; | |
l.x = a; | |
l.y = g; | |
return !0 | |
} | |
h = (d - b) / (c - a); | |
if (Eb(k, h)) return db(a, b, c, d, e, g, l), !1; | |
e = (h * a - k * e + g - b) / (h - k); | |
if (Eb(h, 0)) { | |
a < c ? h = a : (h = c, c = a); | |
if (e < h) return l.x = h, l.y = b, !1; | |
if (e > c) return l.x = c, l.y = b, !1; | |
l.x = e; | |
l.y = b; | |
return !0 | |
} | |
g = | |
h * (e - a) + b; | |
return db(a, b, c, d, e, g, l) | |
} | |
function Je(a, b, c, d, e, g, h, k, l) { | |
var m = 1E21, | |
n = a, | |
p = b; | |
if (Ie(a, b, a, d, e, g, h, k, l)) { | |
var q = (l.x - e) * (l.x - e) + (l.y - g) * (l.y - g); | |
q < m && (m = q, n = l.x, p = l.y) | |
} | |
Ie(c, b, c, d, e, g, h, k, l) && (q = (l.x - e) * (l.x - e) + (l.y - g) * (l.y - g), q < m && (m = q, n = l.x, p = l.y)); | |
Ie(a, b, c, b, e, g, h, k, l) && (q = (l.x - e) * (l.x - e) + (l.y - g) * (l.y - g), q < m && (m = q, n = l.x, p = l.y)); | |
Ie(a, d, c, d, e, g, h, k, l) && (q = (l.x - e) * (l.x - e) + (l.y - g) * (l.y - g), q < m && (m = q, n = l.x, p = l.y)); | |
l.x = n; | |
l.y = p; | |
return 1E21 > m | |
} | |
function Ke(a, b, c, d, e, g, h, k, l) { | |
c = a - c; | |
var m = e - h, | |
n = h = 0; | |
0 === c || 0 === m ? 0 === c ? (k = (g - k) / m, h = a, n = k * h + (g - k * e)) : (d = (b - d) / c, h = e, n = d * h + (b - d * a)) : (d = (b - d) / c, k = (g - k) / m, a = b - d * a, h = (g - k * e - a) / (d - k), n = d * h + a); | |
l.n(h, n); | |
return l | |
} | |
function Le(a, b, c) { | |
var d = b.x, | |
e = b.y, | |
g = c.x, | |
h = c.y, | |
k = a.left, | |
l = a.right, | |
m = a.top, | |
n = a.bottom; | |
return d === g ? (g = a = 0, e < h ? (a = e, g = h) : (a = h, g = e), k <= d && d <= l && a <= n && g >= m) : e === h ? (d < g ? a = d : (a = g, g = d), m <= e && e <= n && a <= l && g >= k) : a.Pa(b) || a.Pa(c) || Pe(k, m, l, m, d, e, g, h) || Pe(l, m, l, n, d, e, g, h) || Pe(l, n, k, n, d, e, g, h) || Pe(k, n, k, m, d, e, g, h) ? !0 : !1 | |
} | |
function Pe(a, b, c, d, e, g, h, k) { | |
return 0 >= Qe(a, b, c, d, e, g) * Qe(a, b, c, d, h, k) && 0 >= Qe(e, g, h, k, a, b) * Qe(e, g, h, k, c, d) | |
} | |
function Qe(a, b, c, d, e, g) { | |
c -= a; | |
d -= b; | |
a = e - a; | |
b = g - b; | |
g = a * d - b * c; | |
0 === g && (g = a * c + b * d, 0 < g && (g = (a - c) * c + (b - d) * d, 0 > g && (g = 0))); | |
return 0 > g ? -1 : 0 < g ? 1 : 0 | |
} | |
function Re(a) { | |
0 > a && (a += 360); | |
360 <= a && (a -= 360); | |
return a | |
} | |
function Se(a, b, c, d) { | |
var e = Math.PI; | |
d || (b *= e / 180, c *= e / 180); | |
var g = b > c ? -1 : 1; | |
d = []; | |
var h = e / 2, | |
k = b; | |
c = Math.min(2 * e, Math.abs(c - b)); | |
if (1E-5 > c) return b = k + g * Math.min(c, h), g = 0 + a * Math.cos(k), k = 0 + a * Math.sin(k), h = 0 + a * Math.cos(b), a = 0 + a * Math.sin(b), b = (g + h) / 2, c = (k + a) / 2, d.push([g, k, b, c, b, c, h, a]), d; | |
for (; 1E-5 < c;) { | |
b = k + g * Math.min(c, h); | |
var e = (b - k) / 2, | |
l = a * Math.cos(e), | |
m = a * Math.sin(e), | |
n = -m, | |
p = l * l + n * n, | |
q = p + l * l + n * m, | |
p = 4 / 3 * (Math.sqrt(2 * p * q) - q) / (l * m - n * l), | |
m = l - p * n, | |
l = n + p * l, | |
n = -l, | |
p = e + k, | |
e = Math.cos(p), | |
p = Math.sin(p); | |
d.push([0 + a * Math.cos(k), | |
0 + a * Math.sin(k), 0 + m * e - l * p, 0 + m * p + l * e, 0 + m * e - n * p, 0 + m * p + n * e, 0 + a * Math.cos(b), 0 + a * Math.sin(b) | |
]); | |
c -= Math.abs(b - k); | |
k = b | |
} | |
return d | |
} | |
function gb(a, b, c, d, e, g, h) { | |
c = Math.floor((a - c) / e) * e + c; | |
d = Math.floor((b - d) / g) * g + d; | |
var k = c; | |
c + e - a < e / 2 && (k = c + e); | |
a = d; | |
d + g - b < g / 2 && (a = d + g); | |
h.n(k, a) | |
} | |
function Te(a, b) { | |
var c = Math.max(a, b), | |
d = Math.min(a, b), | |
e = 1, | |
g = 1; | |
do e = c % d, c = g = d, d = e; while (0 < e); | |
return g | |
} | |
function Ue(a, b, c, d) { | |
var e = 0 > c, | |
g = 0 > d, | |
h = 0, | |
k = h = 0; | |
a < b ? (h = 1, k = 0) : (h = 0, k = 1); | |
var l = 0, | |
m = 0, | |
n = 0, | |
p = 0, | |
l = 0 === h ? a : b, | |
n = 0 === h ? c : d; | |
if (0 === h ? e : g) n = -n; | |
h = k; | |
m = 0 === h ? a : b; | |
p = 0 === h ? c : d; | |
if (0 === h ? e : g) p = -p; | |
a = a = 0; | |
if (0 < p) | |
if (0 < n) { | |
b = l * l; | |
a = m * m; | |
l *= n; | |
c = m * p; | |
d = -a + c; | |
e = -a + Math.sqrt(l * l + c * c); | |
m = d; | |
for (g = 0; 9999999999 > g; ++g) { | |
m = .5 * (d + e); | |
if (m === d || m === e) break; | |
k = l / (m + b); | |
h = c / (m + a); | |
k = k * k + h * h - 1; | |
if (0 < k) d = m; | |
else if (0 > k) e = m; | |
else break | |
} | |
n = b * n / (m + b) - n; | |
p = a * p / (m + a) - p; | |
a = Math.sqrt(n * n + p * p) | |
} else a = Math.abs(p - m); | |
else p = l * l - m * m, a = l * n, a < p ? (p = a / p, a = m * Math.sqrt(Math.abs(1 - | |
p * p)), n = l * p - n, a = Math.sqrt(n * n + a * a)) : a = Math.abs(n - l); | |
return a | |
} | |
function Ve(a) { | |
1 < arguments.length && D.k("Geometry constructor can take at most one optional argument, the Geometry type."); | |
D.xc(this); | |
this.J = !1; | |
void 0 === a ? a = We : v && D.Da(a, Ve, Ve, "constructor:type"); | |
this.ca = a; | |
this.Jb = this.Cb = this.Mc = this.Ac = 0; | |
this.kk = new K(Xe); | |
this.ew = this.kk.I; | |
this.Qv = (new C).freeze(); | |
this.pb = !0; | |
this.kr = this.Go = null; | |
this.lr = NaN; | |
this.xi = ec; | |
this.yi = vc; | |
this.jp = this.lp = NaN; | |
this.Xi = Ye | |
} | |
D.ka("Geometry", Ve); | |
D.Di(Ve); | |
Ve.prototype.copy = function() { | |
var a = new Ve; | |
a.ca = this.ca; | |
a.Ac = this.Ac; | |
a.Mc = this.Mc; | |
a.Cb = this.Cb; | |
a.Jb = this.Jb; | |
for (var b = this.kk.o, c = b.length, d = a.kk, e = 0; e < c; e++) { | |
var g = b[e].copy(); | |
d.add(g) | |
} | |
a.ew = this.ew; | |
a.Qv.assign(this.Qv); | |
a.pb = this.pb; | |
a.Go = this.Go; | |
a.kr = this.kr; | |
a.lr = this.lr; | |
a.xi = this.xi.V(); | |
a.yi = this.yi.V(); | |
a.lp = this.lp; | |
a.jp = this.jp; | |
a.Xi = this.Xi; | |
return a | |
}; | |
var Ze; | |
Ve.Line = Ze = D.s(Ve, "Line", 0); | |
var tf; | |
Ve.Rectangle = tf = D.s(Ve, "Rectangle", 1); | |
var uf; | |
Ve.Ellipse = uf = D.s(Ve, "Ellipse", 2); | |
var We; | |
Ve.Path = We = D.s(Ve, "Path", 3); | |
Ve.prototype.Oa = function() { | |
this.freeze(); | |
Object.freeze(this); | |
return this | |
}; | |
Ve.prototype.freeze = function() { | |
this.J = !0; | |
var a = this.nc; | |
a.freeze(); | |
for (var a = a.o, b = a.length, c = 0; c < b; c++) a[c].freeze(); | |
return this | |
}; | |
Ve.prototype.Xa = function() { | |
Object.isFrozen(this) && D.k("cannot thaw constant: " + this); | |
this.J = !1; | |
var a = this.nc; | |
a.Xa(); | |
for (var a = a.o, b = a.length, c = 0; c < b; c++) a[c].Xa(); | |
return this | |
}; | |
Ve.prototype.equalsApprox = Ve.prototype.Wc = function(a) { | |
if (!(a instanceof Ve)) return !1; | |
if (this.type !== a.type) return this.type === Ze && a.type === We ? vf(this, a) : a.type === Ze && this.type === We ? vf(a, this) : !1; | |
if (this.type === We) { | |
var b = this.nc.o; | |
a = a.nc.o; | |
var c = b.length; | |
if (c !== a.length) return !1; | |
for (var d = 0; d < c; d++) | |
if (!b[d].Wc(a[d])) return !1; | |
return !0 | |
} | |
return Q(this.la, a.la) && Q(this.ja, a.ja) && Q(this.F, a.F) && Q(this.G, a.G) | |
}; | |
function vf(a, b) { | |
if (a.type !== Ze || b.type !== We) return !1; | |
if (1 === b.nc.count) { | |
var c = b.nc.fa(0); | |
if (1 === c.Eb.count && Q(a.la, c.la) && Q(a.ja, c.ja) && (c = c.Eb.fa(0), c.type === wf && Q(a.F, c.F) && Q(a.G, c.G))) return !0 | |
} | |
return !1 | |
} | |
var xf; | |
Ve.stringify = xf = function(a) { | |
return a.toString() | |
}; | |
Ve.prototype.qc = function(a) { | |
a.Re === Ve ? this.type = a : D.ak(this, a) | |
}; | |
Ve.prototype.toString = function(a) { | |
void 0 === a && (a = -1); | |
switch (this.type) { | |
case Ze: | |
return 0 > a ? "M" + this.la.toString() + " " + this.ja.toString() + "L" + this.F.toString() + " " + this.G.toString() : "M" + this.la.toFixed(a) + " " + this.ja.toFixed(a) + "L" + this.F.toFixed(a) + " " + this.G.toFixed(a); | |
case tf: | |
var b = new C(this.la, this.ja, 0, 0); | |
b.sH(this.F, this.G, 0, 0); | |
return 0 > a ? "M" + b.x.toString() + " " + b.y.toString() + "H" + b.right.toString() + "V" + b.bottom.toString() + "H" + b.left.toString() + "z" : "M" + b.x.toFixed(a) + " " + b.y.toFixed(a) + "H" + b.right.toFixed(a) + | |
"V" + b.bottom.toFixed(a) + "H" + b.left.toFixed(a) + "z"; | |
case uf: | |
b = new C(this.la, this.ja, 0, 0); | |
b.sH(this.F, this.G, 0, 0); | |
if (0 > a) { | |
var c = b.left.toString() + " " + (b.y + b.height / 2).toString(), | |
d = b.right.toString() + " " + (b.y + b.height / 2).toString(); | |
return "M" + c + "A" + (b.width / 2).toString() + " " + (b.height / 2).toString() + " 0 0 1 " + d + "A" + (b.width / 2).toString() + " " + (b.height / 2).toString() + " 0 0 1 " + c | |
} | |
c = b.left.toFixed(a) + " " + (b.y + b.height / 2).toFixed(a); | |
d = b.right.toFixed(a) + " " + (b.y + b.height / 2).toFixed(a); | |
return "M" + c + "A" + (b.width / | |
2).toFixed(a) + " " + (b.height / 2).toFixed(a) + " 0 0 1 " + d + "A" + (b.width / 2).toFixed(a) + " " + (b.height / 2).toFixed(a) + " 0 0 1 " + c; | |
case We: | |
for (var b = "", c = this.nc.o, d = c.length, e = 0; e < d; e++) { | |
var g = c[e]; | |
0 < e && (b += " x "); | |
g.Ku && (b += "F "); | |
b += g.toString(a) | |
} | |
return b; | |
default: | |
return this.type.toString() | |
} | |
}; | |
Ve.fillPath = function(a) { | |
"string" !== typeof a && D.kc(a, "string", Ve, "fillPath:str"); | |
a = a.split(/[Xx]/); | |
for (var b = a.length, c = "", d = 0; d < b; d++) var e = a[d], | |
c = null !== e.match(/[Ff]/) ? 0 === d ? c + e : c + ("X" + (" " === e[0] ? "" : " ") + e) : c + ((0 === d ? "" : "X ") + "F" + (" " === e[0] ? "" : " ") + e); | |
return c | |
}; | |
var yf; | |
Ve.parse = yf = function(a, b) { | |
function c() { | |
return t >= P - 1 ? !0 : null !== l[t + 1].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/) | |
} | |
function d() { | |
t++; | |
return l[t] | |
} | |
function e() { | |
var a = new N(parseFloat(d()), parseFloat(d())); | |
y === y.toLowerCase() && (a.x = B.x + a.x, a.y = B.y + a.y); | |
return a | |
} | |
function g() { | |
return B = e() | |
} | |
function h() { | |
return A = e() | |
} | |
function k() { | |
return "c" !== w.toLowerCase() && "s" !== w.toLowerCase() ? B : new N(2 * B.x - A.x, 2 * B.y - A.y) | |
} | |
void 0 === b && (b = !1); | |
"string" !== typeof a && D.kc(a, "string", Ve, "parse:str"); | |
a = a.replace(/,/gm, " "); | |
a = a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm, | |
"$1 $2"); | |
a = a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm, "$1 $2"); | |
a = a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([^\s])/gm, "$1 $2"); | |
a = a.replace(/([^\s])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm, "$1 $2"); | |
a = a.replace(/([0-9])([+\-])/gm, "$1 $2"); | |
a = a.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm, "$1 $3 $4 "); | |
a = a.replace(/[\s\r\t\n]+/gm, " "); | |
a = a.replace(/^\s+|\s+$/g, ""); | |
for (var l = a.split(" "), m = 0; m < l.length; m++) { | |
var n = l[m]; | |
if (null !== n.match(/(\.[0-9]*)(\.)/gm)) { | |
for (var p = [], q = "", r = !1, s = 0; s < n.length; s++) { | |
var u = n[s]; | |
"." !== u || r ? "." === u ? (p.push(q), q = ".") : q += u : (r = !0, q += u) | |
} | |
p.push(q); | |
l.splice(m, 1); | |
for (n = 0; n < p.length; n++) l.splice(m + n, 0, p[n]); | |
m += p.length - 1 | |
} | |
} | |
for (var t = -1, y = "", w = "", n = new N(0, 0), A = new N(0, 0), B = new N(0, 0), P = l.length, p = D.v(), r = q = !1, s = !0, m = null; !(t >= P - 1);) | |
if (w = y, y = d(), "" !== y) switch (y.toUpperCase()) { | |
case "X": | |
s = !0; | |
r = q = !1; | |
break; | |
case "M": | |
m = g(); | |
null === p.fc || !0 === s ? (T(p, m.x, m.y, q, !1, !r), s = !1) : p.moveTo(m.x, m.y); | |
for (n = B; !c();) m = g(), p.lineTo(m.x, m.y); | |
break; | |
case "L": | |
for (; !c();) m = | |
g(), p.lineTo(m.x, m.y); | |
break; | |
case "H": | |
for (; !c();) B = m = new N((y === y.toLowerCase() ? B.x : 0) + parseFloat(d()), B.y), p.lineTo(B.x, B.y); | |
break; | |
case "V": | |
for (; !c();) B = m = new N(B.x, (y === y.toLowerCase() ? B.y : 0) + parseFloat(d())), p.lineTo(B.x, B.y); | |
break; | |
case "C": | |
for (; !c();) { | |
var u = e(), | |
H = h(), | |
m = g(); | |
U(p, u.x, u.y, H.x, H.y, m.x, m.y) | |
} | |
break; | |
case "S": | |
for (; !c();) u = k(), H = h(), m = g(), U(p, u.x, u.y, H.x, H.y, m.x, m.y); | |
break; | |
case "Q": | |
for (; !c();) H = h(), m = g(), zf(p, H.x, H.y, m.x, m.y); | |
break; | |
case "T": | |
for (; !c();) A = H = k(), m = g(), zf(p, H.x, H.y, m.x, m.y); | |
break; | |
case "B": | |
for (; !c();) { | |
var m = parseFloat(d()), | |
u = parseFloat(d()), | |
H = parseFloat(d()), | |
R = parseFloat(d()), | |
aa = parseFloat(d()), | |
V = aa, | |
ea = !1; | |
c() || (V = parseFloat(d()), c() || (ea = 0 !== parseFloat(d()))); | |
y === y.toLowerCase() && (H += B.x, R += B.y); | |
p.arcTo(m, u, H, R, aa, V, ea) | |
} | |
break; | |
case "A": | |
for (; !c();) u = Math.abs(parseFloat(d())), H = Math.abs(parseFloat(d())), R = parseFloat(d()), aa = !!parseFloat(d()), V = !!parseFloat(d()), m = g(), Af(p, u, H, R, aa, V, m.x, m.y); | |
break; | |
case "Z": | |
m = p.q.nc.o[p.q.nc.length - 1]; | |
X(p); | |
B = n; | |
break; | |
case "F": | |
u = ""; | |
for (m = 1; l[t + | |
m];) | |
if (null !== l[t + m].match(/[Uu]/)) m++; | |
else if (null === l[t + m].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/)) m++; | |
else { | |
u = l[t + m]; | |
break | |
} | |
u.match(/[Mm]/) ? q = !0 : Bf(p); | |
break; | |
case "U": | |
u = ""; | |
for (m = 1; l[t + m];) | |
if (null !== l[t + m].match(/[Ff]/)) m++; | |
else if (null === l[t + m].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/)) m++; | |
else { | |
u = l[t + m]; | |
break | |
} | |
u.match(/[Mm]/) ? r = !0 : p.kb(!1) | |
} | |
n = p.q; | |
D.u(p); | |
if (b) | |
for (p = n.nc.j; p.next();) m = p.value, m.Ku = !0; | |
return n | |
}; | |
function Cf(a, b) { | |
for (var c = a.length, d = D.P(), e = 0; e < c; e++) { | |
var g = a[e]; | |
d.x = g[0]; | |
d.y = g[1]; | |
b.vb(d); | |
g[0] = d.x; | |
g[1] = d.y; | |
d.x = g[2]; | |
d.y = g[3]; | |
b.vb(d); | |
g[2] = d.x; | |
g[3] = d.y; | |
d.x = g[4]; | |
d.y = g[5]; | |
b.vb(d); | |
g[4] = d.x; | |
g[5] = d.y; | |
d.x = g[6]; | |
d.y = g[7]; | |
b.vb(d); | |
g[6] = d.x; | |
g[7] = d.y | |
} | |
D.A(d) | |
} | |
Ve.prototype.rB = function() { | |
if (this.pb || this.ew !== this.nc.I) return !0; | |
for (var a = this.nc.o, b = a.length, c = 0; c < b; c++) | |
if (a[c].rB()) return !0; | |
return !1 | |
}; | |
Ve.prototype.Kh = function() { | |
this.pb = !1; | |
this.kr = this.Go = null; | |
this.lr = NaN; | |
this.ew = this.nc.I; | |
for (var a = this.nc.o, b = a.length, c = 0; c < b; c++) { | |
var d = a[c]; | |
d.pb = !1; | |
var e = d.Eb; | |
d.ix = e.I; | |
for (var d = e.o, e = d.length, g = 0; g < e; g++) { | |
var h = d[g]; | |
h.pb = !1; | |
h.$h = null | |
} | |
} | |
a = this.Qv; | |
a.Xa(); | |
isNaN(this.lp) || isNaN(this.jp) ? a.n(0, 0, 0, 0) : a.n(0, 0, this.lp, this.jp); | |
Df(this, a, !1); | |
Ub(a, 0, 0, 0, 0); | |
a.freeze() | |
}; | |
Ve.prototype.computeBoundsWithoutOrigin = Ve.prototype.kI = function() { | |
var a = new C; | |
Df(this, a, !0); | |
return a | |
}; | |
function Df(a, b, c) { | |
switch (a.type) { | |
case Ze: | |
case tf: | |
case uf: | |
c ? b.n(a.Ac, a.Mc, 0, 0) : Ub(b, a.Ac, a.Mc, 0, 0); | |
Ub(b, a.Cb, a.Jb, 0, 0); | |
break; | |
case We: | |
var d = a.nc; | |
a = d.o; | |
for (var d = d.length, e = 0; e < d; e++) { | |
var g = a[e]; | |
c && 0 === e ? b.n(g.la, g.ja, 0, 0) : Ub(b, g.la, g.ja, 0, 0); | |
for (var h = g.Eb.o, k = h.length, l = g.la, m = g.ja, n = 0; n < k; n++) { | |
var p = h[n]; | |
switch (p.type) { | |
case wf: | |
case Ef: | |
l = p.F; | |
m = p.G; | |
Ub(b, l, m, 0, 0); | |
break; | |
case Ff: | |
Ae(l, m, p.Ec, p.$c, p.Uh, p.Vh, p.F, p.G, .5, b); | |
l = p.F; | |
m = p.G; | |
break; | |
case Gf: | |
Ee(l, m, p.Ec, p.$c, p.F, p.G, .5, b); | |
l = p.F; | |
m = p.G; | |
break; | |
case Hf: | |
case If: | |
var q = | |
p.type === Hf ? Vf(p, g) : Wf(p, g, l, m), | |
r = q.length; | |
if (0 === r) { | |
l = p.pa; | |
m = p.va; | |
Ub(b, l, m, 0, 0); | |
break | |
} | |
for (var p = null, s = 0; s < r; s++) p = q[s], Ae(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], .5, b); | |
null !== p && (l = p[6], m = p[7]); | |
break; | |
default: | |
D.k("Unknown Segment type: " + p.type) | |
} | |
} | |
} | |
break; | |
default: | |
D.k("Unknown Geometry type: " + a.type) | |
} | |
} | |
Ve.prototype.normalize = Ve.prototype.normalize = function() { | |
this.J && D.qa(this); | |
var a = this.kI(); | |
this.offset(-a.x, -a.y); | |
return new N(-a.x, -a.y) | |
}; | |
Ve.prototype.offset = Ve.prototype.offset = function(a, b) { | |
this.J && D.qa(this); | |
v && (D.p(a, Ve, "offset"), D.p(b, Ve, "offset")); | |
this.transform(1, 0, 0, 1, a, b); | |
return this | |
}; | |
Ve.prototype.scale = Ve.prototype.scale = function(a, b) { | |
this.J && D.qa(this); | |
v && (D.p(a, Ve, "scale:x"), D.p(b, Ve, "scale:y"), 0 === a && D.ua(a, "scale must be non-zero", Ve, "scale:x"), 0 === b && D.ua(b, "scale must be non-zero", Ve, "scale:y")); | |
this.transform(a, 0, 0, b, 0, 0); | |
return this | |
}; | |
Ve.prototype.rotate = Ve.prototype.rotate = function(a, b, c) { | |
this.J && D.qa(this); | |
void 0 === b && (b = 0); | |
void 0 === c && (c = 0); | |
v && (D.p(a, Ve, "rotate:angle"), D.p(b, Ve, "rotate:x"), D.p(c, Ve, "rotate:y")); | |
var d = D.hh(); | |
d.reset(); | |
d.rotate(a, b, c); | |
this.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy); | |
D.nf(d); | |
return this | |
}; | |
Ve.prototype.transform = Ve.prototype.transform = function(a, b, c, d, e, g) { | |
var h = 0, | |
k = 0; | |
switch (this.type) { | |
case Ze: | |
case tf: | |
case uf: | |
h = this.Ac; | |
k = this.Mc; | |
this.Ac = h * a + k * c + e; | |
this.Mc = h * b + k * d + g; | |
h = this.Cb; | |
k = this.Jb; | |
this.Cb = h * a + k * c + e; | |
this.Jb = h * b + k * d + g; | |
break; | |
case We: | |
for (var l = this.nc.o, m = l.length, n = 0; n < m; n++) { | |
var p = l[n], | |
h = p.la, | |
k = p.ja; | |
p.la = h * a + k * c + e; | |
p.ja = h * b + k * d + g; | |
for (var p = p.Eb.o, q = p.length, r = 0; r < q; r++) { | |
var s = p[r]; | |
switch (s.type) { | |
case wf: | |
case Ef: | |
h = s.F; | |
k = s.G; | |
s.F = h * a + k * c + e; | |
s.G = h * b + k * d + g; | |
break; | |
case Ff: | |
h = s.Ec; | |
k = s.$c; | |
s.Ec = | |
h * a + k * c + e; | |
s.$c = h * b + k * d + g; | |
h = s.Uh; | |
k = s.Vh; | |
s.Uh = h * a + k * c + e; | |
s.Vh = h * b + k * d + g; | |
h = s.F; | |
k = s.G; | |
s.F = h * a + k * c + e; | |
s.G = h * b + k * d + g; | |
break; | |
case Gf: | |
h = s.Ec; | |
k = s.$c; | |
s.Ec = h * a + k * c + e; | |
s.$c = h * b + k * d + g; | |
h = s.F; | |
k = s.G; | |
s.F = h * a + k * c + e; | |
s.G = h * b + k * d + g; | |
break; | |
case Hf: | |
h = s.pa; | |
k = s.va; | |
s.pa = h * a + k * c + e; | |
s.va = h * b + k * d + g; | |
0 !== b && (h = 180 * Math.atan2(b, a) / Math.PI, 0 > h && (h += 360), s.Ne += h); | |
0 > a && (s.Ne = 180 - s.Ne, s.Ff = -s.Ff); | |
0 > d && (s.Ne = -s.Ne, s.Ff = -s.Ff); | |
s.radiusX *= Math.sqrt(a * a + c * c); | |
void 0 !== s.radiusY && (s.radiusY *= Math.sqrt(b * b + d * d)); | |
break; | |
case If: | |
h = s.F; | |
k = s.G; | |
s.F = h * | |
a + k * c + e; | |
s.G = h * b + k * d + g; | |
0 !== b && (h = 180 * Math.atan2(b, a) / Math.PI, 0 > h && (h += 360), s.ck += h); | |
0 > a && (s.ck = 180 - s.ck, s.xm = !s.xm); | |
0 > d && (s.ck = -s.ck, s.xm = !s.xm); | |
s.radiusX *= Math.sqrt(a * a + c * c); | |
s.radiusY *= Math.sqrt(b * b + d * d); | |
break; | |
default: | |
D.k("Unknown Segment type: " + s.type) | |
} | |
} | |
} | |
} | |
this.pb = !0; | |
return this | |
}; | |
Ve.prototype.Pa = function(a, b, c, d) { | |
var e = a.x, | |
g = a.y, | |
h = this.ib.x - 20; | |
a = a.y; | |
for (var k = 0, l = 0, m = 0, n = 0, p = 0, q = 0, r = this.nc.o, s = r.length, u = 0; u < s; u++) { | |
var t = r[u]; | |
if (t.Ku) { | |
if (c && t.Pa(e, g, b)) return !0; | |
for (var y = t.Eb, l = t.la, m = t.ja, w = l, A = m, B = y.o, P = 0; P <= y.length; P++) { | |
var H, R; | |
P !== y.length ? (H = B[P], R = H.type, p = H.F, q = H.G) : (R = wf, p = w, q = A); | |
switch (R) { | |
case Ef: | |
n = Xf(e, g, h, a, l, m, w, A); | |
if (isNaN(n)) return !0; | |
k += n; | |
w = p; | |
A = q; | |
break; | |
case wf: | |
n = Xf(e, g, h, a, l, m, p, q); | |
if (isNaN(n)) return !0; | |
k += n; | |
break; | |
case Ff: | |
n = He(l, m, H.Ec, H.$c, H.Uh, H.Vh, p, q, h, | |
a, e, g, .5); | |
k += n; | |
break; | |
case Gf: | |
n = He(l, m, (l + 2 * H.Ec) / 3, (m + 2 * H.$c) / 3, (2 * H.Ec + p) / 3, (2 * H.$c + q) / 3, p, q, h, a, e, g, .5); | |
k += n; | |
break; | |
case Hf: | |
case If: | |
R = H.type === Hf ? Vf(H, t) : Wf(H, t, l, m); | |
var aa = R.length; | |
if (0 === aa) { | |
n = Xf(e, g, h, a, l, m, H.pa, H.va); | |
if (isNaN(n)) return !0; | |
k += n; | |
break | |
} | |
for (var V = null, ea = 0; ea < aa; ea++) { | |
V = R[ea]; | |
if (0 === ea) { | |
n = Xf(e, g, h, a, l, m, V[0], V[1]); | |
if (isNaN(n)) return !0; | |
k += n | |
} | |
n = He(V[0], V[1], V[2], V[3], V[4], V[5], V[6], V[7], h, a, e, g, .5); | |
k += n | |
} | |
null !== V && (p = V[6], q = V[7]); | |
break; | |
default: | |
D.k("Unknown Segment type: " + H.type) | |
} | |
l = p; | |
m = q | |
} | |
if (0 !== k) return !0; | |
k = 0 | |
} else if (t.Pa(e, g, d ? b : b + 2)) return !0 | |
} | |
return 0 !== k | |
}; | |
function Xf(a, b, c, d, e, g, h, k) { | |
if (qe(e, g, h, k, .05, a, b)) return NaN; | |
var l = (a - c) * (g - k); | |
if (0 === l) return 0; | |
var m = ((a * d - b * c) * (e - h) - (a - c) * (e * k - g * h)) / l; | |
b = (a * d - b * c) * (g - k) / l; | |
if (m >= a) return 0; | |
if ((e > h ? e - h : h - e) < (g > k ? g - k : k - g)) { | |
if (e = a = 0, g < k ? (a = g, e = k) : (a = k, e = g), b < a || b > e) return 0 | |
} else if (e < h ? (a = e, e = h) : a = h, m < a || m > e) return 0; | |
return 0 < l ? 1 : -1 | |
} | |
function Yf(a, b, c, d) { | |
a = a.nc.o; | |
for (var e = a.length, g = 0; g < e; g++) | |
if (a[g].Pa(b, c, d)) return !0; | |
return !1 | |
} | |
Ve.prototype.getPointAlongPath = Ve.prototype.VI = function(a, b) { | |
0 > a ? a = 0 : 1 < a && (a = 1); | |
void 0 === b && (b = new N); | |
if (this.type === Ze) return b.n(this.la + a * (this.F - this.la), this.ja + a * (this.G - this.ja)), b; | |
for (var c = this.$x, d = this.uu, e = c.length, g = this.vu * a, h = 0, k = 0; k < e; k++) | |
for (var l = d[k], m = l.length, n = 0; n < m; n++) { | |
var p = l[n]; | |
if (h + p >= g) return d = (g - h) / p, c = c[k], k = c[2 * n], e = c[2 * n + 1], b.n(k + (c[2 * n + 2] - k) * d, e + (c[2 * n + 3] - e) * d), b; | |
h += p | |
} | |
b.n(NaN, NaN); | |
return b | |
}; | |
Ve.prototype.getAngleAlongPath = Ve.prototype.MF = function(a) { | |
0 > a ? a = 0 : 1 < a && (a = 1); | |
var b = 0; | |
if (this.type === Ze) return b = 180 * Math.atan2(this.G - this.ja, this.F - this.la) / Math.PI; | |
for (var b = this.$x, c = this.uu, d = b.length, e = this.vu * a, g = 0, h = 0; h < d; h++) { | |
var k = c[h], | |
l = k.length; | |
for (a = 0; a < l; a++) { | |
var m = k[a]; | |
if (g + m >= e) return b = b[h], b = 180 * Math.atan2(b[2 * a + 3] - b[2 * a + 1], b[2 * a + 2] - b[2 * a]) / Math.PI; | |
g += m | |
} | |
} | |
return NaN | |
}; | |
Ve.prototype.getFractionForPoint = Ve.prototype.RI = function(a) { | |
if (this.type === Ze) { | |
var b = this.la, | |
c = this.ja, | |
d = this.F, | |
e = this.G; | |
if (b !== d || c !== e) { | |
var g = a.x; | |
a = a.y; | |
var h = 0, | |
k = 0; | |
return b === d ? (c < e ? (h = c, k = e) : (h = e, k = c), a <= h ? h === c ? 0 : 1 : a >= k ? k === c ? 0 : 1 : Math.abs(a - c) / (k - h)) : c === e ? (b < d ? (h = b, k = d) : (h = d, k = b), g <= h ? h === b ? 0 : 1 : g >= k ? k === b ? 0 : 1 : Math.abs(g - b) / (k - h)) : ((g - b) * (g - b) + (a - c) * (a - c)) / ((d - b) * (d - b) + (e - c) * (e - c)) | |
} | |
} else if (this.type === tf) { | |
if (b = this.la, c = this.ja, d = this.F, e = this.G, b !== d || c !== e) { | |
var h = d - b, | |
k = e - c, | |
l = 2 * h + 2 * k, | |
g = a.x; | |
a = a.y; | |
g = Math.min(Math.max(g, b), d); | |
a = Math.min(Math.max(a, c), e); | |
var b = Math.abs(g - b), | |
d = Math.abs(g - d), | |
c = Math.abs(a - c), | |
e = Math.abs(a - e), | |
m = Math.min(b, d, c, e); | |
if (m === c) return g / l; | |
if (m === d) return (h + a) / l; | |
if (m === e) return (2 * h + k - g) / l; | |
if (m === b) return (2 * h + 2 * k - a) / l | |
} | |
} else { | |
for (var e = this.$x, h = this.uu, k = this.vu, l = D.P(), c = Infinity, b = d = 0, g = e.length, n = m = 0, p = 0; p < g; p++) | |
for (var q = e[p], r = h[p], s = q.length, u = 0; u < s; u += 2) { | |
var t = q[u], | |
y = q[u + 1]; | |
if (0 !== u) { | |
db(m, n, t, y, a.x, a.y, l); | |
var w = (l.x - a.x) * (l.x - a.x) + (l.y - a.y) * (l.y - a.y); | |
w < c && (c = w, | |
d = b, d += Math.sqrt((l.x - m) * (l.x - m) + (l.y - n) * (l.y - n))); | |
b += r[(u - 2) / 2] | |
} | |
m = t; | |
n = y | |
} | |
D.A(l); | |
a = d / k; | |
return 0 > a ? 0 : 1 < a ? 1 : a | |
} | |
return 0 | |
}; | |
D.w(Ve, { | |
$x: "flattenedSegments" | |
}, function() { | |
Zf(this); | |
return this.Go | |
}); | |
function Zf(a) { | |
if (null === a.Go) { | |
var b = a.Go = [], | |
c = a.kr = [], | |
d = [], | |
e = []; | |
if (a.type === Ze) d.push(a.la), d.push(a.ja), d.push(a.F), d.push(a.G), b.push(d), e.push(Math.sqrt((a.la - a.F) * (a.la - a.F) + (a.ja - a.G) * (a.ja - a.G))), c.push(e); | |
else if (a.type === tf) d.push(a.la), d.push(a.ja), d.push(a.F), d.push(a.ja), d.push(a.F), d.push(a.G), d.push(a.la), d.push(a.G), d.push(a.la), d.push(a.ja), b.push(d), e.push(Math.abs(a.la - a.F)), e.push(Math.abs(a.ja - a.G)), e.push(Math.abs(a.la - a.F)), e.push(Math.abs(a.ja - a.G)), c.push(e); | |
else if (a.type === | |
uf) { | |
var g = new Xe; | |
g.la = a.F; | |
g.ja = (a.ja + a.G) / 2; | |
var h = new $f(Hf); | |
h.Ne = 0; | |
h.Ff = 360; | |
h.pa = (a.la + a.F) / 2; | |
h.va = (a.ja + a.G) / 2; | |
h.radiusX = Math.abs(a.la - a.F) / 2; | |
h.radiusY = Math.abs(a.ja - a.G) / 2; | |
g.add(h); | |
a = Vf(h, g); | |
e = a.length; | |
if (0 === e) d.push(h.pa), d.push(h.va); | |
else | |
for (var h = g.la, g = g.ja, k = 0; k < e; k++) { | |
var l = a[k]; | |
Be(h, g, l[2], l[3], l[4], l[5], l[6], l[7], .5, d); | |
h = l[6]; | |
g = l[7] | |
} | |
b.push(d); | |
c.push(ag(d)) | |
} else | |
for (var m = a.nc.j; m.next();) { | |
var n = m.value, | |
d = []; | |
d.push(n.la); | |
d.push(n.ja); | |
for (var h = n.la, g = n.ja, p = h, q = g, r = n.Eb.o, s = r.length, u = | |
0; u < s; u++) { | |
var t = r[u]; | |
switch (t.ca) { | |
case Ef: | |
4 <= d.length && (b.push(d), c.push(ag(d))); | |
d = []; | |
d.push(t.F); | |
d.push(t.G); | |
h = t.F; | |
g = t.G; | |
p = h; | |
q = g; | |
break; | |
case wf: | |
d.push(t.F); | |
d.push(t.G); | |
h = t.F; | |
g = t.G; | |
break; | |
case Ff: | |
Be(h, g, t.Xd, t.ff, t.Ch, t.Og, t.Cb, t.Jb, .5, d); | |
h = t.F; | |
g = t.G; | |
break; | |
case Gf: | |
Fe(h, g, t.Xd, t.ff, t.Cb, t.Jb, .5, d); | |
h = t.F; | |
g = t.G; | |
break; | |
case Hf: | |
a = Vf(t, n); | |
e = a.length; | |
if (0 === e) { | |
d.push(t.pa); | |
d.push(t.va); | |
h = t.pa; | |
g = t.va; | |
break | |
} | |
for (k = 0; k < e; k++) l = a[k], Be(h, g, l[2], l[3], l[4], l[5], l[6], l[7], .5, d), h = l[6], g = l[7]; | |
break; | |
case If: | |
a = Wf(t, | |
n, h, g); | |
e = a.length; | |
if (0 === e) { | |
d.push(t.pa); | |
d.push(t.va); | |
h = t.pa; | |
g = t.va; | |
break | |
} | |
for (k = 0; k < e; k++) l = a[k], Be(h, g, l[2], l[3], l[4], l[5], l[6], l[7], .5, d), h = l[6], g = l[7]; | |
break; | |
default: | |
D.k("Segment not of valid type: " + t.ca) | |
} | |
t.hi && (d.push(p), d.push(q)) | |
} | |
4 <= d.length && (b.push(d), c.push(ag(d))) | |
} | |
} | |
} | |
D.w(Ve, { | |
uu: "flattenedLengths" | |
}, function() { | |
Zf(this); | |
return this.kr | |
}); | |
D.w(Ve, { | |
vu: "flattenedTotalLength" | |
}, function() { | |
var a = this.lr; | |
if (isNaN(a)) { | |
if (this.type === Ze) var a = Math.abs(this.F - this.la), | |
b = Math.abs(this.G - this.ja), | |
a = Math.sqrt(a * a + b * b); | |
else if (this.type === tf) a = Math.abs(this.F - this.la), b = Math.abs(this.G - this.ja), a = 2 * a + 2 * b; | |
else | |
for (var b = this.uu, c = b.length, d = a = 0; d < c; d++) | |
for (var e = b[d], g = e.length, h = 0; h < g; h++) a += e[h]; | |
this.lr = a | |
} | |
return a | |
}); | |
function ag(a) { | |
for (var b = [], c = 0, d = 0, e = a.length, g = 0; g < e; g += 2) { | |
var h = a[g], | |
k = a[g + 1]; | |
0 !== g && (c = Math.sqrt(mb(c, d, h, k)), b.push(c)); | |
c = h; | |
d = k | |
} | |
return b | |
} | |
D.defineProperty(Ve, { | |
type: "type" | |
}, function() { | |
return this.ca | |
}, function(a) { | |
this.ca !== a && (v && D.Da(a, Ve, Ve, "type"), this.J && D.qa(this, a), this.ca = a, this.pb = !0) | |
}); | |
D.defineProperty(Ve, { | |
la: "startX" | |
}, function() { | |
return this.Ac | |
}, function(a) { | |
this.Ac !== a && (v && D.p(a, Ve, "startX"), this.J && D.qa(this, a), this.Ac = a, this.pb = !0) | |
}); | |
D.defineProperty(Ve, { | |
ja: "startY" | |
}, function() { | |
return this.Mc | |
}, function(a) { | |
this.Mc !== a && (v && D.p(a, Ve, "startY"), this.J && D.qa(this, a), this.Mc = a, this.pb = !0) | |
}); | |
D.defineProperty(Ve, { | |
F: "endX" | |
}, function() { | |
return this.Cb | |
}, function(a) { | |
this.Cb !== a && (v && D.p(a, Ve, "endX"), this.J && D.qa(this, a), this.Cb = a, this.pb = !0) | |
}); | |
D.defineProperty(Ve, { | |
G: "endY" | |
}, function() { | |
return this.Jb | |
}, function(a) { | |
this.Jb !== a && (v && D.p(a, Ve, "endY"), this.J && D.qa(this, a), this.Jb = a, this.pb = !0) | |
}); | |
D.defineProperty(Ve, { | |
nc: "figures" | |
}, function() { | |
return this.kk | |
}, function(a) { | |
this.kk !== a && (v && D.l(a, K, Ve, "figures"), this.J && D.qa(this, a), this.kk = a, this.pb = !0) | |
}); | |
Ve.prototype.add = Ve.prototype.add = function(a) { | |
this.kk.add(a); | |
return this | |
}; | |
Ve.prototype.setSpots = function(a, b, c, d, e, g, h, k) { | |
this.J && D.qa(this); | |
this.xi = (new S(a, b, e, g)).freeze(); | |
this.yi = (new S(c, d, h, k)).freeze(); | |
return this | |
}; | |
D.defineProperty(Ve, { | |
C: "spot1" | |
}, function() { | |
return this.xi | |
}, function(a) { | |
v && D.l(a, S, Ve, "spot1"); | |
this.J && D.qa(this, a); | |
this.xi = a.V() | |
}); | |
D.defineProperty(Ve, { | |
D: "spot2" | |
}, function() { | |
return this.yi | |
}, function(a) { | |
v && D.l(a, S, Ve, "spot2"); | |
this.J && D.qa(this, a); | |
this.yi = a.V() | |
}); | |
D.defineProperty(Ve, { | |
me: "defaultStretch" | |
}, function() { | |
return this.Xi | |
}, function(a) { | |
v && D.Da(a, O, Ve, "stretch"); | |
this.J && D.qa(this, a); | |
this.Xi = a | |
}); | |
D.w(Ve, { | |
ib: "bounds" | |
}, function() { | |
this.rB() && this.Kh(); | |
return this.Qv | |
}); | |
function Xe(a, b, c, d) { | |
D.xc(this); | |
this.J = !1; | |
void 0 === c && (c = !0); | |
this.Zm = c; | |
void 0 === d && (d = !0); | |
this.mp = d; | |
void 0 !== a ? (v && D.p(a, Xe, "sx"), this.Ac = a) : this.Ac = 0; | |
void 0 !== b ? (v && D.p(b, Xe, "sy"), this.Mc = b) : this.Mc = 0; | |
this.Ip = new K($f); | |
this.ix = this.Ip.I; | |
this.pb = !0 | |
} | |
D.ka("PathFigure", Xe); | |
D.Di(Xe); | |
Xe.prototype.copy = function() { | |
var a = new Xe; | |
a.Zm = this.Zm; | |
a.mp = this.mp; | |
a.Ac = this.Ac; | |
a.Mc = this.Mc; | |
for (var b = this.Ip.o, c = b.length, d = a.Ip, e = 0; e < c; e++) { | |
var g = b[e].copy(); | |
d.add(g) | |
} | |
a.ix = this.ix; | |
a.pb = this.pb; | |
return a | |
}; | |
Xe.prototype.equalsApprox = Xe.prototype.Wc = function(a) { | |
if (!(a instanceof Xe && Q(this.la, a.la) && Q(this.ja, a.ja))) return !1; | |
var b = this.Eb.o; | |
a = a.Eb.o; | |
var c = b.length; | |
if (c !== a.length) return !1; | |
for (var d = 0; d < c; d++) | |
if (!b[d].Wc(a[d])) return !1; | |
return !0 | |
}; | |
Xe.prototype.toString = function(a) { | |
void 0 === a && (a = -1); | |
for (var b = 0 > a ? "M" + this.la.toString() + " " + this.ja.toString() : "M" + this.la.toFixed(a) + " " + this.ja.toFixed(a), c = this.Eb.o, d = c.length, e = 0; e < d; e++) b += " " + c[e].toString(a); | |
return b | |
}; | |
Xe.prototype.freeze = function() { | |
this.J = !0; | |
var a = this.Eb; | |
a.freeze(); | |
for (var b = a.o, a = a.length, c = 0; c < a; c++) b[c].freeze(); | |
return this | |
}; | |
Xe.prototype.Xa = function() { | |
this.J = !1; | |
var a = this.Eb; | |
a.Xa(); | |
for (var a = a.o, b = a.length, c = 0; c < b; c++) a[c].Xa(); | |
return this | |
}; | |
Xe.prototype.rB = function() { | |
if (this.pb) return !0; | |
var a = this.Eb; | |
if (this.ix !== a.I) return !0; | |
for (var a = a.o, b = a.length, c = 0; c < b; c++) | |
if (a[c].pb) return !0; | |
return !1 | |
}; | |
D.defineProperty(Xe, { | |
Ku: "isFilled" | |
}, function() { | |
return this.Zm | |
}, function(a) { | |
v && D.h(a, "boolean", Xe, "isFilled"); | |
this.J && D.qa(this, a); | |
this.Zm = a | |
}); | |
D.defineProperty(Xe, { | |
el: "isShadowed" | |
}, function() { | |
return this.mp | |
}, function(a) { | |
v && D.h(a, "boolean", Xe, "isShadowed"); | |
this.J && D.qa(this, a); | |
this.mp = a | |
}); | |
D.defineProperty(Xe, { | |
la: "startX" | |
}, function() { | |
return this.Ac | |
}, function(a) { | |
v && D.p(a, Xe, "startX"); | |
this.J && D.qa(this, a); | |
this.Ac = a; | |
this.pb = !0 | |
}); | |
D.defineProperty(Xe, { | |
ja: "startY" | |
}, function() { | |
return this.Mc | |
}, function(a) { | |
v && D.p(a, Xe, "startY"); | |
this.J && D.qa(this, a); | |
this.Mc = a; | |
this.pb = !0 | |
}); | |
D.defineProperty(Xe, { | |
Eb: "segments" | |
}, function() { | |
return this.Ip | |
}, function(a) { | |
v && D.l(a, K, Xe, "segments"); | |
this.J && D.qa(this, a); | |
this.Ip = a; | |
this.pb = !0 | |
}); | |
Xe.prototype.add = Xe.prototype.add = function(a) { | |
this.Ip.add(a); | |
return this | |
}; | |
Xe.prototype.Pa = function(a, b, c) { | |
for (var d = this.la, e = this.ja, g = d, h = e, k = this.Eb.o, l = k.length, m = 0; m < l; m++) { | |
var n = k[m]; | |
switch (n.type) { | |
case Ef: | |
g = n.F; | |
h = n.G; | |
d = n.F; | |
e = n.G; | |
break; | |
case wf: | |
if (qe(d, e, n.F, n.G, c, a, b)) return !0; | |
d = n.F; | |
e = n.G; | |
break; | |
case Ff: | |
if (re(d, e, n.Ec, n.$c, n.Uh, n.Vh, n.F, n.G, .5, a, b, c)) return !0; | |
d = n.F; | |
e = n.G; | |
break; | |
case Gf: | |
if (De(d, e, n.Ec, n.$c, n.F, n.G, .5, a, b, c)) return !0; | |
d = n.F; | |
e = n.G; | |
break; | |
case Hf: | |
case If: | |
var p = n.type === Hf ? Vf(n, this) : Wf(n, this, d, e), | |
q = p.length; | |
if (0 === q) { | |
if (qe(d, e, n.pa, n.va, c, a, b)) return !0; | |
d = n.pa; | |
e = n.va; | |
break | |
} | |
for (var r = null, s = 0; s < q; s++) | |
if (r = p[s], 0 === s && qe(d, e, r[0], r[1], c, a, b) || re(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], .5, a, b, c)) return !0; | |
null !== r && (d = r[6], e = r[7]); | |
break; | |
default: | |
D.k("Unknown Segment type: " + n.type) | |
} | |
if (n.gy && (d !== g || e !== h) && qe(d, e, g, h, c, a, b)) return !0 | |
} | |
return !1 | |
}; | |
function $f(a, b, c, d, e, g, h, k) { | |
D.xc(this); | |
this.J = !1; | |
void 0 === a ? a = wf : v && D.Da(a, $f, $f, "constructor:type"); | |
this.ca = a; | |
void 0 !== b ? (v && D.p(b, $f, "ex"), this.Cb = b) : this.Cb = 0; | |
void 0 !== c ? (v && D.p(c, $f, "ey"), this.Jb = c) : this.Jb = 0; | |
void 0 === d && (d = 0); | |
void 0 === e && (e = 0); | |
void 0 === g && (g = 0); | |
void 0 === h && (h = 0); | |
a === If ? (a = g % 360, 0 > a && (a += 360), this.Xd = a, this.ff = 0, v && D.p(d, $f, "x1"), this.Ch = Math.max(d, 0), v && D.p(e, $f, "y1"), this.Og = Math.max(e, 0), this.qp = "boolean" === typeof h ? !!h : !1, this.Ko = !!k) : (v && D.p(d, $f, "x1"), this.Xd = d, v && D.p(e, | |
$f, "y1"), this.ff = e, v && D.p(g, $f, "x2"), a === Hf && (g = Math.max(g, 0)), this.Ch = g, "number" === typeof h ? (a === Hf && (h = Math.max(h, 0)), this.Og = h) : this.Og = 0, this.Ko = this.qp = !1); | |
this.hi = !1; | |
this.pb = !0; | |
this.$h = null | |
} | |
D.ka("PathSegment", $f); | |
D.Di($f); | |
$f.prototype.copy = function() { | |
var a = new $f; | |
a.ca = this.ca; | |
a.Cb = this.Cb; | |
a.Jb = this.Jb; | |
a.Xd = this.Xd; | |
a.ff = this.ff; | |
a.Ch = this.Ch; | |
a.Og = this.Og; | |
a.qp = this.qp; | |
a.Ko = this.Ko; | |
a.hi = this.hi; | |
a.pb = this.pb; | |
return a | |
}; | |
$f.prototype.equalsApprox = $f.prototype.Wc = function(a) { | |
if (!(a instanceof $f) || this.type !== a.type || this.gy !== a.gy) return !1; | |
switch (this.type) { | |
case Ef: | |
case wf: | |
return Q(this.F, a.F) && Q(this.G, a.G); | |
case Ff: | |
return Q(this.F, a.F) && Q(this.G, a.G) && Q(this.Ec, a.Ec) && Q(this.$c, a.$c) && Q(this.Uh, a.Uh) && Q(this.Vh, a.Vh); | |
case Gf: | |
return Q(this.F, a.F) && Q(this.G, a.G) && Q(this.Ec, a.Ec) && Q(this.$c, a.$c); | |
case Hf: | |
return Q(this.Ne, a.Ne) && Q(this.Ff, a.Ff) && Q(this.pa, a.pa) && Q(this.va, a.va) && Q(this.radiusX, a.radiusX) && Q(this.radiusY, | |
a.radiusY); | |
case If: | |
return this.xm === a.xm && this.jy === a.jy && Q(this.ck, a.ck) && Q(this.F, a.F) && Q(this.G, a.G) && Q(this.radiusX, a.radiusX) && Q(this.radiusY, a.radiusY); | |
default: | |
return !1 | |
} | |
}; | |
$f.prototype.qc = function(a) { | |
a.Re === $f ? this.type = a : D.ak(this, a) | |
}; | |
$f.prototype.toString = function(a) { | |
void 0 === a && (a = -1); | |
var b = ""; | |
switch (this.type) { | |
case Ef: | |
b = 0 > a ? "M" + this.F.toString() + " " + this.G.toString() : "M" + this.F.toFixed(a) + " " + this.G.toFixed(a); | |
break; | |
case wf: | |
b = 0 > a ? "L" + this.F.toString() + " " + this.G.toString() : "L" + this.F.toFixed(a) + " " + this.G.toFixed(a); | |
break; | |
case Ff: | |
b = 0 > a ? "C" + this.Ec.toString() + " " + this.$c.toString() + " " + this.Uh.toString() + " " + this.Vh.toString() + " " + this.F.toString() + " " + this.G.toString() : "C" + this.Ec.toFixed(a) + " " + this.$c.toFixed(a) + " " + this.Uh.toFixed(a) + | |
" " + this.Vh.toFixed(a) + " " + this.F.toFixed(a) + " " + this.G.toFixed(a); | |
break; | |
case Gf: | |
b = 0 > a ? "Q" + this.Ec.toString() + " " + this.$c.toString() + " " + this.F.toString() + " " + this.G.toString() : "Q" + this.Ec.toFixed(a) + " " + this.$c.toFixed(a) + " " + this.F.toFixed(a) + " " + this.G.toFixed(a); | |
break; | |
case Hf: | |
b = 0 > a ? "B" + this.Ne.toString() + " " + this.Ff.toString() + " " + this.pa.toString() + " " + this.va.toString() + " " + this.radiusX : "B" + this.Ne.toFixed(a) + " " + this.Ff.toFixed(a) + " " + this.pa.toFixed(a) + " " + this.va.toFixed(a) + " " + this.radiusX; | |
break; | |
case If: | |
b = 0 > a ? "A" + this.radiusX.toString() + " " + this.radiusY.toString() + " " + this.ck.toString() + " " + (this.jy ? 1 : 0) + " " + (this.xm ? 1 : 0) + " " + this.F.toString() + " " + this.G.toString() : "A" + this.radiusX.toFixed(a) + " " + this.radiusY.toFixed(a) + " " + this.ck.toFixed(a) + " " + (this.jy ? 1 : 0) + " " + (this.xm ? 1 : 0) + " " + this.F.toFixed(a) + " " + this.G.toFixed(a); | |
break; | |
default: | |
b = this.type.toString() | |
} | |
return b + (this.hi ? "z" : "") | |
}; | |
var Ef; | |
$f.Move = Ef = D.s($f, "Move", 0); | |
var wf; | |
$f.Line = wf = D.s($f, "Line", 1); | |
var Ff; | |
$f.Bezier = Ff = D.s($f, "Bezier", 2); | |
var Gf; | |
$f.QuadraticBezier = Gf = D.s($f, "QuadraticBezier", 3); | |
var Hf; | |
$f.Arc = Hf = D.s($f, "Arc", 4); | |
var If; | |
$f.SvgArc = If = D.s($f, "SvgArc", 4); | |
$f.prototype.freeze = function() { | |
this.J = !0; | |
return this | |
}; | |
$f.prototype.Xa = function() { | |
this.J = !1; | |
return this | |
}; | |
$f.prototype.close = $f.prototype.close = function() { | |
this.hi = !0; | |
return this | |
}; | |
function Vf(a, b) { | |
if (null !== a.$h && !1 === b.pb) return a.$h; | |
var c = a.radiusX, | |
d = a.radiusY; | |
void 0 === d && (d = c); | |
if (0 === c || 0 === d) return a.$h = [], a.$h; | |
var e = a.Xd, | |
g = a.ff, | |
h = Se(c < d ? c : d, a.Ne, a.Ne + a.Ff, !1); | |
if (c !== d) { | |
var k = D.hh(); | |
k.reset(); | |
c < d ? k.scale(1, d / c) : k.scale(c / d, 1); | |
Cf(h, k); | |
D.nf(k) | |
} | |
c = h.length; | |
for (d = 0; d < c; d++) k = h[d], k[0] += e, k[1] += g, k[2] += e, k[3] += g, k[4] += e, k[5] += g, k[6] += e, k[7] += g; | |
a.$h = h; | |
return a.$h | |
} | |
function Wf(a, b, c, d) { | |
function e(a, b, c, d) { | |
return (a * d < b * c ? -1 : 1) * Math.acos((a * c + b * d) / (Math.sqrt(a * a + b * b) * Math.sqrt(c * c + d * d))) | |
} | |
if (null !== a.$h && !1 === b.pb) return a.$h; | |
b = a.Ch; | |
var g = a.Og; | |
0 === b && (b = 1E-4); | |
0 === g && (g = 1E-4); | |
var h = Math.PI / 180 * a.Xd, | |
k = a.qp, | |
l = a.Ko, | |
m = a.Cb, | |
n = a.Jb, | |
p = Math.cos(h), | |
q = Math.sin(h), | |
r = p * (c - m) / 2 + q * (d - n) / 2, | |
h = -q * (c - m) / 2 + p * (d - n) / 2, | |
s = r * r / (b * b) + h * h / (g * g); | |
1 < s && (b *= Math.sqrt(s), g *= Math.sqrt(s)); | |
s = (k === l ? -1 : 1) * Math.sqrt((b * b * g * g - b * b * h * h - g * g * r * r) / (b * b * h * h + g * g * r * r)); | |
isNaN(s) && (s = 0); | |
k = s * b * h / g; | |
s = s * -g * r / | |
b; | |
isNaN(k) && (k = 0); | |
isNaN(s) && (s = 0); | |
c = (c + m) / 2 + p * k - q * s; | |
d = (d + n) / 2 + q * k + p * s; | |
n = e(1, 0, (r - k) / b, (h - s) / g); | |
p = (r - k) / b; | |
m = (h - s) / g; | |
r = (-r - k) / b; | |
k = (-h - s) / g; | |
h = e(p, m, r, k); | |
r = (p * r + m * k) / (Math.sqrt(p * p + m * m) * Math.sqrt(r * r + k * k)); - 1 >= r ? h = Math.PI : 1 <= r && (h = 0); | |
!l && 0 < h && (h -= 2 * Math.PI); | |
l && 0 > h && (h += 2 * Math.PI); | |
l = b > g ? 1 : b / g; | |
r = b > g ? g / b : 1; | |
b = Se(b > g ? b : g, n, n + h, !0); | |
g = D.hh(); | |
g.reset(); | |
g.translate(c, d); | |
g.rotate(a.Xd, 0, 0); | |
g.scale(l, r); | |
Cf(b, g); | |
D.nf(g); | |
a.$h = b; | |
return a.$h | |
} | |
D.defineProperty($f, { | |
gy: "isClosed" | |
}, function() { | |
return this.hi | |
}, function(a) { | |
this.hi !== a && (this.hi = a, this.pb = !0) | |
}); | |
D.defineProperty($f, { | |
type: "type" | |
}, function() { | |
return this.ca | |
}, function(a) { | |
v && D.Da(a, $f, $f, "type"); | |
this.J && D.qa(this, a); | |
this.ca = a; | |
this.pb = !0 | |
}); | |
D.defineProperty($f, { | |
F: "endX" | |
}, function() { | |
return this.Cb | |
}, function(a) { | |
v && D.p(a, $f, "endX"); | |
this.J && D.qa(this, a); | |
this.Cb = a; | |
this.pb = !0 | |
}); | |
D.defineProperty($f, { | |
G: "endY" | |
}, function() { | |
return this.Jb | |
}, function(a) { | |
v && D.p(a, $f, "endY"); | |
this.J && D.qa(this, a); | |
this.Jb = a; | |
this.pb = !0 | |
}); | |
D.defineProperty($f, { | |
Ec: "point1X" | |
}, function() { | |
return this.Xd | |
}, function(a) { | |
v && D.p(a, $f, "point1X"); | |
this.J && D.qa(this, a); | |
this.Xd = a; | |
this.pb = !0 | |
}); | |
D.defineProperty($f, { | |
$c: "point1Y" | |
}, function() { | |
return this.ff | |
}, function(a) { | |
v && D.p(a, $f, "point1Y"); | |
this.J && D.qa(this, a); | |
this.ff = a; | |
this.pb = !0 | |
}); | |
D.defineProperty($f, { | |
Uh: "point2X" | |
}, function() { | |
return this.Ch | |
}, function(a) { | |
v && D.p(a, $f, "point2X"); | |
this.J && D.qa(this, a); | |
this.Ch = a; | |
this.pb = !0 | |
}); | |
D.defineProperty($f, { | |
Vh: "point2Y" | |
}, function() { | |
return this.Og | |
}, function(a) { | |
v && D.p(a, $f, "point2Y"); | |
this.J && D.qa(this, a); | |
this.Og = a; | |
this.pb = !0 | |
}); | |
D.defineProperty($f, { | |
pa: "centerX" | |
}, function() { | |
return this.Xd | |
}, function(a) { | |
v && D.p(a, $f, "centerX"); | |
this.J && D.qa(this, a); | |
this.Xd = a; | |
this.pb = !0 | |
}); | |
D.defineProperty($f, { | |
va: "centerY" | |
}, function() { | |
return this.ff | |
}, function(a) { | |
v && D.p(a, $f, "centerY"); | |
this.J && D.qa(this, a); | |
this.ff = a; | |
this.pb = !0 | |
}); | |
D.defineProperty($f, { | |
radiusX: "radiusX" | |
}, function() { | |
return this.Ch | |
}, function(a) { | |
v && D.p(a, $f, "radiusX"); | |
0 > a && D.ua(a, ">= zero", $f, "radiusX"); | |
this.J && D.qa(this, a); | |
this.Ch = a; | |
this.pb = !0 | |
}); | |
D.defineProperty($f, { | |
radiusY: "radiusY" | |
}, function() { | |
return this.Og | |
}, function(a) { | |
v && D.p(a, $f, "radiusY"); | |
0 > a && D.ua(a, ">= zero", $f, "radiusY"); | |
this.J && D.qa(this, a); | |
this.Og = a; | |
this.pb = !0 | |
}); | |
D.defineProperty($f, { | |
Ne: "startAngle" | |
}, function() { | |
return this.Cb | |
}, function(a) { | |
this.Cb !== a && (this.J && D.qa(this, a), v && D.p(a, $f, "startAngle"), a %= 360, 0 > a && (a += 360), this.Cb = a, this.pb = !0) | |
}); | |
D.defineProperty($f, { | |
Ff: "sweepAngle" | |
}, function() { | |
return this.Jb | |
}, function(a) { | |
v && D.p(a, $f, "sweepAngle"); | |
this.J && D.qa(this, a); | |
360 < a && (a = 360); - 360 > a && (a = -360); | |
this.Jb = a; | |
this.pb = !0 | |
}); | |
D.defineProperty($f, { | |
xm: "isClockwiseArc" | |
}, function() { | |
return this.Ko | |
}, function(a) { | |
this.J && D.qa(this, a); | |
this.Ko = a; | |
this.pb = !0 | |
}); | |
D.defineProperty($f, { | |
jy: "isLargeArc" | |
}, function() { | |
return this.qp | |
}, function(a) { | |
this.J && D.qa(this, a); | |
this.qp = a; | |
this.pb = !0 | |
}); | |
D.defineProperty($f, { | |
ck: "xAxisRotation" | |
}, function() { | |
return this.Xd | |
}, function(a) { | |
v && D.p(a, $f, "xAxisRotation"); | |
a %= 360; | |
0 > a && (a += 360); | |
this.J && D.qa(this, a); | |
this.Xd = a; | |
this.pb = !0 | |
}); | |
function bg() { | |
this.ea = null; | |
this.yA = (new N(0, 0)).freeze(); | |
this.Fz = (new N(0, 0)).freeze(); | |
this.Nv = this.Jw = 0; | |
this.Ov = 1; | |
this.ww = ""; | |
this.tx = this.aw = !1; | |
this.Zv = this.Pv = 0; | |
this.fk = this.iw = this.sw = !1; | |
this.$r = null; | |
this.qx = 0; | |
this.Sg = this.px = null | |
} | |
D.ka("InputEvent", bg); | |
bg.prototype.copy = function() { | |
var a = new bg; | |
a.ea = this.ea; | |
a.yA.assign(this.Sd); | |
a.Fz.assign(this.ha); | |
a.Jw = this.Jw; | |
a.Nv = this.Nv; | |
a.Ov = this.Ov; | |
a.ww = this.ww; | |
a.aw = this.aw; | |
a.tx = this.tx; | |
a.Pv = this.Pv; | |
a.Zv = this.Zv; | |
a.sw = this.sw; | |
a.iw = this.iw; | |
a.fk = this.fk; | |
a.$r = this.$r; | |
a.qx = this.qx; | |
a.px = this.px; | |
a.Sg = this.Sg; | |
return a | |
}; | |
bg.prototype.toString = function() { | |
var a = "^"; | |
0 !== this.xd && (a += "M:" + this.xd); | |
0 !== this.button && (a += "B:" + this.button); | |
"" !== this.key && (a += "K:" + this.key); | |
0 !== this.Ee && (a += "C:" + this.Ee); | |
0 !== this.Vk && (a += "D:" + this.Vk); | |
this.Cc && (a += "h"); | |
this.bubbles && (a += "b"); | |
null !== this.ha && (a += "@" + this.ha.toString()); | |
return a | |
}; | |
D.defineProperty(bg, { | |
g: "diagram" | |
}, function() { | |
return this.ea | |
}, function(a) { | |
this.ea = a | |
}); | |
D.defineProperty(bg, { | |
Sd: "viewPoint" | |
}, function() { | |
return this.yA | |
}, function(a) { | |
D.l(a, N, bg, "viewPoint"); | |
this.yA.assign(a) | |
}); | |
D.defineProperty(bg, { | |
ha: "documentPoint" | |
}, function() { | |
return this.Fz | |
}, function(a) { | |
D.l(a, N, bg, "documentPoint"); | |
this.Fz.assign(a) | |
}); | |
bg.prototype.getMultiTouchViewPoint = bg.prototype.ay = function(a, b) { | |
var c = this.g; | |
if (null === c) return b; | |
cg(c, this.event, a, b); | |
return b | |
}; | |
bg.prototype.getMultiTouchDocumentPoint = function(a, b) { | |
var c = this.g; | |
if (null === c) return b; | |
cg(c, this.event, a, b); | |
b.assign(c.oC(b)); | |
return b | |
}; | |
D.defineProperty(bg, { | |
xd: "modifiers" | |
}, function() { | |
return this.Jw | |
}, function(a) { | |
this.Jw = a | |
}); | |
D.defineProperty(bg, { | |
button: "button" | |
}, function() { | |
return this.Nv | |
}, function(a) { | |
this.Nv = a; | |
if (null === this.event) switch (a) { | |
case 0: | |
this.buttons = 1; | |
break; | |
case 1: | |
this.buttons = 4; | |
break; | |
case 2: | |
this.buttons = 2 | |
} | |
}); | |
D.defineProperty(bg, { | |
buttons: "buttons" | |
}, function() { | |
return this.Ov | |
}, function(a) { | |
this.Ov = a | |
}); | |
D.defineProperty(bg, { | |
key: "key" | |
}, function() { | |
return this.ww | |
}, function(a) { | |
this.ww = a | |
}); | |
D.defineProperty(bg, { | |
Wk: "down" | |
}, function() { | |
return this.aw | |
}, function(a) { | |
this.aw = a | |
}); | |
D.defineProperty(bg, { | |
up: "up" | |
}, function() { | |
return this.tx | |
}, function(a) { | |
this.tx = a | |
}); | |
D.defineProperty(bg, { | |
Ee: "clickCount" | |
}, function() { | |
return this.Pv | |
}, function(a) { | |
this.Pv = a | |
}); | |
D.defineProperty(bg, { | |
Vk: "delta" | |
}, function() { | |
return this.Zv | |
}, function(a) { | |
this.Zv = a | |
}); | |
D.defineProperty(bg, { | |
Ou: "isMultiTouch" | |
}, function() { | |
return this.sw | |
}, function(a) { | |
this.sw = a | |
}); | |
D.defineProperty(bg, { | |
Cc: "handled" | |
}, function() { | |
return this.iw | |
}, function(a) { | |
this.iw = a | |
}); | |
D.defineProperty(bg, { | |
bubbles: "bubbles" | |
}, function() { | |
return this.fk | |
}, function(a) { | |
this.fk = a | |
}); | |
D.defineProperty(bg, { | |
event: "event" | |
}, function() { | |
return this.$r | |
}, function(a) { | |
this.$r = a | |
}); | |
D.w(bg, { | |
Qj: "isTouchEvent" | |
}, function() { | |
var a = window.TouchEvent, | |
b = this.event; | |
return a && b instanceof a ? !0 : (a = window.PointerEvent) && b instanceof a && ("touch" === b.pointerType || "pen" === b.pointerType) | |
}); | |
D.w(bg, { | |
Qh: "isMac" | |
}, function() { | |
return D.Qh | |
}); | |
D.defineProperty(bg, { | |
timestamp: "timestamp" | |
}, function() { | |
return this.qx | |
}, function(a) { | |
this.qx = a | |
}); | |
D.defineProperty(bg, { | |
Qf: "targetDiagram" | |
}, function() { | |
return this.px | |
}, function(a) { | |
this.px = a | |
}); | |
D.defineProperty(bg, { | |
Oe: "targetObject" | |
}, function() { | |
return this.Sg | |
}, function(a) { | |
this.Sg = a | |
}); | |
D.defineProperty(bg, { | |
control: "control" | |
}, function() { | |
return 0 !== (this.xd & 1) | |
}, function(a) { | |
this.xd = a ? this.xd | 1 : this.xd & -2 | |
}); | |
D.defineProperty(bg, { | |
shift: "shift" | |
}, function() { | |
return 0 !== (this.xd & 4) | |
}, function(a) { | |
this.xd = a ? this.xd | 4 : this.xd & -5 | |
}); | |
D.defineProperty(bg, { | |
alt: "alt" | |
}, function() { | |
return 0 !== (this.xd & 2) | |
}, function(a) { | |
this.xd = a ? this.xd | 2 : this.xd & -3 | |
}); | |
D.defineProperty(bg, { | |
Xu: "meta" | |
}, function() { | |
return 0 !== (this.xd & 8) | |
}, function(a) { | |
this.xd = a ? this.xd | 8 : this.xd & -9 | |
}); | |
D.defineProperty(bg, { | |
left: "left" | |
}, function() { | |
var a = this.event; | |
return null === a || "mousedown" !== a.type && "mouseup" !== a.type && "pointerdown" !== a.type && "pointerup" !== a.type ? 0 !== (this.buttons & 1) : 0 === this.button | |
}, function(a) { | |
this.buttons = a ? this.buttons | 1 : this.buttons & -2 | |
}); | |
D.defineProperty(bg, { | |
right: "right" | |
}, function() { | |
var a = this.event; | |
return null === a || "mousedown" !== a.type && "mouseup" !== a.type && "pointerdown" !== a.type && "pointerup" !== a.type ? 0 !== (this.buttons & 2) : 2 === this.button | |
}, function(a) { | |
this.buttons = a ? this.buttons | 2 : this.buttons & -3 | |
}); | |
D.defineProperty(bg, { | |
hM: "middle" | |
}, function() { | |
var a = this.event; | |
return null === a || "mousedown" !== a.type && "mouseup" !== a.type && "pointerdown" !== a.type && "pointerup" !== a.type ? 0 !== (this.buttons & 4) : 1 === this.button | |
}, function(a) { | |
this.buttons = a ? this.buttons | 4 : this.buttons & -5 | |
}); | |
function dg() { | |
this.ea = null; | |
this.ac = ""; | |
this.Tw = this.nx = null; | |
this.sr = !1 | |
} | |
D.ka("DiagramEvent", dg); | |
dg.prototype.copy = function() { | |
var a = new dg; | |
a.ea = this.ea; | |
a.ac = this.ac; | |
a.nx = this.nx; | |
a.Tw = this.Tw; | |
a.sr = this.sr; | |
return a | |
}; | |
dg.prototype.toString = function() { | |
var a = "*" + this.name; | |
null !== this.gC && (a += ":" + this.gC.toString()); | |
null !== this.KB && (a += "(" + this.KB.toString() + ")"); | |
return a | |
}; | |
D.defineProperty(dg, { | |
g: "diagram" | |
}, function() { | |
return this.ea | |
}, function(a) { | |
this.ea = a | |
}); | |
D.defineProperty(dg, { | |
name: "name" | |
}, function() { | |
return this.ac | |
}, function(a) { | |
this.ac = a | |
}); | |
D.defineProperty(dg, { | |
gC: "subject" | |
}, function() { | |
return this.nx | |
}, function(a) { | |
this.nx = a | |
}); | |
D.defineProperty(dg, { | |
KB: "parameter" | |
}, function() { | |
return this.Tw | |
}, function(a) { | |
this.Tw = a | |
}); | |
D.defineProperty(dg, { | |
cancel: "cancel" | |
}, function() { | |
return this.sr | |
}, function(a) { | |
this.sr !== a && D.Qn("DiagramEvent.cancel", "2.0"); | |
this.sr = a | |
}); | |
function eg() { | |
this.tr = fg; | |
this.pn = this.Iw = ""; | |
this.Xs = this.Ys = this.ct = this.dt = this.at = this.ea = this.ye = null | |
} | |
D.ka("ChangedEvent", eg); | |
var gg; | |
eg.Transaction = gg = D.s(eg, "Transaction", -1); | |
var fg; | |
eg.Property = fg = D.s(eg, "Property", 0); | |
var hg; | |
eg.Insert = hg = D.s(eg, "Insert", 1); | |
var ig; | |
eg.Remove = ig = D.s(eg, "Remove", 2); | |
eg.prototype.clear = eg.prototype.clear = function() { | |
this.Xs = this.Ys = this.ct = this.dt = this.at = this.ea = this.ye = null | |
}; | |
eg.prototype.copy = function() { | |
var a = new eg; | |
a.tr = this.tr; | |
a.Iw = this.Iw; | |
a.pn = this.pn; | |
a.ye = this.ye; | |
a.ea = this.ea; | |
a.at = this.at; | |
var b = this.dt; | |
a.dt = D.Qa(b) && "function" === typeof b.V ? b.V() : b; | |
b = this.ct; | |
a.ct = D.Qa(b) && "function" === typeof b.V ? b.V() : b; | |
b = this.Ys; | |
a.Ys = D.Qa(b) && "function" === typeof b.V ? b.V() : b; | |
b = this.Xs; | |
a.Xs = D.Qa(b) && "function" === typeof b.V ? b.V() : b; | |
return a | |
}; | |
eg.prototype.qc = function(a) { | |
a.Re === eg ? this.Oc = a : D.ak(this, a) | |
}; | |
eg.prototype.toString = function() { | |
var a = "", | |
a = this.Oc === gg ? a + "* " : this.Oc === fg ? a + (null !== this.da ? "!m" : "!d") : a + ((null !== this.da ? "!m" : "!d") + this.Oc); | |
this.propertyName && "string" === typeof this.propertyName && (a += " " + this.propertyName); | |
this.Ef && this.Ef !== this.propertyName && (a += " " + this.Ef); | |
a += ": "; | |
this.Oc === gg ? null !== this.oldValue && (a += " " + this.oldValue) : (null !== this.object && (a += ia(this.object)), null !== this.oldValue && (a += " old: " + ia(this.oldValue)), null !== this.Wj && (a += " " + this.Wj), null !== this.newValue && | |
(a += " new: " + ia(this.newValue)), null !== this.Uj && (a += " " + this.Uj)); | |
return a | |
}; | |
eg.prototype.getValue = eg.prototype.oa = function(a) { | |
return a ? this.oldValue : this.newValue | |
}; | |
eg.prototype.getParam = function(a) { | |
return a ? this.Wj : this.Uj | |
}; | |
eg.prototype.canUndo = eg.prototype.canUndo = function() { | |
return null !== this.da || null !== this.g ? !0 : !1 | |
}; | |
eg.prototype.undo = eg.prototype.undo = function() { | |
this.canUndo() && (null !== this.da ? this.da.Hn(this, !0) : null !== this.g && this.g.Hn(this, !0)) | |
}; | |
eg.prototype.canRedo = eg.prototype.canRedo = function() { | |
return null !== this.da || null !== this.g ? !0 : !1 | |
}; | |
eg.prototype.redo = eg.prototype.redo = function() { | |
this.canRedo() && (null !== this.da ? this.da.Hn(this, !1) : null !== this.g && this.g.Hn(this, !1)) | |
}; | |
D.defineProperty(eg, { | |
da: "model" | |
}, function() { | |
return this.ye | |
}, function(a) { | |
this.ye = a | |
}); | |
D.defineProperty(eg, { | |
g: "diagram" | |
}, function() { | |
return this.ea | |
}, function(a) { | |
this.ea = a | |
}); | |
D.defineProperty(eg, { | |
Oc: "change" | |
}, function() { | |
return this.tr | |
}, function(a) { | |
v && D.Da(a, eg, eg, "change"); | |
this.tr = a | |
}); | |
D.defineProperty(eg, { | |
Ef: "modelChange" | |
}, function() { | |
return this.Iw | |
}, function(a) { | |
v && D.h(a, "string", eg, "modelChange"); | |
this.Iw = a | |
}); | |
D.defineProperty(eg, { | |
propertyName: "propertyName" | |
}, function() { | |
return this.pn | |
}, function(a) { | |
v && "string" !== typeof a && D.h(a, "function", eg, "propertyName"); | |
this.pn = a | |
}); | |
D.w(eg, { | |
lG: "isTransactionFinished" | |
}, function() { | |
return this.tr === gg && ("CommittedTransaction" === this.pn || "FinishedUndo" === this.pn || "FinishedRedo" === this.pn) | |
}); | |
D.defineProperty(eg, { | |
object: "object" | |
}, function() { | |
return this.at | |
}, function(a) { | |
this.at = a | |
}); | |
D.defineProperty(eg, { | |
oldValue: "oldValue" | |
}, function() { | |
return this.dt | |
}, function(a) { | |
this.dt = a | |
}); | |
D.defineProperty(eg, { | |
Wj: "oldParam" | |
}, function() { | |
return this.ct | |
}, function(a) { | |
this.ct = a | |
}); | |
D.defineProperty(eg, { | |
newValue: "newValue" | |
}, function() { | |
return this.Ys | |
}, function(a) { | |
this.Ys = a | |
}); | |
D.defineProperty(eg, { | |
Uj: "newParam" | |
}, function() { | |
return this.Xs | |
}, function(a) { | |
this.Xs = a | |
}); | |
function M(a) { | |
1 < arguments.length && D.k("Model constructor can only take one optional argument, the Array of node data."); | |
D.xc(this); | |
this.Ir = this.ac = ""; | |
this.dj = !1; | |
this.cA = {}; | |
this.ze = []; | |
this.Kc = new na(null, Object); | |
this.Dk = "key"; | |
this.Po = this.vp = null; | |
this.zr = this.Ar = !1; | |
this.jr = null; | |
this.kn = "category"; | |
this.zg = new na(null, L); | |
this.zk = null; | |
this.vj = !1; | |
this.xA = null; | |
this.na = new tg; | |
void 0 !== a && (this.qg = a) | |
} | |
D.ka("Model", M); | |
M.prototype.cloneProtected = function(a) { | |
a.ac = this.ac; | |
a.Ir = this.Ir; | |
a.dj = this.dj; | |
a.Dk = this.Dk; | |
a.vp = this.vp; | |
a.Po = this.Po; | |
a.Ar = this.Ar; | |
a.zr = this.zr; | |
a.jr = this.jr; | |
a.kn = this.kn | |
}; | |
M.prototype.copy = function() { | |
var a = new this.constructor; | |
this.cloneProtected(a); | |
return a | |
}; | |
M.prototype.clear = M.prototype.clear = function() { | |
this.ze = []; | |
this.Kc.clear(); | |
this.zg.clear(); | |
this.na.clear() | |
}; | |
f = M.prototype; | |
f.toString = function(a) { | |
void 0 === a && (a = 0); | |
if (1 < a) return this.jC(); | |
var b = ("" !== this.name ? this.name : "") + " Model"; | |
if (0 < a) { | |
b += "\n node data:"; | |
a = this.qg; | |
for (var c = D.cb(a), d = 0; d < c; d++) var e = D.La(a, d), | |
b = b + (" " + this.zb(e) + ":" + ia(e)) | |
} | |
return b | |
}; | |
f.Bo = function() { | |
var a = ""; | |
"" !== this.name && (a += ',\n "name": ' + this.quote(this.name)); | |
"" !== this.om && (a += ',\n "dataFormat": ' + this.quote(this.om)); | |
this.qb && (a += ',\n "isReadOnly": ' + this.qb); | |
"key" !== this.Vj && "string" === typeof this.Vj && (a += ',\n "nodeKeyProperty": ' + this.quote(this.Vj)); | |
this.NA && (a += ',\n "copiesArrays": true'); | |
this.MA && (a += ',\n "copiesArrayObjects": true'); | |
"category" !== this.qo && "string" === typeof this.qo && (a += ',\n "nodeCategoryProperty": ' + this.quote(this.qo)); | |
return a | |
}; | |
f.fv = function(a) { | |
a.name && (this.name = a.name); | |
a.dataFormat && (this.om = a.dataFormat); | |
a.isReadOnly && (this.qb = a.isReadOnly); | |
a.nodeKeyProperty && (this.Vj = a.nodeKeyProperty); | |
a.copiesArrays && (this.NA = a.copiesArrays); | |
a.copiesArrayObjects && (this.MA = a.copiesArrayObjects); | |
a.nodeCategoryProperty && (this.qo = a.nodeCategoryProperty) | |
}; | |
function ug(a) { | |
return ',\n "modelData": ' + vg(a, a.gl) | |
} | |
function wg(a, b) { | |
var c = b.modelData; | |
D.Qa(c) && (a.iv(c), a.gl = c) | |
} | |
f.vC = function() { | |
var a = this.gl, | |
b = !1, | |
c; | |
for (c in a) | |
if (!xg(c, a[c])) { | |
b = !0; | |
break | |
} | |
a = ""; | |
b && (a = ug(this)); | |
return a + ',\n "nodeDataArray": ' + yg(this, this.qg, !0) | |
}; | |
f.NB = function(a) { | |
wg(this, a); | |
a = a.nodeDataArray; | |
D.isArray(a) && (this.iv(a), this.qg = a) | |
}; | |
function zg(a, b, c, d) { | |
if (b === c) return !0; | |
if (typeof b !== typeof c || "function" === typeof b || "function" === typeof c) return !1; | |
if (Array.isArray(b) && Array.isArray(c)) { | |
if (d.oa(b) === c) return !0; | |
d.add(b, c); | |
if (b.length !== c.length) return !1; | |
for (var e = 0; e < b.length; e++) | |
if (!zg(a, b[e], c[e], d)) return !1; | |
return !0 | |
} | |
if (D.Qa(b) && D.Qa(c)) { | |
if (d.oa(b) === c) return !0; | |
d.add(b, c); | |
for (e in b) { | |
var g = b[e]; | |
if (!xg(e, g)) { | |
var h = c[e]; | |
if (void 0 === h || !zg(a, g, h, d)) return !1 | |
} | |
} | |
for (var k in c) | |
if (h = c[k], !xg(k, h) && (g = b[k], void 0 === g || !zg(a, g, h, d))) return !1; | |
return !0 | |
} | |
return !1 | |
} | |
function Ag(a, b, c) { | |
a[c] !== b[c] && D.k("Model.computeJsonDifference: Model." + c + ' is not the same in both models: "' + a[c] + '" and "' + b[c] + '"') | |
} | |
f.wC = function(a) { | |
Ag(this, a, "nodeKeyProperty"); | |
this instanceof Bg && Ag(this, a, "nodeParentKeyProperty"); | |
for (var b = new L, c = new L, d = (new L).Vc(this.Kc.nG), e = new na, g = a.qg, h = 0; h < g.length; h++) { | |
var k = g[h], | |
l = a.zb(k); | |
if (void 0 !== l) { | |
d.remove(l); | |
var m = this.Ie(l); | |
null === m ? (b.add(l), c.add(k)) : zg(this, m, k, e) || c.add(k) | |
} else this.yB(k), l = this.zb(k), b.add(l), c.add(k) | |
} | |
g = ""; | |
zg(this, this.gl, a.gl, e) || (g += ug(this)); | |
0 < b.count && (g += this.hz + yg(this, b.Fc(), !0)); | |
0 < c.count && (g += this.EC + yg(this, c.Fc(), !0)); | |
0 < d.count && (g += this.jz + | |
yg(this, d.Fc(), !0)); | |
return g | |
}; | |
M.prototype.computeJsonDifference = M.prototype.computeJSONDifference = function(a, b) { | |
D.l(a, M, M, "computeJsonDifference:newmodel"); | |
void 0 === b && (b = this.constructor === M ? "go.Model" : this.constructor === Y ? "go.GraphLinksModel" : this.constructor === Bg ? "go.TreeModel" : D.yf(this)); | |
return '{ "class": ' + this.quote(b) + ', "incremental": 1' + this.Bo() + this.wC(a) + "}" | |
}; | |
f = M.prototype; | |
f.hz = ',\n "insertedNodeKeys": '; | |
f.EC = ',\n "modifiedNodeData": '; | |
f.jz = ',\n "removedNodeKeys": '; | |
f.uC = function(a, b) { | |
var c = this, | |
d = !1, | |
e = new L, | |
g = new L, | |
h = new L; | |
a.fg.each(function(a) { | |
a.da === c && ("nodeDataArray" === a.Ef ? a.Oc === hg ? e.add(a.newValue) : a.Oc === ig && h.add(a.oldValue) : c.le(a.object) ? g.add(a.object) : c.gl === a.object && a.Oc === fg && (d = !0)) | |
}); | |
var k = new L; | |
e.each(function(a) { | |
k.add(c.zb(a)); | |
b || g.add(a) | |
}); | |
var l = new L; | |
h.each(function(a) { | |
l.add(c.zb(a)); | |
b && g.add(a) | |
}); | |
var m = ""; | |
d && (m += ug(this)); | |
0 < k.count && (m += (b ? this.jz : this.hz) + yg(this, k.Fc(), !0)); | |
0 < g.count && (m += this.EC + yg(this, g.Fc(), !0)); | |
0 < l.count && (m += (b ? | |
this.hz : this.jz) + yg(this, l.Fc(), !0)); | |
return m | |
}; | |
f.MB = function(a) { | |
wg(this, a); | |
var b = a.insertedNodeKeys, | |
c = a.modifiedNodeData, | |
d = new na; | |
if (D.isArray(c)) | |
for (var e = 0; e < c.length; e++) { | |
var g = D.La(c, e), | |
h = this.zb(g); | |
void 0 !== h && null !== h && d.set(h, g) | |
} | |
if (D.isArray(b)) | |
for (var e = D.cb(b), k = 0; k < e; k++) g = D.La(b, k), h = this.Ie(g), null === h && (h = (h = d.get(g)) ? h : this.copyNodeData({}), this.Ty(h, g), this.em(h)); | |
if (D.isArray(c)) | |
for (e = D.cb(c), k = 0; k < e; k++) | |
if (g = D.La(c, k), h = this.zb(g), h = this.Ie(h), null !== h) | |
for (var l in g) "__gohashid" !== l && l !== this.Vj && l !== this.Iq && this.setDataProperty(h, | |
l, g[l]); | |
a = a.removedNodeKeys; | |
if (D.isArray(a)) | |
for (e = D.cb(a), k = 0; k < e; k++) g = D.La(a, k), h = this.Ie(g), null !== h && this.Ky(h) | |
}; | |
M.prototype.toIncrementalJson = M.prototype.toIncrementalJSON = function(a, b) { | |
D.l(a, eg, M, "toIncrementalJson:e"); | |
a.Oc !== gg && D.k("Model.toIncrementalJson argument is not a Transaction ChangedEvent:" + a.toString()); | |
var c = a.object; | |
if (!(a.lG && c instanceof Cg)) return '{ "incremental": 0 }'; | |
void 0 === b && (b = this.constructor === M ? "go.Model" : this.constructor === Y ? "go.GraphLinksModel" : this.constructor === Bg ? "go.TreeModel" : D.yf(this)); | |
return '{ "class": ' + this.quote(b) + ', "incremental": 1' + this.Bo() + this.uC(c, "FinishedUndo" === | |
a.propertyName) + "}" | |
}; | |
M.prototype.toJson = M.prototype.toJSON = M.prototype.jC = function(a) { | |
void 0 === a && (a = this.constructor === M ? "go.Model" : this.constructor === Y ? "go.GraphLinksModel" : this.constructor === Bg ? "go.TreeModel" : D.yf(this)); | |
return '{ "class": ' + this.quote(a) + this.Bo() + this.vC() + "}" | |
}; | |
M.prototype.applyIncrementalJson = M.prototype.applyIncrementalJSON = function(a) { | |
var b = null; | |
if ("string" === typeof a) | |
if (window.JSON && window.JSON.parse) try { | |
b = window.JSON.parse(a) | |
} catch (c) { | |
v && D.trace("JSON.parse error: " + c.toString()) | |
} else D.trace("WARNING: no JSON.parse available"); | |
else "object" === typeof a ? b = a : D.k("Unable to modify a Model from: " + a); | |
var d = b.incremental; | |
"number" !== typeof d && D.k("Unable to apply non-incremental changes to Model: " + a); | |
0 !== d && (this.Nb("applyIncrementalJson"), this.MB(b), this.jd("applyIncrementalJson")) | |
}; | |
M.fromJson = M.fromJSON = function(a, b) { | |
void 0 === b && (b = null); | |
null !== b && D.l(b, M, M, "fromJson:model"); | |
var c = null; | |
if ("string" === typeof a) | |
if (window.JSON && window.JSON.parse) try { | |
c = window.JSON.parse(a) | |
} catch (d) { | |
v && D.trace("JSON.parse error: " + d.toString()) | |
} else D.trace("WARNING: no JSON.parse available"); | |
else "object" === typeof a ? c = a : D.k("Unable to construct a Model from: " + a); | |
if (null === b) { | |
var e; | |
e = null; | |
var g = c["class"]; | |
if ("string" === typeof g) try { | |
var h = null; | |
0 === g.indexOf("go.") ? (g = g.substr(3), h = ca[g]) : (h = ca[g], | |
void 0 === h && (h = window[g])); | |
"function" === typeof h && (e = new h) | |
} catch (k) {} | |
null === e || e instanceof M ? b = e : D.k("Unable to construct a Model of declared class: " + c["class"]) | |
} | |
null === b && (b = new Y); | |
b.fv(c); | |
b.NB(c); | |
return b | |
}; | |
M.prototype.replaceJsonObjects = M.prototype.iv = function(a) { | |
if (D.isArray(a)) | |
for (var b = D.cb(a), c = 0; c < b; c++) { | |
var d = D.La(a, c); | |
D.Qa(d) && D.aF(a, c, this.iv(d)) | |
} else if (D.Qa(a)) { | |
for (c in a) | |
if (d = a[c], D.Qa(d) && (d = this.iv(d), a[c] = d, "points" === c && Array.isArray(d))) { | |
for (var e = 0 === d.length % 2, g = 0; g < d.length; g++) | |
if ("number" !== typeof d[g]) { | |
e = !1; | |
break | |
} | |
if (e) { | |
e = new K(N); | |
for (g = 0; g < d.length / 2; g++) { | |
var h = new N(d[2 * g], d[2 * g + 1]); | |
e.add(h) | |
} | |
e.freeze(); | |
a[c] = e | |
} | |
} | |
if ("object" === typeof a) { | |
c = a; | |
d = a["class"]; | |
if ("NaN" === d) c = NaN; | |
else if ("Date" === | |
d) c = new Date(a.value); | |
else if ("go.Point" === d) c = new N(Dg(a.x), Dg(a.y)); | |
else if ("go.Size" === d) c = new Ca(Dg(a.width), Dg(a.height)); | |
else if ("go.Rect" === d) c = new C(Dg(a.x), Dg(a.y), Dg(a.width), Dg(a.height)); | |
else if ("go.Margin" === d) c = new Lb(Dg(a.top), Dg(a.right), Dg(a.bottom), Dg(a.left)); | |
else if ("go.Spot" === d) c = "string" === typeof a["enum"] ? cc(a["enum"]) : new S(Dg(a.x), Dg(a.y), Dg(a.offsetX), Dg(a.offsetY)); | |
else if ("go.Brush" === d) { | |
if (c = new Ba, c.type = Ha(Ba, a.type), "string" === typeof a.color && (c.color = a.color), a.start instanceof S && (c.start = a.start), a.end instanceof S && (c.end = a.end), "number" === typeof a.startRadius && (c.sv = Dg(a.startRadius)), "number" === typeof a.endRadius && (c.ou = Dg(a.endRadius)), a = a.colorStops, D.Qa(a)) | |
for (b in a) c.addColorStop(parseFloat(b), a[b]) | |
} else "go.Geometry" === d ? (b = null, b = "string" === typeof a.path ? yf(a.path) : new Ve, b.type = Ha(Ve, a.type), "number" === typeof a.startX && (b.la = Dg(a.startX)), "number" === typeof a.startY && (b.ja = Dg(a.startY)), "number" === typeof a.endX && (b.F = Dg(a.endX)), "number" === typeof a.endY && (b.G = | |
Dg(a.endY)), a.spot1 instanceof S && (b.C = a.spot1), a.spot2 instanceof S && (b.D = a.spot2), c = b) : "go.EnumValue" === d && (b = a.classType, 0 === b.indexOf("go.") && (b = b.substr(3)), c = Ha(ca[b], a.name)); | |
a = c | |
} | |
} | |
return a | |
}; | |
M.prototype.quote = function(a) { | |
for (var b = "", c = a.length, d = 0; d < c; d++) { | |
var e = a[d]; | |
if ('"' === e || "\\" === e) b += "\\" + e; | |
else if ("\b" === e) b += "\\b"; | |
else if ("\f" === e) b += "\\f"; | |
else if ("\n" === e) b += "\\n"; | |
else if ("\r" === e) b += "\\r"; | |
else if ("\t" === e) b += "\\t"; | |
else var g = a.charCodeAt(d), | |
b = 16 > g ? b + ("\\u000" + a.charCodeAt(d).toString(16)) : 32 > g ? b + ("\\u00" + a.charCodeAt(d).toString(16)) : 8232 === g ? b + "\\u2028" : 8233 === g ? b + "\\u2029" : b + e | |
} | |
return '"' + b + '"' | |
}; | |
M.prototype.writeJsonValue = M.prototype.yv = function(a) { | |
return void 0 === a ? "undefined" : null === a ? "null" : !0 === a ? "true" : !1 === a ? "false" : "string" === typeof a ? this.quote(a) : "number" === typeof a ? Infinity === a ? "9e9999" : -Infinity === a ? "-9e9999" : isNaN(a) ? '{"class":"NaN"}' : a.toString() : a instanceof Date ? '{"class":"Date", "value":"' + a.toJSON() + '"}' : a instanceof Number ? this.yv(a.valueOf()) : D.isArray(a) ? yg(this, a) : D.Qa(a) ? vg(this, a) : "function" === typeof a ? "null" : a.toString() | |
}; | |
function yg(a, b, c) { | |
void 0 === c && (c = !1); | |
var d = D.cb(b); | |
if (0 >= d) return "[]"; | |
var e = new xa; | |
e.add("[ "); | |
c && 1 < d && e.add("\n"); | |
for (var g = 0; g < d; g++) { | |
var h = D.La(b, g); | |
void 0 !== h && (0 < g && (e.add(","), c && e.add("\n")), e.add(a.yv(h))) | |
} | |
c && 1 < d && e.add("\n"); | |
e.add(" ]"); | |
return e.toString() | |
} | |
function xg(a, b) { | |
return void 0 === b || "__gohashid" === a || "_" === a[0] || "function" === typeof b ? !0 : !1 | |
} | |
function Eg(a) { | |
return isNaN(a) ? "NaN" : Infinity === a ? "9e9999" : -Infinity === a ? "-9e9999" : a | |
} | |
function vg(a, b) { | |
var c = b; | |
if (c instanceof N) b = { | |
"class": "go.Point", | |
x: Eg(c.x), | |
y: Eg(c.y) | |
}; | |
else if (c instanceof Ca) b = { | |
"class": "go.Size", | |
width: Eg(c.width), | |
height: Eg(c.height) | |
}; | |
else if (c instanceof C) b = { | |
"class": "go.Rect", | |
x: Eg(c.x), | |
y: Eg(c.y), | |
width: Eg(c.width), | |
height: Eg(c.height) | |
}; | |
else if (c instanceof Lb) b = { | |
"class": "go.Margin", | |
top: Eg(c.top), | |
right: Eg(c.right), | |
bottom: Eg(c.bottom), | |
left: Eg(c.left) | |
}; | |
else if (c instanceof S) b = c.Xc() ? { | |
"class": "go.Spot", | |
x: Eg(c.x), | |
y: Eg(c.y), | |
offsetX: Eg(c.offsetX), | |
offsetY: Eg(c.offsetY) | |
} : { | |
"class": "go.Spot", | |
"enum": c.toString() | |
}; | |
else if (c instanceof Ba) { | |
b = { | |
"class": "go.Brush", | |
type: c.type.name | |
}; | |
if (c.type === Fg) b.color = c.color; | |
else if (c.type === Gg || c.type === Id) b.start = c.start, b.end = c.end, c.type === Id && (0 !== c.sv && (b.startRadius = Eg(c.sv)), isNaN(c.ou) || (b.endRadius = Eg(c.ou))); | |
if (null !== c.Rk) { | |
for (var d = {}, c = c.Rk.j; c.next();) d[c.key] = c.value; | |
b.colorStops = d | |
} | |
} else if (c instanceof Ve) b = { | |
"class": "go.Geometry", | |
type: c.type.name | |
}, 0 !== c.la && (b.startX = Eg(c.la)), 0 !== c.ja && (b.startY = Eg(c.ja)), 0 !== c.F && (b.endX = | |
Eg(c.F)), 0 !== c.G && (b.endY = Eg(c.G)), c.C.O(ec) || (b.spot1 = c.C), c.D.O(vc) || (b.spot2 = c.D), c.type === We && (b.path = xf(c)); | |
else if (c instanceof ya) b = { | |
"class": "go.EnumValue", | |
classType: D.yf(c.Re), | |
name: c.name | |
}; | |
else if (c instanceof O || c instanceof E || c instanceof Hg || c instanceof M || c instanceof Zg || c instanceof qa || c instanceof $g || c instanceof ua || c instanceof tg || c instanceof Cg) return D.trace("ERROR: trying to convert a GraphObject or Diagram or Model or Tool or Layout or UndoManager into JSON text: " + c.toString()), | |
"{}"; | |
var d = "{", | |
c = !0, | |
e; | |
for (e in b) { | |
var g = D.xb(b, e); | |
if (!xg(e, g)) | |
if (c ? c = !1 : d += ", ", d += '"' + e + '":', "points" === e && g instanceof K && g.ca === N) { | |
for (var h = "[", g = g.j; g.next();) { | |
var k = g.value; | |
1 < h.length && (h += ","); | |
h += a.yv(k.x); | |
h += ","; | |
h += a.yv(k.y) | |
} | |
h += "]"; | |
d += h | |
} else d += a.yv(g) | |
} | |
return d + "}" | |
} | |
function Dg(a) { | |
return "number" === typeof a ? a : "NaN" === a ? NaN : "9e9999" === a ? Infinity : "-9e9999" === a ? -Infinity : parseFloat(a) | |
} | |
D.defineProperty(M, { | |
name: "name" | |
}, function() { | |
return this.ac | |
}, function(a) { | |
var b = this.ac; | |
b !== a && (D.h(a, "string", M, "name"), this.ac = a, this.i("name", b, a)) | |
}); | |
D.defineProperty(M, { | |
om: "dataFormat" | |
}, function() { | |
return this.Ir | |
}, function(a) { | |
var b = this.Ir; | |
b !== a && (D.h(a, "string", M, "dataFormat"), this.Ir = a, this.i("dataFormat", b, a)) | |
}); | |
D.defineProperty(M, { | |
qb: "isReadOnly" | |
}, function() { | |
return this.dj | |
}, function(a) { | |
var b = this.dj; | |
b !== a && (D.h(a, "boolean", M, "isReadOnly"), this.dj = a, this.i("isReadOnly", b, a)) | |
}); | |
D.defineProperty(M, { | |
gl: "modelData" | |
}, function() { | |
return this.cA | |
}, function(a) { | |
var b = this.cA; | |
b !== a && (D.h(a, "object", M, "modelData"), this.cA = a, this.i("modelData", b, a), this.Ob(a)) | |
}); | |
M.prototype.addChangedListener = M.prototype.Dn = function(a) { | |
D.h(a, "function", M, "addChangedListener:listener"); | |
null === this.zk && (this.zk = new K("function")); | |
this.zk.add(a) | |
}; | |
M.prototype.removeChangedListener = M.prototype.gv = function(a) { | |
D.h(a, "function", M, "removeChangedListener:listener"); | |
null !== this.zk && (this.zk.remove(a), 0 === this.zk.count && (this.zk = null)) | |
}; | |
M.prototype.Hx = function(a) { | |
this.lb || this.na.XF(a); | |
if (null !== this.zk) | |
for (var b = this.zk, c = b.length, d = 0; d < c; d++) b.fa(d)(a) | |
}; | |
M.prototype.raiseChangedEvent = M.prototype.od = function(a, b, c, d, e, g, h) { | |
ah(this, "", a, b, c, d, e, g, h) | |
}; | |
M.prototype.raiseChanged = M.prototype.i = function(a, b, c, d, e) { | |
ah(this, "", fg, a, this, b, c, d, e) | |
}; | |
M.prototype.raiseDataChanged = M.prototype.LB = function(a, b, c, d, e, g) { | |
ah(this, "", fg, b, a, c, d, e, g) | |
}; | |
function ah(a, b, c, d, e, g, h, k, l) { | |
void 0 === k && (k = null); | |
void 0 === l && (l = null); | |
var m = new eg; | |
m.da = a; | |
m.Oc = c; | |
m.Ef = b; | |
m.propertyName = d; | |
m.object = e; | |
m.oldValue = g; | |
m.Wj = k; | |
m.newValue = h; | |
m.Uj = l; | |
a.Hx(m) | |
} | |
D.defineProperty(M, { | |
na: "undoManager" | |
}, function() { | |
return this.xA | |
}, function(a) { | |
var b = this.xA; | |
b !== a && (D.l(a, tg, M, "undoManager"), null !== b && b.dK(this), this.xA = a, null !== a && a.WH(this)) | |
}); | |
D.defineProperty(M, { | |
lb: "skipsUndoManager" | |
}, function() { | |
return this.vj | |
}, function(a) { | |
D.h(a, "boolean", M, "skipsUndoManager"); | |
this.vj = a | |
}); | |
M.prototype.Hn = function(a, b) { | |
if (null !== a && a.da === this) | |
if (a.Oc === fg) { | |
var c = a.object, | |
d = a.propertyName, | |
e = a.oa(b); | |
D.Ua(c, d, e) | |
} else a.Oc === hg ? (c = a.Uj, "nodeDataArray" === a.Ef ? (d = a.newValue, D.Qa(d) && "number" === typeof c && (e = this.zb(d), b ? (D.La(this.ze, c) === d && D.Vg(this.ze, c), void 0 !== e && this.Kc.remove(e)) : (D.La(this.ze, c) !== d && D.Ih(this.ze, c, d), void 0 !== e && this.Kc.add(e, d)))) : "" === a.Ef ? (d = a.object, !D.isArray(d) && a.propertyName && (d = D.xb(a.object, a.propertyName)), D.isArray(d) && "number" === typeof c && (e = a.newValue, | |
b ? D.Vg(d, c) : D.Ih(d, c, e))) : D.k("unknown ChangedEvent.Insert modelChange: " + a.toString())) : a.Oc === ig ? (c = a.Wj, "nodeDataArray" === a.Ef ? (d = a.oldValue, D.Qa(d) && "number" === typeof c && (e = this.zb(d), b ? (D.La(this.ze, c) !== d && D.Ih(this.ze, c, d), void 0 !== e && this.Kc.add(e, d)) : (D.La(this.ze, c) === d && D.Vg(this.ze, c), void 0 !== e && this.Kc.remove(e)))) : "" === a.Ef ? (d = a.object, !D.isArray(d) && a.propertyName && (d = D.xb(a.object, a.propertyName)), D.isArray(d) && "number" === typeof c && (e = a.oldValue, b ? D.Ih(d, c, e) : D.Vg(d, c))) : D.k("unknown ChangedEvent.Remove modelChange: " + | |
a.toString())) : a.Oc !== gg && D.k("unknown ChangedEvent: " + a.toString()) | |
}; | |
M.prototype.startTransaction = M.prototype.Nb = function(a) { | |
return this.na.Nb(a) | |
}; | |
M.prototype.commitTransaction = M.prototype.jd = function(a) { | |
return this.na.jd(a) | |
}; | |
M.prototype.rollbackTransaction = M.prototype.Bm = function() { | |
return this.na.Bm() | |
}; | |
M.prototype.commit = function(a, b) { | |
var c = b; | |
void 0 === c && (c = ""); | |
var d = this.lb; | |
null === c && (this.lb = !0, c = ""); | |
this.na.Nb(c); | |
var e = !1; | |
try { | |
a(this), e = !0 | |
} finally { | |
e ? this.na.jd(c) : this.na.Bm(), this.lb = d | |
} | |
}; | |
M.prototype.updateTargetBindings = M.prototype.Ob = function(a, b) { | |
void 0 === b && (b = ""); | |
ah(this, "SourceChanged", gg, b, a, null, null) | |
}; | |
D.defineProperty(M, { | |
Vj: "nodeKeyProperty" | |
}, function() { | |
return this.Dk | |
}, function(a) { | |
var b = this.Dk; | |
b !== a && (bh(a, M, "nodeKeyProperty"), "" === a && D.k("Model.nodeKeyProperty may not be the empty string"), 0 < this.Kc.count && D.k("Cannot set Model.nodeKeyProperty when there is existing node data"), this.Dk = a, this.i("nodeKeyProperty", b, a)) | |
}); | |
function bh(a, b, c) { | |
"string" !== typeof a && "function" !== typeof a && D.kc(a, "string or function", b, c) | |
} | |
M.prototype.getKeyForNodeData = M.prototype.zb = function(a) { | |
if (null !== a) { | |
var b = this.Dk; | |
if ("" !== b && (b = D.xb(a, b), void 0 !== b)) { | |
if (ch(b)) return b; | |
D.k("Key value for node data " + a + " is not a number or a string: " + b) | |
} | |
} | |
}; | |
M.prototype.setKeyForNodeData = M.prototype.Ty = function(a, b) { | |
void 0 !== b && null !== b && ch(b) || D.kc(b, "number or string", M, "setKeyForNodeData:key"); | |
if (null !== a) { | |
var c = this.Dk; | |
if ("" !== c) | |
if (this.le(a)) { | |
var d = D.xb(a, c); | |
d !== b && null === this.Ie(b) && (D.Ua(a, c, b), this.Kc.remove(d), this.Kc.add(b, a), ah(this, "nodeKey", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c), this.hv(d, b)) | |
} else D.Ua(a, c, b) | |
} | |
}; | |
D.defineProperty(M, { | |
aM: "makeUniqueKeyFunction" | |
}, function() { | |
return this.vp | |
}, function(a) { | |
var b = this.vp; | |
b !== a && (null !== a && D.h(a, "function", M, "makeUniqueKeyFunction"), this.vp = a, this.i("makeUniqueKeyFunction", b, a)) | |
}); | |
function ch(a) { | |
return "number" === typeof a || "string" === typeof a | |
} | |
M.prototype.containsNodeData = M.prototype.le = function(a) { | |
var b = this.zb(a); | |
return void 0 === b ? !1 : this.Kc.oa(b) === a | |
}; | |
M.prototype.findNodeDataForKey = M.prototype.Ie = function(a) { | |
null === a && D.k("Model.findNodeDataForKey:key must not be null"); | |
return void 0 !== a && ch(a) ? this.Kc.oa(a) : null | |
}; | |
D.defineProperty(M, { | |
qg: "nodeDataArray" | |
}, function() { | |
return this.ze | |
}, function(a) { | |
var b = this.ze; | |
if (b !== a) { | |
D.gu(a, M, "nodeDataArray"); | |
this.Kc.clear(); | |
this.qC(); | |
for (var c = D.cb(a), d = 0; d < c; d++) { | |
var e = D.La(a, d); | |
if (!D.Qa(e)) { | |
D.k("Model.nodeDataArray must only contain Objects, not: " + e); | |
return | |
} | |
D.sq(e) | |
} | |
this.ze = a; | |
for (var g = new K(Object), d = 0; d < c; d++) { | |
var e = D.La(a, d), | |
h = this.zb(e); | |
void 0 === h ? g.add(e) : null !== this.Kc.oa(h) ? g.add(e) : this.Kc.add(h, e) | |
} | |
for (d = g.j; d.next();) e = d.value, this.yB(e), g = this.zb(e), void 0 !== g && | |
this.Kc.add(g, e); | |
ah(this, "nodeDataArray", fg, "nodeDataArray", this, b, a); | |
for (d = 0; d < c; d++) e = D.La(a, d), this.Qq(e), this.Pq(e); | |
this.eF(); | |
D.oJ(a) || (this.qb = !0) | |
} | |
}); | |
M.prototype.makeNodeDataKeyUnique = M.prototype.yB = function(a) { | |
if (null !== a) { | |
var b = this.Dk; | |
if ("" !== b) { | |
var c = this.zb(a); | |
if (void 0 === c || this.Kc.contains(c)) { | |
var d = this.vp; | |
if (null !== d && (c = d(this, a), void 0 !== c && null !== c && !this.Kc.contains(c))) { | |
D.Ua(a, b, c); | |
return | |
} | |
if ("string" === typeof c) { | |
for (d = 2; this.Kc.contains(c + d);) d++; | |
D.Ua(a, b, c + d) | |
} else if (void 0 === c || "number" === typeof c) { | |
for (d = -this.Kc.count - 1; this.Kc.contains(d);) d--; | |
D.Ua(a, b, d) | |
} else D.k("Model.getKeyForNodeData returned something other than a string or a number: " + | |
c) | |
} | |
} | |
} | |
}; | |
M.prototype.addNodeData = M.prototype.em = function(a) { | |
null !== a && (D.sq(a), this.le(a) || dh(this, a, !0)) | |
}; | |
function dh(a, b, c) { | |
var d = a.zb(b); | |
if (void 0 === d || a.Kc.oa(d) !== b) a.yB(b), d = a.zb(b), void 0 === d ? D.k("Model.makeNodeDataKeyUnique failed on " + b + ". Data not added to Model.") : (a.Kc.add(d, b), d = null, c && (d = D.cb(a.ze), D.Ih(a.ze, d, b)), ah(a, "nodeDataArray", hg, "nodeDataArray", a, null, b, null, d), a.Qq(b), a.Pq(b)) | |
} | |
M.prototype.addNodeDataCollection = function(a) { | |
if (D.isArray(a)) | |
for (var b = D.cb(a), c = 0; c < b; c++) this.em(D.La(a, c)); | |
else | |
for (a = a.j; a.next();) this.em(a.value) | |
}; | |
M.prototype.removeNodeData = M.prototype.Ky = function(a) { | |
null !== a && eh(this, a, !0) | |
}; | |
function eh(a, b, c) { | |
var d = a.zb(b); | |
void 0 !== d && a.Kc.remove(d); | |
d = null; | |
if (c) { | |
d = D.im(a.ze, b); | |
if (0 > d) return; | |
D.Vg(a.ze, d) | |
} | |
ah(a, "nodeDataArray", ig, "nodeDataArray", a, b, null, d, null); | |
a.xv(b) | |
} | |
M.prototype.removeNodeDataCollection = function(a) { | |
if (D.isArray(a)) | |
for (var b = D.cb(a), c = 0; c < b; c++) this.Ky(D.La(a, c)); | |
else | |
for (a = a.j; a.next();) this.Ky(a.value) | |
}; | |
f = M.prototype; | |
f.hv = function(a, b) { | |
var c = fh(this, a); | |
c instanceof L && this.zg.add(b, c) | |
}; | |
f.qC = function() {}; | |
f.Qq = function() {}; | |
f.Pq = function() {}; | |
f.xv = function() {}; | |
function gh(a, b, c) { | |
if (void 0 !== b) { | |
var d = a.zg.oa(b); | |
null === d && (d = new L(Object), a.zg.add(b, d)); | |
d.add(c) | |
} | |
} | |
function hh(a, b, c) { | |
if (void 0 !== b) { | |
var d = a.zg.oa(b); | |
d instanceof L && (void 0 === c || null === c ? a.zg.remove(b) : (d.remove(c), 0 === d.count && a.zg.remove(b))) | |
} | |
} | |
function fh(a, b) { | |
if (void 0 === b) return null; | |
var c = a.zg.oa(b); | |
return c instanceof L ? c : null | |
} | |
M.prototype.clearUnresolvedReferences = M.prototype.eF = function(a) { | |
void 0 === a ? this.zg.clear() : this.zg.remove(a) | |
}; | |
D.defineProperty(M, { | |
tL: "copyNodeDataFunction" | |
}, function() { | |
return this.Po | |
}, function(a) { | |
var b = this.Po; | |
b !== a && (null !== a && D.h(a, "function", M, "copyNodeDataFunction"), this.Po = a, this.i("copyNodeDataFunction", b, a)) | |
}); | |
D.defineProperty(M, { | |
NA: "copiesArrays" | |
}, function() { | |
return this.Ar | |
}, function(a) { | |
var b = this.Ar; | |
b !== a && (null !== a && D.h(a, "boolean", M, "copiesArrays"), this.Ar = a, this.i("copiesArrays", b, a)) | |
}); | |
D.defineProperty(M, { | |
MA: "copiesArrayObjects" | |
}, function() { | |
return this.zr | |
}, function(a) { | |
var b = this.zr; | |
b !== a && (null !== a && D.h(a, "boolean", M, "copiesArrayObjects"), this.zr = a, this.i("copiesArrayObjects", b, a)) | |
}); | |
M.prototype.copyNodeData = function(a) { | |
if (null === a) return null; | |
var b = null, | |
b = this.Po, | |
b = null !== b ? b(a, this) : ih(this, a, !0); | |
D.Qa(b) && D.xc(b); | |
return b | |
}; | |
function ih(a, b, c) { | |
if (a.NA && Array.isArray(b)) { | |
var d = []; | |
for (c = 0; c < b.length; c++) { | |
var e = ih(a, b[c], a.MA); | |
d.push(e) | |
} | |
D.xc(d); | |
return d | |
} | |
if (c && D.Qa(b)) { | |
c = (c = b.constructor) ? new c : {}; | |
for (d in b) | |
if ("__gohashid" !== d) { | |
var e = D.xb(b, d), | |
g; | |
g = e; | |
g instanceof O || g instanceof E || g instanceof Hg || g instanceof jh || g instanceof kh || g instanceof Zg || g instanceof qa || g instanceof $g || g instanceof bg || g instanceof dg ? ("_" !== d[0] && D.trace('Warning: found GraphObject or Diagram reference when copying model data on property "' + | |
d + '" of data object: ' + b.toString() + " \nModel data should not have any references to a Diagram or any part of a diagram, such as: " + g.toString()), g = !0) : g = g instanceof M || g instanceof tg || g instanceof Cg || g instanceof eg ? !0 : !1; | |
g || (e = ih(a, e, !1)); | |
D.Ua(c, d, e) | |
} | |
D.xc(c); | |
return c | |
} | |
return b instanceof N ? b.copy() : b instanceof Ca ? b.copy() : b instanceof C ? b.copy() : b instanceof S ? b.copy() : b instanceof Lb ? b.copy() : b | |
} | |
D.defineProperty(M, { | |
YH: "afterCopyFunction" | |
}, function() { | |
return this.jr | |
}, function(a) { | |
var b = this.jr; | |
b !== a && (null !== a && D.h(a, "function", M, "afterCopyFunction"), this.jr = a, this.i("afterCopyFunction", b, a)) | |
}); | |
var lh = !1; | |
M.prototype.set = function(a, b, c) { | |
this.setDataProperty(a, b, c) | |
}; | |
M.prototype.set = M.prototype.setDataProperty = function(a, b, c) { | |
v && (D.h(a, "object", M, "setDataProperty:data"), D.h(b, "string", M, "setDataProperty:propname"), "" === b && D.k("Model.setDataProperty: property name must not be an empty string when setting " + a + " to " + c)); | |
if (this.le(a)) | |
if (b === this.Vj) this.Ty(a, c); | |
else { | |
if (b === this.qo) { | |
this.Ry(a, c); | |
return | |
} | |
} | |
else !lh && a instanceof O && (lh = !0, D.trace('Model.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), D.trace(" Is that really your intent?")); | |
var d = D.xb(a, | |
b); | |
d !== c && (D.Ua(a, b, c), this.LB(a, b, d, c)) | |
}; | |
M.prototype.addArrayItem = function(a, b) { | |
this.kB(a, -1, b) | |
}; | |
M.prototype.insertArrayItem = M.prototype.kB = function(a, b, c) { | |
v && (D.gu(a, M, "insertArrayItem:arr"), D.p(b, M, "insertArrayItem:idx")); | |
a === this.ze && D.k("Model.insertArrayItem or Model.addArrayItem should not be called on the Model.nodeDataArray"); | |
0 > b && (b = D.cb(a)); | |
D.Ih(a, b, c); | |
ah(this, "", hg, "", a, null, c, null, b) | |
}; | |
M.prototype.removeArrayItem = M.prototype.GG = function(a, b) { | |
void 0 === b && (b = -1); | |
v && (D.gu(a, M, "removeArrayItem:arr"), D.p(b, M, "removeArrayItem:idx")); | |
a === this.ze && D.k("Model.removeArrayItem should not be called on the Model.nodeDataArray"); - 1 === b && (b = D.cb(a) - 1); | |
var c = D.La(a, b); | |
D.Vg(a, b); | |
ah(this, "", ig, "", a, c, null, b, null) | |
}; | |
D.defineProperty(M, { | |
qo: "nodeCategoryProperty" | |
}, function() { | |
return this.kn | |
}, function(a) { | |
var b = this.kn; | |
b !== a && (bh(a, M, "nodeCategoryProperty"), this.kn = a, this.i("nodeCategoryProperty", b, a)) | |
}); | |
M.prototype.getCategoryForNodeData = M.prototype.cB = function(a) { | |
if (null === a) return ""; | |
var b = this.kn; | |
if ("" === b) return ""; | |
b = D.xb(a, b); | |
if (void 0 === b) return ""; | |
if ("string" === typeof b) return b; | |
D.k("getCategoryForNodeData found a non-string category for " + a + ": " + b); | |
return "" | |
}; | |
M.prototype.setCategoryForNodeData = M.prototype.Ry = function(a, b) { | |
D.h(b, "string", M, "setCategoryForNodeData:cat"); | |
if (null !== a) { | |
var c = this.kn; | |
if ("" !== c) | |
if (this.le(a)) { | |
var d = D.xb(a, c); | |
void 0 === d && (d = ""); | |
d !== b && (D.Ua(a, c, b), ah(this, "nodeCategory", fg, c, a, d, b)) | |
} else D.Ua(a, c, b) | |
} | |
}; | |
function Y(a, b) { | |
M.call(this); | |
2 < arguments.length && D.k("GraphLinksModel constructor can only take two optional arguments, the Array of node data and the Array of link data."); | |
this.df = []; | |
this.ki = new L(Object); | |
this.td = new na(null, Object); | |
this.Pl = ""; | |
this.zl = this.Oo = this.wp = null; | |
this.li = "from"; | |
this.mi = "to"; | |
this.fn = this.en = ""; | |
this.dn = "category"; | |
this.Kg = ""; | |
this.zp = "isGroup"; | |
this.Ah = "group"; | |
this.Br = !1; | |
void 0 !== a && (this.qg = a); | |
void 0 !== b && (this.$g = b) | |
} | |
D.Ta(Y, M); | |
D.ka("GraphLinksModel", Y); | |
Y.prototype.cloneProtected = function(a) { | |
M.prototype.cloneProtected.call(this, a); | |
a.Pl = this.Pl; | |
a.wp = this.wp; | |
a.Oo = this.Oo; | |
a.li = this.li; | |
a.mi = this.mi; | |
a.en = this.en; | |
a.fn = this.fn; | |
a.dn = this.dn; | |
a.Kg = this.Kg; | |
a.zp = this.zp; | |
a.Ah = this.Ah; | |
a.Br = this.Br | |
}; | |
Y.prototype.clear = Y.prototype.clear = function() { | |
M.prototype.clear.call(this); | |
this.df = []; | |
this.td.clear(); | |
this.ki.clear() | |
}; | |
f = Y.prototype; | |
f.toString = function(a) { | |
void 0 === a && (a = 0); | |
if (2 <= a) return this.jC(); | |
var b = ("" !== this.name ? this.name : "") + " GraphLinksModel"; | |
if (0 < a) { | |
b += "\n node data:"; | |
a = this.qg; | |
for (var c = D.cb(a), d = 0, d = 0; d < c; d++) var e = D.La(a, d), | |
b = b + (" " + this.zb(e) + ":" + ia(e)); | |
b += "\n link data:"; | |
a = this.$g; | |
c = D.cb(a); | |
for (d = 0; d < c; d++) e = D.La(a, d), b += " " + this.um(e) + "--\x3e" + this.vm(e) | |
} | |
return b | |
}; | |
f.Bo = function() { | |
var a = M.prototype.Bo.call(this), | |
b = ""; | |
"category" !== this.Su && "string" === typeof this.Su && (b += ',\n "linkCategoryProperty": ' + this.quote(this.Su)); | |
"" !== this.Tj && "string" === typeof this.Tj && (b += ',\n "linkKeyProperty": ' + this.quote(this.Tj)); | |
"from" !== this.fo && "string" === typeof this.fo && (b += ',\n "linkFromKeyProperty": ' + this.quote(this.fo)); | |
"to" !== this.ho && "string" === typeof this.ho && (b += ',\n "linkToKeyProperty": ' + this.quote(this.ho)); | |
"" !== this.Tu && "string" === typeof this.Tu && (b += ',\n "linkFromPortIdProperty": ' + | |
this.quote(this.Tu)); | |
"" !== this.Vu && "string" === typeof this.Vu && (b += ',\n "linkToPortIdProperty": ' + this.quote(this.Vu)); | |
"" !== this.Uu && "string" === typeof this.Uu && (b += ',\n "linkLabelKeysProperty": ' + this.quote(this.Uu)); | |
"isGroup" !== this.Iq && "string" === typeof this.Iq && (b += ',\n "nodeIsGroupProperty": ' + this.quote(this.Iq)); | |
"group" !== this.bv && "string" === typeof this.bv && (b += ',\n "nodeGroupKeyProperty": ' + this.quote(this.bv)); | |
return a + b | |
}; | |
f.fv = function(a) { | |
M.prototype.fv.call(this, a); | |
a.linkKeyProperty && (this.Tj = a.linkKeyProperty); | |
a.linkFromKeyProperty && (this.fo = a.linkFromKeyProperty); | |
a.linkToKeyProperty && (this.ho = a.linkToKeyProperty); | |
a.linkFromPortIdProperty && (this.Tu = a.linkFromPortIdProperty); | |
a.linkToPortIdProperty && (this.Vu = a.linkToPortIdProperty); | |
a.linkCategoryProperty && (this.Su = a.linkCategoryProperty); | |
a.linkLabelKeysProperty && (this.Uu = a.linkLabelKeysProperty); | |
a.nodeIsGroupProperty && (this.Iq = a.nodeIsGroupProperty); | |
a.nodeGroupKeyProperty && | |
(this.bv = a.nodeGroupKeyProperty) | |
}; | |
f.vC = function() { | |
var a = M.prototype.vC.call(this), | |
b = ',\n "linkDataArray": ' + yg(this, this.$g, !0); | |
return a + b | |
}; | |
f.NB = function(a) { | |
M.prototype.NB.call(this, a); | |
a = a.linkDataArray; | |
D.isArray(a) && (this.iv(a), this.$g = a) | |
}; | |
f.wC = function(a) { | |
if (!(a instanceof Y)) return D.k("Model.computeJsonDifference: newmodel must be a GraphLinksModel"), ""; | |
"" === this.Tj && D.k("GraphLinksModel.linkKeyProperty must not be an empty string for .computeJsonDifference() to succeed."); | |
var b = M.prototype.wC.call(this, a); | |
Ag(this, a, "linkKeyProperty"); | |
Ag(this, a, "linkFromKeyProperty"); | |
Ag(this, a, "linkToKeyProperty"); | |
Ag(this, a, "linkLabelKeysProperty"); | |
Ag(this, a, "nodeIsGroupProperty"); | |
Ag(this, a, "nodeGroupKeyProperty"); | |
for (var c = new L, d = new L, e = (new L).Vc(this.td.nG), | |
g = new na, h = a.$g, k = 0; k < h.length; k++) { | |
var l = h[k], | |
m = a.of(l); | |
if (void 0 !== m) { | |
e.remove(m); | |
var n = this.oq(m); | |
null === n ? (c.add(m), d.add(l)) : zg(this, n, l, g) || d.add(l) | |
} else this.vy(l), m = this.of(l), c.add(m), d.add(l) | |
} | |
a = b; | |
0 < c.count && (a += this.gz + yg(this, c.Fc(), !0)); | |
0 < d.count && (a += this.DC + yg(this, d.Fc(), !0)); | |
0 < e.count && (a += this.iz + yg(this, e.Fc(), !0)); | |
return a | |
}; | |
f.gz = ',\n "insertedLinkKeys": '; | |
f.DC = ',\n "modifiedLinkData": '; | |
f.iz = ',\n "removedLinkKeys": '; | |
f.uC = function(a, b) { | |
"" === this.Tj && D.k("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed."); | |
var c = M.prototype.uC.call(this, a, b), | |
d = this, | |
e = new L, | |
g = new L, | |
h = new L; | |
a.fg.each(function(a) { | |
a.da === d && ("linkDataArray" === a.Ef ? a.Oc === hg ? e.add(a.newValue) : a.Oc === ig && h.add(a.oldValue) : d.Lh(a.object) && g.add(a.object)) | |
}); | |
var k = new L; | |
e.each(function(a) { | |
k.add(d.of(a)); | |
b || g.add(a) | |
}); | |
var l = new L; | |
h.each(function(a) { | |
l.add(d.of(a)); | |
b && g.add(a) | |
}); | |
0 < k.count && (c += (b ? this.iz : this.gz) + | |
yg(this, k.Fc(), !0)); | |
0 < g.count && (c += this.DC + yg(this, g.Fc(), !0)); | |
0 < l.count && (c += (b ? this.gz : this.iz) + yg(this, l.Fc(), !0)); | |
return c | |
}; | |
f.MB = function(a) { | |
M.prototype.MB.call(this, a); | |
var b = a.insertedLinkKeys, | |
c = a.modifiedLinkData, | |
d = new na; | |
if (D.isArray(c)) | |
for (var e = 0; e < c.length; e++) { | |
var g = D.La(c, e), | |
h = this.of(g); | |
void 0 !== h && null !== h && d.set(h, g) | |
} | |
if (D.isArray(b)) | |
for (var e = D.cb(b), k = 0; k < e; k++) g = D.La(b, k), h = this.oq(g), null === h && (h = (h = d.get(g)) ? h : this.Lx({}), this.aH(h, g), this.au(h)); | |
if (D.isArray(c)) | |
for (e = D.cb(c), k = 0; k < e; k++) | |
if (g = D.La(c, k), h = this.of(g), h = this.oq(h), null !== h) | |
for (var l in g) "__gohashid" !== l && l !== this.Tj && this.setDataProperty(h, | |
l, g[l]); | |
a = a.removedLinkKeys; | |
if (D.isArray(a)) | |
for (e = D.cb(a), k = 0; k < e; k++) g = D.La(a, k), h = this.oq(g), null !== h && this.Jy(h) | |
}; | |
f.Hn = function(a, b) { | |
if (a.Oc === hg) { | |
var c = a.Uj; | |
if ("linkDataArray" === a.Ef) { | |
var d = a.newValue; | |
if (D.Qa(d) && "number" === typeof c) { | |
var e = this.of(d); | |
b ? (this.ki.remove(d), D.La(this.df, c) === d && D.Vg(this.df, c), void 0 !== e && this.td.remove(e)) : (this.ki.add(d), D.La(this.df, c) !== d && D.Ih(this.df, c, d), void 0 !== e && this.td.add(e, d)) | |
} | |
return | |
} | |
if ("linkLabelKeys" === a.Ef) { | |
d = this.al(a.object); | |
D.isArray(d) && "number" === typeof c && (b ? (c = D.im(d, a.newValue), 0 <= c && D.Vg(d, c)) : 0 > D.im(d, a.newValue) && D.Ih(d, c, a.newValue)); | |
return | |
} | |
} else if (a.Oc === | |
ig) { | |
c = a.Wj; | |
if ("linkDataArray" === a.Ef) { | |
d = a.oldValue; | |
D.Qa(d) && "number" === typeof c && (e = this.of(d), b ? (this.ki.add(d), D.La(this.df, c) !== d && D.Ih(this.df, c, d), void 0 !== e && this.td.add(e, d)) : (this.ki.remove(d), D.La(this.df, c) === d && D.Vg(this.df, c), void 0 !== e && this.td.remove(e))); | |
return | |
} | |
if ("linkLabelKeys" === a.Ef) { | |
d = this.al(a.object); | |
D.isArray(d) && "number" === typeof c && (b ? 0 > D.im(d, a.newValue) && D.Ih(d, c, a.newValue) : (c = D.im(d, a.newValue), 0 <= c && D.Vg(d, c))); | |
return | |
} | |
} | |
M.prototype.Hn.call(this, a, b) | |
}; | |
D.defineProperty(Y, { | |
EA: "archetypeNodeData" | |
}, function() { | |
return this.zl | |
}, function(a) { | |
var b = this.zl; | |
b !== a && (null !== a && D.l(a, Object, Y, "archetypeNodeData"), this.zl = a, this.i("archetypeNodeData", b, a)) | |
}); | |
Y.prototype.io = function(a) { | |
if (void 0 !== a) { | |
var b = this.zl; | |
if (null !== b) { | |
var c = this.Ie(a); | |
null === c && (c = this.copyNodeData(b), D.Ua(c, this.Dk, a), this.em(c)) | |
} | |
return a | |
} | |
}; | |
D.defineProperty(Y, { | |
fo: "linkFromKeyProperty" | |
}, function() { | |
return this.li | |
}, function(a) { | |
var b = this.li; | |
b !== a && (bh(a, Y, "linkFromKeyProperty"), this.li = a, this.i("linkFromKeyProperty", b, a)) | |
}); | |
Y.prototype.getFromKeyForLinkData = Y.prototype.um = function(a) { | |
if (null !== a) { | |
var b = this.li; | |
if ("" !== b && (b = D.xb(a, b), void 0 !== b)) { | |
if (ch(b)) return b; | |
D.k("FromKey value for link data " + a + " is not a number or a string: " + b) | |
} | |
} | |
}; | |
Y.prototype.setFromKeyForLinkData = Y.prototype.XB = function(a, b) { | |
null === b && (b = void 0); | |
void 0 === b || ch(b) || D.kc(b, "number or string", Y, "setFromKeyForLinkData:key"); | |
if (null !== a) { | |
var c = this.li; | |
if ("" !== c) | |
if (b = this.io(b), this.Lh(a)) { | |
var d = D.xb(a, c); | |
d !== b && (hh(this, d, a), D.Ua(a, c, b), null === this.Ie(b) && gh(this, b, a), ah(this, "linkFromKey", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c)) | |
} else D.Ua(a, c, b) | |
} | |
}; | |
D.defineProperty(Y, { | |
ho: "linkToKeyProperty" | |
}, function() { | |
return this.mi | |
}, function(a) { | |
var b = this.mi; | |
b !== a && (bh(a, Y, "linkToKeyProperty"), this.mi = a, this.i("linkToKeyProperty", b, a)) | |
}); | |
Y.prototype.getToKeyForLinkData = Y.prototype.vm = function(a) { | |
if (null !== a) { | |
var b = this.mi; | |
if ("" !== b && (b = D.xb(a, b), void 0 !== b)) { | |
if (ch(b)) return b; | |
D.k("ToKey value for link data " + a + " is not a number or a string: " + b) | |
} | |
} | |
}; | |
Y.prototype.setToKeyForLinkData = Y.prototype.cC = function(a, b) { | |
null === b && (b = void 0); | |
void 0 === b || ch(b) || D.kc(b, "number or string", Y, "setToKeyForLinkData:key"); | |
if (null !== a) { | |
var c = this.mi; | |
if ("" !== c) | |
if (b = this.io(b), this.Lh(a)) { | |
var d = D.xb(a, c); | |
d !== b && (hh(this, d, a), D.Ua(a, c, b), null === this.Ie(b) && gh(this, b, a), ah(this, "linkToKey", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c)) | |
} else D.Ua(a, c, b) | |
} | |
}; | |
D.defineProperty(Y, { | |
Tu: "linkFromPortIdProperty" | |
}, function() { | |
return this.en | |
}, function(a) { | |
var b = this.en; | |
b !== a && (bh(a, Y, "linkFromPortIdProperty"), a !== this.fo && a !== this.ho || D.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: " + a), this.en = a, this.i("linkFromPortIdProperty", b, a)) | |
}); | |
Y.prototype.getFromPortIdForLinkData = Y.prototype.SI = function(a) { | |
if (null === a) return ""; | |
var b = this.en; | |
if ("" === b) return ""; | |
a = D.xb(a, b); | |
return void 0 === a ? "" : a | |
}; | |
Y.prototype.setFromPortIdForLinkData = Y.prototype.YB = function(a, b) { | |
D.h(b, "string", Y, "setFromPortIdForLinkData:portname"); | |
if (null !== a) { | |
var c = this.en; | |
if ("" !== c) | |
if (this.Lh(a)) { | |
var d = D.xb(a, c); | |
void 0 === d && (d = ""); | |
d !== b && (D.Ua(a, c, b), ah(this, "linkFromPortId", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c)) | |
} else D.Ua(a, c, b) | |
} | |
}; | |
D.defineProperty(Y, { | |
Vu: "linkToPortIdProperty" | |
}, function() { | |
return this.fn | |
}, function(a) { | |
var b = this.fn; | |
b !== a && (bh(a, Y, "linkToPortIdProperty"), a !== this.fo && a !== this.ho || D.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: " + a), this.fn = a, this.i("linkToPortIdProperty", b, a)) | |
}); | |
Y.prototype.getToPortIdForLinkData = Y.prototype.WI = function(a) { | |
if (null === a) return ""; | |
var b = this.fn; | |
if ("" === b) return ""; | |
a = D.xb(a, b); | |
return void 0 === a ? "" : a | |
}; | |
Y.prototype.setToPortIdForLinkData = Y.prototype.dC = function(a, b) { | |
D.h(b, "string", Y, "setToPortIdForLinkData:portname"); | |
if (null !== a) { | |
var c = this.fn; | |
if ("" !== c) | |
if (this.Lh(a)) { | |
var d = D.xb(a, c); | |
void 0 === d && (d = ""); | |
d !== b && (D.Ua(a, c, b), ah(this, "linkToPortId", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c)) | |
} else D.Ua(a, c, b) | |
} | |
}; | |
D.defineProperty(Y, { | |
Uu: "linkLabelKeysProperty" | |
}, function() { | |
return this.Kg | |
}, function(a) { | |
var b = this.Kg; | |
b !== a && (bh(a, Y, "linkLabelKeysProperty"), this.Kg = a, this.i("linkLabelKeysProperty", b, a)) | |
}); | |
Y.prototype.getLabelKeysForLinkData = Y.prototype.al = function(a) { | |
if (null === a) return D.ml; | |
var b = this.Kg; | |
if ("" === b) return D.ml; | |
a = D.xb(a, b); | |
return void 0 === a ? D.ml : a | |
}; | |
Y.prototype.setLabelKeysForLinkData = Y.prototype.bH = function(a, b) { | |
D.gu(b, Y, "setLabelKeysForLinkData:arr"); | |
if (null !== a) { | |
var c = this.Kg; | |
if ("" !== c) | |
if (this.Lh(a)) { | |
var d = D.xb(a, c); | |
void 0 === d && (d = D.ml); | |
if (d !== b) { | |
for (var e = D.cb(d), g = 0; g < e; g++) { | |
var h = D.La(d, g); | |
hh(this, h, a) | |
} | |
D.Ua(a, c, b); | |
e = D.cb(b); | |
for (g = 0; g < e; g++) h = D.La(b, g), null === this.Ie(h) && gh(this, h, a); | |
ah(this, "linkLabelKeys", fg, c, a, d, b); | |
"string" === typeof c && this.Ob(a, c) | |
} | |
} else D.Ua(a, c, b) | |
} | |
}; | |
Y.prototype.addLabelKeyForLinkData = Y.prototype.TE = function(a, b) { | |
if (null !== b && void 0 !== b && (ch(b) || D.kc(b, "number or string", Y, "addLabelKeyForLinkData:key"), null !== a)) { | |
var c = this.Kg; | |
if ("" !== c) { | |
var d = D.xb(a, c); | |
if (void 0 === d) c = [], c.push(b), this.bH(a, c); | |
else if (D.isArray(d)) { | |
var e = D.im(d, b); | |
0 <= e || (e = D.cb(d), D.Ih(d, Infinity, b), this.Lh(a) && (null === this.Ie(b) && gh(this, b, a), ah(this, "linkLabelKeys", hg, c, a, null, b, null, e))) | |
} else D.k(c + " property is not an Array; cannot addLabelKeyForLinkData: " + a) | |
} | |
} | |
}; | |
Y.prototype.removeLabelKeyForLinkData = Y.prototype.cK = function(a, b) { | |
if (null !== b && void 0 !== b && (ch(b) || D.kc(b, "number or string", Y, "removeLabelKeyForLinkData:key"), null !== a)) { | |
var c = this.Kg; | |
if ("" !== c) { | |
var d = D.xb(a, c); | |
if (D.isArray(d)) { | |
var e = D.im(d, b); | |
0 > e || (D.Vg(d, e), this.Lh(a) && (hh(this, b, a), ah(this, "linkLabelKeys", ig, c, a, b, null, e, null))) | |
} else void 0 !== d && D.k(c + " property is not an Array; cannot removeLabelKeyforLinkData: " + a) | |
} | |
} | |
}; | |
D.defineProperty(Y, { | |
$g: "linkDataArray" | |
}, function() { | |
return this.df | |
}, function(a) { | |
var b = this.df; | |
if (b !== a) { | |
D.gu(a, Y, "linkDataArray"); | |
this.td.clear(); | |
for (var c = D.cb(a), d = 0; d < c; d++) { | |
var e = D.La(a, d); | |
if (!D.Qa(e)) { | |
D.k("GraphLinksModel.linkDataArray must only contain Objects, not: " + e); | |
return | |
} | |
D.sq(e) | |
} | |
this.df = a; | |
if ("" !== this.Tj) { | |
for (var g = new K(Object), d = 0; d < c; d++) { | |
var e = D.La(a, d), | |
h = this.of(e); | |
void 0 === h ? g.add(e) : null !== this.td.oa(h) ? g.add(e) : this.td.add(h, e) | |
} | |
for (d = g.j; d.next();) e = d.value, this.vy(e), g = this.of(e), | |
void 0 !== g && this.td.add(g, e) | |
} | |
g = new L(Object); | |
for (d = 0; d < c; d++) e = D.La(a, d), g.add(e); | |
this.ki = g; | |
ah(this, "linkDataArray", fg, "linkDataArray", this, b, a); | |
for (d = 0; d < c; d++) e = D.La(a, d), mh(this, e) | |
} | |
}); | |
D.defineProperty(Y, { | |
Tj: "linkKeyProperty" | |
}, function() { | |
return this.Pl | |
}, function(a) { | |
var b = this.Pl; | |
if (b !== a) { | |
bh(a, Y, "linkKeyProperty"); | |
this.Pl = a; | |
this.td.clear(); | |
for (var c = D.cb(this.$g), d = 0; d < c; d++) { | |
var e = D.La(this.$g, d), | |
g = this.of(e); | |
void 0 === g && (this.vy(e), g = this.of(e)); | |
void 0 !== g && this.td.add(g, e) | |
} | |
this.i("linkKeyProperty", b, a) | |
} | |
}); | |
Y.prototype.getKeyForLinkData = Y.prototype.of = function(a) { | |
if (null !== a) { | |
var b = this.Pl; | |
if ("" !== b && (b = D.xb(a, b), void 0 !== b)) { | |
if (ch(b)) return b; | |
D.k("Key value for link data " + a + " is not a number or a string: " + b) | |
} | |
} | |
}; | |
Y.prototype.setKeyForLinkData = Y.prototype.aH = function(a, b) { | |
void 0 !== b && null !== b && ch(b) || D.kc(b, "number or string", Y, "setKeyForLinkData:key"); | |
if (null !== a) { | |
var c = this.Pl; | |
if ("" !== c) | |
if (this.Lh(a)) { | |
var d = D.xb(a, c); | |
d !== b && null === this.oq(b) && (D.Ua(a, c, b), this.td.remove(d), this.td.add(b, a), ah(this, "linkKey", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c)) | |
} else D.Ua(a, c, b) | |
} | |
}; | |
D.defineProperty(Y, { | |
bM: "makeUniqueLinkKeyFunction" | |
}, function() { | |
return this.wp | |
}, function(a) { | |
var b = this.wp; | |
b !== a && (null !== a && D.h(a, "function", Y, "makeUniqueLinkKeyFunction"), this.wp = a, this.i("makeUniqueLinkKeyFunction", b, a)) | |
}); | |
Y.prototype.findLinkDataForKey = Y.prototype.oq = function(a) { | |
null === a && D.k("GraphLinksModel.findLinkDataForKey:key must not be null"); | |
return void 0 !== a && ch(a) ? this.td.oa(a) : null | |
}; | |
Y.prototype.makeLinkDataKeyUnique = Y.prototype.vy = function(a) { | |
if (null !== a) { | |
var b = this.Pl; | |
if ("" !== b) { | |
var c = this.of(a); | |
if (void 0 === c || this.td.contains(c)) { | |
var d = this.wp; | |
if (null !== d && (c = d(this, a), void 0 !== c && null !== c && !this.td.contains(c))) { | |
D.Ua(a, b, c); | |
return | |
} | |
if ("string" === typeof c) { | |
for (d = 2; this.td.contains(c + d);) d++; | |
D.Ua(a, b, c + d) | |
} else if (void 0 === c || "number" === typeof c) { | |
for (d = -this.td.count - 1; this.td.contains(d);) d--; | |
D.Ua(a, b, d) | |
} else D.k("GraphLinksModel.getKeyForLinkData returned something other than a string or a number: " + | |
c) | |
} | |
} | |
} | |
}; | |
Y.prototype.containsLinkData = Y.prototype.Lh = function(a) { | |
return null === a ? !1 : this.ki.contains(a) | |
}; | |
Y.prototype.addLinkData = Y.prototype.au = function(a) { | |
null !== a && (D.sq(a), this.Lh(a) || nh(this, a, !0)) | |
}; | |
function nh(a, b, c) { | |
if ("" !== a.Tj) { | |
var d = a.of(b); | |
if (void 0 !== d && a.td.oa(d) === b) return; | |
a.vy(b); | |
d = a.of(b); | |
if (void 0 === d) { | |
D.k("GraphLinksModel.makeLinkDataKeyUnique failed on " + b + ". Data not added to model."); | |
return | |
} | |
a.td.add(d, b) | |
} | |
a.ki.add(b); | |
d = null; | |
c && (d = D.cb(a.df), D.Ih(a.df, d, b)); | |
ah(a, "linkDataArray", hg, "linkDataArray", a, null, b, null, d); | |
mh(a, b) | |
} | |
Y.prototype.addLinkDataCollection = function(a) { | |
if (D.isArray(a)) | |
for (var b = D.cb(a), c = 0; c < b; c++) this.au(D.La(a, c)); | |
else | |
for (a = a.j; a.next();) this.au(a.value) | |
}; | |
Y.prototype.removeLinkData = Y.prototype.Jy = function(a) { | |
null !== a && oh(this, a, !0) | |
}; | |
function oh(a, b, c) { | |
a.ki.remove(b); | |
var d = a.of(b); | |
void 0 !== d && a.td.remove(d); | |
d = null; | |
if (c) { | |
d = D.im(a.df, b); | |
if (0 > d) return; | |
D.Vg(a.df, d) | |
} | |
ah(a, "linkDataArray", ig, "linkDataArray", a, b, null, d, null); | |
c = a.um(b); | |
hh(a, c, b); | |
c = a.vm(b); | |
hh(a, c, b); | |
d = a.al(b); | |
if (D.isArray(d)) | |
for (var e = D.cb(d), g = 0; g < e; g++) c = D.La(d, g), hh(a, c, b) | |
} | |
Y.prototype.removeLinkDataCollection = function(a) { | |
if (D.isArray(a)) | |
for (var b = D.cb(a), c = 0; c < b; c++) this.Jy(D.La(a, c)); | |
else | |
for (a = a.j; a.next();) this.Jy(a.value) | |
}; | |
function mh(a, b) { | |
var c = a.um(b), | |
c = a.io(c); | |
null === a.Ie(c) && gh(a, c, b); | |
c = a.vm(b); | |
c = a.io(c); | |
null === a.Ie(c) && gh(a, c, b); | |
var d = a.al(b); | |
if (D.isArray(d)) | |
for (var e = D.cb(d), g = 0; g < e; g++) c = D.La(d, g), null === a.Ie(c) && gh(a, c, b) | |
} | |
D.defineProperty(Y, { | |
sL: "copyLinkDataFunction" | |
}, function() { | |
return this.Oo | |
}, function(a) { | |
var b = this.Oo; | |
b !== a && (null !== a && D.h(a, "function", Y, "copyLinkDataFunction"), this.Oo = a, this.i("copyLinkDataFunction", b, a)) | |
}); | |
Y.prototype.copyLinkData = Y.prototype.Lx = function(a) { | |
if (null === a) return null; | |
var b = null, | |
b = this.Oo, | |
b = null !== b ? b(a, this) : ih(this, a, !0); | |
D.Qa(b) && (D.xc(b), "" !== this.li && D.Ua(b, this.li, void 0), "" !== this.mi && D.Ua(b, this.mi, void 0), "" !== this.Kg && D.Ua(b, this.Kg, [])); | |
return b | |
}; | |
D.defineProperty(Y, { | |
Iq: "nodeIsGroupProperty" | |
}, function() { | |
return this.zp | |
}, function(a) { | |
var b = this.zp; | |
b !== a && (bh(a, Y, "nodeIsGroupProperty"), this.zp = a, this.i("nodeIsGroupProperty", b, a)) | |
}); | |
Y.prototype.isGroupForNodeData = Y.prototype.qB = function(a) { | |
if (null === a) return !1; | |
var b = this.zp; | |
return "" === b ? !1 : D.xb(a, b) ? !0 : !1 | |
}; | |
D.defineProperty(Y, { | |
bv: "nodeGroupKeyProperty" | |
}, function() { | |
return this.Ah | |
}, function(a) { | |
var b = this.Ah; | |
b !== a && (bh(a, Y, "nodeGroupKeyProperty"), this.Ah = a, this.i("nodeGroupKeyProperty", b, a)) | |
}); | |
D.defineProperty(Y, { | |
Ln: "copiesGroupKeyOfNodeData" | |
}, function() { | |
return this.Br | |
}, function(a) { | |
this.Br !== a && (D.h(a, "boolean", Y, "copiesGroupKeyOfNodeData"), this.Br = a) | |
}); | |
Y.prototype.getGroupKeyForNodeData = Y.prototype.Un = function(a) { | |
if (null !== a) { | |
var b = this.Ah; | |
if ("" !== b && (b = D.xb(a, b), void 0 !== b)) { | |
if (ch(b)) return b; | |
D.k("GroupKey value for node data " + a + " is not a number or a string: " + b) | |
} | |
} | |
}; | |
Y.prototype.setGroupKeyForNodeData = Y.prototype.ZB = function(a, b) { | |
null === b && (b = void 0); | |
void 0 === b || ch(b) || D.kc(b, "number or string", Y, "setGroupKeyForNodeData:key"); | |
if (null !== a) { | |
var c = this.Ah; | |
if ("" !== c) | |
if (this.le(a)) { | |
var d = D.xb(a, c); | |
d !== b && (hh(this, d, a), D.Ua(a, c, b), null === this.Ie(b) && gh(this, b, a), ah(this, "nodeGroupKey", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c)) | |
} else D.Ua(a, c, b) | |
} | |
}; | |
Y.prototype.copyNodeData = function(a) { | |
if (null === a) return null; | |
a = M.prototype.copyNodeData.call(this, a); | |
this.Ln || "" === this.Ah || void 0 === D.xb(a, this.Ah) || D.Ua(a, this.Ah, void 0); | |
return a | |
}; | |
Y.prototype.setDataProperty = function(a, b, c) { | |
v && (D.h(a, "object", Y, "setDataProperty:data"), D.h(b, "string", Y, "setDataProperty:propname"), "" === b && D.k("GraphLinksModel.setDataProperty: property name must not be an empty string when setting " + a + " to " + c)); | |
if (this.le(a)) | |
if (b === this.Vj) this.Ty(a, c); | |
else { | |
if (b === this.qo) { | |
this.Ry(a, c); | |
return | |
} | |
if (b === this.bv) { | |
this.ZB(a, c); | |
return | |
} | |
b === this.Iq && D.k("GraphLinksModel.setDataProperty: property name must not be the nodeIsGroupProperty: " + b) | |
} | |
else if (this.Lh(a)) { | |
if (b === | |
this.fo) { | |
this.XB(a, c); | |
return | |
} | |
if (b === this.ho) { | |
this.cC(a, c); | |
return | |
} | |
if (b === this.Tu) { | |
this.YB(a, c); | |
return | |
} | |
if (b === this.Vu) { | |
this.dC(a, c); | |
return | |
} | |
if (b === this.Tj) { | |
this.aH(a, c); | |
return | |
} | |
if (b === this.Su) { | |
this.$G(a, c); | |
return | |
} | |
if (b === this.Uu) { | |
this.bH(a, c); | |
return | |
} | |
} else !lh && a instanceof O && (lh = !0, D.trace('GraphLinksModel.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), D.trace(" Is that really your intent?")); | |
var d = D.xb(a, b); | |
d !== c && (D.Ua(a, b, c), this.LB(a, b, d, c)) | |
}; | |
f = Y.prototype; | |
f.hv = function(a, b) { | |
M.prototype.hv.call(this, a, b); | |
for (var c = this.Kc.j; c.next();) this.RB(c.value, a, b); | |
for (c = this.ki.j; c.next();) { | |
var d = c.value, | |
e = a, | |
g = b; | |
if (this.um(d) === e) { | |
var h = this.li; | |
D.Ua(d, h, g); | |
ah(this, "linkFromKey", fg, h, d, e, g); | |
"string" === typeof h && this.Ob(d, h) | |
} | |
this.vm(d) === e && (h = this.mi, D.Ua(d, h, g), ah(this, "linkToKey", fg, h, d, e, g), "string" === typeof h && this.Ob(d, h)); | |
h = this.al(d); | |
if (D.isArray(h)) | |
for (var k = D.cb(h), l = this.Kg, m = 0; m < k; m++) D.La(h, m) === e && (D.aF(h, m, g), ah(this, "linkLabelKeys", hg, l, d, e, g, m, | |
m)) | |
} | |
}; | |
f.RB = function(a, b, c) { | |
if (this.Un(a) === b) { | |
var d = this.Ah; | |
D.Ua(a, d, c); | |
ah(this, "nodeGroupKey", fg, d, a, b, c); | |
"string" === typeof d && this.Ob(a, d) | |
} | |
}; | |
f.qC = function() { | |
M.prototype.qC.call(this); | |
for (var a = this.$g, b = D.cb(a), c = 0; c < b; c++) { | |
var d = D.La(a, c); | |
mh(this, d) | |
} | |
}; | |
f.Qq = function(a) { | |
M.prototype.Qq.call(this, a); | |
a = this.zb(a); | |
var b = fh(this, a); | |
if (null !== b) { | |
for (var c = new K(Object), b = b.j; b.next();) { | |
var d = b.value; | |
if (this.le(d)) { | |
if (this.Un(d) === a) { | |
var e = this.Ah; | |
ah(this, "nodeGroupKey", fg, e, d, a, a); | |
"string" === typeof e && this.Ob(d, e); | |
c.add(d) | |
} | |
} else if (this.um(d) === a && (e = this.li, ah(this, "linkFromKey", fg, e, d, a, a), "string" === typeof e && this.Ob(d, e), c.add(d)), this.vm(d) === a && (e = this.mi, ah(this, "linkToKey", fg, e, d, a, a), "string" === typeof e && this.Ob(d, e), c.add(d)), e = this.al(d), D.isArray(e)) | |
for (var g = | |
D.cb(e), h = this.Kg, k = 0; k < g; k++) D.La(e, k) === a && (ah(this, "linkLabelKeys", hg, h, d, a, a, k, k), c.add(d)) | |
} | |
for (c = c.j; c.next();) hh(this, a, c.value) | |
} | |
}; | |
f.Pq = function(a) { | |
M.prototype.Pq.call(this, a); | |
var b = this.Un(a); | |
null === this.Ie(b) && gh(this, b, a) | |
}; | |
f.xv = function(a) { | |
M.prototype.xv.call(this, a); | |
var b = this.Un(a); | |
hh(this, b, a) | |
}; | |
D.defineProperty(Y, { | |
Su: "linkCategoryProperty" | |
}, function() { | |
return this.dn | |
}, function(a) { | |
var b = this.dn; | |
b !== a && (bh(a, Y, "linkCategoryProperty"), this.dn = a, this.i("linkCategoryProperty", b, a)) | |
}); | |
Y.prototype.getCategoryForLinkData = Y.prototype.Bu = function(a) { | |
if (null === a) return ""; | |
var b = this.dn; | |
if ("" === b) return ""; | |
b = D.xb(a, b); | |
if (void 0 === b) return ""; | |
if ("string" === typeof b) return b; | |
D.k("getCategoryForLinkData found a non-string category for " + a + ": " + b); | |
return "" | |
}; | |
Y.prototype.setCategoryForLinkData = Y.prototype.$G = function(a, b) { | |
D.h(b, "string", Y, "setCategoryForLinkData:cat"); | |
if (null !== a) { | |
var c = this.dn; | |
if ("" !== c) | |
if (this.Lh(a)) { | |
var d = D.xb(a, c); | |
void 0 === d && (d = ""); | |
d !== b && (D.Ua(a, c, b), ah(this, "linkCategory", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c)) | |
} else D.Ua(a, c, b) | |
} | |
}; | |
function Bg(a) { | |
1 < arguments.length && D.k("TreeModel constructor can only take one optional argument, the Array of node data."); | |
M.call(this); | |
this.Bh = "parent"; | |
this.Cr = !1; | |
this.nn = "parentLinkCategory"; | |
void 0 !== a && (this.qg = a) | |
} | |
D.Ta(Bg, M); | |
D.ka("TreeModel", Bg); | |
Bg.prototype.cloneProtected = function(a) { | |
M.prototype.cloneProtected.call(this, a); | |
a.Bh = this.Bh; | |
a.Cr = this.Cr; | |
a.nn = this.nn | |
}; | |
Bg.prototype.toString = function(a) { | |
void 0 === a && (a = 0); | |
if (2 <= a) return this.jC(); | |
var b = ("" !== this.name ? this.name : "") + " TreeModel"; | |
if (0 < a) { | |
b += "\n node data:"; | |
a = this.qg; | |
for (var c = D.cb(a), d = 0; d < c; d++) var e = D.La(a, d), | |
b = b + (" " + this.zb(e) + ":" + ia(e)) | |
} | |
return b | |
}; | |
Bg.prototype.Bo = function() { | |
var a = M.prototype.Bo.call(this), | |
b = ""; | |
"parent" !== this.cv && "string" === typeof this.cv && (b += ',\n "nodeParentKeyProperty": ' + this.quote(this.cv)); | |
return a + b | |
}; | |
Bg.prototype.fv = function(a) { | |
M.prototype.fv.call(this, a); | |
a.nodeParentKeyProperty && (this.cv = a.nodeParentKeyProperty) | |
}; | |
Bg.prototype.io = function(a) { | |
return a | |
}; | |
D.defineProperty(Bg, { | |
cv: "nodeParentKeyProperty" | |
}, function() { | |
return this.Bh | |
}, function(a) { | |
var b = this.Bh; | |
b !== a && (bh(a, Bg, "nodeParentKeyProperty"), this.Bh = a, this.i("nodeParentKeyProperty", b, a)) | |
}); | |
D.defineProperty(Bg, { | |
Mn: "copiesParentKeyOfNodeData" | |
}, function() { | |
return this.Cr | |
}, function(a) { | |
this.Cr !== a && (D.h(a, "boolean", Bg, "copiesParentKeyOfNodeData"), this.Cr = a) | |
}); | |
Bg.prototype.getParentKeyForNodeData = Bg.prototype.Wn = function(a) { | |
if (null !== a) { | |
var b = this.Bh; | |
if ("" !== b && (b = D.xb(a, b), void 0 !== b)) { | |
if (ch(b)) return b; | |
D.k("ParentKey value for node data " + a + " is not a number or a string: " + b) | |
} | |
} | |
}; | |
Bg.prototype.setParentKeyForNodeData = Bg.prototype.Ii = function(a, b) { | |
null === b && (b = void 0); | |
void 0 === b || ch(b) || D.kc(b, "number or string", Bg, "setParentKeyForNodeData:key"); | |
if (null !== a) { | |
var c = this.Bh; | |
if ("" !== c) | |
if (b = this.io(b), this.le(a)) { | |
var d = D.xb(a, c); | |
d !== b && (hh(this, d, a), D.Ua(a, c, b), null === this.Ie(b) && gh(this, b, a), ah(this, "nodeParentKey", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c)) | |
} else D.Ua(a, c, b) | |
} | |
}; | |
D.defineProperty(Bg, { | |
vM: "parentLinkCategoryProperty" | |
}, function() { | |
return this.nn | |
}, function(a) { | |
var b = this.nn; | |
b !== a && (bh(a, Bg, "parentLinkCategoryProperty"), this.nn = a, this.i("parentLinkCategoryProperty", b, a)) | |
}); | |
Bg.prototype.getParentLinkCategoryForNodeData = Bg.prototype.UI = function(a) { | |
if (null === a) return ""; | |
var b = this.nn; | |
if ("" === b) return ""; | |
b = D.xb(a, b); | |
if (void 0 === b) return ""; | |
if ("string" === typeof b) return b; | |
D.k("getParentLinkCategoryForNodeData found a non-string category for " + a + ": " + b); | |
return "" | |
}; | |
Bg.prototype.setParentLinkCategoryForNodeData = Bg.prototype.qK = function(a, b) { | |
D.h(b, "string", Bg, "setParentLinkCategoryForNodeData:cat"); | |
if (null !== a) { | |
var c = this.nn; | |
if ("" !== c) | |
if (this.le(a)) { | |
var d = D.xb(a, c); | |
void 0 === d && (d = ""); | |
d !== b && (D.Ua(a, c, b), ah(this, "parentLinkCategory", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c)) | |
} else D.Ua(a, c, b) | |
} | |
}; | |
Bg.prototype.copyNodeData = function(a) { | |
if (null === a) return null; | |
a = M.prototype.copyNodeData.call(this, a); | |
this.Mn || "" === this.Bh || void 0 === D.xb(a, this.Bh) || D.Ua(a, this.Bh, void 0); | |
return a | |
}; | |
Bg.prototype.setDataProperty = function(a, b, c) { | |
v && (D.h(a, "object", Bg, "setDataProperty:data"), D.h(b, "string", Bg, "setDataProperty:propname"), "" === b && D.k("TreeModel.setDataProperty: property name must not be an empty string when setting " + a + " to " + c)); | |
if (this.le(a)) | |
if (b === this.Vj) this.Ty(a, c); | |
else { | |
if (b === this.qo) { | |
this.Ry(a, c); | |
return | |
} | |
if (b === this.cv) { | |
this.Ii(a, c); | |
return | |
} | |
} | |
else !lh && a instanceof O && (lh = !0, D.trace('TreeModel.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), D.trace(" Is that really your intent?")); | |
var d = D.xb(a, b); | |
d !== c && (D.Ua(a, b, c), this.LB(a, b, d, c)) | |
}; | |
f = Bg.prototype; | |
f.hv = function(a, b) { | |
M.prototype.hv.call(this, a, b); | |
for (var c = this.Kc.j; c.next();) this.RB(c.value, a, b) | |
}; | |
f.RB = function(a, b, c) { | |
if (this.Wn(a) === b) { | |
var d = this.Bh; | |
D.Ua(a, d, c); | |
ah(this, "nodeParentKey", fg, d, a, b, c); | |
"string" === typeof d && this.Ob(a, d) | |
} | |
}; | |
f.Qq = function(a) { | |
M.prototype.Qq.call(this, a); | |
a = this.zb(a); | |
var b = fh(this, a); | |
if (null !== b) { | |
for (var c = new K(Object), b = b.j; b.next();) { | |
var d = b.value; | |
if (this.le(d) && this.Wn(d) === a) { | |
var e = this.Bh; | |
ah(this, "nodeParentKey", fg, e, d, a, a); | |
"string" === typeof e && this.Ob(d, e); | |
c.add(d) | |
} | |
} | |
for (c = c.j; c.next();) hh(this, a, c.value) | |
} | |
}; | |
f.Pq = function(a) { | |
M.prototype.Pq.call(this, a); | |
var b = this.Wn(a), | |
b = this.io(b); | |
null === this.Ie(b) && gh(this, b, a) | |
}; | |
f.xv = function(a) { | |
M.prototype.xv.call(this, a); | |
var b = this.Wn(a); | |
hh(this, b, a) | |
}; | |
function ph(a, b, c) { | |
D.xc(this); | |
this.J = !1; | |
void 0 === a ? a = "" : D.h(a, "string", ph, "constructor:targetprop"); | |
void 0 === b ? b = a : D.h(b, "string", ph, "constructor:sourceprop"); | |
void 0 === c ? c = null : null !== c && D.h(c, "function", ph, "constructor:conv"); | |
this.vE = -1; | |
this.Sg = null; | |
this.Up = a; | |
this.Tp = this.Pt = 0; | |
this.kx = null; | |
this.us = !1; | |
this.Kp = b; | |
this.yr = c; | |
this.Os = qh; | |
this.rr = null; | |
this.Oz = new L | |
} | |
D.ka("Binding", ph); | |
ph.prototype.copy = function() { | |
var a = new ph; | |
a.Up = this.Up; | |
a.Pt = this.Pt; | |
a.Tp = this.Tp; | |
a.kx = this.kx; | |
a.us = this.us; | |
a.Kp = this.Kp; | |
a.yr = this.yr; | |
a.Os = this.Os; | |
a.rr = this.rr; | |
return a | |
}; | |
var qh; | |
ph.OneWay = qh = D.s(ph, "OneWay", 1); | |
var rh; | |
ph.TwoWay = rh = D.s(ph, "TwoWay", 2); | |
ph.parseEnum = function(a, b) { | |
D.h(a, "function", ph, "parseEnum:ctor"); | |
D.Da(b, a, ph, "parseEnum:defval"); | |
return function(c) { | |
c = Ha(a, c); | |
return null === c ? b : c | |
} | |
}; | |
ph.prototype.qc = function(a) { | |
a.Re === ph ? this.mode = a : D.ak(this, a) | |
}; | |
var ia; | |
ph.toString = ia = function(a) { | |
var b = a; | |
D.Qa(a) && (a.text ? b = a.text : a.name ? b = a.name : void 0 !== a.key ? b = a.key : void 0 !== a.id ? b = a.id : a.constructor === Object && (a.Text ? b = a.Text : a.Name ? b = a.Name : void 0 !== a.Key ? b = a.Key : void 0 !== a.Id ? b = a.Id : void 0 !== a.ID && (b = a.ID))); | |
return void 0 === b ? "undefined" : null === b ? "null" : b.toString() | |
}; | |
ph.prototype.toString = function() { | |
return "Binding(" + this.tv + ":" + this.eH + (-1 !== this.Hm ? " " + this.Hm : "") + " " + this.mode.name + ")" | |
}; | |
ph.prototype.freeze = function() { | |
this.J = !0; | |
return this | |
}; | |
ph.prototype.Xa = function() { | |
this.J = !1; | |
return this | |
}; | |
D.defineProperty(ph, { | |
Hm: null | |
}, function() { | |
return this.vE | |
}, function(a) { | |
this.J && D.qa(this); | |
D.h(a, "number", ph, "targetId"); | |
this.vE = a | |
}); | |
D.defineProperty(ph, { | |
tv: "targetProperty" | |
}, function() { | |
return this.Up | |
}, function(a) { | |
this.J && D.qa(this); | |
D.h(a, "string", ph, "targetProperty"); | |
this.Up = a | |
}); | |
D.defineProperty(ph, { | |
$q: "sourceName" | |
}, function() { | |
return this.kx | |
}, function(a) { | |
this.J && D.qa(this); | |
null !== a && D.h(a, "string", ph, "sourceName"); | |
this.kx = a; | |
null !== a && (this.us = !1) | |
}); | |
D.defineProperty(ph, { | |
ly: "isToModel" | |
}, function() { | |
return this.us | |
}, function(a) { | |
this.J && D.qa(this); | |
D.h(a, "boolean", ph, "isToModel"); | |
this.us = a | |
}); | |
D.defineProperty(ph, { | |
eH: "sourceProperty" | |
}, function() { | |
return this.Kp | |
}, function(a) { | |
this.J && D.qa(this); | |
D.h(a, "string", ph, "sourceProperty"); | |
this.Kp = a | |
}); | |
D.defineProperty(ph, { | |
nI: "converter" | |
}, function() { | |
return this.yr | |
}, function(a) { | |
this.J && D.qa(this); | |
null !== a && D.h(a, "function", ph, "converter"); | |
this.yr = a | |
}); | |
D.defineProperty(ph, { | |
cI: "backConverter" | |
}, function() { | |
return this.rr | |
}, function(a) { | |
this.J && D.qa(this); | |
null !== a && D.h(a, "function", ph, "backConverter"); | |
this.rr = a | |
}); | |
D.defineProperty(ph, { | |
mode: "mode" | |
}, function() { | |
return this.Os | |
}, function(a) { | |
this.J && D.qa(this); | |
D.Da(a, ph, ph, "mode"); | |
this.Os = a | |
}); | |
ph.prototype.makeTwoWay = ph.prototype.EJ = function(a) { | |
void 0 === a && (a = null); | |
null !== a && D.h(a, "function", ph, "makeTwoWay"); | |
this.mode = rh; | |
this.cI = a; | |
return this | |
}; | |
ph.prototype.ofObject = ph.prototype.yy = function(a) { | |
void 0 === a && (a = ""); | |
v && D.h(a, "string", ph, "ofObject:srcname"); | |
this.$q = a; | |
this.ly = !1; | |
return this | |
}; | |
ph.prototype.ofModel = function() { | |
this.$q = null; | |
this.ly = !0; | |
return this | |
}; | |
function sh(a, b, c) { | |
a = a.$q; | |
var d = null; | |
return d = null === a || "" === a ? b : "/" === a ? c.Y : "." === a ? c : ".." === a ? c.R : b.Nd(a) | |
} | |
ph.prototype.updateTarget = ph.prototype.uH = function(a, b, c) { | |
var d = this.Kp; | |
if (void 0 === c || "" === d || d === c) { | |
c = this.Up; | |
var e = this.yr; | |
if (null === e && "" === c) D.trace("Binding error: target property is the empty string: " + this.toString()); | |
else { | |
v && "string" === typeof c && ("function" !== typeof a.setAttribute && 0 < c.length && "_" !== c[0] && !D.ey(a, c) ? D.trace("Binding error: undefined target property: " + c + " on " + a.toString()) : "name" === c && a instanceof O && D.trace("Binding error: cannot modify GraphObject.name on " + a.toString())); | |
var g = b; | |
"" !== d && (g = D.xb(b, d)); | |
if (void 0 !== g) | |
if (null === e) "" !== c && D.Ua(a, c, g); | |
else try { | |
if ("" !== c) { | |
var h = e(g, a); | |
v && void 0 === h && D.trace('Binding warning: conversion function returned undefined when setting target property "' + c + '" on ' + a.toString() + ", function is: " + e); | |
D.Ua(a, c, h) | |
} else e(g, a) | |
} catch (k) { | |
v && D.trace("Binding error: " + k.toString() + ' setting target property "' + c + '" on ' + a.toString() + " with conversion function: " + e) | |
} | |
} | |
} | |
}; | |
ph.prototype.updateSource = ph.prototype.Wy = function(a, b, c, d) { | |
if (this.Os === rh) { | |
var e = this.Up; | |
if (void 0 === c || e === c) { | |
c = this.Kp; | |
var g = this.rr, | |
h = a; | |
"" !== e && (h = D.xb(a, e)); | |
if (void 0 !== h && !this.Oz.contains(a)) try { | |
this.Oz.add(a); | |
var k = null !== d ? d.g : null, | |
l = null !== k ? k.da : null; | |
if (null === g) | |
if ("" !== c) null !== l ? (v && l.Vj === c && l.le(b) && D.trace("Binding error: cannot have TwoWay Binding on node data key property: " + this.toString()), l.setDataProperty(b, c, h)) : D.Ua(b, c, h); | |
else { | |
if (null !== l && null !== d && 0 <= d.Qu && null !== d.R && | |
Array.isArray(d.R.fl)) { | |
var m = d.Qu, | |
n = d.R.fl; | |
l.GG(n, m); | |
l.kB(n, m, h) | |
} | |
} | |
else try { | |
if ("" !== c) { | |
var p = g(h, b, l); | |
null !== l ? (v && (l.Vj === c && l.le(b) && D.trace("Binding error: cannot have TwoWay Binding on node data key property: " + this.toString()), void 0 === p && D.trace('Binding warning: conversion function returned undefined when setting source property "' + c + '" on ' + b.toString() + ", function is: " + g)), l.setDataProperty(b, c, p)) : D.Ua(b, c, p) | |
} else p = g(h, b, l), void 0 !== p && null !== l && null !== d && 0 <= d.Qu && null !== d.R && Array.isArray(d.R.fl) && | |
(m = d.Qu, n = d.R.fl, l.GG(n, m), l.kB(n, m, p)) | |
} catch (q) { | |
v && D.trace("Binding error: " + q.toString() + ' setting source property "' + c + '" on ' + b.toString() + " with conversion function: " + g) | |
} | |
} finally { | |
this.Oz.remove(a) | |
} | |
} | |
} | |
}; | |
function Cg() { | |
this.AH = (new K(eg)).freeze(); | |
this.ac = ""; | |
this.BD = !1 | |
} | |
D.ka("Transaction", Cg); | |
Cg.prototype.toString = function(a) { | |
var b = "Transaction: " + this.name + " " + this.fg.count.toString() + (this.Iu ? "" : ", incomplete"); | |
if (void 0 !== a && 0 < a) { | |
a = this.fg.count; | |
for (var c = 0; c < a; c++) { | |
var d = this.fg.fa(c); | |
null !== d && (b += "\n " + d.toString()) | |
} | |
} | |
return b | |
}; | |
Cg.prototype.clear = Cg.prototype.clear = function() { | |
var a = this.fg; | |
a.Xa(); | |
for (var b = a.count - 1; 0 <= b; b--) { | |
var c = a.fa(b); | |
null !== c && c.clear() | |
} | |
a.clear(); | |
a.freeze() | |
}; | |
Cg.prototype.canUndo = Cg.prototype.canUndo = function() { | |
return this.Iu | |
}; | |
Cg.prototype.undo = Cg.prototype.undo = function() { | |
if (this.canUndo()) | |
for (var a = this.fg.count - 1; 0 <= a; a--) { | |
var b = this.fg.fa(a); | |
null !== b && b.undo() | |
} | |
}; | |
Cg.prototype.canRedo = Cg.prototype.canRedo = function() { | |
return this.Iu | |
}; | |
Cg.prototype.redo = Cg.prototype.redo = function() { | |
if (this.canRedo()) | |
for (var a = this.fg.count, b = 0; b < a; b++) { | |
var c = this.fg.fa(b); | |
null !== c && c.redo() | |
} | |
}; | |
D.w(Cg, { | |
fg: "changes" | |
}, function() { | |
return this.AH | |
}); | |
D.defineProperty(Cg, { | |
name: "name" | |
}, function() { | |
return this.ac | |
}, function(a) { | |
this.ac = a | |
}); | |
D.defineProperty(Cg, { | |
Iu: "isComplete" | |
}, function() { | |
return this.BD | |
}, function(a) { | |
this.BD = a | |
}); | |
function tg() { | |
this.dA = new L(M); | |
this.tf = !1; | |
this.EH = (new K(Cg)).freeze(); | |
this.rh = -1; | |
this.QD = 999; | |
this.uh = !1; | |
this.Yv = null; | |
this.bm = 0; | |
this.sz = !1; | |
v && (this.sz = !0); | |
this.zh = (new K("string")).freeze(); | |
this.yp = new K("number"); | |
this.Pz = !0; | |
this.Zz = !1 | |
} | |
D.ka("UndoManager", tg); | |
tg.prototype.toString = function(a) { | |
for (var b = "UndoManager " + this.Lj + "<" + this.history.count + "<=" + this.tG, b = b + "[", c = this.yG.count, d = 0; d < c; d++) 0 < d && (b += " "), b += this.yG.fa(d); | |
b += "]"; | |
if (void 0 !== a && 0 < a) | |
for (c = this.history.count, d = 0; d < c; d++) b += "\n " + this.history.fa(d).toString(a - 1); | |
return b | |
}; | |
tg.prototype.clear = tg.prototype.clear = function() { | |
var a = this.history; | |
a.Xa(); | |
for (var b = a.count - 1; 0 <= b; b--) { | |
var c = a.fa(b); | |
null !== c && c.clear() | |
} | |
a.clear(); | |
this.rh = -1; | |
a.freeze(); | |
this.uh = !1; | |
this.Yv = null; | |
this.bm = 0; | |
this.zh.Xa(); | |
this.zh.clear(); | |
this.zh.freeze(); | |
this.yp.clear() | |
}; | |
tg.prototype.addModel = tg.prototype.WH = function(a) { | |
this.dA.add(a) | |
}; | |
tg.prototype.removeModel = tg.prototype.dK = function(a) { | |
this.dA.remove(a) | |
}; | |
tg.prototype.startTransaction = tg.prototype.Nb = function(a) { | |
void 0 === a && (a = ""); | |
null === a && (a = ""); | |
if (this.ub) return !1; | |
!0 === this.Pz && (this.Pz = !1, this.bm++, this.vd("StartingFirstTransaction", a, this.Gj), 0 < this.bm && this.bm--); | |
this.isEnabled && (this.zh.Xa(), this.zh.add(a), this.zh.freeze(), null === this.Gj ? this.yp.add(0) : this.yp.add(this.Gj.fg.count)); | |
this.bm++; | |
var b = 1 === this.Ki; | |
b && this.vd("StartedTransaction", a, this.Gj); | |
return b | |
}; | |
tg.prototype.commitTransaction = tg.prototype.jd = function(a) { | |
void 0 === a && (a = ""); | |
return th(this, !0, a) | |
}; | |
tg.prototype.rollbackTransaction = tg.prototype.Bm = function() { | |
return th(this, !1, "") | |
}; | |
function th(a, b, c) { | |
if (a.ub) return !1; | |
a.GA && 1 > a.Ki && D.trace("Ending transaction without having started a transaction: " + c); | |
var d = 1 === a.Ki; | |
d && b && a.vd("CommittingTransaction", c, a.Gj); | |
var e = 0; | |
if (0 < a.Ki && (a.bm--, a.isEnabled)) { | |
var g = a.zh.count; | |
0 < g && ("" === c && (c = a.zh.fa(0)), a.zh.Xa(), a.zh.pd(g - 1), a.zh.freeze()); | |
g = a.yp.count; | |
0 < g && (e = a.yp.fa(g - 1), a.yp.pd(g - 1)) | |
} | |
g = a.Gj; | |
if (d) { | |
if (b) { | |
a.Zz = !1; | |
if (a.isEnabled && null !== g) { | |
b = g; | |
b.Iu = !0; | |
b.name = c; | |
d = a.history; | |
d.Xa(); | |
for (e = d.count - 1; e > a.Lj; e--) g = d.fa(e), null !== g && g.clear(), | |
d.pd(e), a.Zz = !0; | |
e = a.tG; | |
0 === e && (e = 1); | |
0 < e && d.count >= e && (g = d.fa(0), null !== g && g.clear(), d.pd(0), a.rh--); | |
d.add(b); | |
a.rh++; | |
d.freeze(); | |
g = b | |
} | |
a.vd("CommittedTransaction", c, g) | |
} else { | |
a.uh = !0; | |
try { | |
a.isEnabled && null !== g && (g.Iu = !0, g.undo()) | |
} finally { | |
a.vd("RolledBackTransaction", c, g), a.uh = !1 | |
} | |
null !== g && g.clear() | |
} | |
a.Yv = null; | |
return !0 | |
} | |
if (a.isEnabled && !b && null !== g) { | |
a = e; | |
c = g.fg; | |
for (b = c.count - 1; b >= a; b--) d = c.fa(b), null !== d && d.undo(), c.Xa(), c.pd(b); | |
c.freeze() | |
} | |
return !1 | |
} | |
tg.prototype.canUndo = tg.prototype.canUndo = function() { | |
if (!this.isEnabled || 0 < this.Ki) return !1; | |
var a = this.qH; | |
return null !== a && a.canUndo() ? !0 : !1 | |
}; | |
tg.prototype.undo = tg.prototype.undo = function() { | |
if (this.canUndo()) { | |
var a = this.qH; | |
try { | |
this.uh = !0, this.vd("StartingUndo", "Undo", a), this.rh--, a.undo() | |
} catch (b) { | |
D.trace("undo error: " + b.toString()) | |
} finally { | |
this.vd("FinishedUndo", "Undo", a), this.uh = !1 | |
} | |
} | |
}; | |
tg.prototype.canRedo = tg.prototype.canRedo = function() { | |
if (!this.isEnabled || 0 < this.Ki) return !1; | |
var a = this.pH; | |
return null !== a && a.canRedo() ? !0 : !1 | |
}; | |
tg.prototype.redo = tg.prototype.redo = function() { | |
if (this.canRedo()) { | |
var a = this.pH; | |
try { | |
this.uh = !0, this.vd("StartingRedo", "Redo", a), this.rh++, a.redo() | |
} catch (b) { | |
D.trace("redo error: " + b.toString()) | |
} finally { | |
this.vd("FinishedRedo", "Redo", a), this.uh = !1 | |
} | |
} | |
}; | |
tg.prototype.vd = function(a, b, c) { | |
void 0 === c && (c = null); | |
var d = new eg; | |
d.Oc = gg; | |
d.propertyName = a; | |
d.object = c; | |
d.oldValue = b; | |
for (a = this.OJ; a.next();) b = a.value, d.da = b, b.Hx(d) | |
}; | |
tg.prototype.handleChanged = tg.prototype.XF = function(a) { | |
if (this.isEnabled && !this.ub && !this.skipsEvent(a)) { | |
var b = this.Gj; | |
null === b && (this.Yv = b = new Cg); | |
var c = a.copy(), | |
b = b.fg; | |
b.Xa(); | |
b.add(c); | |
b.freeze(); | |
this.GA && 0 >= this.Ki && !this.Pz && (a = a.g, null !== a && !1 === a.ao || D.trace("Change not within a transaction: " + c.toString())) | |
} | |
}; | |
tg.prototype.skipsEvent = function(a) { | |
if (null === a || 0 > a.Oc.value) return !0; | |
a = a.object; | |
if (a instanceof O) { | |
if (a = a.layer, null !== a && a.Yc) return !0 | |
} else if (a instanceof Hg && a.Yc) return !0; | |
return !1 | |
}; | |
D.w(tg, { | |
OJ: "models" | |
}, function() { | |
return this.dA.j | |
}); | |
D.defineProperty(tg, { | |
isEnabled: "isEnabled" | |
}, function() { | |
return this.tf | |
}, function(a) { | |
this.tf = a | |
}); | |
D.w(tg, { | |
qH: "transactionToUndo" | |
}, function() { | |
return 0 <= this.Lj && this.Lj <= this.history.count - 1 ? this.history.fa(this.Lj) : null | |
}); | |
D.w(tg, { | |
pH: "transactionToRedo" | |
}, function() { | |
return this.Lj < this.history.count - 1 ? this.history.fa(this.Lj + 1) : null | |
}); | |
D.w(tg, { | |
ub: "isUndoingRedoing" | |
}, function() { | |
return this.uh | |
}); | |
D.w(tg, { | |
history: "history" | |
}, function() { | |
return this.EH | |
}); | |
D.defineProperty(tg, { | |
tG: "maxHistoryLength" | |
}, function() { | |
return this.QD | |
}, function(a) { | |
this.QD = a | |
}); | |
D.w(tg, { | |
Lj: "historyIndex" | |
}, function() { | |
return this.rh | |
}); | |
D.w(tg, { | |
Gj: "currentTransaction" | |
}, function() { | |
return this.Yv | |
}); | |
D.w(tg, { | |
Ki: "transactionLevel" | |
}, function() { | |
return this.bm | |
}); | |
D.w(tg, { | |
hG: "isInTransaction" | |
}, function() { | |
return 0 < this.bm | |
}); | |
D.defineProperty(tg, { | |
GA: "checksTransactionLevel" | |
}, function() { | |
return this.sz | |
}, function(a) { | |
this.sz = a | |
}); | |
D.w(tg, { | |
yG: "nestedTransactionNames" | |
}, function() { | |
return this.zh | |
}); | |
function qa() { | |
0 < arguments.length && D.zd(qa); | |
D.xc(this); | |
this.ea = null; | |
this.OC = !1; | |
this.iD = this.PC = !0; | |
this.RC = this.SC = this.jD = this.TC = !1; | |
this.Sl = this.mz = null; | |
this.NE = 1.05; | |
this.fD = 1; | |
this.$z = NaN; | |
this.ND = null; | |
this.BA = NaN; | |
this.AA = Ld; | |
this.uj = null; | |
this.lE = 0 | |
} | |
D.ka("CommandHandler", qa); | |
var Nh = null, | |
Oh = ""; | |
qa.prototype.toString = function() { | |
return "CommandHandler" | |
}; | |
D.w(qa, { | |
g: "diagram" | |
}, function() { | |
return this.ea | |
}); | |
qa.prototype.ad = function(a) { | |
v && null !== a && D.l(a, E, qa, "setDiagram"); | |
this.ea = a | |
}; | |
qa.prototype.doKeyDown = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.U, | |
c = D.Qh ? b.Xu : b.control, | |
d = b.shift, | |
e = b.alt, | |
g = b.key; | |
!c || "C" !== g && "Insert" !== g ? c && "X" === g || d && "Del" === g ? this.canCutSelection() && this.cutSelection() : c && "V" === g || d && "Insert" === g ? this.canPasteSelection() && this.pasteSelection() : c && "Y" === g || e && d && "Backspace" === g ? this.canRedo() && this.redo() : c && "Z" === g || e && "Backspace" === g ? this.canUndo() && this.undo() : "Del" === g || "Backspace" === g ? this.canDeleteSelection() && this.deleteSelection() : c && "A" === g ? this.canSelectAll() && | |
this.selectAll() : "Esc" === g ? this.canStopCommand() && this.stopCommand() : "Up" === g ? a.Ce && (c ? a.scroll("pixel", "up") : a.scroll("line", "up")) : "Down" === g ? a.Ce && (c ? a.scroll("pixel", "down") : a.scroll("line", "down")) : "Left" === g ? a.Be && (c ? a.scroll("pixel", "left") : a.scroll("line", "left")) : "Right" === g ? a.Be && (c ? a.scroll("pixel", "right") : a.scroll("line", "right")) : "PageUp" === g ? d && a.Be ? a.scroll("page", "left") : a.Ce && a.scroll("page", "up") : "PageDown" === g ? d && a.Be ? a.scroll("page", "right") : a.Ce && a.scroll("page", "down") : "Home" === | |
g ? c && a.Ce ? a.scroll("document", "up") : !c && a.Be && a.scroll("document", "left") : "End" === g ? c && a.Ce ? a.scroll("document", "down") : !c && a.Be && a.scroll("document", "right") : " " === g ? this.canScrollToPart() && this.scrollToPart() : "Subtract" === g ? this.canDecreaseZoom() && this.decreaseZoom() : "Add" === g ? this.canIncreaseZoom() && this.increaseZoom() : c && "0" === g ? this.canResetZoom() && this.resetZoom() : d && "Z" === g ? this.canZoomToFit() && this.zoomToFit() : c && !d && "G" === g ? this.canGroupSelection() && this.groupSelection() : c && d && "G" === g ? this.canUngroupSelection() && | |
this.ungroupSelection() : b.event && 113 === b.event.which ? this.canEditTextBlock() && this.editTextBlock() : b.event && 93 === b.event.which ? this.canShowContextMenu() && this.showContextMenu() : b.bubbles = !0 : this.canCopySelection() && this.copySelection() | |
} | |
}; | |
qa.prototype.doKeyUp = function() { | |
var a = this.g; | |
null !== a && (a.U.bubbles = !0) | |
}; | |
qa.prototype.stopCommand = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.eb; | |
b instanceof Ph && a.Jf && a.Jx(); | |
null !== b && b.doCancel() | |
} | |
}; | |
qa.prototype.canStopCommand = function() { | |
return !0 | |
}; | |
qa.prototype.selectAll = function() { | |
var a = this.g; | |
if (null !== a) { | |
a.ra(); | |
try { | |
a.sc = "wait"; | |
a.Ja("ChangingSelection"); | |
for (var b = a.Hi; b.next();) b.value.jb = !0; | |
for (var c = a.rg; c.next();) c.value.jb = !0; | |
for (var d = a.links; d.next();) d.value.jb = !0 | |
} finally { | |
a.Ja("ChangedSelection"), a.sc = "" | |
} | |
} | |
}; | |
qa.prototype.canSelectAll = function() { | |
var a = this.g; | |
return null !== a && a.Jf | |
}; | |
qa.prototype.deleteSelection = function() { | |
var a = this.g; | |
if (null !== a && !a.Ja("SelectionDeleting", a.selection)) try { | |
a.sc = "wait"; | |
a.Nb("Delete"); | |
a.Ja("ChangingSelection"); | |
for (var b = new L(F), c = a.selection.j; c.next();) Qh(b, c.value, !0, this.wI ? Infinity : 0, this.tF, function(a) { | |
return a.canDelete() | |
}); | |
a.QB(b, !0); | |
a.Ja("SelectionDeleted", b) | |
} finally { | |
a.Ja("ChangedSelection"), a.jd("Delete"), a.sc = "" | |
} | |
}; | |
qa.prototype.canDeleteSelection = function() { | |
var a = this.g; | |
return null === a || a.qb || a.Mf || !a.En || 0 === a.selection.count ? !1 : !0 | |
}; | |
function Qh(a, b, c, d, e, g) { | |
void 0 === g && (g = null); | |
if (!(a.contains(b) || null !== g && !g(b) || b instanceof da)) | |
if (a.add(b), b instanceof G) { | |
if (c && b instanceof I) | |
for (var h = b.uc; h.next();) Qh(a, h.value, c, d, e, g); | |
if (e) | |
for (h = b.Pd; h.next();) { | |
var k = h.value; | |
if (!a.contains(k)) { | |
var l = k.$, | |
m = k.ba; | |
null !== l && a.contains(l) && null !== m && a.contains(m) ? Qh(a, k, c, d, e, g) : null !== l && null !== m || Qh(a, k, c, d, e, g) | |
} | |
} | |
if (1 < d) | |
for (b = b.IF(); b.next();) Qh(a, b.value, c, d - 1, e, g) | |
} else if (b instanceof J) | |
for (b = b.Cf; b.next();) Qh(a, b.value, c, d, e, g) | |
} | |
qa.prototype.hq = function(a, b, c) { | |
var d = new na(F, F); | |
for (a = a.j; a.next();) Rh(this, a.value, b, d, c); | |
if (null !== b) { | |
c = b.da; | |
a = !1; | |
null !== b.ob.Ge && (a = b.ob.Ge.Ij); | |
for (var e = new L(J), g = new na(J, J), h = d.j; h.next();) { | |
var k = h.value; | |
if (k instanceof J) { | |
var l = k; | |
a || null !== l.$ && null !== l.ba || e.add(l) | |
} else if (c instanceof Bg && k instanceof G && null !== k.data) { | |
var l = c, | |
m = k, | |
k = h.key, | |
n = k.Zk(); | |
null !== n && (n = d.oa(n), null !== n ? (l.Ii(m.data, l.zb(n.data)), l = b.gg(m.data), k = k.Sn(), null !== k && null !== l && g.add(k, l)) : l.Ii(m.data, void 0)) | |
} | |
} | |
0 < e.count && | |
b.QB(e, !1); | |
if (0 < g.count) | |
for (c = g.j; c.next();) d.add(c.key, c.value) | |
} | |
if (null !== b && null !== this.g && (b = b.da, c = b.YH, null !== c)) { | |
var p = new na; | |
d.each(function(a) { | |
null !== a.key.data && p.add(a.key.data, a.value.data) | |
}); | |
c(p, b, this.g.da) | |
} | |
for (b = d.j; b.next();) b.value.Ob(); | |
return d | |
}; | |
function Rh(a, b, c, d, e) { | |
if (null === b || e && !b.canCopy()) return null; | |
if (d.contains(b)) return d.oa(b); | |
var g = null, | |
h = b.data; | |
if (null !== h && null !== c) { | |
var k = c.da; | |
b instanceof J ? k instanceof Y && (h = k.Lx(h), D.Qa(h) && (k.au(h), g = c.gg(h))) : (h = k.copyNodeData(h), D.Qa(h) && (k.em(h), g = c.Nh(h))) | |
} else Sh(b), g = b.copy(), null !== g && (null !== c ? c.add(g) : null !== h && null !== a.g && a.oI && (k = a.g.da, h = g instanceof J && k instanceof Y ? k.Lx(h) : k.copyNodeData(h), D.Qa(h) && (g.data = h))); | |
if (!(g instanceof F)) return null; | |
g.jb = !1; | |
g.Zg = !1; | |
d.add(b, g); | |
if (b instanceof G) { | |
for (h = b.Pd; h.next();) { | |
k = h.value; | |
if (k.$ === b) { | |
var l = d.oa(k); | |
null !== l && (l.$ = g) | |
} | |
k.ba === b && (l = d.oa(k), null !== l && (l.ba = g)) | |
} | |
if (b instanceof I && g instanceof I) | |
for (h = g, b = b.uc; b.next();) k = Rh(a, b.value, c, d, e), k instanceof J || null === k || (k.Ka = h) | |
} else if (b instanceof J && g instanceof J) | |
for (h = b.$, null !== h && (h = d.oa(h), null !== h && (g.$ = h)), h = b.ba, null !== h && (h = d.oa(h), null !== h && (g.ba = h)), b = b.Cf; b.next();) h = Rh(a, b.value, c, d, e), null !== h && h instanceof G && (h.Yb = g); | |
return g | |
} | |
qa.prototype.copySelection = function() { | |
var a = this.g; | |
if (null !== a) { | |
for (var b = new L(F), a = a.selection.j; a.next();) Qh(b, a.value, !0, this.rI ? Infinity : 0, this.pI, function(a) { | |
return a.canCopy() | |
}); | |
this.copyToClipboard(b) | |
} | |
}; | |
qa.prototype.canCopySelection = function() { | |
var a = this.g; | |
return null !== a && a.Qk && a.CA && 0 !== a.selection.count ? !0 : !1 | |
}; | |
qa.prototype.cutSelection = function() { | |
this.copySelection(); | |
this.deleteSelection() | |
}; | |
qa.prototype.canCutSelection = function() { | |
var a = this.g; | |
return null !== a && !a.qb && !a.Mf && a.Qk && a.En && a.CA && 0 !== a.selection.count ? !0 : !1 | |
}; | |
qa.prototype.copyToClipboard = function(a) { | |
var b = this.g; | |
if (null !== b) { | |
var c = null; | |
if (null === a) Nh = null, Oh = ""; | |
else { | |
var c = b.da, | |
d = !1, | |
e = !1, | |
g = null; | |
try { | |
if (c instanceof Bg) { | |
var h = c, | |
d = h.Mn; | |
h.Mn = this.kF | |
} | |
c instanceof Y && (h = c, e = h.Ln, h.Ln = this.jF); | |
g = b.hq(a, null, !0) | |
} finally { | |
c instanceof Bg && (c.Mn = d), c instanceof Y && (c.Ln = e), c = new K(F), c.Vc(g), Nh = c, Oh = b.da.om | |
} | |
} | |
b.Ja("ClipboardChanged", c) | |
} | |
}; | |
qa.prototype.pasteFromClipboard = function() { | |
var a = new L(F), | |
b = Nh; | |
if (null === b) return a; | |
var c = this.g; | |
if (null === c || Oh !== c.da.om) return a; | |
var d = c.da, | |
e = !1, | |
g = !1, | |
h = null; | |
try { | |
if (d instanceof Bg) { | |
var k = d, | |
e = k.Mn; | |
k.Mn = this.kF | |
} | |
d instanceof Y && (k = d, g = k.Ln, k.Ln = this.jF); | |
h = c.hq(b, c, !1) | |
} finally { | |
for (d instanceof Bg && (d.Mn = e), d instanceof Y && (d.Ln = g), b = h.j; b.next();) c = b.value, d = b.key, c.location.H() || (d.location.H() ? c.location = d.location : !c.position.H() && d.position.H() && (c.position = d.position)), a.add(c) | |
} | |
return a | |
}; | |
qa.prototype.pasteSelection = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null !== b) try { | |
b.sc = "wait"; | |
b.Nb("Paste"); | |
b.Ja("ChangingSelection"); | |
var c = this.pasteFromClipboard(); | |
0 < c.count && Th(b); | |
for (var d = c.j; d.next();) d.value.jb = !0; | |
b.Ja("ChangedSelection"); | |
if (null !== a) { | |
var e = b.computePartsBounds(b.selection); | |
if (e.H()) { | |
var g = b.ob.Ge; | |
null === g && (g = new Uh, g.ad(b)); | |
var h = g.computeEffectiveCollection(b.selection); | |
g.moveParts(h, new N(a.x - e.pa, a.y - e.va), !1) | |
} | |
} | |
b.Ja("ClipboardPasted", c) | |
} finally { | |
b.jd("Paste"), b.sc = | |
"" | |
} | |
}; | |
qa.prototype.canPasteSelection = function() { | |
var a = this.g; | |
return null === a || a.qb || a.Mf || !a.Zp || !a.CA || null === Nh || 0 === Nh.count || Oh !== a.da.om ? !1 : !0 | |
}; | |
qa.prototype.undo = function() { | |
var a = this.g; | |
null !== a && a.na.undo() | |
}; | |
qa.prototype.canUndo = function() { | |
var a = this.g; | |
return null === a || a.qb || a.Mf ? !1 : a.WE && a.na.canUndo() | |
}; | |
qa.prototype.redo = function() { | |
var a = this.g; | |
null !== a && a.na.redo() | |
}; | |
qa.prototype.canRedo = function() { | |
var a = this.g; | |
return null === a || a.qb || a.Mf ? !1 : a.WE && a.na.canRedo() | |
}; | |
qa.prototype.decreaseZoom = function(a) { | |
void 0 === a && (a = 1 / this.Zy); | |
D.p(a, qa, "decreaseZoom:factor"); | |
var b = this.g; | |
null !== b && b.jm === Vh && (a *= b.scale, a < b.Sh || a > b.Rh || (b.scale = a)) | |
}; | |
qa.prototype.canDecreaseZoom = function(a) { | |
void 0 === a && (a = 1 / this.Zy); | |
D.p(a, qa, "canDecreaseZoom:factor"); | |
var b = this.g; | |
if (null === b || b.jm !== Vh) return !1; | |
a *= b.scale; | |
return a < b.Sh || a > b.Rh ? !1 : b.Gx | |
}; | |
qa.prototype.increaseZoom = function(a) { | |
void 0 === a && (a = this.Zy); | |
D.p(a, qa, "increaseZoom:factor"); | |
var b = this.g; | |
null !== b && b.jm === Vh && (a *= b.scale, a < b.Sh || a > b.Rh || (b.scale = a)) | |
}; | |
qa.prototype.canIncreaseZoom = function(a) { | |
void 0 === a && (a = this.Zy); | |
D.p(a, qa, "canIncreaseZoom:factor"); | |
var b = this.g; | |
if (null === b || b.jm !== Vh) return !1; | |
a *= b.scale; | |
return a < b.Sh || a > b.Rh ? !1 : b.Gx | |
}; | |
qa.prototype.resetZoom = function(a) { | |
void 0 === a && (a = this.Px); | |
D.p(a, qa, "resetZoom:newscale"); | |
var b = this.g; | |
null === b || a < b.Sh || a > b.Rh || (b.scale = a) | |
}; | |
qa.prototype.canResetZoom = function(a) { | |
void 0 === a && (a = this.Px); | |
D.p(a, qa, "canResetZoom:newscale"); | |
var b = this.g; | |
return null === b || a < b.Sh || a > b.Rh ? !1 : b.Gx | |
}; | |
qa.prototype.zoomToFit = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.scale, | |
c = a.position; | |
b === this.BA && !isNaN(this.$z) && a.kd.O(this.AA) ? (a.scale = this.$z, a.position = this.ND, this.BA = NaN, this.AA = Ld) : (this.$z = b, this.ND = c.copy(), a.zoomToFit(), this.BA = a.scale, this.AA = a.kd.copy()) | |
} | |
}; | |
qa.prototype.canZoomToFit = function() { | |
var a = this.g; | |
return null === a ? !1 : a.Gx | |
}; | |
qa.prototype.scrollToPart = function(a) { | |
void 0 === a && (a = null); | |
null !== a && D.l(a, F, qa, "part"); | |
var b = this.g; | |
if (null !== b) { | |
if (null === a) { | |
try { | |
null !== this.uj && (this.uj.next() ? a = this.uj.value : this.uj = null) | |
} catch (c) { | |
this.uj = null | |
} | |
null === a && (0 < b.wm.count ? this.uj = b.wm.j : 0 < b.selection.count && (this.uj = b.selection.j), null !== this.uj && this.uj.next() && (a = this.uj.value)) | |
} | |
if (null !== a) { | |
var d = b.Ra; | |
d.ro("Scroll To Part"); | |
var e = this.lK; | |
if (0 < e) { | |
var g = Wh(this, a, [a]), | |
h = function() { | |
b.Nb(); | |
for (var a = g.pop(); 0 < g.length && a instanceof G && a.Dc && (!(a instanceof I) || a.md);) a = g.pop(); | |
0 < g.length ? (a instanceof F && b.UG(a.aa), a instanceof G && !a.Dc && (a.Dc = !0), a instanceof I && !a.md && (a.md = !0)) : (a instanceof F && b.cF(a.aa), b.PB("LayoutCompleted", k)); | |
b.jd("Scroll To Part") | |
}, | |
k = function() { | |
setTimeout(h, (d.isEnabled ? d.duration : 0) + e) | |
}; | |
b.yx("LayoutCompleted", k); | |
h() | |
} else { | |
var l = b.position.copy(); | |
b.cF(a.aa); | |
l.Wc(b.position) && d.Yh() | |
} | |
} | |
} | |
}; | |
function Wh(a, b, c) { | |
if (b.isVisible()) return c; | |
if (b instanceof da) Wh(a, b.hf, c); | |
else if (b instanceof J) { | |
var d = b.$; | |
null !== d && Wh(a, d, c); | |
b = b.ba; | |
null !== b && Wh(a, b, c) | |
} else b instanceof G && (d = b.Yb, null !== d && Wh(a, d, c), d = b.Zk(), null !== d && (d.Dc || d.br || c.push(d), Wh(a, d, c))), b = b.Ka, null !== b && (b.md || b.Yy || c.push(b), Wh(a, b, c)); | |
return c | |
} | |
qa.prototype.canScrollToPart = function(a) { | |
void 0 === a && (a = null); | |
if (null !== a && !(a instanceof F)) return !1; | |
a = this.g; | |
return null === a || 0 === a.selection.count && 0 === a.wm.count ? !1 : a.Be && a.Ce | |
}; | |
qa.prototype.collapseTree = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null !== b) try { | |
b.Nb("Collapse Tree"); | |
b.Ra.ro("Collapse Tree"); | |
var c = new K(G); | |
if (null !== a && a.Dc) a.collapseTree(), c.add(a); | |
else | |
for (var d = b.selection.j; d.next();) { | |
var e = d.value; | |
e instanceof G && (a = e, a.Dc && (a.collapseTree(), c.add(a))) | |
} | |
b.Ja("TreeCollapsed", c) | |
} finally { | |
b.jd("Collapse Tree") | |
} | |
}; | |
qa.prototype.canCollapseTree = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null === b || b.qb) return !1; | |
if (null !== a) { | |
if (!(a instanceof G && a.Dc)) return !1; | |
if (0 < a.Zx().count) return !0 | |
} else | |
for (a = b.selection.j; a.next();) | |
if (b = a.value, b instanceof G && b.Dc && 0 < b.Zx().count) return !0; | |
return !1 | |
}; | |
qa.prototype.expandTree = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null !== b) try { | |
b.Nb("Expand Tree"); | |
b.Ra.ro("Expand Tree"); | |
var c = new K(G); | |
if (null === a || a.Dc) | |
for (var d = b.selection.j; d.next();) { | |
var e = d.value; | |
e instanceof G && (a = e, a.Dc || (a.expandTree(), c.add(a))) | |
} else a.expandTree(), c.add(a); | |
b.Ja("TreeExpanded", c) | |
} finally { | |
b.jd("Expand Tree") | |
} | |
}; | |
qa.prototype.canExpandTree = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null === b || b.qb) return !1; | |
if (null !== a) { | |
if (!(a instanceof G) || a.Dc) return !1; | |
if (0 < a.Zx().count) return !0 | |
} else | |
for (a = b.selection.j; a.next();) | |
if (b = a.value, b instanceof G && !b.Dc && 0 < b.Zx().count) return !0; | |
return !1 | |
}; | |
qa.prototype.groupSelection = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.da; | |
if (b instanceof Y) { | |
var c = this.XE; | |
if (null !== c) { | |
var d = null; | |
try { | |
a.sc = "wait"; | |
a.Nb("Group"); | |
a.Ja("ChangingSelection"); | |
for (var e = new K(F), g = a.selection.j; g.next();) { | |
var h = g.value; | |
h.re() && h.canGroup() && e.add(h) | |
} | |
for (var k = new K(F), l = e.j; l.next();) { | |
for (var m = l.value, g = !1, n = e.j; n.next();) | |
if (m.Fi(n.value)) { | |
g = !0; | |
break | |
} | |
g || k.add(m) | |
} | |
if (0 < k.count) { | |
var p = k.first().Ka; | |
if (null !== p) | |
for (; null !== p;) { | |
for (var e = !1, q = k.j; q.next();) | |
if (!q.value.Fi(p)) { | |
e = !0; | |
break | |
} | |
if (e) p = p.Ka; | |
else break | |
} | |
if (c instanceof I) Sh(c), d = c.copy(), null !== d && a.add(d); | |
else if (b.qB(c)) { | |
var r = b.copyNodeData(c); | |
D.Qa(r) && (b.em(r), d = a.Yx(r)) | |
} | |
if (null !== d) { | |
null !== p && this.isValidMember(p, d) && (d.Ka = p); | |
for (var s = k.j; s.next();) { | |
var u = s.value; | |
this.isValidMember(d, u) && (u.Ka = d) | |
} | |
a.select(d) | |
} | |
} | |
a.Ja("ChangedSelection"); | |
a.Ja("SelectionGrouped", d) | |
} finally { | |
a.jd("Group"), a.sc = "" | |
} | |
} | |
} | |
} | |
}; | |
qa.prototype.canGroupSelection = function() { | |
var a = this.g; | |
if (null === a || a.qb || a.Mf || !a.Zp || !a.Bx || !(a.da instanceof Y) || null === this.XE) return !1; | |
for (a = a.selection.j; a.next();) { | |
var b = a.value; | |
if (b.re() && b.canGroup()) return !0 | |
} | |
return !1 | |
}; | |
function Xh(a) { | |
var b = D.nb(); | |
for (a = a.j; a.next();) { | |
var c = a.value; | |
c instanceof J || b.push(c) | |
} | |
a = new L(F); | |
for (var c = b.length, d = 0; d < c; d++) { | |
for (var e = b[d], g = !0, h = 0; h < c; h++) | |
if (e.Fi(b[h])) { | |
g = !1; | |
break | |
} | |
g && a.add(e) | |
} | |
D.ya(b); | |
return a | |
} | |
qa.prototype.isValidMember = function(a, b) { | |
if (null === b || a === b || b instanceof J) return !1; | |
if (null !== a) { | |
if (a === b || a.Fi(b)) return !1; | |
var c = a.AB; | |
if (null !== c && !c(a, b) || null === a.data && null !== b.data || null !== a.data && null === b.data) return !1 | |
} | |
c = this.AB; | |
return null !== c ? c(a, b) : !0 | |
}; | |
qa.prototype.ungroupSelection = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null !== b) { | |
var c = b.da; | |
if (c instanceof Y) try { | |
b.sc = "wait"; | |
b.Nb("Ungroup"); | |
b.Ja("ChangingSelection"); | |
var d = new K(I); | |
if (null !== a) d.add(a); | |
else | |
for (var e = b.selection.j; e.next();) { | |
var g = e.value; | |
g instanceof I && (a = g, a.canUngroup() && d.add(a)) | |
} | |
if (0 < d.count) { | |
b.Jx(); | |
for (var h = d.j; h.next();) { | |
var k = h.value; | |
k.expandSubGraph(); | |
var l = k.Ka, | |
m = null !== l && null !== l.data ? c.zb(l.data) : void 0, | |
n = new K(F); | |
n.Vc(k.uc); | |
for (var p = n.j; p.next();) { | |
var q = | |
p.value; | |
q.jb = !0; | |
if (!(q instanceof J)) { | |
var r = q.data; | |
null !== r ? c.ZB(r, m) : q.Ka = l | |
} | |
} | |
b.remove(k) | |
} | |
} | |
b.Ja("ChangedSelection"); | |
b.Ja("SelectionUngrouped", d, n) | |
} finally { | |
b.jd("Ungroup"), b.sc = "" | |
} | |
} | |
}; | |
qa.prototype.canUngroupSelection = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null === b || b.qb || b.Mf || !b.En || !b.Fx || !(b.da instanceof Y)) return !1; | |
if (null !== a) { | |
if (!(a instanceof I)) return !1; | |
if (a.canUngroup()) return !0 | |
} else | |
for (a = b.selection.j; a.next();) | |
if (b = a.value, b instanceof I && b.canUngroup()) return !0; | |
return !1 | |
}; | |
qa.prototype.addTopLevelParts = function(a, b) { | |
for (var c = !0, d = Xh(a).j; d.next();) { | |
var e = d.value; | |
null !== e.Ka && (!b || this.isValidMember(null, e) ? e.Ka = null : c = !1) | |
} | |
return c | |
}; | |
qa.prototype.collapseSubGraph = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null !== b) try { | |
b.Nb("Collapse SubGraph"); | |
b.Ra.ro("Collapse SubGraph"); | |
var c = new K(I); | |
if (null !== a && a.md) a.collapseSubGraph(), c.add(a); | |
else | |
for (var d = b.selection.j; d.next();) { | |
var e = d.value; | |
e instanceof I && (a = e, a.md && (a.collapseSubGraph(), c.add(a))) | |
} | |
b.Ja("SubGraphCollapsed", c) | |
} finally { | |
b.jd("Collapse SubGraph") | |
} | |
}; | |
qa.prototype.canCollapseSubGraph = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null === b || b.qb) return !1; | |
if (null !== a) return a instanceof I && a.md ? !0 : !1; | |
for (a = b.selection.j; a.next();) | |
if (b = a.value, b instanceof I && b.md) return !0; | |
return !1 | |
}; | |
qa.prototype.expandSubGraph = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null !== b) try { | |
b.Nb("Expand SubGraph"); | |
b.Ra.ro("Expand SubGraph"); | |
var c = new K(I); | |
if (null === a || a.md) | |
for (var d = b.selection.j; d.next();) { | |
var e = d.value; | |
e instanceof I && (a = e, a.md || (a.expandSubGraph(), c.add(a))) | |
} else a.expandSubGraph(), c.add(a); | |
b.Ja("SubGraphExpanded", c) | |
} finally { | |
b.jd("Expand SubGraph") | |
} | |
}; | |
qa.prototype.canExpandSubGraph = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null === b || b.qb) return !1; | |
if (null !== a) return a instanceof I && !a.md ? !0 : !1; | |
for (a = b.selection.j; a.next();) | |
if (b = a.value, b instanceof I && !b.md) return !0; | |
return !1 | |
}; | |
qa.prototype.editTextBlock = function(a) { | |
void 0 === a && (a = null); | |
null !== a && D.l(a, pa, qa, "editTextBlock"); | |
var b = this.g; | |
if (null !== b) { | |
var c = b.ob.hC; | |
if (null !== c) { | |
if (null === a) { | |
a = null; | |
for (var d = b.selection.j; d.next();) { | |
var e = d.value; | |
if (e.canEdit()) { | |
a = e; | |
break | |
} | |
} | |
if (null === a) return; | |
a = a.qu(function(a) { | |
return a instanceof pa && a.VA | |
}) | |
} | |
null !== a && (b.eb = null, c.ih = a, b.eb = c) | |
} | |
} | |
}; | |
qa.prototype.canEditTextBlock = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null === b || b.qb || b.Mf || !b.Ex || null === b.ob.hC) return !1; | |
if (null !== a) { | |
if (!(a instanceof pa)) return !1; | |
a = a.Y; | |
if (null !== a && a.canEdit()) return !0 | |
} else | |
for (b = b.selection.j; b.next();) | |
if (a = b.value, a.canEdit() && (a = a.qu(function(a) { | |
return a instanceof pa && a.VA | |
}), null !== a)) return !0; | |
return !1 | |
}; | |
qa.prototype.showContextMenu = function(a) { | |
var b = this.g; | |
if (null !== b) { | |
var c = b.ob.LA; | |
if (null !== c && (void 0 === a && (a = 0 < b.selection.count ? b.selection.first() : b), a = c.findObjectWithContextMenu(a), null !== a)) { | |
var d = new bg, | |
e = null; | |
a instanceof O ? e = a.fb(mc) : b.pJ || (e = b.wb, e = new N(e.x + e.width / 2, e.y + e.height / 2)); | |
null !== e && (d.g = b, d.Sd = b.wv(e), d.ha = e, d.left = !1, d.right = !0, d.up = !0, b.U = d); | |
b.eb = c; | |
Yh(c, !1, a) | |
} | |
} | |
}; | |
qa.prototype.canShowContextMenu = function(a) { | |
var b = this.g; | |
if (null === b) return !1; | |
var c = b.ob.LA; | |
if (null === c) return !1; | |
void 0 === a && (a = 0 < b.selection.count ? b.selection.first() : b); | |
return null === c.findObjectWithContextMenu(a) ? !1 : !0 | |
}; | |
D.defineProperty(qa, { | |
oI: "copiesClipboardData" | |
}, function() { | |
return this.OC | |
}, function(a) { | |
D.h(a, "boolean", qa, "copiesClipboardData"); | |
this.OC = a | |
}); | |
D.defineProperty(qa, { | |
pI: "copiesConnectedLinks" | |
}, function() { | |
return this.PC | |
}, function(a) { | |
D.h(a, "boolean", qa, "copiesConnectedLinks"); | |
this.PC = a | |
}); | |
D.defineProperty(qa, { | |
tF: "deletesConnectedLinks" | |
}, function() { | |
return this.iD | |
}, function(a) { | |
D.h(a, "boolean", qa, "deletesConnectedLinks"); | |
this.iD = a | |
}); | |
D.defineProperty(qa, { | |
rI: "copiesTree" | |
}, function() { | |
return this.TC | |
}, function(a) { | |
D.h(a, "boolean", qa, "copiesTree"); | |
this.TC = a | |
}); | |
D.defineProperty(qa, { | |
wI: "deletesTree" | |
}, function() { | |
return this.jD | |
}, function(a) { | |
D.h(a, "boolean", qa, "deletesTree"); | |
this.jD = a | |
}); | |
D.defineProperty(qa, { | |
kF: "copiesParentKey" | |
}, function() { | |
return this.SC | |
}, function(a) { | |
D.h(a, "boolean", qa, "copiesParentKey"); | |
this.SC = a | |
}); | |
D.defineProperty(qa, { | |
jF: "copiesGroupKey" | |
}, function() { | |
return this.RC | |
}, function(a) { | |
D.h(a, "boolean", qa, "copiesGroupKey"); | |
this.RC = a | |
}); | |
D.defineProperty(qa, { | |
XE: "archetypeGroupData" | |
}, function() { | |
return this.mz | |
}, function(a) { | |
null !== a && D.l(a, Object, qa, "archetypeGroupData"); | |
var b = this.g; | |
null !== b && (b = b.da, b instanceof Y && (a instanceof I || b.qB(a) || D.k("CommandHandler.archetypeGroupData must be either a Group or a data object for which GraphLinksModel.isGroupForNodeData is true: " + a))); | |
this.mz = a | |
}); | |
D.defineProperty(qa, { | |
AB: "memberValidation" | |
}, function() { | |
return this.Sl | |
}, function(a) { | |
null !== a && D.h(a, "function", qa, "memberValidation"); | |
this.Sl = a | |
}); | |
D.defineProperty(qa, { | |
Px: "defaultScale" | |
}, function() { | |
return this.fD | |
}, function(a) { | |
D.p(a, qa, "defaultScale"); | |
0 < a || D.k("defaultScale must be larger than zero, not: " + a); | |
this.fD = a | |
}); | |
D.defineProperty(qa, { | |
Zy: "zoomFactor" | |
}, function() { | |
return this.NE | |
}, function(a) { | |
D.p(a, qa, "zoomFactor"); | |
1 < a || D.k("zoomFactor must be larger than 1.0, not: " + a); | |
this.NE = a | |
}); | |
D.defineProperty(qa, { | |
lK: "scrollToPartPause" | |
}, function() { | |
return this.lE | |
}, function(a) { | |
D.p(a, qa, "scrollToPartPause"); | |
this.lE = a | |
}); | |
function Zg() { | |
0 < arguments.length && D.zd(Zg); | |
D.xc(this); | |
this.ea = null; | |
this.ac = ""; | |
this.tf = !0; | |
this.zD = !1; | |
this.HE = null; | |
this.wx = -1 | |
} | |
D.ka("Tool", Zg); | |
Zg.prototype.ad = function(a) { | |
v && null !== a && D.l(a, E, Zg, "setDiagram"); | |
this.ea = a | |
}; | |
Zg.prototype.toString = function() { | |
return "" !== this.name ? this.name + " Tool" : D.yf(Object.getPrototypeOf(this)) | |
}; | |
Zg.prototype.updateAdornments = function() {}; | |
Zg.prototype.canStart = function() { | |
return this.isEnabled | |
}; | |
Zg.prototype.doStart = function() {}; | |
Zg.prototype.doActivate = function() { | |
this.wa = !0 | |
}; | |
Zg.prototype.doDeactivate = function() { | |
this.wa = !1 | |
}; | |
Zg.prototype.doStop = function() {}; | |
Zg.prototype.doCancel = function() { | |
this.stopTool() | |
}; | |
Zg.prototype.stopTool = function() { | |
var a = this.g; | |
null !== a && a.eb === this && (a.eb = null, a.sc = "") | |
}; | |
Zg.prototype.doMouseDown = function() { | |
!this.wa && this.canStart() && this.doActivate() | |
}; | |
Zg.prototype.doMouseMove = function() {}; | |
Zg.prototype.doMouseUp = function() { | |
this.stopTool() | |
}; | |
Zg.prototype.doMouseWheel = function() {}; | |
Zg.prototype.canStartMultiTouch = function() { | |
return !0 | |
}; | |
Zg.prototype.standardPinchZoomStart = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.U, | |
c = b.ay(0, D.Fb(NaN, NaN)), | |
d = b.ay(1, D.Fb(NaN, NaN)); | |
if (c.H() && d.H() && (this.doCancel(), a.Cu("hasGestureZoom"))) { | |
a.ZD = a.scale; | |
var e = d.x - c.x, | |
g = d.y - c.y; | |
a.qE = Math.sqrt(e * e + g * g); | |
b.bubbles = !1 | |
} | |
D.A(c); | |
D.A(d) | |
} | |
}; | |
Zg.prototype.standardPinchZoomMove = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.U, | |
c = b.ay(0, D.Fb(NaN, NaN)), | |
d = b.ay(1, D.Fb(NaN, NaN)); | |
if (c.H() && d.H() && (this.doCancel(), a.Cu("hasGestureZoom"))) { | |
var e = d.x - c.x, | |
g = d.y - c.y, | |
g = Math.sqrt(e * e + g * g) / a.qE, | |
e = new N((Math.min(d.x, c.x) + Math.max(d.x, c.x)) / 2, (Math.min(d.y, c.y) + Math.max(d.y, c.y)) / 2), | |
g = a.ZD * g, | |
h = a.yb; | |
if (g !== a.scale && h.canResetZoom(g)) { | |
var k = a.Lm; | |
a.Lm = e; | |
h.resetZoom(g); | |
a.Lm = k | |
} | |
b.bubbles = !1 | |
} | |
D.A(c); | |
D.A(d) | |
} | |
}; | |
Zg.prototype.doKeyDown = function() { | |
var a = this.g; | |
null !== a && "Esc" === a.U.key && this.doCancel() | |
}; | |
Zg.prototype.doKeyUp = function() {}; | |
Zg.prototype.startTransaction = Zg.prototype.Nb = function(a) { | |
void 0 === a && (a = this.name); | |
this.Tf = null; | |
var b = this.g; | |
return null === b ? !1 : b.Nb(a) | |
}; | |
Zg.prototype.stopTransaction = Zg.prototype.ll = function() { | |
var a = this.g; | |
return null === a ? !1 : null === this.Tf ? a.Bm() : a.jd(this.Tf) | |
}; | |
Zg.prototype.standardMouseSelect = function() { | |
var a = this.g; | |
if (null !== a && a.Jf) { | |
var b = a.U, | |
c = a.su(b.ha, !1); | |
if (null !== c) | |
if (D.Qh ? b.Xu : b.control) { | |
a.Ja("ChangingSelection"); | |
for (b = c; null !== b && !b.canSelect();) b = b.Ka; | |
null !== b && (b.jb = !b.jb); | |
a.Ja("ChangedSelection") | |
} else if (b.shift) { | |
if (!c.jb) { | |
a.Ja("ChangingSelection"); | |
for (b = c; null !== b && !b.canSelect();) b = b.Ka; | |
null !== b && (b.jb = !0); | |
a.Ja("ChangedSelection") | |
} | |
} else { | |
if (!c.jb) { | |
for (b = c; null !== b && !b.canSelect();) b = b.Ka; | |
null !== b && a.select(b) | |
} | |
} else !b.left || (D.Qh ? b.Xu : b.control) || | |
b.shift || a.Jx() | |
} | |
}; | |
Zg.prototype.standardMouseClick = function(a, b) { | |
void 0 === a && (a = null); | |
void 0 === b && (b = function(a) { | |
return !a.layer.Yc | |
}); | |
var c = this.g; | |
if (null === c) return !1; | |
var d = c.U, | |
e = c.Je(d.ha, a, b); | |
d.Oe = e; | |
Zh(e, d, c); | |
return d.Cc | |
}; | |
function Zh(a, b, c) { | |
b.Cc = !1; | |
if (null === a || a.Ju()) { | |
var d = 0; | |
b.left ? d = 1 === b.Ee ? 1 : 2 === b.Ee ? 2 : 1 : b.right && 1 === b.Ee && (d = 3); | |
var e = ""; | |
if (null !== a) { | |
switch (d) { | |
case 1: | |
e = "ObjectSingleClicked"; | |
break; | |
case 2: | |
e = "ObjectDoubleClicked"; | |
break; | |
case 3: | |
e = "ObjectContextClicked" | |
} | |
0 !== d && c.Ja(e, a) | |
} else { | |
switch (d) { | |
case 1: | |
e = "BackgroundSingleClicked"; | |
break; | |
case 2: | |
e = "BackgroundDoubleClicked"; | |
break; | |
case 3: | |
e = "BackgroundContextClicked" | |
} | |
0 !== d && c.Ja(e) | |
} | |
if (null !== a) | |
for (; null !== a;) { | |
c = null; | |
switch (d) { | |
case 1: | |
c = a.click; | |
break; | |
case 2: | |
c = a.nu ? a.nu : | |
a.click; | |
break; | |
case 3: | |
c = a.KA | |
} | |
if (null !== c && (c(b, a), b.Cc)) break; | |
a = a.R | |
} else { | |
a = null; | |
switch (d) { | |
case 1: | |
a = c.click; | |
break; | |
case 2: | |
a = c.nu ? c.nu : c.click; | |
break; | |
case 3: | |
a = c.KA | |
} | |
null !== a && a(b) | |
} | |
} | |
} | |
Zg.prototype.standardMouseOver = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.U; | |
if (null !== b.g && !0 !== a.Ra.zc) { | |
var c = a.lb; | |
a.lb = !0; | |
var d = a.th ? a.Je(b.ha, null, null) : null; | |
b.Oe = d; | |
var e = !1; | |
if (d !== a.Qo) { | |
var g = a.Qo, | |
h = g; | |
a.Qo = d; | |
this.doCurrentObjectChanged(g, d); | |
for (b.Cc = !1; null !== g;) { | |
var k = g.Zu; | |
if (null !== k) { | |
if (d === g) break; | |
if (null !== d && d.ym(g)) break; | |
k(b, g, d); | |
e = !0; | |
if (b.Cc) break | |
} | |
g = g.R | |
} | |
g = h; | |
for (b.Cc = !1; null !== d;) { | |
k = d.Yu; | |
if (null !== k) { | |
if (g === d) break; | |
if (null !== g && g.ym(d)) break; | |
k(b, d, g); | |
e = !0; | |
if (b.Cc) break | |
} | |
d = d.R | |
} | |
d = a.Qo | |
} | |
if (null !== | |
d) { | |
g = d; | |
for (h = ""; null !== g;) { | |
h = g.cursor; | |
if ("" !== h) break; | |
g = g.R | |
} | |
a.sc = h; | |
b.Cc = !1; | |
for (g = d; null !== g;) { | |
d = g.EB; | |
if (null !== d && (d(b, g), e = !0, b.Cc)) break; | |
g = g.R | |
} | |
} else a.sc = "", d = a.EB, null !== d && (d(b), e = !0); | |
e && a.Le(); | |
a.lb = c | |
} | |
} | |
}; | |
Zg.prototype.doCurrentObjectChanged = function() {}; | |
Zg.prototype.standardMouseWheel = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.U, | |
c = b.Vk; | |
if (0 !== c && a.kd.H()) { | |
var d = a.yb, | |
e = a.ob.$u; | |
if ((e === $h && !b.shift || e === ai && b.control) && (0 < c ? d.canIncreaseZoom() : d.canDecreaseZoom())) e = a.Lm, a.Lm = b.Sd, 0 < c ? d.increaseZoom() : d.decreaseZoom(), a.Lm = e, b.bubbles = !1; | |
else if (e === $h && b.shift || e === ai && !b.control) { | |
var d = a.position.copy(), | |
e = 0 < c ? c : -c, | |
g = b.event.deltaMode, | |
h = b.event.deltaX, | |
k = b.event.deltaY, | |
l = "pixel"; | |
if (D.zq || D.Aq || D.pB) g = 1, 0 < h && (h = 3), 0 > h && (h = -3), 0 < k && (k = 3), 0 > k && (k = -3); | |
if (void 0 === g || void 0 === h || void 0 === k || 0 === h && 0 === k || b.shift) !b.shift && a.Ce ? (g = a.mv, e = 3 * e * g, 0 < c ? a.scroll("pixel", "up", e) : a.scroll("pixel", "down", e)) : b.shift && a.Be && (g = a.lv, e = 3 * e * g, 0 < c ? a.scroll("pixel", "left", e) : a.scroll("pixel", "right", e)); | |
else { | |
switch (g) { | |
case 0: | |
l = "pixel"; | |
break; | |
case 1: | |
l = "line"; | |
break; | |
case 2: | |
l = "page"; | |
break; | |
default: | |
l = "pixel" | |
} | |
0 !== h && a.Be && (0 < h ? a.scroll(l, "left", -h) : a.scroll(l, "right", h)); | |
0 !== k && a.Ce && (0 < k ? a.scroll(l, "up", -k) : a.scroll(l, "down", k)) | |
} | |
a.position.O(d) || (b.bubbles = !1) | |
} | |
} | |
} | |
}; | |
Zg.prototype.standardWaitAfter = function(a, b) { | |
D.h(a, "number", Zg, "standardWaitAfter:delay"); | |
this.cancelWaitAfter(); | |
var c = this, | |
d = b.copy(); | |
this.wx = D.setTimeout(function() { | |
c.doWaitAfter(d) | |
}, a) | |
}; | |
Zg.prototype.cancelWaitAfter = function() { | |
-1 !== this.wx && D.clearTimeout(this.wx); | |
this.wx = -1 | |
}; | |
Zg.prototype.doWaitAfter = function() {}; | |
Zg.prototype.findToolHandleAt = function(a, b) { | |
var c = this.g; | |
if (null === c) return null; | |
c = c.Je(a, function(a) { | |
for (; null !== a && !(a.R instanceof da);) a = a.R; | |
return a | |
}); | |
return null === c ? null : c.Y.Ld === b ? c : null | |
}; | |
Zg.prototype.isBeyondDragSize = function(a, b) { | |
var c = this.g; | |
if (null === c) return !1; | |
void 0 === a && (a = c.Pc.Sd); | |
void 0 === b && (b = c.U.Sd); | |
var d = c.ob.AI, | |
e = d.width, | |
d = d.height; | |
c.Pc.Qj && (e += 6, d += 6); | |
return Math.abs(b.x - a.x) > e || Math.abs(b.y - a.y) > d | |
}; | |
D.w(Zg, { | |
g: "diagram" | |
}, function() { | |
return this.ea | |
}); | |
D.defineProperty(Zg, { | |
name: "name" | |
}, function() { | |
return this.ac | |
}, function(a) { | |
D.h(a, "string", Zg, "name"); | |
this.ac = a | |
}); | |
D.defineProperty(Zg, { | |
isEnabled: "isEnabled" | |
}, function() { | |
return this.tf | |
}, function(a) { | |
D.h(a, "boolean", Zg, "isEnabled"); | |
this.tf = a | |
}); | |
D.defineProperty(Zg, { | |
wa: "isActive" | |
}, function() { | |
return this.zD | |
}, function(a) { | |
D.h(a, "boolean", Zg, "isActive"); | |
this.zD = a | |
}); | |
D.defineProperty(Zg, { | |
Tf: "transactionResult" | |
}, function() { | |
return this.HE | |
}, function(a) { | |
null !== a && D.h(a, "string", Zg, "transactionResult"); | |
this.HE = a | |
}); | |
function Uh() { | |
Zg.call(this); | |
0 < arguments.length && D.zd(Uh); | |
this.name = "Dragging"; | |
this.QC = this.DD = !0; | |
this.os = this.oD = !1; | |
this.HD = !0; | |
this.Qz = (new Ca(NaN, NaN)).freeze(); | |
this.Rz = ec; | |
this.Sz = (new N(NaN, NaN)).freeze(); | |
this.nD = !1; | |
this.Nw = this.Mw = this.Gz = this.NC = this.mD = this.YC = this.sj = null; | |
this.Vr = this.FD = !1; | |
this.Np = new N(NaN, NaN); | |
this.lx = new N; | |
this.ox = !1; | |
this.CD = !0; | |
this.Wo = 100; | |
this.jk = []; | |
this.DH = (new L(F)).freeze() | |
} | |
D.Ta(Uh, Zg); | |
D.ka("DraggingTool", Uh); | |
D.defineProperty(Uh, { | |
eG: "isCopyEnabled" | |
}, function() { | |
return this.DD | |
}, function(a) { | |
D.h(a, "boolean", Uh, "isCopyEnabled"); | |
this.DD = a | |
}); | |
D.defineProperty(Uh, { | |
qI: "copiesEffectiveCollection" | |
}, function() { | |
return this.QC | |
}, function(a) { | |
D.h(a, "boolean", Uh, "copiesEffectiveCollection"); | |
this.QC = a | |
}); | |
D.defineProperty(Uh, { | |
BI: "dragsTree" | |
}, function() { | |
return this.oD | |
}, function(a) { | |
D.h(a, "boolean", Uh, "dragsTree"); | |
this.oD = a | |
}); | |
D.defineProperty(Uh, { | |
Lu: "isGridSnapEnabled" | |
}, function() { | |
return this.os | |
}, function(a) { | |
D.h(a, "boolean", Uh, "isGridSnapEnabled"); | |
this.os = a | |
}); | |
D.defineProperty(Uh, { | |
kJ: "isComplexRoutingRealtime" | |
}, function() { | |
return this.CD | |
}, function(a) { | |
D.h(a, "boolean", Uh, "isComplexRoutingRealtime"); | |
this.CD = a | |
}); | |
D.defineProperty(Uh, { | |
mJ: "isGridSnapRealtime" | |
}, function() { | |
return this.HD | |
}, function(a) { | |
D.h(a, "boolean", Uh, "isGridSnapRealtime"); | |
this.HD = a | |
}); | |
D.defineProperty(Uh, { | |
VF: "gridSnapCellSize" | |
}, function() { | |
return this.Qz | |
}, function(a) { | |
D.l(a, Ca, Uh, "gridSnapCellSize"); | |
this.Qz.O(a) || (this.Qz = a = a.V()) | |
}); | |
D.defineProperty(Uh, { | |
XI: "gridSnapCellSpot" | |
}, function() { | |
return this.Rz | |
}, function(a) { | |
D.l(a, S, Uh, "gridSnapCellSpot"); | |
this.Rz.O(a) || (this.Rz = a = a.V()) | |
}); | |
D.defineProperty(Uh, { | |
YI: "gridSnapOrigin" | |
}, function() { | |
return this.Sz | |
}, function(a) { | |
D.l(a, N, Uh, "gridSnapOrigin"); | |
this.Sz.O(a) || (this.Sz = a = a.V()) | |
}); | |
D.defineProperty(Uh, { | |
Ij: "dragsLink" | |
}, function() { | |
return this.nD | |
}, function(a) { | |
D.h(a, "boolean", Uh, "dragsLink"); | |
this.nD = a | |
}); | |
D.defineProperty(Uh, { | |
On: "currentPart" | |
}, function() { | |
return this.YC | |
}, function(a) { | |
null !== a && D.l(a, F, Uh, "currentPart"); | |
this.YC = a | |
}); | |
D.defineProperty(Uh, { | |
mc: "copiedParts" | |
}, function() { | |
return this.NC | |
}, function(a) { | |
this.NC = a | |
}); | |
D.defineProperty(Uh, { | |
hc: "draggedParts" | |
}, function() { | |
return this.mD | |
}, function(a) { | |
this.mD = a | |
}); | |
D.w(Uh, { | |
JL: "draggingParts" | |
}, function() { | |
return null !== this.mc ? this.mc.bk() : null !== this.hc ? this.hc.bk() : this.DH | |
}); | |
D.defineProperty(Uh, { | |
wd: "draggedLink" | |
}, function() { | |
return this.Gz | |
}, function(a) { | |
null !== a && D.l(a, J, Uh, "draggedLink"); | |
this.Gz !== a && (this.Gz = a, null !== a ? (this.Mw = a.oc, this.Nw = a.Gc) : this.Nw = this.Mw = null) | |
}); | |
D.defineProperty(Uh, { | |
hy: "isDragOutStarted" | |
}, function() { | |
return this.FD | |
}, function(a) { | |
this.FD = a | |
}); | |
D.defineProperty(Uh, { | |
kl: "startPoint" | |
}, function() { | |
return this.lx | |
}, function(a) { | |
D.l(a, N, Uh, "startPoint"); | |
this.lx.O(a) || (this.lx = a = a.V()) | |
}); | |
D.defineProperty(Uh, { | |
oF: "delay" | |
}, function() { | |
return this.Wo | |
}, function(a) { | |
D.h(a, "number", Uh, "delay"); | |
this.Wo = a | |
}); | |
Uh.prototype.canStart = function() { | |
if (!this.isEnabled) return !1; | |
var a = this.g; | |
if (null === a || a.qb && !a.du || !a.gm && !a.Qk && !a.du || !a.Jf) return !1; | |
var b = a.U; | |
return !b.left || a.eb !== this && (!this.isBeyondDragSize() || b.Qj && b.timestamp - a.Pc.timestamp < this.Wo) ? !1 : null !== this.findDraggablePart() | |
}; | |
Uh.prototype.findDraggablePart = function() { | |
var a = this.g; | |
if (null === a) return null; | |
a = a.su(a.Pc.ha, !1); | |
if (null === a) return null; | |
for (; null !== a && !a.canSelect();) a = a.Ka; | |
return null !== a && (a.canMove() || a.canCopy()) ? a : null | |
}; | |
Uh.prototype.standardMouseSelect = function() { | |
var a = this.g; | |
if (null !== a && a.Jf) { | |
var b = a.su(a.Pc.ha, !1); | |
if (null !== b) { | |
for (; null !== b && !b.canSelect();) b = b.Ka; | |
this.On = b; | |
this.On.jb || (a.Ja("ChangingSelection"), b = a.U, (D.Qh ? b.Xu : b.control) || b.shift || Th(a), this.On.jb = !0, a.Ja("ChangedSelection")) | |
} | |
} | |
}; | |
Uh.prototype.doActivate = function() { | |
var a = this.g; | |
if (null !== a) { | |
null === this.On && this.standardMouseSelect(); | |
var b = this.On; | |
null !== b && (b.canMove() || b.canCopy()) && (this.wa = !0, this.Np.set(a.position), bi(this, a.selection), this.jk.length = 0, this.hc = this.computeEffectiveCollection(a.selection), a.rv = !0, ci(this, this.hc), this.Nb("Drag"), this.kl = a.Pc.ha, a.qf = !0, a.du && (this.hy = !0, this.Vr = !1, di = this, ei = this.g, this.doSimulatedDragOut())) | |
} | |
}; | |
function bi(a, b) { | |
if (a.Ij) { | |
var c = a.g; | |
null !== c && c.Fn && (c.da instanceof Y && 1 === b.count && b.first() instanceof J ? (a.wd = b.first(), a.wd.canRelinkFrom() && a.wd.canRelinkTo() && a.wd.iu(), a.sj = c.ob.FG, null === a.sj && (a.sj = new fi, a.sj.ad(c))) : (a.wd = null, a.sj = null)) | |
} | |
} | |
Uh.prototype.computeEffectiveCollection = function(a) { | |
var b = null !== this.g && this.g.eb === this, | |
c = new na(F); | |
if (null === a) return c; | |
for (var d = a.j; d.next();) gi(this, c, d.value, b); | |
if (null !== this.wd && this.Ij) return c; | |
for (d = a.j; d.next();) a = d.value, a instanceof J && (b = a.$, null === b || c.contains(b) ? (b = a.ba, null === b || c.contains(b) || c.remove(a)) : c.remove(a)); | |
return c | |
}; | |
function hi(a, b) { | |
return void 0 === b ? new qi(Kd) : a.Lu ? new qi(new N(Math.round(b.x), Math.round(b.y))) : new qi(b.copy()) | |
} | |
function gi(a, b, c, d) { | |
if (!b.contains(c) && (!d || c.canMove() || c.canCopy())) | |
if (c instanceof G) { | |
b.add(c, hi(a, c.location)); | |
if (c instanceof I) | |
for (var e = c.uc; e.next();) gi(a, b, e.value, d); | |
for (e = c.Pd; e.next();) { | |
var g = e.value; | |
if (!b.contains(g)) { | |
var h = g.$, | |
k = g.ba; | |
null !== h && b.contains(h) && null !== k && b.contains(k) && gi(a, b, g, d) | |
} | |
} | |
if (a.BI) | |
for (c = c.IF(); c.next();) gi(a, b, c.value, d) | |
} else if (c instanceof J) | |
for (g = c, b.add(g, hi(a)), c = g.Cf; c.next();) gi(a, b, c.value, d); | |
else c instanceof da || b.add(c, hi(a, c.location)) | |
} | |
Uh.prototype.doDeactivate = function() { | |
this.wa = !1; | |
var a = this.g; | |
null !== a && Di(a); | |
Ei(this); | |
Fi(this, this.hc); | |
this.hc = this.On = null; | |
this.Vr = this.hy = !1; | |
if (0 < Gi.count) { | |
for (var b = Gi.length, c = 0; c < b; c++) { | |
var d = Gi.fa(c); | |
Hi(d); | |
Ii(d); | |
Ei(d); | |
null !== d.g && Di(d.g) | |
} | |
Gi.clear() | |
} | |
Hi(this); | |
this.Np.n(NaN, NaN); | |
di = ei = null; | |
Ii(this); | |
a.qf = !1; | |
a.sc = ""; | |
a.rv = !1; | |
this.ll() | |
}; | |
function Ei(a) { | |
var b = a.g; | |
if (null !== b) { | |
var c = b.lb; | |
b.lb = !0; | |
Ji(a, b.U, null); | |
b.lb = c | |
} | |
a.jk.length = 0 | |
} | |
function Ki() { | |
var a = di; | |
Ii(a); | |
Li(a); | |
var b = a.g; | |
null !== b && a.Np.H() && (b.position = a.Np); | |
null !== b && Di(b) | |
} | |
Uh.prototype.doCancel = function() { | |
Ii(this); | |
Li(this); | |
var a = this.g; | |
null !== a && this.Np.H() && (a.position = this.Np); | |
this.stopTool() | |
}; | |
function ci(a, b) { | |
if (null !== b) { | |
a.ox = !0; | |
for (var c = b.j; c.next();) { | |
var d = c.key; | |
d instanceof J && (d.Ji = !0) | |
} | |
} | |
} | |
function Fi(a, b) { | |
if (null !== b) { | |
for (var c = b.j; c.next();) { | |
var d = c.key; | |
d instanceof J && (d.Ji = !1, Mi(d) && d.ec()) | |
} | |
a.ox = !1 | |
} | |
} | |
Uh.prototype.doKeyDown = function() { | |
var a = this.g; | |
null !== a && (a = a.U, null !== a && this.wa && ("Esc" === a.key ? this.doCancel() : this.doMouseMove())) | |
}; | |
Uh.prototype.doKeyUp = function() { | |
var a = this.g; | |
null !== a && null !== a.U && this.wa && this.doMouseMove() | |
}; | |
function Ni(a, b) { | |
for (var c = Infinity, d = Infinity, e = -Infinity, g = -Infinity, h = a.j; h.next();) { | |
var k = h.value; | |
if (k.re() && k.isVisible()) { | |
var l = k.location, | |
k = l.x, | |
l = l.y; | |
isNaN(k) || isNaN(l) || (k < c && (c = k), l < d && (d = l), k > e && (e = k), l > g && (g = l)) | |
} | |
} | |
Infinity === c ? b.n(0, 0, 0, 0) : b.n(c, d, e - c, g - d) | |
} | |
function Oi(a, b) { | |
if (null === a.mc) { | |
var c = a.g; | |
if (!(null === c || b && (c.qb || c.Mf)) && null !== a.hc) { | |
var d = c.na; | |
d.isEnabled && d.hG ? null !== d.Gj && 0 < d.Gj.fg.count && (c.na.Bm(), c.Nb("Drag")) : Li(a); | |
c.lb = !b; | |
c.hr = !b; | |
a.kl = c.Pc.ha; | |
d = a.qI ? a.hc.bk() : c.selection; | |
d = c.hq(d, c, !0); | |
for (c = d.j; c.next();) c.value.location = c.key.location; | |
c = D.Sf(); | |
Ni(d, c); | |
D.Lb(c); | |
for (var c = new na(F), e = a.hc.j; e.next();) { | |
var g = e.key; | |
g.re() && g.canCopy() && (g = d.oa(g), null !== g && (g.mf(), c.add(g, hi(a, g.location)))) | |
} | |
for (d = d.j; d.next();) e = d.value, e instanceof | |
J && e.canCopy() && c.add(e, hi(a)); | |
a.mc = c; | |
bi(a, c.bk()); | |
null !== a.wd && (c = a.wd, d = c.uo, c.hl(a.kl.x - (d.x + d.width / 2), a.kl.y - (d.y + d.height / 2))) | |
} | |
} | |
} | |
function Ii(a) { | |
var b = a.g; | |
if (null !== b) { | |
if (null !== a.mc && (b.QB(a.mc.bk(), !1), a.mc = null, null !== a.hc)) | |
for (var c = a.hc.j; c.next();) c.key instanceof J && (c.value.point = new N(0, 0)); | |
b.lb = !1; | |
b.hr = !1; | |
a.kl = b.Pc.ha | |
} | |
} | |
function Hi(a) { | |
if (null !== a.wd) { | |
if (a.Ij && null !== a.sj) { | |
var b = a.sj; | |
null !== b.g && (b.g.remove(b.ge), b.g.remove(b.he)) | |
} | |
a.wd = null; | |
a.sj = null | |
} | |
} | |
function Pi(a, b, c) { | |
var d = a.g; | |
if (null !== d) { | |
var e = a.kl, | |
g = D.P(); | |
g.assign(d.U.ha); | |
a.moveParts(b, g.$j(e), c); | |
D.A(g) | |
} | |
} | |
Uh.prototype.moveParts = function(a, b, c) { | |
if (null !== a && (D.l(a, na, Uh, "moveParts:parts"), 0 !== a.count)) { | |
var d = D.P(), | |
e = D.P(); | |
e.assign(b); | |
isNaN(e.x) && (e.x = 0); | |
isNaN(e.y) && (e.y = 0); | |
(b = this.ox) || ci(this, a); | |
for (var g = new K(Qi), h = new K(Wa), k = a.j; k.next();) { | |
var l = k.key; | |
if (l.re()) { | |
var m = Ri(this, l, a); | |
if (null !== m) g.add(new Qi(l, k.value, m)); | |
else if (!c || l.canMove()) { | |
m = k.value.point; | |
d.assign(m); | |
var n = new N, | |
p = this.computeMove(l, d.add(e), a, n); | |
l.location = p; | |
k.value.cH = n.$j(m) | |
} | |
} else k.key instanceof J && h.add(k.bb) | |
} | |
for (c = g.j; c.next();) g = | |
c.value, m = g.info.point, d.assign(m), g.Zc.location = d.add(g.ZI.cH); | |
c = D.P(); | |
m = D.P(); | |
for (h = h.j; h.next();) | |
if (k = h.value, g = k.key, g instanceof J) | |
if (g.Ji) l = g.$, n = g.ba, null !== this.wd && this.Ij ? (k = k.value.point, a.add(g, hi(this, e)), l = e.x - k.x, k = e.y - k.y, g.hl(l, k)) : (null !== l && (c.assign(l.location), p = a.oa(l), null !== p && c.$j(p.point)), null !== n && (m.assign(n.location), p = a.oa(n), null !== p && m.$j(p.point)), null !== l && null !== n ? c.Wc(m) ? (k = k.value.point, l = d, l.assign(c), l.$j(k), a.add(g, hi(this, c)), g.hl(l.x, l.y)) : (g.Ji = !1, g.ec()) : | |
(k = k.value.point, n = null !== l ? c : null !== n ? m : e, a.add(g, hi(this, n)), l = n.x - k.x, k = n.y - k.y, g.hl(l, k))); | |
else if (null === g.$ || null === g.ba) k = k.value.point, a.add(g, hi(this, e)), l = e.x - k.x, k = e.y - k.y, g.hl(l, k); | |
D.A(d); | |
D.A(e); | |
D.A(c); | |
D.A(m); | |
b || (Si(this.g), Fi(this, a)) | |
} | |
}; | |
function Ri(a, b, c) { | |
b = b.Ka; | |
if (null !== b) { | |
a = Ri(a, b, c); | |
if (null !== a) return a; | |
a = c.oa(b); | |
if (null !== a) return a | |
} | |
return null | |
} | |
function Li(a) { | |
if (null !== a.hc) { | |
for (var b = a.g, c = a.hc.j; c.next();) { | |
var d = c.key; | |
d.re() && (d.location = c.value.point) | |
} | |
for (c = a.hc.j; c.next();) | |
if (d = c.key, d instanceof J && d.Ji) { | |
var e = c.value.point; | |
a.hc.add(d, hi(a)); | |
d.hl(-e.x, -e.y) | |
} | |
b.lg() | |
} | |
} | |
Uh.prototype.computeMove = function(a, b, c, d) { | |
void 0 === d && (d = new N); | |
d.assign(b); | |
if (null === a) return d; | |
void 0 === c && (c = null); | |
var e = b; | |
if (this.Lu && (this.mJ || null === c || null !== this.g && this.g.U.up) && (e = D.P(), c = e, c.assign(b), null !== a)) { | |
var g = this.g; | |
if (null !== g) { | |
var h = g.Xn, | |
k = this.VF, | |
g = k.width, | |
k = k.height, | |
l = this.YI, | |
m = l.x, | |
l = l.y, | |
n = this.XI; | |
if (null !== h) { | |
var p = h.by; | |
isNaN(g) && (g = p.width); | |
isNaN(k) && (k = p.height); | |
h = h.UF; | |
isNaN(m) && (m = h.x); | |
isNaN(l) && (l = h.y) | |
} | |
h = D.Fb(0, 0); | |
h.pv(0, 0, g, k, n); | |
gb(b.x, b.y, m + h.x, l + h.y, g, k, c); | |
D.A(h) | |
} | |
} | |
c = | |
null !== a.uF ? a.uF(a, b, e) : e; | |
k = a.NJ; | |
g = k.x; | |
isNaN(g) && (g = a.location.x); | |
k = k.y; | |
isNaN(k) && (k = a.location.y); | |
h = a.HJ; | |
m = h.x; | |
isNaN(m) && (m = a.location.x); | |
h = h.y; | |
isNaN(h) && (h = a.location.y); | |
d.n(Math.max(g, Math.min(c.x, m)), Math.max(k, Math.min(c.y, h))); | |
e !== b && D.A(e); | |
return d | |
}; | |
function Ti(a, b) { | |
if (null === b) return !0; | |
var c = b.Y; | |
return null === c || c instanceof da || c.layer.Yc || a.hc && a.hc.contains(c) || a.mc && a.mc.contains(c) ? !0 : !1 | |
} | |
function Ui(a, b) { | |
var c = a.g; | |
if (null !== c) { | |
a.Ij && (null !== a.wd && (a.wd.$ = null, a.wd.ba = null), Vi(a, !1)); | |
var d = Wi(c, b, null, function(b) { | |
return !Ti(a, b) | |
}), | |
e = c.U; | |
e.Oe = d; | |
var g = c.lb, | |
h = !1; | |
try { | |
c.lb = !0; | |
h = Ji(a, e, d); | |
if (!a.wa && null === di) return; | |
if (null === d) { | |
var k = c.RJ; | |
null !== k && (k(e), h = !0) | |
} | |
if (!a.wa && null === di) return; | |
a.doDragOver(b, d); | |
if (!a.wa && null === di) return | |
} finally { | |
c.lb = g, h && c.lg() | |
}(c.Be || c.Ce) && c.SA(e.Sd) | |
} | |
} | |
function Ji(a, b, c) { | |
var d = !1, | |
e = a.jk.length, | |
g = 0 < e ? a.jk[0] : null; | |
if (c === g) return !1; | |
b.Cc = !1; | |
for (var h = 0; h < e; h++) { | |
var k = a.jk[h], | |
l = k.QJ; | |
if (null !== l && (l(b, k, c), d = !0, b.Cc)) break | |
} | |
a.jk.length = 0; | |
if (!a.wa && null === di || null === c) return d; | |
for (b.Cc = !1; null !== c;) a.jk.push(c), c = Xi(c); | |
e = a.jk.length; | |
for (h = 0; h < e && (k = a.jk[h], l = k.PJ, null === l || (l(b, k, g), d = !0, !b.Cc)); h++); | |
return d | |
} | |
function Xi(a) { | |
var b = a.R; | |
return null !== b ? b : a instanceof F && !(a instanceof I) && (a = a.Ka, null !== a && a.aJ) ? a : null | |
} | |
function Yi(a, b, c) { | |
var d = a.sj; | |
if (null === d) return null; | |
var e = a.g.Rn(b, d.DG, function(a) { | |
return d.findValidLinkablePort(a, c) | |
}); | |
a = D.P(); | |
for (var g = Infinity, h = null, e = e.j; e.next();) { | |
var k = e.value; | |
if (null !== k.Y) { | |
var l = k.fb(mc, a), | |
l = b.Kf(l); | |
l < g && (h = k, g = l) | |
} | |
} | |
D.A(a); | |
return h | |
} | |
function Vi(a, b) { | |
var c = a.wd; | |
if (null !== c && !(2 > c.ta)) { | |
var d = a.g; | |
if (null !== d && !d.qb) { | |
var e = a.sj; | |
if (null !== e) { | |
var g = null, | |
h = null; | |
null === c.$ && (g = Yi(a, c.m(0), !1), null !== g && (h = g.Y)); | |
var k = null, | |
l = null; | |
null === c.ba && (k = Yi(a, c.m(c.ta - 1), !0), null !== k && (l = k.Y)); | |
e.isValidLink(h, g, l, k) ? b ? (c.iq = c.m(0), c.jq = c.m(c.ta - 1), c.Ji = !1, c.$ = h, null !== g && (c.hg = g.yd), c.ba = l, null !== k && (c.jh = k.yd), c.oc !== a.Mw && d.Ja("LinkRelinked", c, a.Mw), c.Gc !== a.Nw && d.Ja("LinkRelinked", c, a.Nw)) : Zi(e, h, g, l, k) : Zi(e, null, null, null, null) | |
} | |
} | |
} | |
} | |
Uh.prototype.doDragOver = function() {}; | |
function $i(a, b) { | |
var c = a.g; | |
if (null !== c) { | |
a.Ij && Vi(a, !0); | |
Ei(a); | |
var d = Wi(c, b, null, function(b) { | |
return !Ti(a, b) | |
}), | |
e = c.U; | |
e.Oe = d; | |
if (null !== d) { | |
e.Cc = !1; | |
for (var g = d; null !== g;) { | |
var h = g.BB; | |
if (null !== h && (h(e, g), e.Cc)) break; | |
g = Xi(g) | |
} | |
} else g = c.BB, null !== g && g(e); | |
if (a.wa || null !== di) { | |
for (e = (a.mc || a.hc).j; e.next();) g = e.key, g instanceof G && g.Pd.each(function(a) { | |
a.Ji = !1 | |
}); | |
a.doDropOnto(b, d); | |
if (a.wa || null !== di) { | |
d = D.Sf(); | |
for (e = c.selection.j; e.next();) g = e.value, g instanceof G && aj(c, g.getAvoidableRect(d)); | |
D.Lb(d) | |
} | |
} | |
} | |
} | |
function aj(a, b) { | |
var c = !1; | |
a.wb.Tk(b) && (c = !0); | |
c = a.YA(b, function(a) { | |
return a.Y | |
}, function(a) { | |
return a instanceof J | |
}, !0, function(a) { | |
return a instanceof J | |
}, c); | |
if (0 !== c.count) | |
for (c = c.j; c.next();) { | |
var d = c.value; | |
d.Nj && d.ec() | |
} | |
} | |
Uh.prototype.doDropOnto = function() {}; | |
Uh.prototype.doMouseMove = function() { | |
if (this.wa) { | |
var a = this.g; | |
null !== a && null !== this.On && null !== this.hc && (this.mayCopy() ? (a.sc = "copy", Oi(this, !1), ci(this, this.mc), Pi(this, this.mc, !1), Fi(this, this.mc)) : this.mayMove() ? (Ii(this), Pi(this, this.hc, !0)) : this.mayDragOut() ? (a.sc = "no-drop", Oi(this, !1), Pi(this, this.mc, !1)) : Ii(this), Ui(this, a.U.ha)) | |
} | |
}; | |
Uh.prototype.doMouseUp = function() { | |
if (this.wa) { | |
var a = this.g; | |
if (null !== a) { | |
var b = !1, | |
c = this.mayCopy(); | |
c && null !== this.mc ? (Ii(this), Oi(this, !0), ci(this, this.mc), Pi(this, this.mc, !1), Fi(this, this.mc), null !== this.mc && a.XG(this.mc.bk())) : (b = !0, Ii(this), this.mayMove() && (Pi(this, this.hc, !0), Ui(this, a.U.ha))); | |
this.Vr = !0; | |
$i(this, a.U.ha); | |
if (this.wa) { | |
this.mc = null; | |
if (b && null !== this.hc) | |
for (b = this.hc.j; b.next();) { | |
var d = b.key; | |
d instanceof G && (d = d.Ka, null === d || null === d.placeholder || this.hc.contains(d) || d.placeholder.K()) | |
} | |
a.Qc(); | |
Fi(this, this.hc); | |
this.Tf = c ? "Copy" : "Move"; | |
a.Ja(c ? "SelectionCopied" : "SelectionMoved", a.selection) | |
} | |
this.stopTool() | |
} | |
} | |
}; | |
Uh.prototype.mayCopy = function() { | |
if (!this.eG) return !1; | |
var a = this.g; | |
if (null === a || a.qb || a.Mf || !a.Zp || !a.Qk || (D.Qh ? !a.U.alt : !a.U.control)) return !1; | |
for (a = a.selection.j; a.next();) { | |
var b = a.value; | |
if (b.re() && b.canCopy()) return !0 | |
} | |
return null !== this.wd && this.Ij && this.wd.canCopy() ? !0 : !1 | |
}; | |
Uh.prototype.mayDragOut = function() { | |
if (!this.eG) return !1; | |
var a = this.g; | |
if (null === a || !a.du || !a.Qk || a.gm) return !1; | |
for (a = a.selection.j; a.next();) { | |
var b = a.value; | |
if (b.re() && b.canCopy()) return !0 | |
} | |
return null !== this.wd && this.Ij && this.wd.canCopy() ? !0 : !1 | |
}; | |
Uh.prototype.mayMove = function() { | |
var a = this.g; | |
if (null === a || a.qb || !a.gm) return !1; | |
for (a = a.selection.j; a.next();) { | |
var b = a.value; | |
if (b.re() && b.canMove()) return !0 | |
} | |
return null !== this.wd && this.Ij && this.wd.canMove() ? !0 : !1 | |
}; | |
var Gi = new K(Uh), | |
di = null, | |
ei = null; | |
Uh.prototype.getDraggingSource = function() { | |
return di | |
}; | |
Uh.prototype.mayDragIn = function() { | |
var a = this.g; | |
if (null === a || !a.VE || a.qb || a.Mf || !a.Zp) return !1; | |
var b = di; | |
return null === b || null === b.g || b.g.da.om !== a.da.om ? !1 : !0 | |
}; | |
Uh.prototype.doSimulatedDragEnter = function() { | |
if (this.mayDragIn()) { | |
var a = this.g; | |
a.Ra.Yh(); | |
bj(a); | |
a.Ra.Yh(); | |
a = di; | |
null !== a && null !== a.g && (a.g.sc = "copy") | |
} | |
}; | |
Uh.prototype.doSimulatedDragLeave = function() { | |
var a = di; | |
null !== a && a.doSimulatedDragOut(); | |
this.doCancel() | |
}; | |
Uh.prototype.doSimulatedDragOver = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = di; | |
null !== b && null !== b.hc && this.mayDragIn() && (a.sc = "copy", cj(this, b.hc.bk(), !1), Pi(this, this.mc, !1), Ui(this, a.U.ha)) | |
} | |
}; | |
Uh.prototype.doSimulatedDrop = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = di; | |
if (null !== b) { | |
var c = b.g; | |
b.Vr = !0; | |
Ii(this); | |
this.mayDragIn() && (this.Nb("Drop"), cj(this, b.hc.bk(), !0), Pi(this, this.mc, !1), null !== this.mc && a.XG(this.mc.bk()), $i(this, a.U.ha), a.Qc(), b = a.selection, null !== this.mc ? this.Tf = "ExternalCopy" : b = new L(F), this.mc = null, a.doFocus(), a.Ja("ExternalObjectsDropped", b, c), this.ll()) | |
} | |
} | |
}; | |
function cj(a, b, c) { | |
if (null === a.mc) { | |
var d = a.g; | |
if (null !== d && !d.qb && !d.Mf) { | |
d.lb = !c; | |
d.hr = !c; | |
a.kl = d.U.ha; | |
c = d.hq(b, d, !0); | |
var e = D.Sf(); | |
Ni(b, e); | |
var d = e.x + e.width / 2, | |
g = e.y + e.height / 2; | |
D.Lb(e); | |
var e = a.lx, | |
h = new na(F), | |
k = D.P(); | |
for (b = b.j; b.next();) { | |
var l = b.value, | |
m = c.oa(l); | |
l.re() && l.canCopy() ? (l = l.location, k.n(e.x - (d - l.x), e.y - (g - l.y)), m.location = k, m.mf(), h.add(m, hi(a, k))) : l instanceof J && l.canCopy() && (m.hl(e.x - d, e.y - g), h.add(m, hi(a))) | |
} | |
D.A(k); | |
a.mc = h; | |
bi(a, h.bk()); | |
null !== a.wd && (c = a.wd, d = c.uo, c.hl(a.kl.x - (d.x + d.width / | |
2), a.kl.y - (d.y + d.height / 2))) | |
} | |
} | |
} | |
Uh.prototype.doSimulatedDragOut = function() { | |
var a = this.g; | |
null !== a && (this.mayCopy() || this.mayMove() ? a.sc = "" : a.sc = "no-drop") | |
}; | |
function qi(a) { | |
this.point = a; | |
this.cH = Kd | |
} | |
D.ka("DraggingInfo", qi); | |
function Qi(a, b, c) { | |
this.Zc = a; | |
this.info = b; | |
this.ZI = c | |
} | |
function dj() { | |
0 < arguments.length && D.zd(dj); | |
Zg.call(this); | |
this.hE = 100; | |
this.LD = !1; | |
var a = new J, | |
b = new z; | |
b.Ve = !0; | |
b.stroke = "blue"; | |
a.add(b); | |
b = new z; | |
b.ar = "Standard"; | |
b.fill = "blue"; | |
b.stroke = "blue"; | |
a.add(b); | |
a.Nf = "Tool"; | |
this.BE = a; | |
a = new G; | |
b = new z; | |
b.yd = ""; | |
b.Kb = "Rectangle"; | |
b.fill = null; | |
b.stroke = "magenta"; | |
b.mb = 2; | |
b.Ea = Yd; | |
a.add(b); | |
a.jl = !1; | |
a.Nf = "Tool"; | |
this.zE = a; | |
this.AE = b; | |
a = new G; | |
b = new z; | |
b.yd = ""; | |
b.Kb = "Rectangle"; | |
b.fill = null; | |
b.stroke = "magenta"; | |
b.mb = 2; | |
b.Ea = Yd; | |
a.add(b); | |
a.jl = !1; | |
a.Nf = "Tool"; | |
this.CE = a; | |
this.DE = b; | |
this.gE = this.fE = | |
this.bE = this.aE = this.cE = null; | |
this.GD = !0; | |
this.QH = new na(O, "boolean"); | |
this.iE = this.Ql = this.wE = null | |
} | |
D.Ta(dj, Zg); | |
D.ka("LinkingBaseTool", dj); | |
dj.prototype.doStop = function() { | |
var a = this.g; | |
null !== a && Di(a); | |
this.fh = this.eh = this.dh = this.bh = this.vc = null; | |
this.Xy.clear(); | |
this.Rf = null | |
}; | |
D.defineProperty(dj, { | |
DG: "portGravity" | |
}, function() { | |
return this.hE | |
}, function(a) { | |
D.h(a, "number", dj, "portGravity"); | |
0 <= a && (this.hE = a) | |
}); | |
D.defineProperty(dj, { | |
Cq: "isUnconnectedLinkValid" | |
}, function() { | |
return this.LD | |
}, function(a) { | |
D.h(a, "boolean", dj, "isUnconnectedLinkValid"); | |
this.LD = a | |
}); | |
D.defineProperty(dj, { | |
Gf: "temporaryLink" | |
}, function() { | |
return this.BE | |
}, function(a) { | |
D.l(a, J, dj, "temporaryLink"); | |
this.BE = a | |
}); | |
D.defineProperty(dj, { | |
ge: "temporaryFromNode" | |
}, function() { | |
return this.zE | |
}, function(a) { | |
D.l(a, G, dj, "temporaryFromNode"); | |
this.zE = a | |
}); | |
D.defineProperty(dj, { | |
yo: "temporaryFromPort" | |
}, function() { | |
return this.AE | |
}, function(a) { | |
D.l(a, O, dj, "temporaryFromPort"); | |
this.AE = a | |
}); | |
D.defineProperty(dj, { | |
he: "temporaryToNode" | |
}, function() { | |
return this.CE | |
}, function(a) { | |
D.l(a, G, dj, "temporaryToNode"); | |
this.CE = a | |
}); | |
D.defineProperty(dj, { | |
zo: "temporaryToPort" | |
}, function() { | |
return this.DE | |
}, function(a) { | |
D.l(a, O, dj, "temporaryToPort"); | |
this.DE = a | |
}); | |
D.defineProperty(dj, { | |
vc: "originalLink" | |
}, function() { | |
return this.cE | |
}, function(a) { | |
null !== a && D.l(a, J, dj, "originalLink"); | |
this.cE = a | |
}); | |
D.defineProperty(dj, { | |
bh: "originalFromNode" | |
}, function() { | |
return this.aE | |
}, function(a) { | |
null !== a && D.l(a, G, dj, "originalFromNode"); | |
this.aE = a | |
}); | |
D.defineProperty(dj, { | |
dh: "originalFromPort" | |
}, function() { | |
return this.bE | |
}, function(a) { | |
null !== a && D.l(a, O, dj, "originalFromPort"); | |
this.bE = a | |
}); | |
D.defineProperty(dj, { | |
eh: "originalToNode" | |
}, function() { | |
return this.fE | |
}, function(a) { | |
null !== a && D.l(a, G, dj, "originalToNode"); | |
this.fE = a | |
}); | |
D.defineProperty(dj, { | |
fh: "originalToPort" | |
}, function() { | |
return this.gE | |
}, function(a) { | |
null !== a && D.l(a, O, dj, "originalToPort"); | |
this.gE = a | |
}); | |
D.defineProperty(dj, { | |
de: "isForwards" | |
}, function() { | |
return this.GD | |
}, function(a) { | |
D.h(a, "boolean", dj, "isForwards"); | |
this.GD = a | |
}); | |
D.w(dj, { | |
Xy: "validPortsCache" | |
}, function() { | |
return this.QH | |
}); | |
D.defineProperty(dj, { | |
Rf: "targetPort" | |
}, function() { | |
return this.wE | |
}, function(a) { | |
null !== a && D.l(a, O, dj, "targetPort"); | |
this.wE = a | |
}); | |
dj.prototype.copyPortProperties = function(a, b, c, d, e) { | |
if (null !== a && null !== b && null !== c && null !== d) { | |
d.Ea = b.aa.size; | |
e ? (d.Hb = b.Hb, d.Jm = b.Jm) : (d.Gb = b.Gb, d.sm = b.sm); | |
c.Of = mc; | |
var g = D.P(); | |
c.location = b.fb(mc, g); | |
D.A(g); | |
d.angle = b.tm(); | |
null !== this.Ey && this.Ey(a, b, c, d, e) | |
} | |
}; | |
dj.prototype.setNoTargetPortProperties = function(a, b, c) { | |
null !== b && (b.Ea = Yd, b.Gb = dc, b.Hb = dc); | |
null !== a && null !== this.g && (a.location = this.g.U.ha); | |
null !== this.Ey && this.Ey(null, null, a, b, c) | |
}; | |
dj.prototype.doMouseDown = function() { | |
this.wa && this.doMouseMove() | |
}; | |
dj.prototype.doMouseMove = function() { | |
if (this.wa) { | |
var a = this.g; | |
if (null !== a) { | |
this.Rf = this.findTargetPort(this.de); | |
if (null !== this.Rf && this.Rf.Y instanceof G) { | |
var b = this.Rf.Y; | |
this.de ? this.copyPortProperties(b, this.Rf, this.he, this.zo, !0) : this.copyPortProperties(b, this.Rf, this.ge, this.yo, !1) | |
} else this.de ? this.setNoTargetPortProperties(this.he, this.zo, !0) : this.setNoTargetPortProperties(this.ge, this.yo, !1); | |
(a.Be || a.Ce) && a.SA(a.U.Sd) | |
} | |
} | |
}; | |
dj.prototype.findValidLinkablePort = function(a, b) { | |
if (null === a) return null; | |
var c = a.Y; | |
if (!(c instanceof G)) return null; | |
for (; null !== a;) { | |
var d = b ? a.lH : a.KF; | |
if (!0 === d && (null !== a.yd || a instanceof G) && (b ? this.isValidTo(c, a) : this.isValidFrom(c, a))) return a; | |
if (!1 === d) break; | |
a = a.R | |
} | |
return null | |
}; | |
dj.prototype.findTargetPort = function(a) { | |
var b = this.g, | |
c = b.U.ha, | |
d = this.DG; | |
0 >= d && (d = .1); | |
for (var e = this, g = b.Rn(c, d, function(b) { | |
return e.findValidLinkablePort(b, a) | |
}, null, !0), d = Infinity, b = null, g = g.j; g.next();) { | |
var h = g.value, | |
k = h.Y; | |
if (k instanceof G) { | |
var l = h.fb(mc, D.P()), | |
m = c.x - l.x, | |
n = c.y - l.y; | |
D.A(l); | |
l = m * m + n * n; | |
l < d && (m = this.Xy.oa(h), null !== m ? m && (b = h, d = l) : a && this.isValidLink(this.bh, this.dh, k, h) || !a && this.isValidLink(k, h, this.eh, this.fh) ? (this.Xy.add(h, !0), b = h, d = l) : this.Xy.add(h, !1)) | |
} | |
} | |
return null !== b && (c = b.Y, | |
c instanceof G && (null === c.layer || c.layer.eu)) ? b : null | |
}; | |
dj.prototype.isValidFrom = function(a, b) { | |
if (null === a || null === b) return this.Cq; | |
if (null !== this.g && this.g.eb === this && (null !== a.layer && !a.layer.eu || !0 !== b.KF)) return !1; | |
var c = b.aB; | |
if (Infinity > c) { | |
if (null !== this.vc && a === this.bh && b === this.dh) return !0; | |
var d = b.yd; | |
null === d && (d = ""); | |
if (a.Xx(d).count >= c) return !1 | |
} | |
return !0 | |
}; | |
dj.prototype.isValidTo = function(a, b) { | |
if (null === a || null === b) return this.Cq; | |
if (null !== this.g && this.g.eb === this && (null !== a.layer && !a.layer.eu || !0 !== b.lH)) return !1; | |
var c = b.DK; | |
if (Infinity > c) { | |
if (null !== this.vc && a === this.eh && b === this.fh) return !0; | |
var d = b.yd; | |
null === d && (d = ""); | |
if (a.Yg(d).count >= c) return !1 | |
} | |
return !0 | |
}; | |
dj.prototype.isInSameNode = function(a, b) { | |
if (null === a || null === b) return !1; | |
if (a === b) return !0; | |
var c = a.Y, | |
d = b.Y; | |
return null !== c && c === d | |
}; | |
dj.prototype.isLinked = function(a, b) { | |
if (null === a || null === b) return !1; | |
var c = a.Y; | |
if (!(c instanceof G)) return !1; | |
var d = a.yd; | |
null === d && (d = ""); | |
var e = b.Y; | |
if (!(e instanceof G)) return !1; | |
var g = b.yd; | |
null === g && (g = ""); | |
for (e = e.Yg(g); e.next();) | |
if (g = e.value, g.$ === c && g.hg === d) return !0; | |
return !1 | |
}; | |
dj.prototype.isValidLink = function(a, b, c, d) { | |
if (!this.isValidFrom(a, b) || !this.isValidTo(c, d) || !(null === b || null === d || (b.OI && d.CK || !this.isInSameNode(b, d)) && (b.NI && d.BK || !this.isLinked(b, d))) || null !== this.vc && (null !== a && this.isLabelDependentOnLink(a, this.vc) || null !== c && this.isLabelDependentOnLink(c, this.vc)) || null !== a && null !== c && (null === a.data && null !== c.data || null !== a.data && null === c.data) || !this.isValidCycle(a, c, this.vc)) return !1; | |
if (null !== a) { | |
var e = a.sy; | |
if (null !== e && !e(a, b, c, d, this.vc)) return !1 | |
} | |
if (null !== | |
c && (e = c.sy, null !== e && !e(a, b, c, d, this.vc))) return !1; | |
e = this.sy; | |
return null !== e ? e(a, b, c, d, this.vc) : !0 | |
}; | |
dj.prototype.isLabelDependentOnLink = function(a, b) { | |
if (null === a) return !1; | |
var c = a.Yb; | |
if (null === c) return !1; | |
if (c === b) return !0; | |
var d = new L(G); | |
d.add(a); | |
return ej(this, c, b, d) | |
}; | |
function ej(a, b, c, d) { | |
if (b === c) return !0; | |
var e = b.$; | |
if (null !== e && e.Lf && (d.add(e), ej(a, e.Yb, c, d))) return !0; | |
b = b.ba; | |
return null !== b && b.Lf && (d.add(b), ej(a, b.Yb, c, d)) ? !0 : !1 | |
} | |
dj.prototype.isValidCycle = function(a, b, c) { | |
void 0 === c && (c = null); | |
if (null === a || null === b) return this.Cq; | |
var d = null !== this.g ? this.g.JK : fj; | |
if (d !== fj) { | |
if (d === gj) { | |
d = c || this.Gf; | |
if (null !== d && !d.jc) return !0; | |
for (d = b.Pd; d.next();) { | |
var e = d.value; | |
if (e !== c && e.jc && e.ba === b) return !1 | |
} | |
return !hj(this, a, b, c, !0) | |
} | |
if (d === ij) { | |
d = c || this.Gf; | |
if (null !== d && !d.jc) return !0; | |
for (d = a.Pd; d.next();) | |
if (e = d.value, e !== c && e.jc && e.$ === a) return !1; | |
return !hj(this, a, b, c, !0) | |
} | |
if (d === jj) return a === b ? a = !0 : (d = new L(G), d.add(b), a = kj(this, d, a, b, c)), !a; | |
if (d === lj) return !hj(this, a, b, c, !1); | |
if (d === mj) return a === b ? a = !0 : (d = new L(G), d.add(b), a = nj(this, d, a, b, c)), !a | |
} | |
return !0 | |
}; | |
function hj(a, b, c, d, e) { | |
if (b === c) return !0; | |
if (null === b || null === c) return !1; | |
for (var g = b.Pd; g.next();) { | |
var h = g.value; | |
if (h !== d && (!e || h.jc) && h.ba === b && (h = h.$, h !== b && hj(a, h, c, d, e))) return !0 | |
} | |
return !1 | |
} | |
function kj(a, b, c, d, e) { | |
if (c === d) return !0; | |
if (null === c || null === d || b.contains(c)) return !1; | |
b.add(c); | |
for (var g = c.Pd; g.next();) { | |
var h = g.value; | |
if (h !== e && h.ba === c && (h = h.$, h !== c && kj(a, b, h, d, e))) return !0 | |
} | |
return !1 | |
} | |
function nj(a, b, c, d, e) { | |
if (c === d) return !0; | |
if (null === c || null === d || b.contains(c)) return !1; | |
b.add(c); | |
for (var g = c.Pd; g.next();) { | |
var h = g.value; | |
if (h !== e) { | |
var k = h.$, | |
h = h.ba, | |
k = k === c ? h : k; | |
if (k !== c && nj(a, b, k, d, e)) return !0 | |
} | |
} | |
return !1 | |
} | |
D.defineProperty(dj, { | |
sy: "linkValidation" | |
}, function() { | |
return this.Ql | |
}, function(a) { | |
null !== a && D.h(a, "function", dj, "linkValidation"); | |
this.Ql = a | |
}); | |
D.defineProperty(dj, { | |
Ey: "portTargeted" | |
}, function() { | |
return this.iE | |
}, function(a) { | |
null !== a && D.h(a, "function", dj, "portTargeted"); | |
this.iE = a | |
}); | |
function ra() { | |
0 < arguments.length && D.zd(ra); | |
dj.call(this); | |
this.name = "Linking"; | |
this.oz = {}; | |
this.nz = null; | |
this.ga = oj; | |
this.rE = null | |
} | |
D.Ta(ra, dj); | |
D.ka("LinkingTool", ra); | |
var oj; | |
ra.Either = oj = D.s(ra, "Either", 0); | |
var pj; | |
ra.ForwardsOnly = pj = D.s(ra, "ForwardsOnly", 0); | |
var qj; | |
ra.BackwardsOnly = qj = D.s(ra, "BackwardsOnly", 0); | |
D.defineProperty(ra, { | |
ZE: "archetypeLinkData" | |
}, function() { | |
return this.oz | |
}, function(a) { | |
null !== a && D.l(a, Object, ra, "archetypeLinkData"); | |
a instanceof O && D.l(a, J, ra, "archetypeLinkData"); | |
this.oz = a | |
}); | |
D.defineProperty(ra, { | |
YE: "archetypeLabelNodeData" | |
}, function() { | |
return this.nz | |
}, function(a) { | |
null !== a && D.l(a, Object, ra, "archetypeLabelNodeData"); | |
a instanceof O && D.l(a, G, ra, "archetypeLabelNodeData"); | |
this.nz = a | |
}); | |
D.defineProperty(ra, { | |
direction: "direction" | |
}, function() { | |
return this.ga | |
}, function(a) { | |
D.Da(a, ra, ra, "direction"); | |
this.ga = a | |
}); | |
D.defineProperty(ra, { | |
fH: "startObject" | |
}, function() { | |
return this.rE | |
}, function(a) { | |
null !== a && D.l(a, O, ra, "startObject"); | |
this.rE = a | |
}); | |
ra.prototype.canStart = function() { | |
if (!this.isEnabled) return !1; | |
var a = this.g; | |
if (null === a || a.qb || a.Mf || !a.eu) return !1; | |
var b = a.da; | |
return (b instanceof Y || b instanceof Bg) && a.U.left && (a.eb === this || this.isBeyondDragSize()) ? null !== this.findLinkablePort() : !1 | |
}; | |
ra.prototype.findLinkablePort = function() { | |
var a = this.g; | |
if (null === a) return null; | |
var b = this.fH; | |
null === b && (b = a.Je(a.Pc.ha, null, null)); | |
if (null === b || !(b.Y instanceof G)) return null; | |
a = this.direction; | |
if (a === oj || a === pj) { | |
var c = this.findValidLinkablePort(b, !1); | |
if (null !== c) return this.de = !0, c | |
} | |
if (a === oj || a === qj) | |
if (c = this.findValidLinkablePort(b, !0), null !== c) return this.de = !1, c; | |
return null | |
}; | |
ra.prototype.doActivate = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = this.findLinkablePort(); | |
null !== b && (this.Nb(this.name), a.qf = !0, a.sc = "pointer", this.de ? (null === this.he || this.he.location.H() || (this.he.location = a.U.ha), this.dh = b, b = this.dh.Y, b instanceof G && (this.bh = b), this.copyPortProperties(this.bh, this.dh, this.ge, this.yo, !1)) : (null === this.ge || this.ge.location.H() || (this.ge.location = a.U.ha), this.fh = b, b = this.fh.Y, b instanceof G && (this.eh = b), this.copyPortProperties(this.eh, this.fh, this.he, this.zo, !0)), | |
a.add(this.ge), a.add(this.he), null !== this.Gf && (null !== this.ge && (this.Gf.$ = this.ge), null !== this.he && (this.Gf.ba = this.he), this.Gf.jc = this.isNewTreeLink(), this.Gf.ec(), a.add(this.Gf)), this.wa = !0) | |
} | |
}; | |
ra.prototype.doDeactivate = function() { | |
this.wa = !1; | |
var a = this.g; | |
null !== a && (a.remove(this.Gf), a.remove(this.ge), a.remove(this.he), a.qf = !1, a.sc = "", this.ll()) | |
}; | |
ra.prototype.doStop = function() { | |
dj.prototype.doStop.call(this); | |
this.fH = null | |
}; | |
ra.prototype.doMouseUp = function() { | |
if (this.wa) { | |
var a = this.g; | |
if (null === a) return; | |
var b = this.Tf = null, | |
c = null, | |
d = null, | |
e = null, | |
g = this.Rf = this.findTargetPort(this.de); | |
if (null !== g) { | |
var h = g.Y; | |
h instanceof G && (this.de ? (null !== this.bh && (b = this.bh, c = this.dh), d = h, e = g) : (b = h, c = g, null !== this.eh && (d = this.eh, e = this.fh))) | |
} else this.de ? null !== this.bh && this.Cq && (b = this.bh, c = this.dh) : null !== this.eh && this.Cq && (d = this.eh, e = this.fh); | |
null !== b || null !== d ? (h = this.insertLink(b, c, d, e), null !== h ? (null === g && (this.de ? h.jq = a.U.ha : h.iq = | |
a.U.ha), a.Jf && a.select(h), this.Tf = this.name, a.Ja("LinkDrawn", h)) : (a.da.eF(), this.doNoLink(b, c, d, e))) : this.de ? this.doNoLink(this.bh, this.dh, null, null) : this.doNoLink(null, null, this.eh, this.fh) | |
} | |
this.stopTool() | |
}; | |
ra.prototype.isNewTreeLink = function() { | |
var a = this.ZE; | |
if (null === a) return !0; | |
if (a instanceof J) return a.jc; | |
var b = this.g; | |
if (null === b) return !0; | |
a = b.Bu(a); | |
b = rj(b, a); | |
return null !== b ? b.jc : !0 | |
}; | |
ra.prototype.insertLink = function(a, b, c, d) { | |
var e = this.g; | |
if (null === e) return null; | |
var g = e.da; | |
if (g instanceof Bg) { | |
var h = a; | |
b = c; | |
e.fe || (h = c, b = a); | |
if (null !== h && null !== b) return g.Ii(b.data, g.zb(h.data)), b.Sn() | |
} else if (g instanceof Y) | |
if (h = "", null !== a && (null === b && (b = a), h = b.yd, null === h && (h = "")), b = "", null !== c && (null === d && (d = c), b = d.yd, null === b && (b = "")), d = this.ZE, d instanceof J) { | |
if (Sh(d), g = d.copy(), null !== g) return g.$ = a, g.hg = h, g.ba = c, g.jh = b, e.add(g), a = this.YE, a instanceof G && (Sh(a), a = a.copy(), null !== a && (a.Yb = g, e.add(a))), | |
g | |
} else if (null !== d && (d = g.Lx(d), D.Qa(d))) return null !== a && g.XB(d, g.zb(a.data)), g.YB(d, h), null !== c && g.cC(d, g.zb(c.data)), g.dC(d, b), g.au(d), a = this.YE, null === a || a instanceof G || (a = g.copyNodeData(a), D.Qa(a) && (g.em(a), a = g.zb(a), void 0 !== a && g.TE(d, a))), g = e.gg(d); | |
return null | |
}; | |
ra.prototype.doNoLink = function() {}; | |
function fi() { | |
0 < arguments.length && D.zd(fi); | |
dj.call(this); | |
this.name = "Relinking"; | |
var a = new z; | |
a.Kb = "Diamond"; | |
a.Ea = $d; | |
a.fill = "lightblue"; | |
a.stroke = "dodgerblue"; | |
a.cursor = "pointer"; | |
a.We = 0; | |
this.tD = a; | |
a = new z; | |
a.Kb = "Diamond"; | |
a.Ea = $d; | |
a.fill = "lightblue"; | |
a.stroke = "dodgerblue"; | |
a.cursor = "pointer"; | |
a.We = -1; | |
this.EE = a; | |
this.pc = null; | |
this.dE = new C | |
} | |
D.Ta(fi, dj); | |
D.ka("RelinkingTool", fi); | |
fi.prototype.updateAdornments = function(a) { | |
if (null !== a && a instanceof J) { | |
var b = "RelinkFrom", | |
c = null; | |
if (a.jb && null !== this.g && !this.g.qb) { | |
var d = a.Cm; | |
null !== d && a.canRelinkFrom() && a.aa.H() && a.isVisible() && d.aa.H() && d.Sj() && (c = a.nq(b), null === c && (c = this.makeAdornment(d, !1), a.dm(b, c))) | |
} | |
null === c && a.Xj(b); | |
b = "RelinkTo"; | |
c = null; | |
a.jb && null !== this.g && !this.g.qb && (d = a.Cm, null !== d && a.canRelinkTo() && a.aa.H() && a.isVisible() && d.aa.H() && d.Sj() && (c = a.nq(b), null === c && (c = this.makeAdornment(d, !0), a.dm(b, c)))); | |
null === c && a.Xj(b) | |
} | |
}; | |
fi.prototype.makeAdornment = function(a, b) { | |
var c = new da; | |
c.type = sj; | |
var d = b ? this.AK : this.MI; | |
null !== d && c.add(d.copy()); | |
c.Bb = a; | |
return c | |
}; | |
D.defineProperty(fi, { | |
MI: "fromHandleArchetype" | |
}, function() { | |
return this.tD | |
}, function(a) { | |
null !== a && D.l(a, O, fi, "fromHandleArchetype"); | |
this.tD = a | |
}); | |
D.defineProperty(fi, { | |
AK: "toHandleArchetype" | |
}, function() { | |
return this.EE | |
}, function(a) { | |
null !== a && D.l(a, O, fi, "toHandleArchetype"); | |
this.EE = a | |
}); | |
D.w(fi, { | |
handle: "handle" | |
}, function() { | |
return this.pc | |
}); | |
fi.prototype.canStart = function() { | |
if (!this.isEnabled) return !1; | |
var a = this.g; | |
if (null === a || a.qb || a.Mf || !a.Fn) return !1; | |
var b = a.da; | |
if (!(b instanceof Y || b instanceof Bg) || !a.U.left) return !1; | |
b = this.findToolHandleAt(a.Pc.ha, "RelinkFrom"); | |
null === b && (b = this.findToolHandleAt(a.Pc.ha, "RelinkTo")); | |
return null !== b | |
}; | |
fi.prototype.doActivate = function() { | |
var a = this.g; | |
if (null !== a) { | |
if (null === this.vc) { | |
var b = this.findToolHandleAt(a.Pc.ha, "RelinkFrom"); | |
null === b && (b = this.findToolHandleAt(a.Pc.ha, "RelinkTo")); | |
if (null === b) return; | |
var c = b.Y; | |
if (!(c instanceof da && c.hf instanceof J)) return; | |
this.pc = b; | |
this.de = null === c || "RelinkTo" === c.Ld; | |
this.vc = c.hf | |
} | |
this.Nb(this.name); | |
a.qf = !0; | |
a.sc = "pointer"; | |
this.dh = this.vc.oc; | |
this.bh = this.vc.$; | |
this.fh = this.vc.Gc; | |
this.eh = this.vc.ba; | |
this.dE.set(this.vc.aa); | |
null !== this.vc && 0 < this.vc.ta && (null === | |
this.vc.$ && (null !== this.yo && (this.yo.Ea = Xd), null !== this.ge && (this.ge.location = this.vc.m(0))), null === this.vc.ba && (null !== this.zo && (this.zo.Ea = Xd), null !== this.he && (this.he.location = this.vc.m(this.vc.ta - 1)))); | |
this.copyPortProperties(this.bh, this.dh, this.ge, this.yo, !1); | |
this.copyPortProperties(this.eh, this.fh, this.he, this.zo, !0); | |
a.add(this.ge); | |
a.add(this.he); | |
null !== this.Gf && (null !== this.ge && (this.Gf.$ = this.ge), null !== this.he && (this.Gf.ba = this.he), this.copyLinkProperties(this.vc, this.Gf), this.Gf.ec(), a.add(this.Gf)); | |
this.wa = !0 | |
} | |
}; | |
fi.prototype.copyLinkProperties = function(a, b) { | |
if (null !== a && null !== b) { | |
b.Yp = a.Yp; | |
b.OA = a.OA; | |
var c = a.lf; | |
if (c === tj || c === uj) c = vj; | |
b.lf = c; | |
b.Ox = a.Ox; | |
b.jc = a.jc; | |
b.points = a.points; | |
b.My = a.My; | |
b.Yq = a.Yq; | |
b.Gb = a.Gb; | |
b.sm = a.sm; | |
b.zu = a.zu; | |
b.Au = a.Au; | |
b.Hb = a.Hb; | |
b.Jm = a.Jm; | |
b.uv = a.uv; | |
b.vv = a.vv | |
} | |
}; | |
fi.prototype.doDeactivate = function() { | |
this.wa = !1; | |
var a = this.g; | |
null !== a && (a.remove(this.Gf), a.remove(this.ge), a.remove(this.he), a.qf = !1, a.sc = "", this.ll()) | |
}; | |
fi.prototype.doStop = function() { | |
dj.prototype.doStop.call(this); | |
this.pc = null | |
}; | |
fi.prototype.doMouseUp = function() { | |
if (this.wa) { | |
var a = this.g; | |
if (null === a) return; | |
this.Tf = null; | |
var b = this.bh, | |
c = this.dh, | |
d = this.eh, | |
e = this.fh, | |
g = this.vc; | |
this.Rf = this.findTargetPort(this.de); | |
if (null !== this.Rf) { | |
var h = this.Rf.Y; | |
h instanceof G && (this.de ? (d = h, e = this.Rf) : (b = h, c = this.Rf)) | |
} else this.Cq ? this.de ? e = d = null : c = b = null : g = null; | |
null !== g ? (this.reconnectLink(g, this.de ? d : b, this.de ? e : c, this.de), null === this.Rf && (this.de ? g.jq = a.U.ha : g.iq = a.U.ha, g.ec()), a.Jf && (g.jb = !0), this.Tf = this.name, a.Ja("LinkRelinked", g, this.de ? | |
this.fh : this.dh)) : this.doNoRelink(this.vc, this.de); | |
wj(this.vc, this.dE) | |
} | |
this.stopTool() | |
}; | |
fi.prototype.reconnectLink = function(a, b, c, d) { | |
if (null === this.g) return !1; | |
c = null !== c && null !== c.yd ? c.yd : ""; | |
d ? (a.ba = b, a.jh = c) : (a.$ = b, a.hg = c); | |
return !0 | |
}; | |
fi.prototype.doNoRelink = function() {}; | |
function Zi(a, b, c, d, e) { | |
null !== a.g && (null !== b ? (a.copyPortProperties(b, c, a.ge, a.yo, !1), a.g.add(a.ge)) : a.g.remove(a.ge), null !== d ? (a.copyPortProperties(d, e, a.he, a.zo, !0), a.g.add(a.he)) : a.g.remove(a.he)) | |
} | |
function xj() { | |
0 < arguments.length && D.zd(xj); | |
Zg.call(this); | |
this.name = "LinkReshaping"; | |
var a = new z; | |
a.Kb = "Rectangle"; | |
a.Ea = Zd; | |
a.fill = "lightblue"; | |
a.stroke = "dodgerblue"; | |
this.Gl = a; | |
a = new z; | |
a.Kb = "Diamond"; | |
a.Ea = Zd; | |
a.fill = "lightblue"; | |
a.stroke = "dodgerblue"; | |
this.RD = a; | |
this.jE = 3; | |
this.kz = this.pc = null; | |
this.Bp = new N; | |
this.Pw = null | |
} | |
D.Ta(xj, Zg); | |
D.ka("LinkReshapingTool", xj); | |
var Qj; | |
xj.None = Qj = D.s(xj, "None", 0); | |
var Rj; | |
xj.Horizontal = Rj = D.s(xj, "Horizontal", 1); | |
var Sj; | |
xj.Vertical = Sj = D.s(xj, "Vertical", 2); | |
var Tj; | |
xj.All = Tj = D.s(xj, "All", 3); | |
xj.prototype.getReshapingBehavior = xj.prototype.PF = function(a) { | |
return a && a.jA ? a.jA : Qj | |
}; | |
xj.prototype.setReshapingBehavior = xj.prototype.ov = function(a, b) { | |
D.l(a, O, xj, "setReshapingBehavior:obj"); | |
D.Da(b, xj, xj, "setReshapingBehavior:behavior"); | |
a.jA = b | |
}; | |
xj.prototype.updateAdornments = function(a) { | |
if (null !== a && a instanceof J) { | |
if (a.jb && null !== this.g && !this.g.qb) { | |
var b = a.path; | |
if (null !== b && a.canReshape() && a.aa.H() && a.isVisible() && b.aa.H() && b.Sj()) { | |
var c = a.nq(this.name); | |
if (null === c || c.YD !== a.ta || c.ME !== a.jv) c = this.makeAdornment(b), null !== c && (c.YD = a.ta, c.ME = a.jv, a.dm(this.name, c)); | |
if (null !== c) { | |
c.location = a.position; | |
return | |
} | |
} | |
} | |
a.Xj(this.name) | |
} | |
}; | |
xj.prototype.makeAdornment = function(a) { | |
var b = a.Y, | |
c = b.ta, | |
d = b.ic, | |
e = null; | |
if (null !== b.points && 1 < c) { | |
e = new da; | |
e.type = sj; | |
var c = b.tu, | |
g = b.oy, | |
h = d ? 1 : 0; | |
if (b.jv && b.lf !== Uj) | |
for (var k = c + h; k < g - h; k++) { | |
var l = this.makeResegmentHandle(a, k); | |
null !== l && (l.We = k, l.VB = .5, l.aB = 999, e.add(l)) | |
} | |
for (k = c + 1; k < g; k++) | |
if (l = this.makeHandle(a, k), null !== l) { | |
l.We = k; | |
if (k !== c) | |
if (k === c + 1 && d) { | |
var h = b.m(c), | |
m = b.m(c + 1); | |
Q(h.x, m.x) && Q(h.y, m.y) && (m = b.m(c - 1)); | |
Q(h.x, m.x) ? (this.ov(l, Sj), l.cursor = "n-resize") : Q(h.y, m.y) && (this.ov(l, Rj), l.cursor = "w-resize") | |
} else k === | |
g - 1 && d ? (h = b.m(g - 1), m = b.m(g), Q(h.x, m.x) && Q(h.y, m.y) && (h = b.m(g + 1)), Q(h.x, m.x) ? (this.ov(l, Sj), l.cursor = "n-resize") : Q(h.y, m.y) && (this.ov(l, Rj), l.cursor = "w-resize")) : k !== g && (this.ov(l, Tj), l.cursor = "move"); | |
e.add(l) | |
} | |
e.Bb = a | |
} | |
return e | |
}; | |
xj.prototype.makeHandle = function() { | |
var a = this.Eu; | |
return null === a ? null : a.copy() | |
}; | |
D.defineProperty(xj, { | |
Eu: "handleArchetype" | |
}, function() { | |
return this.Gl | |
}, function(a) { | |
null !== a && D.l(a, O, xj, "handleArchetype"); | |
this.Gl = a | |
}); | |
xj.prototype.makeResegmentHandle = function() { | |
var a = this.MJ; | |
return null === a ? null : a.copy() | |
}; | |
D.defineProperty(xj, { | |
MJ: "midHandleArchetype" | |
}, function() { | |
return this.RD | |
}, function(a) { | |
null !== a && D.l(a, O, xj, "midHandleArchetype"); | |
this.RD = a | |
}); | |
D.w(xj, { | |
handle: "handle" | |
}, function() { | |
return this.pc | |
}); | |
D.w(xj, { | |
cu: "adornedLink" | |
}, function() { | |
return this.kz | |
}); | |
xj.prototype.canStart = function() { | |
if (!this.isEnabled) return !1; | |
var a = this.g; | |
return null !== a && !a.qb && a.Cx && a.U.left ? null !== this.findToolHandleAt(a.Pc.ha, this.name) : !1 | |
}; | |
xj.prototype.doActivate = function() { | |
var a = this.g; | |
if (null !== a && (this.pc = this.findToolHandleAt(a.Pc.ha, this.name), null !== this.pc)) { | |
var b = this.pc.Y.hf; | |
if (b instanceof J) { | |
this.kz = b; | |
a.qf = !0; | |
this.Nb(this.name); | |
if (b.jv && 999 === this.pc.aB) { | |
var c = b.points.copy(), | |
d = this.pc.fb(mc); | |
c.ce(this.pc.We + 1, d); | |
b.ic && c.ce(this.pc.We + 1, d); | |
b.points = c; | |
b.qe(); | |
this.pc = this.findToolHandleAt(a.Pc.ha, this.name); | |
if (null === this.pc) { | |
this.doDeactivate(); | |
return | |
} | |
} | |
this.Bp = b.m(this.pc.We); | |
this.Pw = b.points.copy(); | |
this.wa = !0 | |
} | |
} | |
}; | |
xj.prototype.doDeactivate = function() { | |
this.ll(); | |
this.kz = this.pc = null; | |
var a = this.g; | |
null !== a && (a.qf = !1); | |
this.wa = !1 | |
}; | |
xj.prototype.doCancel = function() { | |
var a = this.cu; | |
null !== a && (a.points = this.Pw); | |
this.stopTool() | |
}; | |
xj.prototype.doMouseMove = function() { | |
var a = this.g; | |
this.wa && null !== a && (a = this.computeReshape(a.U.ha), this.reshape(a)) | |
}; | |
xj.prototype.doMouseUp = function() { | |
var a = this.g; | |
if (this.wa && null !== a) { | |
var b = this.computeReshape(a.U.ha); | |
this.reshape(b); | |
b = this.cu; | |
if (null !== b && b.jv) { | |
var c = this.handle.We, | |
d = b.m(c - 1), | |
e = b.m(c), | |
g = b.m(c + 1); | |
if (b.ic) { | |
if (c > b.tu + 1 && c < b.oy - 1) { | |
var h = b.m(c - 2); | |
if (Math.abs(d.x - e.x) < this.Wh && Math.abs(d.y - e.y) < this.Wh && (Vj(this, h, d, e, g, !0) || Vj(this, h, d, e, g, !1))) { | |
var k = b.points.copy(); | |
Vj(this, h, d, e, g, !0) ? (k.ug(c - 2, new N(h.x, (g.y + h.y) / 2)), k.ug(c + 1, new N(g.x, (g.y + h.y) / 2))) : (k.ug(c - 2, new N((g.x + h.x) / 2, h.y)), k.ug(c + 1, | |
new N((g.x + h.x) / 2, g.y))); | |
k.pd(c); | |
k.pd(c - 1); | |
b.points = k; | |
b.qe() | |
} else h = b.m(c + 2), Math.abs(e.x - g.x) < this.Wh && Math.abs(e.y - g.y) < this.Wh && (Vj(this, d, e, g, h, !0) || Vj(this, d, e, g, h, !1)) && (k = b.points.copy(), Vj(this, d, e, g, h, !0) ? (k.ug(c - 1, new N(d.x, (d.y + h.y) / 2)), k.ug(c + 2, new N(h.x, (d.y + h.y) / 2))) : (k.ug(c - 1, new N((d.x + h.x) / 2, d.y)), k.ug(c + 2, new N((d.x + h.x) / 2, h.y))), k.pd(c + 1), k.pd(c), b.points = k, b.qe()) | |
} | |
} else h = D.P(), db(d.x, d.y, g.x, g.y, e.x, e.y, h) && h.Kf(e) < this.Wh * this.Wh && (k = b.points.copy(), k.pd(c), b.points = k, b.qe()), | |
D.A(h) | |
} | |
a.Qc(); | |
this.Tf = this.name; | |
a.Ja("LinkReshaped", this.cu, this.Pw) | |
} | |
this.stopTool() | |
}; | |
function Vj(a, b, c, d, e, g) { | |
return g ? Math.abs(b.y - c.y) < a.Wh && Math.abs(c.y - d.y) < a.Wh && Math.abs(d.y - e.y) < a.Wh : Math.abs(b.x - c.x) < a.Wh && Math.abs(c.x - d.x) < a.Wh && Math.abs(d.x - e.x) < a.Wh | |
} | |
D.defineProperty(xj, { | |
Wh: "resegmentingDistance" | |
}, function() { | |
return this.jE | |
}, function(a) { | |
D.h(a, "number", xj, "resegmentingDistance"); | |
this.jE = a | |
}); | |
xj.prototype.reshape = function(a) { | |
var b = this.cu; | |
b.Fm(); | |
var c = this.handle.We, | |
d = this.PF(this.handle); | |
if (b.ic) | |
if (c === b.tu + 1) c = b.tu + 1, d === Sj ? (b.ia(c, b.m(c - 1).x, a.y), b.ia(c + 1, b.m(c + 2).x, a.y)) : d === Rj && (b.ia(c, a.x, b.m(c - 1).y), b.ia(c + 1, a.x, b.m(c + 2).y)); | |
else if (c === b.oy - 1) c = b.oy - 1, d === Sj ? (b.ia(c - 1, b.m(c - 2).x, a.y), b.ia(c, b.m(c + 1).x, a.y)) : d === Rj && (b.ia(c - 1, a.x, b.m(c - 2).y), b.ia(c, a.x, b.m(c + 1).y)); | |
else { | |
var d = c, | |
e = b.m(d), | |
g = b.m(d - 1), | |
h = b.m(d + 1); | |
Q(g.x, e.x) && Q(e.y, h.y) ? (Q(g.x, b.m(d - 2).x) && !Q(g.y, b.m(d - 2).y) ? (b.B(d, a.x, | |
g.y), c++, d++) : b.ia(d - 1, a.x, g.y), Q(h.y, b.m(d + 2).y) && !Q(h.x, b.m(d + 2).x) ? b.B(d + 1, h.x, a.y) : b.ia(d + 1, h.x, a.y)) : Q(g.y, e.y) && Q(e.x, h.x) ? (Q(g.y, b.m(d - 2).y) && !Q(g.x, b.m(d - 2).x) ? (b.B(d, g.x, a.y), c++, d++) : b.ia(d - 1, g.x, a.y), Q(h.x, b.m(d + 2).x) && !Q(h.y, b.m(d + 2).y) ? b.B(d + 1, a.x, h.y) : b.ia(d + 1, a.x, h.y)) : Q(g.x, e.x) && Q(e.x, h.x) ? (Q(g.x, b.m(d - 2).x) && !Q(g.y, b.m(d - 2).y) ? (b.B(d, a.x, g.y), c++, d++) : b.ia(d - 1, a.x, g.y), Q(h.x, b.m(d + 2).x) && !Q(h.y, b.m(d + 2).y) ? b.B(d + 1, a.x, h.y) : b.ia(d + 1, a.x, h.y)) : Q(g.y, e.y) && Q(e.y, h.y) && (Q(g.y, b.m(d - | |
2).y) && !Q(g.x, b.m(d - 2).x) ? (b.B(d, g.x, a.y), c++, d++) : b.ia(d - 1, g.x, a.y), Q(h.y, b.m(d + 2).y) && !Q(h.x, b.m(d + 2).x) ? b.B(d + 1, h.x, a.y) : b.ia(d + 1, h.x, a.y)); | |
b.ia(c, a.x, a.y) | |
} else b.ia(c, a.x, a.y), e = b.$, g = b.oc, null !== e && (d = e.findVisibleNode(), null !== d && d !== e && (e = d, g = e.port)), 1 === c && b.computeSpot(!0, g).ee() && (d = g.fb(mc, D.P()), e = b.getLinkPointFromPoint(e, g, d, a, !0, D.P()), b.ia(0, e.x, e.y), D.A(d), D.A(e)), e = b.ba, g = b.Gc, null !== e && (d = e.findVisibleNode(), null !== d && d !== e && (e = d, g = e.port)), c === b.ta - 2 && b.computeSpot(!1, g).ee() && | |
(d = g.fb(mc, D.P()), e = b.getLinkPointFromPoint(e, g, d, a, !1, D.P()), b.ia(b.ta - 1, e.x, e.y), D.A(d), D.A(e)); | |
b.Ej() | |
}; | |
xj.prototype.computeReshape = function(a) { | |
var b = this.cu, | |
c = this.handle.We; | |
switch (this.PF(this.handle)) { | |
case Tj: | |
return a; | |
case Sj: | |
return b = b.m(c), new N(b.x, a.y); | |
case Rj: | |
return b = b.m(c), new N(a.x, b.y); | |
default: | |
case Qj: | |
return b.m(c) | |
} | |
}; | |
D.w(xj, { | |
pM: "originalPoint" | |
}, function() { | |
return this.Bp | |
}); | |
D.w(xj, { | |
qM: "originalPoints" | |
}, function() { | |
return this.Pw | |
}); | |
function Wj() { | |
0 < arguments.length && D.zd(Wj); | |
Zg.call(this); | |
this.name = "Resizing"; | |
this.oi = (new Ca(1, 1)).freeze(); | |
this.ni = (new Ca(9999, 9999)).freeze(); | |
this.gk = (new Ca(NaN, NaN)).freeze(); | |
this.os = !1; | |
this.Tc = null; | |
var a = new z; | |
a.Gh = mc; | |
a.Kb = "Rectangle"; | |
a.Ea = Zd; | |
a.fill = "lightblue"; | |
a.stroke = "dodgerblue"; | |
a.mb = 1; | |
a.cursor = "pointer"; | |
this.Gl = a; | |
this.pc = null; | |
this.Bp = new N; | |
this.$D = new Ca; | |
this.eE = new N; | |
this.Nz = new Ca(0, 0); | |
this.Mz = new Ca(Infinity, Infinity); | |
this.Lz = new Ca(1, 1); | |
this.XD = !0 | |
} | |
D.Ta(Wj, Zg); | |
D.ka("ResizingTool", Wj); | |
Wj.prototype.updateAdornments = function(a) { | |
if (!(null === a || a instanceof J)) { | |
if (a.jb && null !== this.g && !this.g.qb) { | |
var b = a.PG; | |
if (null !== b && a.canResize() && a.aa.H() && a.isVisible() && b.aa.H() && b.Sj()) { | |
var c = a.nq(this.name); | |
if (null === c || c.Bb !== b) c = this.makeAdornment(b); | |
if (null !== c) { | |
var d = b.tm(); | |
c.angle = d; | |
var e = b.fb(c.Of, D.P()), | |
g = b.Jj(); | |
c.location = e; | |
D.A(e); | |
e = c.placeholder; | |
if (null !== e) { | |
var b = b.Ga, | |
h = D.Im(); | |
h.n(b.width * g, b.height * g); | |
e.Ea = h; | |
D.$k(h) | |
} | |
this.updateResizeHandles(c, d); | |
a.dm(this.name, c); | |
return | |
} | |
} | |
} | |
a.Xj(this.name) | |
} | |
}; | |
Wj.prototype.makeAdornment = function(a) { | |
var b = null, | |
b = a.Y.OG; | |
if (null === b) { | |
b = new da; | |
b.type = Xj; | |
b.Of = mc; | |
var c = new Yj; | |
c.Ve = !0; | |
b.add(c); | |
b.add(this.makeHandle(a, ec)); | |
b.add(this.makeHandle(a, kc)); | |
b.add(this.makeHandle(a, vc)); | |
b.add(this.makeHandle(a, tc)); | |
b.add(this.makeHandle(a, $c)); | |
b.add(this.makeHandle(a, fd)); | |
b.add(this.makeHandle(a, gd)); | |
b.add(this.makeHandle(a, ed)) | |
} else if (Sh(b), b = b.copy(), null === b) return null; | |
b.Bb = a; | |
return b | |
}; | |
Wj.prototype.makeHandle = function(a, b) { | |
var c = this.Eu; | |
if (null === c) return null; | |
c = c.copy(); | |
c.alignment = b; | |
return c | |
}; | |
Wj.prototype.updateResizeHandles = function(a, b) { | |
if (null !== a) | |
if (!a.alignment.ld() && ("pointer" === a.cursor || 0 < a.cursor.indexOf("resize"))) a: { | |
var c = a.alignment;c.ee() && (c = mc); | |
var d = b; | |
if (0 >= c.x) d = 0 >= c.y ? d + 225 : 1 <= c.y ? d + 135 : d + 180; | |
else if (1 <= c.x) 0 >= c.y ? d += 315 : 1 <= c.y && (d += 45); | |
else if (0 >= c.y) d += 270; | |
else if (1 <= c.y) d += 90; | |
else break a;0 > d ? d += 360 : 360 <= d && (d -= 360);a.cursor = 22.5 > d ? "e-resize" : 67.5 > d ? "se-resize" : 112.5 > d ? "s-resize" : 157.5 > d ? "sw-resize" : 202.5 > d ? "w-resize" : 247.5 > d ? "nw-resize" : 292.5 > d ? "n-resize" : 337.5 > d ? | |
"ne-resize" : "e-resize" | |
} | |
else if (a instanceof x) | |
for (c = a.elements; c.next();) this.updateResizeHandles(c.value, b) | |
}; | |
D.defineProperty(Wj, { | |
Eu: "handleArchetype" | |
}, function() { | |
return this.Gl | |
}, function(a) { | |
null !== a && D.l(a, O, Wj, "handleArchetype"); | |
this.Gl = a | |
}); | |
D.w(Wj, { | |
handle: "handle" | |
}, function() { | |
return this.pc | |
}); | |
D.defineProperty(Wj, { | |
Bb: "adornedObject" | |
}, function() { | |
return this.Tc | |
}, function(a) { | |
null !== a && D.l(a, O, Wj, "adornedObject"); | |
this.Tc = a | |
}); | |
Wj.prototype.canStart = function() { | |
if (!this.isEnabled) return !1; | |
var a = this.g; | |
return null !== a && !a.qb && a.fu && a.U.left ? null !== this.findToolHandleAt(a.Pc.ha, this.name) : !1 | |
}; | |
Wj.prototype.doActivate = function() { | |
var a = this.g; | |
null !== a && (this.pc = this.findToolHandleAt(a.Pc.ha, this.name), null !== this.pc && (this.Tc = this.pc.Y.Bb, this.Bp.set(this.Bb.fb(this.handle.alignment.BG())), this.eE.set(this.Tc.Y.location), this.$D.set(this.Tc.Ea), this.Lz = this.computeCellSize(), this.Nz = this.computeMinSize(), this.Mz = this.computeMaxSize(), a.qf = !0, this.XD = a.Ra.isEnabled, a.Ra.isEnabled = !1, this.Nb(this.name), this.wa = !0)) | |
}; | |
Wj.prototype.doDeactivate = function() { | |
var a = this.g; | |
null !== a && (this.ll(), this.Tc = this.pc = null, this.wa = a.qf = !1, a.Ra.isEnabled = this.XD) | |
}; | |
Wj.prototype.doCancel = function() { | |
null !== this.Bb && (this.Bb.Ea = this.CG, this.Bb.Y.location = this.WJ); | |
this.stopTool() | |
}; | |
Wj.prototype.doMouseMove = function() { | |
var a = this.g; | |
if (this.wa && null !== a) { | |
var b = this.Nz, | |
c = this.Mz, | |
d = this.Lz, | |
e = this.Bb.NF(a.U.ha, D.P()), | |
g = this.computeReshape(), | |
b = this.computeResize(e, this.handle.alignment, b, c, d, g); | |
this.resize(b); | |
a.lg(); | |
D.A(e) | |
} | |
}; | |
Wj.prototype.doMouseUp = function() { | |
var a = this.g; | |
if (this.wa && null !== a) { | |
var b = this.Nz, | |
c = this.Mz, | |
d = this.Lz, | |
e = this.Bb.NF(a.U.ha, D.P()), | |
g = this.computeReshape(), | |
b = this.computeResize(e, this.handle.alignment, b, c, d, g); | |
this.resize(b); | |
D.A(e); | |
a.Qc(); | |
this.Tf = this.name; | |
a.Ja("PartResized", this.Bb, this.CG) | |
} | |
this.stopTool() | |
}; | |
Wj.prototype.resize = function(a) { | |
var b = this.g; | |
if (null !== b) { | |
var c = this.Bb, | |
d = c.Y; | |
c.Ea = a.size; | |
d.mf(); | |
a = this.Bb.fb(this.handle.alignment.BG()); | |
d instanceof I ? (c = new K(F), c.add(d), b.moveParts(c, this.Bp.copy().$j(a), !0)) : d.location = d.location.copy().$j(a).add(this.Bp) | |
} | |
}; | |
Wj.prototype.computeResize = function(a, b, c, d, e, g) { | |
b.ee() && (b = mc); | |
var h = this.Bb.Ga, | |
k = h.x, | |
l = h.y, | |
m = h.x + h.width, | |
n = h.y + h.height, | |
p = 1; | |
if (!g) { | |
var p = h.width, | |
q = h.height; | |
0 >= p && (p = 1); | |
0 >= q && (q = 1); | |
p = q / p | |
} | |
q = D.P(); | |
gb(a.x, a.y, k, l, e.width, e.height, q); | |
a = h.copy(); | |
0 >= b.x ? 0 >= b.y ? (a.x = Math.max(q.x, m - d.width), a.x = Math.min(a.x, m - c.width), a.width = Math.max(m - a.x, c.width), a.y = Math.max(q.y, n - d.height), a.y = Math.min(a.y, n - c.height), a.height = Math.max(n - a.y, c.height), g || (b = a.height / a.width, p < b ? (a.height = p * a.width, a.y = n - a.height) : (a.width = | |
a.height / p, a.x = m - a.width))) : 1 <= b.y ? (a.x = Math.max(q.x, m - d.width), a.x = Math.min(a.x, m - c.width), a.width = Math.max(m - a.x, c.width), a.height = Math.max(Math.min(q.y - l, d.height), c.height), g || (b = a.height / a.width, p < b ? a.height = p * a.width : (a.width = a.height / p, a.x = m - a.width))) : (a.x = Math.max(q.x, m - d.width), a.x = Math.min(a.x, m - c.width), a.width = m - a.x, g || (a.height = p * a.width, a.y = l + .5 * (n - l - a.height))) : 1 <= b.x ? 0 >= b.y ? (a.width = Math.max(Math.min(q.x - k, d.width), c.width), a.y = Math.max(q.y, n - d.height), a.y = Math.min(a.y, n - c.height), | |
a.height = Math.max(n - a.y, c.height), g || (b = a.height / a.width, p < b ? (a.height = p * a.width, a.y = n - a.height) : a.width = a.height / p)) : 1 <= b.y ? (a.width = Math.max(Math.min(q.x - k, d.width), c.width), a.height = Math.max(Math.min(q.y - l, d.height), c.height), g || (b = a.height / a.width, p < b ? a.height = p * a.width : a.width = a.height / p)) : (a.width = Math.max(Math.min(q.x - k, d.width), c.width), g || (a.height = p * a.width, a.y = l + .5 * (n - l - a.height))) : 0 >= b.y ? (a.y = Math.max(q.y, n - d.height), a.y = Math.min(a.y, n - c.height), a.height = n - a.y, g || (a.width = a.height / p, a.x = | |
k + .5 * (m - k - a.width))) : 1 <= b.y && (a.height = Math.max(Math.min(q.y - l, d.height), c.height), g || (a.width = a.height / p, a.x = k + .5 * (m - k - a.width))); | |
D.A(q); | |
return a | |
}; | |
Wj.prototype.computeReshape = function() { | |
var a = Zj; | |
this.Bb instanceof z && (a = ak(this.Bb)); | |
return !(a === bk || a === ck || null !== this.g && this.g.U.shift) | |
}; | |
Wj.prototype.computeMinSize = function() { | |
var a = this.Bb.ah.copy(), | |
b = this.ah; | |
!isNaN(b.width) && b.width > a.width && (a.width = b.width); | |
!isNaN(b.height) && b.height > a.height && (a.height = b.height); | |
return a | |
}; | |
Wj.prototype.computeMaxSize = function() { | |
var a = this.Bb.rf.copy(), | |
b = this.rf; | |
!isNaN(b.width) && b.width < a.width && (a.width = b.width); | |
!isNaN(b.height) && b.height < a.height && (a.height = b.height); | |
return a | |
}; | |
Wj.prototype.computeCellSize = function() { | |
var a = new Ca(NaN, NaN), | |
b = this.Bb.Y; | |
if (null !== b) { | |
var c = b.eK; | |
!isNaN(c.width) && 0 < c.width && (a.width = c.width); | |
!isNaN(c.height) && 0 < c.height && (a.height = c.height) | |
} | |
c = this.bq; | |
isNaN(a.width) && !isNaN(c.width) && 0 < c.width && (a.width = c.width); | |
isNaN(a.height) && !isNaN(c.height) && 0 < c.height && (a.height = c.height); | |
b = this.g; | |
(isNaN(a.width) || isNaN(a.height)) && b && (c = b.ob.Ge, null !== c && c.Lu && (c = c.VF, isNaN(a.width) && !isNaN(c.width) && 0 < c.width && (a.width = c.width), isNaN(a.height) && !isNaN(c.height) && | |
0 < c.height && (a.height = c.height)), b = b.Xn, null !== b && b.visible && this.Lu && (c = b.by, isNaN(a.width) && !isNaN(c.width) && 0 < c.width && (a.width = c.width), isNaN(a.height) && !isNaN(c.height) && 0 < c.height && (a.height = c.height))); | |
if (isNaN(a.width) || 0 === a.width || Infinity === a.width) a.width = 1; | |
if (isNaN(a.height) || 0 === a.height || Infinity === a.height) a.height = 1; | |
return a | |
}; | |
D.defineProperty(Wj, { | |
ah: "minSize" | |
}, function() { | |
return this.oi | |
}, function(a) { | |
D.l(a, Ca, Wj, "minSize"); | |
if (!this.oi.O(a)) { | |
var b = a.width; | |
isNaN(b) && (b = 0); | |
a = a.height; | |
isNaN(a) && (a = 0); | |
this.oi.n(b, a) | |
} | |
}); | |
D.defineProperty(Wj, { | |
rf: "maxSize" | |
}, function() { | |
return this.ni | |
}, function(a) { | |
D.l(a, Ca, Wj, "maxSize"); | |
if (!this.ni.O(a)) { | |
var b = a.width; | |
isNaN(b) && (b = Infinity); | |
a = a.height; | |
isNaN(a) && (a = Infinity); | |
this.ni.n(b, a) | |
} | |
}); | |
D.defineProperty(Wj, { | |
bq: "cellSize" | |
}, function() { | |
return this.gk | |
}, function(a) { | |
D.l(a, Ca, Wj, "cellSize"); | |
this.gk.O(a) || this.gk.assign(a) | |
}); | |
D.defineProperty(Wj, { | |
Lu: "isGridSnapEnabled" | |
}, function() { | |
return this.os | |
}, function(a) { | |
D.h(a, "boolean", Wj, "isGridSnapEnabled"); | |
this.os = a | |
}); | |
D.w(Wj, { | |
CG: "originalDesiredSize" | |
}, function() { | |
return this.$D | |
}); | |
D.w(Wj, { | |
WJ: "originalLocation" | |
}, function() { | |
return this.eE | |
}); | |
function dk() { | |
0 < arguments.length && D.zd(dk); | |
Zg.call(this); | |
this.name = "Rotating"; | |
this.pE = 45; | |
this.oE = 2; | |
this.Tc = null; | |
var a = new z; | |
a.Kb = "Ellipse"; | |
a.Ea = $d; | |
a.fill = "lightblue"; | |
a.stroke = "dodgerblue"; | |
a.mb = 1; | |
a.cursor = "pointer"; | |
this.Gl = a; | |
this.pc = null; | |
this.Ow = 0; | |
this.kE = new N | |
} | |
D.Ta(dk, Zg); | |
D.ka("RotatingTool", dk); | |
dk.prototype.updateAdornments = function(a) { | |
if (null !== a) { | |
if (a instanceof J) { | |
var b = a.SB; | |
if (b === a || b === a.path || b.Ve) return | |
} | |
if (a.jb && null !== this.g && !this.g.qb && (b = a.SB, null !== b && a.canRotate() && a.aa.H() && a.isVisible() && b.aa.H() && b.Sj())) { | |
var c = a.nq(this.name); | |
if (null === c || c.Bb !== b) c = this.makeAdornment(b); | |
if (null !== c) { | |
c.angle = b.tm(); | |
var d = null, | |
e = null; | |
b === a || b === a.Df ? (d = a.Df, e = a.Of) : (d = b, e = mc); | |
for (var g = d.Ga, e = D.Fb(g.width * e.x + e.offsetX, g.height * e.y + e.offsetY); null !== d && d !== b;) d.transform.vb(e), d = d.R; | |
var d = | |
e.y, | |
g = Math.max(e.x - b.Ga.width, 0), | |
h = D.P(); | |
c.location = b.fb(new S(1, 0, 50 + g, d), h); | |
D.A(h); | |
D.A(e); | |
a.dm(this.name, c); | |
return | |
} | |
} | |
a.Xj(this.name) | |
} | |
}; | |
dk.prototype.makeAdornment = function(a) { | |
var b = null, | |
b = a.Y.gK; | |
if (null === b) { | |
b = new da; | |
b.type = ek; | |
b.Of = mc; | |
var c = this.Eu; | |
null !== c && b.add(c.copy()) | |
} else if (Sh(b), b = b.copy(), null === b) return null; | |
b.Bb = a; | |
return b | |
}; | |
D.defineProperty(dk, { | |
Eu: "handleArchetype" | |
}, function() { | |
return this.Gl | |
}, function(a) { | |
null !== a && D.l(a, O, dk, "handleArchetype"); | |
this.Gl = a | |
}); | |
D.w(dk, { | |
handle: "handle" | |
}, function() { | |
return this.pc | |
}); | |
D.defineProperty(dk, { | |
Bb: "adornedObject" | |
}, function() { | |
return this.Tc | |
}, function(a) { | |
null !== a && D.l(a, O, dk, "adornedObject"); | |
this.Tc = a | |
}); | |
dk.prototype.canStart = function() { | |
if (!this.isEnabled) return !1; | |
var a = this.g; | |
return null !== a && !a.qb && a.Dx && a.U.left ? null !== this.findToolHandleAt(a.Pc.ha, this.name) : !1 | |
}; | |
dk.prototype.doActivate = function() { | |
var a = this.g; | |
if (null !== a && (this.pc = this.findToolHandleAt(a.Pc.ha, this.name), null !== this.pc)) { | |
this.Tc = this.pc.Y.Bb; | |
var b = this.Tc.Y, | |
c = b.Df; | |
this.kE = this.Tc === b || this.Tc === c ? c.fb(b.Of) : this.Tc.fb(mc); | |
this.Ow = this.Tc.angle; | |
a.qf = !0; | |
a.QA = !0; | |
this.Nb(this.name); | |
this.wa = !0 | |
} | |
}; | |
dk.prototype.doDeactivate = function() { | |
var a = this.g; | |
null !== a && (this.ll(), this.Tc = this.pc = null, this.wa = a.qf = !1) | |
}; | |
dk.prototype.doCancel = function() { | |
var a = this.g; | |
null !== a && (a.QA = !1); | |
this.rotate(this.Ow); | |
this.stopTool() | |
}; | |
dk.prototype.doMouseMove = function() { | |
var a = this.g; | |
this.wa && null !== a && (a = this.computeRotate(a.U.ha), this.rotate(a)) | |
}; | |
dk.prototype.doMouseUp = function() { | |
var a = this.g; | |
if (this.wa && null !== a) { | |
a.QA = !1; | |
var b = this.computeRotate(a.U.ha); | |
this.rotate(b); | |
a.Qc(); | |
this.Tf = this.name; | |
a.Ja("PartRotated", this.Tc, this.Ow) | |
} | |
this.stopTool() | |
}; | |
dk.prototype.rotate = function(a) { | |
v && D.p(a, dk, "rotate:newangle"); | |
null !== this.Tc && (this.Tc.angle = a) | |
}; | |
dk.prototype.computeRotate = function(a) { | |
a = this.kE.Xb(a); | |
var b = this.Tc.R; | |
null !== b && (a -= b.tm(), 360 <= a ? a -= 360 : 0 > a && (a += 360)); | |
var b = Math.min(Math.abs(this.uK), 180), | |
c = Math.min(Math.abs(this.tK), b / 2); | |
(null === this.g || !this.g.U.shift) && 0 < b && 0 < c && (a % b < c ? a = Math.floor(a / b) * b : a % b > b - c && (a = (Math.floor(a / b) + 1) * b)); | |
360 <= a ? a -= 360 : 0 > a && (a += 360); | |
return a | |
}; | |
D.defineProperty(dk, { | |
uK: "snapAngleMultiple" | |
}, function() { | |
return this.pE | |
}, function(a) { | |
D.h(a, "number", dk, "snapAngleMultiple"); | |
this.pE = a | |
}); | |
D.defineProperty(dk, { | |
tK: "snapAngleEpsilon" | |
}, function() { | |
return this.oE | |
}, function(a) { | |
D.h(a, "number", dk, "snapAngleEpsilon"); | |
this.oE = a | |
}); | |
D.w(dk, { | |
oM: "originalAngle" | |
}, function() { | |
return this.Ow | |
}); | |
function fk() { | |
Zg.call(this); | |
0 < arguments.length && D.zd(fk); | |
this.name = "ClickSelecting" | |
} | |
D.Ta(fk, Zg); | |
D.ka("ClickSelectingTool", fk); | |
fk.prototype.canStart = function() { | |
return !this.isEnabled || null === this.g || this.isBeyondDragSize() ? !1 : !0 | |
}; | |
fk.prototype.doMouseUp = function() { | |
this.wa && (this.standardMouseSelect(), !this.standardMouseClick() && null !== this.g && this.g.U.Qj && this.g.ob.doToolTip()); | |
this.stopTool() | |
}; | |
function gk() { | |
Zg.call(this); | |
0 < arguments.length && D.zd(gk); | |
this.name = "Action"; | |
this.Eo = null | |
} | |
D.Ta(gk, Zg); | |
D.ka("ActionTool", gk); | |
gk.prototype.canStart = function() { | |
if (!this.isEnabled) return !1; | |
var a = this.g; | |
if (null === a) return !1; | |
var b = a.U, | |
c = a.Je(b.ha, function(a) { | |
for (; null !== a.R && !a.Hu;) a = a.R; | |
return a | |
}); | |
if (null !== c) { | |
if (!c.Hu) return !1; | |
this.Eo = c; | |
a.Qo = a.Je(b.ha, null, null); | |
return !0 | |
} | |
return !1 | |
}; | |
gk.prototype.doMouseDown = function() { | |
if (this.wa) { | |
var a = this.g.U, | |
b = this.Eo; | |
null !== b && (a.Oe = b, null !== b.PE && b.PE(a, b)) | |
} else this.canStart() && this.doActivate() | |
}; | |
gk.prototype.doMouseMove = function() { | |
if (this.wa) { | |
var a = this.g.U, | |
b = this.Eo; | |
null !== b && (a.Oe = b, null !== b.QE && b.QE(a, b)) | |
} | |
}; | |
gk.prototype.doMouseUp = function() { | |
if (this.wa) { | |
var a = this.g, | |
b = a.U, | |
c = this.Eo; | |
if (null === c) return; | |
b.Oe = c; | |
null !== c.RE && c.RE(b, c); | |
this.isBeyondDragSize() || Zh(c, b, a) | |
} | |
this.stopTool() | |
}; | |
gk.prototype.doCancel = function() { | |
var a = this.g; | |
if (null !== a) { | |
var a = a.U, | |
b = this.Eo; | |
if (null === b) return; | |
a.Oe = b; | |
null !== b.OE && b.OE(a, b) | |
} | |
this.stopTool() | |
}; | |
gk.prototype.doStop = function() { | |
this.Eo = null | |
}; | |
function ta() { | |
Zg.call(this); | |
0 < arguments.length && D.zd(ta); | |
this.name = "ClickCreating"; | |
this.zl = null; | |
this.ED = !0; | |
this.sD = new N(0, 0) | |
} | |
D.Ta(ta, Zg); | |
D.ka("ClickCreatingTool", ta); | |
ta.prototype.canStart = function() { | |
if (!this.isEnabled || null === this.EA) return !1; | |
var a = this.g; | |
if (null === a || a.qb || a.Mf || !a.Zp || !a.U.left || this.isBeyondDragSize()) return !1; | |
if (this.lJ) { | |
if (1 === a.U.Ee && (this.sD = a.U.Sd.copy()), 2 !== a.U.Ee || this.isBeyondDragSize(this.sD)) return !1 | |
} else if (1 !== a.U.Ee) return !1; | |
return a.eb !== this && null !== a.su(a.U.ha, !0) ? !1 : !0 | |
}; | |
ta.prototype.doMouseUp = function() { | |
var a = this.g; | |
this.wa && null !== a && this.insertPart(a.U.ha); | |
this.stopTool() | |
}; | |
ta.prototype.insertPart = function(a) { | |
var b = this.g; | |
if (null === b) return null; | |
var c = this.EA; | |
if (null === c) return null; | |
this.Nb(this.name); | |
var d = null; | |
c instanceof F ? c.re() && (Sh(c), d = c.copy(), null !== d && b.add(d)) : null !== c && (c = b.da.copyNodeData(c), D.Qa(c) && (b.da.em(c), d = b.Nh(c))); | |
null !== d && (d.location = a, b.Jf && b.select(d)); | |
b.Qc(); | |
this.Tf = this.name; | |
b.Ja("PartCreated", d); | |
this.ll(); | |
return d | |
}; | |
D.defineProperty(ta, { | |
EA: "archetypeNodeData" | |
}, function() { | |
return this.zl | |
}, function(a) { | |
null !== a && D.l(a, Object, ta, "archetypeNodeData"); | |
this.zl = a | |
}); | |
D.defineProperty(ta, { | |
lJ: "isDoubleClick" | |
}, function() { | |
return this.ED | |
}, function(a) { | |
D.h(a, "boolean", ta, "isDoubleClick"); | |
this.ED = a | |
}); | |
function hk() { | |
this.JE = this.PD = this.Uz = this.oA = null | |
} | |
D.ka("HTMLInfo", hk); | |
D.defineProperty(hk, { | |
xB: "mainElement" | |
}, function() { | |
return this.PD | |
}, function(a) { | |
null !== a && D.l(a, HTMLElement, hk, "mainElement"); | |
this.PD = a | |
}); | |
D.defineProperty(hk, { | |
show: "show" | |
}, function() { | |
return this.oA | |
}, function(a) { | |
this.oA !== a && (null !== a && D.h(a, "function", hk, "show"), this.oA = a) | |
}); | |
D.defineProperty(hk, { | |
Yn: "hide" | |
}, function() { | |
return this.Uz | |
}, function(a) { | |
this.Uz !== a && (null !== a && D.h(a, "function", hk, "hide"), this.Uz = a) | |
}); | |
D.defineProperty(hk, { | |
sC: "valueFunction" | |
}, function() { | |
return this.JE | |
}, function(a) { | |
this.JE = a | |
}); | |
function ik(a, b, c) { | |
this.text = a; | |
this.gF = b; | |
this.visible = c | |
} | |
function jk() { | |
Zg.call(this); | |
0 < arguments.length && D.zd(jk); | |
this.name = "ContextMenu"; | |
this.XC = this.xz = this.UC = null; | |
this.VD = new N; | |
this.zz = this.Um = null; | |
var a = this; | |
this.vA = function() { | |
a.stopTool() | |
}; | |
kk(this) | |
} | |
D.Ta(jk, Zg); | |
D.ka("ContextMenuTool", jk); | |
function kk(a) { | |
var b = new hk; | |
b.show = function(a, b, c) { | |
c.showDefaultContextMenu() | |
}; | |
b.Yn = function(a, b) { | |
b.hideDefaultContextMenu() | |
}; | |
a.Um = b; | |
a.vA = function() { | |
a.stopTool() | |
}; | |
if (!1 === D.nF) { | |
var b = D.createElement("div"), | |
c = D.createElement("div"); | |
b.style.cssText = "top: 0px;z-index:10002;position: fixed;display: none;text-align: center;left: 25%;width: 50%;background-color: #F5F5F5;padding: 16px;border: 16px solid #444;border-radius: 10px;margin-top: 10px"; | |
c.style.cssText = "z-index:10001;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;opacity: 0.8;"; | |
var d = D.createElement("style"); | |
window.document.getElementsByTagName("head")[0].appendChild(d); | |
d.sheet.insertRule(".goCXul { list-style: none; }", 0); | |
d.sheet.insertRule(".goCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }", 0); | |
d.sheet.insertRule(".goCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }", 0); | |
b.addEventListener("contextmenu", lk, !1); | |
b.addEventListener("selectstart", lk, !1); | |
c.addEventListener("contextmenu", lk, !1); | |
window.document.body && (window.document.body.appendChild(b), window.document.body.appendChild(c)); | |
D.ku = b; | |
D.ju = c; | |
D.nF = !0 | |
} | |
} | |
function lk(a) { | |
a.preventDefault(); | |
return !1 | |
} | |
jk.prototype.canStart = function() { | |
if (!this.isEnabled) return !1; | |
var a = this.g; | |
return null === a || this.isBeyondDragSize() || !a.U.right ? !1 : null !== this.Um && a.U.Qj || null !== this.findObjectWithContextMenu() ? !0 : !1 | |
}; | |
jk.prototype.doStart = function() { | |
var a = this.g; | |
null !== a && this.VD.set(a.Pc.ha) | |
}; | |
jk.prototype.doStop = function() { | |
this.hideContextMenu(); | |
this.Nx = null | |
}; | |
jk.prototype.findObjectWithContextMenu = function(a) { | |
void 0 === a && (a = null); | |
var b = this.g; | |
if (null === b) return null; | |
var c = b.U, | |
d = null; | |
a instanceof E || (d = a instanceof O ? a : b.Je(c.ha, null, function(a) { | |
return !a.layer.Yc | |
})); | |
if (null !== d) { | |
for (a = d; null !== a;) { | |
if (null !== a.contextMenu) return a; | |
a = a.R | |
} | |
if (null !== this.Um && b.U.Qj) return d.Y | |
} else if (null !== b.contextMenu) return b; | |
return null | |
}; | |
jk.prototype.doActivate = function() {}; | |
jk.prototype.doMouseDown = function() { | |
Zg.prototype.doMouseDown.call(this); | |
null !== this.g && this.g.ob.sf.contains(this) && mk(this) | |
}; | |
jk.prototype.doMouseUp = function() { | |
mk(this) | |
}; | |
function mk(a) { | |
var b = a.g; | |
if (null !== b) | |
if (a.wa) { | |
var c = a.mm; | |
if (null !== c) { | |
if (!(c instanceof hk)) { | |
var d = b.Je(b.U.ha, null, null); | |
null !== d && d.ym(c) && a.standardMouseClick(null, null) | |
} | |
a.stopTool(); | |
a.canStart() && (b.eb = a, a.doMouseUp()) | |
} | |
} else a.canStart() && (Yh(a, !0), a.wa || a.stopTool()) | |
} | |
function Yh(a, b, c) { | |
void 0 === c && (c = null); | |
b && a.standardMouseSelect(); | |
if (!a.standardMouseClick()) | |
if (a.wa = !0, b = a.Um, null === c && (c = a.findObjectWithContextMenu()), null !== c) { | |
var d = c.contextMenu; | |
null !== d ? (a.Nx = c instanceof O ? c : null, a.showContextMenu(d, a.Nx)) : null !== b && a.showContextMenu(b, a.Nx) | |
} else null !== b && a.showContextMenu(b, null) | |
} | |
jk.prototype.doMouseMove = function() { | |
this.wa && null !== this.g && this.g.ob.doMouseMove() | |
}; | |
jk.prototype.showContextMenu = function(a, b) { | |
!v || a instanceof da || a instanceof hk || D.k("showContextMenu:contextMenu must be an Adornment or HTMLInfo."); | |
null !== b && D.l(b, O, jk, "showContextMenu:obj"); | |
var c = this.g; | |
if (null !== c) { | |
a !== this.mm && this.hideContextMenu(); | |
if (a instanceof da) { | |
a.Nf = "Tool"; | |
a.jl = !1; | |
a.scale = 1 / c.scale; | |
a.Ld = this.name; | |
null !== a.placeholder && (a.placeholder.scale = c.scale); | |
c.add(a); | |
if (null !== b) { | |
var c = null, | |
d = b.rm(); | |
null !== d && (c = d.data); | |
a.Bb = b; | |
a.data = c | |
} else a.data = c.da; | |
a.mf(); | |
this.positionContextMenu(a, | |
b) | |
} else a instanceof hk && a.show(b, c, this); | |
this.mm = a | |
} | |
}; | |
jk.prototype.positionContextMenu = function(a) { | |
if (null === a.placeholder) { | |
var b = this.g; | |
if (null !== b) { | |
var c = b.U.ha.copy(), | |
d = a.Fa, | |
e = b.wb; | |
b.U.Qj && (c.x -= d.width); | |
c.x + d.width > e.right && (c.x -= d.width + 5); | |
c.x < e.x && (c.x = e.x); | |
c.y + d.height > e.bottom && (c.y -= d.height + 5); | |
c.y < e.y && (c.y = e.y); | |
a.position = c | |
} | |
} | |
}; | |
jk.prototype.hideContextMenu = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = this.mm; | |
null !== b && (b instanceof da ? (a.remove(b), null !== this.xz && this.xz.Xj(b.Ld), b.data = null, b.Bb = null) : b instanceof hk && (null !== b.Yn ? b.Yn(a, this) : null !== b.xB && (b.xB.style.display = "none")), this.mm = null, this.standardMouseOver()) | |
} | |
}; | |
function nk(a) { | |
if (null === a.g) return null; | |
a = new K(ik); | |
a.add(new ik("Copy", function(a) { | |
a.yb.copySelection() | |
}, function(a) { | |
return a.yb.canCopySelection() | |
})); | |
a.add(new ik("Cut", function(a) { | |
a.yb.cutSelection() | |
}, function(a) { | |
return a.yb.canCutSelection() | |
})); | |
a.add(new ik("Delete", function(a) { | |
a.yb.deleteSelection() | |
}, function(a) { | |
return a.yb.canDeleteSelection() | |
})); | |
a.add(new ik("Paste", function(a) { | |
a.yb.pasteSelection(a.U.ha) | |
}, function(a) { | |
return a.yb.canPasteSelection() | |
})); | |
a.add(new ik("Select All", function(a) { | |
a.yb.selectAll() | |
}, | |
function(a) { | |
return a.yb.canSelectAll() | |
})); | |
a.add(new ik("Undo", function(a) { | |
a.yb.undo() | |
}, function(a) { | |
return a.yb.canUndo() | |
})); | |
a.add(new ik("Redo", function(a) { | |
a.yb.redo() | |
}, function(a) { | |
return a.yb.canRedo() | |
})); | |
a.add(new ik("Scroll To Part", function(a) { | |
a.yb.scrollToPart() | |
}, function(a) { | |
return a.yb.canScrollToPart() | |
})); | |
a.add(new ik("Zoom To Fit", function(a) { | |
a.yb.zoomToFit() | |
}, function(a) { | |
return a.yb.canZoomToFit() | |
})); | |
a.add(new ik("Reset Zoom", function(a) { | |
a.yb.resetZoom() | |
}, function(a) { | |
return a.yb.canResetZoom() | |
})); | |
a.add(new ik("Group Selection", function(a) { | |
a.yb.groupSelection() | |
}, function(a) { | |
return a.yb.canGroupSelection() | |
})); | |
a.add(new ik("Ungroup Selection", function(a) { | |
a.yb.ungroupSelection() | |
}, function(a) { | |
return a.yb.canUngroupSelection() | |
})); | |
a.add(new ik("Edit Text", function(a) { | |
a.yb.editTextBlock() | |
}, function(a) { | |
return a.yb.canEditTextBlock() | |
})); | |
return a | |
} | |
jk.prototype.showDefaultContextMenu = function() { | |
var a = this.g; | |
if (null !== a) { | |
null === this.zz && (this.zz = nk(this)); | |
D.ku.innerHTML = ""; | |
D.ju.addEventListener("click", this.vA, !1); | |
var b = this, | |
c = D.createElement("ul"); | |
c.className = "goCXul"; | |
D.ku.appendChild(c); | |
c.innerHTML = ""; | |
for (var d = this.zz.j; d.next();) { | |
var e = d.value, | |
g = e.visible; | |
if ("function" === typeof e.gF && ("function" !== typeof g || g(a))) { | |
g = D.createElement("li"); | |
g.className = "goCXli"; | |
var h = D.createElement("a"); | |
h.className = "goCXa"; | |
h.href = "#"; | |
h.BH = e.gF; | |
h.addEventListener("click", | |
function(c) { | |
this.BH(a); | |
b.stopTool(); | |
c.preventDefault(); | |
return !1 | |
}, !1); | |
h.textContent = e.text; | |
g.appendChild(h); | |
c.appendChild(g) | |
} | |
} | |
D.ku.style.display = "block"; | |
D.ju.style.display = "block" | |
} | |
}; | |
jk.prototype.hideDefaultContextMenu = function() { | |
null !== this.mm && this.mm === this.Um && (D.ku.style.display = "none", D.ju.style.display = "none", D.ju.removeEventListener("click", this.vA, !1), this.mm = null) | |
}; | |
D.defineProperty(jk, { | |
mm: "currentContextMenu" | |
}, function() { | |
return this.UC | |
}, function(a) { | |
!v || null === a || a instanceof da || a instanceof hk || D.k("ContextMenuTool.currentContextMenu must be an Adornment or HTMLInfo."); | |
this.UC = a; | |
this.xz = a instanceof da ? a.hf : null | |
}); | |
D.defineProperty(jk, { | |
HL: "defaultTouchContextMenu" | |
}, function() { | |
return this.Um | |
}, function(a) { | |
!v || null === a || a instanceof da || a instanceof hk || D.k("ContextMenuTool.defaultTouchContextMenu must be an Adornment or HTMLInfo."); | |
this.Um = a | |
}); | |
D.defineProperty(jk, { | |
Nx: "currentObject" | |
}, function() { | |
return this.XC | |
}, function(a) { | |
null !== a && D.l(a, O, jk, "currentObject"); | |
this.XC = a | |
}); | |
D.w(jk, { | |
jM: "mouseDownPoint" | |
}, function() { | |
return this.VD | |
}); | |
function ok() { | |
Zg.call(this); | |
0 < arguments.length && D.zd(ok); | |
this.name = "DragSelecting"; | |
this.Wo = 175; | |
this.KD = !1; | |
var a = new F; | |
a.Nf = "Tool"; | |
a.jl = !1; | |
var b = new z; | |
b.name = "SHAPE"; | |
b.Kb = "Rectangle"; | |
b.fill = null; | |
b.stroke = "magenta"; | |
a.add(b); | |
this.Qm = a | |
} | |
D.Ta(ok, Zg); | |
D.ka("DragSelectingTool", ok); | |
ok.prototype.canStart = function() { | |
if (!this.isEnabled) return !1; | |
var a = this.g; | |
if (null === a || !a.Jf) return !1; | |
var b = a.U; | |
return !b.left || a.eb !== this && (!this.isBeyondDragSize() || b.timestamp - a.Pc.timestamp < this.oF || null !== a.su(b.ha, !0)) ? !1 : !0 | |
}; | |
ok.prototype.doActivate = function() { | |
var a = this.g; | |
null !== a && (this.wa = !0, a.qf = !0, a.lb = !0, a.add(this.Jh), this.doMouseMove()) | |
}; | |
ok.prototype.doDeactivate = function() { | |
var a = this.g; | |
null !== a && (Di(a), a.remove(this.Jh), a.lb = !1, this.wa = a.qf = !1) | |
}; | |
ok.prototype.doMouseMove = function() { | |
var a = this.g; | |
if (null !== a && this.wa && null !== this.Jh) { | |
var b = this.computeBoxBounds(), | |
c = this.Jh.Nd("SHAPE"); | |
null === c && (c = this.Jh.Md()); | |
c.Ea = b.size; | |
this.Jh.position = b.position; | |
(a.Be || a.Ce) && a.SA(a.U.Sd) | |
} | |
}; | |
ok.prototype.doMouseUp = function() { | |
if (this.wa) { | |
var a = this.g; | |
a.remove(this.Jh); | |
try { | |
a.sc = "wait", this.selectInRect(this.computeBoxBounds()) | |
} finally { | |
a.sc = "" | |
} | |
} | |
this.stopTool() | |
}; | |
ok.prototype.computeBoxBounds = function() { | |
var a = this.g; | |
return null === a ? new C(0, 0, 0, 0) : new C(a.Pc.ha, a.U.ha) | |
}; | |
ok.prototype.selectInRect = function(a) { | |
var b = this.g; | |
if (null !== b) { | |
var c = b.U; | |
b.Ja("ChangingSelection"); | |
a = b.Yk(a, null, function(a) { | |
return a instanceof F ? a.canSelect() : !1 | |
}, this.sJ); | |
if (D.Qh ? c.Xu : c.control) | |
if (c.shift) | |
for (a = a.j; a.next();) c = a.value, c.jb && (c.jb = !1); | |
else | |
for (a = a.j; a.next();) c = a.value, c.jb = !c.jb; | |
else { | |
if (!c.shift) { | |
for (var c = new K(F), d = b.selection.j; d.next();) { | |
var e = d.value; | |
a.contains(e) || c.add(e) | |
} | |
for (c = c.j; c.next();) c.value.jb = !1 | |
} | |
for (a = a.j; a.next();) c = a.value, c.jb || (c.jb = !0) | |
} | |
b.Ja("ChangedSelection") | |
} | |
}; | |
D.defineProperty(ok, { | |
oF: "delay" | |
}, function() { | |
return this.Wo | |
}, function(a) { | |
D.h(a, "number", ok, "delay"); | |
this.Wo = a | |
}); | |
D.defineProperty(ok, { | |
sJ: "isPartialInclusion" | |
}, function() { | |
return this.KD | |
}, function(a) { | |
D.h(a, "boolean", ok, "isPartialInclusion"); | |
this.KD = a | |
}); | |
D.defineProperty(ok, { | |
Jh: "box" | |
}, function() { | |
return this.Qm | |
}, function(a) { | |
null !== a && D.l(a, F, ok, "box"); | |
this.Qm = a | |
}); | |
function pk() { | |
Zg.call(this); | |
0 < arguments.length && D.zd(pk); | |
this.name = "Panning"; | |
this.gA = new N; | |
this.fk = !1; | |
var a = this; | |
this.tE = function() { | |
window.document.removeEventListener("scroll", a.tE, !1); | |
a.stopTool() | |
} | |
} | |
D.Ta(pk, Zg); | |
D.ka("PanningTool", pk); | |
pk.prototype.canStart = function() { | |
if (!this.isEnabled) return !1; | |
var a = this.g; | |
return null === a || !a.Be && !a.Ce || !a.U.left || a.eb !== this && !this.isBeyondDragSize() ? !1 : !0 | |
}; | |
pk.prototype.doActivate = function() { | |
var a = this.g; | |
null !== a && (this.fk ? (a.U.bubbles = !0, window.document.addEventListener("scroll", this.tE, !1)) : (a.sc = "move", a.qf = !0, this.gA = a.position.copy()), this.wa = !0) | |
}; | |
pk.prototype.doDeactivate = function() { | |
var a = this.g; | |
null !== a && (a.sc = "", this.wa = a.qf = !1) | |
}; | |
pk.prototype.doCancel = function() { | |
var a = this.g; | |
null !== a && (a.position = this.gA, a.qf = !1); | |
this.stopTool() | |
}; | |
pk.prototype.doMouseMove = function() { | |
this.move() | |
}; | |
pk.prototype.doMouseUp = function() { | |
this.move(); | |
this.stopTool() | |
}; | |
pk.prototype.move = function() { | |
var a = this.g; | |
if (this.wa && a) | |
if (this.fk) a.U.bubbles = !0; | |
else { | |
var b = a.position, | |
c = a.Pc.ha, | |
d = a.U.ha, | |
e = b.x + c.x - d.x, | |
c = b.y + c.y - d.y; | |
a.Be || (e = b.x); | |
a.Ce || (c = b.y); | |
a.position = new N(e, c) | |
} | |
}; | |
D.defineProperty(pk, { | |
bubbles: "bubbles" | |
}, function() { | |
return this.fk | |
}, function(a) { | |
D.h(a, "boolean", pk, "bubbles"); | |
this.fk = a | |
}); | |
D.w(pk, { | |
rM: "originalPosition" | |
}, function() { | |
return this.gA | |
}); | |
function qk() { | |
0 < arguments.length && D.zd(qk); | |
Zg.call(this); | |
this.name = "TextEditing"; | |
this.tA = this.Jk = null; | |
this.sE = rk; | |
this.$l = null; | |
this.$a = sk; | |
this.bt = null; | |
this.SD = 1; | |
this.mE = !0; | |
var a = new hk; | |
this.ZC = null; | |
this.gD = a; | |
this.Az = null; | |
tk(this, a) | |
} | |
D.ka("TextEditingTool", qk); | |
D.Ta(qk, Zg); | |
var uk; | |
qk.LostFocus = uk = D.s(qk, "LostFocus", 0); | |
var vk; | |
qk.MouseDown = vk = D.s(qk, "MouseDown", 1); | |
var wk; | |
qk.Tab = wk = D.s(qk, "Tab", 2); | |
var xk; | |
qk.Enter = xk = D.s(qk, "Enter", 3); | |
qk.SingleClick = D.s(qk, "SingleClick", 0); | |
var rk; | |
qk.SingleClickSelected = rk = D.s(qk, "SingleClickSelected", 1); | |
var yk; | |
qk.DoubleClick = yk = D.s(qk, "DoubleClick", 2); | |
var sk; | |
qk.StateNone = sk = D.s(qk, "StateNone", 0); | |
var zk; | |
qk.StateActive = zk = D.s(qk, "StateActive", 1); | |
var Ak; | |
qk.StateEditing = Ak = D.s(qk, "StateEditing", 2); | |
var Bk; | |
qk.StateValidating = Bk = D.s(qk, "StateValidating", 3); | |
var Ck; | |
qk.StateInvalid = Ck = D.s(qk, "StateInvalid", 4); | |
var Dk; | |
qk.StateValidated = Dk = D.s(qk, "StateValidated", 5); | |
function tk(a, b) { | |
var c = D.createElement("textarea"); | |
a.Az = c; | |
c.addEventListener("input", function() { | |
if (null !== a.ih) { | |
var b = a.JJ(this.value), | |
c = this.zK; | |
this.style.width = 20 + b.Fa.width * c + "px"; | |
this.style.height = 10 + b.Fa.height * c + "px"; | |
this.rows = b.vB | |
} | |
}, !1); | |
c.addEventListener("keydown", function(b) { | |
if (null !== a.ih) { | |
var c = b.which; | |
13 === c ? (!1 === a.ih.ky && b.preventDefault(), a.acceptText(xk)) : 9 === c ? (a.acceptText(wk), b.preventDefault()) : 27 === c && (a.doCancel(), null !== a.g && a.g.doFocus()) | |
} | |
}, !1); | |
c.addEventListener("focus", function() { | |
Ek(a) | |
}, !1); | |
c.addEventListener("blur", function() { | |
Fk(a) | |
}, !1); | |
b.sC = function() { | |
return c.value | |
}; | |
b.xB = c; | |
b.show = function(a, b, g) { | |
if (g.state === Ck) c.style.border = "3px solid red", c.focus(); | |
else { | |
var h = a.fb(mc), | |
k = b.position, | |
l = b.scale, | |
m = a.Jj() * l; | |
m < g.wG && (m = g.wG); | |
var n = a.Ga.width * m + 6, | |
p = a.Ga.height * m + 2, | |
q = (h.x - k.x) * l, | |
h = (h.y - k.y) * l; | |
c.value = a.text; | |
b.Hj.style.font = a.font; | |
c.style.position = " absolute"; | |
c.style.zIndex = "100"; | |
c.style.font = "inherit"; | |
c.style.fontSize = " " + 100 * m + "%"; | |
c.style.lineHeight = " normal"; | |
c.style.width = " " + n + "px"; | |
c.style.height = " " + p + "px"; | |
c.style.left = " " + ((q - n / 2 | 0) - 1) + "px"; | |
c.style.top = " " + ((h - p / 2 | 0) - 1) + "px"; | |
c.style.text = "align: " + a.textAlign + ""; | |
c.style.margin = " 0"; | |
c.style.padding = " 1px"; | |
c.style.border = " 0"; | |
c.style.outline = " none"; | |
c.style.white = "space: pre-wrap"; | |
c.style.overflow = " hidden"; | |
c.zK = m; | |
b.Hj.appendChild(c); | |
c.focus(); | |
g.Qy && (c.select(), c.setSelectionRange(0, 9999)) | |
} | |
}; | |
b.Yn = function(a) { | |
a.Hj.removeChild(c) | |
} | |
} | |
D.defineProperty(qk, { | |
ih: "textBlock" | |
}, function() { | |
return this.tA | |
}, function(a) { | |
null !== a && D.l(a, pa, qk, "textBlock"); | |
this.tA = a | |
}); | |
D.defineProperty(qk, { | |
Fj: "currentTextEditor" | |
}, function() { | |
return this.ZC | |
}, function(a) { | |
this.ZC = a | |
}); | |
D.defineProperty(qk, { | |
vI: "defaultTextEditor" | |
}, function() { | |
return this.gD | |
}, function(a) { | |
!v || a instanceof HTMLElement || a instanceof hk || D.k("TextEditingTool.defaultTextEditor must be an Element or HTMLInfo."); | |
this.gD = a | |
}); | |
D.defineProperty(qk, { | |
gH: "starting" | |
}, function() { | |
return this.sE | |
}, function(a) { | |
D.Da(a, qk, qk, "starting"); | |
this.sE = a | |
}); | |
qk.prototype.canStart = function() { | |
if (!this.isEnabled) return !1; | |
var a = this.g; | |
if (null === a || a.qb || !a.U.left || this.isBeyondDragSize()) return !1; | |
var b = a.Je(a.U.ha); | |
if (!(null !== b && b instanceof pa && b.VA && b.Y.canEdit())) return !1; | |
b = b.Y; | |
return null === b || this.gH === rk && !b.jb || this.gH === yk && 2 > a.U.Ee ? !1 : !0 | |
}; | |
qk.prototype.doStart = function() { | |
this.wa || null === this.ih || this.doActivate() | |
}; | |
qk.prototype.doActivate = function() { | |
if (!this.wa) { | |
var a = this.g; | |
if (null !== a) { | |
var b = this.ih; | |
null === b && (b = a.Je(a.U.ha)); | |
if (null !== b && b instanceof pa && (this.ih = b, null !== b.Y)) { | |
this.wa = !0; | |
this.$a = zk; | |
var c = this.vI; | |
null !== b.kH && (c = b.kH); | |
this.Jk = this.ih.copy(); | |
var d = new C(this.ih.fb(ec), this.ih.fb(vc)); | |
a.UG(d); | |
if (c instanceof hk) c.show(b, a, this); | |
else { | |
c.style.position = "absolute"; | |
c.style.zIndex = "100"; | |
c.textEditingTool = this; | |
if ("function" === typeof c.onActivate) c.onActivate(); | |
a.Hj.appendChild(c); | |
"function" === typeof c.focus && | |
c.focus(); | |
"function" === typeof c.select && this.Qy && (c.select(), c.setSelectionRange(0, 9999)) | |
} | |
this.Fj = c | |
} | |
} | |
} | |
}; | |
qk.prototype.doCancel = function() { | |
null !== this.bt && this.Fj instanceof HTMLElement && (this.Fj.style.border = this.bt, this.bt = null); | |
this.stopTool() | |
}; | |
qk.prototype.doMouseUp = function() { | |
!this.wa && this.canStart() && this.doActivate() | |
}; | |
qk.prototype.doMouseDown = function() { | |
this.wa && this.acceptText(vk) | |
}; | |
qk.prototype.acceptText = function(a) { | |
switch (a) { | |
case vk: | |
if (this.$a === Dk) this.Fj instanceof HTMLElement && this.Fj.focus(); | |
else if (this.$a === zk || this.$a === Ck || this.$a === Ak) this.$a = Bk, Gk(this); | |
break; | |
case uk: | |
case xk: | |
case wk: | |
if (xk === a && !0 === this.tA.ky) break; | |
if (this.$a === zk || this.$a === Ck || this.$a === Ak) this.$a = Bk, Gk(this) | |
} | |
}; | |
function Gk(a) { | |
var b = a.ih, | |
c = a.g, | |
d = a.Fj; | |
if (null !== b && null !== d) { | |
var e = b.text, | |
g = ""; | |
d instanceof hk ? null !== d.sC && (g = d.sC()) : (g = d.value, g = "function" === typeof g ? g() : g); | |
a.isValidText(b, e, g) ? (a.Nb(a.name), a.$a = Dk, a.Tf = a.name, b.text = g, null !== b.jH && b.jH(b, e, g), null !== c && c.Ja("TextEdited", b, e), a.ll(), a.stopTool(), null !== c && c.doFocus()) : (a.$a = Ck, null !== b.XA && b.XA(a, e, g), d instanceof hk ? d.show(b, c, a) : (null === a.bt && (a.bt = d.style.border, d.style.border = "3px solid red"), "function" === typeof d.focus && d.focus())) | |
} | |
} | |
qk.prototype.doDeactivate = function() { | |
var a = this.g; | |
if (null !== a) { | |
this.$a = sk; | |
this.ih = null; | |
if (null !== this.Fj) { | |
var b = this.Fj; | |
if (b instanceof hk) b.Yn(a, this); | |
else { | |
if ("function" === typeof b.onDeactivate) b.onDeactivate(); | |
null !== b && a.Hj.removeChild(b) | |
} | |
} | |
this.wa = !1 | |
} | |
}; | |
qk.prototype.doFocus = function() { | |
v && D.Qn("TextEditingTool.doFocus", "2.0"); | |
Ek(this) | |
}; | |
qk.prototype.doBlur = function() { | |
v && D.Qn("TextEditingTool.doBlur", "2.0"); | |
Fk(this) | |
}; | |
function Ek(a) { | |
if (null !== a.Fj && a.state !== sk) { | |
var b = a.Az; | |
a.$a === zk && (a.$a = Ak); | |
"function" === typeof b.select && a.Qy && (b.select(), b.setSelectionRange(0, 9999)) | |
} | |
} | |
function Fk(a) { | |
if (null !== a.Fj && a.state !== sk) { | |
var b = a.Az; | |
"function" === typeof b.focus && b.focus(); | |
"function" === typeof b.select && a.Qy && (b.select(), b.setSelectionRange(0, 9999)) | |
} | |
} | |
qk.prototype.isValidText = function(a, b, c) { | |
D.l(a, pa, qk, "isValidText:textblock"); | |
var d = this.iC; | |
if (null !== d && !d(a, b, c)) return !1; | |
d = a.iC; | |
return null === d || d(a, b, c) ? !0 : !1 | |
}; | |
D.defineProperty(qk, { | |
iC: "textValidation" | |
}, function() { | |
return this.$l | |
}, function(a) { | |
null !== a && D.h(a, "function", qk, "textValidation"); | |
this.$l = a | |
}); | |
D.defineProperty(qk, { | |
wG: "minimumEditorScale" | |
}, function() { | |
return this.SD | |
}, function(a) { | |
null !== a && D.h(a, "number", qk, "minimumEditorScale"); | |
this.SD = a | |
}); | |
D.defineProperty(qk, { | |
Qy: "selectsTextOnActivate" | |
}, function() { | |
return this.mE | |
}, function(a) { | |
null !== a && D.h(a, "boolean", qk, "selectsTextOnActivate"); | |
this.mE = a | |
}); | |
D.defineProperty(qk, { | |
state: "state" | |
}, function() { | |
return this.$a | |
}, function(a) { | |
this.$a !== a && (D.Da(a, qk, qk, "starting"), this.$a = a) | |
}); | |
qk.prototype.measureTemporaryTextBlock = qk.prototype.JJ = function(a) { | |
var b = this.Jk; | |
b.text = a; | |
Hk(b, this.ih.rp, Infinity); | |
return b | |
}; | |
function Ph() { | |
Zg.call(this); | |
this.name = "ToolManager"; | |
this.GH = new K(Zg); | |
this.HH = new K(Zg); | |
this.IH = new K(Zg); | |
this.wD = this.xD = 850; | |
this.lD = (new Ca(2, 2)).Oa(); | |
this.FE = 5E3; | |
this.WD = ai; | |
this.uD = Ik; | |
this.Xv = this.$C = null; | |
this.An = -1 | |
} | |
D.Ta(Ph, Zg); | |
D.ka("ToolManager", Ph); | |
var ai; | |
Ph.WheelScroll = ai = D.s(Ph, "WheelScroll", 0); | |
var $h; | |
Ph.WheelZoom = $h = D.s(Ph, "WheelZoom", 1); | |
Ph.WheelNone = D.s(Ph, "WheelNone", 2); | |
var Ik; | |
Ph.GestureZoom = Ik = D.s(Ph, "GestureZoom", 3); | |
var Jk; | |
Ph.GestureCancel = Jk = D.s(Ph, "GestureCancel", 4); | |
var Wk; | |
Ph.GestureNone = Wk = D.s(Ph, "GestureNone", 5); | |
D.defineProperty(Ph, { | |
$u: "mouseWheelBehavior" | |
}, function() { | |
return this.WD | |
}, function(a) { | |
D.Da(a, Ph, Ph, "mouseWheelBehavior"); | |
this.WD = a | |
}); | |
D.defineProperty(Ph, { | |
rq: "gestureBehavior" | |
}, function() { | |
return this.uD | |
}, function(a) { | |
D.Da(a, Ph, Ph, "gestureBehavior"); | |
this.uD = a | |
}); | |
Ph.prototype.initializeStandardTools = function() { | |
this.SH = new gk; | |
this.FG = new fi; | |
this.BJ = new xj; | |
this.RG = new Wj; | |
this.iK = new dk; | |
this.sG = new ra; | |
this.Ge = new Uh; | |
this.zI = new ok; | |
this.XJ = new pk; | |
this.LA = new jk; | |
this.hC = new qk; | |
this.eI = new ta; | |
this.fI = new fk | |
}; | |
Ph.prototype.updateAdornments = function(a) { | |
var b = this.nm; | |
if (b instanceof da && this.Xv === a) { | |
var c = b.Bb; | |
(null !== a ? c.Y === a : null === c) ? this.showToolTip(b, c): this.hideToolTip() | |
} | |
}; | |
Ph.prototype.doMouseDown = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.U; | |
b.Qj && this.rq === Jk && (b.bubbles = !1); | |
if (b.Ou) { | |
this.cancelWaitAfter(); | |
if (this.rq === Wk) { | |
b.bubbles = !0; | |
return | |
} | |
if (this.rq === Jk) return; | |
if (a.eb.canStartMultiTouch()) { | |
a.eb.standardPinchZoomStart(); | |
return | |
} | |
} | |
var c = a.na; | |
c.GA && 0 !== c.Ki && D.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero"); | |
for (var c = this.sf.length, d = 0; d < c; d++) { | |
var e = this.sf.fa(d); | |
null === e.g && e.ad(this.g); | |
if (e.canStart()) { | |
a.doFocus(); | |
a.eb = e; | |
a.eb === e && (e.wa || e.doActivate(), e.doMouseDown()); | |
return | |
} | |
} | |
1 === a.U.button && (this.$u === ai ? this.$u = $h : this.$u === $h && (this.$u = ai)); | |
this.doActivate(); | |
this.standardWaitAfter(this.ZF, b) | |
} | |
}; | |
Ph.prototype.doMouseMove = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.U; | |
if (b.Ou) { | |
if (this.rq === Wk) { | |
b.bubbles = !0; | |
return | |
} | |
if (this.rq === Jk) return; | |
if (a.eb.canStartMultiTouch()) { | |
a.eb.standardPinchZoomMove(); | |
return | |
} | |
} | |
if (this.wa) | |
for (var c = this.mg.length, d = 0; d < c; d++) { | |
var e = this.mg.fa(d); | |
null === e.g && e.ad(this.g); | |
if (e.canStart()) { | |
a.doFocus(); | |
a.eb = e; | |
a.eb === e && (e.wa || e.doActivate(), e.doMouseMove()); | |
return | |
} | |
} | |
Xk(this, a); | |
a = b.event; | |
null === a || "mousemove" !== a.type && "pointermove" !== a.type && a.cancelable || (b.bubbles = !0) | |
} | |
}; | |
function Xk(a, b) { | |
a.standardMouseOver(); | |
a.isBeyondDragSize() && a.standardWaitAfter(a.wa ? a.ZF : a.dJ, b.U) | |
} | |
Ph.prototype.doCurrentObjectChanged = function(a, b) { | |
var c = this.nm; | |
null === c || null !== b && c instanceof da && (b === c || b.ym(c)) || this.hideToolTip() | |
}; | |
Ph.prototype.doWaitAfter = function(a) { | |
var b = this.g; | |
null !== b && b.Ib && (this.doMouseHover(), this.wa || this.doToolTip(), a.Qj && !b.U.Cc && (a = a.copy(), a.button = 2, a.buttons = 2, b.U = a, b.Sp = !0, b.doMouseUp())) | |
}; | |
Ph.prototype.doMouseHover = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.U; | |
null === b.Oe && (b.Oe = a.Je(b.ha, null, null)); | |
var c = b.Oe; | |
if (null !== c) | |
for (b.Cc = !1; null !== c;) { | |
a = this.wa ? c.CB : c.DB; | |
if (null !== a && (a(b, c), b.Cc)) break; | |
c = c.R | |
} else c = this.wa ? a.CB : a.DB, null !== c && c(b) | |
} | |
}; | |
Ph.prototype.doToolTip = function() { | |
var a = this.g; | |
if (null !== a) { | |
var b = a.U; | |
null === b.Oe && (b.Oe = a.Je(b.ha, null, null)); | |
b = b.Oe; | |
if (null !== b) { | |
if (a = this.nm, !(a instanceof da) || b !== a && !b.ym(a)) { | |
for (; null !== b;) { | |
a = b.kC; | |
if (null !== a) { | |
this.showToolTip(a, b); | |
return | |
} | |
b = b.R | |
} | |
this.hideToolTip() | |
} | |
} else a = a.kC, null !== a ? this.showToolTip(a, null) : this.hideToolTip() | |
} | |
}; | |
Ph.prototype.showToolTip = function(a, b) { | |
!v || a instanceof da || a instanceof hk || D.k("showToolTip:tooltip must be an Adornment or HTMLInfo."); | |
null !== b && D.l(b, O, Ph, "showToolTip:obj"); | |
var c = this.g; | |
if (null !== c) { | |
a !== this.nm && this.hideToolTip(); | |
if (a instanceof da) { | |
a.Nf = "Tool"; | |
a.jl = !1; | |
a.scale = 1 / c.scale; | |
a.Ld = "ToolTip"; | |
null !== a.placeholder && (a.placeholder.scale = c.scale); | |
c.add(a); | |
if (null !== b) { | |
var c = null, | |
d = b.rm(); | |
null !== d && (c = d.data); | |
a.Bb = b; | |
a.data = c | |
} else a.data = c.da; | |
a.mf(); | |
this.positionToolTip(a, b) | |
} else a instanceof | |
hk && a !== this.nm && a.show(b, c, this); | |
this.nm = a; - 1 !== this.An && (D.clearTimeout(this.An), this.An = -1); | |
c = this.EK; | |
if (0 < c && Infinity !== c) { | |
var e = this; | |
this.An = D.setTimeout(function() { | |
e.hideToolTip() | |
}, c) | |
} | |
} | |
}; | |
Ph.prototype.positionToolTip = function(a) { | |
if (null === a.placeholder) { | |
var b = this.g; | |
if (null !== b) { | |
var c = b.U.ha.copy(), | |
d = a.Fa, | |
e = b.wb; | |
b.U.Qj && (c.x -= d.width); | |
c.x + d.width > e.right && (c.x -= d.width + 5); | |
c.x < e.x && (c.x = e.x); | |
c.y = c.y + 20 + d.height > e.bottom ? c.y - (d.height + 5) : c.y + 20; | |
c.y < e.y && (c.y = e.y); | |
a.position = c | |
} | |
} | |
}; | |
Ph.prototype.hideToolTip = function() { | |
-1 !== this.An && (D.clearTimeout(this.An), this.An = -1); | |
var a = this.g; | |
if (null !== a) { | |
var b = this.nm; | |
null !== b && (b instanceof da ? (a.remove(b), null !== this.Xv && this.Xv.Xj(b.Ld), b.data = null, b.Bb = null) : b instanceof hk && null !== b.Yn && b.Yn(a, this), this.nm = null) | |
} | |
}; | |
D.defineProperty(Ph, { | |
nm: "currentToolTip" | |
}, function() { | |
return this.$C | |
}, function(a) { | |
!v || null === a || a instanceof da || a instanceof hk || D.k("ToolManager.currentToolTip must be an Adornment or HTMLInfo."); | |
this.$C = a; | |
this.Xv = null !== a && a instanceof da ? a.hf : null | |
}); | |
Ph.prototype.doMouseUp = function() { | |
this.cancelWaitAfter(); | |
var a = this.g; | |
if (null !== a) { | |
if (this.wa) | |
for (var b = this.ng.length, c = 0; c < b; c++) { | |
var d = this.ng.fa(c); | |
null === d.g && d.ad(this.g); | |
if (d.canStart()) { | |
a.doFocus(); | |
a.eb = d; | |
a.eb === d && (d.wa || d.doActivate(), d.doMouseUp()); | |
return | |
} | |
} | |
a.doFocus(); | |
this.doDeactivate() | |
} | |
}; | |
Ph.prototype.doMouseWheel = function() { | |
this.standardMouseWheel() | |
}; | |
Ph.prototype.doKeyDown = function() { | |
var a = this.g; | |
null !== a && a.yb.doKeyDown() | |
}; | |
Ph.prototype.doKeyUp = function() { | |
var a = this.g; | |
null !== a && a.yb.doKeyUp() | |
}; | |
Ph.prototype.doCancel = function() { | |
null !== di && di.doCancel(); | |
Zg.prototype.doCancel.call(this) | |
}; | |
Ph.prototype.findTool = function(a) { | |
D.h(a, "string", Ph, "findTool:name"); | |
for (var b = this.sf.length, c = 0; c < b; c++) { | |
var d = this.sf.fa(c); | |
if (d.name === a) return d | |
} | |
b = this.mg.length; | |
for (c = 0; c < b; c++) | |
if (d = this.mg.fa(c), d.name === a) return d; | |
b = this.ng.length; | |
for (c = 0; c < b; c++) | |
if (d = this.ng.fa(c), d.name === a) return d; | |
return null | |
}; | |
Ph.prototype.replaceTool = function(a, b) { | |
D.h(a, "string", Ph, "replaceTool:name"); | |
null !== b && (D.l(b, Zg, Ph, "replaceTool:newtool"), b.g && b.g !== this.g && D.k("Cannot share tools between Diagrams: " + b.toString()), b.ad(this.g)); | |
for (var c = this.sf.length, d = 0; d < c; d++) { | |
var e = this.sf.fa(d); | |
if (e.name === a) return null !== b ? this.sf.ug(d, b) : this.sf.pd(d), e | |
} | |
c = this.mg.length; | |
for (d = 0; d < c; d++) | |
if (e = this.mg.fa(d), e.name === a) return null !== b ? this.mg.ug(d, b) : this.mg.pd(d), e; | |
c = this.ng.length; | |
for (d = 0; d < c; d++) | |
if (e = this.ng.fa(d), e.name === | |
a) return null !== b ? this.ng.ug(d, b) : this.ng.pd(d), e; | |
return null | |
}; | |
function Yk(a, b, c, d) { | |
D.h(b, "string", Ph, "replaceStandardTool:name"); | |
D.l(d, K, Ph, "replaceStandardTool:list"); | |
null !== c && (D.l(c, Zg, Ph, "replaceStandardTool:newtool"), c.g && c.g !== a.g && D.k("Cannot share tools between Diagrams: " + c.toString()), c.name = b, c.ad(a.g)); | |
a.findTool(b) ? a.replaceTool(b, c) : null !== c && d.add(c) | |
} | |
D.w(Ph, { | |
sf: "mouseDownTools" | |
}, function() { | |
return this.GH | |
}); | |
D.w(Ph, { | |
mg: "mouseMoveTools" | |
}, function() { | |
return this.HH | |
}); | |
D.w(Ph, { | |
ng: "mouseUpTools" | |
}, function() { | |
return this.IH | |
}); | |
D.defineProperty(Ph, { | |
dJ: "hoverDelay" | |
}, function() { | |
return this.xD | |
}, function(a) { | |
D.h(a, "number", Ph, "hoverDelay"); | |
this.xD = a | |
}); | |
D.defineProperty(Ph, { | |
ZF: "holdDelay" | |
}, function() { | |
return this.wD | |
}, function(a) { | |
D.h(a, "number", Ph, "holdDelay"); | |
this.wD = a | |
}); | |
D.defineProperty(Ph, { | |
AI: "dragSize" | |
}, function() { | |
return this.lD | |
}, function(a) { | |
D.l(a, Ca, Ph, "dragSize"); | |
this.lD = a.V() | |
}); | |
D.defineProperty(Ph, { | |
EK: "toolTipDuration" | |
}, function() { | |
return this.FE | |
}, function(a) { | |
D.h(a, "number", Ph, "toolTipDuration"); | |
this.FE = a | |
}); | |
D.defineProperty(Ph, { | |
SH: "actionTool" | |
}, function() { | |
return this.findTool("Action") | |
}, function(a) { | |
Yk(this, "Action", a, this.sf) | |
}); | |
D.defineProperty(Ph, { | |
FG: "relinkingTool" | |
}, function() { | |
return this.findTool("Relinking") | |
}, function(a) { | |
Yk(this, "Relinking", a, this.sf) | |
}); | |
D.defineProperty(Ph, { | |
BJ: "linkReshapingTool" | |
}, function() { | |
return this.findTool("LinkReshaping") | |
}, function(a) { | |
Yk(this, "LinkReshaping", a, this.sf) | |
}); | |
D.defineProperty(Ph, { | |
RG: "resizingTool" | |
}, function() { | |
return this.findTool("Resizing") | |
}, function(a) { | |
Yk(this, "Resizing", a, this.sf) | |
}); | |
D.defineProperty(Ph, { | |
iK: "rotatingTool" | |
}, function() { | |
return this.findTool("Rotating") | |
}, function(a) { | |
Yk(this, "Rotating", a, this.sf) | |
}); | |
D.defineProperty(Ph, { | |
sG: "linkingTool" | |
}, function() { | |
return this.findTool("Linking") | |
}, function(a) { | |
Yk(this, "Linking", a, this.mg) | |
}); | |
D.defineProperty(Ph, { | |
Ge: "draggingTool" | |
}, function() { | |
return this.findTool("Dragging") | |
}, function(a) { | |
Yk(this, "Dragging", a, this.mg) | |
}); | |
D.defineProperty(Ph, { | |
zI: "dragSelectingTool" | |
}, function() { | |
return this.findTool("DragSelecting") | |
}, function(a) { | |
Yk(this, "DragSelecting", a, this.mg) | |
}); | |
D.defineProperty(Ph, { | |
XJ: "panningTool" | |
}, function() { | |
return this.findTool("Panning") | |
}, function(a) { | |
Yk(this, "Panning", a, this.mg) | |
}); | |
D.defineProperty(Ph, { | |
LA: "contextMenuTool" | |
}, function() { | |
return this.findTool("ContextMenu") | |
}, function(a) { | |
Yk(this, "ContextMenu", a, this.ng) | |
}); | |
D.defineProperty(Ph, { | |
hC: "textEditingTool" | |
}, function() { | |
return this.findTool("TextEditing") | |
}, function(a) { | |
Yk(this, "TextEditing", a, this.ng) | |
}); | |
D.defineProperty(Ph, { | |
eI: "clickCreatingTool" | |
}, function() { | |
return this.findTool("ClickCreating") | |
}, function(a) { | |
Yk(this, "ClickCreating", a, this.ng) | |
}); | |
D.defineProperty(Ph, { | |
fI: "clickSelectingTool" | |
}, function() { | |
return this.findTool("ClickSelecting") | |
}, function(a) { | |
Yk(this, "ClickSelecting", a, this.ng) | |
}); | |
function kh() { | |
this.aD = Zk; | |
this.Nr = this.Pr = this.ea = null; | |
this.Om = this.Qr = this.Rr = 0; | |
this.Ho = this.zc = this.np = this.tk = !1; | |
this.Ll = this.tf = !0; | |
this.Vv = this.Uv = this.WC = null; | |
this.VC = 0; | |
this.Wv = null; | |
this.Kv = new L("string"); | |
this.Iz = 600; | |
this.JH = new N(0, 0); | |
this.KC = this.JC = this.IE = !1; | |
this.ln = new na(O, dl) | |
} | |
D.ka("AnimationManager", kh); | |
kh.prototype.ad = function(a) { | |
this.ea = a | |
}; | |
function Zk(a, b, c, d) { | |
a /= d / 2; | |
return 1 > a ? c / 2 * a * a + b : -c / 2 * (--a * (a - 2) - 1) + b | |
} | |
D.w(kh, { | |
kL: "animationReasons" | |
}, function() { | |
return this.Kv | |
}); | |
kh.prototype.canStart = function() { | |
return !0 | |
}; | |
kh.prototype.prepareAutomaticAnimation = kh.prototype.ro = function(a) { | |
this.tf && (this.Ll || this.ea.ao) && (this.Kv.add(a), this.canStart(a) && (this.tk && this.Yh(), this.zc = !0)) | |
}; | |
function el(a) { | |
if (a.tf && (a.Kv.clear(), a.zc)) | |
if (!a.Ho) a.zc = !1; | |
else if (0 === a.Om) { | |
var b = +new Date; | |
a.Om = b; | |
requestAnimationFrame(function() { | |
if (!1 !== a.zc && !a.tk && a.Om === b) { | |
var c = a.ea; | |
c.Kj("temporaryPixelRatio") && (c.Ik = 1); | |
fl(c); | |
a.zc = !1; | |
c.Ja("AnimationStarting"); | |
gl(a, b) | |
} | |
}) | |
} | |
} | |
function hl(a, b, c, d, e, g) { | |
if (a.zc && (v && D.l(b, O, kh, "addPropToAnimation:obj"), !("position" === c && d.O(e) || b instanceof F && !b.cG))) { | |
var h = a.ln; | |
if (h.contains(b)) { | |
var h = h.oa(b), | |
k = h.start, | |
l = h.end; | |
void 0 === k[c] && (k[c] = il(d)); | |
h.Mx && void 0 !== l[c] ? h.pu[c] = il(e) : (g || (h.pu[c] = il(e)), l[c] = il(e)); | |
g && 0 === c.indexOf("position:") && b instanceof F && (h.pu.location = il(b.location)) | |
} else k = new ma, l = new ma, k[c] = il(d), l[c] = il(e), d = l, e = k.position, e instanceof N && !e.H() && a.Kv.contains("Expand SubGraph") && e.assign(d.position), k = | |
new dl(k, l, g), g && 0 === c.indexOf("position:") && b instanceof F && (k.pu.location = il(b.location)), h.add(b, k); | |
a.Ho = !0 | |
} | |
} | |
function il(a) { | |
return a instanceof N ? a.copy() : a instanceof Ca ? a.copy() : a | |
} | |
function gl(a, b) { | |
var c; | |
function d() { | |
if (!1 !== g.tk && g.Om === b) { | |
var a = +new Date, | |
c = a > s ? m : a - r; | |
jl(g); | |
kl(g, e, q, h, c, m); | |
g.Uv && g.Uv(); | |
bj(e); | |
ll(g); | |
a > s ? ml(g) : requestAnimationFrame(d) | |
} | |
} | |
void 0 === c && (c = new ma); | |
var e = a.ea; | |
if (null !== e) { | |
var g = a, | |
h = c.PL || a.aD, | |
k = c.mM || null, | |
l = c.nM || null, | |
m = c.duration || a.Iz, | |
n = a.JH; | |
for (c = a.ln.j; c.next();) { | |
var p = c.value.start.position; | |
p instanceof N && (p.H() || p.assign(n)) | |
} | |
a.WC = h; | |
a.Uv = k; | |
a.Vv = l; | |
a.VC = m; | |
a.Wv = a.ln; | |
var q = a.Wv; | |
for (c = q.j; c.next();) k = c.value.end, k["position:placeholder"] && (l = c.key.findVisibleNode(), | |
l instanceof I && null !== l.placeholder && (l = l.placeholder, n = l.fb(ec), n.x += l.padding.left, n.y += l.padding.top, k["position:placeholder"] = n)); | |
a.tk = !0; | |
jl(a); | |
kl(a, e, q, h, 0, m); | |
bj(a.ea); | |
ll(a); | |
var r = +new Date, | |
s = r + m; | |
g.Om === b && requestAnimationFrame(function() { | |
d() | |
}) | |
} | |
} | |
function jl(a) { | |
if (!a.np) { | |
var b = a.ea; | |
a.IE = b.lb; | |
a.JC = b.Xe; | |
a.KC = b.rv; | |
b.lb = !0; | |
b.Xe = !0; | |
b.rv = !0; | |
a.np = !0 | |
} | |
} | |
function ll(a) { | |
var b = a.ea; | |
b.lb = a.IE; | |
b.Xe = a.JC; | |
b.rv = a.KC; | |
a.np = !1 | |
} | |
function kl(a, b, c, d, e, g) { | |
for (c = c.j; c.next();) { | |
var h = c.key, | |
k = c.value, | |
l = k.start, | |
k = k.end, | |
m; | |
for (m in k) | |
if (("position" !== m || !k["position:placeholder"] && !k["position:node"]) && void 0 !== nl[m]) nl[m](h, l[m], k[m], d, e, g) | |
} | |
d = b.oB; | |
b.oB = !0; | |
m = a.aD; | |
0 !== a.Rr && 0 !== a.Qr && (c = a.Rr, b.Db = m(e, c, a.Qr - c, g)); | |
null !== a.Pr && null !== a.Nr && (c = a.Pr, a = a.Nr, b.sb = new N(m(e, c.x, a.x - c.x, g), m(e, c.y, a.y - c.y, g))); | |
b.oB = d | |
} | |
kh.prototype.stopAnimation = kh.prototype.Yh = function() { | |
!0 === this.zc && (this.zc = !1, this.Om = 0, this.Ho && this.ea.Le()); | |
this.tk && this.tf && ml(this) | |
}; | |
function ml(a) { | |
a.tk = !1; | |
a.Ho = !1; | |
jl(a); | |
for (var b = a.ea, c = a.WC, d = a.VC, e = a.Wv.j; e.next();) { | |
var g = e.key, | |
h = e.value, | |
k = h.start, | |
l = h.end, | |
m = h.pu, | |
n; | |
for (n in l) | |
if (void 0 !== nl[n]) { | |
var p = n; | |
!h.Mx || "position:node" !== p && "position:placeholder" !== p || (p = "position"); | |
nl[p](g, k[n], void 0 !== m[n] ? m[n] : h.Mx ? k[n] : l[n], c, d, d) | |
} | |
h.Mx && void 0 !== m.location && g instanceof F && (g.location = m.location); | |
h.Hy && g instanceof F && g.Qd(!1) | |
} | |
for (c = a.ea.links; c.next();) d = c.value, null !== d.Hp && (d.points = d.Hp, d.Hp = null); | |
b.ty.clear(); | |
b.Ik = null; | |
b.Qc(); | |
b.ra(); | |
b.lg(); | |
ol(b); | |
ll(a); | |
a.Vv && a.Vv(); | |
a.Om = 0; | |
a.Wv = null; | |
a.Vv = null; | |
a.Uv = null; | |
a.Pr = null; | |
a.Nr = null; | |
a.Rr = 0; | |
a.Qr = 0; | |
a.ln = new na(O, dl); | |
b.Ja("AnimationFinished"); | |
b.Le() | |
} | |
function pl(a, b, c) { | |
var d = b.aa, | |
e = c.aa, | |
g = null; | |
c instanceof I && (g = c.placeholder); | |
null !== g ? (d = g.fb(ec), d.x += g.padding.left, d.y += g.padding.top, hl(a, b, "position", d, b.position, !1)) : hl(a, b, "position", new N(e.x + e.width / 2 - d.width / 2, e.y + e.height / 2 - d.height / 2), b.position, !1); | |
hl(a, b, "scale", .01, b.scale, !1); | |
if (b instanceof I) | |
for (b = b.uc; b.next();) g = b.value, g instanceof G && pl(a, g, c) | |
} | |
function ql(a, b, c) { | |
if (b.isVisible()) { | |
var d = null; | |
c instanceof I && (d = c.placeholder); | |
null !== d ? hl(a, b, "position:placeholder", b.position, d, !0) : hl(a, b, "position:node", b.position, c, !0); | |
hl(a, b, "scale", b.scale, .01, !0); | |
a.zc && (d = a.ln, d.contains(b) && (d.oa(b).Hy = !0)); | |
if (b instanceof I) | |
for (b = b.uc; b.next();) d = b.value, d instanceof G && ql(a, d, c) | |
} | |
} | |
function rl(a, b, c) { | |
a.zc && (null === a.Pr && b.H() && null === a.Nr && (a.Pr = b.copy()), a.Nr = c.copy(), a.Ho = !0) | |
} | |
function sl(a, b, c) { | |
a.zc && a.ea.ao && (0 === a.Rr && 0 === a.Qr && (a.Rr = b), a.Qr = c, a.Ho = !0) | |
} | |
D.defineProperty(kh, { | |
isEnabled: "isEnabled" | |
}, function() { | |
return this.tf | |
}, function(a) { | |
D.h(a, "boolean", kh, "isEnabled"); | |
this.tf = a | |
}); | |
D.defineProperty(kh, { | |
duration: "duration" | |
}, function() { | |
return this.Iz | |
}, function(a) { | |
D.h(a, "number", kh, "duration"); | |
1 > a && D.ua(a, ">= 1", kh, "duration"); | |
this.Iz = a | |
}); | |
D.w(kh, { | |
pf: "isAnimating" | |
}, function() { | |
return this.tk | |
}); | |
D.w(kh, { | |
tJ: "isTicking" | |
}, function() { | |
return this.np | |
}); | |
D.defineProperty(kh, { | |
iG: "isInitial" | |
}, function() { | |
return this.Ll | |
}, function(a) { | |
D.h(a, "boolean", kh, "isInitial"); | |
this.Ll = a | |
}); | |
function dl(a, b, c) { | |
this.start = a; | |
this.end = b; | |
this.pu = new ma; | |
this.Mx = c; | |
this.Hy = !1 | |
} | |
var nl = { | |
opacity: function(a, b, c, d, e, g) { | |
a.opacity = d(e, b, c - b, g) | |
}, | |
position: function(a, b, c, d, e, g) { | |
e !== g ? a.Uy(d(e, b.x, c.x - b.x, g), d(e, b.y, c.y - b.y, g)) : a.position = new N(d(e, b.x, c.x - b.x, g), d(e, b.y, c.y - b.y, g)) | |
}, | |
"position:node": function(a, b, c, d, e, g) { | |
var h = a.aa, | |
k = c.aa; | |
c = k.x + k.width / 2 - h.width / 2; | |
h = k.y + k.height / 2 - h.height / 2; | |
e !== g ? a.Uy(d(e, b.x, c - b.x, g), d(e, b.y, h - b.y, g)) : a.position = new N(d(e, b.x, c - b.x, g), d(e, b.y, h - b.y, g)) | |
}, | |
"position:placeholder": function(a, b, c, d, e, g) { | |
e !== g ? a.Uy(d(e, b.x, c.x - b.x, g), d(e, b.y, c.y - b.y, g)) : | |
a.position = new N(d(e, b.x, c.x - b.x, g), d(e, b.y, c.y - b.y, g)) | |
}, | |
scale: function(a, b, c, d, e, g) { | |
a.scale = d(e, b, c - b, g) | |
}, | |
visible: function(a, b, c, d, e, g) { | |
a.visible = e !== g ? b : c | |
} | |
}; | |
function Hg() { | |
0 < arguments.length && D.zd(Hg); | |
D.xc(this); | |
this.ea = null; | |
this.rb = new K(F); | |
this.ac = ""; | |
this.Lc = 1; | |
this.Yz = !1; | |
this.Vl = this.zA = this.wl = this.vl = this.ul = this.tl = this.rl = this.sl = this.ql = this.yl = this.pl = this.xl = this.ol = this.nl = !0; | |
this.Vz = !1; | |
this.Qw = [] | |
} | |
D.ka("Layer", Hg); | |
Hg.prototype.ad = function(a) { | |
this.ea = a | |
}; | |
Hg.prototype.toString = function(a) { | |
void 0 === a && (a = 0); | |
var b = 'Layer "' + this.name + '"'; | |
if (0 >= a) return b; | |
for (var c = 0, d = 0, e = 0, g = 0, h = 0, k = this.rb.j; k.next();) { | |
var l = k.value; | |
l instanceof I ? e++ : l instanceof G ? d++ : l instanceof J ? g++ : l instanceof da ? h++ : c++ | |
} | |
k = ""; | |
0 < c && (k += c + " Parts "); | |
0 < d && (k += d + " Nodes "); | |
0 < e && (k += e + " Groups "); | |
0 < g && (k += g + " Links "); | |
0 < h && (k += h + " Adornments "); | |
if (1 < a) | |
for (a = this.rb.j; a.next();) c = a.value, k += "\n " + c.toString(), d = c.data, null !== d && D.Od(d) && (k += " #" + D.Od(d)), c instanceof G ? k += " " + | |
ia(d) : c instanceof J && (k += " " + ia(c.$) + " " + ia(c.ba)); | |
return b + " " + this.rb.count + ": " + k | |
}; | |
Hg.prototype.findObjectAt = Hg.prototype.Je = function(a, b, c) { | |
void 0 === b && (b = null); | |
void 0 === c && (c = null); | |
if (!1 === this.Vl) return null; | |
v && !a.H() && D.k("findObjectAt: Point must have a real value, not: " + a.toString()); | |
var d = !1; | |
null !== this.g && this.g.wb.Pa(a) && (d = !0); | |
for (var e = D.P(), g = this.rb.o, h = g.length; h--;) { | |
var k = g[h]; | |
if ((!0 !== d || !1 !== tl(k)) && k.isVisible() && (e.assign(a), kb(e, k.Hh), k = k.Je(e, b, c), null !== k && (null !== b && (k = b(k)), null !== k && (null === c || c(k))))) return D.A(e), k | |
} | |
D.A(e); | |
return null | |
}; | |
Hg.prototype.findObjectsAt = Hg.prototype.ru = function(a, b, c, d) { | |
void 0 === b && (b = null); | |
void 0 === c && (c = null); | |
d instanceof K || d instanceof L || (d = new L(O)); | |
if (!1 === this.Vl) return d; | |
v && !a.H() && D.k("findObjectsAt: Point must have a real value, not: " + a.toString()); | |
var e = !1; | |
null !== this.g && this.g.wb.Pa(a) && (e = !0); | |
for (var g = D.P(), h = this.rb.o, k = h.length; k--;) { | |
var l = h[k]; | |
if ((!0 !== e || !1 !== tl(l)) && l.isVisible()) { | |
g.assign(a); | |
kb(g, l.Hh); | |
var m = l; | |
l.ru(g, b, c, d) && (null !== b && (m = b(m)), null === m || null !== c && !c(m) || (d instanceof L && d.add(m), d instanceof K && d.add(m))) | |
} | |
} | |
D.A(g); | |
return d | |
}; | |
Hg.prototype.findObjectsIn = Hg.prototype.Yk = function(a, b, c, d, e) { | |
void 0 === b && (b = null); | |
void 0 === c && (c = null); | |
void 0 === d && (d = !1); | |
e instanceof K || e instanceof L || (e = new L(O)); | |
if (!1 === this.Vl) return e; | |
v && !a.H() && D.k("findObjectsIn: Rect must have a real value, not: " + a.toString()); | |
var g = !1; | |
null !== this.g && this.g.wb.Tk(a) && (g = !0); | |
for (var h = this.rb.o, k = h.length; k--;) { | |
var l = h[k]; | |
if ((!0 !== g || !1 !== tl(l)) && l.isVisible()) { | |
var m = l; | |
l.Yk(a, b, c, d, e) && (null !== b && (m = b(m)), null === m || null !== c && !c(m) || (e instanceof L && e.add(m), | |
e instanceof K && e.add(m))) | |
} | |
} | |
return e | |
}; | |
Hg.prototype.YA = function(a, b, c, d, e, g, h) { | |
if (!1 === this.Vl) return e; | |
for (var k = this.rb.o, l = k.length; l--;) { | |
var m = k[l]; | |
if ((!0 !== h || !1 !== tl(m)) && g(m) && m.isVisible()) { | |
var n = m; | |
m.Yk(a, b, c, d, e) && (null !== b && (n = b(n)), null === n || null !== c && !c(n) || (e instanceof L && e.add(n), e instanceof K && e.add(n))) | |
} | |
} | |
return e | |
}; | |
Hg.prototype.findObjectsNear = Hg.prototype.Rn = function(a, b, c, d, e, g) { | |
void 0 === c && (c = null); | |
void 0 === d && (d = null); | |
void 0 === e && (e = !0); | |
if (!1 !== e && !0 !== e) { | |
if (e instanceof K || e instanceof L) g = e; | |
e = !0 | |
} | |
g instanceof K || g instanceof L || (g = new L(O)); | |
if (!1 === this.Vl) return g; | |
v && !a.H() && D.k("findObjectsNear: Point must have a real value, not: " + a.toString()); | |
var h = !1; | |
null !== this.g && this.g.wb.Pa(a) && (h = !0); | |
for (var k = D.P(), l = D.P(), m = this.rb.o, n = m.length; n--;) { | |
var p = m[n]; | |
if ((!0 !== h || !1 !== tl(p)) && p.isVisible()) { | |
k.assign(a); | |
kb(k, p.Hh); | |
l.n(a.x + b, a.y); | |
kb(l, p.Hh); | |
var q = p; | |
p.Rn(k, l, c, d, e, g) && (null !== c && (q = c(q)), null === q || null !== d && !d(q) || (g instanceof L && g.add(q), g instanceof K && g.add(q))) | |
} | |
} | |
D.A(k); | |
D.A(l); | |
return g | |
}; | |
f = Hg.prototype; | |
f.Pf = function(a, b) { | |
if (this.visible) { | |
var c; | |
c = void 0 === b ? a.wb : b; | |
for (var d = this.rb.o, e = d.length, g = 0; g < e; g++) { | |
var h = d[g]; | |
h.OD = g; | |
if (!(h instanceof J && !1 === h.Uf)) { | |
if (h instanceof da) { | |
var k = h; | |
if (null !== k.hf) continue | |
} | |
if (Ob(h.aa, c)) | |
for (h.Pf(!0), ul(h), h = h.Ax; h.next();) k = h.value, Hk(k, Infinity, Infinity), k.rc(), k.Pf(!0); | |
else h.Pf(!1), null !== h.Ax && 0 < h.Ax.count && ul(h) | |
} | |
} | |
} | |
}; | |
f.He = function(a, b, c) { | |
if (this.visible && 0 !== this.Lc && (void 0 === c && (c = !0), c || !this.Yc)) { | |
c = this.rb.o; | |
var d = c.length; | |
if (0 !== d) { | |
1 !== this.Lc && (a.globalAlpha = this.Lc); | |
var e = this.Qw; | |
e.length = 0; | |
for (var g = b.scale, h = 0; h < d; h++) { | |
var k = c[h]; | |
if (tl(k)) { | |
if (k instanceof J) { | |
var l = k; | |
l.ic && e.push(l); | |
if (!1 === l.Uf) continue | |
} | |
l = k.aa; | |
1 < l.width * g || 1 < l.height * g ? k.He(a, b) : vl(k, a) | |
} | |
} | |
a.globalAlpha = 1 | |
} | |
} | |
}; | |
function wl(a, b, c, d) { | |
if (a.visible && 0 !== a.Lc) { | |
1 !== a.Lc && (b.globalAlpha = a.Lc); | |
var e = a.Qw; | |
e.length = 0; | |
var g = c.scale; | |
a = a.rb.o; | |
for (var h = a.length, k = d.length, l = 0; l < h; l++) { | |
var m = a[l]; | |
if (tl(m)) { | |
if (m instanceof J) { | |
var n = m; | |
n.ic && e.push(n); | |
if (!1 === n.Uf) continue | |
} | |
var n = xl(m, m.aa), | |
p; | |
a: { | |
p = n; | |
for (var q = d, r = k, s = 2 / g, u = 4 / g, t = 0; t < r; t++) { | |
var y = q[t]; | |
if (0 !== y.width && 0 !== y.height && p.aG(y.x - s, y.y - s, y.width + u, y.height + u)) { | |
p = !0; | |
break a | |
} | |
} | |
p = !1 | |
} | |
p && (1 < n.width * g || 1 < n.height * g ? m.He(b, c) : vl(m, b)) | |
} | |
} | |
b.globalAlpha = 1 | |
} | |
} | |
f.i = function(a, b, c, d, e) { | |
var g = this.g; | |
null !== g && g.od(fg, a, this, b, c, d, e) | |
}; | |
f.uq = function(a, b, c) { | |
var d = this.rb; | |
b.yw = this; | |
if (a >= d.count) a = d.count; | |
else if (d.fa(a) === b) return -1; | |
d.ce(a, b); | |
b.Fu(c); | |
d = this.g; | |
null !== d && (c ? d.ra() : d.uq(b)); | |
yl(this, a, b); | |
return a | |
}; | |
f.Af = function(a, b, c) { | |
if (!c && b.layer !== this && null !== b.layer) return b.layer.Af(a, b, c); | |
var d = this.rb; | |
if (0 > a || a >= d.length) { | |
if (a = d.indexOf(b), 0 > a) return -1 | |
} else if (d.fa(a) !== b && (a = d.indexOf(b), 0 > a)) return -1; | |
b.Gu(c); | |
d.pd(a); | |
d = this.g; | |
null !== d && (c ? d.ra() : d.Af(b)); | |
b.yw = null; | |
return a | |
}; | |
function yl(a, b, c) { | |
b = zl(a, b, c); | |
if (c instanceof I && null !== c && isNaN(c.Do)) { | |
if (0 !== c.uc.count) { | |
for (var d = -1, e = a.rb.o, g = e.length, h = 0; h < g; h++) { | |
var k = e[h]; | |
if (k === c && (b = h, 0 <= d)) break; | |
if (0 > d && k.Ka === c && (d = h, 0 <= b)) break | |
}!(0 > d) && d < b && (e = a.rb, e.pd(b), e.ce(d, c)) | |
} | |
c = c.Ka; | |
null !== c && yl(a, -1, c) | |
} | |
} | |
function zl(a, b, c) { | |
var d = c.Do; | |
if (isNaN(d)) return b; | |
a = a.rb; | |
var e = a.count; | |
if (1 >= e) return b; | |
0 > b && (b = a.indexOf(c)); | |
if (0 > b) return -1; | |
for (var g = b - 1, h = NaN; 0 <= g;) { | |
h = a.fa(g).Do; | |
if (!isNaN(h)) break; | |
g-- | |
} | |
for (var k = b + 1, l = NaN; k < e;) { | |
l = a.fa(k).Do; | |
if (!isNaN(l)) break; | |
k++ | |
} | |
if (!isNaN(h) && h > d) | |
for (;;) { | |
if (-1 === g || h <= d) { | |
g++; | |
if (g === b) break; | |
a.pd(b); | |
a.ce(g, c); | |
return g | |
} | |
for (h = NaN; 0 <= --g && (h = a.fa(g).Do, isNaN(h));); | |
} else if (!isNaN(l) && l < d) | |
for (;;) { | |
if (k === e || l >= d) { | |
k--; | |
if (k === b) break; | |
a.pd(b); | |
a.ce(k, c); | |
return k | |
} | |
for (l = NaN; ++k < e && (l = a.fa(k).Do, | |
isNaN(l));); | |
} | |
return b | |
} | |
f.clear = function() { | |
for (var a = this.rb.Fc(), b = a.length, c = 0; c < b; c++) a[c].Pf(!1), this.Af(-1, a[c], !1) | |
}; | |
D.w(Hg, { | |
Hi: "parts" | |
}, function() { | |
return this.rb.j | |
}); | |
D.w(Hg, { | |
wM: "partsBackwards" | |
}, function() { | |
return this.rb.bo | |
}); | |
D.w(Hg, { | |
g: "diagram" | |
}, function() { | |
return this.ea | |
}); | |
D.defineProperty(Hg, { | |
name: "name" | |
}, function() { | |
return this.ac | |
}, function(a) { | |
D.h(a, "string", Hg, "name"); | |
var b = this.ac; | |
if (b !== a) { | |
var c = this.g; | |
if (null !== c) | |
for ("" === b && D.k("Cannot rename default Layer to: " + a), c = c.co; c.next();) c.value.name === a && D.k("Layer.name is already present in this diagram: " + a); | |
this.ac = a; | |
this.i("name", b, a); | |
for (a = this.rb.j; a.next();) a.value.Nf = this.ac | |
} | |
}); | |
D.defineProperty(Hg, { | |
opacity: "opacity" | |
}, function() { | |
return this.Lc | |
}, function(a) { | |
var b = this.Lc; | |
b !== a && (D.h(a, "number", Hg, "opacity"), (0 > a || 1 < a) && D.ua(a, "0 <= value <= 1", Hg, "opacity"), this.Lc = a, this.i("opacity", b, a), a = this.g, null !== a && a.ra()) | |
}); | |
D.defineProperty(Hg, { | |
Yc: "isTemporary" | |
}, function() { | |
return this.Yz | |
}, function(a) { | |
var b = this.Yz; | |
b !== a && (D.h(a, "boolean", Hg, "isTemporary"), this.Yz = a, this.i("isTemporary", b, a)) | |
}); | |
D.defineProperty(Hg, { | |
visible: "visible" | |
}, function() { | |
return this.zA | |
}, function(a) { | |
var b = this.zA; | |
if (b !== a) { | |
D.h(a, "boolean", Hg, "visible"); | |
this.zA = a; | |
this.i("visible", b, a); | |
for (b = this.rb.j; b.next();) b.value.Qd(a); | |
a = this.g; | |
null !== a && a.ra() | |
} | |
}); | |
D.defineProperty(Hg, { | |
tg: "pickable" | |
}, function() { | |
return this.Vl | |
}, function(a) { | |
var b = this.Vl; | |
b !== a && (D.h(a, "boolean", Hg, "pickable"), this.Vl = a, this.i("pickable", b, a)) | |
}); | |
D.defineProperty(Hg, { | |
dG: "isBoundsIncluded" | |
}, function() { | |
return this.Vz | |
}, function(a) { | |
this.Vz !== a && (this.Vz = a, null !== this.g && this.g.Qc()) | |
}); | |
D.defineProperty(Hg, { | |
Qk: "allowCopy" | |
}, function() { | |
return this.nl | |
}, function(a) { | |
var b = this.nl; | |
b !== a && (D.h(a, "boolean", Hg, "allowCopy"), this.nl = a, this.i("allowCopy", b, a)) | |
}); | |
D.defineProperty(Hg, { | |
En: "allowDelete" | |
}, function() { | |
return this.ol | |
}, function(a) { | |
var b = this.ol; | |
b !== a && (D.h(a, "boolean", Hg, "allowDelete"), this.ol = a, this.i("allowDelete", b, a)) | |
}); | |
D.defineProperty(Hg, { | |
Ex: "allowTextEdit" | |
}, function() { | |
return this.xl | |
}, function(a) { | |
var b = this.xl; | |
b !== a && (D.h(a, "boolean", Hg, "allowTextEdit"), this.xl = a, this.i("allowTextEdit", b, a)) | |
}); | |
D.defineProperty(Hg, { | |
Bx: "allowGroup" | |
}, function() { | |
return this.pl | |
}, function(a) { | |
var b = this.pl; | |
b !== a && (D.h(a, "boolean", Hg, "allowGroup"), this.pl = a, this.i("allowGroup", b, a)) | |
}); | |
D.defineProperty(Hg, { | |
Fx: "allowUngroup" | |
}, function() { | |
return this.yl | |
}, function(a) { | |
var b = this.yl; | |
b !== a && (D.h(a, "boolean", Hg, "allowUngroup"), this.yl = a, this.i("allowUngroup", b, a)) | |
}); | |
D.defineProperty(Hg, { | |
eu: "allowLink" | |
}, function() { | |
return this.ql | |
}, function(a) { | |
var b = this.ql; | |
b !== a && (D.h(a, "boolean", Hg, "allowLink"), this.ql = a, this.i("allowLink", b, a)) | |
}); | |
D.defineProperty(Hg, { | |
Fn: "allowRelink" | |
}, function() { | |
return this.sl | |
}, function(a) { | |
var b = this.sl; | |
b !== a && (D.h(a, "boolean", Hg, "allowRelink"), this.sl = a, this.i("allowRelink", b, a)) | |
}); | |
D.defineProperty(Hg, { | |
gm: "allowMove" | |
}, function() { | |
return this.rl | |
}, function(a) { | |
var b = this.rl; | |
b !== a && (D.h(a, "boolean", Hg, "allowMove"), this.rl = a, this.i("allowMove", b, a)) | |
}); | |
D.defineProperty(Hg, { | |
Cx: "allowReshape" | |
}, function() { | |
return this.tl | |
}, function(a) { | |
var b = this.tl; | |
b !== a && (D.h(a, "boolean", Hg, "allowReshape"), this.tl = a, this.i("allowReshape", b, a)) | |
}); | |
D.defineProperty(Hg, { | |
fu: "allowResize" | |
}, function() { | |
return this.ul | |
}, function(a) { | |
var b = this.ul; | |
b !== a && (D.h(a, "boolean", Hg, "allowResize"), this.ul = a, this.i("allowResize", b, a)) | |
}); | |
D.defineProperty(Hg, { | |
Dx: "allowRotate" | |
}, function() { | |
return this.vl | |
}, function(a) { | |
var b = this.vl; | |
b !== a && (D.h(a, "boolean", Hg, "allowRotate"), this.vl = a, this.i("allowRotate", b, a)) | |
}); | |
D.defineProperty(Hg, { | |
Jf: "allowSelect" | |
}, function() { | |
return this.wl | |
}, function(a) { | |
var b = this.wl; | |
b !== a && (D.h(a, "boolean", Hg, "allowSelect"), this.wl = a, this.i("allowSelect", b, a)) | |
}); | |
function E(a) { | |
function b() { | |
window.document.removeEventListener("DOMContentLoaded", b, !1); | |
Al(c) | |
} | |
1 < arguments.length && D.k("Diagram constructor can only take one optional argument, the DIV HTML element or its id."); | |
D.xc(this); | |
Bl = []; | |
this.ed = !0; | |
this.HC = new kh; | |
this.HC.ad(this); | |
this.Kd = 17; | |
this.rs = !1; | |
this.kA = "default"; | |
var c = this; | |
null !== window.document.body ? Al(this) : window.document.addEventListener("DOMContentLoaded", b, !1); | |
this.dc = new K(Hg); | |
this.Pb = this.Qb = 0; | |
this.Fk = this.Ub = this.dd = this.Ib = null; | |
this.LG(); | |
this.kp = | |
null; | |
this.KG(); | |
this.sb = (new N(NaN, NaN)).freeze(); | |
this.Db = 1; | |
this.nw = (new N(NaN, NaN)).freeze(); | |
this.ow = NaN; | |
this.Hw = 1E-4; | |
this.Ew = 100; | |
this.Nc = new Ea; | |
this.xx = (new N(NaN, NaN)).freeze(); | |
this.fw = (new C(NaN, NaN, NaN, NaN)).freeze(); | |
this.$w = (new Lb(0, 0, 0, 0)).freeze(); | |
this.ax = Cl; | |
this.gx = !0; | |
this.Xw = this.Vw = null; | |
this.Pm = Vh; | |
this.No = Vc; | |
this.Jl = Vh; | |
this.hp = Vc; | |
this.pw = this.mw = ec; | |
this.Pe = !0; | |
this.ms = !1; | |
this.Gg = new L(F); | |
this.Dl = new na(J, C); | |
this.Ur = !0; | |
this.pr = 250; | |
this.Io = -1; | |
this.Mv = (new Lb(16, 16, 16, 16)).freeze(); | |
this.Sr = | |
this.cg = !1; | |
this.bp = !0; | |
this.aj = new bg; | |
this.Hd = new bg; | |
this.Vb = new bg; | |
this.xh = this.Qi = null; | |
this.Sp = !1; | |
this.Dz = this.Ez = null; | |
this.lz = window.PointerEvent && (D.zq || D.Aq || D.pB) && window.navigator && !1 !== window.navigator.msPointerEnabled; | |
Dl(this); | |
this.Ap = new L(G); | |
this.am = new L(I); | |
this.tp = new L(J); | |
this.rb = new L(F); | |
this.uw = !0; | |
this.sx = El; | |
this.AD = !1; | |
this.ux = fj; | |
this.yz = this.Bz = this.uA = null; | |
this.Tv = ""; | |
this.Mr = "auto"; | |
this.Ui = this.wj = this.kj = this.Kw = this.lj = this.mj = this.nj = this.Ti = this.Yi = this.Ri = null; | |
this.eA = !1; | |
this.iA = {}; | |
this.Dp = [null, null]; | |
this.vz = null; | |
this.hr = this.Cz = this.pA = this.nE = this.vj = !1; | |
this.MD = !0; | |
this.Xz = this.ke = !1; | |
this.ye = null; | |
var d = this; | |
this.TD = function(a) { | |
if (a.da === d.da && d.ab) { | |
d.ab = !1; | |
try { | |
var b = a.Oc; | |
"" === a.Ef && b === fg && Fl(d, a.object, a.propertyName) | |
} finally { | |
d.ab = !0 | |
} | |
} | |
}; | |
this.UD = function(a) { | |
Gl(d, a) | |
}; | |
this.LE = !0; | |
this.rh = -2; | |
this.Vi = new na(Object, F); | |
this.hk = new na(Object, J); | |
this.an = new na(Object, Array); | |
this.Cp = new na("string", Array); | |
this.hA = new K(Hl); | |
this.dj = !1; | |
this.ol = this.nl = this.Cv = this.tf = !0; | |
this.Ev = this.Dv = !1; | |
this.Jv = this.Hv = this.wl = this.vl = this.ul = this.tl = this.rl = this.sl = this.ql = this.Gv = this.yl = this.pl = this.xl = !0; | |
this.th = this.JD = !1; | |
this.Iv = this.Fv = this.kw = this.jw = !0; | |
this.ex = this.Zw = 16; | |
this.Yw = !1; | |
this.yt = this.bx = null; | |
this.mA = this.nA = 0; | |
this.vf = (new Lb(5)).freeze(); | |
this.jx = (new L(F)).freeze(); | |
this.Fw = 999999999; | |
this.lw = (new L(F)).freeze(); | |
this.Kl = this.Ym = this.sk = !0; | |
this.Hl = this.rk = !1; | |
this.we = null; | |
this.ek = !0; | |
this.sh = !1; | |
this.FH = new L(J); | |
this.yD = new L(Il); | |
this.Yd = null; | |
this.ZD = 1; | |
this.qE = 0; | |
this.Fh = { | |
scale: 1, | |
position: new N, | |
bounds: new C, | |
isScroll: !1 | |
}; | |
this.KE = (new C(NaN, NaN, NaN, NaN)).freeze(); | |
this.$v = (new C(NaN, NaN, NaN, NaN)).freeze(); | |
this.vw = !1; | |
this.bw = null; | |
this.Rw = new L(Jl); | |
Kl(this); | |
this.Aw = this.hw = this.Lw = this.dD = this.cD = this.eD = this.yk = this.Fl = this.oj = null; | |
Ll(this); | |
this.Ed = null; | |
this.gw = !1; | |
this.Qo = null; | |
this.ob = new Ph; | |
this.ob.initializeStandardTools(); | |
this.eb = this.mu = this.ob; | |
this.yb = new qa; | |
this.da = new Y; | |
this.vj = !0; | |
this.Zb = new $g; | |
this.vj = !1; | |
this.pD = this.Hz = null; | |
this.ud = 1; | |
this.Ik = null; | |
var e = D.vfo.split("."); | |
!0 !== D.Rx.licenseKey && "1" === e[0] && 7 > parseInt(e[1], 10) && (D.trace("Warning: You have entered a license key for GoJS version 1.7 or later, but this library is version " + D.vfo + ". This license key will do nothing until you upgrade to GoJS 1.7 or later."), D.Rx.licenseKey = !0); | |
this.ji = 1; | |
this.xk = 0; | |
this.xw = new N; | |
this.wA = 500; | |
this.Lv = new N; | |
this.Ht = null; | |
this.vk = !1; | |
this.preventDefault = this.Gy = this.Lq = this.Mq = this.Kq = this.Jq = this.mo = this.oo = this.no = this.ko = this.lo = this.tC = this.lC = this.mC = this.nC = this.Xl = this.ut = | |
this.Wl = this.tt = null; | |
this.rw = !1; | |
this.Il = new Ml; | |
void 0 !== a && Nl(this, a); | |
this.ed = !1 | |
} | |
D.ka("Diagram", E); | |
E.prototype.clear = E.prototype.clear = function() { | |
var a = null; | |
null !== this.Ed && (a = this.Ed.Y); | |
this.da.clear(); | |
for (var b = this.dc.length, c = 0; c < b; c++) this.dc.o[c].clear(); | |
this.Gg.clear(); | |
this.Dl.clear(); | |
this.Ap.clear(); | |
this.am.clear(); | |
this.tp.clear(); | |
this.rb.clear(); | |
this.Vi.clear(); | |
this.hk.clear(); | |
this.an.clear(); | |
this.jx.Xa(); | |
this.jx.clear(); | |
this.jx.freeze(); | |
this.lw.Xa(); | |
this.lw.clear(); | |
this.lw.freeze(); | |
Nh = this.Qo = null; | |
Oh = ""; | |
this.$v = (new C(NaN, NaN, NaN, NaN)).freeze(); | |
null !== a && (this.add(a), this.rb.remove(a)); | |
this.ra() | |
}; | |
E.prototype.reset = E.prototype.reset = function() { | |
this.ed = !0; | |
this.clear(); | |
this.dc = new K(Hg); | |
this.LG(); | |
this.KG(); | |
this.sb = (new N(NaN, NaN)).freeze(); | |
this.Db = 1; | |
this.nw = (new N(NaN, NaN)).freeze(); | |
this.ow = NaN; | |
this.Hw = 1E-4; | |
this.Ew = 100; | |
this.xx = (new N(NaN, NaN)).freeze(); | |
this.fw = (new C(NaN, NaN, NaN, NaN)).freeze(); | |
this.$w = (new Lb(0, 0, 0, 0)).freeze(); | |
this.ax = Cl; | |
this.gx = !0; | |
this.Xw = this.Vw = null; | |
this.Pm = Vh; | |
this.No = Vc; | |
this.Jl = Vh; | |
this.hp = Vc; | |
this.pw = this.mw = ec; | |
this.pr = 250; | |
this.Mv = (new Lb(16, 16, 16, 16)).freeze(); | |
this.uw = !0; | |
this.sx = El; | |
this.ux = fj; | |
this.Mr = "auto"; | |
this.Ui = this.wj = this.kj = this.Kw = this.lj = this.mj = this.nj = this.Ti = this.Yi = this.Ri = null; | |
this.dj = !1; | |
this.ol = this.nl = this.Cv = this.tf = !0; | |
this.Ev = this.Dv = !1; | |
this.Iv = this.Fv = this.kw = this.jw = this.Jv = this.Hv = this.wl = this.vl = this.ul = this.tl = this.rl = this.sl = this.ql = this.Gv = this.yl = this.pl = this.xl = !0; | |
this.ex = this.Zw = 16; | |
this.vf = (new Lb(5)).freeze(); | |
this.Fw = 999999999; | |
this.we = null; | |
this.vw = !1; | |
Ll(this); | |
this.Ed = null; | |
this.ob = new Ph; | |
this.ob.initializeStandardTools(); | |
this.eb = this.mu = | |
this.ob; | |
this.yb = new qa; | |
this.vj = !0; | |
Kl(this); | |
this.Zb = new $g; | |
this.vj = !1; | |
this.da = new Y; | |
this.sh = !1; | |
this.bp = !0; | |
this.ed = this.cg = !1; | |
this.ra(); | |
this.xh = this.Qi = null; | |
Dl(this); | |
this.Tv = "" | |
}; | |
function Ll(a) { | |
a.oj = new na("string", F); | |
var b = new G, | |
c = new pa; | |
c.bind(new ph("text", "", ia)); | |
b.add(c); | |
a.eD = b; | |
a.oj.add("", b); | |
b = new G; | |
c = new pa; | |
c.stroke = "brown"; | |
c.bind(new ph("text", "", ia)); | |
b.add(c); | |
a.oj.add("Comment", b); | |
b = new G; | |
b.jl = !1; | |
b.FA = !1; | |
c = new z; | |
c.Kb = "Ellipse"; | |
c.fill = "black"; | |
c.stroke = null; | |
c.Ea = (new Ca(3, 3)).Oa(); | |
b.add(c); | |
a.oj.add("LinkLabel", b); | |
a.Fl = new na("string", I); | |
b = new I; | |
b.Py = "GROUPPANEL"; | |
b.type = Ol; | |
c = new pa; | |
c.font = "bold 12pt sans-serif"; | |
c.bind(new ph("text", "", ia)); | |
b.add(c); | |
c = new x(Pl); | |
c.name = | |
"GROUPPANEL"; | |
var d = new z; | |
d.Kb = "Rectangle"; | |
d.fill = "rgba(128,128,128,0.2)"; | |
d.stroke = "black"; | |
c.add(d); | |
d = new Yj; | |
d.padding = (new Lb(5, 5, 5, 5)).Oa(); | |
c.add(d); | |
b.add(c); | |
a.cD = b; | |
a.Fl.add("", b); | |
a.yk = new na("string", J); | |
b = new J; | |
c = new z; | |
c.Ve = !0; | |
b.add(c); | |
c = new z; | |
c.ar = "Standard"; | |
c.fill = "black"; | |
c.stroke = null; | |
c.mb = 0; | |
b.add(c); | |
a.dD = b; | |
a.yk.add("", b); | |
b = new J; | |
c = new z; | |
c.Ve = !0; | |
c.stroke = "brown"; | |
b.add(c); | |
a.yk.add("Comment", b); | |
b = new da; | |
b.type = Pl; | |
c = new z; | |
c.fill = null; | |
c.stroke = "dodgerblue"; | |
c.mb = 3; | |
b.add(c); | |
c = new Yj; | |
c.margin = (new Lb(1.5, | |
1.5, 1.5, 1.5)).Oa(); | |
b.add(c); | |
a.Lw = b; | |
a.hw = b; | |
b = new da; | |
b.type = sj; | |
c = new z; | |
c.Ve = !0; | |
c.fill = null; | |
c.stroke = "dodgerblue"; | |
c.mb = 3; | |
b.add(c); | |
a.Aw = b | |
} | |
function Al(a) { | |
var b = D.createElement("p"); | |
b.style.width = "100%"; | |
b.style.height = "200px"; | |
b.style.boxSizing = "content-box"; | |
var c = D.createElement("div"); | |
c.style.position = "absolute"; | |
c.style.visibility = "hidden"; | |
c.style.width = "200px"; | |
c.style.height = "150px"; | |
c.style.overflow = "hidden"; | |
c.style.boxSizing = "content-box"; | |
c.appendChild(b); | |
window.document.body.appendChild(c); | |
var d = b.offsetWidth; | |
c.style.overflow = "scroll"; | |
b = b.offsetWidth; | |
d === b && (b = c.clientWidth); | |
window.document.body.removeChild(c); | |
c = d - b; | |
0 !== c || D.gG || | |
(c = 11); | |
a.Kd = c; | |
c = D.createElement("div"); | |
c.dir = "rtl"; | |
c.style.cssText = "font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;"; | |
c.textContent = "A"; | |
window.document.body.appendChild(c); | |
d = "reverse"; | |
0 < c.scrollLeft ? d = "default" : (c.scrollLeft = 1, 0 === c.scrollLeft && (d = "negative")); | |
window.document.body.removeChild(c); | |
a.kA = d | |
} | |
E.prototype.qc = function(a) { | |
a.Re === E ? this.jm = a : D.ak(this, a) | |
}; | |
E.prototype.toString = function(a) { | |
void 0 === a && (a = 0); | |
var b = ""; | |
this.Hj && this.Hj.id && (b = this.Hj.id); | |
b = 'Diagram "' + b + '"'; | |
if (0 >= a) return b; | |
for (var c = this.dc.j; c.next();) b += "\n " + c.value.toString(a - 1); | |
return b | |
}; | |
E.fromDiv = function(a) { | |
var b = a; | |
"string" === typeof a && (b = window.document.getElementById(a)); | |
return b instanceof HTMLDivElement && b.ea instanceof E ? b.ea : null | |
}; | |
D.defineProperty(E, { | |
Hj: "div" | |
}, function() { | |
return this.Ub | |
}, function(a) { | |
null !== a && D.l(a, HTMLDivElement, E, "div"); | |
if (this.Ub !== a) { | |
Bl = []; | |
var b = this.Ub; | |
null !== b ? (b.ea = void 0, b.innerHTML = "", null !== this.Ib && (this.Ib.removeEventListener("touchstart", this.nC, !1), this.Ib.removeEventListener("touchmove", this.mC, !1), this.Ib.removeEventListener("touchend", this.lC, !1), this.Ib.ae.ea = null), b = this.ob, null !== b && (b.sf.each(function(a) { | |
a.cancelWaitAfter() | |
}), b.mg.each(function(a) { | |
a.cancelWaitAfter() | |
}), b.ng.each(function(a) { | |
a.cancelWaitAfter() | |
})), | |
b.cancelWaitAfter(), this.eb.doCancel(), this.dd = this.Ib = null, window.removeEventListener("resize", this.tC, !1), window.removeEventListener("mousemove", this.lo, !0), window.removeEventListener("mousedown", this.ko, !0), window.removeEventListener("mouseup", this.no, !0), window.removeEventListener("wheel", this.oo, !0), window.removeEventListener("mouseout", this.mo, !0)) : this.sh = !1; | |
this.Ub = null; | |
if (null !== a) { | |
if (b = a.ea) b.Hj = null; | |
Nl(this, a); | |
this.to() | |
} | |
} | |
}); | |
function Ql(a) { | |
var b = a.Ib; | |
a.lz ? (b.addEventListener("pointerdown", a.Jq, !1), b.addEventListener("pointermove", a.Kq, !1), b.addEventListener("pointerup", a.Mq, !1), b.addEventListener("pointerout", a.Lq, !1)) : (b.addEventListener("touchstart", a.nC, !1), b.addEventListener("touchmove", a.mC, !1), b.addEventListener("touchend", a.lC, !1), b.addEventListener("mousemove", a.lo, !1), b.addEventListener("mousedown", a.ko, !1), b.addEventListener("mouseup", a.no, !1), b.addEventListener("mouseout", a.mo, !1)); | |
b.addEventListener("wheel", | |
a.oo, !1); | |
b.addEventListener("keydown", a.vJ, !1); | |
b.addEventListener("keyup", a.wJ, !1); | |
b.addEventListener("selectstart", function(a) { | |
a.preventDefault(); | |
return !1 | |
}, !1); | |
b.addEventListener("contextmenu", function(a) { | |
a.preventDefault(); | |
return !1 | |
}, !1); | |
b.addEventListener("gesturechange", function(b) { | |
a.ob.rq === Jk && b.preventDefault() | |
}, !1); | |
window.addEventListener("resize", a.tC, !1) | |
} | |
E.prototype.computePixelRatio = function() { | |
if (null !== this.Ik) return this.Ik; | |
var a = this.dd; | |
return (window.devicePixelRatio || 1) / (a.za.webkitBackingStorePixelRatio || a.za.mozBackingStorePixelRatio || a.za.msBackingStorePixelRatio || a.za.oBackingStorePixelRatio || a.za.backingStorePixelRatio || 1) | |
}; | |
E.prototype.doMouseMove = function() { | |
this.eb.doMouseMove() | |
}; | |
E.prototype.doMouseDown = function() { | |
this.eb.doMouseDown() | |
}; | |
E.prototype.doMouseUp = function() { | |
this.eb.doMouseUp() | |
}; | |
E.prototype.doMouseWheel = function() { | |
this.eb.doMouseWheel() | |
}; | |
E.prototype.doKeyDown = function() { | |
this.eb.doKeyDown() | |
}; | |
E.prototype.doKeyUp = function() { | |
this.eb.doKeyUp() | |
}; | |
E.prototype.doFocus = function() { | |
this.focus() | |
}; | |
E.prototype.focus = E.prototype.focus = function() { | |
if (this.Ib) | |
if (this.mK) this.Ib.focus(); | |
else { | |
var a = window.scrollX || window.pageXOffset, | |
b = window.scrollY || window.pageYOffset; | |
this.Ib.focus(); | |
window.scrollTo(a, b) | |
} | |
}; | |
function fl(a) { | |
if (null !== a.Ib) { | |
var b = a.Ub; | |
if (0 !== b.clientWidth && 0 !== b.clientHeight) { | |
var c = a.Hl ? a.Kd : 0, | |
d = a.rk ? a.Kd : 0, | |
e = a.ud; | |
a.ud = a.computePixelRatio(); | |
a.ud !== e && (a.ms = !0, a.Le()); | |
if (b.clientWidth !== a.Qb + c || b.clientHeight !== a.Pb + d) a.Ym = !0, a.Pe = !0, b = a.Zb, null !== b && b.my && a.jm === Vh && (a.Sr = !0, b.L()), a.ke || a.Le() | |
} | |
} | |
} | |
function Kl(a) { | |
var b = new Hg; | |
b.name = "Background"; | |
a.$t(b); | |
b = new Hg; | |
b.name = ""; | |
a.$t(b); | |
b = new Hg; | |
b.name = "Foreground"; | |
a.$t(b); | |
b = new Hg; | |
b.name = "Adornment"; | |
b.Yc = !0; | |
a.$t(b); | |
b = new Hg; | |
b.name = "Tool"; | |
b.Yc = !0; | |
b.dG = !0; | |
a.$t(b); | |
b = new Hg; | |
b.name = "Grid"; | |
b.Jf = !1; | |
b.tg = !1; | |
b.Yc = !0; | |
a.VH(b, a.qm("Background")) | |
} | |
function Rl(a) { | |
a.Ed = new x(Sl); | |
a.Ed.name = "GRID"; | |
var b = new z; | |
b.Kb = "LineH"; | |
b.stroke = "lightgray"; | |
b.mb = .5; | |
b.interval = 1; | |
a.Ed.add(b); | |
b = new z; | |
b.Kb = "LineH"; | |
b.stroke = "gray"; | |
b.mb = .5; | |
b.interval = 5; | |
a.Ed.add(b); | |
b = new z; | |
b.Kb = "LineH"; | |
b.stroke = "gray"; | |
b.mb = 1; | |
b.interval = 10; | |
a.Ed.add(b); | |
b = new z; | |
b.Kb = "LineV"; | |
b.stroke = "lightgray"; | |
b.mb = .5; | |
b.interval = 1; | |
a.Ed.add(b); | |
b = new z; | |
b.Kb = "LineV"; | |
b.stroke = "gray"; | |
b.mb = .5; | |
b.interval = 5; | |
a.Ed.add(b); | |
b = new z; | |
b.Kb = "LineV"; | |
b.stroke = "gray"; | |
b.mb = 1; | |
b.interval = 10; | |
a.Ed.add(b); | |
b = new F; | |
b.add(a.Ed); | |
b.Nf = "Grid"; | |
b.Do = 0; | |
b.iy = !1; | |
b.cG = !1; | |
b.tg = !1; | |
b.uy = "GRID"; | |
a.add(b); | |
a.rb.remove(b); | |
a.Ed.visible = !1 | |
} | |
function Tl() { | |
this.ea.isEnabled ? this.ea.yI(this) : Ul(this.ea) | |
} | |
function Vl(a) { | |
this.ea.isEnabled ? (this.ea.nA = a.target.scrollTop, this.ea.mA = a.target.scrollLeft) : Ul(this.ea) | |
} | |
E.prototype.diagramScroll = E.prototype.yI = function(a) { | |
if (null !== this.Ib) { | |
this.Yw = !0; | |
var b = this.kd, | |
c = this.wb, | |
d = this.Ny, | |
e = b.x - d.left, | |
g = b.y - d.top, | |
h = b.width + d.left + d.right, | |
k = b.height + d.top + d.bottom, | |
l = b.right + d.right, | |
d = b.bottom + d.bottom, | |
m = c.x, | |
b = c.y, | |
n = c.width, | |
p = c.height, | |
q = c.right, | |
r = c.bottom, | |
c = this.scale, | |
s; | |
s = a.scrollLeft; | |
if (this.rs) switch (this.kA) { | |
case "negative": | |
s = s + a.scrollWidth - a.clientWidth; | |
break; | |
case "reverse": | |
s = a.scrollWidth - s - a.clientWidth | |
} | |
var u = s; | |
n < h || p < k ? (s = D.Fb(this.position.x, this.position.y), | |
this.Be && this.mA !== u && (s.x = u / c + e, this.mA = u), this.Ce && this.nA !== a.scrollTop && (s.y = a.scrollTop / c + g, this.nA = a.scrollTop), this.position = s, D.A(s), this.Ym = this.Yw = !1) : (s = D.P(), a.LH && this.Be && (e < m && (this.position = s.n(u + e, this.position.y)), l > q && (this.position = s.n(-(this.bx.scrollWidth - this.Qb) + u - this.Qb / c + l, this.position.y))), a.MH && this.Ce && (g < b && (this.position = s.n(this.position.x, a.scrollTop + g)), d > r && (this.position = s.n(this.position.x, -(this.bx.scrollHeight - this.Pb) + a.scrollTop - this.Pb / c + d))), D.A(s), Wl(this), | |
this.Ym = this.Yw = !1, b = this.kd, c = this.wb, l = b.right, q = c.right, d = b.bottom, r = c.bottom, e = b.x, m = c.x, g = b.y, b = c.y, n >= h && e >= m && l <= q && (this.yt.style.width = "1px"), p >= k && g >= b && d <= r && (this.yt.style.height = "1px")) | |
} | |
}; | |
E.prototype.computeBounds = E.prototype.Kh = function() { | |
0 < this.Gg.count && Si(this); | |
return Xl(this) | |
}; | |
function Xl(a) { | |
if (a.JF.H()) { | |
var b = a.JF.copy(); | |
b.zx(a.padding); | |
return b | |
} | |
for (var c = !0, d = a.dc.o, e = d.length, g = 0; g < e; g++) { | |
var h = d[g]; | |
if (h.visible && (!h.Yc || h.dG)) | |
for (var h = h.rb.o, k = h.length, l = 0; l < k; l++) { | |
var m = h[l]; | |
m.iy && m.isVisible() && (m = m.aa, m.H() && (c ? (c = !1, b = m.copy()) : b.Zh(m))) | |
} | |
} | |
c && (b = new C(0, 0, 0, 0)); | |
b.zx(a.padding); | |
return b | |
} | |
E.prototype.computePartsBounds = function(a, b) { | |
void 0 === b && (b = !1); | |
for (var c = null, d = a.j; d.next();) { | |
var e = d.value; | |
!b && e instanceof J || (e.mf(), null === c ? c = e.aa.copy() : c.Zh(e.aa)) | |
} | |
return null === c ? new C(NaN, NaN, 0, 0) : c | |
}; | |
function Yl(a, b) { | |
if ((b || a.sh) && !a.ed && null !== a.Ib && !a.Ra.pf && a.kd.H()) { | |
a.ed = !0; | |
var c = a.Pm; | |
b && a.Jl !== Vh && (c = a.Jl); | |
var d = c !== Vh ? Zl(a, c) : a.scale, | |
c = a.wb.copy(), | |
e = a.Qb / d, | |
g = a.Pb / d, | |
h = null, | |
k = a.Ra; | |
k.zc && (h = a.sb.copy()); | |
a.position.Xa(); | |
var l = a.No; | |
b && !l.Xc() && a.hp.Xc() && (l = a.hp); | |
$l(a, a.sb, a.kd, e, g, l, b); | |
a.position.freeze(); | |
null !== h && rl(k, h, a.sb); | |
e = a.scale; | |
a.scale = d; | |
a.ed = !1; | |
d = a.wb; | |
d.Wc(c) || a.dv(c, d, e, a.scale, !1) | |
} | |
} | |
function Zl(a, b) { | |
var c = a.yb.Px; | |
if (null === a.Ib) return c; | |
a.sk && am(a, a.Kh()); | |
var d = a.kd; | |
if (!d.H()) return c; | |
var e = d.width, | |
d = d.height, | |
g = a.Qb, | |
h = a.Pb, | |
k = g / e, | |
l = h / d; | |
return b === bm ? (e = Math.min(l, k), e > c && (e = c), e < a.Sh && (e = a.Sh), e > a.Rh && (e = a.Rh), e) : b === cm ? (e = l > k ? (h - a.Kd) / d : (g - a.Kd) / e, e > c && (e = c), e < a.Sh && (e = a.Sh), e > a.Rh && (e = a.Rh), e) : a.scale | |
} | |
E.prototype.zoomToFit = E.prototype.zoomToFit = function() { | |
this.scale = Zl(this, bm) | |
}; | |
E.prototype.zoomToRect = function(a, b) { | |
void 0 === b && (b = bm); | |
var c = a.width, | |
d = a.height; | |
if (!(0 === c || 0 === d || isNaN(c) && isNaN(d))) { | |
var e = 1; | |
if (b === bm || b === cm) | |
if (isNaN(c)) e = this.wb.height * this.scale / d; | |
else if (isNaN(d)) e = this.wb.width * this.scale / c; | |
else var e = this.Qb, | |
g = this.Pb, | |
e = b === cm ? g / d > e / c ? (g - (this.rk ? this.Kd : 0)) / d : (e - (this.Hl ? this.Kd : 0)) / c : Math.min(g / d, e / c); | |
this.scale = e; | |
this.position = new N(a.x, a.y) | |
} | |
}; | |
D.defineProperty(E, { | |
oB: null | |
}, function() { | |
return this.ed | |
}, function(a) { | |
this.ed = a | |
}); | |
E.prototype.alignDocument = function(a, b) { | |
this.sk && am(this, this.Kh()); | |
var c = this.kd, | |
d = this.wb; | |
this.position = new N(c.x + (a.x * c.width + a.offsetX) - (b.x * d.width - b.offsetX), c.y + (a.y * c.height + a.offsetY) - (b.y * d.height - b.offsetY)) | |
}; | |
function $l(a, b, c, d, e, g, h) { | |
var k = b.x, | |
l = b.y; | |
if (h || a.UB === Cl) g.Xc() && (d > c.width && (k = c.x + (g.x * c.width + g.offsetX) - (g.x * d - g.offsetX)), e > c.height && (l = c.y + (g.y * c.height + g.offsetY) - (g.y * e - g.offsetY))), g = a.Ny, h = d - c.width, d < c.width + g.left + g.right ? (k = Math.min(k + d / 2, c.right + Math.max(h, g.right) - d / 2), k = Math.max(k, c.left - Math.max(h, g.left) + d / 2), k -= d / 2) : k > c.left ? k = c.left : k < c.right - d && (k = c.right - d), d = e - c.height, e < c.height + g.top + g.bottom ? (l = Math.min(l + e / 2, c.bottom + Math.max(d, g.bottom) - e / 2), l = Math.max(l, c.top - Math.max(d, | |
g.top) + e / 2), l -= e / 2) : l > c.top ? l = c.top : l < c.bottom - e && (l = c.bottom - e); | |
b.x = isFinite(k) ? k : -a.padding.left; | |
b.y = isFinite(l) ? l : -a.padding.top; | |
null !== a.EG && (a = a.EG(a, b), b.x = a.x, b.y = a.y) | |
} | |
E.prototype.findPartAt = E.prototype.su = function(a, b) { | |
var c = b ? Wi(this, a, function(a) { | |
return a.Y | |
}, function(a) { | |
return a.canSelect() | |
}) : Wi(this, a, function(a) { | |
return a.Y | |
}); | |
return c instanceof F ? c : null | |
}; | |
E.prototype.findObjectAt = E.prototype.Je = function(a, b, c) { | |
void 0 === b && (b = null); | |
void 0 === c && (c = null); | |
Si(this); | |
for (var d = this.dc.bo; d.next();) { | |
var e = d.value; | |
if (e.visible && (e = e.Je(a, b, c), null !== e)) return e | |
} | |
return null | |
}; | |
function Wi(a, b, c, d) { | |
void 0 === c && (c = null); | |
void 0 === d && (d = null); | |
Si(a); | |
for (a = a.dc.bo; a.next();) { | |
var e = a.value; | |
if (e.visible && !e.Yc && (e = e.Je(b, c, d), null !== e)) return e | |
} | |
return null | |
} | |
E.prototype.findObjectsAt = E.prototype.ru = function(a, b, c, d) { | |
void 0 === b && (b = null); | |
void 0 === c && (c = null); | |
d instanceof K || d instanceof L || (d = new L(O)); | |
Si(this); | |
for (var e = this.dc.bo; e.next();) { | |
var g = e.value; | |
g.visible && g.ru(a, b, c, d) | |
} | |
return d | |
}; | |
E.prototype.findObjectsIn = E.prototype.Yk = function(a, b, c, d, e) { | |
void 0 === b && (b = null); | |
void 0 === c && (c = null); | |
void 0 === d && (d = !1); | |
e instanceof K || e instanceof L || (e = new L(O)); | |
Si(this); | |
for (var g = this.dc.bo; g.next();) { | |
var h = g.value; | |
h.visible && h.Yk(a, b, c, d, e) | |
} | |
return e | |
}; | |
E.prototype.YA = function(a, b, c, d, e, g) { | |
var h = new L(O); | |
Si(this); | |
for (var k = this.dc.bo; k.next();) { | |
var l = k.value; | |
l.visible && l.YA(a, b, c, d, h, e, g) | |
} | |
return h | |
}; | |
E.prototype.findObjectsNear = E.prototype.Rn = function(a, b, c, d, e, g) { | |
void 0 === c && (c = null); | |
void 0 === d && (d = null); | |
void 0 === e && (e = !0); | |
if (!1 !== e && !0 !== e) { | |
if (e instanceof K || e instanceof L) g = e; | |
e = !0 | |
} | |
g instanceof K || g instanceof L || (g = new L(O)); | |
Si(this); | |
for (var h = this.dc.bo; h.next();) { | |
var k = h.value; | |
k.visible && k.Rn(a, b, c, d, e, g) | |
} | |
return g | |
}; | |
E.prototype.acceptEvent = function(a) { | |
var b = this.Hd; | |
this.Hd = this.Vb; | |
this.Vb = b; | |
dm(this, this, a, b, a instanceof MouseEvent); | |
return b | |
}; | |
function dm(a, b, c, d, e) { | |
d.g = b; | |
d.event = c; | |
e ? em(a, c, d) : (d.Sd = b.Vb.Sd, d.ha = b.Vb.ha); | |
a = 0; | |
c.ctrlKey && (a += 1); | |
c.altKey && (a += 2); | |
c.shiftKey && (a += 4); | |
c.metaKey && (a += 8); | |
d.xd = a; | |
d.button = c.button; | |
void 0 === c.buttons || D.Mu || (d.buttons = c.buttons); | |
D.Qh && 0 === c.button && c.ctrlKey && (d.button = 2); | |
d.Wk = !1; | |
d.up = !1; | |
d.Ee = 1; | |
d.Vk = 0; | |
d.Cc = !1; | |
d.bubbles = !1; | |
d.timestamp = Date.now(); | |
d.Ou = !1; | |
d.Qf = fm(c); | |
d.Oe = null | |
} | |
function fm(a) { | |
var b = a.target.ea; | |
if (!b) { | |
var c = a.path; | |
c || "function" !== typeof a.jI || (c = a.jI()); | |
c && c[0] && (b = c[0].ea) | |
} | |
return b ? b : null | |
} | |
function gm(a, b, c, d) { | |
var e = a.Hd; | |
a.Hd = a.Vb; | |
a.Vb = e; | |
e.g = a; | |
em(a, c, e); | |
e.button = 0; | |
e.buttons = 1; | |
c = 0; | |
b.ctrlKey && (c += 1); | |
b.altKey && (c += 2); | |
b.shiftKey && (c += 4); | |
b.metaKey && (c += 8); | |
e.xd = c; | |
e.Wk = !0; | |
e.up = !1; | |
e.Ee = 1; | |
e.Vk = 0; | |
e.Cc = !1; | |
e.bubbles = !0; | |
e.event = b; | |
e.timestamp = Date.now(); | |
e.Ou = d; | |
e.Qf = fm(b); | |
e.Oe = null; | |
d || (a.aj = e.copy()); | |
di = null; | |
return e | |
} | |
function hm(a, b, c, d) { | |
var e = a.Hd; | |
a.Hd = a.Vb; | |
a.Vb = e; | |
var g = null; | |
e.g = a; | |
null !== c ? ((g = window.document.elementFromPoint(c.clientX, c.clientY)) && g.ea ? g = g.ea : (c = void 0 !== b.targetTouches ? b.targetTouches[0] : b, g = a), e.Qf = g, em(a, c, e)) : null !== a.Hd ? (e.ha = a.Hd.ha, e.Sd = a.Hd.Sd, e.Qf = a.Hd.Qf) : null !== a.aj && (e.ha = a.aj.ha, e.Sd = a.aj.Sd, e.Qf = a.aj.Qf); | |
e.button = 0; | |
e.buttons = 1; | |
a = 0; | |
b.ctrlKey && (a += 1); | |
b.altKey && (a += 2); | |
b.shiftKey && (a += 4); | |
b.metaKey && (a += 8); | |
e.xd = a; | |
e.Wk = !1; | |
e.up = !1; | |
e.Ee = 1; | |
e.Vk = 0; | |
e.Cc = !1; | |
e.bubbles = !1; | |
e.event = b; | |
e.timestamp = | |
Date.now(); | |
e.Ou = d; | |
e.Oe = null; | |
return e | |
} | |
function ga(a, b, c) { | |
if (b.bubbles) return v && v.YF && D.trace("NOT handled " + c.type + " " + b.toString()), !0; | |
v && v.YF && D.trace("handled " + c.type + " " + a.eb.name + " " + b.toString()); | |
void 0 !== c.stopPropagation && c.stopPropagation(); | |
c.preventDefault(); | |
c.cancelBubble = !0; | |
return !1 | |
} | |
E.prototype.vJ = function(a) { | |
if (!this.ea.isEnabled) return !1; | |
var b = this.ea.Vb; | |
dm(this.ea, this.ea, a, b, !1); | |
b.key = String.fromCharCode(a.which); | |
b.Wk = !0; | |
switch (a.which) { | |
case 8: | |
b.key = "Backspace"; | |
break; | |
case 33: | |
b.key = "PageUp"; | |
break; | |
case 34: | |
b.key = "PageDown"; | |
break; | |
case 35: | |
b.key = "End"; | |
break; | |
case 36: | |
b.key = "Home"; | |
break; | |
case 37: | |
b.key = "Left"; | |
break; | |
case 38: | |
b.key = "Up"; | |
break; | |
case 39: | |
b.key = "Right"; | |
break; | |
case 40: | |
b.key = "Down"; | |
break; | |
case 45: | |
b.key = "Insert"; | |
break; | |
case 46: | |
b.key = "Del"; | |
break; | |
case 48: | |
b.key = "0"; | |
break; | |
case 187: | |
case 61: | |
case 107: | |
b.key = | |
"Add"; | |
break; | |
case 189: | |
case 173: | |
case 109: | |
b.key = "Subtract"; | |
break; | |
case 27: | |
b.key = "Esc" | |
} | |
this.ea.doKeyDown(); | |
return ga(this.ea, b, a) | |
}; | |
E.prototype.wJ = function(a) { | |
if (!this.ea.isEnabled) return !1; | |
var b = this.ea.Vb; | |
dm(this.ea, this.ea, a, b, !1); | |
b.key = String.fromCharCode(a.which); | |
b.up = !0; | |
switch (a.which) { | |
case 8: | |
b.key = "Backspace"; | |
break; | |
case 33: | |
b.key = "PageUp"; | |
break; | |
case 34: | |
b.key = "PageDown"; | |
break; | |
case 35: | |
b.key = "End"; | |
break; | |
case 36: | |
b.key = "Home"; | |
break; | |
case 37: | |
b.key = "Left"; | |
break; | |
case 38: | |
b.key = "Up"; | |
break; | |
case 39: | |
b.key = "Right"; | |
break; | |
case 40: | |
b.key = "Down"; | |
break; | |
case 45: | |
b.key = "Insert"; | |
break; | |
case 46: | |
b.key = "Del" | |
} | |
this.ea.doKeyUp(); | |
return ga(this.ea, b, a) | |
}; | |
E.prototype.dp = function(a) { | |
var b = this.Ib; | |
if (null === b) return new N(0, 0); | |
var c = this.Qb, | |
d = this.Pb, | |
b = b.getBoundingClientRect(), | |
c = a.clientX - c / b.width * b.left; | |
a = a.clientY - d / b.height * b.top; | |
return null !== this.Nc ? (a = new N(c, a), kb(a, this.Nc), a) : new N(c, a) | |
}; | |
function em(a, b, c) { | |
var d = a.Ib, | |
e = a.Qb, | |
g = a.Pb, | |
h = 0, | |
k = 0; | |
null !== d && (d = d.getBoundingClientRect(), h = b.clientX - e / d.width * d.left, k = b.clientY - g / d.height * d.top); | |
c.Sd.n(h, k); | |
null !== a.Nc ? (b = D.Fb(h, k), a.Nc.Oh(b), c.ha.assign(b), D.A(b)) : c.ha.n(h, k) | |
} | |
function cg(a, b, c, d) { | |
var e = null; | |
if (void 0 !== b.targetTouches) { | |
if (2 > b.targetTouches.length) return; | |
e = b.targetTouches[c] | |
} else if (null !== a.Dp[0]) e = a.Dp[c]; | |
else return; | |
c = a.Ib; | |
b = a.Qb; | |
a = a.Pb; | |
var g = 0, | |
h = 0; | |
null !== c && null !== e && (c = c.getBoundingClientRect(), g = e.clientX - b / c.width * c.left, h = e.clientY - a / c.height * c.top); | |
d.n(g, h) | |
} | |
E.prototype.invalidateDocumentBounds = E.prototype.Qc = function() { | |
this.sk || (this.sk = !0, this.Le(!0)) | |
}; | |
function ol(a) { | |
a.ke || Si(a); | |
a.sk && am(a, a.Kh()) | |
} | |
E.prototype.redraw = E.prototype.to = function() { | |
this.ed || this.ke || (this.ra(), im(this), Wl(this), this.Qc(), this.lg()) | |
}; | |
E.prototype.isUpdateRequested = function() { | |
return this.cg | |
}; | |
E.prototype.delayInitialization = function(a) { | |
void 0 === a && (a = null); | |
var b = this.Ra, | |
c = b.isEnabled; | |
b.Yh(); | |
b.isEnabled = !1; | |
bj(this); | |
this.sh = !1; | |
b.isEnabled = c; | |
null !== a && D.setTimeout(a, 1) | |
}; | |
E.prototype.requestUpdate = E.prototype.Le = function(a) { | |
void 0 === a && (a = !1); | |
if (!0 !== this.cg && !(this.ed || !1 === a && this.ke)) { | |
this.cg = !0; | |
var b = this; | |
requestAnimationFrame(function() { | |
b.cg && b.lg() | |
}) | |
} | |
}; | |
E.prototype.maybeUpdate = E.prototype.lg = function() { | |
if (!this.bp || this.cg) this.bp && (this.bp = !1), bj(this) | |
}; | |
function jm(a, b) { | |
a.Ra.pf || a.ed || !a.Ym || Ul(a) || (b && Si(a), Yl(a, !1)) | |
} | |
function bj(a) { | |
if (!a.ke && (a.cg = !1, null !== a.Ub)) { | |
a.ke = !0; | |
var b = a.Ra, | |
c = a.hA; | |
if (!b.np && 0 !== c.length) { | |
for (var d = c.o, e = d.length, g = 0; g < e; g++) { | |
var h = d[g]; | |
km(h, !1); | |
h.K() | |
} | |
c.clear() | |
} | |
c = a.yD; | |
0 < c.count && (c.each(function(a) { | |
a.rC() | |
}), c.clear()); | |
d = c = !1; | |
b.pf && (d = !0, c = a.lb, a.lb = !0); | |
b.zc || fl(a); | |
jm(a, !1); | |
null !== a.Ed && (a.Ed.visible && !a.gw && (lm(a), a.gw = !0), !a.Ed.visible && a.gw && (a.gw = !1)); | |
Si(a); | |
e = !1; | |
if (!a.sh || a.ek) a.sh ? mm(a, !a.Sr) : (a.Nb("Initial Layout"), !1 === b.isEnabled && b.Yh(), mm(a, !1)), e = !0; | |
a.Sr = !1; | |
Si(a); | |
a.pA || b.pf || | |
ol(a); | |
jm(a, !0); | |
e && (a.sh || pm(a), a.Ja("LayoutCompleted")); | |
Si(a); | |
e && !a.sh && (a.sh = !0, a.jd("Initial Layout"), a.lb || a.na.clear(), D.setTimeout(function() { | |
a.Gi = !1 | |
}, 1)); | |
xm(a); | |
el(b); | |
a.He(a.dd); | |
d && (a.lb = c); | |
a.ke = !1 | |
} | |
} | |
D.w(E, { | |
ao: null | |
}, function() { | |
return this.sh | |
}); | |
function pm(a) { | |
var b = a.dc.o; | |
a.Pf(b, b.length, a); | |
a.Jl !== Vh ? a.scale = Zl(a, a.Jl) : a.Pm !== Vh ? a.scale = Zl(a, a.Pm) : (b = a.hJ, isFinite(b) && 0 < b && (a.scale = b)); | |
b = a.gJ; | |
if (b.H()) a.position = b; | |
else { | |
b = D.P(); | |
b.vo(a.kd, a.fJ); | |
var c = a.wb, | |
c = D.vg(0, 0, c.width, c.height), | |
d = D.P(); | |
d.vo(c, a.iJ); | |
d.n(b.x - d.x, b.y - d.y); | |
a.position = d; | |
D.Lb(c); | |
D.A(d); | |
D.A(b); | |
im(a); | |
jm(a, !0); | |
Yl(a, !0) | |
} | |
a.Ja("InitialLayoutCompleted"); | |
lm(a) | |
} | |
function Si(a) { | |
if ((a.ke || !a.Ra.pf) && 0 !== a.Gg.count) { | |
for (var b = 0; 23 > b; b++) { | |
var c = a.Gg.j; | |
if (null === c || 0 === a.Gg.count) break; | |
a.Gg = new L(F); | |
a.rC(c, a.Gg); | |
v && 22 === b && D.trace("failure to validate parts") | |
} | |
a.rg.each(function(a) { | |
a instanceof I && 0 !== (a.Ca & 65536) !== !1 && (a.Ca ^= 65536) | |
}) | |
} | |
} | |
E.prototype.rC = function(a, b) { | |
for (a.reset(); a.next();) { | |
var c = a.value; | |
!c.re() || c instanceof I || (c.zm() ? (Hk(c, Infinity, Infinity), c.rc()) : b.add(c)) | |
} | |
for (a.reset(); a.next();) c = a.value, c instanceof I && c.isVisible() && Mm(this, c); | |
for (a.reset(); a.next();) c = a.value, c instanceof J && c.isVisible() && (c.zm() ? (Hk(c, Infinity, Infinity), c.rc()) : b.add(c)); | |
for (a.reset(); a.next();) c = a.value, c instanceof da && c.isVisible() && (c.zm() ? (Hk(c, Infinity, Infinity), c.rc()) : b.add(c)) | |
}; | |
function Mm(a, b) { | |
for (var c = D.nb(), d = D.nb(), e = b.uc; e.next();) { | |
var g = e.value; | |
g.isVisible() && (g instanceof I ? (Nm(g) || Om(g) || Pm(g)) && Mm(a, g) : g instanceof J ? g.$ === b || g.ba === b ? d.push(g) : c.push(g) : (Hk(g, Infinity, Infinity), g.rc())) | |
} | |
for (var e = c.length, h = 0; h < e; h++) g = c[h], Hk(g, Infinity, Infinity), g.rc(); | |
D.ya(c); | |
Hk(b, Infinity, Infinity); | |
b.rc(); | |
e = d.length; | |
for (h = 0; h < e; h++) g = d[h], Hk(g, Infinity, Infinity), g.rc(); | |
D.ya(d) | |
} | |
E.prototype.Pf = function(a, b, c, d) { | |
var e = this.Ra; | |
if (this.Kl || e.pf) | |
for (e = 0; e < b; e++) a[e].Pf(c, d) | |
}; | |
E.prototype.He = function(a, b) { | |
void 0 === b && (b = null); | |
null === this.Ub && D.k("No div specified"); | |
var c = this.Ib; | |
null === c && D.k("No canvas specified"); | |
var d = this.Ra; | |
if (!d.zc && (Qm(this), "0" !== this.Ub.style.opacity)) { | |
var e = a !== this.dd, | |
g = this.dc.o, | |
h = g.length, | |
k = this; | |
this.Pf(g, h, k); | |
if (e) a.De(!0), Wl(this); | |
else if (!this.Pe && null === b && !d.tk) return; | |
var h = this.sb, | |
l = this.Db, | |
m = Math.round(h.x * l) / l, | |
n = Math.round(h.y * l) / l, | |
d = this.Nc; | |
d.reset(); | |
1 !== l && d.scale(l); | |
0 === h.x && 0 === h.y || d.translate(-m, -n); | |
l = this.ud; | |
D.Zn ? (c.width = c.width, | |
a.De(!0), a.scale(l, l)) : (a.setTransform(1, 0, 0, 1, 0, 0), a.scale(l, l), a.clearRect(0, 0, this.Qb, this.Pb)); | |
a.setTransform(1, 0, 0, 1, 0, 0); | |
a.scale(l, l); | |
a.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy); | |
v && v.Dj && v.xF(this, a); | |
c = null !== b ? function(c) { | |
var d = b; | |
if (c.visible && 0 !== c.Lc) { | |
var e = c.rb.o, | |
g = e.length; | |
if (0 !== g) { | |
1 !== c.Lc && (a.globalAlpha = c.Lc); | |
c = c.Qw; | |
c.length = 0; | |
for (var h = k.scale, l = 0; l < g; l++) { | |
var m = e[l]; | |
if (tl(m) && !d.contains(m)) { | |
if (m instanceof J) { | |
var n = m; | |
n.ic && c.push(n); | |
if (!1 === n.Uf) continue | |
} | |
n = m.aa; | |
1 < n.width * h || 1 < | |
n.height * h ? m.He(a, k) : vl(m, a) | |
} | |
} | |
a.globalAlpha = 1 | |
} | |
} | |
} : function(b) { | |
b.He(a, k) | |
}; | |
Rm(this, a); | |
h = g.length; | |
for (m = 0; m < h; m++) a.setTransform(1, 0, 0, 1, 0, 0), a.scale(l, l), a.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy), c(g[m]); | |
this.Il ? this.Il.Km(this) && this.bw() : this.dp = function() { | |
return new N(0, 0) | |
}; | |
v && (v.UA || v.Dj) && v.TA(a, this, d); | |
e ? (this.dd.De(!0), Wl(this)) : this.Pe = this.Kl = !1 | |
} | |
}; | |
function Sm(a, b, c, d, e) { | |
null === a.Ub && D.k("No div specified"); | |
var g = a.Ib; | |
null === g && D.k("No canvas specified"); | |
if (!a.Ra.zc) { | |
var h = a.dd; | |
if (a.Pe) { | |
Qm(a); | |
var k = a.ud; | |
D.Zn ? (g.width = g.width, h.De(!0)) : (h.setTransform(1, 0, 0, 1, 0, 0), h.clearRect(0, 0, a.Qb * k, a.Pb * k)); | |
h.Sy(!1); | |
h.drawImage(a.Hz.ae, 0 < d ? 0 : Math.round(-d), 0 < e ? 0 : Math.round(-e)); | |
e = a.sb; | |
var g = a.Db, | |
l = Math.round(e.x * g) / g, | |
m = Math.round(e.y * g) / g; | |
d = a.Nc; | |
d.reset(); | |
1 !== g && d.scale(g); | |
0 === e.x && 0 === e.y || d.translate(-l, -m); | |
h.save(); | |
h.beginPath(); | |
e = c.length; | |
for (g = 0; g < | |
e; g++) l = c[g], 0 !== l.width && 0 !== l.height && h.rect(Math.floor(l.x), Math.floor(l.y), Math.ceil(l.width), Math.ceil(l.height)); | |
h.clip(); | |
h.setTransform(1, 0, 0, 1, 0, 0); | |
h.scale(k, k); | |
h.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy); | |
v && v.Dj && v.xF(a, h); | |
c = a.dc.o; | |
e = c.length; | |
a.Pf(c, e, a); | |
Rm(a, h); | |
for (g = 0; g < e; g++) wl(c[g], h, a, b); | |
h.restore(); | |
h.De(!0); | |
v && (v.UA || v.Dj) && v.TA(h, a, d); | |
a.Il ? a.Il.Km(a) && a.bw() : a.dp = function() { | |
return new N(0, 0) | |
}; | |
a.Kl = !1; | |
a.Pe = !1; | |
a.Gy() | |
} | |
} | |
} | |
function Tm(a, b, c, d, e, g, h, k, l, m) { | |
null === a.Ub && D.k("No div specified"); | |
null === a.Ib && D.k("No canvas specified"); | |
void 0 === h && (h = null); | |
void 0 === k && (k = null); | |
void 0 === l && (l = !1); | |
void 0 === m && (m = !1); | |
Qm(a); | |
a.dd.De(!0); | |
Wl(a); | |
a.Xz = !0; | |
var n = a.Db; | |
a.Db = e; | |
var p = a.dc.o, | |
q = p.length; | |
try { | |
var r = new C(g.x, g.y, d.width / e, d.height / e), | |
s = r.copy(); | |
s.zx(c); | |
lm(a, s); | |
Si(a); | |
a.Pf(p, q, a, r); | |
var u = a.ud; | |
b.setTransform(1, 0, 0, 1, 0, 0); | |
b.scale(u, u); | |
b.clearRect(0, 0, d.width, d.height); | |
null !== k && "" !== k && (b.fillStyle = k, b.fillRect(0, 0, d.width, d.height)); | |
var t = D.hh(); | |
t.reset(); | |
t.translate(c.left, c.top); | |
t.scale(e); | |
0 === g.x && 0 === g.y || t.translate(-g.x, -g.y); | |
b.setTransform(t.m11, t.m12, t.m21, t.m22, t.dx, t.dy); | |
D.nf(t); | |
Rm(a, b); | |
var y; | |
if (null !== h) { | |
var w = new L(F), | |
A = h.j; | |
for (A.reset(); A.next();) { | |
var B = A.value; | |
!1 === m && "Grid" === B.layer.name || null === B || w.add(B) | |
} | |
y = function(c) { | |
var d = l; | |
if (c.visible && 0 !== c.Lc && (void 0 === d && (d = !0), d || !c.Yc)) { | |
var d = c.rb.o, | |
e = d.length; | |
if (0 !== e) { | |
1 !== c.Lc && (b.globalAlpha = c.Lc); | |
c = c.Qw; | |
c.length = 0; | |
for (var g = a.scale, h = 0; h < e; h++) { | |
var k = d[h]; | |
if (tl(k) && | |
w.contains(k)) { | |
if (k instanceof J) { | |
var m = k; | |
m.ic && c.push(m); | |
if (!1 === m.Uf) continue | |
} | |
m = k.aa; | |
1 < m.width * g || 1 < m.height * g ? k.He(b, a) : vl(k, b) | |
} | |
} | |
b.globalAlpha = 1 | |
} | |
} | |
} | |
} else if (!l && m) { | |
var P = a.Xn.Y, | |
H = P.layer; | |
y = function(c) { | |
c === H ? P.He(b, a) : c.He(b, a, l) | |
} | |
} else y = function(c) { | |
c.He(b, a, l) | |
}; | |
for (c = 0; c < q; c++) y(p[c]); | |
a.Xz = !1; | |
a.Il ? a.Il.Km(a) && a.bw() : a.dp = function() { | |
return new N(0, 0) | |
} | |
} finally { | |
a.Db = n, a.dd.De(!0), Wl(a), a.Pf(p, q, a), lm(a) | |
} | |
} | |
E.prototype.getRenderingHint = E.prototype.Kj = function(a) { | |
return this.Fk[a] | |
}; | |
E.prototype.setRenderingHint = E.prototype.rK = function(a, b) { | |
this.Fk[a] = b; | |
this.to() | |
}; | |
E.prototype.resetRenderingHints = E.prototype.LG = function() { | |
this.Fk = new ma; | |
this.Fk.drawShadows = !0; | |
this.Fk.textGreeking = !0; | |
this.Fk.viewportOptimizations = D.gG || D.zq || D.Aq ? !1 : !0; | |
this.Fk.temporaryPixelRatio = !0; | |
this.Fk.pictureRatioOptimization = !0 | |
}; | |
function Rm(a, b) { | |
var c = a.Fk; | |
null !== c && (void 0 !== c.imageSmoothingEnabled && b.Sy(!!c.imageSmoothingEnabled), c = c.defaultFont, void 0 !== c && null !== c && (b.font = c)) | |
} | |
E.prototype.getInputOption = E.prototype.Cu = function(a) { | |
return this.kp[a] | |
}; | |
E.prototype.setInputOption = function(a, b) { | |
this.kp[a] = b | |
}; | |
E.prototype.resetInputOptions = E.prototype.KG = function() { | |
this.kp = new ma; | |
this.kp.extraTouchArea = 10; | |
this.kp.extraTouchThreshold = 10; | |
this.kp.hasGestureZoom = !0 | |
}; | |
E.prototype.setProperties = function(a) { | |
D.nv(this, a) | |
}; | |
function xm(a) { | |
if (0 === a.na.Ki && 0 !== a.Dl.count) { | |
for (; 0 < a.Dl.count;) { | |
var b = a.Dl; | |
a.Dl = new na(J, C); | |
for (b = b.j; b.next();) { | |
var c = b.key; | |
wj(c, b.value); | |
c.Ue() | |
} | |
} | |
a.ra() | |
} | |
} | |
E.prototype.ra = function(a) { | |
void 0 === a && (a = null); | |
if (null === a) this.Pe = !0, this.Le(); | |
else { | |
var b = this.wb; | |
null !== a && a.H() && b.jg(a) && (this.Pe = !0, this.Le()) | |
} | |
for (b = this.Rw.j; b.next();) b.value.ra(a) | |
}; | |
E.prototype.bG = function(a, b) { | |
if (!0 !== this.Pe) { | |
this.Pe = !0; | |
var c = !0 === this.Kj("temporaryPixelRatio"); | |
if (!0 === this.Kj("viewportOptimizations") && this.UB !== Um && this.Ny.Ux(0, 0, 0, 0) && b.width === a.width && b.height === a.height) { | |
var d = this.scale, | |
e = D.Sf(), | |
g = Math.max(a.x, b.x), | |
h = Math.max(a.y, b.y), | |
k = Math.min(a.x + a.width, b.x + b.width), | |
l = Math.min(a.y + a.height, b.y + b.height); | |
e.x = g; | |
e.y = h; | |
e.width = Math.max(0, k - g) * d; | |
e.height = Math.max(0, l - h) * d; | |
if (0 < e.width && 0 < e.height) { | |
if (!this.ke && (this.cg = !1, null !== this.Ub)) { | |
this.ke = !0; | |
xm(this); | |
this.kd.H() || am(this, this.Kh()); | |
var m = this.Ib; | |
if (null !== m) { | |
var n = this.ud, | |
h = this.Qb * n, | |
k = this.Pb * n, | |
g = this.scale * n, | |
d = Math.round(Math.round(b.x * g) - Math.round(a.x * g)), | |
g = Math.round(Math.round(b.y * g) - Math.round(a.y * g)), | |
l = this.Hz, | |
p = this.pD; | |
l.width !== h && (l.width = h); | |
l.height !== k && (l.height = k); | |
p.clearRect(0, 0, h, k); | |
var l = 190 * this.ud, | |
q = 70 * this.ud, | |
r = Math.max(d, 0), | |
s = Math.max(g, 0), | |
u = Math.floor(h - r), | |
t = Math.floor(k - s); | |
p.Sy(!1); | |
p.drawImage(m.ae, r, s, u, t, 0, 0, u, t); | |
this.Il.Km(this) && p.clearRect(0, 0, l, q); | |
var m = D.nb(), | |
p = | |
D.nb(), | |
t = Math.abs(d), | |
u = Math.abs(g), | |
y = 0 === r ? 0 : h - t, | |
r = D.Fb(y, 0), | |
t = D.Fb(t + y, k); | |
p.push(new C(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - t.x), Math.abs(r.y - t.y))); | |
var w = this.Nc; | |
w.reset(); | |
w.scale(n, n); | |
1 !== this.Db && w.scale(this.Db); | |
n = this.sb; | |
(0 !== n.x || 0 !== n.y) && isFinite(n.x) && isFinite(n.y) && w.translate(-n.x, -n.y); | |
kb(r, w); | |
kb(t, w); | |
m.push(new C(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - t.x), Math.abs(r.y - t.y))); | |
y = 0 === s ? 0 : k - u; | |
r.n(0, y); | |
t.n(h, u + y); | |
p.push(new C(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - | |
t.x), Math.abs(r.y - t.y))); | |
kb(r, w); | |
kb(t, w); | |
m.push(new C(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - t.x), Math.abs(r.y - t.y))); | |
this.Il.Km(this) && (h = 0 < d ? 0 : -d, k = 0 < g ? 0 : -g, r.n(h, k), t.n(l + h, q + k), p.push(new C(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - t.x), Math.abs(r.y - t.y))), kb(r, w), kb(t, w), m.push(new C(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - t.x), Math.abs(r.y - t.y)))); | |
D.A(r); | |
D.A(t); | |
jm(this, !1); | |
Sm(this, m, p, d, g); | |
D.ya(m); | |
D.ya(p); | |
this.ke = !1 | |
} | |
} | |
} else this.lg(); | |
D.Lb(e); | |
c && (this.Ik = 1, this.lg(), | |
this.Ik = null, this.Gy()) | |
} else c ? (this.Ik = 1, this.lg(), this.Ik = null, this.Gy()) : this.lg() | |
} | |
}; | |
function im(a) { | |
!1 === a.Ym && (a.Ym = !0) | |
} | |
function Wl(a) { | |
!1 === a.Kl && (a.Kl = !0) | |
} | |
function Qm(a) { | |
!1 !== a.ms && (a.ms = !1, Vm(a, a.Qb, a.Pb)) | |
} | |
function Vm(a, b, c) { | |
var d = a.Ib, | |
e = a.ud, | |
g = b * e, | |
e = c * e; | |
if (d.width !== g || d.height !== e) d.width = g, d.height = e, d.style.width = b + "px", d.style.height = c + "px", a.Pe = !0, a.dd.De(!0) | |
} | |
function Ul(a) { | |
var b = a.Ib; | |
if (null === b) return !0; | |
var c = a.Ub, | |
d = a.Qb, | |
e = a.Pb, | |
g = a.KE.copy(); | |
if (!g.H()) return !0; | |
var h = !1, | |
k = a.Hl ? a.Kd : 0, | |
l = a.rk ? a.Kd : 0, | |
m = c.clientWidth || d + k, | |
c = c.clientHeight || e + l; | |
if (m !== d + k || c !== e + l) a.Hl = !1, a.rk = !1, l = k = 0, a.Qb = m, a.Pb = c, h = a.ms = !0; | |
a.Ym = !1; | |
var n = a.wb, | |
p = a.kd, | |
q = 0, | |
r = 0, | |
s = 0, | |
u = 0, | |
m = n.width, | |
c = n.height, | |
t = a.Ny; | |
a.JA.Xc() ? (p.width > m && (q = t.left, r = t.right), p.height > c && (s = t.top, u = t.bottom)) : (q = t.left, r = t.right, s = t.top, u = t.bottom); | |
var t = p.width + q + r, | |
y = p.height + s + u, | |
q = p.x - q, | |
w = n.x, | |
r = p.right + r, | |
A = n.right + | |
k, | |
s = p.y - s, | |
B = n.y, | |
u = p.bottom + u, | |
n = n.bottom + l, | |
P = "1px", | |
H = "1px", | |
p = a.scale, | |
R = !(t < m + k), | |
aa = !(y < c + l); | |
a.UB === Cl && (R || aa) && (R && a.hB && a.Be && (P = 1, q + 1 < w && (P = Math.max((w - q) * p + a.Qb, P)), r > A + 1 && (P = Math.max((r - A) * p + a.Qb, P)), m + k + 1 < t && (P = Math.max((t - m + k) * p + a.Qb, P)), P = P.toString() + "px"), aa && a.iB && a.Ce && (H = 1, s + 1 < B && (H = Math.max((B - s) * p + a.Pb, H)), u > n + 1 && (H = Math.max((u - n) * p + a.Pb, H)), c + l + 1 < y && (H = Math.max((y - c + l) * p + a.Pb, H)), H = H.toString() + "px")); | |
var R = "1px" !== P, | |
V = "1px" !== H; | |
R && V || !R && !V || (aa = !(y < c + l), V && (A -= a.Kd), R && (n -= a.Kd), | |
t < m + k || !a.hB || !a.Be || (P = 1, q + 1 < w && (P = Math.max((w - q) * p + a.Qb, P)), r > A + 1 && (P = Math.max((r - A) * p + a.Qb, P)), m + 1 < t && (P = Math.max((t - m) * p + a.Qb, P)), P = P.toString() + "px"), R = "1px" !== P, k = a.Pb, R !== a.rk && (k = R ? a.Pb - a.Kd : a.Pb + a.Kd), aa && a.iB && a.Ce && (H = 1, s + 1 < B && (H = Math.max((B - s) * p + k, H)), u > n + 1 && (H = Math.max((u - n) * p + k, H)), c + 1 < y && (H = Math.max((y - c) * p + k, H)), H = H.toString() + "px"), V = "1px" !== H); | |
if (a.Yw && R === a.rk && V === a.Hl) return d === a.Qb && e === a.Pb || a.lg(), !1; | |
R !== a.rk && (a.Pb = "1px" === P ? a.Pb + a.Kd : Math.max(a.Pb - a.Kd, 1), h = !0); | |
a.rk = R; | |
a.yt.style.width = | |
P; | |
V !== a.Hl && (a.Qb = "1px" === H ? a.Qb + a.Kd : Math.max(a.Qb - a.Kd, 1), h = !0, a.rs && (k = D.P(), V ? (b.style.left = a.Kd + "px", a.position = k.n(a.sb.x + a.Kd / a.scale, a.sb.y)) : (b.style.left = "0px", a.position = k.n(a.sb.x - a.Kd / a.scale, a.sb.y)), D.A(k))); | |
a.Hl = V; | |
a.yt.style.height = H; | |
b = a.bx; | |
k = b.scrollLeft; | |
a.hB && a.Be && (m + 1 < t ? k = (a.position.x - q) * p : q + 1 < w ? k = b.scrollWidth - b.clientWidth : r > A + 1 && (k = a.position.x * p)); | |
if (a.rs) switch (a.kA) { | |
case "negative": | |
k = -(b.scrollWidth - k - b.clientWidth); | |
break; | |
case "reverse": | |
k = b.scrollWidth - k - b.clientWidth | |
} | |
b.scrollLeft = | |
k; | |
a.iB && a.Ce && (c + 1 < y ? b.scrollTop = (a.position.y - s) * p : s + 1 < B ? b.scrollTop = b.scrollHeight - b.clientHeight : u > n + 1 && (b.scrollTop = a.position.y * p)); | |
h && (a.ms = !0); | |
m = a.Qb; | |
c = a.Pb; | |
b.style.width = m + (a.Hl ? a.Kd : 0) + "px"; | |
b.style.height = c + (a.rk ? a.Kd : 0) + "px"; | |
return d !== m || e !== c || a.Ra.zc ? (n = a.wb, a.dv(g, n, p, a.scale, h), !1) : !0 | |
} | |
E.prototype.add = E.prototype.add = function(a) { | |
D.l(a, F, E, "add:part"); | |
var b = a.g; | |
if (b !== this) { | |
null !== b && D.k("Cannot add part " + a.toString() + " to " + this.toString() + ". It is already a part of " + b.toString()); | |
this.hr && (a.Ol = "Tool"); | |
var c = a.Nf, | |
b = this.qm(c); | |
null === b && (b = this.qm("")); | |
null === b && D.k('Cannot add a Part when unable find a Layer named "' + c + '" and there is no default Layer'); | |
a.layer !== b && (c = b.uq(99999999, a, a.g === this), 0 <= c && this.od(hg, "parts", b, null, a, null, c), b.Yc || this.Qc(), a.L(Wm), c = a.py, null !== | |
c && c(a, null, b)) | |
} | |
}; | |
E.prototype.uq = function(a) { | |
if (a instanceof G) { | |
if (this.Ap.add(a), a instanceof I) { | |
var b = a.Ka; | |
null === b ? this.am.add(a) : b.jn.add(a); | |
b = a.Zb; | |
null !== b && (b.g = this) | |
} | |
} else a instanceof J ? this.tp.add(a) : a instanceof da || this.rb.add(a); | |
var c = this; | |
Xm(a, function(a) { | |
Ym(c, a) | |
}); | |
(a instanceof da || a instanceof I && null !== a.Sb) && a.K(); | |
b = a.data; | |
null !== b && (a instanceof da || (a instanceof J ? this.hk.add(b, a) : this.Vi.add(b, a)), Xm(a, function(a) { | |
Zm(c, a) | |
})); | |
!0 !== Om(a) && !0 !== Pm(a) || this.Gg.add(a); | |
$m(a, !0, this); | |
an(a) ? (a.aa.H() && | |
this.ra(xl(a, a.aa)), this.Qc()) : a.isVisible() && a.aa.H() && this.ra(xl(a, a.aa)); | |
this.Le() | |
}; | |
E.prototype.Af = function(a) { | |
a.iu(); | |
if (a instanceof G) { | |
if (this.Ap.remove(a), a instanceof I) { | |
var b = a.Ka; | |
null === b ? this.am.remove(a) : b.jn.remove(a); | |
b = a.Zb; | |
null !== b && (b.g = null) | |
} | |
} else a instanceof J ? this.tp.remove(a) : a instanceof da || this.rb.remove(a); | |
var c = this; | |
Xm(a, function(a) { | |
bn(c, a) | |
}); | |
b = a.data; | |
null !== b && (a instanceof da || (a instanceof J ? this.hk.remove(b) : this.Vi.remove(b)), Xm(a, function(a) { | |
cn(c, a) | |
})); | |
this.Gg.remove(a); | |
an(a) ? (a.aa.H() && this.ra(xl(a, a.aa)), this.Qc()) : a.isVisible() && a.aa.H() && this.ra(xl(a, | |
a.aa)); | |
this.Le() | |
}; | |
E.prototype.remove = E.prototype.remove = function(a) { | |
D.l(a, F, E, "remove:part"); | |
dn(this, a, !0) | |
}; | |
function dn(a, b, c) { | |
var d = b.layer; | |
null !== d && d.g === a && (b.jb = !1, b.Zg = !1, b.L(en), c && b.Pn(), c = d.Af(-1, b, !1), 0 <= c && a.od(ig, "parts", d, b, null, c, null), a = b.py, null !== a && a(b, d, null)) | |
} | |
E.prototype.removeParts = E.prototype.QB = function(a, b) { | |
if (D.isArray(a)) | |
for (var c = D.cb(a), d = 0; d < c; d++) { | |
var e = D.La(a, d); | |
b && !e.canDelete() || this.remove(e) | |
} else | |
for (e = new L(F), e.Vc(a), c = e.j; c.next();) e = c.value, b && !e.canDelete() || this.remove(e) | |
}; | |
E.prototype.copyParts = E.prototype.hq = function(a, b, c) { | |
return this.yb.hq(a, b, c) | |
}; | |
E.prototype.moveParts = E.prototype.moveParts = function(a, b, c) { | |
D.l(b, N, E, "moveParts:offset"); | |
var d = this.ob; | |
if (null !== d) { | |
d = d.Ge; | |
null === d && (d = new Uh, d.ad(this)); | |
var e = new na(F); | |
if (null !== a) a = a.j; | |
else { | |
for (a = this.Hi; a.next();) gi(d, e, a.value, c); | |
for (a = this.rg; a.next();) gi(d, e, a.value, c); | |
a = this.links | |
} | |
for (; a.next();) gi(d, e, a.value, c); | |
d.moveParts(e, b, c) | |
} | |
}; | |
function fn(a, b, c) { | |
D.l(b, Hg, E, "addLayer:layer"); | |
null !== b.g && b.g !== a && D.k("Cannot share a Layer with another Diagram: " + b + " of " + b.g); | |
null === c ? null !== b.g && D.k("Cannot add an existing Layer to this Diagram again: " + b) : (D.l(c, Hg, E, "addLayer:existingLayer"), c.g !== a && D.k("Existing Layer must be in this Diagram: " + c + " not in " + c.g), b === c && D.k("Cannot move a Layer before or after itself: " + b)); | |
if (b.g !== a) { | |
b = b.name; | |
a = a.dc; | |
c = a.count; | |
for (var d = 0; d < c; d++) a.fa(d).name === b && D.k("Cannot add Layer with the name '" + | |
b + "'; a Layer with the same name is already present in this Diagram.") | |
} | |
} | |
E.prototype.addLayer = E.prototype.$t = function(a) { | |
fn(this, a, null); | |
a.ad(this); | |
var b = this.dc, | |
c = b.count - 1; | |
if (!a.Yc) | |
for (; 0 <= c && b.fa(c).Yc;) c--; | |
b.ce(c + 1, a); | |
null !== this.ye && this.od(hg, "layers", this, null, a, null, c + 1); | |
this.ra(); | |
this.Qc() | |
}; | |
E.prototype.addLayerBefore = E.prototype.VH = function(a, b) { | |
fn(this, a, b); | |
a.ad(this); | |
var c = this.dc, | |
d = c.indexOf(a); | |
0 <= d && (c.remove(a), null !== this.ye && this.od(ig, "layers", this, a, null, d, null)); | |
for (var e = c.count, g = 0; g < e; g++) | |
if (c.fa(g) === b) { | |
c.ce(g, a); | |
break | |
} | |
null !== this.ye && this.od(hg, "layers", this, null, a, null, g); | |
this.ra(); | |
0 > d && this.Qc() | |
}; | |
E.prototype.addLayerAfter = function(a, b) { | |
fn(this, a, b); | |
a.ad(this); | |
var c = this.dc, | |
d = c.indexOf(a); | |
0 <= d && (c.remove(a), null !== this.ye && this.od(ig, "layers", this, a, null, d, null)); | |
for (var e = c.count, g = 0; g < e; g++) | |
if (c.fa(g) === b) { | |
c.ce(g + 1, a); | |
break | |
} | |
null !== this.ye && this.od(hg, "layers", this, null, a, null, g + 1); | |
this.ra(); | |
0 > d && this.Qc() | |
}; | |
E.prototype.removeLayer = function(a) { | |
D.l(a, Hg, E, "removeLayer:layer"); | |
a.g !== this && D.k("Cannot remove a Layer from another Diagram: " + a + " of " + a.g); | |
if ("" !== a.name) { | |
var b = this.dc, | |
c = b.indexOf(a); | |
if (b.remove(a)) { | |
for (b = a.rb.copy().j; b.next();) { | |
var d = b.value, | |
e = d.Nf; | |
d.Nf = e !== a.name ? e : "" | |
} | |
null !== this.ye && this.od(ig, "layers", this, a, null, c, null); | |
this.ra(); | |
this.Qc() | |
} | |
} | |
}; | |
E.prototype.findLayer = E.prototype.qm = function(a) { | |
for (var b = this.co; b.next();) { | |
var c = b.value; | |
if (c.name === a) return c | |
} | |
return null | |
}; | |
E.prototype.addModelChangedListener = E.prototype.XH = function(a) { | |
D.h(a, "function", E, "addModelChangedListener:listener"); | |
null === this.xh && (this.xh = new K("function")); | |
this.xh.add(a); | |
this.da.Dn(a) | |
}; | |
E.prototype.removeModelChangedListener = function(a) { | |
D.h(a, "function", E, "removeModelChangedListener:listener"); | |
null !== this.xh && (this.xh.remove(a), 0 === this.xh.count && (this.xh = null)); | |
this.da.gv(a) | |
}; | |
E.prototype.addChangedListener = E.prototype.Dn = function(a) { | |
D.h(a, "function", E, "addChangedListener:listener"); | |
null === this.Qi && (this.Qi = new K("function")); | |
this.Qi.add(a) | |
}; | |
E.prototype.removeChangedListener = E.prototype.gv = function(a) { | |
D.h(a, "function", E, "removeChangedListener:listener"); | |
null !== this.Qi && (this.Qi.remove(a), 0 === this.Qi.count && (this.Qi = null)) | |
}; | |
E.prototype.Hx = function(a) { | |
this.lb || this.na.XF(a); | |
a.Oc !== gg && (this.Gi = !0); | |
if (null !== this.Qi) | |
for (var b = this.Qi, c = b.length, d = 0; d < c; d++) b.fa(d)(a) | |
}; | |
E.prototype.raiseChangedEvent = E.prototype.od = function(a, b, c, d, e, g, h) { | |
void 0 === g && (g = null); | |
void 0 === h && (h = null); | |
var k = new eg; | |
k.g = this; | |
k.Oc = a; | |
k.propertyName = b; | |
k.object = c; | |
k.oldValue = d; | |
k.Wj = g; | |
k.newValue = e; | |
k.Uj = h; | |
this.Hx(k) | |
}; | |
E.prototype.raiseChanged = E.prototype.i = function(a, b, c, d, e) { | |
this.od(fg, a, this, b, c, d, e) | |
}; | |
D.w(E, { | |
Ra: "animationManager" | |
}, function() { | |
return this.HC | |
}); | |
D.w(E, { | |
na: "undoManager" | |
}, function() { | |
return this.ye.na | |
}); | |
D.defineProperty(E, { | |
lb: "skipsUndoManager" | |
}, function() { | |
return this.vj | |
}, function(a) { | |
D.h(a, "boolean", E, "skipsUndoManager"); | |
this.vj = a; | |
this.ye.vj = a | |
}); | |
D.defineProperty(E, { | |
QA: "delaysLayout" | |
}, function() { | |
return this.Cz | |
}, function(a) { | |
this.Cz = a | |
}); | |
E.prototype.Hn = function(a, b) { | |
if (null !== a && a.g === this) { | |
var c = this.Xe; | |
try { | |
this.Xe = !0; | |
var d = a.Oc, | |
e; | |
if (d === fg) { | |
var g = a.object, | |
h = a.propertyName, | |
k = a.oa(b); | |
D.Ua(g, h, k); | |
if (g instanceof O) { | |
var l, m = g.Y; | |
null !== m && m.qe() | |
} | |
this.Gi = !0 | |
} else if (d === hg) { | |
var n = a.object, | |
p = a.Uj, | |
g = a.newValue; | |
if (n instanceof x) | |
if ("number" === typeof p && g instanceof O) { | |
l = g; | |
var q = n; | |
b ? q.Af(p) : q.ce(p, l); | |
m = n.Y; | |
null !== m && m.qe() | |
} else { | |
if ("number" === typeof p && g instanceof jh) { | |
var r = g, | |
q = n; | |
b ? r.Ke ? q.JG(p) : q.HG(p) : (e = r.Ke ? q.pe(r.index) : q.oe(r.index), | |
e.gq(r)) | |
} | |
} | |
else if (n instanceof Hg) { | |
var s = !0 === a.Wj; | |
if ("number" === typeof p && g instanceof F) { | |
var m = g, | |
u = n; | |
b ? (m.jb = !1, m.Zg = !1, m.qe(), u.Af(s ? p : -1, m, s)) : u.uq(p, m, s) | |
} | |
} else if (n instanceof E) { | |
if ("number" === typeof p && g instanceof Hg) { | |
var t = g; | |
b ? this.dc.pd(p) : (d = t, d.ad(this), this.dc.ce(p, d)) | |
} | |
} else D.k("unknown ChangedEvent.Insert object: " + a.toString()); | |
this.Gi = !0 | |
} else d === ig ? (n = a.object, p = a.Wj, g = a.oldValue, n instanceof x ? "number" === typeof p && g instanceof O ? (q = n, b ? q.ce(p, g) : q.Af(p)) : "number" === typeof p && g instanceof jh && (r = g, q = n, b ? (e = r.Ke ? q.pe(r.index) : q.oe(r.index), e.gq(r)) : r.Ke ? q.JG(p) : q.HG(p)) : n instanceof Hg ? (s = !0 === a.Uj, "number" === typeof p && g instanceof F && (m = g, u = n, b ? u.uq(p, m, s) : (m.jb = !1, m.Zg = !1, m.qe(), u.Af(s ? p : -1, m, s)))) : n instanceof E ? "number" === typeof p && g instanceof Hg && (t = g, b ? (d = t, d.ad(this), this.dc.ce(p, d)) : this.dc.pd(p)) : D.k("unknown ChangedEvent.Remove object: " + a.toString()), this.Gi = !0) : d !== gg && D.k("unknown ChangedEvent: " + a.toString()) | |
} finally { | |
this.Xe = c | |
} | |
} | |
}; | |
E.prototype.startTransaction = E.prototype.Nb = function(a) { | |
return this.na.Nb(a) | |
}; | |
E.prototype.commitTransaction = E.prototype.jd = function(a) { | |
return this.na.jd(a) | |
}; | |
E.prototype.rollbackTransaction = E.prototype.Bm = function() { | |
return this.na.Bm() | |
}; | |
E.prototype.commit = function(a, b) { | |
var c = b; | |
void 0 === c && (c = ""); | |
var d = this.lb; | |
null === c && (this.lb = !0, c = ""); | |
this.na.Nb(c); | |
var e = !1; | |
try { | |
a(this), e = !0 | |
} finally { | |
e ? this.na.jd(c) : this.na.Bm(), this.lb = d | |
} | |
}; | |
E.prototype.updateAllTargetBindings = E.prototype.tH = function(a) { | |
void 0 === a && (a = ""); | |
for (var b = this.Hi; b.next();) b.value.Ob(a); | |
for (b = this.rg; b.next();) b.value.Ob(a); | |
for (b = this.links; b.next();) b.value.Ob(a) | |
}; | |
E.prototype.updateAllRelationshipsFromData = E.prototype.IK = function() { | |
for (var a = this.da, b = new L, c = a.qg, d = 0; d < c.length; d++) { | |
var e = c[d]; | |
b.add(e) | |
} | |
var g = []; | |
this.rg.each(function(a) { | |
null === a.data || b.contains(a.data) || g.push(a.data) | |
}); | |
this.Hi.each(function(a) { | |
null === a.data || b.contains(a.data) || g.push(a.data) | |
}); | |
g.forEach(function(b) { | |
eh(a, b, !1) | |
}); | |
for (d = 0; d < c.length; d++) { | |
var e = c[d], | |
h = this.Nh(e); | |
null === h && dh(a, e, !1) | |
} | |
if (a instanceof Y) { | |
for (var k = new L, c = a.$g, d = 0; d < c.length; d++) e = c[d], k.add(e); | |
var l = []; | |
this.links.each(function(a) { | |
null === | |
a.data || k.contains(a.data) || l.push(a.data) | |
}); | |
l.forEach(function(b) { | |
oh(a, b, !1) | |
}); | |
for (d = 0; d < c.length; d++) e = c[d], h = this.gg(e), null === h && nh(a, e, !1) | |
} | |
for (d = this.Hi; d.next();) h = d.value, h.updateRelationshipsFromData(); | |
for (d = this.rg; d.next();) d.value.updateRelationshipsFromData(); | |
for (d = this.links; d.next();) h = d.value, h.updateRelationshipsFromData() | |
}; | |
function gn(a, b, c) { | |
if (a.ed || a.ke) a.Db = c, c = a.Ra, c.zc && sl(c, b, a.Db); | |
else if (a.ed = !0, null === a.Ib) a.Db = c; | |
else { | |
var d = a.wb.copy(), | |
e = a.Qb, | |
g = a.Pb; | |
d.width = a.Qb / b; | |
d.height = a.Pb / b; | |
var h = a.Lm.x, | |
k = a.Lm.y, | |
l = a.JA; | |
isNaN(h) && (l.Pj() ? l.Mj(xc) ? h = 0 : l.Mj(yc) && (h = e - 1) : h = l.Xc() ? l.x * (e - 1) : e / 2); | |
isNaN(k) && (l.Pj() ? l.Mj(wc) ? k = 0 : l.Mj(Dc) && (k = g - 1) : k = l.Xc() ? l.y * (g - 1) : g / 2); | |
null !== a.TG && (c = a.TG(a, c)); | |
c < a.Sh && (c = a.Sh); | |
c > a.Rh && (c = a.Rh); | |
e = D.Fb(a.sb.x + h / b - h / c, a.sb.y + k / b - k / c); | |
a.position = e; | |
D.A(e); | |
a.Db = c; | |
a.dv(d, a.wb, b, c, !1); | |
a.ed = !1; | |
Yl(a, !1); | |
c = a.Ra; | |
c.zc && sl(c, b, a.Db); | |
a.ra(); | |
im(a) | |
} | |
} | |
E.prototype.dv = function(a, b, c, d, e) { | |
a.O(b) || (void 0 === e && (e = !1), e || im(this), Wl(this), d = this.Zb, null === d || !d.my || this.jm !== Vh || e || a.width === b.width && a.height === b.height || d.L(), d = this.eb, !0 === this.th && d instanceof Ph && (this.U.ha = this.oC(this.U.Sd), Xk(d, this)), this.ed || this.bG(a, b), lm(this), this.Fh.scale = c, this.Fh.position.x = a.x, this.Fh.position.y = a.y, this.Fh.bounds.set(a), this.Fh.isScroll = e, this.Ja("ViewportBoundsChanged", this.Fh, a), this.tB && this.links.each(function(a) { | |
a.Nj && a.aa.jg(b) && a.ec() | |
})) | |
}; | |
function lm(a, b) { | |
void 0 === b && (b = null); | |
var c = a.Ed; | |
if (null !== c && c.visible) { | |
for (var d = D.Im(), e = 1, g = 1, h = c.xa.o, k = h.length, l = 0; l < k; l++) { | |
var m = h[l], | |
n = m.interval; | |
2 > n || (hn(m.Kb) ? g = g * n / Te(g, n) : e = e * n / Te(e, n)) | |
} | |
h = c.by; | |
d.n(g * h.width, e * h.height); | |
h = g = l = k = 0; | |
if (null !== b) k = b.width, l = b.height, g = b.x, h = b.y; | |
else { | |
e = D.Sf(); | |
g = a.wb; | |
e.n(g.x, g.y, g.width, g.height); | |
for (h = a.Rw.j; h.next();) g = h.value.wb, g.H() && Ub(e, g.x, g.y, g.width, g.height); | |
if (!e.H()) { | |
D.Lb(e); | |
return | |
} | |
k = e.width; | |
l = e.height; | |
g = e.x; | |
h = e.y; | |
D.Lb(e) | |
} | |
c.width = k + 2 * d.width; | |
c.height = | |
l + 2 * d.height; | |
e = D.P(); | |
gb(g, h, 0, 0, d.width, d.height, e); | |
e.offset(-d.width, -d.height); | |
D.$k(d); | |
c.Y.location = e; | |
D.A(e) | |
} | |
} | |
E.prototype.clearSelection = E.prototype.Jx = function() { | |
var a = 0 < this.selection.count; | |
a && this.Ja("ChangingSelection"); | |
Th(this); | |
a && this.Ja("ChangedSelection") | |
}; | |
function Th(a) { | |
a = a.selection; | |
if (0 < a.count) { | |
for (var b = a.Fc(), c = b.length, d = 0; d < c; d++) b[d].jb = !1; | |
a.Xa(); | |
a.clear(); | |
a.freeze() | |
} | |
} | |
E.prototype.select = E.prototype.select = function(a) { | |
null !== a && (D.l(a, F, E, "select:part"), a.layer.g === this && (!a.jb || 1 < this.selection.count) && (this.Ja("ChangingSelection"), Th(this), a.jb = !0, this.Ja("ChangedSelection"))) | |
}; | |
E.prototype.selectCollection = E.prototype.XG = function(a) { | |
this.Ja("ChangingSelection"); | |
Th(this); | |
if (D.isArray(a)) | |
for (var b = D.cb(a), c = 0; c < b; c++) { | |
var d = D.La(a, c); | |
d instanceof F || D.k("Diagram.selectCollection given something that is not a Part: " + d); | |
d.jb = !0 | |
} else | |
for (a = a.j; a.next();) d = a.value, d instanceof F || D.k("Diagram.selectCollection given something that is not a Part: " + d), d.jb = !0; | |
this.Ja("ChangedSelection") | |
}; | |
E.prototype.clearHighlighteds = E.prototype.dI = function() { | |
var a = this.wm; | |
if (0 < a.count) { | |
for (var b = a.Fc(), c = b.length, d = 0; d < c; d++) b[d].Zg = !1; | |
a.Xa(); | |
a.clear(); | |
a.freeze() | |
} | |
}; | |
E.prototype.highlight = function(a) { | |
null !== a && a.layer.g === this && (D.l(a, F, E, "highlight:part"), !a.Zg || 1 < this.wm.count) && (this.dI(), a.Zg = !0) | |
}; | |
E.prototype.highlightCollection = function(a) { | |
for (var b = (new L(F)).Vc(a), c = this.wm.copy().Iy(b).j; c.next();) a = c.value, a.Zg = !1; | |
for (b = b.j; b.next();) a = b.value, a instanceof F || D.k("Diagram.highlightCollection given something that is not a Part: " + a), a.Zg = !0 | |
}; | |
E.prototype.scroll = E.prototype.scroll = function(a, b, c) { | |
void 0 === c && (c = 1); | |
var d = "up" === b || "down" === b, | |
e = 0; | |
if ("pixel" === a) e = c; | |
else if ("line" === a) e = c * (d ? this.mv : this.lv); | |
else if ("page" === a) a = d ? this.wb.height : this.wb.width, a *= this.scale, 0 !== a && (e = Math.max(a - (d ? this.mv : this.lv), 0), e *= c); | |
else { | |
if ("document" === a) { | |
e = this.kd; | |
d = this.wb; | |
c = D.P(); | |
"up" === b ? this.position = c.n(d.x, e.y) : "left" === b ? this.position = c.n(e.x, d.y) : "down" === b ? this.position = c.n(d.x, e.bottom - d.height) : "right" === b && (this.position = c.n(e.right - d.width, | |
d.y)); | |
D.A(c); | |
return | |
} | |
D.k("scrolling unit must be 'pixel', 'line', 'page', or 'document', not: " + a) | |
} | |
e /= this.scale; | |
c = this.position.copy(); | |
"up" === b ? c.y = this.position.y - e : "down" === b ? c.y = this.position.y + e : "left" === b ? c.x = this.position.x - e : "right" === b ? c.x = this.position.x + e : D.k("scrolling direction must be 'up', 'down', 'left', or 'right', not: " + b); | |
this.position = c | |
}; | |
E.prototype.scrollToRect = E.prototype.UG = function(a) { | |
var b = this.wb; | |
b.Tk(a) || (a = a.km, a.x -= b.width / 2, a.y -= b.height / 2, this.position = a) | |
}; | |
E.prototype.centerRect = E.prototype.cF = function(a) { | |
var b = this.wb; | |
a = a.km; | |
a.x -= b.width / 2; | |
a.y -= b.height / 2; | |
this.position = a | |
}; | |
E.prototype.transformDocToView = E.prototype.wv = function(a) { | |
var b = this.Nc; | |
b.reset(); | |
1 !== this.Db && b.scale(this.Db); | |
var c = this.sb; | |
(0 !== c.x || 0 !== c.y) && isFinite(c.x) && isFinite(c.y) && b.translate(-c.x, -c.y); | |
return a.copy().transform(this.Nc) | |
}; | |
E.prototype.transformViewToDoc = E.prototype.oC = function(a) { | |
var b = this.Nc; | |
b.reset(); | |
1 !== this.Db && b.scale(this.Db); | |
var c = this.sb; | |
(0 !== c.x || 0 !== c.y) && isFinite(c.x) && isFinite(c.y) && b.translate(-c.x, -c.y); | |
return kb(a.copy(), this.Nc) | |
}; | |
var Vh; | |
E.None = Vh = D.s(E, "None", 0); | |
var bm; | |
E.Uniform = bm = D.s(E, "Uniform", 1); | |
var cm; | |
E.UniformToFill = cm = D.s(E, "UniformToFill", 2); | |
var fj; | |
E.CycleAll = fj = D.s(E, "CycleAll", 10); | |
var jj; | |
E.CycleNotDirected = jj = D.s(E, "CycleNotDirected", 11); | |
var lj; | |
E.CycleNotDirectedFast = lj = D.s(E, "CycleNotDirectedFast", 12); | |
var mj; | |
E.CycleNotUndirected = mj = D.s(E, "CycleNotUndirected", 13); | |
var gj; | |
E.CycleDestinationTree = gj = D.s(E, "CycleDestinationTree", 14); | |
var ij; | |
E.CycleSourceTree = ij = D.s(E, "CycleSourceTree", 15); | |
var Cl; | |
E.DocumentScroll = Cl = D.s(E, "DocumentScroll", 1); | |
var Um; | |
E.InfiniteScroll = Um = D.s(E, "InfiniteScroll", 2); | |
var El; | |
E.TreeParentCollapsed = El = D.s(E, "TreeParentCollapsed", 21); | |
var jn; | |
E.AllParentsCollapsed = jn = D.s(E, "AllParentsCollapsed", 22); | |
var kn; | |
E.AnyParentsCollapsed = kn = D.s(E, "AnyParentsCollapsed", 23); | |
D.defineProperty(E, { | |
JK: "validCycle" | |
}, function() { | |
return this.ux | |
}, function(a) { | |
var b = this.ux; | |
b !== a && (D.Da(a, E, E, "validCycle"), this.ux = a, this.i("validCycle", b, a)) | |
}); | |
D.w(E, { | |
co: "layers" | |
}, function() { | |
return this.dc.j | |
}); | |
D.defineProperty(E, { | |
Mf: "isModelReadOnly" | |
}, function() { | |
var a = this.ye; | |
return null === a ? !1 : a.qb | |
}, function(a) { | |
var b = this.ye; | |
null !== b && (b.qb = a) | |
}); | |
D.defineProperty(E, { | |
qb: "isReadOnly" | |
}, function() { | |
return this.dj | |
}, function(a) { | |
var b = this.dj; | |
b !== a && (D.h(a, "boolean", E, "isReadOnly"), this.dj = a, this.i("isReadOnly", b, a)) | |
}); | |
D.defineProperty(E, { | |
isEnabled: "isEnabled" | |
}, function() { | |
return this.tf | |
}, function(a) { | |
var b = this.tf; | |
b !== a && (D.h(a, "boolean", E, "isEnabled"), this.tf = a, this.i("isEnabled", b, a)) | |
}); | |
D.defineProperty(E, { | |
CA: "allowClipboard" | |
}, function() { | |
return this.Cv | |
}, function(a) { | |
var b = this.Cv; | |
b !== a && (D.h(a, "boolean", E, "allowClipboard"), this.Cv = a, this.i("allowClipboard", b, a)) | |
}); | |
D.defineProperty(E, { | |
Qk: "allowCopy" | |
}, function() { | |
return this.nl | |
}, function(a) { | |
var b = this.nl; | |
b !== a && (D.h(a, "boolean", E, "allowCopy"), this.nl = a, this.i("allowCopy", b, a)) | |
}); | |
D.defineProperty(E, { | |
En: "allowDelete" | |
}, function() { | |
return this.ol | |
}, function(a) { | |
var b = this.ol; | |
b !== a && (D.h(a, "boolean", E, "allowDelete"), this.ol = a, this.i("allowDelete", b, a)) | |
}); | |
D.defineProperty(E, { | |
du: "allowDragOut" | |
}, function() { | |
return this.Dv | |
}, function(a) { | |
var b = this.Dv; | |
b !== a && (D.h(a, "boolean", E, "allowDragOut"), this.Dv = a, this.i("allowDragOut", b, a)) | |
}); | |
D.defineProperty(E, { | |
VE: "allowDrop" | |
}, function() { | |
return this.Ev | |
}, function(a) { | |
var b = this.Ev; | |
b !== a && (D.h(a, "boolean", E, "allowDrop"), this.Ev = a, this.i("allowDrop", b, a)) | |
}); | |
D.defineProperty(E, { | |
Ex: "allowTextEdit" | |
}, function() { | |
return this.xl | |
}, function(a) { | |
var b = this.xl; | |
b !== a && (D.h(a, "boolean", E, "allowTextEdit"), this.xl = a, this.i("allowTextEdit", b, a)) | |
}); | |
D.defineProperty(E, { | |
Bx: "allowGroup" | |
}, function() { | |
return this.pl | |
}, function(a) { | |
var b = this.pl; | |
b !== a && (D.h(a, "boolean", E, "allowGroup"), this.pl = a, this.i("allowGroup", b, a)) | |
}); | |
D.defineProperty(E, { | |
Fx: "allowUngroup" | |
}, function() { | |
return this.yl | |
}, function(a) { | |
var b = this.yl; | |
b !== a && (D.h(a, "boolean", E, "allowUngroup"), this.yl = a, this.i("allowUngroup", b, a)) | |
}); | |
D.defineProperty(E, { | |
Zp: "allowInsert" | |
}, function() { | |
return this.Gv | |
}, function(a) { | |
var b = this.Gv; | |
b !== a && (D.h(a, "boolean", E, "allowInsert"), this.Gv = a, this.i("allowInsert", b, a)) | |
}); | |
D.defineProperty(E, { | |
eu: "allowLink" | |
}, function() { | |
return this.ql | |
}, function(a) { | |
var b = this.ql; | |
b !== a && (D.h(a, "boolean", E, "allowLink"), this.ql = a, this.i("allowLink", b, a)) | |
}); | |
D.defineProperty(E, { | |
Fn: "allowRelink" | |
}, function() { | |
return this.sl | |
}, function(a) { | |
var b = this.sl; | |
b !== a && (D.h(a, "boolean", E, "allowRelink"), this.sl = a, this.i("allowRelink", b, a)) | |
}); | |
D.defineProperty(E, { | |
gm: "allowMove" | |
}, function() { | |
return this.rl | |
}, function(a) { | |
var b = this.rl; | |
b !== a && (D.h(a, "boolean", E, "allowMove"), this.rl = a, this.i("allowMove", b, a)) | |
}); | |
D.defineProperty(E, { | |
Cx: "allowReshape" | |
}, function() { | |
return this.tl | |
}, function(a) { | |
var b = this.tl; | |
b !== a && (D.h(a, "boolean", E, "allowReshape"), this.tl = a, this.i("allowReshape", b, a)) | |
}); | |
D.defineProperty(E, { | |
fu: "allowResize" | |
}, function() { | |
return this.ul | |
}, function(a) { | |
var b = this.ul; | |
b !== a && (D.h(a, "boolean", E, "allowResize"), this.ul = a, this.i("allowResize", b, a)) | |
}); | |
D.defineProperty(E, { | |
Dx: "allowRotate" | |
}, function() { | |
return this.vl | |
}, function(a) { | |
var b = this.vl; | |
b !== a && (D.h(a, "boolean", E, "allowRotate"), this.vl = a, this.i("allowRotate", b, a)) | |
}); | |
D.defineProperty(E, { | |
Jf: "allowSelect" | |
}, function() { | |
return this.wl | |
}, function(a) { | |
var b = this.wl; | |
b !== a && (D.h(a, "boolean", E, "allowSelect"), this.wl = a, this.i("allowSelect", b, a)) | |
}); | |
D.defineProperty(E, { | |
WE: "allowUndo" | |
}, function() { | |
return this.Hv | |
}, function(a) { | |
var b = this.Hv; | |
b !== a && (D.h(a, "boolean", E, "allowUndo"), this.Hv = a, this.i("allowUndo", b, a)) | |
}); | |
D.defineProperty(E, { | |
Gx: "allowZoom" | |
}, function() { | |
return this.Jv | |
}, function(a) { | |
var b = this.Jv; | |
b !== a && (D.h(a, "boolean", E, "allowZoom"), this.Jv = a, this.i("allowZoom", b, a)) | |
}); | |
D.defineProperty(E, { | |
iB: "hasVerticalScrollbar" | |
}, function() { | |
return this.kw | |
}, function(a) { | |
var b = this.kw; | |
b !== a && (D.h(a, "boolean", E, "hasVerticalScrollbar"), this.kw = a, im(this), this.ra(), this.i("hasVerticalScrollbar", b, a), Yl(this, !1)) | |
}); | |
D.defineProperty(E, { | |
hB: "hasHorizontalScrollbar" | |
}, function() { | |
return this.jw | |
}, function(a) { | |
var b = this.jw; | |
b !== a && (D.h(a, "boolean", E, "hasHorizontalScrollbar"), this.jw = a, im(this), this.ra(), this.i("hasHorizontalScrollbar", b, a), Yl(this, !1)) | |
}); | |
D.defineProperty(E, { | |
Be: "allowHorizontalScroll" | |
}, function() { | |
return this.Fv | |
}, function(a) { | |
var b = this.Fv; | |
b !== a && (D.h(a, "boolean", E, "allowHorizontalScroll"), this.Fv = a, this.i("allowHorizontalScroll", b, a), Yl(this, !1)) | |
}); | |
D.defineProperty(E, { | |
Ce: "allowVerticalScroll" | |
}, function() { | |
return this.Iv | |
}, function(a) { | |
var b = this.Iv; | |
b !== a && (D.h(a, "boolean", E, "allowVerticalScroll"), this.Iv = a, this.i("allowVerticalScroll", b, a), Yl(this, !1)) | |
}); | |
D.defineProperty(E, { | |
lv: "scrollHorizontalLineChange" | |
}, function() { | |
return this.Zw | |
}, function(a) { | |
var b = this.Zw; | |
b !== a && (D.h(a, "number", E, "scrollHorizontalLineChange"), 0 > a && D.ua(a, ">= 0", E, "scrollHorizontalLineChange"), this.Zw = a, this.i("scrollHorizontalLineChange", b, a)) | |
}); | |
D.defineProperty(E, { | |
mv: "scrollVerticalLineChange" | |
}, function() { | |
return this.ex | |
}, function(a) { | |
var b = this.ex; | |
b !== a && (D.h(a, "number", E, "scrollVerticalLineChange"), 0 > a && D.ua(a, ">= 0", E, "scrollVerticalLineChange"), this.ex = a, this.i("scrollVerticalLineChange", b, a)) | |
}); | |
D.defineProperty(E, { | |
U: "lastInput" | |
}, function() { | |
return this.Vb | |
}, function(a) { | |
v && D.l(a, bg, E, "lastInput"); | |
this.Vb = a | |
}); | |
D.defineProperty(E, { | |
Pc: "firstInput" | |
}, function() { | |
return this.aj | |
}, function(a) { | |
v && D.l(a, bg, E, "firstInput"); | |
this.aj = a | |
}); | |
D.defineProperty(E, { | |
sc: "currentCursor" | |
}, function() { | |
return this.Tv | |
}, function(a) { | |
"" === a && (a = this.Mr); | |
var b = this.Tv; | |
if (b !== a) { | |
D.h(a, "string", E, "currentCursor"); | |
var c = this.Ib, | |
d = this.Ub; | |
null !== c && (this.Tv = a, c.style.cursor = a, d.style.cursor = a, c.style.cursor === b && (c.style.cursor = "-webkit-" + a, d.style.cursor = "-webkit-" + a, c.style.cursor === b && (c.style.cursor = "-moz-" + a, d.style.cursor = "-moz-" + a, c.style.cursor === b && (c.style.cursor = a, d.style.cursor = a)))) | |
} | |
}); | |
D.defineProperty(E, { | |
yL: "defaultCursor" | |
}, function() { | |
return this.Mr | |
}, function(a) { | |
"" === a && (a = "auto"); | |
var b = this.Mr; | |
b !== a && (D.h(a, "string", E, "defaultCursor"), this.Mr = a, this.i("defaultCursor", b, a)) | |
}); | |
D.defineProperty(E, { | |
click: "click" | |
}, function() { | |
return this.Ri | |
}, function(a) { | |
var b = this.Ri; | |
b !== a && (null !== a && D.h(a, "function", E, "click"), this.Ri = a, this.i("click", b, a)) | |
}); | |
D.defineProperty(E, { | |
nu: "doubleClick" | |
}, function() { | |
return this.Yi | |
}, function(a) { | |
var b = this.Yi; | |
b !== a && (null !== a && D.h(a, "function", E, "doubleClick"), this.Yi = a, this.i("doubleClick", b, a)) | |
}); | |
D.defineProperty(E, { | |
KA: "contextClick" | |
}, function() { | |
return this.Ti | |
}, function(a) { | |
var b = this.Ti; | |
b !== a && (null !== a && D.h(a, "function", E, "contextClick"), this.Ti = a, this.i("contextClick", b, a)) | |
}); | |
D.defineProperty(E, { | |
EB: "mouseOver" | |
}, function() { | |
return this.nj | |
}, function(a) { | |
var b = this.nj; | |
b !== a && (null !== a && D.h(a, "function", E, "mouseOver"), this.nj = a, this.i("mouseOver", b, a)) | |
}); | |
D.defineProperty(E, { | |
DB: "mouseHover" | |
}, function() { | |
return this.mj | |
}, function(a) { | |
var b = this.mj; | |
b !== a && (null !== a && D.h(a, "function", E, "mouseHover"), this.mj = a, this.i("mouseHover", b, a)) | |
}); | |
D.defineProperty(E, { | |
CB: "mouseHold" | |
}, function() { | |
return this.lj | |
}, function(a) { | |
var b = this.lj; | |
b !== a && (null !== a && D.h(a, "function", E, "mouseHold"), this.lj = a, this.i("mouseHold", b, a)) | |
}); | |
D.defineProperty(E, { | |
RJ: "mouseDragOver" | |
}, function() { | |
return this.Kw | |
}, function(a) { | |
var b = this.Kw; | |
b !== a && (null !== a && D.h(a, "function", E, "mouseDragOver"), this.Kw = a, this.i("mouseDragOver", b, a)) | |
}); | |
D.defineProperty(E, { | |
BB: "mouseDrop" | |
}, function() { | |
return this.kj | |
}, function(a) { | |
var b = this.kj; | |
b !== a && (null !== a && D.h(a, "function", E, "mouseDrop"), this.kj = a, this.i("mouseDrop", b, a)) | |
}); | |
D.defineProperty(E, { | |
kC: "toolTip" | |
}, function() { | |
return this.wj | |
}, function(a) { | |
var b = this.wj; | |
b !== a && (!v || null === a || a instanceof da || a instanceof hk || D.k("Diagram.toolTip must be an Adornment or HTMLInfo."), this.wj = a, this.i("toolTip", b, a)) | |
}); | |
D.defineProperty(E, { | |
contextMenu: "contextMenu" | |
}, function() { | |
return this.Ui | |
}, function(a) { | |
var b = this.Ui; | |
b !== a && (!v || a instanceof da || a instanceof hk || D.k("Diagram.contextMenu must be an Adornment or HTMLInfo."), this.Ui = a, this.i("contextMenu", b, a)) | |
}); | |
D.defineProperty(E, { | |
yb: "commandHandler" | |
}, function() { | |
return this.vz | |
}, function(a) { | |
var b = this.vz; | |
b !== a && (D.l(a, qa, E, "commandHandler"), null !== a.g && D.k("Cannot share CommandHandlers between Diagrams: " + a.toString()), null !== b && b.ad(null), this.vz = a, a.ad(this)) | |
}); | |
D.defineProperty(E, { | |
ob: "toolManager" | |
}, function() { | |
return this.uA | |
}, function(a) { | |
var b = this.uA; | |
b !== a && (D.l(a, Ph, E, "toolManager"), null !== a.g && D.k("Cannot share ToolManagers between Diagrams: " + a.toString()), null !== b && b.ad(null), this.uA = a, a.ad(this)) | |
}); | |
D.defineProperty(E, { | |
mu: "defaultTool" | |
}, function() { | |
return this.Bz | |
}, function(a) { | |
var b = this.Bz; | |
b !== a && (D.l(a, Zg, E, "defaultTool"), this.Bz = a, this.eb === b && (this.eb = a)) | |
}); | |
D.defineProperty(E, { | |
eb: "currentTool" | |
}, function() { | |
return this.yz | |
}, function(a) { | |
var b = this.yz; | |
null !== b && (b.wa && b.doDeactivate(), b.cancelWaitAfter(), b.doStop()); | |
null === a && (a = this.mu); | |
null !== a && (D.l(a, Zg, E, "currentTool"), this.yz = a, a.ad(this), a.doStart()) | |
}); | |
D.w(E, { | |
selection: "selection" | |
}, function() { | |
return this.jx | |
}); | |
D.defineProperty(E, { | |
IJ: "maxSelectionCount" | |
}, function() { | |
return this.Fw | |
}, function(a) { | |
var b = this.Fw; | |
if (b !== a) | |
if (D.h(a, "number", E, "maxSelectionCount"), 0 <= a && !isNaN(a)) { | |
if (this.Fw = a, this.i("maxSelectionCount", b, a), !this.na.ub && (a = this.selection.count - a, 0 < a)) { | |
this.Ja("ChangingSelection"); | |
for (var b = this.selection.Fc(), c = 0; c < a; c++) b[c].jb = !1; | |
this.Ja("ChangedSelection") | |
} | |
} else D.ua(a, ">= 0", E, "maxSelectionCount") | |
}); | |
D.defineProperty(E, { | |
UJ: "nodeSelectionAdornmentTemplate" | |
}, function() { | |
return this.Lw | |
}, function(a) { | |
var b = this.Lw; | |
b !== a && (D.l(a, da, E, "nodeSelectionAdornmentTemplate"), this.Lw = a, this.i("nodeSelectionAdornmentTemplate", b, a)) | |
}); | |
D.defineProperty(E, { | |
$I: "groupSelectionAdornmentTemplate" | |
}, function() { | |
return this.hw | |
}, function(a) { | |
var b = this.hw; | |
b !== a && (D.l(a, da, E, "groupSelectionAdornmentTemplate"), this.hw = a, this.i("groupSelectionAdornmentTemplate", b, a)) | |
}); | |
D.defineProperty(E, { | |
CJ: "linkSelectionAdornmentTemplate" | |
}, function() { | |
return this.Aw | |
}, function(a) { | |
var b = this.Aw; | |
b !== a && (D.l(a, da, E, "linkSelectionAdornmentTemplate"), this.Aw = a, this.i("linkSelectionAdornmentTemplate", b, a)) | |
}); | |
D.w(E, { | |
wm: "highlighteds" | |
}, function() { | |
return this.lw | |
}); | |
D.defineProperty(E, { | |
Gi: "isModified" | |
}, function() { | |
var a = this.na; | |
return a.isEnabled ? null !== a.Gj ? !0 : this.rw && this.rh !== a.Lj : this.rw | |
}, function(a) { | |
if (this.rw !== a) { | |
D.h(a, "boolean", E, "isModified"); | |
this.rw = a; | |
var b = this.na; | |
!a && b.isEnabled && (this.rh = b.Lj); | |
a || ln(this) | |
} | |
}); | |
function ln(a) { | |
var b = a.Gi; | |
a.LE !== b && (a.LE = b, a.Ja("Modified")) | |
} | |
D.defineProperty(E, { | |
da: "model" | |
}, function() { | |
return this.ye | |
}, function(a) { | |
var b = this.ye; | |
if (b !== a) { | |
D.l(a, M, E, "model"); | |
this.eb.doCancel(); | |
null !== b && b.na !== a.na && b.na.hG && D.k("Do not replace a Diagram.model while a transaction is in progress."); | |
this.Ra.Yh(); | |
this.Jx(); | |
this.sh = !1; | |
this.bp = !0; | |
this.rh = -2; | |
this.cg = !1; | |
var c = this.ke; | |
this.ke = !0; | |
this.Ra.ro("Model"); | |
null !== b && (null !== this.xh && this.xh.each(function(a) { | |
b.gv(a) | |
}), b.gv(this.UD), b instanceof Y && mn(this, b.$g), mn(this, b.qg)); | |
this.ye = a; | |
a.Dn(this.TD); | |
nn(this, | |
a.qg); | |
a instanceof Y && on(this, a.$g); | |
a.gv(this.TD); | |
a.Dn(this.UD); | |
null !== this.xh && this.xh.each(function(b) { | |
a.Dn(b) | |
}); | |
this.ke = c; | |
this.ed || this.ra(); | |
null !== b && (a.na.isEnabled = b.na.isEnabled) | |
} | |
}); | |
D.defineProperty(E, { | |
ab: null | |
}, function() { | |
return this.MD | |
}, function(a) { | |
this.MD = a | |
}); | |
D.w(E, { | |
ty: null | |
}, function() { | |
return this.FH | |
}); | |
function Gl(a, b) { | |
if (b.da === a.da) { | |
var c = b.Oc, | |
d = b.propertyName; | |
if (c === gg && "S" === d[0]) | |
if ("StartingFirstTransaction" === d) c = a.ob, c.sf.each(function(b) { | |
b.ad(a) | |
}), c.mg.each(function(b) { | |
b.ad(a) | |
}), c.ng.each(function(b) { | |
b.ad(a) | |
}), a.ke || a.sh || (a.Sr = !0, a.bp && (a.cg = !0)); | |
else if ("StartingUndo" === d || "StartingRedo" === d) { | |
var e = a.Ra; | |
e.pf && !a.lb && e.Yh(); | |
a.Ja("ChangingSelection") | |
} else "StartedTransaction" === d && (e = a.Ra, e.pf && !a.lb && e.Yh()); | |
else if (a.ab) { | |
a.ab = !1; | |
try { | |
var g = b.Ef; | |
if ("" !== g) | |
if (c === fg) { | |
if ("linkFromKey" === g) { | |
var h = | |
b.object, | |
k = a.gg(h); | |
if (null !== k) { | |
var l = b.newValue, | |
m = a.Te(l); | |
k.$ = m | |
} | |
} else if ("linkToKey" === g) h = b.object, k = a.gg(h), null !== k && (l = b.newValue, m = a.Te(l), k.ba = m); | |
else if ("linkFromPortId" === g) { | |
if (h = b.object, k = a.gg(h), null !== k) { | |
var n = b.newValue; | |
"string" === typeof n && (k.hg = n) | |
} | |
} else if ("linkToPortId" === g) h = b.object, k = a.gg(h), null !== k && (n = b.newValue, "string" === typeof n && (k.jh = n)); | |
else if ("nodeGroupKey" === g) { | |
var h = b.object, | |
p = a.Nh(h); | |
if (null !== p) { | |
var q = b.newValue; | |
if (void 0 !== q) { | |
var r = a.Te(q); | |
p.Ka = r instanceof I ? r : | |
null | |
} else p.Ka = null | |
} | |
} else if ("linkLabelKeys" === g) { | |
if (h = b.object, k = a.gg(h), null !== k) { | |
var s = b.oldValue, | |
u = b.newValue; | |
if (D.isArray(s)) | |
for (var t = D.cb(s), y = 0; y < t; y++) { | |
var w = D.La(s, y), | |
m = a.Te(w); | |
null !== m && (m.Yb = null) | |
} | |
if (D.isArray(u)) | |
for (t = D.cb(u), y = 0; y < t; y++) w = D.La(u, y), m = a.Te(w), null !== m && (m.Yb = k) | |
} | |
} else if ("nodeParentKey" === g) { | |
var A = b.object, | |
B = a.Te(b.newValue), | |
P = a.Yx(A); | |
if (null !== P) { | |
var H = P.Sn(); | |
null !== H ? null === B ? a.remove(H) : a.fe ? H.$ = B : H.ba = B : pn(a, B, P) | |
} | |
} else if ("parentLinkCategory" === g) { | |
var A = b.object, | |
P = | |
a.Yx(A), | |
R = b.newValue; | |
null !== P && "string" === typeof R && (H = P.Sn(), null !== H && (H.Ld = R)) | |
} else if ("nodeCategory" === g) { | |
var h = b.object, | |
aa = a.Nh(h), | |
R = b.newValue; | |
null !== aa && "string" === typeof R && (aa.Ld = R) | |
} else if ("linkCategory" === g) { | |
var h = b.object, | |
V = a.gg(h), | |
R = b.newValue; | |
null !== V && "string" === typeof R && (V.Ld = R) | |
} else if ("nodeDataArray" === g) { | |
var ea = b.oldValue; | |
mn(a, ea); | |
var la = b.newValue; | |
nn(a, la) | |
} else "linkDataArray" === g && (ea = b.oldValue, mn(a, ea), la = b.newValue, on(a, la)); | |
a.Gi = !0 | |
} else c === hg ? (la = b.newValue, "nodeDataArray" === | |
g && D.Qa(la) ? qn(a, la) : "linkDataArray" === g && D.Qa(la) ? rn(a, la) : "linkLabelKeys" === g && ch(la) && (k = a.gg(b.object), m = a.Te(la), null !== k && null !== m && (m.Yb = k)), a.Gi = !0) : c === ig ? (ea = b.oldValue, "nodeDataArray" === g && D.Qa(ea) ? sn(a, ea) : "linkDataArray" === g && D.Qa(ea) ? sn(a, ea) : "linkLabelKeys" === g && ch(ea) && (m = a.Te(ea), null !== m && (m.Yb = null)), a.Gi = !0) : c === gg && ("SourceChanged" === g ? null !== b.object ? Fl(a, b.object, b.propertyName) : (a.IK(), a.tH()) : "ModelDisplaced" === g && a.Am()); | |
else if (c === fg) { | |
var Da = b.propertyName, | |
h = b.object; | |
if (h === | |
a.da) { | |
if ("nodeKeyProperty" === Da || "nodeCategoryProperty" === Da || "linkFromKeyProperty" === Da || "linkToKeyProperty" === Da || "linkFromPortIdProperty" === Da || "linkToPortIdProperty" === Da || "linkLabelKeysProperty" === Da || "nodeIsGroupProperty" === Da || "nodeGroupKeyProperty" === Da || "nodeParentKeyProperty" === Da || "linkCategoryProperty" === Da) a.na.ub || a.Am() | |
} else Fl(a, h, Da); | |
a.Gi = !0 | |
} else if (c === hg || c === ig) tn(a, b), a.Gi = !0; | |
else if (c === gg) { | |
if ("FinishedUndo" === d || "FinishedRedo" === d) a.Ja("ChangedSelection"), Si(a); | |
e = a.Ra; | |
"RolledBackTransaction" === | |
d && e.Yh(); | |
a.Sr = !0; | |
a.lg(); | |
0 === a.na.Ki && el(e); | |
"CommittedTransaction" === d && a.na.Zz && (a.rh = Math.min(a.rh, a.na.Lj - 1)); | |
var La = b.lG; | |
La && (ln(a), a.ty.clear()); | |
!a.eA && La && (a.eA = !0, D.setTimeout(function() { | |
a.eb.standardMouseOver(); | |
a.eA = !1 | |
}, 10)) | |
} | |
} finally { | |
a.ab = !0 | |
} | |
} | |
} | |
} | |
function Fl(a, b, c) { | |
if ("string" === typeof c) { | |
var d = a.Nh(b); | |
if (null !== d) d.Ob(c), a.da instanceof Bg && (d = a.gg(b), null !== d && d.Ob(c)); | |
else { | |
for (var d = null, e = a.an.j; e.next();) { | |
for (var g = e.value, h = 0; h < g.length; h++) { | |
var k = g[h].KI(b); | |
null !== k && (null === d && (d = D.nb()), d.push(k)) | |
} | |
if (null !== d) break | |
} | |
if (null !== d) { | |
for (e = 0; e < d.length; e++) d[e].Ob(c); | |
D.ya(d) | |
} | |
} | |
b === a.da.gl && a.tH(c) | |
} | |
} | |
D.defineProperty(E, { | |
Xe: "skipsModelSourceBindings" | |
}, function() { | |
return this.nE | |
}, function(a) { | |
this.nE = a | |
}); | |
D.defineProperty(E, { | |
rv: null | |
}, function() { | |
return this.pA | |
}, function(a) { | |
this.pA = a | |
}); | |
function tn(a, b) { | |
var c = b.Oc === hg, | |
d = c ? b.Uj : b.Wj, | |
e = c ? b.newValue : b.oldValue, | |
g = a.an.oa(b.object); | |
if (Array.isArray(g)) | |
for (var h = 0; h < g.length; h++) { | |
var k = g[h]; | |
if (c) un(k, e, d); | |
else { | |
var l = d; | |
if (!(0 > l)) { | |
var m = l; | |
vn(k) && m++; | |
k.Af(m, !0); | |
wn(k, m, l) | |
} | |
} | |
} | |
} | |
function Zm(a, b) { | |
var c = b.ej; | |
if (D.isArray(c)) { | |
var d = a.an.oa(c); | |
if (null === d) d = [], d.push(b), a.an.add(c, d); | |
else { | |
for (c = 0; c < d.length; c++) | |
if (d[c] === b) return; | |
d.push(b) | |
} | |
} | |
} | |
function cn(a, b) { | |
var c = b.ej; | |
if (D.isArray(c)) { | |
var d = a.an.oa(c); | |
if (null !== d) | |
for (var e = 0; e < d.length; e++) | |
if (d[e] === b) { | |
d.splice(e, 1); | |
0 === d.length && a.an.remove(c); | |
break | |
} | |
} | |
} | |
function Ym(a, b) { | |
for (var c = b.xa.o, d = c.length, e = 0; e < d; e++) { | |
var g = c[e]; | |
g instanceof Hl && xn(a, g) | |
} | |
} | |
function xn(a, b) { | |
var c = b.element; | |
if (null !== c && c instanceof HTMLImageElement) { | |
var d = b.af; | |
null !== d && (d.ep instanceof Event && null !== b.bf && b.bf(b, d.ep), !0 === d.ps && (null !== b.zi && b.zi(b, d.lA), null !== b.g && b.g.hA.add(b))); | |
c = c.src; | |
d = a.Cp.oa(c); | |
if (null === d) d = [], d.push(b), a.Cp.add(c, d); | |
else { | |
for (c = 0; c < d.length; c++) | |
if (d[c] === b) return; | |
d.push(b) | |
} | |
} | |
} | |
function bn(a, b) { | |
for (var c = b.xa.o, d = c.length, e = 0; e < d; e++) { | |
var g = c[e]; | |
g instanceof Hl && yn(a, g) | |
} | |
} | |
function yn(a, b) { | |
var c = b.element; | |
if (null !== c && c instanceof HTMLImageElement) { | |
var c = c.src, | |
d = a.Cp.oa(c); | |
if (null !== d) | |
for (var e = 0; e < d.length; e++) | |
if (d[e] === b) { | |
d.splice(e, 1); | |
0 === d.length && a.Cp.remove(c); | |
break | |
} | |
} | |
} | |
E.prototype.rebuildParts = E.prototype.Am = function() { | |
for (var a = this.IB.j; a.next();) { | |
var b = a.value, | |
c = a.key; | |
(!b.re() || b instanceof I) && D.k('Invalid node template in Diagram.nodeTemplateMap: template for "' + c + '" must be a Node or a simple Part, not a Group or Link: ' + b) | |
} | |
for (a = this.gB.j; a.next();) b = a.value, c = a.key, b instanceof I || D.k('Invalid group template in Diagram.groupTemplateMap: template for "' + c + '" must be a Group, not a normal Node or Link: ' + b); | |
for (a = this.wB.j; a.next();) b = a.value, c = a.key, b instanceof | |
J || D.k('Invalid link template in Diagram.linkTemplateMap: template for "' + c + '" must be a Link, not a normal Node or simple Part: ' + b); | |
a = D.nb(); | |
for (b = this.selection.j; b.next();)(c = b.value.data) && a.push(c); | |
for (var b = D.nb(), d = this.wm.j; d.next();)(c = d.value.data) && b.push(c); | |
c = D.nb(); | |
for (d = this.rg.j; d.next();) { | |
var e = d.value; | |
null !== e.data && (c.push(e.data), c.push(e.location)) | |
} | |
for (d = this.links.j; d.next();) e = d.value, null !== e.data && (c.push(e.data), c.push(e.location)); | |
for (d = this.Hi.j; d.next();) e = d.value, null !== | |
e.data && (c.push(e.data), c.push(e.location)); | |
d = this.da; | |
d instanceof Y && mn(this, d.$g); | |
mn(this, d.qg); | |
nn(this, d.qg); | |
d instanceof Y && on(this, d.$g); | |
for (d = 0; d < a.length; d++) e = this.Nh(a[d]), null !== e && (e.jb = !0); | |
for (d = 0; d < b.length; d++) e = this.Nh(b[d]), null !== e && (e.Zg = !0); | |
for (d = 0; d < c.length; d += 2) e = this.Nh(c[d]), null !== e && (e.location = c[d + 1]); | |
D.ya(a); | |
D.ya(b); | |
D.ya(c) | |
}; | |
function nn(a, b) { | |
if (null !== b) { | |
for (var c = a.da, d = c instanceof Y, e = D.cb(b), g = 0; g < e; g++) { | |
var h = D.La(b, g); | |
c.le(h) ? qn(a, h, !1) : d && rn(a, h) | |
} | |
if (d || c instanceof Bg) { | |
for (g = 0; g < e; g++) h = D.La(b, g), c.le(h) && zn(a, h); | |
if (d) | |
for (c = a.links; c.next();) An(c.value) | |
} | |
Bn(a, !1) | |
} | |
} | |
function qn(a, b, c) { | |
if (void 0 !== b && null !== b && !a.na.ub && !a.Vi.contains(b)) { | |
void 0 === c && (c = !0); | |
var d = a.cB(b), | |
e = Cn(a, b, d); | |
if (null !== e && (Sh(e), e = e.copy(), null !== e)) { | |
var g = a.Xe; | |
a.Xe = !0; | |
e.Pi = d; | |
e.Ud = b; | |
a.add(e); | |
e.Ud = null; | |
e.data = b; | |
c && zn(a, b); | |
a.Xe = g | |
} | |
} | |
} | |
E.prototype.cB = function(a) { | |
return this.da.cB(a) | |
}; | |
var Dn = !1, | |
En = !1; | |
function Cn(a, b, c) { | |
var d = !1, | |
e = a.da; | |
e instanceof Y && (d = e.qB(b)); | |
d ? (b = a.gB.oa(c), null === b && (b = a.gB.oa(""), null === b && (En || (En = !0, D.trace('No Group template found for category "' + c + '"'), D.trace(" Using default group template")), b = a.cD))) : (b = a.IB.oa(c), null === b && (b = a.IB.oa(""), null === b && (Dn || (Dn = !0, D.trace('No Node template found for category "' + c + '"'), D.trace(" Using default node template")), b = a.eD))); | |
return b | |
} | |
function zn(a, b) { | |
var c = a.da; | |
if (c instanceof Y || c instanceof Bg) { | |
var d = c.zb(b); | |
if (void 0 !== d) { | |
var e = fh(c, d), | |
g = a.Nh(b); | |
if (null !== e && null !== g) { | |
for (e = e.j; e.next();) { | |
var h = e.value; | |
if (c instanceof Y) { | |
var k = c; | |
if (k.le(h)) { | |
if (g instanceof I && k.Un(h) === d) { | |
var l = g, | |
h = a.Nh(h); | |
null !== h && (h.Ka = l) | |
} | |
} else { | |
var m = a.gg(h); | |
if (null !== m && g instanceof G && (l = g, k.um(h) === d && (m.$ = l), k.vm(h) === d && (m.ba = l), h = k.al(h), D.isArray(h))) | |
for (k = 0; k < D.cb(h); k++) | |
if (D.La(h, k) === d) { | |
l.Yb = m; | |
break | |
} | |
} | |
} else c instanceof Bg && (m = c, m.le(h) && g instanceof G && (l = g, m.Wn(h) === d && (h = a.Yx(h), pn(a, l, h)))) | |
} | |
hh(c, d) | |
} | |
c instanceof Y ? (c = c.Un(b), void 0 !== c && (c = a.Te(c), c instanceof I && (g.Ka = c))) : c instanceof Bg && (c = c.Wn(b), void 0 !== c && g instanceof G && (l = g, g = a.Te(c), pn(a, g, l))) | |
} | |
} | |
} | |
function pn(a, b, c) { | |
if (null !== b && null !== c) { | |
var d = a.ob.sG, | |
e = b, | |
g = c; | |
if (a.fe) | |
for (b = g.Pd; b.next();) { | |
if (b.value.ba === g) return | |
} else | |
for (e = c, g = b, b = e.Pd; b.next();) | |
if (b.value.$ === e) return; | |
if (null === d || !hj(d, e, g, null, !0)) | |
if (d = a.Bu(c.data), b = rj(a, d), null !== b && (Sh(b), b = b.copy(), null !== b)) { | |
var h = a.Xe; | |
a.Xe = !0; | |
b.Pi = d; | |
b.Ud = c.data; | |
b.$ = e; | |
b.ba = g; | |
a.add(b); | |
b.Ud = null; | |
b.data = c.data; | |
a.Xe = h | |
} | |
} | |
} | |
function on(a, b) { | |
if (null !== b) { | |
for (var c = D.cb(b), d = 0; d < c; d++) { | |
var e = D.La(b, d); | |
rn(a, e) | |
} | |
Bn(a, !1) | |
} | |
} | |
function rn(a, b) { | |
if (void 0 !== b && null !== b && !a.na.ub && !a.hk.contains(b)) { | |
var c = a.Bu(b), | |
d = rj(a, c); | |
if (null !== d && (Sh(d), d = d.copy(), null !== d)) { | |
var e = a.Xe; | |
a.Xe = !0; | |
d.Pi = c; | |
d.Ud = b; | |
var c = a.da, | |
g = c.SI(b); | |
"" !== g && (d.hg = g); | |
g = c.um(b); | |
void 0 !== g && (g = a.Te(g), g instanceof G && (d.$ = g)); | |
g = c.WI(b); | |
"" !== g && (d.jh = g); | |
g = c.vm(b); | |
void 0 !== g && (g = a.Te(g), g instanceof G && (d.ba = g)); | |
c = c.al(b); | |
if (D.isArray(c)) | |
for (var g = D.cb(c), h = 0; h < g; h++) { | |
var k = D.La(c, h), | |
k = a.Te(k); | |
null !== k && (k.Yb = d) | |
} | |
a.add(d); | |
d.Ud = null; | |
d.data = b; | |
a.Xe = e | |
} | |
} | |
} | |
E.prototype.Bu = function(a) { | |
var b = this.da, | |
c = ""; | |
b instanceof Y ? c = b.Bu(a) : b instanceof Bg && (c = b.UI(a)); | |
return c | |
}; | |
var Fn = !1; | |
function rj(a, b) { | |
var c = a.wB.oa(b); | |
null === c && (c = a.wB.oa(""), null === c && (Fn || (Fn = !0, D.trace('No Link template found for category "' + b + '"'), D.trace(" Using default link template")), c = a.dD)); | |
return c | |
} | |
function mn(a, b) { | |
for (var c = D.cb(b), d = 0; d < c; d++) { | |
var e = D.La(b, d); | |
sn(a, e) | |
} | |
} | |
function sn(a, b) { | |
if (void 0 !== b && null !== b) { | |
var c = a.Nh(b); | |
if (null !== c) { | |
dn(a, c, !1); | |
var d = a.da; | |
if (d instanceof Y && c instanceof G) { | |
var e = d.zb(c.data); | |
if (void 0 !== e) { | |
for (var g = c.Pd; g.next();) gh(d, e, g.value.data); | |
c.Lf && (g = c.Yb, null !== g && gh(d, e, g.data)); | |
if (c instanceof I) | |
for (c = c.uc; c.next();) g = c.value.data, d.le(g) && gh(d, e, g) | |
} | |
} else if (d instanceof Bg && c instanceof G) { | |
g = a.gg(c.data); | |
if (null !== g) { | |
g.jb = !1; | |
g.Zg = !1; | |
var h = g.layer; | |
if (null !== h) { | |
var k = h.Af(-1, g, !1); | |
0 <= k && a.od(ig, "parts", h, g, null, k, null); | |
k = g.py; | |
null !== | |
k && k(g, h, null) | |
} | |
} | |
g = a.fe; | |
for (c = c.Pd; c.next();) h = c.value, h = (g ? h.ba : h.$).data, d.le(h) && gh(d, e, h) | |
} | |
} | |
} | |
} | |
E.prototype.findPartForKey = E.prototype.LI = function(a) { | |
if (null === a || void 0 === a) return null; | |
var b = this.da.Ie(a); | |
return null !== b ? this.Vi.oa(b) : this.da instanceof Y && (b = this.da.oq(a), null !== b) ? this.hk.oa(b) : null | |
}; | |
E.prototype.findNodeForKey = E.prototype.Te = function(a) { | |
if (null === a || void 0 === a) return null; | |
a = this.da.Ie(a); | |
if (null === a) return null; | |
a = this.Vi.oa(a); | |
return a instanceof G ? a : null | |
}; | |
E.prototype.findPartForData = E.prototype.Nh = function(a) { | |
if (null === a) return null; | |
var b = this.Vi.oa(a); | |
return null !== b ? b : b = this.hk.oa(a) | |
}; | |
E.prototype.findNodeForData = E.prototype.Yx = function(a) { | |
if (null === a) return null; | |
a = this.Vi.oa(a); | |
return a instanceof G ? a : null | |
}; | |
E.prototype.findLinkForData = E.prototype.gg = function(a) { | |
return null === a ? null : this.hk.oa(a) | |
}; | |
E.prototype.findNodesByExample = function(a) { | |
for (var b = new L(G), c = this.Ap.j; c.next();) { | |
var d = c.value, | |
e = d.data; | |
if (null !== e) | |
for (var g = 0; g < arguments.length; g++) { | |
var h = arguments[g]; | |
if (D.Qa(h) && Gn(this, e, h)) { | |
b.add(d); | |
break | |
} | |
} | |
} | |
return b.j | |
}; | |
E.prototype.findLinksByExample = function(a) { | |
for (var b = new L(J), c = this.tp.j; c.next();) { | |
var d = c.value, | |
e = d.data; | |
if (null !== e) | |
for (var g = 0; g < arguments.length; g++) { | |
var h = arguments[g]; | |
if (D.Qa(h) && Gn(this, e, h)) { | |
b.add(d); | |
break | |
} | |
} | |
} | |
return b.j | |
}; | |
function Gn(a, b, c) { | |
for (var d in c) { | |
var e = b[d], | |
g = c[d]; | |
if (D.isArray(g)) { | |
if (!D.isArray(e) || e.length < g.length) return !1; | |
for (var h = 0; h < e.length; h++) { | |
var k = e[h], | |
l = g[h]; | |
if (void 0 !== l && !Hn(a, k, l)) return !1 | |
} | |
} else if (!Hn(a, e, g)) return !1 | |
} | |
return !0 | |
} | |
function Hn(a, b, c) { | |
if ("function" === typeof c) { | |
if (!c(b)) return !1 | |
} else if (c instanceof RegExp) { | |
if (!b || !c.test(b.toString())) return !1 | |
} else if (D.Qa(b) && D.Qa(c)) { | |
if (!Gn(a, b, c)) return !1 | |
} else if (b !== c) return !1; | |
return !0 | |
} | |
D.defineProperty(E, { | |
lM: "nodeTemplate" | |
}, function() { | |
return this.oj.oa("") | |
}, function(a) { | |
var b = this.oj.oa(""); | |
b !== a && (D.l(a, F, E, "nodeTemplate"), this.oj.add("", a), this.i("nodeTemplate", b, a), this.na.ub || this.Am()) | |
}); | |
D.defineProperty(E, { | |
IB: "nodeTemplateMap" | |
}, function() { | |
return this.oj | |
}, function(a) { | |
var b = this.oj; | |
b !== a && (D.l(a, na, E, "nodeTemplateMap"), this.oj = a, this.i("nodeTemplateMap", b, a), this.na.ub || this.Am()) | |
}); | |
D.defineProperty(E, { | |
RL: "groupTemplate" | |
}, function() { | |
return this.Fl.oa("") | |
}, function(a) { | |
var b = this.Fl.oa(""); | |
b !== a && (D.l(a, I, E, "groupTemplate"), this.Fl.add("", a), this.i("groupTemplate", b, a), this.na.ub || this.Am()) | |
}); | |
D.defineProperty(E, { | |
gB: "groupTemplateMap" | |
}, function() { | |
return this.Fl | |
}, function(a) { | |
var b = this.Fl; | |
b !== a && (D.l(a, na, E, "groupTemplateMap"), this.Fl = a, this.i("groupTemplateMap", b, a), this.na.ub || this.Am()) | |
}); | |
D.defineProperty(E, { | |
$L: "linkTemplate" | |
}, function() { | |
return this.yk.oa("") | |
}, function(a) { | |
var b = this.yk.oa(""); | |
b !== a && (D.l(a, J, E, "linkTemplate"), this.yk.add("", a), this.i("linkTemplate", b, a), this.na.ub || this.Am()) | |
}); | |
D.defineProperty(E, { | |
wB: "linkTemplateMap" | |
}, function() { | |
return this.yk | |
}, function(a) { | |
var b = this.yk; | |
b !== a && (D.l(a, na, E, "linkTemplateMap"), this.yk = a, this.i("linkTemplateMap", b, a), this.na.ub || this.Am()) | |
}); | |
D.defineProperty(E, { | |
pJ: null | |
}, function() { | |
return this.th | |
}, function(a) { | |
this.th = a | |
}); | |
D.defineProperty(E, { | |
qf: "isMouseCaptured" | |
}, function() { | |
return this.JD | |
}, function(a) { | |
var b = this.Ib; | |
null !== b && (a ? (this.U.bubbles = !1, this.lz ? (b.removeEventListener("pointermove", this.Kq, !1), b.removeEventListener("pointerdown", this.Jq, !1), b.removeEventListener("pointerup", this.Mq, !1), b.removeEventListener("pointerout", this.Lq, !1), window.addEventListener("pointermove", this.Kq, !0), window.addEventListener("pointerdown", this.Jq, !0), window.addEventListener("pointerup", this.Mq, !0), window.addEventListener("pointerout", | |
this.Lq, !0)) : (b.removeEventListener("mousemove", this.lo, !1), b.removeEventListener("mousedown", this.ko, !1), b.removeEventListener("mouseup", this.no, !1), b.removeEventListener("mouseout", this.mo, !1), window.addEventListener("mousemove", this.lo, !0), window.addEventListener("mousedown", this.ko, !0), window.addEventListener("mouseup", this.no, !0), window.addEventListener("mouseout", this.mo, !0)), b.removeEventListener("wheel", this.oo, !1), window.addEventListener("wheel", this.oo, !0), window.addEventListener("selectstart", | |
this.preventDefault, !1)) : (this.lz ? (window.removeEventListener("pointermove", this.Kq, !0), window.removeEventListener("pointerdown", this.Jq, !0), window.removeEventListener("pointerup", this.Mq, !0), window.removeEventListener("pointerout", this.Lq, !0), b.addEventListener("pointermove", this.Kq, !1), b.addEventListener("pointerdown", this.Jq, !1), b.addEventListener("pointerup", this.Mq, !1), b.addEventListener("pointerout", this.Lq, !1)) : (window.removeEventListener("mousemove", this.lo, !0), window.removeEventListener("mousedown", | |
this.ko, !0), window.removeEventListener("mouseup", this.no, !0), window.removeEventListener("mouseout", this.mo, !0), b.addEventListener("mousemove", this.lo, !1), b.addEventListener("mousedown", this.ko, !1), b.addEventListener("mouseup", this.no, !1), b.addEventListener("mouseout", this.mo, !1)), window.removeEventListener("wheel", this.oo, !0), window.removeEventListener("selectstart", this.preventDefault, !1), b.addEventListener("wheel", this.oo, !1)), this.JD = a) | |
}); | |
D.defineProperty(E, { | |
position: "position" | |
}, function() { | |
return this.sb | |
}, function(a) { | |
var b = this.sb; | |
if (!b.O(a)) { | |
D.l(a, N, E, "position"); | |
var c = this.wb.copy(); | |
a = a.copy(); | |
if (!this.ed && null !== this.Ib) { | |
this.ed = !0; | |
var d = this.scale; | |
$l(this, a, this.kd, this.Qb / d, this.Pb / d, this.No, !1); | |
this.ed = !1 | |
} | |
this.sb = a.V(); | |
a = this.Ra; | |
a.zc && rl(a, b, this.sb); | |
this.ed || this.dv(c, this.wb, this.Db, this.Db, !1) | |
} | |
}); | |
D.defineProperty(E, { | |
gJ: "initialPosition" | |
}, function() { | |
return this.nw | |
}, function(a) { | |
this.nw.O(a) || (D.l(a, N, E, "initialPosition"), this.nw = a.V()) | |
}); | |
D.defineProperty(E, { | |
hJ: "initialScale" | |
}, function() { | |
return this.ow | |
}, function(a) { | |
this.ow !== a && (D.h(a, "number", E, "initialScale"), this.ow = a) | |
}); | |
D.defineProperty(E, { | |
Xn: "grid" | |
}, function() { | |
null === this.Ed && Rl(this); | |
return this.Ed | |
}, function(a) { | |
var b = this.Ed; | |
if (b !== a) { | |
null === b && (Rl(this), b = this.Ed); | |
D.l(a, x, E, "grid"); | |
a.type !== Sl && D.k("Diagram.grid must be a Panel of type Panel.Grid"); | |
var c = b.R; | |
null !== c && c.remove(b); | |
this.Ed = a; | |
a.name = "GRID"; | |
null !== c && c.add(a); | |
lm(this); | |
this.ra(); | |
this.i("grid", b, a) | |
} | |
}); | |
D.w(E, { | |
wb: "viewportBounds" | |
}, function() { | |
var a = this.KE; | |
if (null === this.Ib) return a; | |
var b = this.sb, | |
c = this.Db; | |
a.n(b.x, b.y, Math.max(this.Qb, 0) / c, Math.max(this.Pb, 0) / c); | |
return a | |
}); | |
D.defineProperty(E, { | |
JF: "fixedBounds" | |
}, function() { | |
return this.fw | |
}, function(a) { | |
var b = this.fw; | |
b.O(a) || (D.l(a, C, E, "fixedBounds"), (v && Infinity === a.width || -Infinity === a.width || Infinity === a.height || -Infinity === a.height) && D.k("fixedBounds width/height must not be Infinity"), this.fw = a = a.V(), this.Qc(), this.i("fixedBounds", b, a)) | |
}); | |
D.defineProperty(E, { | |
Ny: "scrollMargin" | |
}, function() { | |
return this.$w | |
}, function(a) { | |
"number" === typeof a ? a = new Lb(a) : D.l(a, Lb, E, "scrollMargin"); | |
var b = this.$w; | |
b.O(a) || (this.$w = a = a.V(), this.i("scrollMargin", b, a), this.to()) | |
}); | |
D.defineProperty(E, { | |
UB: "scrollMode" | |
}, function() { | |
return this.ax | |
}, function(a) { | |
var b = this.ax; | |
b !== a && (D.Da(a, E, E, "scrollMode"), this.ax = a, a === Cl && Yl(this, !1), this.i("scrollMode", b, a)) | |
}); | |
D.defineProperty(E, { | |
mK: "scrollsPageOnFocus" | |
}, function() { | |
return this.gx | |
}, function(a) { | |
var b = this.gx; | |
b !== a && (D.h(a, "boolean", E, "scrollsPageOnFocus"), this.gx = a, this.i("scrollsPageOnFocus", b, a)) | |
}); | |
D.defineProperty(E, { | |
EG: "positionComputation" | |
}, function() { | |
return this.Vw | |
}, function(a) { | |
var b = this.Vw; | |
b !== a && (null !== a && D.h(a, "function", E, "positionComputation"), this.Vw = a, Yl(this, !1), this.i("positionComputation", b, a)) | |
}); | |
D.defineProperty(E, { | |
TG: "scaleComputation" | |
}, function() { | |
return this.Xw | |
}, function(a) { | |
var b = this.Xw; | |
b !== a && (null !== a && D.h(a, "function", E, "scaleComputation"), this.Xw = a, gn(this, this.scale, this.scale), this.i("scaleComputation", b, a)) | |
}); | |
D.w(E, { | |
kd: "documentBounds" | |
}, function() { | |
return this.$v | |
}); | |
function am(a, b) { | |
a.sk = !1; | |
var c = a.$v; | |
c.O(b) || (b = b.V(), a.$v = b, Yl(a, !1), a.Ja("DocumentBoundsChanged", null, c.copy()), im(a)) | |
} | |
D.defineProperty(E, { | |
tB: "isVirtualized" | |
}, function() { | |
return this.vw | |
}, function(a) { | |
var b = this.vw; | |
b !== a && (D.h(a, "boolean", E, "isVirtualized"), this.vw = a, this.i("isVirtualized", b, a)) | |
}); | |
D.defineProperty(E, { | |
scale: "scale" | |
}, function() { | |
return this.Db | |
}, function(a) { | |
var b = this.Db; | |
D.p(a, E, "scale"); | |
b !== a && gn(this, b, a) | |
}); | |
D.defineProperty(E, { | |
jm: "autoScale" | |
}, function() { | |
return this.Pm | |
}, function(a) { | |
var b = this.Pm; | |
b !== a && (D.Da(a, E, E, "autoScale"), this.Pm = a, this.i("autoScale", b, a), a !== Vh && Yl(this, !1)) | |
}); | |
D.defineProperty(E, { | |
UL: "initialAutoScale" | |
}, function() { | |
return this.Jl | |
}, function(a) { | |
var b = this.Jl; | |
b !== a && (D.Da(a, E, E, "initialAutoScale"), this.Jl = a, this.i("initialAutoScale", b, a)) | |
}); | |
D.defineProperty(E, { | |
iJ: "initialViewportSpot" | |
}, function() { | |
return this.pw | |
}, function(a) { | |
var b = this.pw; | |
b !== a && (D.l(a, S, E, "initialViewportSpot"), a.Xc() || D.k("initialViewportSpot must be a specific Spot: " + a), this.pw = a, this.i("initialViewportSpot", b, a)) | |
}); | |
D.defineProperty(E, { | |
fJ: "initialDocumentSpot" | |
}, function() { | |
return this.mw | |
}, function(a) { | |
var b = this.mw; | |
b !== a && (D.l(a, S, E, "initialDocumentSpot"), a.Xc() || D.k("initialViewportSpot must be a specific Spot: " + a), this.mw = a, this.i("initialDocumentSpot", b, a)) | |
}); | |
D.defineProperty(E, { | |
Sh: "minScale" | |
}, function() { | |
return this.Hw | |
}, function(a) { | |
D.p(a, E, "minScale"); | |
var b = this.Hw; | |
b !== a && (0 < a ? (this.Hw = a, this.i("minScale", b, a), a > this.scale && (this.scale = a)) : D.ua(a, "> 0", E, "minScale")) | |
}); | |
D.defineProperty(E, { | |
Rh: "maxScale" | |
}, function() { | |
return this.Ew | |
}, function(a) { | |
D.p(a, E, "maxScale"); | |
var b = this.Ew; | |
b !== a && (0 < a ? (this.Ew = a, this.i("maxScale", b, a), a < this.scale && (this.scale = a)) : D.ua(a, "> 0", E, "maxScale")) | |
}); | |
D.defineProperty(E, { | |
Lm: "zoomPoint" | |
}, function() { | |
return this.xx | |
}, function(a) { | |
this.xx.O(a) || (D.l(a, N, E, "zoomPoint"), this.xx = a = a.V()) | |
}); | |
D.defineProperty(E, { | |
JA: "contentAlignment" | |
}, function() { | |
return this.No | |
}, function(a) { | |
var b = this.No; | |
b.O(a) || (D.l(a, S, E, "contentAlignment"), this.No = a = a.V(), this.i("contentAlignment", b, a), Yl(this, !1)) | |
}); | |
D.defineProperty(E, { | |
VL: "initialContentAlignment" | |
}, function() { | |
return this.hp | |
}, function(a) { | |
var b = this.hp; | |
b.O(a) || (D.l(a, S, E, "initialContentAlignment"), this.hp = a = a.V(), this.i("initialContentAlignment", b, a)) | |
}); | |
D.defineProperty(E, { | |
padding: "padding" | |
}, function() { | |
return this.vf | |
}, function(a) { | |
"number" === typeof a ? a = new Lb(a) : D.l(a, Lb, E, "padding"); | |
var b = this.vf; | |
b.O(a) || (this.vf = a = a.V(), this.Qc(), this.i("padding", b, a)) | |
}); | |
D.w(E, { | |
rg: "nodes" | |
}, function() { | |
return this.Ap.j | |
}); | |
D.w(E, { | |
links: "links" | |
}, function() { | |
return this.tp.j | |
}); | |
D.w(E, { | |
Hi: "parts" | |
}, function() { | |
return this.rb.j | |
}); | |
E.prototype.findTopLevelNodesAndLinks = function() { | |
for (var a = new L(F), b = this.Ap.j; b.next();) { | |
var c = b.value; | |
c.Bq && a.add(c) | |
} | |
for (b = this.tp.j; b.next();) c = b.value, c.Bq && a.add(c); | |
return a.j | |
}; | |
E.prototype.findTopLevelGroups = function() { | |
return this.am.j | |
}; | |
D.defineProperty(E, { | |
Zb: "layout" | |
}, function() { | |
return this.we | |
}, function(a) { | |
var b = this.we; | |
b !== a && (D.l(a, $g, E, "layout"), null !== b && (b.g = null, b.group = null), this.we = a, a.g = this, a.group = null, this.ek = !0, this.i("layout", b, a), this.Le()) | |
}); | |
E.prototype.layoutDiagram = function(a) { | |
Si(this); | |
a && Bn(this, !0); | |
mm(this, !1) | |
}; | |
function Bn(a, b) { | |
for (var c = a.am.j; c.next();) In(a, c.value, b); | |
null !== a.Zb && (b ? a.Zb.Bf = !1 : a.Zb.L()) | |
} | |
function In(a, b, c) { | |
if (null !== b) { | |
for (var d = b.jn.j; d.next();) In(a, d.value, c); | |
null !== b.Zb && (c ? b.Zb.Bf = !1 : b.Zb.L()) | |
} | |
} | |
function mm(a, b) { | |
if (a.ek && !a.Cz) { | |
var c = a.ab; | |
a.ab = !0; | |
try { | |
var d = a.na.Ki; | |
0 === d && a.Nb("Layout"); | |
var e = a.Ra; | |
1 >= d && !e.pf && !e.zc && (b || e.ro("Layout")); | |
a.ek = !1; | |
for (var g = a.am.j; g.next();) Jn(a, g.value, b, d); | |
var h = a.Zb; | |
h.Bf || (!b || h.kG || 0 === d ? (h.doLayout(a), Si(a), h.Bf = !0) : a.ek = !0) | |
} finally { | |
0 === d && a.jd("Layout"), a.ek = !h.Bf, a.ab = c | |
} | |
} | |
} | |
function Jn(a, b, c, d) { | |
if (null !== b) { | |
for (var e = b.jn.j; e.next();) Jn(a, e.value, c, d); | |
e = b.Zb; | |
null === e || e.Bf || (!c || e.kG || 0 === d ? (b.po = !b.location.H(), e.doLayout(b), b.L(Kn), Mm(a, b), e.Bf = !0) : a.ek = !0) | |
} | |
} | |
D.defineProperty(E, { | |
fe: "isTreePathToChildren" | |
}, function() { | |
return this.uw | |
}, function(a) { | |
var b = this.uw; | |
if (b !== a && (D.h(a, "boolean", E, "isTreePathToChildren"), this.uw = a, this.i("isTreePathToChildren", b, a), !this.na.ub)) | |
for (a = this.rg; a.next();) Ln(a.value) | |
}); | |
E.prototype.findTreeRoots = function() { | |
for (var a = new K(G), b = this.rg; b.next();) { | |
var c = b.value; | |
c.Bq && null === c.Sn() && a.add(c) | |
} | |
return a.j | |
}; | |
D.defineProperty(E, { | |
pC: "treeCollapsePolicy" | |
}, function() { | |
return this.sx | |
}, function(a) { | |
var b = this.sx; | |
b !== a && (a !== El && a !== jn && a !== kn && D.k("Unknown Diagram.treeCollapsePolicy: " + a), this.sx = a, this.i("treeCollapsePolicy", b, a)) | |
}); | |
D.defineProperty(E, { | |
Ph: null | |
}, function() { | |
return this.AD | |
}, function(a) { | |
this.AD = a | |
}); | |
function Dl(a) { | |
function b(a) { | |
var b = a.toLowerCase(), | |
h = new K("function"); | |
c.add(a, h); | |
c.add(b, h); | |
d.add(a, a); | |
d.add(b, a) | |
} | |
var c = new na("string", K), | |
d = new na("string", "string"); | |
b("AnimationStarting"); | |
b("AnimationFinished"); | |
b("BackgroundSingleClicked"); | |
b("BackgroundDoubleClicked"); | |
b("BackgroundContextClicked"); | |
b("ClipboardChanged"); | |
b("ClipboardPasted"); | |
b("DocumentBoundsChanged"); | |
b("ExternalObjectsDropped"); | |
b("InitialLayoutCompleted"); | |
b("LayoutCompleted"); | |
b("LinkDrawn"); | |
b("LinkRelinked"); | |
b("LinkReshaped"); | |
b("Modified"); | |
b("ObjectSingleClicked"); | |
b("ObjectDoubleClicked"); | |
b("ObjectContextClicked"); | |
b("PartCreated"); | |
b("PartResized"); | |
b("PartRotated"); | |
b("SelectionMoved"); | |
b("SelectionCopied"); | |
b("SelectionDeleting"); | |
b("SelectionDeleted"); | |
b("SelectionGrouped"); | |
b("SelectionUngrouped"); | |
b("ChangingSelection"); | |
b("ChangedSelection"); | |
b("SubGraphCollapsed"); | |
b("SubGraphExpanded"); | |
b("TextEdited"); | |
b("TreeCollapsed"); | |
b("TreeExpanded"); | |
b("ViewportBoundsChanged"); | |
a.Ez = c; | |
a.Dz = d | |
} | |
function Ga(a, b) { | |
var c = a.Dz.oa(b); | |
return null !== c ? c : a.Dz.oa(b.toLowerCase()) | |
} | |
function Mn(a, b) { | |
var c = a.Ez.oa(b); | |
if (null !== c) return c; | |
c = a.Ez.oa(b.toLowerCase()); | |
if (null !== c) return c; | |
D.k("Unknown DiagramEvent name: " + b); | |
return null | |
} | |
E.prototype.addDiagramListener = E.prototype.yx = function(a, b) { | |
D.h(a, "string", E, "addDiagramListener:name"); | |
D.h(b, "function", E, "addDiagramListener:listener"); | |
var c = Mn(this, a); | |
null !== c && c.add(b) | |
}; | |
E.prototype.removeDiagramListener = E.prototype.PB = function(a, b) { | |
D.h(a, "string", E, "removeDiagramListener:name"); | |
D.h(b, "function", E, "addDiagramListener:listener"); | |
var c = Mn(this, a); | |
null !== c && c.remove(b) | |
}; | |
E.prototype.raiseDiagramEvent = E.prototype.Ja = function(a, b, c) { | |
v && D.h(a, "string", E, "raiseDiagramEvent:name"); | |
var d = Mn(this, a), | |
e = new dg; | |
e.g = this; | |
a = Ga(this, a); | |
null !== a && (e.name = a); | |
void 0 !== b && (e.gC = b); | |
void 0 !== c && (e.KB = c); | |
b = d.length; | |
if (1 === b) d = d.fa(0), d(e); | |
else if (0 !== b) | |
for (c = d.Fc(), a = 0; a < b; a++) d = c[a], d(e); | |
return e.cancel | |
}; | |
E.prototype.isUnoccupied = E.prototype.Dq = function(a, b) { | |
void 0 === b && (b = null); | |
return ha(this, !1, null, b).Dq(a.x, a.y, a.width, a.height) | |
}; | |
E.prototype.computeOccupiedArea = function() { | |
return this.tB ? this.wb.copy() : this.sk ? Xl(this) : this.kd.copy() | |
}; | |
function ha(a, b, c, d) { | |
null === a.Yd && (a.Yd = new Nn); | |
if (a.Yd.vq || a.Yd.group !== c || a.Yd.fC !== d) { | |
if (null === c) { | |
b = a.computeOccupiedArea(); | |
b.ig(100, 100); | |
a.Yd.initialize(b); | |
b = D.Sf(); | |
for (var e = a.rg; e.next();) { | |
var g = e.value, | |
h = g.layer; | |
null !== h && h.visible && !h.Yc && On(a, g, d, b) | |
} | |
} else | |
for (0 < c.uc.count && (b = a.computePartsBounds(c.uc, !1), b.ig(20, 20), a.Yd.initialize(b)), b = D.Sf(), e = c.uc; e.next();) g = e.value, g instanceof G && On(a, g, d, b); | |
D.Lb(b); | |
a.Yd.group = c; | |
a.Yd.fC = d; | |
a.Yd.vq = !1 | |
} else b && Pn(a.Yd); | |
return a.Yd | |
} | |
function On(a, b, c, d) { | |
if (b !== c) | |
if (b.isVisible() && b.FA && !b.Lf) { | |
c = b.getAvoidableRect(d); | |
d = a.Yd.cq; | |
b = a.Yd.aq; | |
for (var e = c.x + c.width, g = c.y + c.height, h = c.x; h < e; h += d) { | |
for (var k = c.y; k < g; k += b) Qn(a.Yd, h, k); | |
Qn(a.Yd, h, g) | |
} | |
for (k = c.y; k < g; k += b) Qn(a.Yd, e, k); | |
Qn(a.Yd, e, g) | |
} else if (b instanceof I) | |
for (b = b.uc; b.next();) e = b.value, e instanceof G && On(a, e, c, d) | |
} | |
E.invalidatePositionArray = E.prototype.mB = function(a) { | |
null !== this.Yd && !this.Yd.vq && (void 0 === a && (a = null), null === a || a.FA && !a.Lf) && (this.Yd.vq = !0) | |
}; | |
E.prototype.simulatedMouseMove = function(a, b, c) { | |
if (null !== di) { | |
var d = di.g; | |
c instanceof E || (c = null); | |
var e = ei; | |
c !== e && (null !== e && e !== d && null !== e.ob.Ge && (Di(e), di.hy = !1, e.ob.Ge.doSimulatedDragLeave()), ei = c, null !== c && c !== d && null !== c.ob.Ge && (Ki(), e = c.ob.Ge, Gi.contains(e) || Gi.add(e), c.ob.Ge.doSimulatedDragEnter())); | |
if (null === c || c === d || !c.VE || c.qb || !c.Zp) return !1; | |
d = c.ob.Ge; | |
null !== d && (null !== a ? b = c.dp(a) : null === b && (b = new N), c.Vb.ha = b, c.Vb.Sd = c.wv(b), c.Vb.Wk = !1, c.Vb.up = !1, d.doSimulatedDragOver()); | |
return !0 | |
} | |
return !1 | |
}; | |
E.prototype.simulatedMouseUp = function(a, b, c, d) { | |
if (null !== di) { | |
null === d && (d = b); | |
b = ei; | |
var e = di.g; | |
if (d !== b) { | |
if (null !== b && b !== e && null !== b.ob.Ge) return Di(b), di.hy = !1, b.ob.Ge.doSimulatedDragLeave(), !1; | |
ei = d; | |
null !== d && null !== d.ob.Ge && (Ki(), b = d.ob.Ge, Gi.contains(b) || Gi.add(b), d.ob.Ge.doSimulatedDragEnter()) | |
} | |
if (null === d) return di.doCancel(), !0; | |
if (d !== this) return null !== a && (c = d.dp(a)), d.Vb.ha = c, d.Vb.Sd = d.wv(c), d.Vb.Wk = !1, d.Vb.up = !0, a = d.ob.Ge, null !== a && a.doSimulatedDrop(), a = di, null !== a && (d = a.mayCopy(), a.Tf = d ? | |
"Copy" : "Move", a.stopTool()), !0 | |
} | |
return !1 | |
}; | |
D.defineProperty(E, { | |
nL: "autoScrollInterval" | |
}, function() { | |
return this.pr | |
}, function(a) { | |
var b = this.pr; | |
D.p(a, E, "scale"); | |
b !== a && (this.pr = a, this.i("autoScrollInterval", b, a)) | |
}); | |
D.defineProperty(E, { | |
bF: "autoScrollRegion" | |
}, function() { | |
return this.Mv | |
}, function(a) { | |
"number" === typeof a ? a = new Lb(a) : D.l(a, Lb, E, "autoScrollRegion"); | |
var b = this.Mv; | |
b.O(a) || (this.Mv = a = a.V(), this.Qc(), this.i("autoScrollRegion", b, a)) | |
}); | |
E.prototype.doAutoScroll = E.prototype.SA = function(a) { | |
this.Lv.assign(a); | |
Rn(this, this.Lv).Wc(this.position) ? Di(this) : Sn(this) | |
}; | |
function Sn(a) { | |
-1 === a.Io && (a.Io = D.setTimeout(function() { | |
if (-1 !== a.Io) { | |
Di(a); | |
var b = a.U.event; | |
if (null !== b) { | |
var c = Rn(a, a.Lv); | |
c.Wc(a.position) || (a.position = c, a.U.ha = a.oC(a.Lv), c = fm(b), a.simulatedMouseMove(b, null, c) || a.doMouseMove(), a.sk = !0, am(a, a.Kh()), a.Pe = !0, a.lg(), Sn(a)) | |
} | |
} | |
}, a.pr)) | |
} | |
function Di(a) { | |
-1 !== a.Io && (D.clearTimeout(a.Io), a.Io = -1) | |
} | |
function Rn(a, b) { | |
var c = a.position, | |
d = a.bF; | |
if (0 >= d.top && 0 >= d.left && 0 >= d.right && 0 >= d.bottom) return c; | |
var e = a.wb, | |
g = a.scale, | |
e = D.vg(0, 0, e.width * g, e.height * g), | |
h = D.Fb(0, 0); | |
if (b.x >= e.x && b.x < e.x + d.left) { | |
var k = Math.max(a.lv, 1), | |
k = k | 0; | |
h.x -= k; | |
b.x < e.x + d.left / 2 && (h.x -= k); | |
b.x < e.x + d.left / 4 && (h.x -= 4 * k) | |
} else b.x <= e.x + e.width && b.x > e.x + e.width - d.right && (k = Math.max(a.lv, 1), k |= 0, h.x += k, b.x > e.x + e.width - d.right / 2 && (h.x += k), b.x > e.x + e.width - d.right / 4 && (h.x += 4 * k)); | |
b.y >= e.y && b.y < e.y + d.top ? (k = Math.max(a.mv, 1), k |= 0, h.y -= k, b.y < e.y + | |
d.top / 2 && (h.y -= k), b.y < e.y + d.top / 4 && (h.y -= 4 * k)) : b.y <= e.y + e.height && b.y > e.y + e.height - d.bottom && (k = Math.max(a.mv, 1), k |= 0, h.y += k, b.y > e.y + e.height - d.bottom / 2 && (h.y += k), b.y > e.y + e.height - d.bottom / 4 && (h.y += 4 * k)); | |
h.Wc(Kd) || (c = new N(c.x + h.x / g, c.y + h.y / g)); | |
D.Lb(e); | |
D.A(h); | |
return c | |
} | |
E.prototype.makeSvg = E.prototype.makeSVG = function(a) { | |
void 0 === a && (a = new ma); | |
a.context = "svg"; | |
a = Tn(this, a); | |
return null !== a ? a.Gm : null | |
}; | |
E.prototype.makeImage = function(a) { | |
void 0 === a && (a = new ma); | |
var b = (a.document || document).createElement("img"); | |
b.src = this.DJ(a); | |
return b | |
}; | |
E.prototype.makeImageData = E.prototype.DJ = function(a) { | |
void 0 === a && (a = new ma); | |
var b = Tn(this, a); | |
if (null !== b) { | |
var c = a.returnType, | |
c = void 0 === c ? "string" : c.toLowerCase(); | |
switch (c) { | |
case "imagedata": | |
return b.Uk.getImageData(0, 0, b.width, b.height); | |
case "blob": | |
b = b.ae; | |
c = a.callback; | |
if ("function" !== typeof c) { | |
D.k('Error: Diagram.makeImageData called with "returnType: toBlob", but no "callback" function property defined.'); | |
break | |
} | |
if ("function" === typeof b.toBlob) return b.toBlob(c, a.type, a.details), "toBlob"; | |
if ("function" === | |
typeof b.msToBlob) return c(b.msToBlob()), "msToBlob"; | |
c(null); | |
break; | |
default: | |
return b.toDataURL(a.type, a.details) | |
} | |
} | |
return "" | |
}; | |
var Un = !1; | |
function Tn(a, b) { | |
a.Ra.Yh(); | |
a.lg(); | |
if (null === a.Ib) return null; | |
"object" !== typeof b && D.k("properties argument must be an Object."); | |
var c = !1, | |
d = b.size || null, | |
e = b.scale || null; | |
void 0 !== b.scale && isNaN(b.scale) && (e = "NaN"); | |
var g = b.maxSize; | |
void 0 === b.maxSize && (c = !0, g = "svg" === b.context ? new Ca(Infinity, Infinity) : new Ca(2E3, 2E3)); | |
var h = b.position || null, | |
k = b.parts || null, | |
l = void 0 === b.padding ? 1 : b.padding, | |
m = b.background || null, | |
n = b.omitTemporary; | |
void 0 === n && (n = !0); | |
var p = b.document || document, | |
q = b.elementFinished || null, | |
r = | |
b.showTemporary; | |
void 0 === r && (r = !n); | |
n = b.showGrid; | |
void 0 === n && (n = r); | |
null !== d && isNaN(d.width) && isNaN(d.height) && (d = null); | |
"number" === typeof l ? l = new Lb(l) : l instanceof Lb || D.k("MakeImage padding must be a Margin or a number."); | |
l.left = Math.max(l.left, 0); | |
l.right = Math.max(l.right, 0); | |
l.top = Math.max(l.top, 0); | |
l.bottom = Math.max(l.bottom, 0); | |
a.dd.De(!0); | |
var s = new ja(null, p), | |
u = s.Uk; | |
if (!(d || e || k || h)) { | |
s.width = a.Qb + Math.ceil(l.left + l.right); | |
s.height = a.Pb + Math.ceil(l.top + l.bottom); | |
if ("svg" === b.context) return u = new qd(s.ae, | |
p, q), Tm(a, u, l, new Ca(s.width, s.height), a.Db, a.sb, k, m, r, n), u; | |
a.Ur = !1; | |
Tm(a, u, l, new Ca(s.width, s.height), a.Db, a.sb, k, m, r, n); | |
a.Ur = !0; | |
return s | |
} | |
var t = a.yb.Px, | |
y = new N(0, 0), | |
w = a.kd.copy(); | |
w.yK(a.padding); | |
if (r) | |
for (var A = !0, A = a.dc.o, B = A.length, P = 0; P < B; P++) { | |
var H = A[P]; | |
if (H.visible && H.Yc) | |
for (var H = H.rb.o, R = H.length, aa = 0; aa < R; aa++) { | |
var V = H[aa]; | |
V.iy && V.isVisible() && (V = V.aa, V.H() && w.Zh(V)) | |
} | |
} | |
y.x = w.x; | |
y.y = w.y; | |
if (null !== k) { | |
var ea, A = !0, | |
B = k.j; | |
for (B.reset(); B.next();) V = B.value, V instanceof F && (H = V.layer, null !== H && !H.visible || | |
null !== H && !r && H.Yc || !V.isVisible() || (V = V.aa, V.H() && (A ? (A = !1, ea = V.copy()) : ea.Zh(V)))); | |
A && (ea = new C(0, 0, 0, 0)); | |
w.width = ea.width; | |
w.height = ea.height; | |
y.x = ea.x; | |
y.y = ea.y | |
} | |
null !== h && h.H() && (y = h, e || (e = t)); | |
A = V = 0; | |
null !== l && (V = l.left + l.right, A = l.top + l.bottom); | |
P = B = 0; | |
null !== d && (B = d.width, P = d.height, isFinite(B) && (B = Math.max(0, B - V)), isFinite(P) && (P = Math.max(0, P - A))); | |
ea = h = 0; | |
null !== d && null !== e ? ("NaN" === e && (e = t), d.H() ? (h = B, ea = P) : isNaN(P) ? (h = B, ea = w.height * e) : (h = w.width * e, ea = P)) : null !== d ? d.H() ? (e = Math.min(B / w.width, P / w.height), | |
h = B, ea = P) : isNaN(P) ? (e = B / w.width, h = B, ea = w.height * e) : (e = P / w.height, h = w.width * e, ea = P) : null !== e ? "NaN" === e && g.H() ? (e = Math.min((g.width - V) / w.width, (g.height - A) / w.height), e > t ? (e = t, h = w.width, ea = w.height) : (h = g.width, ea = g.height)) : (h = w.width * e, ea = w.height * e) : (e = t, h = w.width, ea = w.height); | |
null !== l ? (h += V, ea += A) : l = new Lb(0); | |
null !== g && (d = g.width, g = g.height, "svg" !== b.context && c && !Un && (h > d || ea > g) && (D.trace("Diagram.makeImage(data): Diagram width or height is larger than the default max size. (" + Math.ceil(h) + "x" + Math.ceil(ea) + | |
" vs 2000x2000) Consider increasing the max size."), Un = !0), isNaN(d) && (d = 2E3), isNaN(g) && (g = 2E3), isFinite(d) && (h = Math.min(h, d)), isFinite(g) && (ea = Math.min(ea, g))); | |
s.width = Math.ceil(h); | |
s.height = Math.ceil(ea); | |
if ("svg" === b.context) return u = new qd(s.ae, p, q), Tm(a, u, l, new Ca(Math.ceil(h), Math.ceil(ea)), e, y, k, m, r, n), u; | |
a.Ur = !1; | |
Tm(a, u, l, new Ca(Math.ceil(h), Math.ceil(ea)), e, y, k, m, r, n); | |
a.Ur = !0; | |
return s | |
} | |
E.inherit = function(a, b) { | |
D.h(a, "function", E, "inherit"); | |
D.h(b, "function", E, "inherit"); | |
b.NH && D.k("Cannot inherit from " + D.yf(b)); | |
D.Ta(a, b) | |
}; | |
function Ml() { | |
this.uE = null; | |
this.PH = "63ad05bbe23a1786468a4c741b6d2"; | |
this.Zi = this.PH === this._tk ? !0 : null | |
} | |
Ml.prototype.Km = function(a) { | |
a.dd.setTransform(a.ud, 0, 0, a.ud, 0, 0); | |
if (null === this.Zi) { | |
var b = "f", | |
c = window[D.Wg("76a715b2f73f148a")][D.Wg("72ba13b5")]; | |
a = D.Wg; | |
this.Zi = !0; | |
if (window[a("7da7")] && window[a("7da7")][a("76a115b6ed251eaf4692")]) { | |
var d = window[a("7da7")][a("76a115b6ed251eaf4692")], | |
d = a(d).split(a("39e9")); | |
if (!(6 > d.length)) { | |
var e = a(d[1]).split("."); | |
if ("7da71ca0" === d[4]) { | |
var g = a(D[a("6cae19")]).split("."); | |
if (e[0] > g[0] || e[0] === g[0] && e[1] >= g[1]) { | |
g = c[a("76ad18b4f73e")]; | |
for (e = c[a("73a612b6fb191d")](a("35e7")) + | |
2; e < g; e++) b += c[e]; | |
c = b[a("73a612b6fb191d")](a(d[2])); | |
0 > c && a(d[2]) !== a("7da71ca0ad381e90") && (c = b[a("73a612b6fb191d")](a("76a715b2ef3e149757"))); | |
0 > c && (c = b[a("73a612b6fb191d")](a("76a715b2ef3e149757"))); | |
if (this.Zi = !(0 <= c && c < b[a("73a612b6fb191d")](a("35")))) | |
if (b = a(d[2]), "#" === b[0]) { | |
c = window.document[a("79ba13b2f7333e8846865a7d00")]("div"); | |
for (e = d[0].replace(/[A-Za-z]/g, ""); 4 > e.length;) e += "9"; | |
e = e.substr(e.length - 4); | |
d = "" + ["gsh", "gsf"][parseInt(e.substr(0, 1), 10) % 2]; | |
d += ["Header", "Background", "Display", "Feedback"][parseInt(e.substr(0, | |
1), 10) % 4]; | |
c[a("79a417a0f0181a8946")] = d; | |
if (window.document[a("78a712aa")]) { | |
if (window.document[a("78a712aa")][a("7bb806b6ed32388c4a875b")](c), e = window[a("7dad0290ec3b0b91578e5b40007031bf")](c)[a("7dad0283f1390b81519f4645156528bf")](a("78a704b7e62456904c9b12701b6532a8")), window.document[a("78a712aa")][a("68ad1bbcf533388c4a875b")](c), e) | |
if (-1 !== e.indexOf(parseInt(b[1] + b[2], 16)) && -1 !== e.indexOf(parseInt(b[3] + b[4], 16))) this.Zi = !1; | |
else if (D.Mu || D.zq || D.Aq || D.pB) | |
for (d = "." + d, e = 0; e < document.styleSheets.length; e++) { | |
a = | |
document.styleSheets[e].rules || document.styleSheets[e].cssRules; | |
for (var h in a) | |
if (d === a[h].selectorText) { | |
this.Zi = !1; | |
break | |
} | |
} | |
} else this.Zi = null, this.Zi = !1 | |
} | |
} | |
} | |
} | |
} else { | |
g = c[a("76ad18b4f73e")]; | |
for (e = c[a("73a612b6fb191d")](a("35e7")) + 2; e < g; e++) b += c[e]; | |
c = b[a("73a612b6fb191d")](a("7da71ca0ad381e90")); | |
this.Zi = !(0 <= c && c < b[a("73a612b6fb191d")](a("35"))) | |
} | |
} | |
return 0 < this.Zi && this !== this.uE ? !0 : !1 | |
}; | |
Ml.prototype.t = function() { | |
this.uE = null | |
}; | |
function Nl(a, b) { | |
void 0 !== b && null !== b || D.k("Diagram setup requires an argument DIV."); | |
null !== a.Ub && D.k("Diagram has already completed setup."); | |
"string" === typeof b ? a.Ub = window.document.getElementById(b) : b instanceof HTMLDivElement ? a.Ub = b : D.k("No DIV or DIV id supplied: " + b); | |
null === a.Ub && D.k("Invalid DIV id; could not get element with id: " + b); | |
void 0 !== a.Ub.ea && D.k("Invalid div id; div already has a Diagram associated with it."); | |
"static" === window.getComputedStyle(a.Ub, null).position && (a.Ub.style.position = | |
"relative"); | |
a.Ub.style["-webkit-tap-highlight-color"] = "rgba(255, 255, 255, 0)"; | |
a.Ub.style["-ms-touch-action"] = "none"; | |
a.Ub.innerHTML = ""; | |
a.Ub.ea = a; | |
var c = new ja(a); | |
c.ae.innerHTML = "This text is displayed if your browser does not support the Canvas HTML element."; | |
void 0 !== c.style && (c.style.position = "absolute", c.style.top = "0px", c.style.left = "0px", "rtl" === window.getComputedStyle(a.Ub, null).getPropertyValue("direction") && (a.rs = !0), c.style.zIndex = "2", c.style.OM = "none", c.style.webkitUserSelect = "none", c.style.MozUserSelect = | |
"none"); | |
a.Qb = a.Ub.clientWidth || 1; | |
a.Pb = a.Ub.clientHeight || 1; | |
a.Ib = c; | |
a.dd = c.Uk; | |
var d = a.dd; | |
a.ud = a.computePixelRatio(); | |
Vm(a, a.Qb, a.Pb); | |
a.bw = d[D.Wg("7eba17a4ca3b1a8346")][D.Wg("78a118b7")](d, D.Km, 4, 4); | |
a.Ub.insertBefore(c.ae, a.Ub.firstChild); | |
c = new ja(null); | |
c.width = 1; | |
c.height = 1; | |
a.Hz = c; | |
a.pD = c.Uk; | |
var c = D.createElement("div"), | |
e = D.createElement("div"); | |
c.style.position = "absolute"; | |
c.style.overflow = "auto"; | |
c.style.width = a.Qb + "px"; | |
c.style.height = a.Pb + "px"; | |
c.style.zIndex = "1"; | |
e.style.position = "absolute"; | |
e.style.width = | |
"1px"; | |
e.style.height = "1px"; | |
a.Ub.appendChild(c); | |
c.appendChild(e); | |
c.onscroll = Tl; | |
c.onmousedown = Vl; | |
c.ontouchstart = Vl; | |
c.ea = a; | |
c.LH = !0; | |
c.MH = !0; | |
a.bx = c; | |
a.yt = e; | |
a.Gy = D.mF(function() { | |
a.Ik = null; | |
a.ra() | |
}, 300, !1); | |
a.tC = D.mF(function() { | |
fl(a) | |
}, 250, !1); | |
a.preventDefault = function(a) { | |
a.preventDefault(); | |
return !1 | |
}; | |
a.lo = function(b) { | |
if (a.isEnabled) { | |
a.th = !0; | |
var c = a.Hd; | |
D.Zn && c.Qj ? (b.preventDefault(), b.simulated = !0, a.Ht = b) : (a.Hd = a.Vb, a.Vb = c, dm(a, a, b, c, !0), a.simulatedMouseMove(b, null, b.target.ea) || (a.doMouseMove(), a.eb.isBeyondDragSize() && | |
(a.ji = 0), ga(a, c, b))) | |
} | |
}; | |
a.ko = function(b) { | |
if (a.isEnabled) { | |
a.th = !0; | |
var c = a.Hd; | |
if (D.Zn && null !== a.Ht) a.Ht = b, b.preventDefault(); | |
else if (D.Zn && 400 > b.timeStamp - a.xk) b.preventDefault(); | |
else if (a.vk) b.preventDefault(); | |
else { | |
a.Hd = a.Vb; | |
a.Vb = c; | |
dm(a, a, b, c, !0); | |
c.Wk = !0; | |
c.Ee = b.detail; | |
if (D.zq || D.Aq) b.timeStamp - a.xk < a.wA && !a.eb.isBeyondDragSize() ? a.ji++ : a.ji = 1, a.xk = b.timeStamp, c.Ee = a.ji; | |
a.aj = c; | |
!0 === c.$r.simulated ? (b.preventDefault(), b.simulated = !0) : (di = null, a.doMouseDown(), a.aj = a.aj.copy(), 1 === b.button ? b.preventDefault() : | |
ga(a, c, b)) | |
} | |
} | |
}; | |
a.no = function(b) { | |
if (a.isEnabled) | |
if (a.vk && 2 === b.button) b.preventDefault(); | |
else if (a.vk && 0 === b.button && (a.vk = !1), a.Sp) b.preventDefault(); | |
else { | |
a.th = !0; | |
var c = a.Hd; | |
if (D.Zn) { | |
if (400 > b.timeStamp - a.xk) { | |
b.preventDefault(); | |
return | |
} | |
a.xk = b.timeStamp | |
} | |
if (D.Zn && null !== a.Ht) a.Ht = null, b.preventDefault(); | |
else { | |
a.Hd = a.Vb; | |
a.Vb = c; | |
dm(a, a, b, c, !0); | |
c.up = !0; | |
c.Ee = b.detail; | |
if (D.zq || D.Aq) c.Ee = a.ji; | |
c.bubbles = b.bubbles; | |
c.Qf = fm(b); | |
a.simulatedMouseUp(b, null, new N, c.Qf) || (a.doMouseUp(), Di(a), ga(a, c, b)) | |
} | |
} | |
}; | |
a.oo = function(b) { | |
if (a.isEnabled) { | |
var c = | |
a.Hd; | |
a.Hd = a.Vb; | |
a.Vb = c; | |
dm(a, a, b, c, !0); | |
c.bubbles = !0; | |
var d = 0, | |
e = 0; | |
void 0 !== b.wheelDelta && (e = 0 < b.wheelDelta ? 1 : -1); | |
void 0 !== b.wheelDeltaY && (e = 0 < b.wheelDeltaY ? 1 : -1); | |
void 0 !== b.wheelDeltaX && (d = 0 < b.wheelDeltaX ? 1 : -1); | |
void 0 !== b.deltaY && (e = 0 < b.deltaY ? 1 : -1); | |
void 0 !== b.deltaX && (d = 0 < b.deltaX ? 1 : -1); | |
c.Vk = 0 === e ? -d : -e; | |
a.doMouseWheel(); | |
ga(a, c, b) | |
} | |
}; | |
a.mo = function() { | |
if (a.isEnabled) { | |
a.th = !1; | |
var b = a.eb; | |
b.cancelWaitAfter(); | |
b.standardMouseOver() | |
} | |
}; | |
a.nC = function(b) { | |
if (a.isEnabled) { | |
a.Sp = !1; | |
a.vk = !0; | |
var c = gm(a, b, b.targetTouches[0], | |
1 < b.touches.length); | |
a.doMouseDown(); | |
ga(a, c, b) | |
} | |
}; | |
a.mC = function(b) { | |
if (a.isEnabled) { | |
var c = null; | |
0 < b.targetTouches.length ? c = b.targetTouches[0] : 0 < b.changedTouches.length && (c = b.changedTouches[0]); | |
var d = hm(a, b, c, 1 < b.touches.length); | |
a.simulatedMouseMove(c ? c : b, null, d.Qf) || a.doMouseMove(); | |
ga(a, d, b) | |
} | |
}; | |
a.lC = function(b) { | |
if (a.isEnabled) | |
if (a.Sp) b.preventDefault(); | |
else if (!(1 < b.touches.length)) { | |
var c = null, | |
d = null; | |
0 < b.targetTouches.length ? d = b.targetTouches[0] : 0 < b.changedTouches.length && (d = b.changedTouches[0]); | |
var e = | |
a.Hd; | |
a.Hd = a.Vb; | |
a.Vb = e; | |
e.g = a; | |
e.Ee = 1; | |
if (null !== d) { | |
c = window.document.elementFromPoint(d.clientX, d.clientY); | |
null !== c && c.ea instanceof E && c.ea !== a && em(c.ea, d, e); | |
em(a, d, e); | |
var m = d.screenX, | |
n = d.screenY, | |
p = a.xw; | |
b.timeStamp - a.xk < a.wA && !(25 < Math.abs(p.x - m) || 25 < Math.abs(p.y - n)) ? a.ji++ : a.ji = 1; | |
e.Ee = a.ji; | |
a.xk = b.timeStamp; | |
a.xw.n(m, n) | |
} | |
m = 0; | |
b.ctrlKey && (m += 1); | |
b.altKey && (m += 2); | |
b.shiftKey && (m += 4); | |
b.metaKey && (m += 8); | |
e.xd = m; | |
e.button = 0; | |
e.buttons = 1; | |
e.Wk = !1; | |
e.up = !0; | |
e.Vk = 0; | |
e.Cc = !1; | |
e.bubbles = !1; | |
e.event = b; | |
e.timestamp = Date.now(); | |
e.Qf = null === c ? fm(b) : c.ea ? c.ea : null; | |
e.Oe = null; | |
a.simulatedMouseUp(d ? d : b, null, new N, e.Qf) || a.doMouseUp(); | |
ga(a, e, b); | |
a.vk = !1 | |
} | |
}; | |
a.Jq = function(b) { | |
if (a.isEnabled) { | |
a.th = !0; | |
var c = a.iA; | |
void 0 === c[b.pointerId] && (c[b.pointerId] = b); | |
var c = a.Dp, | |
d = !1; | |
if (null !== c[0] && c[0].pointerId === b.pointerId) c[0] = b; | |
else if (null !== c[1] && c[1].pointerId === b.pointerId) c[1] = b, d = !0; | |
else if (null === c[0]) c[0] = b; | |
else if (null === c[1]) c[1] = b, d = !0; | |
else { | |
b.preventDefault(); | |
return | |
} | |
if ("touch" === b.pointerType || "pen" === b.pointerType) a.Sp = !1, a.vk = !0; | |
c = gm(a, b, b, d); | |
"touch" !== b.pointerType && (c.button = b.button, void 0 === b.buttons || D.Mu || (c.buttons = b.buttons), D.Qh && 0 === b.button && b.ctrlKey && (c.button = 2)); | |
a.doMouseDown(); | |
1 === b.button ? b.preventDefault() : ga(a, c, b) | |
} | |
}; | |
a.Kq = function(b) { | |
if (a.isEnabled) { | |
a.th = !0; | |
var c = a.Dp; | |
if (null !== c[0] && c[0].pointerId === b.pointerId) c[0] = b; | |
else { | |
if (null !== c[1] && c[1].pointerId === b.pointerId) { | |
c[1] = b; | |
return | |
} | |
if (null === c[0]) c[0] = b; | |
else return | |
} | |
c[0].pointerId === b.pointerId && (c = hm(a, b, b, null !== c[1]), "touch" !== b.pointerType && (c.button = | |
b.button, void 0 === b.buttons || D.Mu || (c.buttons = b.buttons), D.Qh && 0 === b.button && b.ctrlKey && (c.button = 2)), a.simulatedMouseMove(b, null, c.Qf) || (a.doMouseMove(), ga(a, c, b))) | |
} | |
}; | |
a.Mq = function(b) { | |
if (a.isEnabled) { | |
a.th = !0; | |
var c = "touch" === b.pointerType || "pen" === b.pointerType, | |
d = a.iA; | |
if (c && a.Sp) delete d[b.pointerId], b.preventDefault(); | |
else if (d = a.Dp, null !== d[0] && d[0].pointerId === b.pointerId) { | |
d[0] = null; | |
d = a.Hd; | |
a.Hd = a.Vb; | |
a.Vb = d; | |
var e = window.document.elementFromPoint(b.clientX, b.clientY); | |
null !== e && e.ea instanceof E && | |
e.ea !== a && em(e.ea, b, d); | |
em(a, b, d); | |
d.g = a; | |
var m = a.xw, | |
n = c ? 25 : 10; | |
b.timeStamp - a.xk < a.wA && !(Math.abs(m.x - b.screenX) > n || Math.abs(m.y - b.screenY) > n) ? a.ji++ : a.ji = 1; | |
d.Ee = a.ji; | |
a.xk = b.timeStamp; | |
a.xw.n(b.screenX, b.screenY); | |
m = 0; | |
b.ctrlKey && (m += 1); | |
b.altKey && (m += 2); | |
b.shiftKey && (m += 4); | |
b.metaKey && (m += 8); | |
d.xd = m; | |
d.button = b.button; | |
void 0 === b.buttons || D.Mu || (d.buttons = b.buttons); | |
D.Qh && 0 === b.button && b.ctrlKey && (d.button = 2); | |
d.Wk = !1; | |
d.up = !0; | |
d.Vk = 0; | |
d.Cc = !1; | |
d.bubbles = !0; | |
d.event = b; | |
d.timestamp = Date.now(); | |
d.Qf = null === e ? fm(b) : e.ea ? | |
e.ea : null; | |
d.Oe = null; | |
a.simulatedMouseUp(b, null, new N, d.Qf) || (a.doMouseUp(), Di(a), ga(a, d, b), c && (a.vk = !1)) | |
} else null !== d[1] && d[1].pointerId === b.pointerId && (d[1] = null) | |
} | |
}; | |
a.Lq = function(b) { | |
if (a.isEnabled) { | |
a.th = !1; | |
var c = a.iA; | |
c[b.pointerId] && delete c[b.pointerId]; | |
c = a.Dp; | |
null !== c[0] && c[0].pointerId === b.pointerId && (c[0] = null); | |
null !== c[1] && c[1].pointerId === b.pointerId && (c[1] = null); | |
"touch" !== b.pointerType && "pen" !== b.pointerType && (b = a.eb, b.cancelWaitAfter(), b.standardMouseOver()) | |
} | |
}; | |
d.De(!0); | |
Ql(a) | |
} | |
function Vn(a) { | |
1 < arguments.length && D.k("Palette constructor can only take one optional argument, the DIV HTML element or its id."); | |
E.call(this, a); | |
this.du = !0; | |
this.gm = !1; | |
this.qb = !0; | |
this.JA = jc; | |
this.Zb = new Wn | |
} | |
D.Ta(Vn, E); | |
D.ka("Palette", Vn); | |
function Jl(a) { | |
1 < arguments.length && D.k("Overview constructor can only take one optional argument, the DIV HTML element or its id."); | |
E.call(this, a); | |
this.Ra.isEnabled = !1; | |
this.ed = !0; | |
this.Ek = null; | |
this.cw = !0; | |
this.rK("drawShadows", !1); | |
var b = new F, | |
c = new z; | |
c.stroke = "magenta"; | |
c.mb = 2; | |
c.fill = "transparent"; | |
c.name = "BOXSHAPE"; | |
b.jl = !0; | |
b.Py = "BOXSHAPE"; | |
b.uy = "BOXSHAPE"; | |
b.QG = "BOXSHAPE"; | |
b.cursor = "move"; | |
b.add(c); | |
this.Qm = b; | |
c = new da; | |
c.type = Xj; | |
c.Of = mc; | |
var d = new Yj; | |
d.Ve = !0; | |
c.add(d); | |
d = new z; | |
d.Gh = mc; | |
d.Kb = "Rectangle"; | |
d.Ea = new Ca(64, | |
64); | |
d.cursor = "se-resize"; | |
d.alignment = vc; | |
c.add(d); | |
b.OG = c; | |
this.En = this.Qk = !1; | |
this.Jf = this.fu = !0; | |
this.bF = new Lb(0, 0, 0, 0); | |
this.rA = new ja(null); | |
this.OH = this.rA.Uk; | |
this.ob.Ge = new Xn; | |
this.ob.RG = new Yn; | |
var e = this; | |
this.click = function() { | |
var a = e.Ek; | |
if (null !== a) { | |
var b = a.wb, | |
c = e.U.ha; | |
a.position = new N(c.x - b.width / 2, c.y - b.height / 2) | |
} | |
}; | |
this.AG = function() { | |
Zn(e) | |
}; | |
this.zG = function() { | |
null !== e.Ek && (e.Qc(), e.ra()) | |
}; | |
this.jm = bm; | |
this.ed = !1 | |
} | |
D.Ta(Jl, E); | |
D.ka("Overview", Jl); | |
function $n(a) { | |
a.ed || a.ke || !1 !== a.cg || (a.cg = !0, requestAnimationFrame(function() { | |
if (a.cg && !a.ke && (a.cg = !1, null !== a.Ub)) { | |
a.ke = !0; | |
Si(a); | |
a.kd.H() || am(a, a.Kh()); | |
null === a.Ub && D.k("No div specified"); | |
null === a.Ib && D.k("No canvas specified"); | |
if (a.Pe) { | |
var b = a.Ek; | |
if (null !== b && !b.Ra.pf && !b.Ra.zc) { | |
var b = a.dd, | |
c = a.rA; | |
b.setTransform(1, 0, 0, 1, 0, 0); | |
b.clearRect(0, 0, a.Ib.width, a.Ib.height); | |
b.drawImage(c.ae, 0, 0); | |
c = a.Nc; | |
c.reset(); | |
1 !== a.scale && c.scale(a.scale); | |
0 === a.position.x && 0 === a.position.y || c.translate(-a.position.x, -a.position.y); | |
b.scale(a.ud, a.ud); | |
b.transform(c.m11, c.m12, c.m21, c.m22, c.dx, c.dy); | |
for (var c = a.dc.o, d = c.length, e = 0; e < d; e++) c[e].He(b, a); | |
a.Kl = !1; | |
a.Pe = !1 | |
} | |
} | |
a.ke = !1 | |
} | |
})) | |
} | |
Jl.prototype.computePixelRatio = function() { | |
return 1 | |
}; | |
Jl.prototype.He = function() { | |
null === this.Ub && D.k("No div specified"); | |
null === this.Ib && D.k("No canvas specified"); | |
if (this.Pe) { | |
var a = this.Ek; | |
if (null !== a && !a.Ra.pf) { | |
Qm(this); | |
var b = a.Xn; | |
(null !== b && b.visible && isNaN(b.width) || isNaN(b.height)) && lm(a); | |
var c = this.Ib, | |
b = this.dd, | |
d = this.rA, | |
e = this.OH; | |
d.width = c.width; | |
d.height = c.height; | |
b.De(!0); | |
b.setTransform(1, 0, 0, 1, 0, 0); | |
b.clearRect(0, 0, c.width, c.height); | |
var g = this.Nc; | |
g.reset(); | |
1 !== this.scale && g.scale(this.scale); | |
0 === this.position.x && 0 === this.position.y || g.translate(-this.position.x, -this.position.y); | |
b.scale(this.ud, this.ud); | |
b.transform(g.m11, g.m12, g.m21, g.m22, g.dx, g.dy); | |
for (var h = this.cw, k = this.wb, l = a.dc.o, m = l.length, a = 0; a < m; a++) { | |
var n = l[a], | |
p = b, | |
q = k, | |
r = h; | |
if (n.visible && 0 !== n.Lc && (void 0 === r && (r = !0), r || !n.Yc)) { | |
1 !== n.Lc && (p.globalAlpha = n.Lc); | |
for (var r = this.scale, n = n.rb.o, s = n.length, u = 0; u < s; u++) { | |
var t = n[u], | |
y = t.aa; | |
y.jg(q) && (1 < y.width * r || 1 < y.height * r ? t.He(p, this) : vl(t, p)) | |
} | |
p.globalAlpha = 1 | |
} | |
} | |
e.drawImage(c.ae, 0, 0); | |
v && v.Dj && (e.fillStyle = "red", e.fillRect(0, d.height / 2, d.width, 4)); | |
c = this.dc.o; | |
d = c.length; | |
for (a = 0; a < d; a++) c[a].He(b, this); | |
v && (v.UA || v.Dj) && v.TA(b, this, g); | |
this.Pe = this.Kl = !1 | |
} | |
} | |
}; | |
D.defineProperty(Jl, { | |
JB: "observed" | |
}, function() { | |
return this.Ek | |
}, function(a) { | |
var b = this.Ek; | |
null !== a && D.l(a, E, Jl, "observed"); | |
a instanceof Jl && D.k("Overview.observed Diagram may not be an Overview itself: " + a); | |
b !== a && (null !== b && (this.remove(this.Jh), b.PB("ViewportBoundsChanged", this.AG), b.PB("DocumentBoundsChanged", this.zG), b.Rw.remove(this)), this.Ek = a, null !== a && (a.yx("ViewportBoundsChanged", this.AG), a.yx("DocumentBoundsChanged", this.zG), a.Rw.add(this), this.add(this.Jh), Zn(this)), this.Qc(), this.i("observed", | |
b, a)) | |
}); | |
D.defineProperty(Jl, { | |
Jh: "box" | |
}, function() { | |
return this.Qm | |
}, function(a) { | |
var b = this.Qm; | |
b !== a && (this.Qm = a, this.remove(b), this.add(this.Qm), Zn(this), this.i("box", b, a)) | |
}); | |
D.defineProperty(Jl, { | |
NL: "drawsTemporaryLayers" | |
}, function() { | |
return this.cw | |
}, function(a) { | |
this.cw !== a && (this.cw = a, this.to()) | |
}); | |
function Zn(a) { | |
var b = a.Jh; | |
if (null !== b) { | |
var c = a.Ek; | |
if (null !== c) { | |
a.Pe = !0; | |
var c = c.wb, | |
d = b.Cm, | |
e = D.Im(); | |
e.n(c.width, c.height); | |
d.Ea = e; | |
D.$k(e); | |
a = 2 / a.scale; | |
d instanceof z && (d.mb = a); | |
b.location = new N(c.x - a / 2, c.y - a / 2) | |
} | |
} | |
} | |
Jl.prototype.Kh = function() { | |
var a = this.Ek; | |
return null === a ? Ld : a.kd | |
}; | |
Jl.prototype.bG = function() { | |
!0 !== this.Pe && (this.Pe = !0, $n(this)) | |
}; | |
Jl.prototype.dv = function(a, b, c, d, e) { | |
this.ed || (Wl(this), this.ra(), im(this), this.Qc(), Zn(this), this.Fh.scale = c, this.Fh.position.x = a.x, this.Fh.position.y = a.y, this.Fh.bounds.set(a), this.Fh.isScroll = e, this.Ja("ViewportBoundsChanged", this.Fh, a)) | |
}; | |
function Xn() { | |
Uh.call(this); | |
this.Ul = null | |
} | |
D.Ta(Xn, Uh); | |
Xn.prototype.canStart = function() { | |
if (!this.isEnabled) return !1; | |
var a = this.g; | |
if (null === a || !a.gm || !a.Jf) return !1; | |
var b = a.JB; | |
if (null === b) return !1; | |
if (null === this.findDraggablePart()) { | |
var c = b.wb; | |
this.Ul = new N(c.width / 2, c.height / 2); | |
a = a.Pc.ha; | |
b.position = new N(a.x - this.Ul.x, a.y - this.Ul.y) | |
} | |
return !0 | |
}; | |
Xn.prototype.doActivate = function() { | |
this.Ul = null; | |
Uh.prototype.doActivate.call(this) | |
}; | |
Xn.prototype.moveParts = function() { | |
var a = this.g, | |
b = a.JB; | |
if (null !== b) { | |
var c = a.Jh; | |
if (null !== c) { | |
if (null === this.Ul) { | |
var d = a.Pc.ha, | |
c = c.location; | |
this.Ul = new N(d.x - c.x, d.y - c.y) | |
} | |
a = a.U.ha; | |
b.position = new N(a.x - this.Ul.x, a.y - this.Ul.y) | |
} | |
} | |
}; | |
function Yn() { | |
Wj.call(this) | |
} | |
D.Ta(Yn, Wj); | |
Yn.prototype.resize = function(a) { | |
var b = this.g.JB; | |
if (null !== b) { | |
var c = b.wb.copy(); | |
b.position = a.position; | |
(c.width !== a.width || c.height !== a.height) && 0 < a.width && 0 < a.height && (b.scale = Math.min(c.width / a.width, c.height / a.height)) | |
} | |
}; | |
function ao() { | |
this.pg = this.nd = this.Rd = this.Rc = 0 | |
} | |
function Ba(a) { | |
1 < arguments.length && D.k("Brush constructor can take at most one optional argument, the Brush type."); | |
D.xc(this); | |
this.J = !1; | |
void 0 === a ? (this.ca = Fg, this.Lo = "black") : "string" === typeof a ? (this.ca = Fg, v && !za(a) && D.k('Color "' + a + '" is not a valid color string for Brush constructor'), this.Lo = a) : (v && D.Da(a, Ba, Ba, "constructor:type"), this.ca = a, this.Lo = "black"); | |
var b = this.ca; | |
b === Gg ? (this.Mp = jc, this.Zo = uc) : this.Zo = b === Id ? this.Mp = mc : this.Mp = dc; | |
this.mx = 0; | |
this.dw = NaN; | |
this.qh = this.Uw = this.ph = null; | |
this.wz = | |
this.Mo = 0 | |
} | |
D.ka("Brush", Ba); | |
var Fg; | |
Ba.Solid = Fg = D.s(Ba, "Solid", 0); | |
var Gg; | |
Ba.Linear = Gg = D.s(Ba, "Linear", 1); | |
var Id; | |
Ba.Radial = Id = D.s(Ba, "Radial", 2); | |
var bo; | |
Ba.Pattern = bo = D.s(Ba, "Pattern", 4); | |
var co; | |
Ba.Lab = co = D.s(Ba, "Lab", 5); | |
var eo; | |
Ba.HSL = eo = D.s(Ba, "HSL", 6); | |
Ba.prototype.copy = function() { | |
var a = new Ba; | |
a.ca = this.ca; | |
a.Lo = this.Lo; | |
a.Mp = this.Mp.V(); | |
a.Zo = this.Zo.V(); | |
a.mx = this.mx; | |
a.dw = this.dw; | |
null !== this.ph && (a.ph = this.ph.copy()); | |
a.Uw = this.Uw; | |
return a | |
}; | |
f = Ba.prototype; | |
f.Oa = function() { | |
this.freeze(); | |
Object.freeze(this); | |
return this | |
}; | |
f.freeze = function() { | |
this.J = !0; | |
null !== this.ph && this.ph.freeze(); | |
return this | |
}; | |
f.Xa = function() { | |
Object.isFrozen(this) && D.k("cannot thaw constant: " + this); | |
this.J = !1; | |
null !== this.ph && this.ph.Xa(); | |
return this | |
}; | |
f.qc = function(a) { | |
a.Re === Ba ? this.type = a : D.ak(this, a) | |
}; | |
f.toString = function() { | |
var a = "Brush("; | |
if (this.type === Fg) a += this.color; | |
else if (a = this.type === Gg ? a + "Linear " : this.type === Id ? a + "Radial " : this.type === bo ? a + "Pattern " : a + "(unknown) ", a += this.start + " " + this.end, null !== this.Rk) | |
for (var b = this.Rk.j; b.next();) a += " " + b.key + ":" + b.value; | |
return a + ")" | |
}; | |
Ba.prototype.addColorStop = Ba.prototype.addColorStop = function(a, b) { | |
this.J && D.qa(this); | |
("number" !== typeof a || !isFinite(a) || 1 < a || 0 > a) && D.ua(a, "0 <= loc <= 1", Ba, "addColorStop:loc"); | |
D.h(b, "string", Ba, "addColorStop:color"); | |
v && !za(b) && D.k('Color "' + b + '" is not a valid color string for Brush.addColorStop'); | |
null === this.ph && (this.ph = new na("number", "string")); | |
this.ph.add(a, b); | |
this.ca === Fg && (this.type = Gg); | |
this.qh = null | |
}; | |
D.defineProperty(Ba, { | |
type: "type" | |
}, function() { | |
return this.ca | |
}, function(a) { | |
this.J && D.qa(this, a); | |
D.Da(a, Ba, Ba, "type"); | |
this.ca = a; | |
this.start.ee() && (a === Gg ? this.start = jc : a === Id && (this.start = mc)); | |
this.end.ee() && (a === Gg ? this.end = uc : a === Id && (this.end = mc)); | |
this.qh = null | |
}); | |
D.defineProperty(Ba, { | |
color: "color" | |
}, function() { | |
return this.Lo | |
}, function(a) { | |
this.J && D.qa(this, a); | |
v && !za(a) && D.k('Color "' + a + '" is not a valid color string for Brush.color'); | |
this.Lo = a; | |
this.qh = null | |
}); | |
D.defineProperty(Ba, { | |
start: "start" | |
}, function() { | |
return this.Mp | |
}, function(a) { | |
this.J && D.qa(this, a); | |
D.l(a, S, Ba, "start"); | |
this.Mp = a.V(); | |
this.qh = null | |
}); | |
D.defineProperty(Ba, { | |
end: "end" | |
}, function() { | |
return this.Zo | |
}, function(a) { | |
this.J && D.qa(this, a); | |
D.l(a, S, Ba, "end"); | |
this.Zo = a.V(); | |
this.qh = null | |
}); | |
D.defineProperty(Ba, { | |
sv: "startRadius" | |
}, function() { | |
return this.mx | |
}, function(a) { | |
this.J && D.qa(this, a); | |
D.p(a, Ba, "startRadius"); | |
0 > a && D.ua(a, ">= zero", Ba, "startRadius"); | |
this.mx = a; | |
this.qh = null | |
}); | |
D.defineProperty(Ba, { | |
ou: "endRadius" | |
}, function() { | |
return this.dw | |
}, function(a) { | |
this.J && D.qa(this, a); | |
D.p(a, Ba, "endRadius"); | |
0 > a && D.ua(a, ">= zero", Ba, "endRadius"); | |
this.dw = a; | |
this.qh = null | |
}); | |
D.defineProperty(Ba, { | |
Rk: "colorStops" | |
}, function() { | |
return this.ph | |
}, function(a) { | |
this.J && D.qa(this, a); | |
v && D.l(a, na, Ba, "colorStops"); | |
this.ph = a; | |
this.qh = null | |
}); | |
D.defineProperty(Ba, { | |
pattern: "pattern" | |
}, function() { | |
return this.Uw | |
}, function(a) { | |
this.J && D.qa(this, a); | |
this.Uw = a; | |
this.qh = null | |
}); | |
Ba.randomColor = function(a, b) { | |
void 0 === a && (a = 128); | |
v && (D.p(a, Ba, "randomColor:min"), (0 > a || 255 < a) && D.ua(a, "0 <= min <= 255", Ba, "randomColor:min")); | |
void 0 === b && (b = Math.max(a, 255)); | |
v && (D.p(b, Ba, "randomColor:max"), (b < a || 255 < b) && D.ua(b, "min <= max <= 255", Ba, "randomColor:max")); | |
var c = Math.abs(b - a), | |
d = Math.floor(a + Math.random() * c).toString(16), | |
e = Math.floor(a + Math.random() * c).toString(16), | |
c = Math.floor(a + Math.random() * c).toString(16); | |
2 > d.length && (d = "0" + d); | |
2 > e.length && (e = "0" + e); | |
2 > c.length && (c = "0" + c); | |
return "#" + | |
d + e + c | |
}; | |
var fo = (new ja(null)).Uk, | |
za; | |
Ba.isValidColor = za = function(a) { | |
if ("black" === a) return !0; | |
if ("" === a) return !1; | |
v && D.h(a, "string", Ba, "isValidColor"); | |
fo.fillStyle = "#000000"; | |
var b = fo.fillStyle; | |
fo.fillStyle = a; | |
if (fo.fillStyle !== b) return !0; | |
fo.fillStyle = "#FFFFFF"; | |
b = fo.fillStyle; | |
fo.fillStyle = a; | |
return fo.fillStyle !== b | |
}; | |
var ho = new ao, | |
io = new ao, | |
jo = new ao, | |
ko = new ao; | |
Ba.lighten = function(a) { | |
return lo(a) | |
}; | |
Ba.prototype.lightenBy = function(a, b) { | |
this.J && D.qa(this); | |
var c = void 0 === a || "number" !== typeof a ? .2 : a, | |
d = void 0 === b ? co : b; | |
if (this.type === Fg) mo(this.color), this.color = no(c, d); | |
else if ((this.type === Gg || this.type === Id) && null !== this.Rk) | |
for (var e = this.Rk.j; e.next();) mo(e.value), this.addColorStop(e.key, no(c, d)); | |
return this | |
}; | |
var lo; | |
Ba.lightenBy = lo = function(a, b, c) { | |
b = void 0 === b || "number" !== typeof b ? .2 : b; | |
c = void 0 === c ? co : c; | |
mo(a); | |
return no(b, c) | |
}; | |
Ba.darken = function(a) { | |
return oo(a) | |
}; | |
Ba.prototype.darkenBy = function(a, b) { | |
this.J && D.qa(this); | |
var c = void 0 === a || "number" !== typeof a ? .2 : a, | |
d = void 0 === b ? co : b; | |
if (this.type === Fg) mo(this.color), this.color = no(-c, d); | |
else if ((this.type === Gg || this.type === Id) && null !== this.Rk) | |
for (var e = this.Rk.j; e.next();) mo(e.value), this.addColorStop(e.key, no(-c, d)); | |
return this | |
}; | |
var oo; | |
Ba.darkenBy = oo = function(a, b, c) { | |
b = void 0 === b || "number" !== typeof b ? .2 : b; | |
c = void 0 === c ? co : c; | |
mo(a); | |
return no(-b, c) | |
}; | |
function no(a, b) { | |
switch (b) { | |
case co: | |
var c = 100 * po(ho.Rc), | |
d = 100 * po(ho.Rd), | |
e = 100 * po(ho.nd); | |
jo.Rc = .4124564 * c + .3575761 * d + .1804375 * e; | |
jo.Rd = .2126729 * c + .7151522 * d + .072175 * e; | |
jo.nd = .0193339 * c + .119192 * d + .9503041 * e; | |
jo.pg = ho.pg; | |
c = qo(jo.Rc / ro[0]); | |
d = qo(jo.Rd / ro[1]); | |
e = qo(jo.nd / ro[2]); | |
ko.Rc = 116 * d - 16; | |
ko.Rd = 500 * (c - d); | |
ko.nd = 200 * (d - e); | |
ko.pg = jo.pg; | |
ko.Rc = Math.min(100, Math.max(0, ko.Rc + 100 * a)); | |
c = (ko.Rc + 16) / 116; | |
d = c - ko.nd / 200; | |
jo.Rc = ro[0] * so(ko.Rd / 500 + c); | |
jo.Rd = ro[1] * (ko.Rc > to * uo ? Math.pow(c, 3) : ko.Rc / to); | |
jo.nd = ro[2] * so(d); | |
jo.pg = | |
ko.pg; | |
c = -.969266 * jo.Rc + 1.8760108 * jo.Rd + .041556 * jo.nd; | |
d = .0556434 * jo.Rc + -.2040259 * jo.Rd + 1.0572252 * jo.nd; | |
ho.Rc = 255 * vo((3.2404542 * jo.Rc + -1.5371385 * jo.Rd + -.4985314 * jo.nd) / 100); | |
ho.Rd = 255 * vo(c / 100); | |
ho.nd = 255 * vo(d / 100); | |
ho.pg = jo.pg; | |
ho.Rc = Math.round(ho.Rc); | |
255 < ho.Rc ? ho.Rc = 255 : 0 > ho.Rc && (ho.Rc = 0); | |
ho.Rd = Math.round(ho.Rd); | |
255 < ho.Rd ? ho.Rd = 255 : 0 > ho.Rd && (ho.Rd = 0); | |
ho.nd = Math.round(ho.nd); | |
255 < ho.nd ? ho.nd = 255 : 0 > ho.nd && (ho.nd = 0); | |
return "rgba(" + ho.Rc + ", " + ho.Rd + ", " + ho.nd + ", " + ho.pg + ")"; | |
case eo: | |
var e = ho.Rc / 255, | |
g = ho.Rd / | |
255, | |
h = ho.nd / 255, | |
k = Math.max(e, g, h), | |
d = Math.min(e, g, h), | |
l = k - d, | |
d = (k + d) / 2; | |
if (0 === l) c = e = 0; | |
else { | |
switch (k) { | |
case e: | |
c = (g - h) / l % 6; | |
break; | |
case g: | |
c = (h - e) / l + 2; | |
break; | |
case h: | |
c = (e - g) / l + 4 | |
} | |
c *= 60; | |
0 > c && (c += 360); | |
e = l / (1 - Math.abs(2 * d - 1)) | |
} | |
io.Rc = Math.round(c); | |
io.Rd = Math.round(100 * e); | |
io.nd = Math.round(100 * d); | |
io.pg = ho.pg; | |
io.nd = Math.min(100, Math.max(0, io.nd + 100 * a)); | |
return "hsla(" + io.Rc + ", " + io.Rd + "%, " + io.nd + "%, " + io.pg + ")"; | |
default: | |
return D.k("Unknown color space: " + b), "rgba(0, 0, 0, 1)" | |
} | |
} | |
function mo(a) { | |
fo.clearRect(0, 0, 1, 1); | |
fo.fillStyle = "#000000"; | |
var b = fo.fillStyle; | |
fo.fillStyle = a; | |
fo.fillStyle !== b ? (fo.fillRect(0, 0, 1, 1), a = fo.getImageData(0, 0, 1, 1).data, ho.Rc = a[0], ho.Rd = a[1], ho.nd = a[2], ho.pg = a[3] / 255) : (fo.fillStyle = "#FFFFFF", b = fo.fillStyle, fo.fillStyle = a, fo.fillStyle === b && v && D.k('Color "' + a + '" is not a valid color string for RGBA color conversion'), ho.Rc = 0, ho.Rd = 0, ho.nd = 0, ho.pg = 1) | |
} | |
function po(a) { | |
a /= 255; | |
return .04045 >= a ? a / 12.92 : Math.pow((a + .055) / 1.055, 2.4) | |
} | |
function vo(a) { | |
return .0031308 >= a ? 12.92 * a : 1.055 * Math.pow(a, 1 / 2.4) - .055 | |
} | |
var uo = 216 / 24389, | |
to = 24389 / 27, | |
ro = [95.047, 100, 108.883]; | |
function qo(a) { | |
return a > uo ? Math.pow(a, 1 / 3) : (to * a + 16) / 116 | |
} | |
function so(a) { | |
var b = a * a * a; | |
return b > uo ? b : (116 * a - 16) / to | |
} | |
function O() { | |
D.xc(this); | |
this.S = 4225027; | |
this.Lc = 1; | |
this.rj = null; | |
this.ac = ""; | |
this.lc = this.Mb = null; | |
this.sb = (new N(NaN, NaN)).freeze(); | |
this.$e = ie; | |
this.oi = Xd; | |
this.ni = ge; | |
this.Nc = new Ea; | |
this.Ni = new Ea; | |
this.ij = new Ea; | |
this.Db = this.Xo = 1; | |
this.wg = 0; | |
this.Qg = wo; | |
this.gn = Sd; | |
this.Fd = (new C(NaN, NaN, NaN, NaN)).freeze(); | |
this.cc = (new C(NaN, NaN, NaN, NaN)).freeze(); | |
this.fd = (new C(0, 0, NaN, NaN)).freeze(); | |
this.Z = this.it = this.jt = null; | |
this.Nm = this.ue = Vc; | |
this.vt = 0; | |
this.tj = 1; | |
this.wr = 0; | |
this.Si = 1; | |
this.Lt = null; | |
this.zt = -Infinity; | |
this.sn = | |
0; | |
this.tn = Kd; | |
this.un = vj; | |
this.Fr = ""; | |
this.Hc = this.ma = null; | |
this.Jo = -1; | |
this.yn = this.yg = this.Cl = this.Lp = null; | |
this.jA = Qj; | |
this.on = null | |
} | |
D.Di(O); | |
D.ka("GraphObject", O); | |
O.prototype.cloneProtected = function(a) { | |
a.S = this.S | 6144; | |
a.Lc = this.Lc; | |
a.ac = this.ac; | |
a.Mb = this.Mb; | |
a.lc = this.lc; | |
a.sb.assign(this.sb); | |
a.$e = this.$e.V(); | |
a.oi = this.oi.V(); | |
a.ni = this.ni.V(); | |
a.ij = this.ij.copy(); | |
a.Db = this.Db; | |
a.wg = this.wg; | |
a.Qg = this.Qg; | |
a.gn = this.gn.V(); | |
a.Fd.assign(this.Fd); | |
a.cc.assign(this.cc); | |
a.fd.assign(this.fd); | |
a.it = this.it; | |
null !== this.Z && (a.Z = this.Z.copy()); | |
a.ue = this.ue.V(); | |
a.Nm = this.Nm.V(); | |
a.vt = this.vt; | |
a.tj = this.tj; | |
a.wr = this.wr; | |
a.Si = this.Si; | |
a.Lt = this.Lt; | |
a.zt = this.zt; | |
a.sn = this.sn; | |
a.tn = this.tn.V(); | |
a.un = this.un; | |
a.Fr = this.Fr; | |
null !== this.ma && (a.ma = this.ma.copy()); | |
a.Hc = this.Hc; | |
a.Jo = this.Jo; | |
null !== this.Cl && (a.Cl = D.lm(this.Cl)); | |
null !== this.yg && (a.yg = this.yg.copy()); | |
a.yn = this.yn | |
}; | |
O.prototype.addCopyProperty = O.prototype.UH = function(a) { | |
var b = this.Cl; | |
if (D.isArray(b)) | |
for (var c = 0; c < b.length; c++) { | |
if (b[c] === a) return | |
} else this.Cl = b = []; | |
b.push(a) | |
}; | |
O.prototype.Ei = function(a) { | |
a.jt = null; | |
a.on = null; | |
a.K() | |
}; | |
O.prototype.clone = function() { | |
var a = new this.constructor; | |
this.cloneProtected(a); | |
if (null !== this.Cl) | |
for (var b = 0; b < this.Cl.length; b++) { | |
var c = this.Cl[b]; | |
a[c] = this[c] | |
} | |
return a | |
}; | |
O.prototype.copy = function() { | |
return this.clone() | |
}; | |
O.prototype.qc = function(a) { | |
a.Re === J ? 0 === a.name.indexOf("Orient") ? this.Uq = a : D.k("Unknown Link enum value for GraphObject.segmentOrientation property: " + a) : a.Re === O ? this.stretch = a : D.ak(this, a) | |
}; | |
O.prototype.toString = function() { | |
return D.yf(Object.getPrototypeOf(this)) + "#" + D.Od(this) | |
}; | |
var Zj; | |
O.None = Zj = D.s(O, "None", 0); | |
var wo; | |
O.Default = wo = D.s(O, "Default", 0); | |
var xo; | |
O.Vertical = xo = D.s(O, "Vertical", 4); | |
var yo; | |
O.Horizontal = yo = D.s(O, "Horizontal", 5); | |
var Ye; | |
O.Fill = Ye = D.s(O, "Fill", 3); | |
var bk; | |
O.Uniform = bk = D.s(O, "Uniform", 1); | |
var ck; | |
O.UniformToFill = ck = D.s(O, "UniformToFill", 2); | |
var zo; | |
O.FlipVertical = zo = D.s(O, "FlipVertical", 1); | |
var Ao; | |
O.FlipHorizontal = Ao = D.s(O, "FlipHorizontal", 2); | |
var Bo; | |
O.FlipBoth = Bo = D.s(O, "FlipBoth", 3); | |
function Co(a) { | |
null === a.ma && (a.ma = new Do) | |
} | |
O.prototype.be = function() { | |
if (null === this.Z) { | |
var a = new Eo; | |
a.pk = dc; | |
a.Nk = dc; | |
a.nk = 10; | |
a.Lk = 10; | |
a.mk = Fo; | |
a.Kk = Fo; | |
a.ok = 0; | |
a.Mk = 0; | |
this.Z = a | |
} | |
}; | |
function Go(a, b, c, d, e, g, h) { | |
var k = .001, | |
l = g.length; | |
a.moveTo(b, c); | |
d -= b; | |
k = e - c; | |
0 === d && (d = .001); | |
e = k / d; | |
for (var m = Math.sqrt(d * d + k * k), n = 0, p = !0, q = 0 === h ? !1 : !0; .1 <= m;) { | |
if (q) { | |
k = g[n++ % l]; | |
for (k -= h; 0 > k;) k += g[n++ % l], p = !p; | |
q = !1 | |
} else k = g[n++ % l]; | |
k > m && (k = m); | |
var r = Math.sqrt(k * k / (1 + e * e)); | |
0 > d && (r = -r); | |
b += r; | |
c += e * r; | |
p ? a.lineTo(b, c) : a.moveTo(b, c); | |
m -= k; | |
p = !p | |
} | |
} | |
O.prototype.raiseChangedEvent = O.prototype.od = function(a, b, c, d, e, g, h) { | |
var k = this.Y; | |
if (null !== k && (k.so(a, b, c, d, e, g, h), Ho(this) && c === this && a === fg && Io(this, k, b), c === k && 0 !== (k.S & 16777216) && null !== k.data)) | |
for (a = this.xa.o, c = a.length, d = 0; d < c; d++) e = a[d], e instanceof x && Xm(e, function(a) { | |
null !== a.data && 0 !== (a.S & 16777216) && a.Ob(b) | |
}) | |
}; | |
function Io(a, b, c) { | |
var d = a.rm(); | |
if (null !== d) | |
for (var e = a.Hc.j; e.next();) { | |
var g = e.value, | |
h = null; | |
if (null !== g.$q) { | |
h = sh(g, d, a); | |
if (null === h) continue; | |
g.Wy(a, h, c, null) | |
} else if (g.ly) { | |
var k = b.g; | |
null === k || k.Xe || g.Wy(a, k.da.gl, c, d) | |
} else { | |
var l = d.data; | |
if (null === l) continue; | |
k = b.g; | |
null === k || k.Xe || g.Wy(a, l, c, d) | |
} | |
h === a && (k = d.Wx(g.Hm), null !== k && g.uH(k, h, c)) | |
} | |
} | |
O.prototype.Wx = function(a) { | |
return this.Jo === a ? this : null | |
}; | |
O.prototype.raiseChanged = O.prototype.i = function(a, b, c) { | |
this.od(fg, a, this, b, c) | |
}; | |
function Jo(a, b, c, d, e) { | |
var g = a.Fd, | |
h = a.ij; | |
h.reset(); | |
Ko(a, h, b, c, d, e); | |
a.ij = h; | |
g.x = b; | |
g.y = c; | |
g.width = d; | |
g.height = e; | |
h.Nu() || h.rH(g) | |
} | |
function Lo(a, b, c, d) { | |
if (!1 === a.tg) return !1; | |
d.multiply(a.transform); | |
return c ? a.jg(b, d) : a.Kn(b, d) | |
} | |
O.prototype.HF = function(a, b, c) { | |
if (!1 === this.tg) return !1; | |
var d = this.Ga; | |
b = a.Kf(b); | |
var e = !1; | |
c && (e = lb(a.x, a.y, 0, 0, 0, d.height) < b || lb(a.x, a.y, 0, d.height, d.width, d.height) < b || lb(a.x, a.y, d.width, d.height, d.width, 0) < b || lb(a.x, a.y, d.width, 0, 0, 0) < b); | |
c || (e = lb(a.x, a.y, 0, 0, 0, d.height) < b && lb(a.x, a.y, 0, d.height, d.width, d.height) < b && lb(a.x, a.y, d.width, d.height, d.width, 0) < b && lb(a.x, a.y, d.width, 0, 0, 0) < b); | |
return e | |
}; | |
O.prototype.kh = function() { | |
return !0 | |
}; | |
O.prototype.containsPoint = O.prototype.Pa = function(a) { | |
v && D.l(a, N, O, "containsPoint:p"); | |
var b = D.P(); | |
b.assign(a); | |
this.transform.vb(b); | |
var c = this.aa; | |
if (!c.H()) return D.A(b), !1; | |
var d = this.g; | |
if (null !== d && d.vk) { | |
var e = d.Cu("extraTouchThreshold"), | |
g = d.Cu("extraTouchArea"), | |
h = g / 2, | |
k = this.Ga, | |
d = this.Jj() * d.scale, | |
l = 1 / d; | |
if (k.width * d < e && k.height * d < e) return a = Vb(c.x - h * l, c.y - h * l, c.width + g * l, c.height + g * l, b.x, b.y), D.A(b), a | |
} | |
if (this instanceof da || this instanceof z ? Vb(c.x - 5, c.y - 5, c.width + 10, c.height + 10, b.x, b.y) : c.Pa(b)) return e = !1, e = this.yg && !this.yg.Pa(b) ? !1 : null !== this.lc && c.Pa(b) ? !0 : null !== this.Mb && this.fd.Pa(a) ? !0 : this.Sk(a), D.A(b), e; | |
D.A(b); | |
return !1 | |
}; | |
O.prototype.Sk = function(a) { | |
var b = this.Ga; | |
return Vb(0, 0, b.width, b.height, a.x, a.y) | |
}; | |
O.prototype.containsRect = O.prototype.Tk = function(a) { | |
v && D.l(a, C, O, "containsRect:r"); | |
if (0 === this.angle) return this.aa.Tk(a); | |
var b = this.Ga, | |
b = D.vg(0, 0, b.width, b.height), | |
c = this.transform, | |
d = !1, | |
e = D.Fb(a.x, a.y); | |
b.Pa(c.Oh(e)) && (e.n(a.x, a.bottom), b.Pa(c.Oh(e)) && (e.n(a.right, a.bottom), b.Pa(c.Oh(e)) && (e.n(a.right, a.y), b.Pa(c.Oh(e)) && (d = !0)))); | |
D.A(e); | |
D.Lb(b); | |
return d | |
}; | |
O.prototype.containedInRect = O.prototype.Kn = function(a, b) { | |
v && D.l(a, C, O, "containedInRect:r"); | |
if (void 0 === b) return a.Tk(this.aa); | |
var c = this.Ga, | |
d = !1, | |
e = D.Fb(0, 0); | |
a.Pa(b.vb(e)) && (e.n(0, c.height), a.Pa(b.vb(e)) && (e.n(c.width, c.height), a.Pa(b.vb(e)) && (e.n(c.width, 0), a.Pa(b.vb(e)) && (d = !0)))); | |
D.A(e); | |
return d | |
}; | |
O.prototype.intersectsRect = O.prototype.jg = function(a, b) { | |
v && D.l(a, C, O, "intersectsRect:r"); | |
if (void 0 === b && (b = this.transform, 0 === this.angle)) return a.jg(this.aa); | |
var c = this.Ga, | |
d = b, | |
e = D.Fb(0, 0), | |
g = D.Fb(0, c.height), | |
h = D.Fb(c.width, c.height), | |
k = D.Fb(c.width, 0), | |
l = !1; | |
if (a.Pa(d.vb(e)) || a.Pa(d.vb(g)) || a.Pa(d.vb(h)) || a.Pa(d.vb(k))) l = !0; | |
else { | |
var c = D.vg(0, 0, c.width, c.height), | |
m = D.Fb(a.x, a.y); | |
c.Pa(d.Oh(m)) ? l = !0 : (m.n(a.x, a.bottom), c.Pa(d.Oh(m)) ? l = !0 : (m.n(a.right, a.bottom), c.Pa(d.Oh(m)) ? l = !0 : (m.n(a.right, a.y), c.Pa(d.Oh(m)) && | |
(l = !0)))); | |
D.A(m); | |
D.Lb(c); | |
!l && (Le(a, e, g) || Le(a, g, h) || Le(a, h, k) || Le(a, k, e)) && (l = !0) | |
} | |
D.A(e); | |
D.A(g); | |
D.A(h); | |
D.A(k); | |
return l | |
}; | |
O.prototype.getDocumentPoint = O.prototype.fb = function(a, b) { | |
void 0 === b && (b = new N); | |
if (a instanceof S) { | |
a.ee() && D.k("getDocumentPoint:s Spot must be specific: " + a.toString()); | |
var c = this.Ga; | |
b.n(a.x * c.width + a.offsetX, a.y * c.height + a.offsetY) | |
} else b.set(a); | |
this.Hh.vb(b); | |
return b | |
}; | |
O.prototype.getDocumentAngle = O.prototype.tm = function() { | |
var a; | |
a = this.Hh; | |
1 === a.m11 && 0 === a.m12 ? a = 0 : (a = 180 * Math.atan2(a.m12, a.m11) / Math.PI, 0 > a && (a += 360)); | |
return a | |
}; | |
O.prototype.getDocumentScale = O.prototype.Jj = function() { | |
if (0 !== (this.S & 4096) === !1) return this.Xo; | |
var a = this.Db; | |
return null !== this.R ? a * this.R.Jj() : a | |
}; | |
O.prototype.getLocalPoint = O.prototype.NF = function(a, b) { | |
void 0 === b && (b = new N); | |
b.assign(a); | |
this.Hh.Oh(b); | |
return b | |
}; | |
O.prototype.getNearestIntersectionPoint = O.prototype.OF = function(a, b, c) { | |
return this.Vn(a.x, a.y, b.x, b.y, c) | |
}; | |
f = O.prototype; | |
f.Vn = function(a, b, c, d, e) { | |
var g = this.transform, | |
h = 1 / (g.m11 * g.m22 - g.m12 * g.m21), | |
k = g.m22 * h, | |
l = -g.m12 * h, | |
m = -g.m21 * h, | |
n = g.m11 * h, | |
p = h * (g.m21 * g.dy - g.m22 * g.dx), | |
q = h * (g.m12 * g.dx - g.m11 * g.dy); | |
if (null !== this.hm) return g = this.aa, Je(g.left, g.top, g.right, g.bottom, a, b, c, d, e); | |
h = a * k + b * m + p; | |
a = a * l + b * n + q; | |
b = c * k + d * m + p; | |
c = c * l + d * n + q; | |
e.n(0, 0); | |
d = this.Ga; | |
c = Je(0, 0, d.width, d.height, h, a, b, c, e); | |
e.transform(g); | |
return c | |
}; | |
function Hk(a, b, c, d, e) { | |
if (!1 !== Nm(a)) { | |
var g = a.margin, | |
h = g.right + g.left, | |
g = g.top + g.bottom; | |
b = Math.max(b - h, 0); | |
c = Math.max(c - g, 0); | |
e = e || 0; | |
d = Math.max((d || 0) - h, 0); | |
e = Math.max(e - g, 0); | |
var h = a.angle, | |
g = 0, | |
g = a.Ea, | |
k = 0; | |
a instanceof z && (k = a.mb); | |
90 === h || 270 === h ? (b = isFinite(g.height) ? g.height + k : b, c = isFinite(g.width) ? g.width + k : c) : (b = isFinite(g.width) ? g.width + k : b, c = isFinite(g.height) ? g.height + k : c); | |
var g = d || 0, | |
k = e || 0, | |
l = a instanceof x; | |
switch (Mo(a, !0)) { | |
case Zj: | |
k = g = 0; | |
l && (c = b = Infinity); | |
break; | |
case Ye: | |
isFinite(b) && b > d && (g = b); | |
isFinite(c) && | |
c > e && (k = c); | |
break; | |
case yo: | |
isFinite(b) && b > d && (g = b); | |
k = 0; | |
l && (c = Infinity); | |
break; | |
case xo: | |
isFinite(c) && c > e && (k = c), g = 0, l && (b = Infinity) | |
} | |
var l = a.rf, | |
m = a.ah; | |
g > l.width && m.width < l.width && (g = l.width); | |
k > l.height && m.height < l.height && (k = l.height); | |
d = Math.max(g / a.scale, m.width); | |
e = Math.max(k / a.scale, m.height); | |
l.width < d && (d = Math.min(m.width, d)); | |
l.height < e && (e = Math.min(m.height, e)); | |
b = Math.min(l.width, b); | |
c = Math.min(l.height, c); | |
b = Math.max(d, b); | |
c = Math.max(e, c); | |
if (90 === h || 270 === h) g = b, b = c, c = g, g = d, d = e, e = g; | |
a.Fd.Xa(); | |
a.jo(b, c, | |
d, e); | |
a.Fd.freeze(); | |
a.Fd.H() || D.k("Non-real measuredBounds has been set. Object " + a + ", measuredBounds: " + a.Fd.toString()); | |
km(a, !1) | |
} | |
} | |
f.jo = function() {}; | |
f.Oj = function() { | |
return !1 | |
}; | |
f.rc = function(a, b, c, d, e) { | |
this.cj(); | |
var g = D.Sf(); | |
g.assign(this.cc); | |
this.cc.Xa(); | |
if (!1 === Om(this)) { | |
var h = this.cc; | |
h.x = a; | |
h.y = b; | |
h.width = c; | |
h.height = d | |
} else this.Cj(a, b, c, d); | |
this.cc.freeze(); | |
this.yg = void 0 === e ? null : e; | |
c = !1; | |
void 0 !== e ? c = !0 : null !== this.R && (e = this.R.fd, d = this.Fa, null !== this.hm && (d = this.cc), c = b + d.height, d = a + d.width, c = !(0 <= a + .05 && d <= e.width + .05 && 0 <= b + .05 && c <= e.height + .05), this instanceof pa && (a = this.fd, this.Dw > a.height || this.uf.Qe > a.width)) && (c = !0); | |
this.S = c ? this.S | 256 : this.S & -257; | |
this.cc.H() || | |
D.k("Non-real actualBounds has been set. Object " + this + ", actualBounds: " + this.cc.toString()); | |
this.zy(g, this.cc); | |
No(this, !1); | |
D.Lb(g) | |
}; | |
f.Cj = function() {}; | |
function Oo(a, b, c, d, e) { | |
var g = a.aa; | |
g.x = b; | |
g.y = c; | |
g.width = d; | |
g.height = e; | |
if (!a.Ea.H()) { | |
g = a.Fd; | |
c = a.margin; | |
b = c.right + c.left; | |
var h = c.top + c.bottom; | |
c = g.width + b; | |
g = g.height + h; | |
d += b; | |
e += h; | |
b = Mo(a, !0); | |
c === d && g === e && (b = Zj); | |
switch (b) { | |
case Zj: | |
if (c > d || g > e) km(a, !0), Hk(a, c > d ? d : c, g > e ? e : g); | |
break; | |
case Ye: | |
km(a, !0); | |
Hk(a, d, e, 0, 0); | |
break; | |
case yo: | |
km(a, !0); | |
Hk(a, d, g, 0, 0); | |
break; | |
case xo: | |
km(a, !0), Hk(a, c, e, 0, 0) | |
} | |
} | |
} | |
f.zy = function(a, b) { | |
var c = this.Y; | |
null !== c && null !== c.g && (c.Cm !== this && c.PG !== this && c.SB !== this || Po(c, !0), this.ra(), Db(a, b) || (c.dl(), this.$s(c))) | |
}; | |
f.$s = function(a) { | |
null !== this.yd && (Po(a, !0), a instanceof G && Qo(a, this)) | |
}; | |
D.defineProperty(O, { | |
wo: "shadowVisible" | |
}, function() { | |
return this.yn | |
}, function(a) { | |
var b = this.yn; | |
b !== a && (v && null !== a && D.h(a, "boolean", O, "shadowVisible"), this.yn = a, this.ra(), this.i("shadowVisible", b, a)) | |
}); | |
O.prototype.He = function(a, b) { | |
if (this.visible) { | |
var c = this.cc; | |
if (0 !== c.width && 0 !== c.height && !isNaN(c.x) && !isNaN(c.y)) { | |
var d = this.opacity, | |
e = 1; | |
if (1 !== d) { | |
if (0 === d) return; | |
e = a.globalAlpha; | |
a.globalAlpha = e * d | |
} | |
if (a instanceof qd) a: { | |
if (this.visible) { | |
var g = null, | |
h = a.ny; | |
if (this instanceof x && (this.type === Ro || this.type === So)) To(this, a, b); | |
else { | |
var k = this.cc; | |
if (0 !== k.width && 0 !== k.height && !isNaN(k.x) && !isNaN(k.y)) { | |
var l = this.transform, | |
m = this.R; | |
0 !== (this.S & 4096) === !0 && Uo(this); | |
var c = 0 !== (this.S & 256), | |
n = !1; | |
this instanceof | |
pa && (a.font = this.font); | |
if (c) { | |
n = m.kh() ? m.Ga : m.aa; | |
if (null !== this.yg) var p = this.yg, | |
q = p.x, | |
r = p.y, | |
s = p.width, | |
p = p.height; | |
else q = Math.max(k.x, n.x), r = Math.max(k.y, n.y), s = Math.min(k.right, n.right) - q, p = Math.min(k.bottom, n.bottom) - r; | |
if (q > k.width + k.x || k.x > n.width + n.x || r > k.height + k.y || k.y > n.height + n.y) break a; | |
n = !0; | |
sd(a, 1, 0, 0, 1, 0, 0); | |
a.save(); | |
a.beginPath(); | |
a.rect(q, r, s, p); | |
a.clip() | |
} | |
if (this.Oj()) { | |
var u = this; | |
if (!u.isVisible()) break a | |
} | |
a.Mh.bc = [1, 0, 0, 1, 0, 0]; | |
this instanceof pa && 1 < this.vB && sd(a, 1, 0, 0, 1, 0, 0); | |
q = !1; | |
this.Oj() && | |
this.el && b.Kj("drawShadows") && (r = this.xn, a.eC(r.x * b.scale * b.ud, r.y * b.scale * b.ud, u.Pg), a.xo(), a.shadowColor = u.wn); | |
u = !1; | |
this.Y && b.Kj("drawShadows") && (u = this.Y.el); | |
!0 === this.wo ? (a.xo(), !1 === q && u && (sd(a, 1, 0, 0, 1, 0, 0), a.kb(), q = !0)) : !1 === this.wo && a.Em(); | |
null !== this.lc && (Vo(this, a, this.lc, !0, !0), !1 === q && u && (sd(a, 1, 0, 0, 1, 0, 0), a.kb(), q = !0), this.lc instanceof Ba && this.lc.type === Id ? (a.beginPath(), a.rect(k.x, k.y, k.width, k.height), a.Xg(this.lc)) : a.fillRect(k.x, k.y, k.width, k.height)); | |
this instanceof x ? sd(a, l.m11, | |
l.m12, l.m21, l.m22, l.dx, l.dy) : a.Mh.bc = [l.m11, l.m12, l.m21, l.m22, l.dx, l.dy]; | |
null !== this.Mb && (!1 === q && u && (sd(a, 1, 0, 0, 1, 0, 0), a.kb(), q = !0), s = this.Ga, l = k = 0, r = s.width, s = s.height, p = 0, this instanceof z && (s = this.Za.ib, k = s.x, l = s.y, r = s.width, s = s.height, p = this.Rg), Vo(this, a, this.Mb, !0, !1), this.Mb instanceof Ba && this.Mb.type === Id ? (a.beginPath(), a.rect(k - p / 2, l - p / 2, r + p, s + p), a.Xg(this.Mb)) : a.fillRect(k - p / 2, l - p / 2, r + p, s + p)); | |
u && (null !== this.Mb || null !== this.lc || null !== m && 0 !== (m.S & 512) || null !== m && (m.type === Pl || m.type === | |
Xj) && m.Md() !== this) ? (Wo(this, !0), null === this.wo && a.Em()) : Wo(this, !1); | |
this.Xk(a, b); | |
u && 0 !== (this.S & 512) === !0 && a.xo(); | |
this.Oj() && u && a.Em(); | |
c && (a.restore(), n && a.zf.pop()); | |
this instanceof x && (g = a.zf.pop()); | |
!0 === q && a.zf.pop(); | |
this instanceof pa && 1 < this.vB && (g = a.zf.pop()); | |
null !== a.zF && (null === g && (h === a.ny ? (sd(a, 1, 0, 0, 1, 0, 0), g = a.zf.pop()) : g = a.ny), a.zF(this, g)) | |
} | |
} | |
} | |
} | |
else { | |
if (this instanceof x && (this.type === Ro || this.type === So)) { | |
To(this, a, b); | |
1 !== d && (a.globalAlpha = e); | |
return | |
} | |
this instanceof J && this.Wu(!1); | |
v && v.Dj && | |
v.DI(a, this); | |
g = this.transform; | |
h = this.R; | |
0 !== (this.S & 4096) === !0 && Uo(this); | |
m = 0 !== (this.S & 256); | |
a.eq && (m = !1); | |
this instanceof pa && (a.font = this.font); | |
if (m) { | |
v && v.yF && D.trace("clip" + this.toString()); | |
n = h.kh() ? h.Ga : h.aa; | |
null !== this.yg ? (q = this.yg, k = q.x, l = q.y, u = q.width, q = q.height) : (k = Math.max(c.x, n.x), l = Math.max(c.y, n.y), u = Math.min(c.right, n.right) - k, q = Math.min(c.bottom, n.bottom) - l); | |
if (k > c.width + c.x || c.x > n.width + n.x) { | |
1 !== d && (a.globalAlpha = e); | |
return | |
} | |
v && v.yF && v.FI(a, k, l, u, q); | |
a.save(); | |
a.beginPath(); | |
a.rect(k, l, u, | |
q); | |
a.clip() | |
} | |
if (this.Oj()) { | |
if (!this.isVisible()) { | |
1 !== d && (a.globalAlpha = e); | |
return | |
} | |
this.el && b.Kj("drawShadows") && (n = this.xn, a.eC(n.x * b.scale * b.ud, n.y * b.scale * b.ud, this.Pg), a.xo(), a.shadowColor = this.wn) | |
} | |
n = !1; | |
this.Y && b.Kj("drawShadows") && (n = this.Y.el); | |
!0 === this.wo ? a.xo() : !1 === this.wo && a.Em(); | |
null !== this.lc && (Vo(this, a, this.lc, !0, !0), this.lc instanceof Ba && this.lc.type === Id ? (a.beginPath(), a.rect(c.x, c.y, c.width, c.height), a.Xg(this.lc)) : a.fillRect(c.x, c.y, c.width, c.height)); | |
g.Nu() || a.transform(g.m11, g.m12, | |
g.m21, g.m22, g.dx, g.dy); | |
n && (null !== h && 0 !== (h.S & 512) || null !== h && (h.type === Pl || h.type === Xj) && h.Md() !== this) && null === this.wo && a.Em(); | |
null !== this.Mb && (u = this.Ga, k = c = 0, l = u.width, u = u.height, q = 0, this instanceof z && (u = this.Za.ib, c = u.x, k = u.y, l = u.width, u = u.height, q = this.Rg), Vo(this, a, this.Mb, !0, !1), this.Mb instanceof Ba && this.Mb.type === Id ? (a.beginPath(), a.rect(c - q / 2, k - q / 2, l + q, u + q), a.Xg(this.Mb)) : a.fillRect(c - q / 2, k - q / 2, l + q, u + q)); | |
v && v.Dj && v.EI(a, this); | |
n && (null !== this.Mb || null !== this.lc || null !== h && 0 !== (h.S & 512) || | |
null !== h && (h.type === Pl || h.type === Xj) && h.Md() !== this) ? (Wo(this, !0), null === this.wo && a.Em()) : Wo(this, !1); | |
this.Xk(a, b); | |
n && 0 !== (this.S & 512) === !0 && a.xo(); | |
this.Oj() && n && a.Em(); | |
m ? (a.restore(), this instanceof x ? a.De(!0) : a.De(!1)) : g.Nu() || (h = 1 / (g.m11 * g.m22 - g.m12 * g.m21), a.transform(g.m22 * h, -g.m12 * h, -g.m21 * h, g.m11 * h, h * (g.m21 * g.dy - g.m22 * g.dx), h * (g.m12 * g.dx - g.m11 * g.dy))) | |
} | |
1 !== d && (a.globalAlpha = e) | |
} | |
} | |
}; | |
function To(a, b, c) { | |
var d = a.cc; | |
0 === d.width || 0 === d.height || isNaN(d.x) || isNaN(d.y) || (null !== a.lc && (Vo(a, b, a.lc, !0, !0), a.lc instanceof Ba && a.lc.type === Id ? (b.beginPath(), b.rect(d.x, d.y, d.width, d.height), b.Xg(a.lc)) : b.fillRect(d.x, d.y, d.width, d.height)), null !== a.Mb && (Vo(a, b, a.Mb, !0, !1), a.Mb instanceof Ba && a.Mb.type === Id ? (b.beginPath(), b.rect(d.x, d.y, d.width, d.height), b.Xg(a.Mb)) : b.fillRect(d.x, d.y, d.width, d.height)), a.Xk(b, c)) | |
} | |
O.prototype.Xk = function() {}; | |
function Vo(a, b, c, d, e) { | |
if (null !== c) { | |
var g = 1, | |
h = 1; | |
if ("string" === typeof c) d ? b.fillStyle = c : b.strokeStyle = c; | |
else if (c.type === Fg) d ? b.fillStyle = c.color : b.strokeStyle = c.color; | |
else { | |
var k, h = a.Ga, | |
g = h.width, | |
h = h.height; | |
if (e) var l = a.aa, | |
g = l.width, | |
h = l.height; | |
var m = b instanceof Hd; | |
if (m && c.qh && (c.type === bo || c.Mo === g && c.wz === h)) k = c.qh; | |
else { | |
var n = l = 0, | |
p = 0, | |
q = 0, | |
r = 0, | |
s = 0, | |
s = r = 0; | |
e && (l = a.aa, g = l.width, h = l.height, r = l.x, s = l.y); | |
l = c.start.x * g + c.start.offsetX; | |
n = c.start.y * h + c.start.offsetY; | |
p = c.end.x * g + c.end.offsetX; | |
q = c.end.y * h + c.end.offsetY; | |
l += r; | |
p += r; | |
n += s; | |
q += s; | |
if (c.type === Gg) k = b.createLinearGradient(l, n, p, q); | |
else if (c.type === Id) s = isNaN(c.ou) ? Math.max(g, h) / 2 : c.ou, isNaN(c.sv) ? (r = 0, s = Math.max(g, h) / 2) : r = c.sv, k = b.createRadialGradient(l, n, r, p, q, s); | |
else if (c.type === bo) try { | |
k = b.createPattern(c.pattern, "repeat") | |
} catch (u) { | |
k = null | |
} else D.kc(c.type, "Brush type"); | |
if (c.type !== bo && (e = c.Rk, null !== e)) | |
for (e = e.j; e.next();) k.addColorStop(e.key, e.value); | |
if (m && (c.qh = k, null !== k && (c.Mo = g, c.wz = h), null === k && c.type === bo && -1 !== c.Mo)) { | |
c.Mo = -1; | |
var t = a.g; | |
null !== t && | |
-1 === c.Mo && D.setTimeout(function() { | |
t.to() | |
}, 600) | |
} | |
} | |
d ? b.fillStyle = k : b.strokeStyle = k | |
} | |
} | |
} | |
O.prototype.isContainedBy = O.prototype.ym = function(a) { | |
if (a instanceof x) a: { | |
if (this !== a && null !== a) | |
for (var b = this.R; null !== b;) { | |
if (b === a) { | |
a = !0; | |
break a | |
} | |
b = b.R | |
} | |
a = !1 | |
} | |
else a = !1; | |
return a | |
}; | |
O.prototype.isVisibleObject = O.prototype.Sj = function() { | |
if (!this.visible) return !1; | |
var a = this.R; | |
return null !== a ? a.Sj() : !0 | |
}; | |
O.prototype.isEnabledObject = O.prototype.Ju = function() { | |
for (var a = this instanceof x ? this : this.R; null !== a && a.isEnabled;) a = a.R; | |
return null === a | |
}; | |
D.defineProperty(O, { | |
AF: "enabledChanged" | |
}, function() { | |
return null !== this.ma ? this.ma.Yr : null | |
}, function(a) { | |
Co(this); | |
var b = this.ma.Yr; | |
b !== a && (null !== a && D.h(a, "function", O, "enabledChanged"), this.ma.Yr = a, this.i("enabledChanged", b, a)) | |
}); | |
function Uo(a) { | |
if (0 !== (a.S & 2048) === !0) { | |
var b = a.Nc; | |
b.reset(); | |
if (!a.cc.H() || !a.Fd.H()) { | |
Xo(a, !1); | |
return | |
} | |
b.translate(a.cc.x, a.cc.y); | |
b.translate(-a.Fa.x, -a.Fa.y); | |
var c = a.Ga; | |
Ko(a, b, c.x, c.y, c.width, c.height); | |
Xo(a, !1); | |
Yo(a, !0) | |
} | |
0 !== (a.S & 4096) === !0 && (b = a.R, null === b ? (a.Ni.set(a.Nc), a.Xo = a.scale, Yo(a, !1)) : null !== b.Hh && (c = a.Ni, c.reset(), b.kh() ? c.multiply(b.Ni) : null !== b.R && c.multiply(b.R.Ni), c.multiply(a.Nc), a.Xo = a.scale * b.Xo, Yo(a, !1))) | |
} | |
function Ko(a, b, c, d, e, g) { | |
1 !== a.scale && b.scale(a.scale); | |
if (0 !== a.angle) { | |
var h = mc; | |
a.Oj() && a.Of.Xc() && (h = a.Of); | |
var k = D.P(); | |
if (a instanceof F && a.Df !== a) | |
for (c = a.Df, d = c.Ga, k.pv(d.x, d.y, d.width, d.height, h), c.ij.vb(k), k.offset(-c.Fa.x, -c.Fa.y), h = c.R; null !== h && h !== a;) h.ij.vb(k), k.offset(-h.Fa.x, -h.Fa.y), h = h.R; | |
else k.pv(c, d, e, g, h); | |
b.rotate(a.angle, k.x, k.y); | |
D.A(k) | |
} | |
} | |
f = O.prototype; | |
f.K = function(a) { | |
void 0 === a && (a = !1); | |
if (!0 !== Nm(this)) { | |
km(this, !0); | |
No(this, !0); | |
var b = this.R; | |
null === b || a || b.K() | |
} | |
}; | |
f.xq = function() { | |
!0 !== Nm(this) && (km(this, !0), No(this, !0)) | |
}; | |
function Zo(a) { | |
if (!1 === Om(a)) { | |
var b = a.R; | |
null !== b ? b.K() : a.Oj() && (b = a.g, null !== b && (b.Gg.add(a), a instanceof G && a.kg(), b.Le())); | |
No(a, !0) | |
} | |
} | |
f.cj = function() { | |
0 !== (this.S & 2048) === !1 && (Xo(this, !0), Yo(this, !0)) | |
}; | |
f.lB = function() { | |
Yo(this, !0) | |
}; | |
f.ra = function() { | |
var a = this.Y; | |
null !== a && a.ra() | |
}; | |
function Mo(a, b) { | |
var c = a.stretch, | |
d = a.R; | |
if (null !== d && d.ca === fa) return $o(a, d.pe(a.Tb), d.oe(a.column), b); | |
if (null !== d && d.ca === Pl && d.Md() === a) return ap(a, Ye, b); | |
if (c === wo) { | |
if (null !== d) { | |
if (d.ca === Xj && d.Md() === a) return ap(a, Ye, b); | |
c = d.me; | |
return c === wo ? ap(a, Zj, b) : ap(a, c, b) | |
} | |
return ap(a, Zj, b) | |
} | |
return ap(a, c, b) | |
} | |
function $o(a, b, c, d) { | |
var e = a.stretch; | |
if (e !== wo) return ap(a, e, d); | |
var g = e = null; | |
switch (b.stretch) { | |
case xo: | |
g = !0; | |
break; | |
case Ye: | |
g = !0 | |
} | |
switch (c.stretch) { | |
case yo: | |
e = !0; | |
break; | |
case Ye: | |
e = !0 | |
} | |
b = a.R.me; | |
null === e && (e = b === yo || b === Ye); | |
null === g && (g = b === xo || b === Ye); | |
return !0 === e && !0 === g ? ap(a, Ye, d) : !0 === e ? ap(a, yo, d) : !0 === g ? ap(a, xo, d) : ap(a, Zj, d) | |
} | |
function ap(a, b, c) { | |
if (c) return b; | |
if (b === Zj) return Zj; | |
c = a.Ea; | |
if (c.H()) return Zj; | |
a = a.angle; | |
if (!isNaN(c.width)) | |
if (90 !== a && 270 !== a) { | |
if (b === yo) return Zj; | |
if (b === Ye) return xo | |
} else { | |
if (b === xo) return Zj; | |
if (b === Ye) return yo | |
} | |
if (!isNaN(c.height)) | |
if (90 !== a && 270 !== a) { | |
if (b === xo) return Zj; | |
if (b === Ye) return yo | |
} else { | |
if (b === yo) return Zj; | |
if (b === Ye) return xo | |
} | |
return b | |
} | |
D.defineProperty(O, { | |
Uq: "segmentOrientation" | |
}, function() { | |
return this.un | |
}, function(a) { | |
var b = this.un; | |
b !== a && (v && D.Da(a, J, O, "segmentOrientation"), this.un = a, this.K(), this.i("segmentOrientation", b, a), a === vj && (this.angle = 0)) | |
}); | |
D.defineProperty(O, { | |
We: "segmentIndex" | |
}, function() { | |
return this.zt | |
}, function(a) { | |
v && D.h(a, "number", O, "segmentIndex"); | |
a = Math.round(a); | |
var b = this.zt; | |
b !== a && (this.zt = a, this.K(), this.i("segmentIndex", b, a)) | |
}); | |
D.defineProperty(O, { | |
VB: "segmentFraction" | |
}, function() { | |
return this.sn | |
}, function(a) { | |
v && D.h(a, "number", O, "segmentFraction"); | |
isNaN(a) ? a = 0 : 0 > a ? a = 0 : 1 < a && (a = 1); | |
var b = this.sn; | |
b !== a && (this.sn = a, this.K(), this.i("segmentFraction", b, a)) | |
}); | |
D.defineProperty(O, { | |
WB: "segmentOffset" | |
}, function() { | |
return this.tn | |
}, function(a) { | |
var b = this.tn; | |
b.O(a) || (v && D.l(a, N, O, "segmentOffset"), this.tn = a = a.V(), this.K(), this.i("segmentOffset", b, a)) | |
}); | |
D.defineProperty(O, { | |
stretch: "stretch" | |
}, function() { | |
return this.Qg | |
}, function(a) { | |
var b = this.Qg; | |
b !== a && (v && D.Da(a, O, O, "stretch"), this.Qg = a, this.K(), this.i("stretch", b, a)) | |
}); | |
D.defineProperty(O, { | |
name: "name" | |
}, function() { | |
return this.ac | |
}, function(a) { | |
var b = this.ac; | |
b !== a && (v && D.h(a, "string", O, "name"), this.ac = a, null !== this.Y && (this.Y.Tl = null), this.i("name", b, a)) | |
}); | |
D.defineProperty(O, { | |
opacity: "opacity" | |
}, function() { | |
return this.Lc | |
}, function(a) { | |
var b = this.Lc; | |
b !== a && (D.h(a, "number", O, "opacity"), (0 > a || 1 < a) && D.ua(a, "0 <= value <= 1", O, "opacity"), this.Lc = a, this.i("opacity", b, a), a = this.g, b = this.Y, null !== a && null !== b && a.ra(xl(b, b.aa))) | |
}); | |
D.defineProperty(O, { | |
visible: "visible" | |
}, function() { | |
return 0 !== (this.S & 1) | |
}, function(a) { | |
var b = 0 !== (this.S & 1); | |
b !== a && (v && D.h(a, "boolean", O, "visible"), this.S ^= 1, this.i("visible", b, a), b = this.R, null !== b ? b.K() : this.Oj() && this.Qd(a), this.ra(), bp(this)) | |
}); | |
D.defineProperty(O, { | |
tg: "pickable" | |
}, function() { | |
return 0 !== (this.S & 2) | |
}, function(a) { | |
var b = 0 !== (this.S & 2); | |
b !== a && (v && D.h(a, "boolean", O, "pickable"), this.S ^= 2, this.i("pickable", b, a)) | |
}); | |
D.defineProperty(O, { | |
NI: "fromLinkableDuplicates" | |
}, function() { | |
return 0 !== (this.S & 4) | |
}, function(a) { | |
var b = 0 !== (this.S & 4); | |
b !== a && (v && D.h(a, "boolean", O, "fromLinkableDuplicates"), this.S ^= 4, this.i("fromLinkableDuplicates", b, a)) | |
}); | |
D.defineProperty(O, { | |
OI: "fromLinkableSelfNode" | |
}, function() { | |
return 0 !== (this.S & 8) | |
}, function(a) { | |
var b = 0 !== (this.S & 8); | |
b !== a && (v && D.h(a, "boolean", O, "fromLinkableSelfNode"), this.S ^= 8, this.i("fromLinkableSelfNode", b, a)) | |
}); | |
D.defineProperty(O, { | |
BK: "toLinkableDuplicates" | |
}, function() { | |
return 0 !== (this.S & 16) | |
}, function(a) { | |
var b = 0 !== (this.S & 16); | |
b !== a && (v && D.h(a, "boolean", O, "toLinkableDuplicates"), this.S ^= 16, this.i("toLinkableDuplicates", b, a)) | |
}); | |
D.defineProperty(O, { | |
CK: "toLinkableSelfNode" | |
}, function() { | |
return 0 !== (this.S & 32) | |
}, function(a) { | |
var b = 0 !== (this.S & 32); | |
b !== a && (v && D.h(a, "boolean", O, "toLinkableSelfNode"), this.S ^= 32, this.i("toLinkableSelfNode", b, a)) | |
}); | |
D.defineProperty(O, { | |
Ve: "isPanelMain" | |
}, function() { | |
return 0 !== (this.S & 64) | |
}, function(a) { | |
var b = 0 !== (this.S & 64); | |
b !== a && (v && D.h(a, "boolean", O, "isPanelMain"), this.S ^= 64, this.K(), this.i("isPanelMain", b, a)) | |
}); | |
D.defineProperty(O, { | |
Hu: "isActionable" | |
}, function() { | |
return 0 !== (this.S & 128) | |
}, function(a) { | |
var b = 0 !== (this.S & 128); | |
b !== a && (v && D.h(a, "boolean", O, "isActionable"), this.S ^= 128, this.i("isActionable", b, a)) | |
}); | |
D.defineProperty(O, { | |
hm: "areaBackground" | |
}, function() { | |
return this.lc | |
}, function(a) { | |
var b = this.lc; | |
b !== a && (v && null !== a && D.hu(a, "GraphObject.areaBackground"), a instanceof Ba && a.freeze(), this.lc = a, this.ra(), this.i("areaBackground", b, a)) | |
}); | |
D.defineProperty(O, { | |
background: "background" | |
}, function() { | |
return this.Mb | |
}, function(a) { | |
var b = this.Mb; | |
b !== a && (v && null !== a && D.hu(a, "GraphObject.background"), a instanceof Ba && a.freeze(), this.Mb = a, this.ra(), this.i("background", b, a)) | |
}); | |
function Wo(a, b) { | |
a.S = b ? a.S | 512 : a.S & -513 | |
} | |
function Ho(a) { | |
return 0 !== (a.S & 1024) | |
} | |
function cp(a, b) { | |
a.S = b ? a.S | 1024 : a.S & -1025 | |
} | |
function Xo(a, b) { | |
a.S = b ? a.S | 2048 : a.S & -2049 | |
} | |
function Yo(a, b) { | |
a.S = b ? a.S | 4096 : a.S & -4097 | |
} | |
function Nm(a) { | |
return 0 !== (a.S & 8192) | |
} | |
function km(a, b) { | |
a.S = b ? a.S | 8192 : a.S & -8193 | |
} | |
function Om(a) { | |
return 0 !== (a.S & 16384) | |
} | |
function No(a, b) { | |
a.S = b ? a.S | 16384 : a.S & -16385 | |
} | |
D.w(O, { | |
Y: "part" | |
}, function() { | |
if (this.Oj()) return this; | |
if (null !== this.on) return this.on; | |
var a; | |
for (a = this.R; a;) { | |
if (a instanceof F) return this.on = a; | |
a = a.R | |
} | |
return null | |
}); | |
D.w(O, { | |
R: "panel" | |
}, function() { | |
return this.rj | |
}); | |
O.prototype.Dm = function(a) { | |
this.rj = a | |
}; | |
D.w(O, { | |
layer: "layer" | |
}, function() { | |
var a = this.Y; | |
return null !== a ? a.layer : null | |
}, { | |
configurable: !0 | |
}); | |
D.w(O, { | |
g: "diagram" | |
}, function() { | |
var a = this.Y; | |
return null !== a ? a.g : null | |
}, { | |
configurable: !0 | |
}); | |
D.defineProperty(O, { | |
position: "position" | |
}, function() { | |
return this.sb | |
}, function(a) { | |
v && D.l(a, N, O, "position"); | |
var b = a.x, | |
c = a.y, | |
d = this.sb, | |
e = d.x, | |
g = d.y; | |
(e === b || isNaN(e) && isNaN(b)) && (g === c || isNaN(g) && isNaN(c)) ? this.bC(): (a = a.V(), this.aC(a, d) && this.i("position", d, a)) | |
}); | |
O.prototype.bC = function() {}; | |
O.prototype.aC = function(a) { | |
this.sb = a; | |
Zo(this); | |
this.cj(); | |
return !0 | |
}; | |
O.prototype.Uy = function(a, b) { | |
this.sb.n(a, b); | |
this.cj() | |
}; | |
D.w(O, { | |
aa: "actualBounds" | |
}, function() { | |
return this.cc | |
}); | |
D.defineProperty(O, { | |
scale: "scale" | |
}, function() { | |
return this.Db | |
}, function(a) { | |
var b = this.Db; | |
b !== a && (v && D.p(a, O, "scale"), 0 >= a && D.k("GraphObject.scale for " + this + " must be greater than zero, not: " + a), this.Db = a, this.cj(), this.K(), this.i("scale", b, a)) | |
}); | |
D.defineProperty(O, { | |
angle: "angle" | |
}, function() { | |
return this.wg | |
}, function(a) { | |
var b = this.wg; | |
b !== a && (v && D.p(a, O, "angle"), a %= 360, 0 > a && (a += 360), b !== a && (this.wg = a, bp(this), this.K(), this.cj(), this.i("angle", b, a))) | |
}); | |
D.defineProperty(O, { | |
Ea: "desiredSize" | |
}, function() { | |
return this.$e | |
}, function(a) { | |
v && D.l(a, Ca, O, "desiredSize"); | |
var b = a.width, | |
c = a.height, | |
d = this.$e, | |
e = d.width, | |
g = d.height; | |
(e === b || isNaN(e) && isNaN(b)) && (g === c || isNaN(g) && isNaN(c)) || (this.$e = a = a.V(), this.K(), this instanceof z && this.Ue(), this.i("desiredSize", d, a), Ho(this) && (a = this.Y, null !== a && (Io(this, a, "width"), Io(this, a, "height")))) | |
}); | |
D.defineProperty(O, { | |
width: "width" | |
}, function() { | |
return this.$e.width | |
}, function(a) { | |
var b = this.$e.width; | |
b === a || isNaN(b) && isNaN(a) || (v && D.h(a, "number", O, "width"), b = this.$e, this.$e = a = (new Ca(a, this.$e.height)).freeze(), this.K(), this instanceof z && this.Ue(), this.i("desiredSize", b, a), Ho(this) && (a = this.Y, null !== a && Io(this, a, "width"))) | |
}); | |
D.defineProperty(O, { | |
height: "height" | |
}, function() { | |
return this.$e.height | |
}, function(a) { | |
var b = this.$e.height; | |
b === a || isNaN(b) && isNaN(a) || (v && D.h(a, "number", O, "height"), b = this.$e, this.$e = a = (new Ca(this.$e.width, a)).freeze(), this.K(), this instanceof z && this.Ue(), this.i("desiredSize", b, a), Ho(this) && (a = this.Y, null !== a && Io(this, a, "height"))) | |
}); | |
D.defineProperty(O, { | |
ah: "minSize" | |
}, function() { | |
return this.oi | |
}, function(a) { | |
var b = this.oi; | |
b.O(a) || (v && D.l(a, Ca, O, "minSize"), a = a.copy(), isNaN(a.width) && (a.width = 0), isNaN(a.height) && (a.height = 0), a.freeze(), this.oi = a, this.K(), this.i("minSize", b, a)) | |
}); | |
D.defineProperty(O, { | |
rf: "maxSize" | |
}, function() { | |
return this.ni | |
}, function(a) { | |
var b = this.ni; | |
b.O(a) || (v && D.l(a, Ca, O, "maxSize"), a = a.copy(), isNaN(a.width) && (a.width = Infinity), isNaN(a.height) && (a.height = Infinity), a.freeze(), this.ni = a, this.K(), this.i("maxSize", b, a)) | |
}); | |
D.w(O, { | |
Fa: "measuredBounds" | |
}, function() { | |
return this.Fd | |
}); | |
D.w(O, { | |
Ga: "naturalBounds" | |
}, function() { | |
return this.fd | |
}, { | |
configurable: !0 | |
}); | |
D.defineProperty(O, { | |
margin: "margin" | |
}, function() { | |
return this.gn | |
}, function(a) { | |
"number" === typeof a ? a = new Lb(a) : v && D.l(a, Lb, O, "margin"); | |
var b = this.gn; | |
b.O(a) || (this.gn = a = a.V(), this.K(), this.i("margin", b, a)) | |
}); | |
D.w(O, { | |
transform: null | |
}, function() { | |
0 !== (this.S & 2048) === !0 && Uo(this); | |
return this.Nc | |
}); | |
D.w(O, { | |
Hh: null | |
}, function() { | |
0 !== (this.S & 4096) === !0 && Uo(this); | |
return this.Ni | |
}); | |
D.defineProperty(O, { | |
alignment: "alignment" | |
}, function() { | |
return this.ue | |
}, function(a) { | |
var b = this.ue; | |
b.O(a) || (v && D.l(a, S, O, "alignment"), a.ee() && !a.ld() && D.k("GraphObject.alignment for " + this + " must be a real Spot or Spot.Default, not: " + a), this.ue = a = a.V(), Zo(this), this.i("alignment", b, a)) | |
}); | |
D.defineProperty(O, { | |
column: "column" | |
}, function() { | |
return this.wr | |
}, function(a) { | |
v && D.p(a, O, "column"); | |
a = Math.round(a); | |
var b = this.wr; | |
b !== a && (0 > a && D.ua(a, ">= 0", O, "column"), this.wr = a, this.K(), this.i("column", b, a)) | |
}); | |
D.defineProperty(O, { | |
iI: "columnSpan" | |
}, function() { | |
return this.Si | |
}, function(a) { | |
v && D.h(a, "number", O, "columnSpan"); | |
a = Math.round(a); | |
var b = this.Si; | |
b !== a && (1 > a && D.ua(a, ">= 1", O, "columnSpan"), this.Si = a, this.K(), this.i("columnSpan", b, a)) | |
}); | |
D.defineProperty(O, { | |
Tb: "row" | |
}, function() { | |
return this.vt | |
}, function(a) { | |
v && D.p(a, O, "row"); | |
a = Math.round(a); | |
var b = this.vt; | |
b !== a && (0 > a && D.ua(a, ">= 0", O, "row"), this.vt = a, this.K(), this.i("row", b, a)) | |
}); | |
D.defineProperty(O, { | |
rowSpan: "rowSpan" | |
}, function() { | |
return this.tj | |
}, function(a) { | |
v && D.h(a, "number", O, "rowSpan"); | |
a = Math.round(a); | |
var b = this.tj; | |
b !== a && (1 > a && D.ua(a, ">= 1", O, "rowSpan"), this.tj = a, this.K(), this.i("rowSpan", b, a)) | |
}); | |
D.defineProperty(O, { | |
Vy: "spanAllocation" | |
}, function() { | |
return this.Lt | |
}, function(a) { | |
var b = this.Lt; | |
b !== a && (null !== a && D.h(a, "function", O, "spanAllocation"), this.Lt = a, this.K(), this.i("spanAllocation", b, a)) | |
}); | |
D.defineProperty(O, { | |
Gh: "alignmentFocus" | |
}, function() { | |
return this.Nm | |
}, function(a) { | |
var b = this.Nm; | |
b.O(a) || (v && D.l(a, S, O, "alignmentFocus"), !a.ee() || a.ld() || a.O(dc) && this instanceof G || D.k("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: " + a), this.Nm = a = a.V(), this.K(), this.i("alignmentFocus", b, a)) | |
}); | |
D.defineProperty(O, { | |
yd: "portId" | |
}, function() { | |
return this.it | |
}, function(a) { | |
var b = this.it; | |
if (b !== a) { | |
v && null !== a && D.h(a, "string", O, "portId"); | |
var c = this.Y; | |
null === c || c instanceof G || (D.k("Cannot set portID on a Link: " + a), c = null); | |
null !== b && null !== c && dp(c, this); | |
this.it = a; | |
if (null !== a && c) { | |
c.cl = !0; | |
null === c.Ae && ep(c); | |
var d = this.yd; | |
null !== d && c.Ae.add(d, this) | |
} | |
this.i("portId", b, a) | |
} | |
}); | |
function fp(a) { | |
var b = a.Y; | |
if (b instanceof G && (null !== a.yd || a === b.port)) { | |
var c = b.g; | |
null === c || c.na.ub || Qo(b, a) | |
} | |
} | |
function bp(a) { | |
var b = a.g; | |
null === b || b.na.ub || (a instanceof x ? a instanceof G ? a.kg() : gp(a, a, function(a) { | |
fp(a) | |
}) : fp(a)) | |
} | |
D.defineProperty(O, { | |
Hb: "toSpot" | |
}, function() { | |
return null !== this.Z ? this.Z.Nk : dc | |
}, function(a) { | |
this.be(); | |
var b = this.Z.Nk; | |
b.O(a) || (v && D.l(a, S, O, "toSpot"), a = a.V(), this.Z.Nk = a, this.i("toSpot", b, a), fp(this)) | |
}); | |
D.defineProperty(O, { | |
Jm: "toEndSegmentLength" | |
}, function() { | |
return null !== this.Z ? this.Z.Lk : 10 | |
}, function(a) { | |
this.be(); | |
var b = this.Z.Lk; | |
b !== a && (v && D.h(a, "number", O, "toEndSegmentLength"), 0 > a && D.ua(a, ">= 0", O, "toEndSegmentLength"), this.Z.Lk = a, this.i("toEndSegmentLength", b, a), fp(this)) | |
}); | |
D.defineProperty(O, { | |
uv: "toEndSegmentDirection" | |
}, function() { | |
return null !== this.Z ? this.Z.Kk : Fo | |
}, function(a) { | |
this.be(); | |
var b = this.Z.Kk; | |
b !== a && (D.Qn("GraphObject.toEndSegmentDirection", "2.0"), v && D.Da(a, G, O, "toEndSegmentDirection"), this.Z.Kk = a, this.i("toEndSegmentDirection", b, a), fp(this)) | |
}); | |
D.defineProperty(O, { | |
vv: "toShortLength" | |
}, function() { | |
return null !== this.Z ? this.Z.Mk : 0 | |
}, function(a) { | |
this.be(); | |
var b = this.Z.Mk; | |
b !== a && (v && D.h(a, "number", O, "toShortLength"), this.Z.Mk = a, this.i("toShortLength", b, a), fp(this)) | |
}); | |
D.defineProperty(O, { | |
lH: "toLinkable" | |
}, function() { | |
return null !== this.Z ? this.Z.St : null | |
}, function(a) { | |
this.be(); | |
var b = this.Z.St; | |
b !== a && (v && null !== a && D.h(a, "boolean", O, "toLinkable"), this.Z.St = a, this.i("toLinkable", b, a)) | |
}); | |
D.defineProperty(O, { | |
DK: "toMaxLinks" | |
}, function() { | |
return null !== this.Z ? this.Z.Tt : Infinity | |
}, function(a) { | |
this.be(); | |
var b = this.Z.Tt; | |
b !== a && (v && D.h(a, "number", O, "toMaxLinks"), 0 > a && D.ua(a, ">= 0", O, "toMaxLinks"), this.Z.Tt = a, this.i("toMaxLinks", b, a)) | |
}); | |
D.defineProperty(O, { | |
Gb: "fromSpot" | |
}, function() { | |
return null !== this.Z ? this.Z.pk : dc | |
}, function(a) { | |
this.be(); | |
var b = this.Z.pk; | |
b.O(a) || (v && D.l(a, S, O, "fromSpot"), a = a.V(), this.Z.pk = a, this.i("fromSpot", b, a), fp(this)) | |
}); | |
D.defineProperty(O, { | |
sm: "fromEndSegmentLength" | |
}, function() { | |
return null !== this.Z ? this.Z.nk : 10 | |
}, function(a) { | |
this.be(); | |
var b = this.Z.nk; | |
b !== a && (v && D.h(a, "number", O, "fromEndSegmentLength"), 0 > a && D.ua(a, ">= 0", O, "fromEndSegmentLength"), this.Z.nk = a, this.i("fromEndSegmentLength", b, a), fp(this)) | |
}); | |
D.defineProperty(O, { | |
zu: "fromEndSegmentDirection" | |
}, function() { | |
return null !== this.Z ? this.Z.mk : Fo | |
}, function(a) { | |
this.be(); | |
var b = this.Z.mk; | |
b !== a && (D.Qn("GraphObject.fromEndSegmentDirection", "2.0"), v && D.Da(a, G, O, "fromEndSegmentDirection"), this.Z.mk = a, this.i("fromEndSegmentDirection", b, a), fp(this)) | |
}); | |
D.defineProperty(O, { | |
Au: "fromShortLength" | |
}, function() { | |
return null !== this.Z ? this.Z.ok : 0 | |
}, function(a) { | |
this.be(); | |
var b = this.Z.ok; | |
b !== a && (v && D.h(a, "number", O, "fromShortLength"), this.Z.ok = a, this.i("fromShortLength", b, a), fp(this)) | |
}); | |
D.defineProperty(O, { | |
KF: "fromLinkable" | |
}, function() { | |
return null !== this.Z ? this.Z.as : null | |
}, function(a) { | |
this.be(); | |
var b = this.Z.as; | |
b !== a && (v && null !== a && D.h(a, "boolean", O, "fromLinkable"), this.Z.as = a, this.i("fromLinkable", b, a)) | |
}); | |
D.defineProperty(O, { | |
aB: "fromMaxLinks" | |
}, function() { | |
return null !== this.Z ? this.Z.bs : Infinity | |
}, function(a) { | |
this.be(); | |
var b = this.Z.bs; | |
b !== a && (v && D.h(a, "number", O, "fromMaxLinks"), 0 > a && D.ua(a, ">= 0", O, "fromMaxLinks"), this.Z.bs = a, this.i("fromMaxLinks", b, a)) | |
}); | |
D.defineProperty(O, { | |
cursor: "cursor" | |
}, function() { | |
return this.Fr | |
}, function(a) { | |
var b = this.Fr; | |
b !== a && (D.h(a, "string", O, "cursor"), this.Fr = a, this.i("cursor", b, a)) | |
}); | |
D.defineProperty(O, { | |
click: "click" | |
}, function() { | |
return null !== this.ma ? this.ma.Ri : null | |
}, function(a) { | |
Co(this); | |
var b = this.ma.Ri; | |
b !== a && (null !== a && D.h(a, "function", O, "click"), this.ma.Ri = a, this.i("click", b, a)) | |
}); | |
D.defineProperty(O, { | |
nu: "doubleClick" | |
}, function() { | |
return null !== this.ma ? this.ma.Yi : null | |
}, function(a) { | |
Co(this); | |
var b = this.ma.Yi; | |
b !== a && (null !== a && D.h(a, "function", O, "doubleClick"), this.ma.Yi = a, this.i("doubleClick", b, a)) | |
}); | |
D.defineProperty(O, { | |
KA: "contextClick" | |
}, function() { | |
return null !== this.ma ? this.ma.Ti : null | |
}, function(a) { | |
Co(this); | |
var b = this.ma.Ti; | |
b !== a && (null !== a && D.h(a, "function", O, "contextClick"), this.ma.Ti = a, this.i("contextClick", b, a)) | |
}); | |
D.defineProperty(O, { | |
Yu: "mouseEnter" | |
}, function() { | |
return null !== this.ma ? this.ma.Rs : null | |
}, function(a) { | |
Co(this); | |
var b = this.ma.Rs; | |
b !== a && (null !== a && D.h(a, "function", O, "mouseEnter"), this.ma.Rs = a, this.i("mouseEnter", b, a)) | |
}); | |
D.defineProperty(O, { | |
Zu: "mouseLeave" | |
}, function() { | |
return null !== this.ma ? this.ma.Ss : null | |
}, function(a) { | |
Co(this); | |
var b = this.ma.Ss; | |
b !== a && (null !== a && D.h(a, "function", O, "mouseLeave"), this.ma.Ss = a, this.i("mouseLeave", b, a)) | |
}); | |
D.defineProperty(O, { | |
EB: "mouseOver" | |
}, function() { | |
return null !== this.ma ? this.ma.nj : null | |
}, function(a) { | |
Co(this); | |
var b = this.ma.nj; | |
b !== a && (null !== a && D.h(a, "function", O, "mouseOver"), this.ma.nj = a, this.i("mouseOver", b, a)) | |
}); | |
D.defineProperty(O, { | |
DB: "mouseHover" | |
}, function() { | |
return null !== this.ma ? this.ma.mj : null | |
}, function(a) { | |
Co(this); | |
var b = this.ma.mj; | |
b !== a && (null !== a && D.h(a, "function", O, "mouseHover"), this.ma.mj = a, this.i("mouseHover", b, a)) | |
}); | |
D.defineProperty(O, { | |
CB: "mouseHold" | |
}, function() { | |
return null !== this.ma ? this.ma.lj : null | |
}, function(a) { | |
Co(this); | |
var b = this.ma.lj; | |
b !== a && (null !== a && D.h(a, "function", O, "mouseHold"), this.ma.lj = a, this.i("mouseHold", b, a)) | |
}); | |
D.defineProperty(O, { | |
PJ: "mouseDragEnter" | |
}, function() { | |
return null !== this.ma ? this.ma.Ps : null | |
}, function(a) { | |
Co(this); | |
var b = this.ma.Ps; | |
b !== a && (null !== a && D.h(a, "function", O, "mouseDragEnter"), this.ma.Ps = a, this.i("mouseDragEnter", b, a)) | |
}); | |
D.defineProperty(O, { | |
QJ: "mouseDragLeave" | |
}, function() { | |
return null !== this.ma ? this.ma.Qs : null | |
}, function(a) { | |
Co(this); | |
var b = this.ma.Qs; | |
b !== a && (null !== a && D.h(a, "function", O, "mouseDragLeave"), this.ma.Qs = a, this.i("mouseDragLeave", b, a)) | |
}); | |
D.defineProperty(O, { | |
BB: "mouseDrop" | |
}, function() { | |
return null !== this.ma ? this.ma.kj : null | |
}, function(a) { | |
Co(this); | |
var b = this.ma.kj; | |
b !== a && (null !== a && D.h(a, "function", O, "mouseDrop"), this.ma.kj = a, this.i("mouseDrop", b, a)) | |
}); | |
D.defineProperty(O, { | |
PE: "actionDown" | |
}, function() { | |
return null !== this.ma ? this.ma.er : null | |
}, function(a) { | |
Co(this); | |
var b = this.ma.er; | |
b !== a && (null !== a && D.h(a, "function", O, "actionDown"), this.ma.er = a, this.i("actionDown", b, a)) | |
}); | |
D.defineProperty(O, { | |
QE: "actionMove" | |
}, function() { | |
return null !== this.ma ? this.ma.fr : null | |
}, function(a) { | |
Co(this); | |
var b = this.ma.fr; | |
b !== a && (null !== a && D.h(a, "function", O, "actionMove"), this.ma.fr = a, this.i("actionMove", b, a)) | |
}); | |
D.defineProperty(O, { | |
RE: "actionUp" | |
}, function() { | |
return null !== this.ma ? this.ma.gr : null | |
}, function(a) { | |
Co(this); | |
var b = this.ma.gr; | |
b !== a && (null !== a && D.h(a, "function", O, "actionUp"), this.ma.gr = a, this.i("actionUp", b, a)) | |
}); | |
D.defineProperty(O, { | |
OE: "actionCancel" | |
}, function() { | |
return null !== this.ma ? this.ma.dr : null | |
}, function(a) { | |
Co(this); | |
var b = this.ma.dr; | |
b !== a && (null !== a && D.h(a, "function", O, "actionCancel"), this.ma.dr = a, this.i("actionCancel", b, a)) | |
}); | |
D.defineProperty(O, { | |
kC: "toolTip" | |
}, function() { | |
return null !== this.ma ? this.ma.wj : null | |
}, function(a) { | |
Co(this); | |
var b = this.ma.wj; | |
b !== a && (!v || null === a || a instanceof da || a instanceof hk || D.k("GraphObject.toolTip must be an Adornment or HTMLInfo."), this.ma.wj = a, this.i("toolTip", b, a)) | |
}); | |
D.defineProperty(O, { | |
contextMenu: "contextMenu" | |
}, function() { | |
return null !== this.ma ? this.ma.Ui : null | |
}, function(a) { | |
Co(this); | |
var b = this.ma.Ui; | |
b !== a && (!v || a instanceof da || a instanceof hk || D.k("GraphObject.contextMenu must be an Adornment or HTMLInfo."), this.ma.Ui = a, this.i("contextMenu", b, a)) | |
}); | |
O.prototype.bind = O.prototype.bind = function(a) { | |
a.Sg = this; | |
var b = this.rm(); | |
null !== b && hp(b) && D.k("Cannot add a Binding to a template that has already been copied: " + a); | |
null === this.Hc && (this.Hc = new K(ph)); | |
this.Hc.add(a) | |
}; | |
O.prototype.findTemplateBinder = O.prototype.rm = function() { | |
for (var a = this instanceof x ? this : this.R; null !== a;) { | |
if (null !== a.Al) return a; | |
a = a.R | |
} | |
return null | |
}; | |
O.prototype.setProperties = function(a) { | |
D.nv(this, a) | |
}; | |
var ip; | |
O.make = ip = function(a, b) { | |
var c = arguments, | |
d = null, | |
e = null; | |
if ("function" === typeof a) e = a; | |
else if ("string" === typeof a) { | |
var g = jp.oa(a); | |
"function" === typeof g ? (c = D.lm(arguments), d = g(c), D.Qa(d) || D.k('GraphObject.make invoked object builder "' + a + '", but it did not return an Object')) : e = ca[a] | |
} | |
null === d && (void 0 !== e && null !== e && e.constructor || D.k("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: " + a), d = new e); | |
g = 1; | |
if (d instanceof E && 1 < c.length) { | |
var h = d, | |
e = c[1]; | |
if ("string" === | |
typeof e || e instanceof HTMLDivElement) Nl(h, e), g++ | |
} | |
for (; g < c.length; g++) e = c[g], void 0 === e ? D.k("Undefined value at argument " + g + " for object being constructed by GraphObject.make: " + d) : kp(d, e); | |
return d | |
}; | |
function kp(a, b) { | |
if ("string" === typeof b) | |
if (a instanceof pa) a.text = b; | |
else if (a instanceof z) a.Kb = b; | |
else if (a instanceof Hl) a.source = b; | |
else if (a instanceof x) { | |
var c = Ha(x, b); | |
null !== c ? a.type = c : D.k("Unknown Panel type as an argument to GraphObject.make: " + b) | |
} else a instanceof Ba ? (c = Ha(Ba, b), null !== c ? a.type = c : D.k("Unknown Brush type as an argument to GraphObject.make: " + b)) : a instanceof Ve ? (c = Ha(Ve, b), null !== c ? a.type = c : D.k("Unknown Geometry type as an argument to GraphObject.make: " + b)) : a instanceof $f ? | |
(c = Ha($f, b), null !== c ? a.type = c : D.k("Unknown PathSegment type as an argument to GraphObject.make: " + b)) : D.k("Unable to use a string as an argument to GraphObject.make: " + b); | |
else if (b instanceof O) c = b, a instanceof x || D.k("A GraphObject can only be added to a Panel, not to: " + a), a.add(c); | |
else if (b instanceof jh) { | |
var d = b, | |
c = a, | |
e; | |
d.Ke && c.getRowDefinition ? e = c.getRowDefinition(d.index) : !d.Ke && c.getColumnDefinition ? e = c.getColumnDefinition(d.index) : D.k("A RowColumnDefinition can only be added to a Panel, not to: " + | |
a); | |
e.gq(d) | |
} else if (b instanceof ya) "function" === typeof a.qc ? a.qc(b) : D.ak(a, b); | |
else if (b instanceof ph) a instanceof O ? a.bind(b) : a instanceof jh ? a.bind(b) : D.k("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: " + a); | |
else if (b instanceof Xe) a instanceof Ve ? a.nc.add(b) : D.k("A PathFigure can only be added to a Geometry, not to: " + a); | |
else if (b instanceof $f) a instanceof Xe ? a.Eb.add(b) : D.k("A PathSegment can only be added to a PathFigure, not to: " + a); | |
else if (b instanceof $g) a instanceof | |
E ? a.Zb = b : a instanceof I ? a.Zb = b : D.k("A Layout can only be assigned to a Diagram or a Group, not to: " + a); | |
else if (Array.isArray(b)) | |
for (c = 0; c < b.length; c++) kp(a, b[c]); | |
else if ("object" === typeof b && null !== b) | |
if (a instanceof Ba) { | |
e = new ma; | |
for (c in b) d = parseFloat(c), isNaN(d) ? e[c] = b[c] : a.addColorStop(d, b[c]); | |
D.nv(a, e) | |
} else if (a instanceof jh) { | |
void 0 !== b.row ? (e = b.row, (void 0 === e || null === e || Infinity === e || isNaN(e) || 0 > e) && D.k("Must specify non-negative integer row for RowColumnDefinition " + b + ", not: " + e), a.Ke = !0, | |
a.index = e) : void 0 !== b.column && (e = b.column, (void 0 === e || null === e || Infinity === e || isNaN(e) || 0 > e) && D.k("Must specify non-negative integer column for RowColumnDefinition " + b + ", not: " + e), a.Ke = !1, a.index = e); | |
e = new ma; | |
for (c in b) "row" !== c && "column" !== c && (e[c] = b[c]); | |
D.nv(a, e) | |
} else D.nv(a, b); | |
else D.k('Unknown initializer "' + b + '" for object being constructed by GraphObject.make: ' + a) | |
} | |
var jp = new na("string", "function"); | |
O.getBuilders = function() { | |
var a = new na("string", "function"), | |
b; | |
for (b in jp) | |
if (b !== b.toLowerCase()) { | |
var c = jp.oa(b); | |
"function" === typeof c && a.add(b, c) | |
} | |
a.freeze(); | |
return a | |
}; | |
var lp; | |
O.defineBuilder = lp = function(a, b) { | |
D.h(a, "string", O, "defineBuilder:name"); | |
D.h(b, "function", O, "defineBuilder:func"); | |
var c = a.toLowerCase(); | |
"" !== a && "none" !== c && a !== c || D.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: " + a); | |
jp.add(a, b) | |
}; | |
var mp; | |
O.takeBuilderArgument = mp = function(a, b, c) { | |
void 0 === c && (c = null); | |
var d = a[1]; | |
if ("function" === typeof c ? c(d) : "string" === typeof d) return a.splice(1, 1), d; | |
if (void 0 === b) throw Error("no " + ("function" === typeof c ? "satisfactory" : "string") + " argument for GraphObject builder " + a[0]); | |
return b | |
}; | |
lp("Button", function() { | |
var a = new Ba(Gg); | |
a.addColorStop(0, "white"); | |
a.addColorStop(1, "lightgray"); | |
var b = new Ba(Gg); | |
b.addColorStop(0, "white"); | |
b.addColorStop(1, "dodgerblue"); | |
a = ip(x, Pl, { | |
Hu: !0, | |
AF: function(a, b) { | |
var e = a.Nd("ButtonBorder"); | |
null !== e && (e.fill = b ? a._buttonFillNormal : a._buttonFillDisabled) | |
}, | |
_buttonFillNormal: a, | |
_buttonStrokeNormal: "gray", | |
_buttonFillOver: b, | |
_buttonStrokeOver: "blue", | |
_buttonFillDisabled: "darkgray" | |
}, ip(z, { | |
name: "ButtonBorder", | |
Kb: "Rectangle", | |
C: new S(0, 0, 2.761423749153968, 2.761423749153968), | |
D: new S(1, 1, -2.761423749153968, -2.761423749153968), | |
fill: a, | |
stroke: "gray" | |
})); | |
a.Yu = function(a, b) { | |
if (b.Ju()) { | |
var e = b.Nd("ButtonBorder"); | |
if (e instanceof z) { | |
var g = b._buttonFillOver; | |
b._buttonFillNormal = e.fill; | |
e.fill = g; | |
g = b._buttonStrokeOver; | |
b._buttonStrokeNormal = e.stroke; | |
e.stroke = g | |
} | |
} | |
}; | |
a.Zu = function(a, b) { | |
if (b.Ju()) { | |
var e = b.Nd("ButtonBorder"); | |
e instanceof z && (e.fill = b._buttonFillNormal, e.stroke = b._buttonStrokeNormal) | |
} | |
}; | |
return a | |
}); | |
lp("TreeExpanderButton", function() { | |
var a = ip("Button", { | |
_treeExpandedFigure: "MinusLine", | |
_treeCollapsedFigure: "PlusLine" | |
}, ip(z, { | |
name: "ButtonIcon", | |
Kb: "MinusLine", | |
Ea: Zd | |
}, (new ph("figure", "isTreeExpanded", function(a, c) { | |
var d = c.R; | |
return a ? d._treeExpandedFigure : d._treeCollapsedFigure | |
})).yy()), { | |
visible: !1 | |
}, (new ph("visible", "isTreeLeaf", function(a) { | |
return !a | |
})).yy()); | |
a.click = function(a, c) { | |
var d = c.Y; | |
d instanceof da && (d = d.hf); | |
if (d instanceof G) { | |
var e = d.g; | |
if (null !== e) { | |
e = e.yb; | |
if (d.Dc) { | |
if (!e.canCollapseTree(d)) return | |
} else if (!e.canExpandTree(d)) return; | |
a.Cc = !0; | |
d.Dc ? e.collapseTree(d) : e.expandTree(d) | |
} | |
} | |
}; | |
return a | |
}); | |
lp("SubGraphExpanderButton", function() { | |
var a = ip("Button", { | |
_subGraphExpandedFigure: "MinusLine", | |
_subGraphCollapsedFigure: "PlusLine" | |
}, ip(z, { | |
name: "ButtonIcon", | |
Kb: "MinusLine", | |
Ea: Zd | |
}, (new ph("figure", "isSubGraphExpanded", function(a, c) { | |
var d = c.R; | |
return a ? d._subGraphExpandedFigure : d._subGraphCollapsedFigure | |
})).yy())); | |
a.click = function(a, c) { | |
var d = c.Y; | |
d instanceof da && (d = d.hf); | |
if (d instanceof I) { | |
var e = d.g; | |
if (null !== e) { | |
e = e.yb; | |
if (d.md) { | |
if (!e.canCollapseSubGraph(d)) return | |
} else if (!e.canExpandSubGraph(d)) return; | |
a.Cc = !0; | |
d.md ? e.collapseSubGraph(d) : e.expandSubGraph(d) | |
} | |
} | |
}; | |
return a | |
}); | |
lp("ToolTip", function() { | |
var a = new da(Pl), | |
b = new z; | |
b.name = "Border"; | |
b.fill = "#FFFFE0"; | |
b.stroke = "#CCCCCC"; | |
a.add(b); | |
return a | |
}); | |
lp("ContextMenu", function() { | |
return new da(Ol) | |
}); | |
lp("ContextMenuButton", function() { | |
var a = ip("Button"); | |
a.stretch = yo; | |
var b = a.Nd("ButtonBorder"); | |
b instanceof z && (b.Kb = "Rectangle", b.C = new S(0, 0, 2, 3), b.D = new S(1, 1, -2, -2)); | |
return a | |
}); | |
lp("PanelExpanderButton", function(a) { | |
var b = mp(a, "COLLAPSIBLE"), | |
c = ip("Button", { | |
_buttonExpandedFigure: "TriangleUp", | |
_buttonCollapsedFigure: "TriangleDown" | |
}, ip(z, "TriangleUp", { | |
name: "ButtonIcon", | |
Ea: new Ca(6, 4) | |
}, (new ph("figure", "visible", function(a) { | |
return a ? c._buttonExpandedFigure : c._buttonCollapsedFigure | |
})).yy(b))); | |
a = c.Nd("ButtonBorder"); | |
a instanceof z && (a.stroke = null, a.fill = "transparent"); | |
c.click = function(a, c) { | |
var g = c.g; | |
if (null !== g && !g.qb) { | |
var h = c.rm(); | |
null === h && (h = c.Y); | |
null !== h && (h = h.Nd(b), null !== h && | |
(g.Nb("Collapse/Expand Panel"), h.visible = !h.visible, g.jd("Collapse/Expand Panel"))) | |
} | |
}; | |
return c | |
}); | |
lp("CheckBoxButton", function(a) { | |
var b = mp(a); | |
a = ip("Button", { | |
"ButtonBorder.fill": "white", | |
"ButtonBorder.stroke": "gray", | |
width: 14, | |
height: 14 | |
}, ip(z, { | |
name: "ButtonIcon", | |
QI: "M0 4 L3 9 9 0", | |
mb: 2, | |
stretch: Ye, | |
bB: bk, | |
visible: !1 | |
}, "" !== b ? (new ph("visible", b)).EJ() : [])); | |
a.click = function(a, d) { | |
var e = a.g; | |
if (!(null === e || e.qb || "" !== b && e.da.qb)) { | |
a.Cc = !0; | |
var g = d.Nd("ButtonIcon"); | |
e.Nb("checkbox"); | |
g.visible = !g.visible; | |
"function" === typeof d._doClick && d._doClick(a, d); | |
e.jd("checkbox") | |
} | |
}; | |
return a | |
}); | |
lp("CheckBox", function(a) { | |
a = mp(a); | |
a = ip("CheckBoxButton", a, { | |
name: "Button", | |
margin: new Lb(0, 1, 0, 0) | |
}); | |
var b = ip(x, "Horizontal", a, { | |
Hu: !0, | |
margin: 1, | |
_buttonFillNormal: a._buttonFillNormal, | |
_buttonStrokeNormal: a._buttonStrokeNormal, | |
_buttonFillOver: a._buttonFillOver, | |
_buttonStrokeOver: a._buttonStrokeOver, | |
_buttonFillDisabled: a._buttonFillDisabled, | |
Yu: a.Yu, | |
Zu: a.Zu, | |
click: a.click, | |
_buttonClick: a.click | |
}); | |
a.Yu = null; | |
a.Zu = null; | |
a.click = null; | |
return b | |
}); | |
function Do() { | |
this.Yr = this.Ui = this.wj = this.dr = this.gr = this.fr = this.er = this.kj = this.Qs = this.Ps = this.lj = this.mj = this.nj = this.Ss = this.Rs = this.Ti = this.Yi = this.Ri = null | |
} | |
Do.prototype.copy = function() { | |
var a = new Do; | |
a.Ri = this.Ri; | |
a.Yi = this.Yi; | |
a.Ti = this.Ti; | |
a.Rs = this.Rs; | |
a.Ss = this.Ss; | |
a.nj = this.nj; | |
a.mj = this.mj; | |
a.lj = this.lj; | |
a.Ps = this.Ps; | |
a.Qs = this.Qs; | |
a.kj = this.kj; | |
a.er = this.er; | |
a.fr = this.fr; | |
a.gr = this.gr; | |
a.dr = this.dr; | |
a.wj = this.wj; | |
a.Ui = this.Ui; | |
a.Yr = this.Yr; | |
return a | |
}; | |
function x(a) { | |
O.call(this); | |
void 0 === a ? this.ca = ek : (D.Da(a, x, x, "type"), this.ca = a); | |
this.xa = new K(O); | |
this.vf = Sd; | |
this.ca === Sl && (this.$n = !0); | |
this.Jr = Vc; | |
this.Xi = wo; | |
this.ca === fa && np(this); | |
this.Wp = bk; | |
this.js = ae; | |
this.ks = Kd; | |
this.fs = 0; | |
this.es = 100; | |
this.hs = 10; | |
this.gs = 0; | |
this.Al = this.Ud = this.qk = this.Vm = this.Xm = null; | |
this.xs = NaN; | |
this.Ig = this.ej = null; | |
this.op = "category"; | |
this.Hg = null; | |
this.yj = new C(NaN, NaN, NaN, NaN); | |
this.Jk = this.wt = this.Yl = null; | |
this.dk = "" | |
} | |
D.Ta(x, O); | |
D.Di(x); | |
D.ka("Panel", x); | |
function np(a) { | |
a.ik = Sd; | |
a.fi = 1; | |
a.Wi = null; | |
a.Tm = null; | |
a.ei = 1; | |
a.di = null; | |
a.Sm = null; | |
a.hd = []; | |
a.cd = []; | |
a.rn = op; | |
a.Rm = op; | |
a.xj = 0; | |
a.hj = 0 | |
} | |
x.prototype.cloneProtected = function(a) { | |
O.prototype.cloneProtected.call(this, a); | |
a.ca = this.ca; | |
a.vf = this.vf.V(); | |
a.Jr = this.Jr.V(); | |
a.Xi = this.Xi; | |
if (a.ca === fa) { | |
a.ik = this.ik.V(); | |
a.fi = this.fi; | |
a.Wi = this.Wi; | |
a.Tm = this.Tm; | |
a.ei = this.ei; | |
a.di = this.di; | |
a.Sm = this.Sm; | |
var b = []; | |
if (0 < this.hd.length) | |
for (var c = this.hd, d = c.length, e = 0; e < d; e++) | |
if (void 0 !== c[e]) { | |
var g = c[e].copy(); | |
g.Dm(a); | |
b[e] = g | |
} | |
a.hd = b; | |
b = []; | |
if (0 < this.cd.length) | |
for (c = this.cd, d = c.length, e = 0; e < d; e++) void 0 !== c[e] && (g = c[e].copy(), g.Dm(a), b[e] = g); | |
a.cd = b; | |
a.rn = this.rn; | |
a.Rm = this.Rm; | |
a.xj = this.xj; | |
a.hj = this.hj | |
} | |
a.Wp = this.Wp; | |
a.js = this.js.V(); | |
a.ks = this.ks.V(); | |
a.fs = this.fs; | |
a.es = this.es; | |
a.hs = this.hs; | |
a.gs = this.gs; | |
a.Xm = this.Xm; | |
a.qk = this.qk; | |
a.Ud = this.Ud; | |
a.Al = this.Al; | |
a.xs = this.xs; | |
a.ej = this.ej; | |
a.Ig = this.Ig; | |
a.op = this.op; | |
a.yj.assign(this.yj); | |
a.dk = this.dk; | |
null !== this.wt && (a.wt = this.wt) | |
}; | |
x.prototype.Ei = function(a) { | |
O.prototype.Ei.call(this, a); | |
a.xa = this.xa; | |
for (var b = a.xa.o, c = b.length, d = 0; d < c; d++) b[d].rj = a; | |
a.Yl = null | |
}; | |
x.prototype.copy = function() { | |
var a = O.prototype.copy.call(this); | |
if (null !== a) { | |
for (var b = this.xa.o, c = b.length, d = 0; d < c; d++) { | |
var e = b[d].copy(), | |
g = a; | |
e.Dm(g); | |
e.on = null; | |
var h = g.xa, | |
k = h.count; | |
h.ce(k, e); | |
h = g.Y; | |
if (null !== h) { | |
h.Tl = null; | |
null !== e.yd && h instanceof G && (h.cl = !0); | |
var l = g.g; | |
null !== l && l.na.ub || h.od(hg, "elements", g, null, e, null, k) | |
} | |
} | |
return a | |
} | |
return null | |
}; | |
x.prototype.qc = function(a) { | |
a.Re === x ? this.type = a : O.prototype.qc.call(this, a) | |
}; | |
x.prototype.toString = function() { | |
return "Panel(" + this.type + ")#" + D.Od(this) | |
}; | |
var ek; | |
x.Position = ek = D.s(x, "Position", 0); | |
x.Horizontal = D.s(x, "Horizontal", 1); | |
var Ol; | |
x.Vertical = Ol = D.s(x, "Vertical", 2); | |
var Xj; | |
x.Spot = Xj = D.s(x, "Spot", 3); | |
var Pl; | |
x.Auto = Pl = D.s(x, "Auto", 4); | |
var fa; | |
x.Table = fa = D.s(x, "Table", 5); | |
x.Viewbox = D.s(x, "Viewbox", 6); | |
var Ro; | |
x.TableRow = Ro = D.s(x, "TableRow", 7); | |
var So; | |
x.TableColumn = So = D.s(x, "TableColumn", 8); | |
var sj; | |
x.Link = sj = D.s(x, "Link", 9); | |
var Sl; | |
x.Grid = Sl = D.s(x, "Grid", 10); | |
var pp; | |
x.Graduated = pp = D.s(x, "Graduated", 11); | |
D.defineProperty(x, { | |
type: "type" | |
}, function() { | |
return this.ca | |
}, function(a) { | |
var b = this.ca; | |
b !== a && (v && D.Da(a, x, x, "type"), b !== Ro && b !== So || D.k("Cannot change Panel.type when it is already a TableRow or a TableColumn: " + a), this.ca = a, this.ca === Sl ? this.$n = !0 : this.ca === fa && np(this), this.K(), this.i("type", b, a)) | |
}); | |
D.w(x, { | |
elements: "elements" | |
}, function() { | |
return this.xa.j | |
}); | |
D.w(x, { | |
Ga: "naturalBounds" | |
}, function() { | |
return this.fd | |
}); | |
D.defineProperty(x, { | |
padding: "padding" | |
}, function() { | |
return this.vf | |
}, function(a) { | |
"number" === typeof a ? (0 > a && D.ua(a, ">= 0", x, "padding"), a = new Lb(a)) : (D.l(a, Lb, x, "padding"), 0 > a.left && D.ua(a.left, ">= 0", x, "padding:value.left"), 0 > a.right && D.ua(a.right, ">= 0", x, "padding:value.right"), 0 > a.top && D.ua(a.top, ">= 0", x, "padding:value.top"), 0 > a.bottom && D.ua(a.bottom, ">= 0", x, "padding:value.bottom")); | |
var b = this.vf; | |
b.O(a) || (this.vf = a = a.V(), this.K(), this.i("padding", b, a)) | |
}); | |
D.defineProperty(x, { | |
pm: "defaultAlignment" | |
}, function() { | |
return this.Jr | |
}, function(a) { | |
var b = this.Jr; | |
b.O(a) || (v && D.l(a, S, x, "defaultAlignment"), this.Jr = a = a.V(), this.K(), this.i("defaultAlignment", b, a)) | |
}); | |
D.defineProperty(x, { | |
me: "defaultStretch" | |
}, function() { | |
return this.Xi | |
}, function(a) { | |
var b = this.Xi; | |
b !== a && (D.Da(a, O, x, "defaultStretch"), this.Xi = a, this.K(), this.i("defaultStretch", b, a)) | |
}); | |
D.defineProperty(x, { | |
EL: "defaultSeparatorPadding" | |
}, function() { | |
return void 0 === this.ik ? Sd : this.ik | |
}, function(a) { | |
if (void 0 !== this.ik) { | |
"number" === typeof a ? a = new Lb(a) : v && D.l(a, Lb, x, "defaultSeparatorPadding"); | |
var b = this.ik; | |
b.O(a) || (this.ik = a = a.V(), this.K(), this.i("defaultSeparatorPadding", b, a)) | |
} | |
}); | |
D.defineProperty(x, { | |
CL: "defaultRowSeparatorStroke" | |
}, function() { | |
return void 0 === this.Wi ? null : this.Wi | |
}, function(a) { | |
var b = this.Wi; | |
b !== a && (null === a || "string" === typeof a || a instanceof Ba) && (a instanceof Ba && a.freeze(), this.Wi = a, this.ra(), this.i("defaultRowSeparatorStroke", b, a)) | |
}); | |
D.defineProperty(x, { | |
DL: "defaultRowSeparatorStrokeWidth" | |
}, function() { | |
return void 0 === this.fi ? 1 : this.fi | |
}, function(a) { | |
if (void 0 !== this.fi) { | |
var b = this.fi; | |
b !== a && isFinite(a) && 0 <= a && (this.fi = a, this.K(), this.i("defaultRowSeparatorStrokeWidth", b, a)) | |
} | |
}); | |
D.defineProperty(x, { | |
BL: "defaultRowSeparatorDashArray" | |
}, function() { | |
return void 0 === this.Tm ? null : this.Tm | |
}, function(a) { | |
if (void 0 !== this.Tm) { | |
var b = this.Tm; | |
if (b !== a) { | |
null === a || Array.isArray(a) || D.kc(a, "Array", x, "defaultRowSeparatorDashArray:value"); | |
if (null !== a) { | |
for (var c = a.length, d = 0, e = 0; e < c; e++) { | |
var g = a[e]; | |
"number" === typeof g && 0 <= g && isFinite(g) || D.k("defaultRowSeparatorDashArray value " + g + " at index " + e + " must be a positive number or zero."); | |
d += g | |
} | |
if (0 === d) { | |
if (null === b) return; | |
a = null | |
} | |
} | |
this.Tm = a; | |
this.ra(); | |
this.i("defaultRowSeparatorDashArray", b, a) | |
} | |
} | |
}); | |
D.defineProperty(x, { | |
wL: "defaultColumnSeparatorStroke" | |
}, function() { | |
return void 0 === this.di ? null : this.di | |
}, function(a) { | |
if (void 0 !== this.di) { | |
var b = this.di; | |
b !== a && (null === a || "string" === typeof a || a instanceof Ba) && (a instanceof Ba && a.freeze(), this.di = a, this.ra(), this.i("defaultColumnSeparatorStroke", b, a)) | |
} | |
}); | |
D.defineProperty(x, { | |
xL: "defaultColumnSeparatorStrokeWidth" | |
}, function() { | |
return void 0 === this.ei ? 1 : this.ei | |
}, function(a) { | |
if (void 0 !== this.ei) { | |
var b = this.ei; | |
b !== a && isFinite(a) && 0 <= a && (this.ei = a, this.K(), this.i("defaultColumnSeparatorStrokeWidth", b, a)) | |
} | |
}); | |
D.defineProperty(x, { | |
vL: "defaultColumnSeparatorDashArray" | |
}, function() { | |
return void 0 === this.Sm ? null : this.Sm | |
}, function(a) { | |
if (void 0 !== this.Sm) { | |
var b = this.Sm; | |
if (b !== a) { | |
null === a || Array.isArray(a) || D.kc(a, "Array", x, "defaultColumnSeparatorDashArray:value"); | |
if (null !== a) { | |
for (var c = a.length, d = 0, e = 0; e < c; e++) { | |
var g = a[e]; | |
"number" === typeof g && 0 <= g && isFinite(g) || D.k("defaultColumnSeparatorDashArray value " + g + " at index " + e + " must be a positive number or zero."); | |
d += g | |
} | |
if (0 === d) { | |
if (null === b) return; | |
a = null | |
} | |
} | |
this.Sm = | |
a; | |
this.ra(); | |
this.i("defaultColumnSeparatorDashArray", b, a) | |
} | |
} | |
}); | |
D.defineProperty(x, { | |
QM: "viewboxStretch" | |
}, function() { | |
return this.Wp | |
}, function(a) { | |
var b = this.Wp; | |
b !== a && (D.Da(a, O, x, "viewboxStretch"), this.Wp = a, this.K(), this.i("viewboxStretch", b, a)) | |
}); | |
D.defineProperty(x, { | |
by: "gridCellSize" | |
}, function() { | |
return this.js | |
}, function(a) { | |
var b = this.js; | |
if (!b.O(a)) { | |
D.l(a, Ca, x, "gridCellSize"); | |
a.H() && 0 !== a.width && 0 !== a.height || D.k("Invalid Panel.gridCellSize: " + a); | |
this.js = a.V(); | |
var c = this.g; | |
null !== c && this === c.Xn && lm(c); | |
this.ra(); | |
this.i("gridCellSize", b, a) | |
} | |
}); | |
D.defineProperty(x, { | |
UF: "gridOrigin" | |
}, function() { | |
return this.ks | |
}, function(a) { | |
var b = this.ks; | |
if (!b.O(a)) { | |
D.l(a, N, x, "gridOrigin"); | |
a.H() || D.k("Invalid Panel.gridOrigin: " + a); | |
this.ks = a.V(); | |
var c = this.g; | |
null !== c && this === c.Xn && lm(c); | |
this.ra(); | |
this.i("gridOrigin", b, a) | |
} | |
}); | |
D.defineProperty(x, { | |
bl: "graduatedMin" | |
}, function() { | |
return this.fs | |
}, function(a) { | |
D.p(a, x, "graduatedMin"); | |
var b = this.fs; | |
b !== a && (this.fs = a, this.K(), this.i("graduatedMin", b, a), Ho(this) && (a = this.Y, null !== a && Io(this, a, "graduatedRange"))) | |
}); | |
D.defineProperty(x, { | |
eB: "graduatedMax" | |
}, function() { | |
return this.es | |
}, function(a) { | |
D.p(a, x, "graduatedMax"); | |
var b = this.es; | |
b !== a && (this.es = a, this.K(), this.i("graduatedMax", b, a), Ho(this) && (a = this.Y, null !== a && Io(this, a, "graduatedRange"))) | |
}); | |
D.w(x, { | |
Du: "graduatedRange" | |
}, function() { | |
return this.eB - this.bl | |
}); | |
D.defineProperty(x, { | |
fB: "graduatedTickUnit" | |
}, function() { | |
return this.hs | |
}, function(a) { | |
D.p(a, x, "graduatedTickUnit"); | |
var b = this.hs; | |
b !== a && 0 < a && (this.hs = a, this.K(), this.i("graduatedTickUnit", b, a)) | |
}); | |
D.defineProperty(x, { | |
TF: "graduatedTickBase" | |
}, function() { | |
return this.gs | |
}, function(a) { | |
D.p(a, x, "graduatedTickBase"); | |
var b = this.gs; | |
b !== a && (this.gs = a, this.K(), this.i("graduatedTickBase", b, a)) | |
}); | |
f = x.prototype; | |
f.$s = function(a) { | |
O.prototype.$s.call(this, a); | |
for (var b = this.xa.o, c = b.length, d = 0; d < c; d++) b[d].$s(a) | |
}; | |
f.Xk = function(a, b) { | |
if (this.ca === Sl) { | |
var c = this.Jj() * b.scale; | |
0 >= c && (c = 1); | |
var d = this.by, | |
e = d.width, | |
d = d.height, | |
g = this.Ga, | |
h = g.width, | |
g = g.height, | |
k = Math.ceil(h / e), | |
l = Math.ceil(g / d), | |
m = this.UF; | |
a.save(); | |
a.beginPath(); | |
a.rect(0, 0, h, g); | |
a.clip(); | |
for (var n = [], p = this.xa.o, q = p.length, r = 0; r < q; r++) { | |
var s = p[r], | |
u = []; | |
n.push(u); | |
if (s.visible) | |
for (var s = hn(s.Kb), t = r + 1; t < q; t++) { | |
var y = p[t]; | |
y.visible && hn(y.Kb) === s && (y = y.interval, 2 <= y && u.push(y)) | |
} | |
} | |
p = this.xa.o; | |
q = p.length; | |
for (r = 0; r < q; r++) { | |
var w = p[r]; | |
if (w.visible && (u = w.interval, !(2 > | |
e * u * c))) { | |
s = w.opacity; | |
t = 1; | |
if (1 !== s) { | |
if (0 === s) continue; | |
t = a.globalAlpha; | |
a.globalAlpha = t * s | |
} | |
var y = n[r], | |
A = !1, | |
B = !0, | |
P = w.hH; | |
null !== P && (A = !0, B = a.WA(P, w.gf)); | |
if ("LineV" === w.Kb && null !== w.stroke) { | |
a.lineWidth = w.mb; | |
Vo(this, a, w.stroke, !1, !1); | |
a.beginPath(); | |
for (var H = Math.floor(-m.x / e), R = H; R <= H + k; R++) { | |
var aa = R * e + m.x; | |
0 <= aa && aa <= h && qp(R, u, y) && (A && !B ? Go(a, aa, 0, aa, g, P, w.gf) : (a.moveTo(aa, 0), a.lineTo(aa, g))) | |
} | |
a.stroke() | |
} else if ("LineH" === w.Kb && null !== w.stroke) { | |
a.lineWidth = w.mb; | |
Vo(this, a, w.stroke, !1, !1); | |
a.beginPath(); | |
for (R = | |
H = Math.floor(-m.y / d); R <= H + l; R++) aa = R * d + m.y, 0 <= aa && aa <= g && qp(R, u, y) && (A && !B ? Go(a, 0, aa, h, aa, P, w.gf) : (a.moveTo(0, aa), a.lineTo(h, aa))); | |
a.stroke() | |
} else if ("BarV" === w.Kb && null !== w.fill) | |
for (Vo(this, a, w.fill, !0, !1), w = w.width, isNaN(w) && (w = e), R = H = Math.floor(-m.x / e); R <= H + k; R++) aa = R * e + m.x, 0 <= aa && aa <= h && qp(R, u, y) && a.fillRect(aa, 0, w, g); | |
else if ("BarH" === w.Kb && null !== w.fill) | |
for (Vo(this, a, w.fill, !0, !1), w = w.height, isNaN(w) && (w = d), R = H = Math.floor(-m.y / d); R <= H + l; R++) aa = R * d + m.y, 0 <= aa && aa <= g && qp(R, u, y) && a.fillRect(0, aa, | |
h, w); | |
A && a.RA(); | |
1 !== s && (a.globalAlpha = t) | |
} | |
} | |
a.restore(); | |
a.De(!1) | |
} else if (this.ca === pp) { | |
e = this.Ga; | |
c = e.width; | |
e = e.height; | |
a.save(); | |
a.beginPath(); | |
a.rect(-1, -1, c + 1, e + 1); | |
a.clip(); | |
c = this.Md(); | |
c.He(a, b); | |
e = this.Jj() * b.scale; | |
0 >= e && (e = 1); | |
d = c.aa; | |
h = this.xa.o; | |
g = this.Xm; | |
k = h.length; | |
for (l = 0; l < k; l++) | |
if (q = h[l], m = g[l], n = m.length, q.visible && q !== c && 0 !== m.length) | |
if (q instanceof z) { | |
if (!(2 > this.fB * q.interval * c.xf.vu / this.Du * e)) | |
for (r = q.Fa, u = q.mb * q.scale, s = q.Gh, s.ee() && (s = jc), p = 0; p < n; p++) t = q, y = m[p][0], A = d, H = m[p][1], R = r, w = u, B = s, | |
P = t.Nc, P.reset(), P.translate(y.x + A.x, y.y + A.y), P.rotate(H + t.angle, 0, 0), P.translate(-R.width * B.x + B.offsetX + w / 2, -R.height * B.y + B.offsetY + w / 2), P.scale(t.scale, t.scale), Xo(t, !1), t.Ni.set(t.Nc), t.Xo = t.scale, Yo(t, !1), q.He(a, b), q.Nc.reset() | |
} else if (q instanceof pa) | |
for (null === this.Jk && (this.Jk = new pa), r = this.Jk, rp(q, r), p = 0; p < n; p++) y = m[p], 3 < y.length && (s = y[6], r.Zd = y[2], r.wg = y[3], r.xe = y[4], r.uf = y[5], r.fd = y[8], r.rc(s.x, s.y, s.width, s.height), q = r, u = d, t = y[7], y = y[8], A = q.Nc, A.reset(), A.translate(s.x + u.x, s.y + u.y), A.translate(-t.x, -t.y), Ko(q, A, y.x, y.y, y.width, y.height), Xo(q, !1), q.Ni.set(q.Nc), q.Xo = q.scale, Yo(q, !1), r.He(a, b)); | |
a.restore(); | |
a.De(!0) | |
} else { | |
this.ca === fa && (a.lineCap = "butt", sp(this, a, !0, this.hd, !0), sp(this, a, !1, this.cd, !0), tp(this, a, !0, this.hd), tp(this, a, !1, this.cd), sp(this, a, !0, this.hd, !1), sp(this, a, !1, this.cd, !1)); | |
if (c = this.yq) a.save(), v && this.type !== Xj && D.trace("Warning: Panel.isClipping set on non-Spot Panel: " + this.toString()); | |
e = this.Md(); | |
d = this.xa.o; | |
h = d.length; | |
for (g = 0; g < h; g++) k = d[g], c && k === e && (a.eq = !0), k.He(a, | |
b), c && k === e && (a.eq = !1); | |
c && (a.restore(), a.De(!0)); | |
v && v.HI && this instanceof J && v.GI(a, b, this) | |
} | |
}; | |
function rp(a, b) { | |
b.S = a.S | 6144; | |
b.Lc = a.Lc; | |
b.Mb = a.Mb; | |
b.lc = a.lc; | |
b.$e = a.$e.V(); | |
b.oi = a.oi.V(); | |
b.ni = a.ni.V(); | |
b.ij = a.ij.copy(); | |
b.Db = a.Db; | |
b.wg = a.wg; | |
b.Qg = a.Qg; | |
b.gn = a.gn.V(); | |
b.ue = a.ue.V(); | |
b.Nm = a.Nm.V(); | |
b.sn = a.sn; | |
b.tn = a.tn.V(); | |
b.un = a.un; | |
null !== a.yg && (b.yg = a.yg.copy()); | |
b.yn = a.yn; | |
a instanceof pa && (b.Zd = a.Zd, b.Bc = a.Bc, b.Bg = a.Bg, b.Zl = a.Zl, b.Ag = a.Ag, b.cm = a.cm, b.$m = a.$m, b.wk = a.wk, b.uk = a.uk, b.pj = a.pj, b.Aj = a.Aj, b.uf.lk = null, b.vi = a.vi, b.wi = a.wi, b.wh = a.wh, b.rp = a.rp, b.Fg = a.Fg, b.Eg = a.Eg, b.Dg = a.Dg, b.Wm = a.Wm) | |
} | |
function tp(a, b, c, d) { | |
for (var e = d.length, g = a.aa, h = !0, k = 0; k < e; k++) { | |
var l = d[k]; | |
if (void 0 !== l) | |
if (h) h = !1; | |
else if (0 !== l.hb) { | |
if (c) { | |
if (l.position > g.height) continue | |
} else if (l.position > g.width) continue; | |
var m = l.Wq; | |
isNaN(m) && (m = c ? a.fi : a.ei); | |
var n = l.Vq; | |
null === n && (n = c ? a.Wi : a.di); | |
if (0 !== m && null !== n) { | |
Vo(a, b, n, !1, !1); | |
var n = !1, | |
p = !0, | |
q = l.pK; | |
null !== q && (n = !0, void 0 !== b.setLineDash ? (b.setLineDash(q), b.lineDashOffset = a.gf) : void 0 !== b.webkitLineDash ? (b.webkitLineDash = q, b.webkitLineDashOffset = a.gf) : p = !1); | |
b.beginPath(); | |
var r = | |
l.position + m; | |
c ? r > g.height && (m -= r - g.height) : r > g.width && (m -= r - g.width); | |
l = l.position + m / 2; | |
b.lineWidth = m; | |
r = a.padding; | |
c ? (l += r.top, m = r.left, r = g.width - r.right, n && !p ? Go(b, m, l, r, l, q, 0) : (b.moveTo(m, l), b.lineTo(r, l))) : (l += r.left, m = r.top, r = g.height - r.bottom, n && !p ? Go(b, l, m, l, r, q, 0) : (b.moveTo(l, m), b.lineTo(l, r))); | |
b.stroke(); | |
n && (void 0 !== b.setLineDash ? (b.setLineDash(D.ml), b.lineDashOffset = 0) : void 0 !== b.webkitLineDash && (b.webkitLineDash = D.ml, b.webkitLineDashOffset = 0)) | |
} | |
} | |
} | |
} | |
function sp(a, b, c, d, e) { | |
for (var g = d.length, h = a.aa, k = 0; k < g; k++) { | |
var l = d[k]; | |
if (void 0 !== l && null !== l.background && l.PA !== e && 0 !== l.hb) { | |
var m = c ? h.height : h.width; | |
if (!(l.position > m)) { | |
var n = l.kf(), | |
p = l.Wq; | |
isNaN(p) && (p = c ? a.fi : a.ei); | |
var q = l.Vq; | |
null === q && (q = c ? a.Wi : a.di); | |
null === q && (p = 0); | |
n -= p; | |
p = l.position + p; | |
n += l.hb; | |
p + n > m && (n = m - p); | |
0 >= n || (m = a.padding, Vo(a, b, l.background, !0, !1), c ? b.fillRect(m.left, p + m.top, h.width - (m.left + m.right), n) : b.fillRect(p + m.left, m.top, n, h.height - (m.top + m.bottom))) | |
} | |
} | |
} | |
} | |
function qp(a, b, c) { | |
if (0 !== a % b) return !1; | |
b = c.length; | |
for (var d = 0; d < b; d++) | |
if (0 === a % c[d]) return !1; | |
return !0 | |
} | |
function hn(a) { | |
return "LineV" === a || "BarV" === a | |
} | |
f.Vn = function(a, b, c, d, e) { | |
var g = this.kh(), | |
h = this.transform, | |
k = 1 / (h.m11 * h.m22 - h.m12 * h.m21), | |
l = h.m22 * k, | |
m = -h.m12 * k, | |
n = -h.m21 * k, | |
p = h.m11 * k, | |
q = k * (h.m21 * h.dy - h.m22 * h.dx), | |
r = k * (h.m12 * h.dx - h.m11 * h.dy); | |
if (null !== this.hm) return h = this.aa, Je(h.left, h.top, h.right, h.bottom, a, b, c, d, e); | |
if (null !== this.background) g = a * l + b * n + q, k = a * m + b * p + r, a = c * l + d * n + q, l = c * m + d * p + r, e.n(0, 0), c = this.Ga, c = Je(0, 0, c.width, c.height, g, k, a, l, e), e.transform(h); | |
else { | |
g || (l = 1, n = m = 0, p = 1, r = q = 0); | |
k = a * l + b * n + q; | |
a = a * m + b * p + r; | |
l = c * l + d * n + q; | |
d = c * m + d * p + r; | |
e.n(l, d); | |
m = (l - | |
k) * (l - k) + (d - a) * (d - a); | |
c = !1; | |
p = this.xa.o; | |
r = p.length; | |
n = D.P(); | |
q = null; | |
b = Infinity; | |
var s = null; | |
this.yq && (s = D.P(), q = this.Md(), (c = q.Vn(k, a, l, d, s)) && (b = (k - s.x) * (k - s.x) + (a - s.y) * (a - s.y))); | |
for (var u = 0; u < r; u++) { | |
var t = p[u]; | |
t.visible && t !== q && t.Vn(k, a, l, d, n) && (c = !0, t = (k - n.x) * (k - n.x) + (a - n.y) * (a - n.y), t < m && (m = t, e.set(n))) | |
} | |
this.yq && (b > m && e.set(s), D.A(s)); | |
D.A(n); | |
g && e.transform(h) | |
} | |
return c | |
}; | |
f.K = function(a) { | |
O.prototype.K.call(this, a); | |
a = null; | |
if (this.ca === Pl || this.ca === sj) a = this.Md(); | |
for (var b = this.xa.o, c = b.length, d = 0; d < c; d++) { | |
var e = b[d]; | |
(e === a || e.Ve) && e.K(!0); | |
if (!e.Ea.H()) { | |
var g = Mo(e, !1); | |
(e instanceof Yj || e instanceof x || e instanceof pa || g !== Zj) && e.K(!0) | |
} | |
} | |
}; | |
f.xq = function() { | |
if (!1 === Nm(this)) { | |
km(this, !0); | |
No(this, !0); | |
for (var a = this.xa.o, b = a.length, c = 0; c < b; c++) a[c].xq() | |
} | |
}; | |
f.cj = function() { | |
if (0 !== (this.S & 2048) === !1) { | |
Xo(this, !0); | |
Yo(this, !0); | |
for (var a = this.xa.o, b = a.length, c = 0; c < b; c++) a[c].lB() | |
} | |
}; | |
f.lB = function() { | |
Yo(this, !0); | |
for (var a = this.xa.o, b = a.length, c = 0; c < b; c++) a[c].lB() | |
}; | |
f.jo = function(a, b, c, d) { | |
var e = this.yj; | |
e.width = 0; | |
e.height = 0; | |
var g = this.Ea, | |
h = this.ah; | |
void 0 === c && (c = h.width, d = h.height); | |
c = Math.max(c, h.width); | |
d = Math.max(d, h.height); | |
var k = this.rf; | |
isNaN(g.width) || (a = Math.min(g.width, k.width)); | |
isNaN(g.height) || (b = Math.min(g.height, k.height)); | |
a = Math.max(c, a); | |
b = Math.max(d, b); | |
var l = this.padding; | |
a = Math.max(a - l.left - l.right, 0); | |
b = Math.max(b - l.top - l.bottom, 0); | |
var m = this.xa.o; | |
if (0 !== m.length) { | |
var n = this.ca.ac; | |
switch (n) { | |
case "Position": | |
var p = a, | |
q = b, | |
r = c, | |
s = d, | |
u = m.length; | |
e.x = 0; | |
e.y = | |
0; | |
e.width = 0; | |
e.height = 0; | |
for (var t = Rp(this), y = 0; y < u; y++) { | |
var w = m[y]; | |
if (w.visible || w === t) { | |
var A = w.margin, | |
B = A.right + A.left, | |
P = A.top + A.bottom; | |
Hk(w, p, q, r, s); | |
var H = w.Fa, | |
R = Math.max(H.width + B, 0), | |
aa = Math.max(H.height + P, 0), | |
V = w.position.x, | |
ea = w.position.y; | |
isFinite(V) || (V = 0); | |
isFinite(ea) || (ea = 0); | |
if (w instanceof z) { | |
var la = w; | |
if (la.fG) var Da = la.mb / 2, | |
V = V - Da, | |
ea = ea - Da | |
} | |
Ub(e, V, ea, R, aa) | |
} | |
} | |
break; | |
case "Vertical": | |
for (var La = a, hb = c, Aa = m.length, W = D.nb(), xb = Rp(this), Pb = 0; Pb < Aa; Pb++) { | |
var Sa = m[Pb]; | |
if (Sa.visible || Sa === xb) { | |
var Qc = | |
Mo(Sa, !1); | |
if (Qc !== Zj && Qc !== xo) W.push(Sa); | |
else { | |
var Ra = Sa.margin, | |
jg = Ra.right + Ra.left, | |
kg = Ra.top + Ra.bottom; | |
Hk(Sa, La, Infinity, hb, 0); | |
var vd = Sa.Fa, | |
wd = Math.max(vd.width + jg, 0), | |
Rc = Math.max(vd.height + kg, 0); | |
e.width = Math.max(e.width, wd); | |
e.height += Rc | |
} | |
} | |
} | |
var uh = W.length; | |
if (0 !== uh) { | |
this.Ea.width ? La = Math.min(this.Ea.width, this.rf.width) : 0 !== e.width && (La = Math.min(e.width, this.rf.width)); | |
for (Pb = 0; Pb < uh; Pb++) | |
if (Sa = W[Pb], Sa.visible || Sa === xb) Ra = Sa.margin, jg = Ra.right + Ra.left, kg = Ra.top + Ra.bottom, Hk(Sa, La, Infinity, hb, 0), vd = | |
Sa.Fa, wd = Math.max(vd.width + jg, 0), Rc = Math.max(vd.height + kg, 0), e.width = Math.max(e.width, wd), e.height += Rc; | |
D.ya(W) | |
} | |
break; | |
case "Horizontal": | |
for (var $e = b, ib = d, ub = m.length, sa = D.nb(), oa = Rp(this), ab = 0; ab < ub; ab++) { | |
var Oa = m[ab]; | |
if (Oa.visible || Oa === oa) { | |
var pb = Mo(Oa, !1); | |
if (pb !== Zj && pb !== yo) sa.push(Oa); | |
else { | |
var Md = Oa.margin, | |
Jf = Md.right + Md.left, | |
se = Md.top + Md.bottom; | |
Hk(Oa, Infinity, $e, 0, ib); | |
var be = Oa.Fa, | |
jd = Math.max(be.width + Jf, 0), | |
vh = Math.max(be.height + se, 0); | |
e.width += jd; | |
e.height = Math.max(e.height, vh) | |
} | |
} | |
} | |
var Kf = sa.length; | |
if (0 !== Kf) { | |
this.Ea.height ? $e = Math.min(this.Ea.height, this.rf.height) : 0 !== e.height && ($e = Math.min(e.height, this.rf.height)); | |
for (ab = 0; ab < Kf; ab++) | |
if (Oa = sa[ab], Oa.visible || Oa === oa) Md = Oa.margin, Jf = Md.right + Md.left, se = Md.top + Md.bottom, Hk(Oa, Infinity, $e, 0, ib), be = Oa.Fa, jd = Math.max(be.width + Jf, 0), vh = Math.max(be.height + se, 0), e.width += jd, e.height = Math.max(e.height, vh); | |
D.ya(sa) | |
} | |
break; | |
case "Spot": | |
a: { | |
var Ig = a, | |
Hb = b, | |
oc = c, | |
xd = d, | |
wh = m.length, | |
qb = this.Md(), | |
Pa = qb.margin, | |
Qb = 0, | |
Lf = 0, | |
Jg = Pa.right + Pa.left, | |
xh = Pa.top + Pa.bottom; | |
Hk(qb, Ig, Hb, oc, xd); | |
for (var jb = qb.Fa, zc = jb.width, $b = jb.height, te = Math.max(zc + Jg, 0), Ac = Math.max($b + xh, 0), Bc = this.yq, vb = D.vg(-Pa.left, -Pa.top, te, Ac), pc = !0, yb = Rp(this), Fc = 0; Fc < wh; Fc++) { | |
var eb = m[Fc]; | |
if (eb !== qb && (eb.visible || eb === yb)) { | |
Pa = eb.margin; | |
Qb = Pa.right + Pa.left; | |
Lf = Pa.top + Pa.bottom; | |
Hk(eb, Ig, Hb, 0, 0); | |
var jb = eb.Fa, | |
te = Math.max(jb.width + Qb, 0), | |
Ac = Math.max(jb.height + Lf, 0), | |
Ta = eb.alignment; | |
Ta.ld() && (Ta = this.pm); | |
Ta.Xc() || (Ta = mc); | |
var Mb = eb.Gh; | |
Mb.ld() && (Mb = mc); | |
var yd = null; | |
eb instanceof x && "" !== eb.dk && (eb.rc(0, | |
0, jb.width, jb.height), yd = eb.Nd(eb.dk), yd === eb && (yd = null)); | |
var lg, af; | |
if (null !== yd) { | |
for (var bf = yd.Ga, yj = yd.margin, Rb = D.Fb(Mb.x * bf.width + Mb.offsetX - yj.left, Mb.y * bf.height + Mb.offsetY - yj.top); yd !== eb;) yd.transform.vb(Rb), yd = yd.R; | |
lg = Ta.x * zc + Ta.offsetX - Rb.x; | |
af = Ta.y * $b + Ta.offsetY - Rb.y; | |
D.A(Rb) | |
} else lg = Ta.x * zc + Ta.offsetX - (Mb.x * jb.width - Mb.offsetX) - Pa.left, af = Ta.y * $b + Ta.offsetY - (Mb.y * jb.height - Mb.offsetY) - Pa.top; | |
pc ? (pc = !1, e.x = lg, e.y = af, e.width = te, e.height = Ac) : Ub(e, lg, af, te, Ac) | |
} | |
} | |
pc ? e.assign(vb) : Bc ? e.$F(vb.x, | |
vb.y, vb.width, vb.height) : Ub(e, vb.x, vb.y, vb.width, vb.height);D.Lb(vb); | |
var qc = qb.stretch;qc === wo && (qc = Mo(qb, !1)); | |
switch (qc) { | |
case Zj: | |
break a; | |
case Ye: | |
if (!isFinite(Ig) && !isFinite(Hb)) break a; | |
break; | |
case yo: | |
if (!isFinite(Ig)) break a; | |
break; | |
case xo: | |
if (!isFinite(Hb)) break a | |
} | |
jb = qb.Fa;zc = jb.width;$b = jb.height;te = Math.max(zc + Jg, 0);Ac = Math.max($b + xh, 0);Pa = qb.margin;vb = D.vg(-Pa.left, -Pa.top, te, Ac); | |
for (Fc = 0; Fc < wh; Fc++) eb = m[Fc], | |
eb === qb || !eb.visible && eb !== yb || (Pa = eb.margin, Qb = Pa.right + Pa.left, Lf = Pa.top + Pa.bottom, jb = | |
eb.Fa, te = Math.max(jb.width + Qb, 0), Ac = Math.max(jb.height + Lf, 0), Ta = eb.alignment, Ta.ld() && (Ta = this.pm), Ta.Xc() || (Ta = mc), Mb = eb.Gh, Mb.ld() && (Mb = mc), pc ? (pc = !1, e.x = Ta.x * zc + Ta.offsetX - (Mb.x * jb.width - Mb.offsetX) - Pa.left, e.y = Ta.y * $b + Ta.offsetY - (Mb.y * jb.height - Mb.offsetY) - Pa.top, e.width = te, e.height = Ac) : Ub(e, Ta.x * zc + Ta.offsetX - (Mb.x * jb.width - Mb.offsetX) - Pa.left, Ta.y * $b + Ta.offsetY - (Mb.y * jb.height - Mb.offsetY) - Pa.top, te, Ac));pc ? e.assign(vb) : Bc ? e.$F(vb.x, vb.y, vb.width, vb.height) : Ub(e, vb.x, vb.y, vb.width, vb.height); | |
D.Lb(vb) | |
} | |
break; | |
case "Auto": | |
var fc = a, | |
kd = b, | |
nb = c, | |
Sb = d, | |
ue = m.length, | |
zb = this.Md(), | |
ce = zb.margin, | |
yh = fc, | |
zh = kd, | |
Kg = ce.right + ce.left, | |
ld = ce.top + ce.bottom; | |
Hk(zb, fc, kd, nb, Sb); | |
var Nd = zb.Fa, | |
gc = 0, | |
Ab = null; | |
zb instanceof z && (Ab = zb, gc = Ab.mb * Ab.scale); | |
var zd = Math.max(Nd.width + Kg, 0), | |
ob = Math.max(Nd.height + ld, 0), | |
hc = Sp(zb), | |
ii = hc.x * zd + hc.offsetX, | |
ad = hc.y * ob + hc.offsetY, | |
Ib = Tp(zb), | |
ve = Ib.x * zd + Ib.offsetX, | |
cf = Ib.y * ob + Ib.offsetY; | |
isFinite(fc) && (yh = Math.max(Math.abs(ii - ve) - gc, 0)); | |
isFinite(kd) && (zh = Math.max(Math.abs(ad - cf) - gc, 0)); | |
var bd = | |
D.Im(); | |
bd.n(0, 0); | |
for (var Mf = Rp(this), Nf = 0; Nf < ue; Nf++) { | |
var Ah = m[Nf]; | |
if (Ah !== zb && (Ah.visible || Ah === Mf)) { | |
var ce = Ah.margin, | |
Kk = ce.right + ce.left, | |
Bb = ce.top + ce.bottom; | |
Hk(Ah, yh, zh, 0, 0); | |
Nd = Ah.Fa; | |
zd = Math.max(Nd.width + Kk, 0); | |
ob = Math.max(Nd.height + Bb, 0); | |
bd.n(Math.max(zd, bd.width), Math.max(ob, bd.height)) | |
} | |
} | |
if (1 === ue) e.width = zd, e.height = ob, D.$k(bd); | |
else { | |
var hc = Sp(zb), | |
Ib = Tp(zb), | |
de = 0, | |
md = 0; | |
Ib.x !== hc.x && Ib.y !== hc.y && (de = bd.width / Math.abs(Ib.x - hc.x), md = bd.height / Math.abs(Ib.y - hc.y)); | |
D.$k(bd); | |
gc = 0; | |
null !== Ab && (gc = Ab.mb * | |
Ab.scale, ak(Ab) === bk && (de = md = Math.max(de, md))); | |
var de = de + (Math.abs(hc.offsetX) + Math.abs(Ib.offsetX) + gc), | |
md = md + (Math.abs(hc.offsetY) + Math.abs(Ib.offsetY) + gc), | |
Me = zb.stretch; | |
Me === wo && (Me = Mo(zb, !1)); | |
switch (Me) { | |
case Zj: | |
Sb = nb = 0; | |
break; | |
case Ye: | |
isFinite(fc) && (de = fc); | |
isFinite(kd) && (md = kd); | |
break; | |
case yo: | |
isFinite(fc) && (de = fc); | |
Sb = 0; | |
break; | |
case xo: | |
nb = 0, isFinite(kd) && (md = kd) | |
} | |
zb.xq(); | |
Hk(zb, de, md, nb, Sb); | |
e.width = zb.Fa.width + Kg; | |
e.height = zb.Fa.height + ld | |
} | |
break; | |
case "Table": | |
for (var ji = a, ki = b, zj = c, Aj = d, Jb = m.length, Bh = D.nb(), | |
Ch = D.nb(), ka = 0; ka < Jb; ka++) { | |
var ba = m[ka], | |
ic = ba instanceof x ? ba : null; | |
if (null === ic || ic.type !== Ro && ic.type !== So || !ba.visible) Bh.push(ba); | |
else { | |
v && (ic.Ea.H() && D.k(ic.toString() + " TableRow/TableColumn Panels cannot set a desiredSize: " + ic.Ea.toString()), ic.ah.O(Xd) || D.k(ic.toString() + " TableRow/TableColumn Panels cannot set a minSize: " + ic.ah.toString()), ic.rf.O(ge) || D.k(ic.toString() + " TableRow/TableColumn Panels cannot set a maxSize: " + ic.rf.toString())); | |
Ch.push(ic); | |
for (var mg = ic.xa.o, li = mg.length, Kb = | |
0; Kb < li; Kb++) { | |
var mi = mg[Kb]; | |
ic.type === Ro ? mi.Tb = ba.Tb : ic.type === So && (mi.column = ba.column); | |
Bh.push(mi) | |
} | |
} | |
} | |
Jb = Bh.length; | |
0 === Jb && (this.pe(0), this.oe(0)); | |
for (var Xb = [], ka = 0; ka < Jb; ka++) ba = Bh[ka], km(ba, !0), No(ba, !0), Xb[ba.Tb] || (Xb[ba.Tb] = []), Xb[ba.Tb][ba.column] || (Xb[ba.Tb][ba.column] = []), Xb[ba.Tb][ba.column].push(ba); | |
D.ya(Bh); | |
for (var df = D.nb(), Ne = D.nb(), ef = D.nb(), we = { | |
count: 0 | |
}, xe = { | |
count: 0 | |
}, cd = ji, Od = ki, Dh = this.hd, Jb = Dh.length, ka = 0; ka < Jb; ka++) { | |
var Z = Dh[ka]; | |
void 0 !== Z && (Z.hb = 0) | |
} | |
Dh = this.cd; | |
Jb = Dh.length; | |
for (ka = | |
0; ka < Jb; ka++) Z = Dh[ka], void 0 !== Z && (Z.hb = 0); | |
for (var nd = Xb.length, ng = 0, ka = 0; ka < nd; ka++) Xb[ka] && (ng = Math.max(ng, Xb[ka].length)); | |
for (var ni = Math.min(this.xj, nd - 1), Eh = Math.min(this.hj, ng - 1), rc = 0, nd = Xb.length, Fh = Rp(this), ka = 0; ka < nd; ka++) | |
if (Xb[ka]) | |
for (var ng = Xb[ka].length, rb = this.pe(ka), Kb = rb.hb = 0; Kb < ng; Kb++) | |
if (Xb[ka][Kb]) { | |
var sb = this.oe(Kb); | |
void 0 === df[Kb] && (sb.hb = 0, df[Kb] = !0); | |
for (var nm = Xb[ka][Kb], ff = nm.length, Lk = 0; Lk < ff; Lk++) | |
if (ba = nm[Lk], ba.visible || ba === Fh) { | |
var oi = 1 < ba.tj || 1 < ba.Si; | |
oi && (ka < ni || Kb < Eh || | |
Ne.push(ba)); | |
var Cc = ba.margin, | |
Of = Cc.right + Cc.left, | |
og = Cc.top + Cc.bottom, | |
Tb = $o(ba, rb, sb, !1), | |
gf = ba.Ea, | |
Mk = !isNaN(gf.height), | |
om = !isNaN(gf.width) && Mk; | |
oi || Tb === Zj || om || ka < ni || Kb < Eh || (void 0 !== we[Kb] || Tb !== Ye && Tb !== yo || (we[Kb] = -1, we.count++), void 0 !== xe[ka] || Tb !== Ye && Tb !== xo || (xe[ka] = -1, xe.count++), ef.push(ba)); | |
Hk(ba, Infinity, Infinity, 0, 0); | |
if (!(ka < ni || Kb < Eh)) { | |
var Pf = ba.Fa, | |
hf = Math.max(Pf.width + Of, 0), | |
jf = Math.max(Pf.height + og, 0); | |
if (1 === ba.tj && (Tb === Zj || Tb === yo)) { | |
var Z = this.pe(ka), | |
sc = Z.kf(), | |
rc = Math.max(jf - Z.hb, | |
0); | |
rc + sc > Od && (rc = Math.max(Od - sc, 0)); | |
var pg = 0 === Z.hb; | |
Z.hb += rc; | |
Od = Math.max(Od - (rc + (pg ? sc : 0)), 0) | |
} | |
1 !== ba.Si || Tb !== Zj && Tb !== xo || (Z = this.oe(Kb), sc = Z.kf(), rc = Math.max(hf - Z.hb, 0), rc + sc > cd && (rc = Math.max(cd - sc, 0)), pg = 0 === Z.hb, Z.hb += rc, cd = Math.max(cd - (rc + (pg ? sc : 0)), 0)); | |
oi && ba.xq() | |
} | |
} | |
} | |
D.ya(df); | |
for (var Gc = 0, Fb = 0, Jb = this.fq, ka = 0; ka < Jb; ka++) { | |
var pi = this.cd[ka]; | |
void 0 !== pi && (Gc += pi.Ya, 0 !== pi.Ya && (Gc += pi.kf())) | |
} | |
Jb = this.Tq; | |
for (ka = 0; ka < Jb; ka++) { | |
var Lg = this.hd[ka]; | |
void 0 !== Lg && (Fb += Lg.Ya, 0 !== Lg.Ya && (Fb += Lg.kf())) | |
} | |
for (var cd = | |
Math.max(ji - Gc, 0), Bj = Od = Math.max(ki - Fb, 0), up = cd, Jb = ef.length, ka = 0; ka < Jb; ka++) { | |
var ba = ef[ka], | |
rb = this.pe(ba.Tb), | |
sb = this.oe(ba.column), | |
Mg = ba.Fa, | |
Cc = ba.margin, | |
Of = Cc.right + Cc.left, | |
og = Cc.top + Cc.bottom; | |
we[ba.column] = 0 === sb.hb && void 0 !== we[ba.column] ? Math.max(Mg.width + Of, we[ba.column]) : null; | |
xe[ba.Tb] = 0 === rb.hb && void 0 !== xe[ba.Tb] ? Math.max(Mg.height + og, xe[ba.Tb]) : null | |
} | |
var Qf = 0, | |
Ng = 0, | |
Og; | |
for (Og in xe) "count" !== Og && (Qf += xe[Og]); | |
for (Og in we) "count" !== Og && (Ng += we[Og]); | |
for (var tb = D.Im(), ka = 0; ka < Jb; ka++) | |
if (ba = ef[ka], | |
ba.visible || ba === Fh) { | |
var rb = this.pe(ba.Tb), | |
sb = this.oe(ba.column), | |
ac = 0; | |
isFinite(sb.width) ? ac = sb.width : (ac = isFinite(cd) && null !== we[ba.column] ? 0 === Ng ? sb.hb + cd : we[ba.column] / Ng * up : null !== we[ba.column] ? cd : sb.hb || cd, ac = Math.max(0, ac - sb.kf())); | |
var Hc = 0; | |
isFinite(rb.height) ? Hc = rb.height : (Hc = isFinite(Od) && null !== xe[ba.Tb] ? 0 === Qf ? rb.hb + Od : xe[ba.Tb] / Qf * Bj : null !== xe[ba.Tb] ? Od : rb.hb || Od, Hc = Math.max(0, Hc - rb.kf())); | |
tb.n(Math.max(sb.Th, Math.min(ac, sb.te)), Math.max(rb.Th, Math.min(Hc, rb.te))); | |
Tb = $o(ba, rb, sb, !1); | |
switch (Tb) { | |
case yo: | |
tb.height = | |
Math.max(tb.height, rb.hb + Od); | |
break; | |
case xo: | |
tb.width = Math.max(tb.width, sb.hb + cd) | |
} | |
Cc = ba.margin; | |
Of = Cc.right + Cc.left; | |
og = Cc.top + Cc.bottom; | |
ba.xq(); | |
Hk(ba, tb.width, tb.height, sb.Th, rb.Th); | |
Pf = ba.Fa; | |
hf = Math.max(Pf.width + Of, 0); | |
jf = Math.max(Pf.height + og, 0); | |
isFinite(cd) && (hf = Math.min(hf, tb.width)); | |
isFinite(Od) && (jf = Math.min(jf, tb.height)); | |
var kf = 0, | |
kf = rb.hb; | |
rb.hb = Math.max(rb.hb, jf); | |
rc = rb.hb - kf; | |
Od = Math.max(Od - rc, 0); | |
kf = sb.hb; | |
sb.hb = Math.max(sb.hb, hf); | |
rc = sb.hb - kf; | |
cd = Math.max(cd - rc, 0) | |
} | |
D.ya(ef); | |
var Pd = D.Im(), | |
Jb = Ne.length; | |
if (0 !== Jb) | |
for (var Ad = D.nb(), lf = D.nb(), ka = 0; ka < nd; ka++) | |
if (Xb[ka]) | |
for (ng = Xb[ka].length, rb = this.pe(ka), Ad[ka] = rb.hb, Kb = 0; Kb < ng; Kb++) Xb[ka][Kb] && (sb = this.oe(Kb), lf[Kb] = sb.hb); | |
for (ka = 0; ka < Jb; ka++) | |
if (ba = Ne[ka], ba.visible || ba === Fh) { | |
rb = this.pe(ba.Tb); | |
sb = this.oe(ba.column); | |
tb.n(Math.max(sb.Th, Math.min(ji, sb.te)), Math.max(rb.Th, Math.min(ki, rb.te))); | |
Tb = $o(ba, rb, sb, !1); | |
switch (Tb) { | |
case Ye: | |
0 !== lf[sb.index] && (tb.width = Math.min(tb.width, lf[sb.index])); | |
0 !== Ad[rb.index] && (tb.height = Math.min(tb.height, Ad[rb.index])); | |
break; | |
case yo: | |
0 !== lf[sb.index] && (tb.width = Math.min(tb.width, lf[sb.index])); | |
break; | |
case xo: | |
0 !== Ad[rb.index] && (tb.height = Math.min(tb.height, Ad[rb.index])) | |
} | |
isFinite(sb.width) && (tb.width = sb.width); | |
isFinite(rb.height) && (tb.height = rb.height); | |
Pd.n(0, 0); | |
for (var fb = 1; fb < ba.tj && !(ba.Tb + fb >= this.Tq); fb++) Z = this.pe(ba.Tb + fb), rc = Tb === Ye || Tb === xo ? Math.max(Z.Th, 0 === Ad[ba.Tb + fb] ? Z.te : Math.min(Ad[ba.Tb + fb], Z.te)) : Math.max(Z.Th, isNaN(Z.wf) ? Z.te : Math.min(Z.wf, Z.te)), Pd.height += rc; | |
for (fb = 1; fb < ba.Si && !(ba.column + fb >= this.fq); fb++) Z = | |
this.oe(ba.column + fb), rc = Tb === Ye || Tb === yo ? Math.max(Z.Th, 0 === lf[ba.column + fb] ? Z.te : Math.min(lf[ba.column + fb], Z.te)) : Math.max(Z.Th, isNaN(Z.wf) ? Z.te : Math.min(Z.wf, Z.te)), Pd.width += rc; | |
tb.width += Pd.width; | |
tb.height += Pd.height; | |
Cc = ba.margin; | |
Of = Cc.right + Cc.left; | |
og = Cc.top + Cc.bottom; | |
Hk(ba, tb.width, tb.height, zj, Aj); | |
for (var Pf = ba.Fa, hf = Math.max(Pf.width + Of, 0), jf = Math.max(Pf.height + og, 0), mf = 0, fb = 0; fb < ba.tj && !(ba.Tb + fb >= this.Tq); fb++) Z = this.pe(ba.Tb + fb), mf += Z.total || 0; | |
if (mf < jf) { | |
var od = jf - mf, | |
Pg = jf - mf; | |
if (null !== ba.Vy) | |
for (var nf = | |
ba.Vy, fb = 0; fb < ba.tj && !(0 >= od) && !(ba.Tb + fb >= this.Tq); fb++) { | |
var Z = this.pe(ba.Tb + fb), | |
Ic = Z.Ya || 0, | |
Rf = nf(ba, Z, Pg); | |
v && "number" !== typeof Rf && D.k(ba + " spanAllocation does not return a number: " + Rf); | |
Z.hb = Math.min(Z.te, Ic + Rf); | |
Z.Ya !== Ic && (od -= Z.Ya - Ic) | |
} | |
for (; 0 < od;) { | |
Ic = Z.Ya || 0; | |
isNaN(Z.height) && Z.te > Ic && (Z.hb = Math.min(Z.te, Ic + od), Z.Ya !== Ic && (od -= Z.Ya - Ic)); | |
if (0 === Z.index) break; | |
Z = this.pe(Z.index - 1) | |
} | |
} | |
for (var Oe = 0, fb = 0; fb < ba.Si && !(ba.column + fb >= this.fq); fb++) Z = this.oe(ba.column + fb), Oe += Z.total || 0; | |
if (Oe < hf) { | |
od = hf - Oe; | |
Pg = hf - Oe; | |
if (null !== ba.Vy) | |
for (nf = ba.Vy, fb = 0; fb < ba.Si && !(0 >= od) && !(ba.column + fb >= this.fq); fb++) Z = this.oe(ba.column + fb), Ic = Z.Ya || 0, Rf = nf(ba, Z, Pg), v && "number" !== typeof Rf && D.k(ba + " spanAllocation does not return a number: " + Rf), Z.hb = Math.min(Z.te, Ic + Rf), Z.Ya !== Ic && (od -= Z.Ya - Ic); | |
for (; 0 < od;) { | |
Ic = Z.Ya || 0; | |
isNaN(Z.width) && Z.te > Ic && (Z.hb = Math.min(Z.te, Ic + od), Z.Ya !== Ic && (od -= Z.Ya - Ic)); | |
if (0 === Z.index) break; | |
Z = this.oe(Z.index - 1) | |
} | |
} | |
} | |
D.ya(Ne); | |
D.$k(Pd); | |
D.$k(tb); | |
void 0 !== Ad && D.ya(Ad); | |
void 0 !== lf && D.ya(lf); | |
for (var Qg = | |
0, Rg = 0, Tb = Mo(this, !0), Cj = this.Ea, Nk = this.rf, ye = Fb = Gc = 0, dd = 0, Jb = this.fq, ka = 0; ka < Jb; ka++) void 0 !== this.cd[ka] && (Z = this.oe(ka), isFinite(Z.width) ? (ye += Z.width, ye += Z.kf()) : Up(Z) === Vp ? (ye += Z.Ya, ye += Z.kf()) : 0 !== Z.Ya && (Gc += Z.Ya, Gc += Z.kf())); | |
var Qg = isFinite(Cj.width) ? Math.min(Cj.width, Nk.width) : Tb !== Zj && isFinite(ji) ? ji : Gc, | |
Qg = Math.max(Qg, this.ah.width), | |
Qg = Math.max(Qg - ye, 0), | |
Ok = Math.max(Qg / Gc, 1); | |
isFinite(Ok) || (Ok = 1); | |
for (ka = 0; ka < Jb; ka++) void 0 !== this.cd[ka] && (Z = this.oe(ka), isFinite(Z.width) || Up(Z) === Vp || (Z.hb = | |
Z.Ya * Ok), Z.position = e.width, 0 !== Z.Ya && (e.width += Z.Ya, e.width += Z.kf())); | |
Jb = this.Tq; | |
for (ka = 0; ka < Jb; ka++) void 0 !== this.hd[ka] && (Z = this.pe(ka), isFinite(Z.height) ? (dd += Z.height, dd += Z.kf()) : Up(Z) === Vp ? (dd += Z.Ya, dd += Z.kf()) : 0 !== Z.Ya && (Fb += Z.Ya, 0 !== Z.Ya && (Fb += Z.kf()))); | |
var Rg = isFinite(Cj.height) ? Math.min(Cj.height, Nk.height) : Tb !== Zj && isFinite(ki) ? ki : Fb, | |
Rg = Math.max(Rg, this.ah.height), | |
Rg = Math.max(Rg - dd, 0), | |
Gh = Math.max(Rg / Fb, 1); | |
isFinite(Gh) || (Gh = 1); | |
for (ka = 0; ka < Jb; ka++) void 0 !== this.hd[ka] && (Z = this.pe(ka), isFinite(Z.height) || | |
Up(Z) === Vp || (Z.hb = Z.Ya * Gh), Z.position = e.height, 0 !== Z.Ya && (e.height += Z.Ya, 0 !== Z.Ya && (e.height += Z.kf()))); | |
Jb = Ch.length; | |
for (ka = 0; ka < Jb; ka++) { | |
var pd = Ch[ka]; | |
pd.type === Ro ? (ac = e.width, Z = this.pe(pd.Tb), Hc = Z.hb) : (Z = this.oe(pd.column), ac = Z.hb, Hc = e.height); | |
pd.Fd.n(0, 0, ac, Hc); | |
km(pd, !1); | |
Xb[pd.Tb] || (Xb[pd.Tb] = []); | |
Xb[pd.Tb][pd.column] || (Xb[pd.Tb][pd.column] = []); | |
Xb[pd.Tb][pd.column].push(pd) | |
} | |
D.ya(Ch); | |
this.wt = Xb; | |
break; | |
case "Viewbox": | |
var Dj = a, | |
qm = b, | |
rt = c, | |
st = d; | |
1 < m.length && D.k("Viewbox Panel cannot contain more than one GraphObject."); | |
var of = m[0]; of .Db = 1; of .xq(); | |
Hk( of , Infinity, Infinity, rt, st); | |
var Pk = of .Fa, | |
rm = of .margin, | |
tt = rm.right + rm.left, | |
ut = rm.top + rm.bottom; | |
if (isFinite(Dj) || isFinite(qm)) { | |
var jw = of .scale, | |
sm = Pk.width, | |
tm = Pk.height, | |
vt = Math.max(Dj - tt, 0), | |
wt = Math.max(qm - ut, 0), | |
Qk = 1; | |
this.Wp === bk ? 0 !== sm && 0 !== tm && (Qk = Math.min(vt / sm, wt / tm)) : 0 !== sm && 0 !== tm && (Qk = Math.max(vt / sm, wt / tm)); | |
0 === Qk && (Qk = 1E-4); of .Db *= Qk; | |
jw !== of .scale && (km( of , !0), Hk( of , Infinity, Infinity, rt, st)) | |
} | |
Pk = of .Fa; | |
e.width = isFinite(Dj) ? Dj : Math.max(Pk.width + tt, 0); | |
e.height = isFinite(qm) ? | |
qm : Math.max(Pk.height + ut, 0); | |
break; | |
case "Link": | |
var xt = m.length; | |
if (this instanceof da || this instanceof J) { | |
var ri = null; | |
this instanceof J && (ri = this); | |
this instanceof da && (ri = this.hf); | |
if (ri instanceof J) { | |
var Rk = ri; | |
if (0 === xt) { | |
var um = this.Ga; | |
Cb(um, 0, 0); | |
var ze = this.Fa; | |
ze.n(0, 0, 0, 0) | |
} else { | |
var vm = this instanceof da ? null : ri.path, | |
Sg = ri.uo, | |
pf = this.yj; | |
pf.assign(Sg); | |
pf.x = 0; | |
pf.y = 0; | |
var Hh = Rk.points, | |
si = ri.ta; | |
this.Wu(!1); | |
var yt = Sg.width, | |
zt = Sg.height; | |
this.jj.n(Sg.x, Sg.y); | |
null === this.oh && (this.oh = new K(C)); | |
this.oh.clear(); | |
null !== vm && (Wp(vm, yt, zt, this), ze = vm.Fa, pf.Zh(ze), this.oh.add(ze)); | |
for (var Tg = D.hh(), Sk = D.P(), Ug = D.P(), vp = 0; vp < xt; vp++) { | |
var Yb = m[vp]; | |
if (Yb !== vm) | |
if (Yb.Ve && Yb instanceof z) Wp(Yb, yt, zt, this), ze = Yb.Fa, pf.Zh(ze), this.oh.add(ze); | |
else if (2 > si) Hk(Yb, Infinity, Infinity), ze = Yb.Fa, pf.Zh(ze), this.oh.add(ze); | |
else { | |
var Bd = Yb.We, | |
Bt = Yb.VB, | |
wp = Yb.Gh; | |
wp.ee() && (wp = mc); | |
var qg = Yb.Uq, | |
kw = Yb.WB, | |
Tk = 0, | |
Uk = 0, | |
wm = 0; | |
if (Bd < -si || Bd >= si) { | |
var Ct = Rk.vG, | |
Sf = Rk.uG; | |
qg !== vj && (wm = Rk.computeAngle(Yb, qg, Sf), Yb.wg = wm); | |
Tk = Ct.x - Sg.x; | |
Uk = Ct.y - Sg.y | |
} else { | |
var Qd, | |
qf; | |
if (0 <= Bd) Qd = Hh.fa(Bd), qf = Bd < si - 1 ? Hh.fa(Bd + 1) : Qd; | |
else { | |
var ti = si + Bd; | |
Qd = Hh.fa(ti); | |
qf = 0 < ti ? Hh.fa(ti - 1) : Qd | |
} | |
if (Qd.Wc(qf)) { | |
var ui, vi; | |
0 <= Bd ? (ui = 0 < Bd ? Hh.fa(Bd - 1) : Qd, vi = Bd < si - 2 ? Hh.fa(Bd + 2) : qf) : (ui = ti < si - 1 ? Hh.fa(ti + 1) : Qd, vi = 1 < ti ? Hh.fa(ti - 2) : qf); | |
var Dt = ui.Kf(Qd), | |
Et = qf.Kf(vi), | |
Sf = Dt > Et + 10 ? 0 <= Bd ? ui.Xb(Qd) : Qd.Xb(ui) : Et > Dt + 10 ? 0 <= Bd ? qf.Xb(vi) : vi.Xb(qf) : 0 <= Bd ? ui.Xb(vi) : vi.Xb(ui) | |
} else Sf = 0 <= Bd ? Qd.Xb(qf) : qf.Xb(Qd); | |
qg !== vj && (wm = Rk.computeAngle(Yb, qg, Sf), Yb.wg = wm); | |
Tk = Qd.x + (qf.x - Qd.x) * Bt - Sg.x; | |
Uk = Qd.y + (qf.y - Qd.y) * Bt - Sg.y | |
} | |
Hk(Yb, | |
Infinity, Infinity); | |
var ze = Yb.Fa, | |
um = Yb.Ga, | |
Vk = 0; | |
Yb instanceof z && (Vk = Yb.mb); | |
var wi = um.width + Vk, | |
Ej = um.height + Vk; | |
Tg.reset(); | |
Tg.translate(-ze.x, -ze.y); | |
Tg.scale(Yb.scale, Yb.scale); | |
Tg.rotate(qg === vj ? Yb.angle : Sf, wi / 2, Ej / 2); | |
qg !== Xp && qg !== Yp || Tg.rotate(90, wi / 2, Ej / 2); | |
qg !== Zp && qg !== $p || Tg.rotate(-90, wi / 2, Ej / 2); | |
qg === aq && (45 < Sf && 135 > Sf || 225 < Sf && 315 > Sf) && Tg.rotate(-Sf, wi / 2, Ej / 2); | |
var Fj = new C(0, 0, wi, Ej); | |
Sk.vo(Fj, wp); | |
Tg.vb(Sk); | |
var lw = -Sk.x + Vk / 2 * Yb.scale, | |
mw = -Sk.y + Vk / 2 * Yb.scale; | |
Ug.assign(kw); | |
isNaN(Ug.x) && (Ug.x = 0 <= Bd ? | |
wi / 2 + 3 : -(wi / 2 + 3)); | |
isNaN(Ug.y) && (Ug.y = -(Ej / 2 + 3)); | |
Ug.rotate(Sf); | |
Tk += Ug.x; | |
Uk += Ug.y; | |
Fj.set(ze); | |
Fj.x = Tk + lw; | |
Fj.y = Uk + mw; | |
this.oh.add(Fj); | |
pf.Zh(Fj) | |
} | |
} | |
if (this instanceof J) | |
for (var Ft = this.Cf; Ft.next();) Hk(Ft.value, Infinity, Infinity); | |
this.yj = pf; | |
var xp = this.jj; | |
xp.n(xp.x + pf.x, xp.y + pf.y); | |
Cb(e, pf.width || 0, pf.height || 0); | |
D.nf(Tg); | |
D.A(Sk); | |
D.A(Ug) | |
} | |
} | |
} | |
break; | |
case "Grid": | |
break; | |
case "Graduated": | |
var nw = a, | |
ow = b, | |
pw = c, | |
qw = d, | |
Vg = this.Md(); | |
this.Vm = []; | |
var Gj = Vg.margin, | |
rw = Gj.right + Gj.left, | |
sw = Gj.top + Gj.bottom; | |
Hk(Vg, nw, ow, pw, qw); | |
var Gt = | |
Vg.Fa, | |
tw = Gt.height, | |
uw = Math.max(Gt.width + rw, 0), | |
vw = Math.max(tw + sw, 0), | |
Ht = new C(-Gj.left, -Gj.top, uw, vw); | |
this.Vm.push(Ht); | |
e.assign(Ht); | |
for (var $k = Vg.xf, It = Vg.mb, yp = $k.$x, Hj = $k.uu, xi = $k.vu, ww = yp.length, zp = 0, Ap = 0, Ij = D.nb(), Bp = 0; Bp < ww; Bp++) { | |
for (var Cp = yp[Bp], Jt = [], Ap = zp = 0, xw = Cp.length, Jj = 0; Jj < xw; Jj += 2) { | |
var Kt = Cp[Jj], | |
Lt = Cp[Jj + 1]; | |
if (0 !== Jj) { | |
var Cd = 180 * Math.atan2(Lt - Ap, Kt - zp) / Math.PI; | |
0 > Cd && (Cd += 360); | |
Jt.push(Cd) | |
} | |
zp = Kt; | |
Ap = Lt | |
} | |
Ij.push(Jt) | |
} | |
var Mt; | |
if (null === this.qk) { | |
for (var Nt = [], Dp = this.xa.o, Ot = Dp.length, Ep = 0; Ep < | |
Ot; Ep++) { | |
var al = Dp[Ep], | |
Pt = []; | |
Nt.push(Pt); | |
if (al.visible) | |
for (var yw = al.interval, Fp = 0; Fp < Ot; Fp++) { | |
var bl = Dp[Fp]; | |
if (bl.visible && al !== bl && !(al instanceof z && !(bl instanceof z) || al instanceof pa && !(bl instanceof pa))) { | |
var Qt = bl.interval; | |
Qt > yw && Pt.push(Qt) | |
} | |
} | |
} | |
this.qk = Nt | |
} | |
Mt = this.qk; | |
var Rt = this.xa.o, | |
zw = Rt.length, | |
Ih = 0, | |
St = 0, | |
Tt = xi; | |
this.Xm = []; | |
for (var ym = [], zm = 0; zm < zw; zm++) { | |
var Jh = Rt[zm], | |
ym = []; | |
if (Jh.visible && Jh !== Vg) { | |
var Ut = Jh.interval, | |
Vt = this.fB; | |
if (!(2 > Vt * Ut * xi / this.Du)) { | |
var ee = this.TF, | |
Wt = Mt[zm], | |
yi = Hj[0][0], | |
Tf = | |
0, | |
Dd = 0, | |
St = xi * Jh.SF - 1E-4, | |
Tt = xi * Jh.QF + 1E-4, | |
Kj = Vt * Ut; | |
if (ee < this.bl) var zi = (this.bl - ee) / Kj, | |
zi = 0 === zi % 1 ? zi : Math.floor(zi + 1), | |
ee = ee + zi * Kj; | |
else ee > this.bl + Kj && (zi = Math.floor((ee - this.bl) / Kj), ee -= zi * Kj); | |
for (; ee <= this.eB;) { | |
var Gp; | |
a: { | |
for (var Aw = Wt.length, Hp = 0; Hp < Aw; Hp++) | |
if (Eb((ee - this.TF) % (Wt[Hp] * this.fB), 0)) { | |
Gp = !1; | |
break a | |
} | |
Gp = !0 | |
} | |
if (Gp && (Ih = (ee - this.bl) * xi / this.Du, Ih > xi && (Ih = xi), St <= Ih && Ih <= Tt)) { | |
for (var Cd = Ij[Tf][Dd], Lj = Hj[Tf][Dd]; Tf < Hj.length;) { | |
for (; Ih > yi && Dd < Hj[Tf].length - 1;) Dd++, Cd = Ij[Tf][Dd], Lj = Hj[Tf][Dd], | |
yi += Lj; | |
if (Ih <= yi) break; | |
Tf++; | |
Dd = 0; | |
Cd = Ij[Tf][Dd]; | |
Lj = Hj[Tf][Dd]; | |
yi += Lj | |
} | |
var Rd = yp[Tf], | |
Xt = Rd[2 * Dd], | |
Yt = Rd[2 * Dd + 1], | |
Am = (Ih - (yi - Lj)) / Lj, | |
Ip = new N(Xt + (Rd[2 * Dd + 2] - Xt) * Am + It / 2 - $k.ib.x, Yt + (Rd[2 * Dd + 3] - Yt) * Am + It / 2 - $k.ib.y); | |
Ip.scale(Vg.scale, Vg.scale); | |
var rg = Cd, | |
Mj = Ij[Tf]; | |
1E-4 > Am ? 0 < Dd ? rg = Mj[Dd - 1] : Eb(Rd[0], Rd[Rd.length - 2]) && Eb(Rd[1], Rd[Rd.length - 1]) && (rg = Mj[Mj.length - 1]) : .9999 < Am && (Dd + 1 < Mj.length ? rg = Mj[Dd + 1] : Eb(Rd[0], Rd[Rd.length - 2]) && Eb(Rd[1], Rd[Rd.length - 1]) && (rg = Mj[0])); | |
Cd !== rg && (180 < Math.abs(Cd - rg) && (Cd < rg ? Cd += | |
360 : rg += 360), Cd = (Cd + rg) / 2 % 360); | |
if (Jh instanceof pa) { | |
var Bm = "", | |
Bm = null !== Jh.RF ? Jh.RF(ee) : (+ee.toFixed(2)).toString(); | |
v && D.h(Bm, "string"); | |
"" !== Bm && ym.push([Ip, Cd, Bm]) | |
} else ym.push([Ip, Cd]) | |
} | |
ee += Kj | |
} | |
} | |
} | |
this.Xm.push(ym) | |
} | |
D.ya(Ij); | |
for (var Bw = this.Xm, Cw = m.length, Cm = 0; Cm < Cw; Cm++) { | |
var Ai = m[Cm], | |
Jp = Bw[Cm]; | |
if (Ai.visible && Ai !== Vg && 0 !== Jp.length) { | |
if (Ai instanceof z) { | |
var Kh = Ai, | |
Zt = Jp, | |
Dw = e, | |
Kp = Kh.Gh; | |
Kp.ee() && (Kp = jc); | |
var Ew = Kh.angle; | |
Kh.wg = 0; | |
Hk(Kh, Infinity, Infinity); | |
Kh.wg = Ew; | |
var $t = Kh.Fa, | |
Lp = $t.width, | |
Mp = $t.height, | |
au = D.vg(0, | |
0, Lp, Mp), | |
fe = D.P(); | |
fe.vo(au, Kp); | |
D.Lb(au); | |
for (var Dm = -fe.x, Em = -fe.y, Bi = new C, Fw = Zt.length, Fm = 0; Fm < Fw; Fm++) | |
for (var Np = Zt[Fm], bu = Np[0].x, cu = Np[0].y, du = Np[1], Gm = 0; 4 > Gm; Gm++) { | |
switch (Gm) { | |
case 0: | |
fe.n(Dm, Em); | |
break; | |
case 1: | |
fe.n(Dm + Lp, Em); | |
break; | |
case 2: | |
fe.n(Dm, Em + Mp); | |
break; | |
case 3: | |
fe.n(Dm + Lp, Em + Mp) | |
} | |
fe.rotate(du + Kh.angle); | |
fe.offset(bu, cu); | |
0 === Fm && 0 === Gm ? Bi.n(fe.x, fe.y, 0, 0) : Bi.Mi(fe); | |
fe.offset(-bu, -cu); | |
fe.rotate(-du - Kh.angle) | |
} | |
D.A(fe); | |
this.Vm.push(Bi); | |
Ub(Dw, Bi.x, Bi.y, Bi.width, Bi.height) | |
} else if (Ai instanceof pa) { | |
var Hm = | |
Ai, | |
eu = Jp, | |
Gw = e; | |
null === this.Jk && (this.Jk = new pa); | |
var Uf = this.Jk; | |
rp(Hm, Uf); | |
var Op = Hm.Gh; | |
Op.ee() && (Op = jc); | |
for (var Lh = Hm.Uq, Hw = Hm.WB, Ci = null, Im = 0, Jm = 0, Wg = 0, Pp = 0, Iw = eu.length, Km = 0; Km < Iw; Km++) { | |
var sg = eu[Km], | |
Im = sg[0].x, | |
Jm = sg[0].y, | |
Wg = sg[1]; | |
Lh !== vj && (Pp = J.computeAngle(Lh, Wg), Uf.wg = Pp); | |
Uf.text = sg[2]; | |
Hk(Uf, Infinity, Infinity); | |
var Mh = Uf.Fa, | |
Nj = Uf.Ga, | |
Oj = Nj.width, | |
Pj = Nj.height, | |
Xg = D.hh(); | |
Xg.reset(); | |
Xg.translate(-Mh.x, -Mh.y); | |
Xg.scale(Uf.scale, Uf.scale); | |
Xg.rotate(Lh === vj ? Uf.angle : Wg, Oj / 2, Pj / 2); | |
Lh !== Xp && Lh !== Yp || Xg.rotate(90, | |
Oj / 2, Pj / 2); | |
Lh !== Zp && Lh !== $p || Xg.rotate(-90, Oj / 2, Pj / 2); | |
Lh === aq && (45 < Wg && 135 > Wg || 225 < Wg && 315 > Wg) && Xg.rotate(-Wg, Oj / 2, Pj / 2); | |
var fu = D.vg(0, 0, Oj, Pj), | |
cl = D.P(); | |
cl.vo(fu, Op); | |
Xg.vb(cl); | |
var Jw = -cl.x, | |
Kw = -cl.y, | |
Yg = D.P(); | |
Yg.assign(Hw); | |
isNaN(Yg.x) && (Yg.x = Oj / 2 + 3); | |
isNaN(Yg.y) && (Yg.y = -(Pj / 2 + 3)); | |
Yg.rotate(Wg); | |
var Im = Im + (Yg.x + Jw), | |
Jm = Jm + (Yg.y + Kw), | |
Qp = new C(Im, Jm, Mh.width, Mh.height), | |
Lw = new C(Mh.x, Mh.y, Mh.width, Mh.height), | |
Mw = new C(Nj.x, Nj.y, Nj.width, Nj.height), | |
gu = new bq; | |
gu.gq(Uf.uf); | |
sg.push(Pp); | |
sg.push(Uf.xe); | |
sg.push(gu); | |
sg.push(Qp); | |
sg.push(Lw); | |
sg.push(Mw); | |
0 === Km ? Ci = Qp.copy() : Ci.Zh(Qp); | |
D.A(Yg); | |
D.A(cl); | |
D.Lb(fu); | |
D.nf(Xg) | |
} | |
this.Vm.push(Ci); | |
Ub(Gw, Ci.x, Ci.y, Ci.width, Ci.height) | |
} | |
km(Ai, !1) | |
} | |
} | |
break; | |
case "TableRow": | |
case "TableColumn": | |
D.k(this.toString() + " is not an element of a Table Panel. TableRow and TableColumn Panels can only be elements of a Table Panel."); | |
break; | |
default: | |
D.k("Unknown panel type: " + n) | |
} | |
} | |
var rf = e.width, | |
sf = e.height, | |
Lm = this.padding, | |
Nw = Lm.top + Lm.bottom, | |
rf = rf + (Lm.left + Lm.right), | |
sf = sf + Nw; | |
isFinite(g.width) && (rf = | |
g.width); | |
isFinite(g.height) && (sf = g.height); | |
rf = Math.min(k.width, rf); | |
sf = Math.min(k.height, sf); | |
rf = Math.max(h.width, rf); | |
sf = Math.max(h.height, sf); | |
rf = Math.max(c, rf); | |
sf = Math.max(d, sf); | |
e.width = rf; | |
e.height = sf; | |
Cb(this.fd, rf, sf); | |
Jo(this, 0, 0, rf, sf) | |
}; | |
x.prototype.findMainElement = x.prototype.Md = function() { | |
if (null === this.Yl) { | |
var a = this.xa.o, | |
b = a.length; | |
if (0 === b) return null; | |
for (var c = 0; c < b; c++) { | |
var d = a[c]; | |
if (!0 === d.Ve) return this.Yl = d | |
} | |
this.Yl = a[0] | |
} | |
return this.Yl | |
}; | |
function Rp(a) { | |
return null !== a.Y ? a.Y.Df : null | |
} | |
x.prototype.Cj = function(a, b, c, d) { | |
var e = this.yj, | |
g = this.xa.o, | |
h = D.vg(0, 0, 0, 0); | |
if (0 === g.length) { | |
var k = this.aa; | |
k.x = a; | |
k.y = b; | |
k.width = c; | |
k.height = d | |
} else { | |
if (!this.Ea.H()) { | |
var l = Mo(this, !0), | |
m = this.Fd, | |
n = m.width, | |
p = m.height, | |
q = this.margin, | |
r = q.left + q.right, | |
s = q.top + q.bottom; | |
n === c && p === d && (l = Zj); | |
switch (l) { | |
case Zj: | |
if (n > c || p > d) this.K(), Hk(this, n > c ? c : n, p > d ? d : p); | |
break; | |
case Ye: | |
this.K(!0); | |
Hk(this, c + r, d + s, 0, 0); | |
break; | |
case yo: | |
this.K(!0); | |
Hk(this, c + r, p + s, 0, 0); | |
break; | |
case xo: | |
this.K(!0), Hk(this, n + r, d + s, 0, 0) | |
} | |
} | |
k = this.aa; | |
k.x = a; | |
k.y = | |
b; | |
k.width = c; | |
k.height = d; | |
var u = this.ca.ac; | |
switch (u) { | |
case "Position": | |
for (var t = g.length, y = e.x - this.padding.left, w = e.y - this.padding.top, A = 0; A < t; A++) { | |
var B = g[A], | |
P = B.Fa, | |
H = B.margin, | |
R = B.position.x, | |
aa = B.position.y; | |
h.x = isNaN(R) ? -y : R - y; | |
h.y = isNaN(aa) ? -w : aa - w; | |
if (B instanceof z) { | |
var V = B; | |
if (V.fG) { | |
var ea = V.mb / 2; | |
h.x -= ea; | |
h.y -= ea | |
} | |
} | |
h.x += H.left; | |
h.y += H.top; | |
h.width = P.width; | |
h.height = P.height; | |
B.visible && B.rc(h.x, h.y, h.width, h.height) | |
} | |
break; | |
case "Vertical": | |
for (var la = g.length, Da = this.padding.left, La = this.jG, hb = La ? e.height : | |
this.padding.top, Aa = 0; Aa < la; Aa++) { | |
var W = Da, | |
xb = g[Aa]; | |
if (xb.visible) { | |
var Pb = xb.Fa, | |
Sa = xb.margin, | |
Qc = Sa.left + Sa.right, | |
Ra = Da + this.padding.right, | |
jg = Pb.width, | |
kg = Mo(xb, !1); | |
if (isNaN(xb.Ea.width) && kg === Ye || kg === yo) jg = Math.max(e.width - Qc - Ra, 0); | |
var vd = jg + Qc + Ra, | |
wd = xb.alignment; | |
wd.ld() && (wd = this.pm); | |
wd.Xc() || (wd = mc); | |
La && (hb -= Pb.height + Sa.bottom + Sa.top); | |
xb.rc(W + wd.offsetX + Sa.left + (e.width * wd.x - vd * wd.x), hb + wd.offsetY + Sa.top, jg, Pb.height); | |
La || (hb += Pb.height + Sa.bottom + Sa.top) | |
} | |
} | |
break; | |
case "Horizontal": | |
for (var Rc = g.length, | |
uh = this.padding.top, $e = this.jG, ib = $e ? e.width : this.padding.left, ub = 0; ub < Rc; ub++) { | |
var sa = uh, | |
oa = g[ub]; | |
if (oa.visible) { | |
var ab = oa.Fa, | |
Oa = oa.margin, | |
pb = Oa.top + Oa.bottom, | |
Md = uh + this.padding.bottom, | |
Jf = ab.height, | |
se = Mo(oa, !1); | |
if (isNaN(oa.Ea.height) && se === Ye || se === xo) Jf = Math.max(e.height - pb - Md, 0); | |
var be = Jf + pb + Md, | |
jd = oa.alignment; | |
jd.ld() && (jd = this.pm); | |
jd.Xc() || (jd = mc); | |
$e && (ib -= ab.width + Oa.left + Oa.right); | |
oa.rc(ib + jd.offsetX + Oa.left, sa + jd.offsetY + Oa.top + (e.height * jd.y - be * jd.y), ab.width, Jf); | |
$e || (ib += ab.width + Oa.left + | |
Oa.right) | |
} | |
} | |
break; | |
case "Spot": | |
var vh = g.length, | |
Kf = this.Md(), | |
Ig = Kf.Fa, | |
Hb = Ig.width, | |
oc = Ig.height, | |
xd = this.padding, | |
wh = xd.left, | |
qb = xd.top; | |
h.x = wh - e.x; | |
h.y = qb - e.y; | |
Kf.rc(h.x, h.y, Hb, oc); | |
for (var Pa = 0; Pa < vh; Pa++) { | |
var Qb = g[Pa]; | |
if (Qb !== Kf) { | |
var Lf = Qb.Fa, | |
Jg = Lf.width, | |
xh = Lf.height, | |
jb = Qb.alignment; | |
jb.ld() && (jb = this.pm); | |
jb.Xc() || (jb = mc); | |
var zc = Qb.Gh; | |
zc.ld() && (zc = mc); | |
var $b = null; | |
Qb instanceof x && "" !== Qb.dk && ($b = Qb.Nd(Qb.dk), $b === Qb && ($b = null)); | |
if (null !== $b) { | |
for (var te = $b.Ga, Ac = D.Fb(zc.x * te.width + zc.offsetX, zc.y * te.height + | |
zc.offsetY); $b !== Qb;) $b.transform.vb(Ac), $b = $b.R; | |
h.x = jb.x * Hb + jb.offsetX - Ac.x; | |
h.y = jb.y * oc + jb.offsetY - Ac.y; | |
D.A(Ac) | |
} else h.x = jb.x * Hb + jb.offsetX - (zc.x * Jg - zc.offsetX), h.y = jb.y * oc + jb.offsetY - (zc.y * xh - zc.offsetY); | |
h.x -= e.x; | |
h.y -= e.y; | |
Qb.visible && Qb.rc(wh + h.x, qb + h.y, Jg, xh) | |
} | |
} | |
break; | |
case "Auto": | |
var Bc = g.length, | |
vb = this.Md(), | |
pc = vb.Fa, | |
yb = D.Sf(); | |
yb.n(0, 0, 1, 1); | |
var Fc = vb.margin, | |
eb = Fc.left, | |
Ta = Fc.top, | |
Mb = this.padding, | |
yd = Mb.left, | |
lg = Mb.top; | |
h.x = eb; | |
h.y = Ta; | |
h.width = pc.width; | |
h.height = pc.height; | |
vb.rc(yd + h.x, lg + h.y, h.width, h.height); | |
var af = Sp(vb), | |
bf = Tp(vb), | |
yj = 0 + af.y * pc.height + af.offsetY, | |
Rb = 0 + bf.x * pc.width + bf.offsetX, | |
qc = 0 + bf.y * pc.height + bf.offsetY; | |
yb.x = 0 + af.x * pc.width + af.offsetX; | |
yb.y = yj; | |
Ub(yb, Rb, qc, 0, 0); | |
yb.x += eb + yd; | |
yb.y += Ta + lg; | |
for (var fc = 0; fc < Bc; fc++) { | |
var kd = g[fc]; | |
if (kd !== vb) { | |
var nb = kd.Fa, | |
Fc = kd.margin, | |
Sb = Math.max(nb.width + Fc.right + Fc.left, 0), | |
ue = Math.max(nb.height + Fc.top + Fc.bottom, 0), | |
zb = kd.alignment; | |
zb.ld() && (zb = this.pm); | |
zb.Xc() || (zb = mc); | |
h.x = yb.width * zb.x + zb.offsetX - Sb * zb.x + Fc.left + yb.x; | |
h.y = yb.height * zb.y + zb.offsetY - ue * zb.y + Fc.top + | |
yb.y; | |
h.width = yb.width; | |
h.height = yb.height; | |
kd.visible && (Vb(yb.x, yb.y, yb.width, yb.height, h.x, h.y, nb.width, nb.height) ? kd.rc(h.x, h.y, nb.width, nb.height) : kd.rc(h.x, h.y, nb.width, nb.height, new C(yb.x, yb.y, yb.width, yb.height))) | |
} | |
} | |
D.Lb(yb); | |
break; | |
case "Table": | |
for (var ce = g.length, yh = this.padding, zh = yh.left, Kg = yh.top, ld = this.wt, Nd = 0, gc = 0, Ab = ld.length, zd = 0, ob = 0; ob < Ab; ob++) ld[ob] && (zd = Math.max(zd, ld[ob].length)); | |
for (var hc = Math.min(this.xj, Ab - 1); hc !== Ab && (void 0 === this.hd[hc] || 0 === this.hd[hc].Ya);) hc++; | |
for (var hc = | |
Math.min(hc, Ab - 1), ii = -this.hd[hc].sb, ad = Math.min(this.hj, zd - 1); ad !== zd && (void 0 === this.cd[ad] || 0 === this.cd[ad].Ya);) ad++; | |
for (var ad = Math.min(ad, zd - 1), Ib = -this.cd[ad].sb, ve = D.Im(), ob = 0; ob < Ab; ob++) | |
if (ld[ob]) { | |
var zd = ld[ob].length, | |
cf = this.pe(ob), | |
gc = cf.sb + ii + Kg; | |
0 !== cf.Ya && (gc += cf.hF()); | |
for (var bd = 0; bd < zd; bd++) | |
if (ld[ob][bd]) { | |
var Mf = this.oe(bd), | |
Nd = Mf.sb + Ib + zh; | |
0 !== Mf.Ya && (Nd += Mf.hF()); | |
for (var Nf = ld[ob][bd], Ah = Nf.length, Kk = 0; Kk < Ah; Kk++) { | |
var Bb = Nf[Kk], | |
de = Bb.Fa, | |
md = Bb instanceof x ? Bb : null; | |
if (null === md || md.type !== | |
Ro && md.type !== So) { | |
ve.n(0, 0); | |
for (var Me = 1; Me < Bb.rowSpan && !(ob + Me >= this.Tq); Me++) { | |
var ji = this.pe(ob + Me); | |
ve.height += ji.total | |
} | |
for (Me = 1; Me < Bb.iI && !(bd + Me >= this.fq); Me++) { | |
var ki = this.oe(bd + Me); | |
ve.width += ki.total | |
} | |
var zj = Mf.Ya + ve.width, | |
Aj = cf.Ya + ve.height; | |
h.x = Nd; | |
h.y = gc; | |
h.width = zj; | |
h.height = Aj; | |
var Jb = Nd, | |
Bh = gc, | |
Ch = zj, | |
ka = Aj; | |
Nd + zj > e.width && (Ch = Math.max(e.width - Nd, 0)); | |
gc + Aj > e.height && (ka = Math.max(e.height - gc, 0)); | |
var ba = Bb.alignment, | |
ic = 0, | |
mg = 0, | |
li = 0, | |
Kb = 0; | |
if (ba.ld()) { | |
ba = this.pm; | |
ba.Xc() || (ba = mc); | |
var ic = ba.x, | |
mg = ba.y, | |
li = | |
ba.offsetX, | |
Kb = ba.offsetY, | |
mi = Mf.alignment, | |
Xb = cf.alignment; | |
mi.Xc() && (ic = mi.x, li = mi.offsetX); | |
Xb.Xc() && (mg = Xb.y, Kb = Xb.offsetY) | |
} else ic = ba.x, mg = ba.y, li = ba.offsetX, Kb = ba.offsetY; | |
if (isNaN(ic) || isNaN(mg)) mg = ic = .5, Kb = li = 0; | |
var df = de.width, | |
Ne = de.height, | |
ef = Bb.margin, | |
we = ef.left + ef.right, | |
xe = ef.top + ef.bottom, | |
cd = $o(Bb, cf, Mf, !1); | |
!isNaN(Bb.Ea.width) || cd !== Ye && cd !== yo || (df = Math.max(zj - we, 0)); | |
!isNaN(Bb.Ea.height) || cd !== Ye && cd !== xo || (Ne = Math.max(Aj - xe, 0)); | |
var Od = Bb.rf, | |
Dh = Bb.ah, | |
df = Math.min(Od.width, df), | |
Ne = Math.min(Od.height, | |
Ne), | |
df = Math.max(Dh.width, df), | |
Ne = Math.max(Dh.height, Ne), | |
Z = Ne + xe; | |
h.x += h.width * ic - (df + we) * ic + li + ef.left; | |
h.y += h.height * mg - Z * mg + Kb + ef.top; | |
Bb.visible && (Vb(Jb, Bh, Ch, ka, h.x, h.y, de.width, de.height) ? Bb.rc(h.x, h.y, df, Ne) : Bb.rc(h.x, h.y, df, Ne, new C(Jb, Bh, Ch, ka))) | |
} else { | |
Bb.cj(); | |
Bb.cc.Xa(); | |
var nd = Bb.cc, | |
ng = D.vg(nd.x, nd.y, nd.width, nd.height); | |
nd.x = md.type === Ro ? zh : Nd; | |
nd.y = md.type === So ? Kg : gc; | |
nd.width = de.width; | |
nd.height = de.height; | |
Bb.cc.freeze(); | |
No(Bb, !1); | |
if (!Db(ng, nd)) { | |
var ni = Bb.Y; | |
null !== ni && (ni.dl(), Bb.$s(ni)) | |
} | |
D.Lb(ng) | |
} | |
} | |
} | |
} | |
D.$k(ve); | |
for (ob = 0; ob < ce; ob++) Bb = g[ob], md = Bb instanceof x ? Bb : null, null === md || md.type !== Ro && md.type !== So || (nd = Bb.cc, Bb.fd.Xa(), Bb.fd.n(0, 0, nd.width, nd.height), Bb.fd.freeze()); | |
break; | |
case "Viewbox": | |
var Eh = g[0], | |
rc = Eh.Fa, | |
Fh = Eh.margin, | |
rb = Fh.top + Fh.bottom, | |
sb = Math.max(rc.width + (Fh.right + Fh.left), 0), | |
nm = Math.max(rc.height + rb, 0), | |
ff = Eh.alignment; | |
ff.ld() && (ff = this.pm); | |
ff.Xc() || (ff = mc); | |
h.x = e.width * ff.x - sb * ff.x + ff.offsetX; | |
h.y = e.height * ff.y - nm * ff.y + ff.offsetY; | |
h.width = rc.width; | |
h.height = rc.height; | |
Eh.rc(h.x, h.y, h.width, h.height); | |
break; | |
case "Link": | |
var Lk = g.length; | |
if (this instanceof da || this instanceof J) { | |
var oi = null; | |
this instanceof J && (oi = this); | |
this instanceof da && (oi = this.hf); | |
var Cc = oi, | |
Of = this instanceof da ? null : Cc.path; | |
if (null !== this.oh) { | |
var og = this.oh.o, | |
Tb = 0; | |
if (null !== Of && Tb < this.oh.count) { | |
var gf = og[Tb]; | |
Tb++; | |
Of.rc(gf.x - this.yj.x, gf.y - this.yj.y, gf.width, gf.height) | |
} | |
for (var Mk = 0; Mk < Lk; Mk++) { | |
var om = g[Mk]; | |
om !== Of && Tb < this.oh.count && (gf = og[Tb], Tb++, om.rc(gf.x - this.yj.x, gf.y - this.yj.y, gf.width, gf.height)) | |
} | |
} | |
var Pf = Cc.points, | |
hf = | |
Pf.count; | |
if (2 <= hf && this instanceof J) | |
for (var jf = this.Cf; jf.next();) { | |
var sc = jf.value, | |
pg = hf, | |
Gc = Pf, | |
Fb = sc.We, | |
pi = sc.VB, | |
Lg = sc.Gh, | |
Bj = sc.Uq, | |
up = sc.WB, | |
Mg = 0, | |
Qf = 0, | |
Ng = 0; | |
if (Fb < -pg || Fb >= pg) { | |
var Og = this.vG, | |
tb = this.uG; | |
Bj !== vj && (Ng = this.computeAngle(sc, Bj, tb), sc.angle = Ng); | |
Mg = Og.x; | |
Qf = Og.y | |
} else { | |
var ac = void 0, | |
Hc = void 0; | |
if (0 <= Fb) ac = Gc.o[Fb], Hc = Fb < pg - 1 ? Gc.o[Fb + 1] : ac; | |
else var kf = pg + Fb, | |
ac = Gc.o[kf], | |
Hc = 0 < kf ? Gc.o[kf - 1] : ac; | |
if (ac.Wc(Hc)) { | |
var Pd = void 0, | |
Ad = void 0; | |
0 <= Fb ? (Pd = 0 < Fb ? Gc.o[Fb - 1] : ac, Ad = Fb < pg - 2 ? Gc.o[Fb + 2] : Hc) : (Pd = kf < pg - | |
1 ? Gc.o[kf + 1] : ac, Ad = 1 < kf ? Gc.o[kf - 2] : Hc); | |
var lf = Pd.Kf(ac), | |
fb = Hc.Kf(Ad), | |
tb = lf > fb + 10 ? 0 <= Fb ? Pd.Xb(ac) : ac.Xb(Pd) : fb > lf + 10 ? 0 <= Fb ? Hc.Xb(Ad) : Ad.Xb(Hc) : 0 <= Fb ? Pd.Xb(Ad) : Ad.Xb(Pd) | |
} else tb = 0 <= Fb ? ac.Xb(Hc) : Hc.Xb(ac); | |
Bj !== vj && (Ng = this.computeAngle(sc, Bj, tb), sc.angle = Ng); | |
Mg = ac.x + (Hc.x - ac.x) * pi; | |
Qf = ac.y + (Hc.y - ac.y) * pi | |
} | |
if (Lg.O(dc)) sc.location = new N(Mg, Qf); | |
else { | |
Lg.ee() && (Lg = mc); | |
var mf = D.hh(); | |
mf.reset(); | |
mf.scale(sc.scale, sc.scale); | |
mf.rotate(sc.angle, 0, 0); | |
var od = sc.Ga, | |
Pg = D.vg(0, 0, od.width, od.height), | |
nf = D.P(); | |
nf.vo(Pg, | |
Lg); | |
mf.vb(nf); | |
var Ic = -nf.x, | |
Rf = -nf.y, | |
Oe = up.copy(); | |
isNaN(Oe.x) && (Oe.x = 0 <= Fb ? nf.x + 3 : -(nf.x + 3)); | |
isNaN(Oe.y) && (Oe.y = -(nf.y + 3)); | |
Oe.rotate(tb); | |
Mg += Oe.x; | |
Qf += Oe.y; | |
mf.rH(Pg); | |
var Ic = Ic + Pg.x, | |
Rf = Rf + Pg.y, | |
Qg = D.Fb(Mg + Ic, Qf + Rf); | |
sc.move(Qg); | |
D.A(Qg); | |
D.A(nf); | |
D.Lb(Pg); | |
D.nf(mf) | |
} | |
} | |
this.Wu(!1) | |
} | |
break; | |
case "Grid": | |
break; | |
case "Graduated": | |
if (null !== this.Vm) { | |
var Rg = this.Md(), | |
Cj = this.Xm, | |
Nk = this.Vm, | |
ye = 0, | |
dd = Nk[ye]; | |
ye++; | |
Rg.rc(dd.x - e.x, dd.y - e.y, dd.width, dd.height); | |
for (var Ok = g.length, Gh = 0; Gh < Ok; Gh++) { | |
var pd = g[Gh], | |
Dj = Cj[Gh]; | |
pd.visible && | |
pd !== Rg && 0 !== Dj.length && (dd = Nk[ye], ye++, pd.rc(dd.x - e.x, dd.y - e.y, dd.width, dd.height)) | |
} | |
this.Vm = null | |
} | |
break; | |
case "TableRow": | |
case "TableColumn": | |
D.k(this.toString() + " is not an element of a Table Panel.TableRow and TableColumn panels can only be elements of a Table Panel."); | |
break; | |
default: | |
D.k("Unknown panel type: " + u) | |
} | |
D.Lb(h) | |
} | |
}; | |
x.prototype.Sk = function(a) { | |
var b = this.Ga, | |
c = Rp(this); | |
if (Vb(0, 0, b.width, b.height, a.x, a.y)) { | |
for (var b = this.xa.o, d = b.length, e = D.Fb(0, 0); d--;) { | |
var g = b[d]; | |
if (g.visible || g === c) | |
if (kb(e.set(a), g.transform), g.Pa(e)) return D.A(e), !0 | |
} | |
D.A(e); | |
return null === this.Mb && null === this.lc ? !1 : !0 | |
} | |
return !1 | |
}; | |
x.prototype.Wx = function(a) { | |
if (this.Jo === a) return this; | |
for (var b = this.xa.o, c = b.length, d = 0; d < c; d++) { | |
var e = b[d].Wx(a); | |
if (null !== e) return e | |
} | |
return null | |
}; | |
function gp(a, b, c) { | |
c(a, b); | |
if (b instanceof x) { | |
b = b.xa.o; | |
for (var d = b.length, e = 0; e < d; e++) gp(a, b[e], c) | |
} | |
} | |
function Xm(a, b) { | |
cq(a, a, b) | |
} | |
function cq(a, b, c) { | |
c(b); | |
b = b.xa.o; | |
for (var d = b.length, e = 0; e < d; e++) { | |
var g = b[e]; | |
g instanceof x && cq(a, g, c) | |
} | |
} | |
x.prototype.walkVisualTree = x.prototype.KK = function(a) { | |
dq(this, this, a) | |
}; | |
function dq(a, b, c) { | |
c(b); | |
if (b instanceof x) { | |
b = b.xa.o; | |
for (var d = b.length, e = 0; e < d; e++) dq(a, b[e], c) | |
} | |
} | |
x.prototype.findInVisualTree = x.prototype.qu = function(a) { | |
return eq(this, this, a) | |
}; | |
function eq(a, b, c) { | |
if (c(b)) return b; | |
if (b instanceof x) { | |
b = b.xa.o; | |
for (var d = b.length, e = 0; e < d; e++) { | |
var g = eq(a, b[e], c); | |
if (null !== g) return g | |
} | |
} | |
return null | |
} | |
x.prototype.findObject = x.prototype.Nd = function(a) { | |
if (this.name === a) return this; | |
for (var b = this.xa.o, c = b.length, d = 0; d < c; d++) { | |
var e = b[d]; | |
if (e.name === a) return e; | |
if (e instanceof x) | |
if (null === e.ej && null === e.Ig) { | |
if (e = e.Nd(a), null !== e) return e | |
} else if (vn(e) && (e = e.xa.first(), null !== e && (e = e.Nd(a), null !== e))) return e | |
} | |
return null | |
}; | |
function fq(a) { | |
a = a.xa.o; | |
for (var b = a.length, c = 0, d = 0; d < b; d++) { | |
var e = a[d]; | |
if (e instanceof x) c = Math.max(c, fq(e)); | |
else if (e instanceof z) { | |
a: { | |
if (null !== !e.bg) switch (e.$o) { | |
case "None": | |
case "Square": | |
case "Ellipse": | |
case "Circle": | |
case "LineH": | |
case "LineV": | |
case "FramedRectangle": | |
case "RoundedRectangle": | |
case "Line1": | |
case "Line2": | |
case "Border": | |
case "Cube1": | |
case "Cube2": | |
case "Junction": | |
case "Cylinder1": | |
case "Cylinder2": | |
case "Cylinder3": | |
case "Cylinder4": | |
case "PlusLine": | |
case "XLine": | |
case "ThinCross": | |
case "ThickCross": | |
e = | |
0; | |
break a | |
} | |
e = e.Rg / 2 * e.zn * e.Jj() | |
} | |
c = Math.max(c, e) | |
} | |
} | |
return c | |
} | |
f = x.prototype; | |
f.kh = function() { | |
return !(this.type === Ro || this.type === So) | |
}; | |
f.Je = function(a, b, c) { | |
if (!1 === this.tg) return null; | |
void 0 === b && (b = null); | |
void 0 === c && (c = null); | |
if (Om(this)) return null; | |
var d = this.Ga, | |
e = 1 / this.Jj(), | |
g = this.kh(), | |
h = g ? a : kb(D.Fb(a.x, a.y), this.transform), | |
k = this.g, | |
l = 10, | |
m = 5; | |
null !== k && (l = k.Cu("extraTouchArea"), m = l / 2); | |
if (Vb(-(m * e), -(m * e), d.width + l * e, d.height + l * e, h.x, h.y)) { | |
if (!this.$n) { | |
var e = this.xa.o, | |
n = e.length, | |
k = D.P(), | |
m = (l = this.yq) ? this.Md() : null; | |
if (l && (m.kh() ? kb(k.set(a), m.transform) : k.set(a), !m.Pa(k))) return D.A(k), g || D.A(h), null; | |
for (var p = Rp(this); n--;) { | |
var q = | |
e[n]; | |
if (q.visible || q === p) | |
if (q.kh() ? kb(k.set(a), q.transform) : k.set(a), !l || q !== m) { | |
var r = null; | |
q instanceof x ? r = q.Je(k, b, c) : !0 === q.tg && q.Pa(k) && (r = q); | |
if (null !== r && (null !== b && (r = b(r)), null !== r && (null === c || c(r)))) return D.A(k), g || D.A(h), r | |
} | |
} | |
D.A(k) | |
} | |
if (null === this.background && null === this.hm) return g || D.A(h), null; | |
a = Vb(0, 0, d.width, d.height, h.x, h.y) ? this : null; | |
g || D.A(h); | |
return a | |
} | |
g || D.A(h); | |
return null | |
}; | |
f.ru = function(a, b, c, d) { | |
if (!1 === this.tg) return !1; | |
void 0 === b && (b = null); | |
void 0 === c && (c = null); | |
d instanceof K || d instanceof L || (d = new K(O)); | |
var e = this.Ga, | |
g = this.kh(), | |
h = g ? a : kb(D.Fb(a.x, a.y), this.transform); | |
if (Vb(0, 0, e.width, e.height, h.x, h.y)) { | |
if (!this.$n) { | |
for (var e = this.xa.o, k = e.length, l = D.P(), m = Rp(this); k--;) { | |
var n = e[k]; | |
if (n.visible || n === m) { | |
n.kh() ? kb(l.set(a), n.transform) : l.set(a); | |
var p = n, | |
n = n instanceof x ? n : null; | |
(null !== n ? n.ru(l, b, c, d) : p.Pa(l)) && !1 !== p.tg && (null !== b && (p = b(p)), null === p || null !== c && !c(p) || | |
d.add(p)) | |
} | |
} | |
D.A(l) | |
} | |
g || D.A(h); | |
return null !== this.background || null !== this.hm | |
} | |
g || D.A(h); | |
return !1 | |
}; | |
f.Yk = function(a, b, c, d, e, g) { | |
if (!1 === this.tg) return !1; | |
void 0 === b && (b = null); | |
void 0 === c && (c = null); | |
var h = g; | |
void 0 === g && (h = D.hh(), h.reset()); | |
h.multiply(this.transform); | |
if (this.Kn(a, h)) return gq(this, b, c, e), void 0 === g && D.nf(h), !0; | |
if (this.jg(a, h)) { | |
if (!this.$n) | |
for (var k = Rp(this), l = this.xa.o, m = l.length; m--;) { | |
var n = l[m]; | |
if (n.visible || n === k) { | |
var p = n.aa, | |
q = |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment