code stringlengths 2 1.05M |
|---|
/**
* bootstrap-table - An extended Bootstrap table with radio, checkbox, sort, pagination, and other added features. (supports twitter bootstrap v2 and v3).
*
* @version v1.14.1
* @homepage https://bootstrap-table.com
* @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
* @license MIT
*/
(function(a,b){if('function'==typeof define&&define.amd)define([],b);else if('undefined'!=typeof exports)b();else{b(),a.bootstrapTableMsMY={exports:{}}.exports}})(this,function(){'use strict';(function(a){a.fn.bootstrapTable.locales['ms-MY']={formatLoadingMessage:function(){return'Permintaan sedang dimuatkan. Sila tunggu sebentar...'},formatRecordsPerPage:function(a){return a+' rekod setiap muka surat'},formatShowingRows:function(a,b,c){return'Sedang memaparkan rekod '+a+' hingga '+b+' daripada jumlah '+c+' rekod'},formatSearch:function(){return'Cari'},formatNoMatches:function(){return'Tiada rekod yang menyamai permintaan'},formatPaginationSwitch:function(){return'Tunjuk/sembunyi muka surat'},formatRefresh:function(){return'Muatsemula'},formatToggle:function(){return'Tukar'},formatColumns:function(){return'Lajur'},formatAllRows:function(){return'Semua'}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales['ms-MY'])})(jQuery)}); |
/**
* @license
* v1.3.4
* MIT (https://github.com/pnp/pnpjs/blob/master/LICENSE)
* Copyright (c) 2019 Microsoft
* docs: https://pnp.github.io/pnpjs/
* source: https://github.com/pnp/pnpjs
* bugs: https://github.com/pnp/pnpjs/issues
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('adal-angular/dist/adal.min.js')) :
typeof define === 'function' && define.amd ? define(['exports', 'adal-angular/dist/adal.min.js'], factory) :
(factory((global.pnp = global.pnp || {}, global.pnp.common = {}),global.adal));
}(this, (function (exports,adal) { 'use strict';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var global$1 = (typeof global !== "undefined" ? global :
typeof self !== "undefined" ? self :
typeof window !== "undefined" ? window : {});
/**
* Gets a callback function which will maintain context across async calls.
* Allows for the calling pattern getCtxCallback(thisobj, method, methodarg1, methodarg2, ...)
*
* @param context The object that will be the 'this' value in the callback
* @param method The method to which we will apply the context and parameters
* @param params Optional, additional arguments to supply to the wrapped method when it is invoked
*/
function getCtxCallback(context, method) {
var params = [];
for (var _i = 2; _i < arguments.length; _i++) {
params[_i - 2] = arguments[_i];
}
return function () {
method.apply(context, params);
};
}
/**
* Adds a value to a date
*
* @param date The date to which we will add units, done in local time
* @param interval The name of the interval to add, one of: ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second']
* @param units The amount to add to date of the given interval
*
* http://stackoverflow.com/questions/1197928/how-to-add-30-minutes-to-a-javascript-date-object
*/
function dateAdd(date, interval, units) {
var ret = new Date(date); // don't change original date
switch (interval.toLowerCase()) {
case "year":
ret.setFullYear(ret.getFullYear() + units);
break;
case "quarter":
ret.setMonth(ret.getMonth() + 3 * units);
break;
case "month":
ret.setMonth(ret.getMonth() + units);
break;
case "week":
ret.setDate(ret.getDate() + 7 * units);
break;
case "day":
ret.setDate(ret.getDate() + units);
break;
case "hour":
ret.setTime(ret.getTime() + units * 3600000);
break;
case "minute":
ret.setTime(ret.getTime() + units * 60000);
break;
case "second":
ret.setTime(ret.getTime() + units * 1000);
break;
default:
ret = undefined;
break;
}
return ret;
}
/**
* Combines an arbitrary set of paths ensuring and normalizes the slashes
*
* @param paths 0 to n path parts to combine
*/
function combine() {
var paths = [];
for (var _i = 0; _i < arguments.length; _i++) {
paths[_i] = arguments[_i];
}
return paths
.filter(function (path) { return !stringIsNullOrEmpty(path); })
.map(function (path) { return path.replace(/^[\\|\/]/, "").replace(/[\\|\/]$/, ""); })
.join("/")
.replace(/\\/g, "/");
}
/**
* Gets a random string of chars length
*
* https://stackoverflow.com/questions/1349404/generate-random-string-characters-in-javascript
*
* @param chars The length of the random string to generate
*/
function getRandomString(chars) {
var text = new Array(chars);
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (var i = 0; i < chars; i++) {
text[i] = possible.charAt(Math.floor(Math.random() * possible.length));
}
return text.join("");
}
/**
* Gets a random GUID value
*
* http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
* https://stackoverflow.com/a/8809472 updated to prevent collisions.
*/
/* tslint:disable no-bitwise */
function getGUID() {
var d = Date.now();
if (typeof performance !== "undefined" && typeof performance.now === "function") {
d += performance.now(); // use high-precision timer if available
}
var guid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
var r = (d + Math.random() * 16) % 16 | 0;
d = Math.floor(d / 16);
return (c === "x" ? r : (r & 0x3 | 0x8)).toString(16);
});
return guid;
}
/* tslint:enable */
/**
* Determines if a given value is a function
*
* @param cf The thing to test for functionness
*/
function isFunc(cf) {
return typeof cf === "function";
}
/**
* Determines if an object is both defined and not null
* @param obj Object to test
*/
function objectDefinedNotNull(obj) {
return typeof obj !== "undefined" && obj !== null;
}
/**
* @returns whether the provided parameter is a JavaScript Array or not.
*/
function isArray(array) {
if (Array.isArray) {
return Array.isArray(array);
}
return array && typeof array.length === "number" && array.constructor === Array;
}
/**
* Provides functionality to extend the given object by doing a shallow copy
*
* @param target The object to which properties will be copied
* @param source The source object from which properties will be copied
* @param noOverwrite If true existing properties on the target are not overwritten from the source
* @param filter If provided allows additional filtering on what properties are copied (propName: string) => boolean
*
*/
function extend(target, source, noOverwrite, filter) {
if (noOverwrite === void 0) { noOverwrite = false; }
if (filter === void 0) { filter = function () { return true; }; }
if (!objectDefinedNotNull(source)) {
return target;
}
// ensure we don't overwrite things we don't want overwritten
var check = noOverwrite ? function (o, i) { return !(i in o); } : function () { return true; };
// final filter we will use
var f = function (v) { return check(target, v) && filter(v); };
return Object.getOwnPropertyNames(source)
.filter(f)
.reduce(function (t, v) {
t[v] = source[v];
return t;
}, target);
}
/**
* Determines if a given url is absolute
*
* @param url The url to check to see if it is absolute
*/
function isUrlAbsolute(url) {
return /^https?:\/\/|^\/\//i.test(url);
}
/**
* Determines if a string is null or empty or undefined
*
* @param s The string to test
*/
function stringIsNullOrEmpty(s) {
return s === undefined || s === null || s.length < 1;
}
/**
* Gets an attribute value from an html/xml string block. NOTE: if the input attribute value has
* RegEx special characters they will be escaped in the returned string
*
* @param html HTML to search
* @param attrName The name of the attribute to find
*/
function getAttrValueFromString(html, attrName) {
// make the input safe for regex
html = html.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
var reg = new RegExp(attrName + "\\s*?=\\s*?(\"|')([^\\1]*?)\\1", "i");
var match = reg.exec(html);
return match !== null && match.length > 0 ? match[2] : null;
}
/**
* Ensures guid values are represented consistently as "ea123463-137d-4ae3-89b8-cf3fc578ca05"
*
* @param guid The candidate guid
*/
function sanitizeGuid(guid) {
if (stringIsNullOrEmpty(guid)) {
return guid;
}
var matches = /([0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})/i.exec(guid);
return matches === null ? guid : matches[1];
}
/**
* Shorthand for JSON.stringify
*
* @param o Any type of object
*/
function jsS(o) {
return JSON.stringify(o);
}
/**
* Shorthand for Object.hasOwnProperty
*
* @param o Object to check for
* @param p Name of the property
*/
function hOP(o, p) {
return Object.hasOwnProperty.call(o, p);
}
/**
* Generates a ~unique hash code
*
* From: https://stackoverflow.com/questions/6122571/simple-non-secure-hash-function-for-javascript
*/
// tslint:disable:no-bitwise
function getHashCode(s) {
var hash = 0;
if (s.length === 0) {
return hash;
}
for (var i = 0; i < s.length; i++) {
var chr = s.charCodeAt(i);
hash = ((hash << 5) - hash) + chr;
hash |= 0; // Convert to 32bit integer
}
return hash;
}
// tslint:enable:no-bitwise
function mergeHeaders(target, source) {
if (source !== undefined && source !== null) {
var temp = new Request("", { headers: source });
temp.headers.forEach(function (value, name) {
target.append(name, value);
});
}
}
function mergeOptions(target, source) {
if (objectDefinedNotNull(source)) {
var headers = extend(target.headers || {}, source.headers);
target = extend(target, source);
target.headers = headers;
}
}
/**
* Makes requests using the global/window fetch API
*/
var FetchClient = /** @class */ (function () {
function FetchClient() {
}
FetchClient.prototype.fetch = function (url, options) {
return global$1.fetch(url, options);
};
return FetchClient;
}());
/**
* Makes requests using the fetch API adding the supplied token to the Authorization header
*/
var BearerTokenFetchClient = /** @class */ (function (_super) {
__extends(BearerTokenFetchClient, _super);
function BearerTokenFetchClient(_token) {
var _this = _super.call(this) || this;
_this._token = _token;
return _this;
}
Object.defineProperty(BearerTokenFetchClient.prototype, "token", {
get: function () {
return this._token || "";
},
set: function (token) {
this._token = token;
},
enumerable: true,
configurable: true
});
BearerTokenFetchClient.prototype.fetch = function (url, options) {
if (options === void 0) { options = {}; }
var headers = new Headers();
mergeHeaders(headers, options.headers);
headers.set("Authorization", "Bearer " + this._token);
options.headers = headers;
return _super.prototype.fetch.call(this, url, options);
};
return BearerTokenFetchClient;
}(FetchClient));
/**
* Parses out the root of the request url to use as the resource when getting the token
*
* After: https://gist.github.com/jlong/2428561
* @param url The url to parse
*/
function getResource(url) {
var parser = document.createElement("a");
parser.href = url;
return parser.protocol + "//" + parser.hostname;
}
/**
* Azure AD Client for use in the browser
*/
var AdalClient = /** @class */ (function (_super) {
__extends(AdalClient, _super);
/**
* Creates a new instance of AdalClient
* @param clientId Azure App Id
* @param tenant Office 365 tenant (Ex: {tenant}.onmicrosoft.com)
* @param redirectUri The redirect url used to authenticate the
*/
function AdalClient(clientId, tenant, redirectUri) {
var _this = _super.call(this, null) || this;
_this.clientId = clientId;
_this.tenant = tenant;
_this.redirectUri = redirectUri;
_this._displayCallback = null;
_this._loginPromise = null;
return _this;
}
/**
* Creates a new AdalClient using the values of the supplied SPFx context (requires SPFx >= 1.6)
*
* @param spfxContext Current SPFx context
* @description Using this method requires that the features described in this article
* https://docs.microsoft.com/en-us/sharepoint/dev/spfx/use-aadhttpclient are activated in the tenant.
*/
AdalClient.fromSPFxContext = function (spfxContext) {
return new SPFxAdalClient(spfxContext);
};
/**
* Conducts the fetch opertation against the AAD secured resource
*
* @param url Absolute URL for the request
* @param options Any fetch options passed to the underlying fetch implementation
*/
AdalClient.prototype.fetch = function (url, options) {
var _this = this;
if (!isUrlAbsolute(url)) {
throw Error("You must supply absolute urls to AdalClient.fetch.");
}
// the url we are calling is the resource
return this.getToken(getResource(url)).then(function (token) {
_this.token = token;
return _super.prototype.fetch.call(_this, url, options);
});
};
/**
* Gets a token based on the current user
*
* @param resource The resource for which we are requesting a token
*/
AdalClient.prototype.getToken = function (resource) {
var _this = this;
return new Promise(function (resolve, reject) {
_this.ensureAuthContext().then(function (_) { return _this.login(); }).then(function (_) {
AdalClient._authContext.acquireToken(resource, function (message, token) {
if (message) {
return reject(Error(message));
}
resolve(token);
});
}).catch(reject);
});
};
/**
* Ensures we have created and setup the adal AuthenticationContext instance
*/
AdalClient.prototype.ensureAuthContext = function () {
var _this = this;
return new Promise(function (resolve) {
if (AdalClient._authContext === null) {
AdalClient._authContext = adal.inject({
clientId: _this.clientId,
displayCall: function (url) {
if (_this._displayCallback) {
_this._displayCallback(url);
}
},
navigateToLoginRequestUrl: false,
redirectUri: _this.redirectUri,
tenant: _this.tenant,
});
}
resolve();
});
};
/**
* Ensures the current user is logged in
*/
AdalClient.prototype.login = function () {
var _this = this;
if (this._loginPromise) {
return this._loginPromise;
}
this._loginPromise = new Promise(function (resolve, reject) {
if (AdalClient._authContext.getCachedUser()) {
return resolve();
}
_this._displayCallback = function (url) {
var popupWindow = window.open(url, "login", "width=483, height=600");
if (!popupWindow) {
return reject(Error("Could not open pop-up window for auth. Likely pop-ups are blocked by the browser."));
}
if (popupWindow && popupWindow.focus) {
popupWindow.focus();
}
var pollTimer = window.setInterval(function () {
if (!popupWindow || popupWindow.closed || popupWindow.closed === undefined) {
window.clearInterval(pollTimer);
}
try {
if (popupWindow.document.URL.indexOf(_this.redirectUri) !== -1) {
window.clearInterval(pollTimer);
AdalClient._authContext.handleWindowCallback(popupWindow.location.hash);
popupWindow.close();
resolve();
}
}
catch (e) {
reject(e);
}
}, 30);
};
// this triggers the login process
_this.ensureAuthContext().then(function (_) {
AdalClient._authContext._loginInProgress = false;
AdalClient._authContext.login();
_this._displayCallback = null;
});
});
return this._loginPromise;
};
/**
* Our auth context
*/
AdalClient._authContext = null;
return AdalClient;
}(BearerTokenFetchClient));
/**
* Client wrapping the aadTokenProvider available from SPFx >= 1.6
*/
var SPFxAdalClient = /** @class */ (function (_super) {
__extends(SPFxAdalClient, _super);
/**
*
* @param context provide the appropriate SPFx Context object
*/
function SPFxAdalClient(context) {
var _this = _super.call(this, null) || this;
_this.context = context;
return _this;
}
/**
* Executes a fetch request using the supplied url and options
*
* @param url Absolute url of the request
* @param options Any options
*/
SPFxAdalClient.prototype.fetch = function (url, options) {
var _this = this;
return this.getToken(getResource(url)).then(function (token) {
_this.token = token;
return _super.prototype.fetch.call(_this, url, options);
});
};
/**
* Gets an AAD token for the provided resource using the SPFx AADTokenProvider
*
* @param resource Resource for which a token is to be requested (ex: https://graph.microsoft.com)
*/
SPFxAdalClient.prototype.getToken = function (resource) {
return this.context.aadTokenProviderFactory.getTokenProvider().then(function (provider) {
return provider.getToken(resource);
});
};
return SPFxAdalClient;
}(BearerTokenFetchClient));
/**
* Used to calculate the object properties, with polyfill if needed
*/
var objectEntries = isFunc(Object.entries) ? Object.entries : function (o) { return Object.keys(o).map(function (k) { return [k, o[k]]; }); };
/**
* Converts the supplied object to a map
*
* @param o The object to map
*/
function objectToMap(o) {
if (o !== undefined && o !== null) {
return new Map(objectEntries(o));
}
return new Map();
}
/**
* Merges to Map instances together, overwriting values in target with matching keys, last in wins
*
* @param target map into which the other maps are merged
* @param maps One or more maps to merge into the target
*/
function mergeMaps(target) {
var maps = [];
for (var _i = 1; _i < arguments.length; _i++) {
maps[_i - 1] = arguments[_i];
}
for (var i = 0; i < maps.length; i++) {
maps[i].forEach(function (v, k) {
target.set(k, v);
});
}
return target;
}
function setup(config) {
RuntimeConfig.extend(config);
}
// lable mapping for known config values
var s = [
"defaultCachingStore",
"defaultCachingTimeoutSeconds",
"globalCacheDisable",
"enableCacheExpiration",
"cacheExpirationIntervalMilliseconds",
"spfxContext",
];
var RuntimeConfigImpl = /** @class */ (function () {
function RuntimeConfigImpl(_v) {
if (_v === void 0) { _v = new Map(); }
this._v = _v;
// setup defaults
this._v.set(s[0], "session");
this._v.set(s[1], 60);
this._v.set(s[2], false);
this._v.set(s[3], false);
this._v.set(s[4], 750);
this._v.set(s[5], null);
}
/**
*
* @param config The set of properties to add to the globa configuration instance
*/
RuntimeConfigImpl.prototype.extend = function (config) {
this._v = mergeMaps(this._v, objectToMap(config));
};
RuntimeConfigImpl.prototype.get = function (key) {
return this._v.get(key);
};
Object.defineProperty(RuntimeConfigImpl.prototype, "defaultCachingStore", {
get: function () {
return this.get(s[0]);
},
enumerable: true,
configurable: true
});
Object.defineProperty(RuntimeConfigImpl.prototype, "defaultCachingTimeoutSeconds", {
get: function () {
return this.get(s[1]);
},
enumerable: true,
configurable: true
});
Object.defineProperty(RuntimeConfigImpl.prototype, "globalCacheDisable", {
get: function () {
return this.get(s[2]);
},
enumerable: true,
configurable: true
});
Object.defineProperty(RuntimeConfigImpl.prototype, "enableCacheExpiration", {
get: function () {
return this.get(s[3]);
},
enumerable: true,
configurable: true
});
Object.defineProperty(RuntimeConfigImpl.prototype, "cacheExpirationIntervalMilliseconds", {
get: function () {
return this.get(s[4]);
},
enumerable: true,
configurable: true
});
Object.defineProperty(RuntimeConfigImpl.prototype, "spfxContext", {
get: function () {
return this.get(s[5]);
},
enumerable: true,
configurable: true
});
return RuntimeConfigImpl;
}());
var _runtimeConfig = new RuntimeConfigImpl();
var RuntimeConfig = _runtimeConfig;
/**
* A wrapper class to provide a consistent interface to browser based storage
*
*/
var PnPClientStorageWrapper = /** @class */ (function () {
/**
* Creates a new instance of the PnPClientStorageWrapper class
*
* @constructor
*/
function PnPClientStorageWrapper(store, defaultTimeoutMinutes) {
if (defaultTimeoutMinutes === void 0) { defaultTimeoutMinutes = -1; }
this.store = store;
this.defaultTimeoutMinutes = defaultTimeoutMinutes;
this.enabled = this.test();
// if the cache timeout is enabled call the handler
// this will clear any expired items and set the timeout function
if (RuntimeConfig.enableCacheExpiration) {
this.cacheExpirationHandler();
}
}
/**
* Get a value from storage, or null if that value does not exist
*
* @param key The key whose value we want to retrieve
*/
PnPClientStorageWrapper.prototype.get = function (key) {
if (!this.enabled) {
return null;
}
var o = this.store.getItem(key);
if (!objectDefinedNotNull(o)) {
return null;
}
var persistable = JSON.parse(o);
if (new Date(persistable.expiration) <= new Date()) {
this.delete(key);
return null;
}
else {
return persistable.value;
}
};
/**
* Adds a value to the underlying storage
*
* @param key The key to use when storing the provided value
* @param o The value to store
* @param expire Optional, if provided the expiration of the item, otherwise the default is used
*/
PnPClientStorageWrapper.prototype.put = function (key, o, expire) {
if (this.enabled) {
this.store.setItem(key, this.createPersistable(o, expire));
}
};
/**
* Deletes a value from the underlying storage
*
* @param key The key of the pair we want to remove from storage
*/
PnPClientStorageWrapper.prototype.delete = function (key) {
if (this.enabled) {
this.store.removeItem(key);
}
};
/**
* Gets an item from the underlying storage, or adds it if it does not exist using the supplied getter function
*
* @param key The key to use when storing the provided value
* @param getter A function which will upon execution provide the desired value
* @param expire Optional, if provided the expiration of the item, otherwise the default is used
*/
PnPClientStorageWrapper.prototype.getOrPut = function (key, getter, expire) {
var _this = this;
if (!this.enabled) {
return getter();
}
var o = this.get(key);
if (o === null) {
return getter().then(function (d) {
_this.put(key, d, expire);
return d;
});
}
return Promise.resolve(o);
};
/**
* Deletes any expired items placed in the store by the pnp library, leaves other items untouched
*/
PnPClientStorageWrapper.prototype.deleteExpired = function () {
var _this = this;
return new Promise(function (resolve, reject) {
if (!_this.enabled) {
resolve();
}
try {
for (var i = 0; i < _this.store.length; i++) {
var key = _this.store.key(i);
if (key !== null) {
// test the stored item to see if we stored it
if (/["|']?pnp["|']? ?: ?1/i.test(_this.store.getItem(key))) {
// get those items as get will delete from cache if they are expired
_this.get(key);
}
}
}
resolve();
}
catch (e) {
reject(e);
}
});
};
/**
* Used to determine if the wrapped storage is available currently
*/
PnPClientStorageWrapper.prototype.test = function () {
var str = "t";
try {
this.store.setItem(str, str);
this.store.removeItem(str);
return true;
}
catch (e) {
return false;
}
};
/**
* Creates the persistable to store
*/
PnPClientStorageWrapper.prototype.createPersistable = function (o, expire) {
if (expire === undefined) {
// ensure we are by default inline with the global library setting
var defaultTimeout = RuntimeConfig.defaultCachingTimeoutSeconds;
if (this.defaultTimeoutMinutes > 0) {
defaultTimeout = this.defaultTimeoutMinutes * 60;
}
expire = dateAdd(new Date(), "second", defaultTimeout);
}
return jsS({ pnp: 1, expiration: expire, value: o });
};
/**
* Deletes expired items added by this library in this.store and sets a timeout to call itself
*/
PnPClientStorageWrapper.prototype.cacheExpirationHandler = function () {
var _this = this;
this.deleteExpired().then(function (_) {
// call ourself in the future
setTimeout(getCtxCallback(_this, _this.cacheExpirationHandler), RuntimeConfig.cacheExpirationIntervalMilliseconds);
}).catch(function (e) {
console.error(e);
});
};
return PnPClientStorageWrapper;
}());
/**
* A thin implementation of in-memory storage for use in nodejs
*/
var MemoryStorage = /** @class */ (function () {
function MemoryStorage(_store) {
if (_store === void 0) { _store = new Map(); }
this._store = _store;
}
Object.defineProperty(MemoryStorage.prototype, "length", {
get: function () {
return this._store.size;
},
enumerable: true,
configurable: true
});
MemoryStorage.prototype.clear = function () {
this._store.clear();
};
MemoryStorage.prototype.getItem = function (key) {
return this._store.get(key);
};
MemoryStorage.prototype.key = function (index) {
return Array.from(this._store)[index][0];
};
MemoryStorage.prototype.removeItem = function (key) {
this._store.delete(key);
};
MemoryStorage.prototype.setItem = function (key, data) {
this._store.set(key, data);
};
return MemoryStorage;
}());
/**
* A class that will establish wrappers for both local and session storage
*/
var PnPClientStorage = /** @class */ (function () {
/**
* Creates a new instance of the PnPClientStorage class
*
* @constructor
*/
function PnPClientStorage(_local, _session) {
if (_local === void 0) { _local = null; }
if (_session === void 0) { _session = null; }
this._local = _local;
this._session = _session;
}
Object.defineProperty(PnPClientStorage.prototype, "local", {
/**
* Provides access to the local storage of the browser
*/
get: function () {
if (this._local === null) {
this._local = this.getStore("local");
}
return this._local;
},
enumerable: true,
configurable: true
});
Object.defineProperty(PnPClientStorage.prototype, "session", {
/**
* Provides access to the session storage of the browser
*/
get: function () {
if (this._session === null) {
this._session = this.getStore("session");
}
return this._session;
},
enumerable: true,
configurable: true
});
PnPClientStorage.prototype.getStore = function (name) {
if (name === "local") {
return new PnPClientStorageWrapper(typeof (localStorage) === "undefined" ? new MemoryStorage() : localStorage);
}
return new PnPClientStorageWrapper(typeof (sessionStorage) === "undefined" ? new MemoryStorage() : sessionStorage);
};
return PnPClientStorage;
}());
exports.AdalClient = AdalClient;
exports.SPFxAdalClient = SPFxAdalClient;
exports.objectToMap = objectToMap;
exports.mergeMaps = mergeMaps;
exports.setup = setup;
exports.RuntimeConfigImpl = RuntimeConfigImpl;
exports.RuntimeConfig = RuntimeConfig;
exports.mergeHeaders = mergeHeaders;
exports.mergeOptions = mergeOptions;
exports.FetchClient = FetchClient;
exports.BearerTokenFetchClient = BearerTokenFetchClient;
exports.PnPClientStorageWrapper = PnPClientStorageWrapper;
exports.PnPClientStorage = PnPClientStorage;
exports.getCtxCallback = getCtxCallback;
exports.dateAdd = dateAdd;
exports.combine = combine;
exports.getRandomString = getRandomString;
exports.getGUID = getGUID;
exports.isFunc = isFunc;
exports.objectDefinedNotNull = objectDefinedNotNull;
exports.isArray = isArray;
exports.extend = extend;
exports.isUrlAbsolute = isUrlAbsolute;
exports.stringIsNullOrEmpty = stringIsNullOrEmpty;
exports.getAttrValueFromString = getAttrValueFromString;
exports.sanitizeGuid = sanitizeGuid;
exports.jsS = jsS;
exports.hOP = hOP;
exports.getHashCode = getHashCode;
Object.defineProperty(exports, '__esModule', { value: true });
})));
//# sourceMappingURL=common.es5.umd.js.map
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.useDropTargetMonitor = useDropTargetMonitor;
exports.useDropHandler = useDropHandler;
var _react = require("react");
var _registration = require("../../common/registration");
var _useDragDropManager = require("../useDragDropManager");
var _TargetConnector = require("../../common/TargetConnector");
var _DropTargetMonitorImpl = require("../../common/DropTargetMonitorImpl");
var _useIsomorphicLayoutEffect = require("./useIsomorphicLayoutEffect");
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function useDropTargetMonitor() {
var manager = (0, _useDragDropManager.useDragDropManager)();
var monitor = (0, _react.useMemo)(function () {
return new _DropTargetMonitorImpl.DropTargetMonitorImpl(manager);
}, [manager]);
var connector = (0, _react.useMemo)(function () {
return new _TargetConnector.TargetConnector(manager.getBackend());
}, [manager]);
return [monitor, connector];
}
function useDropHandler(spec, monitor, connector) {
var manager = (0, _useDragDropManager.useDragDropManager)();
var handler = (0, _react.useMemo)(function () {
return {
canDrop: function canDrop() {
var canDrop = spec.current.canDrop;
return canDrop ? canDrop(monitor.getItem(), monitor) : true;
},
hover: function hover() {
var hover = spec.current.hover;
if (hover) {
hover(monitor.getItem(), monitor);
}
},
drop: function drop() {
var drop = spec.current.drop;
if (drop) {
return drop(monitor.getItem(), monitor);
}
}
};
}, [monitor]);
(0, _useIsomorphicLayoutEffect.useIsomorphicLayoutEffect)(function registerHandler() {
var _registerTarget = (0, _registration.registerTarget)(spec.current.accept, handler, manager),
_registerTarget2 = _slicedToArray(_registerTarget, 2),
handlerId = _registerTarget2[0],
unregister = _registerTarget2[1];
monitor.receiveHandlerId(handlerId);
connector.receiveHandlerId(handlerId);
return unregister;
}, [monitor, connector]);
} |
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _clsx = _interopRequireDefault(require("clsx"));
var _unstyled = require("@material-ui/unstyled");
var _styled = _interopRequireDefault(require("../styles/styled"));
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
var _cardContentClasses = require("./cardContentClasses");
var _jsxRuntime = require("react/jsx-runtime");
const _excluded = ["className", "component"];
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
const useUtilityClasses = styleProps => {
const {
classes
} = styleProps;
const slots = {
root: ['root']
};
return (0, _unstyled.unstable_composeClasses)(slots, _cardContentClasses.getCardContentUtilityClass, classes);
};
const CardContentRoot = (0, _styled.default)('div', {
name: 'MuiCardContent',
slot: 'Root',
overridesResolver: (props, styles) => styles.root
})(() => {
/* Styles applied to the root element. */
return {
padding: 16,
'&:last-child': {
paddingBottom: 24
}
};
});
const CardContent = /*#__PURE__*/React.forwardRef(function CardContent(inProps, ref) {
const props = (0, _useThemeProps.default)({
props: inProps,
name: 'MuiCardContent'
});
const {
className,
component = 'div'
} = props,
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
const styleProps = (0, _extends2.default)({}, props, {
component
});
const classes = useUtilityClasses(styleProps);
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CardContentRoot, (0, _extends2.default)({
as: component,
className: (0, _clsx.default)(classes.root, className),
styleProps: styleProps,
ref: ref
}, other));
});
process.env.NODE_ENV !== "production" ? CardContent.propTypes
/* remove-proptypes */
= {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* The content of the component.
*/
children: _propTypes.default.node,
/**
* Override or extend the styles applied to the component.
*/
classes: _propTypes.default.object,
/**
* @ignore
*/
className: _propTypes.default.string,
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component: _propTypes.default.elementType,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: _propTypes.default.object
} : void 0;
var _default = CardContent;
exports.default = _default; |
/**
* Copyright 2015 Telerik AD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
(function(f, define){
define([], f);
})(function(){
(function ($, undefined) {
/* Filter cell operator messages */
if (kendo.ui.FilterCell) {
kendo.ui.FilterCell.prototype.options.operators =
$.extend(true, kendo.ui.FilterCell.prototype.options.operators,{
"date": {
"eq": "Es igual a",
"gte": "Es posterior o igual a",
"gt": "Es posterior",
"lte": "Es anterior o igual a",
"lt": "Es anterior",
"neq": "No es igual a"
},
"number": {
"eq": "Es igual a",
"gte": "Es mayor o igual que",
"gt": "Es mayor que",
"lte": "Es menor o igual que",
"lt": "Es menor que",
"neq": "No es igual a"
},
"string": {
"endswith": "Termina en",
"eq": "Es igual a",
"neq": "No es igual a",
"startswith": "Comienza con",
"contains": "Contiene",
"doesnotcontain": "No contiene"
},
"enums": {
"eq": "Es igual a",
"neq": "No es igual a"
}
});
}
/* Filter menu operator messages */
if (kendo.ui.FilterMenu) {
kendo.ui.FilterMenu.prototype.options.operators =
$.extend(true, kendo.ui.FilterMenu.prototype.options.operators,{
"date": {
"eq": "Es igual a",
"gte": "Es posterior o igual a",
"gt": "Es posterior",
"lte": "Es anterior o igual a",
"lt": "Es anterior",
"neq": "No es igual a"
},
"number": {
"eq": "Es igual a",
"gte": "Es mayor o igual que",
"gt": "Es mayor que",
"lte": "Es menor o igual que",
"lt": "Es menor que",
"neq": "No es igual a"
},
"string": {
"endswith": "Termina en",
"eq": "Es igual a",
"neq": "No es igual a",
"startswith": "Comienza con",
"contains": "Contiene",
"doesnotcontain": "No contiene"
},
"enums": {
"eq": "Es igual a",
"neq": "No es igual a"
}
});
}
/* ColumnMenu messages */
if (kendo.ui.ColumnMenu) {
kendo.ui.ColumnMenu.prototype.options.messages =
$.extend(true, kendo.ui.ColumnMenu.prototype.options.messages,{
"columns": "Columnas",
"sortAscending": "Orden ascendente",
"sortDescending": "Orden descendente",
"settings": "Configuración de columnas",
"done": "Hecho",
"lock": "Bloquear",
"unlock": "Desbloquear"
});
}
/* RecurrenceEditor messages */
if (kendo.ui.RecurrenceEditor) {
kendo.ui.RecurrenceEditor.prototype.options.messages =
$.extend(true, kendo.ui.RecurrenceEditor.prototype.options.messages,{
"daily": {
"interval": "día(s)",
"repeatEvery": "Repetir cada:"
},
"end": {
"after": "Después",
"occurrence": "ocurrencia(s)",
"label": "Fin:",
"never": "Nunca",
"on": "En",
"mobileLabel": "Ends"
},
"frequencies": {
"daily": "Diariamente",
"monthly": "Mensualmente",
"never": "Nunca",
"weekly": "Semanalmente",
"yearly": "Anualmente"
},
"monthly": {
"day": "Día",
"interval": "mes(es)",
"repeatEvery": "Repetir cada:",
"repeatOn": "Repetir en:"
},
"offsetPositions": {
"first": "Primero",
"fourth": "Cuarto",
"last": "Último",
"second": "Segundo",
"third": "Tercero"
},
"weekly": {
"repeatEvery": "Repetir cada:",
"repeatOn": "Repetir en:",
"interval": "semana(s)"
},
"yearly": {
"of": "de",
"repeatEvery": "Repetir cada:",
"repeatOn": "Repetir en:",
"interval": "año(s)"
},
"weekdays": {
"day": "día",
"weekday": "día de semana",
"weekend": "día de fin de semana"
}
});
}
/* Grid messages */
if (kendo.ui.Grid) {
kendo.ui.Grid.prototype.options.messages =
$.extend(true, kendo.ui.Grid.prototype.options.messages,{
"commands": {
"create": "Agregar",
"destroy": "Eliminar",
"canceledit": "Cancelar",
"update": "Actualizar",
"edit": "Editar",
"excel": "Export to Excel",
"pdf": "Export to PDF",
"select": "Seleccionar",
"cancel": "Cancelar Cambios",
"save": "Guardar Cambios"
},
"editable": {
"confirmation": "¿Confirma la eliminación de este registro?",
"cancelDelete": "Cancelar",
"confirmDelete": "Eliminar"
}
});
}
/* Pager messages */
if (kendo.ui.Pager) {
kendo.ui.Pager.prototype.options.messages =
$.extend(true, kendo.ui.Pager.prototype.options.messages,{
"page": "Página",
"display": "Elementos mostrados {0} - {1} de {2}",
"of": "de {0}",
"empty": "No hay registros.",
"refresh": "Actualizar",
"first": "Ir a la primera página",
"itemsPerPage": "ítems por página",
"last": "Ir a la última página",
"next": "Ir a la página siguiente",
"previous": "Ir a la página anterior",
"morePages": "Más paginas"
});
}
/* FilterCell messages */
if (kendo.ui.FilterCell) {
kendo.ui.FilterCell.prototype.options.messages =
$.extend(true, kendo.ui.FilterCell.prototype.options.messages,{
"filter": "Filtrar",
"clear": "Limpiar filtro",
"isFalse": "No",
"isTrue": "Sí",
"operator": "Operador"
});
}
/* FilterMenu messages */
if (kendo.ui.FilterMenu) {
kendo.ui.FilterMenu.prototype.options.messages =
$.extend(true, kendo.ui.FilterMenu.prototype.options.messages,{
"filter": "Filtrar",
"and": "Y",
"clear": "Limpiar filtro",
"info": "Mostrar filas con valor que",
"isFalse": "No",
"isTrue": "Si",
"or": "Or",
"cancel": "Cancelar",
"operator": "Operador",
"value": "Valor",
"selectValue": "-Seleccionar valor-"
});
}
/* Groupable messages */
if (kendo.ui.Groupable) {
kendo.ui.Groupable.prototype.options.messages =
$.extend(true, kendo.ui.Groupable.prototype.options.messages,{
"empty": "Arrastre un encabezado de columna y suéltelo aquí para agrupar por dicho criterio"
});
}
/* Editor messages */
if (kendo.ui.Editor) {
kendo.ui.Editor.prototype.options.messages =
$.extend(true, kendo.ui.Editor.prototype.options.messages,{
"dialogButtonSeparator": "or",
"dialogCancel": "Cancel",
"dialogInsert": "Insert",
"imageAltText": "Alternate text",
"imageWebAddress": "Web address",
"linkOpenInNewWindow": "Open link in new window",
"linkText": "Text",
"linkToolTip": "ToolTip",
"linkWebAddress": "Web address",
"search": "Search",
"createTable": "Crear una tabla",
"addColumnLeft": "Add column on the left",
"addColumnRight": "Add column on the right",
"addRowAbove": "Add row above",
"addRowBelow": "Add row below",
"deleteColumn": "Delete column",
"deleteRow": "Delete row",
"backColor": "Background color",
"bold": "Bold",
"createLink": "Insert hyperlink",
"deleteFile": "Are you sure you want to delete \"{0}\"?",
"directoryNotFound": "A directory with this name was not found.",
"dropFilesHere": "drop files here to upload",
"emptyFolder": "Empty Folder",
"fontName": "Select font family",
"fontNameInherit": "(inherited font)",
"fontSize": "Select font size",
"fontSizeInherit": "(inherited size)",
"foreColor": "Color",
"formatBlock": "Format",
"indent": "Indent",
"insertHtml": "Insert HTML",
"insertImage": "Insert image",
"insertOrderedList": "Insert ordered list",
"insertUnorderedList": "Insert unordered list",
"invalidFileType": "The selected file \"{0}\" is not valid. Supported file types are {1}.",
"italic": "Italic",
"justifyCenter": "Center text",
"justifyFull": "Justify",
"justifyLeft": "Align text left",
"justifyRight": "Align text right",
"linkOpenInNewWindow1": "Open link in new window",
"linkText1": "Text",
"linkToolTip1": "ToolTip",
"linkWebAddress1": "Web address",
"orderBy": "Arrange by:",
"orderByName": "Name",
"orderBySize": "Size",
"outdent": "Outdent",
"overwriteFile": "'A file with name \"{0}\" already exists in the current directory. Do you want to overwrite it?",
"search1": "Search",
"strikethrough": "Strikethrough",
"styles": "Styles",
"subscript": "Subscript",
"superscript": "Superscript",
"underline": "Underline",
"unlink": "Remove hyperlink",
"uploadFile": "Upload",
"formatting": "Format",
"viewHtml": "View HTML",
"dialogUpdate": "Update",
"insertFile": "Insert file"
});
}
/* Scheduler messages */
if (kendo.ui.Scheduler) {
kendo.ui.Scheduler.prototype.options.messages =
$.extend(true, kendo.ui.Scheduler.prototype.options.messages,{
"allDay": "todo el día",
"cancel": "Cancelar",
"editable": {
"confirmation": "¿Está seguro que quiere eliminar este evento?"
},
"date": "Fecha",
"destroy": "Eliminar",
"editor": {
"allDayEvent": "Todo el día",
"description": "Descripción",
"editorTitle": "Evento",
"end": "Fin",
"endTimezone": "Zona horaria de fin",
"repeat": "Repetir",
"separateTimezones": "Usar zonas horarias separadas para el inicio y el fin",
"start": "Inicio",
"startTimezone": "Zona horaria de inicio",
"timezone": " ",
"timezoneEditorButton": "Zona horaria",
"timezoneEditorTitle": "Zonas horarias",
"title": "Título",
"noTimezone": "Sin zona horaria"
},
"event": "Evento",
"recurrenceMessages": {
"deleteRecurring": "¿Quiere eliminar esta ocurrencia del evento o la serie completa?",
"deleteWindowOccurrence": "Eliminar ocurrencia actual",
"deleteWindowSeries": "Eliminar la serie",
"deleteWindowTitle": "Eliminar elemento recurrente",
"editRecurring": "¿Quiere editar esta ocurrencia del evento o la serie completa?",
"editWindowOccurrence": "Editar ocurrencia actual",
"editWindowSeries": "Editar la serie",
"editWindowTitle": "Editar elemento recurrente"
},
"save": "Guardar",
"time": "Hora",
"today": "Hoy",
"views": {
"agenda": "Agenda",
"day": "Día",
"month": "Mes",
"week": "Semana",
"workWeek": "Semana laboral"
},
"deleteWindowTitle": "Eliminar evento",
"showFullDay": "Mostrar día completo",
"showWorkDay": "Mostrar horas laborables"
});
}
/* Upload messages */
if (kendo.ui.Upload) {
kendo.ui.Upload.prototype.options.localization =
$.extend(true, kendo.ui.Upload.prototype.options.localization,{
"cancel": "Cancelar",
"dropFilesHere": "Arrastre los archivos aquí para subirlos",
"headerStatusUploaded": "Completado",
"headerStatusUploading": "Subiendo...",
"remove": "Quitar",
"retry": "Reintentar",
"select": "Seleccione...",
"statusFailed": "Error",
"statusUploaded": "Completado",
"statusUploading": "subiendo",
"uploadSelectedFiles": "Subir archivos"
});
}
})(window.kendo.jQuery);
return window.kendo;
}, typeof define == 'function' && define.amd ? define : function(_, f){ f(); }); |
'imul' in Math
|
var parent = require('../../../actual/array/virtual/join');
module.exports = parent;
|
/*global define */
define(function (require) {
'use strict';
return {
Accordion: require('./lib/Accordion'),
Affix: require('./lib/Affix'),
AffixMixin: require('./lib/AffixMixin'),
Alert: require('./lib/Alert'),
BootstrapMixin: require('./lib/BootstrapMixin'),
Badge: require('./lib/Badge'),
Button: require('./lib/Button'),
ButtonGroup: require('./lib/ButtonGroup'),
ButtonToolbar: require('./lib/ButtonToolbar'),
Carousel: require('./lib/Carousel'),
CarouselItem: require('./lib/CarouselItem'),
Col: require('./lib/Col'),
CollapsableNav: require('./lib/CollapsableNav'),
CollapsableMixin: require('./lib/CollapsableMixin'),
DropdownButton: require('./lib/DropdownButton'),
DropdownMenu: require('./lib/DropdownMenu'),
DropdownStateMixin: require('./lib/DropdownStateMixin'),
FadeMixin: require('./lib/FadeMixin'),
Glyphicon: require('./lib/Glyphicon'),
Grid: require('./lib/Grid'),
Input: require('./lib/Input'),
Interpolate: require('./lib/Interpolate'),
Jumbotron: require('./lib/Jumbotron'),
Label: require('./lib/Label'),
ListGroup: require('./lib/ListGroup'),
ListGroupItem: require('./lib/ListGroupItem'),
MenuItem: require('./lib/MenuItem'),
Modal: require('./lib/Modal'),
Nav: require('./lib/Nav'),
Navbar: require('./lib/Navbar'),
NavItem: require('./lib/NavItem'),
ModalTrigger: require('./lib/ModalTrigger'),
OverlayTrigger: require('./lib/OverlayTrigger'),
OverlayMixin: require('./lib/OverlayMixin'),
PageHeader: require('./lib/PageHeader'),
Panel: require('./lib/Panel'),
PanelGroup: require('./lib/PanelGroup'),
PageItem: require('./lib/PageItem'),
Pager: require('./lib/Pager'),
Popover: require('./lib/Popover'),
ProgressBar: require('./lib/ProgressBar'),
Row: require('./lib/Row'),
SplitButton: require('./lib/SplitButton'),
SubNav: require('./lib/SubNav'),
TabbedArea: require('./lib/TabbedArea'),
Table: require('./lib/Table'),
TabPane: require('./lib/TabPane'),
Tooltip: require('./lib/Tooltip'),
Well: require('./lib/Well')
};
});
|
/*
* GoJS v1.8.33 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-2018 by Northwoods Software Corporation. All Rights Reserved.
* THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/1.8.33/license.html.
*/
(function(window) { var f,aa={};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={Gj:!1,bB:!1,zF:!1,KI:!1,lM:!1,ZF:!1,ru:null,enableBoundsInfo:function(a){v.Gj=!0;a&&a.Gm()},disableBoundsInfo:function(a){v.Gj=!1;a&&(a.fd.Ee(!0),a.Gm())},wF:function(a,b){void 0===a&&(a=v.ru);void 0===b&&(b=a.vm("").rb);var c=b.length,d=a.fd;d.fillStyle="rgba(255,255,0,.3)";for(var e=0;e<c;e++){var g=b.fa(e),h=g.Y;if(g instanceof x)v.wF(a,g.ya);else{var k=g.bi.copy();k.LB(g.Oc);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()}}},xF:function(a,
b){a||(a=v.ru);b||(b=a.vm("").rb);var c=a.fd,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.bi;g instanceof x?v.xF(a,g.ya):(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())}},FI:function(a,b){a||(a=v.ru);b||(b=a.vm("").rb);var c=a.fd,d=b.length;c.fillStyle="rgba(0,0,255,.3)";for(var e=0;e<d;e++){var g=b.fa(e),h=g.Ia,k=g.bi;g instanceof x?v.FI(a,g.ya):(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())}},LL:function(){v.xF();v.wF()},ML:function(a){a||(a=v.ru);var b=a.Qc;a=a.fd;a.strokeStyle="rgba(0,255,0,.9)";a.rect(b.x,b.y,b.width,b.height);a.stroke()},yF: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.Qc.x,a.Qc.y,a.Qc.width,a.Qc.height)},GI:function(a,b){b instanceof ca||(a.lineWidth=
2,a.strokeStyle="rgba(255,0,0,.5)",a.rect(b.dc.x,b.dc.y,b.dc.width,b.dc.height),a.stroke(),b instanceof A&&(a.strokeStyle=b.stroke,a.lineWidth=b.pb),null!==b.Q&&b.Q.type===da&&(a.lineWidth=1,a.strokeStyle="rgba(10,200,10,.6)",b instanceof A&&(a.strokeStyle=b.stroke,a.lineWidth=b.pb)))},HI:function(a,b){a.lineWidth=1;a.strokeStyle="rgba(0,0,255,.5)";a.rect(b.Fa.x,b.Fa.y,b.Fa.width,b.Fa.height);a.stroke();void 0!==b.stroke&&(a.strokeStyle=b.stroke);void 0!==b.Rg&&(a.lineWidth=b.Rg)},aB:function(a,b,
c){a.setTransform(1,0,0,1,0,0);a.scale(b.hd,b.hd);a.transform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy);c=b.ec.length;for(var d=0;d<c;d++)for(var e=b.ec.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.F()){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)},NL: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.Oc;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,t=g.dx,u=g.dy,z=k*p+l*r+t,h=k*q+l*s+u;g=m*p+l*r+t;var l=m*q+l*s+u,w=k*p+n*r+t,k=k*q+n*s+u,p=m*p+n*r+t,m=m*q+n*s+u,n=z,q=h,n=Math.min(n,g),z=Math.max(z,g),q=Math.min(q,l),h=Math.max(h,l),n=
Math.min(n,w),z=Math.max(z,w),q=Math.min(q,k),h=Math.max(h,k),n=Math.min(n,p),z=Math.max(z,p),q=Math.min(q,m),h=Math.max(h,m);g=new C(n,q,z-n,h-q);b.fillRect(g.x,g.y,g.width,g.height)}},II:function(a,b,c,d,e){a.fillStyle="rgba(0,255,0,.2)";a.fillRect(b,c,d,e)},JI:function(a,b,c){a.save();var d=b.Oc;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.jd.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()},JL:function(a){a||(a=v.ru);for(a=a.jo;a.next();)D.trace(a.value.toString())},zM:function(a,b){var c=b.ip(a),d=b.Wb;d.Sd=b.zv(c);d.ha=c;return fa(b,d,a)},uM:function(a,b){b.Je(a.ha)&&(b.fd.fillStyle="lime",b.fd.fillRect(a.Sd.x,a.Sd.y,1*b.scale,1*b.scale))},vM:function(a){var b=ga(a,!1,null,null);if(!b.zq){var c=a.wb,d=a.scale;a=a.fd;for(var e=0;e<=b.Gn;e++)for(var g=
0;g<=b.Hn;g++){var h=b.td[e][g];if(0!==h){var k=(e*b.je+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.je*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.jo;a.next();){var b=a.value;D.trace(b.toString());for(b=b.Wh;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.Of+'"');a.Im!==a&&D.trace(" SelectionObject: "+a.Im.toString()+' SelectionObjectName: "'+a.Vy+'"');a.Cf!==a&&D.trace(" LocationObject: "+a.Cf.toString()+' LocationObjectName: "'+a.zy+'"');if(a.mh){for(var b="",c=a.mh.j;c.next();)b+=c.key+" ";D.trace(" Adornments: "+b)}null!==a.Ja&&D.trace(" ContainingGroup: "+a.Ja.toString());if(a instanceof H){if(0<a.Od.count){b="";for(c=a.Od;c.next();)b+=c.value.toString()+", ";D.trace(" Links: "+b)}null!==a.Zb&&D.trace(" LabeledLink: "+a.Zb.toString());
if(a instanceof I){D.trace(" Placeholder: "+a.placeholder);b="";for(c=a.lc;c.next();)b+=c.value.toString()+", ";D.trace(" Members: "+b);b="";for(c=a.on.j;c.next();)b+=c.value.toString()+", ";D.trace(" NestedGroups: "+b);D.trace(" Layout: "+a.$b)}}else if(a instanceof J){D.trace(" Path: "+a.path);D.trace(" From: "+a.Z+" "+a.ic+' "'+a.ig+'"');D.trace(" To: "+a.ba+" "+a.wc+' "'+a.jh+'"');b="";for(a=a.Bf;a.next();)b+=a.value.toString()+", ";D.trace(" LabelNodes: "+b)}}},dumpVisualTree:function(a){if(a instanceof
E)for(a=a.jo;a.next();){var b=a.value;D.trace(b.toString());for(b=b.Wh;b.next();)v.dumpVisualTree(b.value)}else a instanceof F&&(b=" ",a.nF&&(b+="c"),a.rF&&(b+="d"),a.XF&&(b+="g"),a.zG&&(b+="m"),a.OG&&(b+="h"),a.PG&&(b+="z"),a.UG&&(b+="o"),a.nl&&(b+="s"),a.lH&&(b+="t"),a.$G&&(b+="A"),a.my&&(b+="B"),a.zB&&(b+="L"),a.mb&&(b+="S"),a.jl&&(b+="H"),v.uD(a,1,b))},uD: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.We&&(c+="m");a.Mu&&(c+="a");d+=c;if(0!==a.Ub||0!==a.column)d+=" ["+a.Ub+","+a.column+"]";d+=" "+a.Y.toString();a.Ea.F()&&(d+=" d:"+a.Ea.toString());a.Fa.F()&&(d+=" n:"+a.Fa.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.mm&&(d+=" a:"+a.background.toString());a instanceof x&&(d+=" elts:"+a.ya.count,a.isEnabled||(d+=" !ENABLED"),a.Cq&&(d+=" CLIPPING"),0!==a.rH&&(d+=" top:"+a.rH),0!==a.sG&&(d+=
" left:"+a.sG),null!==a.kl&&(d+=" itemArray#:"+D.fb(a.kl)),a.oG&&(d+=" cat:"+a.oG),null!==a.data&&(d+=" data:"+a.data));null!==a.Rd&&(d+=' portId: "'+a.Rd+'"');D.trace(d);if(a instanceof x)for(a=a.elements;a.next();)v.uD(a.value,b+1,"")},PL: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+=ha(c.value)+", ";D.trace(" "+a.key+": "+b)}},fF:function(a,b){if(!D.Qa(b)||b instanceof Element||b instanceof CanvasRenderingContext2D||b instanceof
ia||b instanceof ja)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.zb(b,d);if(null!==e&&"function"!==typeof e){if(b.hasOwnProperty(d)){var g=Object.getPrototypeOf(b);if(g&&g.Uw&&g.Uw[d])continue}else if(D.jy(b,d))continue;""===c&&(c=b+"\n");c+=' unknown property "'+d+'" has value: '+e+" at "+a+"\n"}}return c},Kx: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.Nd(b)){if(!v.jx.contains(b))if(v.jx.add(b),v.Jw.add(v.fF(a,b)),b instanceof K||b instanceof L||b instanceof ma)for(var c=b.j;c.next();)v.Kx(a+"["+c.key+"]",c.value);else for(c in b){var d=D.zb(b,c);if(void 0!==d&&null!==d&&D.Qa(d)&&d!==b.Uw){if(b instanceof na){if(d===b.sf)continue}else if(b instanceof x){if("data"===c||d===b.Ud)continue;if("itemArray"===c||d===b.ij)continue;if(b instanceof F&&d===b.Yl)continue}else if(!(b instanceof
E))if(b instanceof pa){if("archetypeGroupData"===c||d===b.uz)continue}else if(b instanceof qa){if("archetypeLinkData"===c||d===b.wz)continue;if("archetypeLabelNodeData"===c||d===b.vz)continue}else if(b instanceof ra){if("archetypeNodeData"===c||d===b.Cl)continue}else if(b instanceof M){if("nodeDataArray"===c||d===b.Be)continue;if("linkDataArray"===c||d===b.ef||d===b.ni)continue;if(d===b.Lc)continue;if(d===b.zg)continue}else if(b instanceof ta||b instanceof ua||b instanceof va)continue;v.Kx(a+"."+
c,d)}}}else if(Array.isArray(b))for(c=0;c<b.length;c++)v.Kx(a+"["+c+"]",b[c]);else v.Jw.add(v.fF(a,b))},checkProperties:function(a){void 0===v.jx?v.jx=new L(Object):v.jx.clear();v.Jw=new wa;v.Kx("",a);a=v.Jw.toString();v.Jw=null;return a}};aa.Debug=v;
var D={Ad:1,dd:2,sd:4,rd:8,eo:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("534.30")&&0<window.navigator.userAgent.indexOf("Android"),Qu:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("MSIE 9.0"),Dq:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("MSIE 10.0"),Eq:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("Trident/7"),wB:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("Edge/"),Rh:void 0!==window.navigator&&void 0!==
window.navigator.platform&&0<=window.navigator.platform.toUpperCase().indexOf("MAC"),iG:void 0!==window.navigator&&void 0!==window.navigator.platform&&null!==window.navigator.platform.match(/(iPhone|iPod|iPad)/i),oF: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.mc(a,b,c))},h:function(a,b,c,d){typeof a!==b&&(c=D.getTypeName(c),void 0!==d&&(c+="."+d),D.mc(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 xa&&a.Se===b||(c=D.getTypeName(c),void 0!==d&&(c+="."+d),D.mc(a,"a constant of class "+D.xf(b),c))},nu:function(a,b){"string"===typeof a?ya(a)||D.k('Color "'+a+'" is not a valid color string for '+b):a instanceof za||D.k("Value for "+b+" must be a color string or a Brush, not "+a)},mc: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)},va: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.xf(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.")},ck: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)},Sx:{},Vn:function(a,b){!0!==D.Sx[a]&&(D.Sx[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},qJ:function(a){return Array.isArray(a)},mu:function(a,b,c){D.isArray(a)||D.mc(a,"Array or NodeList or HTMLCollection",b,c)},fb:function(a){return a.length},
qm:function(a){return Array.prototype.slice.call(a)},La:function(a,b){Array.isArray(a);return a[b]},cF:function(a,b,c){Array.isArray(a)?a[b]=c:D.k("Cannot replace an object in an HTMLCollection or NodeList at "+b)},nm: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},Kh: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)},kz:[],O:function(){var a=D.kz.pop();return void 0===a?new N:a},Db:function(a,b){var c=D.kz.pop();if(void 0===c)return new N(a,b);c.x=a;c.y=b;return c},A:function(a){D.kz.push(a)},FC:[],Om:function(){var a=D.FC.pop();return void 0===a?new Ba:a},bl:function(a){D.FC.push(a)},lz:[],Ff:function(){var a=D.lz.pop();return void 0===a?new C:a},vg:function(a,b,c,d){var e=D.lz.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},Hb:function(a){D.lz.push(a)},GC:[],hh:function(){var a=D.GC.pop();return void 0===a?new Ca:a},lf:function(a){D.GC.push(a)},mz:null,v:function(){var a=D.mz;return null!==a?(D.mz=null,a):new Ea},u:function(a){a.reset();D.mz=a},jz:[],hb:function(){var a=D.jz.pop();return void 0===a?[]:a},ua:function(a){a.length=0;D.jz.push(a)},Jo:Object.freeze([]),Rm:1,xc:function(a){a.__gohashid=D.Rm++},wq:function(a){var b=a.__gohashid;
void 0===b&&(b=D.Rm++,a.__gohashid=b);return b},Nd:function(a){return a.__gohashid},ka:function(a,b){b.Bz=a;aa[a]=b},Ta:function(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},Gi:function(a){a.QH=!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}},NK:!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}},oe:function(a,b){for(var c in b)b[c]=!0;a.prototype.Uw=b},getTypeName:function(a){return void 0===a?"":"string"===typeof a?a:"function"===typeof a?D.xf(a):null===a?"*":""},xf:function(a){if("function"===typeof a){if(a.Bz)return a.Bz;if(a.name)return a.name;var b=a.toString(),c=b.indexOf("("),b=b.substring(9,
c).trim();if(""!==b)return a.Bz=b}else if(D.Qa(a)&&a.constructor)return D.xf(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 xa(a,b,c);Object.freeze(c);a[b]=c;var d=a.Dv;d instanceof ma||(d=new ma("string",xa),a.Dv=d);d.add(b,c);return c},zb: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())}},rv: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.Md(l);else if(g=a[l],void 0===g||null===g)g=a.bb[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.jy(g,h))if(d&&"ModelChanged"===h){a.$H(b[h]);continue}else if(d&&"Changed"===h){a.In(b[h]);continue}else if(d&&D.jy(a.bb,h))g=a.bb;else if(d&&Fa(a,h)){a.Ax(h,b[h]);continue}else if(a instanceof
M&&"Changed"===h){a.In(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.XH(h)}},jy: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.Uw;if(d&&d[b])return!0;c=Object.getPrototypeOf(c)}return!1},bK: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},eJ: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.bK(D.eJ(a))},Qm:null,adym:"7da71ca0ad381e90",vfo:"2be64efdb065",qL:"@COLOR1",rL:"@COLOR2",
pF:!1,pu:null,qu:null};
D.Qm=function(){var a=window.document.createElement("canvas"),b=a.getContext("2d");b[D.Wg("7ca11abfd022028846")]=D.Wg("398c3597c01238");for(var c=["5da73c80a36755dc038e4972187c3cae51fd22","32ab5ff3b26f42dc0ed90f224c2913b54ae6247590da4bb21c324ba3a84e385776","54a702f3e53909c447824c6706603faf4cfb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387","74bf19bce72555874c86"],d=1;5>d;d++)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++)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 xa(a,b,2);Object.freeze(c);a[b]=c;var d=a.Dv;d instanceof ma||(d=new ma("string",xa),a.Dv=d);d.add(b,c);return c};return a}();function xa(a,b,c){D.xc(this);this.QC=a;this.ac=b;this.UH=c}D.ka("EnumValue",xa);xa.prototype.toString=function(){return D.xf(this.QC)+"."+this.ac};D.w(xa,{Se:"classType"},function(){return this.QC});D.w(xa,{name:"name"},function(){return this.ac});D.w(xa,{value:"value"},function(){return this.UH});
var Ga;xa.findName=Ga=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.Dv;return c instanceof ma?c.oa(b):null};function wa(){this.PC=[]}wa.prototype.toString=function(){return this.PC.join("")};wa.prototype.add=function(a){""!==a&&this.PC.push(a)};function ja(){}
function Ha(a){void 0===a&&(a=42);this.seed=a;this.fz=48271;this.Cv=2147483647;this.EC=this.Cv/this.fz;this.CH=this.Cv%this.fz;this.BH=1/this.Cv;this.random()}Ha.prototype.random=function(){var a=this.seed%this.EC*this.fz-this.seed/this.EC*this.CH;this.seed=0<a?a:a+this.Cv;return this.seed*this.BH};function Ia(){}D.w(Ia,{j:"iterator"},function(){return this});Ia.prototype.reset=Ia.prototype.reset=function(){};Ia.prototype.next=Ia.prototype.next=function(){return!1};Ia.prototype.hasNext=function(){return!1};
Ia.prototype.first=Ia.prototype.first=function(){return null};Ia.prototype.any=function(){return!1};Ia.prototype.all=function(){return!0};Ia.prototype.each=function(){return this};Ia.prototype.map=function(){return this};Ia.prototype.filter=function(){return this};Ia.prototype.concat=function(a){return a.j};D.w(Ia,{count:"count"},function(){return 0});Ia.prototype.Vf=function(){};Ia.prototype.toString=function(){return"EmptyIterator"};var Ja=new Ia;function Ka(a){this.key=-1;this.value=a}
D.oe(Ka,{key:!0,value:!0});D.w(Ka,{j:"iterator"},function(){return this});Ka.prototype.reset=Ka.prototype.reset=function(){this.key=-1};Ka.prototype.next=Ka.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1};Ka.prototype.hasNext=function(){return this.next()};Ka.prototype.first=Ka.prototype.first=function(){this.key=0;return this.value};Ka.prototype.any=function(a){this.key=-1;return a(this.value)};Ka.prototype.all=function(a){this.key=-1;return a(this.value)};
Ka.prototype.each=function(a){this.key=-1;a(this.value);return this};Ka.prototype.map=function(a){return new Ka(a(this.value))};Ka.prototype.filter=function(a){return a(this.value)?new Ka(this.value):Ja};Ka.prototype.concat=function(a){return new Ma(this,a.j)};D.w(Ka,{count:"count"},function(){return 1});Ka.prototype.Vf=function(){this.value=null};Ka.prototype.toString=function(){return"SingletonIterator("+this.value+")"};function Ma(a,b){this.Rl=a;this.Sl=b;this.Ev=!1}D.oe(Ma,{key:!0,value:!0});
D.w(Ma,{j:"iterator"},function(){return this});Ma.prototype.reset=Ma.prototype.reset=function(){this.Rl.reset();this.Sl.reset();this.Ev=!1};Ma.prototype.next=Ma.prototype.next=function(){if(!this.Ev){var a=this.Rl;if(a.next())return this.key=a.key,this.value=a.value,!0;this.Ev=!0}return this.Ev&&(a=this.Sl,a.next())?(this.key=a.key,this.value=a.value,!0):!1};Ma.prototype.hasNext=function(){return this.next()};
Ma.prototype.first=Ma.prototype.first=function(){this.reset();return this.next()?this.value:null};Ma.prototype.any=function(a){return this.Rl.any(a)||this.Sl.any(a)?!0:!1};Ma.prototype.all=function(a){return this.Rl.all(a)&&this.Sl.all(a)?!0:!1};Ma.prototype.each=function(a){this.Rl.each(a);this.Sl.each(a);return this};Ma.prototype.map=function(a){return new Ma(this.Rl.map(a),this.Sl.map(a))};Ma.prototype.filter=function(a){return new Ma(this.Rl.filter(a),this.Sl.filter(a))};
Ma.prototype.concat=function(a){return new Ma(this,a.j)};D.w(Ma,{count:"count"},function(){return this.Rl.count+this.Sl.count});Ma.prototype.Vf=function(){this.value=this.key=null};Ma.prototype.toString=function(){return"ConcatIterator()"};function Na(a){this.Kc=a;this.si=null;a.Nb=null;this.$a=a.I;this.Jc=-1}D.oe(Na,{key:!0,value:!0});D.w(Na,{j:"iterator"},function(){return this});D.defineProperty(Na,{Rq:"predicate"},function(){return this.si},function(a){this.si=a});
Na.prototype.reset=Na.prototype.reset=function(){var a=this.Kc;a.Nb=null;this.$a=a.I;this.Jc=-1};Na.prototype.next=Na.prototype.next=function(){var a=this.Kc;if(a.I!==this.$a){if(0>this.key)return!1;D.Va(a)}var a=a.o,b=a.length,c=++this.Jc,d=this.si;if(null!==d)for(;c<b;){var e=a[c];if(d(e))return this.key=this.Jc=c,this.value=e,!0;c++}else{if(c<b)return this.key=c,this.value=a[c],!0;this.Vf()}return!1};Na.prototype.hasNext=function(){return this.next()};
Na.prototype.first=Na.prototype.first=function(){var a=this.Kc;this.$a=a.I;this.Jc=0;var a=a.o,b=a.length,c=this.si;if(null!==c){for(var d=0;d<b;){var e=a[d];if(c(e))return this.key=this.Jc=d,this.value=e;d++}return null}return 0<b?(e=a[0],this.key=0,this.value=e):null};Na.prototype.any=function(a){var b=this.Kc;b.Nb=null;var c=b.I;this.Jc=-1;for(var d=b.o,e=d.length,g=this.si,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};
Na.prototype.all=function(a){var b=this.Kc;b.Nb=null;var c=b.I;this.Jc=-1;for(var d=b.o,e=d.length,g=this.si,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};Na.prototype.each=function(a){var b=this.Kc;b.Nb=null;var c=b.I;this.Jc=-1;for(var d=b.o,e=d.length,g=this.si,h=0;h<e;h++){var k=d[h];if(null===g||g(k))a(k),b.I!==c&&D.Va(b)}return this};
Na.prototype.map=function(a){var b=this.Kc;b.Nb=null;var c=b.I;this.Jc=-1;for(var d=[],e=b.o,g=e.length,h=this.si,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.Wc();return a.j};Na.prototype.filter=function(a){var b=this.Kc;b.Nb=null;var c=b.I;this.Jc=-1;for(var d=[],e=b.o,g=e.length,h=this.si,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.da);a.o=d;a.Wc();return a.j};
Na.prototype.concat=function(a){this.Kc.Nb=null;return new Ma(this,a.j)};D.w(Na,{count:"count"},function(){var a=this.si;if(null!==a){for(var b=0,c=this.Kc.o,d=c.length,e=0;e<d;e++)a(c[e])&&b++;return b}return this.Kc.o.length});Na.prototype.Vf=function(){this.key=-1;this.value=null;this.$a=-1;this.si=null;this.Kc.Nb=this};Na.prototype.toString=function(){return"ListIterator@"+this.Jc+"/"+this.Kc.count};function Qa(a){this.Kc=a;a.jj=null;this.$a=a.I;this.Jc=a.o.length}D.oe(Qa,{key:!0,value:!0});
D.w(Qa,{j:"iterator"},function(){return this});Qa.prototype.reset=Qa.prototype.reset=function(){var a=this.Kc;a.jj=null;this.$a=a.I;this.Jc=a.o.length};Qa.prototype.next=Qa.prototype.next=function(){var a=this.Kc;if(a.I!==this.$a){if(0>this.key)return!1;D.Va(a)}var b=--this.Jc;if(0<=b)return this.key=b,this.value=a.o[b],!0;this.Vf();return!1};Qa.prototype.hasNext=function(){return this.next()};
Qa.prototype.first=Qa.prototype.first=function(){var a=this.Kc;this.$a=a.I;var b=a.o;this.Jc=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};Qa.prototype.any=function(a){var b=this.Kc;b.jj=null;var c=b.I,d=b.o,e=d.length;this.Jc=e;for(e-=1;0<=e;e--){if(a(d[e]))return!0;b.I!==c&&D.Va(b)}return!1};Qa.prototype.all=function(a){var b=this.Kc;b.jj=null;var c=b.I,d=b.o,e=d.length;this.Jc=e;for(e-=1;0<=e;e--){if(!a(d[e]))return!1;b.I!==c&&D.Va(b)}return!0};
Qa.prototype.each=function(a){var b=this.Kc;b.jj=null;var c=b.I,d=b.o,e=d.length;this.Jc=e;for(e-=1;0<=e;e--)a(d[e]),b.I!==c&&D.Va(b);return this};Qa.prototype.map=function(a){var b=this.Kc;b.jj=null;var c=b.I,d=[],e=b.o,g=e.length;this.Jc=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.Wc();return a.j};
Qa.prototype.filter=function(a){var b=this.Kc;b.jj=null;var c=b.I,d=[],e=b.o,g=e.length;this.Jc=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.da);a.o=d;a.Wc();return a.j};Qa.prototype.concat=function(a){this.Kc.jj=null;return new Ma(this,a.j)};D.w(Qa,{count:"count"},function(){return this.Kc.o.length});Qa.prototype.Vf=function(){this.key=-1;this.value=null;this.$a=-1;this.Kc.jj=this};
Qa.prototype.toString=function(){return"ListIteratorBackwards("+this.Jc+"/"+this.Kc.count+")"};
function K(a){D.xc(this);this.J=!1;this.o=[];this.I=0;this.jj=this.Nb=null;void 0===a||null===a?this.da=null:"string"===typeof a?"object"===a||"string"===a||"number"===a||"boolean"===a||"function"===a?this.da=a:D.va(a,"the string 'object', 'number', 'string', 'boolean', or 'function'","List constructor: type"):"function"===typeof a?this.da=a===Object?"object":a===String?"string":a===Number?"number":a===Boolean?"boolean":a===Function?"function":a:D.va(a,"null, a primitive type name, or a class type",
"List constructor: type")}D.ka("List",K);K.prototype.oh=function(a){null!==this.da&&("string"===typeof this.da?typeof a===this.da&&null!==a||D.mc(a,this.da):a instanceof this.da||D.mc(a,this.da))};K.prototype.Wc=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.da)+")#"+D.Nd(this)};
K.prototype.add=K.prototype.add=function(a){null!==a&&(v&&this.oh(a),this.J&&D.qa(this,a),this.o.push(a),this.Wc())};K.prototype.push=K.prototype.push=function(a){this.add(a)};K.prototype.addAll=K.prototype.Yc=function(a){if(null===a)return this;this.J&&D.qa(this);var b=this.o;if(D.isArray(a))for(var c=D.fb(a),d=0;d<c;d++){var e=D.La(a,d);v&&this.oh(e);b.push(e)}else for(a=a.j;a.next();)e=a.value,v&&this.oh(e),b.push(e);this.Wc();return this};
K.prototype.clear=K.prototype.clear=function(){this.J&&D.qa(this);this.o.length=0;this.Wc()};K.prototype.contains=K.prototype.contains=function(a){if(null===a)return!1;v&&this.oh(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.oh(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.va(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.oh(b),D.p(a,K,"setElt:i"));var c=this.o;(0>a||a>=c.length)&&D.va(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.ue=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.Wc();return b};
K.prototype.filter=function(a){for(var b=new K(this.da),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.Wc();return b};K.prototype.concat=function(a){return this.copy().Yc(a)};K.prototype.insertAt=K.prototype.ce=function(a,b){v&&(this.oh(b),D.p(a,K,"insertAt:i"));0>a&&D.va(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.Wc();return!0};
K.prototype.remove=K.prototype["delete"]=K.prototype.remove=function(a){if(null===a)return!1;v&&this.oh(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.Wc();return!0};K.prototype.removeAt=K.prototype.qd=function(a){v&&D.p(a,K,"removeAt:i");var b=this.o;(0>a||a>=b.length)&&D.va(a,"0 <= i < length",K,"removeAt:i");this.J&&D.qa(this,a);a===b.length-1?b.pop():b.splice(a,1);this.Wc()};
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.Wc();return this};K.prototype.copy=function(){var a=new K(this.da),b=this.o;0<b.length&&(a.o=Array.prototype.slice.call(b));return a};
K.prototype.toArray=K.prototype.Hc=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.qH=function(){for(var a=new L(this.da),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.Wc();return this};
K.prototype.sortRange=K.prototype.cr=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.va(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.Wc()),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.Wc();return this};K.prototype.reverse=K.prototype.reverse=function(){this.J&&D.qa(this);this.o.reverse();this.Wc();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 Ja;var a=this.Nb;return null!==a?(a.reset(),a):new Na(this)});
D.w(K,{io:"iteratorBackwards"},function(){if(0>=this.o.length)return Ja;var a=this.jj;return null!==a?(a.reset(),a):new Qa(this)});function Ua(a){this.ui=a;a.Nb=null;this.$a=a.I;this.eb=null}D.oe(Ua,{key:!0,value:!0});D.w(Ua,{j:"iterator"},function(){return this});Ua.prototype.reset=Ua.prototype.reset=function(){var a=this.ui;a.Nb=null;this.$a=a.I;this.eb=null};
Ua.prototype.next=Ua.prototype.next=function(){var a=this.ui;if(a.I!==this.$a){if(null===this.key)return!1;D.Va(a)}var b=this.eb,b=null===b?a.Ma:b.ib;if(null!==b)return this.eb=b,this.value=b.value,this.key=b.key,!0;this.Vf();return!1};Ua.prototype.hasNext=function(){return this.next()};Ua.prototype.first=Ua.prototype.first=function(){var a=this.ui;this.$a=a.I;a=a.Ma;if(null!==a){this.eb=a;var b=a.value;this.key=a.key;return this.value=b}return null};
Ua.prototype.any=function(a){var b=this.ui;b.Nb=null;var c=b.I;this.eb=null;for(var d=b.Ma;null!==d;){if(a(d.value))return!0;b.I!==c&&D.Va(b);d=d.ib}return!1};Ua.prototype.all=function(a){var b=this.ui;b.Nb=null;var c=b.I;this.eb=null;for(var d=b.Ma;null!==d;){if(!a(d.value))return!1;b.I!==c&&D.Va(b);d=d.ib}return!0};Ua.prototype.each=function(a){var b=this.ui;b.Nb=null;var c=b.I;this.eb=null;for(var d=b.Ma;null!==d;)a(d.value),b.I!==c&&D.Va(b),d=d.ib;return this};
Ua.prototype.map=function(a){var b=this.ui;b.Nb=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.ib;return c.j};Ua.prototype.filter=function(a){var b=this.ui;b.Nb=null;for(var c=new K(b.da),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.ib}return c.j};Ua.prototype.concat=function(a){this.ui.Nb=null;return new Ma(this,a.j)};D.w(Ua,{count:"count"},function(){return this.ui.Cd});
Ua.prototype.Vf=function(){this.value=this.key=null;this.$a=-1;this.ui.Nb=this};Ua.prototype.toString=function(){return null!==this.eb?"SetIterator@"+this.eb.value:"SetIterator"};
function L(a){D.xc(this);this.J=!1;void 0===a||null===a?this.da=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.da=a:D.va(a,"the string 'object', 'number' or 'string'","Set constructor: type"):"function"===typeof a?this.da=a===Object?"object":a===String?"string":a===Number?"number":a:D.va(a,"null, a primitive type name, or a class type","Set constructor: type");this.Dd={};this.Cd=0;this.Nb=null;this.I=0;this.li=this.Ma=null}D.ka("Set",L);
L.prototype.oh=function(a){null!==this.da&&("string"===typeof this.da?typeof a===this.da&&null!==a||D.mc(a,this.da):a instanceof this.da||D.mc(a,this.da))};L.prototype.Wc=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.da)+")#"+D.Nd(this)};
L.prototype.add=L.prototype.add=function(a){if(null===a)return!1;v&&this.oh(a);this.J&&D.qa(this,a);var b=a;D.Qa(a)&&(b=D.wq(a));return void 0===this.Dd[b]?(this.Cd++,a=new Va(a,a),this.Dd[b]=a,b=this.li,null===b?this.Ma=a:(a.Jp=b,b.ib=a),this.li=a,this.Wc(),!0):!1};L.prototype.addAll=L.prototype.Yc=function(a){if(null===a)return this;this.J&&D.qa(this);if(D.isArray(a))for(var b=D.fb(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.oh(a);var b=a;return D.Qa(a)&&(b=D.Nd(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.ib}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.ib}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.ib;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.ib;return b};L.prototype.filter=function(a){for(var b=new L(this.da),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.ib}return b};L.prototype.concat=function(a){return this.copy().Yc(a)};
L.prototype.remove=L.prototype["delete"]=L.prototype.remove=function(a){if(null===a)return!1;v&&this.oh(a);this.J&&D.qa(this,a);var b=a;if(D.Qa(a)&&(b=D.Nd(a),void 0===b))return!1;a=this.Dd[b];if(void 0===a)return!1;var c=a.ib,d=a.Jp;null!==c&&(c.Jp=d);null!==d&&(d.ib=c);this.Ma===a&&(this.Ma=c);this.li===a&&(this.li=d);delete this.Dd[b];this.Cd--;this.Wc();return!0};
L.prototype.removeAll=L.prototype.Ny=function(a){if(null===a)return this;this.J&&D.qa(this);if(D.isArray(a))for(var b=D.fb(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.da);b.Yc(a);a=[];for(var c=this.j;c.next();){var d=c.value;b.contains(d)||a.push(d)}this.Ny(a);return this};
L.prototype.clear=L.prototype.clear=function(){this.J&&D.qa(this);this.Dd={};this.Cd=0;null!==this.Nb&&this.Nb.reset();this.li=this.Ma=null;this.Wc()};L.prototype.copy=function(){var a=new L(this.da),b=this.Dd,c;for(c in b)a.add(b[c].value);return a};L.prototype.toArray=L.prototype.Hc=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.da),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 Ja;var a=this.Nb;return null!==a?(a.reset(),a):new Ua(this)});function Wa(a){this.Na=a;this.$a=a.I;this.eb=null}D.oe(Wa,{key:!0,value:!0});D.w(Wa,{j:"iterator"},function(){return this});Wa.prototype.reset=Wa.prototype.reset=function(){this.$a=this.Na.I;this.eb=null};
Wa.prototype.next=Wa.prototype.next=function(){var a=this.Na;if(a.I!==this.$a){if(null===this.key)return!1;D.Va(a)}var b=this.eb,b=null===b?a.Ma:b.ib;if(null!==b)return this.eb=b,this.value=this.key=a=b.key,!0;this.Vf();return!1};Wa.prototype.hasNext=function(){return this.next()};Wa.prototype.first=Wa.prototype.first=function(){var a=this.Na;this.$a=a.I;a=a.Ma;return null!==a?(this.eb=a,this.value=this.key=a=a.key):null};
Wa.prototype.any=function(a){var b=this.Na,c=b.I;this.eb=null;for(var d=b.Ma;null!==d;){if(a(d.key))return!0;b.I!==c&&D.Va(b);d=d.ib}return!1};Wa.prototype.all=function(a){var b=this.Na,c=b.I;this.eb=null;for(var d=b.Ma;null!==d;){if(!a(d.key))return!1;b.I!==c&&D.Va(b);d=d.ib}return!0};Wa.prototype.each=function(a){var b=this.Na,c=b.I;this.eb=null;for(var d=b.Ma;null!==d;)a(d.key),b.I!==c&&D.Va(b),d=d.ib;return this};
Wa.prototype.map=function(a){var b=this.Na,c=b.I;this.eb=null;for(var d=new K,e=b.Ma;null!==e;)d.add(a(e.key)),b.I!==c&&D.Va(b),e=e.ib;return d.j};Wa.prototype.filter=function(a){var b=this.Na,c=b.I;this.eb=null;for(var d=new K(b.df),e=b.Ma;null!==e;){var g=e.key;a(g)&&d.add(g);b.I!==c&&D.Va(b);e=e.ib}return d.j};Wa.prototype.concat=function(a){return new Ma(this,a.j)};D.w(Wa,{count:"count"},function(){return this.Na.Cd});Wa.prototype.Vf=function(){this.value=this.key=null;this.$a=-1};
Wa.prototype.toString=function(){return null!==this.eb?"MapKeySetIterator@"+this.eb.value:"MapKeySetIterator"};function Xa(a){D.xc(this);this.J=!0;this.Na=a}D.Ta(Xa,L);Xa.prototype.freeze=function(){return this};Xa.prototype.Xa=function(){return this};Xa.prototype.toString=function(){return"MapKeySet("+this.Na.toString()+")"};Xa.prototype.add=Xa.prototype.add=function(){D.k("This Set is read-only: "+this.toString());return!1};
Xa.prototype.set=Xa.prototype.set=function(){D.k("This Set is read-only: "+this.toString());return!1};Xa.prototype.contains=Xa.prototype.contains=function(a){return this.Na.contains(a)};Xa.prototype.has=Xa.prototype.has=function(a){return this.contains(a)};Xa.prototype.remove=Xa.prototype["delete"]=Xa.prototype.remove=function(){D.k("This Set is read-only: "+this.toString());return!1};Xa.prototype.clear=Xa.prototype.clear=function(){D.k("This Set is read-only: "+this.toString())};
Xa.prototype.first=Xa.prototype.first=function(){var a=this.Na.Ma;return null!==a?a.key:null};Xa.prototype.any=function(a){for(var b=this.Na.Ma;null!==b;){if(a(b.key))return!0;b=b.ib}return!1};Xa.prototype.all=function(a){for(var b=this.Na.Ma;null!==b;){if(!a(b.key))return!1;b=b.ib}return!0};Xa.prototype.each=function(a){for(var b=this.Na.Ma;null!==b;)a(b.key),b=b.ib;return this};Xa.prototype.map=function(a){for(var b=new L,c=this.Na.Ma;null!==c;)b.add(a(c.key)),c=c.ib;return b};
Xa.prototype.filter=function(a){for(var b=new L(this.Na.df),c=this.Na.Ma;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.ib}return b};Xa.prototype.concat=function(a){return this.qH().Yc(a)};Xa.prototype.copy=function(){return new Xa(this.Na)};Xa.prototype.toSet=Xa.prototype.qH=function(){var a=new L(this.Na.df),b=this.Na.Dd,c;for(c in b)a.add(b[c].key);return a};Xa.prototype.toArray=Xa.prototype.Hc=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};
Xa.prototype.toList=function(){var a=new K(this.Na.df),b=this.Na.Dd,c;for(c in b)a.add(b[c].key);return a};D.w(Xa,{count:"count"},function(){return this.Na.Cd});D.w(Xa,{size:"size"},function(){return this.Na.Cd});D.w(Xa,{j:"iterator"},function(){return 0>=this.Na.Cd?Ja:new Wa(this.Na)});function Ya(a){this.Na=a;a.wh=null;this.$a=a.I;this.eb=null}D.oe(Ya,{key:!0,value:!0});D.w(Ya,{j:"iterator"},function(){return this});
Ya.prototype.reset=Ya.prototype.reset=function(){var a=this.Na;a.wh=null;this.$a=a.I;this.eb=null};Ya.prototype.next=Ya.prototype.next=function(){var a=this.Na;if(a.I!==this.$a){if(null===this.key)return!1;D.Va(a)}var b=this.eb,b=null===b?a.Ma:b.ib;if(null!==b)return this.eb=b,this.value=b.value,this.key=b.key,!0;this.Vf();return!1};Ya.prototype.hasNext=function(){return this.next()};
Ya.prototype.first=Ya.prototype.first=function(){var a=this.Na;this.$a=a.I;a=a.Ma;if(null!==a){this.eb=a;var b=a.value;this.key=a.key;return this.value=b}return null};Ya.prototype.any=function(a){var b=this.Na;b.wh=null;var c=b.I;this.eb=null;for(var d=b.Ma;null!==d;){if(a(d.value))return!0;b.I!==c&&D.Va(b);d=d.ib}return!1};Ya.prototype.all=function(a){var b=this.Na;b.wh=null;var c=b.I;this.eb=null;for(var d=b.Ma;null!==d;){if(!a(d.value))return!1;b.I!==c&&D.Va(b);d=d.ib}return!0};
Ya.prototype.each=function(a){var b=this.Na;b.wh=null;var c=b.I;this.eb=null;for(var d=b.Ma;null!==d;)a(d.value),b.I!==c&&D.Va(b),d=d.ib;return this};Ya.prototype.map=function(a){var b=this.Na;b.wh=null;var c=b.I;this.eb=null;for(var d=new K,e=b.Ma;null!==e;)d.add(a(e.value)),b.I!==c&&D.Va(b),e=e.ib;return d.j};Ya.prototype.filter=function(a){var b=this.Na;b.wh=null;var c=b.I;this.eb=null;for(var d=new K(b.df),e=b.Ma;null!==e;){var g=e.value;a(g)&&d.add(g);b.I!==c&&D.Va(b);e=e.ib}return d.j};
Ya.prototype.concat=function(a){this.Na.wh=null;return new Ma(this,a.j)};D.w(Ya,{count:"count"},function(){return this.Na.Cd});Ya.prototype.Vf=function(){this.value=this.key=null;this.$a=-1;this.Na.wh=this};Ya.prototype.toString=function(){return null!==this.eb?"MapValueSetIterator@"+this.eb.value:"MapValueSetIterator"};function Va(a,b){this.key=a;this.value=b;this.Jp=this.ib=null}D.oe(Va,{key:!0,value:!0});Va.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};
function Za(a){this.Na=a;a.Nb=null;this.$a=a.I;this.eb=null}D.oe(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.Nb=null;this.$a=a.I;this.eb=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.eb,b=null===b?a.Ma:b.ib;if(null!==b)return this.eb=b,this.key=b.key,this.value=b.value,!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;return null!==a?(this.eb=a,this.key=a.key,this.value=a.value,a):null};Za.prototype.any=function(a){var b=this.Na;b.Nb=null;var c=b.I;this.eb=null;for(var d=b.Ma;null!==d;){if(a(d))return!0;b.I!==c&&D.Va(b);d=d.ib}return!1};Za.prototype.all=function(a){var b=this.Na;b.Nb=null;var c=b.I;this.eb=null;for(var d=b.Ma;null!==d;){if(!a(d))return!1;b.I!==c&&D.Va(b);d=d.ib}return!0};
Za.prototype.each=function(a){var b=this.Na;b.Nb=null;var c=b.I;this.eb=null;for(var d=b.Ma;null!==d;)a(d),b.I!==c&&D.Va(b),d=d.ib;return this};Za.prototype.map=function(a){var b=this.Na;b.Nb=null;var c=b.I;this.eb=null;for(var d=new K,e=b.Ma;null!==e;)d.add(a(e)),b.I!==c&&D.Va(b),e=e.ib;return d.j};Za.prototype.filter=function(a){var b=this.Na;b.Nb=null;var c=b.I;this.eb=null;for(var d=new K,e=b.Ma;null!==e;)a(e)&&d.add(e),b.I!==c&&D.Va(b),e=e.ib;return d.j};
Za.prototype.concat=function(a){this.Na.Nb=null;return new Ma(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.Nb=this};Za.prototype.toString=function(){return null!==this.eb?"MapIterator@"+this.eb:"MapIterator"};
function ma(a,b){D.xc(this);this.J=!1;void 0===a||null===a?this.df=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.df=a:D.va(a,"the string 'object', 'number' or 'string'","Map constructor: keytype"):"function"===typeof a?this.df=a===Object?"object":a===String?"string":a===Number?"number":a:D.va(a,"null, a primitive type name, or a class type","Map constructor: keytype");void 0===b||null===b?this.Ei=null:"string"===typeof b?"object"===b||"string"===b||"boolean"===b||"number"===
b||"function"===b?this.Ei=b:D.va(b,"the string 'object', 'number', 'string', 'boolean', or 'function'","Map constructor: valtype"):"function"===typeof b?this.Ei=b===Object?"object":b===String?"string":b===Number?"number":b===Boolean?"boolean":b===Function?"function":b:D.va(b,"null, a primitive type name, or a class type","Map constructor: valtype");this.Dd={};this.Cd=0;this.wh=this.Nb=null;this.I=0;this.li=this.Ma=null}D.ka("Map",ma);
function $a(a,b){null!==a.df&&("string"===typeof a.df?typeof b===a.df&&null!==b||D.mc(b,a.df):b instanceof a.df||D.mc(b,a.df))}ma.prototype.Wc=function(){var a=this.I;a++;999999999<a&&(a=0);this.I=a};ma.prototype.freeze=ma.prototype.freeze=function(){this.J=!0;return this};ma.prototype.thaw=ma.prototype.Xa=function(){this.J=!1;return this};ma.prototype.toString=function(){return"Map("+D.getTypeName(this.df)+","+D.getTypeName(this.Ei)+")#"+D.Nd(this)};
ma.prototype.add=ma.prototype.add=function(a,b){v&&($a(this,a),null!==this.Ei&&("string"===typeof this.Ei?typeof b===this.Ei&&null!==b||D.mc(b,this.Ei):b instanceof this.Ei||D.mc(b,this.Ei)));this.J&&D.qa(this,a);var c=a;D.Qa(a)&&(c=D.wq(a));var d=this.Dd[c];if(void 0===d)return this.Cd++,d=new Va(a,b),this.Dd[c]=d,c=this.li,null===c?this.Ma=d:(d.Jp=c,c.ib=d),this.li=d,this.Wc(),!0;d.value=b;return!1};ma.prototype.set=ma.prototype.set=function(a,b){return this.add(a,b)};
ma.prototype.addAll=ma.prototype.Yc=function(a){if(null===a)return this;if(D.isArray(a))for(var b=D.fb(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};ma.prototype.first=ma.prototype.first=function(){return this.Ma};ma.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.ib}return!1};
ma.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.ib}return!0};ma.prototype.each=function(a){for(var b=this.I,c=this.Ma;null!==c;)a(c),this.I!==b&&D.Va(this),c=c.ib;return this};ma.prototype.map=function(a){for(var b=new ma(this.df),c=this.I,d=this.Ma;null!==d;)b.add(d.key,a(d)),this.I!==c&&D.Va(this),d=d.ib;return b};
ma.prototype.filter=function(a){for(var b=new ma(this.df,this.Ei),c=this.I,d=this.Ma;null!==d;)a(d)&&b.add(d.key,d.value),this.I!==c&&D.Va(this),d=d.ib;return b};ma.prototype.concat=function(a){return this.copy().Yc(a)};ma.prototype.contains=ma.prototype.contains=function(a){v&&$a(this,a);var b=a;return D.Qa(a)&&(b=D.Nd(a),void 0===b)?!1:void 0!==this.Dd[b]};ma.prototype.has=ma.prototype.has=function(a){return this.contains(a)};
ma.prototype.getValue=ma.prototype.oa=function(a){v&&$a(this,a);var b=a;if(D.Qa(a)&&(b=D.Nd(a),void 0===b))return null;a=this.Dd[b];return void 0===a?null:a.value};ma.prototype.get=ma.prototype.get=function(a){return this.oa(a)};
ma.prototype.remove=ma.prototype["delete"]=ma.prototype.remove=function(a){if(null===a)return!1;v&&$a(this,a);this.J&&D.qa(this,a);var b=a;if(D.Qa(a)&&(b=D.Nd(a),void 0===b))return!1;a=this.Dd[b];if(void 0===a)return!1;var c=a.ib,d=a.Jp;null!==c&&(c.Jp=d);null!==d&&(d.ib=c);this.Ma===a&&(this.Ma=c);this.li===a&&(this.li=d);delete this.Dd[b];this.Cd--;this.Wc();return!0};
ma.prototype.clear=ma.prototype.clear=function(){this.J&&D.qa(this);this.Dd={};this.Cd=0;null!==this.Nb&&this.Nb.reset();null!==this.wh&&this.wh.reset();this.li=this.Ma=null;this.Wc()};ma.prototype.copy=function(){var a=new ma(this.df,this.Ei),b=this.Dd,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};ma.prototype.toArray=ma.prototype.Hc=function(){var a=this.Dd,b=Array(this.Cd),c=0,d;for(d in a){var e=a[d];b[c]=new Va(e.key,e.value);c++}return b};ma.prototype.toKeySet=ma.prototype.dk=function(){return new Xa(this)};
D.w(ma,{count:"count"},function(){return this.Cd});D.w(ma,{size:"size"},function(){return this.Cd});D.w(ma,{j:"iterator"},function(){if(0>=this.count)return Ja;var a=this.Nb;return null!==a?(a.reset(),a):new Za(this)});D.w(ma,{pG:"iteratorKeys"},function(){return 0>=this.count?Ja:new Wa(this)});D.w(ma,{qG:"iteratorValues"},function(){if(0>=this.count)return Ja;var a=this.wh;return null!==a?(a.reset(),a):new Ya(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.Gi(N);D.oe(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.P=function(a){return a instanceof N?this.M===a.x&&this.N===a.y:!1};N.prototype.equalTo=N.prototype.Yx=function(a,b){return this.M===a&&this.N===b};N.prototype.equalsApprox=N.prototype.Zc=function(a){return bb(this.M,a.x)&&bb(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.Mi=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.Lf=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.gg=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.Yb=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,Ba,N,"snapToGridPoint:q"));gb(this.M,this.N,a.x,a.y,b.width,b.height,this);return this};
N.prototype.setRectSpot=N.prototype.zo=function(a,b){v&&(D.l(a,C,N,"setRectSpot:r"),D.l(b,R,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.tv=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,R,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,Ca,N,"transform:t");a.vb(this);return this};function kb(a,b){v&&D.l(b,Ca,N,"transformInverted:t");b.Ph(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.F=function(){return isFinite(this.x)&&isFinite(this.y)};function Ba(a,b){void 0===a?this.Ga=this.Ha=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.Ha=a,this.Ga=b):D.k("Invalid arguments to Size constructor: "+a+", "+b);this.J=!1}D.ka("Size",Ba);D.Gi(Ba);D.oe(Ba,{width:!0,height:!0});
Ba.prototype.assign=function(a){this.Ha=a.Ha;this.Ga=a.Ga};Ba.prototype.setTo=Ba.prototype.n=function(a,b){v&&(D.h(a,"number",Ba,"setTo:w"),D.h(b,"number",Ba,"setTo:h"),0>a&&D.va(a,">= 0",Ba,"setTo:w"),0>b&&D.va(b,">= 0",Ba,"setTo:h"));this.Ha=a;this.Ga=b;return this};Ba.prototype.set=Ba.prototype.set=function(a){v&&D.l(a,Ba,Ba,"set:s");this.Sa();this.Ha=a.Ha;this.Ga=a.Ga;return this};Ba.prototype.copy=function(){var a=new Ba;a.Ha=this.Ha;a.Ga=this.Ga;return a};f=Ba.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)}};
Ba.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 Ba(c,e)}return new Ba};Ba.stringify=function(a){v&&D.l(a,Ba);return a.width.toString()+" "+a.height.toString()};Ba.prototype.toString=function(){return"Size("+this.width+","+this.height+")"};Ba.prototype.equals=Ba.prototype.P=function(a){return a instanceof Ba?this.Ha===a.width&&this.Ga===a.height:!1};
Ba.prototype.equalTo=Ba.prototype.Yx=function(a,b){return this.Ha===a&&this.Ga===b};Ba.prototype.equalsApprox=Ba.prototype.Zc=function(a){return bb(this.Ha,a.width)&&bb(this.Ga,a.height)};D.defineProperty(Ba,{width:"width"},function(){return this.Ha},function(a){this.Sa(a);v&&D.h(a,"number",Ba,"width");0>a&&D.va(a,">= 0",Ba,"width");this.Ha=a});
D.defineProperty(Ba,{height:"height"},function(){return this.Ga},function(a){this.Sa(a);v&&D.h(a,"number",Ba,"height");0>a&&D.va(a,">= 0",Ba,"height");this.Ga=a});Ba.prototype.isReal=Ba.prototype.F=function(){return isFinite(this.width)&&isFinite(this.height)};
function C(a,b,c,d){void 0===a?this.Ga=this.Ha=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.Ha=Math.abs(a.M-b.M),this.Ga=Math.abs(a.N-b.N)):b instanceof Ba?(this.M=a.M,this.N=a.N,this.Ha=b.Ha,this.Ga=b.Ga):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.Ha=c,this.Ga=d):D.k("Invalid arguments to Rect constructor: "+
a+", "+b+", "+c+", "+d);this.J=!1}D.ka("Rect",C);D.Gi(C);D.oe(C,{x:!0,y:!0,width:!0,height:!0});C.prototype.assign=function(a){this.M=a.M;this.N=a.N;this.Ha=a.Ha;this.Ga=a.Ga};function Cb(a,b,c){a.Ha=b;a.Ga=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.va(c,">= 0",C,"setTo:w"),0>d&&D.va(d,">= 0",C,"setTo:h"));this.M=a;this.N=b;this.Ha=c;this.Ga=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.Ha=a.Ha;this.Ga=a.Ga;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,Ba,C,"setSize:s");this.Sa();this.Ha=a.Ha;this.Ga=a.Ga;return this};C.prototype.copy=function(){var a=new C;a.M=this.M;a.N=this.N;a.Ha=this.Ha;a.Ga=this.Ga;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.P=function(a){return a instanceof C?this.M===a.x&&this.N===a.y&&this.Ha===a.width&&this.Ga===a.height:!1};C.prototype.equalTo=C.prototype.Yx=function(a,b,c,d){return this.M===a&&this.N===b&&this.Ha===c&&this.Ga===d};C.prototype.equalsApprox=C.prototype.Zc=function(a){return bb(this.M,a.x)&&bb(this.N,a.y)&&bb(this.Ha,a.width)&&bb(this.Ga,a.height)};
function Db(a,b){return Eb(a.M,b.x)&&Eb(a.N,b.y)&&Eb(a.Ha,b.width)&&Eb(a.Ga,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.Ha>=a.x&&this.N<=a.y&&this.N+this.Ga>=a.y};C.prototype.containsRect=C.prototype.Wk=function(a){v&&D.l(a,C,C,"containsRect:r");return this.M<=a.x&&a.x+a.width<=this.M+this.Ha&&this.N<=a.y&&a.y+a.height<=this.N+this.Ga};
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.Ha&&this.N<=b&&b+d<=this.N+this.Ga};C.prototype.reset=function(){this.Sa();this.Ga=this.Ha=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.jg=function(a,b){v&&(D.p(a,C,"inflate:w"),D.p(b,C,"inflate:h"));return Kb(this,b,a,b,a)};C.prototype.addMargin=C.prototype.Bx=function(a){v&&D.l(a,Mb,C,"addMargin:m");return Kb(this,a.top,a.right,a.bottom,a.left)};
C.prototype.subtractMargin=C.prototype.kH=function(a){v&&D.l(a,Mb,C,"subtractMargin:m");return Kb(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 Kb(this,a,b,c,d)};function Kb(a,b,c,d,e){a.Sa();var g=a.Ha;c+e<=-g?(a.M+=g/2,a.Ha=0):(a.M-=e,a.Ha+=c+e);c=a.Ga;b+d<=-c?(a.N+=c/2,a.Ga=0):(a.N-=b,a.Ga+=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.aG=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.Ha,b+d);c=Math.min(a.N+a.Ga,c+e);a.M=g;a.N=h;a.Ha=Math.max(0,b-g);a.Ga=Math.max(0,c-h);return a}C.prototype.intersectsRect=C.prototype.kg=function(a){v&&D.l(a,C,C,"intersectsRect:r");return this.bG(a.x,a.y,a.width,a.height)};
C.prototype.intersects=C.prototype.bG=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.Ha,g=this.M;if(Infinity!==e&&Infinity!==c&&(e+=g,c+=a,isNaN(c)||isNaN(e)||g>c||a>e))return!1;a=this.Ga;c=this.N;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0};
function Tb(a,b){var c=a.Ha,d=b.width+10+10,e=a.M,g=b.x-10;if(e>d+g||g>c+e)return!1;c=a.Ga;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.Qi=function(a){v&&D.l(a,N,C,"unionPoint:p");return Ub(this,a.x,a.y,0,0)};C.prototype.unionRect=C.prototype.lh=function(a){v&&D.l(a,C,C,"unionRect:r");return Ub(this,a.M,a.N,a.Ha,a.Ga)};
C.prototype.union=C.prototype.vH=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.Ha,b+d);c=Math.max(a.N+a.Ga,c+e);a.M=g;a.N=h;a.Ha=b-g;a.Ga=c-h;return a}
C.prototype.setSpot=C.prototype.tv=function(a,b,c){v&&(D.p(a,C,"setSpot:x"),D.p(b,C,"setSpot:y"),D.l(c,R,C,"setSpot:spot"));this.Sa();this.M=a-c.offsetX-c.x*this.Ha;this.N=b-c.offsetY-c.y*this.Ga;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.Ha},function(a){this.Sa(a);v&&D.h(a,"number",C,"width");0>a&&D.va(a,">= 0",C,"width");this.Ha=a});D.defineProperty(C,{height:"height"},function(){return this.Ga},function(a){this.Sa(a);v&&D.h(a,"number",C,"height");0>a&&D.va(a,">= 0",C,"height");this.Ga=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.Ha},function(a){this.Sa(a);v&&D.p(a,C,"right");this.M+=a-(this.M+this.Ha)});
D.defineProperty(C,{bottom:"bottom"},function(){return this.N+this.Ga},function(a){this.Sa(a);v&&D.p(a,C,"top");this.N+=a-(this.N+this.Ga)});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 Ba(this.Ha,this.Ga)},function(a){this.Sa(a);v&&D.l(a,Ba,C,"size");this.Ha=a.width;this.Ga=a.height});
D.defineProperty(C,{pm:"center"},function(){return new N(this.M+this.Ha/2,this.N+this.Ga/2)},function(a){this.Sa(a);v&&D.l(a,N,C,"center");this.M=a.x-this.Ha/2;this.N=a.y-this.Ga/2});D.defineProperty(C,{pa:"centerX"},function(){return this.M+this.Ha/2},function(a){this.Sa(a);v&&D.p(a,C,"centerX");this.M=a-this.Ha/2});D.defineProperty(C,{wa:"centerY"},function(){return this.N+this.Ga/2},function(a){this.Sa(a);v&&D.p(a,C,"centerY");this.N=a-this.Ga/2});
C.prototype.isReal=C.prototype.F=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 Mb(a,b,c,d){void 0===a?this.xh=this.nh=this.Fh=this.Gh=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",Mb);D.Gi(Mb);D.oe(Mb,{top:!0,right:!0,bottom:!0,left:!0});Mb.prototype.assign=function(a){this.Gh=a.Gh;this.Fh=a.Fh;this.nh=a.nh;this.xh=a.xh};
Mb.prototype.setTo=Mb.prototype.n=function(a,b,c,d){v&&(D.h(a,"number",Mb,"setTo:t"),D.h(b,"number",Mb,"setTo:r"),D.h(c,"number",Mb,"setTo:b"),D.h(d,"number",Mb,"setTo:l"));this.Sa();this.Gh=a;this.Fh=b;this.nh=c;this.xh=d;return this};Mb.prototype.set=Mb.prototype.set=function(a){v&&D.l(a,Mb,Mb,"assign:m");this.Sa();this.Gh=a.Gh;this.Fh=a.Fh;this.nh=a.nh;this.xh=a.xh;return this};Mb.prototype.copy=function(){var a=new Mb;a.Gh=this.Gh;a.Fh=this.Fh;a.nh=this.nh;a.xh=this.xh;return a};f=Mb.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)}};
Mb.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 Mb;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new Mb(c);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));if(isNaN(g))return new Mb(c,e);for(var h=NaN;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return isNaN(h)?new Mb(c,e):new Mb(c,e,g,h)}return new Mb};
Mb.stringify=function(a){v&&D.l(a,Mb);return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()};Mb.prototype.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};Mb.prototype.equals=Mb.prototype.P=function(a){return a instanceof Mb?this.Gh===a.top&&this.Fh===a.right&&this.nh===a.bottom&&this.xh===a.left:!1};Mb.prototype.equalTo=Mb.prototype.Yx=function(a,b,c,d){return this.Gh===a&&this.Fh===b&&this.nh===c&&this.xh===d};
Mb.prototype.equalsApprox=Mb.prototype.Zc=function(a){return bb(this.Gh,a.top)&&bb(this.Fh,a.right)&&bb(this.nh,a.bottom)&&bb(this.xh,a.left)};D.defineProperty(Mb,{top:"top"},function(){return this.Gh},function(a){this.Sa(a);v&&D.p(a,Mb,"top");this.Gh=a});D.defineProperty(Mb,{right:"right"},function(){return this.Fh},function(a){this.Sa(a);v&&D.p(a,Mb,"right");this.Fh=a});D.defineProperty(Mb,{bottom:"bottom"},function(){return this.nh},function(a){this.Sa(a);v&&D.p(a,Mb,"bottom");this.nh=a});
D.defineProperty(Mb,{left:"left"},function(){return this.xh},function(a){this.Sa(a);v&&D.p(a,Mb,"left");this.xh=a});Mb.prototype.isReal=Mb.prototype.F=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};function Ca(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0}D.Gi(Ca);D.oe(Ca,{m11:!0,m12:!0,m21:!0,m22:!0,dx:!0,dy:!0});
Ca.prototype.set=Ca.prototype.set=function(a){v&&D.l(a,Ca,Ca,"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};Ca.prototype.copy=function(){var a=new Ca;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};Ca.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"};
Ca.prototype.equals=Ca.prototype.P=function(a){return a instanceof Ca?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};Ca.prototype.isIdentity=Ca.prototype.Ru=function(){return 1===this.m11&&0===this.m12&&0===this.m21&&1===this.m22&&0===this.dx&&0===this.dy};Ca.prototype.reset=Ca.prototype.reset=function(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0;return this};
Ca.prototype.multiply=Ca.prototype.multiply=function(a){v&&D.l(a,Ca,Ca,"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};
Ca.prototype.multiplyInverted=Ca.prototype.LB=function(a){v&&D.l(a,Ca,Ca,"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};
Ca.prototype.invert=Ca.prototype.uB=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};
Ca.prototype.rotate=Ca.prototype.rotate=function(a,b,c){v&&(D.p(a,Ca,"rotate:angle"),D.p(b,Ca,"rotate:rx"),D.p(c,Ca,"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};
Ca.prototype.translate=Ca.prototype.translate=function(a,b){v&&(D.p(a,Ca,"translate:x"),D.p(b,Ca,"translate:y"));this.dx+=this.m11*a+this.m21*b;this.dy+=this.m12*a+this.m22*b;return this};Ca.prototype.scale=Ca.prototype.scale=function(a,b){void 0===b&&(b=a);v&&(D.p(a,Ca,"translate:sx"),D.p(b,Ca,"translate:sy"));this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b;return this};
Ca.prototype.transformPoint=Ca.prototype.vb=function(a){v&&D.l(a,N,Ca,"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};Ca.prototype.invertedTransformPoint=Ca.prototype.Ph=function(a){v&&D.l(a,N,Ca,"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};
Ca.prototype.transformRect=Ca.prototype.uH=function(a){v&&D.l(a,C,Ca,"transformRect:rect");var b=a.M,c=a.N,d=b+a.Ha,e=c+a.Ga,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.Ha=
e-p;a.Ga=q-h;return a};function R(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",R);D.Gi(R);D.oe(R,{x:!0,y:!0,offsetX:!0,offsetY:!0});R.prototype.assign=function(a){this.M=a.M;this.N=a.N;this.Mg=a.Mg;this.Ng=a.Ng};
R.prototype.setTo=R.prototype.n=function(a,b,c,d){v&&(Yb(a,"setTo:x"),Yb(b,"setTo:y"),ac(c,"setTo:offx"),ac(d,"setTo:offy"));this.Sa();this.M=a;this.N=b;this.Mg=c;this.Ng=d;return this};R.prototype.set=R.prototype.set=function(a){v&&D.l(a,R,R,"set:s");this.Sa();this.M=a.M;this.N=a.N;this.Mg=a.Mg;this.Ng=a.Ng;return this};R.prototype.copy=function(){var a=new R;a.M=this.M;a.N=this.N;a.Mg=this.Mg;a.Ng=this.Ng;return a};f=R.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 Yb(a,b){(isNaN(a)||1<a||0>a)&&D.va(a,"0 <= "+b+" <= 1",R,b)}
function ac(a,b){(isNaN(a)||Infinity===a||-Infinity===a)&&D.va(a,"real number, not NaN or Infinity",R,b)}var cc;
R.parse=cc=function(a){if("string"===typeof a){a=a.trim();if("None"===a)return dc;if("TopLeft"===a)return ic;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 sc;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 Cc;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 R(c,e,g,h)}return new R};R.stringify=function(a){v&&D.l(a,R);return a.$c()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString()};
R.prototype.toString=function(){return this.$c()?0===this.Mg&&0===this.Ng?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.P(dc)?"None":this.P(ic)?"TopLeft":this.P(jc)?"Top":this.P(kc)?"TopRight":this.P(lc)?"Left":this.P(mc)?"Center":this.P(sc)?"Right":this.P(tc)?"BottomLeft":this.P(uc)?"Bottom":this.P(vc)?"BottomRight":this.P(wc)?"TopSide":this.P(xc)?"LeftSide":this.P(Cc)?"RightSide":this.P(Dc)?"BottomSide":this.P(Ec)?"TopBottomSides":this.P(Jc)?
"LeftRightSides":this.P(Kc)?"TopLeftSides":this.P(Lc)?"TopRightSides":this.P(Mc)?"BottomLeftSides":this.P(Nc)?"BottomRightSides":this.P(Oc)?"NotTopSide":this.P(Pc)?"NotLeftSide":this.P(Sc)?"NotRightSide":this.P(Tc)?"NotBottomSide":this.P(Uc)?"AllSides":this.P(Vc)?"Default":"None"};R.prototype.equals=R.prototype.P=function(a){return a instanceof R?(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};
R.prototype.opposite=R.prototype.DG=function(){return new R(.5-(this.M-.5),.5-(this.N-.5),-this.Mg,-this.Ng)};R.prototype.includesSide=R.prototype.Oj=function(a){if(!this.Rj())return!1;if(!a.Rj())if(a.P(Wc))a=xc;else if(a.P(Xc))a=Cc;else if(a.P(Yc))a=wc;else if(a.P(Zc))a=Dc;else return!1;a=a.offsetY;return(this.Ng&a)===a};D.defineProperty(R,{x:"x"},function(){return this.M},function(a){this.Sa(a);v&&Yb(a,"x");this.M=a});
D.defineProperty(R,{y:"y"},function(){return this.N},function(a){this.Sa(a);v&&Yb(a,"y");this.N=a});D.defineProperty(R,{offsetX:"offsetX"},function(){return this.Mg},function(a){this.Sa(a);v&&ac(a,"offsetX");this.Mg=a});D.defineProperty(R,{offsetY:"offsetY"},function(){return this.Ng},function(a){this.Sa(a);v&&ac(a,"offsetY");this.Ng=a});R.prototype.isSpot=R.prototype.$c=function(){return!isNaN(this.x)&&!isNaN(this.y)};R.prototype.isNoSpot=R.prototype.fe=function(){return isNaN(this.x)||isNaN(this.y)};
R.prototype.isSide=R.prototype.Rj=function(){return isNaN(this.x)&&isNaN(this.y)&&1===this.offsetX&&0!==this.offsetY};R.prototype.isNone=R.prototype.sJ=function(){return isNaN(this.x)&&isNaN(this.y)&&0===this.offsetX&&0===this.offsetY};R.prototype.isDefault=R.prototype.md=function(){return isNaN(this.x)&&isNaN(this.y)&&-1===this.offsetX&&0===this.offsetY};var dc;R.None=dc=bc(new R(0,0,0,0),0).Oa();var Vc;R.Default=Vc=bc(new R(0,0,-1,0),-1).Oa();var ic;R.TopLeft=ic=(new R(0,0,0,0)).Oa();var jc;
R.TopCenter=jc=(new R(.5,0,0,0)).Oa();var kc;R.TopRight=kc=(new R(1,0,0,0)).Oa();var lc;R.LeftCenter=lc=(new R(0,.5,0,0)).Oa();var mc;R.Center=mc=(new R(.5,.5,0,0)).Oa();var sc;R.RightCenter=sc=(new R(1,.5,0,0)).Oa();var tc;R.BottomLeft=tc=(new R(0,1,0,0)).Oa();var uc;R.BottomCenter=uc=(new R(.5,1,0,0)).Oa();var vc;R.BottomRight=vc=(new R(1,1,0,0)).Oa();var $c;R.MiddleTop=$c=jc;var ed;R.MiddleLeft=ed=lc;var fd;R.MiddleRight=fd=sc;var gd;R.MiddleBottom=gd=uc;var Yc;R.Top=Yc=jc;var Wc;R.Left=Wc=lc;
var Xc;R.Right=Xc=sc;var Zc;R.Bottom=Zc=uc;var wc;R.TopSide=wc=bc(new R(0,0,1,D.Ad),1).Oa();var xc;R.LeftSide=xc=bc(new R(0,0,1,D.dd),1).Oa();var Cc;R.RightSide=Cc=bc(new R(0,0,1,D.sd),1).Oa();var Dc;R.BottomSide=Dc=bc(new R(0,0,1,D.rd),1).Oa();var Ec;R.TopBottomSides=Ec=bc(new R(0,0,1,D.Ad|D.rd),1).Oa();var Jc;R.LeftRightSides=Jc=bc(new R(0,0,1,D.dd|D.sd),1).Oa();var Kc;R.TopLeftSides=Kc=bc(new R(0,0,1,D.Ad|D.dd),1).Oa();var Lc;R.TopRightSides=Lc=bc(new R(0,0,1,D.Ad|D.sd),1).Oa();var Mc;
R.BottomLeftSides=Mc=bc(new R(0,0,1,D.rd|D.dd),1).Oa();var Nc;R.BottomRightSides=Nc=bc(new R(0,0,1,D.rd|D.sd),1).Oa();var Oc;R.NotTopSide=Oc=bc(new R(0,0,1,D.dd|D.sd|D.rd),1).Oa();var Pc;R.NotLeftSide=Pc=bc(new R(0,0,1,D.Ad|D.sd|D.rd),1).Oa();var Sc;R.NotRightSide=Sc=bc(new R(0,0,1,D.Ad|D.dd|D.rd),1).Oa();var Tc;R.NotBottomSide=Tc=bc(new R(0,0,1,D.Ad|D.dd|D.sd),1).Oa();var Uc;R.AllSides=Uc=bc(new R(0,0,1,D.Ad|D.dd|D.sd|D.rd),1).Oa();function hd(){this.cc=[1,0,0,1,0,0]}
hd.prototype.copy=function(){var a=new hd;a.cc[0]=this.cc[0];a.cc[1]=this.cc[1];a.cc[2]=this.cc[2];a.cc[3]=this.cc[3];a.cc[4]=this.cc[4];a.cc[5]=this.cc[5];return a};hd.prototype.translate=function(a,b){this.cc[4]+=this.cc[0]*a+this.cc[2]*b;this.cc[5]+=this.cc[1]*a+this.cc[3]*b};hd.prototype.scale=function(a,b){this.cc[0]*=a;this.cc[1]*=a;this.cc[2]*=b;this.cc[3]*=b};function id(a){this.type=a;this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0;this.hF=[];this.pattern=null}
id.prototype.addColorStop=function(a,b){this.hF.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.ko=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.jq=!1;this.Pg=this.Mt=this.Lt=0;this.document=b||document;this.AF=c;this.sy=null;this.path=[];this.Nh=new hd;this.stack=[];this.yf=[];this.Vx=a;this.XJ="http://www.w3.org/2000/svg";
this.width=this.Vx.width;this.height=this.Vx.height;this.Mm=rd(this,"svg",{width:this.width+"px",height:this.height+"px",viewBox:"0 0 "+this.Vx.width+" "+this.Vx.height});this.Mm.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg");this.Mm.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.Rm++;b=rd(this,"clipPath",{id:"mainClip"+a});b.appendChild(rd(this,"rect",{x:0,y:0,width:this.width,height:this.height}));
this.Mm.appendChild(b);this.yf[0].setAttributeNS(null,"clip-path","url(#mainClip"+a+")")}f=qd.prototype;f.arc=function(a,b,c,d,e,g,h,k){var l=2*Math.PI,m=l-1E-6,n=c*Math.cos(d),p=c*Math.sin(d),q=a+n,r=b+p,s=g?0:1;d=g?d-e:e-d;(1E-6<Math.abs(h-q)||1E-6<Math.abs(k-r))&&this.path.push(["L",q,+r]);0>d&&(d=d%l+l);d>m?(this.path.push(["A",c,c,0,1,s,a-n,b-p]),this.path.push(["A",c,c,0,1,s,q,r])):1E-6<d&&this.path.push(["A",c,c,0,+(d>=Math.PI),s,a+c*Math.cos(e),b+c*Math.sin(e)])};
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(){td(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.Rm++,g=rd(this,"clipPath",{id:a}),g.appendChild(rd(this,"rect",{x:b,y:c,width:d,height:e})),this.Mm.appendChild(g),m["clip-path"]="url(#"+a+")";ud(this,"image",m,this.Nh,n);this.addElement("image",m)};f.fill=function(){td(this,"fill",this.path,this.Nh)};f.Xg=function(){this.jq?this.clip():this.fill()};f.fillRect=function(a,b,c,d){Ed(this,"fill",[a,b,c,d],this.Nh)};
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};ud(this,"fill",b,this.Nh);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.Nh=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.ko=a.ko;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,ko:this.ko,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.Nh.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.Nh.scale(a,b)};f.translate=function(a,b){this.Nh.translate(a,b)};f.transform=function(){};f.stroke=function(){td(this,"stroke",this.path,this.Nh)};f.bk=function(){this.jq||this.stroke()};f.strokeRect=function(a,b,c,d){Ed(this,"stroke",[a,b,c,d],this.Nh)};
function rd(a,b,c,d){a=a.document.createElementNS(a.XJ,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.yf.length?this.yf[this.yf.length-1].appendChild(a):this.Mm.appendChild(a);return this.sy=a};
function ud(a,b,c,d,e){1!==a.globalAlpha&&(c.opacity=a.globalAlpha);"fill"===b?(a.fillStyle instanceof id?c.fill=Fd(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=Fd(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.cc;a="matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")";void 0!==e&&(a+=e);c.transform=a}
function Fd(a,b){var c="GRAD"+D.Rm++,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.hF,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.Mm.appendChild(d);
return"url(#"+c+")"}function Ed(a,b,c,d){c={x:c[0],y:c[1],width:c[2],height:c[3]};ud(a,b,c,d);a.addElement("rect",c)}
function td(a,b,c,d){for(var e=[],g=0;g<c.length;g++){var h=D.qm(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(" ")};ud(a,b,c,d);"clipPath"===b?(b="CLIP"+D.Rm++,d=rd(a,"clipPath",{id:b}),d.appendChild(rd(a,"path",c)),a.Mm.appendChild(d),0<a.yf.length&&a.yf[a.yf.length-1].setAttributeNS(null,"clip-path","url(#"+b+")")):a.addElement("path",
c)}function sd(a,b,c,d,e,g,h){var k=new hd;k.cc=[b,c,d,e,g,h];b={};ud(a,"g",b,k);k=a.addElement("g",b);a.yf.push(k)}
f.nb=function(){if(0!==this.shadowOffsetX||0!==this.shadowOffsetY||0!==this.shadowBlur){var a="SHADOW"+D.Rm++,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",HM: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.yf.length&&this.yf[this.yf.length-1].setAttributeNS(null,"filter","url(#"+a+")")}};f.jC=function(a,b,c){this.Lt=a;this.Mt=b;this.Pg=c};f.Km=function(){this.shadowBlur=this.shadowOffsetY=this.shadowOffsetX=0};
f.Bo=function(){this.shadowOffsetX=this.Lt;this.shadowOffsetY=this.Mt;this.shadowBlur=this.Pg};f.Wx=function(){return!1};f.Tx=function(){};f.Ee=function(){};f.Yy=function(){};qd.prototype.rotate=function(){};function ia(a,b){this.ownerDocument=void 0===b?document:b;var c=this.ownerDocument.createElement("canvas");c.tabIndex=0;this.ae=c;this.Xk=new Gd(c);c.ca=a;Object.seal(this)}f=ia.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(ia,{width:"width"},function(){return this.ae.width},function(a){this.ae.width=a});D.defineProperty(ia,{height:"height"},function(){return this.ae.height},function(a){this.ae.height=a});D.w(ia,{style:"style"},function(){return this.ae.style});
function Gd(a){a.getContext&&a.getContext("2d")||D.k("Browser does not support HTML Canvas Element");this.za=a.getContext("2d");this.xz=this.zz=this.yz="";this.zr=!1;this.Pg=this.Mt=this.Lt=0;Object.seal(this)}Gd.prototype.Yy=function(a){this.za.qB=a};D.defineProperty(Gd,{fillStyle:"fillStyle"},function(){return this.za.fillStyle},function(a){this.xz!==a&&(this.xz=this.za.fillStyle=a)});
D.defineProperty(Gd,{font:"font"},function(){return this.za.font},function(a){this.yz!==a&&(this.yz=this.za.font=a)});D.defineProperty(Gd,{globalAlpha:"globalAlpha"},function(){return this.za.globalAlpha},function(a){this.za.globalAlpha=a});D.defineProperty(Gd,{lineCap:"lineCap"},function(){return this.za.lineCap},function(a){this.za.lineCap=a});D.defineProperty(Gd,{ko:"lineDashOffset"},function(){return this.za.ko},function(a){this.za.ko=a});
D.defineProperty(Gd,{lineJoin:"lineJoin"},function(){return this.za.lineJoin},function(a){this.za.lineJoin=a});D.defineProperty(Gd,{lineWidth:"lineWidth"},function(){return this.za.lineWidth},function(a){this.za.lineWidth=a});D.defineProperty(Gd,{miterLimit:"miterLimit"},function(){return this.za.miterLimit},function(a){this.za.miterLimit=a});D.defineProperty(Gd,{shadowBlur:"shadowBlur"},function(){return this.za.shadowBlur},function(a){this.za.shadowBlur=a});
D.defineProperty(Gd,{shadowColor:"shadowColor"},function(){return this.za.shadowColor},function(a){this.za.shadowColor=a});D.defineProperty(Gd,{shadowOffsetX:"shadowOffsetX"},function(){return this.za.shadowOffsetX},function(a){this.za.shadowOffsetX=a});D.defineProperty(Gd,{shadowOffsetY:"shadowOffsetY"},function(){return this.za.shadowOffsetY},function(a){this.za.shadowOffsetY=a});
D.defineProperty(Gd,{strokeStyle:"strokeStyle"},function(){return this.za.strokeStyle},function(a){this.zz!==a&&(this.zz=this.za.strokeStyle=a)});D.defineProperty(Gd,{textAlign:"textAlign"},function(){return this.za.textAlign},function(a){this.za.textAlign=a});D.defineProperty(Gd,{qB:"imageSmoothingEnabled"},function(){return this.za.qB},function(a){this.za.qB=a});f=Gd.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()};Gd.prototype.rotate=function(a){this.za.rotate(a)};f=Gd.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 za&&a.type===Hd){var b=a.So;a=a.Dz;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.zr?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.zr?this.clip():this.fill()};
f.bk=function(){this.zr||this.stroke()};D.defineProperty(Gd,{jq:"clipInsteadOfFill"},function(){return this.zr},function(a){this.zr=a});f=Gd.prototype;f.jC=function(a,b,c){this.Lt=a;this.Mt=b;this.Pg=c};f.Km=function(){this.shadowBlur=this.shadowOffsetY=this.shadowOffsetX=0};f.Bo=function(){this.shadowOffsetX=this.Lt;this.shadowOffsetY=this.Mt;this.shadowBlur=this.Pg};
f.Wx=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.Tx=function(){var a=this.za;void 0!==a.setLineDash?(a.setLineDash(D.Jo),a.lineDashOffset=0):void 0!==a.webkitLineDash&&(a.webkitLineDash=D.Jo,a.webkitLineDashOffset=0)};f.Ee=function(a){a&&(this.yz="");this.xz=this.zz=""};
var Id=(Math.sqrt(2)-1)/3*4,Jd=(new N(0,0)).Oa(),Kd=(new C(0,0,0,0)).Oa(),Ld=(new Mb(0,0,0,0)).Oa(),Md=(new Mb(2,2,2,2)).Oa(),Td=(new N(6,6)).Oa(),Ud=(new N(-Infinity,-Infinity)).Oa(),Vd=(new N(Infinity,Infinity)).Oa(),Wd=(new Ba(0,0)).Oa(),Xd=(new Ba(1,1)).Oa(),Yd=(new Ba(6,6)).Oa(),Zd=(new Ba(8,8)).Oa(),$d=(new Ba(10,10)).Oa(),ae=(new Ba(Infinity,Infinity)).Oa(),be=(new N(NaN,NaN)).Oa(),ce=(new Ba(NaN,NaN)).Oa(),ie=(new C(NaN,NaN,NaN,NaN)).Oa(),je=(new R(.156,.156)).Oa(),ke=(new R(.844,.844)).Oa(),
le=new ja,me=new ja,ne=null;function oe(a){if(0>=a)return 0;var b=ne;if(null===b){for(var b=[],c=0;2E3>=c;c++)b[c]=Math.sqrt(c);ne=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 bb(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 pe(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 qe(a,b,c,d,e,g,h,k,l,m,n,p){if(pe(a,b,h,k,p,c,d)&&pe(a,b,h,k,p,e,g))return pe(a,b,h,k,p,m,n);var q=(a+c)/2,r=(b+d)/2,s=(c+e)/2,t=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(q+s)/2;c=(r+t)/2;var s=(s+e)/2,t=(t+g)/2,u=(d+s)/2,z=(c+t)/2;return qe(a,b,q,r,d,c,u,z,l,m,n,p)||qe(u,z,s,t,e,g,h,k,l,m,n,p)}
function re(a,b,c,d,e,g,h,k,l,m){if(pe(a,b,h,k,l,c,d)&&pe(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,t=(c+r)/2;re(a,b,n,p,d,c,s,t,l,m);re(s,t,q,r,e,g,h,k,l,m)}}
function se(a,b,c,d,e,g,h,k,l,m){if(pe(a,b,h,k,l,c,d)&&pe(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,t=(c+r)/2;se(a,b,n,p,d,c,s,t,l,m);se(s,t,q,r,e,g,h,k,l,m)}}
function te(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 Ce(a,b,c,d,e,g,h,k,l,m){if(pe(a,b,e,g,m,c,d))return pe(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 Ce(a,b,n,p,q,r,h,k,l,m)||Ce(q,r,c,d,e,g,h,k,l,m)}
function De(a,b,c,d,e,g,h,k){if(pe(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;De(a,b,l,m,n,p,h,k);De(n,p,c,d,e,g,h,k)}}function Ee(a,b,c,d,e,g,h,k){if(pe(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;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,l,m,n,p,q,r){0>=q&&(q=1E-6);if(pe(a,b,h,k,q,c,d)&&pe(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,t=(b+d)/2;c=(c+e)/2;d=(d+g)/2;e=(e+h)/2;g=(g+k)/2;var u=(s+c)/2,z=(t+d)/2;c=(c+e)/2;d=(d+g)/2;var w=(u+c)/2,y=(z+d)/2,
B=(n-l)*(n-l)+(p-m)*(p-m),P=!1;Fe(a,b,s,t,u,z,w,y,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;Fe(w,y,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 Ge(a,b,c,d,e,g,h,k,l,m,n,p,q){var r=0;0>=q&&(q=1E-6);if(pe(a,b,h,k,q,c,d)&&pe(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,t=((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),t<l||t>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,t=(b+d)/2,u=(c+e)/2,z=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(s+u)/2;c=(t+z)/2;var u=(u+e)/2,z=(z+g)/2,
w=(d+u)/2,y=(c+z)/2,r=r+Ge(a,b,s,t,d,c,w,y,l,m,n,p,q),r=r+Ge(w,y,u,z,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 He(a,b,c,d,e,g,h,k,l){if(bb(a,c)&&bb(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 Ie(a,b,c,d,e,g,h,k,l){var m=1E21,n=a,p=b;if(He(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)}He(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));He(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));He(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 Je(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 Ke(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)||Le(k,m,l,m,d,e,g,h)||Le(l,m,l,n,d,e,g,h)||Le(l,n,k,n,d,e,g,h)||Le(k,n,k,m,d,e,g,h)?!0:!1}function Le(a,b,c,d,e,g,h,k){return 0>=Me(a,b,c,d,e,g)*Me(a,b,c,d,h,k)&&0>=Me(e,g,h,k,a,b)*Me(e,g,h,k,c,d)}
function Me(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 Ne(a){0>a&&(a+=360);360<=a&&(a-=360);return a}
function Re(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 Se(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 Te(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 Ue(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=Ve:v&&D.Da(a,Ue,Ue,"constructor:type");this.da=a;this.Mb=this.Eb=this.Nc=this.Bc=0;this.mk=new K(We);this.hw=this.mk.I;this.Tv=(new C).freeze();this.qb=!0;this.or=this.Mo=null;this.pr=NaN;this.Ai=ic;this.Bi=vc;this.op=this.qp=NaN;this.aj=Xe}D.ka("Geometry",Ue);D.Gi(Ue);
Ue.prototype.copy=function(){var a=new Ue;a.da=this.da;a.Bc=this.Bc;a.Nc=this.Nc;a.Eb=this.Eb;a.Mb=this.Mb;for(var b=this.mk.o,c=b.length,d=a.mk,e=0;e<c;e++){var g=b[e].copy();d.add(g)}a.hw=this.hw;a.Tv.assign(this.Tv);a.qb=this.qb;a.Mo=this.Mo;a.or=this.or;a.pr=this.pr;a.Ai=this.Ai.V();a.Bi=this.Bi.V();a.qp=this.qp;a.op=this.op;a.aj=this.aj;return a};var Ye;Ue.Line=Ye=D.s(Ue,"Line",0);var Ze;Ue.Rectangle=Ze=D.s(Ue,"Rectangle",1);var tf;Ue.Ellipse=tf=D.s(Ue,"Ellipse",2);var Ve;
Ue.Path=Ve=D.s(Ue,"Path",3);Ue.prototype.Oa=function(){this.freeze();Object.freeze(this);return this};Ue.prototype.freeze=function(){this.J=!0;var a=this.pc;a.freeze();for(var a=a.o,b=a.length,c=0;c<b;c++)a[c].freeze();return this};Ue.prototype.Xa=function(){Object.isFrozen(this)&&D.k("cannot thaw constant: "+this);this.J=!1;var a=this.pc;a.Xa();for(var a=a.o,b=a.length,c=0;c<b;c++)a[c].Xa();return this};
Ue.prototype.equalsApprox=Ue.prototype.Zc=function(a){if(!(a instanceof Ue))return!1;if(this.type!==a.type)return this.type===Ye&&a.type===Ve?uf(this,a):a.type===Ye&&this.type===Ve?uf(a,this):!1;if(this.type===Ve){var b=this.pc.o;a=a.pc.o;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b[d].Zc(a[d]))return!1;return!0}return bb(this.la,a.la)&&bb(this.ja,a.ja)&&bb(this.G,a.G)&&bb(this.H,a.H)};
function uf(a,b){if(a.type!==Ye||b.type!==Ve)return!1;if(1===b.pc.count){var c=b.pc.fa(0);if(1===c.Fb.count&&bb(a.la,c.la)&&bb(a.ja,c.ja)&&(c=c.Fb.fa(0),c.type===vf&&bb(a.G,c.G)&&bb(a.H,c.H)))return!0}return!1}var wf;Ue.stringify=wf=function(a){return a.toString()};Ue.prototype.qc=function(a){a.Se===Ue?this.type=a:D.ck(this,a)};
Ue.prototype.toString=function(a){void 0===a&&(a=-1);switch(this.type){case Ye:return 0>a?"M"+this.la.toString()+" "+this.ja.toString()+"L"+this.G.toString()+" "+this.H.toString():"M"+this.la.toFixed(a)+" "+this.ja.toFixed(a)+"L"+this.G.toFixed(a)+" "+this.H.toFixed(a);case Ze:var b=new C(this.la,this.ja,0,0);b.vH(this.G,this.H,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 tf:b=new C(this.la,this.ja,0,0);b.vH(this.G,this.H,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 Ve:for(var b="",c=this.pc.o,d=c.length,e=0;e<d;e++){var g=c[e];0<e&&(b+=" x ");g.Pu&&(b+="F ");b+=g.toString(a)}return b;default:return this.type.toString()}};
Ue.fillPath=function(a){"string"!==typeof a&&D.mc(a,"string",Ue,"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 xf;
Ue.parse=xf=function(a,b){function c(){return u>=P-1?!0:null!==l[u+1].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/)}function d(){u++;return l[u]}function e(){var a=new N(parseFloat(d()),parseFloat(d()));z===z.toLowerCase()&&(a.x=B.x+a.x,a.y=B.y+a.y);return a}function g(){return B=e()}function h(){return y=e()}function k(){return"c"!==w.toLowerCase()&&"s"!==w.toLowerCase()?B:new N(2*B.x-y.x,2*B.y-y.y)}void 0===b&&(b=!1);"string"!==typeof a&&D.mc(a,"string",Ue,"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 t=n[s];"."!==t||r?"."===t?(p.push(q),q="."):q+=t:(r=!0,q+=t)}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 u=-1,z="",w="",n=new N(0,0),y=new N(0,0),B=new N(0,0),P=l.length,p=D.v(),r=q=!1,s=!0,m=null;!(u>=P-1);)if(w=z,z=d(),""!==z)switch(z.toUpperCase()){case "X":s=!0;r=q=!1;break;case "M":m=g();null===p.fc||!0===s?(S(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((z===z.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,(z===z.toLowerCase()?B.y:0)+parseFloat(d())),p.lineTo(B.x,B.y);break;case "C":for(;!c();){var t=e(),G=h(),m=g();T(p,t.x,t.y,G.x,G.y,m.x,m.y)}break;case "S":for(;!c();)t=k(),G=h(),m=g(),T(p,t.x,t.y,G.x,G.y,m.x,m.y);break;case "Q":for(;!c();)G=h(),m=g(),yf(p,G.x,G.y,m.x,m.y);break;case "T":for(;!c();)y=G=k(),m=g(),yf(p,G.x,G.y,m.x,m.y);
break;case "B":for(;!c();){var m=parseFloat(d()),t=parseFloat(d()),G=parseFloat(d()),Q=parseFloat(d()),Y=parseFloat(d()),U=Y,ea=!1;c()||(U=parseFloat(d()),c()||(ea=0!==parseFloat(d())));z===z.toLowerCase()&&(G+=B.x,Q+=B.y);p.arcTo(m,t,G,Q,Y,U,ea)}break;case "A":for(;!c();)t=Math.abs(parseFloat(d())),G=Math.abs(parseFloat(d())),Q=parseFloat(d()),Y=!!parseFloat(d()),U=!!parseFloat(d()),m=g(),zf(p,t,G,Q,Y,U,m.x,m.y);break;case "Z":m=p.q.pc.o[p.q.pc.length-1];V(p);B=n;break;case "F":t="";for(m=1;l[u+
m];)if(null!==l[u+m].match(/[Uu]/))m++;else if(null===l[u+m].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/))m++;else{t=l[u+m];break}t.match(/[Mm]/)?q=!0:Af(p);break;case "U":t="";for(m=1;l[u+m];)if(null!==l[u+m].match(/[Ff]/))m++;else if(null===l[u+m].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/))m++;else{t=l[u+m];break}t.match(/[Mm]/)?r=!0:p.nb(!1)}n=p.q;D.u(p);if(b)for(p=n.pc.j;p.next();)m=p.value,m.Pu=!0;return n};
function Bf(a,b){for(var c=a.length,d=D.O(),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)}Ue.prototype.yB=function(){if(this.qb||this.hw!==this.pc.I)return!0;for(var a=this.pc.o,b=a.length,c=0;c<b;c++)if(a[c].yB())return!0;return!1};
Ue.prototype.computeBounds=function(){this.qb=!1;this.or=this.Mo=null;this.pr=NaN;this.hw=this.pc.I;for(var a=this.pc.o,b=a.length,c=0;c<b;c++){var d=a[c];d.qb=!1;var e=d.Fb;d.kx=e.I;for(var d=e.o,e=d.length,g=0;g<e;g++){var h=d[g];h.qb=!1;h.ci=null}}a=this.Tv;a.Xa();isNaN(this.qp)||isNaN(this.op)?a.n(0,0,0,0):a.n(0,0,this.qp,this.op);Cf(this,a,!1);Ub(a,0,0,0,0);a.freeze()};Ue.prototype.computeBoundsWithoutOrigin=Ue.prototype.nI=function(){var a=new C;Cf(this,a,!0);return a};
function Cf(a,b,c){switch(a.type){case Ye:case Ze:case tf:c?b.n(a.Bc,a.Nc,0,0):Ub(b,a.Bc,a.Nc,0,0);Ub(b,a.Eb,a.Mb,0,0);break;case Ve:var d=a.pc;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.Fb.o,k=h.length,l=g.la,m=g.ja,n=0;n<k;n++){var p=h[n];switch(p.type){case vf:case Df:l=p.G;m=p.H;Ub(b,l,m,0,0);break;case Ef:re(l,m,p.Gc,p.bd,p.Xh,p.Yh,p.G,p.H,.5,b);l=p.G;m=p.H;break;case Ff:De(l,m,p.Gc,p.bd,p.G,p.H,.5,b);l=p.G;m=p.H;break;case Gf:case Hf:var q=
p.type===Gf?If(p,g):Vf(p,g,l,m),r=q.length;if(0===r){l=p.pa;m=p.wa;Ub(b,l,m,0,0);break}for(var p=null,s=0;s<r;s++)p=q[s],re(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)}}Ue.prototype.normalize=Ue.prototype.normalize=function(){this.J&&D.qa(this);var a=this.nI();this.offset(-a.x,-a.y);return new N(-a.x,-a.y)};
Ue.prototype.offset=Ue.prototype.offset=function(a,b){this.J&&D.qa(this);v&&(D.p(a,Ue,"offset"),D.p(b,Ue,"offset"));this.transform(1,0,0,1,a,b);return this};Ue.prototype.scale=Ue.prototype.scale=function(a,b){this.J&&D.qa(this);v&&(D.p(a,Ue,"scale:x"),D.p(b,Ue,"scale:y"),0===a&&D.va(a,"scale must be non-zero",Ue,"scale:x"),0===b&&D.va(b,"scale must be non-zero",Ue,"scale:y"));this.transform(a,0,0,b,0,0);return this};
Ue.prototype.rotate=Ue.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,Ue,"rotate:angle"),D.p(b,Ue,"rotate:x"),D.p(c,Ue,"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.lf(d);return this};
Ue.prototype.transform=Ue.prototype.transform=function(a,b,c,d,e,g){var h=0,k=0;switch(this.type){case Ye:case Ze:case tf:h=this.Bc;k=this.Nc;this.Bc=h*a+k*c+e;this.Nc=h*b+k*d+g;h=this.Eb;k=this.Mb;this.Eb=h*a+k*c+e;this.Mb=h*b+k*d+g;break;case Ve:for(var l=this.pc.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.Fb.o,q=p.length,r=0;r<q;r++){var s=p[r];switch(s.type){case vf:case Df:h=s.G;k=s.H;s.G=h*a+k*c+e;s.H=h*b+k*d+g;break;case Ef:h=s.Gc;k=s.bd;s.Gc=
h*a+k*c+e;s.bd=h*b+k*d+g;h=s.Xh;k=s.Yh;s.Xh=h*a+k*c+e;s.Yh=h*b+k*d+g;h=s.G;k=s.H;s.G=h*a+k*c+e;s.H=h*b+k*d+g;break;case Ff:h=s.Gc;k=s.bd;s.Gc=h*a+k*c+e;s.bd=h*b+k*d+g;h=s.G;k=s.H;s.G=h*a+k*c+e;s.H=h*b+k*d+g;break;case Gf:h=s.pa;k=s.wa;s.pa=h*a+k*c+e;s.wa=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.Ef=-s.Ef);0>d&&(s.Ne=-s.Ne,s.Ef=-s.Ef);s.radiusX*=Math.sqrt(a*a+c*c);void 0!==s.radiusY&&(s.radiusY*=Math.sqrt(b*b+d*d));break;case Hf:h=s.G;k=s.H;s.G=h*
a+k*c+e;s.H=h*b+k*d+g;0!==b&&(h=180*Math.atan2(b,a)/Math.PI,0>h&&(h+=360),s.ek+=h);0>a&&(s.ek=180-s.ek,s.Cm=!s.Cm);0>d&&(s.ek=-s.ek,s.Cm=!s.Cm);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.qb=!0;return this};
Ue.prototype.Pa=function(a,b,c,d){var e=a.x,g=a.y,h=this.lb.x-20;a=a.y;for(var k=0,l=0,m=0,n=0,p=0,q=0,r=this.pc.o,s=r.length,t=0;t<s;t++){var u=r[t];if(u.Pu){if(c&&u.Pa(e,g,b))return!0;for(var z=u.Fb,l=u.la,m=u.ja,w=l,y=m,B=z.o,P=0;P<=z.length;P++){var G,Q;P!==z.length?(G=B[P],Q=G.type,p=G.G,q=G.H):(Q=vf,p=w,q=y);switch(Q){case Df:n=Wf(e,g,h,a,l,m,w,y);if(isNaN(n))return!0;k+=n;w=p;y=q;break;case vf:n=Wf(e,g,h,a,l,m,p,q);if(isNaN(n))return!0;k+=n;break;case Ef:n=Ge(l,m,G.Gc,G.bd,G.Xh,G.Yh,p,q,h,
a,e,g,.5);k+=n;break;case Ff:n=Ge(l,m,(l+2*G.Gc)/3,(m+2*G.bd)/3,(2*G.Gc+p)/3,(2*G.bd+q)/3,p,q,h,a,e,g,.5);k+=n;break;case Gf:case Hf:Q=G.type===Gf?If(G,u):Vf(G,u,l,m);var Y=Q.length;if(0===Y){n=Wf(e,g,h,a,l,m,G.pa,G.wa);if(isNaN(n))return!0;k+=n;break}for(var U=null,ea=0;ea<Y;ea++){U=Q[ea];if(0===ea){n=Wf(e,g,h,a,l,m,U[0],U[1]);if(isNaN(n))return!0;k+=n}n=Ge(U[0],U[1],U[2],U[3],U[4],U[5],U[6],U[7],h,a,e,g,.5);k+=n}null!==U&&(p=U[6],q=U[7]);break;default:D.k("Unknown Segment type: "+G.type)}l=p;m=
q}if(0!==k)return!0;k=0}else if(u.Pa(e,g,d?b:b+2))return!0}return 0!==k};function Wf(a,b,c,d,e,g,h,k){if(pe(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 Xf(a,b,c,d){a=a.pc.o;for(var e=a.length,g=0;g<e;g++)if(a[g].Pa(b,c,d))return!0;return!1}
Ue.prototype.getPointAlongPath=Ue.prototype.YI=function(a,b){0>a?a=0:1<a&&(a=1);void 0===b&&(b=new N);if(this.type===Ye)return b.n(this.la+a*(this.G-this.la),this.ja+a*(this.H-this.ja)),b;for(var c=this.gy,d=this.Au,e=c.length,g=this.Bu*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};
Ue.prototype.getAngleAlongPath=Ue.prototype.NF=function(a){0>a?a=0:1<a&&(a=1);var b=0;if(this.type===Ye)return b=180*Math.atan2(this.H-this.ja,this.G-this.la)/Math.PI;for(var b=this.gy,c=this.Au,d=b.length,e=this.Bu*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};
Ue.prototype.getFractionForPoint=Ue.prototype.UI=function(a){if(this.type===Ye){var b=this.la,c=this.ja,d=this.G,e=this.H;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===Ze){if(b=this.la,c=this.ja,d=this.G,e=this.H,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.gy,h=this.Au,k=this.Bu,l=D.O(),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,t=0;t<s;t+=2){var u=q[t],z=q[t+1];if(0!==t){db(m,n,u,z,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[(t-2)/2]}m=u;n=z}D.A(l);a=d/k;return 0>a?0:1<a?1:a}return 0};D.w(Ue,{gy:"flattenedSegments"},function(){Yf(this);return this.Mo});
function Yf(a){if(null===a.Mo){var b=a.Mo=[],c=a.or=[],d=[],e=[];if(a.type===Ye)d.push(a.la),d.push(a.ja),d.push(a.G),d.push(a.H),b.push(d),e.push(Math.sqrt((a.la-a.G)*(a.la-a.G)+(a.ja-a.H)*(a.ja-a.H))),c.push(e);else if(a.type===Ze)d.push(a.la),d.push(a.ja),d.push(a.G),d.push(a.ja),d.push(a.G),d.push(a.H),d.push(a.la),d.push(a.H),d.push(a.la),d.push(a.ja),b.push(d),e.push(Math.abs(a.la-a.G)),e.push(Math.abs(a.ja-a.H)),e.push(Math.abs(a.la-a.G)),e.push(Math.abs(a.ja-a.H)),c.push(e);else if(a.type===
tf){var g=new We;g.la=a.G;g.ja=(a.ja+a.H)/2;var h=new Zf(Gf);h.Ne=0;h.Ef=360;h.pa=(a.la+a.G)/2;h.wa=(a.ja+a.H)/2;h.radiusX=Math.abs(a.la-a.G)/2;h.radiusY=Math.abs(a.ja-a.H)/2;g.add(h);a=If(h,g);e=a.length;if(0===e)d.push(h.pa),d.push(h.wa);else for(var h=g.la,g=g.ja,k=0;k<e;k++){var l=a[k];se(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($f(d))}else for(var m=a.pc.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.Fb.o,s=r.length,t=
0;t<s;t++){var u=r[t];switch(u.da){case Df:4<=d.length&&(b.push(d),c.push($f(d)));d=[];d.push(u.G);d.push(u.H);h=u.G;g=u.H;p=h;q=g;break;case vf:d.push(u.G);d.push(u.H);h=u.G;g=u.H;break;case Ef:se(h,g,u.Xd,u.gf,u.Eh,u.Og,u.Eb,u.Mb,.5,d);h=u.G;g=u.H;break;case Ff:Ee(h,g,u.Xd,u.gf,u.Eb,u.Mb,.5,d);h=u.G;g=u.H;break;case Gf:a=If(u,n);e=a.length;if(0===e){d.push(u.pa);d.push(u.wa);h=u.pa;g=u.wa;break}for(k=0;k<e;k++)l=a[k],se(h,g,l[2],l[3],l[4],l[5],l[6],l[7],.5,d),h=l[6],g=l[7];break;case Hf:a=Vf(u,
n,h,g);e=a.length;if(0===e){d.push(u.pa);d.push(u.wa);h=u.pa;g=u.wa;break}for(k=0;k<e;k++)l=a[k],se(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: "+u.da)}u.ki&&(d.push(p),d.push(q))}4<=d.length&&(b.push(d),c.push($f(d)))}}}D.w(Ue,{Au:"flattenedLengths"},function(){Yf(this);return this.or});
D.w(Ue,{Bu:"flattenedTotalLength"},function(){var a=this.pr;if(isNaN(a)){if(this.type===Ye)var a=Math.abs(this.G-this.la),b=Math.abs(this.H-this.ja),a=Math.sqrt(a*a+b*b);else if(this.type===Ze)a=Math.abs(this.G-this.la),b=Math.abs(this.H-this.ja),a=2*a+2*b;else for(var b=this.Au,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.pr=a}return a});
function $f(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(Ue,{type:"type"},function(){return this.da},function(a){this.da!==a&&(v&&D.Da(a,Ue,Ue,"type"),this.J&&D.qa(this,a),this.da=a,this.qb=!0)});D.defineProperty(Ue,{la:"startX"},function(){return this.Bc},function(a){this.Bc!==a&&(v&&D.p(a,Ue,"startX"),this.J&&D.qa(this,a),this.Bc=a,this.qb=!0)});
D.defineProperty(Ue,{ja:"startY"},function(){return this.Nc},function(a){this.Nc!==a&&(v&&D.p(a,Ue,"startY"),this.J&&D.qa(this,a),this.Nc=a,this.qb=!0)});D.defineProperty(Ue,{G:"endX"},function(){return this.Eb},function(a){this.Eb!==a&&(v&&D.p(a,Ue,"endX"),this.J&&D.qa(this,a),this.Eb=a,this.qb=!0)});D.defineProperty(Ue,{H:"endY"},function(){return this.Mb},function(a){this.Mb!==a&&(v&&D.p(a,Ue,"endY"),this.J&&D.qa(this,a),this.Mb=a,this.qb=!0)});
D.defineProperty(Ue,{pc:"figures"},function(){return this.mk},function(a){this.mk!==a&&(v&&D.l(a,K,Ue,"figures"),this.J&&D.qa(this,a),this.mk=a,this.qb=!0)});Ue.prototype.add=Ue.prototype.add=function(a){this.mk.add(a);return this};Ue.prototype.setSpots=function(a,b,c,d,e,g,h,k){this.J&&D.qa(this);this.Ai=(new R(a,b,e,g)).freeze();this.Bi=(new R(c,d,h,k)).freeze();return this};
D.defineProperty(Ue,{C:"spot1"},function(){return this.Ai},function(a){v&&D.l(a,R,Ue,"spot1");this.J&&D.qa(this,a);this.Ai=a.V()});D.defineProperty(Ue,{D:"spot2"},function(){return this.Bi},function(a){v&&D.l(a,R,Ue,"spot2");this.J&&D.qa(this,a);this.Bi=a.V()});D.defineProperty(Ue,{ne:"defaultStretch"},function(){return this.aj},function(a){v&&D.Da(a,O,Ue,"stretch");this.J&&D.qa(this,a);this.aj=a});D.w(Ue,{lb:"bounds"},function(){this.yB()&&this.computeBounds();return this.Tv});
function We(a,b,c,d){D.xc(this);this.J=!1;void 0===c&&(c=!0);this.dn=c;void 0===d&&(d=!0);this.rp=d;void 0!==a?(v&&D.p(a,We,"sx"),this.Bc=a):this.Bc=0;void 0!==b?(v&&D.p(b,We,"sy"),this.Nc=b):this.Nc=0;this.Np=new K(Zf);this.kx=this.Np.I;this.qb=!0}D.ka("PathFigure",We);D.Gi(We);We.prototype.copy=function(){var a=new We;a.dn=this.dn;a.rp=this.rp;a.Bc=this.Bc;a.Nc=this.Nc;for(var b=this.Np.o,c=b.length,d=a.Np,e=0;e<c;e++){var g=b[e].copy();d.add(g)}a.kx=this.kx;a.qb=this.qb;return a};
We.prototype.equalsApprox=We.prototype.Zc=function(a){if(!(a instanceof We&&bb(this.la,a.la)&&bb(this.ja,a.ja)))return!1;var b=this.Fb.o;a=a.Fb.o;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b[d].Zc(a[d]))return!1;return!0};We.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.Fb.o,d=c.length,e=0;e<d;e++)b+=" "+c[e].toString(a);return b};
We.prototype.freeze=function(){this.J=!0;var a=this.Fb;a.freeze();for(var b=a.o,a=a.length,c=0;c<a;c++)b[c].freeze();return this};We.prototype.Xa=function(){this.J=!1;var a=this.Fb;a.Xa();for(var a=a.o,b=a.length,c=0;c<b;c++)a[c].Xa();return this};We.prototype.yB=function(){if(this.qb)return!0;var a=this.Fb;if(this.kx!==a.I)return!0;for(var a=a.o,b=a.length,c=0;c<b;c++)if(a[c].qb)return!0;return!1};
D.defineProperty(We,{Pu:"isFilled"},function(){return this.dn},function(a){v&&D.h(a,"boolean",We,"isFilled");this.J&&D.qa(this,a);this.dn=a});D.defineProperty(We,{jl:"isShadowed"},function(){return this.rp},function(a){v&&D.h(a,"boolean",We,"isShadowed");this.J&&D.qa(this,a);this.rp=a});D.defineProperty(We,{la:"startX"},function(){return this.Bc},function(a){v&&D.p(a,We,"startX");this.J&&D.qa(this,a);this.Bc=a;this.qb=!0});
D.defineProperty(We,{ja:"startY"},function(){return this.Nc},function(a){v&&D.p(a,We,"startY");this.J&&D.qa(this,a);this.Nc=a;this.qb=!0});D.defineProperty(We,{Fb:"segments"},function(){return this.Np},function(a){v&&D.l(a,K,We,"segments");this.J&&D.qa(this,a);this.Np=a;this.qb=!0});We.prototype.add=We.prototype.add=function(a){this.Np.add(a);return this};
We.prototype.Pa=function(a,b,c){for(var d=this.la,e=this.ja,g=d,h=e,k=this.Fb.o,l=k.length,m=0;m<l;m++){var n=k[m];switch(n.type){case Df:g=n.G;h=n.H;d=n.G;e=n.H;break;case vf:if(pe(d,e,n.G,n.H,c,a,b))return!0;d=n.G;e=n.H;break;case Ef:if(qe(d,e,n.Gc,n.bd,n.Xh,n.Yh,n.G,n.H,.5,a,b,c))return!0;d=n.G;e=n.H;break;case Ff:if(Ce(d,e,n.Gc,n.bd,n.G,n.H,.5,a,b,c))return!0;d=n.G;e=n.H;break;case Gf:case Hf:var p=n.type===Gf?If(n,this):Vf(n,this,d,e),q=p.length;if(0===q){if(pe(d,e,n.pa,n.wa,c,a,b))return!0;
d=n.pa;e=n.wa;break}for(var r=null,s=0;s<q;s++)if(r=p[s],0===s&&pe(d,e,r[0],r[1],c,a,b)||qe(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.ky&&(d!==g||e!==h)&&pe(d,e,g,h,c,a,b))return!0}return!1};
function Zf(a,b,c,d,e,g,h,k){D.xc(this);this.J=!1;void 0===a?a=vf:v&&D.Da(a,Zf,Zf,"constructor:type");this.da=a;void 0!==b?(v&&D.p(b,Zf,"ex"),this.Eb=b):this.Eb=0;void 0!==c?(v&&D.p(c,Zf,"ey"),this.Mb=c):this.Mb=0;void 0===d&&(d=0);void 0===e&&(e=0);void 0===g&&(g=0);void 0===h&&(h=0);a===Hf?(a=g%360,0>a&&(a+=360),this.Xd=a,this.gf=0,v&&D.p(d,Zf,"x1"),this.Eh=Math.max(d,0),v&&D.p(e,Zf,"y1"),this.Og=Math.max(e,0),this.wp="boolean"===typeof h?!!h:!1,this.Qo=!!k):(v&&D.p(d,Zf,"x1"),this.Xd=d,v&&D.p(e,
Zf,"y1"),this.gf=e,v&&D.p(g,Zf,"x2"),a===Gf&&(g=Math.max(g,0)),this.Eh=g,"number"===typeof h?(a===Gf&&(h=Math.max(h,0)),this.Og=h):this.Og=0,this.Qo=this.wp=!1);this.ki=!1;this.qb=!0;this.ci=null}D.ka("PathSegment",Zf);D.Gi(Zf);Zf.prototype.copy=function(){var a=new Zf;a.da=this.da;a.Eb=this.Eb;a.Mb=this.Mb;a.Xd=this.Xd;a.gf=this.gf;a.Eh=this.Eh;a.Og=this.Og;a.wp=this.wp;a.Qo=this.Qo;a.ki=this.ki;a.qb=this.qb;return a};
Zf.prototype.equalsApprox=Zf.prototype.Zc=function(a){if(!(a instanceof Zf)||this.type!==a.type||this.ky!==a.ky)return!1;switch(this.type){case Df:case vf:return bb(this.G,a.G)&&bb(this.H,a.H);case Ef:return bb(this.G,a.G)&&bb(this.H,a.H)&&bb(this.Gc,a.Gc)&&bb(this.bd,a.bd)&&bb(this.Xh,a.Xh)&&bb(this.Yh,a.Yh);case Ff:return bb(this.G,a.G)&&bb(this.H,a.H)&&bb(this.Gc,a.Gc)&&bb(this.bd,a.bd);case Gf:return bb(this.Ne,a.Ne)&&bb(this.Ef,a.Ef)&&bb(this.pa,a.pa)&&bb(this.wa,a.wa)&&bb(this.radiusX,a.radiusX)&&
bb(this.radiusY,a.radiusY);case Hf:return this.Cm===a.Cm&&this.ny===a.ny&&bb(this.ek,a.ek)&&bb(this.G,a.G)&&bb(this.H,a.H)&&bb(this.radiusX,a.radiusX)&&bb(this.radiusY,a.radiusY);default:return!1}};Zf.prototype.qc=function(a){a.Se===Zf?this.type=a:D.ck(this,a)};
Zf.prototype.toString=function(a){void 0===a&&(a=-1);var b="";switch(this.type){case Df:b=0>a?"M"+this.G.toString()+" "+this.H.toString():"M"+this.G.toFixed(a)+" "+this.H.toFixed(a);break;case vf:b=0>a?"L"+this.G.toString()+" "+this.H.toString():"L"+this.G.toFixed(a)+" "+this.H.toFixed(a);break;case Ef:b=0>a?"C"+this.Gc.toString()+" "+this.bd.toString()+" "+this.Xh.toString()+" "+this.Yh.toString()+" "+this.G.toString()+" "+this.H.toString():"C"+this.Gc.toFixed(a)+" "+this.bd.toFixed(a)+" "+this.Xh.toFixed(a)+
" "+this.Yh.toFixed(a)+" "+this.G.toFixed(a)+" "+this.H.toFixed(a);break;case Ff:b=0>a?"Q"+this.Gc.toString()+" "+this.bd.toString()+" "+this.G.toString()+" "+this.H.toString():"Q"+this.Gc.toFixed(a)+" "+this.bd.toFixed(a)+" "+this.G.toFixed(a)+" "+this.H.toFixed(a);break;case Gf:b=0>a?"B"+this.Ne.toString()+" "+this.Ef.toString()+" "+this.pa.toString()+" "+this.wa.toString()+" "+this.radiusX:"B"+this.Ne.toFixed(a)+" "+this.Ef.toFixed(a)+" "+this.pa.toFixed(a)+" "+this.wa.toFixed(a)+" "+this.radiusX;
break;case Hf:b=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.ek.toString()+" "+(this.ny?1:0)+" "+(this.Cm?1:0)+" "+this.G.toString()+" "+this.H.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+" "+this.ek.toFixed(a)+" "+(this.ny?1:0)+" "+(this.Cm?1:0)+" "+this.G.toFixed(a)+" "+this.H.toFixed(a);break;default:b=this.type.toString()}return b+(this.ki?"z":"")};var Df;Zf.Move=Df=D.s(Zf,"Move",0);var vf;Zf.Line=vf=D.s(Zf,"Line",1);var Ef;
Zf.Bezier=Ef=D.s(Zf,"Bezier",2);var Ff;Zf.QuadraticBezier=Ff=D.s(Zf,"QuadraticBezier",3);var Gf;Zf.Arc=Gf=D.s(Zf,"Arc",4);var Hf;Zf.SvgArc=Hf=D.s(Zf,"SvgArc",4);Zf.prototype.freeze=function(){this.J=!0;return this};Zf.prototype.Xa=function(){this.J=!1;return this};Zf.prototype.close=Zf.prototype.close=function(){this.ki=!0;return this};
function If(a,b){if(null!==a.ci&&!1===b.qb)return a.ci;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.ci=[],a.ci;var e=a.Xd,g=a.gf,h=Re(c<d?c:d,a.Ne,a.Ne+a.Ef,!1);if(c!==d){var k=D.hh();k.reset();c<d?k.scale(1,d/c):k.scale(c/d,1);Bf(h,k);D.lf(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.ci=h;return a.ci}
function Vf(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.ci&&!1===b.qb)return a.ci;b=a.Eh;var g=a.Og;0===b&&(b=1E-4);0===g&&(g=1E-4);var h=Math.PI/180*a.Xd,k=a.wp,l=a.Qo,m=a.Eb,n=a.Mb,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=Re(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);Bf(b,g);D.lf(g);a.ci=b;return a.ci}
D.defineProperty(Zf,{ky:"isClosed"},function(){return this.ki},function(a){this.ki!==a&&(this.ki=a,this.qb=!0)});D.defineProperty(Zf,{type:"type"},function(){return this.da},function(a){v&&D.Da(a,Zf,Zf,"type");this.J&&D.qa(this,a);this.da=a;this.qb=!0});D.defineProperty(Zf,{G:"endX"},function(){return this.Eb},function(a){v&&D.p(a,Zf,"endX");this.J&&D.qa(this,a);this.Eb=a;this.qb=!0});
D.defineProperty(Zf,{H:"endY"},function(){return this.Mb},function(a){v&&D.p(a,Zf,"endY");this.J&&D.qa(this,a);this.Mb=a;this.qb=!0});D.defineProperty(Zf,{Gc:"point1X"},function(){return this.Xd},function(a){v&&D.p(a,Zf,"point1X");this.J&&D.qa(this,a);this.Xd=a;this.qb=!0});D.defineProperty(Zf,{bd:"point1Y"},function(){return this.gf},function(a){v&&D.p(a,Zf,"point1Y");this.J&&D.qa(this,a);this.gf=a;this.qb=!0});
D.defineProperty(Zf,{Xh:"point2X"},function(){return this.Eh},function(a){v&&D.p(a,Zf,"point2X");this.J&&D.qa(this,a);this.Eh=a;this.qb=!0});D.defineProperty(Zf,{Yh:"point2Y"},function(){return this.Og},function(a){v&&D.p(a,Zf,"point2Y");this.J&&D.qa(this,a);this.Og=a;this.qb=!0});D.defineProperty(Zf,{pa:"centerX"},function(){return this.Xd},function(a){v&&D.p(a,Zf,"centerX");this.J&&D.qa(this,a);this.Xd=a;this.qb=!0});
D.defineProperty(Zf,{wa:"centerY"},function(){return this.gf},function(a){v&&D.p(a,Zf,"centerY");this.J&&D.qa(this,a);this.gf=a;this.qb=!0});D.defineProperty(Zf,{radiusX:"radiusX"},function(){return this.Eh},function(a){v&&D.p(a,Zf,"radiusX");0>a&&D.va(a,">= zero",Zf,"radiusX");this.J&&D.qa(this,a);this.Eh=a;this.qb=!0});D.defineProperty(Zf,{radiusY:"radiusY"},function(){return this.Og},function(a){v&&D.p(a,Zf,"radiusY");0>a&&D.va(a,">= zero",Zf,"radiusY");this.J&&D.qa(this,a);this.Og=a;this.qb=!0});
D.defineProperty(Zf,{Ne:"startAngle"},function(){return this.Eb},function(a){this.Eb!==a&&(this.J&&D.qa(this,a),v&&D.p(a,Zf,"startAngle"),a%=360,0>a&&(a+=360),this.Eb=a,this.qb=!0)});D.defineProperty(Zf,{Ef:"sweepAngle"},function(){return this.Mb},function(a){v&&D.p(a,Zf,"sweepAngle");this.J&&D.qa(this,a);360<a&&(a=360);-360>a&&(a=-360);this.Mb=a;this.qb=!0});D.defineProperty(Zf,{Cm:"isClockwiseArc"},function(){return this.Qo},function(a){this.J&&D.qa(this,a);this.Qo=a;this.qb=!0});
D.defineProperty(Zf,{ny:"isLargeArc"},function(){return this.wp},function(a){this.J&&D.qa(this,a);this.wp=a;this.qb=!0});D.defineProperty(Zf,{ek:"xAxisRotation"},function(){return this.Xd},function(a){v&&D.p(a,Zf,"xAxisRotation");a%=360;0>a&&(a+=360);this.J&&D.qa(this,a);this.Xd=a;this.qb=!0});
function ag(){this.ca=null;this.FA=(new N(0,0)).freeze();this.Mz=(new N(0,0)).freeze();this.Qv=this.Mw=0;this.Rv=1;this.zw="";this.vx=this.dw=!1;this.bw=this.Sv=0;this.hk=this.lw=this.vw=!1;this.ds=null;this.tx=0;this.Sg=this.sx=null}D.ka("InputEvent",ag);
ag.prototype.copy=function(){var a=new ag;a.ca=this.ca;a.FA.assign(this.Sd);a.Mz.assign(this.ha);a.Mw=this.Mw;a.Qv=this.Qv;a.Rv=this.Rv;a.zw=this.zw;a.dw=this.dw;a.vx=this.vx;a.Sv=this.Sv;a.bw=this.bw;a.vw=this.vw;a.lw=this.lw;a.hk=this.hk;a.ds=this.ds;a.tx=this.tx;a.sx=this.sx;a.Sg=this.Sg;return a};
ag.prototype.toString=function(){var a="^";0!==this.yd&&(a+="M:"+this.yd);0!==this.button&&(a+="B:"+this.button);""!==this.key&&(a+="K:"+this.key);0!==this.Fe&&(a+="C:"+this.Fe);0!==this.Hi&&(a+="D:"+this.Hi);this.Ec&&(a+="h");this.bubbles&&(a+="b");null!==this.ha&&(a+="@"+this.ha.toString());return a};D.defineProperty(ag,{g:"diagram"},function(){return this.ca},function(a){this.ca=a});D.defineProperty(ag,{Sd:"viewPoint"},function(){return this.FA},function(a){D.l(a,N,ag,"viewPoint");this.FA.assign(a)});
D.defineProperty(ag,{ha:"documentPoint"},function(){return this.Mz},function(a){D.l(a,N,ag,"documentPoint");this.Mz.assign(a)});ag.prototype.getMultiTouchViewPoint=ag.prototype.hy=function(a,b){var c=this.g;if(null===c)return b;bg(c,this.event,a,b);return b};ag.prototype.getMultiTouchDocumentPoint=function(a,b){var c=this.g;if(null===c)return b;bg(c,this.event,a,b);b.assign(c.tC(b));return b};D.defineProperty(ag,{yd:"modifiers"},function(){return this.Mw},function(a){this.Mw=a});
D.defineProperty(ag,{button:"button"},function(){return this.Qv},function(a){this.Qv=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(ag,{buttons:"buttons"},function(){return this.Rv},function(a){this.Rv=a});D.defineProperty(ag,{key:"key"},function(){return this.zw},function(a){this.zw=a});D.defineProperty(ag,{Yk:"down"},function(){return this.dw},function(a){this.dw=a});
D.defineProperty(ag,{up:"up"},function(){return this.vx},function(a){this.vx=a});D.defineProperty(ag,{Fe:"clickCount"},function(){return this.Sv},function(a){this.Sv=a});D.defineProperty(ag,{Hi:"delta"},function(){return this.bw},function(a){this.bw=a});D.defineProperty(ag,{Su:"isMultiTouch"},function(){return this.vw},function(a){this.vw=a});D.defineProperty(ag,{Ec:"handled"},function(){return this.lw},function(a){this.lw=a});
D.defineProperty(ag,{bubbles:"bubbles"},function(){return this.hk},function(a){this.hk=a});D.defineProperty(ag,{event:"event"},function(){return this.ds},function(a){this.ds=a});D.w(ag,{Sj:"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(ag,{Rh:"isMac"},function(){return D.Rh});
D.defineProperty(ag,{timestamp:"timestamp"},function(){return this.tx},function(a){this.tx=a});D.defineProperty(ag,{Rf:"targetDiagram"},function(){return this.sx},function(a){this.sx=a});D.defineProperty(ag,{Oe:"targetObject"},function(){return this.Sg},function(a){this.Sg=a});D.defineProperty(ag,{control:"control"},function(){return 0!==(this.yd&1)},function(a){this.yd=a?this.yd|1:this.yd&-2});
D.defineProperty(ag,{shift:"shift"},function(){return 0!==(this.yd&4)},function(a){this.yd=a?this.yd|4:this.yd&-5});D.defineProperty(ag,{alt:"alt"},function(){return 0!==(this.yd&2)},function(a){this.yd=a?this.yd|2:this.yd&-3});D.defineProperty(ag,{av:"meta"},function(){return 0!==(this.yd&8)},function(a){this.yd=a?this.yd|8:this.yd&-9});
D.defineProperty(ag,{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(ag,{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(ag,{iM:"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 cg(){this.ca=null;this.ac="";this.Vw=this.px=null;this.wr=!1}D.ka("DiagramEvent",cg);cg.prototype.copy=function(){var a=new cg;a.ca=this.ca;a.ac=this.ac;a.px=this.px;a.Vw=this.Vw;a.wr=this.wr;return a};
cg.prototype.toString=function(){var a="*"+this.name;null!==this.lC&&(a+=":"+this.lC.toString());null!==this.QB&&(a+="("+this.QB.toString()+")");return a};D.defineProperty(cg,{g:"diagram"},function(){return this.ca},function(a){this.ca=a});D.defineProperty(cg,{name:"name"},function(){return this.ac},function(a){this.ac=a});D.defineProperty(cg,{lC:"subject"},function(){return this.px},function(a){this.px=a});D.defineProperty(cg,{QB:"parameter"},function(){return this.Vw},function(a){this.Vw=a});
D.defineProperty(cg,{cancel:"cancel"},function(){return this.wr},function(a){this.wr!==a&&D.Vn("DiagramEvent.cancel","2.0");this.wr=a});function dg(){this.xr=eg;this.un=this.Lw="";this.at=this.bt=this.gt=this.ht=this.et=this.ca=this.Ae=null}D.ka("ChangedEvent",dg);var fg;dg.Transaction=fg=D.s(dg,"Transaction",-1);var eg;dg.Property=eg=D.s(dg,"Property",0);var gg;dg.Insert=gg=D.s(dg,"Insert",1);var hg;dg.Remove=hg=D.s(dg,"Remove",2);
dg.prototype.clear=dg.prototype.clear=function(){this.at=this.bt=this.gt=this.ht=this.et=this.ca=this.Ae=null};dg.prototype.copy=function(){var a=new dg;a.xr=this.xr;a.Lw=this.Lw;a.un=this.un;a.Ae=this.Ae;a.ca=this.ca;a.et=this.et;var b=this.ht;a.ht=D.Qa(b)&&"function"===typeof b.V?b.V():b;b=this.gt;a.gt=D.Qa(b)&&"function"===typeof b.V?b.V():b;b=this.bt;a.bt=D.Qa(b)&&"function"===typeof b.V?b.V():b;b=this.at;a.at=D.Qa(b)&&"function"===typeof b.V?b.V():b;return a};
dg.prototype.qc=function(a){a.Se===dg?this.Pc=a:D.ck(this,a)};
dg.prototype.toString=function(){var a="",a=this.Pc===fg?a+"* ":this.Pc===eg?a+(null!==this.ea?"!m":"!d"):a+((null!==this.ea?"!m":"!d")+this.Pc);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.Df&&this.Df!==this.propertyName&&(a+=" "+this.Df);a+=": ";this.Pc===fg?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=ha(this.object)),null!==this.oldValue&&(a+=" old: "+ha(this.oldValue)),null!==this.Zj&&(a+=" "+this.Zj),null!==this.newValue&&
(a+=" new: "+ha(this.newValue)),null!==this.Xj&&(a+=" "+this.Xj));return a};dg.prototype.getValue=dg.prototype.oa=function(a){return a?this.oldValue:this.newValue};dg.prototype.getParam=function(a){return a?this.Zj:this.Xj};dg.prototype.canUndo=dg.prototype.canUndo=function(){return null!==this.ea||null!==this.g?!0:!1};dg.prototype.undo=dg.prototype.undo=function(){this.canUndo()&&(null!==this.ea?this.ea.Mn(this,!0):null!==this.g&&this.g.Mn(this,!0))};
dg.prototype.canRedo=dg.prototype.canRedo=function(){return null!==this.ea||null!==this.g?!0:!1};dg.prototype.redo=dg.prototype.redo=function(){this.canRedo()&&(null!==this.ea?this.ea.Mn(this,!1):null!==this.g&&this.g.Mn(this,!1))};D.defineProperty(dg,{ea:"model"},function(){return this.Ae},function(a){this.Ae=a});D.defineProperty(dg,{g:"diagram"},function(){return this.ca},function(a){this.ca=a});
D.defineProperty(dg,{Pc:"change"},function(){return this.xr},function(a){v&&D.Da(a,dg,dg,"change");this.xr=a});D.defineProperty(dg,{Df:"modelChange"},function(){return this.Lw},function(a){v&&D.h(a,"string",dg,"modelChange");this.Lw=a});D.defineProperty(dg,{propertyName:"propertyName"},function(){return this.un},function(a){v&&"string"!==typeof a&&D.h(a,"function",dg,"propertyName");this.un=a});
D.w(dg,{nG:"isTransactionFinished"},function(){return this.xr===fg&&("CommittedTransaction"===this.un||"FinishedUndo"===this.un||"FinishedRedo"===this.un)});D.defineProperty(dg,{object:"object"},function(){return this.et},function(a){this.et=a});D.defineProperty(dg,{oldValue:"oldValue"},function(){return this.ht},function(a){this.ht=a});D.defineProperty(dg,{Zj:"oldParam"},function(){return this.gt},function(a){this.gt=a});
D.defineProperty(dg,{newValue:"newValue"},function(){return this.bt},function(a){this.bt=a});D.defineProperty(dg,{Xj:"newParam"},function(){return this.at},function(a){this.at=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.Mr=this.ac="";this.hj=!1;this.iA={};this.Be=[];this.Lc=new ma(null,Object);this.Fk="key";this.Uo=this.Ap=null;this.Dr=this.Er=!1;this.nr=null;this.pn="category";this.zg=new ma(null,L);this.Bk=null;this.yj=!1;this.EA=null;this.na=new sg;void 0!==a&&(this.ah=a)}D.ka("Model",M);
M.prototype.cloneProtected=function(a){a.ac=this.ac;a.Mr=this.Mr;a.hj=this.hj;a.Fk=this.Fk;a.Ap=this.Ap;a.Uo=this.Uo;a.Er=this.Er;a.Dr=this.Dr;a.nr=this.nr;a.pn=this.pn};M.prototype.copy=function(){var a=new this.constructor;this.cloneProtected(a);return a};M.prototype.clear=M.prototype.clear=function(){this.Be=[];this.Lc.clear();this.zg.clear();this.na.clear()};f=M.prototype;
f.toString=function(a){void 0===a&&(a=0);if(1<a)return this.oC();var b=(""!==this.name?this.name:"")+" Model";if(0<a){b+="\n node data:";a=this.ah;for(var c=D.fb(a),d=0;d<c;d++)var e=D.La(a,d),b=b+(" "+this.yb(e)+":"+ha(e))}return b};
f.Go=function(){var a="";""!==this.name&&(a+=',\n "name": '+this.quote(this.name));""!==this.tm&&(a+=',\n "dataFormat": '+this.quote(this.tm));this.sb&&(a+=',\n "isReadOnly": '+this.sb);"key"!==this.Yj&&"string"===typeof this.Yj&&(a+=',\n "nodeKeyProperty": '+this.quote(this.Yj));this.WA&&(a+=',\n "copiesArrays": true');this.VA&&(a+=',\n "copiesArrayObjects": true');"category"!==this.vo&&"string"===typeof this.vo&&(a+=',\n "nodeCategoryProperty": '+this.quote(this.vo));return a};
f.jv=function(a){a.name&&(this.name=a.name);a.dataFormat&&(this.tm=a.dataFormat);a.isReadOnly&&(this.sb=a.isReadOnly);a.nodeKeyProperty&&(this.Yj=a.nodeKeyProperty);a.copiesArrays&&(this.WA=a.copiesArrays);a.copiesArrayObjects&&(this.VA=a.copiesArrayObjects);a.nodeCategoryProperty&&(this.vo=a.nodeCategoryProperty)};function tg(a){return',\n "modelData": '+ug(a,a.ll)}function vg(a,b){var c=b.modelData;D.Qa(c)&&(a.mv(c),a.ll=c)}
f.AC=function(){var a=this.ll,b=!1,c;for(c in a)if(!wg(c,a[c])){b=!0;break}a="";b&&(a=tg(this));return a+',\n "nodeDataArray": '+xg(this,this.ah,!0)};f.TB=function(a){vg(this,a);a=a.nodeDataArray;D.isArray(a)&&(this.mv(a),this.ah=a)};
function yg(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(!yg(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(!wg(e,g)){var h=c[e];if(void 0===h||!yg(a,g,h,d))return!1}}for(var k in c)if(h=c[k],!wg(k,h)&&(g=b[k],void 0===g||!yg(a,g,h,d)))return!1;
return!0}return!1}function zg(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.BC=function(a){zg(this,a,"nodeKeyProperty");this instanceof Ag&&zg(this,a,"nodeParentKeyProperty");for(var b=new L,c=new L,d=(new L).Yc(this.Lc.pG),e=new ma,g=a.ah,h=0;h<g.length;h++){var k=g[h],l=a.yb(k);if(void 0!==l){d.remove(l);var m=this.Ie(l);null===m?(b.add(l),c.add(k)):yg(this,m,k,e)||c.add(k)}else this.EB(k),l=this.yb(k),b.add(l),c.add(k)}g="";yg(this,this.ll,a.ll,e)||(g+=tg(this));0<b.count&&(g+=this.oz+xg(this,b.Hc(),!0));0<c.count&&(g+=this.IC+xg(this,c.Hc(),!0));0<d.count&&(g+=this.qz+
xg(this,d.Hc(),!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===X?"go.GraphLinksModel":this.constructor===Ag?"go.TreeModel":D.xf(this));return'{ "class": '+this.quote(b)+', "incremental": 1'+this.Go()+this.BC(a)+"}"};f=M.prototype;f.oz=',\n "insertedNodeKeys": ';f.IC=',\n "modifiedNodeData": ';f.qz=',\n "removedNodeKeys": ';
f.zC=function(a,b){var c=this,d=!1,e=new L,g=new L,h=new L;a.fg.each(function(a){a.ea===c&&("nodeDataArray"===a.Df?a.Pc===gg?e.add(a.newValue):a.Pc===hg&&h.add(a.oldValue):c.me(a.object)?g.add(a.object):c.ll===a.object&&a.Pc===eg&&(d=!0))});var k=new L;e.each(function(a){k.add(c.yb(a));b||g.add(a)});var l=new L;h.each(function(a){l.add(c.yb(a));b&&g.add(a)});var m="";d&&(m+=tg(this));0<k.count&&(m+=(b?this.qz:this.oz)+xg(this,k.Hc(),!0));0<g.count&&(m+=this.IC+xg(this,g.Hc(),!0));0<l.count&&(m+=(b?
this.oz:this.qz)+xg(this,l.Hc(),!0));return m};
f.SB=function(a){vg(this,a);var b=a.insertedNodeKeys,c=a.modifiedNodeData,d=new ma;if(D.isArray(c))for(var e=0;e<c.length;e++){var g=D.La(c,e),h=this.yb(g);void 0!==h&&null!==h&&d.set(h,g)}if(D.isArray(b))for(var e=D.fb(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.Zy(h,g),this.jm(h));if(D.isArray(c))for(e=D.fb(c),k=0;k<e;k++)if(g=D.La(c,k),h=this.yb(g),h=this.Ie(h),null!==h)for(var l in g)"__gohashid"!==l&&l!==this.Yj&&l!==this.Mq&&this.setDataProperty(h,
l,g[l]);a=a.removedNodeKeys;if(D.isArray(a))for(e=D.fb(a),k=0;k<e;k++)g=D.La(a,k),h=this.Ie(g),null!==h&&this.Py(h)};
M.prototype.toIncrementalJson=M.prototype.toIncrementalJSON=function(a,b){D.l(a,dg,M,"toIncrementalJson:e");a.Pc!==fg&&D.k("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+a.toString());var c=a.object;if(!(a.nG&&c instanceof Bg))return'{ "incremental": 0 }';void 0===b&&(b=this.constructor===M?"go.Model":this.constructor===X?"go.GraphLinksModel":this.constructor===Ag?"go.TreeModel":D.xf(this));return'{ "class": '+this.quote(b)+', "incremental": 1'+this.Go()+this.zC(c,"FinishedUndo"===
a.propertyName)+"}"};M.prototype.toJson=M.prototype.toJSON=M.prototype.oC=function(a){void 0===a&&(a=this.constructor===M?"go.Model":this.constructor===X?"go.GraphLinksModel":this.constructor===Ag?"go.TreeModel":D.xf(this));return'{ "class": '+this.quote(a)+this.Go()+this.AC()+"}"};
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.Qb("applyIncrementalJson"),this.SB(b),this.ld("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=aa[g]):(h=aa[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 X);b.jv(c);b.TB(c);return b};
M.prototype.replaceJsonObjects=M.prototype.mv=function(a){if(D.isArray(a))for(var b=D.fb(a),c=0;c<b;c++){var d=D.La(a,c);D.Qa(d)&&D.cF(a,c,this.mv(d))}else if(D.Qa(a)){for(c in a)if(d=a[c],D.Qa(d)&&(d=this.mv(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(Cg(a.x),Cg(a.y));else if("go.Size"===d)c=new Ba(Cg(a.width),Cg(a.height));else if("go.Rect"===d)c=new C(Cg(a.x),Cg(a.y),Cg(a.width),Cg(a.height));else if("go.Margin"===d)c=new Mb(Cg(a.top),Cg(a.right),Cg(a.bottom),Cg(a.left));else if("go.Spot"===d)c="string"===typeof a["enum"]?cc(a["enum"]):new R(Cg(a.x),Cg(a.y),Cg(a.offsetX),Cg(a.offsetY));else if("go.Brush"===d){if(c=new za,c.type=Ga(za,a.type),"string"===typeof a.color&&(c.color=a.color),a.start instanceof
R&&(c.start=a.start),a.end instanceof R&&(c.end=a.end),"number"===typeof a.startRadius&&(c.vv=Cg(a.startRadius)),"number"===typeof a.endRadius&&(c.uu=Cg(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?xf(a.path):new Ue,b.type=Ga(Ue,a.type),"number"===typeof a.startX&&(b.la=Cg(a.startX)),"number"===typeof a.startY&&(b.ja=Cg(a.startY)),"number"===typeof a.endX&&(b.G=Cg(a.endX)),"number"===typeof a.endY&&(b.H=
Cg(a.endY)),a.spot1 instanceof R&&(b.C=a.spot1),a.spot2 instanceof R&&(b.D=a.spot2),c=b):"go.EnumValue"===d&&(b=a.classType,0===b.indexOf("go.")&&(b=b.substr(3)),c=Ga(aa[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.Bv=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.Bv(a.valueOf()):D.isArray(a)?xg(this,a):D.Qa(a)?ug(this,a):"function"===typeof a?"null":a.toString()};
function xg(a,b,c){void 0===c&&(c=!1);var d=D.fb(b);if(0>=d)return"[]";var e=new wa;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.Bv(h)))}c&&1<d&&e.add("\n");e.add(" ]");return e.toString()}function wg(a,b){return void 0===b||"__gohashid"===a||"_"===a[0]||"function"===typeof b?!0:!1}function Dg(a){return isNaN(a)?"NaN":Infinity===a?"9e9999":-Infinity===a?"-9e9999":a}
function ug(a,b){var c=b;if(c instanceof N)b={"class":"go.Point",x:Dg(c.x),y:Dg(c.y)};else if(c instanceof Ba)b={"class":"go.Size",width:Dg(c.width),height:Dg(c.height)};else if(c instanceof C)b={"class":"go.Rect",x:Dg(c.x),y:Dg(c.y),width:Dg(c.width),height:Dg(c.height)};else if(c instanceof Mb)b={"class":"go.Margin",top:Dg(c.top),right:Dg(c.right),bottom:Dg(c.bottom),left:Dg(c.left)};else if(c instanceof R)b=c.$c()?{"class":"go.Spot",x:Dg(c.x),y:Dg(c.y),offsetX:Dg(c.offsetX),offsetY:Dg(c.offsetY)}:
{"class":"go.Spot","enum":c.toString()};else if(c instanceof za){b={"class":"go.Brush",type:c.type.name};if(c.type===Eg)b.color=c.color;else if(c.type===Fg||c.type===Hd)b.start=c.start,b.end=c.end,c.type===Hd&&(0!==c.vv&&(b.startRadius=Dg(c.vv)),isNaN(c.uu)||(b.endRadius=Dg(c.uu)));if(null!==c.Uk){for(var d={},c=c.Uk.j;c.next();)d[c.key]=c.value;b.colorStops=d}}else if(c instanceof Ue)b={"class":"go.Geometry",type:c.type.name},0!==c.la&&(b.startX=Dg(c.la)),0!==c.ja&&(b.startY=Dg(c.ja)),0!==c.G&&(b.endX=
Dg(c.G)),0!==c.H&&(b.endY=Dg(c.H)),c.C.P(ic)||(b.spot1=c.C),c.D.P(vc)||(b.spot2=c.D),c.type===Ve&&(b.path=wf(c));else if(c instanceof xa)b={"class":"go.EnumValue",classType:D.xf(c.Se),name:c.name};else if(c instanceof O||c instanceof E||c instanceof Gg||c instanceof M||c instanceof Hg||c instanceof pa||c instanceof Ig||c instanceof ta||c instanceof sg||c instanceof Bg)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.zb(b,e);if(!wg(e,g))if(c?c=!1:d+=", ",d+='"'+e+'":',"points"===e&&g instanceof K&&g.da===N){for(var h="[",g=g.j;g.next();){var k=g.value;1<h.length&&(h+=",");h+=a.Bv(k.x);h+=",";h+=a.Bv(k.y)}h+="]";d+=h}else d+=a.Bv(g)}return d+"}"}function Cg(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,{tm:"dataFormat"},function(){return this.Mr},function(a){var b=this.Mr;b!==a&&(D.h(a,"string",M,"dataFormat"),this.Mr=a,this.i("dataFormat",b,a))});D.defineProperty(M,{sb:"isReadOnly"},function(){return this.hj},function(a){var b=this.hj;b!==a&&(D.h(a,"boolean",M,"isReadOnly"),this.hj=a,this.i("isReadOnly",b,a))});
D.defineProperty(M,{ll:"modelData"},function(){return this.iA},function(a){var b=this.iA;b!==a&&(D.h(a,"object",M,"modelData"),this.iA=a,this.i("modelData",b,a),this.Rb(a))});M.prototype.addChangedListener=M.prototype.In=function(a){D.h(a,"function",M,"addChangedListener:listener");null===this.Bk&&(this.Bk=new K("function"));this.Bk.add(a)};
M.prototype.removeChangedListener=M.prototype.kv=function(a){D.h(a,"function",M,"removeChangedListener:listener");null!==this.Bk&&(this.Bk.remove(a),0===this.Bk.count&&(this.Bk=null))};M.prototype.Jx=function(a){this.ob||this.na.YF(a);if(null!==this.Bk)for(var b=this.Bk,c=b.length,d=0;d<c;d++)b.fa(d)(a)};M.prototype.raiseChangedEvent=M.prototype.pd=function(a,b,c,d,e,g,h){$g(this,"",a,b,c,d,e,g,h)};M.prototype.raiseChanged=M.prototype.i=function(a,b,c,d,e){$g(this,"",eg,a,this,b,c,d,e)};
M.prototype.raiseDataChanged=M.prototype.RB=function(a,b,c,d,e,g){$g(this,"",eg,b,a,c,d,e,g)};function $g(a,b,c,d,e,g,h,k,l){void 0===k&&(k=null);void 0===l&&(l=null);var m=new dg;m.ea=a;m.Pc=c;m.Df=b;m.propertyName=d;m.object=e;m.oldValue=g;m.Zj=k;m.newValue=h;m.Xj=l;a.Jx(m)}D.defineProperty(M,{na:"undoManager"},function(){return this.EA},function(a){var b=this.EA;b!==a&&(D.l(a,sg,M,"undoManager"),null!==b&&b.fK(this),this.EA=a,null!==a&&a.ZH(this))});
D.defineProperty(M,{ob:"skipsUndoManager"},function(){return this.yj},function(a){D.h(a,"boolean",M,"skipsUndoManager");this.yj=a});
M.prototype.Mn=function(a,b){if(null!==a&&a.ea===this)if(a.Pc===eg){var c=a.object,d=a.propertyName,e=a.oa(b);D.Ua(c,d,e)}else a.Pc===gg?(c=a.Xj,"nodeDataArray"===a.Df?(d=a.newValue,D.Qa(d)&&"number"===typeof c&&(e=this.yb(d),b?(D.La(this.Be,c)===d&&D.Vg(this.Be,c),void 0!==e&&this.Lc.remove(e)):(D.La(this.Be,c)!==d&&D.Kh(this.Be,c,d),void 0!==e&&this.Lc.add(e,d)))):""===a.Df?(d=a.object,!D.isArray(d)&&a.propertyName&&(d=D.zb(a.object,a.propertyName)),D.isArray(d)&&"number"===typeof c&&(e=a.newValue,
b?D.Vg(d,c):D.Kh(d,c,e))):D.k("unknown ChangedEvent.Insert modelChange: "+a.toString())):a.Pc===hg?(c=a.Zj,"nodeDataArray"===a.Df?(d=a.oldValue,D.Qa(d)&&"number"===typeof c&&(e=this.yb(d),b?(D.La(this.Be,c)!==d&&D.Kh(this.Be,c,d),void 0!==e&&this.Lc.add(e,d)):(D.La(this.Be,c)===d&&D.Vg(this.Be,c),void 0!==e&&this.Lc.remove(e)))):""===a.Df?(d=a.object,!D.isArray(d)&&a.propertyName&&(d=D.zb(a.object,a.propertyName)),D.isArray(d)&&"number"===typeof c&&(e=a.oldValue,b?D.Kh(d,c,e):D.Vg(d,c))):D.k("unknown ChangedEvent.Remove modelChange: "+
a.toString())):a.Pc!==fg&&D.k("unknown ChangedEvent: "+a.toString())};M.prototype.startTransaction=M.prototype.Qb=function(a){return this.na.Qb(a)};M.prototype.commitTransaction=M.prototype.ld=function(a){return this.na.ld(a)};M.prototype.rollbackTransaction=M.prototype.Hm=function(){return this.na.Hm()};
M.prototype.commit=M.prototype.commit=function(a,b){var c=b;void 0===c&&(c="");var d=this.ob;null===c&&(this.ob=!0,c="");this.na.Qb(c);var e=!1;try{a(this),e=!0}finally{e?this.na.ld(c):this.na.Hm(),this.ob=d}};M.prototype.updateTargetBindings=M.prototype.Rb=function(a,b){void 0===b&&(b="");$g(this,"SourceChanged",fg,b,a,null,null)};
D.defineProperty(M,{Yj:"nodeKeyProperty"},function(){return this.Fk},function(a){var b=this.Fk;b!==a&&(ah(a,M,"nodeKeyProperty"),""===a&&D.k("Model.nodeKeyProperty may not be the empty string"),0<this.Lc.count&&D.k("Cannot set Model.nodeKeyProperty when there is existing node data"),this.Fk=a,this.i("nodeKeyProperty",b,a))});function ah(a,b,c){"string"!==typeof a&&"function"!==typeof a&&D.mc(a,"string or function",b,c)}
M.prototype.getKeyForNodeData=M.prototype.yb=function(a){if(null!==a){var b=this.Fk;if(""!==b&&(b=D.zb(a,b),void 0!==b)){if(bh(b))return b;D.k("Key value for node data "+a+" is not a number or a string: "+b)}}};
M.prototype.setKeyForNodeData=M.prototype.Zy=function(a,b){void 0!==b&&null!==b&&bh(b)||D.mc(b,"number or string",M,"setKeyForNodeData:key");if(null!==a){var c=this.Fk;if(""!==c)if(this.me(a)){var d=D.zb(a,c);d!==b&&null===this.Ie(b)&&(D.Ua(a,c,b),this.Lc.remove(d),this.Lc.add(b,a),$g(this,"nodeKey",eg,c,a,d,b),"string"===typeof c&&this.Rb(a,c),this.lv(d,b))}else D.Ua(a,c,b)}};
D.defineProperty(M,{bM:"makeUniqueKeyFunction"},function(){return this.Ap},function(a){var b=this.Ap;b!==a&&(null!==a&&D.h(a,"function",M,"makeUniqueKeyFunction"),this.Ap=a,this.i("makeUniqueKeyFunction",b,a))});function bh(a){return"number"===typeof a||"string"===typeof a}M.prototype.containsNodeData=M.prototype.me=function(a){var b=this.yb(a);return void 0===b?!1:this.Lc.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&&bh(a)?this.Lc.oa(a):null};
D.defineProperty(M,{ah:"nodeDataArray"},function(){return this.Be},function(a){var b=this.Be;if(b!==a){D.mu(a,M,"nodeDataArray");this.Lc.clear();this.vC();for(var c=D.fb(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.wq(e)}this.Be=a;for(var g=new K(Object),d=0;d<c;d++){var e=D.La(a,d),h=this.yb(e);void 0===h?g.add(e):null!==this.Lc.oa(h)?g.add(e):this.Lc.add(h,e)}for(d=g.j;d.next();)e=d.value,this.EB(e),g=this.yb(e),void 0!==g&&
this.Lc.add(g,e);$g(this,"nodeDataArray",eg,"nodeDataArray",this,b,a);for(d=0;d<c;d++)e=D.La(a,d),this.Uq(e),this.Tq(e);this.gF();D.qJ(a)||(this.sb=!0)}});
M.prototype.makeNodeDataKeyUnique=M.prototype.EB=function(a){if(null!==a){var b=this.Fk;if(""!==b){var c=this.yb(a);if(void 0===c||this.Lc.contains(c)){var d=this.Ap;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.Lc.contains(c))){D.Ua(a,b,c);return}if("string"===typeof c){for(d=2;this.Lc.contains(c+d);)d++;D.Ua(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(d=-this.Lc.count-1;this.Lc.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.jm=function(a){null!==a&&(D.wq(a),this.me(a)||ch(this,a,!0))};function ch(a,b,c){var d=a.yb(b);if(void 0===d||a.Lc.oa(d)!==b)a.EB(b),d=a.yb(b),void 0===d?D.k("Model.makeNodeDataKeyUnique failed on "+b+". Data not added to Model."):(a.Lc.add(d,b),d=null,c&&(d=D.fb(a.Be),D.Kh(a.Be,d,b)),$g(a,"nodeDataArray",gg,"nodeDataArray",a,null,b,null,d),a.Uq(b),a.Tq(b))}
M.prototype.addNodeDataCollection=function(a){if(D.isArray(a))for(var b=D.fb(a),c=0;c<b;c++)this.jm(D.La(a,c));else for(a=a.j;a.next();)this.jm(a.value)};M.prototype.removeNodeData=M.prototype.Py=function(a){null!==a&&dh(this,a,!0)};function dh(a,b,c){var d=a.yb(b);void 0!==d&&a.Lc.remove(d);d=null;if(c){d=D.nm(a.Be,b);if(0>d)return;D.Vg(a.Be,d)}$g(a,"nodeDataArray",hg,"nodeDataArray",a,b,null,d,null);a.Av(b)}
M.prototype.removeNodeDataCollection=function(a){if(D.isArray(a))for(var b=D.fb(a),c=0;c<b;c++)this.Py(D.La(a,c));else for(a=a.j;a.next();)this.Py(a.value)};f=M.prototype;f.lv=function(a,b){var c=eh(this,a);c instanceof L&&this.zg.add(b,c)};f.vC=function(){};f.Uq=function(){};f.Tq=function(){};f.Av=function(){};function fh(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 gh(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 eh(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.gF=function(a){void 0===a?this.zg.clear():this.zg.remove(a)};
D.defineProperty(M,{uL:"copyNodeDataFunction"},function(){return this.Uo},function(a){var b=this.Uo;b!==a&&(null!==a&&D.h(a,"function",M,"copyNodeDataFunction"),this.Uo=a,this.i("copyNodeDataFunction",b,a))});D.defineProperty(M,{WA:"copiesArrays"},function(){return this.Er},function(a){var b=this.Er;b!==a&&(null!==a&&D.h(a,"boolean",M,"copiesArrays"),this.Er=a,this.i("copiesArrays",b,a))});
D.defineProperty(M,{VA:"copiesArrayObjects"},function(){return this.Dr},function(a){var b=this.Dr;b!==a&&(null!==a&&D.h(a,"boolean",M,"copiesArrayObjects"),this.Dr=a,this.i("copiesArrayObjects",b,a))});M.prototype.copyNodeData=function(a){if(null===a)return null;var b=null,b=this.Uo,b=null!==b?b(a,this):hh(this,a,!0);D.Qa(b)&&D.xc(b);return b};
function hh(a,b,c){if(a.WA&&Array.isArray(b)){var d=[];for(c=0;c<b.length;c++){var e=hh(a,b[c],a.VA);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.zb(b,d),g;g=e;g instanceof O||g instanceof E||g instanceof Gg||g instanceof ih||g instanceof jh||g instanceof Hg||g instanceof pa||g instanceof Ig||g instanceof ag||g instanceof cg?("_"!==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 sg||g instanceof Bg||g instanceof dg?!0:!1;g||(e=hh(a,e,!1));D.Ua(c,d,e)}D.xc(c);return c}return b instanceof N?b.copy():b instanceof Ba?b.copy():b instanceof C?b.copy():b instanceof R?b.copy():b instanceof Mb?b.copy():b}
D.defineProperty(M,{aI:"afterCopyFunction"},function(){return this.nr},function(a){var b=this.nr;b!==a&&(null!==a&&D.h(a,"function",M,"afterCopyFunction"),this.nr=a,this.i("afterCopyFunction",b,a))});var kh=!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.me(a))if(b===this.Yj)this.Zy(a,c);else{if(b===this.vo){this.Xy(a,c);return}}else!kh&&a instanceof O&&(kh=!0,D.trace('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),D.trace(" Is that really your intent?"));var d=D.zb(a,
b);d!==c&&(D.Ua(a,b,c),this.RB(a,b,d,c))};M.prototype.addArrayItem=function(a,b){this.rB(a,-1,b)};M.prototype.insertArrayItem=M.prototype.rB=function(a,b,c){v&&(D.mu(a,M,"insertArrayItem:arr"),D.p(b,M,"insertArrayItem:idx"));a===this.Be&&D.k("Model.insertArrayItem or Model.addArrayItem should not be called on the Model.nodeDataArray");0>b&&(b=D.fb(a));D.Kh(a,b,c);$g(this,"",gg,"",a,null,c,null,b)};
M.prototype.removeArrayItem=M.prototype.IG=function(a,b){void 0===b&&(b=-1);v&&(D.mu(a,M,"removeArrayItem:arr"),D.p(b,M,"removeArrayItem:idx"));a===this.Be&&D.k("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=D.fb(a)-1);var c=D.La(a,b);D.Vg(a,b);$g(this,"",hg,"",a,c,null,b,null)};D.defineProperty(M,{vo:"nodeCategoryProperty"},function(){return this.pn},function(a){var b=this.pn;b!==a&&(ah(a,M,"nodeCategoryProperty"),this.pn=a,this.i("nodeCategoryProperty",b,a))});
M.prototype.getCategoryForNodeData=M.prototype.jB=function(a){if(null===a)return"";var b=this.pn;if(""===b)return"";b=D.zb(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.Xy=function(a,b){D.h(b,"string",M,"setCategoryForNodeData:cat");if(null!==a){var c=this.pn;if(""!==c)if(this.me(a)){var d=D.zb(a,c);void 0===d&&(d="");d!==b&&(D.Ua(a,c,b),$g(this,"nodeCategory",eg,c,a,d,b))}else D.Ua(a,c,b)}};
function X(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.ef=[];this.ni=new L(Object);this.ud=new ma(null,Object);this.Ul="";this.Cl=this.To=this.Bp=null;this.oi="from";this.pi="to";this.ln=this.kn="";this.jn="category";this.Kg="";this.Ep="isGroup";this.Ch="group";this.Fr=!1;void 0!==a&&(this.ah=a);void 0!==b&&(this.Sh=b)}D.Ta(X,M);D.ka("GraphLinksModel",X);
X.prototype.cloneProtected=function(a){M.prototype.cloneProtected.call(this,a);a.Ul=this.Ul;a.Bp=this.Bp;a.To=this.To;a.oi=this.oi;a.pi=this.pi;a.kn=this.kn;a.ln=this.ln;a.jn=this.jn;a.Kg=this.Kg;a.Ep=this.Ep;a.Ch=this.Ch;a.Fr=this.Fr};X.prototype.clear=X.prototype.clear=function(){M.prototype.clear.call(this);this.ef=[];this.ud.clear();this.ni.clear()};f=X.prototype;
f.toString=function(a){void 0===a&&(a=0);if(2<=a)return this.oC();var b=(""!==this.name?this.name:"")+" GraphLinksModel";if(0<a){b+="\n node data:";a=this.ah;for(var c=D.fb(a),d=0,d=0;d<c;d++)var e=D.La(a,d),b=b+(" "+this.yb(e)+":"+ha(e));b+="\n link data:";a=this.Sh;c=D.fb(a);for(d=0;d<c;d++)e=D.La(a,d),b+=" "+this.zm(e)+"--\x3e"+this.Am(e)}return b};
f.Go=function(){var a=M.prototype.Go.call(this),b="";"category"!==this.Wu&&"string"===typeof this.Wu&&(b+=',\n "linkCategoryProperty": '+this.quote(this.Wu));""!==this.Vj&&"string"===typeof this.Vj&&(b+=',\n "linkKeyProperty": '+this.quote(this.Vj));"from"!==this.lo&&"string"===typeof this.lo&&(b+=',\n "linkFromKeyProperty": '+this.quote(this.lo));"to"!==this.mo&&"string"===typeof this.mo&&(b+=',\n "linkToKeyProperty": '+this.quote(this.mo));""!==this.Xu&&"string"===typeof this.Xu&&(b+=',\n "linkFromPortIdProperty": '+
this.quote(this.Xu));""!==this.Zu&&"string"===typeof this.Zu&&(b+=',\n "linkToPortIdProperty": '+this.quote(this.Zu));""!==this.Yu&&"string"===typeof this.Yu&&(b+=',\n "linkLabelKeysProperty": '+this.quote(this.Yu));"isGroup"!==this.Mq&&"string"===typeof this.Mq&&(b+=',\n "nodeIsGroupProperty": '+this.quote(this.Mq));"group"!==this.fv&&"string"===typeof this.fv&&(b+=',\n "nodeGroupKeyProperty": '+this.quote(this.fv));return a+b};
f.jv=function(a){M.prototype.jv.call(this,a);a.linkKeyProperty&&(this.Vj=a.linkKeyProperty);a.linkFromKeyProperty&&(this.lo=a.linkFromKeyProperty);a.linkToKeyProperty&&(this.mo=a.linkToKeyProperty);a.linkFromPortIdProperty&&(this.Xu=a.linkFromPortIdProperty);a.linkToPortIdProperty&&(this.Zu=a.linkToPortIdProperty);a.linkCategoryProperty&&(this.Wu=a.linkCategoryProperty);a.linkLabelKeysProperty&&(this.Yu=a.linkLabelKeysProperty);a.nodeIsGroupProperty&&(this.Mq=a.nodeIsGroupProperty);a.nodeGroupKeyProperty&&
(this.fv=a.nodeGroupKeyProperty)};f.AC=function(){var a=M.prototype.AC.call(this),b=',\n "linkDataArray": '+xg(this,this.Sh,!0);return a+b};f.TB=function(a){M.prototype.TB.call(this,a);a=a.linkDataArray;D.isArray(a)&&(this.mv(a),this.Sh=a)};
f.BC=function(a){if(!(a instanceof X))return D.k("Model.computeJsonDifference: newmodel must be a GraphLinksModel"),"";""===this.Vj&&D.k("GraphLinksModel.linkKeyProperty must not be an empty string for .computeJsonDifference() to succeed.");var b=M.prototype.BC.call(this,a);zg(this,a,"linkKeyProperty");zg(this,a,"linkFromKeyProperty");zg(this,a,"linkToKeyProperty");zg(this,a,"linkLabelKeysProperty");zg(this,a,"nodeIsGroupProperty");zg(this,a,"nodeGroupKeyProperty");for(var c=new L,d=new L,e=(new L).Yc(this.ud.pG),
g=new ma,h=a.Sh,k=0;k<h.length;k++){var l=h[k],m=a.mf(l);if(void 0!==m){e.remove(m);var n=this.sq(m);null===n?(c.add(m),d.add(l)):yg(this,n,l,g)||d.add(l)}else this.Ay(l),m=this.mf(l),c.add(m),d.add(l)}a=b;0<c.count&&(a+=this.nz+xg(this,c.Hc(),!0));0<d.count&&(a+=this.HC+xg(this,d.Hc(),!0));0<e.count&&(a+=this.pz+xg(this,e.Hc(),!0));return a};f.nz=',\n "insertedLinkKeys": ';f.HC=',\n "modifiedLinkData": ';f.pz=',\n "removedLinkKeys": ';
f.zC=function(a,b){""===this.Vj&&D.k("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var c=M.prototype.zC.call(this,a,b),d=this,e=new L,g=new L,h=new L;a.fg.each(function(a){a.ea===d&&("linkDataArray"===a.Df?a.Pc===gg?e.add(a.newValue):a.Pc===hg&&h.add(a.oldValue):d.Mh(a.object)&&g.add(a.object))});var k=new L;e.each(function(a){k.add(d.mf(a));b||g.add(a)});var l=new L;h.each(function(a){l.add(d.mf(a));b&&g.add(a)});0<k.count&&(c+=(b?this.pz:this.nz)+
xg(this,k.Hc(),!0));0<g.count&&(c+=this.HC+xg(this,g.Hc(),!0));0<l.count&&(c+=(b?this.nz:this.pz)+xg(this,l.Hc(),!0));return c};
f.SB=function(a){M.prototype.SB.call(this,a);var b=a.insertedLinkKeys,c=a.modifiedLinkData,d=new ma;if(D.isArray(c))for(var e=0;e<c.length;e++){var g=D.La(c,e),h=this.mf(g);void 0!==h&&null!==h&&d.set(h,g)}if(D.isArray(b))for(var e=D.fb(b),k=0;k<e;k++)g=D.La(b,k),h=this.sq(g),null===h&&(h=(h=d.get(g))?h:this.Mx({}),this.cH(h,g),this.gu(h));if(D.isArray(c))for(e=D.fb(c),k=0;k<e;k++)if(g=D.La(c,k),h=this.mf(g),h=this.sq(h),null!==h)for(var l in g)"__gohashid"!==l&&l!==this.Vj&&this.setDataProperty(h,
l,g[l]);a=a.removedLinkKeys;if(D.isArray(a))for(e=D.fb(a),k=0;k<e;k++)g=D.La(a,k),h=this.sq(g),null!==h&&this.Oy(h)};
f.Mn=function(a,b){if(a.Pc===gg){var c=a.Xj;if("linkDataArray"===a.Df){var d=a.newValue;if(D.Qa(d)&&"number"===typeof c){var e=this.mf(d);b?(this.ni.remove(d),D.La(this.ef,c)===d&&D.Vg(this.ef,c),void 0!==e&&this.ud.remove(e)):(this.ni.add(d),D.La(this.ef,c)!==d&&D.Kh(this.ef,c,d),void 0!==e&&this.ud.add(e,d))}return}if("linkLabelKeys"===a.Df){d=this.dl(a.object);D.isArray(d)&&"number"===typeof c&&(b?(c=D.nm(d,a.newValue),0<=c&&D.Vg(d,c)):0>D.nm(d,a.newValue)&&D.Kh(d,c,a.newValue));return}}else if(a.Pc===
hg){c=a.Zj;if("linkDataArray"===a.Df){d=a.oldValue;D.Qa(d)&&"number"===typeof c&&(e=this.mf(d),b?(this.ni.add(d),D.La(this.ef,c)!==d&&D.Kh(this.ef,c,d),void 0!==e&&this.ud.add(e,d)):(this.ni.remove(d),D.La(this.ef,c)===d&&D.Vg(this.ef,c),void 0!==e&&this.ud.remove(e)));return}if("linkLabelKeys"===a.Df){d=this.dl(a.object);D.isArray(d)&&"number"===typeof c&&(b?0>D.nm(d,a.newValue)&&D.Kh(d,c,a.newValue):(c=D.nm(d,a.newValue),0<=c&&D.Vg(d,c)));return}}M.prototype.Mn.call(this,a,b)};
D.defineProperty(X,{MA:"archetypeNodeData"},function(){return this.Cl},function(a){var b=this.Cl;b!==a&&(null!==a&&D.l(a,Object,X,"archetypeNodeData"),this.Cl=a,this.i("archetypeNodeData",b,a))});X.prototype.no=function(a){if(void 0!==a){var b=this.Cl;if(null!==b){var c=this.Ie(a);null===c&&(c=this.copyNodeData(b),D.Ua(c,this.Fk,a),this.jm(c))}return a}};
D.defineProperty(X,{lo:"linkFromKeyProperty"},function(){return this.oi},function(a){var b=this.oi;b!==a&&(ah(a,X,"linkFromKeyProperty"),this.oi=a,this.i("linkFromKeyProperty",b,a))});X.prototype.getFromKeyForLinkData=X.prototype.zm=function(a){if(null!==a){var b=this.oi;if(""!==b&&(b=D.zb(a,b),void 0!==b)){if(bh(b))return b;D.k("FromKey value for link data "+a+" is not a number or a string: "+b)}}};
X.prototype.setFromKeyForLinkData=X.prototype.bC=function(a,b){null===b&&(b=void 0);void 0===b||bh(b)||D.mc(b,"number or string",X,"setFromKeyForLinkData:key");if(null!==a){var c=this.oi;if(""!==c)if(b=this.no(b),this.Mh(a)){var d=D.zb(a,c);d!==b&&(gh(this,d,a),D.Ua(a,c,b),null===this.Ie(b)&&fh(this,b,a),$g(this,"linkFromKey",eg,c,a,d,b),"string"===typeof c&&this.Rb(a,c))}else D.Ua(a,c,b)}};
D.defineProperty(X,{mo:"linkToKeyProperty"},function(){return this.pi},function(a){var b=this.pi;b!==a&&(ah(a,X,"linkToKeyProperty"),this.pi=a,this.i("linkToKeyProperty",b,a))});X.prototype.getToKeyForLinkData=X.prototype.Am=function(a){if(null!==a){var b=this.pi;if(""!==b&&(b=D.zb(a,b),void 0!==b)){if(bh(b))return b;D.k("ToKey value for link data "+a+" is not a number or a string: "+b)}}};
X.prototype.setToKeyForLinkData=X.prototype.hC=function(a,b){null===b&&(b=void 0);void 0===b||bh(b)||D.mc(b,"number or string",X,"setToKeyForLinkData:key");if(null!==a){var c=this.pi;if(""!==c)if(b=this.no(b),this.Mh(a)){var d=D.zb(a,c);d!==b&&(gh(this,d,a),D.Ua(a,c,b),null===this.Ie(b)&&fh(this,b,a),$g(this,"linkToKey",eg,c,a,d,b),"string"===typeof c&&this.Rb(a,c))}else D.Ua(a,c,b)}};
D.defineProperty(X,{Xu:"linkFromPortIdProperty"},function(){return this.kn},function(a){var b=this.kn;b!==a&&(ah(a,X,"linkFromPortIdProperty"),a!==this.lo&&a!==this.mo||D.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.kn=a,this.i("linkFromPortIdProperty",b,a))});X.prototype.getFromPortIdForLinkData=X.prototype.VI=function(a){if(null===a)return"";var b=this.kn;if(""===b)return"";a=D.zb(a,b);return void 0===a?"":a};
X.prototype.setFromPortIdForLinkData=X.prototype.cC=function(a,b){D.h(b,"string",X,"setFromPortIdForLinkData:portname");if(null!==a){var c=this.kn;if(""!==c)if(this.Mh(a)){var d=D.zb(a,c);void 0===d&&(d="");d!==b&&(D.Ua(a,c,b),$g(this,"linkFromPortId",eg,c,a,d,b),"string"===typeof c&&this.Rb(a,c))}else D.Ua(a,c,b)}};
D.defineProperty(X,{Zu:"linkToPortIdProperty"},function(){return this.ln},function(a){var b=this.ln;b!==a&&(ah(a,X,"linkToPortIdProperty"),a!==this.lo&&a!==this.mo||D.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.ln=a,this.i("linkToPortIdProperty",b,a))});X.prototype.getToPortIdForLinkData=X.prototype.ZI=function(a){if(null===a)return"";var b=this.ln;if(""===b)return"";a=D.zb(a,b);return void 0===a?"":a};
X.prototype.setToPortIdForLinkData=X.prototype.iC=function(a,b){D.h(b,"string",X,"setToPortIdForLinkData:portname");if(null!==a){var c=this.ln;if(""!==c)if(this.Mh(a)){var d=D.zb(a,c);void 0===d&&(d="");d!==b&&(D.Ua(a,c,b),$g(this,"linkToPortId",eg,c,a,d,b),"string"===typeof c&&this.Rb(a,c))}else D.Ua(a,c,b)}};D.defineProperty(X,{Yu:"linkLabelKeysProperty"},function(){return this.Kg},function(a){var b=this.Kg;b!==a&&(ah(a,X,"linkLabelKeysProperty"),this.Kg=a,this.i("linkLabelKeysProperty",b,a))});
X.prototype.getLabelKeysForLinkData=X.prototype.dl=function(a){if(null===a)return D.Jo;var b=this.Kg;if(""===b)return D.Jo;a=D.zb(a,b);return void 0===a?D.Jo:a};
X.prototype.setLabelKeysForLinkData=X.prototype.dH=function(a,b){D.mu(b,X,"setLabelKeysForLinkData:arr");if(null!==a){var c=this.Kg;if(""!==c)if(this.Mh(a)){var d=D.zb(a,c);void 0===d&&(d=D.Jo);if(d!==b){for(var e=D.fb(d),g=0;g<e;g++){var h=D.La(d,g);gh(this,h,a)}D.Ua(a,c,b);e=D.fb(b);for(g=0;g<e;g++)h=D.La(b,g),null===this.Ie(h)&&fh(this,h,a);$g(this,"linkLabelKeys",eg,c,a,d,b);"string"===typeof c&&this.Rb(a,c)}}else D.Ua(a,c,b)}};
X.prototype.addLabelKeyForLinkData=X.prototype.VE=function(a,b){if(null!==b&&void 0!==b&&(bh(b)||D.mc(b,"number or string",X,"addLabelKeyForLinkData:key"),null!==a)){var c=this.Kg;if(""!==c){var d=D.zb(a,c);if(void 0===d)c=[],c.push(b),this.dH(a,c);else if(D.isArray(d)){var e=D.nm(d,b);0<=e||(e=D.fb(d),D.Kh(d,Infinity,b),this.Mh(a)&&(null===this.Ie(b)&&fh(this,b,a),$g(this,"linkLabelKeys",gg,c,a,null,b,null,e)))}else D.k(c+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}};
X.prototype.removeLabelKeyForLinkData=X.prototype.eK=function(a,b){if(null!==b&&void 0!==b&&(bh(b)||D.mc(b,"number or string",X,"removeLabelKeyForLinkData:key"),null!==a)){var c=this.Kg;if(""!==c){var d=D.zb(a,c);if(D.isArray(d)){var e=D.nm(d,b);0>e||(D.Vg(d,e),this.Mh(a)&&(gh(this,b,a),$g(this,"linkLabelKeys",hg,c,a,b,null,e,null)))}else void 0!==d&&D.k(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}};
D.defineProperty(X,{Sh:"linkDataArray"},function(){return this.ef},function(a){var b=this.ef;if(b!==a){D.mu(a,X,"linkDataArray");this.ud.clear();for(var c=D.fb(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.wq(e)}this.ef=a;if(""!==this.Vj){for(var g=new K(Object),d=0;d<c;d++){var e=D.La(a,d),h=this.mf(e);void 0===h?g.add(e):null!==this.ud.oa(h)?g.add(e):this.ud.add(h,e)}for(d=g.j;d.next();)e=d.value,this.Ay(e),g=this.mf(e),
void 0!==g&&this.ud.add(g,e)}g=new L(Object);for(d=0;d<c;d++)e=D.La(a,d),g.add(e);this.ni=g;$g(this,"linkDataArray",eg,"linkDataArray",this,b,a);for(d=0;d<c;d++)e=D.La(a,d),lh(this,e)}});
D.defineProperty(X,{Vj:"linkKeyProperty"},function(){return this.Ul},function(a){var b=this.Ul;if(b!==a){ah(a,X,"linkKeyProperty");this.Ul=a;this.ud.clear();for(var c=D.fb(this.Sh),d=0;d<c;d++){var e=D.La(this.Sh,d),g=this.mf(e);void 0===g&&(this.Ay(e),g=this.mf(e));void 0!==g&&this.ud.add(g,e)}this.i("linkKeyProperty",b,a)}});
X.prototype.getKeyForLinkData=X.prototype.mf=function(a){if(null!==a){var b=this.Ul;if(""!==b&&(b=D.zb(a,b),void 0!==b)){if(bh(b))return b;D.k("Key value for link data "+a+" is not a number or a string: "+b)}}};
X.prototype.setKeyForLinkData=X.prototype.cH=function(a,b){void 0!==b&&null!==b&&bh(b)||D.mc(b,"number or string",X,"setKeyForLinkData:key");if(null!==a){var c=this.Ul;if(""!==c)if(this.Mh(a)){var d=D.zb(a,c);d!==b&&null===this.sq(b)&&(D.Ua(a,c,b),this.ud.remove(d),this.ud.add(b,a),$g(this,"linkKey",eg,c,a,d,b),"string"===typeof c&&this.Rb(a,c))}else D.Ua(a,c,b)}};
D.defineProperty(X,{cM:"makeUniqueLinkKeyFunction"},function(){return this.Bp},function(a){var b=this.Bp;b!==a&&(null!==a&&D.h(a,"function",X,"makeUniqueLinkKeyFunction"),this.Bp=a,this.i("makeUniqueLinkKeyFunction",b,a))});X.prototype.findLinkDataForKey=X.prototype.sq=function(a){null===a&&D.k("GraphLinksModel.findLinkDataForKey:key must not be null");return void 0!==a&&bh(a)?this.ud.oa(a):null};
X.prototype.makeLinkDataKeyUnique=X.prototype.Ay=function(a){if(null!==a){var b=this.Ul;if(""!==b){var c=this.mf(a);if(void 0===c||this.ud.contains(c)){var d=this.Bp;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.ud.contains(c))){D.Ua(a,b,c);return}if("string"===typeof c){for(d=2;this.ud.contains(c+d);)d++;D.Ua(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(d=-this.ud.count-1;this.ud.contains(d);)d--;D.Ua(a,b,d)}else D.k("GraphLinksModel.getKeyForLinkData returned something other than a string or a number: "+
c)}}}};X.prototype.containsLinkData=X.prototype.Mh=function(a){return null===a?!1:this.ni.contains(a)};X.prototype.addLinkData=X.prototype.gu=function(a){null!==a&&(D.wq(a),this.Mh(a)||mh(this,a,!0))};
function mh(a,b,c){if(""!==a.Vj){var d=a.mf(b);if(void 0!==d&&a.ud.oa(d)===b)return;a.Ay(b);d=a.mf(b);if(void 0===d){D.k("GraphLinksModel.makeLinkDataKeyUnique failed on "+b+". Data not added to model.");return}a.ud.add(d,b)}a.ni.add(b);d=null;c&&(d=D.fb(a.ef),D.Kh(a.ef,d,b));$g(a,"linkDataArray",gg,"linkDataArray",a,null,b,null,d);lh(a,b)}X.prototype.addLinkDataCollection=function(a){if(D.isArray(a))for(var b=D.fb(a),c=0;c<b;c++)this.gu(D.La(a,c));else for(a=a.j;a.next();)this.gu(a.value)};
X.prototype.removeLinkData=X.prototype.Oy=function(a){null!==a&&nh(this,a,!0)};function nh(a,b,c){a.ni.remove(b);var d=a.mf(b);void 0!==d&&a.ud.remove(d);d=null;if(c){d=D.nm(a.ef,b);if(0>d)return;D.Vg(a.ef,d)}$g(a,"linkDataArray",hg,"linkDataArray",a,b,null,d,null);c=a.zm(b);gh(a,c,b);c=a.Am(b);gh(a,c,b);d=a.dl(b);if(D.isArray(d))for(var e=D.fb(d),g=0;g<e;g++)c=D.La(d,g),gh(a,c,b)}
X.prototype.removeLinkDataCollection=function(a){if(D.isArray(a))for(var b=D.fb(a),c=0;c<b;c++)this.Oy(D.La(a,c));else for(a=a.j;a.next();)this.Oy(a.value)};function lh(a,b){var c=a.zm(b),c=a.no(c);null===a.Ie(c)&&fh(a,c,b);c=a.Am(b);c=a.no(c);null===a.Ie(c)&&fh(a,c,b);var d=a.dl(b);if(D.isArray(d))for(var e=D.fb(d),g=0;g<e;g++)c=D.La(d,g),null===a.Ie(c)&&fh(a,c,b)}
D.defineProperty(X,{tL:"copyLinkDataFunction"},function(){return this.To},function(a){var b=this.To;b!==a&&(null!==a&&D.h(a,"function",X,"copyLinkDataFunction"),this.To=a,this.i("copyLinkDataFunction",b,a))});X.prototype.copyLinkData=X.prototype.Mx=function(a){if(null===a)return null;var b=null,b=this.To,b=null!==b?b(a,this):hh(this,a,!0);D.Qa(b)&&(D.xc(b),""!==this.oi&&D.Ua(b,this.oi,void 0),""!==this.pi&&D.Ua(b,this.pi,void 0),""!==this.Kg&&D.Ua(b,this.Kg,[]));return b};
D.defineProperty(X,{Mq:"nodeIsGroupProperty"},function(){return this.Ep},function(a){var b=this.Ep;b!==a&&(ah(a,X,"nodeIsGroupProperty"),this.Ep=a,this.i("nodeIsGroupProperty",b,a))});X.prototype.isGroupForNodeData=X.prototype.xB=function(a){if(null===a)return!1;var b=this.Ep;return""===b?!1:D.zb(a,b)?!0:!1};D.defineProperty(X,{fv:"nodeGroupKeyProperty"},function(){return this.Ch},function(a){var b=this.Ch;b!==a&&(ah(a,X,"nodeGroupKeyProperty"),this.Ch=a,this.i("nodeGroupKeyProperty",b,a))});
D.defineProperty(X,{Qn:"copiesGroupKeyOfNodeData"},function(){return this.Fr},function(a){this.Fr!==a&&(D.h(a,"boolean",X,"copiesGroupKeyOfNodeData"),this.Fr=a)});X.prototype.getGroupKeyForNodeData=X.prototype.Zn=function(a){if(null!==a){var b=this.Ch;if(""!==b&&(b=D.zb(a,b),void 0!==b)){if(bh(b))return b;D.k("GroupKey value for node data "+a+" is not a number or a string: "+b)}}};
X.prototype.setGroupKeyForNodeData=X.prototype.dC=function(a,b){null===b&&(b=void 0);void 0===b||bh(b)||D.mc(b,"number or string",X,"setGroupKeyForNodeData:key");if(null!==a){var c=this.Ch;if(""!==c)if(this.me(a)){var d=D.zb(a,c);d!==b&&(gh(this,d,a),D.Ua(a,c,b),null===this.Ie(b)&&fh(this,b,a),$g(this,"nodeGroupKey",eg,c,a,d,b),"string"===typeof c&&this.Rb(a,c))}else D.Ua(a,c,b)}};
X.prototype.copyNodeData=function(a){if(null===a)return null;a=M.prototype.copyNodeData.call(this,a);this.Qn||""===this.Ch||void 0===D.zb(a,this.Ch)||D.Ua(a,this.Ch,void 0);return a};
X.prototype.setDataProperty=function(a,b,c){v&&(D.h(a,"object",X,"setDataProperty:data"),D.h(b,"string",X,"setDataProperty:propname"),""===b&&D.k("GraphLinksModel.setDataProperty: property name must not be an empty string when setting "+a+" to "+c));if(this.me(a))if(b===this.Yj)this.Zy(a,c);else{if(b===this.vo){this.Xy(a,c);return}if(b===this.fv){this.dC(a,c);return}b===this.Mq&&D.k("GraphLinksModel.setDataProperty: property name must not be the nodeIsGroupProperty: "+b)}else if(this.Mh(a)){if(b===
this.lo){this.bC(a,c);return}if(b===this.mo){this.hC(a,c);return}if(b===this.Xu){this.cC(a,c);return}if(b===this.Zu){this.iC(a,c);return}if(b===this.Vj){this.cH(a,c);return}if(b===this.Wu){this.bH(a,c);return}if(b===this.Yu){this.dH(a,c);return}}else!kh&&a instanceof O&&(kh=!0,D.trace('GraphLinksModel.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),D.trace(" Is that really your intent?"));var d=D.zb(a,b);d!==c&&(D.Ua(a,b,c),this.RB(a,b,d,c))};f=X.prototype;
f.lv=function(a,b){M.prototype.lv.call(this,a,b);for(var c=this.Lc.j;c.next();)this.XB(c.value,a,b);for(c=this.ni.j;c.next();){var d=c.value,e=a,g=b;if(this.zm(d)===e){var h=this.oi;D.Ua(d,h,g);$g(this,"linkFromKey",eg,h,d,e,g);"string"===typeof h&&this.Rb(d,h)}this.Am(d)===e&&(h=this.pi,D.Ua(d,h,g),$g(this,"linkToKey",eg,h,d,e,g),"string"===typeof h&&this.Rb(d,h));h=this.dl(d);if(D.isArray(h))for(var k=D.fb(h),l=this.Kg,m=0;m<k;m++)D.La(h,m)===e&&(D.cF(h,m,g),$g(this,"linkLabelKeys",gg,l,d,e,g,m,
m))}};f.XB=function(a,b,c){if(this.Zn(a)===b){var d=this.Ch;D.Ua(a,d,c);$g(this,"nodeGroupKey",eg,d,a,b,c);"string"===typeof d&&this.Rb(a,d)}};f.vC=function(){M.prototype.vC.call(this);for(var a=this.Sh,b=D.fb(a),c=0;c<b;c++){var d=D.La(a,c);lh(this,d)}};
f.Uq=function(a){M.prototype.Uq.call(this,a);a=this.yb(a);var b=eh(this,a);if(null!==b){for(var c=new K(Object),b=b.j;b.next();){var d=b.value;if(this.me(d)){if(this.Zn(d)===a){var e=this.Ch;$g(this,"nodeGroupKey",eg,e,d,a,a);"string"===typeof e&&this.Rb(d,e);c.add(d)}}else if(this.zm(d)===a&&(e=this.oi,$g(this,"linkFromKey",eg,e,d,a,a),"string"===typeof e&&this.Rb(d,e),c.add(d)),this.Am(d)===a&&(e=this.pi,$g(this,"linkToKey",eg,e,d,a,a),"string"===typeof e&&this.Rb(d,e),c.add(d)),e=this.dl(d),D.isArray(e))for(var g=
D.fb(e),h=this.Kg,k=0;k<g;k++)D.La(e,k)===a&&($g(this,"linkLabelKeys",gg,h,d,a,a,k,k),c.add(d))}for(c=c.j;c.next();)gh(this,a,c.value)}};f.Tq=function(a){M.prototype.Tq.call(this,a);var b=this.Zn(a);null===this.Ie(b)&&fh(this,b,a)};f.Av=function(a){M.prototype.Av.call(this,a);var b=this.Zn(a);gh(this,b,a)};D.defineProperty(X,{Wu:"linkCategoryProperty"},function(){return this.jn},function(a){var b=this.jn;b!==a&&(ah(a,X,"linkCategoryProperty"),this.jn=a,this.i("linkCategoryProperty",b,a))});
X.prototype.getCategoryForLinkData=X.prototype.vq=function(a){if(null===a)return"";var b=this.jn;if(""===b)return"";b=D.zb(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""};
X.prototype.setCategoryForLinkData=X.prototype.bH=function(a,b){D.h(b,"string",X,"setCategoryForLinkData:cat");if(null!==a){var c=this.jn;if(""!==c)if(this.Mh(a)){var d=D.zb(a,c);void 0===d&&(d="");d!==b&&(D.Ua(a,c,b),$g(this,"linkCategory",eg,c,a,d,b),"string"===typeof c&&this.Rb(a,c))}else D.Ua(a,c,b)}};
function Ag(a){1<arguments.length&&D.k("TreeModel constructor can only take one optional argument, the Array of node data.");M.call(this);this.Dh="parent";this.Gr=!1;this.sn="parentLinkCategory";void 0!==a&&(this.ah=a)}D.Ta(Ag,M);D.ka("TreeModel",Ag);Ag.prototype.cloneProtected=function(a){M.prototype.cloneProtected.call(this,a);a.Dh=this.Dh;a.Gr=this.Gr;a.sn=this.sn};
Ag.prototype.toString=function(a){void 0===a&&(a=0);if(2<=a)return this.oC();var b=(""!==this.name?this.name:"")+" TreeModel";if(0<a){b+="\n node data:";a=this.ah;for(var c=D.fb(a),d=0;d<c;d++)var e=D.La(a,d),b=b+(" "+this.yb(e)+":"+ha(e))}return b};Ag.prototype.Go=function(){var a=M.prototype.Go.call(this),b="";"parent"!==this.gv&&"string"===typeof this.gv&&(b+=',\n "nodeParentKeyProperty": '+this.quote(this.gv));return a+b};
Ag.prototype.jv=function(a){M.prototype.jv.call(this,a);a.nodeParentKeyProperty&&(this.gv=a.nodeParentKeyProperty)};Ag.prototype.no=function(a){return a};D.defineProperty(Ag,{gv:"nodeParentKeyProperty"},function(){return this.Dh},function(a){var b=this.Dh;b!==a&&(ah(a,Ag,"nodeParentKeyProperty"),this.Dh=a,this.i("nodeParentKeyProperty",b,a))});
D.defineProperty(Ag,{Rn:"copiesParentKeyOfNodeData"},function(){return this.Gr},function(a){this.Gr!==a&&(D.h(a,"boolean",Ag,"copiesParentKeyOfNodeData"),this.Gr=a)});Ag.prototype.getParentKeyForNodeData=Ag.prototype.ao=function(a){if(null!==a){var b=this.Dh;if(""!==b&&(b=D.zb(a,b),void 0!==b)){if(bh(b))return b;D.k("ParentKey value for node data "+a+" is not a number or a string: "+b)}}};
Ag.prototype.setParentKeyForNodeData=Ag.prototype.Li=function(a,b){null===b&&(b=void 0);void 0===b||bh(b)||D.mc(b,"number or string",Ag,"setParentKeyForNodeData:key");if(null!==a){var c=this.Dh;if(""!==c)if(b=this.no(b),this.me(a)){var d=D.zb(a,c);d!==b&&(gh(this,d,a),D.Ua(a,c,b),null===this.Ie(b)&&fh(this,b,a),$g(this,"nodeParentKey",eg,c,a,d,b),"string"===typeof c&&this.Rb(a,c))}else D.Ua(a,c,b)}};
D.defineProperty(Ag,{wM:"parentLinkCategoryProperty"},function(){return this.sn},function(a){var b=this.sn;b!==a&&(ah(a,Ag,"parentLinkCategoryProperty"),this.sn=a,this.i("parentLinkCategoryProperty",b,a))});Ag.prototype.getParentLinkCategoryForNodeData=Ag.prototype.XI=function(a){if(null===a)return"";var b=this.sn;if(""===b)return"";b=D.zb(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""};
Ag.prototype.setParentLinkCategoryForNodeData=Ag.prototype.sK=function(a,b){D.h(b,"string",Ag,"setParentLinkCategoryForNodeData:cat");if(null!==a){var c=this.sn;if(""!==c)if(this.me(a)){var d=D.zb(a,c);void 0===d&&(d="");d!==b&&(D.Ua(a,c,b),$g(this,"parentLinkCategory",eg,c,a,d,b),"string"===typeof c&&this.Rb(a,c))}else D.Ua(a,c,b)}};
Ag.prototype.copyNodeData=function(a){if(null===a)return null;a=M.prototype.copyNodeData.call(this,a);this.Rn||""===this.Dh||void 0===D.zb(a,this.Dh)||D.Ua(a,this.Dh,void 0);return a};
Ag.prototype.setDataProperty=function(a,b,c){v&&(D.h(a,"object",Ag,"setDataProperty:data"),D.h(b,"string",Ag,"setDataProperty:propname"),""===b&&D.k("TreeModel.setDataProperty: property name must not be an empty string when setting "+a+" to "+c));if(this.me(a))if(b===this.Yj)this.Zy(a,c);else{if(b===this.vo){this.Xy(a,c);return}if(b===this.gv){this.Li(a,c);return}}else!kh&&a instanceof O&&(kh=!0,D.trace('TreeModel.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),D.trace(" Is that really your intent?"));
var d=D.zb(a,b);d!==c&&(D.Ua(a,b,c),this.RB(a,b,d,c))};f=Ag.prototype;f.lv=function(a,b){M.prototype.lv.call(this,a,b);for(var c=this.Lc.j;c.next();)this.XB(c.value,a,b)};f.XB=function(a,b,c){if(this.ao(a)===b){var d=this.Dh;D.Ua(a,d,c);$g(this,"nodeParentKey",eg,d,a,b,c);"string"===typeof d&&this.Rb(a,d)}};
f.Uq=function(a){M.prototype.Uq.call(this,a);a=this.yb(a);var b=eh(this,a);if(null!==b){for(var c=new K(Object),b=b.j;b.next();){var d=b.value;if(this.me(d)&&this.ao(d)===a){var e=this.Dh;$g(this,"nodeParentKey",eg,e,d,a,a);"string"===typeof e&&this.Rb(d,e);c.add(d)}}for(c=c.j;c.next();)gh(this,a,c.value)}};f.Tq=function(a){M.prototype.Tq.call(this,a);var b=this.ao(a),b=this.no(b);null===this.Ie(b)&&fh(this,b,a)};f.Av=function(a){M.prototype.Av.call(this,a);var b=this.ao(a);gh(this,b,a)};
function oh(a,b,c){D.xc(this);this.J=!1;void 0===a?a="":D.h(a,"string",oh,"constructor:targetprop");void 0===b?b=a:D.h(b,"string",oh,"constructor:sourceprop");void 0===c?c=null:null!==c&&D.h(c,"function",oh,"constructor:conv");this.yE=-1;this.Sg=null;this.Zp=a;this.Yp=this.Vt=0;this.mx=null;this.ys=!1;this.Pp=b;this.Cr=c;this.Ss=ph;this.vr=null;this.Vz=new L}D.ka("Binding",oh);
oh.prototype.copy=function(){var a=new oh;a.Zp=this.Zp;a.Vt=this.Vt;a.Yp=this.Yp;a.mx=this.mx;a.ys=this.ys;a.Pp=this.Pp;a.Cr=this.Cr;a.Ss=this.Ss;a.vr=this.vr;return a};var ph;oh.OneWay=ph=D.s(oh,"OneWay",1);var qh;oh.TwoWay=qh=D.s(oh,"TwoWay",2);oh.parseEnum=function(a,b){D.h(a,"function",oh,"parseEnum:ctor");D.Da(b,a,oh,"parseEnum:defval");return function(c){c=Ga(a,c);return null===c?b:c}};oh.prototype.qc=function(a){a.Se===oh?this.mode=a:D.ck(this,a)};var ha;
oh.toString=ha=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()};oh.prototype.toString=function(){return"Binding("+this.wv+":"+this.gH+(-1!==this.Nm?" "+this.Nm:"")+" "+this.mode.name+")"};oh.prototype.freeze=function(){this.J=!0;return this};
oh.prototype.Xa=function(){this.J=!1;return this};D.defineProperty(oh,{Nm:null},function(){return this.yE},function(a){this.J&&D.qa(this);D.h(a,"number",oh,"targetId");this.yE=a});D.defineProperty(oh,{wv:"targetProperty"},function(){return this.Zp},function(a){this.J&&D.qa(this);D.h(a,"string",oh,"targetProperty");this.Zp=a});D.defineProperty(oh,{dr:"sourceName"},function(){return this.mx},function(a){this.J&&D.qa(this);null!==a&&D.h(a,"string",oh,"sourceName");this.mx=a;null!==a&&(this.ys=!1)});
D.defineProperty(oh,{py:"isToModel"},function(){return this.ys},function(a){this.J&&D.qa(this);D.h(a,"boolean",oh,"isToModel");this.ys=a});D.defineProperty(oh,{gH:"sourceProperty"},function(){return this.Pp},function(a){this.J&&D.qa(this);D.h(a,"string",oh,"sourceProperty");this.Pp=a});D.defineProperty(oh,{qI:"converter"},function(){return this.Cr},function(a){this.J&&D.qa(this);null!==a&&D.h(a,"function",oh,"converter");this.Cr=a});
D.defineProperty(oh,{fI:"backConverter"},function(){return this.vr},function(a){this.J&&D.qa(this);null!==a&&D.h(a,"function",oh,"backConverter");this.vr=a});D.defineProperty(oh,{mode:"mode"},function(){return this.Ss},function(a){this.J&&D.qa(this);D.Da(a,oh,oh,"mode");this.Ss=a});oh.prototype.makeTwoWay=oh.prototype.GJ=function(a){void 0===a&&(a=null);null!==a&&D.h(a,"function",oh,"makeTwoWay");this.mode=qh;this.fI=a;return this};
oh.prototype.ofObject=oh.prototype.Dy=function(a){void 0===a&&(a="");v&&D.h(a,"string",oh,"ofObject:srcname");this.dr=a;this.py=!1;return this};oh.prototype.ofModel=function(){this.dr=null;this.py=!0;return this};function rh(a,b,c){a=a.dr;var d=null;return d=null===a||""===a?b:"/"===a?c.$:"."===a?c:".."===a?c.Q:b.Md(a)}
oh.prototype.updateTarget=oh.prototype.xH=function(a,b,c){var d=this.Pp;if(void 0===c||""===d||d===c){c=this.Zp;var e=this.Cr;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.jy(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.zb(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)}}}};
oh.prototype.updateSource=oh.prototype.bz=function(a,b,c,d){if(this.Ss===qh){var e=this.Zp;if(void 0===c||e===c){c=this.Pp;var g=this.vr,h=a;""!==e&&(h=D.zb(a,e));if(void 0!==h&&!this.Vz.contains(a))try{this.Vz.add(a);var k=null!==d?d.g:null,l=null!==k?k.ea:null;if(null===g)if(""!==c)null!==l?(v&&l.Yj===c&&l.me(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.Uu&&null!==d.Q&&
Array.isArray(d.Q.kl)){var m=d.Uu,n=d.Q.kl;l.IG(n,m);l.rB(n,m,h)}}else try{if(""!==c){var p=g(h,b,l);null!==l?(v&&(l.Yj===c&&l.me(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.Uu&&null!==d.Q&&Array.isArray(d.Q.kl)&&
(m=d.Uu,n=d.Q.kl,l.IG(n,m),l.rB(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.Vz.remove(a)}}}};function Bg(){this.DH=(new K(dg)).freeze();this.ac="";this.FD=!1}D.ka("Transaction",Bg);
Bg.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.fg.count.toString()+(this.Nu?"":", 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};Bg.prototype.clear=Bg.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()};Bg.prototype.canUndo=Bg.prototype.canUndo=function(){return this.Nu};
Bg.prototype.undo=Bg.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()}};Bg.prototype.canRedo=Bg.prototype.canRedo=function(){return this.Nu};Bg.prototype.redo=Bg.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(Bg,{fg:"changes"},function(){return this.DH});D.defineProperty(Bg,{name:"name"},function(){return this.ac},function(a){this.ac=a});
D.defineProperty(Bg,{Nu:"isComplete"},function(){return this.FD},function(a){this.FD=a});function sg(){this.jA=new L(M);this.rf=!1;this.HH=(new K(Bg)).freeze();this.sh=-1;this.UD=999;this.vh=!1;this.aw=null;this.gm=0;this.Az=!1;v&&(this.Az=!0);this.Bh=(new K("string")).freeze();this.Dp=new K("number");this.Wz=!0;this.eA=!1}D.ka("UndoManager",sg);
sg.prototype.toString=function(a){for(var b="UndoManager "+this.Nj+"<"+this.history.count+"<="+this.vG,b=b+"[",c=this.AG.count,d=0;d<c;d++)0<d&&(b+=" "),b+=this.AG.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};
sg.prototype.clear=sg.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.sh=-1;a.freeze();this.vh=!1;this.aw=null;this.gm=0;this.Bh.Xa();this.Bh.clear();this.Bh.freeze();this.Dp.clear()};sg.prototype.addModel=sg.prototype.ZH=function(a){this.jA.add(a)};sg.prototype.removeModel=sg.prototype.fK=function(a){this.jA.remove(a)};
sg.prototype.startTransaction=sg.prototype.Qb=function(a){void 0===a&&(a="");null===a&&(a="");if(this.ub)return!1;!0===this.Wz&&(this.Wz=!1,this.gm++,this.vd("StartingFirstTransaction",a,this.Jj),0<this.gm&&this.gm--);this.isEnabled&&(this.Bh.Xa(),this.Bh.add(a),this.Bh.freeze(),null===this.Jj?this.Dp.add(0):this.Dp.add(this.Jj.fg.count));this.gm++;var b=1===this.Oi;b&&this.vd("StartedTransaction",a,this.Jj);return b};
sg.prototype.commitTransaction=sg.prototype.ld=function(a){void 0===a&&(a="");return sh(this,!0,a)};sg.prototype.rollbackTransaction=sg.prototype.Hm=function(){return sh(this,!1,"")};
function sh(a,b,c){if(a.ub)return!1;a.OA&&1>a.Oi&&D.trace("Ending transaction without having started a transaction: "+c);var d=1===a.Oi;d&&b&&a.vd("CommittingTransaction",c,a.Jj);var e=0;if(0<a.Oi&&(a.gm--,a.isEnabled)){var g=a.Bh.count;0<g&&(""===c&&(c=a.Bh.fa(0)),a.Bh.Xa(),a.Bh.qd(g-1),a.Bh.freeze());g=a.Dp.count;0<g&&(e=a.Dp.fa(g-1),a.Dp.qd(g-1))}g=a.Jj;if(d){if(b){a.eA=!1;if(a.isEnabled&&null!==g){b=g;b.Nu=!0;b.name=c;d=a.history;d.Xa();for(e=d.count-1;e>a.Nj;e--)g=d.fa(e),null!==g&&g.clear(),
d.qd(e),a.eA=!0;e=a.vG;0===e&&(e=1);0<e&&d.count>=e&&(g=d.fa(0),null!==g&&g.clear(),d.qd(0),a.sh--);d.add(b);a.sh++;d.freeze();g=b}a.vd("CommittedTransaction",c,g)}else{a.vh=!0;try{a.isEnabled&&null!==g&&(g.Nu=!0,g.undo())}finally{a.vd("RolledBackTransaction",c,g),a.vh=!1}null!==g&&g.clear()}a.aw=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.qd(b);c.freeze()}return!1}
sg.prototype.canUndo=sg.prototype.canUndo=function(){if(!this.isEnabled||0<this.Oi)return!1;var a=this.tH;return null!==a&&a.canUndo()?!0:!1};sg.prototype.undo=sg.prototype.undo=function(){if(this.canUndo()){var a=this.tH;try{this.vh=!0,this.vd("StartingUndo","Undo",a),this.sh--,a.undo()}catch(b){D.trace("undo error: "+b.toString())}finally{this.vd("FinishedUndo","Undo",a),this.vh=!1}}};
sg.prototype.canRedo=sg.prototype.canRedo=function(){if(!this.isEnabled||0<this.Oi)return!1;var a=this.sH;return null!==a&&a.canRedo()?!0:!1};sg.prototype.redo=sg.prototype.redo=function(){if(this.canRedo()){var a=this.sH;try{this.vh=!0,this.vd("StartingRedo","Redo",a),this.sh++,a.redo()}catch(b){D.trace("redo error: "+b.toString())}finally{this.vd("FinishedRedo","Redo",a),this.vh=!1}}};
sg.prototype.vd=function(a,b,c){void 0===c&&(c=null);var d=new dg;d.Pc=fg;d.propertyName=a;d.object=c;d.oldValue=b;for(a=this.QJ;a.next();)b=a.value,d.ea=b,b.Jx(d)};sg.prototype.handleChanged=sg.prototype.YF=function(a){if(this.isEnabled&&!this.ub&&!this.skipsEvent(a)){var b=this.Jj;null===b&&(this.aw=b=new Bg);var c=a.copy(),b=b.fg;b.Xa();b.add(c);b.freeze();this.OA&&0>=this.Oi&&!this.Wz&&(a=a.g,null!==a&&!1===a.ho||D.trace("Change not within a transaction: "+c.toString()))}};
sg.prototype.skipsEvent=function(a){if(null===a||0>a.Pc.value)return!0;a=a.object;if(a instanceof O){if(a=a.layer,null!==a&&a.Sc)return!0}else if(a instanceof Gg&&a.Sc)return!0;return!1};D.w(sg,{QJ:"models"},function(){return this.jA.j});D.defineProperty(sg,{isEnabled:"isEnabled"},function(){return this.rf},function(a){this.rf=a});D.w(sg,{tH:"transactionToUndo"},function(){return 0<=this.Nj&&this.Nj<=this.history.count-1?this.history.fa(this.Nj):null});
D.w(sg,{sH:"transactionToRedo"},function(){return this.Nj<this.history.count-1?this.history.fa(this.Nj+1):null});D.w(sg,{ub:"isUndoingRedoing"},function(){return this.vh});D.w(sg,{history:"history"},function(){return this.HH});D.defineProperty(sg,{vG:"maxHistoryLength"},function(){return this.UD},function(a){this.UD=a});D.w(sg,{Nj:"historyIndex"},function(){return this.sh});D.w(sg,{Jj:"currentTransaction"},function(){return this.aw});D.w(sg,{Oi:"transactionLevel"},function(){return this.gm});
D.w(sg,{jG:"isInTransaction"},function(){return 0<this.gm});D.defineProperty(sg,{OA:"checksTransactionLevel"},function(){return this.Az},function(a){this.Az=a});D.w(sg,{AG:"nestedTransactionNames"},function(){return this.Bh});function pa(){0<arguments.length&&D.zd(pa);D.xc(this);this.ca=null;this.SC=!1;this.mD=this.TC=!0;this.VC=this.WC=this.nD=this.XC=!1;this.Xl=this.uz=null;this.PE=1.05;this.jD=1;this.fA=NaN;this.RD=null;this.JA=NaN;this.IA=Kd;this.xj=null;this.oE=0}D.ka("CommandHandler",pa);
var th=null,uh="";pa.prototype.toString=function(){return"CommandHandler"};D.w(pa,{g:"diagram"},function(){return this.ca});pa.prototype.cd=function(a){v&&null!==a&&D.l(a,E,pa,"setDiagram");this.ca=a};
pa.prototype.doKeyDown=function(){var a=this.g;if(null!==a){var b=a.U,c=D.Rh?b.av: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.De&&(c?a.scroll("pixel","up"):a.scroll("line","up")):"Down"===g?a.De&&(c?a.scroll("pixel","down"):a.scroll("line","down")):"Left"===g?a.Ce&&(c?a.scroll("pixel","left"):a.scroll("line","left")):"Right"===g?a.Ce&&(c?a.scroll("pixel","right"):a.scroll("line","right")):"PageUp"===g?d&&a.Ce?a.scroll("page","left"):a.De&&a.scroll("page","up"):"PageDown"===g?d&&a.Ce?a.scroll("page","right"):a.De&&a.scroll("page","down"):"Home"===
g?c&&a.De?a.scroll("document","up"):!c&&a.Ce&&a.scroll("document","left"):"End"===g?c&&a.De?a.scroll("document","down"):!c&&a.Ce&&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()}};pa.prototype.doKeyUp=function(){var a=this.g;null!==a&&(a.U.bubbles=!0)};pa.prototype.stopCommand=function(){var a=this.g;if(null!==a){var b=a.cb;b instanceof Ph&&a.Kf&&a.PA();null!==b&&b.doCancel()}};pa.prototype.canStopCommand=function(){return!0};
pa.prototype.selectAll=function(){var a=this.g;if(null!==a){a.ra();try{a.sc="wait";a.Ka("ChangingSelection");for(var b=a.Wh;b.next();)b.value.mb=!0;for(var c=a.rg;c.next();)c.value.mb=!0;for(var d=a.links;d.next();)d.value.mb=!0}finally{a.Ka("ChangedSelection"),a.sc=""}}};pa.prototype.canSelectAll=function(){var a=this.g;return null!==a&&a.Kf};
pa.prototype.deleteSelection=function(){var a=this.g;if(null!==a&&!a.Ka("SelectionDeleting",a.selection))try{a.sc="wait";a.Qb("Delete");a.Ka("ChangingSelection");for(var b=new L(F),c=a.selection.j;c.next();)Qh(b,c.value,!0,this.zI?Infinity:0,this.vF?null:!1,function(a){return a.canDelete()});a.WB(b,!0);a.Ka("SelectionDeleted",b)}finally{a.Ka("ChangedSelection"),a.ld("Delete"),a.sc=""}};
pa.prototype.canDeleteSelection=function(){var a=this.g;return null===a||a.sb||a.Nf||!a.Jn||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 ca))if(a.add(b),b instanceof H){if(c&&b instanceof I)for(var h=b.lc;h.next();)Qh(a,h.value,c,d,e,g);if(!1!==e)for(h=b.Od;h.next();){var k=h.value;if(!a.contains(k)){var l=k.Z,m=k.ba,l=null===l||a.contains(l),m=null===m||a.contains(m);(e?l&&m:l||m)&&Qh(a,k,c,d,e,g)}}if(1<d)for(b=b.JF();b.next();)Qh(a,b.value,c,d-1,e,g)}else if(b instanceof J)for(b=b.Bf;b.next();)Qh(a,b.value,c,d,e,g)}
pa.prototype.mq=function(a,b,c){var d=new ma(F,F);for(a=a.j;a.next();)Rh(this,a.value,b,d,c);if(null!==b){c=b.ea;a=!1;null!==b.bb.pe&&(a=b.bb.pe.Lj);for(var e=new L(J),g=new ma(J,J),h=d.j;h.next();){var k=h.value;if(k instanceof J){var l=k;a||null!==l.Z&&null!==l.ba||e.add(l)}else if(c instanceof Ag&&k instanceof H&&null!==k.data){var l=c,m=k,k=h.key,n=k.al();null!==n&&(n=d.oa(n),null!==n?(l.Li(m.data,l.yb(n.data)),l=b.hg(m.data),k=k.Xn(),null!==k&&null!==l&&g.add(k,l)):l.Li(m.data,void 0))}}0<e.count&&
b.WB(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.ea,c=b.aI,null!==c)){var p=new ma;d.each(function(a){null!==a.key.data&&p.add(a.key.data,a.value.data)});c(p,b,this.g.ea)}for(b=d.j;b.next();)b.value.Rb();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.ea;b instanceof J?k instanceof X&&(h=k.Mx(h),D.Qa(h)&&(k.gu(h),g=c.hg(h))):(h=k.copyNodeData(h),D.Qa(h)&&(k.jm(h),g=c.Oh(h)))}else Sh(b),g=b.copy(),null!==g&&(null!==c?c.add(g):null!==h&&null!==a.g&&a.rI&&(k=a.g.ea,h=g instanceof J&&k instanceof X?k.Mx(h):k.copyNodeData(h),D.Qa(h)&&(g.data=h)));if(!(g instanceof F))return null;g.mb=!1;g.Zg=!1;d.add(b,g);
if(b instanceof H){for(h=b.Od;h.next();){k=h.value;if(k.Z===b){var l=d.oa(k);null!==l&&(l.Z=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.lc;b.next();)k=Rh(a,b.value,c,d,e),k instanceof J||null===k||(k.Ja=h)}else if(b instanceof J&&g instanceof J)for(h=b.Z,null!==h&&(h=d.oa(h),null!==h&&(g.Z=h)),h=b.ba,null!==h&&(h=d.oa(h),null!==h&&(g.ba=h)),b=b.Bf;b.next();)h=Rh(a,b.value,c,d,e),null!==h&&h instanceof H&&(h.Zb=g);return g}
pa.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.uI?Infinity:0,this.sI,function(a){return a.canCopy()});this.copyToClipboard(b)}};pa.prototype.canCopySelection=function(){var a=this.g;return null!==a&&a.Tk&&a.KA&&0!==a.selection.count?!0:!1};pa.prototype.cutSelection=function(){this.copySelection();this.deleteSelection()};
pa.prototype.canCutSelection=function(){var a=this.g;return null!==a&&!a.sb&&!a.Nf&&a.Tk&&a.Jn&&a.KA&&0!==a.selection.count?!0:!1};pa.prototype.copyToClipboard=function(a){var b=this.g;if(null!==b){var c=null;if(null===a)th=null,uh="";else{var c=b.ea,d=!1,e=!1,g=null;try{if(c instanceof Ag){var h=c,d=h.Rn;h.Rn=this.mF}c instanceof X&&(h=c,e=h.Qn,h.Qn=this.lF);g=b.mq(a,null,!0)}finally{c instanceof Ag&&(c.Rn=d),c instanceof X&&(c.Qn=e),c=new K(F),c.Yc(g),th=c,uh=b.ea.tm}}b.Ka("ClipboardChanged",c)}};
pa.prototype.pasteFromClipboard=function(){var a=new L(F),b=th;if(null===b)return a;var c=this.g;if(null===c||uh!==c.ea.tm)return a;var d=c.ea,e=!1,g=!1,h=null;try{if(d instanceof Ag){var k=d,e=k.Rn;k.Rn=this.mF}d instanceof X&&(k=d,g=k.Qn,k.Qn=this.lF);h=c.mq(b,c,!1)}finally{for(d instanceof Ag&&(d.Rn=e),d instanceof X&&(d.Qn=g),b=h.j;b.next();)c=b.value,d=b.key,c.location.F()||(d.location.F()?c.location=d.location:!c.position.F()&&d.position.F()&&(c.position=d.position)),a.add(c)}return a};
pa.prototype.pasteSelection=function(a){void 0===a&&(a=null);var b=this.g;if(null!==b)try{b.sc="wait";b.Qb("Paste");b.Ka("ChangingSelection");var c=this.pasteFromClipboard();0<c.count&&Th(b);for(var d=c.j;d.next();)d.value.mb=!0;b.Ka("ChangedSelection");if(null!==a){var e=b.computePartsBounds(b.selection);if(e.F()){var g=b.bb.pe;null===g&&(g=new Uh,g.cd(b));var h=g.computeEffectiveCollection(b.selection);g.moveParts(h,new N(a.x-e.pa,a.y-e.wa),!1)}}b.Ka("ClipboardPasted",c)}finally{b.ld("Paste"),b.sc=
""}};pa.prototype.canPasteSelection=function(){var a=this.g;return null===a||a.sb||a.Nf||!a.dq||!a.KA||null===th||0===th.count||uh!==a.ea.tm?!1:!0};pa.prototype.undo=function(){var a=this.g;null!==a&&a.na.undo()};pa.prototype.canUndo=function(){var a=this.g;return null===a||a.sb||a.Nf?!1:a.YE&&a.na.canUndo()};pa.prototype.redo=function(){var a=this.g;null!==a&&a.na.redo()};pa.prototype.canRedo=function(){var a=this.g;return null===a||a.sb||a.Nf?!1:a.YE&&a.na.canRedo()};
pa.prototype.decreaseZoom=function(a){void 0===a&&(a=1/this.ez);D.p(a,pa,"decreaseZoom:factor");var b=this.g;null!==b&&b.om===Vh&&(a*=b.scale,a<b.Uh||a>b.Th||(b.scale=a))};pa.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.ez);D.p(a,pa,"canDecreaseZoom:factor");var b=this.g;if(null===b||b.om!==Vh)return!1;a*=b.scale;return a<b.Uh||a>b.Th?!1:b.Ix};
pa.prototype.increaseZoom=function(a){void 0===a&&(a=this.ez);D.p(a,pa,"increaseZoom:factor");var b=this.g;null!==b&&b.om===Vh&&(a*=b.scale,a<b.Uh||a>b.Th||(b.scale=a))};pa.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.ez);D.p(a,pa,"canIncreaseZoom:factor");var b=this.g;if(null===b||b.om!==Vh)return!1;a*=b.scale;return a<b.Uh||a>b.Th?!1:b.Ix};pa.prototype.resetZoom=function(a){void 0===a&&(a=this.Qx);D.p(a,pa,"resetZoom:newscale");var b=this.g;null===b||a<b.Uh||a>b.Th||(b.scale=a)};
pa.prototype.canResetZoom=function(a){void 0===a&&(a=this.Qx);D.p(a,pa,"canResetZoom:newscale");var b=this.g;return null===b||a<b.Uh||a>b.Th?!1:b.Ix};pa.prototype.zoomToFit=function(){var a=this.g;if(null!==a){var b=a.scale,c=a.position;b===this.JA&&!isNaN(this.fA)&&a.Qc.P(this.IA)?(a.scale=this.fA,a.position=this.RD,this.JA=NaN,this.IA=Kd):(this.fA=b,this.RD=c.copy(),a.zoomToFit(),this.JA=a.scale,this.IA=a.Qc.copy())}};pa.prototype.canZoomToFit=function(){var a=this.g;return null===a?!1:a.Ix};
pa.prototype.scrollToPart=function(a){void 0===a&&(a=null);null!==a&&D.l(a,F,pa,"part");var b=this.g;if(null!==b){if(null===a){try{null!==this.xj&&(this.xj.next()?a=this.xj.value:this.xj=null)}catch(c){this.xj=null}null===a&&(0<b.Bm.count?this.xj=b.Bm.j:0<b.selection.count&&(this.xj=b.selection.j),null!==this.xj&&this.xj.next()&&(a=this.xj.value))}if(null!==a){var d=b.Ra;d.wo("Scroll To Part");var e=this.nK;if(0<e){var g=Wh(this,a,[a]),h=function(){b.Qb();for(var a=g.pop();0<g.length&&a instanceof
H&&a.Fc&&(!(a instanceof I)||a.nd);)a=g.pop();0<g.length?(a instanceof F&&b.WG(a.Y),a instanceof H&&!a.Fc&&(a.Fc=!0),a instanceof I&&!a.nd&&(a.nd=!0)):(a instanceof F&&b.eF(a.Y),b.VB("LayoutCompleted",k));b.ld("Scroll To Part")},k=function(){setTimeout(h,(d.isEnabled?d.duration:0)+e)};b.Ax("LayoutCompleted",k);h()}else{var l=b.position.copy();b.eF(a.Y);l.Zc(b.position)&&d.ai()}}}};
function Wh(a,b,c){if(b.isVisible())return c;if(b instanceof ca)Wh(a,b.hf,c);else if(b instanceof J){var d=b.Z;null!==d&&Wh(a,d,c);b=b.ba;null!==b&&Wh(a,b,c)}else b instanceof H&&(d=b.Zb,null!==d&&Wh(a,d,c),d=b.al(),null!==d&&(d.Fc||d.fr||c.push(d),Wh(a,d,c))),b=b.Ja,null!==b&&(b.nd||b.dz||c.push(b),Wh(a,b,c));return c}pa.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.Bm.count?!1:a.Ce&&a.De};
pa.prototype.collapseTree=function(a){void 0===a&&(a=null);var b=this.g;if(null!==b)try{b.Qb("Collapse Tree");b.Ra.wo("Collapse Tree");var c=new K(H);if(null!==a&&a.Fc)a.collapseTree(),c.add(a);else for(var d=b.selection.j;d.next();){var e=d.value;e instanceof H&&(a=e,a.Fc&&(a.collapseTree(),c.add(a)))}b.Ka("TreeCollapsed",c)}finally{b.ld("Collapse Tree")}};
pa.prototype.canCollapseTree=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.sb)return!1;if(null!==a){if(!(a instanceof H&&a.Fc))return!1;if(0<a.ey().count)return!0}else for(a=b.selection.j;a.next();)if(b=a.value,b instanceof H&&b.Fc&&0<b.ey().count)return!0;return!1};
pa.prototype.expandTree=function(a){void 0===a&&(a=null);var b=this.g;if(null!==b)try{b.Qb("Expand Tree");b.Ra.wo("Expand Tree");var c=new K(H);if(null===a||a.Fc)for(var d=b.selection.j;d.next();){var e=d.value;e instanceof H&&(a=e,a.Fc||(a.expandTree(),c.add(a)))}else a.expandTree(),c.add(a);b.Ka("TreeExpanded",c)}finally{b.ld("Expand Tree")}};
pa.prototype.canExpandTree=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.sb)return!1;if(null!==a){if(!(a instanceof H)||a.Fc)return!1;if(0<a.ey().count)return!0}else for(a=b.selection.j;a.next();)if(b=a.value,b instanceof H&&!b.Fc&&0<b.ey().count)return!0;return!1};
pa.prototype.groupSelection=function(){var a=this.g;if(null!==a){var b=a.ea;if(b instanceof X){var c=this.ZE;if(null!==c){var d=null;try{a.sc="wait";a.Qb("Group");a.Ka("ChangingSelection");for(var e=new K(F),g=a.selection.j;g.next();){var h=g.value;h.te()&&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.Ji(n.value)){g=!0;break}g||k.add(m)}if(0<k.count){var p=k.first().Ja;if(null!==p)for(;null!==p;){for(var e=!1,q=k.j;q.next();)if(!q.value.Ji(p)){e=
!0;break}if(e)p=p.Ja;else break}if(c instanceof I)Sh(c),d=c.copy(),null!==d&&a.add(d);else if(b.xB(c)){var r=b.copyNodeData(c);D.Qa(r)&&(b.jm(r),d=a.by(r))}if(null!==d){null!==p&&this.isValidMember(p,d)&&(d.Ja=p);for(var s=k.j;s.next();){var t=s.value;this.isValidMember(d,t)&&(t.Ja=d)}a.select(d)}}a.Ka("ChangedSelection");a.Ka("SelectionGrouped",d)}finally{a.ld("Group"),a.sc=""}}}}};
pa.prototype.canGroupSelection=function(){var a=this.g;if(null===a||a.sb||a.Nf||!a.dq||!a.Dx||!(a.ea instanceof X)||null===this.ZE)return!1;for(a=a.selection.j;a.next();){var b=a.value;if(b.te()&&b.canGroup())return!0}return!1};function Xh(a){var b=D.hb();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.Ji(b[h])){g=!1;break}g&&a.add(e)}D.ua(b);return a}
pa.prototype.isValidMember=function(a,b){if(null===b||a===b||b instanceof J)return!1;if(null!==a){if(a===b||a.Ji(b))return!1;var c=a.GB;if(null!==c&&!c(a,b)||null===a.data&&null!==b.data||null!==a.data&&null===b.data)return!1}c=this.GB;return null!==c?c(a,b):!0};
pa.prototype.ungroupSelection=function(a){void 0===a&&(a=null);var b=this.g;if(null!==b){var c=b.ea;if(c instanceof X)try{b.sc="wait";b.Qb("Ungroup");b.Ka("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.PA();for(var h=d.j;h.next();){var k=h.value;k.expandSubGraph();var l=k.Ja,m=null!==l&&null!==l.data?c.yb(l.data):void 0,n=new K(F);n.Yc(k.lc);for(var p=n.j;p.next();){var q=
p.value;q.mb=!0;if(!(q instanceof J)){var r=q.data;null!==r?c.dC(r,m):q.Ja=l}}b.remove(k)}}b.Ka("ChangedSelection");b.Ka("SelectionUngrouped",d,n)}finally{b.ld("Ungroup"),b.sc=""}}};pa.prototype.canUngroupSelection=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.sb||b.Nf||!b.Jn||!b.Hx||!(b.ea instanceof X))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};
pa.prototype.addTopLevelParts=function(a,b){for(var c=!0,d=Xh(a).j;d.next();){var e=d.value;null!==e.Ja&&(!b||this.isValidMember(null,e)?e.Ja=null:c=!1)}return c};
pa.prototype.collapseSubGraph=function(a){void 0===a&&(a=null);var b=this.g;if(null!==b)try{b.Qb("Collapse SubGraph");b.Ra.wo("Collapse SubGraph");var c=new K(I);if(null!==a&&a.nd)a.collapseSubGraph(),c.add(a);else for(var d=b.selection.j;d.next();){var e=d.value;e instanceof I&&(a=e,a.nd&&(a.collapseSubGraph(),c.add(a)))}b.Ka("SubGraphCollapsed",c)}finally{b.ld("Collapse SubGraph")}};
pa.prototype.canCollapseSubGraph=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.sb)return!1;if(null!==a)return a instanceof I&&a.nd?!0:!1;for(a=b.selection.j;a.next();)if(b=a.value,b instanceof I&&b.nd)return!0;return!1};
pa.prototype.expandSubGraph=function(a){void 0===a&&(a=null);var b=this.g;if(null!==b)try{b.Qb("Expand SubGraph");b.Ra.wo("Expand SubGraph");var c=new K(I);if(null===a||a.nd)for(var d=b.selection.j;d.next();){var e=d.value;e instanceof I&&(a=e,a.nd||(a.expandSubGraph(),c.add(a)))}else a.expandSubGraph(),c.add(a);b.Ka("SubGraphExpanded",c)}finally{b.ld("Expand SubGraph")}};
pa.prototype.canExpandSubGraph=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.sb)return!1;if(null!==a)return a instanceof I&&!a.nd?!0:!1;for(a=b.selection.j;a.next();)if(b=a.value,b instanceof I&&!b.nd)return!0;return!1};
pa.prototype.editTextBlock=function(a){void 0===a&&(a=null);null!==a&&D.l(a,na,pa,"editTextBlock");var b=this.g;if(null!==b){var c=b.bb.mC;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.wu(function(a){return a instanceof na&&a.cB})}null!==a&&(b.cb=null,c.ih=a,b.cb=c)}}};
pa.prototype.canEditTextBlock=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.sb||b.Nf||!b.Gx||null===b.bb.mC)return!1;if(null!==a){if(!(a instanceof na))return!1;a=a.$;if(null!==a&&a.canEdit())return!0}else for(b=b.selection.j;b.next();)if(a=b.value,a.canEdit()&&(a=a.wu(function(a){return a instanceof na&&a.cB}),null!==a))return!0;return!1};
pa.prototype.showContextMenu=function(a){var b=this.g;if(null!==b){var c=b.bb.UA;if(null!==c&&(void 0===a&&(a=0<b.selection.count?b.selection.first():b),a=c.findObjectWithContextMenu(a),null!==a)){var d=new ag,e=null;a instanceof O?e=a.gb(mc):b.rJ||(e=b.wb,e=new N(e.x+e.width/2,e.y+e.height/2));null!==e&&(d.g=b,d.Sd=b.zv(e),d.ha=e,d.left=!1,d.right=!0,d.up=!0,b.U=d);b.cb=c;Yh(c,!1,a)}}};
pa.prototype.canShowContextMenu=function(a){var b=this.g;if(null===b)return!1;var c=b.bb.UA;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(pa,{rI:"copiesClipboardData"},function(){return this.SC},function(a){D.h(a,"boolean",pa,"copiesClipboardData");this.SC=a});
D.defineProperty(pa,{sI:"copiesConnectedLinks"},function(){return this.TC},function(a){D.h(a,"boolean",pa,"copiesConnectedLinks");this.TC=a});D.defineProperty(pa,{vF:"deletesConnectedLinks"},function(){return this.mD},function(a){D.h(a,"boolean",pa,"deletesConnectedLinks");this.mD=a});D.defineProperty(pa,{uI:"copiesTree"},function(){return this.XC},function(a){D.h(a,"boolean",pa,"copiesTree");this.XC=a});
D.defineProperty(pa,{zI:"deletesTree"},function(){return this.nD},function(a){D.h(a,"boolean",pa,"deletesTree");this.nD=a});D.defineProperty(pa,{mF:"copiesParentKey"},function(){return this.WC},function(a){D.h(a,"boolean",pa,"copiesParentKey");this.WC=a});D.defineProperty(pa,{lF:"copiesGroupKey"},function(){return this.VC},function(a){D.h(a,"boolean",pa,"copiesGroupKey");this.VC=a});
D.defineProperty(pa,{ZE:"archetypeGroupData"},function(){return this.uz},function(a){null!==a&&D.l(a,Object,pa,"archetypeGroupData");var b=this.g;null!==b&&(b=b.ea,b instanceof X&&(a instanceof I||b.xB(a)||D.k("CommandHandler.archetypeGroupData must be either a Group or a data object for which GraphLinksModel.isGroupForNodeData is true: "+a)));this.uz=a});D.defineProperty(pa,{GB:"memberValidation"},function(){return this.Xl},function(a){null!==a&&D.h(a,"function",pa,"memberValidation");this.Xl=a});
D.defineProperty(pa,{Qx:"defaultScale"},function(){return this.jD},function(a){D.p(a,pa,"defaultScale");0<a||D.k("defaultScale must be larger than zero, not: "+a);this.jD=a});D.defineProperty(pa,{ez:"zoomFactor"},function(){return this.PE},function(a){D.p(a,pa,"zoomFactor");1<a||D.k("zoomFactor must be larger than 1.0, not: "+a);this.PE=a});D.defineProperty(pa,{nK:"scrollToPartPause"},function(){return this.oE},function(a){D.p(a,pa,"scrollToPartPause");this.oE=a});
function Hg(){0<arguments.length&&D.zd(Hg);D.xc(this);this.ca=null;this.ac="";this.rf=!0;this.DD=!1;this.KE=null;this.yx=-1}D.ka("Tool",Hg);Hg.prototype.cd=function(a){v&&null!==a&&D.l(a,E,Hg,"setDiagram");this.ca=a};Hg.prototype.toString=function(){return""!==this.name?this.name+" Tool":D.xf(Object.getPrototypeOf(this))};Hg.prototype.updateAdornments=function(){};Hg.prototype.canStart=function(){return this.isEnabled};Hg.prototype.doStart=function(){};Hg.prototype.doActivate=function(){this.xa=!0};
Hg.prototype.doDeactivate=function(){this.xa=!1};Hg.prototype.doStop=function(){};Hg.prototype.doCancel=function(){this.stopTool()};Hg.prototype.stopTool=function(){var a=this.g;null!==a&&a.cb===this&&(a.cb=null,a.sc="")};Hg.prototype.doMouseDown=function(){!this.xa&&this.canStart()&&this.doActivate()};Hg.prototype.doMouseMove=function(){};Hg.prototype.doMouseUp=function(){this.stopTool()};Hg.prototype.doMouseWheel=function(){};Hg.prototype.canStartMultiTouch=function(){return!0};
Hg.prototype.standardPinchZoomStart=function(){var a=this.g;if(null!==a){var b=a.U,c=b.hy(0,D.Db(NaN,NaN)),d=b.hy(1,D.Db(NaN,NaN));if(c.F()&&d.F()&&(this.doCancel(),a.Hu("hasGestureZoom"))){a.it=a.scale;var e=d.x-c.x,g=d.y-c.y;a.tE=Math.sqrt(e*e+g*g);b.bubbles=!1}D.A(c);D.A(d)}};
Hg.prototype.standardPinchZoomMove=function(){var a=this.g;if(null!==a){var b=a.U,c=b.hy(0,D.Db(NaN,NaN)),d=b.hy(1,D.Db(NaN,NaN));if(c.F()&&d.F()&&(this.doCancel(),a.Hu("hasGestureZoom"))){var e=d.x-c.x,g=d.y-c.y,g=Math.sqrt(e*e+g*g)/a.tE,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.it*g,h=a.xb;if(g!==a.scale&&h.canResetZoom(g)){var k=a.Ri;a.Ri=e;h.resetZoom(g);a.Ri=k}b.bubbles=!1}D.A(c);D.A(d)}};
Hg.prototype.doKeyDown=function(){var a=this.g;null!==a&&"Esc"===a.U.key&&this.doCancel()};Hg.prototype.doKeyUp=function(){};Hg.prototype.startTransaction=Hg.prototype.Qb=function(a){void 0===a&&(a=this.name);this.Tf=null;var b=this.g;return null===b?!1:b.Qb(a)};Hg.prototype.stopTransaction=Hg.prototype.pl=function(){var a=this.g;return null===a?!1:null===this.Tf?a.Hm():a.ld(this.Tf)};
Hg.prototype.standardMouseSelect=function(){var a=this.g;if(null!==a&&a.Kf){var b=a.U,c=a.yu(b.ha,!1);if(null!==c)if(D.Rh?b.av:b.control){a.Ka("ChangingSelection");for(b=c;null!==b&&!b.canSelect();)b=b.Ja;null!==b&&(b.mb=!b.mb);a.Ka("ChangedSelection")}else if(b.shift){if(!c.mb){a.Ka("ChangingSelection");for(b=c;null!==b&&!b.canSelect();)b=b.Ja;null!==b&&(b.mb=!0);a.Ka("ChangedSelection")}}else{if(!c.mb){for(b=c;null!==b&&!b.canSelect();)b=b.Ja;null!==b&&a.select(b)}}else!b.left||(D.Rh?b.av:b.control)||
b.shift||a.PA()}};Hg.prototype.standardMouseClick=function(a,b){void 0===a&&(a=null);void 0===b&&(b=function(a){return!a.layer.Sc});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.Ec};
function Zh(a,b,c){b.Ec=!1;if(null===a||a.Ou()){var d=0;b.left?d=1===b.Fe?1:2===b.Fe?2:1:b.right&&1===b.Fe&&(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.Ka(e,a)}else{switch(d){case 1:e="BackgroundSingleClicked";break;case 2:e="BackgroundDoubleClicked";break;case 3:e="BackgroundContextClicked"}0!==d&&c.Ka(e)}if(null!==a)for(;null!==a;){c=null;switch(d){case 1:c=a.click;break;case 2:c=a.tu?a.tu:
a.click;break;case 3:c=a.TA}if(null!==c&&(c(b,a),b.Ec))break;a=a.Q}else{a=null;switch(d){case 1:a=c.click;break;case 2:a=c.tu?c.tu:c.click;break;case 3:a=c.TA}null!==a&&a(b)}}}
Hg.prototype.standardMouseOver=function(){var a=this.g;if(null!==a){var b=a.U;if(null!==b.g&&!0!==a.Ra.Ac){var c=a.ob;a.ob=!0;var d=a.uh?a.Je(b.ha,null,null):null;b.Oe=d;var e=!1;if(d!==a.Vo){var g=a.Vo,h=g;a.Vo=d;this.doCurrentObjectChanged(g,d);for(b.Ec=!1;null!==g;){var k=g.cv;if(null!==k){if(d===g)break;if(null!==d&&d.Dm(g))break;k(b,g,d);e=!0;if(b.Ec)break}g=g.Q}g=h;for(b.Ec=!1;null!==d;){k=d.bv;if(null!==k){if(g===d)break;if(null!==g&&g.Dm(d))break;k(b,d,g);e=!0;if(b.Ec)break}d=d.Q}d=a.Vo}if(null!==
d){g=d;for(h="";null!==g;){h=g.cursor;if(""!==h)break;g=g.Q}a.sc=h;b.Ec=!1;for(g=d;null!==g;){d=g.KB;if(null!==d&&(d(b,g),e=!0,b.Ec))break;g=g.Q}}else a.sc="",d=a.KB,null!==d&&(d(b),e=!0);e&&a.Le();a.ob=c}}};Hg.prototype.doCurrentObjectChanged=function(){};
Hg.prototype.standardMouseWheel=function(){var a=this.g;if(null!==a){var b=a.U,c=b.Hi;if(0!==c&&a.Qc.F()){var d=a.xb,e=a.bb.dv;if((e===$h&&!b.shift||e===ai&&b.control)&&(0<c?d.canIncreaseZoom():d.canDecreaseZoom()))e=a.Ri,a.Ri=b.Sd,0<c?d.increaseZoom():d.decreaseZoom(),a.Ri=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.Dq||D.Eq||D.wB)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.De?(g=a.qv,e=3*e*g,0<c?a.scroll("pixel","up",e):a.scroll("pixel","down",e)):b.shift&&a.Ce&&(g=a.pv,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.Ce&&(0<h?a.scroll(l,"left",-h):a.scroll(l,"right",h));0!==k&&a.De&&(0<k?a.scroll(l,"up",-k):a.scroll(l,"down",k))}a.position.P(d)||(b.bubbles=!1)}}}};
Hg.prototype.standardWaitAfter=function(a,b){D.h(a,"number",Hg,"standardWaitAfter:delay");void 0===b&&(b=this.g.U);this.cancelWaitAfter();var c=this,d=b.copy();this.yx=D.setTimeout(function(){c.doWaitAfter(d)},a)};Hg.prototype.cancelWaitAfter=function(){-1!==this.yx&&D.clearTimeout(this.yx);this.yx=-1};Hg.prototype.doWaitAfter=function(){};
Hg.prototype.findToolHandleAt=function(a,b){var c=this.g;if(null===c)return null;c=c.Je(a,function(a){for(;null!==a&&!(a.Q instanceof ca);)a=a.Q;return a});return null===c?null:c.$.wd===b?c:null};Hg.prototype.isBeyondDragSize=function(a,b){var c=this.g;if(null===c)return!1;void 0===a&&(a=c.Dc.Sd);void 0===b&&(b=c.U.Sd);var d=c.bb.DI,e=d.width,d=d.height;c.Dc.Sj&&(e+=6,d+=6);return Math.abs(b.x-a.x)>e||Math.abs(b.y-a.y)>d};D.w(Hg,{g:"diagram"},function(){return this.ca});
D.defineProperty(Hg,{name:"name"},function(){return this.ac},function(a){D.h(a,"string",Hg,"name");this.ac=a});D.defineProperty(Hg,{isEnabled:"isEnabled"},function(){return this.rf},function(a){D.h(a,"boolean",Hg,"isEnabled");this.rf=a});D.defineProperty(Hg,{xa:"isActive"},function(){return this.DD},function(a){D.h(a,"boolean",Hg,"isActive");this.DD=a});D.defineProperty(Hg,{Tf:"transactionResult"},function(){return this.KE},function(a){null!==a&&D.h(a,"string",Hg,"transactionResult");this.KE=a});
function Uh(){Hg.call(this);0<arguments.length&&D.zd(Uh);this.name="Dragging";this.UC=this.HD=!0;this.ss=this.sD=!1;this.MD=!0;this.Xz=(new Ba(NaN,NaN)).freeze();this.Yz=ic;this.Zz=(new N(NaN,NaN)).freeze();this.rD=!1;this.Qw=this.Pw=this.Nz=this.RC=this.qD=this.bD=this.vj=null;this.Zr=this.KD=!1;this.Sp=new N(NaN,NaN);this.nx=new N;this.qx=!1;this.GD=!0;this.ap=100;this.lk=[];this.GH=(new L(F)).freeze()}D.Ta(Uh,Hg);D.ka("DraggingTool",Uh);
D.defineProperty(Uh,{fG:"isCopyEnabled"},function(){return this.HD},function(a){D.h(a,"boolean",Uh,"isCopyEnabled");this.HD=a});D.defineProperty(Uh,{tI:"copiesEffectiveCollection"},function(){return this.UC},function(a){D.h(a,"boolean",Uh,"copiesEffectiveCollection");this.UC=a});D.defineProperty(Uh,{EI:"dragsTree"},function(){return this.sD},function(a){D.h(a,"boolean",Uh,"dragsTree");this.sD=a});
D.defineProperty(Uh,{il:"isGridSnapEnabled"},function(){return this.ss},function(a){D.h(a,"boolean",Uh,"isGridSnapEnabled");this.ss=a});D.defineProperty(Uh,{nJ:"isComplexRoutingRealtime"},function(){return this.GD},function(a){D.h(a,"boolean",Uh,"isComplexRoutingRealtime");this.GD=a});D.defineProperty(Uh,{hG:"isGridSnapRealtime"},function(){return this.MD},function(a){D.h(a,"boolean",Uh,"isGridSnapRealtime");this.MD=a});
D.defineProperty(Uh,{WF:"gridSnapCellSize"},function(){return this.Xz},function(a){D.l(a,Ba,Uh,"gridSnapCellSize");this.Xz.P(a)||(this.Xz=a=a.V())});D.defineProperty(Uh,{$I:"gridSnapCellSpot"},function(){return this.Yz},function(a){D.l(a,R,Uh,"gridSnapCellSpot");this.Yz.P(a)||(this.Yz=a=a.V())});D.defineProperty(Uh,{aJ:"gridSnapOrigin"},function(){return this.Zz},function(a){D.l(a,N,Uh,"gridSnapOrigin");this.Zz.P(a)||(this.Zz=a=a.V())});
D.defineProperty(Uh,{Lj:"dragsLink"},function(){return this.rD},function(a){D.h(a,"boolean",Uh,"dragsLink");this.rD=a});D.defineProperty(Uh,{Tn:"currentPart"},function(){return this.bD},function(a){null!==a&&D.l(a,F,Uh,"currentPart");this.bD=a});D.defineProperty(Uh,{oc:"copiedParts"},function(){return this.RC},function(a){this.RC=a});D.defineProperty(Uh,{hc:"draggedParts"},function(){return this.qD},function(a){this.qD=a});
D.w(Uh,{KL:"draggingParts"},function(){return null!==this.oc?this.oc.dk():null!==this.hc?this.hc.dk():this.GH});D.defineProperty(Uh,{xd:"draggedLink"},function(){return this.Nz},function(a){null!==a&&D.l(a,J,Uh,"draggedLink");this.Nz!==a&&(this.Nz=a,null!==a?(this.Pw=a.ic,this.Qw=a.wc):this.Qw=this.Pw=null)});D.defineProperty(Uh,{ly:"isDragOutStarted"},function(){return this.KD},function(a){this.KD=a});
D.defineProperty(Uh,{ol:"startPoint"},function(){return this.nx},function(a){D.l(a,N,Uh,"startPoint");this.nx.P(a)||(this.nx=a=a.V())});D.defineProperty(Uh,{qF:"delay"},function(){return this.ap},function(a){D.h(a,"number",Uh,"delay");this.ap=a});Uh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||a.sb&&!a.ju||!a.lm&&!a.Tk&&!a.ju||!a.Kf)return!1;var b=a.U;return!b.left||a.cb!==this&&(!this.isBeyondDragSize()||b.Sj&&b.timestamp-a.Dc.timestamp<this.ap)?!1:null!==this.findDraggablePart()};
Uh.prototype.findDraggablePart=function(){var a=this.g;if(null===a)return null;a=a.yu(a.Dc.ha,!1);if(null===a)return null;for(;null!==a&&!a.canSelect();)a=a.Ja;return null!==a&&(a.canMove()||a.canCopy())?a:null};Uh.prototype.standardMouseSelect=function(){var a=this.g;if(null!==a&&a.Kf){var b=a.yu(a.Dc.ha,!1);if(null!==b){for(;null!==b&&!b.canSelect();)b=b.Ja;this.Tn=b;this.Tn.mb||(a.Ka("ChangingSelection"),b=a.U,(D.Rh?b.av:b.control)||b.shift||Th(a),this.Tn.mb=!0,a.Ka("ChangedSelection"))}}};
Uh.prototype.doActivate=function(){var a=this.g;if(null!==a){null===this.Tn&&this.standardMouseSelect();var b=this.Tn;null!==b&&(b.canMove()||b.canCopy())&&(this.xa=!0,this.Sp.set(a.position),bi(this,a.selection),this.lk.length=0,this.hc=this.computeEffectiveCollection(a.selection),a.Co=!0,ci(this,this.hc),this.Qb("Drag"),this.ol=a.Dc.ha,a.of=!0,a.ju&&(this.ly=!0,this.Zr=!1,di=this,ei=this.g,this.doSimulatedDragOut()))}};
function bi(a,b){if(a.Lj){var c=a.g;null!==c&&c.Kn&&(c.ea instanceof X&&1===b.count&&b.first()instanceof J?(a.xd=b.first(),a.xd.canRelinkFrom()&&a.xd.canRelinkTo()&&a.xd.ou(),a.vj=c.bb.HG,null===a.vj&&(a.vj=new fi,a.vj.cd(c))):(a.xd=null,a.vj=null))}}
Uh.prototype.computeEffectiveCollection=function(a){var b=null!==this.g&&this.g.cb===this,c=new ma(F);if(null===a)return c;for(var d=a.j;d.next();)gi(this,c,d.value,b);if(null!==this.xd&&this.Lj)return c;for(d=a.j;d.next();)a=d.value,a instanceof J&&(b=a.Z,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,c){if(void 0===c)return new ii(Jd);a=a.il;null!==b.Ja&&(a=!1);return a?new ii(new N(Math.round(c.x),Math.round(c.y))):new ii(c.copy())}
function gi(a,b,c,d){if(!b.contains(c)&&(!d||c.canMove()||c.canCopy()))if(c instanceof H){b.add(c,hi(a,c,c.location));if(c instanceof I)for(var e=c.lc;e.next();)gi(a,b,e.value,d);for(e=c.Od;e.next();){var g=e.value;if(!b.contains(g)){var h=g.Z,k=g.ba;null!==h&&b.contains(h)&&null!==k&&b.contains(k)&&gi(a,b,g,d)}}if(a.EI)for(c=c.JF();c.next();)gi(a,b,c.value,d)}else if(c instanceof J)for(g=c,b.add(g,hi(a,g)),c=g.Bf;c.next();)gi(a,b,c.value,d);else c instanceof ca||b.add(c,hi(a,c,c.location))}
Uh.prototype.doDeactivate=function(){this.xa=!1;var a=this.g;null!==a&&ji(a);ki(this);ti(this,this.hc);this.hc=this.Tn=null;this.Zr=this.ly=!1;if(0<Gi.count){for(var b=Gi.length,c=0;c<b;c++){var d=Gi.fa(c);Hi(d);Ii(d);ki(d);null!==d.g&&ji(d.g)}Gi.clear()}Hi(this);this.Sp.n(NaN,NaN);di=ei=null;Ii(this);a.of=!1;a.sc="";a.Co=!1;this.pl()};function ki(a){var b=a.g;if(null!==b){var c=b.ob;b.ob=!0;Ji(a,b.U,null);b.ob=c}a.lk.length=0}
function Ki(){var a=di;Ii(a);Li(a);var b=a.g;null!==b&&a.Sp.F()&&(b.position=a.Sp);null!==b&&ji(b)}Uh.prototype.doCancel=function(){Ii(this);Li(this);var a=this.g;null!==a&&this.Sp.F()&&(a.position=this.Sp);this.stopTool()};function ci(a,b){if(null!==b){a.qx=!0;for(var c=b.j;c.next();){var d=c.key;d instanceof J&&(d.Ni=!0)}}}function ti(a,b){if(null!==b){for(var c=b.j;c.next();){var d=c.key;d instanceof J&&(d.Ni=!1,Mi(d)&&d.bc())}a.qx=!1}}
Uh.prototype.doKeyDown=function(){var a=this.g;null!==a&&(a=a.U,null!==a&&this.xa&&("Esc"===a.key?this.doCancel():this.doMouseMove()))};Uh.prototype.doKeyUp=function(){var a=this.g;null!==a&&null!==a.U&&this.xa&&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.te()&&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.oc){var c=a.g;if(!(null===c||b&&(c.sb||c.Nf))&&null!==a.hc){var d=c.na;d.isEnabled&&d.jG?null!==d.Jj&&0<d.Jj.fg.count&&(c.na.Hm(),c.Qb("Drag")):Li(a);c.ob=!b;c.lr=!b;a.ol=c.Dc.ha;d=a.tI?a.hc.dk():c.selection;d=c.mq(d,c,!0);for(c=d.j;c.next();)c.value.location=c.key.location;c=D.Ff();Ni(d,c);D.Hb(c);for(var c=new ma(F),e=a.hc.j;e.next();){var g=e.key;g.te()&&g.canCopy()&&(g=d.oa(g),null!==g&&(g.Ue(),c.add(g,hi(a,g,g.location))))}for(d=d.j;d.next();)e=d.value,e instanceof
J&&e.canCopy()&&c.add(e,hi(a,e));a.oc=c;bi(a,c.dk());null!==a.xd&&(c=a.xd,d=c.yo,c.Wj(a.ol.x-(d.x+d.width/2),a.ol.y-(d.y+d.height/2)))}}}function Ii(a){var b=a.g;if(null!==b){if(null!==a.oc&&(b.WB(a.oc.dk(),!1),a.oc=null,null!==a.hc))for(var c=a.hc.j;c.next();)c.key instanceof J&&(c.value.point=new N(0,0));b.ob=!1;b.lr=!1;a.ol=b.Dc.ha}}function Hi(a){if(null!==a.xd){if(a.Lj&&null!==a.vj){var b=a.vj;null!==b.g&&(b.g.remove(b.he),b.g.remove(b.ie))}a.xd=null;a.vj=null}}
function Pi(a,b,c){var d=a.g;if(null!==d){var e=a.ol,g=D.O();g.assign(d.U.ha);a.moveParts(b,g.Mi(e),c);D.A(g)}}
Uh.prototype.moveParts=function(a,b,c){if(null!==a&&(D.l(a,ma,Uh,"moveParts:parts"),0!==a.count)){var d=D.O(),e=D.O();e.assign(b);isNaN(e.x)&&(e.x=0);isNaN(e.y)&&(e.y=0);(b=this.qx)||ci(this,a);for(var g=new K(Qi),h=new K(Va),k=a.j;k.next();){var l=k.key;if(l.te()){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.eH=n.Mi(m)}}else k.key instanceof J&&h.add(k.eb)}for(c=g.j;c.next();)n=
c.value,m=n.info.point,d.assign(m),n.ad.location=d.add(n.bJ.eH);c=D.O();m=D.O();for(h=h.j;h.next();)if(k=h.value,g=k.key,g instanceof J)if(g.Ni)if(n=g.Z,l=g.ba,null!==this.xd&&this.Lj)if(k=k.value.point,null===g.Ux)a.add(g,hi(this,g,e)),l=e.x-k.x,k=e.y-k.y,g.Wj(l,k);else{p=D.Db(0,0);(n=g.m(0))&&n.F()&&p.assign(n);n=D.O();n.assign(p);n.add(e);var q=n;this.il&&(this.hG||this.g.U.up)&&(q=D.O(),Si(this,g,n,q));n.assign(g.Ux(g,n,q));n.Mi(p);a.add(g,hi(this,g,n));l=n.x-k.x;k=n.y-k.y;g.Wj(l,k);D.A(p);D.A(n);
q!==n&&D.A(q)}else null!==n&&(c.assign(n.location),p=a.oa(n),null!==p&&c.Mi(p.point)),null!==l&&(m.assign(l.location),p=a.oa(l),null!==p&&m.Mi(p.point)),null!==n&&null!==l?c.Zc(m)?(k=k.value.point,n=d,n.assign(c),n.Mi(k),a.add(g,hi(this,g,c)),g.Wj(n.x,n.y)):(g.Ni=!1,g.bc()):(k=k.value.point,n=null!==n?c:null!==l?m:e,a.add(g,hi(this,g,n)),l=n.x-k.x,k=n.y-k.y,g.Wj(l,k));else if(null===g.Z||null===g.ba)k=k.value.point,a.add(g,hi(this,g,e)),l=e.x-k.x,k=e.y-k.y,g.Wj(l,k);D.A(d);D.A(e);D.A(c);D.A(m);b||
(Ti(this.g),ti(this,a))}};function Ri(a,b,c){b=b.Ja;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.te()&&(d.location=c.value.point)}for(c=a.hc.j;c.next();)if(d=c.key,d instanceof J&&d.Ni){var e=c.value.point;a.hc.add(d,hi(a,d));d.Wj(-e.x,-e.y)}b.mg()}}
function Si(a,b,c,d){d.assign(c);if(null!==b&&(b=a.g,null!==b)){var e=b.bo,g=a.WF;b=g.width;var g=g.height,h=a.aJ,k=h.x,h=h.y;a=a.$I;if(null!==e){var l=e.iy;isNaN(b)&&(b=l.width);isNaN(g)&&(g=l.height);e=e.VF;isNaN(k)&&(k=e.x);isNaN(h)&&(h=e.y)}e=D.Db(0,0);e.tv(0,0,b,g,a);gb(c.x,c.y,k+e.x,h+e.y,b,g,d);D.A(e)}}
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,g=this.il;g&&(this.hG||null===c||null!==this.g&&this.g.U.up)&&(e=D.O(),Si(this,a,b,e));c=null!==a.Ux?a.Ux(a,b,e):e;var h=a.PJ,k=h.x;isNaN(k)&&(k=g?Math.round(a.location.x):a.location.x);h=h.y;isNaN(h)&&(h=g?Math.round(a.location.y):a.location.y);var l=a.JJ,m=l.x;isNaN(m)&&(m=g?Math.round(a.location.x):a.location.x);l=l.y;isNaN(l)&&(l=g?Math.round(a.location.y):a.location.y);
d.n(Math.max(k,Math.min(c.x,m)),Math.max(h,Math.min(c.y,l)));e!==b&&D.A(e);return d};function Ui(a,b){if(null===b)return!0;var c=b.$;return null===c||c instanceof ca||c.layer.Sc||a.hc&&a.hc.contains(c)||a.oc&&a.oc.contains(c)?!0:!1}
function Vi(a,b){var c=a.g;if(null!==c){a.Lj&&(null!==a.xd&&(a.xd.Z=null,a.xd.ba=null),Wi(a,!1));var d=Xi(c,b,null,function(b){return!Ui(a,b)}),e=c.U;e.Oe=d;var g=c.ob,h=!1;try{c.ob=!0;h=Ji(a,e,d);if(!a.xa&&null===di)return;if(null===d){var k=c.TJ;null!==k&&(k(e),h=!0)}if(!a.xa&&null===di)return;a.doDragOver(b,d);if(!a.xa&&null===di)return}finally{c.ob=g,h&&c.mg()}(c.Ce||c.De)&&c.$A(e.Sd)}}
function Ji(a,b,c){var d=!1,e=a.lk.length,g=0<e?a.lk[0]:null;if(c===g)return!1;b.Ec=!1;for(var h=0;h<e;h++){var k=a.lk[h],l=k.SJ;if(null!==l&&(l(b,k,c),d=!0,b.Ec))break}a.lk.length=0;if(!a.xa&&null===di||null===c)return d;for(b.Ec=!1;null!==c;)a.lk.push(c),c=Yi(c);e=a.lk.length;for(h=0;h<e&&(k=a.lk[h],l=k.RJ,null===l||(l(b,k,g),d=!0,!b.Ec));h++);return d}function Yi(a){var b=a.Q;return null!==b?b:a instanceof F&&!(a instanceof I)&&(a=a.Ja,null!==a&&a.dJ)?a:null}
function Zi(a,b,c){var d=a.vj;if(null===d)return null;var e=a.g.Wn(b,d.FG,function(a){return d.findValidLinkablePort(a,c)});a=D.O();for(var g=Infinity,h=null,e=e.j;e.next();){var k=e.value;if(null!==k.$){var l=k.gb(mc,a),l=b.Lf(l);l<g&&(h=k,g=l)}}D.A(a);return h}
function Wi(a,b){var c=a.xd;if(null!==c&&!(2>c.ta)){var d=a.g;if(null!==d&&!d.sb){var e=a.vj;if(null!==e){var g=null,h=null;null===c.Z&&(g=Zi(a,c.m(0),!1),null!==g&&(h=g.$));var k=null,l=null;null===c.ba&&(k=Zi(a,c.m(c.ta-1),!0),null!==k&&(l=k.$));e.isValidLink(h,g,l,k)?b?(c.nq=c.m(0),c.oq=c.m(c.ta-1),c.Ni=!1,c.Z=h,null!==g&&(c.ig=g.Rd),c.ba=l,null!==k&&(c.jh=k.Rd),c.ic!==a.Pw&&d.Ka("LinkRelinked",c,a.Pw),c.wc!==a.Qw&&d.Ka("LinkRelinked",c,a.Qw)):$i(e,h,g,l,k):$i(e,null,null,null,null)}}}}
Uh.prototype.doDragOver=function(){};
function aj(a,b){var c=a.g;if(null!==c){a.Lj&&Wi(a,!0);ki(a);var d=Xi(c,b,null,function(b){return!Ui(a,b)}),e=c.U;e.Oe=d;if(null!==d){e.Ec=!1;for(var g=d;null!==g;){var h=g.HB;if(null!==h&&(h(e,g),e.Ec))break;g=Yi(g)}}else g=c.HB,null!==g&&g(e);if(a.xa||null!==di){for(e=(a.oc||a.hc).j;e.next();)g=e.key,g instanceof H&&g.Od.each(function(a){a.Ni=!1});a.doDropOnto(b,d);if(a.xa||null!==di){d=D.Ff();for(e=c.selection.j;e.next();)g=e.value,g instanceof H&&bj(c,g.getAvoidableRect(d));D.Hb(d)}}}}
function bj(a,b){var c=!1;a.wb.Wk(b)&&(c=!0);c=a.eB(b,function(a){return a.$},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.Pj&&d.bc()}}Uh.prototype.doDropOnto=function(){};
Uh.prototype.doMouseMove=function(){if(this.xa){var a=this.g;null!==a&&null!==this.Tn&&null!==this.hc&&(this.mayCopy()?(a.sc="copy",Oi(this,!1),ci(this,this.oc),Pi(this,this.oc,!1),ti(this,this.oc)):this.mayMove()?(Ii(this),Pi(this,this.hc,!0)):this.mayDragOut()?(a.sc="no-drop",Oi(this,!1),Pi(this,this.oc,!1)):Ii(this),Vi(this,a.U.ha))}};
Uh.prototype.doMouseUp=function(){if(this.xa){var a=this.g;if(null!==a){var b=!1,c=this.mayCopy();c&&null!==this.oc?(Ii(this),Oi(this,!0),ci(this,this.oc),Pi(this,this.oc,!1),ti(this,this.oc),null!==this.oc&&a.ZG(this.oc.dk())):(b=!0,Ii(this),this.mayMove()&&(Pi(this,this.hc,!0),Vi(this,a.U.ha)));this.Zr=!0;aj(this,a.U.ha);if(this.xa){this.oc=null;if(b&&null!==this.hc)for(b=this.hc.j;b.next();){var d=b.key;d instanceof H&&(d=d.Ja,null===d||null===d.placeholder||this.hc.contains(d)||d.placeholder.K())}a.Rc();
ti(this,this.hc);this.Tf=c?"Copy":"Move";a.Ka(c?"SelectionCopied":"SelectionMoved",a.selection)}this.stopTool()}}};Uh.prototype.mayCopy=function(){if(!this.fG)return!1;var a=this.g;if(null===a||a.sb||a.Nf||!a.dq||!a.Tk||(D.Rh?!a.U.alt:!a.U.control))return!1;for(a=a.selection.j;a.next();){var b=a.value;if(b.te()&&b.canCopy())return!0}return null!==this.xd&&this.Lj&&this.xd.canCopy()?!0:!1};
Uh.prototype.mayDragOut=function(){if(!this.fG)return!1;var a=this.g;if(null===a||!a.ju||!a.Tk||a.lm)return!1;for(a=a.selection.j;a.next();){var b=a.value;if(b.te()&&b.canCopy())return!0}return null!==this.xd&&this.Lj&&this.xd.canCopy()?!0:!1};Uh.prototype.mayMove=function(){var a=this.g;if(null===a||a.sb||!a.lm)return!1;for(a=a.selection.j;a.next();){var b=a.value;if(b.te()&&b.canMove())return!0}return null!==this.xd&&this.Lj&&this.xd.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.XE||a.sb||a.Nf||!a.dq)return!1;var b=di;return null===b||null===b.g||b.g.ea.tm!==a.ea.tm?!1:!0};Uh.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.g;a.Ra.ai();cj(a);a.Ra.ai();a=di;null!==a&&null!==a.g&&(a.g.sc="copy",a.g.Co=!0)}};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",dj(this,b.hc.dk(),!1),Pi(this,this.oc,!1),Vi(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.Zr=!0;Ii(this);this.mayDragIn()&&(this.Qb("Drop"),dj(this,b.hc.dk(),!0),Pi(this,this.oc,!1),null!==this.oc&&a.ZG(this.oc.dk()),aj(this,a.U.ha),a.Rc(),b=a.selection,null!==this.oc?this.Tf="ExternalCopy":b=new L(F),this.oc=null,a.doFocus(),a.Ka("ExternalObjectsDropped",b,c),this.pl())}}};
function dj(a,b,c){if(null===a.oc){var d=a.g;if(null!==d&&!d.sb&&!d.Nf){d.ob=!c;d.lr=!c;a.ol=d.Dc.ha;c=d.mq(b,d,!0);var e=D.Ff();Ni(b,e);var d=e.x+e.width/2,g=e.y+e.height/2;D.Hb(e);var e=a.nx,h=new ma(F),k=D.O();for(b=b.j;b.next();){var l=b.value,m=c.oa(l);l.te()&&l.canCopy()?(l=l.location,k.n(e.x-(d-l.x),e.y-(g-l.y)),m.location=k,m.Ue(),h.add(m,hi(a,m,k))):l instanceof J&&l.canCopy()&&(m.Wj(e.x-d,e.y-g),h.add(m,hi(a,m)))}D.A(k);a.oc=h;bi(a,h.dk());null!==a.xd&&(c=a.xd,d=c.yo,c.Wj(a.ol.x-(d.x+d.width/
2),a.ol.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",a.Co=!1)};function ii(a){this.point=a;this.eH=Jd}D.ka("DraggingInfo",ii);function Qi(a,b,c){this.ad=a;this.info=b;this.bJ=c}
function ej(){0<arguments.length&&D.zd(ej);Hg.call(this);this.kE=100;this.PD=!1;var a=new J,b=new A;b.We=!0;b.stroke="blue";a.add(b);b=new A;b.er="Standard";b.fill="blue";b.stroke="blue";a.add(b);a.Of="Tool";this.EE=a;a=new H;b=new A;b.Rd="";b.Ob="Rectangle";b.fill=null;b.stroke="magenta";b.pb=2;b.Ea=Xd;a.add(b);a.nl=!1;a.Of="Tool";this.CE=a;this.DE=b;a=new H;b=new A;b.Rd="";b.Ob="Rectangle";b.fill=null;b.stroke="magenta";b.pb=2;b.Ea=Xd;a.add(b);a.nl=!1;a.Of="Tool";this.FE=a;this.GE=b;this.jE=this.iE=
this.eE=this.dE=this.fE=null;this.LD=!0;this.TH=new ma(O,"boolean");this.lE=this.Vl=this.zE=null}D.Ta(ej,Hg);D.ka("LinkingBaseTool",ej);ej.prototype.doStop=function(){var a=this.g;null!==a&&ji(a);this.fh=this.eh=this.dh=this.bh=this.uc=null;this.cz.clear();this.Sf=null};D.defineProperty(ej,{FG:"portGravity"},function(){return this.kE},function(a){D.h(a,"number",ej,"portGravity");0<=a&&(this.kE=a)});
D.defineProperty(ej,{Gq:"isUnconnectedLinkValid"},function(){return this.PD},function(a){D.h(a,"boolean",ej,"isUnconnectedLinkValid");this.PD=a});D.defineProperty(ej,{Gf:"temporaryLink"},function(){return this.EE},function(a){D.l(a,J,ej,"temporaryLink");this.EE=a});D.defineProperty(ej,{he:"temporaryFromNode"},function(){return this.CE},function(a){D.l(a,H,ej,"temporaryFromNode");this.CE=a});
D.defineProperty(ej,{Do:"temporaryFromPort"},function(){return this.DE},function(a){D.l(a,O,ej,"temporaryFromPort");this.DE=a});D.defineProperty(ej,{ie:"temporaryToNode"},function(){return this.FE},function(a){D.l(a,H,ej,"temporaryToNode");this.FE=a});D.defineProperty(ej,{Eo:"temporaryToPort"},function(){return this.GE},function(a){D.l(a,O,ej,"temporaryToPort");this.GE=a});D.defineProperty(ej,{uc:"originalLink"},function(){return this.fE},function(a){null!==a&&D.l(a,J,ej,"originalLink");this.fE=a});
D.defineProperty(ej,{bh:"originalFromNode"},function(){return this.dE},function(a){null!==a&&D.l(a,H,ej,"originalFromNode");this.dE=a});D.defineProperty(ej,{dh:"originalFromPort"},function(){return this.eE},function(a){null!==a&&D.l(a,O,ej,"originalFromPort");this.eE=a});D.defineProperty(ej,{eh:"originalToNode"},function(){return this.iE},function(a){null!==a&&D.l(a,H,ej,"originalToNode");this.iE=a});
D.defineProperty(ej,{fh:"originalToPort"},function(){return this.jE},function(a){null!==a&&D.l(a,O,ej,"originalToPort");this.jE=a});D.defineProperty(ej,{ee:"isForwards"},function(){return this.LD},function(a){D.h(a,"boolean",ej,"isForwards");this.LD=a});D.w(ej,{cz:"validPortsCache"},function(){return this.TH});D.defineProperty(ej,{Sf:"targetPort"},function(){return this.zE},function(a){null!==a&&D.l(a,O,ej,"targetPort");this.zE=a});
ej.prototype.copyPortProperties=function(a,b,c,d,e){if(null!==a&&null!==b&&null!==c&&null!==d){d.Ea=b.Y.size;e?(d.Jb=b.Jb,d.Pm=b.Pm):(d.Ib=b.Ib,d.xm=b.xm);c.Pf=mc;var g=D.O();c.location=b.gb(mc,g);D.A(g);d.angle=b.ym();null!==this.Jy&&this.Jy(a,b,c,d,e)}};ej.prototype.setNoTargetPortProperties=function(a,b,c){null!==b&&(b.Ea=Xd,b.Ib=dc,b.Jb=dc);null!==a&&null!==this.g&&(a.location=this.g.U.ha);null!==this.Jy&&this.Jy(null,null,a,b,c)};ej.prototype.doMouseDown=function(){this.xa&&this.doMouseMove()};
ej.prototype.doMouseMove=function(){if(this.xa){var a=this.g;if(null!==a){this.Sf=this.findTargetPort(this.ee);if(null!==this.Sf&&this.Sf.$ instanceof H){var b=this.Sf.$;this.ee?this.copyPortProperties(b,this.Sf,this.ie,this.Eo,!0):this.copyPortProperties(b,this.Sf,this.he,this.Do,!1)}else this.ee?this.setNoTargetPortProperties(this.ie,this.Eo,!0):this.setNoTargetPortProperties(this.he,this.Do,!1);(a.Ce||a.De)&&a.$A(a.U.Sd)}}};
ej.prototype.findValidLinkablePort=function(a,b){if(null===a)return null;var c=a.$;if(!(c instanceof H))return null;for(;null!==a;){var d=b?a.oH:a.LF;if(!0===d&&(null!==a.Rd||a instanceof H)&&(b?this.isValidTo(c,a):this.isValidFrom(c,a)))return a;if(!1===d)break;a=a.Q}return null};
ej.prototype.findTargetPort=function(a){var b=this.g,c=b.U.ha,d=this.FG;0>=d&&(d=.1);for(var e=this,g=b.Wn(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.$;if(k instanceof H){var l=h.gb(mc,D.O()),m=c.x-l.x,n=c.y-l.y;D.A(l);l=m*m+n*n;l<d&&(m=this.cz.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.cz.add(h,!0),b=h,d=l):this.cz.add(h,!1))}}return null!==b&&(c=b.$,
c instanceof H&&(null===c.layer||c.layer.ku))?b:null};ej.prototype.isValidFrom=function(a,b){if(null===a||null===b)return this.Gq;if(null!==this.g&&this.g.cb===this&&(null!==a.layer&&!a.layer.ku||!0!==b.LF))return!1;var c=b.hB;if(Infinity>c){if(null!==this.uc&&a===this.bh&&b===this.dh)return!0;var d=b.Rd;null===d&&(d="");if(a.ay(d).count>=c)return!1}return!0};
ej.prototype.isValidTo=function(a,b){if(null===a||null===b)return this.Gq;if(null!==this.g&&this.g.cb===this&&(null!==a.layer&&!a.layer.ku||!0!==b.oH))return!1;var c=b.EK;if(Infinity>c){if(null!==this.uc&&a===this.eh&&b===this.fh)return!0;var d=b.Rd;null===d&&(d="");if(a.Yg(d).count>=c)return!1}return!0};ej.prototype.isInSameNode=function(a,b){if(null===a||null===b)return!1;if(a===b)return!0;var c=a.$,d=b.$;return null!==c&&c===d};
ej.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.$;if(!(c instanceof H))return!1;var d=a.Rd;null===d&&(d="");var e=b.$;if(!(e instanceof H))return!1;var g=b.Rd;null===g&&(g="");for(e=e.Yg(g);e.next();)if(g=e.value,g.Z===c&&g.ig===d)return!0;return!1};
ej.prototype.isValidLink=function(a,b,c,d){if(!this.isValidFrom(a,b)||!this.isValidTo(c,d)||!(null===b||null===d||(b.SI&&d.DK||!this.isInSameNode(b,d))&&(b.RI&&d.CK||!this.isLinked(b,d)))||null!==this.uc&&(null!==a&&this.isLabelDependentOnLink(a,this.uc)||null!==c&&this.isLabelDependentOnLink(c,this.uc))||null!==a&&null!==c&&(null===a.data&&null!==c.data||null!==a.data&&null===c.data)||!this.isValidCycle(a,c,this.uc))return!1;if(null!==a){var e=a.xy;if(null!==e&&!e(a,b,c,d,this.uc))return!1}if(null!==
c&&(e=c.xy,null!==e&&!e(a,b,c,d,this.uc)))return!1;e=this.xy;return null!==e?e(a,b,c,d,this.uc):!0};ej.prototype.isLabelDependentOnLink=function(a,b){if(null===a)return!1;var c=a.Zb;if(null===c)return!1;if(c===b)return!0;var d=new L(H);d.add(a);return fj(this,c,b,d)};function fj(a,b,c,d){if(b===c)return!0;var e=b.Z;if(null!==e&&e.Mf&&(d.add(e),fj(a,e.Zb,c,d)))return!0;b=b.ba;return null!==b&&b.Mf&&(d.add(b),fj(a,b.Zb,c,d))?!0:!1}
ej.prototype.isValidCycle=function(a,b,c){void 0===c&&(c=null);if(null===a||null===b)return this.Gq;var d=null!==this.g?this.g.KK:gj;if(d!==gj){if(d===hj){d=c||this.Gf;if(null!==d&&!d.kc)return!0;for(d=b.Od;d.next();){var e=d.value;if(e!==c&&e.kc&&e.ba===b)return!1}return!ij(this,a,b,c,!0)}if(d===jj){d=c||this.Gf;if(null!==d&&!d.kc)return!0;for(d=a.Od;d.next();)if(e=d.value,e!==c&&e.kc&&e.Z===a)return!1;return!ij(this,a,b,c,!0)}if(d===kj)return a===b?a=!0:(d=new L(H),d.add(b),a=lj(this,d,a,b,c)),
!a;if(d===mj)return!ij(this,a,b,c,!1);if(d===nj)return a===b?a=!0:(d=new L(H),d.add(b),a=oj(this,d,a,b,c)),!a}return!0};function ij(a,b,c,d,e){if(b===c)return!0;if(null===b||null===c)return!1;for(var g=b.Od;g.next();){var h=g.value;if(h!==d&&(!e||h.kc)&&h.ba===b&&(h=h.Z,h!==b&&ij(a,h,c,d,e)))return!0}return!1}
function lj(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.Od;g.next();){var h=g.value;if(h!==e&&h.ba===c&&(h=h.Z,h!==c&&lj(a,b,h,d,e)))return!0}return!1}function oj(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.Od;g.next();){var h=g.value;if(h!==e){var k=h.Z,h=h.ba,k=k===c?h:k;if(k!==c&&oj(a,b,k,d,e))return!0}}return!1}
D.defineProperty(ej,{xy:"linkValidation"},function(){return this.Vl},function(a){null!==a&&D.h(a,"function",ej,"linkValidation");this.Vl=a});D.defineProperty(ej,{Jy:"portTargeted"},function(){return this.lE},function(a){null!==a&&D.h(a,"function",ej,"portTargeted");this.lE=a});function qa(){0<arguments.length&&D.zd(qa);ej.call(this);this.name="Linking";this.wz={};this.vz=null;this.ga=pj;this.uE=null}D.Ta(qa,ej);D.ka("LinkingTool",qa);var pj;qa.Either=pj=D.s(qa,"Either",0);var qj;
qa.ForwardsOnly=qj=D.s(qa,"ForwardsOnly",0);var rj;qa.BackwardsOnly=rj=D.s(qa,"BackwardsOnly",0);D.defineProperty(qa,{aF:"archetypeLinkData"},function(){return this.wz},function(a){null!==a&&D.l(a,Object,qa,"archetypeLinkData");a instanceof O&&D.l(a,J,qa,"archetypeLinkData");this.wz=a});D.defineProperty(qa,{$E:"archetypeLabelNodeData"},function(){return this.vz},function(a){null!==a&&D.l(a,Object,qa,"archetypeLabelNodeData");a instanceof O&&D.l(a,H,qa,"archetypeLabelNodeData");this.vz=a});
D.defineProperty(qa,{direction:"direction"},function(){return this.ga},function(a){D.Da(a,qa,qa,"direction");this.ga=a});D.defineProperty(qa,{hH:"startObject"},function(){return this.uE},function(a){null!==a&&D.l(a,O,qa,"startObject");this.uE=a});qa.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||a.sb||a.Nf||!a.ku)return!1;var b=a.ea;return(b instanceof X||b instanceof Ag)&&a.U.left&&(a.cb===this||this.isBeyondDragSize())?null!==this.findLinkablePort():!1};
qa.prototype.findLinkablePort=function(){var a=this.g;if(null===a)return null;var b=this.hH;null===b&&(b=a.Je(a.Dc.ha,null,null));if(null===b||!(b.$ instanceof H))return null;a=this.direction;if(a===pj||a===qj){var c=this.findValidLinkablePort(b,!1);if(null!==c)return this.ee=!0,c}if(a===pj||a===rj)if(c=this.findValidLinkablePort(b,!0),null!==c)return this.ee=!1,c;return null};
qa.prototype.doActivate=function(){var a=this.g;if(null!==a){var b=this.findLinkablePort();null!==b&&(this.Qb(this.name),a.of=!0,a.sc="pointer",this.ee?(null===this.ie||this.ie.location.F()||(this.ie.location=a.U.ha),this.dh=b,b=this.dh.$,b instanceof H&&(this.bh=b),this.copyPortProperties(this.bh,this.dh,this.he,this.Do,!1)):(null===this.he||this.he.location.F()||(this.he.location=a.U.ha),this.fh=b,b=this.fh.$,b instanceof H&&(this.eh=b),this.copyPortProperties(this.eh,this.fh,this.ie,this.Eo,!0)),
a.add(this.he),a.add(this.ie),null!==this.Gf&&(null!==this.he&&(this.Gf.Z=this.he),null!==this.ie&&(this.Gf.ba=this.ie),this.Gf.kc=this.isNewTreeLink(),this.Gf.bc(),a.add(this.Gf)),this.xa=!0)}};qa.prototype.doDeactivate=function(){this.xa=!1;var a=this.g;null!==a&&(a.remove(this.Gf),a.remove(this.he),a.remove(this.ie),a.of=!1,a.sc="",this.pl())};qa.prototype.doStop=function(){ej.prototype.doStop.call(this);this.hH=null};
qa.prototype.doMouseUp=function(){if(this.xa){var a=this.g;if(null===a)return;var b=this.Tf=null,c=null,d=null,e=null,g=this.Sf=this.findTargetPort(this.ee);if(null!==g){var h=g.$;h instanceof H&&(this.ee?(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.ee?null!==this.bh&&this.Gq&&(b=this.bh,c=this.dh):null!==this.eh&&this.Gq&&(d=this.eh,e=this.fh);null!==b||null!==d?(h=this.insertLink(b,c,d,e),null!==h?(null===g&&(this.ee?h.oq=a.U.ha:h.nq=
a.U.ha),a.Kf&&a.select(h),this.Tf=this.name,a.Ka("LinkDrawn",h)):(a.ea.gF(),this.doNoLink(b,c,d,e))):this.ee?this.doNoLink(this.bh,this.dh,null,null):this.doNoLink(null,null,this.eh,this.fh)}this.stopTool()};qa.prototype.isNewTreeLink=function(){var a=this.aF;if(null===a)return!0;if(a instanceof J)return a.kc;var b=this.g;if(null===b)return!0;a=b.vq(a);b=sj(b,a);return null!==b?b.kc:!0};
qa.prototype.insertLink=function(a,b,c,d){var e=this.g;if(null===e)return null;var g=e.ea;if(g instanceof Ag){var h=a;b=c;e.ge||(h=c,b=a);if(null!==h&&null!==b)return g.Li(b.data,g.yb(h.data)),b.Xn()}else if(g instanceof X)if(h="",null!==a&&(null===b&&(b=a),h=b.Rd,null===h&&(h="")),b="",null!==c&&(null===d&&(d=c),b=d.Rd,null===b&&(b="")),d=this.aF,d instanceof J){if(Sh(d),g=d.copy(),null!==g)return g.Z=a,g.ig=h,g.ba=c,g.jh=b,e.add(g),a=this.$E,a instanceof H&&(Sh(a),a=a.copy(),null!==a&&(a.Zb=g,e.add(a))),
g}else if(null!==d&&(d=g.Mx(d),D.Qa(d)))return null!==a&&g.bC(d,g.yb(a.data)),g.cC(d,h),null!==c&&g.hC(d,g.yb(c.data)),g.iC(d,b),g.gu(d),a=this.$E,null===a||a instanceof H||(a=g.copyNodeData(a),D.Qa(a)&&(g.jm(a),a=g.yb(a),void 0!==a&&g.VE(d,a))),g=e.hg(d);return null};qa.prototype.doNoLink=function(){};
function fi(){0<arguments.length&&D.zd(fi);ej.call(this);this.name="Relinking";var a=new A;a.Ob="Diamond";a.Ea=Zd;a.fill="lightblue";a.stroke="dodgerblue";a.cursor="pointer";a.Xe=0;this.xD=a;a=new A;a.Ob="Diamond";a.Ea=Zd;a.fill="lightblue";a.stroke="dodgerblue";a.cursor="pointer";a.Xe=-1;this.HE=a;this.yc=null;this.gE=new C}D.Ta(fi,ej);D.ka("RelinkingTool",fi);
fi.prototype.updateAdornments=function(a){if(null!==a&&a instanceof J){var b="RelinkFrom",c=null;if(a.mb&&null!==this.g&&!this.g.sb){var d=a.Im;null!==d&&a.canRelinkFrom()&&a.Y.F()&&a.isVisible()&&d.Y.F()&&d.Uj()&&(c=a.rq(b),null===c&&(c=this.makeAdornment(d,!1),a.im(b,c)))}null===c&&a.$j(b);b="RelinkTo";c=null;a.mb&&null!==this.g&&!this.g.sb&&(d=a.Im,null!==d&&a.canRelinkTo()&&a.Y.F()&&a.isVisible()&&d.Y.F()&&d.Uj()&&(c=a.rq(b),null===c&&(c=this.makeAdornment(d,!0),a.im(b,c))));null===c&&a.$j(b)}};
fi.prototype.makeAdornment=function(a,b){var c=new ca;c.type=tj;var d=b?this.BK:this.QI;null!==d&&c.add(d.copy());c.Cb=a;return c};D.defineProperty(fi,{QI:"fromHandleArchetype"},function(){return this.xD},function(a){null!==a&&D.l(a,O,fi,"fromHandleArchetype");this.xD=a});D.defineProperty(fi,{BK:"toHandleArchetype"},function(){return this.HE},function(a){null!==a&&D.l(a,O,fi,"toHandleArchetype");this.HE=a});D.w(fi,{handle:"handle"},function(){return this.yc});
fi.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||a.sb||a.Nf||!a.Kn)return!1;var b=a.ea;if(!(b instanceof X||b instanceof Ag)||!a.U.left)return!1;b=this.findToolHandleAt(a.Dc.ha,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.Dc.ha,"RelinkTo"));return null!==b};
fi.prototype.doActivate=function(){var a=this.g;if(null!==a){if(null===this.uc){var b=this.findToolHandleAt(a.Dc.ha,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.Dc.ha,"RelinkTo"));if(null===b)return;var c=b.$;if(!(c instanceof ca&&c.hf instanceof J))return;this.yc=b;this.ee=null===c||"RelinkTo"===c.wd;this.uc=c.hf}this.Qb(this.name);a.of=!0;a.sc="pointer";this.dh=this.uc.ic;this.bh=this.uc.Z;this.fh=this.uc.wc;this.eh=this.uc.ba;this.gE.set(this.uc.Y);null!==this.uc&&0<this.uc.ta&&(null===this.uc.Z&&
(null!==this.Do&&(this.Do.Ea=Wd),null!==this.he&&(this.he.location=this.uc.m(0))),null===this.uc.ba&&(null!==this.Eo&&(this.Eo.Ea=Wd),null!==this.ie&&(this.ie.location=this.uc.m(this.uc.ta-1))));this.copyPortProperties(this.bh,this.dh,this.he,this.Do,!1);this.copyPortProperties(this.eh,this.fh,this.ie,this.Eo,!0);a.add(this.he);a.add(this.ie);null!==this.Gf&&(null!==this.he&&(this.Gf.Z=this.he),null!==this.ie&&(this.Gf.ba=this.ie),this.copyLinkProperties(this.uc,this.Gf),this.Gf.bc(),a.add(this.Gf));
this.xa=!0}};fi.prototype.copyLinkProperties=function(a,b){if(null!==a&&null!==b){b.cq=a.cq;b.XA=a.XA;var c=a.vf;if(c===uj||c===vj)c=wj;b.vf=c;b.Px=a.Px;b.kc=a.kc;b.points=a.points;b.Ry=a.Ry;b.br=a.br;b.Ib=a.Ib;b.xm=a.xm;b.Fu=a.Fu;b.Gu=a.Gu;b.Jb=a.Jb;b.Pm=a.Pm;b.xv=a.xv;b.yv=a.yv}};fi.prototype.doDeactivate=function(){this.xa=!1;var a=this.g;null!==a&&(a.remove(this.Gf),a.remove(this.he),a.remove(this.ie),a.of=!1,a.sc="",this.pl())};
fi.prototype.doStop=function(){ej.prototype.doStop.call(this);this.yc=null};
fi.prototype.doMouseUp=function(){if(this.xa){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.uc;this.Sf=this.findTargetPort(this.ee);if(null!==this.Sf){var h=this.Sf.$;h instanceof H&&(this.ee?(d=h,e=this.Sf):(b=h,c=this.Sf))}else this.Gq?this.ee?e=d=null:c=b=null:g=null;null!==g?(this.reconnectLink(g,this.ee?d:b,this.ee?e:c,this.ee),null===this.Sf&&(this.ee?g.oq=a.U.ha:g.nq=a.U.ha,g.bc()),a.Kf&&(g.mb=!0),this.Tf=this.name,a.Ka("LinkRelinked",g,this.ee?
this.fh:this.dh)):this.doNoRelink(this.uc,this.ee);xj(this.uc,this.gE)}this.stopTool()};fi.prototype.reconnectLink=function(a,b,c,d){if(null===this.g)return!1;c=null!==c&&null!==c.Rd?c.Rd:"";d?(a.ba=b,a.jh=c):(a.Z=b,a.ig=c);return!0};fi.prototype.doNoRelink=function(){};function $i(a,b,c,d,e){null!==a.g&&(null!==b?(a.copyPortProperties(b,c,a.he,a.Do,!1),a.g.add(a.he)):a.g.remove(a.he),null!==d?(a.copyPortProperties(d,e,a.ie,a.Eo,!0),a.g.add(a.ie)):a.g.remove(a.ie))}
function yj(){0<arguments.length&&D.zd(yj);Hg.call(this);this.name="LinkReshaping";var a=new A;a.Ob="Rectangle";a.Ea=Yd;a.fill="lightblue";a.stroke="dodgerblue";this.Ll=a;a=new A;a.Ob="Diamond";a.Ea=Yd;a.fill="lightblue";a.stroke="dodgerblue";this.VD=a;this.mE=3;this.rz=this.yc=null;this.Gp=new N;this.Sw=null}D.Ta(yj,Hg);D.ka("LinkReshapingTool",yj);var Rj;yj.None=Rj=D.s(yj,"None",0);var Sj;yj.Horizontal=Sj=D.s(yj,"Horizontal",1);var Tj;yj.Vertical=Tj=D.s(yj,"Vertical",2);var Uj;
yj.All=Uj=D.s(yj,"All",3);yj.prototype.getReshapingBehavior=yj.prototype.QF=function(a){return a&&a.pA?a.pA:Rj};yj.prototype.setReshapingBehavior=yj.prototype.sv=function(a,b){D.l(a,O,yj,"setReshapingBehavior:obj");D.Da(b,yj,yj,"setReshapingBehavior:behavior");a.pA=b};
yj.prototype.updateAdornments=function(a){if(null!==a&&a instanceof J){if(a.mb&&null!==this.g&&!this.g.sb){var b=a.path;if(null!==b&&a.canReshape()&&a.Y.F()&&a.isVisible()&&b.Y.F()&&b.Uj()){var c=a.rq(this.name);if(null===c||c.bE!==a.ta||c.OE!==a.nv)c=this.makeAdornment(b),null!==c&&(c.bE=a.ta,c.OE=a.nv,a.im(this.name,c));if(null!==c){c.location=a.position;return}}}a.$j(this.name)}};
yj.prototype.makeAdornment=function(a){var b=a.$,c=b.ta,d=b.jc,e=null;if(null!==b.points&&1<c){e=new ca;e.type=tj;var c=b.zu,g=b.ty,h=d?1:0;if(b.nv&&b.computeCurve()!==Vj)for(var k=c+h;k<g-h;k++){var l=this.makeResegmentHandle(a,k);null!==l&&(l.Xe=k,l.$B=.5,l.hB=999,e.add(l))}for(k=c+1;k<g;k++)if(l=this.makeHandle(a,k),null!==l){l.Xe=k;if(k!==c)if(k===c+1&&d){var h=b.m(c),m=b.m(c+1);bb(h.x,m.x)&&bb(h.y,m.y)&&(m=b.m(c-1));bb(h.x,m.x)?(this.sv(l,Tj),l.cursor="n-resize"):bb(h.y,m.y)&&(this.sv(l,Sj),
l.cursor="w-resize")}else k===g-1&&d?(h=b.m(g-1),m=b.m(g),bb(h.x,m.x)&&bb(h.y,m.y)&&(h=b.m(g+1)),bb(h.x,m.x)?(this.sv(l,Tj),l.cursor="n-resize"):bb(h.y,m.y)&&(this.sv(l,Sj),l.cursor="w-resize")):k!==g&&(this.sv(l,Uj),l.cursor="move");e.add(l)}e.Cb=a}return e};yj.prototype.makeHandle=function(){var a=this.Ju;return null===a?null:a.copy()};D.defineProperty(yj,{Ju:"handleArchetype"},function(){return this.Ll},function(a){null!==a&&D.l(a,O,yj,"handleArchetype");this.Ll=a});
yj.prototype.makeResegmentHandle=function(){var a=this.OJ;return null===a?null:a.copy()};D.defineProperty(yj,{OJ:"midHandleArchetype"},function(){return this.VD},function(a){null!==a&&D.l(a,O,yj,"midHandleArchetype");this.VD=a});D.w(yj,{handle:"handle"},function(){return this.yc});D.w(yj,{iu:"adornedLink"},function(){return this.rz});yj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null!==a&&!a.sb&&a.Ex&&a.U.left?null!==this.findToolHandleAt(a.Dc.ha,this.name):!1};
yj.prototype.doActivate=function(){var a=this.g;if(null!==a&&(this.yc=this.findToolHandleAt(a.Dc.ha,this.name),null!==this.yc)){var b=this.yc.$.hf;if(b instanceof J){this.rz=b;a.of=!0;this.Qb(this.name);if(b.nv&&999===this.yc.hB){var c=b.points.copy(),d=this.getResegmentingPoint();c.ce(this.yc.Xe+1,d);b.jc&&c.ce(this.yc.Xe+1,d);b.points=c;b.de();this.yc=this.findToolHandleAt(a.Dc.ha,this.name);if(null===this.yc){this.doDeactivate();return}}this.Gp=b.m(this.yc.Xe);this.Sw=b.points.copy();this.xa=!0}}};
yj.prototype.doDeactivate=function(){this.pl();this.rz=this.yc=null;var a=this.g;null!==a&&(a.of=!1);this.xa=!1};yj.prototype.doCancel=function(){var a=this.iu;null!==a&&(a.points=this.Sw);this.stopTool()};yj.prototype.getResegmentingPoint=function(){return this.handle.gb(mc)};yj.prototype.doMouseMove=function(){var a=this.g;this.xa&&null!==a&&(a=this.computeReshape(a.U.ha),this.reshape(a))};
yj.prototype.doMouseUp=function(){var a=this.g;if(this.xa&&null!==a){var b=this.computeReshape(a.U.ha);this.reshape(b);b=this.iu;if(null!==b&&b.nv){var c=this.handle.Xe,d=b.m(c-1),e=b.m(c),g=b.m(c+1);if(b.jc){if(c>b.zu+1&&c<b.ty-1){var h=b.m(c-2);if(Math.abs(d.x-e.x)<this.Zh&&Math.abs(d.y-e.y)<this.Zh&&(Wj(this,h,d,e,g,!0)||Wj(this,h,d,e,g,!1))){var k=b.points.copy();Wj(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.qd(c);k.qd(c-1);b.points=k;b.de()}else h=b.m(c+2),Math.abs(e.x-g.x)<this.Zh&&Math.abs(e.y-g.y)<this.Zh&&(Wj(this,d,e,g,h,!0)||Wj(this,d,e,g,h,!1))&&(k=b.points.copy(),Wj(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.qd(c+1),k.qd(c),b.points=k,b.de())}}else h=D.O(),db(d.x,d.y,g.x,g.y,e.x,e.y,h)&&h.Lf(e)<this.Zh*this.Zh&&(k=b.points.copy(),k.qd(c),b.points=k,b.de()),
D.A(h)}a.Rc();this.Tf=this.name;a.Ka("LinkReshaped",this.iu,this.Sw)}this.stopTool()};function Wj(a,b,c,d,e,g){return g?Math.abs(b.y-c.y)<a.Zh&&Math.abs(c.y-d.y)<a.Zh&&Math.abs(d.y-e.y)<a.Zh:Math.abs(b.x-c.x)<a.Zh&&Math.abs(c.x-d.x)<a.Zh&&Math.abs(d.x-e.x)<a.Zh}D.defineProperty(yj,{Zh:"resegmentingDistance"},function(){return this.mE},function(a){D.h(a,"number",yj,"resegmentingDistance");this.mE=a});
yj.prototype.reshape=function(a){var b=this.iu;b.Lm();var c=this.handle.Xe,d=this.QF(this.handle);if(b.jc)if(c===b.zu+1)c=b.zu+1,d===Tj?(b.ia(c,b.m(c-1).x,a.y),b.ia(c+1,b.m(c+2).x,a.y)):d===Sj&&(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.ty-1)c=b.ty-1,d===Tj?(b.ia(c-1,b.m(c-2).x,a.y),b.ia(c,b.m(c+1).x,a.y)):d===Sj&&(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);bb(g.x,e.x)&&bb(e.y,h.y)?(bb(g.x,b.m(d-2).x)&&!bb(g.y,b.m(d-2).y)?(b.B(d,
a.x,g.y),c++,d++):b.ia(d-1,a.x,g.y),bb(h.y,b.m(d+2).y)&&!bb(h.x,b.m(d+2).x)?b.B(d+1,h.x,a.y):b.ia(d+1,h.x,a.y)):bb(g.y,e.y)&&bb(e.x,h.x)?(bb(g.y,b.m(d-2).y)&&!bb(g.x,b.m(d-2).x)?(b.B(d,g.x,a.y),c++,d++):b.ia(d-1,g.x,a.y),bb(h.x,b.m(d+2).x)&&!bb(h.y,b.m(d+2).y)?b.B(d+1,a.x,h.y):b.ia(d+1,a.x,h.y)):bb(g.x,e.x)&&bb(e.x,h.x)?(bb(g.x,b.m(d-2).x)&&!bb(g.y,b.m(d-2).y)?(b.B(d,a.x,g.y),c++,d++):b.ia(d-1,a.x,g.y),bb(h.x,b.m(d+2).x)&&!bb(h.y,b.m(d+2).y)?b.B(d+1,a.x,h.y):b.ia(d+1,a.x,h.y)):bb(g.y,e.y)&&bb(e.y,
h.y)&&(bb(g.y,b.m(d-2).y)&&!bb(g.x,b.m(d-2).x)?(b.B(d,g.x,a.y),c++,d++):b.ia(d-1,g.x,a.y),bb(h.y,b.m(d+2).y)&&!bb(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.Z,g=b.ic,null!==e&&(d=e.findVisibleNode(),null!==d&&d!==e&&(e=d,g=e.port)),1===c&&b.computeSpot(!0,g).fe()&&(d=g.gb(mc,D.O()),e=b.getLinkPointFromPoint(e,g,d,a,!0,D.O()),b.ia(0,e.x,e.y),D.A(d),D.A(e)),e=b.ba,g=b.wc,null!==e&&(d=e.findVisibleNode(),null!==d&&d!==e&&(e=d,g=e.port)),c===b.ta-2&&b.computeSpot(!1,
g).fe()&&(d=g.gb(mc,D.O()),e=b.getLinkPointFromPoint(e,g,d,a,!1,D.O()),b.ia(b.ta-1,e.x,e.y),D.A(d),D.A(e));b.Hj()};yj.prototype.computeReshape=function(a){var b=this.iu,c=this.handle.Xe;switch(this.QF(this.handle)){case Uj:return a;case Tj:return b=b.m(c),new N(b.x,a.y);case Sj:return b=b.m(c),new N(a.x,b.y);default:case Rj:return b.m(c)}};D.w(yj,{qM:"originalPoint"},function(){return this.Gp});D.w(yj,{rM:"originalPoints"},function(){return this.Sw});
function Xj(){0<arguments.length&&D.zd(Xj);Hg.call(this);this.name="Resizing";this.ri=(new Ba(1,1)).freeze();this.qi=(new Ba(9999,9999)).freeze();this.ik=(new Ba(NaN,NaN)).freeze();this.ss=!1;this.Vc=null;var a=new A;a.Ih=mc;a.Ob="Rectangle";a.Ea=Yd;a.fill="lightblue";a.stroke="dodgerblue";a.pb=1;a.cursor="pointer";this.Ll=a;this.yc=null;this.Gp=new N;this.cE=new Ba;this.hE=new N;this.Uz=new Ba(0,0);this.Tz=new Ba(Infinity,Infinity);this.Sz=new Ba(1,1);this.aE=!0}D.Ta(Xj,Hg);D.ka("ResizingTool",Xj);
Xj.prototype.updateAdornments=function(a){if(!(null===a||a instanceof J)){if(a.mb&&null!==this.g&&!this.g.sb){var b=a.RG;if(null!==b&&a.canResize()&&a.Y.F()&&a.isVisible()&&b.Y.F()&&b.Uj()){var c=a.rq(this.name);if(null===c||c.Cb!==b)c=this.makeAdornment(b);if(null!==c){var d=b.ym();c.angle=d;var e=b.gb(c.Pf,D.O()),g=b.Mj();c.location=e;D.A(e);e=c.placeholder;if(null!==e){var b=b.Fa,h=D.Om();h.n(b.width*g,b.height*g);e.Ea=h;D.bl(h)}this.updateResizeHandles(c,d);a.im(this.name,c);return}}}a.$j(this.name)}};
Xj.prototype.makeAdornment=function(a){var b=null,b=a.$.QG;if(null===b){b=new ca;b.type=Yj;b.Pf=mc;var c=new Zj;c.We=!0;b.add(c);b.add(this.makeHandle(a,ic));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.Cb=a;return b};
Xj.prototype.makeHandle=function(a,b){var c=this.Ju;if(null===c)return null;c=c.copy();c.alignment=b;return c};
Xj.prototype.updateResizeHandles=function(a,b){if(null!==a)if(!a.alignment.md()&&("pointer"===a.cursor||0<a.cursor.indexOf("resize")))a:{var c=a.alignment;c.fe()&&(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(Xj,{Ju:"handleArchetype"},function(){return this.Ll},function(a){null!==a&&D.l(a,O,Xj,"handleArchetype");this.Ll=a});D.w(Xj,{handle:"handle"},function(){return this.yc});D.defineProperty(Xj,{Cb:"adornedObject"},function(){return this.Vc},function(a){null!==a&&D.l(a,O,Xj,"adornedObject");this.Vc=a});
Xj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null!==a&&!a.sb&&a.lu&&a.U.left?null!==this.findToolHandleAt(a.Dc.ha,this.name):!1};
Xj.prototype.doActivate=function(){var a=this.g;null!==a&&(this.yc=this.findToolHandleAt(a.Dc.ha,this.name),null!==this.yc&&(this.Vc=this.yc.$.Cb,this.Gp.set(this.Cb.gb(this.handle.alignment.DG())),this.hE.set(this.Vc.$.location),this.cE.set(this.Vc.Ea),this.Sz=this.computeCellSize(),this.Uz=this.computeMinSize(),this.Tz=this.computeMaxSize(),a.of=!0,this.aE=a.Ra.isEnabled,a.Ra.isEnabled=!1,this.Qb(this.name),this.xa=!0))};
Xj.prototype.doDeactivate=function(){var a=this.g;null!==a&&(this.pl(),this.Vc=this.yc=null,this.xa=a.of=!1,a.Ra.isEnabled=this.aE)};Xj.prototype.doCancel=function(){null!==this.Cb&&(this.Cb.Ea=this.EG,this.Cb.$.location=this.YJ);this.stopTool()};Xj.prototype.doMouseMove=function(){var a=this.g;if(this.xa&&null!==a){var b=this.Uz,c=this.Tz,d=this.Sz,e=this.Cb.OF(a.U.ha,D.O()),g=this.computeReshape(),b=this.computeResize(e,this.handle.alignment,b,c,d,g);this.resize(b);a.mg();D.A(e)}};
Xj.prototype.doMouseUp=function(){var a=this.g;if(this.xa&&null!==a){var b=this.Uz,c=this.Tz,d=this.Sz,e=this.Cb.OF(a.U.ha,D.O()),g=this.computeReshape(),b=this.computeResize(e,this.handle.alignment,b,c,d,g);this.resize(b);D.A(e);a.Rc();this.Tf=this.name;a.Ka("PartResized",this.Cb,this.EG)}this.stopTool()};
Xj.prototype.resize=function(a){var b=this.g;if(null!==b){var c=this.Cb,d=c.$;c.Ea=a.size;d.Ue();a=this.Cb.gb(this.handle.alignment.DG());if(d instanceof I){var c=b.bb.pe,e=!1;null!==c&&(e=c.il,c.il=!1);var g=new K(F);g.add(d);b.moveParts(g,this.Gp.copy().Mi(a),!0);null!==c&&(c.il=e)}else d.location=d.location.copy().Mi(a).add(this.Gp)}};
Xj.prototype.computeResize=function(a,b,c,d,e,g){b.fe()&&(b=mc);var h=this.Cb.Fa,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.O();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,1<=b?(a.height=Math.max(Math.min(p*a.width,
d.height),c.height),a.width=a.height/p):(a.width=Math.max(Math.min(a.height/p,d.width),c.width),a.height=p*a.width),a.x=m-a.width,a.y=n-a.height)):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,1<=b?(a.height=Math.max(Math.min(p*a.width,d.height),c.height),a.width=a.height/p):(a.width=Math.max(Math.min(a.height/p,d.width),c.width),a.height=p*a.width),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=Math.max(Math.min(p*a.width,d.height),c.height),a.width=a.height/p,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,1<=b?(a.height=Math.max(Math.min(p*a.width,d.height),c.height),a.width=a.height/p):(a.width=Math.max(Math.min(a.height/p,d.width),c.width),a.height=p*a.width),a.y=
n-a.height)):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,1<=b?(a.height=Math.max(Math.min(p*a.width,d.height),c.height),a.width=a.height/p):(a.width=Math.max(Math.min(a.height/p,d.width),c.width),a.height=p*a.width))):(a.width=Math.max(Math.min(q.x-k,d.width),c.width),g||(a.height=Math.max(Math.min(p*a.width,d.height),c.height),a.width=a.height/p,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=Math.max(Math.min(a.height/p,d.width),c.width),a.height=p*a.width,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=Math.max(Math.min(a.height/p,d.width),c.width),a.height=p*a.width,a.x=k+.5*(m-k-a.width)));D.A(q);return a};Xj.prototype.computeReshape=function(){var a=ak;this.Cb instanceof A&&(a=bk(this.Cb));return!(a===ck||null!==this.g&&this.g.U.shift)};
Xj.prototype.computeMinSize=function(){var a=this.Cb.$g.copy(),b=this.$g;!isNaN(b.width)&&b.width>a.width&&(a.width=b.width);!isNaN(b.height)&&b.height>a.height&&(a.height=b.height);return a};Xj.prototype.computeMaxSize=function(){var a=this.Cb.pf.copy(),b=this.pf;!isNaN(b.width)&&b.width<a.width&&(a.width=b.width);!isNaN(b.height)&&b.height<a.height&&(a.height=b.height);return a};
Xj.prototype.computeCellSize=function(){var a=new Ba(NaN,NaN),b=this.Cb.$;if(null!==b){var c=b.gK;!isNaN(c.width)&&0<c.width&&(a.width=c.width);!isNaN(c.height)&&0<c.height&&(a.height=c.height)}c=this.gq;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.bb.pe,null!==c&&c.il&&(c=c.WF,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.bo,null!==b&&b.visible&&this.il&&(c=b.iy,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(Xj,{$g:"minSize"},function(){return this.ri},function(a){D.l(a,Ba,Xj,"minSize");if(!this.ri.P(a)){var b=a.width;isNaN(b)&&(b=0);a=a.height;isNaN(a)&&(a=0);this.ri.n(b,a)}});D.defineProperty(Xj,{pf:"maxSize"},function(){return this.qi},function(a){D.l(a,Ba,Xj,"maxSize");if(!this.qi.P(a)){var b=a.width;isNaN(b)&&(b=Infinity);a=a.height;isNaN(a)&&(a=Infinity);this.qi.n(b,a)}});
D.defineProperty(Xj,{gq:"cellSize"},function(){return this.ik},function(a){D.l(a,Ba,Xj,"cellSize");this.ik.P(a)||this.ik.assign(a)});D.defineProperty(Xj,{il:"isGridSnapEnabled"},function(){return this.ss},function(a){D.h(a,"boolean",Xj,"isGridSnapEnabled");this.ss=a});D.w(Xj,{EG:"originalDesiredSize"},function(){return this.cE});D.w(Xj,{YJ:"originalLocation"},function(){return this.hE});
function dk(){0<arguments.length&&D.zd(dk);Hg.call(this);this.name="Rotating";this.sE=45;this.rE=2;this.Vc=null;var a=new A;a.Ob="Ellipse";a.Ea=Zd;a.fill="lightblue";a.stroke="dodgerblue";a.pb=1;a.cursor="pointer";this.Ll=a;this.yc=null;this.Rw=0;this.nE=new N}D.Ta(dk,Hg);D.ka("RotatingTool",dk);
dk.prototype.updateAdornments=function(a){if(null!==a){if(a instanceof J){var b=a.YB;if(b===a||b===a.path||b.We)return}if(a.mb&&null!==this.g&&!this.g.sb&&(b=a.YB,null!==b&&a.canRotate()&&a.Y.F()&&a.isVisible()&&b.Y.F()&&b.Uj())){var c=a.rq(this.name);if(null===c||c.Cb!==b)c=this.makeAdornment(b);if(null!==c){c.angle=b.ym();var d=null,e=null;b===a||b===a.Cf?(d=a.Cf,e=a.Pf):(d=b,e=mc);for(var g=d.Fa,e=D.Db(g.width*e.x+e.offsetX,g.height*e.y+e.offsetY);null!==d&&d!==b;)d.transform.vb(e),d=d.Q;var d=
e.y,g=Math.max(e.x-b.Fa.width,0),h=D.O();c.location=b.gb(new R(1,0,50+g,d),h);D.A(h);D.A(e);a.im(this.name,c);return}}a.$j(this.name)}};dk.prototype.makeAdornment=function(a){var b=null,b=a.$.iK;if(null===b){b=new ca;b.type=ek;b.Pf=mc;var c=this.Ju;null!==c&&b.add(c.copy())}else if(Sh(b),b=b.copy(),null===b)return null;b.Cb=a;return b};D.defineProperty(dk,{Ju:"handleArchetype"},function(){return this.Ll},function(a){null!==a&&D.l(a,O,dk,"handleArchetype");this.Ll=a});D.w(dk,{handle:"handle"},function(){return this.yc});
D.defineProperty(dk,{Cb:"adornedObject"},function(){return this.Vc},function(a){null!==a&&D.l(a,O,dk,"adornedObject");this.Vc=a});dk.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null!==a&&!a.sb&&a.Fx&&a.U.left?null!==this.findToolHandleAt(a.Dc.ha,this.name):!1};
dk.prototype.doActivate=function(){var a=this.g;if(null!==a&&(this.yc=this.findToolHandleAt(a.Dc.ha,this.name),null!==this.yc)){this.Vc=this.yc.$.Cb;var b=this.Vc.$,c=b.Cf;this.nE=this.Vc===b||this.Vc===c?c.gb(b.Pf):this.Vc.gb(mc);this.Rw=this.Vc.angle;a.of=!0;a.ZA=!0;this.Qb(this.name);this.xa=!0}};dk.prototype.doDeactivate=function(){var a=this.g;null!==a&&(this.pl(),this.Vc=this.yc=null,this.xa=a.of=!1)};dk.prototype.doCancel=function(){var a=this.g;null!==a&&(a.ZA=!1);this.rotate(this.Rw);this.stopTool()};
dk.prototype.doMouseMove=function(){var a=this.g;this.xa&&null!==a&&(a=this.computeRotate(a.U.ha),this.rotate(a))};dk.prototype.doMouseUp=function(){var a=this.g;if(this.xa&&null!==a){a.ZA=!1;var b=this.computeRotate(a.U.ha);this.rotate(b);a.Rc();this.Tf=this.name;a.Ka("PartRotated",this.Vc,this.Rw)}this.stopTool()};dk.prototype.rotate=function(a){v&&D.p(a,dk,"rotate:newangle");null!==this.Vc&&(this.Vc.angle=a)};
dk.prototype.computeRotate=function(a){a=this.nE.Yb(a);var b=this.Vc.Q;null!==b&&(a-=b.ym(),360<=a?a-=360:0>a&&(a+=360));var b=Math.min(Math.abs(this.wK),180),c=Math.min(Math.abs(this.vK),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,{wK:"snapAngleMultiple"},function(){return this.sE},function(a){D.h(a,"number",dk,"snapAngleMultiple");this.sE=a});
D.defineProperty(dk,{vK:"snapAngleEpsilon"},function(){return this.rE},function(a){D.h(a,"number",dk,"snapAngleEpsilon");this.rE=a});D.w(dk,{pM:"originalAngle"},function(){return this.Rw});function fk(){Hg.call(this);0<arguments.length&&D.zd(fk);this.name="ClickSelecting"}D.Ta(fk,Hg);D.ka("ClickSelectingTool",fk);fk.prototype.canStart=function(){return!this.isEnabled||null===this.g||this.isBeyondDragSize()?!1:!0};
fk.prototype.doMouseUp=function(){this.xa&&(this.standardMouseSelect(),!this.standardMouseClick()&&null!==this.g&&this.g.U.Sj&&this.g.bb.doToolTip());this.stopTool()};function gk(){Hg.call(this);0<arguments.length&&D.zd(gk);this.name="Action";this.Ko=null}D.Ta(gk,Hg);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.Q&&!a.Mu;)a=a.Q;return a});if(null!==c){if(!c.Mu)return!1;this.Ko=c;a.Vo=a.Je(b.ha,null,null);return!0}return!1};gk.prototype.doMouseDown=function(){if(this.xa){var a=this.g.U,b=this.Ko;null!==b&&(a.Oe=b,null!==b.RE&&b.RE(a,b))}else this.canStart()&&this.doActivate()};
gk.prototype.doMouseMove=function(){if(this.xa){var a=this.g.U,b=this.Ko;null!==b&&(a.Oe=b,null!==b.SE&&b.SE(a,b))}};gk.prototype.doMouseUp=function(){if(this.xa){var a=this.g,b=a.U,c=this.Ko;if(null===c)return;b.Oe=c;null!==c.TE&&c.TE(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.Ko;if(null===b)return;a.Oe=b;null!==b.QE&&b.QE(a,b)}this.stopTool()};gk.prototype.doStop=function(){this.Ko=null};
function ra(){Hg.call(this);0<arguments.length&&D.zd(ra);this.name="ClickCreating";this.Cl=null;this.JD=!0;this.wD=new N(0,0)}D.Ta(ra,Hg);D.ka("ClickCreatingTool",ra);
ra.prototype.canStart=function(){if(!this.isEnabled||null===this.MA)return!1;var a=this.g;if(null===a||a.sb||a.Nf||!a.dq||!a.U.left||this.isBeyondDragSize())return!1;if(this.oJ){if(1===a.U.Fe&&(this.wD=a.U.Sd.copy()),2!==a.U.Fe||this.isBeyondDragSize(this.wD))return!1}else if(1!==a.U.Fe)return!1;return a.cb!==this&&null!==a.yu(a.U.ha,!0)?!1:!0};ra.prototype.doMouseUp=function(){var a=this.g;this.xa&&null!==a&&this.insertPart(a.U.ha);this.stopTool()};
ra.prototype.insertPart=function(a){var b=this.g;if(null===b)return null;var c=this.MA;if(null===c)return null;this.Qb(this.name);var d=null;c instanceof F?c.te()&&(Sh(c),d=c.copy(),null!==d&&b.add(d)):null!==c&&(c=b.ea.copyNodeData(c),D.Qa(c)&&(b.ea.jm(c),d=b.Oh(c)));null!==d&&(d.location=a,b.Kf&&b.select(d));b.Rc();this.Tf=this.name;b.Ka("PartCreated",d);this.pl();return d};
D.defineProperty(ra,{MA:"archetypeNodeData"},function(){return this.Cl},function(a){null!==a&&D.l(a,Object,ra,"archetypeNodeData");this.Cl=a});D.defineProperty(ra,{oJ:"isDoubleClick"},function(){return this.JD},function(a){D.h(a,"boolean",ra,"isDoubleClick");this.JD=a});function hk(){this.ME=this.TD=this.aA=this.vA=null}D.ka("HTMLInfo",hk);D.defineProperty(hk,{DB:"mainElement"},function(){return this.TD},function(a){null!==a&&D.l(a,HTMLElement,hk,"mainElement");this.TD=a});
D.defineProperty(hk,{show:"show"},function(){return this.vA},function(a){this.vA!==a&&(null!==a&&D.h(a,"function",hk,"show"),this.vA=a)});D.defineProperty(hk,{co:"hide"},function(){return this.aA},function(a){this.aA!==a&&(null!==a&&D.h(a,"function",hk,"hide"),this.aA=a)});D.defineProperty(hk,{xC:"valueFunction"},function(){return this.ME},function(a){this.ME=a});function ik(a,b,c){this.text=a;this.iF=b;this.visible=c}
function jk(){Hg.call(this);0<arguments.length&&D.zd(jk);this.name="ContextMenu";this.aD=this.Ez=this.YC=null;this.ZD=new N;this.Gz=this.Ym=null;var a=this;this.CA=function(){a.stopTool()};kk(this)}D.Ta(jk,Hg);D.ka("ContextMenuTool",jk);
function kk(a){var b=new hk;b.show=function(a,b,c){c.showDefaultContextMenu()};b.co=function(a,b){b.hideDefaultContextMenu()};a.Ym=b;a.CA=function(){a.stopTool()};if(!1===D.pF){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.qu=b;D.pu=c;D.pF=!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.Ym&&a.U.Sj||null!==this.findObjectWithContextMenu()?!0:!1};jk.prototype.doStart=function(){var a=this.g;null!==a&&this.ZD.set(a.Dc.ha)};
jk.prototype.doStop=function(){this.hideContextMenu();this.Ox=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.Sc}));if(null!==d){for(a=d;null!==a;){if(null!==a.contextMenu)return a;a=a.Q}if(null!==this.Ym&&b.U.Sj)return d.$}else if(null!==b.contextMenu)return b;return null};jk.prototype.doActivate=function(){};
jk.prototype.doMouseDown=function(){Hg.prototype.doMouseDown.call(this);null!==this.g&&this.g.bb.qf.contains(this)&&mk(this)};jk.prototype.doMouseUp=function(){mk(this)};function mk(a){var b=a.g;if(null!==b)if(a.xa){var c=a.rm;if(null!==c){if(!(c instanceof hk)){var d=b.Je(b.U.ha,null,null);null!==d&&d.Dm(c)&&a.standardMouseClick(null,null)}a.stopTool();a.canStart()&&(b.cb=a,a.doMouseUp())}}else a.canStart()&&(Yh(a,!0),a.xa||a.stopTool())}
function Yh(a,b,c){void 0===c&&(c=null);b&&a.standardMouseSelect();if(!a.standardMouseClick())if(a.xa=!0,b=a.Ym,null===c&&(c=a.findObjectWithContextMenu()),null!==c){var d=c.contextMenu;null!==d?(a.Ox=c instanceof O?c:null,a.showContextMenu(d,a.Ox)):null!==b&&a.showContextMenu(b,a.Ox)}else null!==b&&a.showContextMenu(b,null)}jk.prototype.doMouseMove=function(){this.xa&&null!==this.g&&this.g.bb.doMouseMove()};
jk.prototype.showContextMenu=function(a,b){!v||a instanceof ca||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.rm&&this.hideContextMenu();if(a instanceof ca){a.Of="Tool";a.nl=!1;a.scale=1/c.scale;a.wd=this.name;null!==a.placeholder&&(a.placeholder.scale=c.scale);var d=a.g;null!==d&&d!==c&&d.remove(a);c.add(a);null!==b?(c=null,d=b.wm(),null!==d&&(c=d.data),a.Cb=b,a.data=c):a.data=c.ea;
a.Ue();this.positionContextMenu(a,b)}else a instanceof hk&&a.show(b,c,this);this.rm=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.Ia,e=b.wb;b.U.Sj&&(c.x-=d.width);c.x+d.width>e.right&&(c.x-=d.width+5/b.scale);c.x<e.x&&(c.x=e.x);c.y+d.height>e.bottom&&(c.y-=d.height+5/b.scale);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.rm;null!==b&&(b instanceof ca?(a.remove(b),null!==this.Ez&&this.Ez.$j(b.wd),b.data=null,b.Cb=null):b instanceof hk&&(null!==b.co?b.co(a,this):null!==b.DB&&(b.DB.style.display="none")),this.rm=null,this.standardMouseOver())}};
function nk(a){if(null===a.g)return null;a=new K(ik);a.add(new ik("Copy",function(a){a.xb.copySelection()},function(a){return a.xb.canCopySelection()}));a.add(new ik("Cut",function(a){a.xb.cutSelection()},function(a){return a.xb.canCutSelection()}));a.add(new ik("Delete",function(a){a.xb.deleteSelection()},function(a){return a.xb.canDeleteSelection()}));a.add(new ik("Paste",function(a){a.xb.pasteSelection(a.U.ha)},function(a){return a.xb.canPasteSelection()}));a.add(new ik("Select All",function(a){a.xb.selectAll()},
function(a){return a.xb.canSelectAll()}));a.add(new ik("Undo",function(a){a.xb.undo()},function(a){return a.xb.canUndo()}));a.add(new ik("Redo",function(a){a.xb.redo()},function(a){return a.xb.canRedo()}));a.add(new ik("Scroll To Part",function(a){a.xb.scrollToPart()},function(a){return a.xb.canScrollToPart()}));a.add(new ik("Zoom To Fit",function(a){a.xb.zoomToFit()},function(a){return a.xb.canZoomToFit()}));a.add(new ik("Reset Zoom",function(a){a.xb.resetZoom()},function(a){return a.xb.canResetZoom()}));
a.add(new ik("Group Selection",function(a){a.xb.groupSelection()},function(a){return a.xb.canGroupSelection()}));a.add(new ik("Ungroup Selection",function(a){a.xb.ungroupSelection()},function(a){return a.xb.canUngroupSelection()}));a.add(new ik("Edit Text",function(a){a.xb.editTextBlock()},function(a){return a.xb.canEditTextBlock()}));return a}
jk.prototype.showDefaultContextMenu=function(){var a=this.g;if(null!==a){null===this.Gz&&(this.Gz=nk(this));D.qu.innerHTML="";D.pu.addEventListener("click",this.CA,!1);var b=this,c=D.createElement("ul");c.className="goCXul";D.qu.appendChild(c);c.innerHTML="";for(var d=this.Gz.j;d.next();){var e=d.value,g=e.visible;if("function"===typeof e.iF&&("function"!==typeof g||g(a))){g=D.createElement("li");g.className="goCXli";var h=D.createElement("a");h.className="goCXa";h.href="#";h.EH=e.iF;h.addEventListener("click",
function(c){this.EH(a);b.stopTool();c.preventDefault();return!1},!1);h.textContent=e.text;g.appendChild(h);c.appendChild(g)}}D.qu.style.display="block";D.pu.style.display="block"}};jk.prototype.hideDefaultContextMenu=function(){null!==this.rm&&this.rm===this.Ym&&(D.qu.style.display="none",D.pu.style.display="none",D.pu.removeEventListener("click",this.CA,!1),this.rm=null)};
D.defineProperty(jk,{rm:"currentContextMenu"},function(){return this.YC},function(a){!v||null===a||a instanceof ca||a instanceof hk||D.k("ContextMenuTool.currentContextMenu must be an Adornment or HTMLInfo.");this.YC=a;this.Ez=a instanceof ca?a.hf:null});D.defineProperty(jk,{IL:"defaultTouchContextMenu"},function(){return this.Ym},function(a){!v||null===a||a instanceof ca||a instanceof hk||D.k("ContextMenuTool.defaultTouchContextMenu must be an Adornment or HTMLInfo.");this.Ym=a});
D.defineProperty(jk,{Ox:"currentObject"},function(){return this.aD},function(a){null!==a&&D.l(a,O,jk,"currentObject");this.aD=a});D.w(jk,{kM:"mouseDownPoint"},function(){return this.ZD});function ok(){Hg.call(this);0<arguments.length&&D.zd(ok);this.name="DragSelecting";this.ap=175;this.OD=!1;var a=new F;a.Of="Tool";a.nl=!1;var b=new A;b.name="SHAPE";b.Ob="Rectangle";b.fill=null;b.stroke="magenta";a.add(b);this.Vm=a}D.Ta(ok,Hg);D.ka("DragSelectingTool",ok);
ok.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||!a.Kf)return!1;var b=a.U;return!b.left||a.cb!==this&&(!this.isBeyondDragSize()||b.timestamp-a.Dc.timestamp<this.qF||null!==a.yu(b.ha,!0))?!1:!0};ok.prototype.doActivate=function(){var a=this.g;null!==a&&(this.xa=!0,a.of=!0,a.ob=!0,a.add(this.Lh),this.doMouseMove())};ok.prototype.doDeactivate=function(){var a=this.g;null!==a&&(ji(a),a.remove(this.Lh),a.ob=!1,this.xa=a.of=!1)};
ok.prototype.doMouseMove=function(){var a=this.g;if(null!==a&&this.xa&&null!==this.Lh){var b=this.computeBoxBounds(),c=this.Lh.Md("SHAPE");null===c&&(c=this.Lh.Ld());c.Ea=b.size;this.Lh.position=b.position;(a.Ce||a.De)&&a.$A(a.U.Sd)}};ok.prototype.doMouseUp=function(){if(this.xa){var a=this.g;a.remove(this.Lh);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.Dc.ha,a.U.ha)};
ok.prototype.selectInRect=function(a){var b=this.g;if(null!==b){var c=b.U;b.Ka("ChangingSelection");a=b.$k(a,null,function(a){return a instanceof F?a.canSelect():!1},this.uJ);if(D.Rh?c.av:c.control)if(c.shift)for(a=a.j;a.next();)c=a.value,c.mb&&(c.mb=!1);else for(a=a.j;a.next();)c=a.value,c.mb=!c.mb;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.mb=!1}for(a=a.j;a.next();)c=a.value,c.mb||(c.mb=!0)}b.Ka("ChangedSelection")}};
D.defineProperty(ok,{qF:"delay"},function(){return this.ap},function(a){D.h(a,"number",ok,"delay");this.ap=a});D.defineProperty(ok,{uJ:"isPartialInclusion"},function(){return this.OD},function(a){D.h(a,"boolean",ok,"isPartialInclusion");this.OD=a});D.defineProperty(ok,{Lh:"box"},function(){return this.Vm},function(a){null!==a&&D.l(a,F,ok,"box");this.Vm=a});
function pk(){Hg.call(this);0<arguments.length&&D.zd(pk);this.name="Panning";this.mA=new N;this.hk=!1;var a=this;this.wE=function(){window.document.removeEventListener("scroll",a.wE,!1);a.stopTool()}}D.Ta(pk,Hg);D.ka("PanningTool",pk);pk.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null===a||!a.Ce&&!a.De||!a.U.left||a.cb!==this&&!this.isBeyondDragSize()?!1:!0};
pk.prototype.doActivate=function(){var a=this.g;null!==a&&(this.hk?(a.U.bubbles=!0,window.document.addEventListener("scroll",this.wE,!1)):(a.sc="move",a.of=!0,this.mA=a.position.copy()),this.xa=!0)};pk.prototype.doDeactivate=function(){var a=this.g;null!==a&&(a.sc="",this.xa=a.of=!1)};pk.prototype.doCancel=function(){var a=this.g;null!==a&&(a.position=this.mA,a.of=!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.xa&&a)if(this.hk)a.U.bubbles=!0;else{var b=a.position,c=a.Dc.ha,d=a.U.ha,e=b.x+c.x-d.x,c=b.y+c.y-d.y;a.Ce||(e=b.x);a.De||(c=b.y);a.position=new N(e,c)}};D.defineProperty(pk,{bubbles:"bubbles"},function(){return this.hk},function(a){D.h(a,"boolean",pk,"bubbles");this.hk=a});D.w(pk,{sM:"originalPosition"},function(){return this.mA});
function qk(){0<arguments.length&&D.zd(qk);Hg.call(this);this.name="TextEditing";this.AA=this.Mk=null;this.vE=rk;this.em=null;this.$a=sk;this.ft=null;this.WD=1;this.pE=!0;var a=new hk;this.cD=null;this.kD=a;this.Hz=null;tk(this,a)}D.ka("TextEditingTool",qk);D.Ta(qk,Hg);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.Hz=c;c.addEventListener("input",function(){if(null!==a.ih){var b=a.LJ(this.value);this.style.width=20+b.Ia.width*this.AK+"px";this.rows=b.vy}},!1);c.addEventListener("keydown",function(b){if(null!==a.ih){var c=b.which;13===c?(!1===a.ih.oy&&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.xC=function(){return c.value};b.DB=c;b.show=function(a,b,g){if(g.state===Ck)c.style.border="3px solid red",c.focus();else{var h=a.gb(mc),k=b.position,l=b.scale,m=a.Mj()*l;m<g.yG&&(m=g.yG);var n=a.Fa.width*m+6,p=a.Fa.height*m+2,q=(h.x-k.x)*l,h=(h.y-k.y)*l;c.value=a.text;b.Kj.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.left=(q-n/2|0)-1+"px";c.style.top=
(h-p/2|0)-1+"px";c.style.textAlign=a.textAlign;c.style.margin="0";c.style.padding="1px";c.style.border="0";c.style.outline="none";c.style.whiteSpace="pre-wrap";c.style.overflow=" hidden";c.rows=a.vy;c.AK=m;b.Kj.appendChild(c);c.focus();g.Wy&&(c.select(),c.setSelectionRange(0,9999))}};b.co=function(a){a.Kj.removeChild(c)}}D.defineProperty(qk,{ih:"textBlock"},function(){return this.AA},function(a){null!==a&&D.l(a,na,qk,"textBlock");this.AA=a});
D.defineProperty(qk,{Ij:"currentTextEditor"},function(){return this.cD},function(a){this.cD=a});D.defineProperty(qk,{yI:"defaultTextEditor"},function(){return this.kD},function(a){!v||a instanceof HTMLElement||a instanceof hk||D.k("TextEditingTool.defaultTextEditor must be an Element or HTMLInfo.");this.kD=a});D.defineProperty(qk,{iH:"starting"},function(){return this.vE},function(a){D.Da(a,qk,qk,"starting");this.vE=a});
qk.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||a.sb||!a.U.left||this.isBeyondDragSize())return!1;var b=a.Je(a.U.ha);if(!(null!==b&&b instanceof na&&b.cB&&b.$.canEdit()))return!1;b=b.$;return null===b||this.iH===rk&&!b.mb||this.iH===yk&&2>a.U.Fe?!1:!0};qk.prototype.doStart=function(){this.xa||null===this.ih||this.doActivate()};
qk.prototype.doActivate=function(){if(!this.xa){var a=this.g;if(null!==a){var b=this.ih;null===b&&(b=a.Je(a.U.ha));if(null!==b&&b instanceof na&&(this.ih=b,null!==b.$)){this.xa=!0;this.$a=zk;var c=this.yI;null!==b.nH&&(c=b.nH);this.Mk=this.ih.copy();var d=new C(this.ih.gb(ic),this.ih.gb(vc));a.WG(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.Kj.appendChild(c);"function"===typeof c.focus&&
c.focus();"function"===typeof c.select&&this.Wy&&(c.select(),c.setSelectionRange(0,9999))}this.Ij=c}}}};qk.prototype.doCancel=function(){null!==this.ft&&this.Ij instanceof HTMLElement&&(this.Ij.style.border=this.ft,this.ft=null);this.stopTool()};qk.prototype.doMouseUp=function(){!this.xa&&this.canStart()&&this.doActivate()};qk.prototype.doMouseDown=function(){this.xa&&this.acceptText(vk)};
qk.prototype.acceptText=function(a){switch(a){case vk:if(this.$a===Dk)this.Ij instanceof HTMLElement&&this.Ij.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.AA.oy)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.Ij;if(null!==b&&null!==d){var e=b.text,g="";d instanceof hk?null!==d.xC&&(g=d.xC()):(g=d.value,g="function"===typeof g?g():g);a.isValidText(b,e,g)?(a.Qb(a.name),a.$a=Dk,a.Tf=a.name,b.text=g,null!==b.mH&&b.mH(b,e,g),null!==c&&c.Ka("TextEdited",b,e),a.pl(),a.stopTool(),null!==c&&c.doFocus()):(a.$a=Ck,null!==b.dB&&b.dB(a,e,g),d instanceof hk?d.show(b,c,a):(null===a.ft&&(a.ft=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.Ij){var b=this.Ij;if(b instanceof hk)b.co(a,this);else{if("function"===typeof b.onDeactivate)b.onDeactivate();null!==b&&a.Kj.removeChild(b)}}this.xa=!1}};qk.prototype.doFocus=function(){v&&D.Vn("TextEditingTool.doFocus","2.0");Ek(this)};qk.prototype.doBlur=function(){v&&D.Vn("TextEditingTool.doBlur","2.0");Fk(this)};
function Ek(a){if(null!==a.Ij&&a.state!==sk){var b=a.Hz;a.$a===zk&&(a.$a=Ak);"function"===typeof b.select&&a.Wy&&(b.select(),b.setSelectionRange(0,9999))}}function Fk(a){if(null!==a.Ij&&a.state!==sk){var b=a.Hz;"function"===typeof b.focus&&b.focus();"function"===typeof b.select&&a.Wy&&(b.select(),b.setSelectionRange(0,9999))}}qk.prototype.isValidText=function(a,b,c){D.l(a,na,qk,"isValidText:textblock");var d=this.nC;if(null!==d&&!d(a,b,c))return!1;d=a.nC;return null===d||d(a,b,c)?!0:!1};
D.defineProperty(qk,{nC:"textValidation"},function(){return this.em},function(a){null!==a&&D.h(a,"function",qk,"textValidation");this.em=a});D.defineProperty(qk,{yG:"minimumEditorScale"},function(){return this.WD},function(a){null!==a&&D.h(a,"number",qk,"minimumEditorScale");this.WD=a});D.defineProperty(qk,{Wy:"selectsTextOnActivate"},function(){return this.pE},function(a){null!==a&&D.h(a,"boolean",qk,"selectsTextOnActivate");this.pE=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.LJ=function(a){var b=this.Mk;b.text=a;Hk(b,this.ih.xp,Infinity);return b};function Ph(){Hg.call(this);this.name="ToolManager";this.JH=new K(Hg);this.KH=new K(Hg);this.LH=new K(Hg);this.AD=this.BD=850;this.pD=(new Ba(2,2)).Oa();this.IE=5E3;this.$D=ai;this.yD=Ik;this.$v=this.dD=null;this.Fn=-1}D.Ta(Ph,Hg);
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 Kk;Ph.GestureNone=Kk=D.s(Ph,"GestureNone",5);D.defineProperty(Ph,{dv:"mouseWheelBehavior"},function(){return this.$D},function(a){D.Da(a,Ph,Ph,"mouseWheelBehavior");this.$D=a});
D.defineProperty(Ph,{cl:"gestureBehavior"},function(){return this.yD},function(a){D.Da(a,Ph,Ph,"gestureBehavior");this.yD=a});Ph.prototype.initializeStandardTools=function(){this.VH=new gk;this.HG=new fi;this.DJ=new yj;this.TG=new Xj;this.kK=new dk;this.uG=new qa;this.pe=new Uh;this.CI=new ok;this.ZJ=new pk;this.UA=new jk;this.mC=new qk;this.hI=new ra;this.iI=new fk};
Ph.prototype.updateAdornments=function(a){var b=this.sm;if(b instanceof ca&&this.$v===a){var c=b.Cb;(null!==a?c.$===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.Sj&&this.cl===Jk&&(b.bubbles=!1);if(b.Su){this.cancelWaitAfter();if(this.cl===Kk){b.bubbles=!0;return}if(this.cl===Jk)return;if(a.cb.canStartMultiTouch()){a.cb.standardPinchZoomStart();return}}var c=a.na;c.OA&&0!==c.Oi&&D.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");for(var c=this.qf.length,d=0;d<c;d++){var e=this.qf.fa(d);null===e.g&&e.cd(this.g);if(e.canStart()){a.doFocus();a.cb=e;
a.cb===e&&(e.xa||e.doActivate(),e.doMouseDown());return}}1===a.U.button&&(this.dv===ai?this.dv=$h:this.dv===$h&&(this.dv=ai));this.doActivate();this.standardWaitAfter(this.$F,b)}};
Ph.prototype.doMouseMove=function(){var a=this.g;if(null!==a){var b=a.U;if(b.Su){if(this.cl===Kk){b.bubbles=!0;return}if(this.cl===Jk)return;if(a.cb.canStartMultiTouch()){a.cb.standardPinchZoomMove();return}}if(this.xa)for(var c=this.ng.length,d=0;d<c;d++){var e=this.ng.fa(d);null===e.g&&e.cd(this.g);if(e.canStart()){a.doFocus();a.cb=e;a.cb===e&&(e.xa||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.xa?a.$F:a.gJ,b.U)}Ph.prototype.doCurrentObjectChanged=function(a,b){var c=this.sm;null===c||null!==b&&c instanceof ca&&(b===c||b.Dm(c))||this.hideToolTip()};Ph.prototype.doWaitAfter=function(a){var b=this.g;null!==b&&b.Gb&&(this.doMouseHover(),this.xa||this.doToolTip(),a.Sj&&!b.U.Ec&&(a=a.copy(),a.button=2,a.buttons=2,b.U=a,b.Xp=!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.Ec=!1;null!==c;){a=this.xa?c.IB:c.JB;if(null!==a&&(a(b,c),b.Ec))break;c=c.Q}else c=this.xa?a.IB:a.JB,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.sm,!(a instanceof ca)||b!==a&&!b.Dm(a)){for(;null!==b;){a=b.pC;if(null!==a){this.showToolTip(a,b);return}b=b.Q}this.hideToolTip()}}else a=a.pC,null!==a?this.showToolTip(a,null):this.hideToolTip()}};
Ph.prototype.showToolTip=function(a,b){!v||a instanceof ca||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.sm&&this.hideToolTip();if(a instanceof ca){a.Of="Tool";a.nl=!1;a.scale=1/c.scale;a.wd="ToolTip";null!==a.placeholder&&(a.placeholder.scale=c.scale);var d=a.g;null!==d&&d!==c&&d.remove(a);c.add(a);null!==b?(c=null,d=b.wm(),null!==d&&(c=d.data),a.Cb=b,a.data=c):a.data=c.ea;a.Ue();this.positionToolTip(a,
b)}else a instanceof hk&&a!==this.sm&&a.show(b,c,this);this.sm=a;-1!==this.Fn&&(D.clearTimeout(this.Fn),this.Fn=-1);c=this.FK;if(0<c&&Infinity!==c){var e=this;this.Fn=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.Ia,e=b.wb;b.U.Sj&&(c.x-=d.width);c.x+d.width>e.right&&(c.x-=d.width+5/b.scale);c.x<e.x&&(c.x=e.x);c.y=c.y+20/b.scale+d.height>e.bottom?c.y-(d.height+5/b.scale):c.y+20/b.scale;c.y<e.y&&(c.y=e.y);a.position=c}}};
Ph.prototype.hideToolTip=function(){-1!==this.Fn&&(D.clearTimeout(this.Fn),this.Fn=-1);var a=this.g;if(null!==a){var b=this.sm;null!==b&&(b instanceof ca?(a.remove(b),null!==this.$v&&this.$v.$j(b.wd),b.data=null,b.Cb=null):b instanceof hk&&null!==b.co&&b.co(a,this),this.sm=null)}};
D.defineProperty(Ph,{sm:"currentToolTip"},function(){return this.dD},function(a){!v||null===a||a instanceof ca||a instanceof hk||D.k("ToolManager.currentToolTip must be an Adornment or HTMLInfo.");this.dD=a;this.$v=null!==a&&a instanceof ca?a.hf:null});
Ph.prototype.doMouseUp=function(){this.cancelWaitAfter();var a=this.g;if(null!==a){if(this.xa)for(var b=this.og.length,c=0;c<b;c++){var d=this.og.fa(c);null===d.g&&d.cd(this.g);if(d.canStart()){a.doFocus();a.cb=d;a.cb===d&&(d.xa||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.xb.doKeyDown()};Ph.prototype.doKeyUp=function(){var a=this.g;null!==a&&a.xb.doKeyUp()};
Ph.prototype.doCancel=function(){null!==di&&di.doCancel();Hg.prototype.doCancel.call(this)};Ph.prototype.findTool=function(a){D.h(a,"string",Ph,"findTool:name");for(var b=this.qf.length,c=0;c<b;c++){var d=this.qf.fa(c);if(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;b=this.og.length;for(c=0;c<b;c++)if(d=this.og.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,Hg,Ph,"replaceTool:newtool"),b.g&&b.g!==this.g&&D.k("Cannot share tools between Diagrams: "+b.toString()),b.cd(this.g));for(var c=this.qf.length,d=0;d<c;d++){var e=this.qf.fa(d);if(e.name===a)return null!==b?this.qf.ug(d,b):this.qf.qd(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.qd(d),e;c=this.og.length;for(d=0;d<c;d++)if(e=this.og.fa(d),e.name===
a)return null!==b?this.og.ug(d,b):this.og.qd(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,Hg,Ph,"replaceStandardTool:newtool"),c.g&&c.g!==a.g&&D.k("Cannot share tools between Diagrams: "+c.toString()),c.name=b,c.cd(a.g));a.findTool(b)?a.replaceTool(b,c):null!==c&&d.add(c)}D.w(Ph,{qf:"mouseDownTools"},function(){return this.JH});D.w(Ph,{ng:"mouseMoveTools"},function(){return this.KH});
D.w(Ph,{og:"mouseUpTools"},function(){return this.LH});D.defineProperty(Ph,{gJ:"hoverDelay"},function(){return this.BD},function(a){D.h(a,"number",Ph,"hoverDelay");this.BD=a});D.defineProperty(Ph,{$F:"holdDelay"},function(){return this.AD},function(a){D.h(a,"number",Ph,"holdDelay");this.AD=a});D.defineProperty(Ph,{DI:"dragSize"},function(){return this.pD},function(a){D.l(a,Ba,Ph,"dragSize");this.pD=a.V()});
D.defineProperty(Ph,{FK:"toolTipDuration"},function(){return this.IE},function(a){D.h(a,"number",Ph,"toolTipDuration");this.IE=a});D.defineProperty(Ph,{VH:"actionTool"},function(){return this.findTool("Action")},function(a){Yk(this,"Action",a,this.qf)});D.defineProperty(Ph,{HG:"relinkingTool"},function(){return this.findTool("Relinking")},function(a){Yk(this,"Relinking",a,this.qf)});
D.defineProperty(Ph,{DJ:"linkReshapingTool"},function(){return this.findTool("LinkReshaping")},function(a){Yk(this,"LinkReshaping",a,this.qf)});D.defineProperty(Ph,{TG:"resizingTool"},function(){return this.findTool("Resizing")},function(a){Yk(this,"Resizing",a,this.qf)});D.defineProperty(Ph,{kK:"rotatingTool"},function(){return this.findTool("Rotating")},function(a){Yk(this,"Rotating",a,this.qf)});
D.defineProperty(Ph,{uG:"linkingTool"},function(){return this.findTool("Linking")},function(a){Yk(this,"Linking",a,this.ng)});D.defineProperty(Ph,{pe:"draggingTool"},function(){return this.findTool("Dragging")},function(a){Yk(this,"Dragging",a,this.ng)});D.defineProperty(Ph,{CI:"dragSelectingTool"},function(){return this.findTool("DragSelecting")},function(a){Yk(this,"DragSelecting",a,this.ng)});
D.defineProperty(Ph,{ZJ:"panningTool"},function(){return this.findTool("Panning")},function(a){Yk(this,"Panning",a,this.ng)});D.defineProperty(Ph,{UA:"contextMenuTool"},function(){return this.findTool("ContextMenu")},function(a){Yk(this,"ContextMenu",a,this.og)});D.defineProperty(Ph,{mC:"textEditingTool"},function(){return this.findTool("TextEditing")},function(a){Yk(this,"TextEditing",a,this.og)});
D.defineProperty(Ph,{hI:"clickCreatingTool"},function(){return this.findTool("ClickCreating")},function(a){Yk(this,"ClickCreating",a,this.og)});D.defineProperty(Ph,{iI:"clickSelectingTool"},function(){return this.findTool("ClickSelecting")},function(a){Yk(this,"ClickSelecting",a,this.og)});
function jh(){this.eD=Zk;this.Sr=this.Tr=this.ca=null;this.Tm=this.Ur=this.Vr=0;this.No=this.Ac=this.sp=this.vk=!1;this.Ql=this.rf=!0;this.Yv=this.Xv=this.$C=null;this.ZC=0;this.Zv=null;this.Nv=new L("string");this.Pz=600;this.MH=new N(0,0);this.OC=this.NC=this.LE=!1;this.qn=new ma(O,$k)}D.ka("AnimationManager",jh);jh.prototype.cd=function(a){this.ca=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(jh,{lL:"animationReasons"},function(){return this.Nv});
jh.prototype.canStart=function(){return!0};jh.prototype.prepareAutomaticAnimation=jh.prototype.wo=function(a){this.rf&&(this.Ql||this.ca.ho)&&(this.Nv.add(a),this.canStart(a)&&(this.vk&&this.ai(),this.Ac=!0))};function el(a){if(a.rf&&(a.Nv.clear(),a.Ac))if(!a.No)a.Ac=!1;else if(0===a.Tm){var b=+new Date;a.Tm=b;requestAnimationFrame(function(){if(!1!==a.Ac&&!a.vk&&a.Tm===b){var c=a.ca;c.el("temporaryPixelRatio")&&(c.Lk=1);fl(c);a.Ac=!1;c.Ka("AnimationStarting");gl(a,b)}})}}
function hl(a,b,c,d,e,g){if(a.Ac&&(v&&D.l(b,O,jh,"addPropToAnimation:obj"),!("position"===c&&d.P(e)||b instanceof F&&!b.dG))){var h=a.qn;if(h.contains(b)){var h=h.oa(b),k=h.start,l=h.end;void 0===k[c]&&(k[c]=il(d));h.Nx&&void 0!==l[c]?h.vu[c]=il(e):(g||(h.vu[c]=il(e)),l[c]=il(e));g&&0===c.indexOf("position:")&&b instanceof F&&(h.vu.location=il(b.location))}else k=new ja,l=new ja,k[c]=il(d),l[c]=il(e),d=l,e=k.position,e instanceof N&&!e.F()&&a.Nv.contains("Expand SubGraph")&&e.assign(d.position),k=
new $k(k,l,g),g&&0===c.indexOf("position:")&&b instanceof F&&(k.vu.location=il(b.location)),h.add(b,k);a.No=!0}}function il(a){return a instanceof N?a.copy():a instanceof Ba?a.copy():a}
function gl(a,b){var c;function d(){if(!1!==g.vk&&g.Tm===b){var a=+new Date,c=a>s?m:a-r;jl(g);kl(g,e,q,h,c,m);g.Xv&&g.Xv();cj(e);ll(g);a>s?ml(g):requestAnimationFrame(d)}}void 0===c&&(c=new ja);var e=a.ca;if(null!==e){var g=a,h=c.QL||a.eD,k=c.nM||null,l=c.oM||null,m=c.duration||a.Pz,n=a.MH;for(c=a.qn.j;c.next();){var p=c.value.start.position;p instanceof N&&(p.F()||p.assign(n))}a.$C=h;a.Xv=k;a.Yv=l;a.ZC=m;a.Zv=a.qn;var q=a.Zv;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.gb(ic),n.x+=l.padding.left,n.y+=l.padding.top,k["position:placeholder"]=n));a.vk=!0;jl(a);kl(a,e,q,h,0,m);cj(a.ca,!0);ll(a);var r=+new Date,s=r+m;g.Tm===b&&requestAnimationFrame(function(){d()})}}function jl(a){if(!a.sp){var b=a.ca;a.LE=b.ob;a.NC=b.Ye;a.OC=b.Co;b.ob=!0;b.Ye=!0;b.Co=!0;a.sp=!0}}function ll(a){var b=a.ca;b.ob=a.LE;b.Ye=a.NC;b.Co=a.OC;a.sp=!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.vB;b.vB=!0;m=a.eD;0!==a.Vr&&0!==a.Ur&&(c=a.Vr,b.Ab=m(e,c,a.Ur-c,g));null!==a.Tr&&null!==a.Sr&&(c=a.Tr,a=a.Sr,b.jb=new N(m(e,c.x,a.x-c.x,g),m(e,c.y,a.y-c.y,g)));b.vB=d}
jh.prototype.stopAnimation=jh.prototype.ai=function(){!0===this.Ac&&(this.Ac=!1,this.Tm=0,this.No&&this.ca.Le());this.vk&&this.rf&&ml(this)};
function ml(a){a.vk=!1;a.No=!1;jl(a);for(var b=a.ca,c=a.$C,d=a.ZC,e=a.Zv.j;e.next();){var g=e.key,h=e.value,k=h.start,l=h.end,m=h.vu,n;for(n in l)if(void 0!==nl[n]){var p=n;!h.Nx||"position:node"!==p&&"position:placeholder"!==p||(p="position");nl[p](g,k[n],void 0!==m[n]?m[n]:h.Nx?k[n]:l[n],c,d,d)}h.Nx&&void 0!==m.location&&g instanceof F&&(g.location=m.location);h.My&&g instanceof F&&g.Pd(!1)}for(c=a.ca.links;c.next();)d=c.value,null!==d.Mp&&(d.points=d.Mp,d.Mp=null);b.yy.clear();b.Lk=null;b.Rc();
b.ra();b.mg();ol(b);ll(a);a.Yv&&a.Yv();a.Tm=0;a.Zv=null;a.Yv=null;a.Xv=null;a.Tr=null;a.Sr=null;a.Vr=0;a.Ur=0;a.qn=new ma(O,$k);b.Ka("AnimationFinished");b.Le()}
function pl(a,b,c){var d=b.Y,e=c.Y,g=null;c instanceof I&&(g=c.placeholder);null!==g?(d=g.gb(ic),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.lc;b.next();)g=b.value,g instanceof H&&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.Ac&&(d=a.qn,d.contains(b)&&(d.oa(b).My=!0));if(b instanceof I)for(b=b.lc;b.next();)d=b.value,d instanceof H&&ql(a,d,c)}}function rl(a,b,c){a.Ac&&(null===a.Tr&&b.F()&&null===a.Sr&&(a.Tr=b.copy()),a.Sr=c.copy(),a.No=!0)}
function sl(a,b,c){a.Ac&&a.ca.ho&&(0===a.Vr&&0===a.Ur&&(a.Vr=b),a.Ur=c,a.No=!0)}D.defineProperty(jh,{isEnabled:"isEnabled"},function(){return this.rf},function(a){D.h(a,"boolean",jh,"isEnabled");this.rf=a});D.defineProperty(jh,{duration:"duration"},function(){return this.Pz},function(a){D.h(a,"number",jh,"duration");1>a&&D.va(a,">= 1",jh,"duration");this.Pz=a});D.w(jh,{nf:"isAnimating"},function(){return this.vk});D.w(jh,{vJ:"isTicking"},function(){return this.sp});
D.defineProperty(jh,{kG:"isInitial"},function(){return this.Ql},function(a){D.h(a,"boolean",jh,"isInitial");this.Ql=a});function $k(a,b,c){this.start=a;this.end=b;this.vu=new ja;this.Nx=c;this.My=!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.$y(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.Y,k=c.Y;c=k.x+k.width/2-h.width/2;h=k.y+k.height/2-h.height/2;e!==g?a.$y(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.$y(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 Gg(){0<arguments.length&&D.zd(Gg);D.xc(this);this.ca=null;this.rb=new K(F);this.ac="";this.Mc=1;this.dA=!1;this.$l=this.HA=this.zl=this.yl=this.xl=this.wl=this.ul=this.vl=this.tl=this.Bl=this.sl=this.Al=this.rl=this.ql=!0;this.bA=!1;this.jt=[]}D.ka("Layer",Gg);Gg.prototype.cd=function(a){this.ca=a};
Gg.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 H?d++:l instanceof J?g++:l instanceof ca?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.Nd(d)&&(k+=" #"+D.Nd(d)),c instanceof H?k+=" "+
ha(d):c instanceof J&&(k+=" "+ha(c.Z)+" "+ha(c.ba));return b+" "+this.rb.count+": "+k};
Gg.prototype.findObjectAt=Gg.prototype.Je=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);if(!1===this.$l)return null;v&&!a.F()&&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.O(),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.Jh),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};
Gg.prototype.findObjectsAt=Gg.prototype.xu=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.$l)return d;v&&!a.F()&&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.O(),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.Jh);var m=l;l.xu(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};
Gg.prototype.findObjectsIn=Gg.prototype.$k=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.$l)return e;v&&!a.F()&&D.k("findObjectsIn: Rect must have a real value, not: "+a.toString());var g=!1;null!==this.g&&this.g.wb.Wk(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.$k(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};Gg.prototype.eB=function(a,b,c,d,e,g,h){if(!1===this.$l)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.$k(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};
Gg.prototype.findObjectsNear=Gg.prototype.Wn=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.$l)return g;v&&!a.F()&&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.O(),l=D.O(),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.Jh);l.n(a.x+b,a.y);kb(l,p.Jh);var q=p;p.Wn(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=Gg.prototype;
f.Qf=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=D.hb(),h=D.hb(),k=0;k<e;k++){var l=d[k];l.SD=k;if(!(l instanceof J&&!1===l.Uf)){if(l instanceof ca){var m=l;if(null!==m.hf)continue}Tb(l.Y,c)?(l.Qf(!0),g.push(l)):(l.Qf(!1),null!==l.Cx&&0<l.Cx.count&&h.push(l))}}for(k=0;k<g.length;k++)for(m=l=g[k],0!==(m.T&16384)!==!1&&(m.updateAdornments(),ul(m,!1)),l=l.Cx;l.next();)m=l.value,Hk(m,Infinity,Infinity),m.rc(),m.Qf(!0);for(k=0;k<h.length;k++)l=h[k],l.updateAdornments(),
ul(l,!0);D.ua(g);D.ua(h)}};f.He=function(a,b,c){if(this.visible&&0!==this.Mc&&(void 0===c&&(c=!0),c||!this.Sc)){c=this.rb.o;var d=c.length;if(0!==d){1!==this.Mc&&(a.globalAlpha=this.Mc);var e=this.jt;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.jc&&e.push(l);if(!1===l.Uf)continue}l=k.Y;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.Mc){1!==a.Mc&&(b.globalAlpha=a.Mc);var e=a.jt;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.jc&&e.push(n);if(!1===n.Uf)continue}var n=xl(m,m.Y),p;a:{p=n;for(var q=d,r=k,s=2/g,t=4/g,u=0;u<r;u++){var z=q[u];if(0!==z.width&&0!==z.height&&p.bG(z.x-s,z.y-s,z.width+t,z.height+t)){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.pd(eg,a,this,b,c,d,e)};f.yq=function(a,b,c){var d=this.rb;b.Bw=this;if(a>=d.count)a=d.count;else if(d.fa(a)===b)return-1;d.ce(a,b);b.Ku(c);d=this.g;null!==d&&(c?d.ra():d.yq(b));yl(this,a,b);return a};
f.zf=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.zf(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.Lu(c);d.qd(a);d=this.g;null!==d&&(c?d.ra():d.zf(b));b.Bw=null;return a};
function yl(a,b,c){b=zl(a,b,c);if(c instanceof I&&null!==c&&isNaN(c.Io)){if(0!==c.lc.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.Ja===c&&(d=h,0<=b))break}!(0>d)&&d<b&&(e=a.rb,e.qd(b),e.ce(d,c))}c=c.Ja;null!==c&&yl(a,-1,c)}}
function zl(a,b,c){var d=c.Io;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).Io;if(!isNaN(h))break;g--}for(var k=b+1,l=NaN;k<e;){l=a.fa(k).Io;if(!isNaN(l))break;k++}if(!isNaN(h)&&h>d)for(;;){if(-1===g||h<=d){g++;if(g===b)break;a.qd(b);a.ce(g,c);return g}for(h=NaN;0<=--g&&(h=a.fa(g).Io,isNaN(h)););}else if(!isNaN(l)&&l<d)for(;;){if(k===e||l>=d){k--;if(k===b)break;a.qd(b);a.ce(k,c);return k}for(l=NaN;++k<e&&(l=a.fa(k).Io,
isNaN(l)););}return b}f.clear=function(){for(var a=this.rb.Hc(),b=a.length,c=0;c<b;c++)a[c].Qf(!1),this.zf(-1,a[c],!1);this.jt.length=0};D.w(Gg,{Wh:"parts"},function(){return this.rb.j});D.w(Gg,{xM:"partsBackwards"},function(){return this.rb.io});D.w(Gg,{g:"diagram"},function(){return this.ca});
D.defineProperty(Gg,{name:"name"},function(){return this.ac},function(a){D.h(a,"string",Gg,"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.jo;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.Of=this.ac}});
D.defineProperty(Gg,{opacity:"opacity"},function(){return this.Mc},function(a){var b=this.Mc;b!==a&&(D.h(a,"number",Gg,"opacity"),(0>a||1<a)&&D.va(a,"0 <= value <= 1",Gg,"opacity"),this.Mc=a,this.i("opacity",b,a),a=this.g,null!==a&&a.ra())});D.defineProperty(Gg,{Sc:"isTemporary"},function(){return this.dA},function(a){var b=this.dA;b!==a&&(D.h(a,"boolean",Gg,"isTemporary"),this.dA=a,this.i("isTemporary",b,a))});
D.defineProperty(Gg,{visible:"visible"},function(){return this.HA},function(a){var b=this.HA;if(b!==a){D.h(a,"boolean",Gg,"visible");this.HA=a;this.i("visible",b,a);for(b=this.rb.j;b.next();)b.value.Pd(a);a=this.g;null!==a&&a.ra()}});D.defineProperty(Gg,{tg:"pickable"},function(){return this.$l},function(a){var b=this.$l;b!==a&&(D.h(a,"boolean",Gg,"pickable"),this.$l=a,this.i("pickable",b,a))});
D.defineProperty(Gg,{eG:"isBoundsIncluded"},function(){return this.bA},function(a){this.bA!==a&&(this.bA=a,null!==this.g&&this.g.Rc())});D.defineProperty(Gg,{Tk:"allowCopy"},function(){return this.ql},function(a){var b=this.ql;b!==a&&(D.h(a,"boolean",Gg,"allowCopy"),this.ql=a,this.i("allowCopy",b,a))});D.defineProperty(Gg,{Jn:"allowDelete"},function(){return this.rl},function(a){var b=this.rl;b!==a&&(D.h(a,"boolean",Gg,"allowDelete"),this.rl=a,this.i("allowDelete",b,a))});
D.defineProperty(Gg,{Gx:"allowTextEdit"},function(){return this.Al},function(a){var b=this.Al;b!==a&&(D.h(a,"boolean",Gg,"allowTextEdit"),this.Al=a,this.i("allowTextEdit",b,a))});D.defineProperty(Gg,{Dx:"allowGroup"},function(){return this.sl},function(a){var b=this.sl;b!==a&&(D.h(a,"boolean",Gg,"allowGroup"),this.sl=a,this.i("allowGroup",b,a))});
D.defineProperty(Gg,{Hx:"allowUngroup"},function(){return this.Bl},function(a){var b=this.Bl;b!==a&&(D.h(a,"boolean",Gg,"allowUngroup"),this.Bl=a,this.i("allowUngroup",b,a))});D.defineProperty(Gg,{ku:"allowLink"},function(){return this.tl},function(a){var b=this.tl;b!==a&&(D.h(a,"boolean",Gg,"allowLink"),this.tl=a,this.i("allowLink",b,a))});
D.defineProperty(Gg,{Kn:"allowRelink"},function(){return this.vl},function(a){var b=this.vl;b!==a&&(D.h(a,"boolean",Gg,"allowRelink"),this.vl=a,this.i("allowRelink",b,a))});D.defineProperty(Gg,{lm:"allowMove"},function(){return this.ul},function(a){var b=this.ul;b!==a&&(D.h(a,"boolean",Gg,"allowMove"),this.ul=a,this.i("allowMove",b,a))});
D.defineProperty(Gg,{Ex:"allowReshape"},function(){return this.wl},function(a){var b=this.wl;b!==a&&(D.h(a,"boolean",Gg,"allowReshape"),this.wl=a,this.i("allowReshape",b,a))});D.defineProperty(Gg,{lu:"allowResize"},function(){return this.xl},function(a){var b=this.xl;b!==a&&(D.h(a,"boolean",Gg,"allowResize"),this.xl=a,this.i("allowResize",b,a))});
D.defineProperty(Gg,{Fx:"allowRotate"},function(){return this.yl},function(a){var b=this.yl;b!==a&&(D.h(a,"boolean",Gg,"allowRotate"),this.yl=a,this.i("allowRotate",b,a))});D.defineProperty(Gg,{Kf:"allowSelect"},function(){return this.zl},function(a){var b=this.zl;b!==a&&(D.h(a,"boolean",Gg,"allowSelect"),this.zl=a,this.i("allowSelect",b,a))});
function E(a){function b(){window.document.removeEventListener("DOMContentLoaded",b,!1);c.setScrollWidth()}1<arguments.length&&D.k("Diagram constructor can only take one optional argument, the DIV HTML element or its id.");D.xc(this);Al=[];this.gd=!0;this.LC=new jh;this.LC.cd(this);this.Kd=17;this.vs=!1;this.qA="default";var c=this;null!==window.document.body?this.setScrollWidth():window.document.addEventListener("DOMContentLoaded",b,!1);this.ec=new K(Gg);this.Kb=this.Lb=0;this.Hk=this.Vb=this.fd=
this.Gb=null;this.NG();this.pp=null;this.MG();this.jb=(new N(NaN,NaN)).freeze();this.Ab=1;this.qw=(new N(NaN,NaN)).freeze();this.rw=NaN;this.Kw=1E-4;this.Hw=100;this.Oc=new Ca;this.zx=(new N(NaN,NaN)).freeze();this.iw=(new C(NaN,NaN,NaN,NaN)).freeze();this.bx=(new Mb(0,0,0,0)).freeze();this.ex=Bl;this.ix=!0;this.Zw=this.Xw=null;this.Um=Vh;this.Xm=Vc;this.Ol=Vh;this.mp=Vc;this.sw=this.pw=ic;this.Pe=!0;this.qs=!1;this.Gg=new L(F);this.Il=new ma(J,C);this.Yr=!0;this.tr=250;this.Oo=-1;this.Pv=(new Mb(16,
16,16,16)).freeze();this.Wr=this.cg=!1;this.gp=!0;this.ej=new ag;this.Hd=new ag;this.Wb=new ag;this.zh=this.Ui=null;this.Xp=!1;this.Kz=this.Lz=null;this.sz=window.PointerEvent&&(D.Dq||D.Eq||D.wB)&&window.navigator&&!1!==window.navigator.msPointerEnabled;Cl(this);this.Fp=new L(H);this.fm=new L(I);this.zp=new L(J);this.rb=new L(F);this.xw=!0;this.ux=Dl;this.ED=!1;this.wx=gj;this.Fz=this.Iz=this.BA=null;this.Wv="";this.Rr="auto";this.Yi=this.zj=this.nj=this.Nw=this.oj=this.pj=this.qj=this.Xi=this.bj=
this.Vi=null;this.kA=!1;this.oA={};this.Ip=[null,null];this.Cz=null;this.lr=this.Jz=this.wA=this.qE=this.yj=!1;this.QD=!0;this.cn=this.le=!1;this.Ae=null;var d=this;this.XD=function(a){if(a.ea===d.ea&&d.ab){d.ab=!1;try{var b=a.Pc;""===a.Df&&b===eg&&El(d,a.object,a.propertyName)}finally{d.ab=!0}}};this.YD=function(a){Fl(d,a)};this.NE=!0;this.sh=-2;this.Zi=new ma(Object,F);this.jk=new ma(Object,J);this.fn=new ma(Object,Array);this.Hp=new ma("string",Array);this.nA=new K(Gl);this.hj=!1;this.rl=this.ql=
this.Fv=this.rf=!0;this.Hv=this.Gv=!1;this.Mv=this.Kv=this.zl=this.yl=this.xl=this.wl=this.ul=this.vl=this.tl=this.Jv=this.Bl=this.sl=this.Al=!0;this.uh=this.ND=!1;this.Lv=this.Iv=this.nw=this.mw=!0;this.hx=this.ax=16;this.sA=this.$w=!1;this.Et=this.gx=null;this.tA=this.uA=0;this.tf=(new Mb(5)).freeze();this.lx=(new L(F)).freeze();this.Iw=999999999;this.ow=(new L(F)).freeze();this.Pl=this.bn=this.uk=!0;this.Ml=this.tk=!1;this.ye=null;this.gk=!0;this.th=!1;this.IH=new L(J);this.CD=new L(Hl);this.Ik=
this.Yd=null;this.it=1;this.tE=0;this.Hh={scale:1,position:new N,bounds:new C,isScroll:!1};this.GA=(new C(NaN,NaN,NaN,NaN)).freeze();this.cw=(new C(NaN,NaN,NaN,NaN)).freeze();this.yw=!1;this.ew=null;this.Tw=new L(Il);Jl(this);this.Dw=this.kw=this.Ow=this.hD=this.gD=this.iD=this.Ak=this.Kl=this.rj=null;Kl(this);this.Ed=null;this.jw=!1;this.Vo=null;this.bb=new Ph;this.bb.initializeStandardTools();this.cb=this.su=this.bb;this.xb=new pa;this.ea=new X;this.yj=!0;this.$b=new Ig;this.yj=!1;this.tD=this.Oz=
null;this.hd=1;this.Lk=null;var e=D.vfo.split(".");!0!==D.Sx.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.Sx.licenseKey=!0);this.mi=1;this.zk=0;this.Aw=new N;this.DA=500;this.Ov=new N;this.Nt=null;this.xk=!1;this.preventDefault=this.Ly=this.Pq=this.Qq=this.Oq=this.Nq=this.ro=this.to=this.so=this.po=this.qo=
this.yC=this.qC=this.rC=this.sC=this.bm=this.At=this.am=this.zt=null;this.uw=!1;this.Nl=new Ll;void 0!==a&&Ml(this,a);this.gd=!1}D.ka("Diagram",E);E.prototype.clear=E.prototype.clear=function(){this.ea.clear();th=null;uh="";Nl(this,!1);this.cw=(new C(NaN,NaN,NaN,NaN)).freeze();this.ra()};
function Nl(a,b){var c=null;null!==a.Ed&&(c=a.Ed.$);a.Ra.ai();for(var d=[],e=a.ec.length,g=0;g<e;g++){var h=a.ec.o[g];if(b)for(var k=h.Wh;k.next();){var l=k.value;l!==c&&null===l.data&&d.push(l)}h.clear()}a.Gg.clear();a.Il.clear();a.Fp.clear();a.fm.clear();a.zp.clear();a.rb.clear();a.Zi.clear();a.jk.clear();a.fn.clear();a.lx.Xa();a.lx.clear();a.lx.freeze();a.ow.Xa();a.ow.clear();a.ow.freeze();a.Vo=null;D.jz=[];null!==c&&(a.add(c),a.rb.remove(c));if(b)for(c=0;c<d.length;c++)a.add(d[c])}
E.prototype.reset=E.prototype.reset=function(){this.gd=!0;this.clear();this.ec=new K(Gg);this.NG();this.MG();this.jb=(new N(NaN,NaN)).freeze();this.Ab=1;this.qw=(new N(NaN,NaN)).freeze();this.rw=NaN;this.Kw=1E-4;this.Hw=100;this.zx=(new N(NaN,NaN)).freeze();this.iw=(new C(NaN,NaN,NaN,NaN)).freeze();this.bx=(new Mb(0,0,0,0)).freeze();this.ex=Bl;this.ix=!0;this.Zw=this.Xw=null;this.Um=Vh;this.Xm=Vc;this.Ol=Vh;this.mp=Vc;this.sw=this.pw=ic;this.tr=250;this.Pv=(new Mb(16,16,16,16)).freeze();this.xw=!0;
this.ux=Dl;this.wx=gj;this.Rr="auto";this.Yi=this.zj=this.nj=this.Nw=this.oj=this.pj=this.qj=this.Xi=this.bj=this.Vi=null;this.hj=!1;this.rl=this.ql=this.Fv=this.rf=!0;this.Hv=this.Gv=!1;this.Lv=this.Iv=this.nw=this.mw=this.Mv=this.Kv=this.zl=this.yl=this.xl=this.wl=this.ul=this.vl=this.tl=this.Jv=this.Bl=this.sl=this.Al=!0;this.hx=this.ax=16;this.tf=(new Mb(5)).freeze();this.Iw=999999999;this.ye=null;this.yw=!1;Kl(this);this.Ed=null;this.bb=new Ph;this.bb.initializeStandardTools();this.cb=this.su=
this.bb;this.xb=new pa;this.yj=!0;Jl(this);this.$b=new Ig;this.yj=!1;this.ea=new X;this.th=!1;this.gp=!0;this.gd=this.cg=!1;this.ra();this.zh=this.Ui=null;Cl(this);this.Wv=""};
function Kl(a){a.rj=new ma("string",F);var b=new H,c=new na;c.bind(new oh("text","",ha));b.add(c);a.iD=b;a.rj.add("",b);b=new H;c=new na;c.stroke="brown";c.bind(new oh("text","",ha));b.add(c);a.rj.add("Comment",b);b=new H;b.nl=!1;b.NA=!1;c=new A;c.Ob="Ellipse";c.fill="black";c.stroke=null;c.Ea=(new Ba(3,3)).Oa();b.add(c);a.rj.add("LinkLabel",b);a.Kl=new ma("string",I);b=new I;b.Vy="GROUPPANEL";b.type=Ol;c=new na;c.font="bold 12pt sans-serif";c.bind(new oh("text","",ha));b.add(c);c=new x(Pl);c.name=
"GROUPPANEL";var d=new A;d.Ob="Rectangle";d.fill="rgba(128,128,128,0.2)";d.stroke="black";c.add(d);d=new Zj;d.padding=(new Mb(5,5,5,5)).Oa();c.add(d);b.add(c);a.gD=b;a.Kl.add("",b);a.Ak=new ma("string",J);b=new J;c=new A;c.We=!0;b.add(c);c=new A;c.er="Standard";c.fill="black";c.stroke=null;c.pb=0;b.add(c);a.hD=b;a.Ak.add("",b);b=new J;c=new A;c.We=!0;c.stroke="brown";b.add(c);a.Ak.add("Comment",b);b=new ca;b.type=Pl;c=new A;c.fill=null;c.stroke="dodgerblue";c.pb=3;b.add(c);c=new Zj;c.margin=(new Mb(1.5,
1.5,1.5,1.5)).Oa();b.add(c);a.Ow=b;a.kw=b;b=new ca;b.type=tj;c=new A;c.We=!0;c.fill=null;c.stroke="dodgerblue";c.pb=3;b.add(c);a.Dw=b}
E.prototype.setScrollWidth=function(a){a=void 0===a?window.document.body: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);a.appendChild(c);var d=b.offsetWidth;c.style.overflow="scroll";b=b.offsetWidth;d===b&&(b=c.clientWidth);a.removeChild(c);
c=d-b;0!==c||D.iG||(c=11);this.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";a.appendChild(c);d="reverse";0<c.scrollLeft?d="default":(c.scrollLeft=1,0===c.scrollLeft&&(d="negative"));a.removeChild(c);this.qA=d};E.prototype.qc=function(a){a.Se===E?this.om=a:D.ck(this,a)};
E.prototype.toString=function(a){void 0===a&&(a=0);var b="";this.Kj&&this.Kj.id&&(b=this.Kj.id);b='Diagram "'+b+'"';if(0>=a)return b;for(var c=this.ec.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.ca instanceof E?b.ca:null};
D.defineProperty(E,{Kj:"div"},function(){return this.Vb},function(a){null!==a&&D.l(a,HTMLDivElement,E,"div");if(this.Vb!==a){Al=[];var b=this.Vb;null!==b?(b.ca=void 0,b.innerHTML="",null!==this.Gb&&(this.Gb.removeEventListener("touchstart",this.sC,!1),this.Gb.removeEventListener("touchmove",this.rC,!1),this.Gb.removeEventListener("touchend",this.qC,!1),this.Gb.ae.ca=null),b=this.bb,null!==b&&(b.qf.each(function(a){a.cancelWaitAfter()}),b.ng.each(function(a){a.cancelWaitAfter()}),b.og.each(function(a){a.cancelWaitAfter()})),
b.cancelWaitAfter(),this.cb.doCancel(),this.fd=this.Gb=null,window.removeEventListener("resize",this.yC,!1),window.removeEventListener("mousemove",this.qo,!0),window.removeEventListener("mousedown",this.po,!0),window.removeEventListener("mouseup",this.so,!0),window.removeEventListener("wheel",this.to,!0),window.removeEventListener("mouseout",this.ro,!0)):this.th=!1;this.Vb=null;if(null!==a){if(b=a.ca)b.Kj=null;Ml(this,a);this.Gm()}}});
function Ql(a){var b=a.Gb;a.sz?(b.addEventListener("pointerdown",a.Nq,!1),b.addEventListener("pointermove",a.Oq,!1),b.addEventListener("pointerup",a.Qq,!1),b.addEventListener("pointerout",a.Pq,!1)):(b.addEventListener("touchstart",a.sC,!1),b.addEventListener("touchmove",a.rC,!1),b.addEventListener("touchend",a.qC,!1),b.addEventListener("mousemove",a.qo,!1),b.addEventListener("mousedown",a.po,!1),b.addEventListener("mouseup",a.so,!1),b.addEventListener("mouseout",a.ro,!1));b.addEventListener("wheel",
a.to,!1);b.addEventListener("keydown",a.xJ,!1);b.addEventListener("keyup",a.yJ,!1);b.addEventListener("selectstart",function(a){a.preventDefault();return!1},!1);b.addEventListener("contextmenu",function(a){a.preventDefault();return!1},!1);b.addEventListener("gesturestart",function(b){a.bb.cl!==Kk&&(a.bb.cl===Jk?b.preventDefault():(b.preventDefault(),a.it=a.scale,a.cb.doCancel()))},!1);b.addEventListener("gesturechange",function(b){if(a.bb.cl!==Kk)if(a.bb.cl===Jk)b.preventDefault();else{b.preventDefault();
var d=b.scale;if(null!==a.it){var e=a.Lb,g=a.Kb,h=a.Gb.getBoundingClientRect();b=new N(b.pageX-window.scrollX-e/h.width*h.left,b.pageY-window.scrollY-g/h.height*h.top);d*=a.it;e=a.xb;d!==a.scale&&e.canResetZoom(d)&&(g=a.Ri,a.Ri=b,e.resetZoom(d),a.Ri=g)}}},!1);window.addEventListener("resize",a.yC,!1)}
E.prototype.computePixelRatio=function(){if(null!==this.Lk)return this.Lk;var a=this.fd;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.cb.doMouseMove()};E.prototype.doMouseDown=function(){this.cb.doMouseDown()};E.prototype.doMouseUp=function(){this.cb.doMouseUp()};E.prototype.doMouseWheel=function(){this.cb.doMouseWheel()};
E.prototype.doKeyDown=function(){this.cb.doKeyDown()};E.prototype.doKeyUp=function(){this.cb.doKeyUp()};E.prototype.doFocus=function(){this.focus()};E.prototype.focus=E.prototype.focus=function(){if(this.Gb)if(this.oK)this.Gb.focus();else{var a=window.scrollX||window.pageXOffset,b=window.scrollY||window.pageYOffset;this.Gb.focus();window.scrollTo(a,b)}};
function fl(a){if(null!==a.Gb){var b=a.Vb;if(0!==b.clientWidth&&0!==b.clientHeight){var c=a.Ml?a.Kd:0,d=a.tk?a.Kd:0,e=a.hd;a.hd=a.computePixelRatio();a.hd!==e&&(a.qs=!0,a.Le());if(b.clientWidth!==a.Lb+c||b.clientHeight!==a.Kb+d)a.bn=!0,a.Pe=!0,b=a.$b,null!==b&&b.qy&&a.om===Vh&&(a.Wr=!0,b.L()),a.le||a.Le()}}}
function Jl(a){var b=new Gg;b.name="Background";a.fu(b);b=new Gg;b.name="";a.fu(b);b=new Gg;b.name="Foreground";a.fu(b);b=new Gg;b.name="Adornment";b.Sc=!0;a.fu(b);b=new Gg;b.name="Tool";b.Sc=!0;b.eG=!0;a.fu(b);b=new Gg;b.name="Grid";b.Kf=!1;b.tg=!1;b.Sc=!0;a.YH(b,a.vm("Background"))}
function Rl(a){a.Ed=new x(Sl);a.Ed.name="GRID";var b=new A;b.Ob="LineH";b.stroke="lightgray";b.pb=.5;b.interval=1;a.Ed.add(b);b=new A;b.Ob="LineH";b.stroke="gray";b.pb=.5;b.interval=5;a.Ed.add(b);b=new A;b.Ob="LineH";b.stroke="gray";b.pb=1;b.interval=10;a.Ed.add(b);b=new A;b.Ob="LineV";b.stroke="lightgray";b.pb=.5;b.interval=1;a.Ed.add(b);b=new A;b.Ob="LineV";b.stroke="gray";b.pb=.5;b.interval=5;a.Ed.add(b);b=new A;b.Ob="LineV";b.stroke="gray";b.pb=1;b.interval=10;a.Ed.add(b);b=new F;b.add(a.Ed);
b.Of="Grid";b.Io=0;b.my=!1;b.dG=!1;b.tg=!1;b.zy="GRID";a.add(b);a.rb.remove(b);a.Ed.visible=!1}function Tl(){this.ca.sA?this.ca.sA=!1:this.ca.isEnabled?this.ca.BI(this):Ul(this.ca)}function Vl(a){this.ca.isEnabled?(this.ca.uA=a.target.scrollTop,this.ca.tA=a.target.scrollLeft):Ul(this.ca)}
E.prototype.diagramScroll=E.prototype.BI=function(a){if(null!==this.Gb){this.$w=!0;var b=this.Qc,c=this.wb,d=this.Sy,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.vs)switch(this.qA){case "negative":s=s+a.scrollWidth-a.clientWidth;break;case "reverse":s=a.scrollWidth-s-a.clientWidth}var t=s;n<h||p<k?(s=D.Db(this.position.x,this.position.y),
this.Ce&&this.tA!==t&&(s.x=t/c+e,this.tA=t),this.De&&this.uA!==a.scrollTop&&(s.y=a.scrollTop/c+g,this.uA=a.scrollTop),this.position=s,D.A(s),this.bn=this.$w=!1):(s=D.O(),a.OH&&this.Ce&&(e<m&&(this.position=s.n(t+e,this.position.y)),l>q&&(this.position=s.n(-(this.gx.scrollWidth-this.Lb)+t-this.Lb/c+l,this.position.y))),a.PH&&this.De&&(g<b&&(this.position=s.n(this.position.x,a.scrollTop+g)),d>r&&(this.position=s.n(this.position.x,-(this.gx.scrollHeight-this.Kb)+a.scrollTop-this.Kb/c+d))),D.A(s),Wl(this),
this.bn=this.$w=!1,b=this.Qc,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.Et.style.width="1px"),p>=k&&g>=b&&d<=r&&(this.Et.style.height="1px"))}};E.prototype.computeBounds=function(){0<this.Gg.count&&Ti(this);return Xl(this)};
function Xl(a){if(a.KF.F()){var b=a.KF.copy();b.Bx(a.padding);return b}for(var c=!0,d=a.ec.o,e=d.length,g=0;g<e;g++){var h=d[g];if(h.visible&&(!h.Sc||h.eG))for(var h=h.rb.o,k=h.length,l=0;l<k;l++){var m=h[l];m.my&&m.isVisible()&&(m=m.Y,m.F()&&(c?(c=!1,b=m.copy()):b.lh(m)))}}c&&(b=new C(0,0,0,0));b.Bx(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.Ue(),null===c?c=e.Y.copy():c.lh(e.Y))}return null===c?new C(NaN,NaN,0,0):c};
function Yl(a,b){if((b||a.th)&&!a.gd&&null!==a.Gb&&!a.Ra.nf&&a.Qc.F()){a.gd=!0;var c=a.Um;b&&a.Ol!==Vh&&(c=a.Ol);var d=c!==Vh?Zl(a,c):a.scale,c=a.wb.copy(),e=a.Lb/d,g=a.Kb/d,h=null,k=a.Ra;k.Ac&&(h=a.jb.copy());a.position.Xa();var l=a.Xm;b&&!l.$c()&&a.mp.$c()&&(l=a.mp);$l(a,a.jb,a.Qc,e,g,l,b);a.position.freeze();null!==h&&rl(k,h,a.jb);e=a.scale;a.scale=d;a.gd=!1;d=a.wb;d.Zc(c)||a.hv(c,d,e,a.scale,!1)}}
function Zl(a,b){var c=a.xb.Qx;if(null===a.Gb)return c;a.uk&&am(a,a.computeBounds());var d=a.Qc;if(!d.F())return c;var e=d.width,d=d.height,g=a.Lb,h=a.Kb,k=g/e,l=h/d;return b===bm?(e=Math.min(l,k),e>c&&(e=c),e<a.Uh&&(e=a.Uh),e>a.Th&&(e=a.Th),e):b===cm?(e=l>k?(h-a.Kd)/d:(g-a.Kd)/e,e>c&&(e=c),e<a.Uh&&(e=a.Uh),e>a.Th&&(e=a.Th),e):a.scale}
E.prototype.zoomToFit=E.prototype.zoomToFit=function(){this.scale=Zl(this,bm);this.Ty!==Bl&&(this.jb.Xa(),$l(this,this.jb,this.Qc,this.Lb/this.Ab,this.Kb/this.Ab,this.Xm,!0),this.jb.freeze())};
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.Lb,g=this.Kb,e=b===cm?g/d>e/c?(g-(this.tk?this.Kd:0))/d:(e-(this.Ml?this.Kd:0))/c:Math.min(g/d,e/c);this.scale=e;this.position=new N(a.x,a.y)}};D.defineProperty(E,{vB:null},function(){return this.gd},function(a){this.gd=a});
E.prototype.alignDocument=function(a,b){this.uk&&am(this,this.computeBounds());var c=this.Qc,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.Ty===Bl)g.$c()&&(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.Sy,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.GG&&(a=a.GG(a,b),b.x=a.x,b.y=a.y)}E.prototype.findPartAt=E.prototype.yu=function(a,b){var c=b?Xi(this,a,function(a){return a.$},function(a){return a.canSelect()}):Xi(this,a,function(a){return a.$});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);Ti(this);for(var d=this.ec.io;d.next();){var e=d.value;if(e.visible&&(e=e.Je(a,b,c),null!==e))return e}return null};function Xi(a,b,c,d){void 0===c&&(c=null);void 0===d&&(d=null);Ti(a);for(a=a.ec.io;a.next();){var e=a.value;if(e.visible&&!e.Sc&&(e=e.Je(b,c,d),null!==e))return e}return null}
E.prototype.findObjectsAt=E.prototype.xu=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));Ti(this);for(var e=this.ec.io;e.next();){var g=e.value;g.visible&&g.xu(a,b,c,d)}return d};E.prototype.findObjectsIn=E.prototype.$k=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));Ti(this);for(var g=this.ec.io;g.next();){var h=g.value;h.visible&&h.$k(a,b,c,d,e)}return e};
E.prototype.eB=function(a,b,c,d,e,g){var h=new L(O);Ti(this);for(var k=this.ec.io;k.next();){var l=k.value;l.visible&&l.eB(a,b,c,d,h,e,g)}return h};E.prototype.findObjectsNear=E.prototype.Wn=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));Ti(this);for(var h=this.ec.io;h.next();){var k=h.value;k.visible&&k.Wn(a,b,c,d,e,g)}return g};
E.prototype.acceptEvent=function(a){var b=this.Hd;this.Hd=this.Wb;this.Wb=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.Wb.Sd,d.ha=b.Wb.ha);a=0;c.ctrlKey&&(a+=1);c.altKey&&(a+=2);c.shiftKey&&(a+=4);c.metaKey&&(a+=8);d.yd=a;d.button=c.button;void 0===c.buttons||D.Qu||(d.buttons=c.buttons);D.Rh&&0===c.button&&c.ctrlKey&&(d.button=2);d.Yk=!1;d.up=!1;d.Fe=1;d.Hi=0;d.Ec=!1;d.bubbles=!1;d.timestamp=Date.now();d.Su=!1;d.Rf=fm(c);d.Oe=null}
function fm(a){var b=a.target.ca;if(!b){var c=a.path;c||"function"!==typeof a.mI||(c=a.mI());c&&c[0]&&(b=c[0].ca)}return b?b:null}function gm(a,b,c,d){var e=a.Hd;a.Hd=a.Wb;a.Wb=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.yd=c;e.Yk=!0;e.up=!1;e.Fe=1;e.Hi=0;e.Ec=!1;e.bubbles=!0;e.event=b;e.timestamp=Date.now();e.Su=d;e.Rf=fm(b);e.Oe=null;d||(a.ej=e.copy());di=null;return e}
function hm(a,b,c,d){var e=a.Hd;a.Hd=a.Wb;a.Wb=e;var g=null;e.g=a;null!==c?((g=window.document.elementFromPoint(c.clientX,c.clientY))&&g.ca?g=g.ca:(c=void 0!==b.targetTouches?b.targetTouches[0]:b,g=a),e.Rf=g,em(a,c,e)):null!==a.Hd?(e.ha=a.Hd.ha,e.Sd=a.Hd.Sd,e.Rf=a.Hd.Rf):null!==a.ej&&(e.ha=a.ej.ha,e.Sd=a.ej.Sd,e.Rf=a.ej.Rf);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.yd=a;e.Yk=!1;e.up=!1;e.Fe=1;e.Hi=0;e.Ec=!1;e.bubbles=!1;e.event=b;e.timestamp=
Date.now();e.Su=d;e.Oe=null;return e}function fa(a,b,c){if(b.bubbles)return v&&v.ZF&&D.trace("NOT handled "+c.type+" "+b.toString()),!0;v&&v.ZF&&D.trace("handled "+c.type+" "+a.cb.name+" "+b.toString());void 0!==c.stopPropagation&&c.stopPropagation();c.preventDefault();c.cancelBubble=!0;return!1}
E.prototype.xJ=function(a){if(!this.ca.isEnabled)return!1;var b=this.ca.Wb;dm(this.ca,this.ca,a,b,!1);b.key=String.fromCharCode(a.which);b.Yk=!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.ca.doKeyDown();return fa(this.ca,b,a)};
E.prototype.yJ=function(a){if(!this.ca.isEnabled)return!1;var b=this.ca.Wb;dm(this.ca,this.ca,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.ca.doKeyUp();return fa(this.ca,b,a)};
E.prototype.ip=function(a){var b=this.Gb;if(null===b)return new N(0,0);var c=this.Lb,d=this.Kb,b=b.getBoundingClientRect(),c=a.clientX-c/b.width*b.left;a=a.clientY-d/b.height*b.top;return null!==this.Oc?(a=new N(c,a),kb(a,this.Oc),a):new N(c,a)};function em(a,b,c){var d=a.Gb,e=a.Lb,g=a.Kb,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.Oc?(b=D.Db(h,k),a.Oc.Ph(b),c.ha.assign(b),D.A(b)):c.ha.n(h,k)}
function bg(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.Ip[0])e=a.Ip[c];else return;c=a.Gb;b=a.Lb;a=a.Kb;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.Rc=function(){this.uk||(this.uk=!0,this.Le(!0))};function ol(a){a.le||Ti(a);a.uk&&am(a,a.computeBounds())}
E.prototype.redraw=E.prototype.Gm=function(){this.gd||this.le||(this.ra(),im(this),Wl(this),this.Rc(),this.mg())};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.ai();b.isEnabled=!1;cj(this);this.th=!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.gd||!1===a&&this.le)){this.cg=!0;var b=this;requestAnimationFrame(function(){b.cg&&b.mg()})}};E.prototype.maybeUpdate=E.prototype.mg=function(){if(!this.gp||this.cg)this.gp&&(this.gp=!1),cj(this)};function jm(a,b){a.Ra.nf||a.gd||!a.bn||Ul(a)||(b&&Ti(a),Yl(a,!1))}
function cj(a,b){if(!a.le&&(a.cg=!1,null!==a.Vb)){a.le=!0;var c=a.Ra,d=a.nA;if(!c.sp&&0!==d.length){for(var e=d.o,g=e.length,h=0;h<g;h++){var k=e[h];km(k,!1);k.K()}d.clear()}d=a.CD;0<d.count&&(d.each(function(a){a.wC()}),d.clear());e=d=!1;c.nf&&(e=!0,d=a.ob,a.ob=!0);c.Ac||fl(a);jm(a,!1);null!==a.Ed&&(a.Ed.visible&&!a.jw&&(lm(a),a.jw=!0),!a.Ed.visible&&a.jw&&(a.jw=!1));Ti(a);g=!1;if(!a.th||a.gk)a.th?mm(a,!a.Wr):(a.Qb("Initial Layout"),!1===c.isEnabled&&c.ai(),mm(a,!1)),g=!0;a.Wr=!1;Ti(a);a.wA||c.nf||
ol(a);jm(a,!0);g&&(a.th||nm(a),a.Ka("LayoutCompleted"));Ti(a);g&&!a.th&&(a.th=!0,a.ld("Initial Layout"),a.ob||a.na.clear(),D.setTimeout(function(){a.Ki=!1},1));om(a);el(c);b||a.He(a.fd);e&&(a.ob=d);a.le=!1}}D.w(E,{ho:null},function(){return this.th});
function nm(a){var b=a.ec.o;a.Qf(b,b.length,a);a.Ol!==Vh?a.scale=Zl(a,a.Ol):a.Um!==Vh?a.scale=Zl(a,a.Um):(b=a.kJ,isFinite(b)&&0<b&&(a.scale=b));b=a.jJ;if(b.F())a.position=b;else{b=D.O();b.zo(a.Qc,a.iJ);var c=a.wb,c=D.vg(0,0,c.width,c.height),d=D.O();d.zo(c,a.lJ);d.n(b.x-d.x,b.y-d.y);a.position=d;D.Hb(c);D.A(d);D.A(b);im(a);jm(a,!0);Yl(a,!0)}a.Ka("InitialLayoutCompleted");lm(a)}
function Ti(a){if((a.le||!a.Ra.nf)&&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.wC(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.wC=function(a,b){for(a.reset();a.next();){var c=a.value;!c.te()||c instanceof I||(c.Em()?(Hk(c,Infinity,Infinity),c.rc()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof I&&c.isVisible()&&rm(this,c);for(a.reset();a.next();)c=a.value,c instanceof J&&c.isVisible()&&(c.Em()?(Hk(c,Infinity,Infinity),c.rc()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof ca&&c.isVisible()&&(c.Em()?(Hk(c,Infinity,Infinity),c.rc()):b.add(c))};
function rm(a,b){for(var c=D.hb(),d=D.hb(),e=b.lc;e.next();){var g=e.value;g.isVisible()&&(g instanceof I?(zm(g)||Nm(g)||Om(g))&&rm(a,g):g instanceof J?g.Z===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.ua(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.ua(d)}E.prototype.Qf=function(a,b,c,d){var e=this.Ra;if(this.Pl||e.nf)for(e=0;e<b;e++)a[e].Qf(c,d)};
E.prototype.He=function(a,b){void 0===b&&(b=null);null===this.Vb&&D.k("No div specified");var c=this.Gb;null===c&&D.k("No canvas specified");var d=this.Ra;if(!d.Ac&&(Pm(this),"0"!==this.Vb.style.opacity)){var e=a!==this.fd,g=this.ec.o,h=g.length,k=this;this.Qf(g,h,k);if(e)a.Ee(!0),Wl(this);else if(!this.Pe&&null===b&&!d.vk)return;var h=this.jb,l=this.Ab,m=Math.round(h.x*l)/l,n=Math.round(h.y*l)/l,d=this.Oc;d.reset();1!==l&&d.scale(l);0===h.x&&0===h.y||d.translate(-m,-n);l=this.hd;D.eo?(c.width=c.width,
a.Ee(!0),a.scale(l,l)):(a.setTransform(1,0,0,1,0,0),a.scale(l,l),a.clearRect(0,0,this.Lb,this.Kb));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.Gj&&v.yF(this,a);c=null!==b?function(c){var d=b;if(c.visible&&0!==c.Mc){var e=c.rb.o,g=e.length;if(0!==g){1!==c.Mc&&(a.globalAlpha=c.Mc);c=c.jt;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.jc&&c.push(n);if(!1===n.Uf)continue}n=m.Y;1<n.width*h||1<
n.height*h?m.He(a,k):vl(m,a)}}a.globalAlpha=1}}}:function(b){b.He(a,k)};Qm(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.Nl?this.Nl.Qm(this)&&this.ew():this.ip=function(){return new N(0,0)};v&&(v.bB||v.Gj)&&v.aB(a,this,d);e?(this.fd.Ee(!0),Wl(this)):this.Pe=this.Pl=!1}};
function Rm(a,b,c,d,e){null===a.Vb&&D.k("No div specified");var g=a.Gb;null===g&&D.k("No canvas specified");if(!a.Ra.Ac){var h=a.fd;if(a.Pe){Pm(a);var k=a.hd;D.eo?(g.width=g.width,h.Ee(!0)):(h.setTransform(1,0,0,1,0,0),h.clearRect(0,0,a.Lb*k,a.Kb*k));h.Yy(!1);h.drawImage(a.Oz.ae,0<d?0:Math.round(-d),0<e?0:Math.round(-e));e=a.jb;var g=a.Ab,l=Math.round(e.x*g)/g,m=Math.round(e.y*g)/g;d=a.Oc;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.Gj&&v.yF(a,h);c=a.ec.o;e=c.length;a.Qf(c,e,a);Qm(a,h);for(g=0;g<e;g++)wl(c[g],h,a,b);h.restore();h.Ee(!0);v&&(v.bB||v.Gj)&&v.aB(h,a,d);a.Nl?a.Nl.Qm(a)&&a.ew():a.ip=function(){return new N(0,0)};a.Pl=!1;a.Pe=!1;a.Ly()}}}
function Sm(a,b,c,d,e,g,h,k,l,m){null===a.Vb&&D.k("No div specified");null===a.Gb&&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);Pm(a);a.fd.Ee(!0);Wl(a);a.cn=!0;var n=a.Ab;a.Ab=e;var p=a.ec.o,q=p.length;try{var r=new C(g.x,g.y,d.width/e,d.height/e),s=r.copy();s.Bx(c);lm(a,s);Ti(a);a.Qf(p,q,a,r);var t=a.hd;b.setTransform(1,0,0,1,0,0);b.scale(t,t);b.clearRect(0,0,d.width,d.height);null!==k&&""!==k&&(b.fillStyle=k,b.fillRect(0,0,d.width,d.height));
var u=D.hh();u.reset();u.translate(c.left,c.top);u.scale(e);0===g.x&&0===g.y||u.translate(-g.x,-g.y);b.setTransform(u.m11,u.m12,u.m21,u.m22,u.dx,u.dy);D.lf(u);Qm(a,b);var z;if(null!==h){var w=new L(F),y=h.j;for(y.reset();y.next();){var B=y.value;!1===m&&"Grid"===B.layer.name||null===B||w.add(B)}z=function(c){var d=l;if(c.visible&&0!==c.Mc&&(void 0===d&&(d=!0),d||!c.Sc)){var d=c.rb.o,e=d.length;if(0!==e){1!==c.Mc&&(b.globalAlpha=c.Mc);c=c.jt;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.jc&&c.push(m);if(!1===m.Uf)continue}m=k.Y;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.bo.$,G=P.layer;z=function(c){c===G?P.He(b,a):c.He(b,a,l)}}else z=function(c){c.He(b,a,l)};for(c=0;c<q;c++)z(p[c]);a.cn=!1;a.Nl?a.Nl.Qm(a)&&a.ew():a.ip=function(){return new N(0,0)}}finally{a.Ab=n,a.fd.Ee(!0),Wl(a),a.Qf(p,q,a),lm(a)}}E.prototype.getRenderingHint=E.prototype.el=function(a){return this.Hk[a]};
E.prototype.setRenderingHint=E.prototype.tK=function(a,b){this.Hk[a]=b;this.Gm()};E.prototype.resetRenderingHints=E.prototype.NG=function(){this.Hk=new ja;this.Hk.drawShadows=!0;this.Hk.textGreeking=!0;this.Hk.viewportOptimizations=D.iG||D.Dq||D.Eq?!1:!0;this.Hk.temporaryPixelRatio=!0;this.Hk.pictureRatioOptimization=!0};function Qm(a,b){var c=a.Hk;null!==c&&(void 0!==c.imageSmoothingEnabled&&b.Yy(!!c.imageSmoothingEnabled),c=c.defaultFont,void 0!==c&&null!==c&&(b.font=c))}
E.prototype.getInputOption=E.prototype.Hu=function(a){return this.pp[a]};E.prototype.setInputOption=function(a,b){this.pp[a]=b};E.prototype.resetInputOptions=E.prototype.MG=function(){this.pp=new ja;this.pp.extraTouchArea=10;this.pp.extraTouchThreshold=10;this.pp.hasGestureZoom=!0};E.prototype.setProperties=function(a){D.rv(this,a)};function om(a){if(0===a.na.Oi&&0!==a.Il.count){for(;0<a.Il.count;){var b=a.Il;a.Il=new ma(J,C);for(b=b.j;b.next();){var c=b.key;xj(c,b.value);c.se()}}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.F()&&b.kg(a)&&(this.Pe=!0,this.Le())}for(b=this.Tw.j;b.next();)b.value.ra(a)};
E.prototype.cG=function(a,b){if(!0!==this.Pe){this.Pe=!0;var c=!0===this.el("temporaryPixelRatio");if(!0===this.el("viewportOptimizations")&&this.Ty!==Tm&&this.Sy.Yx(0,0,0,0)&&b.width===a.width&&b.height===a.height){var d=this.scale,e=D.Ff(),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.le&&(this.cg=!1,null!==this.Vb)){this.le=!0;om(this);
this.Qc.F()||am(this,this.computeBounds());var m=this.Gb;if(null!==m){var n=this.hd,h=this.Lb*n,k=this.Kb*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.Oz,p=this.tD;l.width!==h&&(l.width=h);l.height!==k&&(l.height=k);p.clearRect(0,0,h,k);var l=190*this.hd,q=70*this.hd,r=Math.max(d,0),s=Math.max(g,0),t=Math.floor(h-r),u=Math.floor(k-s);p.Yy(!1);p.drawImage(m.ae,r,s,t,u,0,0,t,u);this.Nl.Qm(this)&&p.clearRect(0,0,l,q);var m=
D.hb(),p=D.hb(),u=Math.abs(d),t=Math.abs(g),z=0===r?0:h-u,r=D.Db(z,0),u=D.Db(u+z,k);p.push(new C(Math.min(r.x,u.x),Math.min(r.y,u.y),Math.abs(r.x-u.x),Math.abs(r.y-u.y)));var w=this.Oc;w.reset();w.scale(n,n);1!==this.Ab&&w.scale(this.Ab);n=this.jb;(0!==n.x||0!==n.y)&&isFinite(n.x)&&isFinite(n.y)&&w.translate(-n.x,-n.y);kb(r,w);kb(u,w);m.push(new C(Math.min(r.x,u.x),Math.min(r.y,u.y),Math.abs(r.x-u.x),Math.abs(r.y-u.y)));z=0===s?0:k-t;r.n(0,z);u.n(h,t+z);p.push(new C(Math.min(r.x,u.x),Math.min(r.y,
u.y),Math.abs(r.x-u.x),Math.abs(r.y-u.y)));kb(r,w);kb(u,w);m.push(new C(Math.min(r.x,u.x),Math.min(r.y,u.y),Math.abs(r.x-u.x),Math.abs(r.y-u.y)));this.Nl.Qm(this)&&(h=0<d?0:-d,k=0<g?0:-g,r.n(h,k),u.n(l+h,q+k),p.push(new C(Math.min(r.x,u.x),Math.min(r.y,u.y),Math.abs(r.x-u.x),Math.abs(r.y-u.y))),kb(r,w),kb(u,w),m.push(new C(Math.min(r.x,u.x),Math.min(r.y,u.y),Math.abs(r.x-u.x),Math.abs(r.y-u.y))));D.A(r);D.A(u);jm(this,!1);Rm(this,m,p,d,g);D.ua(m);D.ua(p);this.le=!1}}}else this.mg();D.Hb(e);c&&(this.Lk=
1,this.mg(),this.Lk=null,this.Ly())}else c?(this.Lk=1,this.mg(),this.Lk=null,this.Ly()):this.mg()}};function im(a){!1===a.bn&&(a.bn=!0)}function Wl(a){!1===a.Pl&&(a.Pl=!0)}function Pm(a){!1!==a.qs&&(a.qs=!1,Um(a,a.Lb,a.Kb))}function Um(a,b,c){var d=a.Gb,e=a.hd,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.fd.Ee(!0)}
function Ul(a){var b=a.Gb;if(null===b)return!0;var c=a.Vb,d=a.Lb,e=a.Kb,g=a.GA.copy();if(!g.F())return!0;var h=!1,k=a.Ml?a.Kd:0,l=a.tk?a.Kd:0,m=c.clientWidth||d+k,c=c.clientHeight||e+l;if(m!==d+k||c!==e+l)a.Ml=!1,a.tk=!1,l=k=0,a.Lb=m,a.Kb=c,h=a.qs=!0;a.bn=!1;var n=a.wb,p=a.Qc,q=0,r=0,s=0,t=0,m=n.width,c=n.height,u=a.Sy;a.SA.$c()?(p.width>m&&(q=u.left,r=u.right),p.height>c&&(s=u.top,t=u.bottom)):(q=u.left,r=u.right,s=u.top,t=u.bottom);var u=p.width+q+r,z=p.height+s+t,q=p.x-q,w=n.x,r=p.right+r,y=n.right+
k,s=p.y-s,B=n.y,t=p.bottom+t,n=n.bottom+l,P="1px",G="1px",p=a.scale,Q=!(u<m+k),Y=!(z<c+l);a.Ty===Bl&&(Q||Y)&&(Q&&a.oB&&a.Ce&&(P=1,q+1<w&&(P=Math.max((w-q)*p+a.Lb,P)),r>y+1&&(P=Math.max((r-y)*p+a.Lb,P)),m+k+1<u&&(P=Math.max((u-m+k)*p+a.Lb,P)),P=P.toString()+"px"),Y&&a.pB&&a.De&&(G=1,s+1<B&&(G=Math.max((B-s)*p+a.Kb,G)),t>n+1&&(G=Math.max((t-n)*p+a.Kb,G)),c+l+1<z&&(G=Math.max((z-c+l)*p+a.Kb,G)),G=G.toString()+"px"));var Q="1px"!==P,U="1px"!==G;Q&&U||!Q&&!U||(Y=!(z<c+l),U&&(y-=a.Kd),Q&&(n-=a.Kd),u<m+
k||!a.oB||!a.Ce||(P=1,q+1<w&&(P=Math.max((w-q)*p+a.Lb,P)),r>y+1&&(P=Math.max((r-y)*p+a.Lb,P)),m+1<u&&(P=Math.max((u-m)*p+a.Lb,P)),P=P.toString()+"px"),Q="1px"!==P,k=a.Kb,Q!==a.tk&&(k=Q?a.Kb-a.Kd:a.Kb+a.Kd),Y&&a.pB&&a.De&&(G=1,s+1<B&&(G=Math.max((B-s)*p+k,G)),t>n+1&&(G=Math.max((t-n)*p+k,G)),c+1<z&&(G=Math.max((z-c)*p+k,G)),G=G.toString()+"px"),U="1px"!==G);if(a.$w&&Q===a.tk&&U===a.Ml)return d===a.Lb&&e===a.Kb||a.mg(),!1;Q!==a.tk&&(a.Kb="1px"===P?a.Kb+a.Kd:Math.max(a.Kb-a.Kd,1),h=!0);a.tk=Q;a.Et.style.width=
P;U!==a.Ml&&(a.Lb="1px"===G?a.Lb+a.Kd:Math.max(a.Lb-a.Kd,1),h=!0,a.vs&&(k=D.O(),U?(b.style.left=a.Kd+"px",a.position=k.n(a.jb.x+a.Kd/a.scale,a.jb.y)):(b.style.left="0px",a.position=k.n(a.jb.x-a.Kd/a.scale,a.jb.y)),D.A(k)));a.Ml=U;a.Et.style.height=G;a.sA=!0;h&&(a.qs=!0);b=a.gx;k=b.scrollLeft;a.oB&&a.Ce&&(m+1<u?k=(a.position.x-q)*p:q+1<w?k=b.scrollWidth-b.clientWidth:r>y+1&&(k=a.position.x*p));if(a.vs)switch(a.qA){case "negative":k=-(b.scrollWidth-k-b.clientWidth);break;case "reverse":k=b.scrollWidth-
k-b.clientWidth}b.scrollLeft=k;a.pB&&a.De&&(c+1<z?b.scrollTop=(a.position.y-s)*p:s+1<B?b.scrollTop=b.scrollHeight-b.clientHeight:t>n+1&&(b.scrollTop=a.position.y*p));m=a.Lb;c=a.Kb;b.style.width=m+(a.Ml?a.Kd:0)+"px";b.style.height=c+(a.tk?a.Kd:0)+"px";return d!==m||e!==c||a.Ra.Ac?(n=a.wb,a.hv(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.lr&&(a.Tl="Tool");var c=a.Of,b=this.vm(c);null===b&&(b=this.vm(""));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.yq(99999999,a,a.g===this),0<=c&&this.pd(gg,"parts",b,null,a,null,c),b.Sc||this.Rc(),a.L(Vm),c=a.uy,null!==
c&&c(a,null,b))}};
E.prototype.yq=function(a){if(a instanceof H){if(this.Fp.add(a),a instanceof I){var b=a.Ja;null===b?this.fm.add(a):b.on.add(a);b=a.$b;null!==b&&(b.g=this)}}else a instanceof J?this.zp.add(a):a instanceof ca||this.rb.add(a);var c=this;Wm(a,function(a){Xm(c,a)});(a instanceof ca||a instanceof I&&null!==a.Tb)&&a.K();b=a.data;null!==b&&(a instanceof ca||(a instanceof J?this.jk.add(b,a):this.Zi.add(b,a)),Wm(a,function(a){Ym(c,a)}));!0!==Nm(a)&&!0!==Om(a)||this.Gg.add(a);Zm(a,!0,this);$m(a)?(a.Y.F()&&this.ra(xl(a,
a.Y)),this.Rc()):a.isVisible()&&a.Y.F()&&this.ra(xl(a,a.Y));this.Le()};
E.prototype.zf=function(a){a.ou();if(a instanceof H){if(this.Fp.remove(a),a instanceof I){var b=a.Ja;null===b?this.fm.remove(a):b.on.remove(a);b=a.$b;null!==b&&(b.g=null)}}else a instanceof J?this.zp.remove(a):a instanceof ca||this.rb.remove(a);var c=this;Wm(a,function(a){an(c,a)});b=a.data;null!==b&&(a instanceof ca||(a instanceof J?this.jk.remove(b):this.Zi.remove(b)),Wm(a,function(a){bn(c,a)}));this.Gg.remove(a);$m(a)?(a.Y.F()&&this.ra(xl(a,a.Y)),this.Rc()):a.isVisible()&&a.Y.F()&&this.ra(xl(a,
a.Y));this.Le()};E.prototype.remove=E.prototype.remove=function(a){D.l(a,F,E,"remove:part");cn(this,a,!0)};function cn(a,b,c){var d=b.layer;null!==d&&d.g===a&&(b.mb=!1,b.Zg=!1,b.L(dn),c&&b.Un(),c=d.zf(-1,b,!1),0<=c&&a.pd(hg,"parts",d,b,null,c,null),a=b.uy,null!==a&&a(b,d,null))}
E.prototype.removeParts=E.prototype.WB=function(a,b){if(D.isArray(a))for(var c=D.fb(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.Yc(a),c=e.j;c.next();)e=c.value,b&&!e.canDelete()||this.remove(e)};E.prototype.copyParts=E.prototype.mq=function(a,b,c){return this.xb.mq(a,b,c)};
E.prototype.moveParts=E.prototype.moveParts=function(a,b,c){D.l(b,N,E,"moveParts:offset");var d=this.bb;if(null!==d){d=d.pe;null===d&&(d=new Uh,d.cd(this));var e=new ma(F);if(null!==a)a=a.j;else{for(a=this.Wh;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 en(a,b,c){D.l(b,Gg,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,Gg,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.ec;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.fu=function(a){en(this,a,null);a.cd(this);var b=this.ec,c=b.count-1;if(!a.Sc)for(;0<=c&&b.fa(c).Sc;)c--;b.ce(c+1,a);null!==this.Ae&&this.pd(gg,"layers",this,null,a,null,c+1);this.ra();this.Rc()};
E.prototype.addLayerBefore=E.prototype.YH=function(a,b){en(this,a,b);a.cd(this);var c=this.ec,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.Ae&&this.pd(hg,"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.Ae&&this.pd(gg,"layers",this,null,a,null,g);this.ra();0>d&&this.Rc()};
E.prototype.addLayerAfter=function(a,b){en(this,a,b);a.cd(this);var c=this.ec,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.Ae&&this.pd(hg,"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.Ae&&this.pd(gg,"layers",this,null,a,null,g+1);this.ra();0>d&&this.Rc()};
E.prototype.removeLayer=function(a){D.l(a,Gg,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.ec,c=b.indexOf(a);if(b.remove(a)){for(b=a.rb.copy().j;b.next();){var d=b.value,e=d.Of;d.Of=e!==a.name?e:""}null!==this.Ae&&this.pd(hg,"layers",this,a,null,c,null);this.ra();this.Rc()}}};E.prototype.findLayer=E.prototype.vm=function(a){for(var b=this.jo;b.next();){var c=b.value;if(c.name===a)return c}return null};
E.prototype.addModelChangedListener=E.prototype.$H=function(a){D.h(a,"function",E,"addModelChangedListener:listener");null===this.zh&&(this.zh=new K("function"));this.zh.add(a);this.ea.In(a)};E.prototype.removeModelChangedListener=function(a){D.h(a,"function",E,"removeModelChangedListener:listener");null!==this.zh&&(this.zh.remove(a),0===this.zh.count&&(this.zh=null));this.ea.kv(a)};
E.prototype.addChangedListener=E.prototype.In=function(a){D.h(a,"function",E,"addChangedListener:listener");null===this.Ui&&(this.Ui=new K("function"));this.Ui.add(a)};E.prototype.removeChangedListener=E.prototype.kv=function(a){D.h(a,"function",E,"removeChangedListener:listener");null!==this.Ui&&(this.Ui.remove(a),0===this.Ui.count&&(this.Ui=null))};E.prototype.Jx=function(a){this.ob||this.na.YF(a);a.Pc!==fg&&(this.Ki=!0);if(null!==this.Ui)for(var b=this.Ui,c=b.length,d=0;d<c;d++)b.fa(d)(a)};
E.prototype.raiseChangedEvent=E.prototype.pd=function(a,b,c,d,e,g,h){void 0===g&&(g=null);void 0===h&&(h=null);var k=new dg;k.g=this;k.Pc=a;k.propertyName=b;k.object=c;k.oldValue=d;k.Zj=g;k.newValue=e;k.Xj=h;this.Jx(k)};E.prototype.raiseChanged=E.prototype.i=function(a,b,c,d,e){this.pd(eg,a,this,b,c,d,e)};D.w(E,{Ra:"animationManager"},function(){return this.LC});D.w(E,{na:"undoManager"},function(){return this.Ae.na});
D.defineProperty(E,{ob:"skipsUndoManager"},function(){return this.yj},function(a){D.h(a,"boolean",E,"skipsUndoManager");this.yj=a;this.Ae.yj=a});D.defineProperty(E,{ZA:"delaysLayout"},function(){return this.Jz},function(a){this.Jz=a});
E.prototype.Mn=function(a,b){if(null!==a&&a.g===this){var c=this.Ye;try{this.Ye=!0;var d=a.Pc,e;if(d===eg){var g=a.object,h=a.propertyName,k=a.oa(b);D.Ua(g,h,k);if(g instanceof O){var l,m=g.$;null!==m&&m.de()}this.Ki=!0}else if(d===gg){var n=a.object,p=a.Xj,g=a.newValue;if(n instanceof x)if("number"===typeof p&&g instanceof O){l=g;var q=n;b?q.zf(p):q.ce(p,l);m=n.$;null!==m&&m.de()}else{if("number"===typeof p&&g instanceof ih){var r=g,q=n;b?r.Ke?q.LG(p):q.JG(p):(e=r.Ke?q.re(r.index):q.qe(r.index),
e.lq(r))}}else if(n instanceof Gg){var s=!0===a.Zj;if("number"===typeof p&&g instanceof F){var m=g,t=n;b?(m.mb=!1,m.Zg=!1,m.de(),t.zf(s?p:-1,m,s)):t.yq(p,m,s)}}else if(n instanceof E){if("number"===typeof p&&g instanceof Gg){var u=g;b?this.ec.qd(p):(d=u,d.cd(this),this.ec.ce(p,d))}}else D.k("unknown ChangedEvent.Insert object: "+a.toString());this.Ki=!0}else d===hg?(n=a.object,p=a.Zj,g=a.oldValue,n instanceof x?"number"===typeof p&&g instanceof O?(q=n,b?q.ce(p,g):q.zf(p)):"number"===typeof p&&g instanceof
ih&&(r=g,q=n,b?(e=r.Ke?q.re(r.index):q.qe(r.index),e.lq(r)):r.Ke?q.LG(p):q.JG(p)):n instanceof Gg?(s=!0===a.Xj,"number"===typeof p&&g instanceof F&&(m=g,t=n,b?0>t.rb.indexOf(m)&&t.yq(p,m,s):(m.mb=!1,m.Zg=!1,m.de(),t.zf(s?p:-1,m,s)))):n instanceof E?"number"===typeof p&&g instanceof Gg&&(u=g,b?(d=u,d.cd(this),this.ec.ce(p,d)):this.ec.qd(p)):D.k("unknown ChangedEvent.Remove object: "+a.toString()),this.Ki=!0):d!==fg&&D.k("unknown ChangedEvent: "+a.toString())}finally{this.Ye=c}}};
E.prototype.startTransaction=E.prototype.Qb=function(a){return this.na.Qb(a)};E.prototype.commitTransaction=E.prototype.ld=function(a){return this.na.ld(a)};E.prototype.rollbackTransaction=E.prototype.Hm=function(){return this.na.Hm()};E.prototype.commit=E.prototype.commit=function(a,b){var c=b;void 0===c&&(c="");var d=this.ob;null===c&&(this.ob=!0,c="");this.na.Qb(c);var e=!1;try{a(this),e=!0}finally{e?this.na.ld(c):this.na.Hm(),this.ob=d}};
E.prototype.updateAllTargetBindings=E.prototype.wH=function(a){void 0===a&&(a="");for(var b=this.Wh;b.next();)b.value.Rb(a);for(b=this.rg;b.next();)b.value.Rb(a);for(b=this.links;b.next();)b.value.Rb(a)};
E.prototype.updateAllRelationshipsFromData=E.prototype.JK=function(){for(var a=this.ea,b=new L,c=a.ah,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.Wh.each(function(a){null===a.data||b.contains(a.data)||g.push(a.data)});g.forEach(function(b){dh(a,b,!1)});for(d=0;d<c.length;d++){var e=c[d],h=this.Oh(e);null===h&&ch(a,e,!1)}if(a instanceof X){for(var k=new L,c=a.Sh,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){nh(a,b,!1)});for(d=0;d<c.length;d++)e=c[d],h=this.hg(e),null===h&&mh(a,e,!1)}for(d=this.Wh;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 fn(a,b,c){if(a.gd||a.le)a.Ab=c,c=a.Ra,c.Ac&&sl(c,b,a.Ab);else if(a.gd=!0,null===a.Gb)a.Ab=c;else{var d=a.wb.copy(),e=a.Lb,g=a.Kb;d.width=a.Lb/b;d.height=a.Kb/b;var h=a.Ri.x,k=a.Ri.y,l=a.SA;isNaN(h)&&(l.Rj()?l.Oj(xc)?h=0:l.Oj(Cc)&&(h=e-1):h=l.$c()?l.x*(e-1):e/2);isNaN(k)&&(l.Rj()?l.Oj(wc)?k=0:l.Oj(Dc)&&(k=g-1):k=l.$c()?l.y*(g-1):g/2);null!==a.VG&&(c=a.VG(a,c));c<a.Uh&&(c=a.Uh);c>a.Th&&(c=a.Th);e=D.Db(a.jb.x+h/b-h/c,a.jb.y+k/b-k/c);a.position=e;D.A(e);a.Ab=c;a.hv(d,a.wb,b,c,!1);a.gd=!1;Yl(a,
!1);c=a.Ra;c.Ac&&sl(c,b,a.Ab);a.ra();im(a)}}
E.prototype.hv=function(a,b,c,d,e){a.P(b)||(void 0===e&&(e=!1),e||im(this),Wl(this),d=this.$b,null===d||!d.qy||this.om!==Vh||e||a.width===b.width&&a.height===b.height||d.L(),d=this.cb,!0===this.uh&&d instanceof Ph&&(this.U.ha=this.tC(this.U.Sd),Xk(d,this)),this.gd||this.cG(a,b),lm(this),this.Hh.scale=c,this.Hh.position.x=a.x,this.Hh.position.y=a.y,this.Hh.bounds.set(a),this.Hh.isScroll=e,this.Ka("ViewportBoundsChanged",this.Hh,a),this.AB&&this.links.each(function(a){a.Pj&&a.Y.kg(b)&&a.bc()}))};
function lm(a,b){void 0===b&&(b=null);var c=a.Ed;if(null!==c&&c.visible){for(var d=D.Om(),e=1,g=1,h=c.ya.o,k=h.length,l=0;l<k;l++){var m=h[l],n=m.interval;2>n||(gn(m.Ob)?g=g*n/Se(g,n):e=e*n/Se(e,n))}h=c.iy;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.Ff();g=a.wb;e.n(g.x,g.y,g.width,g.height);for(h=a.Tw.j;h.next();)g=h.value.wb,g.F()&&Ub(e,g.x,g.y,g.width,g.height);if(!e.F()){D.Hb(e);return}k=e.width;l=e.height;g=e.x;h=e.y;D.Hb(e)}c.width=k+2*d.width;c.height=
l+2*d.height;e=D.O();gb(g,h,0,0,d.width,d.height,e);e.offset(-d.width,-d.height);D.bl(d);c.$.location=e;D.A(e)}}E.prototype.clearSelection=E.prototype.PA=function(){var a=0<this.selection.count;a&&this.Ka("ChangingSelection");Th(this);a&&this.Ka("ChangedSelection")};function Th(a){a=a.selection;if(0<a.count){for(var b=a.Hc(),c=b.length,d=0;d<c;d++)b[d].mb=!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.mb||1<this.selection.count)&&(this.Ka("ChangingSelection"),Th(this),a.mb=!0,this.Ka("ChangedSelection")))};
E.prototype.selectCollection=E.prototype.ZG=function(a){this.Ka("ChangingSelection");Th(this);if(D.isArray(a))for(var b=D.fb(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.mb=!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.mb=!0;this.Ka("ChangedSelection")};
E.prototype.clearHighlighteds=E.prototype.gI=function(){var a=this.Bm;if(0<a.count){for(var b=a.Hc(),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.Bm.count)&&(this.gI(),a.Zg=!0)};
E.prototype.highlightCollection=function(a){for(var b=(new L(F)).Yc(a),c=this.Bm.copy().Ny(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.qv:this.pv);else if("page"===a)a=d?this.wb.height:this.wb.width,a*=this.scale,0!==a&&(e=Math.max(a-(d?this.qv:this.pv),0),e*=c);else{if("document"===a){e=this.Qc;d=this.wb;c=D.O();"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.WG=function(a){var b=this.wb;b.Wk(a)||(a=a.pm,a.x-=b.width/2,a.y-=b.height/2,this.position=a)};
E.prototype.centerRect=E.prototype.eF=function(a){var b=this.wb;a=a.pm;a.x-=b.width/2;a.y-=b.height/2;this.position=a};E.prototype.transformDocToView=E.prototype.zv=function(a){var b=this.Oc;b.reset();1!==this.Ab&&b.scale(this.Ab);var c=this.jb;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return a.copy().transform(this.Oc)};
E.prototype.transformViewToDoc=E.prototype.tC=function(a){var b=this.Oc;b.reset();1!==this.Ab&&b.scale(this.Ab);var c=this.jb;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return kb(a.copy(),this.Oc)};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 gj;E.CycleAll=gj=D.s(E,"CycleAll",10);var kj;E.CycleNotDirected=kj=D.s(E,"CycleNotDirected",11);var mj;
E.CycleNotDirectedFast=mj=D.s(E,"CycleNotDirectedFast",12);var nj;E.CycleNotUndirected=nj=D.s(E,"CycleNotUndirected",13);var hj;E.CycleDestinationTree=hj=D.s(E,"CycleDestinationTree",14);var jj;E.CycleSourceTree=jj=D.s(E,"CycleSourceTree",15);var Bl;E.DocumentScroll=Bl=D.s(E,"DocumentScroll",1);var Tm;E.InfiniteScroll=Tm=D.s(E,"InfiniteScroll",2);var Dl;E.TreeParentCollapsed=Dl=D.s(E,"TreeParentCollapsed",21);var hn;E.AllParentsCollapsed=hn=D.s(E,"AllParentsCollapsed",22);var jn;
E.AnyParentsCollapsed=jn=D.s(E,"AnyParentsCollapsed",23);D.defineProperty(E,{KK:"validCycle"},function(){return this.wx},function(a){var b=this.wx;b!==a&&(D.Da(a,E,E,"validCycle"),this.wx=a,this.i("validCycle",b,a))});D.w(E,{jo:"layers"},function(){return this.ec.j});D.defineProperty(E,{Nf:"isModelReadOnly"},function(){var a=this.Ae;return null===a?!1:a.sb},function(a){var b=this.Ae;null!==b&&(b.sb=a)});
D.defineProperty(E,{sb:"isReadOnly"},function(){return this.hj},function(a){var b=this.hj;b!==a&&(D.h(a,"boolean",E,"isReadOnly"),this.hj=a,this.i("isReadOnly",b,a))});D.defineProperty(E,{isEnabled:"isEnabled"},function(){return this.rf},function(a){var b=this.rf;b!==a&&(D.h(a,"boolean",E,"isEnabled"),this.rf=a,this.i("isEnabled",b,a))});
D.defineProperty(E,{KA:"allowClipboard"},function(){return this.Fv},function(a){var b=this.Fv;b!==a&&(D.h(a,"boolean",E,"allowClipboard"),this.Fv=a,this.i("allowClipboard",b,a))});D.defineProperty(E,{Tk:"allowCopy"},function(){return this.ql},function(a){var b=this.ql;b!==a&&(D.h(a,"boolean",E,"allowCopy"),this.ql=a,this.i("allowCopy",b,a))});
D.defineProperty(E,{Jn:"allowDelete"},function(){return this.rl},function(a){var b=this.rl;b!==a&&(D.h(a,"boolean",E,"allowDelete"),this.rl=a,this.i("allowDelete",b,a))});D.defineProperty(E,{ju:"allowDragOut"},function(){return this.Gv},function(a){var b=this.Gv;b!==a&&(D.h(a,"boolean",E,"allowDragOut"),this.Gv=a,this.i("allowDragOut",b,a))});
D.defineProperty(E,{XE:"allowDrop"},function(){return this.Hv},function(a){var b=this.Hv;b!==a&&(D.h(a,"boolean",E,"allowDrop"),this.Hv=a,this.i("allowDrop",b,a))});D.defineProperty(E,{Gx:"allowTextEdit"},function(){return this.Al},function(a){var b=this.Al;b!==a&&(D.h(a,"boolean",E,"allowTextEdit"),this.Al=a,this.i("allowTextEdit",b,a))});
D.defineProperty(E,{Dx:"allowGroup"},function(){return this.sl},function(a){var b=this.sl;b!==a&&(D.h(a,"boolean",E,"allowGroup"),this.sl=a,this.i("allowGroup",b,a))});D.defineProperty(E,{Hx:"allowUngroup"},function(){return this.Bl},function(a){var b=this.Bl;b!==a&&(D.h(a,"boolean",E,"allowUngroup"),this.Bl=a,this.i("allowUngroup",b,a))});
D.defineProperty(E,{dq:"allowInsert"},function(){return this.Jv},function(a){var b=this.Jv;b!==a&&(D.h(a,"boolean",E,"allowInsert"),this.Jv=a,this.i("allowInsert",b,a))});D.defineProperty(E,{ku:"allowLink"},function(){return this.tl},function(a){var b=this.tl;b!==a&&(D.h(a,"boolean",E,"allowLink"),this.tl=a,this.i("allowLink",b,a))});
D.defineProperty(E,{Kn:"allowRelink"},function(){return this.vl},function(a){var b=this.vl;b!==a&&(D.h(a,"boolean",E,"allowRelink"),this.vl=a,this.i("allowRelink",b,a))});D.defineProperty(E,{lm:"allowMove"},function(){return this.ul},function(a){var b=this.ul;b!==a&&(D.h(a,"boolean",E,"allowMove"),this.ul=a,this.i("allowMove",b,a))});
D.defineProperty(E,{Ex:"allowReshape"},function(){return this.wl},function(a){var b=this.wl;b!==a&&(D.h(a,"boolean",E,"allowReshape"),this.wl=a,this.i("allowReshape",b,a))});D.defineProperty(E,{lu:"allowResize"},function(){return this.xl},function(a){var b=this.xl;b!==a&&(D.h(a,"boolean",E,"allowResize"),this.xl=a,this.i("allowResize",b,a))});
D.defineProperty(E,{Fx:"allowRotate"},function(){return this.yl},function(a){var b=this.yl;b!==a&&(D.h(a,"boolean",E,"allowRotate"),this.yl=a,this.i("allowRotate",b,a))});D.defineProperty(E,{Kf:"allowSelect"},function(){return this.zl},function(a){var b=this.zl;b!==a&&(D.h(a,"boolean",E,"allowSelect"),this.zl=a,this.i("allowSelect",b,a))});
D.defineProperty(E,{YE:"allowUndo"},function(){return this.Kv},function(a){var b=this.Kv;b!==a&&(D.h(a,"boolean",E,"allowUndo"),this.Kv=a,this.i("allowUndo",b,a))});D.defineProperty(E,{Ix:"allowZoom"},function(){return this.Mv},function(a){var b=this.Mv;b!==a&&(D.h(a,"boolean",E,"allowZoom"),this.Mv=a,this.i("allowZoom",b,a))});
D.defineProperty(E,{pB:"hasVerticalScrollbar"},function(){return this.nw},function(a){var b=this.nw;b!==a&&(D.h(a,"boolean",E,"hasVerticalScrollbar"),this.nw=a,im(this),this.ra(),this.i("hasVerticalScrollbar",b,a),Yl(this,!1))});D.defineProperty(E,{oB:"hasHorizontalScrollbar"},function(){return this.mw},function(a){var b=this.mw;b!==a&&(D.h(a,"boolean",E,"hasHorizontalScrollbar"),this.mw=a,im(this),this.ra(),this.i("hasHorizontalScrollbar",b,a),Yl(this,!1))});
D.defineProperty(E,{Ce:"allowHorizontalScroll"},function(){return this.Iv},function(a){var b=this.Iv;b!==a&&(D.h(a,"boolean",E,"allowHorizontalScroll"),this.Iv=a,this.i("allowHorizontalScroll",b,a),Yl(this,!1))});D.defineProperty(E,{De:"allowVerticalScroll"},function(){return this.Lv},function(a){var b=this.Lv;b!==a&&(D.h(a,"boolean",E,"allowVerticalScroll"),this.Lv=a,this.i("allowVerticalScroll",b,a),Yl(this,!1))});
D.defineProperty(E,{pv:"scrollHorizontalLineChange"},function(){return this.ax},function(a){var b=this.ax;b!==a&&(D.h(a,"number",E,"scrollHorizontalLineChange"),0>a&&D.va(a,">= 0",E,"scrollHorizontalLineChange"),this.ax=a,this.i("scrollHorizontalLineChange",b,a))});
D.defineProperty(E,{qv:"scrollVerticalLineChange"},function(){return this.hx},function(a){var b=this.hx;b!==a&&(D.h(a,"number",E,"scrollVerticalLineChange"),0>a&&D.va(a,">= 0",E,"scrollVerticalLineChange"),this.hx=a,this.i("scrollVerticalLineChange",b,a))});D.defineProperty(E,{U:"lastInput"},function(){return this.Wb},function(a){v&&D.l(a,ag,E,"lastInput");this.Wb=a});D.defineProperty(E,{Dc:"firstInput"},function(){return this.ej},function(a){v&&D.l(a,ag,E,"firstInput");this.ej=a});
D.defineProperty(E,{sc:"currentCursor"},function(){return this.Wv},function(a){""===a&&(a=this.Rr);if(this.Wv!==a){D.h(a,"string",E,"currentCursor");var b=this.Gb,c=this.Vb;if(null!==b){this.Wv=a;var d=b.style.cursor;b.style.cursor=a;c.style.cursor=a;b.style.cursor===d&&(b.style.cursor="-webkit-"+a,c.style.cursor="-webkit-"+a,b.style.cursor===d&&(b.style.cursor="-moz-"+a,c.style.cursor="-moz-"+a,b.style.cursor===d&&(b.style.cursor=a,c.style.cursor=a)))}}});
D.defineProperty(E,{zL:"defaultCursor"},function(){return this.Rr},function(a){""===a&&(a="auto");var b=this.Rr;b!==a&&(D.h(a,"string",E,"defaultCursor"),this.Rr=a,this.i("defaultCursor",b,a))});D.defineProperty(E,{click:"click"},function(){return this.Vi},function(a){var b=this.Vi;b!==a&&(null!==a&&D.h(a,"function",E,"click"),this.Vi=a,this.i("click",b,a))});
D.defineProperty(E,{tu:"doubleClick"},function(){return this.bj},function(a){var b=this.bj;b!==a&&(null!==a&&D.h(a,"function",E,"doubleClick"),this.bj=a,this.i("doubleClick",b,a))});D.defineProperty(E,{TA:"contextClick"},function(){return this.Xi},function(a){var b=this.Xi;b!==a&&(null!==a&&D.h(a,"function",E,"contextClick"),this.Xi=a,this.i("contextClick",b,a))});
D.defineProperty(E,{KB:"mouseOver"},function(){return this.qj},function(a){var b=this.qj;b!==a&&(null!==a&&D.h(a,"function",E,"mouseOver"),this.qj=a,this.i("mouseOver",b,a))});D.defineProperty(E,{JB:"mouseHover"},function(){return this.pj},function(a){var b=this.pj;b!==a&&(null!==a&&D.h(a,"function",E,"mouseHover"),this.pj=a,this.i("mouseHover",b,a))});
D.defineProperty(E,{IB:"mouseHold"},function(){return this.oj},function(a){var b=this.oj;b!==a&&(null!==a&&D.h(a,"function",E,"mouseHold"),this.oj=a,this.i("mouseHold",b,a))});D.defineProperty(E,{TJ:"mouseDragOver"},function(){return this.Nw},function(a){var b=this.Nw;b!==a&&(null!==a&&D.h(a,"function",E,"mouseDragOver"),this.Nw=a,this.i("mouseDragOver",b,a))});
D.defineProperty(E,{HB:"mouseDrop"},function(){return this.nj},function(a){var b=this.nj;b!==a&&(null!==a&&D.h(a,"function",E,"mouseDrop"),this.nj=a,this.i("mouseDrop",b,a))});D.defineProperty(E,{pC:"toolTip"},function(){return this.zj},function(a){var b=this.zj;b!==a&&(!v||null===a||a instanceof ca||a instanceof hk||D.k("Diagram.toolTip must be an Adornment or HTMLInfo."),this.zj=a,this.i("toolTip",b,a))});
D.defineProperty(E,{contextMenu:"contextMenu"},function(){return this.Yi},function(a){var b=this.Yi;b!==a&&(!v||a instanceof ca||a instanceof hk||D.k("Diagram.contextMenu must be an Adornment or HTMLInfo."),this.Yi=a,this.i("contextMenu",b,a))});D.defineProperty(E,{xb:"commandHandler"},function(){return this.Cz},function(a){var b=this.Cz;b!==a&&(D.l(a,pa,E,"commandHandler"),null!==a.g&&D.k("Cannot share CommandHandlers between Diagrams: "+a.toString()),null!==b&&b.cd(null),this.Cz=a,a.cd(this))});
D.defineProperty(E,{bb:"toolManager"},function(){return this.BA},function(a){var b=this.BA;b!==a&&(D.l(a,Ph,E,"toolManager"),null!==a.g&&D.k("Cannot share ToolManagers between Diagrams: "+a.toString()),null!==b&&b.cd(null),this.BA=a,a.cd(this))});D.defineProperty(E,{su:"defaultTool"},function(){return this.Iz},function(a){var b=this.Iz;b!==a&&(D.l(a,Hg,E,"defaultTool"),this.Iz=a,this.cb===b&&(this.cb=a))});
D.defineProperty(E,{cb:"currentTool"},function(){return this.Fz},function(a){var b=this.Fz;null!==b&&(b.xa&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.su);null!==a&&(D.l(a,Hg,E,"currentTool"),this.Fz=a,a.cd(this),a.doStart())});D.w(E,{selection:"selection"},function(){return this.lx});
D.defineProperty(E,{KJ:"maxSelectionCount"},function(){return this.Iw},function(a){var b=this.Iw;if(b!==a)if(D.h(a,"number",E,"maxSelectionCount"),0<=a&&!isNaN(a)){if(this.Iw=a,this.i("maxSelectionCount",b,a),!this.na.ub&&(a=this.selection.count-a,0<a)){this.Ka("ChangingSelection");for(var b=this.selection.Hc(),c=0;c<a;c++)b[c].mb=!1;this.Ka("ChangedSelection")}}else D.va(a,">= 0",E,"maxSelectionCount")});
D.defineProperty(E,{WJ:"nodeSelectionAdornmentTemplate"},function(){return this.Ow},function(a){var b=this.Ow;b!==a&&(D.l(a,ca,E,"nodeSelectionAdornmentTemplate"),this.Ow=a,this.i("nodeSelectionAdornmentTemplate",b,a))});D.defineProperty(E,{cJ:"groupSelectionAdornmentTemplate"},function(){return this.kw},function(a){var b=this.kw;b!==a&&(D.l(a,ca,E,"groupSelectionAdornmentTemplate"),this.kw=a,this.i("groupSelectionAdornmentTemplate",b,a))});
D.defineProperty(E,{EJ:"linkSelectionAdornmentTemplate"},function(){return this.Dw},function(a){var b=this.Dw;b!==a&&(D.l(a,ca,E,"linkSelectionAdornmentTemplate"),this.Dw=a,this.i("linkSelectionAdornmentTemplate",b,a))});D.w(E,{Bm:"highlighteds"},function(){return this.ow});
D.defineProperty(E,{Ki:"isModified"},function(){var a=this.na;return a.isEnabled?null!==a.Jj?!0:this.uw&&this.sh!==a.Nj:this.uw},function(a){if(this.uw!==a){D.h(a,"boolean",E,"isModified");this.uw=a;var b=this.na;!a&&b.isEnabled&&(this.sh=b.Nj);a||kn(this)}});function kn(a){var b=a.Ki;a.NE!==b&&(a.NE=b,a.Ka("Modified"))}
D.defineProperty(E,{ea:"model"},function(){return this.Ae},function(a){var b=this.Ae;if(b!==a){D.l(a,M,E,"model");this.cb.doCancel();null!==b&&b.na!==a.na&&b.na.jG&&D.k("Do not replace a Diagram.model while a transaction is in progress.");Nl(this,!0);this.th=!1;this.gp=!0;this.sh=-2;this.cg=!1;var c=this.le;this.le=!0;this.Ra.wo("Model");null!==b&&(null!==this.zh&&this.zh.each(function(a){b.kv(a)}),b.kv(this.YD));this.Ae=a;a.In(this.XD);ln(this,a.ah);a instanceof X&&mn(this,a.Sh);a.kv(this.XD);a.In(this.YD);
null!==this.zh&&this.zh.each(function(b){a.In(b)});this.le=c;this.gd||this.ra();null!==b&&(a.na.isEnabled=b.na.isEnabled)}});D.defineProperty(E,{ab:null},function(){return this.QD},function(a){this.QD=a});D.w(E,{yy:null},function(){return this.IH});
function Fl(a,b){if(b.ea===a.ea){var c=b.Pc,d=b.propertyName;if(c===fg&&"S"===d[0])if("StartingFirstTransaction"===d)c=a.bb,c.qf.each(function(b){b.cd(a)}),c.ng.each(function(b){b.cd(a)}),c.og.each(function(b){b.cd(a)}),a.le||a.th||(a.Wr=!0,a.gp&&(a.cg=!0));else if("StartingUndo"===d||"StartingRedo"===d){var e=a.Ra;e.nf&&!a.ob&&e.ai();a.Ka("ChangingSelection")}else"StartedTransaction"===d&&(e=a.Ra,e.nf&&!a.ob&&e.ai());else if(a.ab){a.ab=!1;try{var g=b.Df;if(""!==g)if(c===eg){if("linkFromKey"===g){var h=
b.object,k=a.hg(h);if(null!==k){var l=b.newValue,m=a.Ve(l);k.Z=m}}else if("linkToKey"===g)h=b.object,k=a.hg(h),null!==k&&(l=b.newValue,m=a.Ve(l),k.ba=m);else if("linkFromPortId"===g){if(h=b.object,k=a.hg(h),null!==k){var n=b.newValue;"string"===typeof n&&(k.ig=n)}}else if("linkToPortId"===g)h=b.object,k=a.hg(h),null!==k&&(n=b.newValue,"string"===typeof n&&(k.jh=n));else if("nodeGroupKey"===g){var h=b.object,p=a.Oh(h);if(null!==p){var q=b.newValue;if(void 0!==q){var r=a.Ve(q);p.Ja=r instanceof I?r:
null}else p.Ja=null}}else if("linkLabelKeys"===g){if(h=b.object,k=a.hg(h),null!==k){var s=b.oldValue,t=b.newValue;if(D.isArray(s))for(var u=D.fb(s),z=0;z<u;z++){var w=D.La(s,z),m=a.Ve(w);null!==m&&(m.Zb=null)}if(D.isArray(t))for(u=D.fb(t),z=0;z<u;z++)w=D.La(t,z),m=a.Ve(w),null!==m&&(m.Zb=k)}}else if("nodeParentKey"===g){var y=b.object,B=a.Ve(b.newValue),P=a.by(y);if(null!==a.Ik)null!==B&&(a.Ik.data=y,a.Ik.wd=a.vq(y));else if(null!==P){var G=P.Xn();null!==G?null===B?a.remove(G):a.ge?G.Z=B:G.ba=B:nn(a,
B,P)}}else if("parentLinkCategory"===g){var y=b.object,P=a.by(y),Q=b.newValue;null!==P&&"string"===typeof Q&&(G=P.Xn(),null!==G&&(G.wd=Q))}else if("nodeCategory"===g){var h=b.object,Y=a.Oh(h),Q=b.newValue;null!==Y&&"string"===typeof Q&&(Y.wd=Q)}else if("linkCategory"===g){var h=b.object,U=a.hg(h),Q=b.newValue;null!==U&&"string"===typeof Q&&(U.wd=Q)}else if("nodeDataArray"===g){var ea=b.oldValue;on(a,ea);var la=b.newValue;ln(a,la)}else"linkDataArray"===g&&(ea=b.oldValue,on(a,ea),la=b.newValue,mn(a,
la));a.Ki=!0}else c===gg?(la=b.newValue,"nodeDataArray"===g&&D.Qa(la)?pn(a,la):"linkDataArray"===g&&D.Qa(la)?qn(a,la):"linkLabelKeys"===g&&bh(la)&&(k=a.hg(b.object),m=a.Ve(la),null!==k&&null!==m&&(m.Zb=k)),a.Ki=!0):c===hg?(ea=b.oldValue,"nodeDataArray"===g&&D.Qa(ea)?rn(a,ea):"linkDataArray"===g&&D.Qa(ea)?rn(a,ea):"linkLabelKeys"===g&&bh(ea)&&(m=a.Ve(ea),null!==m&&(m.Zb=null)),a.Ki=!0):c===fg&&("SourceChanged"===g?null!==b.object?El(a,b.object,b.propertyName):(a.JK(),a.wH()):"ModelDisplaced"===g&&
a.Fm());else if(c===eg){var Da=b.propertyName,h=b.object;if(h===a.ea){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.Fm()}else El(a,h,Da);a.Ki=!0}else if(c===gg||c===hg)sn(a,b),a.Ki=!0;else if(c===fg){if("FinishedUndo"===d||
"FinishedRedo"===d)a.Ka("ChangedSelection"),Ti(a);e=a.Ra;"RolledBackTransaction"===d&&e.ai();a.Wr=!0;a.mg();0===a.na.Oi&&el(e);"CommittedTransaction"===d&&a.na.eA&&(a.sh=Math.min(a.sh,a.na.Nj-1));var La=b.nG;La&&(kn(a),a.yy.clear());!a.kA&&La&&(a.kA=!0,D.setTimeout(function(){a.cb.standardMouseOver();a.kA=!1},10))}}finally{a.ab=!0}}}}
function El(a,b,c){if("string"===typeof c){var d=a.Oh(b);if(null!==d)d.Rb(c),a.ea instanceof Ag&&(d=a.hg(b),null!==d&&d.Rb(c));else{for(var d=null,e=a.fn.j;e.next();){for(var g=e.value,h=0;h<g.length;h++){var k=g[h].NI(b);null!==k&&(null===d&&(d=D.hb()),d.push(k))}if(null!==d)break}if(null!==d){for(e=0;e<d.length;e++)d[e].Rb(c);D.ua(d)}}b===a.ea.ll&&a.wH(c)}}D.defineProperty(E,{Ye:"skipsModelSourceBindings"},function(){return this.qE},function(a){this.qE=a});
D.defineProperty(E,{Co:null},function(){return this.wA},function(a){this.wA=a});function sn(a,b){var c=b.Pc===gg,d=c?b.Xj:b.Zj,e=c?b.newValue:b.oldValue,g=a.fn.oa(b.object);if(Array.isArray(g))for(var h=0;h<g.length;h++){var k=g[h];if(c)tn(k,e,d);else{var l=d;if(!(0>l)){var m=l;un(k)&&m++;k.zf(m,!0);vn(k,m,l)}}}}function Ym(a,b){var c=b.ij;if(D.isArray(c)){var d=a.fn.oa(c);if(null===d)d=[],d.push(b),a.fn.add(c,d);else{for(c=0;c<d.length;c++)if(d[c]===b)return;d.push(b)}}}
function bn(a,b){var c=b.ij;if(D.isArray(c)){var d=a.fn.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.fn.remove(c);break}}}function Xm(a,b){for(var c=b.ya.o,d=c.length,e=0;e<d;e++){var g=c[e];g instanceof Gl&&wn(a,g)}}
function wn(a,b){var c=b.element;if(null!==c&&c instanceof HTMLImageElement){var d=b.bf;null!==d&&(d.jp instanceof Event&&null!==b.cf&&b.cf(b,d.jp),!0===d.ts&&(null!==b.Ci&&b.Ci(b,d.rA),null!==b.g&&b.g.nA.add(b)));c=c.src;d=a.Hp.oa(c);if(null===d)d=[],d.push(b),a.Hp.add(c,d);else{for(c=0;c<d.length;c++)if(d[c]===b)return;d.push(b)}}}function an(a,b){for(var c=b.ya.o,d=c.length,e=0;e<d;e++){var g=c[e];g instanceof Gl&&xn(a,g)}}
function xn(a,b){var c=b.element;if(null!==c&&c instanceof HTMLImageElement){var c=c.src,d=a.Hp.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.Hp.remove(c),yn(c));break}}}
E.prototype.rebuildParts=E.prototype.Fm=function(){for(var a=this.OB.j;a.next();){var b=a.value,c=a.key;(!b.te()||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.nB.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.CB.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.hb();for(b=this.selection.j;b.next();)(c=b.value.data)&&a.push(c);for(var b=D.hb(),d=this.Bm.j;d.next();)(c=d.value.data)&&b.push(c);c=D.hb();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.Wh.j;d.next();)e=d.value,null!==
e.data&&(c.push(e.data),c.push(e.location));d=this.ea;d instanceof X&&on(this,d.Sh);on(this,d.ah);ln(this,d.ah);d instanceof X&&mn(this,d.Sh);for(d=0;d<a.length;d++)e=this.Oh(a[d]),null!==e&&(e.mb=!0);for(d=0;d<b.length;d++)e=this.Oh(b[d]),null!==e&&(e.Zg=!0);for(d=0;d<c.length;d+=2)e=this.Oh(c[d]),null!==e&&(e.location=c[d+1]);D.ua(a);D.ua(b);D.ua(c)};
function ln(a,b){if(null!==b){for(var c=a.ea,d=c instanceof X,e=D.fb(b),g=0;g<e;g++){var h=D.La(b,g);c.me(h)?pn(a,h,!1):d&&qn(a,h)}if(d||c instanceof Ag){for(g=0;g<e;g++)h=D.La(b,g),c.me(h)&&zn(a,h);if(d)for(c=a.links;c.next();)An(c.value)}Bn(a,!1)}}function pn(a,b,c){if(void 0!==b&&null!==b&&!a.na.ub&&!a.Zi.contains(b)){void 0===c&&(c=!0);var d=a.jB(b),e=Cn(a,b,d);if(null!==e&&(Sh(e),e=e.copy(),null!==e)){var g=a.Ye;a.Ye=!0;e.Ti=d;e.Ud=b;a.add(e);e.Ud=null;e.data=b;c&&zn(a,b);a.Ye=g}}}
E.prototype.jB=function(a){return this.ea.jB(a)};var Dn=!1,En=!1;function Cn(a,b,c){var d=!1,e=a.ea;e instanceof X&&(d=e.xB(b));d?(b=a.nB.oa(c),null===b&&(b=a.nB.oa(""),null===b&&(En||(En=!0,D.trace('No Group template found for category "'+c+'"'),D.trace(" Using default group template")),b=a.gD))):(b=a.OB.oa(c),null===b&&(b=a.OB.oa(""),null===b&&(Dn||(Dn=!0,D.trace('No Node template found for category "'+c+'"'),D.trace(" Using default node template")),b=a.iD)));return b}
function zn(a,b){var c=a.ea;if(c instanceof X||c instanceof Ag){var d=c.yb(b);if(void 0!==d){var e=eh(c,d),g=a.Oh(b);if(null!==e&&null!==g){for(e=e.j;e.next();){var h=e.value;if(c instanceof X){var k=c;if(k.me(h)){if(g instanceof I&&k.Zn(h)===d){var l=g,h=a.Oh(h);null!==h&&(h.Ja=l)}}else{var m=a.hg(h);if(null!==m&&g instanceof H&&(l=g,k.zm(h)===d&&(m.Z=l),k.Am(h)===d&&(m.ba=l),h=k.dl(h),D.isArray(h)))for(k=0;k<D.fb(h);k++)if(D.La(h,k)===d){l.Zb=m;break}}}else c instanceof Ag&&(m=c,m.me(h)&&g instanceof
H&&(l=g,m.ao(h)===d&&(h=a.by(h),nn(a,l,h))))}gh(c,d)}c instanceof X?(c=c.Zn(b),void 0!==c&&(c=a.Ve(c),c instanceof I&&(g.Ja=c))):c instanceof Ag&&(c=c.ao(b),void 0!==c&&g instanceof H&&(l=g,g=a.Ve(c),nn(a,g,l)))}}}
function nn(a,b,c){if(null!==b&&null!==c){var d=a.bb.uG,e=b,g=c;if(a.ge)for(b=g.Od;b.next();){if(b.value.ba===g)return}else for(e=c,g=b,b=e.Od;b.next();)if(b.value.Z===e)return;if(null===d||!ij(d,e,g,null,!0))if(d=a.vq(c.data),b=sj(a,d),null!==b&&(Sh(b),b=b.copy(),null!==b)){var h=a.Ye;a.Ye=!0;b.Ti=d;b.Ud=c.data;b.Z=e;b.ba=g;a.add(b);b.Ud=null;b.data=c.data;a.Ye=h}}}function mn(a,b){if(null!==b){for(var c=D.fb(b),d=0;d<c;d++){var e=D.La(b,d);qn(a,e)}Bn(a,!1)}}
function qn(a,b){if(void 0!==b&&null!==b&&!a.na.ub&&!a.jk.contains(b)){var c=a.vq(b),d=sj(a,c);if(null!==d&&(Sh(d),d=d.copy(),null!==d)){var e=a.Ye;a.Ye=!0;d.Ti=c;d.Ud=b;var c=a.ea,g=c.VI(b);""!==g&&(d.ig=g);g=c.zm(b);void 0!==g&&(g=a.Ve(g),g instanceof H&&(d.Z=g));g=c.ZI(b);""!==g&&(d.jh=g);g=c.Am(b);void 0!==g&&(g=a.Ve(g),g instanceof H&&(d.ba=g));c=c.dl(b);if(D.isArray(c))for(var g=D.fb(c),h=0;h<g;h++){var k=D.La(c,h),k=a.Ve(k);null!==k&&(k.Zb=d)}a.add(d);d.Ud=null;d.data=b;a.Ye=e}}}
E.prototype.vq=function(a){var b=this.ea,c="";b instanceof X?c=b.vq(a):b instanceof Ag&&(c=b.XI(a));return c};var Fn=!1;function sj(a,b){var c=a.CB.oa(b);null===c&&(c=a.CB.oa(""),null===c&&(Fn||(Fn=!0,D.trace('No Link template found for category "'+b+'"'),D.trace(" Using default link template")),c=a.hD));return c}function on(a,b){for(var c=D.fb(b),d=0;d<c;d++){var e=D.La(b,d);rn(a,e)}}
function rn(a,b){if(void 0!==b&&null!==b){var c=a.Oh(b);if(null!==c){cn(a,c,!1);var d=a.ea;if(d instanceof X&&c instanceof H){var e=c,c=d.yb(e.data);if(void 0!==c){for(var g=e.Od;g.next();)fh(d,c,g.value.data);e.Mf&&(g=e.Zb,null!==g&&fh(d,c,g.data));if(e instanceof I)for(e=e.lc;e.next();)g=e.value.data,d.me(g)&&fh(d,c,g)}}else if(d instanceof Ag&&c instanceof H){e=c;c=d.yb(e.data);g=a.hg(e.data);if(null!==g){g.mb=!1;g.Zg=!1;var h=g.layer;if(null!==h){var k=h.zf(-1,g,!1);0<=k&&a.pd(hg,"parts",h,g,
null,k,null);k=g.uy;null!==k&&k(g,h,null)}}g=a.ge;for(e=e.Od;e.next();)h=e.value,h=(g?h.ba:h.Z).data,d.me(h)&&fh(d,c,h)}}}}E.prototype.findPartForKey=E.prototype.OI=function(a){if(null===a||void 0===a)return null;var b=this.ea.Ie(a);return null!==b?this.Zi.oa(b):this.ea instanceof X&&(b=this.ea.sq(a),null!==b)?this.jk.oa(b):null};
E.prototype.findNodeForKey=E.prototype.Ve=function(a){if(null===a||void 0===a)return null;a=this.ea.Ie(a);if(null===a)return null;a=this.Zi.oa(a);return a instanceof H?a:null};E.prototype.findPartForData=E.prototype.Oh=function(a){if(null===a)return null;var b=this.Zi.oa(a);return null!==b?b:b=this.jk.oa(a)};E.prototype.findNodeForData=E.prototype.by=function(a){if(null===a)return null;a=this.Zi.oa(a);return a instanceof H?a:null};
E.prototype.findLinkForData=E.prototype.hg=function(a){return null===a?null:this.jk.oa(a)};E.prototype.findNodesByExample=function(a){for(var b=new L(H),c=this.Fp.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.zp.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,{mM:"nodeTemplate"},function(){return this.rj.oa("")},function(a){var b=this.rj.oa("");b!==a&&(D.l(a,F,E,"nodeTemplate"),this.rj.add("",a),this.i("nodeTemplate",b,a),this.na.ub||this.Fm())});
D.defineProperty(E,{OB:"nodeTemplateMap"},function(){return this.rj},function(a){var b=this.rj;b!==a&&(D.l(a,ma,E,"nodeTemplateMap"),this.rj=a,this.i("nodeTemplateMap",b,a),this.na.ub||this.Fm())});D.defineProperty(E,{SL:"groupTemplate"},function(){return this.Kl.oa("")},function(a){var b=this.Kl.oa("");b!==a&&(D.l(a,I,E,"groupTemplate"),this.Kl.add("",a),this.i("groupTemplate",b,a),this.na.ub||this.Fm())});
D.defineProperty(E,{nB:"groupTemplateMap"},function(){return this.Kl},function(a){var b=this.Kl;b!==a&&(D.l(a,ma,E,"groupTemplateMap"),this.Kl=a,this.i("groupTemplateMap",b,a),this.na.ub||this.Fm())});D.defineProperty(E,{aM:"linkTemplate"},function(){return this.Ak.oa("")},function(a){var b=this.Ak.oa("");b!==a&&(D.l(a,J,E,"linkTemplate"),this.Ak.add("",a),this.i("linkTemplate",b,a),this.na.ub||this.Fm())});
D.defineProperty(E,{CB:"linkTemplateMap"},function(){return this.Ak},function(a){var b=this.Ak;b!==a&&(D.l(a,ma,E,"linkTemplateMap"),this.Ak=a,this.i("linkTemplateMap",b,a),this.na.ub||this.Fm())});D.defineProperty(E,{rJ:null},function(){return this.uh},function(a){this.uh=a});
D.defineProperty(E,{of:"isMouseCaptured"},function(){return this.ND},function(a){var b=this.Gb;null!==b&&(a?(this.U.bubbles=!1,this.sz?(b.removeEventListener("pointermove",this.Oq,!1),b.removeEventListener("pointerdown",this.Nq,!1),b.removeEventListener("pointerup",this.Qq,!1),b.removeEventListener("pointerout",this.Pq,!1),window.addEventListener("pointermove",this.Oq,!0),window.addEventListener("pointerdown",this.Nq,!0),window.addEventListener("pointerup",this.Qq,!0),window.addEventListener("pointerout",
this.Pq,!0)):(b.removeEventListener("mousemove",this.qo,!1),b.removeEventListener("mousedown",this.po,!1),b.removeEventListener("mouseup",this.so,!1),b.removeEventListener("mouseout",this.ro,!1),window.addEventListener("mousemove",this.qo,!0),window.addEventListener("mousedown",this.po,!0),window.addEventListener("mouseup",this.so,!0),window.addEventListener("mouseout",this.ro,!0)),b.removeEventListener("wheel",this.to,!1),window.addEventListener("wheel",this.to,!0),window.addEventListener("selectstart",
this.preventDefault,!1)):(this.sz?(window.removeEventListener("pointermove",this.Oq,!0),window.removeEventListener("pointerdown",this.Nq,!0),window.removeEventListener("pointerup",this.Qq,!0),window.removeEventListener("pointerout",this.Pq,!0),b.addEventListener("pointermove",this.Oq,!1),b.addEventListener("pointerdown",this.Nq,!1),b.addEventListener("pointerup",this.Qq,!1),b.addEventListener("pointerout",this.Pq,!1)):(window.removeEventListener("mousemove",this.qo,!0),window.removeEventListener("mousedown",
this.po,!0),window.removeEventListener("mouseup",this.so,!0),window.removeEventListener("mouseout",this.ro,!0),b.addEventListener("mousemove",this.qo,!1),b.addEventListener("mousedown",this.po,!1),b.addEventListener("mouseup",this.so,!1),b.addEventListener("mouseout",this.ro,!1)),window.removeEventListener("wheel",this.to,!0),window.removeEventListener("selectstart",this.preventDefault,!1),b.addEventListener("wheel",this.to,!1)),this.ND=a)});
D.defineProperty(E,{position:"position"},function(){return this.jb},function(a){var b=this.jb;if(!b.P(a)){D.l(a,N,E,"position");var c=this.wb.copy();a=a.copy();if(!this.gd&&null!==this.Gb){this.gd=!0;var d=this.scale;$l(this,a,this.Qc,this.Lb/d,this.Kb/d,this.Xm,!1);this.gd=!1}this.jb=a.V();a=this.Ra;a.Ac&&rl(a,b,this.jb);this.gd||this.hv(c,this.wb,this.Ab,this.Ab,!1)}});
D.defineProperty(E,{jJ:"initialPosition"},function(){return this.qw},function(a){this.qw.P(a)||(D.l(a,N,E,"initialPosition"),this.qw=a.V())});D.defineProperty(E,{kJ:"initialScale"},function(){return this.rw},function(a){this.rw!==a&&(D.h(a,"number",E,"initialScale"),this.rw=a)});
D.defineProperty(E,{bo:"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.Q;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.GA;if(null===this.Gb)return a;var b=this.jb,c=this.Ab;a.n(b.x,b.y,Math.max(this.Lb,0)/c,Math.max(this.Kb,0)/c);return a});D.defineProperty(E,{KF:"fixedBounds"},function(){return this.iw},function(a){var b=this.iw;b.P(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.iw=a=a.V(),this.Rc(),this.i("fixedBounds",b,a))});
D.defineProperty(E,{Sy:"scrollMargin"},function(){return this.bx},function(a){"number"===typeof a?a=new Mb(a):D.l(a,Mb,E,"scrollMargin");var b=this.bx;b.P(a)||(this.bx=a=a.V(),this.i("scrollMargin",b,a),this.Gm())});D.defineProperty(E,{Ty:"scrollMode"},function(){return this.ex},function(a){var b=this.ex;b!==a&&(D.Da(a,E,E,"scrollMode"),this.ex=a,a===Bl&&Yl(this,!1),this.i("scrollMode",b,a),this.Gm())});
D.defineProperty(E,{oK:"scrollsPageOnFocus"},function(){return this.ix},function(a){var b=this.ix;b!==a&&(D.h(a,"boolean",E,"scrollsPageOnFocus"),this.ix=a,this.i("scrollsPageOnFocus",b,a))});D.defineProperty(E,{GG:"positionComputation"},function(){return this.Xw},function(a){var b=this.Xw;b!==a&&(null!==a&&D.h(a,"function",E,"positionComputation"),this.Xw=a,Yl(this,!1),this.i("positionComputation",b,a))});
D.defineProperty(E,{VG:"scaleComputation"},function(){return this.Zw},function(a){var b=this.Zw;b!==a&&(null!==a&&D.h(a,"function",E,"scaleComputation"),this.Zw=a,fn(this,this.scale,this.scale),this.i("scaleComputation",b,a))});D.w(E,{Qc:"documentBounds"},function(){return this.cw});function am(a,b){a.uk=!1;var c=a.cw;c.P(b)||(b=b.V(),a.cw=b,Yl(a,!1),a.Ka("DocumentBoundsChanged",null,c.copy()),im(a))}
D.defineProperty(E,{AB:"isVirtualized"},function(){return this.yw},function(a){var b=this.yw;b!==a&&(D.h(a,"boolean",E,"isVirtualized"),this.yw=a,this.i("isVirtualized",b,a))});D.defineProperty(E,{scale:"scale"},function(){return this.Ab},function(a){var b=this.Ab;D.p(a,E,"scale");b!==a&&fn(this,b,a)});D.defineProperty(E,{om:"autoScale"},function(){return this.Um},function(a){var b=this.Um;b!==a&&(D.Da(a,E,E,"autoScale"),this.Um=a,this.i("autoScale",b,a),a!==Vh&&Yl(this,!1))});
D.defineProperty(E,{VL:"initialAutoScale"},function(){return this.Ol},function(a){var b=this.Ol;b!==a&&(D.Da(a,E,E,"initialAutoScale"),this.Ol=a,this.i("initialAutoScale",b,a))});D.defineProperty(E,{lJ:"initialViewportSpot"},function(){return this.sw},function(a){var b=this.sw;b!==a&&(D.l(a,R,E,"initialViewportSpot"),a.$c()||D.k("initialViewportSpot must be a specific Spot: "+a),this.sw=a,this.i("initialViewportSpot",b,a))});
D.defineProperty(E,{iJ:"initialDocumentSpot"},function(){return this.pw},function(a){var b=this.pw;b!==a&&(D.l(a,R,E,"initialDocumentSpot"),a.$c()||D.k("initialViewportSpot must be a specific Spot: "+a),this.pw=a,this.i("initialDocumentSpot",b,a))});D.defineProperty(E,{Uh:"minScale"},function(){return this.Kw},function(a){D.p(a,E,"minScale");var b=this.Kw;b!==a&&(0<a?(this.Kw=a,this.i("minScale",b,a),a>this.scale&&(this.scale=a)):D.va(a,"> 0",E,"minScale"))});
D.defineProperty(E,{Th:"maxScale"},function(){return this.Hw},function(a){D.p(a,E,"maxScale");var b=this.Hw;b!==a&&(0<a?(this.Hw=a,this.i("maxScale",b,a),a<this.scale&&(this.scale=a)):D.va(a,"> 0",E,"maxScale"))});D.defineProperty(E,{Ri:"zoomPoint"},function(){return this.zx},function(a){this.zx.P(a)||(D.l(a,N,E,"zoomPoint"),this.zx=a=a.V())});
D.defineProperty(E,{SA:"contentAlignment"},function(){return this.Xm},function(a){var b=this.Xm;b.P(a)||(D.l(a,R,E,"contentAlignment"),this.Xm=a=a.V(),this.i("contentAlignment",b,a),Yl(this,!1))});D.defineProperty(E,{WL:"initialContentAlignment"},function(){return this.mp},function(a){var b=this.mp;b.P(a)||(D.l(a,R,E,"initialContentAlignment"),this.mp=a=a.V(),this.i("initialContentAlignment",b,a))});
D.defineProperty(E,{padding:"padding"},function(){return this.tf},function(a){"number"===typeof a?a=new Mb(a):D.l(a,Mb,E,"padding");var b=this.tf;b.P(a)||(this.tf=a=a.V(),this.Rc(),this.i("padding",b,a))});D.w(E,{rg:"nodes"},function(){return this.Fp.j});D.w(E,{links:"links"},function(){return this.zp.j});D.w(E,{Wh:"parts"},function(){return this.rb.j});
E.prototype.findTopLevelNodesAndLinks=function(){for(var a=new L(F),b=this.Fp.j;b.next();){var c=b.value;c.Fq&&a.add(c)}for(b=this.zp.j;b.next();)c=b.value,c.Fq&&a.add(c);return a.j};E.prototype.findTopLevelGroups=function(){return this.fm.j};D.defineProperty(E,{$b:"layout"},function(){return this.ye},function(a){var b=this.ye;b!==a&&(D.l(a,Ig,E,"layout"),null!==b&&(b.g=null,b.group=null),this.ye=a,a.g=this,a.group=null,this.gk=!0,this.i("layout",b,a),this.Le())});
E.prototype.layoutDiagram=function(a){Ti(this);a&&Bn(this,!0);mm(this,!1)};function Bn(a,b){for(var c=a.fm.j;c.next();)In(a,c.value,b);null!==a.$b&&(b?a.$b.Af=!1:a.$b.L())}function In(a,b,c){if(null!==b){for(var d=b.on.j;d.next();)In(a,d.value,c);null!==b.$b&&(c?b.$b.Af=!1:b.$b.L())}}
function mm(a,b){if(a.gk&&!a.Jz){var c=a.ab;a.ab=!0;var d=a.na.Oi,e=a.$b;try{0===d&&a.Qb("Layout");var g=a.Ra;1>=d&&!g.nf&&!g.Ac&&(b||g.wo("Layout"));a.gk=!1;for(var h=a.fm.j;h.next();)Jn(a,h.value,b,d);e.Af||(!b||e.mG||0===d?(e.doLayout(a),Ti(a),e.Af=!0):a.gk=!0)}finally{0===d&&a.ld("Layout"),a.gk=!e.Af,a.ab=c}}}
function Jn(a,b,c,d){if(null!==b){for(var e=b.on.j;e.next();)Jn(a,e.value,c,d);e=b.$b;null===e||e.Af||(!c||e.mG||0===d?(b.uo=!b.location.F(),e.doLayout(b),b.L(Kn),rm(a,b),e.Af=!0):a.gk=!0)}}D.defineProperty(E,{ge:"isTreePathToChildren"},function(){return this.xw},function(a){var b=this.xw;if(b!==a&&(D.h(a,"boolean",E,"isTreePathToChildren"),this.xw=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(H),b=this.rg;b.next();){var c=b.value;c.Fq&&null===c.Xn()&&a.add(c)}return a.j};D.defineProperty(E,{uC:"treeCollapsePolicy"},function(){return this.ux},function(a){var b=this.ux;b!==a&&(a!==Dl&&a!==hn&&a!==jn&&D.k("Unknown Diagram.treeCollapsePolicy: "+a),this.ux=a,this.i("treeCollapsePolicy",b,a))});D.defineProperty(E,{Qh:null},function(){return this.ED},function(a){this.ED=a});
function Cl(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 ma("string",K),d=new ma("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.Lz=c;a.Kz=d}
function Fa(a,b){var c=a.Kz.oa(b);return null!==c?c:a.Kz.oa(b.toLowerCase())}function Mn(a,b){var c=a.Lz.oa(b);if(null!==c)return c;c=a.Lz.oa(b.toLowerCase());if(null!==c)return c;D.k("Unknown DiagramEvent name: "+b);return null}E.prototype.addDiagramListener=E.prototype.Ax=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.VB=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.Ka=function(a,b,c){v&&D.h(a,"string",E,"raiseDiagramEvent:name");var d=Mn(this,a),e=new cg;e.g=this;a=Fa(this,a);null!==a&&(e.name=a);void 0!==b&&(e.lC=b);void 0!==c&&(e.QB=c);b=d.length;if(1===b)d=d.fa(0),d(e);else if(0!==b)for(c=d.Hc(),a=0;a<b;a++)d=c[a],d(e);return e.cancel};function Nn(a){if(a.Ra.nf)return!1;a=a.cb;return a instanceof Uh?!a.qx||a.nJ:!0}
E.prototype.isUnoccupied=E.prototype.Hq=function(a,b){void 0===b&&(b=null);return ga(this,!1,null,b).Hq(a.x,a.y,a.width,a.height)};E.prototype.computeOccupiedArea=function(){return this.AB?this.wb.copy():this.uk?Xl(this):this.Qc.copy()};
function ga(a,b,c,d){null===a.Yd&&(a.Yd=new On);if(a.Yd.zq||a.Yd.group!==c||a.Yd.kC!==d){if(null===c){b=a.computeOccupiedArea();b.jg(100,100);a.Yd.initialize(b);b=D.Ff();for(var e=a.rg;e.next();){var g=e.value,h=g.layer;null!==h&&h.visible&&!h.Sc&&Pn(a,g,d,b)}}else for(0<c.lc.count&&(b=a.computePartsBounds(c.lc,!1),b.jg(20,20),a.Yd.initialize(b)),b=D.Ff(),e=c.lc;e.next();)g=e.value,g instanceof H&&Pn(a,g,d,b);D.Hb(b);a.Yd.group=c;a.Yd.kC=d;a.Yd.zq=!1}else b&&Qn(a.Yd);return a.Yd}
function Pn(a,b,c,d){if(b!==c)if(b.isVisible()&&b.NA&&!b.Mf){c=b.getAvoidableRect(d);d=a.Yd.hq;b=a.Yd.fq;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)Rn(a.Yd,h,k);Rn(a.Yd,h,g)}for(k=c.y;k<g;k+=b)Rn(a.Yd,e,k);Rn(a.Yd,e,g)}else if(b instanceof I)for(b=b.lc;b.next();)e=b.value,e instanceof H&&Pn(a,e,c,d)}E.invalidatePositionArray=E.prototype.tB=function(a){null!==this.Yd&&!this.Yd.zq&&(void 0===a&&(a=null),null===a||a.NA&&!a.Mf)&&(this.Yd.zq=!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.bb.pe&&(ji(e),di.ly=!1,e.bb.pe.doSimulatedDragLeave()),ei=c,null!==c&&c!==d&&null!==c.bb.pe&&(Ki(),e=c.bb.pe,Gi.contains(e)||Gi.add(e),c.bb.pe.doSimulatedDragEnter()));if(null===c||c===d||!c.XE||c.sb||!c.dq)return!1;d=c.bb.pe;null!==d&&(null!==a?b=c.ip(a):null===b&&(b=new N),c.Wb.ha=b,c.Wb.Sd=c.zv(b),c.Wb.Yk=!1,c.Wb.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.bb.pe)return ji(b),di.ly=!1,b.bb.pe.doSimulatedDragLeave(),!1;ei=d;null!==d&&null!==d.bb.pe&&(Ki(),b=d.bb.pe,Gi.contains(b)||Gi.add(b),d.bb.pe.doSimulatedDragEnter())}if(null===d)return di.doCancel(),!0;if(d!==this)return null!==a&&(c=d.ip(a)),d.Wb.ha=c,d.Wb.Sd=d.zv(c),d.Wb.Yk=!1,d.Wb.up=!0,a=d.bb.pe,null!==a&&a.doSimulatedDrop(),a=di,null!==a&&(d=a.mayCopy(),a.Tf=d?
"Copy":"Move",a.stopTool()),!0}return!1};D.defineProperty(E,{oL:"autoScrollInterval"},function(){return this.tr},function(a){var b=this.tr;D.p(a,E,"scale");b!==a&&(this.tr=a,this.i("autoScrollInterval",b,a))});D.defineProperty(E,{dF:"autoScrollRegion"},function(){return this.Pv},function(a){"number"===typeof a?a=new Mb(a):D.l(a,Mb,E,"autoScrollRegion");var b=this.Pv;b.P(a)||(this.Pv=a=a.V(),this.Rc(),this.i("autoScrollRegion",b,a))});
E.prototype.doAutoScroll=E.prototype.$A=function(a){this.Ov.assign(a);Sn(this,this.Ov).Zc(this.position)?ji(this):Tn(this)};function Tn(a){-1===a.Oo&&(a.Oo=D.setTimeout(function(){if(-1!==a.Oo){ji(a);var b=a.U.event;if(null!==b){var c=Sn(a,a.Ov);c.Zc(a.position)||(a.position=c,a.U.ha=a.tC(a.Ov),c=fm(b),a.simulatedMouseMove(b,null,c)||a.doMouseMove(),a.uk=!0,am(a,a.Qc.copy().lh(a.computeBounds())),a.Pe=!0,a.mg(),Tn(a))}}},a.tr))}function ji(a){-1!==a.Oo&&(D.clearTimeout(a.Oo),a.Oo=-1)}
function Sn(a,b){var c=a.position,d=a.dF;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.Db(0,0);if(b.x>=e.x&&b.x<e.x+d.left){var k=Math.max(a.pv,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.pv,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.qv,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.qv,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.Zc(Jd)||(c=new N(c.x+h.x/g,c.y+h.y/g));D.Hb(e);D.A(h);return c}E.prototype.makeSvg=E.prototype.makeSVG=function(a){void 0===a&&(a=new ja);a.context="svg";a=Un(this,a);return null!==a?a.Mm:null};
E.prototype.makeImage=function(a){void 0===a&&(a=new ja);var b=(a.document||document).createElement("img");b.src=this.FJ(a);return b};
E.prototype.makeImageData=E.prototype.FJ=function(a){void 0===a&&(a=new ja);var b=Un(this,a);if(null!==b){var c=a.returnType,c=void 0===c?"string":c.toLowerCase();switch(c){case "imagedata":return b.Xk.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 Vn=!1;
function Un(a,b){a.Ra.ai();a.mg();if(null===a.Gb)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 Ba(Infinity,Infinity):new Ba(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 Mb(l):l instanceof Mb||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.fd.Ee(!0);var s=new ia(null,p),t=s.Xk;if(!(d||e||k||h)){s.width=a.Lb+Math.ceil(l.left+l.right);s.height=a.Kb+Math.ceil(l.top+l.bottom);if("svg"===b.context)return t=new qd(s.ae,
p,q),Sm(a,t,l,new Ba(s.width,s.height),a.Ab,a.jb,k,m,r,n),t;a.Yr=!1;Sm(a,t,l,new Ba(s.width,s.height),a.Ab,a.jb,k,m,r,n);a.Yr=!0;return s}var u=a.xb.Qx,z=new N(0,0),w=a.Qc.copy();w.kH(a.padding);if(r)for(var y=!0,y=a.ec.o,B=y.length,P=0;P<B;P++){var G=y[P];if(G.visible&&G.Sc)for(var G=G.rb.o,Q=G.length,Y=0;Y<Q;Y++){var U=G[Y];U.my&&U.isVisible()&&(U=U.Y,U.F()&&w.lh(U))}}z.x=w.x;z.y=w.y;if(null!==k){var ea,y=!0,B=k.j;for(B.reset();B.next();)U=B.value,U instanceof F&&(G=U.layer,null!==G&&!G.visible||
null!==G&&!r&&G.Sc||!U.isVisible()||(U=U.Y,U.F()&&(y?(y=!1,ea=U.copy()):ea.lh(U))));y&&(ea=new C(0,0,0,0));w.width=ea.width;w.height=ea.height;z.x=ea.x;z.y=ea.y}null!==h&&h.F()&&(z=h,e||(e=u));y=U=0;null!==l&&(U=l.left+l.right,y=l.top+l.bottom);P=B=0;null!==d&&(B=d.width,P=d.height,isFinite(B)&&(B=Math.max(0,B-U)),isFinite(P)&&(P=Math.max(0,P-y)));ea=h=0;null!==d&&null!==e?("NaN"===e&&(e=u),d.F()?(h=B,ea=P):isNaN(P)?(h=B,ea=w.height*e):(h=w.width*e,ea=P)):null!==d?d.F()?(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.F()?(e=Math.min((g.width-U)/w.width,(g.height-y)/w.height),e>u?(e=u,h=w.width,ea=w.height):(h=g.width,ea=g.height)):(h=w.width*e,ea=w.height*e):(e=u,h=w.width,ea=w.height);null!==l?(h+=U,ea+=y):l=new Mb(0);null!==g&&(d=g.width,g=g.height,"svg"!==b.context&&c&&!Vn&&(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."),Vn=!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 t=new qd(s.ae,p,q),Sm(a,t,l,new Ba(Math.ceil(h),Math.ceil(ea)),e,z,k,m,r,n),t;a.Yr=!1;Sm(a,t,l,new Ba(Math.ceil(h),Math.ceil(ea)),e,z,k,m,r,n);a.Yr=!0;return s}
E.inherit=function(a,b){if("function"===typeof a&&Object.getPrototypeOf(a).prototype)throw Error("Used go.Diagram.inherit defining already defined class \n"+a);D.h(a,"function",E,"inherit");D.h(b,"function",E,"inherit");b.QH&&D.k("Cannot inherit from "+D.xf(b));D.Ta(a,b)};function Ll(){this.xE=null;this.SH="63ad05bbe23a1786468a4c741b6d2";this.cj=this.SH===this._tk?!0:null}
Ll.prototype.Qm=function(a){a.fd.setTransform(a.hd,0,0,a.hd,0,0);if(null===this.cj){var b="f",c=window[D.Wg("76a715b2f73f148a")][D.Wg("72ba13b5")];a=D.Wg;this.cj=!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.cj=!(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.cj=!1;else if(D.Qu||D.Dq||D.Eq||D.wB)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.cj=!1;break}}}else this.cj=null,this.cj=!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.cj=!(0<=c&&c<b[a("73a612b6fb191d")](a("35")))}}return 0<this.cj&&this!==this.xE?!0:!1};Ll.prototype.t=function(){this.xE=null};
function Ml(a,b){void 0!==b&&null!==b||D.k("Diagram setup requires an argument DIV.");null!==a.Vb&&D.k("Diagram has already completed setup.");"string"===typeof b?a.Vb=window.document.getElementById(b):b instanceof HTMLDivElement?a.Vb=b:D.k("No DIV or DIV id supplied: "+b);null===a.Vb&&D.k("Invalid DIV id; could not get element with id: "+b);void 0!==a.Vb.ca&&D.k("Invalid div id; div already has a Diagram associated with it.");"static"===window.getComputedStyle(a.Vb,null).position&&(a.Vb.style.position=
"relative");a.Vb.style["-webkit-tap-highlight-color"]="rgba(255, 255, 255, 0)";a.Vb.style["-ms-touch-action"]="none";a.Vb.innerHTML="";a.Vb.ca=a;var c=new ia(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.Vb,null).getPropertyValue("direction")&&(a.vs=!0),c.style.zIndex="2",c.style.PM="none",c.style.webkitUserSelect="none",c.style.MozUserSelect=
"none");a.Lb=a.Vb.clientWidth||1;a.Kb=a.Vb.clientHeight||1;a.Gb=c;a.fd=c.Xk;var d=a.fd;a.hd=a.computePixelRatio();Um(a,a.Lb,a.Kb);a.ew=d[D.Wg("7eba17a4ca3b1a8346")][D.Wg("78a118b7")](d,D.Qm,4,4);a.Vb.insertBefore(c.ae,a.Vb.firstChild);c=new ia(null);c.width=1;c.height=1;a.Oz=c;a.tD=c.Xk;var c=D.createElement("div"),e=D.createElement("div");c.style.position="absolute";c.style.overflow="auto";c.style.width=a.Lb+"px";c.style.height=a.Kb+"px";c.style.zIndex="1";e.style.position="absolute";e.style.width=
"1px";e.style.height="1px";a.Vb.appendChild(c);c.appendChild(e);c.onscroll=Tl;c.onmousedown=Vl;c.ontouchstart=Vl;c.ca=a;c.OH=!0;c.PH=!0;a.gx=c;a.Et=e;a.Ly=D.oF(function(){a.Lk=null;a.ra()},300,!1);a.yC=D.oF(function(){fl(a)},250,!1);a.preventDefault=function(a){a.preventDefault();return!1};a.qo=function(b){if(a.isEnabled){a.uh=!0;var c=a.Hd;D.eo&&c.Sj?(b.preventDefault(),b.simulated=!0,a.Nt=b):(a.Hd=a.Wb,a.Wb=c,dm(a,a,b,c,!0),a.simulatedMouseMove(b,null,b.target.ca)||(a.doMouseMove(),a.cb.isBeyondDragSize()&&
(a.mi=0),fa(a,c,b)))}};a.po=function(b){if(a.isEnabled){a.uh=!0;var c=a.Hd;if(D.eo&&null!==a.Nt)a.Nt=b,b.preventDefault();else if(D.eo&&400>b.timeStamp-a.zk)b.preventDefault();else if(a.xk)b.preventDefault();else{a.Hd=a.Wb;a.Wb=c;dm(a,a,b,c,!0);c.Yk=!0;c.Fe=b.detail;if(D.Dq||D.Eq)b.timeStamp-a.zk<a.DA&&!a.cb.isBeyondDragSize()?a.mi++:a.mi=1,a.zk=b.timeStamp,c.Fe=a.mi;a.ej=c;!0===c.ds.simulated?(b.preventDefault(),b.simulated=!0):(di=null,a.doMouseDown(),a.ej=a.ej.copy(),1===b.button?b.preventDefault():
fa(a,c,b))}}};a.so=function(b){if(a.isEnabled)if(a.xk&&2===b.button)b.preventDefault();else if(a.xk&&0===b.button&&(a.xk=!1),a.Xp)b.preventDefault();else{a.uh=!0;var c=a.Hd;if(D.eo){if(400>b.timeStamp-a.zk){b.preventDefault();return}a.zk=b.timeStamp}if(D.eo&&null!==a.Nt)a.Nt=null,b.preventDefault();else{a.Hd=a.Wb;a.Wb=c;dm(a,a,b,c,!0);c.up=!0;c.Fe=b.detail;if(D.Dq||D.Eq)c.Fe=a.mi;c.bubbles=b.bubbles;c.Rf=fm(b);a.simulatedMouseUp(b,null,new N,c.Rf)||(a.doMouseUp(),ji(a),fa(a,c,b))}}};a.to=function(b){if(a.isEnabled){var c=
a.Hd;a.Hd=a.Wb;a.Wb=c;dm(a,a,b,c,!0);c.bubbles=!0;var d=0,e=0;void 0!==b.deltaX?(d=0<b.deltaX?1:-1,e=0<b.deltaY?1:-1,c.Hi=Math.abs(b.deltaX)>Math.abs(b.deltaY)?-d:-e):void 0!==b.wheelDeltaX?(d=0<b.wheelDeltaX?-1:1,e=0<b.wheelDeltaY?-1:1,c.Hi=Math.abs(b.wheelDeltaX)>Math.abs(b.wheelDeltaY)?-d:-e):c.Hi=void 0!==b.wheelDelta?0<b.wheelDelta?1:-1:0;a.doMouseWheel();fa(a,c,b)}};a.ro=function(){if(a.isEnabled){a.uh=!1;var b=a.cb;b.cancelWaitAfter();b.standardMouseOver()}};a.sC=function(b){if(a.isEnabled){a.Xp=
!1;a.xk=!0;var c=gm(a,b,b.targetTouches[0],1<b.touches.length);a.doMouseDown();fa(a,c,b)}};a.rC=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.Rf)||a.doMouseMove();fa(a,d,b)}};a.qC=function(b){if(a.isEnabled)if(a.Xp)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.Wb;a.Wb=e;e.g=a;e.Fe=1;if(null!==d){c=window.document.elementFromPoint(d.clientX,d.clientY);null!==c&&c.ca instanceof E&&c.ca!==a&&em(c.ca,d,e);em(a,d,e);var m=d.screenX,n=d.screenY,p=a.Aw;b.timeStamp-a.zk<a.DA&&!(25<Math.abs(p.x-m)||25<Math.abs(p.y-n))?a.mi++:a.mi=1;e.Fe=a.mi;a.zk=b.timeStamp;a.Aw.n(m,n)}m=0;b.ctrlKey&&(m+=1);b.altKey&&(m+=2);b.shiftKey&&(m+=4);b.metaKey&&(m+=8);e.yd=m;e.button=0;e.buttons=1;e.Yk=!1;e.up=!0;e.Hi=0;e.Ec=!1;e.bubbles=!1;e.event=
b;e.timestamp=Date.now();e.Rf=null===c?fm(b):c.ca?c.ca:null;e.Oe=null;a.simulatedMouseUp(d?d:b,null,new N,e.Rf)||a.doMouseUp();fa(a,e,b);a.xk=!1}};a.Nq=function(b){if(a.isEnabled){a.uh=!0;var c=a.oA;void 0===c[b.pointerId]&&(c[b.pointerId]=b);var c=a.Ip,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.Xp=
!1,a.xk=!0;c=gm(a,b,b,d);"touch"!==b.pointerType&&(c.button=b.button,void 0===b.buttons||D.Qu||(c.buttons=b.buttons),D.Rh&&0===b.button&&b.ctrlKey&&(c.button=2));a.doMouseDown();1===b.button?b.preventDefault():fa(a,c,b)}};a.Oq=function(b){if(a.isEnabled){a.uh=!0;var c=a.Ip;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.Qu||(c.buttons=b.buttons),D.Rh&&0===b.button&&b.ctrlKey&&(c.button=2)),a.simulatedMouseMove(b,null,c.Rf)||(a.doMouseMove(),fa(a,c,b)))}};a.Qq=function(b){if(a.isEnabled){a.uh=!0;var c="touch"===b.pointerType||"pen"===b.pointerType,d=a.oA;if(c&&a.Xp)delete d[b.pointerId],b.preventDefault();else if(d=a.Ip,null!==d[0]&&d[0].pointerId===b.pointerId){d[0]=null;d=a.Hd;a.Hd=a.Wb;a.Wb=d;var e=window.document.elementFromPoint(b.clientX,b.clientY);null!==e&&e.ca instanceof
E&&e.ca!==a&&em(e.ca,b,d);em(a,b,d);d.g=a;var m=a.Aw,n=c?25:10;b.timeStamp-a.zk<a.DA&&!(Math.abs(m.x-b.screenX)>n||Math.abs(m.y-b.screenY)>n)?a.mi++:a.mi=1;d.Fe=a.mi;a.zk=b.timeStamp;a.Aw.n(b.screenX,b.screenY);m=0;b.ctrlKey&&(m+=1);b.altKey&&(m+=2);b.shiftKey&&(m+=4);b.metaKey&&(m+=8);d.yd=m;d.button=b.button;void 0===b.buttons||D.Qu||(d.buttons=b.buttons);D.Rh&&0===b.button&&b.ctrlKey&&(d.button=2);d.Yk=!1;d.up=!0;d.Hi=0;d.Ec=!1;d.bubbles=!0;d.event=b;d.timestamp=Date.now();d.Rf=null===e?fm(b):
e.ca?e.ca:null;d.Oe=null;a.simulatedMouseUp(b,null,new N,d.Rf)||(a.doMouseUp(),ji(a),fa(a,d,b),c&&(a.xk=!1))}else null!==d[1]&&d[1].pointerId===b.pointerId&&(d[1]=null)}};a.Pq=function(b){if(a.isEnabled){a.uh=!1;var c=a.oA;c[b.pointerId]&&delete c[b.pointerId];c=a.Ip;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.cb,b.cancelWaitAfter(),b.standardMouseOver())}};d.Ee(!0);Ql(a)}
function Wn(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.ju=!0;this.lm=!1;this.sb=!0;this.SA=jc;this.$b=new Xn}D.Ta(Wn,E);D.ka("Palette",Wn);
function Il(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.gd=!0;this.Gk=null;this.fw=!0;this.tK("drawShadows",!1);var b=new F,c=new A;c.stroke="magenta";c.pb=2;c.fill="transparent";c.name="BOXSHAPE";b.nl=!0;b.Vy="BOXSHAPE";b.zy="BOXSHAPE";b.SG="BOXSHAPE";b.cursor="move";b.add(c);this.Vm=b;c=new ca;c.type=Yj;c.Pf=mc;var d=new Zj;d.We=!0;c.add(d);d=new A;d.Ih=mc;d.Ob="Rectangle";d.Ea=new Ba(64,
64);d.cursor="se-resize";d.alignment=vc;c.add(d);b.QG=c;this.Jn=this.Tk=!1;this.Kf=this.lu=!0;this.dF=new Mb(0,0,0,0);this.yA=new ia(null);this.RH=this.yA.Xk;this.bb.pe=new Yn;this.bb.TG=new Zn;var e=this;this.click=function(){var a=e.Gk;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.CG=function(){$n(e)};this.BG=function(){null!==e.Gk&&(e.Rc(),e.ra())};this.om=bm;this.gd=!1}D.Ta(Il,E);D.ka("Overview",Il);
function ao(a){a.gd||a.le||!1!==a.cg||(a.cg=!0,requestAnimationFrame(function(){if(a.cg&&!a.le&&(a.cg=!1,null!==a.Vb)){a.le=!0;Ti(a);a.Qc.F()||am(a,a.computeBounds());null===a.Vb&&D.k("No div specified");null===a.Gb&&D.k("No canvas specified");if(a.Pe){var b=a.Gk;if(null!==b&&!b.Ra.nf&&!b.Ra.Ac){var b=a.fd,c=a.yA;b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,a.Gb.width,a.Gb.height);b.drawImage(c.ae,0,0);c=a.Oc;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.hd,a.hd);b.transform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy);for(var c=a.ec.o,d=c.length,e=0;e<d;e++)c[e].He(b,a);a.Pl=!1;a.Pe=!1}}a.le=!1}}))}Il.prototype.computePixelRatio=function(){return 1};
Il.prototype.He=function(){null===this.Vb&&D.k("No div specified");null===this.Gb&&D.k("No canvas specified");if(this.Pe){var a=this.Gk;if(null!==a&&!a.Ra.nf){Pm(this);var b=a.bo;(null!==b&&b.visible&&isNaN(b.width)||isNaN(b.height))&&lm(a);var c=this.Gb,b=this.fd,d=this.yA,e=this.RH;d.width=c.width;d.height=c.height;b.Ee(!0);b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,c.width,c.height);var g=this.Oc;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.hd,this.hd);b.transform(g.m11,g.m12,g.m21,g.m22,g.dx,g.dy);for(var h=this.fw,k=this.wb,l=a.ec.o,m=l.length,a=0;a<m;a++){var n=l[a],p=b,q=k,r=h;if(n.visible&&0!==n.Mc&&(void 0===r&&(r=!0),r||!n.Sc)){1!==n.Mc&&(p.globalAlpha=n.Mc);for(var r=this.scale,n=n.rb.o,s=n.length,t=0;t<s;t++){var u=n[t],z=u.Y;z.kg(q)&&(1<z.width*r||1<z.height*r?u.He(p,this):vl(u,p))}p.globalAlpha=1}}e.drawImage(c.ae,0,0);v&&v.Gj&&(e.fillStyle="red",e.fillRect(0,d.height/2,d.width,4));c=this.ec.o;
d=c.length;for(a=0;a<d;a++)c[a].He(b,this);v&&(v.bB||v.Gj)&&v.aB(b,this,g);this.Pe=this.Pl=!1}}};
D.defineProperty(Il,{PB:"observed"},function(){return this.Gk},function(a){var b=this.Gk;null!==a&&D.l(a,E,Il,"observed");a instanceof Il&&D.k("Overview.observed Diagram may not be an Overview itself: "+a);b!==a&&(null!==b&&(this.remove(this.Lh),b.VB("ViewportBoundsChanged",this.CG),b.VB("DocumentBoundsChanged",this.BG),b.Tw.remove(this)),this.Gk=a,null!==a&&(a.Ax("ViewportBoundsChanged",this.CG),a.Ax("DocumentBoundsChanged",this.BG),a.Tw.add(this),this.add(this.Lh),$n(this)),this.Rc(),this.i("observed",
b,a))});D.defineProperty(Il,{Lh:"box"},function(){return this.Vm},function(a){var b=this.Vm;b!==a&&(this.Vm=a,this.remove(b),this.add(this.Vm),$n(this),this.i("box",b,a))});D.defineProperty(Il,{OL:"drawsTemporaryLayers"},function(){return this.fw},function(a){this.fw!==a&&(this.fw=a,this.Gm())});
function $n(a){var b=a.Lh;if(null!==b){var c=a.Gk;if(null!==c){a.Pe=!0;var c=c.wb,d=b.Im,e=D.Om();e.n(c.width,c.height);d.Ea=e;D.bl(e);a=2/a.scale;d instanceof A&&(d.pb=a);b.location=new N(c.x-a/2,c.y-a/2)}}}Il.prototype.computeBounds=function(){var a=this.Gk;return null===a?Kd:a.Qc};Il.prototype.cG=function(){!0!==this.Pe&&(this.Pe=!0,ao(this))};
Il.prototype.hv=function(a,b,c,d,e){this.gd||(Wl(this),this.ra(),im(this),this.Rc(),$n(this),this.Hh.scale=c,this.Hh.position.x=a.x,this.Hh.position.y=a.y,this.Hh.bounds.set(a),this.Hh.isScroll=e,this.Ka("ViewportBoundsChanged",this.Hh,a))};function Yn(){Uh.call(this);this.Zl=null}D.Ta(Yn,Uh);
Yn.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||!a.lm||!a.Kf)return!1;var b=a.PB;if(null===b)return!1;if(null===this.findDraggablePart()){var c=b.wb;this.Zl=new N(c.width/2,c.height/2);a=a.Dc.ha;b.position=new N(a.x-this.Zl.x,a.y-this.Zl.y)}return!0};Yn.prototype.doActivate=function(){this.Zl=null;Uh.prototype.doActivate.call(this)};
Yn.prototype.moveParts=function(){var a=this.g,b=a.PB;if(null!==b){var c=a.Lh;if(null!==c){if(null===this.Zl){var d=a.Dc.ha,c=c.location;this.Zl=new N(d.x-c.x,d.y-c.y)}a=a.U.ha;b.position=new N(a.x-this.Zl.x,a.y-this.Zl.y)}}};function Zn(){Xj.call(this)}D.Ta(Zn,Xj);Zn.prototype.resize=function(a){var b=this.g.PB;if(null!==b){var c=b.wb.copy(),d=b.scale;(c.width!==a.width||c.height!==a.height)&&0<a.width&&0<a.height&&(b.scale=Math.min(d*c.width/a.width,d*c.height/a.height))}};
function bo(){this.qg=this.od=this.Qd=this.Tc=0}
function za(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.da=Eg,this.Ro="black"):"string"===typeof a?(this.da=Eg,v&&!ya(a)&&D.k('Color "'+a+'" is not a valid color string for Brush constructor'),this.Ro=a):(v&&D.Da(a,za,za,"constructor:type"),this.da=a,this.Ro="black");var b=this.da;b===Fg?(this.Rp=jc,this.dp=uc):this.dp=b===Hd?this.Rp=mc:this.Rp=dc;this.ox=0;this.gw=NaN;this.rh=this.Ww=this.qh=null;this.Dz=
this.So=0}D.ka("Brush",za);var Eg;za.Solid=Eg=D.s(za,"Solid",0);var Fg;za.Linear=Fg=D.s(za,"Linear",1);var Hd;za.Radial=Hd=D.s(za,"Radial",2);var co;za.Pattern=co=D.s(za,"Pattern",4);var eo;za.Lab=eo=D.s(za,"Lab",5);var fo;za.HSL=fo=D.s(za,"HSL",6);za.prototype.copy=function(){var a=new za;a.da=this.da;a.Ro=this.Ro;a.Rp=this.Rp.V();a.dp=this.dp.V();a.ox=this.ox;a.gw=this.gw;null!==this.qh&&(a.qh=this.qh.copy());a.Ww=this.Ww;return a};f=za.prototype;
f.Oa=function(){this.freeze();Object.freeze(this);return this};f.freeze=function(){this.J=!0;null!==this.qh&&this.qh.freeze();return this};f.Xa=function(){Object.isFrozen(this)&&D.k("cannot thaw constant: "+this);this.J=!1;null!==this.qh&&this.qh.Xa();return this};f.qc=function(a){a.Se===za?this.type=a:D.ck(this,a)};
f.toString=function(){var a="Brush(";if(this.type===Eg)a+=this.color;else if(a=this.type===Fg?a+"Linear ":this.type===Hd?a+"Radial ":this.type===co?a+"Pattern ":a+"(unknown) ",a+=this.start+" "+this.end,null!==this.Uk)for(var b=this.Uk.j;b.next();)a+=" "+b.key+":"+b.value;return a+")"};
za.prototype.addColorStop=za.prototype.addColorStop=function(a,b){this.J&&D.qa(this);("number"!==typeof a||!isFinite(a)||1<a||0>a)&&D.va(a,"0 <= loc <= 1",za,"addColorStop:loc");D.h(b,"string",za,"addColorStop:color");v&&!ya(b)&&D.k('Color "'+b+'" is not a valid color string for Brush.addColorStop');null===this.qh&&(this.qh=new ma("number","string"));this.qh.add(a,b);this.da===Eg&&(this.type=Fg);this.rh=null};
D.defineProperty(za,{type:"type"},function(){return this.da},function(a){this.J&&D.qa(this,a);D.Da(a,za,za,"type");this.da=a;this.start.fe()&&(a===Fg?this.start=jc:a===Hd&&(this.start=mc));this.end.fe()&&(a===Fg?this.end=uc:a===Hd&&(this.end=mc));this.rh=null});D.defineProperty(za,{color:"color"},function(){return this.Ro},function(a){this.J&&D.qa(this,a);v&&!ya(a)&&D.k('Color "'+a+'" is not a valid color string for Brush.color');this.Ro=a;this.rh=null});
D.defineProperty(za,{start:"start"},function(){return this.Rp},function(a){this.J&&D.qa(this,a);D.l(a,R,za,"start");this.Rp=a.V();this.rh=null});D.defineProperty(za,{end:"end"},function(){return this.dp},function(a){this.J&&D.qa(this,a);D.l(a,R,za,"end");this.dp=a.V();this.rh=null});D.defineProperty(za,{vv:"startRadius"},function(){return this.ox},function(a){this.J&&D.qa(this,a);D.p(a,za,"startRadius");0>a&&D.va(a,">= zero",za,"startRadius");this.ox=a;this.rh=null});
D.defineProperty(za,{uu:"endRadius"},function(){return this.gw},function(a){this.J&&D.qa(this,a);D.p(a,za,"endRadius");0>a&&D.va(a,">= zero",za,"endRadius");this.gw=a;this.rh=null});D.defineProperty(za,{Uk:"colorStops"},function(){return this.qh},function(a){this.J&&D.qa(this,a);v&&D.l(a,ma,za,"colorStops");this.qh=a;this.rh=null});D.defineProperty(za,{pattern:"pattern"},function(){return this.Ww},function(a){this.J&&D.qa(this,a);this.Ww=a;this.rh=null});
za.randomColor=function(a,b){void 0===a&&(a=128);v&&(D.p(a,za,"randomColor:min"),(0>a||255<a)&&D.va(a,"0 <= min <= 255",za,"randomColor:min"));void 0===b&&(b=Math.max(a,255));v&&(D.p(b,za,"randomColor:max"),(b<a||255<b)&&D.va(b,"min <= max <= 255",za,"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 ho=(new ia(null)).Xk,ya;za.isValidColor=ya=function(a){if("black"===a)return!0;if(""===a)return!1;v&&D.h(a,"string",za,"isValidColor");ho.fillStyle="#000000";var b=ho.fillStyle;ho.fillStyle=a;if(ho.fillStyle!==b)return!0;ho.fillStyle="#FFFFFF";b=ho.fillStyle;ho.fillStyle=a;return ho.fillStyle!==b};var io=new bo,jo=new bo,ko=new bo,lo=new bo;za.lighten=function(a){return mo(a)};
za.prototype.lightenBy=function(a,b){this.J&&D.qa(this);var c=void 0===a||"number"!==typeof a?.2:a,d=void 0===b?eo:b;if(this.type===Eg)no(this.color),this.color=oo(c,d);else if((this.type===Fg||this.type===Hd)&&null!==this.Uk)for(var e=this.Uk.j;e.next();)no(e.value),this.addColorStop(e.key,oo(c,d));return this};var mo;za.lightenBy=mo=function(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?eo:c;no(a);return oo(b,c)};za.darken=function(a){return po(a)};
za.prototype.darkenBy=function(a,b){this.J&&D.qa(this);var c=void 0===a||"number"!==typeof a?.2:a,d=void 0===b?eo:b;if(this.type===Eg)no(this.color),this.color=oo(-c,d);else if((this.type===Fg||this.type===Hd)&&null!==this.Uk)for(var e=this.Uk.j;e.next();)no(e.value),this.addColorStop(e.key,oo(-c,d));return this};var po;za.darkenBy=po=function(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?eo:c;no(a);return oo(-b,c)};
function oo(a,b){switch(b){case eo:var c=100*qo(io.Tc),d=100*qo(io.Qd),e=100*qo(io.od);ko.Tc=.4124564*c+.3575761*d+.1804375*e;ko.Qd=.2126729*c+.7151522*d+.072175*e;ko.od=.0193339*c+.119192*d+.9503041*e;ko.qg=io.qg;c=ro(ko.Tc/so[0]);d=ro(ko.Qd/so[1]);e=ro(ko.od/so[2]);lo.Tc=116*d-16;lo.Qd=500*(c-d);lo.od=200*(d-e);lo.qg=ko.qg;lo.Tc=Math.min(100,Math.max(0,lo.Tc+100*a));c=(lo.Tc+16)/116;d=c-lo.od/200;ko.Tc=so[0]*to(lo.Qd/500+c);ko.Qd=so[1]*(lo.Tc>uo*vo?Math.pow(c,3):lo.Tc/uo);ko.od=so[2]*to(d);ko.qg=
lo.qg;c=-.969266*ko.Tc+1.8760108*ko.Qd+.041556*ko.od;d=.0556434*ko.Tc+-.2040259*ko.Qd+1.0572252*ko.od;io.Tc=255*wo((3.2404542*ko.Tc+-1.5371385*ko.Qd+-.4985314*ko.od)/100);io.Qd=255*wo(c/100);io.od=255*wo(d/100);io.qg=ko.qg;io.Tc=Math.round(io.Tc);255<io.Tc?io.Tc=255:0>io.Tc&&(io.Tc=0);io.Qd=Math.round(io.Qd);255<io.Qd?io.Qd=255:0>io.Qd&&(io.Qd=0);io.od=Math.round(io.od);255<io.od?io.od=255:0>io.od&&(io.od=0);return"rgba("+io.Tc+", "+io.Qd+", "+io.od+", "+io.qg+")";case fo:var e=io.Tc/255,g=io.Qd/
255,h=io.od/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))}jo.Tc=Math.round(c);jo.Qd=Math.round(100*e);jo.od=Math.round(100*d);jo.qg=io.qg;jo.od=Math.min(100,Math.max(0,jo.od+100*a));return"hsla("+jo.Tc+", "+jo.Qd+"%, "+jo.od+"%, "+jo.qg+")";default:return D.k("Unknown color space: "+b),"rgba(0, 0, 0, 1)"}}
function no(a){ho.clearRect(0,0,1,1);ho.fillStyle="#000000";var b=ho.fillStyle;ho.fillStyle=a;ho.fillStyle!==b?(ho.fillRect(0,0,1,1),a=ho.getImageData(0,0,1,1).data,io.Tc=a[0],io.Qd=a[1],io.od=a[2],io.qg=a[3]/255):(ho.fillStyle="#FFFFFF",b=ho.fillStyle,ho.fillStyle=a,ho.fillStyle===b&&v&&D.k('Color "'+a+'" is not a valid color string for RGBA color conversion'),io.Tc=0,io.Qd=0,io.od=0,io.qg=1)}function qo(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}
function wo(a){return.0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055}var vo=216/24389,uo=24389/27,so=[95.047,100,108.883];function ro(a){return a>vo?Math.pow(a,1/3):(uo*a+16)/116}function to(a){var b=a*a*a;return b>vo?b:(116*a-16)/uo}
function O(){D.xc(this);this.R=4225027;this.Mc=1;this.uj=null;this.ac="";this.nc=this.Pb=null;this.jb=(new N(NaN,NaN)).freeze();this.af=ce;this.ri=Wd;this.qi=ae;this.Oc=new Ca;this.bi=new Ca;this.lj=new Ca;this.Ab=this.bp=1;this.wg=0;this.Qg=xo;this.mn=Ld;this.Fd=(new C(NaN,NaN,NaN,NaN)).freeze();this.dc=(new C(NaN,NaN,NaN,NaN)).freeze();this.Xc=(new C(0,0,NaN,NaN)).freeze();this.aa=this.ot=this.pt=null;this.Sm=this.we=Vc;this.Bt=0;this.wj=1;this.Ar=0;this.Wi=1;this.Rt=null;this.Ft=-Infinity;this.xn=
0;this.yn=Jd;this.zn=wj;this.Jr="";this.Ic=this.ma=null;this.Po=-1;this.Dn=this.yg=this.Fl=this.Qp=null;this.pA=Rj;this.tn=null}D.Gi(O);D.ka("GraphObject",O);
O.prototype.cloneProtected=function(a){a.R=this.R|6144;a.Mc=this.Mc;a.ac=this.ac;a.Pb=this.Pb;a.nc=this.nc;a.jb.assign(this.jb);a.af=this.af.V();a.ri=this.ri.V();a.qi=this.qi.V();a.lj=this.lj.copy();a.Ab=this.Ab;a.wg=this.wg;a.Qg=this.Qg;a.mn=this.mn.V();a.Fd.assign(this.Fd);a.dc.assign(this.dc);a.Xc.assign(this.Xc);a.ot=this.ot;null!==this.aa&&(a.aa=this.aa.copy());a.we=this.we.V();a.Sm=this.Sm.V();a.Bt=this.Bt;a.wj=this.wj;a.Ar=this.Ar;a.Wi=this.Wi;a.Rt=this.Rt;a.Ft=this.Ft;a.xn=this.xn;a.yn=this.yn.V();
a.zn=this.zn;a.Jr=this.Jr;null!==this.ma&&(a.ma=this.ma.copy());a.Ic=this.Ic;a.Po=this.Po;null!==this.Fl&&(a.Fl=D.qm(this.Fl));null!==this.yg&&(a.yg=this.yg.copy());a.Dn=this.Dn};O.prototype.addCopyProperty=O.prototype.XH=function(a){var b=this.Fl;if(D.isArray(b))for(var c=0;c<b.length;c++){if(b[c]===a)return}else this.Fl=b=[];b.push(a)};O.prototype.Ii=function(a){a.pt=null;a.tn=null;a.K()};
O.prototype.clone=function(){var a=new this.constructor;this.cloneProtected(a);if(null!==this.Fl)for(var b=0;b<this.Fl.length;b++){var c=this.Fl[b];a[c]=this[c]}return a};O.prototype.copy=function(){return this.clone()};O.prototype.qc=function(a){a.Se===J?0===a.name.indexOf("Orient")?this.Yq=a:D.k("Unknown Link enum value for GraphObject.segmentOrientation property: "+a):a.Se===O?this.stretch=a:D.ck(this,a)};O.prototype.toString=function(){return D.xf(Object.getPrototypeOf(this))+"#"+D.Nd(this)};
var ak;O.None=ak=D.s(O,"None",0);var xo;O.Default=xo=D.s(O,"Default",0);var yo;O.Vertical=yo=D.s(O,"Vertical",4);var zo;O.Horizontal=zo=D.s(O,"Horizontal",5);var Xe;O.Fill=Xe=D.s(O,"Fill",3);var ck;O.Uniform=ck=D.s(O,"Uniform",1);var Ao;O.UniformToFill=Ao=D.s(O,"UniformToFill",2);var Bo;O.FlipVertical=Bo=D.s(O,"FlipVertical",1);var Co;O.FlipHorizontal=Co=D.s(O,"FlipHorizontal",2);var Do;O.FlipBoth=Do=D.s(O,"FlipBoth",3);function Eo(a){null===a.ma&&(a.ma=new Fo)}
O.prototype.be=function(){if(null===this.aa){var a=new Go;a.rk=dc;a.Qk=dc;a.pk=10;a.Ok=10;a.ok=Ho;a.Nk=Ho;a.qk=0;a.Pk=0;this.aa=a}};function Io(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.pd=function(a,b,c,d,e,g,h){var k=this.$;if(null!==k&&(k.xo(a,b,c,d,e,g,h),Jo(this)&&c===this&&a===eg&&Ko(this,k,b),c===k&&0!==(k.R&16777216)&&null!==k.data))for(a=this.ya.o,c=a.length,d=0;d<c;d++)e=a[d],e instanceof x&&Wm(e,function(a){null!==a.data&&0!==(a.R&16777216)&&a.Rb(b)})};
function Ko(a,b,c){var d=a.wm();if(null!==d)for(var e=a.Ic.j;e.next();){var g=e.value,h=null;if(null!==g.dr){h=rh(g,d,a);if(null===h)continue;g.bz(a,h,c,null)}else if(g.py){var k=b.g;null===k||k.Ye||g.bz(a,k.ea.ll,c,d)}else{var l=d.data;if(null===l)continue;k=b.g;null===k||k.Ye||g.bz(a,l,c,d)}h===a&&(k=d.$x(g.Nm),null!==k&&g.xH(k,h,c))}}O.prototype.$x=function(a){return this.Po===a?this:null};O.prototype.raiseChanged=O.prototype.i=function(a,b,c){this.pd(eg,a,this,b,c)};
function Lo(a,b,c,d,e){var g=a.Fd,h=a.lj;h.reset();Mo(a,h,b,c,d,e);a.lj=h;g.x=b;g.y=c;g.width=d;g.height=e;h.Ru()||h.uH(g)}function No(a,b,c,d){if(!1===a.tg)return!1;d.multiply(a.transform);return c?a.kg(b,d):a.Pn(b,d)}
O.prototype.IF=function(a,b,c){if(!1===this.tg)return!1;var d=this.Fa;b=a.Lf(b);return c?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:a.gg(0,0)<=b&&a.gg(0,d.height)<=b&&a.gg(d.width,0)<=b&&a.gg(d.width,d.height)<=b};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.O();b.assign(a);this.transform.vb(b);var c=this.Y;if(!c.F())return D.A(b),!1;var d=this.g;if(null!==d&&d.xk){var e=d.Hu("extraTouchThreshold"),g=d.Hu("extraTouchArea"),h=g/2,k=this.Fa,d=this.Mj()*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 ca||this instanceof A?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.nc&&c.Pa(b)?!0:null!==this.Pb&&this.Xc.Pa(a)?!0:this.Vk(a),D.A(b),e;D.A(b);return!1};O.prototype.Vk=function(a){var b=this.Fa;return Vb(0,0,b.width,b.height,a.x,a.y)};
O.prototype.containsRect=O.prototype.Wk=function(a){v&&D.l(a,C,O,"containsRect:r");if(0===this.angle)return this.Y.Wk(a);var b=this.Fa,b=D.vg(0,0,b.width,b.height),c=this.transform,d=!1,e=D.Db(a.x,a.y);b.Pa(c.Ph(e))&&(e.n(a.x,a.bottom),b.Pa(c.Ph(e))&&(e.n(a.right,a.bottom),b.Pa(c.Ph(e))&&(e.n(a.right,a.y),b.Pa(c.Ph(e))&&(d=!0))));D.A(e);D.Hb(b);return d};
O.prototype.containedInRect=O.prototype.Pn=function(a,b){v&&D.l(a,C,O,"containedInRect:r");if(void 0===b)return a.Wk(this.Y);var c=this.Fa,d=!1,e=D.Db(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.kg=function(a,b){v&&D.l(a,C,O,"intersectsRect:r");if(void 0===b&&(b=this.transform,0===this.angle))return a.kg(this.Y);var c=this.Fa,d=b,e=D.Db(0,0),g=D.Db(0,c.height),h=D.Db(c.width,c.height),k=D.Db(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.Db(a.x,a.y);c.Pa(d.Ph(m))?l=!0:(m.n(a.x,a.bottom),c.Pa(d.Ph(m))?l=!0:(m.n(a.right,a.bottom),c.Pa(d.Ph(m))?l=!0:(m.n(a.right,a.y),c.Pa(d.Ph(m))&&
(l=!0))));D.A(m);D.Hb(c);!l&&(Ke(a,e,g)||Ke(a,g,h)||Ke(a,h,k)||Ke(a,k,e))&&(l=!0)}D.A(e);D.A(g);D.A(h);D.A(k);return l};O.prototype.getDocumentPoint=O.prototype.gb=function(a,b){void 0===b&&(b=new N);if(a instanceof R){a.fe()&&D.k("getDocumentPoint:s Spot must be specific: "+a.toString());var c=this.Fa;b.n(a.x*c.width+a.offsetX,a.y*c.height+a.offsetY)}else b.set(a);this.Jh.vb(b);return b};
O.prototype.getDocumentAngle=O.prototype.ym=function(){var a;a=this.Jh;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.Mj=function(){if(0!==(this.R&4096)===!1)return this.bp;var a=this.Ab;return null!==this.Q?a*this.Q.Mj():a};O.prototype.getLocalPoint=O.prototype.OF=function(a,b){void 0===b&&(b=new N);b.assign(a);this.Jh.Ph(b);return b};
O.prototype.getNearestIntersectionPoint=O.prototype.PF=function(a,b,c){return this.$n(a.x,a.y,b.x,b.y,c)};f=O.prototype;f.$n=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.mm)return g=this.Y,Ie(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.Fa;c=Ie(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!==zm(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 A&&(k=a.pb);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(Oo(a,!0)){case ak:k=g=0;l&&(c=b=Infinity);break;case Xe:isFinite(b)&&b>d&&(g=b);isFinite(c)&&
c>e&&(k=c);break;case zo:isFinite(b)&&b>d&&(g=b);k=0;l&&(c=Infinity);break;case yo:isFinite(c)&&c>e&&(k=c),g=0,l&&(b=Infinity)}var l=a.pf,m=a.$g;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.oo(b,c,
d,e);a.Fd.freeze();a.Fd.F()||D.k("Non-real measuredBounds has been set. Object "+a+", measuredBounds: "+a.Fd.toString());km(a,!1)}}f.oo=function(){};f.Qj=function(){return!1};
f.rc=function(a,b,c,d,e){this.gj();var g=D.Ff();g.assign(this.dc);this.dc.Xa();if(!1===Nm(this)){var h=this.dc;h.x=a;h.y=b;h.width=c;h.height=d}else this.Fj(a,b,c,d);this.dc.freeze();this.yg=void 0===e?null:e;c=!1;if(void 0!==e)c=!0;else if(e=this.Q,null===e||e.type!==Po&&e.type!==Qo||(e=e.Q),null!==e&&(e=e.Xc,d=this.Ia,null!==this.mm&&(d=this.dc),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 na&&(a=this.Xc,this.Gw>a.height||this.sf.Qe>a.width)))c=
!0;this.R=c?this.R|256:this.R&-257;this.dc.F()||D.k("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.dc.toString());this.Ey(g,this.dc);Ro(this,!1);D.Hb(g)};f.Fj=function(){};
function So(a,b,c,d,e){var g=a.Y;g.x=b;g.y=c;g.width=d;g.height=e;if(!a.Ea.F()){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=Oo(a,!0);c===d&&g===e&&(b=ak);switch(b){case ak:if(c>d||g>e)km(a,!0),Hk(a,c>d?d:c,g>e?e:g);break;case Xe:km(a,!0);Hk(a,d,e,0,0);break;case zo:km(a,!0);Hk(a,d,g,0,0);break;case yo:km(a,!0),Hk(a,c,e,0,0)}}}
f.Ey=function(a,b){var c=this.$;null!==c&&null!==c.g&&(c.Im!==this&&c.RG!==this&&c.YB!==this||To(c,!0),this.ra(),Db(a,b)||(c.hl(),this.dt(c)))};f.dt=function(a){null!==this.Rd&&(To(a,!0),a instanceof H&&Uo(a,this))};D.defineProperty(O,{Ao:"shadowVisible"},function(){return this.Dn},function(a){var b=this.Dn;b!==a&&(v&&null!==a&&D.h(a,"boolean",O,"shadowVisible"),this.Dn=a,this.ra(),this.i("shadowVisible",b,a))});
O.prototype.He=function(a,b){if(this.visible){var c=this instanceof x&&(this.type===Po||this.type===Qo),d=this.dc;if(c||0!==d.width&&0!==d.height&&!isNaN(d.x)&&!isNaN(d.y)){var e=this.opacity;if(0!==e){var g=1;1!==e&&(g=a.globalAlpha,a.globalAlpha=g*e);if(a instanceof qd)a:{if(this.visible){var c=null,h=a.sy;if(this instanceof x&&(this.type===Po||this.type===Qo))Vo(this,a,b);else{var k=this.dc;if(0!==k.width&&0!==k.height&&!isNaN(k.x)&&!isNaN(k.y)){var l=this.transform,m=this.Q;0!==(this.R&4096)===
!0&&Wo(this);var d=0!==(this.R&256),n=!1;this instanceof na&&(a.font=this.font);if(d){n=m.kh()?m.Fa:m.Y;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.Qj()){var t=this;if(!t.isVisible())break a}a.Nh.cc=[1,0,0,1,0,0];this instanceof
na&&1<this.vy&&sd(a,1,0,0,1,0,0);q=!1;this.Qj()&&this.jl&&b.el("drawShadows")&&(r=this.Cn,a.jC(r.x*b.scale*b.hd,r.y*b.scale*b.hd,t.Pg),a.Bo(),a.shadowColor=t.Bn);t=!1;this.$&&b.el("drawShadows")&&(t=this.$.jl);!0===this.Ao?(a.Bo(),!1===q&&t&&(sd(a,1,0,0,1,0,0),a.nb(),q=!0)):!1===this.Ao&&a.Km();null!==this.nc&&(Xo(this,a,this.nc,!0,!0),!1===q&&t&&(sd(a,1,0,0,1,0,0),a.nb(),q=!0),this.nc instanceof za&&this.nc.type===Hd?(a.beginPath(),a.rect(k.x,k.y,k.width,k.height),a.Xg(this.nc)):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.Nh.cc=[l.m11,l.m12,l.m21,l.m22,l.dx,l.dy];null!==this.Pb&&(!1===q&&t&&(sd(a,1,0,0,1,0,0),a.nb(),q=!0),s=this.Fa,l=k=0,r=s.width,s=s.height,p=0,this instanceof A&&(s=this.Za.lb,k=s.x,l=s.y,r=s.width,s=s.height,p=this.Rg),Xo(this,a,this.Pb,!0,!1),this.Pb instanceof za&&this.Pb.type===Hd?(a.beginPath(),a.rect(k-p/2,l-p/2,r+p,s+p),a.Xg(this.Pb)):a.fillRect(k-p/2,l-p/2,r+p,s+p));t&&(null!==this.Pb||null!==this.nc||null!==m&&
0!==(m.R&512)||null!==m&&(m.type===Pl||m.type===Yj)&&m.Ld()!==this)?(Yo(this,!0),null===this.Ao&&a.Km()):Yo(this,!1);this.Zk(a,b);t&&0!==(this.R&512)===!0&&a.Bo();this.Qj()&&t&&a.Km();d&&(a.restore(),n&&a.yf.pop());this instanceof x&&(c=a.yf.pop());!0===q&&a.yf.pop();this instanceof na&&1<this.vy&&(c=a.yf.pop());null!==a.AF&&(null===c&&(h===a.sy?(sd(a,1,0,0,1,0,0),c=a.yf.pop()):c=a.sy),a.AF(this,c))}}}}else if(c)Vo(this,a,b);else{this instanceof J&&this.$u(!1);v&&v.Gj&&v.GI(a,this);c=this.transform;
h=this.Q;0!==(this.R&4096)===!0&&Wo(this);m=!1;t=this.$;k=0;t&&b.el("drawShadows")&&(m=t.jl)&&(n=t.Cn,k=Math.max(n.y,n.x)*b.scale*b.hd);if(!(l=b.cn)){var s=k,p=this.Xc,k=this.bi,u=k.m11,z=k.m21,w=k.dx,y=k.m12,B=k.m22,P=k.dy,G,Q,Y=Q=0,k=Q*u+Y*z+w,l=Q*y+Y*B+P,r=q=0;Q=p.width+s;Y=0;G=Q*u+Y*z+w;Q=Q*y+Y*B+P;k=Math.min(k,G);l=Math.min(l,Q);q=Math.max(k+q,G)-k;r=Math.max(l+r,Q)-l;Q=p.width+s;Y=p.height+s;G=Q*u+Y*z+w;Q=Q*y+Y*B+P;k=Math.min(k,G);l=Math.min(l,Q);q=Math.max(k+q,G)-k;r=Math.max(l+r,Q)-l;Q=0;
Y=p.height+s;G=Q*u+Y*z+w;Q=Q*y+Y*B+P;k=Math.min(k,G);l=Math.min(l,Q);q=Math.max(k+q,G)-k;r=Math.max(l+r,Q)-l;s=b.GA;p=s.x;u=s.y;l=!(k>s.width+p||p>q+k||l>s.height+u||u>r+l)}if(l){k=0!==(this.R&256);a.jq&&(k=!1);this instanceof na&&(a.font=this.font);if(k){v&&v.zF&&D.trace("clip"+this.toString());l=h.kh()?h.Fa:h.Y;null!==this.yg?(p=this.yg,q=p.x,r=p.y,s=p.width,p=p.height):(q=Math.max(d.x,l.x),r=Math.max(d.y,l.y),s=Math.min(d.right,l.right)-q,p=Math.min(d.bottom,l.bottom)-r);if(q>d.width+d.x||d.x>
l.width+l.x){1!==e&&(a.globalAlpha=g);return}v&&v.zF&&v.II(a,q,r,s,p);a.save();a.beginPath();a.rect(q,r,s,p);a.clip()}if(this.Qj()){if(!t.isVisible()){1!==e&&(a.globalAlpha=g);return}m&&(a.jC(n.x*b.scale*b.hd,n.y*b.scale*b.hd,t.Pg),a.Bo(),a.shadowColor=t.Bn)}!0===this.Ao?a.Bo():!1===this.Ao&&a.Km();null!==this.nc&&(Xo(this,a,this.nc,!0,!0),this.nc instanceof za&&this.nc.type===Hd?(a.beginPath(),a.rect(d.x,d.y,d.width,d.height),a.Xg(this.nc)):a.fillRect(d.x,d.y,d.width,d.height));c.Ru()||a.transform(c.m11,
c.m12,c.m21,c.m22,c.dx,c.dy);m&&(null!==h&&0!==(h.R&512)||null!==h&&(h.type===Pl||h.type===Yj)&&h.Ld()!==this)&&null===this.Ao&&a.Km();null!==this.Pb&&(l=this.Fa,n=d=0,t=l.width,l=l.height,q=0,this instanceof A&&(l=this.Za.lb,d=l.x,n=l.y,t=l.width,l=l.height,q=this.Rg),Xo(this,a,this.Pb,!0,!1),this.Pb instanceof za&&this.Pb.type===Hd?(a.beginPath(),a.rect(d-q/2,n-q/2,t+q,l+q),a.Xg(this.Pb)):a.fillRect(d-q/2,n-q/2,t+q,l+q));v&&v.Gj&&v.HI(a,this);m&&(null!==this.Pb||null!==this.nc||null!==h&&0!==(h.R&
512)||null!==h&&(h.type===Pl||h.type===Yj)&&h.Ld()!==this)?(Yo(this,!0),null===this.Ao&&a.Km()):Yo(this,!1);this.Zk(a,b);m&&0!==(this.R&512)===!0&&a.Bo();this.Qj()&&m&&a.Km();k?(a.restore(),this instanceof x?a.Ee(!0):a.Ee(!1)):c.Ru()||(h=1/(c.m11*c.m22-c.m12*c.m21),a.transform(c.m22*h,-c.m12*h,-c.m21*h,c.m11*h,h*(c.m21*c.dy-c.m22*c.dx),h*(c.m12*c.dx-c.m11*c.dy)))}}1!==e&&(a.globalAlpha=g)}}}};
function Vo(a,b,c){var d=a.dc;null!==a.nc&&(Xo(a,b,a.nc,!0,!0),a.nc instanceof za&&a.nc.type===Hd?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Xg(a.nc)):b.fillRect(d.x,d.y,d.width,d.height));null!==a.Pb&&(Xo(a,b,a.Pb,!0,!1),a.Pb instanceof za&&a.Pb.type===Hd?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Xg(a.Pb)):b.fillRect(d.x,d.y,d.width,d.height));a.Zk(b,c)}O.prototype.Zk=function(){};
function Xo(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===Eg)d?b.fillStyle=c.color:b.strokeStyle=c.color;else{var k,h=a.Fa,g=h.width,h=h.height;if(e)var l=a.Y,g=l.width,h=l.height;var m=b instanceof Gd;if(m&&c.rh&&(c.type===co||c.So===g&&c.Dz===h))k=c.rh;else{var n=l=0,p=0,q=0,r=0,s=0,s=r=0;e&&(l=a.Y,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===Fg)k=b.createLinearGradient(l,n,p,q);else if(c.type===Hd)s=isNaN(c.uu)?Math.max(g,h)/2:c.uu,isNaN(c.vv)?(r=0,s=Math.max(g,h)/2):r=c.vv,k=b.createRadialGradient(l,n,r,p,q,s);else if(c.type===co)try{k=b.createPattern(c.pattern,"repeat")}catch(t){k=null}else D.mc(c.type,"Brush type");if(c.type!==co&&(e=c.Uk,null!==e))for(e=e.j;e.next();)k.addColorStop(e.key,e.value);if(m&&(c.rh=k,null!==k&&(c.So=g,c.Dz=h),null===k&&c.type===co&&-1!==c.So)){c.So=-1;var u=a.g;null!==u&&
-1===c.So&&D.setTimeout(function(){u.Gm()},600)}}d?b.fillStyle=k:b.strokeStyle=k}}}O.prototype.isContainedBy=O.prototype.Dm=function(a){if(a instanceof x)a:{if(this!==a&&null!==a)for(var b=this.Q;null!==b;){if(b===a){a=!0;break a}b=b.Q}a=!1}else a=!1;return a};O.prototype.isVisibleObject=O.prototype.Uj=function(){if(!this.visible)return!1;var a=this.Q;return null!==a?a.Uj():!0};
O.prototype.isEnabledObject=O.prototype.Ou=function(){for(var a=this instanceof x?this:this.Q;null!==a&&a.isEnabled;)a=a.Q;return null===a};D.defineProperty(O,{BF:"enabledChanged"},function(){return null!==this.ma?this.ma.bs:null},function(a){Eo(this);var b=this.ma.bs;b!==a&&(null!==a&&D.h(a,"function",O,"enabledChanged"),this.ma.bs=a,this.i("enabledChanged",b,a))});
function Wo(a){if(0!==(a.R&2048)===!0){var b=a.Oc;b.reset();if(!a.dc.F()||!a.Fd.F()){Zo(a,!1);return}b.translate(a.dc.x,a.dc.y);b.translate(-a.Ia.x,-a.Ia.y);var c=a.Fa;Mo(a,b,c.x,c.y,c.width,c.height);Zo(a,!1);$o(a,!0)}0!==(a.R&4096)===!0&&(b=a.Q,null===b?(a.bi.set(a.Oc),a.bp=a.scale,$o(a,!1)):null!==b.Jh&&(c=a.bi,c.reset(),b.kh()?c.multiply(b.bi):null!==b.Q&&c.multiply(b.Q.bi),c.multiply(a.Oc),a.bp=a.scale*b.bp,$o(a,!1)))}
function Mo(a,b,c,d,e,g){1!==a.scale&&b.scale(a.scale);if(0!==a.angle){var h=mc;a.Qj()&&a.Pf.$c()&&(h=a.Pf);var k=D.O();if(a instanceof F&&a.Cf!==a)for(c=a.Cf,d=c.Fa,k.tv(d.x,d.y,d.width,d.height,h),c.lj.vb(k),k.offset(-c.Ia.x,-c.Ia.y),h=c.Q;null!==h&&h!==a;)h.lj.vb(k),k.offset(-h.Ia.x,-h.Ia.y),h=h.Q;else k.tv(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!==zm(this)){km(this,!0);Ro(this,!0);var b=this.Q;null===b||a||b.K()}};
f.Bq=function(){!0!==zm(this)&&(km(this,!0),Ro(this,!0))};function ap(a){if(!1===Nm(a)){var b=a.Q;null!==b?b.K():a.Qj()&&(b=a.g,null!==b&&(b.Gg.add(a),a instanceof H&&a.lg(),b.Le()));Ro(a,!0)}}f.gj=function(){0!==(this.R&2048)===!1&&(Zo(this,!0),$o(this,!0))};f.sB=function(){$o(this,!0)};f.ra=function(){var a=this.$;null!==a&&a.ra()};
function Oo(a,b){var c=a.stretch,d=a.Q;if(null!==d&&d.da===da)return bp(a,d.re(a.Ub),d.qe(a.column),b);if(null!==d&&d.da===Pl&&d.Ld()===a)return cp(a,Xe,b);if(c===xo){if(null!==d){if(d.da===Yj&&d.Ld()===a)return cp(a,Xe,b);c=d.ne;return c===xo?cp(a,ak,b):cp(a,c,b)}return cp(a,ak,b)}return cp(a,c,b)}
function bp(a,b,c,d){var e=a.stretch;if(e!==xo)return cp(a,e,d);var g=e=null;switch(b.stretch){case yo:g=!0;break;case Xe:g=!0}switch(c.stretch){case zo:e=!0;break;case Xe:e=!0}b=a.Q.ne;null===e&&(e=b===zo||b===Xe);null===g&&(g=b===yo||b===Xe);return!0===e&&!0===g?cp(a,Xe,d):!0===e?cp(a,zo,d):!0===g?cp(a,yo,d):cp(a,ak,d)}
function cp(a,b,c){if(c)return b;if(b===ak)return ak;c=a.Ea;if(c.F())return ak;a=a.angle;if(!isNaN(c.width))if(90!==a&&270!==a){if(b===zo)return ak;if(b===Xe)return yo}else{if(b===yo)return ak;if(b===Xe)return zo}if(!isNaN(c.height))if(90!==a&&270!==a){if(b===yo)return ak;if(b===Xe)return zo}else{if(b===zo)return ak;if(b===Xe)return yo}return b}
D.defineProperty(O,{Yq:"segmentOrientation"},function(){return this.zn},function(a){var b=this.zn;b!==a&&(v&&D.Da(a,J,O,"segmentOrientation"),this.zn=a,this.K(),this.i("segmentOrientation",b,a),a===wj&&(this.angle=0))});D.defineProperty(O,{Xe:"segmentIndex"},function(){return this.Ft},function(a){v&&D.h(a,"number",O,"segmentIndex");a=Math.round(a);var b=this.Ft;b!==a&&(this.Ft=a,this.K(),this.i("segmentIndex",b,a))});
D.defineProperty(O,{$B:"segmentFraction"},function(){return this.xn},function(a){v&&D.h(a,"number",O,"segmentFraction");isNaN(a)?a=0:0>a?a=0:1<a&&(a=1);var b=this.xn;b!==a&&(this.xn=a,this.K(),this.i("segmentFraction",b,a))});D.defineProperty(O,{aC:"segmentOffset"},function(){return this.yn},function(a){var b=this.yn;b.P(a)||(v&&D.l(a,N,O,"segmentOffset"),this.yn=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.$&&(this.$.Yl=null),this.i("name",b,a))});
D.defineProperty(O,{opacity:"opacity"},function(){return this.Mc},function(a){var b=this.Mc;b!==a&&(D.h(a,"number",O,"opacity"),(0>a||1<a)&&D.va(a,"0 <= value <= 1",O,"opacity"),this.Mc=a,this.i("opacity",b,a),a=this.g,b=this.$,null!==a&&null!==b&&a.ra(xl(b,b.Y)))});
D.defineProperty(O,{visible:"visible"},function(){return 0!==(this.R&1)},function(a){var b=0!==(this.R&1);b!==a&&(v&&D.h(a,"boolean",O,"visible"),this.R^=1,this.i("visible",b,a),b=this.Q,null!==b?b.K():this.Qj()&&this.Pd(a),this.ra(),dp(this))});D.defineProperty(O,{tg:"pickable"},function(){return 0!==(this.R&2)},function(a){var b=0!==(this.R&2);b!==a&&(v&&D.h(a,"boolean",O,"pickable"),this.R^=2,this.i("pickable",b,a))});
D.defineProperty(O,{RI:"fromLinkableDuplicates"},function(){return 0!==(this.R&4)},function(a){var b=0!==(this.R&4);b!==a&&(v&&D.h(a,"boolean",O,"fromLinkableDuplicates"),this.R^=4,this.i("fromLinkableDuplicates",b,a))});D.defineProperty(O,{SI:"fromLinkableSelfNode"},function(){return 0!==(this.R&8)},function(a){var b=0!==(this.R&8);b!==a&&(v&&D.h(a,"boolean",O,"fromLinkableSelfNode"),this.R^=8,this.i("fromLinkableSelfNode",b,a))});
D.defineProperty(O,{CK:"toLinkableDuplicates"},function(){return 0!==(this.R&16)},function(a){var b=0!==(this.R&16);b!==a&&(v&&D.h(a,"boolean",O,"toLinkableDuplicates"),this.R^=16,this.i("toLinkableDuplicates",b,a))});D.defineProperty(O,{DK:"toLinkableSelfNode"},function(){return 0!==(this.R&32)},function(a){var b=0!==(this.R&32);b!==a&&(v&&D.h(a,"boolean",O,"toLinkableSelfNode"),this.R^=32,this.i("toLinkableSelfNode",b,a))});
D.defineProperty(O,{We:"isPanelMain"},function(){return 0!==(this.R&64)},function(a){var b=0!==(this.R&64);b!==a&&(v&&D.h(a,"boolean",O,"isPanelMain"),this.R^=64,this.K(),this.i("isPanelMain",b,a))});D.defineProperty(O,{Mu:"isActionable"},function(){return 0!==(this.R&128)},function(a){var b=0!==(this.R&128);b!==a&&(v&&D.h(a,"boolean",O,"isActionable"),this.R^=128,this.i("isActionable",b,a))});
D.defineProperty(O,{mm:"areaBackground"},function(){return this.nc},function(a){var b=this.nc;b!==a&&(v&&null!==a&&D.nu(a,"GraphObject.areaBackground"),a instanceof za&&a.freeze(),this.nc=a,this.ra(),this.i("areaBackground",b,a))});D.defineProperty(O,{background:"background"},function(){return this.Pb},function(a){var b=this.Pb;b!==a&&(v&&null!==a&&D.nu(a,"GraphObject.background"),a instanceof za&&a.freeze(),this.Pb=a,this.ra(),this.i("background",b,a))});function Yo(a,b){a.R=b?a.R|512:a.R&-513}
function Jo(a){return 0!==(a.R&1024)}function ep(a,b){a.R=b?a.R|1024:a.R&-1025}function Zo(a,b){a.R=b?a.R|2048:a.R&-2049}function $o(a,b){a.R=b?a.R|4096:a.R&-4097}function zm(a){return 0!==(a.R&8192)}function km(a,b){a.R=b?a.R|8192:a.R&-8193}function Nm(a){return 0!==(a.R&16384)}function Ro(a,b){a.R=b?a.R|16384:a.R&-16385}D.w(O,{$:"part"},function(){if(this.Qj())return this;if(null!==this.tn)return this.tn;var a;for(a=this.Q;a;){if(a instanceof F)return this.tn=a;a=a.Q}return null});
D.w(O,{Q:"panel"},function(){return this.uj});O.prototype.Jm=function(a){this.uj=a};D.w(O,{layer:"layer"},function(){var a=this.$;return null!==a?a.layer:null},{configurable:!0});D.w(O,{g:"diagram"},function(){var a=this.$;return null!==a?a.g:null},{configurable:!0});
D.defineProperty(O,{position:"position"},function(){return this.jb},function(a){v&&D.l(a,N,O,"position");var b=a.x,c=a.y,d=this.jb,e=d.x,g=d.y;(e===b||isNaN(e)&&isNaN(b))&&(g===c||isNaN(g)&&isNaN(c))?this.gC():(a=a.V(),this.fC(a,d)&&this.i("position",d,a))});O.prototype.gC=function(){};O.prototype.fC=function(a){this.jb=a;ap(this);this.gj();return!0};O.prototype.$y=function(a,b){this.jb.n(a,b);this.gj()};D.w(O,{Y:"actualBounds"},function(){return this.dc});
D.defineProperty(O,{scale:"scale"},function(){return this.Ab},function(a){var b=this.Ab;b!==a&&(v&&D.p(a,O,"scale"),0>=a&&D.k("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.Ab=a,this.gj(),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,dp(this),this.K(),this.gj(),this.i("angle",b,a)))});
D.defineProperty(O,{Ea:"desiredSize"},function(){return this.af},function(a){v&&D.l(a,Ba,O,"desiredSize");var b=a.width,c=a.height,d=this.af,e=d.width,g=d.height;(e===b||isNaN(e)&&isNaN(b))&&(g===c||isNaN(g)&&isNaN(c))||(this.af=a=a.V(),this.K(),this instanceof A&&this.se(),this.i("desiredSize",d,a),Jo(this)&&(a=this.$,null!==a&&(Ko(this,a,"width"),Ko(this,a,"height"))))});
D.defineProperty(O,{width:"width"},function(){return this.af.width},function(a){var b=this.af.width;b===a||isNaN(b)&&isNaN(a)||(v&&D.h(a,"number",O,"width"),b=this.af,this.af=a=(new Ba(a,this.af.height)).freeze(),this.K(),this instanceof A&&this.se(),this.i("desiredSize",b,a),Jo(this)&&(a=this.$,null!==a&&Ko(this,a,"width")))});
D.defineProperty(O,{height:"height"},function(){return this.af.height},function(a){var b=this.af.height;b===a||isNaN(b)&&isNaN(a)||(v&&D.h(a,"number",O,"height"),b=this.af,this.af=a=(new Ba(this.af.width,a)).freeze(),this.K(),this instanceof A&&this.se(),this.i("desiredSize",b,a),Jo(this)&&(a=this.$,null!==a&&Ko(this,a,"height")))});
D.defineProperty(O,{$g:"minSize"},function(){return this.ri},function(a){var b=this.ri;b.P(a)||(v&&D.l(a,Ba,O,"minSize"),a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),this.ri=a,this.K(),this.i("minSize",b,a))});D.defineProperty(O,{pf:"maxSize"},function(){return this.qi},function(a){var b=this.qi;b.P(a)||(v&&D.l(a,Ba,O,"maxSize"),a=a.copy(),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),this.qi=a,this.K(),this.i("maxSize",b,a))});
D.w(O,{Ia:"measuredBounds"},function(){return this.Fd});D.w(O,{Fa:"naturalBounds"},function(){return this.Xc},{configurable:!0});D.defineProperty(O,{margin:"margin"},function(){return this.mn},function(a){"number"===typeof a?a=new Mb(a):v&&D.l(a,Mb,O,"margin");var b=this.mn;b.P(a)||(this.mn=a=a.V(),this.K(),this.i("margin",b,a))});D.w(O,{transform:null},function(){0!==(this.R&2048)===!0&&Wo(this);return this.Oc});D.w(O,{Jh:null},function(){0!==(this.R&4096)===!0&&Wo(this);return this.bi});
D.defineProperty(O,{alignment:"alignment"},function(){return this.we},function(a){var b=this.we;b.P(a)||(v&&D.l(a,R,O,"alignment"),a.fe()&&!a.md()&&D.k("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.we=a=a.V(),ap(this),this.i("alignment",b,a))});D.defineProperty(O,{column:"column"},function(){return this.Ar},function(a){v&&D.p(a,O,"column");a=Math.round(a);var b=this.Ar;b!==a&&(0>a&&D.va(a,">= 0",O,"column"),this.Ar=a,this.K(),this.i("column",b,a))});
D.defineProperty(O,{lI:"columnSpan"},function(){return this.Wi},function(a){v&&D.h(a,"number",O,"columnSpan");a=Math.round(a);var b=this.Wi;b!==a&&(1>a&&D.va(a,">= 1",O,"columnSpan"),this.Wi=a,this.K(),this.i("columnSpan",b,a))});D.defineProperty(O,{Ub:"row"},function(){return this.Bt},function(a){v&&D.p(a,O,"row");a=Math.round(a);var b=this.Bt;b!==a&&(0>a&&D.va(a,">= 0",O,"row"),this.Bt=a,this.K(),this.i("row",b,a))});
D.defineProperty(O,{rowSpan:"rowSpan"},function(){return this.wj},function(a){v&&D.h(a,"number",O,"rowSpan");a=Math.round(a);var b=this.wj;b!==a&&(1>a&&D.va(a,">= 1",O,"rowSpan"),this.wj=a,this.K(),this.i("rowSpan",b,a))});D.defineProperty(O,{az:"spanAllocation"},function(){return this.Rt},function(a){var b=this.Rt;b!==a&&(null!==a&&D.h(a,"function",O,"spanAllocation"),this.Rt=a,this.K(),this.i("spanAllocation",b,a))});
D.defineProperty(O,{Ih:"alignmentFocus"},function(){return this.Sm},function(a){var b=this.Sm;b.P(a)||(v&&D.l(a,R,O,"alignmentFocus"),!a.fe()||a.md()||a.P(dc)&&this instanceof H||D.k("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: "+a),this.Sm=a=a.V(),this.K(),this.i("alignmentFocus",b,a))});
D.defineProperty(O,{Rd:"portId"},function(){return this.ot},function(a){var b=this.ot;if(b!==a){v&&null!==a&&D.h(a,"string",O,"portId");var c=this.$;null===c||c instanceof H||(D.k("Cannot set portID on a Link: "+a),c=null);null!==b&&null!==c&&fp(c,this);this.ot=a;null!==a&&null!==c&&(c.gl=!0,gp(c,this));this.i("portId",b,a)}});function hp(a){var b=a.$;if(b instanceof H&&(null!==a.Rd||a===b.port)){var c=b.g;null===c||c.na.ub||Uo(b,a)}}
function dp(a){var b=a.g;null===b||b.na.ub||(a instanceof x?a instanceof H?a.lg():ip(a,a,function(a){hp(a)}):hp(a))}D.defineProperty(O,{Jb:"toSpot"},function(){return null!==this.aa?this.aa.Qk:dc},function(a){this.be();var b=this.aa.Qk;b.P(a)||(v&&D.l(a,R,O,"toSpot"),a=a.V(),this.aa.Qk=a,this.i("toSpot",b,a),hp(this))});
D.defineProperty(O,{Pm:"toEndSegmentLength"},function(){return null!==this.aa?this.aa.Ok:10},function(a){this.be();var b=this.aa.Ok;b!==a&&(v&&D.h(a,"number",O,"toEndSegmentLength"),0>a&&D.va(a,">= 0",O,"toEndSegmentLength"),this.aa.Ok=a,this.i("toEndSegmentLength",b,a),hp(this))});
D.defineProperty(O,{xv:"toEndSegmentDirection"},function(){return null!==this.aa?this.aa.Nk:Ho},function(a){this.be();var b=this.aa.Nk;b!==a&&(D.Vn("GraphObject.toEndSegmentDirection","2.0"),v&&D.Da(a,H,O,"toEndSegmentDirection"),this.aa.Nk=a,this.i("toEndSegmentDirection",b,a),hp(this))});
D.defineProperty(O,{yv:"toShortLength"},function(){return null!==this.aa?this.aa.Pk:0},function(a){this.be();var b=this.aa.Pk;b!==a&&(v&&D.h(a,"number",O,"toShortLength"),this.aa.Pk=a,this.i("toShortLength",b,a),hp(this))});D.defineProperty(O,{oH:"toLinkable"},function(){return null!==this.aa?this.aa.Yt:null},function(a){this.be();var b=this.aa.Yt;b!==a&&(v&&null!==a&&D.h(a,"boolean",O,"toLinkable"),this.aa.Yt=a,this.i("toLinkable",b,a))});
D.defineProperty(O,{EK:"toMaxLinks"},function(){return null!==this.aa?this.aa.Zt:Infinity},function(a){this.be();var b=this.aa.Zt;b!==a&&(v&&D.h(a,"number",O,"toMaxLinks"),0>a&&D.va(a,">= 0",O,"toMaxLinks"),this.aa.Zt=a,this.i("toMaxLinks",b,a))});D.defineProperty(O,{Ib:"fromSpot"},function(){return null!==this.aa?this.aa.rk:dc},function(a){this.be();var b=this.aa.rk;b.P(a)||(v&&D.l(a,R,O,"fromSpot"),a=a.V(),this.aa.rk=a,this.i("fromSpot",b,a),hp(this))});
D.defineProperty(O,{xm:"fromEndSegmentLength"},function(){return null!==this.aa?this.aa.pk:10},function(a){this.be();var b=this.aa.pk;b!==a&&(v&&D.h(a,"number",O,"fromEndSegmentLength"),0>a&&D.va(a,">= 0",O,"fromEndSegmentLength"),this.aa.pk=a,this.i("fromEndSegmentLength",b,a),hp(this))});
D.defineProperty(O,{Fu:"fromEndSegmentDirection"},function(){return null!==this.aa?this.aa.ok:Ho},function(a){this.be();var b=this.aa.ok;b!==a&&(D.Vn("GraphObject.fromEndSegmentDirection","2.0"),v&&D.Da(a,H,O,"fromEndSegmentDirection"),this.aa.ok=a,this.i("fromEndSegmentDirection",b,a),hp(this))});
D.defineProperty(O,{Gu:"fromShortLength"},function(){return null!==this.aa?this.aa.qk:0},function(a){this.be();var b=this.aa.qk;b!==a&&(v&&D.h(a,"number",O,"fromShortLength"),this.aa.qk=a,this.i("fromShortLength",b,a),hp(this))});D.defineProperty(O,{LF:"fromLinkable"},function(){return null!==this.aa?this.aa.es:null},function(a){this.be();var b=this.aa.es;b!==a&&(v&&null!==a&&D.h(a,"boolean",O,"fromLinkable"),this.aa.es=a,this.i("fromLinkable",b,a))});
D.defineProperty(O,{hB:"fromMaxLinks"},function(){return null!==this.aa?this.aa.fs:Infinity},function(a){this.be();var b=this.aa.fs;b!==a&&(v&&D.h(a,"number",O,"fromMaxLinks"),0>a&&D.va(a,">= 0",O,"fromMaxLinks"),this.aa.fs=a,this.i("fromMaxLinks",b,a))});D.defineProperty(O,{cursor:"cursor"},function(){return this.Jr},function(a){var b=this.Jr;b!==a&&(D.h(a,"string",O,"cursor"),this.Jr=a,this.i("cursor",b,a))});
D.defineProperty(O,{click:"click"},function(){return null!==this.ma?this.ma.Vi:null},function(a){Eo(this);var b=this.ma.Vi;b!==a&&(null!==a&&D.h(a,"function",O,"click"),this.ma.Vi=a,this.i("click",b,a))});D.defineProperty(O,{tu:"doubleClick"},function(){return null!==this.ma?this.ma.bj:null},function(a){Eo(this);var b=this.ma.bj;b!==a&&(null!==a&&D.h(a,"function",O,"doubleClick"),this.ma.bj=a,this.i("doubleClick",b,a))});
D.defineProperty(O,{TA:"contextClick"},function(){return null!==this.ma?this.ma.Xi:null},function(a){Eo(this);var b=this.ma.Xi;b!==a&&(null!==a&&D.h(a,"function",O,"contextClick"),this.ma.Xi=a,this.i("contextClick",b,a))});D.defineProperty(O,{bv:"mouseEnter"},function(){return null!==this.ma?this.ma.Vs:null},function(a){Eo(this);var b=this.ma.Vs;b!==a&&(null!==a&&D.h(a,"function",O,"mouseEnter"),this.ma.Vs=a,this.i("mouseEnter",b,a))});
D.defineProperty(O,{cv:"mouseLeave"},function(){return null!==this.ma?this.ma.Ws:null},function(a){Eo(this);var b=this.ma.Ws;b!==a&&(null!==a&&D.h(a,"function",O,"mouseLeave"),this.ma.Ws=a,this.i("mouseLeave",b,a))});D.defineProperty(O,{KB:"mouseOver"},function(){return null!==this.ma?this.ma.qj:null},function(a){Eo(this);var b=this.ma.qj;b!==a&&(null!==a&&D.h(a,"function",O,"mouseOver"),this.ma.qj=a,this.i("mouseOver",b,a))});
D.defineProperty(O,{JB:"mouseHover"},function(){return null!==this.ma?this.ma.pj:null},function(a){Eo(this);var b=this.ma.pj;b!==a&&(null!==a&&D.h(a,"function",O,"mouseHover"),this.ma.pj=a,this.i("mouseHover",b,a))});D.defineProperty(O,{IB:"mouseHold"},function(){return null!==this.ma?this.ma.oj:null},function(a){Eo(this);var b=this.ma.oj;b!==a&&(null!==a&&D.h(a,"function",O,"mouseHold"),this.ma.oj=a,this.i("mouseHold",b,a))});
D.defineProperty(O,{RJ:"mouseDragEnter"},function(){return null!==this.ma?this.ma.Ts:null},function(a){Eo(this);var b=this.ma.Ts;b!==a&&(null!==a&&D.h(a,"function",O,"mouseDragEnter"),this.ma.Ts=a,this.i("mouseDragEnter",b,a))});D.defineProperty(O,{SJ:"mouseDragLeave"},function(){return null!==this.ma?this.ma.Us:null},function(a){Eo(this);var b=this.ma.Us;b!==a&&(null!==a&&D.h(a,"function",O,"mouseDragLeave"),this.ma.Us=a,this.i("mouseDragLeave",b,a))});
D.defineProperty(O,{HB:"mouseDrop"},function(){return null!==this.ma?this.ma.nj:null},function(a){Eo(this);var b=this.ma.nj;b!==a&&(null!==a&&D.h(a,"function",O,"mouseDrop"),this.ma.nj=a,this.i("mouseDrop",b,a))});D.defineProperty(O,{RE:"actionDown"},function(){return null!==this.ma?this.ma.ir:null},function(a){Eo(this);var b=this.ma.ir;b!==a&&(null!==a&&D.h(a,"function",O,"actionDown"),this.ma.ir=a,this.i("actionDown",b,a))});
D.defineProperty(O,{SE:"actionMove"},function(){return null!==this.ma?this.ma.jr:null},function(a){Eo(this);var b=this.ma.jr;b!==a&&(null!==a&&D.h(a,"function",O,"actionMove"),this.ma.jr=a,this.i("actionMove",b,a))});D.defineProperty(O,{TE:"actionUp"},function(){return null!==this.ma?this.ma.kr:null},function(a){Eo(this);var b=this.ma.kr;b!==a&&(null!==a&&D.h(a,"function",O,"actionUp"),this.ma.kr=a,this.i("actionUp",b,a))});
D.defineProperty(O,{QE:"actionCancel"},function(){return null!==this.ma?this.ma.hr:null},function(a){Eo(this);var b=this.ma.hr;b!==a&&(null!==a&&D.h(a,"function",O,"actionCancel"),this.ma.hr=a,this.i("actionCancel",b,a))});D.defineProperty(O,{pC:"toolTip"},function(){return null!==this.ma?this.ma.zj:null},function(a){Eo(this);var b=this.ma.zj;b!==a&&(!v||null===a||a instanceof ca||a instanceof hk||D.k("GraphObject.toolTip must be an Adornment or HTMLInfo."),this.ma.zj=a,this.i("toolTip",b,a))});
D.defineProperty(O,{contextMenu:"contextMenu"},function(){return null!==this.ma?this.ma.Yi:null},function(a){Eo(this);var b=this.ma.Yi;b!==a&&(!v||a instanceof ca||a instanceof hk||D.k("GraphObject.contextMenu must be an Adornment or HTMLInfo."),this.ma.Yi=a,this.i("contextMenu",b,a))});O.prototype.bind=O.prototype.bind=function(a){a.Sg=this;var b=this.wm();null!==b&&jp(b)&&D.k("Cannot add a Binding to a template that has already been copied: "+a);null===this.Ic&&(this.Ic=new K(oh));this.Ic.add(a)};
O.prototype.findTemplateBinder=O.prototype.wm=function(){for(var a=this instanceof x?this:this.Q;null!==a;){if(null!==a.Dl)return a;a=a.Q}return null};O.prototype.setProperties=function(a){D.rv(this,a)};var kp;
O.make=kp=function(a,b){var c=arguments,d=null,e=null;if("function"===typeof a)e=a;else if("string"===typeof a){var g=lp.oa(a);"function"===typeof g?(c=D.qm(arguments),d=g(c),D.Qa(d)||D.k('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):e=aa[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)Ml(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):mp(d,e);return d};
function mp(a,b){if("string"===typeof b)if(a instanceof na)a.text=b;else if(a instanceof A)a.Ob=b;else if(a instanceof Gl)a.source=b;else if(a instanceof x){var c=Ga(x,b);null!==c?a.type=c:D.k("Unknown Panel type as an argument to GraphObject.make: "+b)}else a instanceof za?(c=Ga(za,b),null!==c?a.type=c:D.k("Unknown Brush type as an argument to GraphObject.make: "+b)):a instanceof Ue?(c=Ga(Ue,b),null!==c?a.type=c:D.k("Unknown Geometry type as an argument to GraphObject.make: "+b)):a instanceof Zf?
(c=Ga(Zf,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 ih){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.lq(d)}else if(b instanceof xa)"function"===typeof a.qc?a.qc(b):D.ck(a,b);else if(b instanceof oh)a instanceof O?a.bind(b):a instanceof ih?a.bind(b):D.k("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+a);else if(b instanceof We)a instanceof Ue?a.pc.add(b):D.k("A PathFigure can only be added to a Geometry, not to: "+a);else if(b instanceof Zf)a instanceof We?a.Fb.add(b):D.k("A PathSegment can only be added to a PathFigure, not to: "+a);else if(b instanceof Ig)a instanceof
E?a.$b=b:a instanceof I?a.$b=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++)mp(a,b[c]);else if("object"===typeof b&&null!==b)if(a instanceof za){e=new ja;for(c in b)d=parseFloat(c),isNaN(d)?e[c]=b[c]:a.addColorStop(d,b[c]);D.rv(a,e)}else if(a instanceof ih){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 ja;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);D.rv(a,e)}else D.rv(a,b);else D.k('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+a)}var lp=new ma("string","function");
O.getBuilders=function(){var a=new ma("string","function"),b;for(b in lp)if(b!==b.toLowerCase()){var c=lp.oa(b);"function"===typeof c&&a.add(b,c)}a.freeze();return a};var np;O.defineBuilder=np=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);lp.add(a,b)};var op;
O.takeBuilderArgument=op=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};
np("Button",function(){var a=new za(Fg);a.addColorStop(0,"white");a.addColorStop(1,"lightgray");var b=new za(Fg);b.addColorStop(0,"white");b.addColorStop(1,"dodgerblue");a=kp(x,Pl,{Mu:!0,BF:function(a,b){var e=a.Md("ButtonBorder");null!==e&&(e.fill=b?a._buttonFillNormal:a._buttonFillDisabled)},_buttonFillNormal:a,_buttonStrokeNormal:"gray",_buttonFillOver:b,_buttonStrokeOver:"blue",_buttonFillDisabled:"darkgray"},kp(A,{name:"ButtonBorder",Ob:"Rectangle",C:new R(0,0,2.761423749153968,2.761423749153968),
D:new R(1,1,-2.761423749153968,-2.761423749153968),fill:a,stroke:"gray"}));a.bv=function(a,b){if(b.Ou()){var e=b.Md("ButtonBorder");if(e instanceof A){var g=b._buttonFillOver;b._buttonFillNormal=e.fill;e.fill=g;g=b._buttonStrokeOver;b._buttonStrokeNormal=e.stroke;e.stroke=g}}};a.cv=function(a,b){if(b.Ou()){var e=b.Md("ButtonBorder");e instanceof A&&(e.fill=b._buttonFillNormal,e.stroke=b._buttonStrokeNormal)}};return a});
np("TreeExpanderButton",function(){var a=kp("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},kp(A,{name:"ButtonIcon",Ob:"MinusLine",Ea:Yd},(new oh("figure","isTreeExpanded",function(a,c){var d=c.Q;return a?d._treeExpandedFigure:d._treeCollapsedFigure})).Dy()),{visible:!1},(new oh("visible","isTreeLeaf",function(a){return!a})).Dy());a.click=function(a,c){var d=c.$;d instanceof ca&&(d=d.hf);if(d instanceof H){var e=d.g;if(null!==e){e=e.xb;if(d.Fc){if(!e.canCollapseTree(d))return}else if(!e.canExpandTree(d))return;
a.Ec=!0;d.Fc?e.collapseTree(d):e.expandTree(d)}}};return a});
np("SubGraphExpanderButton",function(){var a=kp("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},kp(A,{name:"ButtonIcon",Ob:"MinusLine",Ea:Yd},(new oh("figure","isSubGraphExpanded",function(a,c){var d=c.Q;return a?d._subGraphExpandedFigure:d._subGraphCollapsedFigure})).Dy()));a.click=function(a,c){var d=c.$;d instanceof ca&&(d=d.hf);if(d instanceof I){var e=d.g;if(null!==e){e=e.xb;if(d.nd){if(!e.canCollapseSubGraph(d))return}else if(!e.canExpandSubGraph(d))return;a.Ec=
!0;d.nd?e.collapseSubGraph(d):e.expandSubGraph(d)}}};return a});np("ToolTip",function(){var a=new ca(Pl),b=new A;b.name="Border";b.fill="#FFFFE0";b.stroke="#CCCCCC";a.add(b);return a});np("ContextMenu",function(){return new ca(Ol)});np("ContextMenuButton",function(){var a=kp("Button");a.stretch=zo;var b=a.Md("ButtonBorder");b instanceof A&&(b.Ob="Rectangle",b.C=new R(0,0,2,3),b.D=new R(1,1,-2,-2));return a});
np("PanelExpanderButton",function(a){var b=op(a,"COLLAPSIBLE"),c=kp("Button",{_buttonExpandedFigure:"TriangleUp",_buttonCollapsedFigure:"TriangleDown"},kp(A,"TriangleUp",{name:"ButtonIcon",Ea:new Ba(6,4)},(new oh("figure","visible",function(a){return a?c._buttonExpandedFigure:c._buttonCollapsedFigure})).Dy(b)));a=c.Md("ButtonBorder");a instanceof A&&(a.stroke=null,a.fill="transparent");c.click=function(a,c){var g=c.g;if(null!==g&&!g.sb){var h=c.wm();null===h&&(h=c.$);null!==h&&(h=h.Md(b),null!==h&&
(g.Qb("Collapse/Expand Panel"),h.visible=!h.visible,g.ld("Collapse/Expand Panel")))}};return c});
np("CheckBoxButton",function(a){var b=op(a);a=kp("Button",{"ButtonBorder.fill":"white","ButtonBorder.stroke":"gray",width:14,height:14},kp(A,{name:"ButtonIcon",TI:"M0 4 L3 9 9 0",pb:2,stretch:Xe,iB:ck,visible:!1},""!==b?(new oh("visible",b)).GJ():[]));a.click=function(a,d){var e=a.g;if(!(null===e||e.sb||""!==b&&e.ea.sb)){a.Ec=!0;var g=d.Md("ButtonIcon");e.Qb("checkbox");g.visible=!g.visible;"function"===typeof d._doClick&&d._doClick(a,d);e.ld("checkbox")}};return a});
np("CheckBox",function(a){a=op(a);a=kp("CheckBoxButton",a,{name:"Button",margin:new Mb(0,1,0,0)});var b=kp(x,"Horizontal",a,{Mu:!0,margin:1,_buttonFillNormal:a._buttonFillNormal,_buttonStrokeNormal:a._buttonStrokeNormal,_buttonFillOver:a._buttonFillOver,_buttonStrokeOver:a._buttonStrokeOver,_buttonFillDisabled:a._buttonFillDisabled,bv:a.bv,cv:a.cv,click:a.click,_buttonClick:a.click});a.bv=null;a.cv=null;a.click=null;return b});
function Fo(){this.bs=this.Yi=this.zj=this.hr=this.kr=this.jr=this.ir=this.nj=this.Us=this.Ts=this.oj=this.pj=this.qj=this.Ws=this.Vs=this.Xi=this.bj=this.Vi=null}Fo.prototype.copy=function(){var a=new Fo;a.Vi=this.Vi;a.bj=this.bj;a.Xi=this.Xi;a.Vs=this.Vs;a.Ws=this.Ws;a.qj=this.qj;a.pj=this.pj;a.oj=this.oj;a.Ts=this.Ts;a.Us=this.Us;a.nj=this.nj;a.ir=this.ir;a.jr=this.jr;a.kr=this.kr;a.hr=this.hr;a.zj=this.zj;a.Yi=this.Yi;a.bs=this.bs;return a};
function x(a){O.call(this);void 0===a?this.da=ek:(D.Da(a,x,x,"type"),this.da=a);this.ya=new K(O);this.tf=Ld;this.da===Sl&&(this.fo=!0);this.Nr=Vc;this.aj=xo;this.da===da&&pp(this);this.aq=ck;this.ns=$d;this.os=Jd;this.ks=0;this.js=100;this.ms=10;this.ls=0;this.Dl=this.Ud=this.sk=this.Zm=this.an=null;this.Bs=NaN;this.Ig=this.ij=null;this.tp="category";this.Hg=null;this.Bj=new C(NaN,NaN,NaN,NaN);this.Mk=this.Ct=this.cm=null;this.fk=""}D.Ta(x,O);D.Gi(x);D.ka("Panel",x);
function pp(a){a.kk=Ld;a.ii=1;a.$i=null;a.Hl=null;a.hi=1;a.gi=null;a.Gl=null;a.kd=[];a.ed=[];a.wn=qp;a.Wm=qp;a.Aj=0;a.kj=0}
x.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.da=this.da;a.tf=this.tf.V();a.Nr=this.Nr.V();a.aj=this.aj;if(a.da===da){a.kk=this.kk.V();a.ii=this.ii;a.$i=this.$i;a.Hl=this.Hl;a.hi=this.hi;a.gi=this.gi;a.Gl=this.Gl;var b=[];if(0<this.kd.length)for(var c=this.kd,d=c.length,e=0;e<d;e++)if(void 0!==c[e]){var g=c[e].copy();g.Jm(a);b[e]=g}a.kd=b;b=[];if(0<this.ed.length)for(c=this.ed,d=c.length,e=0;e<d;e++)void 0!==c[e]&&(g=c[e].copy(),g.Jm(a),b[e]=g);a.ed=b;a.wn=this.wn;
a.Wm=this.Wm;a.Aj=this.Aj;a.kj=this.kj}a.aq=this.aq;a.ns=this.ns.V();a.os=this.os.V();a.ks=this.ks;a.js=this.js;a.ms=this.ms;a.ls=this.ls;a.an=this.an;a.sk=this.sk;a.Ud=this.Ud;a.Dl=this.Dl;a.Bs=this.Bs;a.ij=this.ij;a.Ig=this.Ig;a.tp=this.tp;a.Bj.assign(this.Bj);a.fk=this.fk;null!==this.Ct&&(a.Ct=this.Ct)};x.prototype.Ii=function(a){O.prototype.Ii.call(this,a);a.ya=this.ya;for(var b=a.ya.o,c=b.length,d=0;d<c;d++)b[d].uj=a;a.cm=null};
x.prototype.copy=function(){var a=O.prototype.copy.call(this);if(null!==a){for(var b=this.ya.o,c=b.length,d=0;d<c;d++){var e=b[d].copy(),g=a;e.Jm(g);e.tn=null;var h=g.ya,k=h.count;h.ce(k,e);h=g.$;if(null!==h){h.Yl=null;null!==e.Rd&&h instanceof H&&(h.gl=!0);var l=g.g;null!==l&&l.na.ub||h.pd(gg,"elements",g,null,e,null,k)}}return a}return null};x.prototype.qc=function(a){a.Se===x?this.type=a:O.prototype.qc.call(this,a)};x.prototype.toString=function(){return"Panel("+this.type+")#"+D.Nd(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 Yj;x.Spot=Yj=D.s(x,"Spot",3);var Pl;x.Auto=Pl=D.s(x,"Auto",4);var da;x.Table=da=D.s(x,"Table",5);x.Viewbox=D.s(x,"Viewbox",6);var Po;x.TableRow=Po=D.s(x,"TableRow",7);var Qo;x.TableColumn=Qo=D.s(x,"TableColumn",8);var tj;x.Link=tj=D.s(x,"Link",9);var Sl;x.Grid=Sl=D.s(x,"Grid",10);var rp;x.Graduated=rp=D.s(x,"Graduated",11);
D.defineProperty(x,{type:"type"},function(){return this.da},function(a){var b=this.da;b!==a&&(v&&D.Da(a,x,x,"type"),b!==Po&&b!==Qo||D.k("Cannot change Panel.type when it is already a TableRow or a TableColumn: "+a),this.da=a,this.da===Sl?this.fo=!0:this.da===da&&pp(this),this.K(),this.i("type",b,a))});D.w(x,{elements:"elements"},function(){return this.ya.j});D.w(x,{Fa:"naturalBounds"},function(){return this.Xc});
D.defineProperty(x,{padding:"padding"},function(){return this.tf},function(a){"number"===typeof a?(0>a&&D.va(a,">= 0",x,"padding"),a=new Mb(a)):(D.l(a,Mb,x,"padding"),0>a.left&&D.va(a.left,">= 0",x,"padding:value.left"),0>a.right&&D.va(a.right,">= 0",x,"padding:value.right"),0>a.top&&D.va(a.top,">= 0",x,"padding:value.top"),0>a.bottom&&D.va(a.bottom,">= 0",x,"padding:value.bottom"));var b=this.tf;b.P(a)||(this.tf=a=a.V(),this.K(),this.i("padding",b,a))});
D.defineProperty(x,{um:"defaultAlignment"},function(){return this.Nr},function(a){var b=this.Nr;b.P(a)||(v&&D.l(a,R,x,"defaultAlignment"),this.Nr=a=a.V(),this.K(),this.i("defaultAlignment",b,a))});D.defineProperty(x,{ne:"defaultStretch"},function(){return this.aj},function(a){var b=this.aj;b!==a&&(D.Da(a,O,x,"defaultStretch"),this.aj=a,this.K(),this.i("defaultStretch",b,a))});
D.defineProperty(x,{FL:"defaultSeparatorPadding"},function(){return void 0===this.kk?Ld:this.kk},function(a){if(void 0!==this.kk){"number"===typeof a?a=new Mb(a):v&&D.l(a,Mb,x,"defaultSeparatorPadding");var b=this.kk;b.P(a)||(this.kk=a=a.V(),this.K(),this.i("defaultSeparatorPadding",b,a))}});
D.defineProperty(x,{DL:"defaultRowSeparatorStroke"},function(){return void 0===this.$i?null:this.$i},function(a){var b=this.$i;b!==a&&(null===a||"string"===typeof a||a instanceof za)&&(a instanceof za&&a.freeze(),this.$i=a,this.ra(),this.i("defaultRowSeparatorStroke",b,a))});
D.defineProperty(x,{EL:"defaultRowSeparatorStrokeWidth"},function(){return void 0===this.ii?1:this.ii},function(a){if(void 0!==this.ii){var b=this.ii;b!==a&&isFinite(a)&&0<=a&&(this.ii=a,this.K(),this.i("defaultRowSeparatorStrokeWidth",b,a))}});
D.defineProperty(x,{CL:"defaultRowSeparatorDashArray"},function(){return void 0===this.Hl?null:this.Hl},function(a){if(void 0!==this.Hl){var b=this.Hl;if(b!==a){null===a||Array.isArray(a)||D.mc(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.Hl=a;this.ra();
this.i("defaultRowSeparatorDashArray",b,a)}}});D.defineProperty(x,{xL:"defaultColumnSeparatorStroke"},function(){return void 0===this.gi?null:this.gi},function(a){if(void 0!==this.gi){var b=this.gi;b!==a&&(null===a||"string"===typeof a||a instanceof za)&&(a instanceof za&&a.freeze(),this.gi=a,this.ra(),this.i("defaultColumnSeparatorStroke",b,a))}});
D.defineProperty(x,{yL:"defaultColumnSeparatorStrokeWidth"},function(){return void 0===this.hi?1:this.hi},function(a){if(void 0!==this.hi){var b=this.hi;b!==a&&isFinite(a)&&0<=a&&(this.hi=a,this.K(),this.i("defaultColumnSeparatorStrokeWidth",b,a))}});
D.defineProperty(x,{wL:"defaultColumnSeparatorDashArray"},function(){return void 0===this.Gl?null:this.Gl},function(a){if(void 0!==this.Gl){var b=this.Gl;if(b!==a){null===a||Array.isArray(a)||D.mc(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.Gl=
a;this.ra();this.i("defaultColumnSeparatorDashArray",b,a)}}});D.defineProperty(x,{RM:"viewboxStretch"},function(){return this.aq},function(a){var b=this.aq;b!==a&&(D.Da(a,O,x,"viewboxStretch"),this.aq=a,this.K(),this.i("viewboxStretch",b,a))});
D.defineProperty(x,{iy:"gridCellSize"},function(){return this.ns},function(a){var b=this.ns;if(!b.P(a)){D.l(a,Ba,x,"gridCellSize");a.F()&&0!==a.width&&0!==a.height||D.k("Invalid Panel.gridCellSize: "+a);this.ns=a.V();var c=this.g;null!==c&&this===c.bo&&lm(c);this.ra();this.i("gridCellSize",b,a)}});
D.defineProperty(x,{VF:"gridOrigin"},function(){return this.os},function(a){var b=this.os;if(!b.P(a)){D.l(a,N,x,"gridOrigin");a.F()||D.k("Invalid Panel.gridOrigin: "+a);this.os=a.V();var c=this.g;null!==c&&this===c.bo&&lm(c);this.ra();this.i("gridOrigin",b,a)}});D.defineProperty(x,{fl:"graduatedMin"},function(){return this.ks},function(a){D.p(a,x,"graduatedMin");var b=this.ks;b!==a&&(this.ks=a,this.K(),this.i("graduatedMin",b,a),Jo(this)&&(a=this.$,null!==a&&Ko(this,a,"graduatedRange")))});
D.defineProperty(x,{lB:"graduatedMax"},function(){return this.js},function(a){D.p(a,x,"graduatedMax");var b=this.js;b!==a&&(this.js=a,this.K(),this.i("graduatedMax",b,a),Jo(this)&&(a=this.$,null!==a&&Ko(this,a,"graduatedRange")))});D.w(x,{Iu:"graduatedRange"},function(){return this.lB-this.fl});D.defineProperty(x,{mB:"graduatedTickUnit"},function(){return this.ms},function(a){D.p(a,x,"graduatedTickUnit");var b=this.ms;b!==a&&0<a&&(this.ms=a,this.K(),this.i("graduatedTickUnit",b,a))});
D.defineProperty(x,{UF:"graduatedTickBase"},function(){return this.ls},function(a){D.p(a,x,"graduatedTickBase");var b=this.ls;b!==a&&(this.ls=a,this.K(),this.i("graduatedTickBase",b,a))});f=x.prototype;f.dt=function(a){O.prototype.dt.call(this,a);for(var b=this.ya.o,c=b.length,d=0;d<c;d++)b[d].dt(a)};
f.Zk=function(a,b){if(this.da===Sl){var c=this.Mj()*b.scale;0>=c&&(c=1);var d=this.iy,e=d.width,d=d.height,g=this.Fa,h=g.width,g=g.height,k=Math.ceil(h/e),l=Math.ceil(g/d),m=this.VF;a.save();a.beginPath();a.rect(0,0,h,g);a.clip();for(var n=[],p=this.ya.o,q=p.length,r=0;r<q;r++){var s=p[r],t=[];n.push(t);if(s.visible)for(var s=gn(s.Ob),u=r+1;u<q;u++){var z=p[u];z.visible&&gn(z.Ob)===s&&(z=z.interval,2<=z&&t.push(z))}}p=this.ya.o;q=p.length;for(r=0;r<q;r++){var w=p[r];if(w.visible&&(t=w.interval,!(2>
e*t*c))){s=w.opacity;u=1;if(1!==s){if(0===s)continue;u=a.globalAlpha;a.globalAlpha=u*s}var z=n[r],y=!1,B=!0,P=w.jH;null!==P&&(y=!0,B=a.Wx(P,w.Jf));if("LineV"===w.Ob&&null!==w.stroke){a.lineWidth=w.pb;Xo(this,a,w.stroke,!1,!1);a.beginPath();for(var G=Math.floor(-m.x/e),Q=G;Q<=G+k;Q++){var Y=Q*e+m.x;0<=Y&&Y<=h&&sp(Q,t,z)&&(y&&!B?Io(a,Y,0,Y,g,P,w.Jf):(a.moveTo(Y,0),a.lineTo(Y,g)))}a.stroke()}else if("LineH"===w.Ob&&null!==w.stroke){a.lineWidth=w.pb;Xo(this,a,w.stroke,!1,!1);a.beginPath();for(Q=G=Math.floor(-m.y/
d);Q<=G+l;Q++)Y=Q*d+m.y,0<=Y&&Y<=g&&sp(Q,t,z)&&(y&&!B?Io(a,0,Y,h,Y,P,w.Jf):(a.moveTo(0,Y),a.lineTo(h,Y)));a.stroke()}else if("BarV"===w.Ob&&null!==w.fill)for(Xo(this,a,w.fill,!0,!1),w=w.width,isNaN(w)&&(w=e),Q=G=Math.floor(-m.x/e);Q<=G+k;Q++)Y=Q*e+m.x,0<=Y&&Y<=h&&sp(Q,t,z)&&a.fillRect(Y,0,w,g);else if("BarH"===w.Ob&&null!==w.fill)for(Xo(this,a,w.fill,!0,!1),w=w.height,isNaN(w)&&(w=d),Q=G=Math.floor(-m.y/d);Q<=G+l;Q++)Y=Q*d+m.y,0<=Y&&Y<=g&&sp(Q,t,z)&&a.fillRect(0,Y,h,w);y&&a.Tx();1!==s&&(a.globalAlpha=
u)}}a.restore();a.Ee(!1)}else if(this.da===rp){c=b.cn;b.cn=!0;d=this.Fa;e=d.width;d=d.height;a.save();a.beginPath();a.rect(-1,-1,e+1,d+1);a.clip();e=this.Ld();e.He(a,b);d=this.Mj()*b.scale;0>=d&&(d=1);h=e.Y;g=this.ya.o;k=this.an;l=g.length;for(m=0;m<l;m++)if(r=g[m],n=k[m],p=n.length,r.visible&&r!==e&&0!==n.length)if(r instanceof A){if(!(2>this.mB*r.interval*e.wf.Bu/this.Iu*d))for(t=r.Ia,s=r.pb*r.scale,u=r.Ih,u.fe()&&(u=jc),q=0;q<p;q++)z=r,y=n[q][0],G=h,Q=n[q][1],w=t,B=s,P=u,Y=z.Oc,Y.reset(),Y.translate(y.x+
G.x,y.y+G.y),Y.rotate(Q+z.angle,0,0),Y.translate(-w.width*P.x+P.offsetX+B/2,-w.height*P.y+P.offsetY+B/2),Y.scale(z.scale,z.scale),Zo(z,!1),z.bi.set(z.Oc),z.bp=z.scale,$o(z,!1),r.He(a,b),r.Oc.reset()}else if(r instanceof na)for(null===this.Mk&&(this.Mk=new na),t=this.Mk,tp(r,t),q=0;q<p;q++)y=n[q],3<y.length&&(u=y[6],t.Zd=y[2],t.wg=y[3],t.ze=y[4],t.sf=y[5],t.Xc=y[8],t.rc(u.x,u.y,u.width,u.height),r=t,s=h,z=y[7],y=y[8],G=r.Oc,G.reset(),G.translate(u.x+s.x,u.y+s.y),G.translate(-z.x,-z.y),Mo(r,G,y.x,y.y,
y.width,y.height),Zo(r,!1),r.bi.set(r.Oc),r.bp=r.scale,$o(r,!1),t.He(a,b));b.cn=c;a.restore();a.Ee(!0)}else{this.da===da&&(a.lineCap="butt",up(this,a,!0,this.kd,!0),up(this,a,!1,this.ed,!0),Sp(this,a,!0,this.kd),Sp(this,a,!1,this.ed),up(this,a,!0,this.kd,!1),up(this,a,!1,this.ed,!1));if(c=this.Cq)a.save(),v&&this.type!==Yj&&D.trace("Warning: Panel.isClipping set on non-Spot Panel: "+this.toString());e=this.Ld();d=this.ya.o;h=d.length;for(g=0;g<h;g++)k=d[g],c&&k===e&&(a.jq=!0),k.He(a,b),c&&k===e&&
(a.jq=!1);c&&(a.restore(),a.Ee(!0));v&&v.KI&&this instanceof J&&v.JI(a,b,this)}};
function tp(a,b){b.R=a.R|6144;b.Mc=a.Mc;b.Pb=a.Pb;b.nc=a.nc;b.af=a.af.V();b.ri=a.ri.V();b.qi=a.qi.V();b.lj=a.lj.copy();b.Ab=a.Ab;b.wg=a.wg;b.Qg=a.Qg;b.mn=a.mn.V();b.we=a.we.V();b.Sm=a.Sm.V();b.xn=a.xn;b.yn=a.yn.V();b.zn=a.zn;null!==a.yg&&(b.yg=a.yg.copy());b.Dn=a.Dn;a instanceof na&&(b.Zd=a.Zd,b.Cc=a.Cc,b.Bg=a.Bg,b.dm=a.dm,b.Ag=a.Ag,b.hm=a.hm,b.en=a.en,b.yk=a.yk,b.wk=a.wk,b.sj=a.sj,b.Dj=a.Dj,b.sf.nk=null,b.yi=a.yi,b.zi=a.zi,b.yh=a.yh,b.xp=a.xp,b.Fg=a.Fg,b.Eg=a.Eg,b.Dg=a.Dg,b.$m=a.$m)}
function Sp(a,b,c,d){for(var e=d.length,g=a.Y,h=!0,k=0;k<e;k++){var l=d[k];if(void 0!==l)if(h)h=!1;else if(0!==l.kb){if(c){if(l.position>g.height)continue}else if(l.position>g.width)continue;var m=l.$q;isNaN(m)&&(m=c?a.ii:a.hi);var n=l.Zq;null===n&&(n=c?a.$i:a.gi);if(0!==m&&null!==n){Xo(a,b,n,!1,!1);var n=!1,p=!0,q=l.rK;null===q&&(q=c?a.Hl:a.Gl);null!==q&&(n=!0,p=b.Wx(q,0));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?Io(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?Io(b,l,m,l,r,q,0):(b.moveTo(l,m),b.lineTo(l,r)));b.stroke();n&&b.Tx()}}}}
function up(a,b,c,d,e){for(var g=d.length,h=a.Y,k=0;k<g;k++){var l=d[k];if(void 0!==l&&null!==l.background&&l.YA!==e&&0!==l.kb){var m=c?h.height:h.width;if(!(l.position>m)){var n=l.kf(),p=l.$q;isNaN(p)&&(p=c?a.ii:a.hi);var q=l.Zq;null===q&&(q=c?a.$i:a.gi);null===q&&(p=0);n-=p;p=l.position+p;n+=l.kb;p+n>m&&(n=m-p);0>=n||(m=a.padding,Xo(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 sp(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 gn(a){return"LineV"===a||"BarV"===a}
f.$n=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.mm)return h=this.Y,Ie(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.Fa,c=Ie(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.ya.o;r=p.length;n=D.O();q=null;b=Infinity;var s=null;this.Cq&&(s=D.O(),q=this.Ld(),(c=q.$n(k,a,l,d,s))&&(b=(k-s.x)*(k-s.x)+(a-s.y)*(a-s.y)));for(var t=0;t<r;t++){var u=p[t];u.visible&&u!==q&&u.$n(k,a,l,d,n)&&(c=!0,u=(k-n.x)*(k-n.x)+(a-n.y)*(a-n.y),u<m&&(m=u,e.set(n)))}this.Cq&&(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.da===Pl||this.da===tj)a=this.Ld();for(var b=this.ya.o,c=b.length,d=0;d<c;d++){var e=b[d];(e===a||e.We)&&e.K(!0);if(!e.Ea.F()){var g=Oo(e,!1);(e instanceof Zj||e instanceof x||e instanceof na||g!==ak)&&e.K(!0)}}};f.Bq=function(){if(!1===zm(this)){km(this,!0);Ro(this,!0);for(var a=this.ya.o,b=a.length,c=0;c<b;c++)a[c].Bq()}};f.gj=function(){if(0!==(this.R&2048)===!1){Zo(this,!0);$o(this,!0);for(var a=this.ya.o,b=a.length,c=0;c<b;c++)a[c].sB()}};
f.sB=function(){$o(this,!0);for(var a=this.ya.o,b=a.length,c=0;c<b;c++)a[c].sB()};
f.oo=function(a,b,c,d){var e=this.Bj;e.width=0;e.height=0;var g=this.Ea,h=this.$g;void 0===c&&(c=h.width,d=h.height);c=Math.max(c,h.width);d=Math.max(d,h.height);var k=this.pf;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.ya.o;if(0!==m.length){var n=this.da.ac;switch(n){case "Position":var p=a,q=b,r=c,s=d,t=m.length;e.x=0;e.y=
0;e.width=0;e.height=0;for(var u=Tp(this),z=0;z<t;z++){var w=m[z];if(w.visible||w===u){var y=w.margin,B=y.right+y.left,P=y.top+y.bottom;Hk(w,p,q,r,s);var G=w.Ia,Q=Math.max(G.width+B,0),Y=Math.max(G.height+P,0),U=w.position.x,ea=w.position.y;isFinite(U)||(U=0);isFinite(ea)||(ea=0);if(w instanceof A){var la=w;if(la.gG)var Da=la.pb/2,U=U-Da,ea=ea-Da}Ub(e,U,ea,Q,Y)}}break;case "Vertical":for(var La=a,hb=c,Aa=m.length,W=D.hb(),xb=Tp(this),Ob=0;Ob<Aa;Ob++){var Sa=m[Ob];if(Sa.visible||Sa===xb){var Qc=Oo(Sa,
!1);if(Qc!==ak&&Qc!==yo)W.push(Sa);else{var Ra=Sa.margin,ig=Ra.right+Ra.left,jg=Ra.top+Ra.bottom;Hk(Sa,La,Infinity,hb,0);var vd=Sa.Ia,wd=Math.max(vd.width+ig,0),Rc=Math.max(vd.height+jg,0);e.width=Math.max(e.width,wd);e.height+=Rc}}}var vh=W.length;if(0!==vh){this.Ea.width?La=Math.min(this.Ea.width,this.pf.width):0!==e.width&&(La=Math.min(e.width,this.pf.width));for(Ob=0;Ob<vh;Ob++)if(Sa=W[Ob],Sa.visible||Sa===xb)Ra=Sa.margin,ig=Ra.right+Ra.left,jg=Ra.top+Ra.bottom,Hk(Sa,La,Infinity,hb,0),vd=Sa.Ia,
wd=Math.max(vd.width+ig,0),Rc=Math.max(vd.height+jg,0),e.width=Math.max(e.width,wd),e.height+=Rc;D.ua(W)}break;case "Horizontal":for(var $e=b,ib=d,ub=m.length,sa=D.hb(),oa=Tp(this),ab=0;ab<ub;ab++){var Oa=m[ab];if(Oa.visible||Oa===oa){var pb=Oo(Oa,!1);if(pb!==ak&&pb!==zo)sa.push(Oa);else{var Nd=Oa.margin,Jf=Nd.right+Nd.left,ue=Nd.top+Nd.bottom;Hk(Oa,Infinity,$e,0,ib);var de=Oa.Ia,jd=Math.max(de.width+Jf,0),wh=Math.max(de.height+ue,0);e.width+=jd;e.height=Math.max(e.height,wh)}}}var Kf=sa.length;if(0!==
Kf){this.Ea.height?$e=Math.min(this.Ea.height,this.pf.height):0!==e.height&&($e=Math.min(e.height,this.pf.height));for(ab=0;ab<Kf;ab++)if(Oa=sa[ab],Oa.visible||Oa===oa)Nd=Oa.margin,Jf=Nd.right+Nd.left,ue=Nd.top+Nd.bottom,Hk(Oa,Infinity,$e,0,ib),de=Oa.Ia,jd=Math.max(de.width+Jf,0),wh=Math.max(de.height+ue,0),e.width+=jd,e.height=Math.max(e.height,wh);D.ua(sa)}break;case "Spot":a:{var Jg=a,Gb=b,nc=c,xd=d,xh=m.length,qb=this.Ld(),Pa=qb.margin,Pb=0,Lf=0,Kg=Pa.right+Pa.left,yh=Pa.top+Pa.bottom;Hk(qb,Jg,
Gb,nc,xd);for(var jb=qb.Ia,yc=jb.width,Zb=jb.height,ve=Math.max(yc+Kg,0),zc=Math.max(Zb+yh,0),Ac=this.Cq,vb=D.vg(-Pa.left,-Pa.top,ve,zc),oc=!0,yb=Tp(this),Fc=0;Fc<xh;Fc++){var eb=m[Fc];if(eb!==qb&&(eb.visible||eb===yb)){Pa=eb.margin;Pb=Pa.right+Pa.left;Lf=Pa.top+Pa.bottom;Hk(eb,Jg,Gb,0,0);var jb=eb.Ia,ve=Math.max(jb.width+Pb,0),zc=Math.max(jb.height+Lf,0),Ta=eb.alignment;Ta.md()&&(Ta=this.um);Ta.$c()||(Ta=mc);var Lb=eb.Ih;Lb.md()&&(Lb=mc);var yd=null;eb instanceof x&&""!==eb.fk&&(eb.rc(0,0,jb.width,
jb.height),yd=eb.Md(eb.fk),yd===eb&&(yd=null));var kg,af;if(null!==yd){for(var bf=yd.Fa,zj=yd.margin,Qb=D.Db(Lb.x*bf.width+Lb.offsetX-zj.left,Lb.y*bf.height+Lb.offsetY-zj.top);yd!==eb;)yd.transform.vb(Qb),yd=yd.Q;kg=Ta.x*yc+Ta.offsetX-Qb.x;af=Ta.y*Zb+Ta.offsetY-Qb.y;D.A(Qb)}else kg=Ta.x*yc+Ta.offsetX-(Lb.x*jb.width-Lb.offsetX)-Pa.left,af=Ta.y*Zb+Ta.offsetY-(Lb.y*jb.height-Lb.offsetY)-Pa.top;oc?(oc=!1,e.x=kg,e.y=af,e.width=ve,e.height=zc):Ub(e,kg,af,ve,zc)}}oc?e.assign(vb):Ac?e.aG(vb.x,vb.y,vb.width,
vb.height):Ub(e,vb.x,vb.y,vb.width,vb.height);D.Hb(vb);var pc=qb.stretch;pc===xo&&(pc=Oo(qb,!1));switch(pc){case ak:break a;case Xe:if(!isFinite(Jg)&&!isFinite(Gb))break a;break;case zo:if(!isFinite(Jg))break a;break;case yo:if(!isFinite(Gb))break a}jb=qb.Ia;yc=jb.width;Zb=jb.height;ve=Math.max(yc+Kg,0);zc=Math.max(Zb+yh,0);Pa=qb.margin;vb=D.vg(-Pa.left,-Pa.top,ve,zc);for(Fc=0;Fc<xh;Fc++)eb=m[Fc],eb===qb||!eb.visible&&eb!==yb||(Pa=eb.margin,Pb=Pa.right+Pa.left,Lf=Pa.top+Pa.bottom,jb=eb.Ia,ve=Math.max(jb.width+
Pb,0),zc=Math.max(jb.height+Lf,0),Ta=eb.alignment,Ta.md()&&(Ta=this.um),Ta.$c()||(Ta=mc),Lb=eb.Ih,Lb.md()&&(Lb=mc),oc?(oc=!1,e.x=Ta.x*yc+Ta.offsetX-(Lb.x*jb.width-Lb.offsetX)-Pa.left,e.y=Ta.y*Zb+Ta.offsetY-(Lb.y*jb.height-Lb.offsetY)-Pa.top,e.width=ve,e.height=zc):Ub(e,Ta.x*yc+Ta.offsetX-(Lb.x*jb.width-Lb.offsetX)-Pa.left,Ta.y*Zb+Ta.offsetY-(Lb.y*jb.height-Lb.offsetY)-Pa.top,ve,zc));oc?e.assign(vb):Ac?e.aG(vb.x,vb.y,vb.width,vb.height):Ub(e,vb.x,vb.y,vb.width,vb.height);D.Hb(vb)}break;case "Auto":var ec=
a,kd=b,nb=c,Rb=d,we=m.length,zb=this.Ld(),ee=zb.margin,zh=ec,Ah=kd,Lg=ee.right+ee.left,ld=ee.top+ee.bottom;Hk(zb,ec,kd,nb,Rb);var Od=zb.Ia,fc=0,Ab=null;zb instanceof A&&(Ab=zb,fc=Ab.pb*Ab.scale);var zd=Math.max(Od.width+Lg,0),ob=Math.max(Od.height+ld,0),gc=Up(zb),li=gc.x*zd+gc.offsetX,ad=gc.y*ob+gc.offsetY,Hb=Vp(zb),xe=Hb.x*zd+Hb.offsetX,cf=Hb.y*ob+Hb.offsetY;isFinite(ec)&&(zh=Math.max(Math.abs(li-xe)-fc,0));isFinite(kd)&&(Ah=Math.max(Math.abs(ad-cf)-fc,0));var bd=D.Om();bd.n(0,0);for(var Mf=Tp(this),
Nf=0;Nf<we;Nf++){var Bh=m[Nf];if(Bh!==zb&&(Bh.visible||Bh===Mf)){var ee=Bh.margin,Lk=ee.right+ee.left,Bb=ee.top+ee.bottom;Hk(Bh,zh,Ah,0,0);Od=Bh.Ia;zd=Math.max(Od.width+Lk,0);ob=Math.max(Od.height+Bb,0);bd.n(Math.max(zd,bd.width),Math.max(ob,bd.height))}}if(1===we)e.width=zd,e.height=ob,D.bl(bd);else{var gc=Up(zb),Hb=Vp(zb),fe=0,md=0;Hb.x!==gc.x&&Hb.y!==gc.y&&(fe=bd.width/Math.abs(Hb.x-gc.x),md=bd.height/Math.abs(Hb.y-gc.y));D.bl(bd);fc=0;null!==Ab&&(fc=Ab.pb*Ab.scale,bk(Ab)===ck&&(fe=md=Math.max(fe,
md)));var fe=fe+(Math.abs(gc.offsetX)+Math.abs(Hb.offsetX)+fc),md=md+(Math.abs(gc.offsetY)+Math.abs(Hb.offsetY)+fc),Oe=zb.stretch;Oe===xo&&(Oe=Oo(zb,!1));switch(Oe){case ak:Rb=nb=0;break;case Xe:isFinite(ec)&&(fe=ec);isFinite(kd)&&(md=kd);break;case zo:isFinite(ec)&&(fe=ec);Rb=0;break;case yo:nb=0,isFinite(kd)&&(md=kd)}zb.Bq();Hk(zb,fe,md,nb,Rb);e.width=zb.Ia.width+Lg;e.height=zb.Ia.height+ld}break;case "Table":for(var mi=a,ni=b,Aj=c,Bj=d,Ib=m.length,Ch=D.hb(),Dh=D.hb(),ka=0;ka<Ib;ka++){var ba=m[ka],
hc=ba instanceof x?ba:null;if(null===hc||hc.type!==Po&&hc.type!==Qo||!ba.visible)Ch.push(ba);else{v&&(hc.Ea.F()&&D.k(hc.toString()+" TableRow/TableColumn Panels cannot set a desiredSize: "+hc.Ea.toString()),hc.$g.P(Wd)||D.k(hc.toString()+" TableRow/TableColumn Panels cannot set a minSize: "+hc.$g.toString()),hc.pf.P(ae)||D.k(hc.toString()+" TableRow/TableColumn Panels cannot set a maxSize: "+hc.pf.toString()));Dh.push(hc);for(var lg=hc.ya.o,oi=lg.length,Jb=0;Jb<oi;Jb++){var pi=lg[Jb];hc.type===Po?
pi.Ub=ba.Ub:hc.type===Qo&&(pi.column=ba.column);Ch.push(pi)}}}Ib=Ch.length;0===Ib&&(this.re(0),this.qe(0));for(var Wb=[],ka=0;ka<Ib;ka++)ba=Ch[ka],km(ba,!0),Ro(ba,!0),Wb[ba.Ub]||(Wb[ba.Ub]=[]),Wb[ba.Ub][ba.column]||(Wb[ba.Ub][ba.column]=[]),Wb[ba.Ub][ba.column].push(ba);D.ua(Ch);for(var df=D.hb(),Pe=D.hb(),ef=D.hb(),ye={count:0},ze={count:0},cd=mi,Pd=ni,Eh=this.kd,Ib=Eh.length,ka=0;ka<Ib;ka++){var $=Eh[ka];void 0!==$&&($.kb=0)}Eh=this.ed;Ib=Eh.length;for(ka=0;ka<Ib;ka++)$=Eh[ka],void 0!==$&&($.kb=
0);for(var nd=Wb.length,mg=0,ka=0;ka<nd;ka++)Wb[ka]&&(mg=Math.max(mg,Wb[ka].length));for(var qi=Math.min(this.Aj,nd-1),Fh=Math.min(this.kj,mg-1),qc=0,nd=Wb.length,Gh=Tp(this),ka=0;ka<nd;ka++)if(Wb[ka])for(var mg=Wb[ka].length,rb=this.re(ka),Jb=rb.kb=0;Jb<mg;Jb++)if(Wb[ka][Jb]){var sb=this.qe(Jb);void 0===df[Jb]&&(sb.kb=0,df[Jb]=!0);for(var pm=Wb[ka][Jb],ff=pm.length,Mk=0;Mk<ff;Mk++)if(ba=pm[Mk],ba.visible||ba===Gh){var ri=1<ba.wj||1<ba.Wi;ri&&(ka<qi||Jb<Fh||Pe.push(ba));var Bc=ba.margin,Of=Bc.right+
Bc.left,ng=Bc.top+Bc.bottom,Sb=bp(ba,rb,sb,!1),gf=ba.Ea,Nk=!isNaN(gf.height),qm=!isNaN(gf.width)&&Nk;ri||Sb===ak||qm||ka<qi||Jb<Fh||(void 0!==ye[Jb]||Sb!==Xe&&Sb!==zo||(ye[Jb]=-1,ye.count++),void 0!==ze[ka]||Sb!==Xe&&Sb!==yo||(ze[ka]=-1,ze.count++),ef.push(ba));Hk(ba,Infinity,Infinity,0,0);if(!(ka<qi||Jb<Fh)){var Pf=ba.Ia,hf=Math.max(Pf.width+Of,0),jf=Math.max(Pf.height+ng,0);if(1===ba.wj&&(Sb===ak||Sb===zo)){var $=this.re(ka),rc=$.kf(),qc=Math.max(jf-$.kb,0);qc+rc>Pd&&(qc=Math.max(Pd-rc,0));var og=
0===$.kb;$.kb+=qc;Pd=Math.max(Pd-(qc+(og?rc:0)),0)}1!==ba.Wi||Sb!==ak&&Sb!==yo||($=this.qe(Jb),rc=$.kf(),qc=Math.max(hf-$.kb,0),qc+rc>cd&&(qc=Math.max(cd-rc,0)),og=0===$.kb,$.kb+=qc,cd=Math.max(cd-(qc+(og?rc:0)),0));ri&&ba.Bq()}}}D.ua(df);for(var Gc=0,Fb=0,Ib=this.kq,ka=0;ka<Ib;ka++){var si=this.ed[ka];void 0!==si&&(Gc+=si.Ya,0!==si.Ya&&(Gc+=si.kf()))}Ib=this.Xq;for(ka=0;ka<Ib;ka++){var Mg=this.kd[ka];void 0!==Mg&&(Fb+=Mg.Ya,0!==Mg.Ya&&(Fb+=Mg.kf()))}for(var cd=Math.max(mi-Gc,0),Cj=Pd=Math.max(ni-
Fb,0),vp=cd,Ib=ef.length,ka=0;ka<Ib;ka++){var ba=ef[ka],rb=this.re(ba.Ub),sb=this.qe(ba.column),Ng=ba.Ia,Bc=ba.margin,Of=Bc.right+Bc.left,ng=Bc.top+Bc.bottom;ye[ba.column]=0===sb.kb&&void 0!==ye[ba.column]?Math.max(Ng.width+Of,ye[ba.column]):null;ze[ba.Ub]=0===rb.kb&&void 0!==ze[ba.Ub]?Math.max(Ng.height+ng,ze[ba.Ub]):null}var Qf=0,Og=0,Pg;for(Pg in ze)"count"!==Pg&&(Qf+=ze[Pg]);for(Pg in ye)"count"!==Pg&&(Og+=ye[Pg]);for(var tb=D.Om(),ka=0;ka<Ib;ka++)if(ba=ef[ka],ba.visible||ba===Gh){var rb=this.re(ba.Ub),
sb=this.qe(ba.column),$b=0;isFinite(sb.width)?$b=sb.width:($b=isFinite(cd)&&null!==ye[ba.column]?0===Og?sb.kb+cd:ye[ba.column]/Og*vp:null!==ye[ba.column]?cd:sb.kb||cd,$b=Math.max(0,$b-sb.kf()));var Hc=0;isFinite(rb.height)?Hc=rb.height:(Hc=isFinite(Pd)&&null!==ze[ba.Ub]?0===Qf?rb.kb+Pd:ze[ba.Ub]/Qf*Cj:null!==ze[ba.Ub]?Pd:rb.kb||Pd,Hc=Math.max(0,Hc-rb.kf()));tb.n(Math.max(sb.Vh,Math.min($b,sb.ve)),Math.max(rb.Vh,Math.min(Hc,rb.ve)));Sb=bp(ba,rb,sb,!1);switch(Sb){case zo:tb.height=Math.max(tb.height,
rb.kb+Pd);break;case yo:tb.width=Math.max(tb.width,sb.kb+cd)}Bc=ba.margin;Of=Bc.right+Bc.left;ng=Bc.top+Bc.bottom;ba.Bq();Hk(ba,tb.width,tb.height,sb.Vh,rb.Vh);Pf=ba.Ia;hf=Math.max(Pf.width+Of,0);jf=Math.max(Pf.height+ng,0);isFinite(cd)&&(hf=Math.min(hf,tb.width));isFinite(Pd)&&(jf=Math.min(jf,tb.height));var kf=0,kf=rb.kb;rb.kb=Math.max(rb.kb,jf);qc=rb.kb-kf;Pd=Math.max(Pd-qc,0);kf=sb.kb;sb.kb=Math.max(sb.kb,hf);qc=sb.kb-kf;cd=Math.max(cd-qc,0)}D.ua(ef);var Qd=D.Om(),Ib=Pe.length;if(0!==Ib)for(var Ad=
D.hb(),lf=D.hb(),ka=0;ka<nd;ka++)if(Wb[ka])for(mg=Wb[ka].length,rb=this.re(ka),Ad[ka]=rb.kb,Jb=0;Jb<mg;Jb++)Wb[ka][Jb]&&(sb=this.qe(Jb),lf[Jb]=sb.kb);for(ka=0;ka<Ib;ka++)if(ba=Pe[ka],ba.visible||ba===Gh){rb=this.re(ba.Ub);sb=this.qe(ba.column);tb.n(Math.max(sb.Vh,Math.min(mi,sb.ve)),Math.max(rb.Vh,Math.min(ni,rb.ve)));Sb=bp(ba,rb,sb,!1);switch(Sb){case Xe: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 zo:0!==lf[sb.index]&&
(tb.width=Math.min(tb.width,lf[sb.index]));break;case yo: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);Qd.n(0,0);for(var fb=1;fb<ba.wj&&!(ba.Ub+fb>=this.Xq);fb++)$=this.re(ba.Ub+fb),qc=Sb===Xe||Sb===yo?Math.max($.Vh,0===Ad[ba.Ub+fb]?$.ve:Math.min(Ad[ba.Ub+fb],$.ve)):Math.max($.Vh,isNaN($.uf)?$.ve:Math.min($.uf,$.ve)),Qd.height+=qc;for(fb=1;fb<ba.Wi&&!(ba.column+fb>=this.kq);fb++)$=this.qe(ba.column+
fb),qc=Sb===Xe||Sb===zo?Math.max($.Vh,0===lf[ba.column+fb]?$.ve:Math.min(lf[ba.column+fb],$.ve)):Math.max($.Vh,isNaN($.uf)?$.ve:Math.min($.uf,$.ve)),Qd.width+=qc;tb.width+=Qd.width;tb.height+=Qd.height;Bc=ba.margin;Of=Bc.right+Bc.left;ng=Bc.top+Bc.bottom;Hk(ba,tb.width,tb.height,Aj,Bj);for(var Pf=ba.Ia,hf=Math.max(Pf.width+Of,0),jf=Math.max(Pf.height+ng,0),mf=0,fb=0;fb<ba.wj&&!(ba.Ub+fb>=this.Xq);fb++)$=this.re(ba.Ub+fb),mf+=$.total||0;if(mf<jf){var od=jf-mf,Qg=jf-mf;if(null!==ba.az)for(var nf=ba.az,
fb=0;fb<ba.wj&&!(0>=od)&&!(ba.Ub+fb>=this.Xq);fb++){var $=this.re(ba.Ub+fb),Ic=$.Ya||0,Rf=nf(ba,$,Qg);v&&"number"!==typeof Rf&&D.k(ba+" spanAllocation does not return a number: "+Rf);$.kb=Math.min($.ve,Ic+Rf);$.Ya!==Ic&&(od-=$.Ya-Ic)}for(;0<od;){Ic=$.Ya||0;isNaN($.height)&&$.ve>Ic&&($.kb=Math.min($.ve,Ic+od),$.Ya!==Ic&&(od-=$.Ya-Ic));if(0===$.index)break;$=this.re($.index-1)}}for(var Qe=0,fb=0;fb<ba.Wi&&!(ba.column+fb>=this.kq);fb++)$=this.qe(ba.column+fb),Qe+=$.total||0;if(Qe<hf){od=hf-Qe;Qg=hf-
Qe;if(null!==ba.az)for(nf=ba.az,fb=0;fb<ba.Wi&&!(0>=od)&&!(ba.column+fb>=this.kq);fb++)$=this.qe(ba.column+fb),Ic=$.Ya||0,Rf=nf(ba,$,Qg),v&&"number"!==typeof Rf&&D.k(ba+" spanAllocation does not return a number: "+Rf),$.kb=Math.min($.ve,Ic+Rf),$.Ya!==Ic&&(od-=$.Ya-Ic);for(;0<od;){Ic=$.Ya||0;isNaN($.width)&&$.ve>Ic&&($.kb=Math.min($.ve,Ic+od),$.Ya!==Ic&&(od-=$.Ya-Ic));if(0===$.index)break;$=this.qe($.index-1)}}}D.ua(Pe);D.bl(Qd);D.bl(tb);void 0!==Ad&&D.ua(Ad);void 0!==lf&&D.ua(lf);for(var Rg=0,Sg=
0,Sb=Oo(this,!0),Dj=this.Ea,Ok=this.pf,Ae=Fb=Gc=0,dd=0,Ib=this.kq,ka=0;ka<Ib;ka++)void 0!==this.ed[ka]&&($=this.qe(ka),isFinite($.width)?(Ae+=$.width,Ae+=$.kf()):Wp($)===Xp?(Ae+=$.Ya,Ae+=$.kf()):0!==$.Ya&&(Gc+=$.Ya,Gc+=$.kf()));var Rg=isFinite(Dj.width)?Math.min(Dj.width,Ok.width):Sb!==ak&&isFinite(mi)?mi:Gc,Rg=Math.max(Rg,this.$g.width),Rg=Math.max(Rg-Ae,0),Pk=Math.max(Rg/Gc,1);isFinite(Pk)||(Pk=1);for(ka=0;ka<Ib;ka++)void 0!==this.ed[ka]&&($=this.qe(ka),isFinite($.width)||Wp($)===Xp||($.kb=$.Ya*
Pk),$.position=e.width,0!==$.Ya&&(e.width+=$.Ya,e.width+=$.kf()));Ib=this.Xq;for(ka=0;ka<Ib;ka++)void 0!==this.kd[ka]&&($=this.re(ka),isFinite($.height)?(dd+=$.height,dd+=$.kf()):Wp($)===Xp?(dd+=$.Ya,dd+=$.kf()):0!==$.Ya&&(Fb+=$.Ya,0!==$.Ya&&(Fb+=$.kf())));var Sg=isFinite(Dj.height)?Math.min(Dj.height,Ok.height):Sb!==ak&&isFinite(ni)?ni:Fb,Sg=Math.max(Sg,this.$g.height),Sg=Math.max(Sg-dd,0),Hh=Math.max(Sg/Fb,1);isFinite(Hh)||(Hh=1);for(ka=0;ka<Ib;ka++)void 0!==this.kd[ka]&&($=this.re(ka),isFinite($.height)||
Wp($)===Xp||($.kb=$.Ya*Hh),$.position=e.height,0!==$.Ya&&(e.height+=$.Ya,0!==$.Ya&&(e.height+=$.kf())));Ib=Dh.length;for(ka=0;ka<Ib;ka++){var pd=Dh[ka];pd.type===Po?($b=e.width,$=this.re(pd.Ub),Hc=$.kb):($=this.qe(pd.column),$b=$.kb,Hc=e.height);pd.Fd.n(0,0,$b,Hc);km(pd,!1);Wb[pd.Ub]||(Wb[pd.Ub]=[]);Wb[pd.Ub][pd.column]||(Wb[pd.Ub][pd.column]=[]);Wb[pd.Ub][pd.column].push(pd)}D.ua(Dh);this.Ct=Wb;break;case "Viewbox":var Ej=a,sm=b,tt=c,ut=d;1<m.length&&D.k("Viewbox Panel cannot contain more than one GraphObject.");
var of=m[0];of.Ab=1;of.Bq();Hk(of,Infinity,Infinity,tt,ut);var Qk=of.Ia,tm=of.margin,vt=tm.right+tm.left,wt=tm.top+tm.bottom;if(isFinite(Ej)||isFinite(sm)){var lw=of.scale,um=Qk.width,vm=Qk.height,xt=Math.max(Ej-vt,0),yt=Math.max(sm-wt,0),Rk=1;this.aq===ck?0!==um&&0!==vm&&(Rk=Math.min(xt/um,yt/vm)):0!==um&&0!==vm&&(Rk=Math.max(xt/um,yt/vm));0===Rk&&(Rk=1E-4);of.Ab*=Rk;lw!==of.scale&&(km(of,!0),Hk(of,Infinity,Infinity,tt,ut))}Qk=of.Ia;e.width=isFinite(Ej)?Ej:Math.max(Qk.width+vt,0);e.height=isFinite(sm)?
sm:Math.max(Qk.height+wt,0);break;case "Link":var zt=m.length;if(this instanceof ca||this instanceof J){var ui=null;this instanceof J&&(ui=this);this instanceof ca&&(ui=this.hf);if(ui instanceof J){var Sk=ui;if(0===zt){var wm=this.Fa;Cb(wm,0,0);var Be=this.Ia;Be.n(0,0,0,0)}else{var xm=this instanceof ca?null:ui.path,Tg=ui.yo,pf=this.Bj;pf.assign(Tg);pf.x=0;pf.y=0;var Ih=Sk.points,vi=ui.ta;this.$u(!1);var At=Tg.width,Bt=Tg.height;this.mj.n(Tg.x,Tg.y);null===this.ph&&(this.ph=new K(C));this.ph.clear();
null!==xm&&(Yp(xm,At,Bt,this),Be=xm.Ia,pf.lh(Be),this.ph.add(Be));for(var Ug=D.hh(),Tk=D.O(),Vg=D.O(),wp=0;wp<zt;wp++){var Xb=m[wp];if(Xb!==xm)if(Xb.We&&Xb instanceof A)Yp(Xb,At,Bt,this),Be=Xb.Ia,pf.lh(Be),this.ph.add(Be);else if(2>vi)Hk(Xb,Infinity,Infinity),Be=Xb.Ia,pf.lh(Be),this.ph.add(Be);else{var Bd=Xb.Xe,Dt=Xb.$B,xp=Xb.Ih;xp.fe()&&(xp=mc);var pg=Xb.Yq,mw=Xb.aC,Uk=0,Vk=0,ym=0;if(Bd<-vi||Bd>=vi){var Et=Sk.xG,Sf=Sk.wG;pg!==wj&&(ym=Sk.computeAngle(Xb,pg,Sf),Xb.wg=ym);Uk=Et.x-Tg.x;Vk=Et.y-Tg.y}else{var Rd,
qf;if(0<=Bd)Rd=Ih.fa(Bd),qf=Bd<vi-1?Ih.fa(Bd+1):Rd;else{var wi=vi+Bd;Rd=Ih.fa(wi);qf=0<wi?Ih.fa(wi-1):Rd}if(Rd.Zc(qf)){var xi,yi;0<=Bd?(xi=0<Bd?Ih.fa(Bd-1):Rd,yi=Bd<vi-2?Ih.fa(Bd+2):qf):(xi=wi<vi-1?Ih.fa(wi+1):Rd,yi=1<wi?Ih.fa(wi-2):qf);var Ft=xi.Lf(Rd),Gt=qf.Lf(yi),Sf=Ft>Gt+10?0<=Bd?xi.Yb(Rd):Rd.Yb(xi):Gt>Ft+10?0<=Bd?qf.Yb(yi):yi.Yb(qf):0<=Bd?xi.Yb(yi):yi.Yb(xi)}else Sf=0<=Bd?Rd.Yb(qf):qf.Yb(Rd);pg!==wj&&(ym=Sk.computeAngle(Xb,pg,Sf),Xb.wg=ym);Uk=Rd.x+(qf.x-Rd.x)*Dt-Tg.x;Vk=Rd.y+(qf.y-Rd.y)*Dt-Tg.y}Hk(Xb,
Infinity,Infinity);var Be=Xb.Ia,wm=Xb.Fa,Wk=0;Xb instanceof A&&(Wk=Xb.pb);var zi=wm.width+Wk,Fj=wm.height+Wk;Ug.reset();Ug.translate(-Be.x,-Be.y);Ug.scale(Xb.scale,Xb.scale);Ug.rotate(pg===wj?Xb.angle:Sf,zi/2,Fj/2);pg!==Zp&&pg!==$p||Ug.rotate(90,zi/2,Fj/2);pg!==aq&&pg!==bq||Ug.rotate(-90,zi/2,Fj/2);pg===cq&&(45<Sf&&135>Sf||225<Sf&&315>Sf)&&Ug.rotate(-Sf,zi/2,Fj/2);var Gj=new C(0,0,zi,Fj);Tk.zo(Gj,xp);Ug.vb(Tk);var nw=-Tk.x+Wk/2*Xb.scale,ow=-Tk.y+Wk/2*Xb.scale;Vg.assign(mw);isNaN(Vg.x)&&(Vg.x=0<=Bd?
zi/2+3:-(zi/2+3));isNaN(Vg.y)&&(Vg.y=-(Fj/2+3));Vg.rotate(Sf);Uk+=Vg.x;Vk+=Vg.y;Gj.set(Be);Gj.x=Uk+nw;Gj.y=Vk+ow;this.ph.add(Gj);pf.lh(Gj)}}if(this instanceof J)for(var Ht=this.Bf;Ht.next();)Hk(Ht.value,Infinity,Infinity);this.Bj=pf;var yp=this.mj;yp.n(yp.x+pf.x,yp.y+pf.y);Cb(e,pf.width||0,pf.height||0);D.lf(Ug);D.A(Tk);D.A(Vg)}}}break;case "Grid":break;case "Graduated":var pw=a,qw=b,rw=c,sw=d,Wg=this.Ld();this.Zm=[];var Hj=Wg.margin,tw=Hj.right+Hj.left,uw=Hj.top+Hj.bottom;Hk(Wg,pw,qw,rw,sw);var It=
Wg.Ia,vw=It.height,ww=Math.max(It.width+tw,0),xw=Math.max(vw+uw,0),Jt=new C(-Hj.left,-Hj.top,ww,xw);this.Zm.push(Jt);e.assign(Jt);for(var al=Wg.wf,Kt=Wg.pb,zp=al.gy,Ij=al.Au,Ai=al.Bu,yw=zp.length,Ap=0,Bp=0,Jj=D.hb(),Cp=0;Cp<yw;Cp++){for(var Dp=zp[Cp],Lt=[],Bp=Ap=0,zw=Dp.length,Kj=0;Kj<zw;Kj+=2){var Mt=Dp[Kj],Nt=Dp[Kj+1];if(0!==Kj){var Cd=180*Math.atan2(Nt-Bp,Mt-Ap)/Math.PI;0>Cd&&(Cd+=360);Lt.push(Cd)}Ap=Mt;Bp=Nt}Jj.push(Lt)}var Ot;if(null===this.sk){for(var Pt=[],Ep=this.ya.o,Qt=Ep.length,Fp=0;Fp<
Qt;Fp++){var bl=Ep[Fp],Rt=[];Pt.push(Rt);if(bl.visible)for(var Aw=bl.interval,Gp=0;Gp<Qt;Gp++){var cl=Ep[Gp];if(cl.visible&&bl!==cl&&!(bl instanceof A&&!(cl instanceof A)||bl instanceof na&&!(cl instanceof na))){var St=cl.interval;St>Aw&&Rt.push(St)}}}this.sk=Pt}Ot=this.sk;var Tt=this.ya.o,Bw=Tt.length,Jh=0,Ut=0,Vt=Ai;this.an=[];for(var Am=[],Bm=0;Bm<Bw;Bm++){var Kh=Tt[Bm],Am=[];if(Kh.visible&&Kh!==Wg){var Wt=Kh.interval,Xt=this.mB;if(!(2>Xt*Wt*Ai/this.Iu)){var ge=this.UF,Yt=Ot[Bm],Bi=Ij[0][0],Tf=
0,Dd=0,Ut=Ai*Kh.TF-1E-4,Vt=Ai*Kh.RF+1E-4,Lj=Xt*Wt;if(ge<this.fl)var Ci=(this.fl-ge)/Lj,Ci=0===Ci%1?Ci:Math.floor(Ci+1),ge=ge+Ci*Lj;else ge>this.fl+Lj&&(Ci=Math.floor((ge-this.fl)/Lj),ge-=Ci*Lj);for(;ge<=this.lB;){var Hp;a:{for(var Cw=Yt.length,Ip=0;Ip<Cw;Ip++)if(Eb((ge-this.UF)%(Yt[Ip]*this.mB),0)){Hp=!1;break a}Hp=!0}if(Hp&&(Jh=(ge-this.fl)*Ai/this.Iu,Jh>Ai&&(Jh=Ai),Ut<=Jh&&Jh<=Vt)){for(var Cd=Jj[Tf][Dd],Mj=Ij[Tf][Dd];Tf<Ij.length;){for(;Jh>Bi&&Dd<Ij[Tf].length-1;)Dd++,Cd=Jj[Tf][Dd],Mj=Ij[Tf][Dd],
Bi+=Mj;if(Jh<=Bi)break;Tf++;Dd=0;Cd=Jj[Tf][Dd];Mj=Ij[Tf][Dd];Bi+=Mj}var Sd=zp[Tf],Zt=Sd[2*Dd],$t=Sd[2*Dd+1],Cm=(Jh-(Bi-Mj))/Mj,Jp=new N(Zt+(Sd[2*Dd+2]-Zt)*Cm+Kt/2-al.lb.x,$t+(Sd[2*Dd+3]-$t)*Cm+Kt/2-al.lb.y);Jp.scale(Wg.scale,Wg.scale);var qg=Cd,Nj=Jj[Tf];1E-4>Cm?0<Dd?qg=Nj[Dd-1]:Eb(Sd[0],Sd[Sd.length-2])&&Eb(Sd[1],Sd[Sd.length-1])&&(qg=Nj[Nj.length-1]):.9999<Cm&&(Dd+1<Nj.length?qg=Nj[Dd+1]:Eb(Sd[0],Sd[Sd.length-2])&&Eb(Sd[1],Sd[Sd.length-1])&&(qg=Nj[0]));Cd!==qg&&(180<Math.abs(Cd-qg)&&(Cd<qg?Cd+=
360:qg+=360),Cd=(Cd+qg)/2%360);if(Kh instanceof na){var Lh="";null!==Kh.SF?(Lh=Kh.SF(ge),Lh=null!==Lh&&void 0!==Lh?Lh.toString():""):Lh=(+ge.toFixed(2)).toString();""!==Lh&&Am.push([Jp,Cd,Lh])}else Am.push([Jp,Cd])}ge+=Lj}}}this.an.push(Am)}D.ua(Jj);for(var Dw=this.an,Ew=m.length,Dm=0;Dm<Ew;Dm++){var Di=m[Dm],Kp=Dw[Dm];if(Di.visible&&Di!==Wg&&0!==Kp.length){if(Di instanceof A){var Mh=Di,au=Kp,Fw=e,Lp=Mh.Ih;Lp.fe()&&(Lp=jc);var Gw=Mh.angle;Mh.wg=0;Hk(Mh,Infinity,Infinity);Mh.wg=Gw;var bu=Mh.Ia,Mp=
bu.width,Np=bu.height,cu=D.vg(0,0,Mp,Np),he=D.O();he.zo(cu,Lp);D.Hb(cu);for(var Em=-he.x,Fm=-he.y,Ei=new C,Hw=au.length,Gm=0;Gm<Hw;Gm++)for(var Op=au[Gm],du=Op[0].x,eu=Op[0].y,fu=Op[1],Hm=0;4>Hm;Hm++){switch(Hm){case 0:he.n(Em,Fm);break;case 1:he.n(Em+Mp,Fm);break;case 2:he.n(Em,Fm+Np);break;case 3:he.n(Em+Mp,Fm+Np)}he.rotate(fu+Mh.angle);he.offset(du,eu);0===Gm&&0===Hm?Ei.n(he.x,he.y,0,0):Ei.Qi(he);he.offset(-du,-eu);he.rotate(-fu-Mh.angle)}D.A(he);this.Zm.push(Ei);Ub(Fw,Ei.x,Ei.y,Ei.width,Ei.height)}else if(Di instanceof
na){var Im=Di,gu=Kp,Iw=e;null===this.Mk&&(this.Mk=new na);var Uf=this.Mk;tp(Im,Uf);var Pp=Im.Ih;Pp.fe()&&(Pp=jc);for(var Nh=Im.Yq,Jw=Im.aC,Fi=null,Jm=0,Km=0,Xg=0,Qp=0,Kw=gu.length,Lm=0;Lm<Kw;Lm++){var rg=gu[Lm],Jm=rg[0].x,Km=rg[0].y,Xg=rg[1];Nh!==wj&&(Qp=J.computeAngle(Nh,Xg),Uf.wg=Qp);Uf.text=rg[2];Hk(Uf,Infinity,Infinity);var Oh=Uf.Ia,Oj=Uf.Fa,Pj=Oj.width,Qj=Oj.height,Yg=D.hh();Yg.reset();Yg.translate(-Oh.x,-Oh.y);Yg.scale(Uf.scale,Uf.scale);Yg.rotate(Nh===wj?Uf.angle:Xg,Pj/2,Qj/2);Nh!==Zp&&Nh!==
$p||Yg.rotate(90,Pj/2,Qj/2);Nh!==aq&&Nh!==bq||Yg.rotate(-90,Pj/2,Qj/2);Nh===cq&&(45<Xg&&135>Xg||225<Xg&&315>Xg)&&Yg.rotate(-Xg,Pj/2,Qj/2);var hu=D.vg(0,0,Pj,Qj),dl=D.O();dl.zo(hu,Pp);Yg.vb(dl);var Lw=-dl.x,Mw=-dl.y,Zg=D.O();Zg.assign(Jw);isNaN(Zg.x)&&(Zg.x=Pj/2+3);isNaN(Zg.y)&&(Zg.y=-(Qj/2+3));Zg.rotate(Xg);var Jm=Jm+(Zg.x+Lw),Km=Km+(Zg.y+Mw),Rp=new C(Jm,Km,Oh.width,Oh.height),Nw=new C(Oh.x,Oh.y,Oh.width,Oh.height),Ow=new C(Oj.x,Oj.y,Oj.width,Oj.height),iu=new dq;iu.lq(Uf.sf);rg.push(Qp);rg.push(Uf.ze);
rg.push(iu);rg.push(Rp);rg.push(Nw);rg.push(Ow);0===Lm?Fi=Rp.copy():Fi.lh(Rp);D.A(Zg);D.A(dl);D.Hb(hu);D.lf(Yg)}this.Zm.push(Fi);Ub(Iw,Fi.x,Fi.y,Fi.width,Fi.height)}km(Di,!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,Mm=this.padding,Pw=Mm.top+Mm.bottom,rf=rf+(Mm.left+Mm.right),sf=sf+Pw;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.Xc,rf,sf);Lo(this,0,0,rf,sf)};x.prototype.findMainElement=x.prototype.Ld=function(){if(null===this.cm){var a=this.ya.o,b=a.length;if(0===b)return null;for(var c=0;c<b;c++){var d=a[c];if(!0===d.We)return this.cm=d}this.cm=a[0]}return this.cm};function Tp(a){return null!==a.$?a.$.Cf:null}
x.prototype.Fj=function(a,b,c,d){var e=this.Bj,g=this.ya.o,h=D.vg(0,0,0,0);if(0===g.length){var k=this.Y;k.x=a;k.y=b;k.width=c;k.height=d}else{if(!this.Ea.F()){var l=Oo(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=ak);switch(l){case ak:if(n>c||p>d)this.K(),Hk(this,n>c?c:n,p>d?d:p);break;case Xe:this.K(!0);Hk(this,c+r,d+s,0,0);break;case zo:this.K(!0);Hk(this,c+r,p+s,0,0);break;case yo:this.K(!0),Hk(this,n+r,d+s,0,0)}}k=this.Y;k.x=a;k.y=b;
k.width=c;k.height=d;var t=this.da.ac;switch(t){case "Position":for(var u=g.length,z=e.x-this.padding.left,w=e.y-this.padding.top,y=0;y<u;y++){var B=g[y],P=B.Ia,G=B.margin,Q=B.position.x,Y=B.position.y;h.x=isNaN(Q)?-z:Q-z;h.y=isNaN(Y)?-w:Y-w;if(B instanceof A){var U=B;if(U.gG){var ea=U.pb/2;h.x-=ea;h.y-=ea}}h.x+=G.left;h.y+=G.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.lG,hb=La?e.height:this.padding.top,
Aa=0;Aa<la;Aa++){var W=Da,xb=g[Aa];if(xb.visible){var Ob=xb.Ia,Sa=xb.margin,Qc=Sa.left+Sa.right,Ra=Da+this.padding.right,ig=Ob.width,jg=Oo(xb,!1);if(isNaN(xb.Ea.width)&&jg===Xe||jg===zo)ig=Math.max(e.width-Qc-Ra,0);var vd=ig+Qc+Ra,wd=xb.alignment;wd.md()&&(wd=this.um);wd.$c()||(wd=mc);La&&(hb-=Ob.height+Sa.bottom+Sa.top);xb.rc(W+wd.offsetX+Sa.left+(e.width*wd.x-vd*wd.x),hb+wd.offsetY+Sa.top,ig,Ob.height);La||(hb+=Ob.height+Sa.bottom+Sa.top)}}break;case "Horizontal":for(var Rc=g.length,vh=this.padding.top,
$e=this.lG,ib=$e?e.width:this.padding.left,ub=0;ub<Rc;ub++){var sa=vh,oa=g[ub];if(oa.visible){var ab=oa.Ia,Oa=oa.margin,pb=Oa.top+Oa.bottom,Nd=vh+this.padding.bottom,Jf=ab.height,ue=Oo(oa,!1);if(isNaN(oa.Ea.height)&&ue===Xe||ue===yo)Jf=Math.max(e.height-pb-Nd,0);var de=Jf+pb+Nd,jd=oa.alignment;jd.md()&&(jd=this.um);jd.$c()||(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-de*jd.y),ab.width,Jf);$e||(ib+=ab.width+Oa.left+Oa.right)}}break;case "Spot":var wh=
g.length,Kf=this.Ld(),Jg=Kf.Ia,Gb=Jg.width,nc=Jg.height,xd=this.padding,xh=xd.left,qb=xd.top;h.x=xh-e.x;h.y=qb-e.y;Kf.rc(h.x,h.y,Gb,nc);for(var Pa=0;Pa<wh;Pa++){var Pb=g[Pa];if(Pb!==Kf){var Lf=Pb.Ia,Kg=Lf.width,yh=Lf.height,jb=Pb.alignment;jb.md()&&(jb=this.um);jb.$c()||(jb=mc);var yc=Pb.Ih;yc.md()&&(yc=mc);var Zb=null;Pb instanceof x&&""!==Pb.fk&&(Zb=Pb.Md(Pb.fk),Zb===Pb&&(Zb=null));if(null!==Zb){for(var ve=Zb.Fa,zc=D.Db(yc.x*ve.width+yc.offsetX,yc.y*ve.height+yc.offsetY);Zb!==Pb;)Zb.transform.vb(zc),
Zb=Zb.Q;h.x=jb.x*Gb+jb.offsetX-zc.x;h.y=jb.y*nc+jb.offsetY-zc.y;D.A(zc)}else h.x=jb.x*Gb+jb.offsetX-(yc.x*Kg-yc.offsetX),h.y=jb.y*nc+jb.offsetY-(yc.y*yh-yc.offsetY);h.x-=e.x;h.y-=e.y;Pb.visible&&Pb.rc(xh+h.x,qb+h.y,Kg,yh)}}break;case "Auto":var Ac=g.length,vb=this.Ld(),oc=vb.Ia,yb=D.Ff();yb.n(0,0,1,1);var Fc=vb.margin,eb=Fc.left,Ta=Fc.top,Lb=this.padding,yd=Lb.left,kg=Lb.top;h.x=eb;h.y=Ta;h.width=oc.width;h.height=oc.height;vb.rc(yd+h.x,kg+h.y,h.width,h.height);var af=Up(vb),bf=Vp(vb),zj=0+af.y*oc.height+
af.offsetY,Qb=0+bf.x*oc.width+bf.offsetX,pc=0+bf.y*oc.height+bf.offsetY;yb.x=0+af.x*oc.width+af.offsetX;yb.y=zj;Ub(yb,Qb,pc,0,0);yb.x+=eb+yd;yb.y+=Ta+kg;for(var ec=0;ec<Ac;ec++){var kd=g[ec];if(kd!==vb){var nb=kd.Ia,Fc=kd.margin,Rb=Math.max(nb.width+Fc.right+Fc.left,0),we=Math.max(nb.height+Fc.top+Fc.bottom,0),zb=kd.alignment;zb.md()&&(zb=this.um);zb.$c()||(zb=mc);h.x=yb.width*zb.x+zb.offsetX-Rb*zb.x+Fc.left+yb.x;h.y=yb.height*zb.y+zb.offsetY-we*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.Hb(yb);break;case "Table":for(var ee=g.length,zh=this.padding,Ah=zh.left,Lg=zh.top,ld=this.Ct,Od=0,fc=0,Ab=ld.length,zd=0,ob=0;ob<Ab;ob++)ld[ob]&&(zd=Math.max(zd,ld[ob].length));for(var gc=Math.min(this.Aj,Ab-1);gc!==Ab&&(void 0===this.kd[gc]||0===this.kd[gc].Ya);)gc++;for(var gc=Math.min(gc,Ab-1),li=-this.kd[gc].jb,ad=
Math.min(this.kj,zd-1);ad!==zd&&(void 0===this.ed[ad]||0===this.ed[ad].Ya);)ad++;for(var ad=Math.min(ad,zd-1),Hb=-this.ed[ad].jb,xe=D.Om(),ob=0;ob<Ab;ob++)if(ld[ob]){var zd=ld[ob].length,cf=this.re(ob),fc=cf.jb+li+Lg;0!==cf.Ya&&(fc+=cf.jF());for(var bd=0;bd<zd;bd++)if(ld[ob][bd]){var Mf=this.qe(bd),Od=Mf.jb+Hb+Ah;0!==Mf.Ya&&(Od+=Mf.jF());for(var Nf=ld[ob][bd],Bh=Nf.length,Lk=0;Lk<Bh;Lk++){var Bb=Nf[Lk],fe=Bb.Ia,md=Bb instanceof x?Bb:null;if(null===md||md.type!==Po&&md.type!==Qo){xe.n(0,0);for(var Oe=
1;Oe<Bb.rowSpan&&!(ob+Oe>=this.Xq);Oe++){var mi=this.re(ob+Oe);xe.height+=mi.total}for(Oe=1;Oe<Bb.lI&&!(bd+Oe>=this.kq);Oe++){var ni=this.qe(bd+Oe);xe.width+=ni.total}var Aj=Mf.Ya+xe.width,Bj=cf.Ya+xe.height;h.x=Od;h.y=fc;h.width=Aj;h.height=Bj;var Ib=Od,Ch=fc,Dh=Aj,ka=Bj;Od+Aj>e.width&&(Dh=Math.max(e.width-Od,0));fc+Bj>e.height&&(ka=Math.max(e.height-fc,0));var ba=Bb.alignment,hc=0,lg=0,oi=0,Jb=0;if(ba.md()){ba=this.um;ba.$c()||(ba=mc);var hc=ba.x,lg=ba.y,oi=ba.offsetX,Jb=ba.offsetY,pi=Mf.alignment,
Wb=cf.alignment;pi.$c()&&(hc=pi.x,oi=pi.offsetX);Wb.$c()&&(lg=Wb.y,Jb=Wb.offsetY)}else hc=ba.x,lg=ba.y,oi=ba.offsetX,Jb=ba.offsetY;if(isNaN(hc)||isNaN(lg))lg=hc=.5,Jb=oi=0;var df=fe.width,Pe=fe.height,ef=Bb.margin,ye=ef.left+ef.right,ze=ef.top+ef.bottom,cd=bp(Bb,cf,Mf,!1);!isNaN(Bb.Ea.width)||cd!==Xe&&cd!==zo||(df=Math.max(Aj-ye,0));!isNaN(Bb.Ea.height)||cd!==Xe&&cd!==yo||(Pe=Math.max(Bj-ze,0));var Pd=Bb.pf,Eh=Bb.$g,df=Math.min(Pd.width,df),Pe=Math.min(Pd.height,Pe),df=Math.max(Eh.width,df),Pe=Math.max(Eh.height,
Pe),$=Pe+ze;h.x+=h.width*hc-(df+ye)*hc+oi+ef.left;h.y+=h.height*lg-$*lg+Jb+ef.top;Bb.visible&&(Vb(Ib,Ch,Dh,ka,h.x,h.y,fe.width,fe.height)?Bb.rc(h.x,h.y,df,Pe):Bb.rc(h.x,h.y,df,Pe,new C(Ib,Ch,Dh,ka)))}else{Bb.gj();Bb.dc.Xa();var nd=Bb.dc,mg=D.vg(nd.x,nd.y,nd.width,nd.height);nd.x=md.type===Po?Ah:Od;nd.y=md.type===Qo?Lg:fc;nd.width=fe.width;nd.height=fe.height;Bb.dc.freeze();Ro(Bb,!1);if(!Db(mg,nd)){var qi=Bb.$;null!==qi&&(qi.hl(),Bb.dt(qi))}D.Hb(mg)}}}}D.bl(xe);for(ob=0;ob<ee;ob++)Bb=g[ob],md=Bb instanceof
x?Bb:null,null===md||md.type!==Po&&md.type!==Qo||(nd=Bb.dc,Bb.Xc.Xa(),Bb.Xc.n(0,0,nd.width,nd.height),Bb.Xc.freeze());break;case "Viewbox":var Fh=g[0],qc=Fh.Ia,Gh=Fh.margin,rb=Gh.top+Gh.bottom,sb=Math.max(qc.width+(Gh.right+Gh.left),0),pm=Math.max(qc.height+rb,0),ff=Fh.alignment;ff.md()&&(ff=this.um);ff.$c()||(ff=mc);h.x=e.width*ff.x-sb*ff.x+ff.offsetX;h.y=e.height*ff.y-pm*ff.y+ff.offsetY;h.width=qc.width;h.height=qc.height;Fh.rc(h.x,h.y,h.width,h.height);break;case "Link":var Mk=g.length;if(this instanceof
ca||this instanceof J){var ri=null;this instanceof J&&(ri=this);this instanceof ca&&(ri=this.hf);var Bc=ri,Of=this instanceof ca?null:Bc.path;if(null!==this.ph){var ng=this.ph.o,Sb=0;if(null!==Of&&Sb<this.ph.count){var gf=ng[Sb];Sb++;Of.rc(gf.x-this.Bj.x,gf.y-this.Bj.y,gf.width,gf.height)}for(var Nk=0;Nk<Mk;Nk++){var qm=g[Nk];qm!==Of&&Sb<this.ph.count&&(gf=ng[Sb],Sb++,qm.rc(gf.x-this.Bj.x,gf.y-this.Bj.y,gf.width,gf.height))}}var Pf=Bc.points,hf=Pf.count;if(2<=hf&&this instanceof J)for(var jf=this.Bf;jf.next();){var rc=
jf.value,og=hf,Gc=Pf,Fb=rc.Xe,si=rc.$B,Mg=rc.Ih,Cj=rc.Yq,vp=rc.aC,Ng=0,Qf=0,Og=0;if(Fb<-og||Fb>=og){var Pg=this.xG,tb=this.wG;Cj!==wj&&(Og=this.computeAngle(rc,Cj,tb),rc.angle=Og);Ng=Pg.x;Qf=Pg.y}else{var $b=void 0,Hc=void 0;if(0<=Fb)$b=Gc.o[Fb],Hc=Fb<og-1?Gc.o[Fb+1]:$b;else var kf=og+Fb,$b=Gc.o[kf],Hc=0<kf?Gc.o[kf-1]:$b;if($b.Zc(Hc)){var Qd=void 0,Ad=void 0;0<=Fb?(Qd=0<Fb?Gc.o[Fb-1]:$b,Ad=Fb<og-2?Gc.o[Fb+2]:Hc):(Qd=kf<og-1?Gc.o[kf+1]:$b,Ad=1<kf?Gc.o[kf-2]:Hc);var lf=Qd.Lf($b),fb=Hc.Lf(Ad),tb=lf>
fb+10?0<=Fb?Qd.Yb($b):$b.Yb(Qd):fb>lf+10?0<=Fb?Hc.Yb(Ad):Ad.Yb(Hc):0<=Fb?Qd.Yb(Ad):Ad.Yb(Qd)}else tb=0<=Fb?$b.Yb(Hc):Hc.Yb($b);Cj!==wj&&(Og=this.computeAngle(rc,Cj,tb),rc.angle=Og);Ng=$b.x+(Hc.x-$b.x)*si;Qf=$b.y+(Hc.y-$b.y)*si}if(Mg.P(dc))rc.location=new N(Ng,Qf);else{Mg.fe()&&(Mg=mc);var mf=D.hh();mf.reset();mf.scale(rc.scale,rc.scale);mf.rotate(rc.angle,0,0);var od=rc.Fa,Qg=D.vg(0,0,od.width,od.height),nf=D.O();nf.zo(Qg,Mg);mf.vb(nf);var Ic=-nf.x,Rf=-nf.y,Qe=vp.copy();isNaN(Qe.x)&&(Qe.x=0<=Fb?nf.x+
3:-(nf.x+3));isNaN(Qe.y)&&(Qe.y=-(nf.y+3));Qe.rotate(tb);Ng+=Qe.x;Qf+=Qe.y;mf.uH(Qg);var Ic=Ic+Qg.x,Rf=Rf+Qg.y,Rg=D.Db(Ng+Ic,Qf+Rf);rc.move(Rg);D.A(Rg);D.A(nf);D.Hb(Qg);D.lf(mf)}}this.$u(!1)}break;case "Grid":break;case "Graduated":if(null!==this.Zm){var Sg=this.Ld(),Dj=this.an,Ok=this.Zm,Ae=0,dd=Ok[Ae];Ae++;Sg.rc(dd.x-e.x,dd.y-e.y,dd.width,dd.height);for(var Pk=g.length,Hh=0;Hh<Pk;Hh++){var pd=g[Hh],Ej=Dj[Hh];pd.visible&&pd!==Sg&&0!==Ej.length&&(dd=Ok[Ae],Ae++,pd.rc(dd.x-e.x,dd.y-e.y,dd.width,dd.height))}this.Zm=
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: "+t)}D.Hb(h)}};x.prototype.Vk=function(a){var b=this.Fa,c=Tp(this);if(Vb(0,0,b.width,b.height,a.x,a.y)){for(var b=this.ya.o,d=b.length,e=D.Db(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.Pb&&null===this.nc?!1:!0}return!1};
x.prototype.$x=function(a){if(this.Po===a)return this;for(var b=this.ya.o,c=b.length,d=0;d<c;d++){var e=b[d].$x(a);if(null!==e)return e}return null};function ip(a,b,c){c(a,b);if(b instanceof x){b=b.ya.o;for(var d=b.length,e=0;e<d;e++)ip(a,b[e],c)}}function Wm(a,b){eq(a,a,b)}function eq(a,b,c){c(b);b=b.ya.o;for(var d=b.length,e=0;e<d;e++){var g=b[e];g instanceof x&&eq(a,g,c)}}x.prototype.walkVisualTree=x.prototype.LK=function(a){fq(this,this,a)};
function fq(a,b,c){c(b);if(b instanceof x){b=b.ya.o;for(var d=b.length,e=0;e<d;e++)fq(a,b[e],c)}}x.prototype.findInVisualTree=x.prototype.wu=function(a){return gq(this,this,a)};function gq(a,b,c){if(c(b))return b;if(b instanceof x){b=b.ya.o;for(var d=b.length,e=0;e<d;e++){var g=gq(a,b[e],c);if(null!==g)return g}}return null}
x.prototype.findObject=x.prototype.Md=function(a){if(this.name===a)return this;for(var b=this.ya.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.ij&&null===e.Ig){if(e=e.Md(a),null!==e)return e}else if(un(e)&&(e=e.ya.first(),null!==e&&(e=e.Md(a),null!==e)))return e}return null};
function hq(a){a=a.ya.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,hq(e));else if(e instanceof A){a:{if(null!==!e.bg)switch(e.ep){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.En*e.Mj()}c=Math.max(c,e)}}return c}f=x.prototype;f.kh=function(){return!(this.type===Po||this.type===Qo)};
f.Je=function(a,b,c){if(!1===this.tg)return null;void 0===b&&(b=null);void 0===c&&(c=null);if(Nm(this))return null;var d=this.Fa,e=1/this.Mj(),g=this.kh(),h=g?a:kb(D.Db(a.x,a.y),this.transform),k=this.g,l=10,m=5;null!==k&&(l=k.Hu("extraTouchArea"),m=l/2);if(Vb(-(m*e),-(m*e),d.width+l*e,d.height+l*e,h.x,h.y)){if(!this.fo){var e=this.ya.o,n=e.length,k=D.O(),m=(l=this.Cq)?this.Ld():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=Tp(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.mm)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.xu=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.Fa,g=this.kh(),h=g?a:kb(D.Db(a.x,a.y),this.transform),k=this.type===Po||this.type===Qo,e=Vb(0,0,e.width,e.height,h.x,h.y);if(k||e){if(!this.fo){for(var k=this.ya.o,l=k.length,m=D.O(),n=Tp(this);l--;){var p=k[l];if(p.visible||p===n){p.kh()?kb(m.set(a),p.transform):m.set(a);var q=p,p=p instanceof x?p:null;(null!==p?p.xu(m,b,c,d):q.Pa(m))&&!1!==q.tg&&(null!==
b&&(q=b(q)),null===q||null!==c&&!c(q)||d.add(q))}}D.A(m)}g||D.A(h);return e&&(null!==this.background||null!==this.mm)}g||D.A(h);return!1};
f.$k=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.Pn(a,h))return iq(this,b,c,e),void 0===g&&D.lf(h),!0;if(this.kg(a,h)){if(!this.fo)for(var k=Tp(this),l=this.ya.o,m=l.length;m--;){var n=l[m];if(n.visible||n===k){var p=n.Y,q=this.Fa;if(!(p.x>q.width||p.y>q.height||0>p.x+p.width||0>p.y+p.height)){p=n;n=n instanceof x?n:null;q=D.hh();q.set(h);if(null!==n?n.$k(a,b,c,d,e,q):No(p,a,d,
q))null!==b&&(p=b(p)),null===p||null!==c&&!c(p)||e.add(p);D.lf(q)}}}void 0===g&&D.lf(h);return d}void 0===g&&D.lf(h);return!1};function iq(a,b,c,d){for(var e=a.ya.o,g=e.length;g--;){var h=e[g];if(h.visible){var k=h.Y,l=a.Fa;k.x>l.width||k.y>l.height||0>k.x+k.width||0>k.y+k.height||(h instanceof x&&iq(h,b,c,d),null!==b&&(h=b(h)),null===h||null!==c&&!c(h)||d.add(h))}}}
f.Wn=function(a,b,c,d,e,g){if(!1===this.tg)return!1;void 0===c&&(c=null);void 0===d&&(d=null);var h=this.Fa,k=this.kh(),l=k?a:kb(D.Db(a.x,a.y),this.transform),m=k?b:kb(D.Db(b.x,b.y),this.transform),n=l.Lf(m),p=0<l.x&&l.x<h.width&&0<l.y&&l.y<h.height||lb(l.x,l.y,0,0,0,h.height)<=n||lb(l.x,l.y,0,h.height,h.width,h.height)<=n||lb(l.x,l.y,h.width,h.height,h.width,0)<=n||lb(l.x,l.y,h.width,0,0,0)<=n,h=l.gg(0,0)<=n&&l.gg(0,h.height)<=n&&l.gg(h.width,0)<=n&&l.gg(h.width,h.height)<=n;k||(D.A(l),D.A(m));if(p){if(!this.fo){for(var l=
D.O(),m=D.O(),n=Tp(this),q=this.ya.o,r=q.length;r--;){var s=q[r];if(s.visible||s===n){var t=s.Y,u=this.Fa;if(!k||!(t.x>u.width||t.y>u.height||0>t.x+t.width||0>t.y+t.height))if(s.kh()?(t=s.transform,kb(l.set(a),t),kb(m.set(b),t)):(l.set(a),m.set(b)),t=s,s=s instanceof x?s:null,null!==s?s.Wn(l,m,c,d,e,g):t.IF(l,m,e))null!==c&&(t=c(t)),null===t||null!==d&&!d(t)||g.add(t)}}D.A(l);D.A(m)}return e?p:h}return!1};
function Up(a){var b=null;a instanceof A&&(b=a.C,b===Vc&&(b=null),a=a.wf,null!==a&&null===b&&(b=a.C));null===b&&(b=ic);return b}function Vp(a){var b=null;a instanceof A&&(b=a.D,b===Vc&&(b=null),a=a.wf,null!==a&&null===b&&(b=a.D));null===b&&(b=vc);return b}x.prototype.add=x.prototype.add=function(a){D.l(a,O,x,"add:element");this.ce(this.ya.count,a)};x.prototype.elt=x.prototype.fa=function(a){return this.ya.fa(a)};
x.prototype.insertAt=x.prototype.ce=function(a,b){b instanceof F&&D.k("Cannot add a Part to a Panel: "+b+"; use a Panel instead");if(this===b||this.Dm(b))this===b&&D.k("Cannot make a Panel contain itself: "+this.toString()),D.k("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+b.toString());var c=b.Q;null!==c&&c!==this&&D.k("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+b.toString()+", already contained by "+c.toString()+", cannot be shared by this Panel: "+
this.toString());this.da!==Sl||b instanceof A||D.k("Can only add Shapes to a Grid Panel, not: "+b);this.da!==rp||b instanceof A||b instanceof na||D.k("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+b);b.Jm(this);b.tn=null;if(null!==this.kl){var d=b.data;null!==d&&"object"===typeof d&&(null===this.Hg&&(this.Hg=new ma(Object,x)),this.Hg.add(d,b))}var e=this.ya,d=-1;if(c===this){for(var g=-1,h=this.ya.o,k=h.length,l=0;l<k;l++)if(h[l]===b){g=l;break}if(-1!==g){if(g===a||g+1>=e.count&&
a>=e.count)return;e.qd(g);d=g}else D.k("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>a||a>e.count)a=e.count;e.ce(a,b);if(0===a||b.We)this.cm=null;zm(this)||this.K();b.K(!1);null!==b.Rd?this.gl=!0:b instanceof x&&!0===b.gl&&(this.gl=!0);this.sk=null;c=this.$;null!==c&&(c.Yl=null,c.Ck=NaN,this.gl&&c instanceof H&&(c.gl=!0),c.gl&&c instanceof H&&(c.Re=null),e=this.g,null!==e&&e.na.ub||(-1!==d&&c.pd(hg,"elements",this,b,null,d,null),c.pd(gg,"elements",this,null,
b,null,a),this.Ou()||jq(this,b,!1)))};D.defineProperty(x,{gl:null},function(){return 0!==(this.R&8388608)},function(a){0!==(this.R&8388608)!==a&&(this.R^=8388608)});function kq(a,b){a.R=b?a.R|16777216:a.R&-16777217}x.prototype.remove=x.prototype.remove=function(a){D.l(a,O,x,"remove:element");for(var b=this.ya.o,c=b.length,d=-1,e=0;e<c;e++)if(b[e]===a){d=e;break}-1!==d&&this.zf(d,!0)};x.prototype.removeAt=x.prototype.qd=function(a){v&&D.p(a,x,"removeAt:idx");0<=a&&this.zf(a,!0)};
x.prototype.zf=function(a,b){var c=this.ya,d=c.fa(a);d.tn=null;d.Jm(null);if(null!==this.Hg){var e=d.data;"object"===typeof e&&this.Hg.remove(e)}c.qd(a);km(this,!1);this.K();this.cm===d&&(this.cm=null);this.sk=null;var g=this.$;null!==g&&(g.Yl=null,g.Ck=NaN,g.de(),g instanceof H&&(d instanceof x?ip(d,d,function(a,c){fp(g,c,b)}):fp(g,d,b)),c=this.g,null!==c&&c.na.ub||g.pd(hg,"elements",this,d,null,a,null))};D.w(x,{Xq:"rowCount"},function(){return void 0===this.kd?0:this.kd.length});
x.prototype.getRowDefinition=x.prototype.re=function(a){v&&D.p(a,x,"getRowDefinition:idx");0>a&&D.va(a,">= 0",x,"getRowDefinition:idx");a=Math.round(a);var b=this.kd;if(void 0===b[a]){var c=new ih;c.Jm(this);c.Ke=!0;c.index=a;b[a]=c}return b[a]};x.prototype.removeRowDefinition=x.prototype.LG=function(a){v&&D.p(a,x,"removeRowDefinition:idx");0>a&&D.va(a,">= 0",x,"removeRowDefinition:idx");a=Math.round(a);var b=this.kd;this.pd(hg,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.K()};
D.w(x,{kq:"columnCount"},function(){return void 0===this.ed?0:this.ed.length});x.prototype.getColumnDefinition=x.prototype.qe=function(a){v&&D.p(a,x,"getColumnDefinition:idx");0>a&&D.va(a,">= 0",x,"getColumnDefinition:idx");a=Math.round(a);var b=this.ed;if(void 0===b[a]){var c=new ih;c.Jm(this);c.Ke=!1;c.index=a;b[a]=c}return b[a]};
x.prototype.removeColumnDefinition=x.prototype.JG=function(a){v&&D.p(a,x,"removeColumnDefinition:idx");0>a&&D.va(a,">= 0",x,"removeColumnDefinition:idx");a=Math.round(a);var b=this.ed;this.pd(hg,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.K()};
D.defineProperty(x,{mK:"rowSizing"},function(){return void 0===this.wn?qp:this.wn},function(a){if(void 0!==this.wn){var b=this.wn;b!==a&&(a!==qp&&a!==Xp&&D.k("Panel.rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.wn=a,this.K(),this.i("rowSizing",b,a))}});
D.defineProperty(x,{kI:"columnSizing"},function(){return void 0===this.Wm?qp:this.Wm},function(a){if(void 0!==this.Wm){var b=this.Wm;b!==a&&(a!==qp&&a!==Xp&&D.k("Panel.columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.Wm=a,this.K(),this.i("columnSizing",b,a))}});
D.defineProperty(x,{rH:"topIndex"},function(){return void 0===this.Aj?0:this.Aj},function(a){if(void 0!==this.Aj){var b=this.Aj;b!==a&&((!isFinite(a)||0>a)&&D.k("Panel.topIndex must be greater than zero and a real number, not: "+a),this.Aj=a,this.K(),this.i("topIndex",b,a))}});
D.defineProperty(x,{sG:"leftIndex"},function(){return void 0===this.kj?0:this.kj},function(a){if(void 0!==this.kj){var b=this.kj;b!==a&&((!isFinite(a)||0>a)&&D.k("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.kj=a,this.K(),this.i("leftIndex",b,a))}});x.prototype.findRowForLocalY=function(a){if(0>a||this.type!==da)return-1;for(var b=0,c=this.kd,d=c.length,e=this.Aj;e<d;e++){var g=c[e];if(void 0!==g&&(b+=g.total,a<b))break}return e};
x.prototype.findColumnForLocalX=function(a){if(0>a||this.type!==da)return-1;for(var b=0,c=this.ed,d=c.length,e=this.kj;e<d;e++){var g=c[e];if(void 0!==g&&(b+=g.total,a<b))break}return e};x.prototype.graduatedPointForValue=function(a,b){void 0===b&&(b=new N(NaN,NaN));if(this.type!==rp)return b.n(NaN,NaN),b;a=Math.min(Math.max(a,this.fl),this.lB);var c=(a-this.fl)/this.Iu,d=this.Ld();d.wf.YI(c,b);return d.transform.vb(b)};
x.prototype.graduatedValueForPoint=function(a){if(this.type!==rp)return NaN;var b=this.Ld(),c=b.wf;b.transform.Ph(a);return c.UI(a)*this.Iu+this.fl};
D.defineProperty(x,{data:"data"},function(){return this.Ud},function(a){var b=this.Ud;if(b!==a){var c=this instanceof F&&!(this instanceof ca);c&&D.h(a,"object",x,"data");Sh(this);this.Ud=a;var d=this.g;null!==d&&(c?this instanceof J?(null!==b&&d.jk.remove(b),null!==a&&d.jk.add(a,this)):this instanceof F&&(null!==b&&d.Zi.remove(b),null!==a&&d.Zi.add(a,this)):(c=this.Q,null!==c&&null!==c.Hg&&(null!==b&&c.Hg.remove(b),null!==a&&c.Hg.add(a,this))));this.i("data",b,a);null!==d&&d.na.ub||null!==a&&this.Rb()}});
D.defineProperty(x,{Uu:"itemIndex"},function(){return this.Bs},function(a){var b=this.Bs;b!==a&&(this.Bs=a,this.i("itemIndex",b,a))});function jp(a){a=a.Dl;return null!==a&&a.J}
function Sh(a){var b=a.Dl;if(null===b)null!==a.data&&D.k("Template cannot have .data be non-null: "+a),a.Dl=b=new K(oh);else if(b.J)return;var c=new K(O);kq(a,!1);ip(a,a,function(a,d){var e=d.Ic;if(null!==e)for(ep(d,!1),e=e.j;e.next();){var g=e.value;g.mode===qh&&ep(d,!0);var h=g.dr;null!==h&&("/"===h&&kq(a,!0),h=rh(g,a,d),null!==h&&(c.add(h),null===h.Qp&&(h.Qp=new K(oh)),h.Qp.add(g)));b.add(g)}if(d instanceof x&&d.type===da){if(0<d.kd.length)for(e=d.kd,g=e.length,h=0;h<g;h++){var k=e[h];if(void 0!==
k&&null!==k.Ic)for(var l=k.Ic.j;l.next();){var u=l.value;u.Sg=k;u.Vt=2;u.Yp=k.index;b.add(u)}}if(0<d.ed.length)for(e=d.ed,g=e.length,h=0;h<g;h++)if(k=e[h],void 0!==k&&null!==k.Ic)for(l=k.Ic.j;l.next();)u=l.value,u.Sg=k,u.Vt=1,u.Yp=k.index,b.add(u)}});for(var d=c.j;d.next();){var e=d.value;if(null!==e.Qp){ep(e,!0);for(var g=e.Qp.j;g.next();){var h=g.value;null===e.Ic&&(e.Ic=new K(oh));e.Ic.add(h)}}e.Qp=null}for(d=b.j;d.next();)if(e=d.value,g=e.Sg,null!==g){e.Sg=null;var k=e.wv,l=k.indexOf(".");0<l&&
g instanceof x&&(h=k.substring(0,l),k=k.substr(l+1),l=g.Md(h),null!==l?(g=l,e.wv=k):D.trace('Warning: unable to find GraphObject named "'+h+'" for Binding: '+e.toString()));g instanceof ih?(e.Nm=D.Nd(g.Q),g.Q.Po=e.Nm):(e.Nm=D.Nd(g),g.Po=e.Nm)}b.freeze();a instanceof F&&(a.te()&&a.Ue(),v&&!lq&&ip(a,a,function(a,c){if(c instanceof x&&(c.type===Pl||c.type===Yj||c.type===rp)&&1>=c.elements.count&&!(c instanceof F)){if(1===c.elements.count){var d=null!==c.kl;if(!d)for(var e=b.j;e.next();)if("itemArray"===
e.value.wv){d=!0;break}}d||(D.trace("Auto, Spot, or Graduated Panel should not have zero or one elements: "+c.toString()+" in "+a.toString()),lq=!0)}}))}var lq=!1;x.prototype.copyTemplate=function(){var a=this.copy();a.LK(function(a){a instanceof x&&(a.Dl=null,a.Ud=null);var c=a.Ic;null!==c&&(a.Ic=null,c.each(function(c){a.bind(c.copy())}))});return a};
x.prototype.updateTargetBindings=x.prototype.Rb=function(a){var b=this.Dl;if(null!==b)for(void 0===a&&(a=""),b=b.j;b.next();){var c=b.value,d=c.gH;if(""===a||""===d||d===a)if(d=c.wv,null!==c.qI||""!==d){var d=this.data,e=c.dr;if(null!==e)d=""===e?this:"/"===e?this:"."===e?this:".."===e?this:this.Md(e);else{var g=this.g;null!==g&&c.py&&(d=g.ea.ll)}if(null===d)v&&D.trace("Binding error: missing GraphObject named "+e+" in "+this.toString());else{var g=this,h=c.Nm;if(-1!==h){if(g=this.$x(h),null===g)continue}else null!==
c.Sg&&(g=c.Sg);"/"===e?d=g.$:"."===e?d=g:".."===e&&(d=g.Q);e=c.Vt;if(0!==e){if(!(g instanceof x))continue;h=g;1===e?g=h.qe(c.Yp):2===e&&(g=h.re(c.Yp))}void 0!==g&&c.xH(g,d)}}}};
D.defineProperty(x,{kl:"itemArray"},function(){return this.ij},function(a){var b=this.ij;if(b!==a){v&&null!==a&&!D.isArray(a)&&D.k("Panel.itemArray must be an Array-like object or null, not: "+a);var c=this.g;null!==c&&null!==b&&bn(c,this);this.ij=a;null!==c&&null!==a&&Ym(c,this);this.i("itemArray",b,a);null!==c&&c.na.ub||this.UB()}});function un(a){return a.type===Yj||a.type===Pl||a.type===tj||a.type===da&&0<a.ya.length&&(a=a.ya.fa(0),a.We&&a instanceof x&&(a.type===Po||a.type===Qo))?!0:!1}
x.prototype.rebuildItemElements=x.prototype.UB=function(){var a=0;for(un(this)&&(a=1);this.ya.length>a;)this.zf(this.ya.length-1,!1);a=this.kl;if(null!==a)for(var b=D.fb(a),c=0;c<b;c++)tn(this,D.La(a,c),c)};x.prototype.findItemPanelForData=x.prototype.NI=function(a){if(void 0===a||null===a||null===this.Hg)return null;D.h(a,"object",x,"findItemPanelForData");return this.Hg.oa(a)};
function tn(a,b,c){if(!(void 0===b||null===b||0>c)){var d;d=mq(a,b);var e=a.wJ,g=null;null!==e&&(g=e.oa(d));null===g&&(nq||(nq=!0,D.trace('No item template Panel found for category "'+d+'" on '+a),D.trace(" Using default item template."),d=new x,e=new na,e.bind(new oh("text","",ha)),d.add(e),oq=d),g=oq);d=g;null!==d&&(Sh(d),d=d.copy(),0!==(d.R&16777216)&&(e=a.wm(),null!==e&&kq(e,!0)),"object"===typeof b&&(null===a.Hg&&(a.Hg=new ma(Object,x)),a.Hg.add(b,d)),e=c,un(a)&&e++,a.ce(e,d),d.Ud=b,vn(a,e,
c),d.Ud=null,d.data=b)}}function vn(a,b,c){for(a=a.ya;b<a.length;){var d=a.fa(b);if(d instanceof x){var e=b,g=c;d.type===Po?d.Ub=e:d.type===Qo&&(d.column=e);d.Uu=g}b++;c++}}
D.defineProperty(x,{ZL:"itemTemplate"},function(){return null===this.Ig?null:this.Ig.oa("")},function(a){if(null===this.Ig){if(null===a)return;this.Ig=new ma("string",x)}var b=this.Ig.oa("");b!==a&&(D.l(a,x,x,"itemTemplate"),(a instanceof F||a.We)&&D.k("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+a),this.Ig.add("",a),this.i("itemTemplate",b,a),a=this.g,null!==a&&a.na.ub||this.UB())});
D.defineProperty(x,{wJ:"itemTemplateMap"},function(){return this.Ig},function(a){var b=this.Ig;if(b!==a){D.l(a,ma,x,"itemTemplateMap");for(var c=a.j;c.next();){var d=c.value;(d instanceof F||d.We)&&D.k("Template in Panel.itemTemplateMap must not be a Part or be Panel.isPanelMain: "+d)}this.Ig=a;this.i("itemTemplateMap",b,a);a=this.g;null!==a&&a.na.ub||this.UB()}});
D.defineProperty(x,{oG:"itemCategoryProperty"},function(){return this.tp},function(a){var b=this.tp;b!==a&&("string"!==typeof a&&"function"!==typeof a&&D.mc(a,"string or function",x,"itemCategoryProperty"),this.tp=a,this.i("itemCategoryProperty",b,a))});
function mq(a,b){if(null===b)return"";var c=a.tp,d="";if("function"===typeof c)d=c(b);else if("string"===typeof c&&"object"===typeof b){if(""===c)return"";d=D.zb(b,c)}else return"";if(void 0===d)return"";if("string"===typeof d)return d;D.k("Panel.getCategoryForItemData found a non-string category for "+b+": "+d);return""}var nq=!1,oq=null;
D.defineProperty(x,{fo:"isAtomic"},function(){return 0!==(this.R&1048576)},function(a){var b=0!==(this.R&1048576);b!==a&&(D.h(a,"boolean",x,"isAtomic"),this.R^=1048576,this.i("isAtomic",b,a))});D.defineProperty(x,{Cq:"isClipping"},function(){return 0!==(this.R&2097152)},function(a){var b=0!==(this.R&2097152);b!==a&&(D.h(a,"boolean",x,"isClipping"),this.R^=2097152,this.K(),this.i("isClipping",b,a))});
D.defineProperty(x,{lG:"isOpposite"},function(){return 0!==(this.R&33554432)},function(a){var b=0!==(this.R&33554432);b!==a&&(D.h(a,"boolean",x,"isOpposite"),this.R^=33554432,this.K(),this.i("isOpposite",b,a))});D.defineProperty(x,{isEnabled:"isEnabled"},function(){return 0!==(this.R&4194304)},function(a){var b=0!==(this.R&4194304);if(b!==a){D.h(a,"boolean",x,"isEnabled");var c=null===this.Q||this.Q.Ou();this.R^=4194304;this.i("isEnabled",b,a);b=this.g;null!==b&&b.na.ub||c&&jq(this,this,a)}});
function jq(a,b,c){var d=b.BF;null!==d&&d(b,c);if(b instanceof x){b=b.ya.o;for(var d=b.length,e=0;e<d;e++){var g=b[e];c&&g instanceof x&&!g.isEnabled||jq(a,g,c)}}}D.defineProperty(x,{RK:"alignmentFocusName"},function(){return this.fk},function(a){var b=this.fk;b!==a&&(v&&D.h(a,"string",x,"alignmentFocusName"),this.fk=a,this.K(),this.i("alignmentFocusName",b,a))});
function ih(){D.xc(this);this.uj=null;this.ww=!0;this.Jc=0;this.uf=NaN;this.Ek=0;this.Dk=Infinity;this.we=Vc;this.jb=this.Ya=0;this.Ic=null;this.Ot=pq;this.Qg=xo;this.Jt=this.Jk=null;this.Kt=NaN;this.Pb=this.ti=null;this.Ir=!1}D.ka("RowColumnDefinition",ih);
ih.prototype.copy=function(){var a=new ih;a.ww=this.ww;a.Jc=this.Jc;a.uf=this.uf;a.Ek=this.Ek;a.Dk=this.Dk;a.we=this.we;a.Ya=this.Ya;a.jb=this.jb;a.Qg=this.Qg;a.Ot=this.Ot;a.Jk=null===this.Jk?null:this.Jk.V();a.Jt=this.Jt;a.Kt=this.Kt;a.ti=null;null!==this.ti&&(a.ti=D.qm(this.ti));a.Pb=this.Pb;a.Ir=this.Ir;a.Ic=this.Ic;return a};
ih.prototype.lq=function(a){D.l(a,ih,ih,"copyFrom:pd");a.Ke?this.height=a.height:this.width=a.width;this.Vh=a.Vh;this.ve=a.ve;this.alignment=a.alignment;this.stretch=a.stretch;this.uv=a.uv;this.Jk=null===a.Jk?null:a.Jk.V();this.Zq=a.Zq;this.$q=a.$q;this.ti=null;a.ti&&(this.ti=D.qm(a.ti));this.background=a.background;this.YA=a.YA;this.Ic=a.Ic};ih.prototype.qc=function(a){a.Se===ih?this.uv=a:D.ck(this,a)};
ih.prototype.toString=function(){return"RowColumnDefinition "+(this.Ke?"(Row ":"(Column ")+this.index+") #"+D.Nd(this)};var pq;ih.Default=pq=D.s(ih,"Default",0);var Xp;ih.None=Xp=D.s(ih,"None",1);var qp;ih.ProportionalExtra=qp=D.s(ih,"ProportionalExtra",2);ih.prototype.Jm=function(a){this.uj=a};
ih.prototype.computeEffectiveSpacingTop=ih.prototype.jF=function(){var a=0,b=this.uj,c=0,d=this.Ke;if(null!==b)for(var e=d?b.kd.length:b.ed.length,g=0;g<e;g++){var h=d?b.kd[g]:b.ed[g];if(void 0!==h){c=h.index;break}}this.index!==c&&(c=this.Zq,null===c&&null!==b&&(c=this.Ke?b.$i:b.gi),null!==c&&(a=this.$q,isNaN(a)&&(a=null!==b?this.Ke?b.ii:b.hi:0)));c=this.aH;if(null===c)if(null!==b)c=b.kk;else return a;return a+(this.Ke?c.top:c.left)};
ih.prototype.computeEffectiveSpacing=ih.prototype.kf=function(){var a=0,b=this.uj,c=0,d=this.Ke;if(null!==b)for(var e=d?b.kd.length:b.ed.length,g=0;g<e;g++){var h=d?b.kd[g]:b.ed[g];if(void 0!==h){c=h.index;break}}this.index!==c&&(c=this.Zq,null===c&&null!==b&&(c=d?b.$i:b.gi),null!==c&&(a=this.$q,isNaN(a)&&(a=null!==b?d?b.ii:b.hi:0)));d=this.aH;if(null===d)if(null!==b)d=b.kk;else return a;return a+(this.Ke?d.top+d.bottom:d.left+d.right)};
ih.prototype.vd=function(a,b,c,d,e){var g=this.uj;if(null!==g&&(g.pd(eg,a,this,b,c,d,e),null!==this.Ic&&(b=g.g,null!==b&&!b.Ye&&(g=g.wm(),null!==g&&(b=g.data,null!==b)))))for(c=this.Ic.j;c.next();)c.value.bz(this,b,a,g)};D.w(ih,{Q:"panel"},function(){return this.uj});D.defineProperty(ih,{Ke:"isRow"},function(){return this.ww},function(a){this.ww=a});D.defineProperty(ih,{index:"index"},function(){return this.Jc},function(a){this.Jc=a});
D.defineProperty(ih,{height:"height"},function(){return this.uf},function(a){var b=this.uf;b!==a&&(v&&D.h(a,"number",ih,"height"),0>a&&D.va(a,">= 0",ih,"height"),this.uf=a,this.kb=this.Ya,null!==this.Q&&this.Q.K(),this.vd("height",b,a))});D.defineProperty(ih,{width:"width"},function(){return this.uf},function(a){var b=this.uf;b!==a&&(v&&D.h(a,"number",ih,"width"),0>a&&D.va(a,">= 0",ih,"width"),this.uf=a,this.kb=this.Ya,null!==this.Q&&this.Q.K(),this.vd("width",b,a))});
D.defineProperty(ih,{Vh:"minimum"},function(){return this.Ek},function(a){var b=this.Ek;b!==a&&(v&&D.h(a,"number",ih,"minimum"),(0>a||!isFinite(a))&&D.va(a,">= 0",ih,"minimum"),this.Ek=a,this.kb=this.Ya,null!==this.Q&&this.Q.K(),this.vd("minimum",b,a))});D.defineProperty(ih,{ve:"maximum"},function(){return this.Dk},function(a){var b=this.Dk;b!==a&&(v&&D.h(a,"number",ih,"maximum"),0>a&&D.va(a,">= 0",ih,"maximum"),this.Dk=a,this.kb=this.Ya,null!==this.Q&&this.Q.K(),this.vd("maximum",b,a))});
D.defineProperty(ih,{alignment:"alignment"},function(){return this.we},function(a){var b=this.we;b.P(a)||(v&&D.l(a,R,ih,"alignment"),this.we=a.V(),null!==this.Q&&this.Q.K(),this.vd("alignment",b,a))});D.defineProperty(ih,{stretch:"stretch"},function(){return this.Qg},function(a){var b=this.Qg;b!==a&&(v&&D.Da(a,O,ih,"stretch"),this.Qg=a,null!==this.Q&&this.Q.K(),this.vd("stretch",b,a))});
D.defineProperty(ih,{aH:"separatorPadding"},function(){return this.Jk},function(a){"number"===typeof a?a=new Mb(a):null!==a&&v&&D.l(a,Mb,ih,"separatorPadding");var b=this.Jk;null!==a&&null!==b&&b.P(a)||(null!==a&&(a=a.V()),this.Jk=a,null!==this.Q&&this.Q.K(),this.vd("separatorPadding",b,a))});
D.defineProperty(ih,{Zq:"separatorStroke"},function(){return this.Jt},function(a){var b=this.Jt;b!==a&&(null===a||"string"===typeof a||a instanceof za)&&(a instanceof za&&a.freeze(),this.Jt=a,null!==this.Q&&this.Q.K(),this.vd("separatorStroke",b,a))});D.defineProperty(ih,{$q:"separatorStrokeWidth"},function(){return this.Kt},function(a){var b=this.Kt;b!==a&&(this.Kt=a,null!==this.Q&&this.Q.K(),this.vd("separatorStrokeWidth",b,a))});
D.defineProperty(ih,{rK:"separatorDashArray"},function(){return this.ti},function(a){var b=this.ti;if(b!==a){null===a||Array.isArray(a)||D.mc(a,"Array",ih,"separatorDashArray: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("separatorDashArray value "+g+" at index "+e+" must be a positive number or zero.");d+=g}if(0===d){if(null===b)return;a=null}}this.ti=a;null!==this.Q&&this.Q.ra();this.vd("separatorDashArray",b,a)}});
D.defineProperty(ih,{background:"background"},function(){return this.Pb},function(a){var b=this.Pb;b!==a&&(null===a||"string"===typeof a||a instanceof za)&&(a instanceof za&&a.freeze(),this.Pb=a,null!==this.Q&&this.Q.ra(),this.vd("background",b,a))});D.defineProperty(ih,{YA:"coversSeparators"},function(){return this.Ir},function(a){var b=this.Ir;b!==a&&(D.h(a,"boolean",ih,"coversSeparators"),this.Ir=a,null!==this.Q&&this.Q.ra(),this.vd("coversSeparators",b,a))});
D.defineProperty(ih,{uv:"sizing"},function(){return this.Ot},function(a){var b=this.Ot;b!==a&&(v&&D.Da(a,ih,ih,"sizing"),this.Ot=a,null!==this.Q&&this.Q.K(),this.vd("sizing",b,a))});function Wp(a){if(a.uv===pq){var b=a.uj;return a.Ke?b.mK:b.kI}return a.uv}D.defineProperty(ih,{kb:"actual"},function(){return this.Ya},function(a){this.Ya=isNaN(this.uf)?Math.max(Math.min(this.Dk,a),this.Ek):Math.max(Math.min(this.Dk,this.uf),this.Ek)});
D.defineProperty(ih,{total:"total"},function(){return this.Ya+this.kf()},function(a){this.Ya=isNaN(this.uf)?Math.max(Math.min(this.Dk,a),this.Ek):Math.max(Math.min(this.Dk,this.uf),this.Ek);this.Ya=Math.max(0,this.Ya-this.kf())});D.defineProperty(ih,{position:"position"},function(){return this.jb},function(a){this.jb=a});
ih.prototype.bind=ih.prototype.bind=function(a){a.Sg=this;var b=this.Q;if(null!==b){var c=b.wm();null!==c&&jp(c)&&D.k("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+a+" on "+b)}null===this.Ic&&(this.Ic=new K(oh));this.Ic.add(a)};
function A(){O.call(this);this.bg=this.Za=null;this.ep="None";this.hs=xo;this.Cc=this.Wd="black";this.Rg=1;this.Tp="butt";this.Vp="miter";this.En=10;this.Up=null;this.Jf=0;this.Bi=this.Ai=Vc;this.lt=this.kt=NaN;this.rs=!1;this.nt=null;this.hp=this.$p="None";this.Fg=1;this.Eg=0;this.Dg=1}D.Ta(A,O);D.ka("Shape",A);
A.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.Za=this.Za;a.ep=this.ep;a.hs=this.hs;a.bg=this.bg;a.Wd=this.Wd;a.Cc=this.Cc;a.Rg=this.Rg;a.Tp=this.Tp;a.Vp=this.Vp;a.En=this.En;null!==this.Up&&(a.Up=D.qm(this.Up));a.Jf=this.Jf;a.Ai=this.Ai.V();a.Bi=this.Bi.V();a.kt=this.kt;a.lt=this.lt;a.rs=this.rs;a.nt=this.nt;a.$p=this.$p;a.hp=this.hp;a.Fg=this.Fg;a.Eg=this.Eg;a.Dg=this.Dg};
A.prototype.qc=function(a){a===ak||a===ck||a===Ao||a===xo?this.iB=a:O.prototype.qc.call(this,a)};A.prototype.toString=function(){return"Shape("+("None"!==this.Ob?this.Ob:"None"!==this.er?this.er:this.gB)+")#"+D.Nd(this)};
function qq(a,b,c,d){var e=c.length;if(!(4>e)){for(var g=d.Ia,h=Math.max(1,g.width),g=g.height,k=c[0],l=c[1],m=0,n=0,p=0,q=0,r=0,s=0,t=q=0,u=D.hb(),z=2;z<e;z+=2)m=c[z],n=c[z+1],p=m-k,q=n-l,0===p&&(p=.001),r=q/p,s=Math.atan2(q,p),q=Math.sqrt(p*p+q*q),u.push([p,s,r,q]),t+=q,k=m,l=n;k=c[0];l=c[1];p=d.Ia.width;d instanceof A&&(p-=d.pb);1>p&&(p=1);for(var e=c=p,m=h/2,n=0===m?!1:!0,z=0,q=u[z],p=q[0],s=q[1],r=q[2],q=q[3],w=0;.1<=t;){0===w&&(n?(e=c,e-=m,t-=m,n=!1):e=c,0===e&&(e=1));if(e>t){D.ua(u);return}e>
q?(w=e-q,e=q):w=0;var y=Math.sqrt(e*e/(1+r*r));0>p&&(y=-y);k+=y;l+=r*y;a.translate(k,l);a.rotate(s);a.translate(-(h/2),-(g/2));0===w&&d.Zk(a,b);a.translate(h/2,g/2);a.rotate(-s);a.translate(-k,-l);t-=e;q-=e;if(0!==w){z++;if(z===u.length){D.ua(u);return}q=u[z];p=q[0];s=q[1];r=q[2];q=q[3];e=w}}D.ua(u)}}
A.prototype.Zk=function(a,b){if(null!==this.Cc||null!==this.Wd){null!==this.Wd&&Xo(this,a,this.Wd,!0,!1);null!==this.Cc&&Xo(this,a,this.Cc,!1,!1);var c=this.Rg;if(0===c){var d=this.$;d instanceof ca&&d.type===tj&&"Selection"===d.wd&&d.Cb instanceof A&&d.hf.Ld()===d.Cb&&(c=d.Cb.pb)}a.lineWidth=c;a.lineJoin=this.Vp;a.lineCap=this.Tp;a.miterLimit=this.En;var e=!1;this.$&&b.el("drawShadows")&&(e=this.$.jl);var g=!0;null!==this.Cc&&null===this.Wd&&(g=!1);var d=!1,h=!0,k=this.jH;null!==k&&(d=!0,h=a.Wx(k,
this.Jf));var l=this.Za;if(null!==l){if(l.da===Ye)a.beginPath(),d&&!h?Io(a,l.Bc,l.Nc,l.Eb,l.Mb,k,this.Jf):(a.moveTo(l.Bc,l.Nc),a.lineTo(l.Eb,l.Mb)),null!==this.Wd&&a.Xg(this.Wd),0!==c&&null!==this.Cc&&a.bk();else if(l.da===Ze){var m=l.Bc,n=l.Nc,p=l.Eb,q=l.Mb,l=Math.min(m,p),r=Math.min(n,q),m=Math.abs(p-m),n=Math.abs(q-n);null!==this.Wd&&(a.beginPath(),a.rect(l,r,m,n),a.Xg(this.Wd));if(null!==this.Cc){var s=p=0,t=0;g&&e&&(p=a.shadowOffsetX,s=a.shadowOffsetY,t=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=
0,a.shadowBlur=0);d&&!h?(h=D.hb(),h.push(l),h.push(r),h.push(l+m),h.push(r),h.push(l+m),h.push(r+n),h.push(l),h.push(r+n),h.push(l),h.push(r),a.beginPath(),rq(a,h,k,this.Jf),a.bk(),D.ua(h)):0!==c&&(a.beginPath(),a.rect(l,r,m,n),a.bk());g&&e&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=t)}}else if(l.da===tf)m=l.Bc,n=l.Nc,p=l.Eb,q=l.Mb,l=Math.abs(p-m)/2,r=Math.abs(q-n)/2,m=Math.min(m,p)+l,n=Math.min(n,q)+r,a.beginPath(),a.moveTo(m,n-r),a.bezierCurveTo(m+Id*l,n-r,m+l,n-Id*r,m+l,n),a.bezierCurveTo(m+
l,n+Id*r,m+Id*l,n+r,m,n+r),a.bezierCurveTo(m-Id*l,n+r,m-l,n+Id*r,m-l,n),a.bezierCurveTo(m-l,n-Id*r,m-Id*l,n-r,m,n-r),a.closePath(),null!==this.Wd&&a.Xg(this.Wd),d&&!h&&(h=D.hb(),se(m,n-r,m+Id*l,n-r,m+l,n-Id*r,m+l,n,.5,h),se(m+l,n,m+l,n+Id*r,m+Id*l,n+r,m,n+r,.5,h),se(m,n+r,m-Id*l,n+r,m-l,n+Id*r,m-l,n,.5,h),se(m-l,n,m-l,n-Id*r,m-Id*l,n-r,m,n-r,.5,h),a.beginPath(),rq(a,h,k,this.Jf),D.ua(h)),0!==c&&null!==this.Cc&&(g&&e?(p=a.shadowOffsetX,s=a.shadowOffsetY,t=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=
0,a.shadowBlur=0,a.bk(),a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=t):a.bk());else if(l.da===Ve){r=l.mk;n=r.length;for(q=0;q<n;q++){m=r.o[q];a.beginPath();a.moveTo(m.la,m.ja);for(var p=m.Fb.o,s=p.length,u=null,t=0;t<s;t++){var z=p[t];switch(z.da){case Df:a.moveTo(z.G,z.H);break;case vf:a.lineTo(z.G,z.H);break;case Ef:a.bezierCurveTo(z.Xd,z.gf,z.Eh,z.Og,z.Eb,z.Mb);break;case Ff:a.quadraticCurveTo(z.Xd,z.gf,z.Eb,z.Mb);break;case Gf:if(z.radiusX===z.radiusY){var w=null!==u?u.G:m.la,y=null!==u?
u.H:m.ja,u=Math.PI/180;a.arc(z.Xd,z.gf,z.radiusX,z.Ne*u,(z.Ne+z.Ef)*u,0>z.Ef,w,y)}else{u=If(z,m);w=u.length;if(0===w){a.lineTo(z.pa,z.wa);break}for(y=0;y<w;y++){var B=u[y];0===y&&a.lineTo(B[0],B[1]);a.bezierCurveTo(B[2],B[3],B[4],B[5],B[6],B[7])}}break;case Hf:y=w=0;if(null!==u&&u.type===Gf){u=If(u,m);B=u.length;if(0===B){a.lineTo(z.pa,z.wa);break}u=u[B-1]||null;null!==u&&(w=u[6],y=u[7])}else w=null!==u?u.G:m.la,y=null!==u?u.H:m.ja;u=Vf(z,m,w,y);w=u.length;if(0===w){a.lineTo(z.pa,z.wa);break}for(y=
0;y<w;y++)B=u[y],a.bezierCurveTo(B[2],B[3],B[4],B[5],B[6],B[7]);break;default:D.k("Segment not of valid type: "+z.da)}z.ki&&a.closePath();u=z}e?(t=s=p=0,m.rp?(!0===m.dn&&null!==this.Wd?(a.Xg(this.Wd),g=!0):g=!1,0!==c&&null!==this.Cc&&(g&&(p=a.shadowOffsetX,s=a.shadowOffsetY,t=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0),d&&!h||a.bk(),g&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=t))):(g&&(p=a.shadowOffsetX,s=a.shadowOffsetY,t=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=
0,a.shadowBlur=0),!0===m.dn&&null!==this.Wd&&a.Xg(this.Wd),0!==c&&null!==this.Cc&&(d&&!h||a.bk()),g&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=t))):(!0===m.dn&&null!==this.Wd&&a.Xg(this.Wd),0===c||null===this.Cc||d&&!h||a.bk())}if(d&&!h)for(c=g,g=l.mk,h=g.length,l=0;l<h;l++){r=g.o[l];a.beginPath();n=D.hb();n.push(r.la);n.push(r.ja);q=r.la;m=r.ja;p=q;s=m;t=r.Fb.o;z=t.length;for(w=0;w<z;w++){y=t[w];switch(y.da){case Df:rq(a,n,k,this.Jf);n.length=0;n.push(y.G);n.push(y.H);q=y.G;m=y.H;p=q;s=m;
break;case vf:n.push(y.G);n.push(y.H);q=y.G;m=y.H;break;case Ef:se(q,m,y.Xd,y.gf,y.Eh,y.Og,y.Eb,y.Mb,.5,n);q=y.G;m=y.H;break;case Ff:Ee(q,m,y.Xd,y.gf,y.Eb,y.Mb,.5,n);q=y.G;m=y.H;break;case Gf:u=If(y,r);B=u.length;if(0===B){n.push(y.pa);n.push(y.wa);q=y.pa;m=y.wa;break}for(var P=0;P<B;P++){var G=u[P];se(q,m,G[2],G[3],G[4],G[5],G[6],G[7],.5,n);q=G[6];m=G[7]}break;case Hf:u=Vf(y,r,q,m);B=u.length;if(0===B){n.push(y.pa);n.push(y.wa);q=y.pa;m=y.wa;break}for(P=0;P<B;P++)G=u[P],se(q,m,G[2],G[3],G[4],G[5],
G[6],G[7],.5,n),q=G[6],m=G[7];break;default:D.k("Segment not of valid type: "+y.da)}y.ki&&(n.push(p),n.push(s),rq(a,n,k,this.Jf))}rq(a,n,k,this.Jf);D.ua(n);null!==this.Cc&&(q=n=r=0,c&&e&&(r=a.shadowOffsetX,n=a.shadowOffsetY,q=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0),a.bk(),c&&e&&(a.shadowOffsetX=r,a.shadowOffsetY=n,a.shadowBlur=q))}}d&&a.Tx();if(null!==this.Gy){d=this.Gy;Hk(d,Infinity,Infinity);k=d.Ia;d.rc(0,0,k.width,k.height);c=this.wf;a.save();a.beginPath();k=D.hb();if(c.type===
Ye)k.push(c.la),k.push(c.ja),k.push(c.G),k.push(c.H),qq(a,b,k,d);else if(c.type===Ve)for(h=c.pc.j;h.next();){l=h.value;k.length=0;k.push(l.la);k.push(l.ja);g=l.la;r=l.ja;n=g;q=r;m=l.Fb.o;p=m.length;for(s=0;s<p;s++){t=m[s];switch(t.da){case Df:qq(a,b,k,d);k.length=0;k.push(t.G);k.push(t.H);g=t.G;r=t.H;n=g;q=r;break;case vf:k.push(t.G);k.push(t.H);g=t.G;r=t.H;break;case Ef:se(g,r,t.Xd,t.gf,t.Eh,t.Og,t.Eb,t.Mb,.5,k);g=t.G;r=t.H;break;case Ff:Ee(g,r,t.Xd,t.gf,t.Eb,t.Mb,.5,k);g=t.G;r=t.H;break;case Gf:c=
If(t,l);e=c.length;if(0===e){k.push(t.pa);k.push(t.wa);g=t.pa;r=t.wa;break}for(z=0;z<e;z++)w=c[z],se(g,r,w[2],w[3],w[4],w[5],w[6],w[7],.5,k),g=w[6],r=w[7];break;case Hf:c=Vf(t,l,g,r);e=c.length;if(0===e){k.push(t.pa);k.push(t.wa);g=t.pa;r=t.wa;break}for(z=0;z<e;z++)w=c[z],se(g,r,w[2],w[3],w[4],w[5],w[6],w[7],.5,k),g=w[6],r=w[7];break;default:D.k("Segment not of valid type: "+t.da)}t.ki&&(k.push(n),k.push(q),qq(a,b,k,d))}qq(a,b,k,d)}else if(c.type===Ze)k.push(c.la),k.push(c.ja),k.push(c.G),k.push(c.ja),
k.push(c.G),k.push(c.H),k.push(c.la),k.push(c.H),k.push(c.la),k.push(c.ja),qq(a,b,k,d);else if(c.type===tf){h=new We;h.la=c.G;h.ja=(c.ja+c.H)/2;g=new Zf(Gf);g.Ne=0;g.Ef=360;g.pa=(c.la+c.G)/2;g.wa=(c.ja+c.H)/2;g.radiusX=Math.abs(c.la-c.G)/2;g.radiusY=Math.abs(c.ja-c.H)/2;h.add(g);c=If(g,h);e=c.length;if(0===e)k.push(g.pa),k.push(g.wa);else for(g=h.la,r=h.ja,z=0;z<e;z++)w=c[z],se(g,r,w[2],w[3],w[4],w[5],w[6],w[7],.5,k),g=w[6],r=w[7];qq(a,b,k,d)}D.ua(k);a.restore();a.Ee(!1)}}}};
function rq(a,b,c,d){var e=b.length;if(!(4>e)){var g=.001,h=c.length,k=b[0],l=b[1];if(4===e)Io(a,k,l,b[2],b[3],c,d);else{a.moveTo(k,l);for(var m=g=0,n=0,p=0,q=0,r=p=0,s=D.hb(),t=2;t<e;t+=2)g=b[t],m=b[t+1],n=g-k,p=m-l,0===n&&(n=.001),q=p/n,p=Math.sqrt(n*n+p*p),s.push([n,q,p]),r+=p,k=g,l=m;k=b[0];l=b[1];b=0;for(var e=!0,g=c[b%h],m=0!==d,t=0,p=s[t],n=p[0],q=p[1],p=p[2],u=0;.1<=r;){0===u&&(g=c[b%h],b++,m&&(d%=g,g-=d,m=!1));g>r&&(g=r);g>p?(u=g-p,g=p):u=0;var z=Math.sqrt(g*g/(1+q*q));0>n&&(z=-z);k+=z;l+=
q*z;e?a.lineTo(k,l):a.moveTo(k,l);r-=g;p-=g;if(0!==u){t++;if(t===s.length){D.ua(s);return}p=s[t];n=p[0];q=p[1];p=p[2];g=u}else e=!e}D.ua(s)}}}A.prototype.getDocumentPoint=A.prototype.gb=function(a,b){void 0===b&&(b=new N);if(a instanceof R){a.fe()&&D.k("getDocumentPoint Spot must be a real, specific Spot, not: "+a.toString());var c=this.Fa,d=this.pb;b.n(a.x*(c.width+d)-d/2+c.x+a.offsetX,a.y*(c.height+d)-d/2+c.y+a.offsetY)}else b.set(a);this.Jh.vb(b);return b};
A.prototype.Vk=function(a,b){var c=this.wf;if(null===c||null===this.fill&&null===this.stroke)return!1;var d=c.lb,e=this.pb/2;c.type!==Ye||b||(e+=2);var g=D.Ff();g.assign(d);g.jg(e+2,e+2);if(!g.Pa(a))return D.Hb(g),!1;d=e+1E-4;if(c.type===Ye){if(null===this.stroke)return!1;d=(c.G-c.la)*(a.x-c.la)+(c.H-c.ja)*(a.y-c.ja);if(0>(c.la-c.G)*(a.x-c.G)+(c.ja-c.H)*(a.y-c.H)||0>d)return!1;D.Hb(g);return pe(c.la,c.ja,c.G,c.H,e,a.x,a.y)}if(c.type===Ze){var h=c.la,k=c.ja,l=c.G,c=c.H;g.x=Math.min(h,l);g.y=Math.min(k,
c);g.width=Math.abs(l-h);g.height=Math.abs(c-k);if(null===this.fill){g.jg(-d,-d);if(g.Pa(a))return D.Hb(g),!1;g.jg(d,d)}null!==this.stroke&&g.jg(e,e);d=g.Pa(a);D.Hb(g);return d}if(c.type===tf){var h=c.la,k=c.ja,l=c.G,c=c.H,e=Math.min(h,l),m=Math.min(k,c),h=Math.abs(l-h)/2,k=Math.abs(c-k)/2,e=a.x-(e+h),m=a.y-(m+k);if(null===this.fill){h-=d;k-=d;if(0>=h||0>=k||1>=e*e/(h*h)+m*m/(k*k))return D.Hb(g),!1;h+=d;k+=d}null!==this.stroke&&(h+=d,k+=d);D.Hb(g);return 0>=h||0>=k?!1:1>=e*e/(h*h)+m*m/(k*k)}if(c.type===
Ve)return D.Hb(g),null===this.fill?Xf(c,a.x,a.y,e):c.Pa(a,e,1<this.pb,b);D.k("Unknown Geometry type: "+c.type);return!1};
A.prototype.oo=function(a,b,c,d){var e=this.Ea,g=this.Rg;a=Math.max(a,0);b=Math.max(b,0);var h;if(null!==this.bg)h=this.wf.lb;else{var k=this.Ob,l=le[k];if(void 0===l){var m=sq[k];"string"===typeof m&&(m=sq[m]);"function"===typeof m?(l=m(null,100,100),le[k]=l):D.k("Unsupported Figure: "+k)}h=l.lb}var k=h.width,l=h.height,m=h.width,n=h.height;switch(Oo(this,!0)){case ak:d=c=0;break;case Xe:m=Math.max(a-g,0);n=Math.max(b-g,0);break;case zo:m=Math.max(a-g,0);d=0;break;case yo:c=0,n=Math.max(b-g,0)}isFinite(e.width)&&
(m=e.width);isFinite(e.height)&&(n=e.height);e=this.pf;h=this.$g;c=Math.max(c-g,h.width);d=Math.max(d-g,h.height);m=Math.min(e.width,m);n=Math.min(e.height,n);m=isFinite(m)?Math.max(c,m):Math.max(k,c);n=isFinite(n)?Math.max(d,n):Math.max(l,d);c=bk(this);switch(c){case ak:break;case Xe:k=m;l=n;break;case ck:c=Math.min(m/k,n/l);isFinite(c)||(c=1);k*=c;l*=c;break;default:D.k(c+" is not a valid geometryStretch.")}null!==this.bg?(k=Math.max(k,.01),l=Math.max(l,.01),h=null!==this.bg?this.bg:this.Za,e=k,
d=l,c=h.copy(),h=h.lb,e/=h.width,d/=h.height,isFinite(e)||(e=1),isFinite(d)||(d=1),1===e&&1===d||c.scale(e,d),v&&c.freeze(),this.Za=c):null!==this.Za&&Eb(this.Za.qp,a-g)&&Eb(this.Za.op,b-g)||(this.Za=A.makeGeometry(this,k,l));h=this.Za.lb;Infinity===a||Infinity===b?Lo(this,h.x-g/2,h.y-g/2,0===a&&0===k?0:h.width+g,0===b&&0===l?0:h.height+g):Lo(this,-(g/2),-(g/2),m+g,n+g)};
function Yp(a,b,c,d){if(!1!==zm(a)){a.Fd.Xa();var e=a.Rg;0===e&&d instanceof ca&&d.Cb instanceof A&&(e=d.Cb.pb);e*=a.Ab;d instanceof J&&null!==d.Za?(b=d.Za.lb,Lo(a,b.x-e/2,b.y-e/2,b.width+e,b.height+e)):d instanceof ca&&null!==d.hf.Za?(b=d.hf.Za.lb,Lo(a,b.x-e/2,b.y-e/2,b.width+e,b.height+e)):Lo(a,-(e/2),-(e/2),b+e,c+e);a.Fd.freeze();a.Fd.F()||D.k("Non-real measuredBounds has been set. Object "+a+", measuredBounds: "+a.Fd.toString());km(a,!1)}}
function bk(a){var b=a.iB;return null!==a.bg?b===xo?Xe:b:b===xo?le[a.Ob].ne:b}A.prototype.Fj=function(a,b,c,d){So(this,a,b,c,d)};A.prototype.getNearestIntersectionPoint=A.prototype.PF=function(a,b,c){return this.$n(a.x,a.y,b.x,b.y,c)};
A.prototype.$n=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),g=a*k+b*m+p,h=a*l+b*n+q,k=c*k+d*m+p,l=c*l+d*n+q,m=this.pb/2,p=this.Za;null===p&&(Hk(this,Infinity,Infinity),p=this.Za);q=p.lb;n=!1;if(p.type===Ye)if(1.5>=this.pb)n=He(p.Bc,p.Nc,p.Eb,p.Mb,g,h,k,l,e);else{var r=0,s=0;p.Bc===p.Eb?(r=m,s=0):(b=(p.Mb-p.Nc)/(p.Eb-p.Bc),s=m/Math.sqrt(1+b*b),r=s*b);d=D.hb();b=new N;He(p.Bc+
r,p.Nc+s,p.Eb+r,p.Mb+s,g,h,k,l,b)&&d.push(b);b=new N;He(p.Bc-r,p.Nc-s,p.Eb-r,p.Mb-s,g,h,k,l,b)&&d.push(b);b=new N;He(p.Bc+r,p.Nc+s,p.Bc-r,p.Nc-s,g,h,k,l,b)&&d.push(b);b=new N;He(p.Eb+r,p.Mb+s,p.Eb-r,p.Mb-s,g,h,k,l,b)&&d.push(b);b=d.length;if(0===b)return D.ua(d),!1;n=!0;s=Infinity;for(r=0;r<b;r++){var k=d[r],t=(k.x-g)*(k.x-g)+(k.y-h)*(k.y-h);t<s&&(s=t,e.x=k.x,e.y=k.y)}D.ua(d)}else if(p.type===Ze)b=q.x-m,n=Ie(b,q.y-m,q.x+q.width+m,q.y+q.height+m,g,h,k,l,e);else if(p.type===tf)a:if(b=q.copy().jg(m,
m),0===b.width)n=He(b.x,b.y,b.x,b.y+b.height,g,h,k,l,e);else if(0===b.height)n=He(b.x,b.y,b.x+b.width,b.y,g,h,k,l,e);else{a=b.width/2;var u=b.height/2;d=b.x+a;b=b.y+u;c=9999;g!==k&&(c=(h-l)/(g-k));if(9999>Math.abs(c)){n=h-b-c*(g-d);if(0>a*a*c*c+u*u-n*n){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(a*a*c*c+u*u-n*n);k=(-(a*a*c*n)+a*u*m)/(u*u+a*a*c*c)+d;a=(-(a*a*c*n)-a*u*m)/(u*u+a*a*c*c)+d;l=c*(k-d)+n+b;b=c*(a-d)+n+b;d=Math.abs((g-k)*(g-k))+Math.abs((h-l)*(h-l));h=Math.abs((g-a)*(g-a))+Math.abs((h-b)*(h-
b));d<h?(e.x=k,e.y=l):(e.x=a,e.y=b)}else{k=u*u;l=g-d;k-=k/(a*a)*l*l;if(0>k){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(k);l=b+m;b-=m;d=Math.abs(l-h);h=Math.abs(b-h);d<h?(e.x=g,e.y=l):(e.x=g,e.y=b)}n=!0}else if(p.type===Ve){var z=0,w=0,y=t=0,q=D.O(),r=k-g,s=l-h,s=r*r+s*s;e.x=k;e.y=l;for(r=0;r<p.pc.count;r++)for(var B=p.pc.o[r],P=B.Fb,z=B.la,w=B.ja,G=z,Q=w,Y=0;Y<P.count;Y++){var U=P.o[Y],ea=U.type,t=U.G,y=U.H,la=!1;switch(ea){case Df:G=t;Q=y;break;case vf:la=tq(z,w,t,y,g,h,k,l,q);break;case Ef:var la=
U.Gc,ea=U.bd,Da=U.Xh,La=U.Yh,la=Fe(z,w,la,ea,Da,La,t,y,g,h,k,l,.5,q);break;case Ff:la=(z+2*U.Gc)/3;ea=(w+2*U.bd)/3;Da=(2*U.Gc+t)/3;La=(2*U.Gc+t)/3;la=Fe(z,w,la,ea,Da,La,t,y,g,h,k,l,.5,q);break;case Gf:case Hf:ea=U.type===Gf?If(U,B):Vf(U,B,z,w);Da=ea.length;if(0===Da){la=tq(z,w,U.pa,U.wa,g,h,k,l,q);break}for(y=0;y<Da;y++)u=ea[y],0===y&&tq(z,w,u[0],u[1],g,h,k,l,q)&&(t=uq(g,h,q,s,e),t<s&&(s=t,n=!0)),Fe(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],g,h,k,l,.5,q)&&(t=uq(g,h,q,s,e),t<s&&(s=t,n=!0));t=u[6];y=
u[7];break;default:D.k("Unknown Segment type: "+ea)}z=t;w=y;la&&(t=uq(g,h,q,s,e),t<s&&(s=t,n=!0));U.ky&&(t=G,y=Q,tq(z,w,t,y,g,h,k,l,q)&&(t=uq(g,h,q,s,e),t<s&&(s=t,n=!0)))}g=c-a;h=d-b;b=Math.sqrt(g*g+h*h);0!==b&&(g/=b,h/=b);e.x-=g*m;e.y-=h*m;D.A(q)}else D.k("Unknown Geometry type: "+p.type);if(!n)return!1;this.transform.vb(e);return!0};function uq(a,b,c,d,e){a=c.x-a;b=c.y-b;b=a*a+b*b;return b<d?(e.x=c.x,e.y=c.y,b):d}
function tq(a,b,c,d,e,g,h,k,l){var m=!1,n=(e-h)*(b-d)-(g-k)*(a-c);if(0===n)return!1;l.x=((e*k-g*h)*(a-c)-(e-h)*(a*d-b*c))/n;l.y=((e*k-g*h)*(b-d)-(g-k)*(a*d-b*c))/n;(a>c?a-c:c-a)<(b>d?b-d:d-b)?(e=b<d?b:d,a=b<d?d:b,(l.y>e||Eb(l.y,e))&&(l.y<a||Eb(l.y,a))&&(m=!0)):(e=a<c?a:c,a=a<c?c:a,(l.x>e||Eb(l.x,e))&&(l.x<a||Eb(l.x,a))&&(m=!0));return m}
A.prototype.containedInRect=A.prototype.Pn=function(a,b){if(void 0===b)return a.Wk(this.Y);var c=this.Za;null===c&&(Hk(this,Infinity,Infinity),c=this.Za);var c=c.lb,d=this.pb/2,e=!1,g=D.O();g.n(c.x-d,c.y-d);a.Pa(b.vb(g))&&(g.n(c.x-d,c.bottom+d),a.Pa(b.vb(g))&&(g.n(c.right+d,c.bottom+d),a.Pa(b.vb(g))&&(g.n(c.right+d,c.y-d),a.Pa(b.vb(g))&&(e=!0))));D.A(g);return e};
A.prototype.intersectsRect=A.prototype.kg=function(a,b){if(this.Pn(a,b)||void 0===b&&(b=this.transform,a.Wk(this.Y)))return!0;var c=D.hh();c.set(b);c.uB();var d=a.left,e=a.right,g=a.top,h=a.bottom,k=D.O();k.n(d,g);c.vb(k);if(this.Vk(k,!0))return D.A(k),!0;k.n(e,g);c.vb(k);if(this.Vk(k,!0))return D.A(k),!0;k.n(d,h);c.vb(k);if(this.Vk(k,!0))return D.A(k),!0;k.n(e,h);c.vb(k);if(this.Vk(k,!0))return D.A(k),!0;var l=D.O(),m=D.O();c.set(b);c.LB(this.transform);c.uB();l.x=e;l.y=g;l.transform(c);k.x=d;k.y=
g;k.transform(c);var n=!1;vq(this,k,l,m)?n=!0:(k.x=e,k.y=h,k.transform(c),vq(this,k,l,m)?n=!0:(l.x=d,l.y=h,l.transform(c),vq(this,k,l,m)?n=!0:(k.x=d,k.y=g,k.transform(c),vq(this,k,l,m)&&(n=!0))));D.A(k);D.lf(c);D.A(l);D.A(m);return n};function vq(a,b,c,d){if(!a.PF(b,c,d))return!1;a=b.x;b=b.y;var e=c.x;c=c.y;var g=d.x;d=d.y;if(a===e){var h=0;a=0;b<c?(h=b,a=c):(h=c,a=b);return d>=h&&d<=a}a<e?(h=a,a=e):h=e;return g>=h&&g<=a}
A.prototype.IF=function(a,b,c){function d(a,b){for(var c=a.length,d=0;d<c;d+=2)if(b.gg(a[d],a[d+1])>e)return!0;return!1}if(c&&null!==this.fill&&this.Vk(a,!0))return!0;var e=a.Lf(b);b=e;1.5<this.pb&&(e=this.pb/2+Math.sqrt(e),e*=e);var g=this.Za;if(null===g&&(Hk(this,Infinity,Infinity),g=this.Za,null===g))return!1;if(!c){var h=g.lb,k=h.x,l=h.y,m=h.x+h.width,h=h.y+h.height;if(mb(a.x,a.y,k,l)<=e&&mb(a.x,a.y,m,l)<=e&&mb(a.x,a.y,k,h)<=e&&mb(a.x,a.y,m,h)<=e)return!0}k=g.Bc;l=g.Nc;m=g.Eb;h=g.Mb;if(g.type===
Ye){if(c=lb(a.x,a.y,k,l,m,h),g=(k-m)*(a.x-m)+(l-h)*(a.y-h),c<=(0<=(m-k)*(a.x-k)+(h-l)*(a.y-l)&&0<=g?e:b))return!0}else{if(g.type===Ze)return b=!1,c&&(b=lb(a.x,a.y,k,l,k,h)<=e||lb(a.x,a.y,k,l,m,l)<=e||lb(a.x,a.y,m,l,m,h)<=e||lb(a.x,a.y,k,h,m,h)<=e),b;if(g.type===tf){b=a.x-(k+m)/2;var g=a.y-(l+h)/2,n=Math.abs(m-k)/2,p=Math.abs(h-l)/2;if(0===n||0===p)return c=lb(a.x,a.y,k,l,m,h),c<=e?!0:!1;if(c){if(a=Te(n,p,b,g),a*a<=e)return!0}else return mb(b,g,-n,0)>=e||mb(b,g,0,-p)>=e||mb(b,g,0,p)>=e||mb(b,g,n,0)>=
e?!1:!0}else if(g.type===Ve){h=g.lb;k=h.x;l=h.y;m=h.x+h.width;h=h.y+h.height;if(a.x>m&&a.x<k&&a.y>h&&a.y<l&&lb(a.x,a.y,k,l,k,h)>e&&lb(a.x,a.y,k,l,m,l)>e&&lb(a.x,a.y,m,h,k,h)>e&&lb(a.x,a.y,m,h,m,l)>e)return!1;b=Math.sqrt(e);if(c){if(null===this.fill?Xf(g,a.x,a.y,b):g.Pa(a,b,!0))return!0}else{c=g.pc;for(b=0;b<c.count;b++){k=c.o[b];n=k.la;p=k.ja;if(a.gg(n,p)>e)return!1;l=k.Fb.o;m=l.length;for(h=0;h<m;h++){var q=l[h];switch(q.type){case Df:case vf:n=q.G;p=q.H;if(a.gg(n,p)>e)return!1;break;case Ef:g=D.hb();
se(n,p,q.Gc,q.bd,q.Xh,q.Yh,q.G,q.H,.8,g);n=d(g,a);D.ua(g);if(n)return!1;n=q.G;p=q.H;if(a.gg(n,p)>e)return!1;break;case Ff:g=D.hb();Ee(n,p,q.Gc,q.bd,q.G,q.H,.8,g);n=d(g,a);D.ua(g);if(n)return!1;n=q.G;p=q.H;if(a.gg(n,p)>e)return!1;break;case Gf:case Hf:var r=q.type===Gf?If(q,k):Vf(q,k,n,p),s=r.length;if(0===s){n=q.pa;p=q.wa;if(a.gg(n,p)>e)return!1;break}q=null;g=D.hb();for(b=0;b<s;b++)if(q=r[b],g.length=0,se(q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7],.8,g),d(g,a))return D.ua(g),!1;D.ua(g);null!==q&&(n=
q[6],p=q[7]);break;default:D.k("Unknown Segment type: "+q.type)}}}return!0}}}return!1};D.defineProperty(A,{wf:"geometry"},function(){return null!==this.Za?this.Za:this.bg},function(a){var b=this.Za;if(b!==a){null!==a?(v&&D.l(a,Ue,A,"geometry"),this.bg=this.Za=a.freeze()):this.bg=this.Za=null;var c=this.$;null!==c&&(c.Ck=NaN);this.K();this.i("geometry",b,a);Jo(this)&&(a=this.$,null!==a&&Ko(this,a,"geometryString"))}});
D.defineProperty(A,{TI:"geometryString"},function(){return null===this.wf?"":this.wf.toString()},function(a){a=xf(a);var b=a.normalize();this.wf=a;this.position=a=D.Db(-b.x,-b.y);D.A(a)});D.defineProperty(A,{gG:"isGeometryPositioned"},function(){return this.rs},function(a){v&&D.h(a,"boolean",A,"isGeometryPositioned");var b=this.rs;b!==a&&(this.rs=a,this.K(),this.i("isGeometryPositioned",b,a))});A.prototype.se=function(){this.Za=null};
D.defineProperty(A,{fill:"fill"},function(){return this.Wd},function(a){var b=this.Wd;b!==a&&(v&&null!==a&&D.nu(a,"Shape.fill"),a instanceof za&&a.freeze(),this.Wd=a,this.ra(),this.i("fill",b,a))});D.defineProperty(A,{stroke:"stroke"},function(){return this.Cc},function(a){var b=this.Cc;b!==a&&(v&&null!==a&&D.nu(a,"Shape.stroke"),a instanceof za&&a.freeze(),this.Cc=a,this.ra(),this.i("stroke",b,a))});
D.defineProperty(A,{pb:"strokeWidth"},function(){return this.Rg},function(a){var b=this.Rg;if(b!==a)if(v&&D.p(a,A,"strokeWidth"),0<=a){this.Rg=a;this.K();var c=this.$;null!==c&&(c.Ck=NaN);this.i("strokeWidth",b,a)}else D.va(a,"value >= 0",A,"strokeWidth:value")});
D.defineProperty(A,{IM:"strokeCap"},function(){return this.Tp},function(a){var b=this.Tp;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?D.va(a,'"butt", "round", or "square"',A,"strokeCap"):(this.Tp=a,this.ra(),this.i("strokeCap",b,a)))});
D.defineProperty(A,{KM:"strokeJoin"},function(){return this.Vp},function(a){var b=this.Vp;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?D.va(a,'"miter", "bevel", or "round"',A,"strokeJoin"):(this.Vp=a,this.ra(),this.i("strokeJoin",b,a)))});
D.defineProperty(A,{LM:"strokeMiterLimit"},function(){return this.En},function(a){var b=this.En;if(b!==a)if(v&&D.p(a,A,"strokeMiterLimit"),1<=a){this.En=a;this.ra();var c=this.$;null!==c&&(c.Ck=NaN);this.i("strokeMiterLimit",b,a)}else D.va(a,"value >= 1",A,"strokeWidth:value")});
D.defineProperty(A,{jH:"strokeDashArray"},function(){return this.Up},function(a){var b=this.Up;if(b!==a){null===a||Array.isArray(a)||D.mc(a,"Array",A,"strokeDashArray: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("strokeDashArray:value "+g+" at index "+e+" must be a positive number or zero.");d+=g}if(0===d){if(null===b)return;a=null}}this.Up=a;this.ra();this.i("strokeDashArray",b,a)}});
D.defineProperty(A,{JM:"strokeDashOffset"},function(){return this.Jf},function(a){var b=this.Jf;b!==a&&(v&&D.p(a,A,"strokeDashOffset"),0<=a&&(this.Jf=a,this.ra(),this.i("strokeDashOffset",b,a)))});
D.defineProperty(A,{Ob:"figure"},function(){return this.ep},function(a){var b=this.ep;if(b!==a){v&&D.h(a,"string",A,"figure");var c=sq[a];"function"===typeof c?c=a:(c=sq[a.toLowerCase()])||D.k("Unknown Shape.figure: "+a);b!==c&&(a=this.$,null!==a&&(a.Ck=NaN),this.ep=c,this.bg=null,this.se(),this.K(),this.i("figure",b,c))}});
D.defineProperty(A,{er:"toArrow"},function(){return this.$p},function(a){var b=this.$p;!0===a?a="Standard":!1===a&&(a="");if(b!==a){v&&D.h(a,"string",A,"toArrow");var c=wq(a);null===c?D.k("Unknown Shape.toArrow: "+a):b!==c&&(this.$p=c,this.bg=null,this.se(),this.K(),xq(this),this.i("toArrow",b,c))}});
D.defineProperty(A,{gB:"fromArrow"},function(){return this.hp},function(a){var b=this.hp;!0===a?a="Standard":!1===a&&(a="");if(b!==a){v&&D.h(a,"string",A,"fromArrow");var c=wq(a);null===c?D.k("Unknown Shape.fromArrow: "+a):b!==c&&(this.hp=c,this.bg=null,this.se(),this.K(),xq(this),this.i("fromArrow",b,c))}});function xq(a){var b=a.g;null!==b&&b.na.ub||(a.Yq=yq,"None"!==a.$p?(a.Xe=-1,a.Ih=fd):"None"!==a.hp&&(a.Xe=0,a.Ih=new R(1-fd.x,fd.y)))}
D.defineProperty(A,{C:"spot1"},function(){return this.Ai},function(a){D.l(a,R,A,"spot1");var b=this.Ai;b.P(a)||(this.Ai=a=a.V(),this.K(),this.i("spot1",b,a))});D.defineProperty(A,{D:"spot2"},function(){return this.Bi},function(a){D.l(a,R,A,"spot2");var b=this.Bi;b.P(a)||(this.Bi=a=a.V(),this.K(),this.i("spot2",b,a))});D.defineProperty(A,{Uc:"parameter1"},function(){return this.kt},function(a){var b=this.kt;b!==a&&(this.kt=a,this.se(),this.K(),this.i("parameter1",b,a))});
D.defineProperty(A,{iv:"parameter2"},function(){return this.lt},function(a){var b=this.lt;b!==a&&(this.lt=a,this.se(),this.K(),this.i("parameter2",b,a))});D.w(A,{Fa:"naturalBounds"},function(){if(null!==this.Za)return this.Xc.assign(this.Za.lb),this.Xc;var a=this.Ea;return new C(0,0,a.width,a.height)});D.defineProperty(A,{Gy:"pathPattern"},function(){return this.nt},function(a){var b=this.nt;b!==a&&(v&&D.l(a,O,A,"pathPattern"),this.nt=a,this.ra(),this.i("pathPattern",b,a))});
D.defineProperty(A,{yM:"pathObject"},function(){return this.Gy},function(a){this.Gy=a});D.defineProperty(A,{iB:"geometryStretch"},function(){return this.hs},function(a){var b=this.hs;b!==a&&(D.Da(a,O,A,"geometryStretch"),this.hs=a,this.i("geometryStretch",b,a))});
D.defineProperty(A,{interval:"interval"},function(){return this.Fg},function(a){var b=this.Fg;v&&D.p(a,A,"interval");a=Math.floor(a);if(b!==a&&0<=a){this.Fg=a;var c=this.g;null!==c&&this.Q===c.bo&&lm(c);this.K();c=this.Q;null!==c&&c.type===rp&&(c.sk=null);this.i("interval",b,a)}});D.defineProperty(A,{TF:"graduatedStart"},function(){return this.Eg},function(a){var b=this.Eg;v&&D.p(a,A,"graduatedStart");b!==a&&(0>a?a=0:1<a&&(a=1),this.Eg=a,this.K(),this.i("graduatedStart",b,a))});
D.defineProperty(A,{RF:"graduatedEnd"},function(){return this.Dg},function(a){var b=this.Dg;v&&D.p(a,A,"graduatedEnd");b!==a&&(0>a?a=0:1<a&&(a=1),this.Dg=a,this.K(),this.i("graduatedEnd",b,a))});A.makeGeometry=function(a,b,c){var d=null;if("None"!==a.er)d=me[a.er];else if("None"!==a.gB)d=me[a.gB];else{var e=sq[a.Ob];"string"===typeof e&&(e=sq[e]);void 0===e&&D.k("Unknown Shape.figure: "+a.Ob);d=e(a,b,c);d.qp=b;d.op=c}null===d&&(e=sq.Rectangle,"function"===typeof e&&(d=e(a,b,c)));return d};
A.getFigureGenerators=function(){var a=new ma,b;for(b in sq)b!==b.toLowerCase()&&a.add(b,sq[b]);a.freeze();return a};
A.defineFigureGenerator=function(a,b){D.h(a,"string",A,"defineFigureGenerator:name");"string"===typeof b?""!==b&&sq[b]||D.k("Shape.defineFigureGenerator synonym must not be empty or None or not a defined figure name: "+b):D.h(b,"function",A,"defineFigureGenerator: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);sq[a]=b;sq[c]=a};
A.getArrowheadGeometries=function(){var a=new ma("string",Ue),b;for(b in zq)if(void 0===me[b]){var c=xf(zq[b],!1);me[b]=c;c=b.toLowerCase();c!==b&&(me[c]=b)}for(b in me)b!==b.toLowerCase()&&(c=me[b],c instanceof Ue&&a.add(b,c));a.freeze();return a};
A.defineArrowheadGeometry=function(a,b){D.h(a,"string",A,"defineArrowheadGeometry:name");var c=null;"string"===typeof b?(D.h(b,"string",A,"defineArrowheadGeometry:pathstr"),c=xf(b,!1)):(D.l(b,Ue,A,"defineArrowheadGeometry:pathstr"),c=b);var d=a.toLowerCase();""!==a&&"none"!==d&&a!==d||D.k("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+a);me[a]=c;me[d]=a};
function na(){O.call(this);this.Zd="";this.Cc="black";this.Bg="13px sans-serif";this.dm="start";this.Ag=ak;this.hm=Yc;this.en=!0;this.wk=this.yk=!1;this.sj=Aq;this.Dj=Bq;this.Gw=this.ze=0;this.gA=this.hA=null;this.sf=new dq;this.as=!1;this.cf=this.yr=this.Wt=this.em=this.Xt=null;this.zi=this.yi=0;this.yh=Infinity;this.xp=0;this.Fg=1;this.Eg=0;this.Dg=1;this.$m=null}D.Ta(na,O);D.ka("TextBlock",na);var Cq=/[ \u200b\u00ad]/;
na.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.Zd=this.Zd;a.Cc=this.Cc;a.Bg=this.Bg;a.dm=this.dm;a.Ag=this.Ag;a.hm=this.hm;a.en=this.en;a.yk=this.yk;a.wk=this.wk;a.sj=this.sj;a.Dj=this.Dj;a.ze=this.ze;a.Gw=this.Gw;a.hA=this.hA;a.gA=this.gA;a.sf.lq(this.sf);a.as=this.as;a.Xt=this.Xt;a.em=this.em;a.Wt=this.Wt;a.yr=this.yr;a.cf=this.cf;a.yi=this.yi;a.zi=this.zi;a.yh=this.yh;a.xp=this.xp;a.Fg=this.Fg;a.Eg=this.Eg;a.Dg=this.Dg;a.$m=this.$m};
na.prototype.qc=function(a){a.Se===na?this.zH=a:O.prototype.qc.call(this,a)};na.prototype.toString=function(){return 22<this.Zd.length?'TextBlock("'+this.Zd.substring(0,20)+'"...)':'TextBlock("'+this.Zd+'")'};var Dq=new ja,Eq=0,Fq=new ja,Gq=0,Hq="...",Iq="",Jq=(new ia(null)).Xk;na.getEllipsis=function(){return Hq};na.setEllipsis=function(a){Hq=a;Fq=new ja;Gq=0};var Kq;na.None=Kq=D.s(na,"None",0);var Lq;na.WrapFit=Lq=D.s(na,"WrapFit",1);var Bq;na.WrapDesiredSize=Bq=D.s(na,"WrapDesiredSize",2);var Mq;
na.WrapBreakAll=Mq=D.s(na,"WrapBreakAll",3);var Aq;na.OverflowClip=Aq=D.s(na,"OverflowClip",0);var Nq;na.OverflowEllipsis=Nq=D.s(na,"OverflowEllipsis",1);na.prototype.K=function(){O.prototype.K.call(this);this.gA=this.hA=null};D.defineProperty(na,{font:"font"},function(){return this.Bg},function(a){var b=this.Bg;b!==a&&(v&&(D.h(a,"string",na,"font"),Oq(a)||D.k('Not a valid font: "'+a+'"')),this.Bg=a,this.sf.nk=null,this.K(),this.i("font",b,a))});var Oq;
na.isValidFont=Oq=function(a){var b=Jq.font;if(a===b||"10px sans-serif"===a)return!0;Jq.font="10px sans-serif";var c;Jq.font=a;var d=Jq.font;if("10px sans-serif"!==d)return Jq.font=b,!0;Jq.font="19px serif";c=Jq.font;Jq.font=a;d=Jq.font;Jq.font=b;return d!==c};D.defineProperty(na,{text:"text"},function(){return this.Zd},function(a){var b=this.Zd;a=null!==a&&void 0!==a?a.toString():"";b!==a&&(this.Zd=a,this.K(),this.i("text",b,a))});
D.defineProperty(na,{textAlign:"textAlign"},function(){return this.dm},function(a){var b=this.dm;b!==a&&(v&&D.h(a,"string",na,"textAlign"),"start"===a||"end"===a||"left"===a||"right"===a||"center"===a?(this.dm=a,this.ra(),this.i("textAlign",b,a)):D.va(a,'"start", "end", "left", "right", or "center"',na,"textAlign"))});D.defineProperty(na,{Cu:"flip"},function(){return this.Ag},function(a){var b=this.Ag;b!==a&&(D.Da(a,O,na,"flip"),this.Ag=a,this.ra(),this.i("flip",b,a))});
D.defineProperty(na,{QM:"verticalAlignment"},function(){return this.hm},function(a){var b=this.hm;b.P(a)||(v&&D.l(a,R,na,"verticalAlignment"),a.fe()&&D.k("TextBlock.verticalAlignment for "+this+" must be a real Spot, not:"+a),this.hm=a=a.V(),ap(this),this.i("verticalAlignment",b,a))});D.w(na,{Fa:"naturalBounds"},function(){if(!this.Xc.F()){var a=Pq(this,this.Zd,this.sf,999999).width,b=Qq(this,a,this.sf),c=this.Ea;isNaN(c.width)||(a=c.width);isNaN(c.height)||(b=c.height);Cb(this.Xc,a,b)}return this.Xc});
D.defineProperty(na,{oy:"isMultiline"},function(){return this.en},function(a){var b=this.en;b!==a&&(v&&D.h(a,"boolean",na,"isMultiline"),this.en=a,this.K(),this.i("isMultiline",b,a))});D.defineProperty(na,{YL:"isUnderline"},function(){return this.yk},function(a){var b=this.yk;b!==a&&(v&&D.h(a,"boolean",na,"isUnderline"),this.yk=a,this.ra(),this.i("isUnderline",b,a))});
D.defineProperty(na,{XL:"isStrikethrough"},function(){return this.wk},function(a){var b=this.wk;b!==a&&(v&&D.h(a,"boolean",na,"isStrikethrough"),this.wk=a,this.ra(),this.i("isStrikethrough",b,a))});D.defineProperty(na,{zH:"wrap"},function(){return this.Dj},function(a){var b=this.Dj;b!==a&&(v&&D.Da(a,na,na,"wrap"),this.Dj=a,this.K(),this.i("wrap",b,a))});
D.defineProperty(na,{overflow:"overflow"},function(){return this.sj},function(a){var b=this.sj;b!==a&&(v&&D.Da(a,na,na,"overflow"),this.sj=a,this.K(),this.i("overflow",b,a))});D.defineProperty(na,{stroke:"stroke"},function(){return this.Cc},function(a){var b=this.Cc;b!==a&&(v&&null!==a&&D.nu(a,"TextBlock.stroke"),a instanceof za&&a.freeze(),this.Cc=a,this.ra(),this.i("stroke",b,a))});D.w(na,{vy:"lineCount"},function(){return this.ze});
D.defineProperty(na,{cB:"editable"},function(){return this.as},function(a){var b=this.as;b!==a&&(v&&D.h(a,"boolean",na,"editable"),this.as=a,this.i("editable",b,a))});D.defineProperty(na,{nH:"textEditor"},function(){return this.Xt},function(a){var b=this.Xt;b!==a&&(!v||a instanceof HTMLElement||a instanceof hk||D.k("TextBlock.textEditor must be an HTMLElement or HTMLInfo."),this.Xt=a,this.i("textEditor",b,a))});
D.defineProperty(na,{dB:"errorFunction"},function(){return this.cf},function(a){var b=this.cf;b!==a&&(null!==a&&D.h(a,"function",na,"errorFunction"),this.cf=a,this.i("errorFunction",b,a))});D.defineProperty(na,{interval:"interval"},function(){return this.Fg},function(a){var b=this.Fg;v&&D.p(a,na,"interval");a=Math.floor(a);if(b!==a&&0<=a){this.Fg=a;this.K();var c=this.Q;null!==c&&c.type===rp&&(c.sk=null);this.i("interval",b,a)}});
D.defineProperty(na,{TF:"graduatedStart"},function(){return this.Eg},function(a){var b=this.Eg;v&&D.p(a,na,"graduatedStart");b!==a&&(0>a?a=0:1<a&&(a=1),this.Eg=a,this.K(),this.i("graduatedStart",b,a))});D.defineProperty(na,{RF:"graduatedEnd"},function(){return this.Dg},function(a){var b=this.Dg;v&&D.p(a,na,"graduatedEnd");b!==a&&(0>a?a=0:1<a&&(a=1),this.Dg=a,this.K(),this.i("graduatedEnd",b,a))});
D.defineProperty(na,{SF:"graduatedFunction"},function(){return this.$m},function(a){var b=this.$m;b!==a&&(null!==a&&D.h(a,"function",na,"graduatedFunction"),this.$m=a,this.K(),this.i("graduatedFunction",b,a))});
na.prototype.Zk=function(a,b){if(null!==this.Cc&&0!==this.Zd.length&&null!==this.Bg){var c=this.Fa.width,d=this.Fa.height,e=Rq(this),g=a.textAlign=this.dm,h=b.vs;"start"===g&&(g=h?"right":"left");"end"===g&&(g=h?"left":"right");Xo(this,a,this.Cc,!0,!1);(this.yk||this.wk)&&Xo(this,a,this.Cc,!1,!1);var k=0,h=!1,l=D.Db(0,0);this.Jh.vb(l);var m=D.Db(0,e);this.Jh.vb(m);var n=l.Lf(m);D.A(l);D.A(m);l=b.scale;8>n*l*l&&(h=!0);b.fd!==a&&(h=!1);!1===b.el("textGreeking")&&(h=!1);n=this.yi;l=this.zi;switch(this.Cu){case Co:a.translate(c,
0);a.scale(-1,1);break;case Bo:a.translate(0,d);a.scale(1,-1);break;case Do:a.translate(c,d),a.scale(-1,-1)}var m=this.ze,p=(n+e+l)*m;d>p&&(k=this.hm,k=k.y*d-k.y*p+k.offsetY);for(var p=this.sf,q=0;q<m;q++){var r=p.Hf[q],s=p.$e[q];r>c&&(r=c);var k=k+n,t=s,s=a,u=k,z=c,w=e,y=g,B=0;h?("left"===y?B=0:"right"===y?B=z-r:"center"===y&&(B=(z-r)/2),s.fillRect(0+B,u+.25*w,r,1)):("left"===y?B=0:"right"===y?B=z:"center"===y&&(B=z/2),s.fillText(t,0+B,u+w-.25*w),t=w/20|0,0===t&&(t=1),"right"===y?B-=r:"center"===
y&&(B-=r/2),this.yk&&(s.beginPath(),s.lineWidth=t,s.moveTo(0+B,u+w-.2*w),s.lineTo(0+B+r,u+w-.2*w),s.stroke()),this.wk&&(s.beginPath(),s.lineWidth=t,u=u+w-w/2.2|0,0!==t%2&&(u+=.5),s.moveTo(0+B,u),s.lineTo(0+B+r,u),s.stroke()));k+=e+l}switch(this.Cu){case Co:a.scale(-1,1);a.translate(-c,0);break;case Bo:a.scale(1,-1);a.translate(0,-d);break;case Do:a.scale(-1,-1),a.translate(-c,-d)}}};
na.prototype.oo=function(a,b,c,d){this.xp=a;var e=this.sf;e.reset();var g=0,h=0;if(isNaN(this.Ea.width)){g=this.Zd.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(0===g.length)g=0;else if(this.oy){for(var k=h=0,l=!1;!l;){var m=g.indexOf("\n",k);-1===m&&(m=g.length,l=!0);k=Sq(g.substr(k,m-k).replace(/^\s+|\s+$/g,""),this.Bg);k>h&&(h=k);k=m+1}g=h}else h=g.indexOf("\n",0),0<=h&&(g=g.substr(0,h)),g=k=Sq(g,this.Bg);g=Math.min(g,a/this.scale);g=Math.max(8,g)}else g=this.Ea.width;null!==this.Q&&(g=Math.min(g,
this.Q.pf.width));h=Qq(this,g,e);m=h=isNaN(this.Ea.height)?Math.min(h,b/this.scale):this.Ea.height;if(0!==e.Qe&&1!==e.$e.length&&this.sj===Nq&&(b=this.Bg,l=this.sj===Nq?Tq(b):0,k=this.yi+this.zi,k=Math.max(0,Rq(this)+k),m=Math.min(this.IJ-1,Math.max(Math.floor(m/k+.01)-1,0)),!(m+1>=e.$e.length))){k=e.$e[m];for(l=Math.max(1,a-l);Sq(k,b)>l&&1<k.length;)k=k.substr(0,k.length-1);k+=Hq;b=Sq(k,b);e.$e[m]=k;e.$e=e.$e.slice(0,m+1);e.Hf[m]=b;e.Hf=e.Hf.slice(0,m+1);e.Cj=e.$e.length;e.Qe=Math.max(e.Qe,b);this.ze=
e.Cj}if(this.zH===Lq||isNaN(this.Ea.width))g=isNaN(a)?e.Qe:Math.min(a,e.Qe),isNaN(this.Ea.width)&&(g=Math.max(8,g));g=Math.max(c,g);h=Math.max(d,h);Cb(this.Xc,g,h);Lo(this,0,0,g,h)};na.prototype.Fj=function(a,b,c,d){So(this,a,b,c,d)};
function Pq(a,b,c,d){b=b.replace(/^\s+|\s+$/g,"");var e=0,g=0,h=0,k=a.Bg,g=a.yi+a.zi,l=Math.max(0,Rq(a)+g),h=a.sj===Nq?Tq(k):0;if(a.ze>=a.yh)return new Ba(0,l);if(a.Dj===Kq){c.Cj=1;g=Sq(b,k);if(0===h||g<=d)return c.Qe=Math.max(c.Qe,g),c.Hf.push(c.Qe),c.$e.push(b),new Ba(g,l);var m=Uq(a,b);b=b.substr(m.length);for(var n=Uq(a,b),g=Sq(m+n,k);0<n.length&&g<=d;)m+=n,b=b.substr(n.length),n=Uq(a,b),g=Sq((m+n).replace(/^\s+|\s+$/g,""),k);m+=n.replace(/^\s+|\s+$/g,"");for(d=Math.max(1,d-h);Sq(m,k)>d&&1<m.length;)m=
m.substr(0,m.length-1);m+=Hq;h=Sq(m,k);c.Hf.push(h);c.Qe=h;c.$e.push(m);return new Ba(h,l)}var p=0;0===b.length&&(p=1,c.Hf.push(0),c.$e.push(b));for(;0<b.length;){m=Uq(a,b);for(b=b.substr(m.length);Sq(m,k)>d;){n=1;g=Sq(m.substr(0,n),k);for(h=0;g<=d;)n++,h=g,g=Sq(m.substr(0,n),k);1===n?(c.Hf[a.ze+p]=g,e=Math.max(e,g)):(c.Hf[a.ze+p]=h,e=Math.max(e,h));n--;1>n&&(n=1);c.$e[a.ze+p]=m.substr(0,n);p++;m=m.substr(n);if(a.ze+p>a.yh)break}n=Uq(a,b);for(g=Sq(m+n,k);0<n.length&&g<=d;)m+=n,b=b.substr(n.length),
n=Uq(a,b),g=Sq((m+n).replace(/^\s+|\s+$/g,""),k);m=m.replace(/^\s+|\s+$/g,"");if(""!==m&&("\u00ad"===m[m.length-1]&&(m=m.substring(0,m.length-1)+"\u2010"),0===n.length?(c.Hf.push(g),e=Math.max(e,g)):(h=Sq(m,k),c.Hf.push(h),e=Math.max(e,h)),c.$e.push(m),p++,a.ze+p>a.yh))break}c.Cj=Math.min(a.yh,p);c.Qe=Math.max(c.Qe,e);return new Ba(c.Qe,l*c.Cj)}
function Uq(a,b){if(a.Dj===Mq)return b.substr(0,1);for(var c=b.length,d=0;d<c&&!Cq.test(b.charAt(d));)d++;for(;d<c&&Cq.test(b.charAt(d));)d++;return d>=c?b:b.substr(0,d)}function Sq(a,b){Iq!==b&&(Iq=Jq.font=b);return Jq.measureText(a).width}function Rq(a){if(null!==a.sf.nk)return a.sf.nk;var b=a.Bg;Iq!==b&&(Iq=Jq.font=b);var c=0;void 0!==Dq[b]&&5E3>Eq?c=Dq[b]:(c=1.3*Jq.measureText("M").width,Dq[b]=c,Eq++);return a.sf.nk=c}
function Tq(a){Iq!==a&&(Iq=Jq.font=a);var b=0;void 0!==Fq[a]&&5E3>Gq?b=Fq[a]:(b=Jq.measureText(Hq).width,Fq[a]=b,Gq++);return b}
function Qq(a,b,c){var d=a.Zd.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),e=a.yi+a.zi,e=Math.max(0,Rq(a)+e);if(0===d.length)return c.Qe=0,a.ze=1,e;if(!a.oy){var g=d.indexOf("\n",0);0<=g&&(d=d.substr(0,g))}for(var g=0,h=a.ze=0,k=-1,l=!1;!l;)k=d.indexOf("\n",h),-1===k&&(k=d.length,l=!0),h<=k&&(h=d.substr(h,k-h),a.Dj!==Kq?(c.Cj=0,h=Pq(a,h,c,b),g+=h.height,a.ze+=c.Cj):(Pq(a,h,c,b),g+=e,a.ze++),a.ze===a.yh&&(l=!0)),h=k+1;return a.Gw=g}
D.defineProperty(na,{nC:"textValidation"},function(){return this.em},function(a){var b=this.em;b!==a&&(null!==a&&D.h(a,"function",na,"textValidation"),this.em=a,this.i("textValidation",b,a))});D.defineProperty(na,{mH:"textEdited"},function(){return this.Wt},function(a){var b=this.Wt;b!==a&&(null!==a&&D.h(a,"function",na,"textEdited"),this.Wt=a,this.i("textEdited",b,a))});
D.defineProperty(na,{FM:"spacingAbove"},function(){return this.yi},function(a){var b=this.yi;b!==a&&(v&&D.h(a,"number",na,"spacingAbove"),this.yi=a,this.i("spacingAbove",b,a))});D.defineProperty(na,{GM:"spacingBelow"},function(){return this.zi},function(a){var b=this.zi;b!==a&&(v&&D.h(a,"number",na,"spacingBelow"),this.zi=a,this.i("spacingBelow",b,a))});
D.defineProperty(na,{IJ:"maxLines"},function(){return this.yh},function(a){var b=this.yh;b!==a&&(v&&D.h(a,"number",na,"maxLines"),a=Math.floor(a),0>=a&&D.va(a,"> 0",na,"maxLines"),this.yh=a,this.i("maxLines",b,a),this.K())});D.w(na,{hM:"metrics"},function(){return this.sf});D.defineProperty(na,{pL:"choices"},function(){return this.yr},function(a){var b=this.yr;b!==a&&(null===a||Array.isArray(a)||D.mc(a,"Array",na,"choices:value"),this.yr=a,this.i("choices",b,a))});
function dq(){this.Qe=this.Cj=0;this.Hf=[];this.$e=[];this.nk=null}dq.prototype.reset=function(){this.Qe=this.Cj=0;this.nk=null;this.Hf=[];this.$e=[]};dq.prototype.lq=function(a){this.Cj=a.Cj;this.nk=a.nk;this.Qe=a.Qe;this.Hf=D.qm(a.Hf);this.$e=D.qm(a.$e)};D.w(dq,{mL:"arrSize"},function(){return this.Hf});D.w(dq,{nL:"arrText"},function(){return this.$e});D.w(dq,{gM:"maxLineWidth"},function(){return this.Qe});D.w(dq,{RL:"fontHeight"},function(){return this.nk});
function Gl(){O.call(this);this.bf=null;this.Qt="";this.Kk=ie;this.lp=Xe;this.Ci=this.cf=null;this.kp=mc;this.Ag=ak;this.Wp=null;this.cA=!1;this.fp=!0;this.Ew=!1;this.Op=null}D.Ta(Gl,O);D.ka("Picture",Gl);Gl.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.element=this.bf;a.Qt=this.Qt;a.Kk=this.Kk.V();a.lp=this.lp;a.Ag=this.Ag;a.cf=this.cf;a.Ci=this.Ci;a.kp=this.kp.V();a.fp=this.fp;a.Op=this.Op};
Gl.prototype.qc=function(a){a===ak||a===ck||a===Ao?this.hJ=a:O.prototype.qc.call(this,a)};Gl.prototype.toString=function(){return"Picture("+this.source+")#"+D.Nd(this)};var Vq=new ja,Wq=0,Al=[];function Xq(){var a=Al;if(0===a.length)for(var b=window.document.getElementsByTagName("canvas"),c=b.length,d=0;d<c;d++){var e=b[d];e.parentElement&&e.parentElement.ca&&a.push(e.parentElement.ca)}return a}var yn;
Gl.clearCache=yn=function(a){void 0===a&&(a="");D.h(a,"string",Gl,"clearCache:url");""!==a?Vq[a]&&(delete Vq[a],Wq--):(Vq=new ja,Wq=0)};
D.defineProperty(Gl,{element:"element"},function(){return this.bf},function(a){var b=this.bf;if(b!==a){null===a||a instanceof HTMLImageElement||a instanceof HTMLVideoElement||a instanceof HTMLCanvasElement||D.k("Picture.element must be an instance of Image, Canvas, or Video, not: "+a);this.cA=a instanceof HTMLCanvasElement;this.bf=a;if(null!==a)if(a instanceof HTMLCanvasElement||!0===a.complete)a.jp instanceof Event&&null!==this.cf&&this.cf(this,a.jp),!0===a.ts&&null!==this.Ci&&this.Ci(this,a.rA),
a.ts=!0,this.Ea.F()||(km(this,!1),this.K());else{var c=this;a.zD||(a.addEventListener("load",function(b){Yq(a,b);c.Ea.F()||(km(c,!1),c.K())}),a.addEventListener("error",function(b){Zq(a,b)}),a.zD=!0)}this.i("element",b,a);this.ra()}});
D.defineProperty(Gl,{source:"source"},function(){return this.Qt},function(a){var b=this.Qt;if(b!==a){D.h(a,"string",Gl,"source");this.Qt=a;var c=Vq,d=this.g;if(void 0!==c[a])var e=c[a].eq[0].source;else{30<Wq&&(yn(),c=Vq);var e=D.createElement("img"),g=this;e.addEventListener("load",function(a){Yq(e,a);g.Ea.F()||(km(g,!1),g.K())});e.addEventListener("error",function(a){Zq(e,a)});e.zD=!0;var h=this.Op;null!==h&&(e.crossOrigin=h(this));e.src=a;c[a]=new $q(e);Wq++}null!==d&&xn(d,this);this.element=e;
null!==d&&wn(d,this);this.K();this.ra();this.i("source",b,a)}});function Yq(a,b){a.ts=!0;a.jp=!1;for(var c=null,d=Xq(),e=d.length,g=0;g<e;g++){var h=d[g],k=h.Hp.oa(a.src);if(null!==k)for(var l=k.length,m=0;m<l;m++)c=k[m],h.nA.add(c),h.Le(),null===a.rA&&(a.rA=b,null!==c.Ci&&c.Ci(c,b))}}function Zq(a,b){a.jp=b;for(var c=null,d=Xq(),e=d.length,g=0;g<e;g++)if(c=d[g].Hp.oa(a.src),null!==c){for(var h=c.length,k=D.hb(),l=0;l<h;l++)k.push(c[l]);for(l=0;l<h;l++)c=k[l],null!==c.cf&&c.cf(c,b);D.ua(k)}}
D.defineProperty(Gl,{EM:"sourceCrossOrigin"},function(){return this.Op},function(a){if(this.Op!==a&&(null!==a&&D.h(a,"function",Gl,"sourceCrossOrigin"),this.Op=a,null!==this.element)){var b=this.element.src;null===a&&"string"===typeof b?this.element.crossOrigin=null:null!==a&&(this.element.crossOrigin=a(this));this.element.src=b}});
D.defineProperty(Gl,{ak:"sourceRect"},function(){return this.Kk},function(a){var b=this.Kk;b.P(a)||(D.l(a,C,Gl,"sourceRect"),this.Kk=a=a.V(),this.ra(),this.i("sourceRect",b,a))});D.defineProperty(Gl,{hJ:"imageStretch"},function(){return this.lp},function(a){var b=this.lp;b!==a&&(D.Da(a,O,Gl,"imageStretch"),this.lp=a,this.ra(),this.i("imageStretch",b,a))});
D.defineProperty(Gl,{Cu:"flip"},function(){return this.Ag},function(a){var b=this.Ag;b!==a&&(D.Da(a,O,Gl,"flip"),this.Ag=a,this.ra(),this.i("flip",b,a))});D.defineProperty(Gl,{TL:"imageAlignment"},function(){return this.kp},function(a){D.l(a,R,Gl,"imageAlignment");var b=this.kp;b.P(a)||(this.kp=a=a.V(),this.K(),this.i("imageAlignment",b,a))});
D.defineProperty(Gl,{dB:"errorFunction"},function(){return this.cf},function(a){var b=this.cf;b!==a&&(null!==a&&D.h(a,"function",Gl,"errorFunction"),this.cf=a,this.i("errorFunction",b,a))});D.defineProperty(Gl,{OM:"successFunction"},function(){return this.Ci},function(a){var b=this.Ci;b!==a&&(null!==a&&D.h(a,"function",Gl,"successFunction"),this.Ci=a,this.i("successFunction",b,a))});
Gl.prototype.Zk=function(a,b){var c=this.bf;if(null!==c){var d=c.src;null!==d&&""!==d||D.k('Element has no source ("src") attribute: '+c);if(!(c.jp instanceof Event)&&!1!==c.ts){var d=this.Fa,e=0,g=0,h=this.cA,k=h?+c.width:c.naturalWidth,h=h?+c.height:c.naturalHeight;void 0===k&&c.videoWidth&&(k=c.videoWidth);void 0===h&&c.videoHeight&&(h=c.videoHeight);k=k||d.width;h=h||d.height;if(0!==k&&0!==h){var l=k,m=h;this.ak.F()&&(e=this.Kk.x,g=this.Kk.y,k=this.Kk.width,h=this.Kk.height);var n=k,p=h,q=this.lp,
r=this.kp;switch(q){case ak:if(this.ak.F())break;n>=d.width&&(e=e+r.offsetX+(n*r.x-d.width*r.x));p>=d.height&&(g=g+r.offsetY+(p*r.y-d.height*r.y));k=Math.min(d.width,n);h=Math.min(d.height,p);break;case Xe:n=d.width;p=d.height;break;case ck:case Ao:var s=0;q===ck?(s=Math.min(d.height/p,d.width/n),n*=s,p*=s):q===Ao&&(s=Math.max(d.height/p,d.width/n),n*=s,p*=s,n>=d.width&&(e=(e+r.offsetX+(n*r.x-d.width*r.x)/n)*k),p>=d.height&&(g=(g+r.offsetY+(p*r.y-d.height*r.y)/p)*h),k*=1/(n/d.width),h*=1/(p/d.height),
n=d.width,p=d.height)}var q=this.Mj()*b.scale,t=k*h/(n*q*p*q),s=Vq[this.source],q=null;if(c.ts&&void 0!==s&&16<t){2>s.eq.length&&(ar(s,4,l,m),ar(s,16,l,m));for(var l=s.eq,m=l.length,q=l[0],u=0;u<m;u++)if(l[u].Sq*l[u].Sq<t)q=l[u];else break}if(!b.Yr){if(null===this.Wp)if(null===this.bf)this.Wp=!1;else{l=(new ia(null)).Xk;l.drawImage(this.bf,0,0);try{l.getImageData(0,0,1,1).data[3]&&(this.Wp=!1),this.Wp=!1}catch(z){this.Wp=!0}}if(this.Wp)return}l=0;n<d.width&&(l=r.offsetX+(d.width*r.x-n*r.x));m=0;p<
d.height&&(m=r.offsetY+(d.height*r.y-p*r.y));switch(this.Cu){case Co:a.translate(Math.min(d.width,n),0);a.scale(-1,1);break;case Bo:a.translate(0,Math.min(d.height,p));a.scale(1,-1);break;case Do:a.translate(Math.min(d.width,n),Math.min(d.height,p)),a.scale(-1,-1)}if(b.el("pictureRatioOptimization")&&!b.cn&&void 0!==s&&null!==q&&1!==q.Sq){a.save();s=q.Sq;try{a.drawImage(q.source,e/s,g/s,Math.min(q.source.width,k/s),Math.min(q.source.height,h/s),l,m,Math.min(d.width,n),Math.min(d.height,p))}catch(w){v&&
this.fp&&D.trace(w.toString()),this.fp=!1}a.restore()}else try{a.drawImage(c,e,g,k,h,l,m,Math.min(d.width,n),Math.min(d.height,p))}catch(y){v&&this.fp&&D.trace(y.toString()),this.fp=!1}switch(this.Cu){case Co:a.scale(-1,1);a.translate(-Math.min(d.width,n),0);break;case Bo:a.scale(1,-1);a.translate(0,-Math.min(d.height,p));break;case Do:a.scale(-1,-1),a.translate(-Math.min(d.width,n),-Math.min(d.height,p))}}}}};D.w(Gl,{Fa:"naturalBounds"},function(){return this.Xc});
Gl.prototype.oo=function(a,b,c,d){var e=this.Ea,g=Oo(this,!0),h=this.bf,k=this.cA;if(k||!this.Ew&&h&&h.complete)this.Ew=!0;null===h&&(isFinite(e.width)||(a=0),isFinite(e.height)||(b=0));isFinite(e.width)||g===Xe||g===zo?(isFinite(a)||(a=this.ak.F()?this.ak.width:k?+h.width:h.naturalWidth),c=0):null!==h&&!1!==this.Ew&&(a=this.ak.F()?this.ak.width:k?+h.width:h.naturalWidth);isFinite(e.height)||g===Xe||g===yo?(isFinite(b)||(b=this.ak.F()?this.ak.height:k?+h.height:h.naturalHeight),d=0):null!==h&&!1!==
this.Ew&&(b=this.ak.F()?this.ak.height:k?+h.height:h.naturalHeight);isFinite(e.width)&&(a=e.width);isFinite(e.height)&&(b=e.height);e=this.pf;g=this.$g;c=Math.max(c,g.width);d=Math.max(d,g.height);a=Math.min(e.width,a);b=Math.min(e.height,b);a=Math.max(c,a);b=Math.max(d,b);null===h||h.complete||(isFinite(a)||(a=0),isFinite(b)||(b=0));Cb(this.Xc,a,b);Lo(this,0,0,a,b)};Gl.prototype.Fj=function(a,b,c,d){So(this,a,b,c,d)};function $q(a){this.eq=[new br(a,1)]}
function ar(a,b,c,d){var e=new ia(null),g=e.Xk,h=1/b;e.width=c/b;e.height=d/b;b=new br(e.ae,b);c=a.eq[a.eq.length-1];g.setTransform(h*c.Sq,0,0,h*c.Sq,0,0);g.drawImage(c.source,0,0);a.eq.push(b)}function br(a,b){this.source=a;this.Sq=b}function Ea(){this.q=new Ue;this.fc=null}f=Ea.prototype;f.reset=function(){this.q=new Ue;this.fc=null};
function S(a,b,c,d,e,g){null===a.q&&D.k("StreamGeometryContext has been closed");void 0!==e&&!0===e?(null===a.fc&&D.k("Need to call beginFigure first"),d=new Zf(Df),d.G=b,d.H=c,a.fc.Fb.add(d)):(a.fc=new We,a.fc.la=b,a.fc.ja=c,a.fc.Pu=d,a.q.pc.add(a.fc));void 0!==g&&(a.fc.rp=g)}function V(a){null===a.q&&D.k("StreamGeometryContext has been closed");null===a.fc&&D.k("Need to call beginFigure first");var b=a.fc.Fb.length;0<b&&a.fc.Fb.fa(b-1).close()}
function Af(a){null===a.q&&D.k("StreamGeometryContext has been closed");null===a.fc&&D.k("Need to call beginFigure first");0<a.fc.Fb.length&&(a.fc.Pu=!0)}f.nb=function(a){null===this.q&&D.k("StreamGeometryContext has been closed");null===this.fc&&D.k("Need to call beginFigure first");this.fc.jl=a};f.moveTo=function(a,b,c){void 0===c&&(c=!1);null===this.q&&D.k("StreamGeometryContext has been closed");null===this.fc&&D.k("Need to call beginFigure first");var d=new Zf(Df);d.G=a;d.H=b;c&&d.close();this.fc.Fb.add(d)};
f.lineTo=function(a,b,c){void 0===c&&(c=!1);null===this.q&&D.k("StreamGeometryContext has been closed");null===this.fc&&D.k("Need to call beginFigure first");var d=new Zf(vf);d.G=a;d.H=b;c&&d.close();this.fc.Fb.add(d)};function T(a,b,c,d,e,g,h,k){void 0===k&&(k=!1);null===a.q&&D.k("StreamGeometryContext has been closed");null===a.fc&&D.k("Need to call beginFigure first");var l=new Zf(Ef);l.Gc=b;l.bd=c;l.Xh=d;l.Yh=e;l.G=g;l.H=h;k&&l.close();a.fc.Fb.add(l)}
function yf(a,b,c,d,e){var g;void 0===g&&(g=!1);null===a.q&&D.k("StreamGeometryContext has been closed");null===a.fc&&D.k("Need to call beginFigure first");var h=new Zf(Ff);h.Gc=b;h.bd=c;h.G=d;h.H=e;g&&h.close();a.fc.Fb.add(h)}f.arcTo=function(a,b,c,d,e,g,h){void 0===g&&(g=0);void 0===h&&(h=!1);null===this.q&&D.k("StreamGeometryContext has been closed");null===this.fc&&D.k("Need to call beginFigure first");var k=new Zf(Gf);k.Ne=a;k.Ef=b;k.pa=c;k.wa=d;k.radiusX=e;k.radiusY=0!==g?g:e;h&&k.close();this.fc.Fb.add(k)};
function zf(a,b,c,d,e,g,h,k){var l;void 0===l&&(l=!1);null===a.q&&D.k("StreamGeometryContext has been closed");null===a.fc&&D.k("Need to call beginFigure first");b=new Zf(Hf,h,k,b,c,d,e,g);l&&b.close();a.fc.Fb.add(b)}function cr(a){a=dr(a);var b=D.hb();b[0]=a[0];for(var c=1,d=1;d<a.length;)b[c]=a[d],b[c+1]=a[d],b[c+2]=a[d+1],d+=2,c+=3;D.ua(a);return b}
function dr(a){var b=er(a),c=D.hb(),d=Math.floor(b.length/2),e=b.length-1;a=0===a%2?2:1;for(var g=0;g<e;g++){var h=b[g],k=b[g+1],l=b[(d+g-1)%e],m=b[(d+g+a)%e];c[2*g]=h;c[2*g+1]=Je(h.x,h.y,l.x,l.y,k.x,k.y,m.x,m.y,new N)}c[c.length]=c[0];D.ua(b);return c}function er(a){for(var b=D.hb(),c=1.5*Math.PI,d=0,e=0;e<a;e++)d=2*Math.PI/a*e+c,b[e]=new N(.5+.5*Math.cos(d),.5+.5*Math.sin(d));b.push(b[0]);return b}
var sq={None:"Rectangle",Rectangle:function(a,b,c){a=new Ue;a.type=Ze;a.la=0;a.ja=0;a.G=b;a.H=c;return a},Square:function(a,b,c){a=new Ue;a.ne=ck;a.type=Ze;a.la=0;a.ja=0;a.G=Math.min(b,c);a.H=Math.min(b,c);return a},Ellipse:function(a,b,c){a=new Ue;a.type=tf;a.la=0;a.ja=0;a.G=b;a.H=c;a.C=je;a.D=ke;return a},Circle:function(a,b,c){a=new Ue;a.ne=ck;a.type=tf;a.la=0;a.ja=0;a.G=Math.min(b,c);a.H=Math.min(b,c);a.C=je;a.D=ke;return a},Connector:"Ellipse",TriangleRight:function(a,b,c){a=new Ue;var d=new We,
e=new Zf;e.G=b;e.H=.5*c;d.Fb.add(e);b=new Zf;b.G=0;b.H=c;d.Fb.add(b.close());a.pc.add(d);a.C=new R(0,.25);a.D=new R(.5,.75);return a},TriangleDown:function(a,b,c){a=new Ue;var d=new We,e=new Zf;e.G=b;e.H=0;d.Fb.add(e);e=new Zf;e.G=.5*b;e.H=c;d.Fb.add(e.close());a.pc.add(d);a.C=new R(.25,0);a.D=new R(.75,.5);return a},TriangleLeft:function(a,b,c){a=new Ue;var d=new We;d.la=b;d.ja=c;var e=new Zf;e.G=0;e.H=.5*c;d.Fb.add(e);c=new Zf;c.G=b;c.H=0;d.Fb.add(c.close());a.pc.add(d);a.C=new R(.5,.25);a.D=new R(1,
.75);return a},TriangleUp:function(a,b,c){a=new Ue;var d=new We;d.la=b;d.ja=c;var e=new Zf;e.G=0;e.H=c;d.Fb.add(e);c=new Zf;c.G=.5*b;c.H=0;d.Fb.add(c.close());a.pc.add(d);a.C=new R(.25,.5);a.D=new R(.75,1);return a},Line1:function(a,b,c){a=new Ue;a.type=Ye;a.la=0;a.ja=0;a.G=b;a.H=c;return a},Line2:function(a,b,c){a=new Ue;a.type=Ye;a.la=b;a.ja=0;a.G=0;a.H=c;return a},MinusLine:"LineH",LineH:function(a,b,c){a=new Ue;a.type=Ye;a.la=0;a.ja=c/2;a.G=b;a.H=c/2;return a},LineV:function(a,b,c){a=new Ue;a.type=
Ye;a.la=b/2;a.ja=0;a.G=b/2;a.H=c;return a},BarH:"Rectangle",BarV:"Rectangle",Curve1:function(a,b,c){a=D.v();S(a,0,0,!1);T(a,Id*b,0,1*b,(1-Id)*c,b,c);b=a.q;D.u(a);return b},Curve2:function(a,b,c){a=D.v();S(a,0,0,!1);T(a,0,Id*c,(1-Id)*b,c,b,c);b=a.q;D.u(a);return b},Curve3:function(a,b,c){a=D.v();S(a,1*b,0,!1);T(a,1*b,Id*c,Id*b,1*c,0,1*c);b=a.q;D.u(a);return b},Curve4:function(a,b,c){a=D.v();S(a,1*b,0,!1);T(a,(1-Id)*b,0,0,(1-Id)*c,0,1*c);b=a.q;D.u(a);return b},Alternative:"Triangle",Merge:"Triangle",
Triangle:function(a,b,c){a=D.v();S(a,.5*b,0*c,!0);a.lineTo(0*b,1*c);a.lineTo(1*b,1*c,!0);b=a.q;b.C=new R(.25,.5);b.D=new R(.75,1);D.u(a);return b},Decision:"Diamond",Diamond:function(a,b,c){a=D.v();S(a,.5*b,0,!0);a.lineTo(0,.5*c);a.lineTo(.5*b,1*c);a.lineTo(1*b,.5*c,!0);b=a.q;b.C=new R(.25,.25);b.D=new R(.75,.75);D.u(a);return b},Pentagon:function(a,b,c){var d=er(5);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;5>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ua(d);V(a);b=a.q;b.C=new R(.2,.22);b.D=new R(.8,
.9);D.u(a);return b},DataTransmission:"Hexagon",Hexagon:function(a,b,c){var d=er(6);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;6>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ua(d);V(a);b=a.q;b.C=new R(.07,.25);b.D=new R(.93,.75);D.u(a);return b},Heptagon:function(a,b,c){var d=er(7);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;7>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ua(d);V(a);b=a.q;b.C=new R(.2,.15);b.D=new R(.8,.85);D.u(a);return b},Octagon:function(a,b,c){var d=er(8);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);
for(var e=1;8>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ua(d);V(a);b=a.q;b.C=new R(.15,.15);b.D=new R(.85,.85);D.u(a);return b},Nonagon:function(a,b,c){var d=er(9);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;9>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ua(d);V(a);b=a.q;b.C=new R(.17,.13);b.D=new R(.82,.82);D.u(a);return b},Decagon:function(a,b,c){var d=er(10);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;10>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ua(d);V(a);b=a.q;b.C=new R(.16,.16);b.D=new R(.84,.84);D.u(a);return b},
Dodecagon:function(a,b,c){var d=er(12);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;12>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ua(d);V(a);b=a.q;b.C=new R(.16,.16);b.D=new R(.84,.84);D.u(a);return b},FivePointedStar:function(a,b,c){var d=dr(5);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;10>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ua(d);V(a);b=a.q;b.C=new R(.312,.383);b.D=new R(.693,.765);D.u(a);return b},SixPointedStar:function(a,b,c){var d=dr(6);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;12>e;e++)a.lineTo(d[e].x*
b,d[e].y*c);D.ua(d);V(a);b=a.q;b.C=new R(.17,.251);b.D=new R(.833,.755);D.u(a);return b},SevenPointedStar:function(a,b,c){var d=dr(7);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;14>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ua(d);V(a);b=a.q;b.C=new R(.363,.361);b.D=new R(.641,.709);D.u(a);return b},EightPointedStar:function(a,b,c){var d=dr(8);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;16>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ua(d);V(a);b=a.q;b.C=new R(.252,.255);b.D=new R(.75,.75);D.u(a);return b},NinePointedStar:function(a,
b,c){var d=dr(9);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;18>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ua(d);V(a);b=a.q;b.C=new R(.355,.361);b.D=new R(.645,.651);D.u(a);return b},TenPointedStar:function(a,b,c){var d=dr(10);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;20>e;e++)a.lineTo(d[e].x*b,d[e].y*c);D.ua(d);V(a);b=a.q;b.C=new R(.281,.261);b.D=new R(.723,.748);D.u(a);return b},FivePointedBurst:function(a,b,c){var d=cr(5);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)T(a,d[e].x*
b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);D.ua(d);V(a);b=a.q;b.C=new R(.312,.383);b.D=new R(.693,.765);D.u(a);return b},SixPointedBurst:function(a,b,c){var d=cr(6);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)T(a,d[e].x*b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);D.ua(d);V(a);b=a.q;b.C=new R(.17,.251);b.D=new R(.833,.755);D.u(a);return b},SevenPointedBurst:function(a,b,c){var d=cr(7);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)T(a,d[e].x*
b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);D.ua(d);V(a);b=a.q;b.C=new R(.363,.361);b.D=new R(.641,.709);D.u(a);return b},EightPointedBurst:function(a,b,c){var d=cr(8);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)T(a,d[e].x*b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);D.ua(d);V(a);b=a.q;b.C=new R(.252,.255);b.D=new R(.75,.75);D.u(a);return b},NinePointedBurst:function(a,b,c){var d=cr(9);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)T(a,d[e].x*
b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);D.ua(d);V(a);b=a.q;b.C=new R(.355,.361);b.D=new R(.645,.651);D.u(a);return b},TenPointedBurst:function(a,b,c){var d=cr(10);a=D.v();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)T(a,d[e].x*b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);D.ua(d);V(a);b=a.q;b.C=new R(.281,.261);b.D=new R(.723,.748);D.u(a);return b},Cloud:function(a,b,c){a=D.v();S(a,.08034461*b,.1944299*c,!0);T(a,-.09239631*b,.07836421*c,.1406031*b,-.0542823*c,.2008615*
b,.05349299*c);T(a,.2450511*b,-.00697547*c,.3776197*b,-.01112067*c,.4338609*b,.074219*c);T(a,.4539471*b,0,.6066018*b,-.02526587*c,.6558228*b,.07004196*c);T(a,.6914277*b,-.01904177*c,.8921095*b,-.01220843*c,.8921095*b,.08370865*c);T(a,1.036446*b,.04105738*c,1.020377*b,.3022052*c,.9147671*b,.3194596*c);T(a,1.04448*b,.360238*c,.992256*b,.5219009*c,.9082935*b,.562044*c);T(a,1.032337*b,.5771781*c,1.018411*b,.8120651*c,.9212406*b,.8217117*c);T(a,1.028411*b,.9571472*c,.8556702*b,1.052487*c,.7592566*b,.9156953*
c);T(a,.7431877*b,1.009325*c,.5624123*b,1.021761*c,.5101666*b,.9310455*c);T(a,.4820677*b,1.031761*c,.3030112*b,1.002796*c,.2609328*b,.9344623*c);T(a,.2329994*b,1.01518*c,.03213784*b,1.01518*c,.08034461*b,.870098*c);T(a,-.02812061*b,.9032597*c,-.01205169*b,.6835638*c,.06829292*b,.6545475*c);T(a,-.01812061*b,.6089503*c,-.00606892*b,.4555777*c,.06427569*b,.4265613*c);T(a,-.01606892*b,.3892545*c,-.01205169*b,.1944299*c,.08034461*b,.1944299*c);V(a);b=a.q;b.C=new R(.1,.1);b.D=new R(.9,.9);D.u(a);return b},
Gate:"Crescent",Crescent:function(a,b,c){a=D.v();S(a,0,0,!0);T(a,1*b,0,1*b,1*c,0,1*c);T(a,.5*b,.75*c,.5*b,.25*c,0,0);V(a);b=a.q;b.C=new R(.511,.19);b.D=new R(.776,.76);D.u(a);return b},FramedRectangle:function(a,b,c){var d=D.v(),e=a?a.Uc:NaN;a=a?a.iv:NaN;isNaN(e)&&(e=.1);isNaN(a)&&(a=.1);S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c,!0);S(d,e*b,a*c,!1,!0);d.lineTo(e*b,(1-a)*c);d.lineTo((1-e)*b,(1-a)*c);d.lineTo((1-e)*b,a*c,!0);b=d.q;b.C=new R(e,a);b.D=new R(1-e,1-a);D.u(d);return b},
Delay:"HalfEllipse",HalfEllipse:function(a,b,c){a=D.v();S(a,0,0,!0);T(a,Id*b,0,1*b,(.5-Id/2)*c,1*b,.5*c);T(a,1*b,(.5+Id/2)*c,Id*b,1*c,0,1*c);V(a);b=a.q;b.C=new R(0,.2);b.D=new R(.75,.8);D.u(a);return b},Heart:function(a,b,c){a=D.v();S(a,.5*b,1*c,!0);T(a,.1*b,.8*c,0,.5*c,0*b,.3*c);T(a,0*b,0,.45*b,0,.5*b,.3*c);T(a,.55*b,0,1*b,0,1*b,.3*c);T(a,b,.5*c,.9*b,.8*c,.5*b,1*c);V(a);b=a.q;b.C=new R(.15,.29);b.D=new R(.86,.68);D.u(a);return b},Spade:function(a,b,c){a=D.v();S(a,.5*b,0,!0);a.lineTo(.51*b,.01*c);
T(a,.6*b,.2*c,b,.25*c,b,.5*c);T(a,b,.8*c,.6*b,.8*c,.55*b,.7*c);T(a,.5*b,.75*c,.55*b,.95*c,.75*b,c);a.lineTo(.25*b,c);T(a,.45*b,.95*c,.5*b,.75*c,.45*b,.7*c);T(a,.4*b,.8*c,0,.8*c,0,.5*c);T(a,0,.25*c,.4*b,.2*c,.49*b,.01*c);V(a);b=a.q;b.C=new R(.19,.26);b.D=new R(.8,.68);D.u(a);return b},Club:function(a,b,c){a=D.v();S(a,.4*b,.6*c,!0);T(a,.5*b,.75*c,.45*b,.95*c,.15*b,1*c);a.lineTo(.85*b,c);T(a,.55*b,.95*c,.5*b,.75*c,.6*b,.6*c);var d=.2,e=.3,g=0,h=4*(Math.SQRT2-1)/3*d;T(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*
b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);T(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*c);T(a,(.5+d+e)*b,(.5-h+g)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);T(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e+.05)*b,(.5-h+g-.02)*c,.65*b,.36771243*c);d=.2;e=0;g=-.3;h=4*(Math.SQRT2-1)/3*d;T(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*c);T(a,(.5+d+e)*b,(.5-h+g)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);T(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);T(a,(.5-d+
e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,.35*b,.36771243*c);d=.2;e=-.3;g=0;h=4*(Math.SQRT2-1)/3*d;T(a,(.5+d+e-.05)*b,(.5-h+g-.02)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);T(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);T(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);T(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,.4*b,.6*c);V(a);b=a.q;b.C=new R(.06,.39);b.D=new R(.93,.58);D.u(a);return b},Ring:function(a,b,c){a=D.v();var d=4*(Math.SQRT2-1)/3*.5;S(a,b,.5*
c,!0);T(a,b,(.5-d)*c,(.5+d)*b,0,.5*b,0);T(a,(.5-d)*b,0,0,(.5-d)*c,0,.5*c);T(a,0,(.5+d)*c,(.5-d)*b,c,.5*b,c);T(a,(.5+d)*b,c,b,(.5+d)*c,b,.5*c);d=4*(Math.SQRT2-1)/3*.4;S(a,.5*b,.1*c,!0,!0);T(a,(.5+d)*b,.1*c,.9*b,(.5-d)*c,.9*b,.5*c);T(a,.9*b,(.5+d)*c,(.5+d)*b,.9*c,.5*b,.9*c);T(a,(.5-d)*b,.9*c,.1*b,(.5+d)*c,.1*b,.5*c);T(a,.1*b,(.5-d)*c,(.5-d)*b,.1*c,.5*b,.1*c);b=a.q;b.C=new R(.146,.146);b.D=new R(.853,.853);b.ne=ck;D.u(a);return b},YinYang:function(a,b,c){var d=.5;a=D.v();d=.5;S(a,.5*b,0,!0);a.arcTo(270,
180,.5*b,.5*b,.5*b);T(a,1*b,d*c,0,d*c,d*b,0,!0);var d=.1,e=.25;S(a,(.5+d)*b,e*c,!0,!0);a.arcTo(0,-360,.5*b,c*e,d*b);V(a);S(a,.5*b,0,!1);a.arcTo(270,-180,.5*b,.5*b,.5*b);a.nb(!1);e=.75;S(a,(.5+d)*b,e*c,!0);a.arcTo(0,360,.5*b,c*e,d*b);V(a);b=a.q;b.ne=ck;D.u(a);return b},Peace:function(a,b,c){a=D.v();var d=4*(Math.SQRT2-1)/3*.5;S(a,b,.5*c,!0);T(a,b,(.5-d)*c,(.5+d)*b,0,.5*b,0);T(a,(.5-d)*b,0,0,(.5-d)*c,0,.5*c);T(a,0,(.5+d)*c,(.5-d)*b,c,.5*b,c);T(a,(.5+d)*b,c,b,(.5+d)*c,b,.5*c);d=4*(Math.SQRT2-1)/3*.4;
S(a,.5*b,.1*c,!0,!0);T(a,(.5+d)*b,.1*c,.9*b,(.5-d)*c,.9*b,.5*c);T(a,.9*b,(.5+d)*c,(.5+d)*b,.9*c,.5*b,.9*c);T(a,(.5-d)*b,.9*c,.1*b,(.5+d)*c,.1*b,.5*c);T(a,.1*b,(.5-d)*c,(.5-d)*b,.1*c,.5*b,.1*c);var d=.07,e=0,g=-.707*.11,h=4*(Math.SQRT2-1)/3*d;S(a,(.5+d+e)*b,(.5+g)*c,!0);T(a,(.5+d+e)*b,(.5-h+g)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);T(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);T(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);T(a,(.5+h+e)*b,(.5+d+g)*
c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*c);d=.07;e=-.707*.11;g=.707*.11;h=4*(Math.SQRT2-1)/3*d;S(a,(.5+d+e)*b,(.5+g)*c,!0);T(a,(.5+d+e)*b,(.5-h+g)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);T(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);T(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);T(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*c);d=.07;e=.707*.11;g=.707*.11;h=4*(Math.SQRT2-1)/3*d;S(a,(.5+d+e)*b,(.5+g)*c,!0);T(a,(.5+d+e)*b,(.5-h+
g)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);T(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);T(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);T(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*c);b=a.q;b.C=new R(.146,.146);b.D=new R(.853,.853);b.ne=ck;D.u(a);return b},NotAllowed:function(a,b,c){var d=.5*Id,e=.5;a=D.v();S(a,.5*b,(.5-e)*c,!0);T(a,(.5-d)*b,(.5-e)*c,(.5-e)*b,(.5-d)*c,(.5-e)*b,.5*c);T(a,(.5-e)*b,(.5+d)*c,(.5-d)*b,(.5+e)*c,.5*b,
(.5+e)*c);T(a,(.5+d)*b,(.5+e)*c,(.5+e)*b,(.5+d)*c,(.5+e)*b,.5*c);T(a,(.5+e)*b,(.5-d)*c,(.5+d)*b,(.5-e)*c,.5*b,(.5-e)*c);var e=.4,d=.4*Id,g=D.O(),h=D.O(),k=D.O(),l=D.O();te(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.42,g,h,k,l,l);var m=D.O(),n=D.O(),p=D.O();te(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.58,l,l,p,m,n);var q=D.O(),r=D.O(),s=D.O();te(.5,.5+e,.5-d,.5+e,.5-e,.5+d,.5-e,.5,.42,q,r,s,l,l);var t=D.O(),u=D.O(),z=D.O();te(.5,.5+e,.5-d,.5+e,.5-e,.5+d,.5-e,.5,.58,l,l,z,t,u);S(a,z.x*b,z.y*c,!0,!0);T(a,t.x*b,
t.y*c,u.x*b,u.y*c,(.5-e)*b,.5*c);T(a,(.5-e)*b,(.5-d)*c,(.5-d)*b,(.5-e)*c,.5*b,(.5-e)*c);T(a,g.x*b,g.y*c,h.x*b,h.y*c,k.x*b,k.y*c);a.lineTo(z.x*b,z.y*c);V(a);S(a,s.x*b,s.y*c,!0,!0);a.lineTo(p.x*b,p.y*c);T(a,m.x*b,m.y*c,n.x*b,n.y*c,(.5+e)*b,.5*c);T(a,(.5+e)*b,(.5+d)*c,(.5+d)*b,(.5+e)*c,.5*b,(.5+e)*c);T(a,q.x*b,q.y*c,r.x*b,r.y*c,s.x*b,s.y*c);V(a);D.A(g);D.A(h);D.A(k);D.A(l);D.A(m);D.A(n);D.A(p);D.A(q);D.A(r);D.A(s);D.A(t);D.A(u);D.A(z);b=a.q;D.u(a);b.ne=ck;return b},Fragile:function(a,b,c){a=D.v();S(a,
0,0,!0);a.lineTo(.25*b,0);a.lineTo(.2*b,.15*c);a.lineTo(.3*b,.25*c);a.lineTo(.29*b,.33*c);a.lineTo(.35*b,.25*c);a.lineTo(.3*b,.15*c);a.lineTo(.4*b,0);a.lineTo(1*b,0);T(a,1*b,.25*c,.75*b,.5*c,.55*b,.5*c);a.lineTo(.55*b,.9*c);a.lineTo(.7*b,.9*c);a.lineTo(.7*b,1*c);a.lineTo(.3*b,1*c);a.lineTo(.3*b,.9*c);a.lineTo(.45*b,.9*c);a.lineTo(.45*b,.5*c);T(a,.25*b,.5*c,0,.25*c,0,0);V(a);b=a.q;b.C=new R(.25,0);b.D=new R(.75,.4);D.u(a);return b},HourGlass:function(a,b,c){a=D.v();S(a,.65*b,.5*c,!0);a.lineTo(1*b,
1*c);a.lineTo(0,1*c);a.lineTo(.35*b,.5*c);a.lineTo(0,0);a.lineTo(1*b,0);V(a);b=a.q;D.u(a);return b},Lightning:function(a,b,c){a=D.v();S(a,0*b,.55*c,!0);a.lineTo(.75*b,0);a.lineTo(.25*b,.45*c);a.lineTo(.9*b,.48*c);a.lineTo(.4*b,1*c);a.lineTo(.65*b,.55*c);V(a);b=a.q;D.u(a);return b},Parallelogram1:function(a,b,c){a=a?a.Uc:NaN;isNaN(a)&&(a=.1);var d=D.v();S(d,a*b,0,!0);d.lineTo(1*b,0);d.lineTo((1-a)*b,1*c);d.lineTo(0,1*c);V(d);b=d.q;b.C=new R(a,0);b.D=new R(1-a,1);D.u(d);return b},Input:"Output",Output:function(a,
b,c){a=D.v();S(a,0,1*c,!0);a.lineTo(.1*b,0);a.lineTo(1*b,0);a.lineTo(.9*b,1*c);V(a);b=a.q;b.C=new R(.1,0);b.D=new R(.9,1);D.u(a);return b},Parallelogram2:function(a,b,c){a=a?a.Uc:NaN;isNaN(a)&&(a=.25);var d=D.v();S(d,a*b,0,!0);d.lineTo(1*b,0);d.lineTo((1-a)*b,1*c);d.lineTo(0,1*c);V(d);b=d.q;b.C=new R(a,0);b.D=new R(1-a,1);D.u(d);return b},ThickCross:function(a,b,c){a=a?a.Uc:NaN;isNaN(a)&&(a=.25);var d=D.v();S(d,(.5-a/2)*b,0,!0);d.lineTo((.5+a/2)*b,0);d.lineTo((.5+a/2)*b,(.5-a/2)*c);d.lineTo(1*b,(.5-
a/2)*c);d.lineTo(1*b,(.5+a/2)*c);d.lineTo((.5+a/2)*b,(.5+a/2)*c);d.lineTo((.5+a/2)*b,1*c);d.lineTo((.5-a/2)*b,1*c);d.lineTo((.5-a/2)*b,(.5+a/2)*c);d.lineTo(0,(.5+a/2)*c);d.lineTo(0,(.5-a/2)*c);d.lineTo((.5-a/2)*b,(.5-a/2)*c);V(d);b=d.q;b.C=new R(.5-a/2,.5-a/2);b.D=new R(.5+a/2,.5+a/2);D.u(d);return b},ThickX:function(a,b,c){a=.25/Math.SQRT2;var d=D.v();S(d,.3*b,0,!0);d.lineTo(.5*b,.2*c);d.lineTo(.7*b,0);d.lineTo(1*b,.3*c);d.lineTo(.8*b,.5*c);d.lineTo(1*b,.7*c);d.lineTo(.7*b,1*c);d.lineTo(.5*b,.8*
c);d.lineTo(.3*b,1*c);d.lineTo(0,.7*c);d.lineTo(.2*b,.5*c);d.lineTo(0,.3*c);V(d);b=d.q;b.C=new R(.5-a,.5-a);b.D=new R(.5+a,.5+a);D.u(d);return b},ThinCross:function(a,b,c){var d=a?a.Uc:NaN;isNaN(d)&&(d=.1);a=D.v();S(a,(.5-d/2)*b,0,!0);a.lineTo((.5+d/2)*b,0);a.lineTo((.5+d/2)*b,(.5-d/2)*c);a.lineTo(1*b,(.5-d/2)*c);a.lineTo(1*b,(.5+d/2)*c);a.lineTo((.5+d/2)*b,(.5+d/2)*c);a.lineTo((.5+d/2)*b,1*c);a.lineTo((.5-d/2)*b,1*c);a.lineTo((.5-d/2)*b,(.5+d/2)*c);a.lineTo(0,(.5+d/2)*c);a.lineTo(0,(.5-d/2)*c);a.lineTo((.5-
d/2)*b,(.5-d/2)*c);V(a);b=a.q;D.u(a);return b},ThinX:function(a,b,c){a=D.v();S(a,.1*b,0,!0);a.lineTo(.5*b,.4*c);a.lineTo(.9*b,0);a.lineTo(1*b,.1*c);a.lineTo(.6*b,.5*c);a.lineTo(1*b,.9*c);a.lineTo(.9*b,1*c);a.lineTo(.5*b,.6*c);a.lineTo(.1*b,1*c);a.lineTo(0,.9*c);a.lineTo(.4*b,.5*c);a.lineTo(0,.1*c);V(a);b=a.q;D.u(a);return b},RightTriangle:function(a,b,c){a=D.v();S(a,0,0,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);V(a);b=a.q;b.C=new R(0,.5);b.D=new R(.5,1);D.u(a);return b},RoundedIBeam:function(a,b,c){a=
D.v();S(a,0,0,!0);a.lineTo(1*b,0);T(a,.5*b,.25*c,.5*b,.75*c,1*b,1*c);a.lineTo(0,1*c);T(a,.5*b,.75*c,.5*b,.25*c,0,0);V(a);b=a.q;D.u(a);return b},RoundedRectangle:function(a,b,c){var d=a?a.Uc:NaN;isNaN(d)&&(d=5);d=Math.min(d,b/3);d=Math.min(d,c/3);a=d*Id;var e=D.v();S(e,d,0,!0);e.lineTo(b-d,0);T(e,b-a,0,b,a,b,d);e.lineTo(b,c-d);T(e,b,c-a,b-a,c,b-d,c);e.lineTo(d,c);T(e,a,c,0,c-a,0,c-d);e.lineTo(0,d);T(e,0,a,a,0,d,0);V(e);b=e.q;1<a?(b.C=new R(0,0,a,a),b.D=new R(1,1,-a,-a)):(b.C=ic,b.D=vc);D.u(e);return b},
Border:function(a,b,c){var d=a?a.Uc:NaN;isNaN(d)&&(d=5);d=Math.min(d,b/3);d=Math.min(d,c/3);a=D.v();S(a,d,0,!0);a.lineTo(b-d,0);T(a,b-0,0,b,0,b,d);a.lineTo(b,c-d);T(a,b,c-0,b-0,c,b-d,c);a.lineTo(d,c);T(a,0,c,0,c-0,0,c-d);a.lineTo(0,d);T(a,0,0,0,0,d,0);V(a);b=a.q;b.C=ic;b.D=vc;D.u(a);return b},SquareIBeam:function(a,b,c){var d=a?a.Uc:NaN;isNaN(d)&&(d=.2);a=D.v();S(a,0,0,!0);a.lineTo(1*b,0);a.lineTo(1*b,d*c);a.lineTo((.5+d/2)*b,d*c);a.lineTo((.5+d/2)*b,(1-d)*c);a.lineTo(1*b,(1-d)*c);a.lineTo(1*b,1*
c);a.lineTo(0,1*c);a.lineTo(0,(1-d)*c);a.lineTo((.5-d/2)*b,(1-d)*c);a.lineTo((.5-d/2)*b,d*c);a.lineTo(0,d*c);V(a);b=a.q;D.u(a);return b},Trapezoid:function(a,b,c){a=a?a.Uc:NaN;isNaN(a)&&(a=.2);var d=D.v();S(d,a*b,0,!0);d.lineTo((1-a)*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);V(d);b=d.q;b.C=new R(a,0);b.D=new R(1-a,1);D.u(d);return b},ManualLoop:"ManualOperation",ManualOperation:function(a,b,c){var d=a?a.Uc:NaN;isNaN(d)&&(d=0);a=D.v();S(a,d,0,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(.9*b,1*c);a.lineTo(.1*
b,1*c);V(a);b=a.q;b.C=new R(.1,0);b.D=new R(.9,1);D.u(a);return b},GenderMale:function(a,b,c){a=D.v();var d=.4*Id,e=.4,g=D.O(),h=D.O(),k=D.O(),l=D.O();S(a,(.5-e)*b,.5*c,!0);T(a,(.5-e)*b,(.5-d)*c,(.5-d)*b,(.5-e)*c,.5*b,(.5-e)*c);te(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.44,k,l,h,g,g);T(a,k.x*b,k.y*c,l.x*b,l.y*c,h.x*b,h.y*c);var m=D.Db(h.x,h.y);te(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.56,g,g,h,k,l);var n=D.Db(h.x,h.y);a.lineTo((.1*m.x+.855)*b,.1*m.y*c);a.lineTo(.85*b,.1*m.y*c);a.lineTo(.85*b,0);a.lineTo(1*
b,0);a.lineTo(1*b,.15*c);a.lineTo((.1*n.x+.9)*b,.15*c);a.lineTo((.1*n.x+.9)*b,(.1*n.y+.05*.9)*c);a.lineTo(n.x*b,n.y*c);T(a,k.x*b,k.y*c,l.x*b,l.y*c,(.5+e)*b,.5*c);T(a,(.5+e)*b,(.5+d)*c,(.5+d)*b,(.5+e)*c,.5*b,(.5+e)*c);T(a,(.5-d)*b,(.5+e)*c,(.5-e)*b,(.5+d)*c,(.5-e)*b,.5*c);e=.35;d=.35*Id;S(a,.5*b,(.5-e)*c,!0,!0);T(a,(.5-d)*b,(.5-e)*c,(.5-e)*b,(.5-d)*c,(.5-e)*b,.5*c);T(a,(.5-e)*b,(.5+d)*c,(.5-d)*b,(.5+e)*c,.5*b,(.5+e)*c);T(a,(.5+d)*b,(.5+e)*c,(.5+e)*b,(.5+d)*c,(.5+e)*b,.5*c);T(a,(.5+e)*b,(.5-d)*c,(.5+
d)*b,(.5-e)*c,.5*b,(.5-e)*c);S(a,(.5-e)*b,.5*c,!0);D.A(g);D.A(h);D.A(k);D.A(l);D.A(m);D.A(n);b=a.q;b.C=new R(.202,.257);b.D=new R(.692,.839);b.ne=ck;D.u(a);return b},GenderFemale:function(a,b,c){a=D.v();var d=.375,e=0,g=-.125,h=4*(Math.SQRT2-1)/3*d;S(a,(.525+e)*b,(.5+d+g)*c,!0);T(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*c);T(a,(.5+d+e)*b,(.5-h+g)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);T(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);T(a,(.5-d+e)*b,
(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.475+e)*b,(.5+d+g)*c);a.lineTo(.475*b,.85*c);a.lineTo(.425*b,.85*c);a.lineTo(.425*b,.9*c);a.lineTo(.475*b,.9*c);a.lineTo(.475*b,1*c);a.lineTo(.525*b,1*c);a.lineTo(.525*b,.9*c);a.lineTo(.575*b,.9*c);a.lineTo(.575*b,.85*c);a.lineTo(.525*b,.85*c);V(a);d=.325;e=0;g=-.125;h=4*(Math.SQRT2-1)/3*d;S(a,(.5+d+e)*b,(.5+g)*c,!0,!0);T(a,(.5+d+e)*b,(.5+h+g)*c,(.5+h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);T(a,(.5-h+e)*b,(.5+d+g)*c,(.5-d+e)*b,(.5+h+g)*c,(.5-d+e)*b,(.5+g)*c);T(a,(.5-
d+e)*b,(.5-h+g)*c,(.5-h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);T(a,(.5+h+e)*b,(.5-d+g)*c,(.5+d+e)*b,(.5-h+g)*c,(.5+d+e)*b,(.5+g)*c);S(a,(.525+e)*b,(.5+d+g)*c,!0);b=a.q;b.C=new R(.232,.136);b.D=new R(.782,.611);b.ne=ck;D.u(a);return b},PlusLine:function(a,b,c){a=D.v();S(a,0,.5*c,!1);a.lineTo(1*b,.5*c);a.moveTo(.5*b,0);a.lineTo(.5*b,1*c);b=a.q;D.u(a);return b},XLine:function(a,b,c){a=D.v();S(a,0,1*c,!1);a.lineTo(1*b,0);a.moveTo(0,0);a.lineTo(1*b,1*c);b=a.q;D.u(a);return b},AsteriskLine:function(a,b,c){a=
D.v();var d=.2/Math.SQRT2;S(a,d*b,(1-d)*c,!1);a.lineTo((1-d)*b,d*c);a.moveTo(d*b,d*c);a.lineTo((1-d)*b,(1-d)*c);a.moveTo(0*b,.5*c);a.lineTo(1*b,.5*c);a.moveTo(.5*b,0*c);a.lineTo(.5*b,1*c);b=a.q;D.u(a);return b},CircleLine:function(a,b,c){var d=.5*Id;a=D.v();S(a,1*b,.5*c,!1);T(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);T(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);T(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);b=a.q;b.C=new R(.146,.146);b.D=new R(.853,.853);b.ne=ck;D.u(a);return b},Pie:function(a,
b,c){a=D.v();var d=4*(Math.SQRT2-1)/3*.5;S(a,(.5*Math.SQRT2/2+.5)*b,(.5-.5*Math.SQRT2/2)*c,!0);T(a,.7*b,0*c,.5*b,0*c,.5*b,0*c);T(a,(.5-d+0)*b,0*c,0*b,(.5-d+0)*c,0*b,.5*c);T(a,0*b,(.5+d+0)*c,(.5-d+0)*b,1*c,.5*b,1*c);T(a,(.5+d+0)*b,1*c,1*b,(.5+d+0)*c,1*b,.5*c);a.lineTo(.5*b,.5*c);V(a);b=a.q;D.u(a);return b},PiePiece:function(a,b,c){var d=Id/Math.SQRT2*.5,e=Math.SQRT2/2,g=1-Math.SQRT2/2;a=D.v();S(a,b,c,!0);T(a,b,(1-d)*c,(e+d)*b,(g+d)*c,e*b,g*c);a.lineTo(0,c);V(a);b=a.q;D.u(a);return b},StopSign:function(a,
b,c){a=1/(Math.SQRT2+2);var d=D.v();S(d,a*b,0,!0);d.lineTo((1-a)*b,0);d.lineTo(1*b,a*c);d.lineTo(1*b,(1-a)*c);d.lineTo((1-a)*b,1*c);d.lineTo(a*b,1*c);d.lineTo(0,(1-a)*c);d.lineTo(0,a*c);V(d);b=d.q;b.C=new R(a/2,a/2);b.D=new R(1-a/2,1-a/2);D.u(d);return b},LogicImplies:function(a,b,c){var d=a?a.Uc:NaN;isNaN(d)&&(d=.2);a=D.v();S(a,(1-d)*b,0*c,!1);a.lineTo(1*b,.5*c);a.lineTo((1-d)*b,c);a.moveTo(0,.5*c);a.lineTo(b,.5*c);b=a.q;b.C=ic;b.D=new R(.8,.5);D.u(a);return b},LogicIff:function(a,b,c){var d=a?a.Uc:
NaN;isNaN(d)&&(d=.2);a=D.v();S(a,(1-d)*b,0*c,!1);a.lineTo(1*b,.5*c);a.lineTo((1-d)*b,c);a.moveTo(0,.5*c);a.lineTo(b,.5*c);a.moveTo(d*b,0);a.lineTo(0,.5*c);a.lineTo(d*b,c);b=a.q;b.C=new R(.2,0);b.D=new R(.8,.5);D.u(a);return b},LogicNot:function(a,b,c){a=D.v();S(a,0,0,!1);a.lineTo(1*b,0);a.lineTo(1*b,1*c);b=a.q;D.u(a);return b},LogicAnd:function(a,b,c){a=D.v();S(a,0,1*c,!1);a.lineTo(.5*b,0);a.lineTo(1*b,1*c);b=a.q;b.C=new R(.25,.5);b.D=new R(.75,1);D.u(a);return b},LogicOr:function(a,b,c){a=D.v();
S(a,0,0,!1);a.lineTo(.5*b,1*c);a.lineTo(1*b,0);b=a.q;b.C=new R(.219,0);b.D=new R(.78,.409);D.u(a);return b},LogicXor:function(a,b,c){a=D.v();S(a,.5*b,0,!1);a.lineTo(.5*b,1*c);a.moveTo(0,.5*c);a.lineTo(1*b,.5*c);var d=.5*Id;T(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);T(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);T(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);b=a.q;b.ne=ck;D.u(a);return b},LogicTruth:function(a,b,c){a=D.v();S(a,0,0,!1);a.lineTo(1*b,0);a.moveTo(.5*b,0);a.lineTo(.5*b,1*c);
b=a.q;D.u(a);return b},LogicFalsity:function(a,b,c){a=D.v();S(a,0,1*c,!1);a.lineTo(1*b,1*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,0);b=a.q;D.u(a);return b},LogicThereExists:function(a,b,c){a=D.v();S(a,0,0,!1);a.lineTo(1*b,0);a.lineTo(1*b,.5*c);a.lineTo(0,.5*c);a.moveTo(1*b,.5*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);b=a.q;D.u(a);return b},LogicForAll:function(a,b,c){a=D.v();S(a,0,0,!1);a.lineTo(.5*b,1*c);a.lineTo(1*b,0);a.moveTo(.25*b,.5*c);a.lineTo(.75*b,.5*c);b=a.q;b.C=new R(.25,0);b.D=new R(.75,.5);D.u(a);
return b},LogicIsDefinedAs:function(a,b,c){a=D.v();S(a,0,0,!1);a.lineTo(b,0);a.moveTo(0,.5*c);a.lineTo(b,.5*c);a.moveTo(0,c);a.lineTo(b,c);b=a.q;b.C=new R(.01,.01);b.D=new R(.99,.49);D.u(a);return b},LogicIntersect:function(a,b,c){var d=.5*Id;a=D.v();S(a,0,1*c,!1);a.lineTo(0,.5*c);T(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);T(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);a.lineTo(1*b,1*c);b=a.q;b.C=new R(0,.5);b.D=vc;D.u(a);return b},LogicUnion:function(a,b,c){var d=.5*Id;a=D.v();S(a,1*b,0,!1);a.lineTo(1*b,.5*c);T(a,
1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);a.lineTo(0,0);b=a.q;b.C=ic;b.D=new R(1,.5);D.u(a);return b},Arrow:function(a,b,c){var d=a?a.Uc:NaN,e=a?a.iv:NaN;isNaN(d)&&(d=.3);isNaN(e)&&(e=.3);a=D.v();S(a,0,(.5-e/2)*c,!0);a.lineTo((1-d)*b,(.5-e/2)*c);a.lineTo((1-d)*b,0);a.lineTo(1*b,.5*c);a.lineTo((1-d)*b,1*c);a.lineTo((1-d)*b,(.5+e/2)*c);a.lineTo(0,(.5+e/2)*c);V(a);b=a.q;b.C=new R(0,.5-e/2);d=Je(0,.5+e/2,1,.5+e/2,1-d,1,1,.5,D.O());b.D=new R(d.x,d.y);D.A(d);D.u(a);return b},
ISOProcess:"Chevron",Chevron:function(a,b,c){a=D.v();S(a,0,0,!0);a.lineTo(.5*b,0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,1*c);a.lineTo(.5*b,.5*c);V(a);b=a.q;D.u(a);return b},DoubleArrow:function(a,b,c){a=D.v();S(a,0,0,!0);a.lineTo(.3*b,.214*c);a.lineTo(.3*b,0);a.lineTo(1*b,.5*c);a.lineTo(.3*b,1*c);a.lineTo(.3*b,.786*c);a.lineTo(0,1*c);V(a);S(a,.3*b,.214*c,!1);a.lineTo(.3*b,.786*c);a.nb(!1);b=a.q;D.u(a);return b},DoubleEndArrow:function(a,b,c){a=D.v();S(a,1*b,.5*c,!0);a.lineTo(.7*b,1*c);
a.lineTo(.7*b,.7*c);a.lineTo(.3*b,.7*c);a.lineTo(.3*b,1*c);a.lineTo(0,.5*c);a.lineTo(.3*b,0);a.lineTo(.3*b,.3*c);a.lineTo(.7*b,.3*c);a.lineTo(.7*b,0);V(a);b=a.q;c=Je(0,.5,.3,0,0,.3,.3,.3,D.O());b.C=new R(c.x,c.y);c=Je(.7,1,1,.5,.7,.7,1,.7,c);b.D=new R(c.x,c.y);D.A(c);D.u(a);return b},IBeamArrow:function(a,b,c){a=D.v();S(a,1*b,.5*c,!0);a.lineTo(.7*b,1*c);a.lineTo(.7*b,.7*c);a.lineTo(.2*b,.7*c);a.lineTo(.2*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.2*b,0);a.lineTo(.2*b,.3*c);a.lineTo(.7*b,.3*c);
a.lineTo(.7*b,0);V(a);b=a.q;b.C=new R(0,.3);c=Je(.7,1,1,.5,.7,.7,1,.7,D.O());b.D=new R(c.x,c.y);D.A(c);D.u(a);return b},Pointer:function(a,b,c){a=D.v();S(a,1*b,.5*c,!0);a.lineTo(0,1*c);a.lineTo(.2*b,.5*c);a.lineTo(0,0);V(a);b=a.q;b.C=new R(.2,.35);c=Je(.2,.65,1,.65,0,1,1,.5,D.O());b.D=new R(c.x,c.y);D.A(c);D.u(a);return b},RoundedPointer:function(a,b,c){a=D.v();S(a,1*b,.5*c,!0);a.lineTo(0,1*c);T(a,.5*b,.75*c,.5*b,.25*c,0,0);V(a);b=a.q;b.C=new R(.4,.35);c=Je(.2,.65,1,.65,0,1,1,.5,D.O());b.D=new R(c.x,
c.y);D.A(c);D.u(a);return b},SplitEndArrow:function(a,b,c){a=D.v();S(a,1*b,.5*c,!0);a.lineTo(.7*b,1*c);a.lineTo(.7*b,.7*c);a.lineTo(0,.7*c);a.lineTo(.2*b,.5*c);a.lineTo(0,.3*c);a.lineTo(.7*b,.3*c);a.lineTo(.7*b,0);V(a);b=a.q;b.C=new R(.2,.3);c=Je(.7,1,1,.5,.7,.7,1,.7,D.O());b.D=new R(c.x,c.y);D.A(c);D.u(a);return b},MessageToUser:"SquareArrow",SquareArrow:function(a,b,c){a=D.v();S(a,1*b,.5*c,!0);a.lineTo(.7*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.7*b,0);V(a);b=a.q;b.C=ic;b.D=new R(.7,1);D.u(a);
return b},Cone1:function(a,b,c){var d=.5*Id,e=.1*Id;a=D.v();S(a,0,.9*c,!0);a.lineTo(.5*b,0);a.lineTo(1*b,.9*c);T(a,1*b,(.9+e)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0,(.9+e)*c,0,.9*c);V(a);b=a.q;b.C=new R(.25,.5);b.D=new R(.75,.97);D.u(a);return b},Cone2:function(a,b,c){a=D.v();S(a,0,.9*c,!0);T(a,(1-.85/.9)*b,1*c,.85/.9*b,1*c,1*b,.9*c);a.lineTo(.5*b,0);a.lineTo(0,.9*c);V(a);S(a,0,.9*c,!1);T(a,(1-.85/.9)*b,.8*c,.85/.9*b,.8*c,1*b,.9*c);a.nb(!1);b=a.q;b.C=new R(.25,.5);b.D=new R(.75,.82);D.u(a);return b},
Cube1:function(a,b,c){a=D.v();S(a,.5*b,1*c,!0);a.lineTo(1*b,.85*c);a.lineTo(1*b,.15*c);a.lineTo(.5*b,0*c);a.lineTo(0*b,.15*c);a.lineTo(0*b,.85*c);V(a);S(a,.5*b,1*c,!1);a.lineTo(.5*b,.3*c);a.lineTo(0,.15*c);a.moveTo(.5*b,.3*c);a.lineTo(1*b,.15*c);a.nb(!1);b=a.q;b.C=new R(0,.3);b.D=new R(.5,.85);D.u(a);return b},Cube2:function(a,b,c){a=D.v();S(a,0,.3*c,!0);a.lineTo(0*b,1*c);a.lineTo(.7*b,c);a.lineTo(1*b,.7*c);a.lineTo(1*b,0*c);a.lineTo(.3*b,0*c);V(a);S(a,0,.3*c,!1);a.lineTo(.7*b,.3*c);a.lineTo(1*b,
0*c);a.moveTo(.7*b,.3*c);a.lineTo(.7*b,1*c);a.nb(!1);b=a.q;b.C=new R(0,.3);b.D=new R(.7,1);D.u(a);return b},MagneticData:"Cylinder1",Cylinder1:function(a,b,c){var d=.5*Id,e=.1*Id;a=D.v();S(a,0,.1*c,!0);T(a,0,(.1-e)*c,(.5-d)*b,0,.5*b,0);T(a,(.5+d)*b,0,1*b,(.1-e)*c,1*b,.1*c);a.lineTo(b,.9*c);T(a,1*b,(.9+e)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0,(.9+e)*c,0,.9*c);a.lineTo(0,.1*c);S(a,0,.1*c,!1);T(a,0,(.1+e)*c,(.5-d)*b,.2*c,.5*b,.2*c);T(a,(.5+d)*b,.2*c,1*b,(.1+e)*c,1*b,.1*c);a.nb(!1);b=a.q;b.C=new R(0,
.2);b.D=new R(1,.9);D.u(a);return b},Cylinder2:function(a,b,c){var d=.5*Id,e=.1*Id;a=D.v();S(a,0,.9*c,!0);a.lineTo(0,.1*c);T(a,0,(.1-e)*c,(.5-d)*b,0,.5*b,0);T(a,(.5+d)*b,0,1*b,(.1-e)*c,1*b,.1*c);a.lineTo(1*b,.9*c);T(a,1*b,(.9+e)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0,(.9+e)*c,0,.9*c);S(a,0,.9*c,!1);T(a,0,(.9-e)*c,(.5-d)*b,.8*c,.5*b,.8*c);T(a,(.5+d)*b,.8*c,1*b,(.9-e)*c,1*b,.9*c);a.nb(!1);b=a.q;b.C=new R(0,.1);b.D=new R(1,.8);D.u(a);return b},Cylinder3:function(a,b,c){var d=.1*Id,e=.5*Id;a=D.v();
S(a,.1*b,0,!0);a.lineTo(.9*b,0);T(a,(.9+d)*b,0,1*b,(.5-e)*c,1*b,.5*c);T(a,1*b,(.5+e)*c,(.9+d)*b,1*c,.9*b,1*c);a.lineTo(.1*b,1*c);T(a,(.1-d)*b,1*c,0,(.5+e)*c,0,.5*c);T(a,0,(.5-e)*c,(.1-d)*b,0,.1*b,0);S(a,.1*b,0,!1);T(a,(.1+d)*b,0,.2*b,(.5-e)*c,.2*b,.5*c);T(a,.2*b,(.5+e)*c,(.1+d)*b,1*c,.1*b,1*c);a.nb(!1);b=a.q;b.C=new R(.2,0);b.D=new R(.9,1);D.u(a);return b},DirectData:"Cylinder4",Cylinder4:function(a,b,c){var d=.1*Id,e=.5*Id;a=D.v();S(a,.9*b,0,!0);T(a,(.9+d)*b,0,1*b,(.5-e)*c,1*b,.5*c);T(a,1*b,(.5+
e)*c,(.9+d)*b,1*c,.9*b,1*c);a.lineTo(.1*b,1*c);T(a,(.1-d)*b,1*c,0,(.5+e)*c,0,.5*c);T(a,0,(.5-e)*c,(.1-d)*b,0,.1*b,0);a.lineTo(.9*b,0);S(a,.9*b,0,!1);T(a,(.9-d)*b,0,.8*b,(.5-e)*c,.8*b,.5*c);T(a,.8*b,(.5+e)*c,(.9-d)*b,1*c,.9*b,1*c);a.nb(!1);b=a.q;b.C=new R(.1,0);b.D=new R(.8,1);D.u(a);return b},Prism1:function(a,b,c){a=D.v();S(a,.25*b,.25*c,!0);a.lineTo(.75*b,0);a.lineTo(b,.5*c);a.lineTo(.5*b,c);a.lineTo(0,c);V(a);S(a,.25*b,.25*c,!1);a.lineTo(.5*b,c);a.nb(!1);b=a.q;b.C=new R(.408,.172);b.D=new R(.833,
.662);D.u(a);return b},Prism2:function(a,b,c){a=D.v();S(a,0,.25*c,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(.75*b,.75*c);a.lineTo(0,1*c);V(a);S(a,0,c,!1);a.lineTo(.25*b,.5*c);a.lineTo(b,.25*c);a.moveTo(0,.25*c);a.lineTo(.25*b,.5*c);a.nb(!1);b=a.q;b.C=new R(.25,.5);b.D=new R(.75,.75);D.u(a);return b},Pyramid1:function(a,b,c){a=D.v();S(a,.5*b,0,!0);a.lineTo(b,.75*c);a.lineTo(.5*b,1*c);a.lineTo(0,.75*c);V(a);S(a,.5*b,0,!1);a.lineTo(.5*b,1*c);a.nb(!1);b=a.q;b.C=new R(.25,.367);b.D=new R(.75,
.875);D.u(a);return b},Pyramid2:function(a,b,c){a=D.v();S(a,.5*b,0,!0);a.lineTo(b,.85*c);a.lineTo(.5*b,1*c);a.lineTo(0,.85*c);V(a);S(a,.5*b,0,!1);a.lineTo(.5*b,.7*c);a.lineTo(0,.85*c);a.moveTo(.5*b,.7*c);a.lineTo(1*b,.85*c);a.nb(!1);b=a.q;b.C=new R(.25,.367);b.D=new R(.75,.875);D.u(a);return b},Actor:function(a,b,c){var d=.2*Id,e=.1*Id,g=.5,h=.1;a=D.v();S(a,g*b,(h+.1)*c,!0);T(a,(g-d)*b,(h+.1)*c,(g-.2)*b,(h+e)*c,(g-.2)*b,h*c);T(a,(g-.2)*b,(h-e)*c,(g-d)*b,(h-.1)*c,g*b,(h-.1)*c);T(a,(g+d)*b,(h-.1)*c,
(g+.2)*b,(h-e)*c,(g+.2)*b,h*c);T(a,(g+.2)*b,(h+e)*c,(g+d)*b,(h+.1)*c,g*b,(h+.1)*c);d=.05;e=Id*d;S(a,.5*b,.2*c,!0);a.lineTo(.95*b,.2*c);g=.95;h=.25;T(a,(g+e)*b,(h-d)*c,(g+d)*b,(h-e)*c,(g+d)*b,h*c);a.lineTo(1*b,.6*c);a.lineTo(.85*b,.6*c);a.lineTo(.85*b,.35*c);d=.025;e=Id*d;g=.825;h=.35;T(a,(g+d)*b,(h-e)*c,(g+e)*b,(h-d)*c,g*b,(h-d)*c);T(a,(g-e)*b,(h-d)*c,(g-d)*b,(h-e)*c,(g-d)*b,h*c);a.lineTo(.8*b,1*c);a.lineTo(.55*b,1*c);a.lineTo(.55*b,.7*c);d=.05;e=Id*d;g=.5;h=.7;T(a,(g+d)*b,(h-e)*c,(g+e)*b,(h-d)*c,
g*b,(h-d)*c);T(a,(g-e)*b,(h-d)*c,(g-d)*b,(h-e)*c,(g-d)*b,h*c);a.lineTo(.45*b,1*c);a.lineTo(.2*b,1*c);a.lineTo(.2*b,.35*c);d=.025;e=Id*d;g=.175;h=.35;T(a,(g+d)*b,(h-e)*c,(g+e)*b,(h-d)*c,g*b,(h-d)*c);T(a,(g-e)*b,(h-d)*c,(g-d)*b,(h-e)*c,(g-d)*b,h*c);a.lineTo(.15*b,.6*c);a.lineTo(0*b,.6*c);a.lineTo(0*b,.25*c);d=.05;e=Id*d;g=.05;h=.25;T(a,(g-d)*b,(h-e)*c,(g-e)*b,(h-d)*c,g*b,(h-d)*c);a.lineTo(.5*b,.2*c);b=a.q;b.C=new R(.2,.2);b.D=new R(.8,.65);D.u(a);return b},Card:function(a,b,c){a=D.v();S(a,1*b,0*c,!0);
a.lineTo(1*b,1*c);a.lineTo(0*b,1*c);a.lineTo(0*b,.2*c);a.lineTo(.2*b,0*c);V(a);b=a.q;b.C=new R(0,.2);b.D=vc;D.u(a);return b},Collate:function(a,b,c){a=D.v();S(a,.5*b,.5*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(.5*b,.5*c);S(a,.5*b,.5*c,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(.5*b,.5*c);b=a.q;b.C=new R(.25,0);b.D=new R(.75,.25);D.u(a);return b},CreateRequest:function(a,b,c){a=a?a.Uc:NaN;isNaN(a)&&(a=.1);var d=D.v();S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);V(d);S(d,0,
a*c,!1);d.lineTo(1*b,a*c);d.moveTo(0,(1-a)*c);d.lineTo(1*b,(1-a)*c);d.nb(!1);b=d.q;b.C=new R(0,a);b.D=new R(1,1-a);D.u(d);return b},Database:function(a,b,c){a=D.v();var d=.5*Id,e=.1*Id;S(a,1*b,.1*c,!0);a.lineTo(1*b,.9*c);T(a,1*b,(.9+e)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0,(.9+e)*c,0,.9*c);a.lineTo(0,.1*c);T(a,0,(.1-e)*c,(.5-d)*b,0,.5*b,0);T(a,(.5+d)*b,0,1*b,(.1-e)*c,1*b,.1*c);S(a,1*b,.1*c,!1);T(a,1*b,(.1+e)*c,(.5+d)*b,.2*c,.5*b,.2*c);T(a,(.5-d)*b,.2*c,0,(.1+e)*c,0,.1*c);a.moveTo(1*b,.2*c);
T(a,1*b,(.2+e)*c,(.5+d)*b,.3*c,.5*b,.3*c);T(a,(.5-d)*b,.3*c,0,(.2+e)*c,0,.2*c);a.moveTo(1*b,.3*c);T(a,1*b,(.3+e)*c,(.5+d)*b,.4*c,.5*b,.4*c);T(a,(.5-d)*b,.4*c,0,(.3+e)*c,0,.3*c);a.nb(!1);b=a.q;b.C=new R(0,.4);b.D=new R(1,.9);D.u(a);return b},StoredData:"DataStorage",DataStorage:function(a,b,c){a=D.v();S(a,0,0,!0);a.lineTo(.75*b,0);T(a,1*b,0,1*b,1*c,.75*b,1*c);a.lineTo(0,1*c);T(a,.25*b,.9*c,.25*b,.1*c,0,0);V(a);b=a.q;b.C=new R(.226,0);b.D=new R(.81,1);D.u(a);return b},DiskStorage:function(a,b,c){a=
D.v();var d=.5*Id,e=.1*Id;S(a,1*b,.1*c,!0);a.lineTo(1*b,.9*c);T(a,1*b,(.9+e)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0,(.9+e)*c,0,.9*c);a.lineTo(0,.1*c);T(a,0,(.1-e)*c,(.5-d)*b,0,.5*b,0);T(a,(.5+d)*b,0,1*b,(.1-e)*c,1*b,.1*c);S(a,1*b,.1*c,!1);T(a,1*b,(.1+e)*c,(.5+d)*b,.2*c,.5*b,.2*c);T(a,(.5-d)*b,.2*c,0,(.1+e)*c,0,.1*c);a.moveTo(1*b,.2*c);T(a,1*b,(.2+e)*c,(.5+d)*b,.3*c,.5*b,.3*c);T(a,(.5-d)*b,.3*c,0,(.2+e)*c,0,.2*c);a.nb(!1);b=a.q;b.C=new R(0,.3);b.D=new R(1,.9);D.u(a);return b},Display:function(a,
b,c){a=D.v();S(a,.25*b,0,!0);a.lineTo(.75*b,0);T(a,1*b,0,1*b,1*c,.75*b,1*c);a.lineTo(.25*b,1*c);a.lineTo(0,.5*c);V(a);b=a.q;b.C=new R(.25,0);b.D=new R(.75,1);D.u(a);return b},DividedEvent:function(a,b,c){a=a?a.Uc:NaN;isNaN(a)?a=.2:.15>a&&(a=.15);var d=D.v(),e=.2*Id;S(d,0,.2*c,!0);T(d,0,(.2-e)*c,(.2-e)*b,0,.2*b,0);d.lineTo(.8*b,0);T(d,(.8+e)*b,0,1*b,(.2-e)*c,1*b,.2*c);d.lineTo(1*b,.8*c);T(d,1*b,(.8+e)*c,(.8+e)*b,1*c,.8*b,1*c);d.lineTo(.2*b,1*c);T(d,(.2-e)*b,1*c,0,(.8+e)*c,0,.8*c);d.lineTo(0,.2*c);
S(d,0,a*c,!1);d.lineTo(1*b,a*c);d.nb(!1);b=d.q;b.C=new R(0,a);b.D=new R(1,1-a);D.u(d);return b},DividedProcess:function(a,b,c){a=a?a.Uc:NaN;if(isNaN(a)||.1>a)a=.1;var d=D.v();S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);V(d);S(d,0,a*c,!1);d.lineTo(1*b,a*c);d.nb(!1);b=d.q;b.C=new R(0,a);b.D=vc;D.u(d);return b},Document:function(a,b,c){c/=.8;a=D.v();S(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);T(a,.5*b,.4*c,.5*b,1*c,0,.7*c);V(a);b=a.q;b.C=ic;b.D=new R(1,.6);D.u(a);
return b},ExternalOrganization:function(a,b,c){a=a?a.Uc:NaN;if(isNaN(a)||.2>a)a=.2;var d=D.v();S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);V(d);S(d,a*b,0,!1);d.lineTo(0,a*c);d.moveTo(1*b,a*c);d.lineTo((1-a)*b,0);d.moveTo(0,(1-a)*c);d.lineTo(a*b,1*c);d.moveTo((1-a)*b,1*c);d.lineTo(1*b,(1-a)*c);d.nb(!1);b=d.q;b.C=new R(a/2,a/2);b.D=new R(1-a/2,1-a/2);D.u(d);return b},ExternalProcess:function(a,b,c){a=D.v();S(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);V(a);
S(a,.1*b,.4*c,!1);a.lineTo(.1*b,.6*c);a.moveTo(.9*b,.6*c);a.lineTo(.9*b,.4*c);a.moveTo(.6*b,.1*c);a.lineTo(.4*b,.1*c);a.moveTo(.4*b,.9*c);a.lineTo(.6*b,.9*c);a.nb(!1);b=a.q;b.C=new R(.25,.25);b.D=new R(.75,.75);D.u(a);return b},File:function(a,b,c){a=D.v();S(a,0,0,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);V(a);S(a,.75*b,0,!1);a.lineTo(.75*b,.25*c);a.lineTo(1*b,.25*c);a.nb(!1);b=a.q;b.C=new R(0,.25);b.D=vc;D.u(a);return b},Interrupt:function(a,b,c){a=D.v();S(a,1*b,
.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);S(a,1*b,.5*c,!1);a.lineTo(1*b,1*c);S(a,1*b,.5*c,!1);a.lineTo(1*b,0);b=a.q;b.C=new R(0,.25);b.D=new R(.5,.75);D.u(a);return b},InternalStorage:function(a,b,c){var d=a?a.Uc:NaN;a=a?a.iv:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.1);var e=D.v();S(e,0,0,!0);e.lineTo(1*b,0);e.lineTo(1*b,1*c);e.lineTo(0,1*c);V(e);S(e,d*b,0,!1);e.lineTo(d*b,1*c);e.moveTo(0,a*c);e.lineTo(1*b,a*c);e.nb(!1);b=e.q;b.C=new R(d,a);b.D=vc;D.u(e);return b},Junction:function(a,b,
c){a=D.v();var d=1/Math.SQRT2,e=(1-1/Math.SQRT2)/2,g=.5*Id;S(a,1*b,.5*c,!0);T(a,1*b,(.5+g)*c,(.5+g)*b,1*c,.5*b,1*c);T(a,(.5-g)*b,1*c,0,(.5+g)*c,0,.5*c);T(a,0,(.5-g)*c,(.5-g)*b,0,.5*b,0);T(a,(.5+g)*b,0,1*b,(.5-g)*c,1*b,.5*c);S(a,(e+d)*b,(e+d)*c,!1);a.lineTo(e*b,e*c);a.moveTo(e*b,(e+d)*c);a.lineTo((e+d)*b,e*c);a.nb(!1);b=a.q;b.ne=ck;D.u(a);return b},LinedDocument:function(a,b,c){c/=.8;a=D.v();S(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);T(a,.5*b,.4*c,.5*b,1*c,0,.7*c);V(a);S(a,.1*
b,0,!1);a.lineTo(.1*b,.75*c);a.nb(!1);b=a.q;b.C=new R(.1,0);b.D=new R(1,.6);D.u(a);return b},LoopLimit:function(a,b,c){a=D.v();S(a,0,1*c,!0);a.lineTo(0,.25*c);a.lineTo(.25*b,0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(1*b,1*c);V(a);b=a.q;b.C=new R(0,.25);b.D=vc;D.u(a);return b},SequentialData:"MagneticTape",MagneticTape:function(a,b,c){a=D.v();var d=.5*Id;S(a,.5*b,1*c,!0);T(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);T(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);T(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);T(a,1*b,(.5+
d)*c,(.5+d)*b,.9*c,.6*b,.9*c);a.lineTo(1*b,.9*c);a.lineTo(1*b,1*c);a.lineTo(.5*b,1*c);b=a.q;b.C=new R(.15,.15);b.D=new R(.85,.8);D.u(a);return b},ManualInput:function(a,b,c){a=D.v();S(a,1*b,0,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.25*c);V(a);b=a.q;b.C=new R(0,.25);b.D=vc;D.u(a);return b},MessageFromUser:function(a,b,c){a=a?a.Uc:NaN;isNaN(a)&&(a=.7);var d=D.v();S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(a*b,.5*c);d.lineTo(1*b,1*c);d.lineTo(0,1*c);V(d);b=d.q;b.C=ic;b.D=new R(a,1);D.u(d);return b},
MicroformProcessing:function(a,b,c){a=a?a.Uc:NaN;isNaN(a)&&(a=.25);var d=D.v();S(d,0,0,!0);d.lineTo(.5*b,a*c);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(.5*b,(1-a)*c);d.lineTo(0,1*c);V(d);b=d.q;b.C=new R(0,a);b.D=new R(1,1-a);D.u(d);return b},MicroformRecording:function(a,b,c){a=D.v();S(a,0,0,!0);a.lineTo(.75*b,.25*c);a.lineTo(1*b,.15*c);a.lineTo(1*b,.85*c);a.lineTo(.75*b,.75*c);a.lineTo(0,1*c);V(a);b=a.q;b.C=new R(0,.25);b.D=new R(1,.75);D.u(a);return b},MultiDocument:function(a,b,c){c/=.8;a=D.v();
S(a,b,0,!0);a.lineTo(b,.5*c);T(a,.96*b,.47*c,.93*b,.45*c,.9*b,.44*c);a.lineTo(.9*b,.6*c);T(a,.86*b,.57*c,.83*b,.55*c,.8*b,.54*c);a.lineTo(.8*b,.7*c);T(a,.4*b,.4*c,.4*b,1*c,0,.7*c);a.lineTo(0,.2*c);a.lineTo(.1*b,.2*c);a.lineTo(.1*b,.1*c);a.lineTo(.2*b,.1*c);a.lineTo(.2*b,0);V(a);S(a,.1*b,.2*c,!1);a.lineTo(.8*b,.2*c);a.lineTo(.8*b,.54*c);a.moveTo(.2*b,.1*c);a.lineTo(.9*b,.1*c);a.lineTo(.9*b,.44*c);a.nb(!1);b=a.q;b.C=new R(0,.25);b.D=new R(.8,.77);D.u(a);return b},MultiProcess:function(a,b,c){a=D.v();
S(a,.1*b,.1*c,!0);a.lineTo(.2*b,.1*c);a.lineTo(.2*b,0);a.lineTo(1*b,0);a.lineTo(1*b,.8*c);a.lineTo(.9*b,.8*c);a.lineTo(.9*b,.9*c);a.lineTo(.8*b,.9*c);a.lineTo(.8*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.2*c);a.lineTo(.1*b,.2*c);V(a);S(a,.2*b,.1*c,!1);a.lineTo(.9*b,.1*c);a.lineTo(.9*b,.8*c);a.moveTo(.1*b,.2*c);a.lineTo(.8*b,.2*c);a.lineTo(.8*b,.9*c);a.nb(!1);b=a.q;b.C=new R(0,.2);b.D=new R(.8,1);D.u(a);return b},OfflineStorage:function(a,b,c){a=a?a.Uc:NaN;isNaN(a)&&(a=.1);var d=1-a,e=D.v();S(e,0,0,!0);e.lineTo(1*
b,0);e.lineTo(.5*b,1*c);V(e);S(e,.5*a*b,a*c,!1);e.lineTo((1-.5*a)*b,a*c);e.nb(!1);b=e.q;b.C=new R(d/4+.5*a,a);b.D=new R(3*d/4+.5*a,a+.5*d);D.u(e);return b},OffPageConnector:function(a,b,c){a=D.v();S(a,0,0,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.5*c);a.lineTo(.75*b,1*c);a.lineTo(0,1*c);V(a);b=a.q;b.C=ic;b.D=new R(.75,1);D.u(a);return b},Or:function(a,b,c){a=D.v();var d=.5*Id;S(a,1*b,.5*c,!0);T(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);T(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);T(a,
(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);S(a,1*b,.5*c,!1);a.lineTo(0,.5*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,0);a.nb(!1);b=a.q;b.ne=ck;D.u(a);return b},PaperTape:function(a,b,c){c/=.8;a=D.v();S(a,0,.7*c,!0);a.lineTo(0,.3*c);T(a,.5*b,.6*c,.5*b,0,1*b,.3*c);a.lineTo(1*b,.7*c);T(a,.5*b,.4*c,.5*b,1*c,0,.7*c);V(a);b=a.q;b.C=new R(0,.49);b.D=new R(1,.75);D.u(a);return b},PrimitiveFromCall:function(a,b,c){var d=a?a.Uc:NaN;a=a?a.iv:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=D.v();S(e,0,0,!0);e.lineTo(1*b,0);e.lineTo((1-
a)*b,.5*c);e.lineTo(1*b,1*c);e.lineTo(0,1*c);V(e);b=e.q;b.C=new R(d,0);b.D=new R(1-a,1);D.u(e);return b},PrimitiveToCall:function(a,b,c){var d=a?a.Uc:NaN;a=a?a.iv:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=D.v();S(e,0,0,!0);e.lineTo((1-a)*b,0);e.lineTo(1*b,.5*c);e.lineTo((1-a)*b,1*c);e.lineTo(0,1*c);V(e);b=e.q;b.C=new R(d,0);b.D=new R(1-a,1);D.u(e);return b},Subroutine:"Procedure",Procedure:function(a,b,c){a=a?a.Uc:NaN;isNaN(a)&&(a=.1);var d=D.v();S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,
1*c);V(d);S(d,(1-a)*b,0,!1);d.lineTo((1-a)*b,1*c);d.moveTo(a*b,0);d.lineTo(a*b,1*c);d.nb(!1);b=d.q;b.C=new R(a,0);b.D=new R(1-a,1);D.u(d);return b},Process:function(a,b,c){a=a?a.Uc:NaN;isNaN(a)&&(a=.1);var d=D.v();S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);V(d);S(d,a*b,0,!1);d.lineTo(a*b,1*c);d.nb(!1);b=d.q;b.C=new R(a,0);b.D=vc;D.u(d);return b},Sort:function(a,b,c){a=D.v();S(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);V(a);S(a,0,.5*c,!1);a.lineTo(1*b,.5*
c);a.nb(!1);b=a.q;b.C=new R(.25,.25);b.D=new R(.75,.5);D.u(a);return b},Start:function(a,b,c){a=D.v();S(a,.25*b,0,!0);S(a,.25*b,0,!0);a.arcTo(270,180,.75*b,.5*c,.25*b,.5*c);a.arcTo(90,180,.25*b,.5*c,.25*b,.5*c);S(a,.25*b,0,!1);a.lineTo(.25*b,1*c);a.moveTo(.75*b,0);a.lineTo(.75*b,1*c);a.nb(!1);b=a.q;b.C=new R(.25,0);b.D=new R(.75,1);D.u(a);return b},Terminator:function(a,b,c){a=D.v();S(a,.25*b,0,!0);a.arcTo(270,180,.75*b,.5*c,.25*b,.5*c);a.arcTo(90,180,.25*b,.5*c,.25*b,.5*c);b=a.q;b.C=new R(.23,0);
b.D=new R(.77,1);D.u(a);return b},TransmittalTape:function(a,b,c){a=a?a.Uc:NaN;isNaN(a)&&(a=.1);var d=D.v();S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(.75*b,(1-a)*c);d.lineTo(0,(1-a)*c);V(d);b=d.q;b.C=ic;b.D=new R(1,1-a);D.u(d);return b},AndGate:function(a,b,c){a=D.v();var d=.5*Id;S(a,0,0,!0);a.lineTo(.5*b,0);T(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);T(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);a.lineTo(0,1*c);V(a);b=a.q;b.C=ic;b.D=new R(.55,1);D.u(a);return b},Buffer:function(a,b,c){a=D.v();S(a,
0,0,!0);a.lineTo(1*b,.5*c);a.lineTo(0,1*c);V(a);b=a.q;b.C=new R(0,.25);b.D=new R(.5,.75);D.u(a);return b},Clock:function(a,b,c){a=D.v();var d=.5*Id;S(a,1*b,.5*c,!0);T(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);T(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);T(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);S(a,1*b,.5*c,!1);a.lineTo(1*b,.5*c);S(a,.8*b,.75*c,!1);a.lineTo(.8*b,.25*c);a.lineTo(.6*b,.25*c);a.lineTo(.6*b,.75*c);a.lineTo(.4*b,.75*c);a.lineTo(.4*b,.25*c);a.lineTo(.2*b,.25*c);a.lineTo(.2*
b,.75*c);a.nb(!1);b=a.q;b.ne=ck;D.u(a);return b},Ground:function(a,b,c){a=D.v();S(a,.5*b,0,!1);a.lineTo(.5*b,.4*c);a.moveTo(.2*b,.6*c);a.lineTo(.8*b,.6*c);a.moveTo(.3*b,.8*c);a.lineTo(.7*b,.8*c);a.moveTo(.4*b,1*c);a.lineTo(.6*b,1*c);b=a.q;D.u(a);return b},Inverter:function(a,b,c){a=D.v();var d=.1*Id;S(a,.8*b,.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.8*b,.5*c);S(a,1*b,.5*c,!0);T(a,1*b,(.5+d)*c,(.9+d)*b,.6*c,.9*b,.6*c);T(a,(.9-d)*b,.6*c,.8*b,(.5+d)*c,.8*b,.5*c);T(a,.8*b,(.5-d)*c,(.9-d)*b,.4*
c,.9*b,.4*c);T(a,(.9+d)*b,.4*c,1*b,(.5-d)*c,1*b,.5*c);b=a.q;b.C=new R(0,.25);b.D=new R(.4,.75);D.u(a);return b},NandGate:function(a,b,c){a=D.v();var d=.5*Id,e=.4*Id,g=.1*Id;S(a,.8*b,.5*c,!0);T(a,.8*b,(.5+e)*c,(.4+d)*b,1*c,.4*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.4*b,0);T(a,(.4+d)*b,0,.8*b,(.5-e)*c,.8*b,.5*c);S(a,1*b,.5*c,!0);T(a,1*b,(.5+g)*c,(.9+g)*b,.6*c,.9*b,.6*c);T(a,(.9-g)*b,.6*c,.8*b,(.5+g)*c,.8*b,.5*c);T(a,.8*b,(.5-g)*c,(.9-g)*b,.4*c,.9*b,.4*c);T(a,(.9+g)*b,.4*c,1*b,(.5-g)*c,1*b,.5*
c);b=a.q;b.C=new R(0,.05);b.D=new R(.55,.95);D.u(a);return b},NorGate:function(a,b,c){a=D.v();var d=.5,e=Id*d,g=0,h=.5;S(a,.8*b,.5*c,!0);T(a,.7*b,(h+e)*c,(g+e)*b,(h+d)*c,0,1*c);T(a,.25*b,.75*c,.25*b,.25*c,0,0);T(a,(g+e)*b,(h-d)*c,.7*b,(h-e)*c,.8*b,.5*c);d=.1;e=.1*Id;g=.9;h=.5;S(a,(g-d)*b,h*c,!0);T(a,(g-d)*b,(h-e)*c,(g-e)*b,(h-d)*c,g*b,(h-d)*c);T(a,(g+e)*b,(h-d)*c,(g+d)*b,(h-e)*c,(g+d)*b,h*c);T(a,(g+d)*b,(h+e)*c,(g+e)*b,(h+d)*c,g*b,(h+d)*c);T(a,(g-e)*b,(h+d)*c,(g-d)*b,(h+e)*c,(g-d)*b,h*c);b=a.q;b.C=
new R(.2,.25);b.D=new R(.6,.75);D.u(a);return b},OrGate:function(a,b,c){a=D.v();var d=.5*Id;S(a,0,0,!0);T(a,(0+d+d)*b,0*c,.8*b,(.5-d)*c,1*b,.5*c);T(a,.8*b,(.5+d)*c,(0+d+d)*b,1*c,0,1*c);T(a,.25*b,.75*c,.25*b,.25*c,0,0);V(a);b=a.q;b.C=new R(.2,.25);b.D=new R(.75,.75);D.u(a);return b},XnorGate:function(a,b,c){a=D.v();var d=.5,e=Id*d,g=.2,h=.5;S(a,.1*b,0,!1);T(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);S(a,.8*b,.5*c,!0);T(a,.7*b,(h+e)*c,(g+e)*b,(h+d)*c,.2*b,1*c);T(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);T(a,(g+e)*
b,(h-d)*c,.7*b,(h-e)*c,.8*b,.5*c);d=.1;e=.1*Id;g=.9;h=.5;S(a,(g-d)*b,h*c,!0);T(a,(g-d)*b,(h-e)*c,(g-e)*b,(h-d)*c,g*b,(h-d)*c);T(a,(g+e)*b,(h-d)*c,(g+d)*b,(h-e)*c,(g+d)*b,h*c);T(a,(g+d)*b,(h+e)*c,(g+e)*b,(h+d)*c,g*b,(h+d)*c);T(a,(g-e)*b,(h+d)*c,(g-d)*b,(h+e)*c,(g-d)*b,h*c);b=a.q;b.C=new R(.4,.25);b.D=new R(.65,.75);D.u(a);return b},XorGate:function(a,b,c){a=D.v();var d=.5*Id;S(a,.1*b,0,!1);T(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);S(a,.2*b,0,!0);T(a,(.2+d)*b,0*c,.9*b,(.5-d)*c,1*b,.5*c);T(a,.9*b,(.5+d)*
c,(.2+d)*b,1*c,.2*b,1*c);T(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);V(a);b=a.q;b.C=new R(.4,.25);b.D=new R(.8,.75);D.u(a);return b},Capacitor:function(a,b,c){a=D.v();S(a,0,0,!1);a.lineTo(0,1*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.q;D.u(a);return b},Resistor:function(a,b,c){a=D.v();S(a,0,.5*c,!1);a.lineTo(.1*b,0);a.lineTo(.2*b,1*c);a.lineTo(.3*b,0);a.lineTo(.4*b,1*c);a.lineTo(.5*b,0);a.lineTo(.6*b,1*c);a.lineTo(.7*b,.5*c);b=a.q;D.u(a);return b},Inductor:function(a,b,c){a=D.v();var d=.1*Id,e=.1;S(a,(e-.5*
d)*b,c,!1);T(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.3;T(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);T(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.5;T(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);T(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.7;T(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);T(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.9;T(a,(e+.1)*b,0,(e+d)*b,c,(e+.5*d)*b,c);b=a.q;D.u(a);return b},ACvoltageSource:function(a,b,c){a=D.v();var d=.5*Id;S(a,0*b,.5*c,!1);T(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);T(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);T(a,1*b,(.5+d)*
c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b,.5*c);a.moveTo(.1*b,.5*c);T(a,.5*b,0*c,.5*b,1*c,.9*b,.5*c);b=a.q;b.ne=ck;D.u(a);return b},DCvoltageSource:function(a,b,c){a=D.v();S(a,0,.75*c,!1);a.lineTo(0,.25*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.q;D.u(a);return b},Diode:function(a,b,c){a=D.v();S(a,1*b,0,!1);a.lineTo(1*b,.5*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);a.lineTo(1*b,1*c);b=a.q;b.C=new R(0,.25);b.D=new R(.5,.75);D.u(a);return b},Wifi:function(a,b,c){var d=b,e=c;
b*=.38;c*=.6;a=D.v();var g=.8*Id,h=.8,k=0,l=.5,d=(d-b)/2,e=(e-c)/2;S(a,k*b+d,(l+h)*c+e,!0);T(a,(k-g)*b+d,(l+h)*c+e,(k-h)*b+d,(l+g)*c+e,(k-h)*b+d,l*c+e);T(a,(k-h)*b+d,(l-g)*c+e,(k-g)*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);T(a,k*b+d,(l-h)*c+e,(k-h+.5*g)*b+d,(l-g)*c+e,(k-h+.5*g)*b+d,l*c+e);T(a,(k-h+.5*g)*b+d,(l+g)*c+e,k*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);V(a);g=.4*Id;h=.4;k=.2;l=.5;S(a,k*b+d,(l+h)*c+e,!0);T(a,(k-g)*b+d,(l+h)*c+e,(k-h)*b+d,(l+g)*c+e,(k-h)*b+d,l*c+e);T(a,(k-h)*b+d,(l-g)*c+e,(k-g)*b+d,(l-h)*c+e,k*
b+d,(l-h)*c+e);T(a,k*b+d,(l-h)*c+e,(k-h+.5*g)*b+d,(l-g)*c+e,(k-h+.5*g)*b+d,l*c+e);T(a,(k-h+.5*g)*b+d,(l+g)*c+e,k*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);V(a);g=.2*Id;h=.2;l=k=.5;S(a,(k-h)*b+d,l*c+e,!0);T(a,(k-h)*b+d,(l-g)*c+e,(k-g)*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);T(a,(k+g)*b+d,(l-h)*c+e,(k+h)*b+d,(l-g)*c+e,(k+h)*b+d,l*c+e);T(a,(k+h)*b+d,(l+g)*c+e,(k+g)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);T(a,(k-g)*b+d,(l+h)*c+e,(k-h)*b+d,(l+g)*c+e,(k-h)*b+d,l*c+e);g=.4*Id;h=.4;k=.8;l=.5;S(a,k*b+d,(l-h)*c+e,!0);T(a,(k+g)*b+d,(l-
h)*c+e,(k+h)*b+d,(l-g)*c+e,(k+h)*b+d,l*c+e);T(a,(k+h)*b+d,(l+g)*c+e,(k+g)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);T(a,k*b+d,(l+h)*c+e,(k+h-.5*g)*b+d,(l+g)*c+e,(k+h-.5*g)*b+d,l*c+e);T(a,(k+h-.5*g)*b+d,(l-g)*c+e,k*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);V(a);g=.8*Id;h=.8;k=1;l=.5;S(a,k*b+d,(l-h)*c+e,!0);T(a,(k+g)*b+d,(l-h)*c+e,(k+h)*b+d,(l-g)*c+e,(k+h)*b+d,l*c+e);T(a,(k+h)*b+d,(l+g)*c+e,(k+g)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);T(a,k*b+d,(l+h)*c+e,(k+h-.5*g)*b+d,(l+g)*c+e,(k+h-.5*g)*b+d,l*c+e);T(a,(k+h-.5*g)*b+d,(l-g)*c+
e,k*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);V(a);b=a.q;D.u(a);return b},Email:function(a,b,c){a=D.v();S(a,0,0,!0);a.lineTo(1*b,0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);V(a);S(a,0,0,!1);a.lineTo(.5*b,.6*c);a.lineTo(1*b,0);a.moveTo(0,1*c);a.lineTo(.45*b,.54*c);a.moveTo(1*b,1*c);a.lineTo(.55*b,.54*c);a.nb(!1);b=a.q;D.u(a);return b},Ethernet:function(a,b,c){a=D.v();S(a,.35*b,0,!0);a.lineTo(.65*b,0);a.lineTo(.65*b,.4*c);a.lineTo(.35*b,.4*c);a.lineTo(.35*b,0);V(a);S(a,.1*b,1*c,!0,!0);a.lineTo(.4*b,1*c);
a.lineTo(.4*b,.6*c);a.lineTo(.1*b,.6*c);a.lineTo(.1*b,1*c);V(a);S(a,.6*b,1*c,!0,!0);a.lineTo(.9*b,1*c);a.lineTo(.9*b,.6*c);a.lineTo(.6*b,.6*c);a.lineTo(.6*b,1*c);V(a);S(a,0,.5*c,!1);a.lineTo(1*b,.5*c);a.moveTo(.5*b,.5*c);a.lineTo(.5*b,.4*c);a.moveTo(.75*b,.5*c);a.lineTo(.75*b,.6*c);a.moveTo(.25*b,.5*c);a.lineTo(.25*b,.6*c);a.nb(!1);b=a.q;D.u(a);return b},Power:function(a,b,c){a=D.v();var d=.4*Id,e=.4,g=D.O(),h=D.O(),k=D.O(),l=D.O();te(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.5,g,g,h,k,l);var m=D.Db(h.x,
h.y);S(a,h.x*b,h.y*c,!0);T(a,k.x*b,k.y*c,l.x*b,l.y*c,(.5+e)*b,.5*c);T(a,(.5+e)*b,(.5+d)*c,(.5+d)*b,(.5+e)*c,.5*b,(.5+e)*c);T(a,(.5-d)*b,(.5+e)*c,(.5-e)*b,(.5+d)*c,(.5-e)*b,.5*c);te(.5-e,.5,.5-e,.5-d,.5-d,.5-e,.5,.5-e,.5,k,l,h,g,g);T(a,k.x*b,k.y*c,l.x*b,l.y*c,h.x*b,h.y*c);d=.3*Id;e=.3;te(.5-e,.5,.5-e,.5-d,.5-d,.5-e,.5,.5-e,.5,k,l,h,g,g);a.lineTo(h.x*b,h.y*c);T(a,l.x*b,l.y*c,k.x*b,k.y*c,(.5-e)*b,.5*c);T(a,(.5-e)*b,(.5+d)*c,(.5-d)*b,(.5+e)*c,.5*b,(.5+e)*c);T(a,(.5+d)*b,(.5+e)*c,(.5+e)*b,(.5+d)*c,(.5+
e)*b,.5*c);te(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.5,g,g,h,k,l);T(a,l.x*b,l.y*c,k.x*b,k.y*c,h.x*b,h.y*c);V(a);S(a,.45*b,0,!0);a.lineTo(.45*b,.5*c);a.lineTo(.55*b,.5*c);a.lineTo(.55*b,0);V(a);D.A(g);D.A(h);D.A(k);D.A(l);D.A(m);b=a.q;b.C=new R(.25,.55);b.D=new R(.75,.8);D.u(a);return b},Fallout:function(a,b,c){a=D.v();var d=.5*Id;S(a,0*b,.5*c,!0);T(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);T(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);T(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b,
.5*c);var e=d=0;S(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);d=.4;e=0;V(a);S(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);d=.2;e=-.3;V(a);S(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);V(a);b=a.q;b.ne=ck;D.u(a);return b},IrritationHazard:function(a,b,c){a=D.v();S(a,.2*b,0*c,!0);a.lineTo(.5*b,.3*c);a.lineTo(.8*
b,0*c);a.lineTo(1*b,.2*c);a.lineTo(.7*b,.5*c);a.lineTo(1*b,.8*c);a.lineTo(.8*b,1*c);a.lineTo(.5*b,.7*c);a.lineTo(.2*b,1*c);a.lineTo(0*b,.8*c);a.lineTo(.3*b,.5*c);a.lineTo(0*b,.2*c);V(a);b=a.q;b.C=new R(.3,.3);b.D=new R(.7,.7);D.u(a);return b},ElectricalHazard:function(a,b,c){a=D.v();S(a,.37*b,0*c,!0);a.lineTo(.5*b,.11*c);a.lineTo(.77*b,.04*c);a.lineTo(.33*b,.49*c);a.lineTo(1*b,.37*c);a.lineTo(.63*b,.86*c);a.lineTo(.77*b,.91*c);a.lineTo(.34*b,1*c);a.lineTo(.34*b,.78*c);a.lineTo(.44*b,.8*c);a.lineTo(.65*
b,.56*c);a.lineTo(0*b,.68*c);V(a);b=a.q;D.u(a);return b},FireHazard:function(a,b,c){a=D.v();S(a,.1*b,1*c,!0);T(a,-.25*b,.63*c,.45*b,.44*c,.29*b,0*c);T(a,.48*b,.17*c,.54*b,.35*c,.51*b,.42*c);T(a,.59*b,.29*c,.58*b,.28*c,.59*b,.18*c);T(a,.8*b,.34*c,.88*b,.43*c,.75*b,.6*c);T(a,.87*b,.48*c,.88*b,.43*c,.88*b,.31*c);T(a,1.17*b,.76*c,.82*b,.8*c,.9*b,1*c);V(a);b=a.q;b.C=new R(.05,.645);b.D=new R(.884,.908);D.u(a);return b},BpmnActivityLoop:function(a,b,c){a=D.v();var d=4*(Math.SQRT2-1)/3*.5;S(a,.65*b,1*c,
!1);T(a,(1-d+0)*b,1*c,1*b,(.5+d+0)*c,1*b,.5*c);T(a,1*b,(.5-d+0)*c,(.5+d+0)*b,0*c,.5*b,0*c);T(a,(.5-d+0)*b,0*c,0*b,(.5-d+0)*c,0*b,.5*c);T(a,0*b,(.5+d+0)*c,(.5-d+0)*b,1*c,.35*b,.98*c);a.moveTo(.25*b,.8*c);a.lineTo(.35*b,1*c);a.lineTo(.1*b,1*c);b=a.q;D.u(a);return b},BpmnActivityParallel:function(a,b,c){a=D.v();S(a,0,0,!1);a.lineTo(0,1*c);a.moveTo(.5*b,0);a.lineTo(.5*b,1*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.q;D.u(a);return b},BpmnActivitySequential:function(a,b,c){a=D.v();S(a,0,0,!1);a.lineTo(1*
b,0);a.moveTo(0,.5*c);a.lineTo(1*b,.5*c);a.moveTo(0,1*c);a.lineTo(1*b,1*c);b=a.q;D.u(a);return b},BpmnActivityAdHoc:function(a,b,c){a=D.v();S(a,0,0,!1);S(a,1*b,1*c,!1);S(a,0,.5*c,!1);T(a,.2*b,.35*c,.3*b,.35*c,.5*b,.5*c);T(a,.7*b,.65*c,.8*b,.65*c,1*b,.5*c);b=a.q;D.u(a);return b},BpmnActivityCompensation:function(a,b,c){a=D.v();S(a,0,.5*c,!0);a.lineTo(.5*b,0);a.lineTo(.5*b,.5*c);a.lineTo(1*b,1*c);a.lineTo(1*b,0);a.lineTo(.5*b,.5*c);a.lineTo(.5*b,1*c);V(a);b=a.q;D.u(a);return b},BpmnTaskMessage:function(a,
b,c){a=D.v();S(a,0,.2*c,!0);a.lineTo(1*b,.2*c);a.lineTo(1*b,.8*c);a.lineTo(0,.8*c);a.lineTo(0,.8*c);V(a);S(a,0,.2*c,!1);a.lineTo(.5*b,.5*c);a.lineTo(1*b,.2*c);a.nb(!1);b=a.q;D.u(a);return b},BpmnTaskScript:function(a,b,c){a=D.v();S(a,.7*b,1*c,!0);a.lineTo(.3*b,1*c);T(a,.6*b,.5*c,0,.5*c,.3*b,0);a.lineTo(.7*b,0);T(a,.4*b,.5*c,1*b,.5*c,.7*b,1*c);V(a);S(a,.45*b,.73*c,!1);a.lineTo(.7*b,.73*c);a.moveTo(.38*b,.5*c);a.lineTo(.63*b,.5*c);a.moveTo(.31*b,.27*c);a.lineTo(.56*b,.27*c);a.nb(!1);b=a.q;D.u(a);return b},
BpmnTaskUser:function(a,b,c){a=D.v();S(a,0,0,!1);S(a,.335*b,(1-.555)*c,!0);a.lineTo(.335*b,.595*c);a.lineTo(.665*b,.595*c);a.lineTo(.665*b,(1-.555)*c);T(a,.88*b,.46*c,.98*b,.54*c,1*b,.68*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.68*c);T(a,.02*b,.54*c,.12*b,.46*c,.335*b,(1-.555)*c);a.lineTo(.365*b,.405*c);var d=.5-.285,e=Math.PI/4,g=4*(1-Math.cos(e))/(3*Math.sin(e)),e=g*d,g=g*d;T(a,(.5-(e+d)/2)*b,(d+(d+g)/2)*c,(.5-d)*b,(d+g)*c,(.5-d)*b,d*c);T(a,(.5-d)*b,(d-g)*c,(.5-e)*b,(d-d)*c,.5*b,(d-d)*c);
T(a,(.5+e)*b,(d-d)*c,(.5+d)*b,(d-g)*c,(.5+d)*b,d*c);T(a,(.5+d)*b,(d+g)*c,(.5+(e+d)/2)*b,(d+(d+g)/2)*c,.635*b,.405*c);a.lineTo(.635*b,.405*c);a.lineTo(.665*b,(1-.555)*c);a.lineTo(.665*b,.595*c);a.lineTo(.335*b,.595*c);S(a,.2*b,1*c,!1);a.lineTo(.2*b,.8*c);S(a,.8*b,1*c,!1);a.lineTo(.8*b,.8*c);b=a.q;D.u(a);return b},BpmnEventConditional:function(a,b,c){a=D.v();S(a,.1*b,0,!0);a.lineTo(.9*b,0);a.lineTo(.9*b,1*c);a.lineTo(.1*b,1*c);V(a);S(a,.2*b,.2*c,!1);a.lineTo(.8*b,.2*c);a.moveTo(.2*b,.4*c);a.lineTo(.8*
b,.4*c);a.moveTo(.2*b,.6*c);a.lineTo(.8*b,.6*c);a.moveTo(.2*b,.8*c);a.lineTo(.8*b,.8*c);a.nb(!1);b=a.q;D.u(a);return b},BpmnEventError:function(a,b,c){a=D.v();S(a,0,1*c,!0);a.lineTo(.33*b,0);a.lineTo(.66*b,.5*c);a.lineTo(1*b,0);a.lineTo(.66*b,1*c);a.lineTo(.33*b,.5*c);V(a);b=a.q;D.u(a);return b},BpmnEventEscalation:function(a,b,c){a=D.v();S(a,0,0,!1);S(a,1*b,1*c,!1);S(a,.1*b,1*c,!0);a.lineTo(.5*b,0);a.lineTo(.9*b,1*c);a.lineTo(.5*b,.5*c);V(a);b=a.q;D.u(a);return b},BpmnEventTimer:function(a,b,c){a=
D.v();var d=.5*Id;S(a,1*b,.5*c,!0);T(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);T(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);T(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);S(a,.5*b,0,!1);a.lineTo(.5*b,.15*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,.85*c);a.moveTo(0,.5*c);a.lineTo(.15*b,.5*c);a.moveTo(1*b,.5*c);a.lineTo(.85*b,.5*c);a.moveTo(.5*b,.5*c);a.lineTo(.58*b,.1*c);a.moveTo(.5*b,.5*c);a.lineTo(.78*b,.54*c);a.nb(!1);b=a.q;b.ne=ck;D.u(a);return b}},fr;for(fr in sq)sq[fr.toLowerCase()]=fr;
var zq={"":"",Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8",
BackwardOpenTriangleLine:"m 8,0 l -8,4 8,4 m -8.5,0 l 0,-8",OpenTriangleTop:"m 0,0 l 8,4 m 0,4",BackwardOpenTriangleTop:"m 8,0 l -8,4 m 0,4",OpenTriangleBottom:"m 0,8 l 8,-4",BackwardOpenTriangleBottom:"m 0,4 l 8,4",HalfTriangleTop:"F1 m 0,0 l 0,4 8,0 z m 0,8",BackwardHalfTriangleTop:"F1 m 8,0 l 0,4 -8,0 z m 0,8",HalfTriangleBottom:"F1 m 0,4 l 0,4 8,-4 z",BackwardHalfTriangleBottom:"F1 m 8,4 l 0,4 -8,-4 z",ForwardSemiCircle:"m 4,0 b 270 180 0 4 4",BackwardSemiCircle:"m 4,8 b 90 180 0 -4 4",Feather:"m 0,0 l 3,4 -3,4",
BackwardFeather:"m 3,0 l -3,4 3,4",DoubleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardDoubleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",TripleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardTripleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",ForwardSlash:"m 0,8 l 5,-8",BackSlash:"m 0,0 l 5,8",DoubleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8",DoubleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8",TripleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8",
TripleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",Fork:"m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",LineFork:"m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardLineFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",CircleFork:"F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",CircleLineFork:"F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",
BackwardCircleLineFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",Circle:"F1 m 8,4 b 0 360 -4 0 4 z",Block:"F1 m 0,0 l 0,8 8,0 0,-8 z",StretchedDiamond:"F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",Diamond:"F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",Chevron:"F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",StretchedChevron:"F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",NormalArrow:"F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",X:"m 0,0 l 8,8 m 0,-8 l -8,8",TailedNormalArrow:"F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z",
DoubleTriangle:"F1 m 0,0 l 4,4 -4,4 0,-8 z m 4,0 l 4,4 -4,4 0,-8 z",BigEndArrow:"F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",ConcaveTailArrow:"F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",RoundedTriangle:"F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",SimpleArrow:"F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",AccelerationArrow:"F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",BoxArrow:"F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z",
TriangleLine:"F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",CircleEndedArrow:"F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",DynamicWidthArrow:"F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",EquilibriumArrow:"m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",FastForward:"F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",Kite:"F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",HalfArrowTop:"F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",HalfArrowBottom:"F1 m 0,8 l 4,-4 4,0 -8,4 z",
OpposingDirectionDoubleArrow:"F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",PartialDoubleTriangle:"F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",LineCircle:"F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",DoubleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",TripleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",CircleLine:"F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",DiamondCircle:"F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",PlusCircle:"F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8",
OpenRightTriangleTop:"m 8,0 l 0,4 -8,0 m 0,4",OpenRightTriangleBottom:"m 8,8 l 0,-4 -8,0",Line:"m 0,0 l 0,8",DoubleLine:"m 0,0 l 0,8 m 2,0 l 0,-8",TripleLine:"m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",PentagonArrow:"F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"};
function wq(a){var b=me[a];if(void 0===b){var c=a.toLowerCase();if("none"===c)return"None";b=me[c];if(void 0===b){var d=null,e;for(e in zq)if(e.toLowerCase()===c){d=e;break}if(null!==d)return a=xf(zq[d],!1),me[d]=a,c!==d&&(me[c]=d),d}}return"string"===typeof b?b:b instanceof Ue?a:null}
function F(a){x.call(this,a);this.T=2408959;this.Tl=this.Ti="";this.xt=this.ut=this.Gt=this.Ds=null;this.It="";this.mh=this.ps=this.Ht=this.An=null;this.wt="";this.Kp=null;this.vt=ce;this.yt="";this.Lp=null;this.Zd="";this.Bw=this.Br=this.El=null;this.mj=(new N(NaN,NaN)).freeze();this.Is="";this.Wl=null;this.Js=ic;this.Rs=Ud;this.Ks=Vd;this.Xr=null;this.Es=gr;this.Cn=Td;this.Bn="gray";this.Pg=4;this.SD=-1;this.eu=NaN;this.FH=new C;this.Yl=null;this.Ck=NaN}D.Ta(F,x);D.ka("Part",F);
F.prototype.cloneProtected=function(a){x.prototype.cloneProtected.call(this,a);a.T=this.T&-4097|49152;a.Ti=this.Ti;a.Tl=this.Tl;a.Ds=this.Ds;a.Gt=this.Gt;a.ut=this.ut;a.xt=this.xt;a.It=this.It;a.Ht=this.Ht;a.ps=this.ps;a.mh=null;a.wt=this.wt;a.vt=this.vt.V();a.yt=this.yt;a.Zd=this.Zd;a.Br=this.Br;a.mj.assign(this.mj);a.Is=this.Is;a.Js=this.Js.V();a.Rs=this.Rs.V();a.Ks=this.Ks.V();a.Xr=this.Xr;a.Es=this.Es;a.Cn=this.Cn.V();a.Bn=this.Bn;a.Pg=this.Pg;a.eu=this.eu};
F.prototype.Ii=function(a){x.prototype.Ii.call(this,a);a.hl();a.An=null;a.Kp=null;a.Lp=null;a.Wl=null;a.Yl=null};F.prototype.toString=function(){var a=D.xf(Object.getPrototypeOf(this))+"#"+D.Nd(this);null!==this.data&&(a+="("+ha(this.data)+")");return a};F.LayoutNone=0;var Vm;F.LayoutAdded=Vm=1;var dn;F.LayoutRemoved=dn=2;F.LayoutShown=4;F.LayoutHidden=8;F.LayoutNodeSized=16;var Kn;F.LayoutGroupLayout=Kn=32;F.LayoutNodeReplaced=64;var gr;F.LayoutStandard=gr=Vm|dn|28|Kn|64;F.LayoutAll=16777215;
F.prototype.xo=function(a,b,c,d,e,g,h){var k=this.g;null!==k&&(a===gg&&"elements"===b?e instanceof x?Wm(e,function(a){Ym(k,a);Xm(k,a)}):e instanceof Gl&&wn(k,e):a===hg&&"elements"===b&&(e instanceof x?Wm(e,function(a){bn(k,a);an(k,a)}):e instanceof Gl&&xn(k,e)),k.pd(a,b,c,d,e,g,h))};F.prototype.updateTargetBindings=F.prototype.Rb=function(a){x.prototype.Rb.call(this,a);if(null!==this.data){a=this.ya.o;for(var b=a.length,c=0;c<b;c++){var d=a[c];d instanceof x&&Wm(d,function(a){null!==a.data&&a.Rb()})}}};
F.prototype.updateRelationshipsFromData=function(){var a=this.data;if(null!==a){var b=this.g;if(null!==b){var c=b.ea;c instanceof X&&(a=c.Zn(a),b=b.OI(a),null===b||b instanceof I)&&(this.Ja=b)}}};D.w(F,{key:"key"},function(){var a=this.g;return null===a?void 0:a.ea.yb(this.data)},{configurable:!0});D.w(F,{Cx:"adornments"},function(){return null===this.mh?Ja:this.mh.qG});
F.prototype.findAdornment=F.prototype.rq=function(a){v&&D.h(a,"string",F,"findAdornment:category");var b=this.mh;return null===b?null:b.oa(a)};F.prototype.addAdornment=F.prototype.im=function(a,b){if(null!==b){v&&(D.h(a,"string",F,"addAdornment:category"),D.l(b,ca,F,"addAdornment:ad"));var c=null,d=this.mh;null!==d&&(c=d.oa(a));if(c!==b){if(null!==c){var e=c.g;null!==e&&e.remove(c)}null===d&&(this.mh=d=new ma("string",ca));b.Ti!==a&&(b.wd=a);d.add(a,b);c=this.g;null!==c&&(c.add(b),b.data=this.data)}}};
F.prototype.removeAdornment=F.prototype.$j=function(a){v&&D.h(a,"string",F,"removeAdornment:category");var b=this.mh;if(null!==b){var c=b.oa(a);if(null!==c){var d=c.g;null!==d&&d.remove(c)}b.remove(a);0===b.count&&(this.mh=null)}};F.prototype.clearAdornments=F.prototype.ou=function(){var a=this.mh;if(null!==a){for(var b=D.hb(),a=a.j;a.next();)b.push(a.key);for(var a=b.length,c=0;c<a;c++)this.$j(b[c]);D.ua(b)}};
F.prototype.updateAdornments=function(){var a=this.g;if(null!==a){a:{if(this.mb&&this.$G){var b=this.Im;if(null!==b&&this.Y.F()&&this.isVisible()&&b.Uj()&&b.Y.F()){var c=this.rq("Selection");if(null===c){c=this.pK;null===c&&(c=this instanceof J?a.EJ:this instanceof I?a.cJ:a.WJ);if(!(c instanceof ca))break a;Sh(c);c=c.copy();null!==c&&(this instanceof J&&this.Im===this.path&&(c.type=tj),c.Cb=b)}if(null!==c){var d=c.placeholder;if(null!==d){var e=b.Mj(),g=0;b instanceof A&&(g=b.pb);var h=D.Om();h.n((b.Fa.width+
g)*e,(b.Fa.height+g)*e);d.Ea=h;D.bl(h)}c.angle=b.ym();c.type!==tj&&(d=D.O(),c.location=b.gb(ic,d),D.A(d));this.im("Selection",c);break a}}}this.$j("Selection")}hr(this,a);for(a=this.Cx;a.next();)b=a.value,b.Rb(),b.K()}};function hr(a,b){b.bb.qf.each(function(b){b.isEnabled&&b.updateAdornments(a)});b.bb.updateAdornments(a)}D.w(F,{layer:"layer"},function(){return this.Bw});D.w(F,{g:"diagram"},function(){var a=this.Bw;return null!==a?a.g:null});
D.defineProperty(F,{Of:"layerName"},function(){return this.Tl},function(a){var b=this.Tl;if(b!==a){D.h(a,"string",F,"layerName");var c=this.g;if(null===c||null!==c.vm(a)&&!c.lr)if(this.Tl=a,null!==c&&c.Rc(),this.i("layerName",b,a),b=this.layer,null!==b&&b.name!==a&&(c=b.g,null!==c&&(a=c.vm(a),null!==a&&a!==b))){var d=b.zf(-1,this,!0);0<=d&&c.pd(hg,"parts",b,this,null,d,!0);d=a.yq(99999999,this,!0);b.visible!==a.visible&&this.Pd(a.visible);0<=d&&c.pd(gg,"parts",a,null,this,!0,d);d=this.uy;if(null!==
d){var e=c.ab;c.ab=!0;d(this,b,a);c.ab=e}}}});D.defineProperty(F,{uy:"layerChanged"},function(){return this.Ds},function(a){var b=this.Ds;b!==a&&(null!==a&&D.h(a,"function",F,"layerChanged"),this.Ds=a,this.i("layerChanged",b,a))});D.defineProperty(F,{Io:"zOrder"},function(){return this.eu},function(a){var b=this.eu;if(b!==a){D.h(a,"number",F,"zOrder");this.eu=a;var c=this.layer;null!==c&&yl(c,-1,this);this.i("zOrder",b,a);a=this.g;null!==a&&a.ra()}});
F.prototype.invalidateAdornments=F.prototype.de=function(){var a=this.g;null!==a&&(Wl(a),0!==(this.T&16384)!==!0&&(ul(this,!0),a.Le()))};function ir(a){if(!1===Om(a)){var b=a.g;null!==b&&(b.Gg.add(a),b.Le());jr(a,!0);a.gj()}}function kr(a){a.T|=2097152;if(!1!==Om(a)){var b=a.position,c=a.location;c.F()&&b.F()||lr(a,b,c);var c=a.dc,d=c.copy();c.Xa();c.x=b.x;c.y=b.y;c.freeze();a.Ey(d,c);jr(a,!1)}}
D.w(F,{Cf:"locationObject"},function(){if(null===this.Wl){var a=this.zy;""!==a?(a=this.Md(a),this.Wl=null!==a?a:this):this.Wl=this instanceof ca?this.type!==tj&&null!==this.placeholder?this.placeholder:this:this}return this.Wl.visible?this.Wl:this});D.defineProperty(F,{PJ:"minLocation"},function(){return this.Rs},function(a){var b=this.Rs;b.P(a)||(v&&D.l(a,N,F,"minLocation"),this.Rs=a=a.V(),this.i("minLocation",b,a))});
D.defineProperty(F,{JJ:"maxLocation"},function(){return this.Ks},function(a){var b=this.Ks;b.P(a)||(v&&D.l(a,N,F,"maxLocation"),this.Ks=a=a.V(),this.i("maxLocation",b,a))});D.defineProperty(F,{zy:"locationObjectName"},function(){return this.Is},function(a){var b=this.Is;b!==a&&(v&&D.h(a,"string",F,"locationObjectName"),this.Is=a,this.Wl=null,this.K(),this.i("locationObjectName",b,a))});
D.defineProperty(F,{Pf:"locationSpot"},function(){return this.Js},function(a){var b=this.Js;b.P(a)||(v&&(D.l(a,R,F,"locationSpot"),a.$c()||D.k("Part.locationSpot must be a specific Spot value, not: "+a)),this.Js=a=a.V(),this.K(),this.i("locationSpot",b,a))});F.prototype.move=function(a){this.position=a};F.prototype.moveTo=F.prototype.moveTo=function(a,b){var c=D.Db(a,b);this.move(c);D.A(c)};
F.prototype.isVisible=function(){if(!this.visible)return!1;var a=this.layer;if(null!==a&&!a.visible)return!1;a=this.g;if(null!==a&&(a=a.Ra,a.nf&&(a=a.qn.oa(this),null!==a&&a.My)))return!0;a=this.Ja;return null===a||a.nd&&a.isVisible()?!0:!1};F.prototype.Pd=function(a){var b=this.g;a?(this.L(4),this.de(),null!==b&&b.Gg.add(this)):(this.L(8),this.ou());this.hl();null!==b&&(b.Rc(),b.ra())};
F.prototype.findObject=F.prototype.Md=function(a){if(this.name===a)return this;var b=this.Yl;null===b&&(this.Yl=b=new ja);if(void 0!==b[a])return b[a];for(var c=this.ya.o,d=c.length,e=0;e<d;e++){var g=c[e];if(g.name===a)return b[a]=g;if(g instanceof x)if(null===g.ij&&null===g.Ig){if(g=g.Md(a),null!==g)return b[a]=g}else if(un(g)&&(g=g.ya.first(),null!==g&&g.name===a))return b[a]=g}return b[a]=null};
function mr(a,b,c,d){void 0===d&&(d=new N);c=c.fe()?mc:c;var e=b.Fa;d.n(e.width*c.x+c.offsetX,e.height*c.y+c.offsetY);if(null===b||b===a)return d;b.transform.vb(d);for(b=b.Q;null!==b&&b!==a;)b.transform.vb(d),b=b.Q;a.lj.vb(d);d.offset(-a.Fd.x,-a.Fd.y);return d}F.prototype.ensureBounds=F.prototype.Ue=function(){!0===zm(this)&&(this instanceof I&&this.lc.each(function(a){a.Ue()}),Hk(this,Infinity,Infinity));this.rc()};
function xl(a,b){var c=a.FH,d;isNaN(a.Ck)&&(a.Ck=hq(a));d=a.Ck;var e=2*d;if(!a.jl)return c.n(b.x-1-d,b.y-1-d,b.width+2+e,b.height+2+e),c;d=b.x;var e=b.y,g=b.width,h=b.height,k=a.shadowBlur,l=a.uK,g=g+k,h=h+k;d-=k/2;e-=k/2;0<l.x?g+=l.x:(d+=l.x,g-=l.x);0<l.y?h+=l.y:(e+=l.y,h-=l.y);c.n(d-1,e-1,g+2,h+2);return c}
F.prototype.rc=function(){this.gj();if(!1===Nm(this))kr(this);else{var a=this.dc,b=D.Ff();b.assign(a);a.Xa();var c=tl(this);this.Fj(0,0,this.Fd.width,this.Fd.height);var d=this.position;lr(this,d,this.location);a.x=d.x;a.y=d.y;a.freeze();this.Ey(b,a);Ro(this,!1);b.P(a)?this.Qf(c):!this.te()||bb(b.width,a.width)&&bb(b.height,a.height)||0<=this.SD&&this.L(16);D.Hb(b);jr(this,!1)}};
F.prototype.Ey=function(a,b){var c=this.g;if(null!==c){var d=!1;if(!1===c.uk&&a.F()){var e=D.Ff();e.assign(c.Qc);e.kH(c.padding);a.x>e.x&&a.y>e.y&&a.right<e.right&&a.bottom<e.bottom&&b.x>e.x&&b.y>e.y&&b.right<e.right&&b.bottom<e.bottom&&(d=!0);D.Hb(e)}0!==(this.T&65536)!==!0&&a.P(b)||Zm(this,d,c);c.ra();Db(a,b)||(this instanceof H&&!c.na.ub&&this.lg(),this.hl())}};
D.defineProperty(F,{location:"location"},function(){return this.mj},function(a){v&&D.l(a,N,F,"location");var b=a.x,c=a.y,d=this.mj,e=d.x,g=d.y;(e===b||isNaN(e)&&isNaN(b))&&(g===c||isNaN(g)&&isNaN(c))||(a=a.V(),b=a,this instanceof J?b=!1:(this.mj=b,this.T|=2097152,!1===Nm(this)&&(ir(this),c=this.jb,c.F()&&(e=c.copy(),c.n(c.x+(b.x-d.x),c.y+(b.y-d.y)),nr(this,this.g,c,e),this.i("position",e,c))),b=!0),b&&this.i("location",d,a))});f=F.prototype;
f.fC=function(a,b){if(this instanceof J||!a.F())return!1;var c=this.g;if(null!==c&&(nr(this,c,a,b),!0===c.na.ub))return!0;this.jb=a;this.T&=-2097153;c=this.mj;if(c.F()){var d=c.copy();c.n(c.x+(a.x-b.x),c.y+(a.y-b.y));this.i("location",d,c)}!1===Om(this)&&!1===Nm(this)&&(ir(this),kr(this));return!0};function nr(a,b,c,d){null===b||a instanceof ca||(b=b.Ra,b.Ac&&hl(b,a,"position",d.copy(),c.copy(),!1))}
f.$y=function(a,b){var c=this.mj,d=this.jb;Om(this)||Nm(this)?c.n(NaN,NaN):c.n(c.x+a-d.x,c.y+b-d.y);d.n(a,b);ir(this)};f.gC=function(){this.T&=-2097153;ir(this)};
function lr(a,b,c){var d=D.O(),e=a.Pf,g=a.Cf;e.fe()&&D.k("determineOffset: Part's locationSpot must be real: "+e.toString());var h=g.Fa,k=g instanceof A?g.pb:0;d.tv(0,0,h.width+k,h.height+k,e);if(g!==a)for(d.offset(-k/2,-k/2),g.transform.vb(d),e=g.Q;null!==e&&e!==a;)e.transform.vb(d),e=e.Q;a.lj.vb(d);d.offset(-a.Fd.x,-a.Fd.y);e=a.g;g=c.F();h=b.F();g&&h?0!==(a.T&2097152)?or(a,b,c,e,d):pr(a,b,c,e,d):g?or(a,b,c,e,d):h&&pr(a,b,c,e,d);a.T|=2097152;D.A(d);a.gj()}
function or(a,b,c,d,e){var g=b.x,h=b.y;b.n(c.x-e.x,c.y-e.y);null!==d&&(c=d.Ra,(e=c.vk)||!c.Ac||a instanceof ca||hl(c,a,"position",new N(g,h),b,!1),e||b.x===g&&b.y===h||(c=d.ob,d.ob=!0,a.i("position",new N(g,h),b),d.ob=c))}function pr(a,b,c,d,e){var g=c.copy();c.n(b.x+e.x,b.y+e.y);c.P(g)||null===d||(b=d.ob,d.ob=!0,a.i("location",g,c),d.ob=b)}
function Zm(a,b,c){To(a,!1);a instanceof H&&c.tB(a);a.layer.Sc||b||c.Rc();b=a.dc;var d=c.wb;d.F()?tl(a)?(Tb(b,d)||a.Qf(!1),a.updateAdornments()):b.kg(d)?(a.Qf(!0),a.updateAdornments()):a.de():c.Pl=!0}f.Em=function(){return!0};
function vl(a,b){var c=a.dc;if(0!==c.width&&0!==c.height&&!isNaN(c.x)&&!isNaN(c.y)&&a.isVisible()){var d=a.transform;null!==a.nc&&(Xo(a,b,a.nc,!0,!0),b.fillRect(c.x,c.y,c.width,c.height));null===a.nc&&null===a.Pb&&(Xo(a,b,"rgba(0,0,0,0.4)",!0,!1),b.fillRect(c.x,c.y,c.width,c.height));null!==a.Pb&&(d.Ru()||b.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy),c=a.Fa,Xo(a,b,a.Pb,!0,!1),b.fillRect(0,0,c.width,c.height),d.Ru()||(c=1/(d.m11*d.m22-d.m12*d.m21),b.transform(d.m22*c,-d.m12*c,-d.m21*c,d.m11*c,c*(d.m21*
d.dy-d.m22*d.dx),c*(d.m12*d.dx-d.m11*d.dy))))}}f.te=function(){return!0};f.Qj=function(){return!0};
D.defineProperty(F,{wd:"category"},function(){return this.Ti},function(a){var b=this.Ti;if(b!==a){D.h(a,"string",F,"category");var c=this.g,d=this.data,e=null;if(null!==c&&null!==d&&!(this instanceof ca)){var g=c.ea.na;g.isEnabled&&!g.ub&&(e=this.clone(),e.ya.Yc(this.ya))}this.Ti=a;this.i("category",b,a);null===c||null===d||this instanceof ca?(e=this.hf,null!==e&&(a=e.mh,null!==a&&a.remove(b),e.im(this.wd,this))):(g=c.ea,g.na.ub||(this instanceof J?(g instanceof X?g.bH(d,a):g instanceof Ag&&g.sK(d,
a),c=sj(c,a),null!==c&&(Sh(c),c=c.copy(),null!==c&&qr(this,c,b,a))):(null!==g&&g.Xy(d,a),c=Cn(c,d,a),null!==c&&(Sh(c),c=c.copy(),null===c||c instanceof J||(c.location=this.location,qr(this,c,b,a)))),null!==e&&(b=this.clone(),b.ya.Yc(this.ya),this.i("self",e,b))))}});D.defineProperty(F,{self:"self"},function(){return this},function(a){qr(this,a,this.wd,a.wd)});var rr=!1;
function qr(a,b,c,d){b.constructor===a.constructor||rr||(rr=!0,D.trace('Should not change the class of the Part when changing category from "'+c+'" to "'+d+'"'),D.trace(" Old class: "+D.xf(a)+", new class: "+D.xf(b)+", part: "+a.toString()));a.ou();var e=a.data;c=a.Of;var g=a.mb,h=a.Zg,k=!0,l=!0,m=!1;if(a instanceof H)var n=a,k=n.Tj,l=n.Fc,m=n.fr;b.Ii(a);b.cloneProtected(a);a.Ti=d;a.K();a.ra();b=a.g;d=!0;null!==b&&(d=b.ob,b.ob=!0);a.Ud=e;null!==e&&a.Rb();null!==b&&(b.ob=d);e=a.Of;e!==c&&(a.Tl=c,
a.Of=e);a instanceof H&&(n=a,n.Tj=k,n.Fc=l,n.fr=m,n.te()&&n.L(64));a.mb=g;a.Zg=h}F.prototype.canCopy=function(){if(!this.nF)return!1;var a=this.layer;if(null===a)return!0;if(!a.Tk)return!1;a=a.g;return null===a?!0:a.Tk?!0:!1};F.prototype.canDelete=function(){if(!this.rF)return!1;var a=this.layer;if(null===a)return!0;if(!a.Jn)return!1;a=a.g;return null===a?!0:a.Jn?!0:!1};
F.prototype.canEdit=function(){if(!this.lH)return!1;var a=this.layer;if(null===a)return!0;if(!a.Gx)return!1;a=a.g;return null===a?!0:a.Gx?!0:!1};F.prototype.canGroup=function(){if(!this.XF)return!1;var a=this.layer;if(null===a)return!0;if(!a.Dx)return!1;a=a.g;return null===a?!0:a.Dx?!0:!1};F.prototype.canMove=function(){if(!this.zG)return!1;var a=this.layer;if(null===a)return!0;if(!a.lm)return!1;a=a.g;return null===a?!0:a.lm?!0:!1};
F.prototype.canReshape=function(){if(!this.OG)return!1;var a=this.layer;if(null===a)return!0;if(!a.Ex)return!1;a=a.g;return null===a?!0:a.Ex?!0:!1};F.prototype.canResize=function(){if(!this.PG)return!1;var a=this.layer;if(null===a)return!0;if(!a.lu)return!1;a=a.g;return null===a?!0:a.lu?!0:!1};F.prototype.canRotate=function(){if(!this.UG)return!1;var a=this.layer;if(null===a)return!0;if(!a.Fx)return!1;a=a.g;return null===a?!0:a.Fx?!0:!1};
F.prototype.canSelect=function(){if(!this.nl)return!1;var a=this.layer;if(null===a)return!0;if(!a.Kf)return!1;a=a.g;return null===a?!0:a.Kf?!0:!1};D.defineProperty(F,{nF:"copyable"},function(){return 0!==(this.T&1)},function(a){var b=0!==(this.T&1);b!==a&&(v&&D.h(a,"boolean",F,"copyable"),this.T^=1,this.i("copyable",b,a))});
D.defineProperty(F,{rF:"deletable"},function(){return 0!==(this.T&2)},function(a){var b=0!==(this.T&2);b!==a&&(v&&D.h(a,"boolean",F,"deletable"),this.T^=2,this.i("deletable",b,a))});D.defineProperty(F,{lH:"textEditable"},function(){return 0!==(this.T&4)},function(a){var b=0!==(this.T&4);b!==a&&(v&&D.h(a,"boolean",F,"textEditable"),this.T^=4,this.i("textEditable",b,a),this.de())});
D.defineProperty(F,{XF:"groupable"},function(){return 0!==(this.T&8)},function(a){var b=0!==(this.T&8);b!==a&&(v&&D.h(a,"boolean",F,"groupable"),this.T^=8,this.i("groupable",b,a))});D.defineProperty(F,{zG:"movable"},function(){return 0!==(this.T&16)},function(a){var b=0!==(this.T&16);b!==a&&(v&&D.h(a,"boolean",F,"movable"),this.T^=16,this.i("movable",b,a))});
D.defineProperty(F,{$G:"selectionAdorned"},function(){return 0!==(this.T&32)},function(a){var b=0!==(this.T&32);b!==a&&(v&&D.h(a,"boolean",F,"selectionAdorned"),this.T^=32,this.i("selectionAdorned",b,a),this.de())});D.defineProperty(F,{my:"isInDocumentBounds"},function(){return 0!==(this.T&64)},function(a){var b=0!==(this.T&64);if(b!==a){v&&D.h(a,"boolean",F,"isInDocumentBounds");this.T^=64;var c=this.g;null!==c&&c.Rc();this.i("isInDocumentBounds",b,a)}});
D.defineProperty(F,{zB:"isLayoutPositioned"},function(){return 0!==(this.T&128)},function(a){var b=0!==(this.T&128);b!==a&&(v&&D.h(a,"boolean",F,"isLayoutPositioned"),this.T^=128,this.i("isLayoutPositioned",b,a),this.L(a?4:8))});D.defineProperty(F,{nl:"selectable"},function(){return 0!==(this.T&256)},function(a){var b=0!==(this.T&256);b!==a&&(v&&D.h(a,"boolean",F,"selectable"),this.T^=256,this.i("selectable",b,a),this.de())});
D.defineProperty(F,{OG:"reshapable"},function(){return 0!==(this.T&512)},function(a){var b=0!==(this.T&512);b!==a&&(v&&D.h(a,"boolean",F,"reshapable"),this.T^=512,this.i("reshapable",b,a),this.de())});D.defineProperty(F,{PG:"resizable"},function(){return 0!==(this.T&1024)},function(a){var b=0!==(this.T&1024);b!==a&&(v&&D.h(a,"boolean",F,"resizable"),this.T^=1024,this.i("resizable",b,a),this.de())});
D.defineProperty(F,{UG:"rotatable"},function(){return 0!==(this.T&2048)},function(a){var b=0!==(this.T&2048);b!==a&&(v&&D.h(a,"boolean",F,"rotatable"),this.T^=2048,this.i("rotatable",b,a),this.de())});
D.defineProperty(F,{mb:"isSelected"},function(){return 0!==(this.T&4096)},function(a){var b=0!==(this.T&4096);if(b!==a){v&&D.h(a,"boolean",F,"isSelected");var c=this.g;if(!a||this.canSelect()&&!(null!==c&&c.selection.count>=c.KJ)){this.T^=4096;var d=!1;if(null!==c){d=c.ob;c.ob=!0;var e=c.selection;e.Xa();a?e.add(this):e.remove(this);e.freeze()}this.i("isSelected",b,a);this.de();a=this.qK;null!==a&&a(this);null!==c&&(c.Le(),c.ob=d)}}});
D.defineProperty(F,{Zg:"isHighlighted"},function(){return 0!==(this.T&524288)},function(a){var b=0!==(this.T&524288);if(b!==a){v&&D.h(a,"boolean",F,"isHighlighted");this.T^=524288;var c=this.g;null!==c&&(c=c.Bm,c.Xa(),a?c.add(this):c.remove(this),c.freeze());this.i("isHighlighted",b,a);this.ra();a=this.fJ;null!==a&&a(this)}});
D.defineProperty(F,{jl:"isShadowed"},function(){return 0!==(this.T&8192)},function(a){var b=0!==(this.T&8192);b!==a&&(v&&D.h(a,"boolean",F,"isShadowed"),this.T^=8192,this.i("isShadowed",b,a),this.ra())});function ul(a,b){a.T=b?a.T|16384:a.T&-16385}function Om(a){return 0!==(a.T&32768)}function jr(a,b){a.T=b?a.T|32768:a.T&-32769}function To(a,b){a.T=b?a.T|65536:a.T&-65537}function tl(a){return 0!==(a.T&131072)}F.prototype.Qf=function(a){this.T=a?this.T|131072:this.T&-131073};
function sr(a,b){a.T=b?a.T|1048576:a.T&-1048577}D.defineProperty(F,{dG:"isAnimated"},function(){return 0!==(this.T&262144)},function(a){var b=0!==(this.T&262144);b!==a&&(v&&D.h(a,"boolean",F,"isAnimated"),this.T^=262144,this.i("isAnimated",b,a))});D.defineProperty(F,{fJ:"highlightedChanged"},function(){return this.ps},function(a){var b=this.ps;b!==a&&(null!==a&&D.h(a,"function",F,"highlightedChanged"),this.ps=a,this.i("highlightedChanged",b,a))});
D.defineProperty(F,{Vy:"selectionObjectName"},function(){return this.It},function(a){var b=this.It;b!==a&&(v&&D.h(a,"string",F,"selectionObjectName"),this.It=a,this.An=null,this.i("selectionObjectName",b,a))});D.defineProperty(F,{pK:"selectionAdornmentTemplate"},function(){return this.Gt},function(a){var b=this.Gt;b!==a&&(v&&D.l(a,ca,F,"selectionAdornmentTemplate"),this.Gt=a,this.i("selectionAdornmentTemplate",b,a))});
D.w(F,{Im:"selectionObject"},function(){if(null===this.An){var a=this.Vy;null!==a&&""!==a?(a=this.Md(a),this.An=null!==a?a:this):this instanceof J?(a=this.path,this.An=null!==a?a:this):this.An=this}return this.An});D.defineProperty(F,{qK:"selectionChanged"},function(){return this.Ht},function(a){var b=this.Ht;b!==a&&(null!==a&&D.h(a,"function",F,"selectionChanged"),this.Ht=a,this.i("selectionChanged",b,a))});
D.defineProperty(F,{QG:"resizeAdornmentTemplate"},function(){return this.ut},function(a){var b=this.ut;b!==a&&(v&&D.l(a,ca,F,"resizeAdornmentTemplate"),this.ut=a,this.i("resizeAdornmentTemplate",b,a))});D.defineProperty(F,{SG:"resizeObjectName"},function(){return this.wt},function(a){var b=this.wt;b!==a&&(v&&D.h(a,"string",F,"resizeObjectName"),this.wt=a,this.Kp=null,this.i("resizeObjectName",b,a))});
D.w(F,{RG:"resizeObject"},function(){if(null===this.Kp){var a=this.SG;null!==a&&""!==a?(a=this.Md(a),this.Kp=null!==a?a:this):this.Kp=this}return this.Kp});D.defineProperty(F,{gK:"resizeCellSize"},function(){return this.vt},function(a){var b=this.vt;b.P(a)||(v&&D.l(a,Ba,F,"resizeCellSize"),this.vt=a=a.V(),this.i("resizeCellSize",b,a))});
D.defineProperty(F,{iK:"rotateAdornmentTemplate"},function(){return this.xt},function(a){var b=this.xt;b!==a&&(v&&D.l(a,ca,F,"rotateAdornmentTemplate"),this.xt=a,this.i("rotateAdornmentTemplate",b,a))});D.defineProperty(F,{jK:"rotateObjectName"},function(){return this.yt},function(a){var b=this.yt;b!==a&&(v&&D.h(a,"string",F,"rotateObjectName"),this.yt=a,this.Lp=null,this.i("rotateObjectName",b,a))});
D.w(F,{YB:"rotateObject"},function(){if(null===this.Lp){var a=this.jK;null!==a&&""!==a?(a=this.Md(a),this.Lp=null!==a?a:this):this.Lp=this}return this.Lp});D.defineProperty(F,{text:"text"},function(){return this.Zd},function(a){var b=this.Zd;b!==a&&(v&&D.h(a,"string",F,"text"),this.Zd=a,this.i("text",b,a))});
D.defineProperty(F,{Ja:"containingGroup"},function(){return this.El},function(a){if(this.te()){var b=this.El;if(b!==a){v&&null!==a&&D.l(a,I,F,"containingGroup");null===a||this!==a&&!a.Ji(this)||(this===a&&D.k("Cannot make a Group a member of itself: "+this.toString()),D.k("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.L(dn);var c=this.g;null!==b?tr(b,this):this instanceof I&&null!==c&&c.fm.remove(this);this.El=a;null!==a?ur(a,this):this instanceof
I&&null!==c&&c.fm.add(this);this.L(Vm);if(null!==c){var d=this.data,e=c.ea;null!==d&&e instanceof X&&e.dC(d,e.yb(null!==a?a.data:null))}d=this.kF;null!==d&&(e=!0,null!==c&&(e=c.ab,c.ab=!0),d(this,b,a),null!==c&&(c.ab=e));if(this instanceof I)for(c=new L(F),Qh(c,this,!0,0,!0),c=c.j;c.next();)if(d=c.value,d instanceof H)for(d=d.Od;d.next();)An(d.value);if(this instanceof H){for(d=this.Od;d.next();)An(d.value);c=this.Zb;null!==c&&An(c)}this.i("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&yl(b,
-1,a))}}else D.k("cannot set the Part.containingGroup of a Link or Adornment")});f=F.prototype;f.hl=function(){var a=this.Ja;null!==a&&(a.K(),null!==a.Tb&&a.Tb.K(),a.lg())};f.ra=function(){var a=this.g;null!==a&&!Nm(this)&&!Om(this)&&this.isVisible()&&this.dc.F()&&a.ra(xl(this,this.dc))};f.K=function(){x.prototype.K.call(this);var a=this.g;null!==a&&(a.Gg.add(this),this instanceof H&&null!==this.Zb&&ap(this.Zb),a.Le(!0))};f.Ku=function(a){a||(a=this.El,null!==a&&ur(a,this))};
f.Lu=function(a){a||(a=this.El,null!==a&&tr(a,this))};f.Un=function(){var a=this.data;if(null!==a){var b=this.g;null!==b&&(b=b.ea,null!==b&&b.Py(a))}};D.defineProperty(F,{kF:"containingGroupChanged"},function(){return this.Br},function(a){var b=this.Br;b!==a&&(null!==a&&D.h(a,"function",F,"containingGroupChanged"),this.Br=a,this.i("containingGroupChanged",b,a))});F.prototype.findSubGraphLevel=function(){return vr(this,this)};
function vr(a,b){var c=b.Ja;return null!==c?1+vr(a,c):b instanceof H&&(c=b.Zb,null!==c)?vr(a,c):0}F.prototype.findTopLevelPart=function(){return wr(this,this)};function wr(a,b){var c=b.Ja;return null!==c?wr(a,c):b instanceof H&&(c=b.Zb,null!==c)?wr(a,c):b}D.w(F,{Fq:"isTopLevel"},function(){return null!==this.Ja||this instanceof H&&null!==this.Zb?!1:!0});F.prototype.isMemberOf=F.prototype.Ji=function(a){return a instanceof I?xr(this,this,a):!1};
function xr(a,b,c){if(b===c||null===c)return!1;var d=b.Ja;return null===d||d!==c&&!xr(a,d,c)?b instanceof H&&(b=b.Zb,null!==b)?xr(a,b,c):!1:!0}
F.prototype.findCommonContainingGroup=F.prototype.MI=function(a){if(null===a)return null;v&&D.l(a,F,F,"findCommonContainingGroup:other");if(this===a)return this.Ja;for(var b=this;null!==b;){b instanceof I&&sr(b,!0);if(b instanceof H){var c=b.Zb;null!==c&&(b=c)}b=b.Ja}for(var d=null,b=a;null!==b;){if(0!==(b.T&1048576)){d=b;break}b instanceof H&&(c=b.Zb,null!==c&&(b=c));b=b.Ja}for(b=this;null!==b;)b instanceof I&&sr(b,!1),b instanceof H&&(c=b.Zb,null!==c&&(b=c)),b=b.Ja;return d};
D.defineProperty(F,{AJ:"layoutConditions"},function(){return this.Es},function(a){var b=this.Es;b!==a&&(v&&D.h(a,"number",F,"layoutConditions"),this.Es=a,this.i("layoutConditions",b,a))});F.prototype.canLayout=function(){if(!this.zB||!this.isVisible())return!1;var a=this.layer;return null!==a&&a.Sc||this instanceof H&&this.Mf?!1:!0};
F.prototype.invalidateLayout=F.prototype.L=function(a){void 0===a&&(a=16777215);var b;this.zB&&0!==(a&this.AJ)?(b=this.layer,null!==b&&b.Sc||this instanceof H&&this.Mf?b=!1:(b=this.g,b=null!==b&&b.na.ub?!1:!0)):b=!1;if(b)if(b=this.El,null!==b){var c=b.$b;null!==c?c.L():b.L(a)}else a=this.g,null!==a&&(c=a.$b,null!==c&&c.L())};function $m(a){if(!a.isVisible())return!1;a=a.layer;return null!==a&&a.Sc?!1:!0}
D.defineProperty(F,{Ux:"dragComputation"},function(){return this.Xr},function(a){var b=this.Xr;b!==a&&(null!==a&&D.h(a,"function",F,"dragComputation"),this.Xr=a,this.i("dragComputation",b,a))});D.defineProperty(F,{uK:"shadowOffset"},function(){return this.Cn},function(a){var b=this.Cn;b.P(a)||(v&&D.l(a,N,F,"shadowOffset"),this.Cn=a=a.V(),this.ra(),this.i("shadowOffset",b,a))});
D.defineProperty(F,{shadowColor:"shadowColor"},function(){return this.Bn},function(a){var b=this.Bn;b!==a&&(v&&D.h(a,"string",F,"shadowColor"),this.Bn=a,this.ra(),this.i("shadowColor",b,a))});D.defineProperty(F,{shadowBlur:"shadowBlur"},function(){return this.Pg},function(a){var b=this.Pg;b!==a&&(v&&D.h(a,"number",F,"shadowBlur"),this.Pg=a,this.ra(),this.i("shadowBlur",b,a))});
function ca(a){0===arguments.length?F.call(this,ek):F.call(this,a);this.T&=-257;this.Tl="Adornment";this.Vc=null;this.bE=0;this.OE=!1;this.Tb=this.ph=null}D.Ta(ca,F);D.ka("Adornment",ca);ca.prototype.toString=function(){var a=this.hf;return"Adornment("+this.wd+")"+(null!==a?a.toString():"")};ca.prototype.updateRelationshipsFromData=function(){};
ca.prototype.$u=function(a){var b=this.Cb.$,c=this.Cb;if(b instanceof J&&c instanceof A){var d=b.path,c=d.wf;b.$u(a);c=d.wf;a=this.ya.o;b=a.length;for(d=0;d<b;d++){var e=a[d];e.We&&e instanceof A&&(e.Za=c)}}};D.w(ca,{placeholder:"placeholder"},function(){return this.Tb});
D.defineProperty(ca,{Cb:"adornedObject"},function(){return this.Vc},function(a){v&&null!==a&&D.l(a,O,F,"adornedObject:value");var b=this.hf,c=null;null!==a&&(c=a.$);null===b||null!==a&&b===c||b.$j(this.wd);this.Vc=a;null!==c&&c.im(this.wd,this)});D.w(ca,{hf:"adornedPart"},function(){var a=this.Vc;return null!==a?a.$:null});ca.prototype.Em=function(){var a=this.Vc;if(null===a)return!0;a=a.$;return null===a||!Nm(a)};ca.prototype.te=function(){return!1};D.w(ca,{Ja:"containingGroup"},function(){return null});
ca.prototype.xo=function(a,b,c,d,e,g,h){if(a===gg&&"elements"===b)if(e instanceof Zj){var k=e;null===this.Tb?this.Tb=k:this.Tb!==k&&D.k("Cannot insert a second Placeholder into the visual tree of an Adornment.")}else e instanceof x&&(k=e.wu(function(a){return a instanceof Zj}),k instanceof Zj&&(null===this.Tb?this.Tb=k:this.Tb!==k&&D.k("Cannot insert a second Placeholder into the visual tree of an Adornment.")));else a===hg&&"elements"===b&&null!==this.Tb&&(d===this.Tb?this.Tb=null:d instanceof x&&
this.Tb.Dm(d)&&(this.Tb=null));F.prototype.xo.call(this,a,b,c,d,e,g,h)};ca.prototype.updateAdornments=function(){};ca.prototype.Un=function(){};function H(a){F.call(this,a);this.Ca=13;this.zc=new K(J);this.au=this.vp=this.Vl=this.Gs=this.Fs=null;this.ur=Md;this.Re=this.di=null;this.qt=yr;this.Rk=!1}D.Ta(H,F);D.ka("Node",H);
H.prototype.cloneProtected=function(a){F.prototype.cloneProtected.call(this,a);a.Ca=this.Ca;a.Ca=this.Ca&-17;a.Fs=this.Fs;a.Gs=this.Gs;a.Vl=this.Vl;a.au=this.au;a.ur=this.ur.V();a.qt=this.qt};H.prototype.Ii=function(a){F.prototype.Ii.call(this,a);a.lg();a.di=this.di;a.Re=null};var zr;H.DirectionDefault=zr=D.s(H,"DirectionDefault",0);H.DirectionAbsolute=D.s(H,"DirectionAbsolute",1);var Ar;H.DirectionRotatedNode=Ar=D.s(H,"DirectionRotatedNode",2);var Ho;
H.DirectionRotatedNodeOrthogonal=Ho=D.s(H,"DirectionRotatedNodeOrthogonal",3);H.SpreadingNone=D.s(H,"SpreadingNone",10);var yr;H.SpreadingEvenly=yr=D.s(H,"SpreadingEvenly",11);var Br;H.SpreadingPacked=Br=D.s(H,"SpreadingPacked",12);function Cr(a,b){null!==b&&(null===a.di&&(a.di=new L(Hl)),a.di.add(b))}
function Dr(a,b,c,d){if(null===b||null===a.di)return null;for(var e=a.di.j;e.next();){var g=e.value;if(g.Lq===a&&g.ev===b&&g.Hy===c&&g.Iy===d||g.Lq===b&&g.ev===a&&g.Hy===d&&g.Iy===c)return g}return null}H.prototype.invalidateLinkBundle=function(a,b,c){if(void 0===b||null===b)b="";if(void 0===c||null===c)c="";a=Dr(this,a,b,c);null!==a&&a.Aq()};H.prototype.xo=function(a,b,c,d,e,g,h){a===gg&&"elements"===b?this.Re=null:a===hg&&"elements"===b&&(this.Re=null);F.prototype.xo.call(this,a,b,c,d,e,g,h)};
H.prototype.invalidateConnectedLinks=H.prototype.lg=function(a){void 0===a&&(a=null);for(var b=this.Od;b.next();){var c=b.value;null!==a&&a.contains(c)||(Er(this,c.ic),Er(this,c.wc),c.bc())}};function Uo(a,b){for(var c=a.Od;c.next();){var d=c.value;if(d.ic===b||d.wc===b)Er(a,d.ic),Er(a,d.wc),d.bc()}}function Er(a,b){if(null!==b){var c=b.pt;null!==c&&c.Aq();c=a.Ja;null===c||c.nd||Er(c,c.port)}}H.prototype.Em=function(){return!0};
D.defineProperty(H,{$J:"portSpreading"},function(){return this.qt},function(a){var b=this.qt;b!==a&&(v&&D.Da(a,H,H,"portSpreading"),this.qt=a,this.i("portSpreading",b,a),a=this.g,null!==a&&a.na.ub||this.lg())});D.defineProperty(H,{NA:"avoidable"},function(){return 0!==(this.Ca&8)},function(a){var b=0!==(this.Ca&8);if(b!==a){v&&D.h(a,"boolean",H,"avoidable");this.Ca^=8;var c=this.g;null!==c&&c.tB(this);this.i("avoidable",b,a)}});
D.defineProperty(H,{eI:"avoidableMargin"},function(){return this.ur},function(a){"number"===typeof a?a=new Mb(a):D.l(a,Mb,H,"avoidableMargin");var b=this.ur;if(!b.P(a)){this.ur=a=a.V();var c=this.g;null!==c&&c.tB(this);this.i("avoidableMargin",b,a)}});H.prototype.getAvoidableRect=function(a){a.set(this.Y);a.Bx(this.eI);return a};H.prototype.findVisibleNode=function(){for(var a=this;null!==a&&!a.isVisible();)a=a.Ja;return a};
H.prototype.isVisible=function(){if(!F.prototype.isVisible.call(this))return!1;var a=!0,b=Dl,c=this.g;if(null!==c){a=c.Ra;if(a.nf&&(a=a.qn.oa(this),null!==a&&a.My))return!0;a=c.ge;b=c.uC}if(b===Dl){if(c=this.al(),null!==c&&!c.Fc)return!1}else if(b===hn){if(c=a?this.GF():this.HF(),0<c.count&&c.all(function(a){return!a.Fc}))return!1}else if(b===jn&&(c=a?this.GF():this.HF(),0<c.count&&c.any(function(a){return!a.Fc})))return!1;c=this.Zb;return null!==c?c.isVisible():!0};
H.prototype.Pd=function(a){F.prototype.Pd.call(this,a);for(var b=this.Od;b.next();)b.value.Pd(a)};D.w(H,{Od:"linksConnected"},function(){return this.zc.j});H.prototype.findLinksConnected=H.prototype.EF=function(a){void 0===a&&(a=null);if(null===a)return this.zc.j;v&&D.h(a,"string",H,"findLinksConnected:pid");var b=new Na(this.zc),c=this;b.Rq=function(b){return b.Z===c&&b.ig===a||b.ba===c&&b.jh===a};return b};
H.prototype.findLinksOutOf=H.prototype.ay=function(a){void 0===a&&(a=null);v&&null!==a&&D.h(a,"string",H,"findLinksOutOf:pid");var b=new Na(this.zc),c=this;b.Rq=function(b){return b.Z!==c?!1:null===a?!0:b.ig===a};return b};H.prototype.findLinksInto=H.prototype.Yg=function(a){void 0===a&&(a=null);v&&null!==a&&D.h(a,"string",H,"findLinksInto:pid");var b=new Na(this.zc),c=this;b.Rq=function(b){return b.ba!==c?!1:null===a?!0:b.jh===a};return b};
H.prototype.findNodesConnected=H.prototype.FF=function(a){void 0===a&&(a=null);v&&null!==a&&D.h(a,"string",H,"findNodesConnected:pid");for(var b=null,c=null,d=this.zc.j;d.next();){var e=d.value;if(e.Z===this){if(null===a||e.ig===a)e=e.ba,null!==b?b.add(e):null!==c&&c!==e?(b=new L(H),b.add(c),b.add(e)):c=e}else e.ba!==this||null!==a&&e.jh!==a||(e=e.Z,null!==b?b.add(e):null!==c&&c!==e?(b=new L(H),b.add(c),b.add(e)):c=e)}return null!==b?b.j:null!==c?new Ka(c):Ja};
H.prototype.findNodesOutOf=H.prototype.HF=function(a){void 0===a&&(a=null);v&&null!==a&&D.h(a,"string",H,"findNodesOutOf:pid");for(var b=null,c=null,d=this.zc.j;d.next();){var e=d.value;e.Z!==this||null!==a&&e.ig!==a||(e=e.ba,null!==b?b.add(e):null!==c&&c!==e?(b=new L(H),b.add(c),b.add(e)):c=e)}return null!==b?b.j:null!==c?new Ka(c):Ja};
H.prototype.findNodesInto=H.prototype.GF=function(a){void 0===a&&(a=null);v&&null!==a&&D.h(a,"string",H,"findNodesInto:pid");for(var b=null,c=null,d=this.zc.j;d.next();){var e=d.value;e.ba!==this||null!==a&&e.jh!==a||(e=e.Z,null!==b?b.add(e):null!==c&&c!==e?(b=new L(H),b.add(c),b.add(e)):c=e)}return null!==b?b.j:null!==c?new Ka(c):Ja};
H.prototype.findLinksBetween=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);v&&(D.l(a,H,H,"findLinksBetween:othernode"),null!==b&&D.h(b,"string",H,"findLinksBetween:pid"),null!==c&&D.h(c,"string",H,"findLinksBetween:otherpid"));var d=new Na(this.zc),e=this;d.Rq=function(d){return(d.Z!==e||d.ba!==a||null!==b&&d.ig!==b||null!==c&&d.jh!==c)&&(d.Z!==a||d.ba!==e||null!==c&&d.ig!==c||null!==b&&d.jh!==b)?!1:!0};return d};
H.prototype.findLinksTo=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);v&&(D.l(a,H,H,"findLinksTo:othernode"),null!==b&&D.h(b,"string",H,"findLinksTo:pid"),null!==c&&D.h(c,"string",H,"findLinksTo:otherpid"));var d=new Na(this.zc),e=this;d.Rq=function(d){return d.Z!==e||d.ba!==a||null!==b&&d.ig!==b||null!==c&&d.jh!==c?!1:!0};return d};
D.defineProperty(H,{BJ:"linkConnected"},function(){return this.Fs},function(a){var b=this.Fs;b!==a&&(null!==a&&D.h(a,"function",H,"linkConnected"),this.Fs=a,this.i("linkConnected",b,a))});D.defineProperty(H,{CJ:"linkDisconnected"},function(){return this.Gs},function(a){var b=this.Gs;b!==a&&(null!==a&&D.h(a,"function",H,"linkDisconnected"),this.Gs=a,this.i("linkDisconnected",b,a))});
D.defineProperty(H,{xy:"linkValidation"},function(){return this.Vl},function(a){var b=this.Vl;b!==a&&(null!==a&&D.h(a,"function",H,"linkValidation"),this.Vl=a,this.i("linkValidation",b,a))});
function Fr(a,b,c){Er(a,c);var d=a.zc.contains(b);d||a.zc.add(b);if(!d||b.Z===b.ba){var e=a.BJ;if(null!==e){var g=!0,h=a.g;null!==h&&(g=h.ab,h.ab=!0);e(a,b,c);null!==h&&(h.ab=g)}}!d&&b.kc&&(c=b.Z,b=b.ba,null!==c&&null!==b&&c!==b&&(d=!0,h=a.g,null!==h&&(d=h.ge),a=d?b:c,e=d?c:b,a.Rk||(a.Rk=e),!e.Tj||null!==h&&h.na.ub||(d?c===e&&(e.Tj=!1):b===e&&(e.Tj=!1))))}
function Gr(a,b,c){Er(a,c);var d=a.zc.remove(b);if(d||b.ba===b.Z){var e=a.CJ,g=a.g;if(null!==e){var h=!0;null!==g&&(h=g.ab,g.ab=!0);e(a,b,c);null!==g&&(g.ab=h)}}d&&b.kc&&(c=!0,null!==g&&(c=g.ge),a=c?b.ba:b.Z,b=c?b.Z:b.ba,null!==a&&(a.Rk=!1),null===b||b.Tj||(0===b.zc.count?(b.Rk=null,null!==g&&g.na.ub||(b.Tj=!0)):Ln(b)))}
function Ln(a){a.Rk=!1;if(0!==a.zc.count){var b=!0,c=a.g;if(null===c||!c.na.ub){null!==c&&(b=c.ge);for(c=a.zc.j;c.next();){var d=c.value;if(d.kc)if(b){if(d.Z===a){a.Tj=!1;return}}else if(d.ba===a){a.Tj=!1;return}}a.Tj=!0}}}
H.prototype.updateRelationshipsFromData=function(){F.prototype.updateRelationshipsFromData.call(this);var a=this.data;if(null!==a){var b=this.g;if(null!==b){var c=b.ea;c instanceof Ag&&(a=c.ao(a),a=b.Ve(a),c=this.al(),a!==c&&(c=this.Xn(),null!==a?null!==c?b.ge?c.Z=a:c.ba=a:nn(b,a,this):null!==c&&cn(b,c,!1)))}}};H.prototype.Ku=function(a){F.prototype.Ku.call(this,a);a||(Ln(this),a=this.vp,null!==a&&Hr(a,this))};
H.prototype.Lu=function(a){F.prototype.Lu.call(this,a);a||(a=this.vp,null!==a&&null!==a.If&&(a.If.remove(this),a.K()))};H.prototype.Un=function(){if(0<this.zc.count){var a=this.g;if(null!==a)for(var b=a.xb.vF,c=this.zc.copy().j;c.next();){var d=c.value;b?a.remove(d):(d.Z===this&&(d.Z=null),d.ba===this&&(d.ba=null))}}this.Zb=null;F.prototype.Un.call(this)};D.w(H,{Mf:"isLinkLabel"},function(){return null!==this.vp});
D.defineProperty(H,{Zb:"labeledLink"},function(){return this.vp},function(a){var b=this.vp;if(b!==a){v&&null!==a&&D.l(a,J,H,"labeledLink");var c=this.g,d=this.data;if(null!==b){null!==b.If&&(b.If.remove(this),b.K());if(null!==c&&null!==d&&!c.na.ub){var e=b.data,g=c.ea;if(null!==e&&g instanceof X){var h=g.yb(d);void 0!==h&&g.eK(e,h)}}this.Ja=null}this.vp=a;null!==a&&(Hr(a,this),null===c||null===d||c.na.ub||(e=a.data,g=c.ea,null!==e&&g instanceof X&&(h=g.yb(d),void 0!==h&&g.VE(e,h))),this.Ja=a.Ja);
ap(this);this.i("labeledLink",b,a)}});H.prototype.findPort=H.prototype.fB=function(a){v&&D.h(a,"string",H,"findPort:pid");if(null===this.Re){if(""===a&&!1===this.gl)return this;Ir(this)}var b=this.Re.oa(a);return null!==b||""!==a&&(b=this.Re.oa(""),null!==b)?b:this};D.w(H,{port:"port"},function(){return this.fB("")});D.w(H,{ports:"ports"},function(){null===this.Re&&Ir(this);return this.Re.qG});
function Ir(a){null===a.Re?a.Re=new ma("string",O):a.Re.clear();ip(a,a,function(a,c){gp(a,c)});0===a.Re.count&&a.Re.add("",a)}function gp(a,b){var c=b.Rd;null!==c&&null!==a.Re&&a.Re.add(c,b)}function fp(a,b,c){var d=b.Rd;if(null!==d&&(null!==a.Re&&a.Re.remove(d),b=a.g,null!==b&&c)){c=null;for(d=a.EF(d);d.next();)a=d.value,null===c&&(c=D.hb()),c.push(a);if(null!==c){for(d=0;d<c.length;d++)a=c[d],b.remove(a);D.ua(c)}}}
H.prototype.isInTreeOf=function(a){if(null===a||a===this)return!1;var b=!0,c=this.g;null!==c&&(b=c.ge);c=this;if(b)for(;c!==a;){for(var b=null,d=c.zc.j;d.next();){var e=d.value;if(e.kc&&(b=e.Z,b!==c&&b!==this))break}if(b===this||null===b||b===c)return!1;c=b}else for(;c!==a;){b=null;for(d=c.zc.j;d.next()&&(e=d.value,!e.kc||(b=e.ba,b===c||b===this)););if(b===this||null===b||b===c)return!1;c=b}return!0};
H.prototype.findTreeRoot=function(){var a=!0,b=this.g;null!==b&&(a=b.ge);b=this;if(a)for(;;){for(var a=null,c=b.zc.j;c.next();){var d=c.value;if(d.kc&&(a=d.Z,a!==b&&a!==this))break}if(a===this)return this;if(null===a||a===b)return b;b=a}else for(;;){a=null;for(c=b.zc.j;c.next()&&(d=c.value,!d.kc||(a=d.ba,a===b||a===this)););if(a===this)return this;if(null===a||a===b)return b;b=a}};
H.prototype.findCommonTreeParent=function(a){if(null===a)return null;v&&D.l(a,H,H,"findCommonTreeParent:other");if(this===a)return this;for(var b=this;null!==b;)sr(b,!0),b=b.al();for(var c=null,b=a;null!==b;){if(0!==(b.T&1048576)){c=b;break}b=b.al()}for(b=this;null!==b;)sr(b,!1),b=b.al();return c};
H.prototype.findTreeParentLink=H.prototype.Xn=function(){var a=!0,b=this.g;null!==b&&(a=b.ge);b=this.zc.j;if(a)for(;b.next();){if(a=b.value,a.kc&&a.Z!==this)return a}else for(;b.next();)if(a=b.value,a.kc&&a.ba!==this)return a;return null};
H.prototype.findTreeParentNode=H.prototype.al=function(){var a=this.Rk;if(null===a)return null;if(a instanceof H)return a;var b=!0,a=this.g;null!==a&&(b=a.ge);a=this.zc.j;if(b)for(;a.next();){if(b=a.value,b.kc&&(b=b.Z,b!==this))return this.Rk=b}else for(;a.next();)if(b=a.value,b.kc&&(b=b.ba,b!==this))return this.Rk=b;return this.Rk=null};H.prototype.findTreeParentChain=function(){function a(b,d){if(null!==b){d.add(b);var e=b.Xn();null!==e&&(d.add(e),a(b.al(),d))}}var b=new L(F);a(this,b);return b};
H.prototype.findTreeLevel=function(){return Jr(this,this)};function Jr(a,b){var c=b.al();return null===c?0:1+Jr(a,c)}H.prototype.findTreeChildrenLinks=H.prototype.ey=function(){var a=!0,b=this.g;null!==b&&(a=b.ge);var b=new Na(this.zc),c=this;b.Rq=a?function(a){return a.kc&&a.Z===c?!0:!1}:function(a){return a.kc&&a.ba===c?!0:!1};return b};
H.prototype.findTreeChildrenNodes=H.prototype.JF=function(){var a=!0,b=this.g;null!==b&&(a=b.ge);var c=b=null,d=this.zc.j;if(a)for(;d.next();)a=d.value,a.kc&&a.Z===this&&(a=a.ba,null!==b?b.add(a):null!==c&&c!==a?(b=new K(H),b.add(c),b.add(a)):c=a);else for(;d.next();)a=d.value,a.kc&&a.ba===this&&(a=a.Z,null!==b?b.add(a):null!==c&&c!==a?(b=new K(H),b.add(c),b.add(a)):c=a);return null!==b?b.j:null!==c?new Ka(c):Ja};
H.prototype.findTreeParts=function(a){void 0===a&&(a=Infinity);D.h(a,"number",H,"findTreeParts:level");var b=new L(F);Qh(b,this,!1,a,!0);return b};H.prototype.collapseTree=H.prototype.collapseTree=function(a){void 0===a&&(a=1);D.p(a,H,"collapseTree:level");1>a&&(a=1);var b=this.g;if(null!==b&&!b.Qh){b.Qh=!0;var c=new L(H);c.add(this);Kr(this,c,b.ge,a,b.Ra,this,b.uC===Dl);b.Qh=!1}};
function Kr(a,b,c,d,e,g,h){if(1<d)for(var k=c?a.ay():a.Yg();k.next();){var l=k.value;l.kc&&(l=l.kB(a),null===l||l===a||b.contains(l)||(b.add(l),Kr(l,b,c,d-1,e,g,h)))}else Lr(a,b,c,e,g,h)}function Lr(a,b,c,d,e,g){for(var h=e===a?!0:a.Fc,k=c?a.ay():a.Yg();k.next();){var l=k.value;if(l.kc&&(l=l.kB(a),null!==l&&l!==a)){var m=b.contains(l);m||b.add(l);h&&(g&&ql(d,l,e),l.hl(),l.Pd(!1));l.Fc&&(l.fr=l.Fc,m||Lr(l,b,c,d,e,g))}}a.Fc=!1}
H.prototype.expandTree=H.prototype.expandTree=function(a){void 0===a&&(a=2);D.p(a,H,"expandTree:level");2>a&&(a=2);var b=this.g;if(null!==b&&!b.Qh){b.Qh=!0;var c=new L(H);c.add(this);Mr(this,c,b.ge,a,b.Ra,this,b.uC===Dl);b.Qh=!1}};function Mr(a,b,c,d,e,g,h){for(var k=g===a?!1:a.Fc,l=c?a.ay():a.Yg();l.next();){var m=l.value;m.kc&&(k||m.Uf||m.bc(),m=m.kB(a),null!==m&&m!==a&&!b.contains(m)&&(b.add(m),k||(m.Pd(!0),m.hl(),h&&pl(e,m,g)),2<d||m.fr))&&(m.fr=!1,Mr(m,b,c,d-1,e,g,h))}a.Fc=!0}
D.defineProperty(H,{Fc:"isTreeExpanded"},function(){return 0!==(this.Ca&1)},function(a){var b=0!==(this.Ca&1);if(b!==a){v&&D.h(a,"boolean",H,"isTreeExpanded");this.Ca^=1;var c=this.g;this.i("isTreeExpanded",b,a);b=this.GK;if(null!==b){var d=!0;null!==c&&(d=c.ab,c.ab=!0);b(this);null!==c&&(c.ab=d)}null!==c&&c.na.ub?this.Pd(a):a?this.expandTree():this.collapseTree()}});
D.defineProperty(H,{fr:"wasTreeExpanded"},function(){return 0!==(this.Ca&2)},function(a){var b=0!==(this.Ca&2);b!==a&&(v&&D.h(a,"boolean",H,"wasTreeExpanded"),this.Ca^=2,this.i("wasTreeExpanded",b,a))});D.defineProperty(H,{GK:"treeExpandedChanged"},function(){return this.au},function(a){var b=this.au;b!==a&&(null!==a&&D.h(a,"function",H,"treeExpandedChanged"),this.au=a,this.i("treeExpandedChanged",b,a))});
D.defineProperty(H,{Tj:"isTreeLeaf"},function(){return 0!==(this.Ca&4)},function(a){var b=0!==(this.Ca&4);b!==a&&(v&&D.h(a,"boolean",H,"isTreeLeaf"),this.Ca^=4,this.i("isTreeLeaf",b,a))});
function J(){F.call(this,tj);this.gc=8;this.Cg=null;this.ji="";this.Tg=this.gs=null;this.Di="";this.$t=null;this.mr=wj;this.Hr=0;this.Kr=wj;this.Lr=NaN;this.vn=Nr;this.Pt=.5;this.If=null;this.jd=(new K(N)).freeze();this.ph=this.lD=this.fD=this.Si=this.dj=this.Za=this.Yw=this.Mp=this.ff=null;this.zA=new N;this.aa=this.BE=this.AE=null}D.Ta(J,F);D.ka("Link",J);
J.prototype.cloneProtected=function(a){F.prototype.cloneProtected.call(this,a);a.gc=this.gc&-113;a.ji=this.ji;a.gs=this.gs;a.Di=this.Di;a.$t=this.$t;a.mr=this.mr;a.Hr=this.Hr;a.Kr=this.Kr;a.Lr=this.Lr;a.vn=this.vn;a.Pt=this.Pt;null!==this.aa&&(a.aa=this.aa.copy())};J.prototype.Ii=function(a){F.prototype.Ii.call(this,a);this.ji=a.ji;this.Di=a.Di;a.ff=null;a.bc();a.Si=this.Si;var b=a.ic;null!==b&&Er(a.Z,b);b=a.wc;null!==b&&Er(a.ba,b)};
J.prototype.qc=function(a){a.Se===J?2===(a.value&2)?this.Ry=a:a===Vj||a===vj||a===uj?this.vf=a:a===Or||a===Pr||a===Qr?this.cq=a:a!==Nr&&a!==wj&&D.k("Unknown Link enum value for a Link property: "+a):F.prototype.qc.call(this,a)};var Nr;J.Normal=Nr=D.s(J,"Normal",1);J.Orthogonal=D.s(J,"Orthogonal",2);J.AvoidsNodes=D.s(J,"AvoidsNodes",6);var Rr;J.AvoidsNodesStraight=Rr=D.s(J,"AvoidsNodesStraight",7);var wj;J.None=wj=D.s(J,"None",0);var Vj;J.Bezier=Vj=D.s(J,"Bezier",9);var vj;
J.JumpGap=vj=D.s(J,"JumpGap",10);var uj;J.JumpOver=uj=D.s(J,"JumpOver",11);var Or;J.End=Or=D.s(J,"End",17);var Pr;J.Scale=Pr=D.s(J,"Scale",18);var Qr;J.Stretch=Qr=D.s(J,"Stretch",19);var yq;J.OrientAlong=yq=D.s(J,"OrientAlong",21);var Zp;J.OrientPlus90=Zp=D.s(J,"OrientPlus90",22);var aq;J.OrientMinus90=aq=D.s(J,"OrientMinus90",23);var Sr;J.OrientOpposite=Sr=D.s(J,"OrientOpposite",24);var Tr;J.OrientUpright=Tr=D.s(J,"OrientUpright",25);var $p;J.OrientPlus90Upright=$p=D.s(J,"OrientPlus90Upright",26);
var bq;J.OrientMinus90Upright=bq=D.s(J,"OrientMinus90Upright",27);var cq;J.OrientUpright45=cq=D.s(J,"OrientUpright45",28);f=J.prototype;f.be=function(){null===this.aa&&(this.aa=new Go)};f.Em=function(){var a=this.Z;if(null!==a){var b=a.findVisibleNode();null!==b&&(a=b);if(Nm(a)||Om(a))return!1}a=this.ba;return null!==a&&(b=a.findVisibleNode(),null!==b&&(a=b),Nm(a)||Om(a))?!1:!0};f.fC=function(){return!1};f.gC=function(){};f.te=function(){return!1};
J.prototype.computeAngle=function(a,b,c){return J.computeAngle(b,c)};J.computeAngle=function(a,b){var c=0;switch(a){default:case wj:c=0;break;case yq:c=b;break;case Zp:c=b+90;break;case aq:c=b-90;break;case Sr:c=b+180;break;case Tr:c=Ne(b);90<c&&270>c&&(c-=180);break;case $p:c=Ne(b+90);90<c&&270>c&&(c-=180);break;case bq:c=Ne(b-90);90<c&&270>c&&(c-=180);break;case cq:c=Ne(b);if(45<c&&135>c||225<c&&315>c)return 0;90<c&&270>c&&(c-=180)}return Ne(c)};
D.defineProperty(J,{Z:"fromNode"},function(){return this.Cg},function(a){var b=this.Cg;if(b!==a){v&&null!==a&&D.l(a,H,J,"fromNode");var c=this.ic;null!==b&&(this.Tg!==b&&Gr(b,this,c),Ur(this),this.L(dn));this.Cg=a;null!==a&&this.Pd(a.isVisible());this.dj=null;this.bc();var d=this.g;if(null!==d){var e=this.data,g=d.ea;if(null!==e)if(g instanceof X){var h=null!==a?a.data:null;g.bC(e,g.yb(h))}else g instanceof Ag&&(h=null!==a?a.data:null,d.ge?g.Li(e,g.yb(h)):(e=d.Ik,d.Ik=this,null!==b&&g.Li(b.data,void 0),
g.Li(h,g.yb(null!==this.Tg?this.Tg.data:null)),d.Ik=e))}g=this.ic;h=this.MF;null!==h&&(e=!0,null!==d&&(e=d.ab,d.ab=!0),h(this,c,g),null!==d&&(d.ab=e));null!==a&&(this.Tg!==a&&Fr(a,this,g),Vr(this),this.L(Vm));this.i("fromNode",b,a);An(this)}});
D.defineProperty(J,{ig:"fromPortId"},function(){return this.ji},function(a){var b=this.ji;if(b!==a){v&&D.h(a,"string",J,"fromPortId");var c=this.Z,d=this.ic;null!==d&&Er(c,d);Ur(this);this.ji=a;var e=this.ic;null!==e&&Er(c,e);c=this.g;if(null!==c){var g=this.data,h=c.ea;null!==g&&h instanceof X&&h.cC(g,a)}d!==e&&(this.dj=null,this.bc(),g=this.MF,null!==g&&(h=!0,null!==c&&(h=c.ab,c.ab=!0),g(this,d,e),null!==c&&(c.ab=h)));Vr(this);this.i("fromPortId",b,a)}});
D.w(J,{ic:"fromPort"},function(){var a=this.Cg;return null===a?null:a.fB(this.ji)});D.defineProperty(J,{MF:"fromPortChanged"},function(){return this.gs},function(a){var b=this.gs;b!==a&&(null!==a&&D.h(a,"function",J,"fromPortChanged"),this.gs=a,this.i("fromPortChanged",b,a))});
D.defineProperty(J,{ba:"toNode"},function(){return this.Tg},function(a){var b=this.Tg;if(b!==a){v&&null!==a&&D.l(a,H,J,"toNode");var c=this.wc;null!==b&&(this.Cg!==b&&Gr(b,this,c),Ur(this),this.L(dn));this.Tg=a;null!==a&&this.Pd(a.isVisible());this.dj=null;this.bc();var d=this.g;if(null!==d){var e=this.data,g=d.ea;if(null!==e)if(g instanceof X){var h=null!==a?a.data:null;g.hC(e,g.yb(h))}else g instanceof Ag&&(h=null!==a?a.data:null,d.ge?(e=d.Ik,d.Ik=this,null!==b&&g.Li(b.data,void 0),g.Li(h,g.yb(null!==
this.Cg?this.Cg.data:null)),d.Ik=e):g.Li(e,g.yb(h)))}g=this.wc;h=this.pH;null!==h&&(e=!0,null!==d&&(e=d.ab,d.ab=!0),h(this,c,g),null!==d&&(d.ab=e));null!==a&&(this.Cg!==a&&Fr(a,this,g),Vr(this),this.L(Vm));this.i("toNode",b,a);An(this)}});
D.defineProperty(J,{jh:"toPortId"},function(){return this.Di},function(a){var b=this.Di;if(b!==a){v&&D.h(a,"string",J,"toPortId");var c=this.ba,d=this.wc;null!==d&&Er(c,d);Ur(this);this.Di=a;var e=this.wc;null!==e&&Er(c,e);c=this.g;if(null!==c){var g=this.data,h=c.ea;null!==g&&h instanceof X&&h.iC(g,a)}d!==e&&(this.dj=null,this.bc(),g=this.pH,null!==g&&(h=!0,null!==c&&(h=c.ab,c.ab=!0),g(this,d,e),null!==c&&(c.ab=h)));Vr(this);this.i("toPortId",b,a)}});
D.w(J,{wc:"toPort"},function(){var a=this.Tg;return null===a?null:a.fB(this.Di)});D.defineProperty(J,{pH:"toPortChanged"},function(){return this.$t},function(a){var b=this.$t;b!==a&&(null!==a&&D.h(a,"function",J,"toPortChanged"),this.$t=a,this.i("toPortChanged",b,a))});D.defineProperty(J,{Ib:"fromSpot"},function(){return null!==this.aa?this.aa.rk:Vc},function(a){this.be();var b=this.aa.rk;b.P(a)||(v&&D.l(a,R,J,"fromSpot"),a=a.V(),this.aa.rk=a,this.i("fromSpot",b,a),this.bc())});
D.defineProperty(J,{xm:"fromEndSegmentLength"},function(){return null!==this.aa?this.aa.pk:NaN},function(a){this.be();var b=this.aa.pk;b!==a&&(v&&D.h(a,"number",J,"fromEndSegmentLength"),0>a&&D.va(a,">= 0",J,"fromEndSegmentLength"),this.aa.pk=a,this.i("fromEndSegmentLength",b,a),this.bc())});
D.defineProperty(J,{Fu:"fromEndSegmentDirection"},function(){return null!==this.aa?this.aa.ok:zr},function(a){this.be();var b=this.aa.ok;b!==a&&(D.Vn("Link.fromEndSegmentDirection","2.0"),v&&D.Da(a,H,J,"fromEndSegmentDirection"),this.aa.ok=a,this.i("fromEndSegmentDirection",b,a),this.bc())});
D.defineProperty(J,{Gu:"fromShortLength"},function(){return null!==this.aa?this.aa.qk:NaN},function(a){this.be();var b=this.aa.qk;b!==a&&(v&&D.h(a,"number",J,"fromShortLength"),this.aa.qk=a,this.i("fromShortLength",b,a),this.bc(),this.se())});D.defineProperty(J,{Jb:"toSpot"},function(){return null!==this.aa?this.aa.Qk:Vc},function(a){this.be();var b=this.aa.Qk;b.P(a)||(v&&D.l(a,R,J,"toSpot"),a=a.V(),this.aa.Qk=a,this.i("toSpot",b,a),this.bc())});
D.defineProperty(J,{Pm:"toEndSegmentLength"},function(){return null!==this.aa?this.aa.Ok:NaN},function(a){this.be();var b=this.aa.Ok;b!==a&&(v&&D.h(a,"number",J,"toEndSegmentLength"),0>a&&D.va(a,">= 0",J,"toEndSegmentLength"),this.aa.Ok=a,this.i("toEndSegmentLength",b,a),this.bc())});
D.defineProperty(J,{xv:"toEndSegmentDirection"},function(){return null!==this.aa?this.aa.Nk:zr},function(a){this.be();var b=this.aa.Nk;b!==a&&(D.Vn("Link.toEndSegmentDirection","2.0"),v&&D.Da(a,H,J,"toEndSegmentDirection"),this.aa.Nk=a,this.i("toEndSegmentDirection",b,a),this.bc())});
D.defineProperty(J,{yv:"toShortLength"},function(){return null!==this.aa?this.aa.Pk:NaN},function(a){this.be();var b=this.aa.Pk;b!==a&&(v&&D.h(a,"number",J,"toShortLength"),this.aa.Pk=a,this.i("toShortLength",b,a),this.bc(),this.se())});
function An(a){var b=a.Z,c=a.ba,d=null,b=d=null!==b?null!==c?b.MI(c):b.Ja:null!==c?c.Ja:null,c=a.El;if(c!==b){null!==c&&tr(c,a);a.El=b;null!==b&&ur(b,a);var e=a.kF;if(null!==e){var g=!0,h=a.g;null!==h&&(g=h.ab,h.ab=!0);e(a,c,b);null!==h&&(h.ab=g)}!a.Uf||a.AE!==c&&a.BE!==c||a.bc()}if(a.pJ)for(a=a.Bf;a.next();)a.value.Ja=d}J.prototype.hl=function(){var a=this.Ja;null!==a&&this.Z!==a&&this.ba!==a&&a.Lx&&F.prototype.hl.call(this)};
J.prototype.getOtherNode=J.prototype.kB=function(a){v&&D.l(a,H,J,"getOtherNode:node");var b=this.Z;return a===b?this.ba:b};J.prototype.getOtherPort=function(a){v&&D.l(a,O,J,"getOtherPort:port");var b=this.ic;return a===b?this.wc:b};D.w(J,{pJ:"isLabeledLink"},function(){return null===this.If?!1:0<this.If.count});D.w(J,{Bf:"labelNodes"},function(){return null===this.If?Ja:this.If.j});function Hr(a,b){null===a.If&&(a.If=new L(H));a.If.add(b);a.K()}
J.prototype.Ku=function(a){F.prototype.Ku.call(this,a);Wr(this)&&xj(this,this.Y);if(!a){a=this.Cg;var b=null;null!==a&&(b=this.ic,Fr(a,this,b));var c=this.Tg,d=null;null!==c&&(d=this.wc,c===a&&d===b||Fr(c,this,d));Vr(this)}};J.prototype.Lu=function(a){F.prototype.Lu.call(this,a);Wr(this)&&xj(this,this.Y);if(!a){a=this.Cg;var b=null;null!==a&&(b=this.ic,Gr(a,this,b));var c=this.Tg,d=null;null!==c&&(d=this.wc,c===a&&d===b||Gr(c,this,d));Ur(this)}};
J.prototype.Un=function(){this.Uf=!0;if(null!==this.If){var a=this.g;if(null!==a)for(var b=this.If.copy().j;b.next();)a.remove(b.value)}b=this.data;null!==b&&(a=this.g,null!==a&&(a=a.ea,a instanceof X?a.Oy(b):a instanceof Ag&&a.Li(b,void 0)))};
J.prototype.updateRelationshipsFromData=function(){var a=this.data;if(null!==a){var b=this.g;if(null!==b){var c=b.ea;if(c instanceof X){var d=c.zm(a);this.Z=d=b.Ve(d);d=c.Am(a);this.ba=d=b.Ve(d);a=c.dl(a);if(0<a.length||0<this.Bf.count){if(1===a.length&&1===this.Bf.count){var d=a[0],e=this.Bf.first();if(c.yb(e.data)===d)return}var d=(new L).Yc(a),g=new L;this.Bf.each(function(a){null!==a.data&&(a=c.yb(a.data),void 0!==a&&g.add(a))});a=g.copy();a.Ny(d);d=d.copy();d.Ny(g);if(0<a.count||0<d.count){var h=
this;a.each(function(a){a=b.Ve(a);null!==a&&a.Zb===h&&(a.Zb=null)});d.each(function(a){a=b.Ve(a);null!==a&&a.Zb!==h&&(a.Zb=h)})}}}}}};J.prototype.move=function(a){var b=this.position,c=b.x;isNaN(c)&&(c=0);b=b.y;isNaN(b)&&(b=0);c=a.x-c;b=a.y-b;F.prototype.move.call(this,a);this.Wj(c,b);for(a=this.Bf;a.next();){var d=a.value,e=d.position;d.moveTo(e.x+c,e.y+b)}};
D.defineProperty(J,{cK:"relinkableFrom"},function(){return 0!==(this.gc&1)},function(a){var b=0!==(this.gc&1);b!==a&&(v&&D.h(a,"boolean",J,"relinkableFrom"),this.gc^=1,this.i("relinkableFrom",b,a),this.de())});D.defineProperty(J,{dK:"relinkableTo"},function(){return 0!==(this.gc&2)},function(a){var b=0!==(this.gc&2);b!==a&&(v&&D.h(a,"boolean",J,"relinkableTo"),this.gc^=2,this.i("relinkableTo",b,a),this.de())});
J.prototype.canRelinkFrom=function(){if(!this.cK)return!1;var a=this.layer;if(null===a)return!0;if(!a.Kn)return!1;a=a.g;return null===a||a.Kn?!0:!1};J.prototype.canRelinkTo=function(){if(!this.dK)return!1;var a=this.layer;if(null===a)return!0;if(!a.Kn)return!1;a=a.g;return null===a||a.Kn?!0:!1};D.defineProperty(J,{nv:"resegmentable"},function(){return 0!==(this.gc&4)},function(a){var b=0!==(this.gc&4);b!==a&&(v&&D.h(a,"boolean",J,"resegmentable"),this.gc^=4,this.i("resegmentable",b,a),this.de())});
D.defineProperty(J,{kc:"isTreeLink"},function(){return 0!==(this.gc&8)},function(a){var b=0!==(this.gc&8);b!==a&&(v&&D.h(a,"boolean",J,"isTreeLink"),this.gc^=8,this.i("isTreeLink",b,a),null!==this.Z&&Ln(this.Z),null!==this.ba&&Ln(this.ba))});D.w(J,{path:"path"},function(){var a=this.Ld();return a instanceof A?a:null});
D.w(J,{yo:"routeBounds"},function(){this.Fo();var a=new C;var b=Infinity,c=Infinity,d=this.ta;if(0===d)a.n(NaN,NaN,0,0);else{if(1===d)d=this.m(0),b=Math.min(d.x,b),c=Math.min(d.y,c),a.n(d.x,d.y,0,0);else if(2===d){var e=this.m(0),g=this.m(1),b=Math.min(e.x,g.x),c=Math.min(e.y,g.y);a.n(e.x,e.y,0,0);a.Qi(g)}else if(this.computeCurve()===Vj&&3<=d&&!this.jc)if(e=this.m(0),b=e.x,c=e.y,a.n(b,c,0,0),3===d)d=this.m(1),b=Math.min(d.x,b),c=Math.min(d.y,c),g=this.m(2),b=Math.min(g.x,b),c=Math.min(g.y,c),re(e.x,
e.y,d.x,d.y,d.x,d.y,g.x,g.y,.5,a);else for(var h=3;h<d;h+=3){var k=this.m(h-2);h+3>=d&&(h=d-1);var l=this.m(h-1),g=this.m(h);re(e.x,e.y,k.x,k.y,l.x,l.y,g.x,g.y,.5,a);b=Math.min(g.x,b);c=Math.min(g.y,c);e=g}else for(e=this.m(0),g=this.m(1),b=Math.min(e.x,g.x),c=Math.min(e.y,g.y),a.n(e.x,e.y,0,0),a.Qi(g),h=2;h<d;h++)e=this.m(h),b=Math.min(e.x,b),c=Math.min(e.y,c),a.Qi(e);this.zA.n(b-a.x,c-a.y)}return this.Yw=a});D.w(J,{xG:"midPoint"},function(){this.Fo();return this.computeMidPoint(new N)});
J.prototype.computeMidPoint=function(a){var b=this.ta;if(0===b)return a.assign(be),a;if(1===b)return a.assign(this.m(0)),a;if(2===b){var c=this.m(0),d=this.m(1);a.n((c.x+d.x)/2,(c.y+d.y)/2);return a}if(this.computeCurve()===Vj&&3<=b&&!this.jc){if(3===b)return this.m(1);var c=(b-1)/3|0,e=3*(c/2|0);if(1===c%2){var c=this.m(e),d=this.m(e+1),g=this.m(e+2),e=this.m(e+3),b=d.x,h=d.y,d=g.x,k=g.y,g=(b+d)/2,l=(h+k)/2,h=((c.y+h)/2+l)/2,k=(l+(k+e.y)/2)/2;a.x=(((c.x+b)/2+g)/2+(g+(d+e.x)/2)/2)/2;a.y=(h+k)/2}else a.assign(this.m(e));
return a}e=0;g=D.hb();for(h=0;h<b-1;h++)c=0,c=this.m(h),d=this.m(h+1),Eb(c.x,d.x)?(c=d.y-c.y,0>c&&(c=-c)):Eb(c.y,d.y)?(c=d.x-c.x,0>c&&(c=-c)):c=Math.sqrt(c.Lf(d)),g.push(c),e+=c;for(d=h=c=0;c<e/2&&h<b;){d=g[h];if(c+d>e/2)break;c+=d;h++}D.ua(g);b=this.m(h);g=this.m(h+1);b.x===g.x?b.y>g.y?a.n(b.x,b.y-(e/2-c)):a.n(b.x,b.y+(e/2-c)):b.y===g.y?b.x>g.x?a.n(b.x-(e/2-c),b.y):a.n(b.x+(e/2-c),b.y):(c=(e/2-c)/d,a.n(b.x+c*(g.x-b.x),b.y+c*(g.y-b.y)));return a};D.w(J,{wG:"midAngle"},function(){this.Fo();return this.computeMidAngle()});
J.prototype.computeMidAngle=function(){var a=this.ta;if(2>a)return NaN;if(this.computeCurve()===Vj&&4<=a&&!this.jc){var b=(a-1)/3|0,c=3*(b/2|0);if(1===b%2){var c=Math.floor(c),b=this.m(c),d=this.m(c+1),a=this.m(c+2),c=this.m(c+3),e=d.x,d=d.y,g=a.x,a=a.y,h=(e+g)/2,k=(d+a)/2;return wb(((b.x+e)/2+h)/2,((b.y+d)/2+k)/2,(h+(g+c.x)/2)/2,(k+(a+c.y)/2)/2)}if(0<c&&c+1<a)return b=this.m(c-1),d=this.m(c+1),b.Yb(d)}c=a/2|0;if(0===a%2)return b=this.m(c-1),d=this.m(c),4<=a&&b.Zc(d)?(b=this.m(c-2),a=this.m(c+1),
c=b.Lf(d),e=d.Lf(a),c>e+10?b.Yb(d):e>c+10?d.Yb(a):b.Yb(a)):null===this.Za||this.jc?b.Yb(d):this.Za.NF(.5);if(null!==this.Za&&!this.jc)return this.Za.NF(.5);b=this.m(c-1);d=this.m(c);a=this.m(c+1);c=b.Lf(d);e=d.Lf(a);return c>e+10?b.Yb(d):e>c+10?d.Yb(a):b.Yb(a)};
D.defineProperty(J,{points:"points"},function(){return this.jd},function(a){var b=this.jd;if(b!==a){var c=null;if(Array.isArray(a)){var d=0===a.length%2;if(d)for(var e=0;e<a.length;e++)if("number"!==typeof a[e]||isNaN(a[e])){d=!1;break}if(d)for(c=new K(N),d=0;d<a.length/2;d++)e=(new N(a[2*d],a[2*d+1])).freeze(),c.add(e);else{e=!0;for(d=0;d<a.length;d++){var g=a[d];if(!D.Qa(g)||"number"!==typeof g.x||isNaN(g.x)||"number"!==typeof g.y||isNaN(g.y)){e=!1;break}}if(e)for(c=new K(N),d=0;d<a.length;d++)e=
a[d],c.add((new N(e.x,e.y)).freeze());else D.k("Link.points array must contain only an even number of numbers or objects with x and y properties, not: "+a)}}else if(a instanceof K)for(c=a.copy(),a=c.j;a.next();)a.value.freeze();else D.k("Link.points value is not an instance of List or Array: "+a);c.freeze();this.jd=c;this.se();this.K();Xr(this);a=this.g;null!==a&&(a.ho||a.na.ub||a.yy.add(this),a.Ra.Ac&&(this.Mp=c));this.i("points",b,c)}});D.w(J,{ta:"pointsCount"},function(){return this.jd.count});
J.prototype.getPoint=J.prototype.m=function(a){return this.jd.o[a]};J.prototype.setPoint=J.prototype.gh=function(a,b){v&&(D.l(b,N,J,"setPoint"),b.F()||D.k("Link.setPoint called with a Point that does not have real numbers: "+b.toString()));null===this.ff&&D.k("Call Link.startRoute before modifying the points of the route.");this.jd.ug(a,b)};
J.prototype.setPointAt=J.prototype.ia=function(a,b,c){v&&(D.p(b,J,"setPointAt:x"),D.p(c,J,"setPointAt:y"));null===this.ff&&D.k("Call Link.startRoute before modifying the points of the route.");this.jd.ug(a,new N(b,c))};J.prototype.insertPoint=function(a,b){v&&(D.l(b,N,J,"insertPoint"),b.F()||D.k("Link.insertPoint called with a Point that does not have real numbers: "+b.toString()));null===this.ff&&D.k("Call Link.startRoute before modifying the points of the route.");this.jd.ce(a,b)};
J.prototype.insertPointAt=J.prototype.B=function(a,b,c){v&&(D.p(b,J,"insertPointAt:x"),D.p(c,J,"insertPointAt:y"));null===this.ff&&D.k("Call Link.startRoute before modifying the points of the route.");this.jd.ce(a,new N(b,c))};J.prototype.addPoint=J.prototype.Fi=function(a){v&&(D.l(a,N,J,"addPoint"),a.F()||D.k("Link.addPoint called with a Point that does not have real numbers: "+a.toString()));null===this.ff&&D.k("Call Link.startRoute before modifying the points of the route.");this.jd.add(a)};
J.prototype.addPointAt=J.prototype.Ej=function(a,b){v&&(D.p(a,J,"insertPointAt:x"),D.p(b,J,"insertPointAt:y"));null===this.ff&&D.k("Call Link.startRoute before modifying the points of the route.");this.jd.add(new N(a,b))};J.prototype.removePoint=J.prototype.KG=function(a){null===this.ff&&D.k("Call Link.startRoute before modifying the points of the route.");this.jd.qd(a)};
J.prototype.clearPoints=J.prototype.iq=function(){null===this.ff&&D.k("Call Link.startRoute before modifying the points of the route.");this.jd.clear()};J.prototype.movePoints=J.prototype.Wj=function(a,b){if(0!==a||0!==b){for(var c=this.Uf,d=new K(N),e=this.jd.j;e.next();){var g=e.value;d.add((new N(g.x+a,g.y+b)).freeze())}d.freeze();e=this.jd;this.jd=d;this.K();c&&Xr(this);c=this.g;null!==c&&c.Ra.Ac&&(this.Mp=d);this.i("points",e,d)}};
J.prototype.startRoute=J.prototype.Lm=function(){null===this.ff&&(this.ff=this.jd,this.jd=this.jd.copy())};
J.prototype.commitRoute=J.prototype.Hj=function(){if(null!==this.ff){for(var a=this.ff,b=this.jd,c=Infinity,d=Infinity,e=a.o,g=e.length,h=0;h<g;h++)var k=e[h],c=Math.min(k.x,c),d=Math.min(k.y,d);for(var l=Infinity,m=Infinity,n=b.o,p=n.length,h=0;h<p;h++)k=n[h],l=Math.min(k.x,l),m=Math.min(k.y,m),k.freeze();b.freeze();if(p===g)for(h=0;h<p;h++){if(g=e[h],k=n[h],g.x-c!==k.x-l||g.y-d!==k.y-m){this.K();this.se();break}}else this.K(),this.se();this.ff=null;c=this.g;null!==c&&c.Ra.Ac&&(this.Mp=b);Xr(this);
this.i("points",a,b)}};J.prototype.rollbackRoute=J.prototype.hK=function(){null!==this.ff&&(this.jd=this.ff,this.ff=null)};function Xr(a){0===a.jd.count?a.Uf=!1:(a.Uf=!0,a.nq=a.m(0),a.oq=a.m(a.ta-1),Yr(a,!1))}J.prototype.invalidateRoute=J.prototype.bc=function(){if(!this.Ni){var a=this.g;a&&(a.yy.contains(this)||a.na.ub||a.Ra.vJ&&!a.Ra.nf)||(a=this.path,null!==a&&(this.Uf=!1,this.K(),a.K()))}};
D.defineProperty(J,{Uf:null},function(){return 0!==(this.gc&16)},function(a){0!==(this.gc&16)!==a&&(this.gc^=16)});D.defineProperty(J,{Ni:"suspendsRouting"},function(){return 0!==(this.gc&32)},function(a){0!==(this.gc&32)!==a&&(this.gc^=32)});D.defineProperty(J,{RA:null},function(){return 0!==(this.gc&64)},function(a){0!==(this.gc&64)!==a&&(this.gc^=64)});D.defineProperty(J,{nq:"defaultFromPoint"},function(){return this.fD},function(a){this.fD=a.copy()});
D.defineProperty(J,{oq:"defaultToPoint"},function(){return this.lD},function(a){this.lD=a.copy()});J.prototype.updateRoute=J.prototype.Fo=function(){if(!this.Uf&&!this.RA){var a=!0;try{this.RA=!0,this.Lm(),a=this.computePoints()}finally{this.RA=!1,a?this.Hj():this.hK()}}};
J.prototype.computePoints=function(){var a=this.g;if(null===a)return!1;var b=this.Z,c=null;null===b?(a.am||(a.zt=new A,a.zt.Ea=Wd,a.zt.pb=0,a.am=new H,a.am.add(a.zt),a.am.Ue()),this.nq&&(a.am.position=a.am.location=this.nq,a.am.Ue(),b=a.am,c=a.zt)):c=this.ic;if(null!==c&&!b.isVisible()){var d=b.findVisibleNode();null!==d&&d!==b?(b=d,c=d.port):b=d}this.AE=b;if(null===b||!b.location.F())return!1;for(;!(null===c||c.Y.F()&&c.Uj());)c=c.Q;if(null===c)return!1;var e=this.ba,g=null;null===e?(a.bm||(a.At=
new A,a.At.Ea=Wd,a.At.pb=0,a.bm=new H,a.bm.add(a.At),a.bm.Ue()),this.oq&&(a.bm.position=a.bm.location=this.oq,a.bm.Ue(),e=a.bm,g=a.At)):g=this.wc;null===g||e.isVisible()||(a=e.findVisibleNode(),null!==a&&a!==e?(e=a,g=a.port):e=a);this.BE=e;if(null===e||!e.location.F())return!1;for(;!(null===g||g.Y.F()&&g.Uj());)g=g.Q;if(null===g)return!1;var h=this.ta,d=this.computeSpot(!0,c),a=this.computeSpot(!1,g),k=d===dc,l=a===dc,m=c===g&&null!==c,n=this.jc,p=this.vf===Vj;this.dj=m&&!n?p=!0:!1;var q=this.cq===
wj||m;if(!n&&!m&&k&&l){if(k=!1,!q&&3<=h&&(q=this.getLinkPoint(b,c,d,!0,!1,e,g),l=this.getLinkPoint(e,g,a,!1,!1,b,c),k=this.adjustPoints(0,q,h-1,l))&&(q=this.getLinkPoint(b,c,d,!0,!1,e,g),l=this.getLinkPoint(e,g,a,!1,!1,b,c),this.adjustPoints(0,q,h-1,l)),!k)if(this.iq(),p){var h=this.getLinkPoint(b,c,d,!0,!1,e,g),q=this.getLinkPoint(e,g,a,!1,!1,b,c),k=q.x-h.x,l=q.y-h.y,m=this.computeCurviness(),p=n=0,r=h.x+k/3,s=h.y+l/3,t=r,u=s;bb(l,0)?u=0<k?u-m:u+m:(n=-k/l,p=Math.sqrt(m*m/(n*n+1)),0>m&&(p=-p),t=(0>
l?-1:1)*p+r,u=n*(t-r)+s);var r=h.x+2*k/3,s=h.y+2*l/3,z=r,w=s;bb(l,0)?w=0<k?w-m:w+m:(z=(0>l?-1:1)*p+r,w=n*(z-r)+s);this.iq();this.Fi(h);this.Ej(t,u);this.Ej(z,w);this.Fi(q);this.gh(0,this.getLinkPoint(b,c,d,!0,!1,e,g));this.gh(3,this.getLinkPoint(e,g,a,!1,!1,b,c))}else d=this.getLinkPoint(b,c,d,!0,!1,e,g),a=this.getLinkPoint(e,g,a,!1,!1,b,c),this.hasCurviness()?(q=a.x-d.x,e=a.y-d.y,g=this.computeCurviness(),b=d.x+q/2,c=d.y+e/2,h=b,k=c,bb(e,0)?k=0<q?k-g:k+g:(q=-q/e,h=Math.sqrt(g*g/(q*q+1)),0>g&&(h=
-h),h=(0>e?-1:1)*h+b,k=q*(h-b)+c),this.Fi(d),this.Ej(h,k)):this.Fi(d),this.Fi(a)}else{p=this.Pj;q&&(n&&p||m)&&this.iq();var y=m?this.computeCurviness():0,p=this.getLinkPoint(b,c,d,!0,n,e,g),r=t=s=0;if(n||!k||m)if(u=this.computeEndSegmentLength(b,c,d,!0),r=this.getLinkDirection(b,c,p,d,!0,n,e,g),m&&(k||d.P(a)||!n&&1===d.x+a.x&&1===d.y+a.y)&&(r-=n?90:30,0>y&&(r-=180)),0>r?r+=360:360<=r&&(r-=360),m&&(u+=Math.abs(y)*(n?1:2)),0===r?s=u:90===r?t=u:180===r?s=-u:270===r?t=-u:(s=u*Math.cos(r*Math.PI/180),
t=u*Math.sin(r*Math.PI/180)),d.fe()&&m){var B=c.gb(mc,D.O()),P=D.Db(B.x+1E3*s,B.y+1E3*t);this.getLinkPointFromPoint(b,c,B,P,!0,p);D.A(B);D.A(P)}var u=this.getLinkPoint(e,g,a,!1,n,b,c),G=w=z=0;if(n||!l||m)B=this.computeEndSegmentLength(e,g,a,!1),G=this.getLinkDirection(e,g,u,a,!1,n,b,c),m&&(l||d.P(a)||!n&&1===d.x+a.x&&1===d.y+a.y)&&(G+=n?0:30,0>y&&(G+=180)),0>G?G+=360:360<=G&&(G-=360),m&&(B+=Math.abs(y)*(n?1:2)),0===G?z=B:90===G?w=B:180===G?z=-B:270===G?w=-B:(z=B*Math.cos(G*Math.PI/180),w=B*Math.sin(G*
Math.PI/180)),a.fe()&&m&&(B=g.gb(mc,D.O()),P=D.Db(B.x+1E3*z,B.y+1E3*w),this.getLinkPointFromPoint(e,g,B,P,!1,u),D.A(B),D.A(P));a=p;if(n||!k||m)a=new N(p.x+s,p.y+t);d=u;if(n||!l||m)d=new N(u.x+z,u.y+w);!q&&!n&&k&&3<h&&this.adjustPoints(0,p,h-2,d)?this.gh(h-1,u):!q&&!n&&l&&3<h&&this.adjustPoints(1,a,h-1,u)?this.gh(0,p):!q&&(n?6<=h:4<h)&&this.adjustPoints(1,a,h-2,d)?(this.gh(0,p),this.gh(h-1,u)):(this.iq(),this.Fi(p),(n||!k||m)&&this.Fi(a),n&&this.addOrthoPoints(a,r,d,G,b,e),(n||!l||m)&&this.Fi(d),this.Fi(u))}return!0};
function Zr(a,b){Math.abs(b.x-a.x)>Math.abs(b.y-a.y)?(b.x=b.x>=a.x?a.x+9E9:a.x-9E9,b.y=a.y):(b.y=b.y>=a.y?a.y+9E9:a.y-9E9,b.x=a.x);return b}
J.prototype.getLinkPointFromPoint=function(a,b,c,d,e,g){void 0===g&&(g=new N);if(null===a||null===b)return g.assign(c),g;a.isVisible()||(e=a.findVisibleNode(),null!==e&&e!==a&&(b=e.port));var h=e=0,k=0,l=0;a=null;e=b.Q;null===e||e.kh()||(e=e.Q);if(null===e)e=d.x,h=d.y,k=c.x,l=c.y;else{a=e.Jh;e=1/(a.m11*a.m22-a.m12*a.m21);var k=a.m22*e,l=-a.m12*e,m=-a.m21*e,n=a.m11*e,p=e*(a.m21*a.dy-a.m22*a.dx),q=e*(a.m12*a.dx-a.m11*a.dy);e=d.x*k+d.y*m+p;h=d.x*l+d.y*n+q;k=c.x*k+c.y*m+p;l=c.x*l+c.y*n+q}b.$n(e,h,k,l,
g);null!==a&&g.transform(a);return g};function $r(a,b){var c=b.pt;null===c&&(c=new as,c.port=b,c.ad=b.$,b.pt=c);return bs(c,a)}
J.prototype.getLinkPoint=function(a,b,c,d,e,g,h,k){void 0===k&&(k=new N);if(c.$c())return b.gb(c,k),k;if(c.Rj()){var l=$r(this,b);if(null!==l){k.assign(l.Iq);if(e&&this.Ry===Rr){var m=$r(this,h);if(null!==m&&l.Sn<m.Sn){var l=D.O(),m=D.O(),n=new C(b.gb(ic,l),b.gb(vc,m)),p=this.computeSpot(!d,h);a=this.getLinkPoint(g,h,p,!d,e,a,b,m);(c.Oj(xc)||c.Oj(Cc))&&a.y>=n.y&&a.y<=n.y+n.height?k.y=a.y:(c.Oj(wc)||c.Oj(Dc))&&a.x>=n.x&&a.x<=n.x+n.width&&(k.x=a.x);D.A(l);D.A(m)}}return k}}c=b.gb(mc,D.O());l=g=null;
this.ta>(e?6:2)?(l=d?this.m(1):this.m(this.ta-2),e&&(l=Zr(c,l.copy()))):(g=D.O(),l=h.gb(mc,g),e&&(l=Zr(c,l)),D.A(g));this.getLinkPointFromPoint(a,b,c,l,d,k);D.A(c);return k};
J.prototype.getLinkDirection=function(a,b,c,d,e,g,h,k){a:if(d.$c())c=d.x>d.y?d.x>1-d.y?0:d.x<1-d.y?270:315:d.x<d.y?d.x>1-d.y?90:d.x<1-d.y?180:135:.5>d.x?225:.5<d.x?45:0;else{if(d.Rj()){var l=$r(this,b);if(null!==l)switch(l.Me){case D.Ad:c=270;break a;case D.dd:c=180;break a;default:case D.sd:c=0;break a;case D.rd:c=90;break a}}var l=b.gb(mc,D.O()),m=null,n=null;this.ta>(g?6:2)?(n=e?this.m(1):this.m(this.ta-2),n=g?Zr(l,n.copy()):c):(m=D.O(),n=k.gb(mc,m),D.A(m));c=0;c=Math.abs(n.x-l.x)>Math.abs(n.y-
l.y)?n.x>=l.x?0:180:n.y>=l.y?90:270;D.A(l)}d.fe()&&h.Ji(a)&&(c+=180,360<=c&&(c-=360));a=zr;a=e?this.Fu:this.xv;a===zr&&(a=e?b.Fu:b.xv);switch(a){case Ar:b=b.ym();c+=b;360<=c&&(c-=360);break;case zr:case Ho:if(d.sJ())break;b=b.ym();if(0===b)break;45<=b&&135>b?c+=90:135<=b&&225>b?c+=180:225<=b&&315>b&&(c+=270);360<=c&&(c-=360)}return c};
J.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!==b&&c.Rj()&&(a=$r(this,b),null!==a))return a.Xx;a=NaN;a=d?this.xm:this.Pm;null!==b&&isNaN(a)&&(a=d?b.xm:b.Pm);isNaN(a)&&(a=10);return a};J.prototype.computeSpot=function(a,b){var c;if(a)if(c=b?b:this.ic,null===c)c=mc;else{var d=this.Ib;d.md()&&null!==c&&(d=c.Ib);c=d===Vc?dc:d}else c=b?b:this.wc,null===c?c=mc:(d=this.Jb,d.md()&&null!==c&&(d=c.Jb),c=d===Vc?dc:d);return c};
J.prototype.computeOtherPoint=function(a,b){var c=b.gb(mc),d;d=b.pt;d=null!==d?bs(d,this):null;null!==d&&(c=d.Iq);return c};J.prototype.computeShortLength=function(a){if(a){if(a=this.Gu,isNaN(a)){var b=this.ic;null!==b&&(a=b.Gu)}}else a=this.yv,isNaN(a)&&(b=this.wc,null!==b&&(a=b.yv));return isNaN(a)?0:a};
J.prototype.$k=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.Pn(a,h))return iq(this,b,c,e),void 0===g&&D.lf(h),!0;if(this.kg(a,h)){var k=!1;if(!this.fo)for(var l=this.ya.o,m=l.length;m--;){var n=l[m];if(n.visible||n===this.Cf){var p=n.Y,q=this.Fa;if(!(p.x>q.width||p.y>q.height||0>p.x+p.width||0>p.y+p.height)){p=D.hh();p.set(h);if(n instanceof x)k=n.$k(a,b,c,d,e,p);else if(this.path===
n){if(n instanceof A){var k=n,r=a,s=d,q=p;if(!1===k.tg)k=!1;else if(q.multiply(k.transform),s)b:{var t=r,u=q;if(k.Pn(t,u))k=!0;else{if(void 0===u&&(u=k.transform,t.Wk(k.Y))){k=!0;break b}var q=t.left,r=t.right,s=t.top,t=t.bottom,z=D.O(),w=D.O(),y=D.O(),B=D.hh();B.set(u);B.LB(k.transform);B.uB();w.x=r;w.y=s;w.transform(B);z.x=q;z.y=s;z.transform(B);u=!1;vq(k,z,w,y)?u=!0:(z.x=r,z.y=t,z.transform(B),vq(k,z,w,y)?u=!0:(w.x=q,w.y=t,w.transform(B),vq(k,z,w,y)?u=!0:(z.x=q,z.y=s,z.transform(B),vq(k,z,w,y)&&
(u=!0))));D.lf(B);D.A(z);D.A(w);D.A(y);k=u}}else k=k.Pn(r,q)}}else k=No(n,a,d,p);k&&(null!==b&&(n=b(n)),n&&(null===c||c(n))&&(e instanceof L&&e.add(n),e instanceof K&&e.add(n)));D.lf(p)}}}void 0===g&&D.lf(h);return k||null!==this.background||null!==this.mm}void 0===g&&D.lf(h);return!1};D.w(J,{jc:"isOrthogonal"},function(){return 2===(this.vn.value&2)});D.w(J,{Pj:"isAvoiding"},function(){return 4===(this.vn.value&4)});
J.prototype.computeCurve=function(){if(null===this.dj){var a=this.ic,b=this.jc;this.dj=null!==a&&a===this.wc&&!b}return this.dj?Vj:this.vf};J.prototype.computeCorner=function(){if(this.vf===Vj)return 0;var a=this.XA;if(isNaN(a)||0>a)a=10;return a};J.prototype.findMidLabel=function(){for(var a=this.path,b=this.ya.o,c=b.length,d=0;d<c;d++){var e=b[d];if(e!==a&&!e.We&&(-Infinity===e.Xe||isNaN(e.Xe)))return e}for(a=this.Bf;a.next();)if(b=a.value,-Infinity===b.Xe||isNaN(b.Xe))return b;return null};
J.prototype.computeSpacing=function(){if(!this.isVisible())return 0;var a;a=Math.max(14,this.computeThickness());var b=this.ic,c=this.wc;if(null!==b&&null!==c){var d=this.findMidLabel();if(null!==d){var e=d.Fa,g=d.margin,h=isNaN(e.width)?30:e.width*d.scale+g.left+g.right,e=isNaN(e.height)?14:e.height*d.scale+g.top+g.bottom,d=d.Yq;d===yq||d===Tr||d===Sr?a=Math.max(a,e):d===aq||d===bq||d===Zp||d===$p?a=Math.max(a,h):(b=b.gb(mc).Yb(c.gb(mc))/180*Math.PI,a=Math.max(a,Math.abs(Math.sin(b)*h)+Math.abs(Math.cos(b)*
e)+1));this.vf===Vj&&(a*=1.333)}}return a};J.prototype.arrangeBundledLinks=function(a,b){if(b)for(var c=0;c<a.length;c++){var d=a[c];d.cq===wj&&d.bc()}};J.prototype.computeCurviness=function(){var a=this.Px;if(isNaN(a)){var a=16,b=this.Si;if(null!==b){for(var c=D.hb(),d=0,e=b.links,g=0;g<e.length;g++){var h=e[g],h=h.computeSpacing();c.push(h);d+=h}d=-d/2;for(g=0;g<e.length;g++){h=e[g];if(h===this){a=d+c[g]/2;break}d+=c[g]}b.Lq===this.Z&&(a=-a);D.ua(c)}}return a};
J.prototype.computeThickness=function(){if(!this.isVisible())return 0;var a=this.path;return null!==a?Math.max(a.pb,1):1};J.prototype.hasCurviness=function(){return!isNaN(this.Px)||null!==this.Si};
J.prototype.adjustPoints=function(a,b,c,d){var e=this.cq;if(this.jc){if(e===Pr)return!1;e===Qr&&(e=Or)}switch(e){case Pr:var g=this.m(a),h=this.m(c);if(!g.Zc(b)||!h.Zc(d)){var e=g.x,g=g.y,k=h.x-e,l=h.y-g,m=Math.sqrt(k*k+l*l);if(!Eb(m,0)){var n=0;Eb(k,0)?n=0>l?-Math.PI/2:Math.PI/2:(n=Math.atan(l/Math.abs(k)),0>k&&(n=Math.PI-n));var h=b.x,p=b.y,l=d.x-h,q=d.y-p,r=Math.sqrt(l*l+q*q),k=0;Eb(l,0)?k=0>q?-Math.PI/2:Math.PI/2:(k=Math.atan(q/Math.abs(l)),0>l&&(k=Math.PI-k));m=r/m;n=k-n;this.gh(a,b);for(a+=
1;a<c;a++)b=this.m(a),k=b.x-e,l=b.y-g,b=Math.sqrt(k*k+l*l),Eb(b,0)||(q=0,Eb(k,0)?q=0>l?-Math.PI/2:Math.PI/2:(q=Math.atan(l/Math.abs(k)),0>k&&(q=Math.PI-q)),k=q+n,b*=m,this.ia(a,h+b*Math.cos(k),p+b*Math.sin(k)));this.gh(c,d)}}return!0;case Qr:g=this.m(a);p=this.m(c);if(!g.Zc(b)||!p.Zc(d)){var e=g.x,g=g.y,h=p.x,p=p.y,m=(h-e)*(h-e)+(p-g)*(p-g),k=b.x,n=b.y,l=d.x,q=d.y,r=0,s=1;0!==l-k?(r=(q-n)/(l-k),s=Math.sqrt(1+1/(r*r))):r=9E9;this.gh(a,b);for(a+=1;a<c;a++){b=this.m(a);var t=b.x,u=b.y,z=.5;0!==m&&(z=
((e-t)*(e-h)+(g-u)*(g-p))/m);var w=e+z*(h-e),y=g+z*(p-g);b=Math.sqrt((t-w)*(t-w)+(u-y)*(u-y));u<r*(t-w)+y&&(b=-b);0<r&&(b=-b);t=k+z*(l-k);z=n+z*(q-n);0!==r?(b=t+b/s,this.ia(a,b,z-(b-t)/r)):this.ia(a,t,z+b)}this.gh(c,d)}return!0;case Or:a:{if(this.jc&&(e=this.m(a),g=this.m(a+1),h=this.m(a+2),k=g.x,n=g.y,p=k,m=n,bb(e.y,g.y)?bb(g.x,h.x)?n=b.y:bb(g.y,h.y)&&(k=b.x):bb(e.x,g.x)&&(bb(g.y,h.y)?k=b.x:bb(g.x,h.x)&&(n=b.y)),this.ia(a+1,k,n),e=this.m(c),g=this.m(c-1),h=this.m(c-2),k=g.x,n=g.y,l=k,q=n,bb(e.y,
g.y)?bb(g.x,h.x)?n=d.y:bb(g.y,h.y)&&(k=d.x):bb(e.x,g.x)&&(bb(g.y,h.y)?k=d.x:bb(g.x,h.x)&&(n=d.y)),this.ia(c-1,k,n),Mi(this))){this.ia(a+1,p,m);this.ia(c-1,l,q);c=!1;break a}this.gh(a,b);this.gh(c,d);c=!0}return c;default:return!1}};
J.prototype.addOrthoPoints=function(a,b,c,d,e,g){b=-45<=b&&45>b?0:45<=b&&135>b?90:135<=b&&225>b?180:270;d=-45<=d&&45>d?0:45<=d&&135>d?90:135<=d&&225>d?180:270;var h=e.Y.copy(),k=g.Y.copy();if(h.F()&&k.F()){h.jg(8,8);k.jg(8,8);h.Qi(a);k.Qi(c);var l,m;if(0===b)if(c.x>a.x||270===d&&c.y<a.y&&k.right>a.x||90===d&&c.y>a.y&&k.right>a.x)l=new N(c.x,a.y),m=new N(c.x,(a.y+c.y)/2),180===d?(l.x=this.computeMidOrthoPosition(a.x,c.x,!1),m.x=l.x,m.y=c.y):270===d&&c.y<a.y||90===d&&c.y>a.y?(l.x=a.x<k.left?this.computeMidOrthoPosition(a.x,
k.left,!1):a.x<k.right&&(270===d&&a.y<k.top||90===d&&a.y>k.bottom)?this.computeMidOrthoPosition(a.x,c.x,!1):k.right,m.x=l.x,m.y=c.y):0===d&&a.x<k.left&&a.y>k.top&&a.y<k.bottom&&(l.x=a.x,l.y=a.y<c.y?Math.min(c.y,k.top):Math.max(c.y,k.bottom),m.y=l.y);else{l=new N(a.x,c.y);m=new N((a.x+c.x)/2,c.y);if(180===d||90===d&&c.y<h.top||270===d&&c.y>h.bottom)180===d&&(k.Pa(a)||h.Pa(c))?l.y=this.computeMidOrthoPosition(a.y,c.y,!0):c.y<a.y&&(180===d||90===d)?l.y=this.computeMidOrthoPosition(h.top,Math.max(c.y,
k.bottom),!0):c.y>a.y&&(180===d||270===d)&&(l.y=this.computeMidOrthoPosition(h.bottom,Math.min(c.y,k.top),!0)),m.x=c.x,m.y=l.y;if(l.y>h.top&&l.y<h.bottom)if(c.x>=h.left&&c.x<=a.x||a.x<=k.right&&a.x>=c.x){if(90===d||270===d)l=new N(Math.max((a.x+c.x)/2,a.x),a.y),m=new N(l.x,c.y)}else l.y=270===d||(0===d||180===d)&&c.y<a.y?Math.min(c.y,0===d?h.top:Math.min(h.top,k.top)):Math.max(c.y,0===d?h.bottom:Math.max(h.bottom,k.bottom)),m.x=c.x,m.y=l.y}else if(180===b)if(c.x<a.x||270===d&&c.y<a.y&&k.left<a.x||
90===d&&c.y>a.y&&k.left<a.x)l=new N(c.x,a.y),m=new N(c.x,(a.y+c.y)/2),0===d?(l.x=this.computeMidOrthoPosition(a.x,c.x,!1),m.x=l.x,m.y=c.y):270===d&&c.y<a.y||90===d&&c.y>a.y?(l.x=a.x>k.right?this.computeMidOrthoPosition(a.x,k.right,!1):a.x>k.left&&(270===d&&a.y<k.top||90===d&&a.y>k.bottom)?this.computeMidOrthoPosition(a.x,c.x,!1):k.left,m.x=l.x,m.y=c.y):180===d&&a.x>k.right&&a.y>k.top&&a.y<k.bottom&&(l.x=a.x,l.y=a.y<c.y?Math.min(c.y,k.top):Math.max(c.y,k.bottom),m.y=l.y);else{l=new N(a.x,c.y);m=new N((a.x+
c.x)/2,c.y);if(0===d||90===d&&c.y<h.top||270===d&&c.y>h.bottom)0===d&&(k.Pa(a)||h.Pa(c))?l.y=this.computeMidOrthoPosition(a.y,c.y,!0):c.y<a.y&&(0===d||90===d)?l.y=this.computeMidOrthoPosition(h.top,Math.max(c.y,k.bottom),!0):c.y>a.y&&(0===d||270===d)&&(l.y=this.computeMidOrthoPosition(h.bottom,Math.min(c.y,k.top),!0)),m.x=c.x,m.y=l.y;if(l.y>h.top&&l.y<h.bottom)if(c.x<=h.right&&c.x>=a.x||a.x>=k.left&&a.x<=c.x){if(90===d||270===d)l=new N(Math.min((a.x+c.x)/2,a.x),a.y),m=new N(l.x,c.y)}else l.y=270===
d||(0===d||180===d)&&c.y<a.y?Math.min(c.y,180===d?h.top:Math.min(h.top,k.top)):Math.max(c.y,180===d?h.bottom:Math.max(h.bottom,k.bottom)),m.x=c.x,m.y=l.y}else if(90===b)if(c.y>a.y||180===d&&c.x<a.x&&k.bottom>a.y||0===d&&c.x>a.x&&k.bottom>a.y)l=new N(a.x,c.y),m=new N((a.x+c.x)/2,c.y),270===d?(l.y=this.computeMidOrthoPosition(a.y,c.y,!0),m.x=c.x,m.y=l.y):180===d&&c.x<a.x||0===d&&c.x>a.x?(l.y=a.y<k.top?this.computeMidOrthoPosition(a.y,k.top,!0):a.y<k.bottom&&(180===d&&a.x<k.left||0===d&&a.x>k.right)?
this.computeMidOrthoPosition(a.y,c.y,!0):k.bottom,m.x=c.x,m.y=l.y):90===d&&a.y<k.top&&a.x>k.left&&a.x<k.right&&(l.x=a.x<c.x?Math.min(c.x,k.left):Math.max(c.x,k.right),l.y=a.y,m.x=l.x);else{l=new N(c.x,a.y);m=new N(c.x,(a.y+c.y)/2);if(270===d||0===d&&c.x<h.left||180===d&&c.x>h.right)270===d&&(k.Pa(a)||h.Pa(c))?l.x=this.computeMidOrthoPosition(a.x,c.x,!1):c.x<a.x&&(270===d||0===d)?l.x=this.computeMidOrthoPosition(h.left,Math.max(c.x,k.right),!1):c.x>a.x&&(270===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,
Math.min(c.x,k.left),!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x<h.right)if(c.y>=h.top&&c.y<=a.y||a.y<=k.bottom&&a.y>=c.y){if(0===d||180===d)l=new N(a.x,Math.max((a.y+c.y)/2,a.y)),m=new N(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.x<a.x?Math.min(c.x,90===d?h.left:Math.min(h.left,k.left)):Math.max(c.x,90===d?h.right:Math.max(h.right,k.right)),m.x=l.x,m.y=c.y}else if(c.y<a.y||180===d&&c.x<a.x&&k.top<a.y||0===d&&c.x>a.x&&k.top<a.y)l=new N(a.x,c.y),m=new N((a.x+c.x)/2,c.y),90===d?(l.y=this.computeMidOrthoPosition(a.y,
c.y,!0),m.x=c.x,m.y=l.y):180===d&&c.x<a.x||0===d&&c.x>=a.x?(l.y=a.y>k.bottom?this.computeMidOrthoPosition(a.y,k.bottom,!0):a.y>k.top&&(180===d&&a.x<k.left||0===d&&a.x>k.right)?this.computeMidOrthoPosition(a.y,c.y,!0):k.top,m.x=c.x,m.y=l.y):270===d&&a.y>k.bottom&&a.x>k.left&&a.x<k.right&&(l.x=a.x<c.x?Math.min(c.x,k.left):Math.max(c.x,k.right),l.y=a.y,m.x=l.x);else{l=new N(c.x,a.y);m=new N(c.x,(a.y+c.y)/2);if(90===d||0===d&&c.x<h.left||180===d&&c.x>h.right)90===d&&(k.Pa(a)||h.Pa(c))?l.x=this.computeMidOrthoPosition(a.x,
c.x,!1):c.x<a.x&&(90===d||0===d)?l.x=this.computeMidOrthoPosition(h.left,Math.max(c.x,k.right),!1):c.x>a.x&&(90===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,Math.min(c.x,k.left),!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x<h.right)if(c.y<=h.bottom&&c.y>=a.y||a.y>=k.top&&a.y<=c.y){if(0===d||180===d)l=new N(a.x,Math.min((a.y+c.y)/2,a.y)),m=new N(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.x<a.x?Math.min(c.x,270===d?h.left:Math.min(h.left,k.left)):Math.max(c.x,270===d?h.right:Math.max(h.right,
k.right)),m.x=l.x,m.y=c.y}var n=l,p=m,q=c;if(this.Pj){var r=this.g;if(null===r||!Nn(r)||h.Pa(q)&&!g.Ji(e)||k.Pa(a)&&!e.Ji(g)||e===g||this.layer.Sc)b=!1;else{var s=ga(r,!0,this.Ja,null);if(s.Hq(Math.min(a.x,n.x),Math.min(a.y,n.y),Math.abs(a.x-n.x),Math.abs(a.y-n.y))&&s.Hq(Math.min(n.x,p.x),Math.min(n.y,p.y),Math.abs(n.x-p.x),Math.abs(n.y-p.y))&&s.Hq(Math.min(p.x,q.x),Math.min(p.y,q.y),Math.abs(p.x-q.x),Math.abs(p.y-q.y)))b=!1;else{e=a;g=q;var t=c=null;if(r.AB){r=s.lb.copy();r.jg(-s.hq,-s.fq);var u=
D.O();cs(s,a.x,a.y)||(Ie(r.x,r.y,r.x+r.width,r.y+r.height,a.x,a.y,n.x,n.y,u)?(c=a=u.copy(),b=u.Yb(n)):Ie(r.x,r.y,r.x+r.width,r.y+r.height,n.x,n.y,p.x,p.y,u)?(c=a=u.copy(),b=u.Yb(p)):Ie(r.x,r.y,r.x+r.width,r.y+r.height,p.x,p.y,q.x,q.y,u)&&(c=a=u.copy(),b=u.Yb(q)));cs(s,q.x,q.y)||(Ie(r.x,r.y,r.x+r.width,r.y+r.height,q.x,q.y,p.x,p.y,u)?(t=q=u.copy(),d=p.Yb(u)):Ie(r.x,r.y,r.x+r.width,r.y+r.height,p.x,p.y,n.x,n.y,u)?(t=q=u.copy(),d=n.Yb(u)):Ie(r.x,r.y,r.x+r.width,r.y+r.height,n.x,n.y,a.x,a.y,u)&&(t=q=
u.copy(),d=a.Yb(u)));D.A(u)}h=h.copy().lh(k);k=s.fH;h.jg(s.hq*k,s.fq*k);ds(s,a,b,q,d,h);k=es(s,q.x,q.y);!s.abort&&999999<=k&&(Qn(s),k=s.rG,h.jg(s.hq*k,s.fq*k),ds(s,a,b,q,d,h),k=es(s,q.x,q.y));!s.abort&&999999<=k&&s.yH&&(Qn(s),ds(s,a,b,q,d,s.lb),k=es(s,q.x,q.y));if(!s.abort&&999999>k&&0!==es(s,q.x,q.y)){fs(this,s,q.x,q.y,d,!0);h=this.m(2);if(4>this.ta)0===b||180===b?(h.x=a.x,h.y=q.y):(h.x=q.x,h.y=a.y),this.ia(2,h.x,h.y),this.B(3,h.x,h.y);else if(q=this.m(3),0===b||180===b)bb(h.x,q.x)?(h=0===b?Math.max(h.x,
a.x):Math.min(h.x,a.x),this.ia(2,h,a.y),this.ia(3,h,q.y)):bb(h.y,q.y)?(Math.abs(a.y-h.y)<=s.fq/2&&(this.ia(2,h.x,a.y),this.ia(3,q.x,a.y)),this.B(2,h.x,a.y)):this.ia(2,a.x,h.y);else if(90===b||270===b)bb(h.y,q.y)?(h=90===b?Math.max(h.y,a.y):Math.min(h.y,a.y),this.ia(2,a.x,h),this.ia(3,q.x,h)):bb(h.x,q.x)?(Math.abs(a.x-h.x)<=s.hq/2&&(this.ia(2,a.x,h.y),this.ia(3,a.x,q.y)),this.B(2,a.x,h.y)):this.ia(2,h.x,a.y);null!==c&&(a=this.m(1),q=this.m(2),a.x!==q.x&&a.y!==q.y?0===b||180===b?this.B(2,a.x,q.y):this.B(2,
q.x,a.y):0===b||180===b?this.B(2,e.x,c.y):this.B(2,c.x,e.y));null!==t&&(0===d||180===d?this.Ej(g.x,t.y):this.Ej(t.x,g.y));b=!0}else b=!1}}}else b=!1;b||(this.Fi(l),this.Fi(m))}};J.prototype.computeMidOrthoPosition=function(a,b){if(this.hasCurviness()){var c=this.computeCurviness();return(a+b)/2+c}return(a+b)/2};
function Mi(a){if(null===a.g||!a.Pj||!Nn(a.g))return!1;var b=a.points.o,c=b.length;if(4>c)return!1;a=ga(a.g,!0,a.Ja,null);for(var d=1;d<c-2;d++){var e=b[d],g=b[d+1];if(!a.Hq(Math.min(e.x,g.x),Math.min(e.y,g.y),Math.abs(e.x-g.x),Math.abs(e.y-g.y)))return!0}return!1}
function fs(a,b,c,d,e,g){var h=b.hq,k=b.fq,l=es(b,c,d),m=c,n=d;for(0===e?m+=h:90===e?n+=k:180===e?m-=h:n-=k;1<l&&es(b,m,n)===l-1;)c=m,d=n,0===e?m+=h:90===e?n+=k:180===e?m-=h:n-=k,l-=1;if(g){if(1<l)if(180===e||0===e)c=Math.floor(c/h)*h+h/2;else if(90===e||270===e)d=Math.floor(d/k)*k+k/2}else c=Math.floor(c/h)*h+h/2,d=Math.floor(d/k)*k+k/2;1<l&&(g=e,m=c,n=d,0===e?(g=90,n+=k):90===e?(g=180,m-=h):180===e?(g=270,n-=k):270===e&&(g=0,m+=h),es(b,m,n)===l-1?fs(a,b,m,n,g,!1):(m=c,n=d,0===e?(g=270,n-=k):90===
e?(g=0,m+=h):180===e?(g=90,n+=k):270===e&&(g=180,m-=h),es(b,m,n)===l-1&&fs(a,b,m,n,g,!1)));a.Ej(c,d)}J.prototype.findClosestSegment=function(a){v&&D.l(a,N,J,"findClosestSegment:p");var b=a.x;a=a.y;for(var c=this.m(0),d=this.m(1),e=lb(b,a,c.x,c.y,d.x,d.y),g=0,h=1;h<this.ta-1;h++){var c=this.m(h+1),k=lb(b,a,d.x,d.y,c.x,c.y),d=c;k<e&&(g=h,e=k)}return g};J.prototype.se=function(){this.Za=null};D.w(J,{wf:"geometry"},function(){null===this.Za&&(this.Fo(),this.Za=this.makeGeometry());return this.Za});
J.prototype.$u=function(a){if(!a){if(!1===this.Uf)return;a=this.Ld();if(null!==this.Za&&(null===a||null!==a.wf))return}this.Za=this.makeGeometry();a=this.path;if(null!==a){a.Za=this.Za;for(var b=this.ya.o,c=b.length,d=0;d<c;d++){var e=b[d];e!==a&&e.We&&e instanceof A&&(e.Za=this.Za)}}};
J.prototype.makeGeometry=function(){var a=this.ta;if(2>a)return new Ue(Ye);var b=!1,c=this.g;null!==c&&Wr(this)&&c.Il.contains(this)&&null!==this.Yw&&(b=!0);var d=c=0,e=this.m(0).copy(),g=e.copy(),c=this.jd.o,h=this.computeCurve();if(h===Vj&&3<=a&&!Eb(this.br,0))if(3===a)var k=this.m(1),c=Math.min(e.x,k.x),d=Math.min(e.y,k.y),k=this.m(2),c=Math.min(c,k.x),d=Math.min(d,k.y);else{if(this.jc)for(k=0;k<a;k++)d=c[k],g.x=Math.min(d.x,g.x),g.y=Math.min(d.y,g.y);else for(k=3;k<a;k+=3)k+3>=a&&(k=a-1),c=this.m(k),
g.x=Math.min(c.x,g.x),g.y=Math.min(c.y,g.y);c=g.x;d=g.y}else{for(k=0;k<a;k++)d=c[k],g.x=Math.min(d.x,g.x),g.y=Math.min(d.y,g.y);c=g.x;d=g.y}c-=this.zA.x;d-=this.zA.y;e.x-=c;e.y-=d;if(2!==a||Wr(this)){var l=D.v();0!==this.computeShortLength(!0)&&(e=gs(this,e,!0,g));S(l,e.x,e.y,!1,!1);if(h===Vj&&3<=a&&!Eb(this.br,0))if(3===a)k=this.m(1),a=k.x-c,b=k.y-d,k=this.m(2).copy(),k.x-=c,k.y-=d,0!==this.computeShortLength(!1)&&(k=gs(this,k,!1,g)),T(l,a,b,a,b,k.x,k.y);else if(this.jc){for(var g=new N(c,d),e=this.m(1).copy(),
h=new N(c,d),a=new N(c,d),b=this.m(0),m=null,n=this.br/3,k=1;k<this.ta-1;k++){var m=this.m(k),p=b,q=m,r=this.m(hs(this,m,k,!1));if(!Eb(p.x,q.x)||!Eb(q.x,r.x))if(!Eb(p.y,q.y)||!Eb(q.y,r.y)){var s=n,t=h,u=a;isNaN(s)&&(s=this.br/3);var z=p.x,p=p.y,w=q.x,q=q.y,y=r.x,r=r.y,B=s*is(z,p,w,q),s=s*is(w,q,y,r);Eb(p,q)&&Eb(w,y)&&(w>z?r>q?(t.x=w-B,t.y=q-B,u.x=w+s,u.y=q+s):(t.x=w-B,t.y=q+B,u.x=w+s,u.y=q-s):r>q?(t.x=w+B,t.y=q-B,u.x=w-s,u.y=q+s):(t.x=w+B,t.y=q+B,u.x=w-s,u.y=q-s));Eb(z,w)&&Eb(q,r)&&(q>p?(y>w?(t.x=
w-B,t.y=q-B,u.x=w+s):(t.x=w+B,t.y=q-B,u.x=w-s),u.y=q+s):(y>w?(t.x=w-B,t.y=q+B,u.x=w+s):(t.x=w+B,t.y=q+B,u.x=w-s),u.y=q-s));if(Eb(z,w)&&Eb(w,y)||Eb(p,q)&&Eb(q,r))z=.5*(z+y),p=.5*(p+r),t.x=z,t.y=p,u.x=z,u.y=p;1===k?(e.x=.5*(b.x+m.x),e.y=.5*(b.y+m.y)):2===k&&Eb(b.x,this.m(0).x)&&Eb(b.y,this.m(0).y)&&(e.x=.5*(b.x+m.x),e.y=.5*(b.y+m.y));T(l,e.x-c,e.y-d,h.x-c,h.y-d,m.x-c,m.y-d);g.set(h);e.set(a);b=m}}k=b.x;b=b.y;g=this.m(this.ta-1);0!==this.computeShortLength(!1)&&(g=gs(this,g.copy(),!1,Jd));k=.5*(k+g.x);
b=.5*(b+g.y);T(l,a.x-c,a.y-d,k-c,b-d,g.x-c,g.y-d)}else for(k=3;k<a;k+=3)b=this.m(k-2),k+3>=a&&(k=a-1),g=this.m(k-1),e=this.m(k),k===a-1&&0!==this.computeShortLength(!1)&&(e=gs(this,e.copy(),!1,Jd)),T(l,b.x-c,b.y-d,g.x-c,g.y-d,e.x-c,e.y-d);else{g=D.O();g.assign(this.m(0));k=1;for(e=0;k<a;){k=hs(this,g,k,1<k);t=this.m(k);if(k>=a-1){if(!g.P(t))0!==this.computeShortLength(!1)&&(t=gs(this,t.copy(),!1,Jd)),js(this,l,-c,-d,g,t,b);else if(0===e)for(k=1;k<a;)t=this.m(k++),js(this,l,-c,-d,g,t,b),g.assign(t);
break}e=hs(this,t,k+1,k<a-3);k=l;h=-c;m=-d;n=g;u=this.m(e);z=g;p=b;bb(n.y,t.y)&&bb(t.x,u.x)?(s=this.computeCorner(),s=Math.min(s,Math.abs(t.x-n.x)/2),s=w=Math.min(s,Math.abs(u.y-t.y)/2),bb(s,0)?(js(this,k,h,m,n,t,p),z.assign(t)):(q=t.x,y=t.y,r=q,B=y,q=t.x>n.x?t.x-s:t.x+s,B=u.y>t.y?t.y+w:t.y-w,js(this,k,h,m,n,new N(q,y),p),yf(k,t.x+h,t.y+m,r+h,B+m),z.n(r,B))):bb(n.x,t.x)&&bb(t.y,u.y)?(s=this.computeCorner(),w=Math.min(s,Math.abs(t.y-n.y)/2),w=s=Math.min(w,Math.abs(u.x-t.x)/2),bb(s,0)?(js(this,k,h,
m,n,t,p),z.assign(t)):(q=t.x,B=y=t.y,y=t.y>n.y?t.y-w:t.y+w,r=u.x>t.x?t.x+s:t.x-s,js(this,k,h,m,n,new N(q,y),p),yf(k,t.x+h,t.y+m,r+h,B+m),z.n(r,B))):(js(this,k,h,m,n,t,p),z.assign(t));k=e}D.A(g)}c=l.q;D.u(l)}else l=this.m(1).copy(),l.x-=c,l.y-=d,0!==this.computeShortLength(!0)&&(e=gs(this,e,!0,g)),0!==this.computeShortLength(!1)&&(l=gs(this,l,!1,g)),c=new Ue(Ye),c.la=e.x,c.ja=e.y,c.G=l.x,c.H=l.y;return c};
function is(a,b,c,d){a=c-a;if(isNaN(a)||Infinity===a||-Infinity===a)return NaN;0>a&&(a=-a);b=d-b;if(isNaN(b)||Infinity===b||-Infinity===b)return NaN;0>b&&(b=-b);return Eb(a,0)?b:Eb(b,0)?a:Math.sqrt(a*a+b*b)}
function gs(a,b,c,d){var e=a.ta;if(2>e)return b;if(c){var g=a.m(1);c=g.x-d.x;d=g.y-d.y;g=is(b.x,b.y,c,d);if(0===g)return b;e=2===e?.5*g:g;a=a.computeShortLength(!0);a>e&&(a=e);c=a*(c-b.x)/g;a=a*(d-b.y)/g;b.x+=c;b.y+=a}else{g=a.m(e-2);c=g.x-d.x;d=g.y-d.y;g=is(b.x,b.y,c,d);if(0===g)return b;e=2===e?.5*g:g;a=a.computeShortLength(!1);a>e&&(a=e);c=a*(b.x-c)/g;a=a*(b.y-d)/g;b.x-=c;b.y-=a}return b}
function hs(a,b,c,d){for(var e=a.ta,g=b;Eb(b.x,g.x)&&Eb(b.y,g.y);){if(c>=e)return e-1;g=a.m(c++)}if(!Eb(b.x,g.x)&&!Eb(b.y,g.y))return c-1;for(var h=g;Eb(b.x,g.x)&&Eb(g.x,h.x)&&(!d||(b.y>=g.y?g.y>=h.y:g.y<=h.y))||Eb(b.y,g.y)&&Eb(g.y,h.y)&&(!d||(b.x>=g.x?g.x>=h.x:g.x<=h.x));){if(c>=e)return e-1;h=a.m(c++)}return c-2}
function js(a,b,c,d,e,g,h){if(!h&&Wr(a)){h=[];var k=0;a.isVisible()&&(k=ks(a,e,g,h));var l=e.x,l=e.y;if(0<k)if(bb(e.y,g.y))if(e.x<g.x)for(var m=0;m<k;){var n=Math.max(e.x,Math.min(h[m++]-5,g.x-10));b.lineTo(n+c,g.y+d);for(var l=n+c,p=Math.min(n+10,g.x);m<k;){var q=h[m];if(q<p+10)m++,p=Math.min(q+5,g.x);else break}q=(n+p)/2+c;q=g.y-10+d;n=p+c;p=g.y+d;a.vf===vj?S(b,n,p,!1,!1):T(b,l,q,n,q,n,p)}else for(m=k-1;0<=m;){n=Math.min(e.x,Math.max(h[m--]+5,g.x+10));b.lineTo(n+c,g.y+d);l=n+c;for(p=Math.max(n-
10,g.x);0<=m;)if(q=h[m],q>p-10)m--,p=Math.max(q-5,g.x);else break;q=g.y-10+d;n=p+c;p=g.y+d;a.vf===vj?S(b,n,p,!1,!1):T(b,l,q,n,q,n,p)}else if(bb(e.x,g.x))if(e.y<g.y)for(m=0;m<k;){n=Math.max(e.y,Math.min(h[m++]-5,g.y-10));b.lineTo(g.x+c,n+d);l=n+d;for(p=Math.min(n+10,g.y);m<k;)if(q=h[m],q<p+10)m++,p=Math.min(q+5,g.y);else break;q=g.x-10+c;n=g.x+c;p+=d;a.vf===vj?S(b,n,p,!1,!1):T(b,q,l,q,p,n,p)}else for(m=k-1;0<=m;){n=Math.min(e.y,Math.max(h[m--]+5,g.y+10));b.lineTo(g.x+c,n+d);l=n+d;for(p=Math.max(n-
10,g.y);0<=m;)if(q=h[m],q>p-10)m--,p=Math.max(q-5,g.y);else break;q=g.x-10+c;n=g.x+c;p+=d;a.vf===vj?S(b,n,p,!1,!1):T(b,q,l,q,p,n,p)}}b.lineTo(g.x+c,g.y+d)}
function ks(a,b,c,d){var e=a.g;if(null===e||b.P(c))return 0;for(e=e.jo;e.next();){var g=e.value;if(null!==g&&g.visible)for(var g=g.rb.o,h=g.length,k=0;k<h;k++){var l=g[k];if(l instanceof J){if(l===a)return 0<d.length&&d.sort(function(a,b){return a-b}),d.length;if(l.isVisible()&&Wr(l)){var m=l.yo;m.F()&&a.yo.kg(m)&&!a.usesSamePort(l)&&(m=l.path,null!==m&&m.Uj()&&ls(b,c,d,l))}}}}0<d.length&&d.sort(function(a,b){return a-b});return d.length}
function ls(a,b,c,d){for(var e=bb(a.y,b.y),g=d.ta,h=d.m(0),k=D.O(),l=1;l<g;l++){var m=d.m(l);if(l<g-1){var n=d.m(l+1);if(h.y===m.y&&m.y===n.y){if(m.x>h.x&&n.x>m.x||m.x<h.x&&n.x<m.x)m=n,l++}else h.x===m.x&&m.x===n.x&&(m.y>h.y&&n.y>m.y||m.y<h.y&&n.y<m.y)&&(m=n,l++)}a:{var n=k,p=a.x,q=a.y,r=b.x,s=b.y,t=h.x,h=h.y,u=m.x,z=m.y;if(!bb(p,r)){if(bb(q,s)&&bb(t,u)&&Math.min(p,r)<t&&Math.max(p,r)>t&&Math.min(h,z)<q&&Math.max(h,z)>q&&!bb(h,z)){n.x=t;n.y=q;n=!0;break a}}else if(!bb(q,s)&&bb(h,z)&&Math.min(q,s)<
h&&Math.max(q,s)>h&&Math.min(t,u)<p&&Math.max(t,u)>p&&!bb(t,u)){n.x=p;n.y=h;n=!0;break a}n.x=0;n.y=0;n=!1}n&&(e?c.push(k.x):c.push(k.y));h=m}D.A(k)}D.w(J,{zu:"firstPickIndex"},function(){var a;2>=this.ta?a=0:((a=this.jc)||(a=this.computeSpot(!0)!==dc),a=a?1:0);return a});D.w(J,{ty:"lastPickIndex"},function(){var a=this.ta;if(0===a)a=0;else if(2>=a)a-=1;else{var b;(b=this.jc)||(b=this.computeSpot(!1)!==dc);a=b?a-2:a-1}return a});function Wr(a){a=a.vf;return a===uj||a===vj}
function Yr(a,b){if(b||Wr(a)){var c=a.g;null===c||c.Il.contains(a)||null===a.Yw||c.Il.add(a,a.Yw)}}function xj(a,b){var c=a.layer;if(null!==c&&c.visible&&!c.Sc){var d=c.g;if(null!==d)for(var e=!1,d=d.jo;d.next();){var g=d.value;if(g.visible)if(g===c)for(var e=!0,h=!1,g=g.rb.o,k=g.length,l=0;l<k;l++){var m=g[l];m instanceof J&&(m===a?h=!0:h&&ms(a,m,b))}else if(e)for(g=g.rb.o,k=g.length,l=0;l<k;l++)m=g[l],m instanceof J&&ms(a,m,b)}}}
function ms(a,b,c){if(null!==b&&null!==b.Za&&Wr(b)){var d=b.yo;d.F()&&(a.yo.kg(d)||c.kg(d))&&(a.usesSamePort(b)||b.se())}}J.prototype.usesSamePort=function(a){var b=this.ta,c=a.ta;if(0<b&&0<c){var d=this.m(0),e=a.m(0);if(d.Zc(e))return!0;b=this.m(b-1);a=a.m(c-1);if(b.Zc(a)||d.Zc(a)||b.Zc(e))return!0}else if(this.Z===a.Z||this.ba===a.ba||this.Z===a.ba||this.ba===a.Z)return!0;return!1};
J.prototype.isVisible=function(){if(!F.prototype.isVisible.call(this))return!1;var a=this.Ja,b=!0,c=this.g;null!==c&&(b=c.ge);var d=this.Z;if(null!==d){if(this.kc&&b&&!d.Fc)return!1;if(d===a)return!0;for(c=d;null!==c;){if(c.Zb===this)return!0;c=c.Ja}c=d.findVisibleNode();if(null===c||c===a)return!1}d=this.ba;if(null!==d){if(this.kc&&!b&&!d.Fc)return!1;if(d===a)return!0;for(c=d;null!==c;){if(c.Zb===this)return!0;c=c.Ja}b=d.findVisibleNode();if(null===b||b===a)return!1}return!0};
J.prototype.Pd=function(a){F.prototype.Pd.call(this,a);null!==this.Si&&this.Si.Aq();if(null!==this.If)for(var b=this.If.j;b.next();)b.value.Pd(a)};D.defineProperty(J,{cq:"adjusting"},function(){return this.mr},function(a){var b=this.mr;b!==a&&(v&&D.Da(a,J,J,"adjusting"),this.mr=a,this.i("adjusting",b,a))});D.defineProperty(J,{XA:"corner"},function(){return this.Hr},function(a){var b=this.Hr;b!==a&&(v&&D.h(a,"number",J,"corner"),this.Hr=a,this.se(),this.i("corner",b,a))});
D.defineProperty(J,{vf:"curve"},function(){return this.Kr},function(a){var b=this.Kr;b!==a&&(v&&D.Da(a,J,J,"curve"),this.Kr=a,this.bc(),this.se(),Yr(this,b===vj||b===uj||a===vj||a===uj),this.i("curve",b,a))});D.defineProperty(J,{Px:"curviness"},function(){return this.Lr},function(a){var b=this.Lr;b!==a&&(v&&D.h(a,"number",J,"curviness"),this.Lr=a,this.bc(),this.se(),this.i("curviness",b,a))});
D.defineProperty(J,{Ry:"routing"},function(){return this.vn},function(a){var b=this.vn;b!==a&&(v&&D.Da(a,J,J,"routing"),this.vn=a,this.dj=null,this.bc(),Yr(this,2===(b.value&2)||2===(a.value&2)),this.i("routing",b,a))});D.defineProperty(J,{br:"smoothness"},function(){return this.Pt},function(a){var b=this.Pt;b!==a&&(v&&D.h(a,"number",J,"smoothness"),this.Pt=a,this.se(),this.i("smoothness",b,a))});
function Vr(a){var b=a.Cg;if(null!==b){var c=a.Tg;if(null!==c){var d=a.ji;a=a.Di;for(var e=null,g=null,h=b.zc.o,k=h.length,l=0;l<k;l++){var m=h[l];if(m.Cg===b&&m.ji===d&&m.Tg===c&&m.Di===a||m.Cg===c&&m.ji===a&&m.Tg===b&&m.Di===d)null===g?g=m:(null===e&&(e=[],e.push(g)),e.push(m))}if(null!==e){g=Dr(b,c,d,a);null===g&&(g=new Hl,g.Lq=b,g.Hy=d,g.ev=c,g.Iy=a,Cr(b,g),Cr(c,g));g.links=e;for(l=0;l<e.length;l++)m=e[l],m.Si=g;g.Aq()}}}}
function Ur(a){var b=a.Si;null!==b&&(a.Si=null,a=b.links.indexOf(a),0<=a&&(D.Vg(b.links,a),b.Aq()))}D.w(J,{key:"key"},function(){var a=this.g;return null!==a&&a.ea instanceof X?a.ea.mf(this.data):void 0},{configurable:!0});function Hl(){D.xc(this);this.vh=this.tw=!1;this.Iy=this.ev=this.Hy=this.Lq=null;this.links=[]}Hl.prototype.Aq=function(){if(!this.tw){var a=this.links;0<a.length&&(a=a[0].g,null!==a&&(a.CD.add(this),this.vh=a.na.ub))}this.tw=!0};
Hl.prototype.wC=function(){if(this.tw){this.tw=!1;var a=this.links;if(0<a.length){var b=a[0],c=b.g,c=null===c||c.ho&&!this.vh;this.vh=!1;b.arrangeBundledLinks(a,c);1===a.length&&(b.Si=null,a.length=0)}0===a.length&&(a=this.Lq,null!==this&&null!==a.di&&a.di.remove(this),a=this.ev,null!==this&&null!==a.di&&a.di.remove(this))}};D.oe(Hl,{Lq:!0,Hy:!0,ev:!0,Iy:!0,links:!0,spacing:!0});
function On(){D.xc(this);this.kC=this.group=null;this.zq=!0;this.abort=!1;this.ag=this.$f=1;this.Ms=this.Ls=-1;this.Td=this.je=8;this.td=null;this.yH=!1;this.fH=22;this.rG=111}D.oe(On,{group:!0,kC:!0,zq:!0,abort:!0,yH:!0,fH:!0,rG:!0});
On.prototype.initialize=function(a){if(!(0>=a.width||0>=a.height)){var b=a.y,c=a.x+a.width,d=a.y+a.height;this.$f=Math.floor((a.x-this.je)/this.je)*this.je;this.ag=Math.floor((b-this.Td)/this.Td)*this.Td;this.Ls=Math.ceil((c+2*this.je)/this.je)*this.je;this.Ms=Math.ceil((d+2*this.Td)/this.Td)*this.Td;a=1+(Math.ceil((this.Ls-this.$f)/this.je)|0);b=1+(Math.ceil((this.Ms-this.ag)/this.Td)|0);if(null===this.td||this.Gn<a-1||this.Hn<b-1){c=[];for(d=0;d<=a;d++)c[d]=[];this.td=c;this.Gn=a-1;this.Hn=b-1}if(null!==
this.td)for(a=0;a<=this.Gn;a++)for(b=0;b<=this.Hn;b++)this.td[a][b]=1E6}};D.w(On,{lb:null},function(){return new C(this.$f,this.ag,this.Ls-this.$f,this.Ms-this.ag)});D.defineProperty(On,{hq:null},function(){return this.je},function(a){0<a&&a!==this.je&&(this.je=a,this.initialize(this.lb))});D.defineProperty(On,{fq:null},function(){return this.Td},function(a){0<a&&a!==this.Td&&(this.Td=a,this.initialize(this.lb))});function cs(a,b,c){return a.$f<=b&&b<=a.Ls&&a.ag<=c&&c<=a.Ms}
function es(a,b,c){if(!cs(a,b,c))return 1E6;b-=a.$f;b/=a.je;c-=a.ag;c/=a.Td;return a.td[b|0][c|0]}function Rn(a,b,c){cs(a,b,c)&&(b-=a.$f,b/=a.je,c-=a.ag,c/=a.Td,a.td[b|0][c|0]=0)}function Qn(a){if(null!==a.td)for(var b=0;b<=a.Gn;b++)for(var c=0;c<=a.Hn;c++)1<=a.td[b][c]&&(a.td[b][c]=1E6)}
On.prototype.Hq=function(a,b,c,d){if(a>this.Ls||a+c<this.$f||b>this.Ms||b+d<this.ag)return!0;a=(a-this.$f)/this.je|0;b=(b-this.ag)/this.Td|0;c=Math.max(0,c)/this.je+1|0;var e=Math.max(0,d)/this.Td+1|0;0>a&&(c+=a,a=0);0>b&&(e+=b,b=0);if(0>c||0>e)return!0;d=Math.min(a+c-1,this.Gn)|0;for(c=Math.min(b+e-1,this.Hn)|0;a<=d;a++)for(e=b;e<=c;e++)if(0===this.td[a][e])return!1;return!0};
function ns(a,b,c,d,e,g,h,k,l){if(!(b<g||b>h||c<k||c>l)){var m,n;m=b|0;n=c|0;var p=a.td[m][n];if(1<=p&&999999>p)for(e?n+=d:m+=d,p+=1;g<=m&&m<=h&&k<=n&&n<=l&&!(p>=a.td[m][n]);)a.td[m][n]=p,p+=1,e?n+=d:m+=d;m=e?n:m;if(e)if(0<d)for(c+=d;c<m;c+=d)ns(a,b,c,1,!e,g,h,k,l),ns(a,b,c,-1,!e,g,h,k,l);else for(c+=d;c>m;c+=d)ns(a,b,c,1,!e,g,h,k,l),ns(a,b,c,-1,!e,g,h,k,l);else if(0<d)for(b+=d;b<m;b+=d)ns(a,b,c,1,!e,g,h,k,l),ns(a,b,c,-1,!e,g,h,k,l);else for(b+=d;b>m;b+=d)ns(a,b,c,1,!e,g,h,k,l),ns(a,b,c,-1,!e,g,h,
k,l)}}function os(a,b,c,d,e,g,h,k,l){b|=0;c|=0;var m=0,n=1;for(a.td[b][c]=n;0===m&&b>g&&b<h&&c>k&&c<l;)n+=1,a.td[b][c]=n,e?c+=d:b+=d,m=a.td[b][c]}function ps(a,b,c,d,e,g,h,k,l){b|=0;c|=0;var m=0;for(a.td[b][c]=999999;0===m&&b>g&&b<h&&c>k&&c<l;)a.td[b][c]=999999,e?c+=d:b+=d,m=a.td[b][c]}
function ds(a,b,c,d,e,g){if(null!==a.td){a.abort=!1;var h=b.x,k=b.y;if(cs(a,h,k)&&(h-=a.$f,h/=a.je,k-=a.ag,k/=a.Td,b=d.x,d=d.y,cs(a,b,d)))if(b-=a.$f,b/=a.je,d-=a.ag,d/=a.Td,1>=Math.abs(h-b)&&1>=Math.abs(k-d))a.abort=!0;else{var l=g.x,m=g.y,n=g.x+g.width,p=g.y+g.height,l=l-a.$f,l=l/a.je,m=m-a.ag,m=m/a.Td,n=n-a.$f,n=n/a.je,p=p-a.ag,p=p/a.Td;g=Math.max(0,Math.min(a.Gn,l|0));n=Math.min(a.Gn,Math.max(0,n|0));m=Math.max(0,Math.min(a.Hn,m|0));p=Math.min(a.Hn,Math.max(0,p|0));h|=0;k|=0;b|=0;d|=0;l=0===c||
90===c?1:-1;c=90===c||270===c;0===a.td[h][k]?(os(a,h,k,l,c,g,n,m,p),os(a,h,k,1,!c,g,n,m,p),os(a,h,k,-1,!c,g,n,m,p)):os(a,h,k,l,c,h,k,h,k);0===a.td[b][d]?(ps(a,b,d,0===e||90===e?1:-1,90===e||270===e,g,n,m,p),ps(a,b,d,1,!(90===e||270===e),g,n,m,p),ps(a,b,d,-1,!(90===e||270===e),g,n,m,p)):ps(a,b,d,l,c,b,d,b,d);a.abort||(ns(a,h,k,1,!1,g,n,m,p),ns(a,h,k,-1,!1,g,n,m,p),ns(a,h,k,1,!0,g,n,m,p),ns(a,h,k,-1,!0,g,n,m,p))}}}function as(){D.xc(this);this.port=this.ad=null;this.pg=[];this.Kq=!1}
D.oe(as,{ad:!0,port:!0,pg:!0,Kq:!0});as.prototype.toString=function(){for(var a=this.pg,b=this.ad.toString()+" "+a.length.toString()+":",c=0;c<a.length;c++){var d=a[c];null!==d&&(b+="\n "+d.toString())}return b};
function qs(a,b,c,d){b=b.offsetY;switch(b){case D.rd:return 90;case D.dd:return 180;case D.Ad:return 270;case D.sd:return 0}switch(b){case D.rd|D.Ad:return 180<c?270:90;case D.dd|D.sd:return 90<c&&270>=c?180:0}a=180*Math.atan2(a.height,a.width)/Math.PI;switch(b){case D.dd|D.Ad:return c>a&&c<=180+a?180:270;case D.Ad|D.sd:return c>180-a&&c<=360-a?270:0;case D.sd|D.rd:return c>a&&c<=180+a?90:0;case D.rd|D.dd:return c>180-a&&c<=360-a?180:90;case D.dd|D.Ad|D.sd:return 90<c&&c<=180+a?180:c>180+a&&c<=360-
a?270:0;case D.Ad|D.sd|D.rd:return 180<c&&c<=360-a?270:c>a&&180>=c?90:0;case D.sd|D.rd|D.dd:return c>a&&c<=180-a?90:c>180-a&&270>=c?180:0;case D.rd|D.dd|D.Ad:return c>180-a&&c<=180+a?180:c>180+a?270:90}d&&b!==(D.dd|D.Ad|D.sd|D.rd)&&(c-=15,0>c&&(c+=360));return c>a&&c<180-a?90:c>=180-a&&c<=180+a?180:c>180+a&&c<360-a?270:0}as.prototype.Aq=function(){this.pg.length=0};
function bs(a,b){var c=a.pg;if(0===c.length){a:if(!a.Kq){c=a.Kq;a.Kq=!0;var d,e=null,g=a.ad,g=g instanceof I?g:null;if(null===g||g.nd)d=a.ad.EF(a.port.Rd);else{if(!g.Y.F()){a.Kq=c;break a}e=g;d=e.DF()}var h=a.pg.length=0,k=a.port.gb(ic,D.O()),l=a.port.gb(vc,D.O()),g=D.vg(k.x,k.y,0,0);g.Qi(l);D.A(k);D.A(l);k=D.Db(g.x+g.width/2,g.y+g.height/2);l=a.port.ym();for(d=d.j;d.next();){var m=d.value;if(m.isVisible()&&m.ic!==m.wc){var n=m.ic===a.port||null!==m.Z&&m.Z.Ji(e),p=m.computeSpot(n,a.port);if(p.Rj()&&
(n=n?m.wc:m.ic,null!==n)){var q=n.$;if(null!==q){var r=q.findVisibleNode();null!==r&&r!==q&&(q=r,n=q.port);n=m.computeOtherPoint(q,n);q=k.Yb(n);q-=l;0>q&&(q+=360);p=qs(g,p,q,m.jc);r=0;0===p?(r=D.sd,180<q&&(q-=360)):r=90===p?D.rd:180===p?D.dd:D.Ad;p=a.pg[h];void 0===p?(p=new rs(m,q,r),a.pg[h]=p):(p.link=m,p.angle=q,p.Me=r);p.Fy.set(n);h++}}}}D.A(k);a.pg.sort(as.prototype.VJ);e=a.pg.length;k=-1;for(h=l=0;h<e;h++)p=a.pg[h],void 0!==p&&(p.Me!==k&&(k=p.Me,l=0),p.xq=l,l++);k=-1;l=0;for(h=e-1;0<=h;h--)p=
a.pg[h],void 0!==p&&(p.Me!==k&&(k=p.Me,l=p.xq+1),p.Sn=l);h=a.pg;p=a.port;e=a.ad.$J;k=D.O();l=D.O();d=D.O();m=D.O();p.gb(ic,k);p.gb(kc,l);p.gb(vc,d);p.gb(tc,m);r=q=n=p=0;if(e===Br)for(var s=0;s<h.length;s++){var t=h[s];if(null!==t){var u=t.link.computeThickness();switch(t.Me){case D.rd:q+=u;break;case D.dd:r+=u;break;case D.Ad:p+=u;break;default:case D.sd:n+=u}}}for(var z=0,w=0,y=1,s=0;s<h.length;s++)if(t=h[s],null!==t){var B,P;if(z!==t.Me){z=t.Me;switch(z){case D.rd:B=d;P=m;break;case D.dd:B=m;P=
k;break;case D.Ad:B=k;P=l;break;default:case D.sd:B=l,P=d}var G=P.x-B.x;P=P.y-B.y;switch(z){case D.rd:q>Math.abs(G)?(y=Math.abs(G)/q,q=Math.abs(G)):y=1;break;case D.dd:r>Math.abs(P)?(y=Math.abs(P)/r,r=Math.abs(P)):y=1;break;case D.Ad:p>Math.abs(G)?(y=Math.abs(G)/p,p=Math.abs(G)):y=1;break;default:case D.sd:n>Math.abs(P)?(y=Math.abs(P)/n,n=Math.abs(P)):y=1}w=0}var Q=t.Iq;if(e===Br){u=t.link.computeThickness();u*=y;Q.set(B);switch(z){case D.rd:Q.x=B.x+G/2+q/2-w-u/2;break;case D.dd:Q.y=B.y+P/2+r/2-w-
u/2;break;case D.Ad:Q.x=B.x+G/2-p/2+w+u/2;break;default:case D.sd:Q.y=B.y+P/2-n/2+w+u/2}w+=u}else u=.5,e===yr&&(u=(t.xq+1)/(t.Sn+1)),Q.x=B.x+G*u,Q.y=B.y+P*u}D.A(k);D.A(l);D.A(d);D.A(m);B=a.pg;for(G=0;G<B.length;G++)P=B[G],null!==P&&(P.Xx=a.computeEndSegmentLength(P));a.Kq=c;D.Hb(g)}c=a.pg}for(g=0;g<c.length;g++)if(B=c[g],null!==B&&B.link===b)return B;return null}as.prototype.VJ=function(a,b){return a===b?0:null===a?-1:null===b?1:a.Me<b.Me?-1:a.Me>b.Me?1:a.angle<b.angle?-1:a.angle>b.angle?1:0};
as.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.ad,this.port,dc,b.ic===this.port),d=a.xq;if(0>d)return c;var e=a.Sn;if(1>=e||!b.jc)return c;var b=a.Fy,g=a.Iq;if(a.Me===D.dd||a.Me===D.rd)d=e-1-d;return((a=a.Me===D.dd||a.Me===D.sd)?b.y<g.y:b.x<g.x)?c+8*d:(a?b.y===g.y:b.x===g.x)?c:c+8*(e-1-d)};function rs(a,b,c){this.link=a;this.angle=b;this.Me=c;this.Fy=new N;this.Sn=this.xq=0;this.Iq=new N;this.Xx=0}
D.oe(rs,{link:!0,angle:!0,Me:!0,Fy:!0,xq:!0,Sn:!0,Iq:!0,Xx:!0});rs.prototype.toString=function(){return this.link.toString()+" "+this.angle.toString()+" "+this.Me.toString()+":"+this.xq.toString()+"/"+this.Sn.toString()+" "+this.Iq.toString()+" "+this.Xx.toString()+" "+this.Fy.toString()};function Go(){this.Qk=this.rk=Vc;this.Ok=this.pk=NaN;this.Nk=this.ok=zr;this.Pk=this.qk=NaN;this.Yt=this.es=null;this.Zt=this.fs=Infinity}
Go.prototype.copy=function(){var a=new Go;a.rk=this.rk.V();a.Qk=this.Qk.V();a.pk=this.pk;a.Ok=this.Ok;a.ok=this.ok;a.Nk=this.Nk;a.qk=this.qk;a.Pk=this.Pk;a.es=this.es;a.Yt=this.Yt;a.fs=this.fs;a.Zt=this.Zt;return a};function I(a){H.call(this,a);this.Ca|=4608;this.Os=new L(F);this.on=new L(I);this.Tb=this.Tt=this.Xl=this.Ps=this.Ns=null;this.ye=new Ig;this.ye.group=this}D.Ta(I,H);D.ka("Group",I);
I.prototype.cloneProtected=function(a){H.prototype.cloneProtected.call(this,a);this.Ca&=-32769;a.Ns=this.Ns;a.Ps=this.Ps;a.Xl=this.Xl;a.Tt=this.Tt;var b=a.wu(function(a){return a instanceof Zj});a.Tb=b instanceof Zj?b:null;null!==this.ye?(a.ye=this.ye.copy(),a.ye.group=a):(null!==a.ye&&(a.ye.group=null),a.ye=null)};I.prototype.Ii=function(a){H.prototype.Ii.call(this,a);var b=a.tq();for(a=a.lc;a.next();){var c=a.value;c.K();c.L(8);c.ou();if(c instanceof H)c.lg(b);else if(c instanceof J)for(c=c.Bf;c.next();)c.value.lg(b)}};
I.prototype.xo=function(a,b,c,d,e,g,h){if(a===gg&&"elements"===b)if(e instanceof Zj){var k=e;null===this.Tb?this.Tb=k:this.Tb!==k&&D.k("Cannot insert a second Placeholder into the visual tree of a Group.")}else e instanceof x&&(k=e.wu(function(a){return a instanceof Zj}),k instanceof Zj&&(null===this.Tb?this.Tb=k:this.Tb!==k&&D.k("Cannot insert a second Placeholder into the visual tree of a Group.")));else a===hg&&"elements"===b&&null!==this.Tb&&(d===this.Tb?this.Tb=null:d instanceof x&&this.Tb.Dm(d)&&
(this.Tb=null));H.prototype.xo.call(this,a,b,c,d,e,g,h)};I.prototype.Fj=function(a,b,c,d){this.Wl=this.Tb;x.prototype.Fj.call(this,a,b,c,d)};I.prototype.Em=function(){if(!H.prototype.Em.call(this))return!1;for(var a=this.lc;a.next();){var b=a.value;if(b instanceof H){if(b.isVisible()&&Nm(b))return!1}else if(b instanceof J&&b.isVisible()&&Nm(b)&&b.Z!==this&&b.ba!==this)return!1}return!0};D.w(I,{placeholder:"placeholder"},function(){return this.Tb});
D.defineProperty(I,{oI:"computesBoundsAfterDrag"},function(){return 0!==(this.Ca&2048)},function(a){var b=0!==(this.Ca&2048);b!==a&&(D.h(a,"boolean",I,"computesBoundsAfterDrag"),this.Ca^=2048,this.i("computesBoundsAfterDrag",b,a))});D.defineProperty(I,{Lx:"computesBoundsIncludingLinks"},function(){return 0!==(this.Ca&4096)},function(a){D.h(a,"boolean",I,"computesBoundsIncludingLinks");var b=0!==(this.Ca&4096);b!==a&&(this.Ca^=4096,this.i("computesBoundsIncludingLinks",b,a))});
D.defineProperty(I,{pI:"computesBoundsIncludingLocation"},function(){return 0!==(this.Ca&8192)},function(a){D.h(a,"boolean",I,"computesBoundsIncludingLocation");var b=0!==(this.Ca&8192);b!==a&&(this.Ca^=8192,this.i("computesBoundsIncludingLocation",b,a))});D.defineProperty(I,{dJ:"handlesDragDropForMembers"},function(){return 0!==(this.Ca&16384)},function(a){D.h(a,"boolean",I,"handlesDragDropForMembers");var b=0!==(this.Ca&16384);b!==a&&(this.Ca^=16384,this.i("handlesDragDropForMembers",b,a))});
D.w(I,{lc:"memberParts"},function(){return this.Os.j});function ur(a,b){if(a.Os.add(b)){b instanceof I&&a.on.add(b);var c=a.MJ;if(null!==c){var d=!0,e=a.g;null!==e&&(d=e.ab,e.ab=!0);c(a,b);null!==e&&(e.ab=d)}a.isVisible()&&a.nd||b.Pd(!1)}b instanceof J&&!a.Lx||(c=a.Tb,null===c&&(c=a),c.K())}
function tr(a,b){if(a.Os.remove(b)){b instanceof I&&a.on.remove(b);var c=a.NJ;if(null!==c){var d=!0,e=a.g;null!==e&&(d=e.ab,e.ab=!0);c(a,b);null!==e&&(e.ab=d)}a.isVisible()&&a.nd||b.Pd(!0)}b instanceof J&&!a.Lx||(c=a.Tb,null===c&&(c=a),c.K())}I.prototype.Un=function(){if(0<this.Os.count){var a=this.g;if(null!==a)for(var b=this.Os.copy().j;b.next();)a.remove(b.value)}H.prototype.Un.call(this)};
D.defineProperty(I,{$b:"layout"},function(){return this.ye},function(a){var b=this.ye;if(b!==a){null!==a&&D.l(a,Ig,I,"layout");null!==b&&(b.g=null,b.group=null);this.ye=a;var c=this.g;null!==a&&(a.g=c,a.group=this);null!==c&&(c.gk=!0);this.i("layout",b,a);null!==c&&c.Le()}});D.defineProperty(I,{MJ:"memberAdded"},function(){return this.Ns},function(a){var b=this.Ns;b!==a&&(null!==a&&D.h(a,"function",I,"memberAdded"),this.Ns=a,this.i("memberAdded",b,a))});
D.defineProperty(I,{NJ:"memberRemoved"},function(){return this.Ps},function(a){var b=this.Ps;b!==a&&(null!==a&&D.h(a,"function",I,"memberRemoved"),this.Ps=a,this.i("memberRemoved",b,a))});D.defineProperty(I,{GB:"memberValidation"},function(){return this.Xl},function(a){var b=this.Xl;b!==a&&(null!==a&&D.h(a,"function",I,"memberValidation"),this.Xl=a,this.i("memberValidation",b,a))});
I.prototype.canAddMembers=function(a){var b=this.g;if(null===b)return!1;b=b.xb;for(a=Xh(a).j;a.next();)if(!b.isValidMember(this,a.value))return!1;return!0};I.prototype.addMembers=function(a,b){var c=this.g;if(null===c)return!1;for(var c=c.xb,d=!0,e=Xh(a).j;e.next();){var g=e.value;!b||c.isValidMember(this,g)?g.Ja=this:d=!1}return d};
D.defineProperty(I,{IK:"ungroupable"},function(){return 0!==(this.Ca&256)},function(a){var b=0!==(this.Ca&256);b!==a&&(D.h(a,"boolean",I,"ungroupable"),this.Ca^=256,this.i("ungroupable",b,a))});I.prototype.canUngroup=function(){if(!this.IK)return!1;var a=this.layer;if(null!==a&&!a.Hx)return!1;a=a.g;return null===a||a.Hx?!0:!1};
I.prototype.lg=function(a){void 0===a&&(a=null);var b=0!==(this.Ca&65536);H.prototype.lg.call(this,a);if(!b)for(0!==(this.Ca&65536)!==!0&&(this.Ca^=65536),b=this.DF();b.next();){var c=b.value;if(null===a||!a.contains(c)){var d=c.Z;null!==d&&d!==this&&d.Ji(this)&&!d.isVisible()?(Er(d,c.ic),Er(d,c.wc),c.bc()):(d=c.ba,null!==d&&d!==this&&d.Ji(this)&&!d.isVisible()&&(Er(d,c.ic),Er(d,c.wc),c.bc()))}}};
I.prototype.findExternalLinksConnected=I.prototype.DF=function(){var a=this.tq();a.add(this);for(var b=new L(J),c=a.j;c.next();){var d=c.value;if(d instanceof H)for(d=d.Od;d.next();){var e=d.value;a.contains(e)||b.add(e)}}return b.j};I.prototype.findExternalNodesConnected=function(){var a=this.tq();a.add(this);for(var b=new L(H),c=a.j;c.next();){var d=c.value;if(d instanceof H)for(d=d.Od;d.next();){var e=d.value,g=e.Z;a.contains(g)&&g!==this||b.add(g);e=e.ba;a.contains(e)&&e!==this||b.add(e)}}return b.j};
I.prototype.findContainingGroupChain=function(){function a(b,d){null!==b&&(d.add(b),a(b.Ja,d))}var b=new L(I);a(this,b);return b};I.prototype.findSubGraphParts=I.prototype.tq=function(){var a=new L(F);Qh(a,this,!0,0,!0);a.remove(this);return a};I.prototype.Pd=function(a){H.prototype.Pd.call(this,a);for(var b=this.lc;b.next();)b.value.Pd(a)};I.prototype.collapseSubGraph=I.prototype.collapseSubGraph=function(){var a=this.g;if(null!==a&&!a.Qh){a.Qh=!0;var b=this.tq();ss(this,b,a.Ra,this);a.Qh=!1}};
function ss(a,b,c,d){for(var e=a.lc;e.next();){var g=e.value;g.Pd(!1);if(g instanceof I){var h=g;h.nd&&(h.dz=h.nd,ss(h,b,c,d))}if(g instanceof H)g.lg(b),ql(c,g,d);else if(g instanceof J)for(g=g.Bf;g.next();)g.value.lg(b)}a.nd=!1}I.prototype.expandSubGraph=I.prototype.expandSubGraph=function(){var a=this.g;if(null!==a&&!a.Qh){a.Qh=!0;var b=this.tq();ts(this,b,a.Ra,this);a.Qh=!1}};
function ts(a,b,c,d){for(var e=a.lc;e.next();){var g=e.value;g.Pd(!0);if(g instanceof I){var h=g;h.dz&&(h.dz=!1,ts(h,b,c,d))}if(g instanceof H)g.lg(b),pl(c,g,d);else if(g instanceof J)for(g=g.Bf;g.next();)g.value.lg(b)}a.nd=!0}
D.defineProperty(I,{nd:"isSubGraphExpanded"},function(){return 0!==(this.Ca&512)},function(a){var b=0!==(this.Ca&512);if(b!==a){D.h(a,"boolean",I,"isSubGraphExpanded");this.Ca^=512;var c=this.g;this.i("isSubGraphExpanded",b,a);b=this.zK;if(null!==b){var d=!0;null!==c&&(d=c.ab,c.ab=!0);b(this);null!==c&&(c.ab=d)}null!==c&&c.na.ub?(null!==this.Tb&&this.Tb.K(),this.lc.each(function(a){a.updateAdornments()})):a?this.expandSubGraph():this.collapseSubGraph()}});
D.defineProperty(I,{dz:"wasSubGraphExpanded"},function(){return 0!==(this.Ca&1024)},function(a){var b=0!==(this.Ca&1024);b!==a&&(D.h(a,"boolean",I,"wasSubGraphExpanded"),this.Ca^=1024,this.i("wasSubGraphExpanded",b,a))});D.defineProperty(I,{zK:"subGraphExpandedChanged"},function(){return this.Tt},function(a){var b=this.Tt;b!==a&&(null!==a&&D.h(a,"function",I,"subGraphExpandedChanged"),this.Tt=a,this.i("subGraphExpandedChanged",b,a))});
I.prototype.move=function(a){var b=this.position,c=b.x;isNaN(c)&&(c=0);b=b.y;isNaN(b)&&(b=0);var c=a.x-c,b=a.y-b,d=D.Db(c,b);H.prototype.move.call(this,a);a=new L(J);for(var e=this.tq().j;e.next();){var g=e.value;g instanceof J&&(g.Ni&&a.add(g),g.Ni=!0)}for(e.reset();e.next();)if(g=e.value,!(g instanceof J||g instanceof H&&g.Mf)){var h=g.position,k=g.location;h.F()?(d.x=h.x+c,d.y=h.y+b,g.position=d):k.F()&&(d.x=k.x+c,d.y=k.y+b,g.location=d)}for(e.reset();e.next();)if(g=e.value,g instanceof J&&(g.Ni=
a.contains(g),g.Uf||g.Z!==this&&g.ba!==this))h=g.position,d.x=h.x+c,d.y=h.y+b,d.F()?g.move(d):g.bc(),Mi(g)&&g.bc();D.A(d)};D.defineProperty(I,{uo:null},function(){return 0!==(this.Ca&32768)},function(a){0!==(this.Ca&32768)!==a&&(this.Ca^=32768)});function Zj(){O.call(this);this.tf=Ld;this.Dt=new C(NaN,NaN,NaN,NaN)}D.Ta(Zj,O);D.ka("Placeholder",Zj);Zj.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.tf=this.tf.V();a.Dt=this.Dt.copy()};
Zj.prototype.Vk=function(a){if(null===this.background&&null===this.mm)return!1;var b=this.Fa;return Vb(0,0,b.width,b.height,a.x,a.y)};
Zj.prototype.oo=function(){var a=this.$;null!==a&&(a instanceof I||a instanceof ca)||D.k("Placeholder is not inside a Group or Adornment.");if(a instanceof I){var b=this.computeBorder(this.Dt),c=this.Xc;Cb(c,b.width||0,b.height||0);Lo(this,0,0,c.width,c.height);for(var d=a.lc,c=!1;d.next();)if(d.value.isVisible()){c=!0;break}d=a.g;!c||null===d||d.Ra.nf||isNaN(b.x)||isNaN(b.y)||(c=D.O(),c.zo(b,a.Pf),a.location=new N(c.x,c.y),D.A(c))}else{var b=this.Ea,c=this.Xc,d=this.padding,e=d.left+d.right,g=d.top+
d.bottom;if(b.F())Cb(c,b.width+e||0,b.height+g||0),Lo(this,-d.left,-d.top,c.width,c.height);else{var h=a.Cb,k=h.gb(ic,D.O()),b=D.vg(k.x,k.y,0,0);b.Qi(h.gb(vc,k));b.Qi(h.gb(kc,k));b.Qi(h.gb(tc,k));a.mj.n(b.x,b.y);Cb(c,b.width+e||0,b.height+g||0);Lo(this,-d.left,-d.top,c.width,c.height);D.A(k);D.Hb(b)}}};Zj.prototype.Fj=function(a,b,c,d){var e=this.Y;e.x=a;e.y=b;e.width=c;e.height=d};
Zj.prototype.computeBorder=function(a){var b=this.$;if(b instanceof I){var c=b;if(c.oI&&this.Dt.F()){var d=c.g;if(null!==d&&!c.layer.Sc&&(d=d.cb,d instanceof Uh&&!d.Zr&&null!==d.hc&&!d.hc.contains(c)))return a.assign(this.Dt),a}}var c=D.Ff(),d=this.computeMemberBounds(c),e=this.padding;a.n(d.x-e.left,d.y-e.top,Math.max(d.width+e.left+e.right,0),Math.max(d.height+e.top+e.bottom,0));D.Hb(c);b instanceof I&&(c=b,c.pI&&c.location.F()&&a.Qi(c.location));return a};
Zj.prototype.computeMemberBounds=function(a){if(!(this.$ instanceof I))return a.n(0,0,0,0),a;for(var b=this.$,c=Infinity,d=Infinity,e=-Infinity,g=-Infinity,h=b.lc;h.next();){var k=h.value;if(k.isVisible()){if(k instanceof J){var l=k;if(!b.Lx)continue;if(zm(l))continue;if(l.Z===b||l.ba===b)continue}k=k.Y;k.left<c&&(c=k.left);k.top<d&&(d=k.top);k.right>e&&(e=k.right);k.bottom>g&&(g=k.bottom)}}isFinite(c)&&isFinite(d)?a.n(c,d,e-c,g-d):(b=b.location,c=this.padding,a.n(b.x+c.left,b.y+c.top,0,0));return a};
D.defineProperty(Zj,{padding:"padding"},function(){return this.tf},function(a){"number"===typeof a?a=new Mb(a):D.l(a,Mb,Zj,"padding");var b=this.tf;b.P(a)||(this.tf=a=a.V(),this.i("padding",b,a))});function Ig(){0<arguments.length&&D.zd(Ig);D.xc(this);this.$z=this.ca=null;this.Ql=this.us=!0;this.As=!1;this.qr=(new N(0,0)).freeze();this.ws=this.xs=!0;this.oD="";this.zs=!1;this.lA=null}D.ka("Layout",Ig);
Ig.prototype.cloneProtected=function(a){a.us=this.us;a.Ql=this.Ql;a.As=this.As;a.qr.assign(this.qr);a.xs=this.xs;a.ws=this.ws;a.oD=this.oD;a.zs=!0};Ig.prototype.copy=function(){var a=new this.constructor;this.cloneProtected(a);return a};Ig.prototype.qc=function(a){D.ck(this,a)};Ig.prototype.toString=function(){var a=D.xf(Object.getPrototypeOf(this)),a=a+"(";null!==this.group&&(a+=" in "+this.group);null!==this.g&&(a+=" for "+this.g);return a+")"};
D.defineProperty(Ig,{g:"diagram"},function(){return this.ca},function(a){null!==a&&D.l(a,E,Ig,"diagram");this.ca=a});D.defineProperty(Ig,{group:"group"},function(){return this.$z},function(a){this.$z!==a&&(null!==a&&D.l(a,I,Ig,"group"),this.$z=a,null!==a&&(this.ca=a.g))});D.defineProperty(Ig,{tJ:"isOngoing"},function(){return this.us},function(a){this.us!==a&&(D.h(a,"boolean",Ig,"isOngoing"),this.us=a)});
D.defineProperty(Ig,{kG:"isInitial"},function(){return this.Ql},function(a){D.h(a,"boolean",Ig,"isInitial");this.Ql=a;a||(this.zs=!0)});D.defineProperty(Ig,{qy:"isViewportSized"},function(){return this.As},function(a){this.As!==a&&(D.h(a,"boolean",Ig,"isViewportSized"),(this.As=a)&&this.L())});D.defineProperty(Ig,{Tu:"isRouting"},function(){return this.xs},function(a){this.xs!==a&&(D.h(a,"boolean",Ig,"isRouting"),this.xs=a)});
D.defineProperty(Ig,{mG:"isRealtime"},function(){return this.ws},function(a){this.ws!==a&&(D.h(a,"boolean",Ig,"isRealtime"),this.ws=a)});D.defineProperty(Ig,{Af:"isValidLayout"},function(){return this.zs},function(a){this.zs!==a&&(D.h(a,"boolean",Ig,"isValidLayout"),this.zs=a,a||(a=this.g,null!==a&&(a.gk=!0)))});Ig.prototype.invalidateLayout=Ig.prototype.L=function(){if(this.Af){var a=this.g;if(null!==a&&!a.na.ub){var b=a.Ra;!b.sp&&(b.nf&&b.ai(),this.tJ&&a.ho||this.kG&&!a.ho)&&(this.Af=!1,a.Le())}}};
D.defineProperty(Ig,{network:"network"},function(){return this.lA},function(a){var b=this.lA;b!==a&&(null!==a&&D.l(a,ta,Ig,"network"),null!==b&&(b.$b=null),this.lA=a,null!==a&&(a.$b=this))});Ig.prototype.createNetwork=function(){return new ta};Ig.prototype.makeNetwork=function(a){var b=this.createNetwork();b.$b=this;a instanceof E?(b.Sk(a.rg,!0),b.Sk(a.links,!0)):a instanceof I?b.Sk(a.lc):b.Sk(a.j);return b};
Ig.prototype.updateParts=function(){var a=this.g;if(null===a&&null!==this.network)for(var b=this.network.vertexes.j;b.next();){var c=b.value.ad;if(null!==c&&(a=c.g,null!==a))break}this.Af=!0;try{null!==a&&a.Qb("Layout"),this.commitLayout()}finally{null!==a&&a.ld("Layout")}};Ig.prototype.commitLayout=function(){for(var a=this.network.vertexes.j;a.next();)a.value.commit();if(this.Tu)for(a=this.network.edges.j;a.next();)a.value.commit()};
Ig.prototype.doLayout=function(a){null===a&&D.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");var b=new L(F);a instanceof E?(us(this,b,a.rg,!0,this.uo,!0,!1,!0),us(this,b,a.Wh,!0,this.uo,!0,!1,!0)):a instanceof I?us(this,b,a.lc,!1,this.uo,!0,!1,!0):b.Yc(a.j);var c=b.count;if(0<c){a=this.g;null!==a&&a.Qb("Layout");c=Math.ceil(Math.sqrt(c));this.$d=this.initialOrigin(this.$d);for(var d=this.$d.x,e=d,g=this.$d.y,h=0,k=0,b=b.j;b.next();){var l=
b.value;l.Ue();var m=l.Ia,n=m.width,m=m.height;l.moveTo(e,g);l instanceof I&&(l.uo=!1);e+=Math.max(n,50)+20;k=Math.max(k,Math.max(m,50));h>=c-1?(h=0,e=d,g+=k+20,k=0):h++}null!==a&&a.ld("Layout")}this.Af=!0};Ig.prototype.uo=function(a){return!a.location.F()||a instanceof I&&a.uo?!0:!1};
function us(a,b,c,d,e,g,h,k){for(c=c.j;c.next();){var l=c.value;d&&!l.Fq||null!==e&&!e(l)||!l.canLayout()||(g&&l instanceof H?l.Mf||(l instanceof I?null===l.$b?us(a,b,l.lc,!1,e,g,h,k):(vs(l),b.add(l)):(vs(l),b.add(l))):h&&l instanceof J?b.add(l):!k||!l.te()||l instanceof H||(vs(l),b.add(l)))}}function vs(a){var b=a.Y;(0===b.width||0===b.height||isNaN(b.width)||isNaN(b.height))&&a.Ue()}
Ig.prototype.collectParts=Ig.prototype.jI=function(a){var b=new L(F);a instanceof E?(us(this,b,a.rg,!0,null,!0,!0,!0),us(this,b,a.links,!0,null,!0,!0,!0),us(this,b,a.Wh,!0,null,!0,!0,!0)):a instanceof I?us(this,b,a.lc,!1,null,!0,!0,!0):us(this,b,a.j,!1,null,!0,!0,!0);return b};D.defineProperty(Ig,{$d:"arrangementOrigin"},function(){return this.qr},function(a){D.l(a,N,Ig,"arrangementOrigin");this.qr.P(a)||(this.qr.assign(a),this.L())});
Ig.prototype.initialOrigin=function(a){var b=this.group;if(null!==b){var c=b.position.copy();(isNaN(c.x)||isNaN(c.y))&&c.set(a);b=b.placeholder;null!==b&&(c=b.gb(ic),(isNaN(c.x)||isNaN(c.y))&&c.set(a),c.x+=b.padding.left,c.y+=b.padding.top);return c}return a};
function ta(){D.xc(this);this.ye=null;if(this.vertexes)for(var a=this.vertexes.j;a.next();){var b=a.value;b.clear();b.network=null}if(this.edges)for(a=this.edges.j;a.next();)b=a.value,b.clear(),b.network=null;this.vertexes=new L(ua);this.edges=new L(va);this.Cy=new ma(H,ua);this.wy=new ma(J,va)}D.ka("LayoutNetwork",ta);
ta.prototype.clear=function(){if(this.vertexes)for(var a=this.vertexes.j;a.next();){var b=a.value;b.clear();b.network=null}if(this.edges)for(a=this.edges.j;a.next();)b=a.value,b.clear(),b.network=null;this.vertexes=new L(ua);this.edges=new L(va);this.Cy=new ma(H,ua);this.wy=new ma(J,va)};
ta.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutNetwork"+(null!==this.$b?"("+this.$b.toString()+")":"");if(0>=a)return b;b+=" vertexes: "+this.vertexes.count+" edges: "+this.edges.count;if(1<a){for(var c=this.vertexes.j;c.next();)b+="\n "+c.value.toString(a-1);for(c=this.edges.j;c.next();)b+="\n "+c.value.toString(a-1)}return b};D.defineProperty(ta,{$b:"layout"},function(){return this.ye},function(a){v&&null!==a&&D.l(a,Ig,ta,"layout");this.ye=a});ta.prototype.createVertex=function(){return new ua};
ta.prototype.createEdge=function(){return new va};
ta.prototype.addParts=ta.prototype.Sk=function(a,b,c){if(null!==a){void 0===b&&(b=!1);D.h(b,"boolean",ta,"addParts:toplevelonly");void 0===c&&(c=null);null===c&&(c=function(a){if(a instanceof H)return!a.Mf;if(a instanceof J){var b=a.Z;if(null===b||b.Mf)return!1;a=a.ba;return null===a||a.Mf?!1:!0}return!1});for(a=a.j;a.next();){var d=a.value;if(d instanceof H&&(!b||d.Fq)&&d.canLayout()&&c(d))if(d instanceof I&&null===d.$b)this.Sk(d.lc,!1);else if(null===this.Yn(d)){var e=this.createVertex();e.ad=d;
this.km(e)}}for(a.reset();a.next();)if(d=a.value,d instanceof J&&(!b||d.Fq)&&d.canLayout()&&c(d)&&null===this.Zx(d)){var g=d.Z,e=d.ba;null!==g&&null!==e&&g!==e&&(g=this.findGroupVertex(g),e=this.findGroupVertex(e),null!==g&&null!==e&&this.Jq(g,e,d))}}};ta.prototype.findGroupVertex=function(a){if(null===a)return null;var b=a.findVisibleNode();if(null===b)return null;a=this.Yn(b);if(null!==a)return a;for(b=b.Ja;null!==b;){a=this.Yn(b);if(null!==a)return a;b=b.Ja}return null};
ta.prototype.addVertex=ta.prototype.km=function(a){if(null!==a){v&&D.l(a,ua,ta,"addVertex:vertex");this.vertexes.add(a);var b=a.ad;null!==b&&this.Cy.add(b,a);a.network=this}};ta.prototype.addNode=ta.prototype.hu=function(a){if(null===a)return null;v&&D.l(a,H,ta,"addNode:node");var b=this.Yn(a);null===b&&(b=this.createVertex(),b.ad=a,this.km(b));return b};
ta.prototype.deleteVertex=ta.prototype.uF=function(a){if(null!==a&&(v&&D.l(a,ua,ta,"deleteVertex:vertex"),ws(this,a))){for(var b=a.Ze,c=b.count-1;0<=c;c--){var d=b.fa(c);this.pq(d)}b=a.Te;for(c=b.count-1;0<=c;c--)d=b.fa(c),this.pq(d)}};function ws(a,b){if(null===b)return!1;var c=a.vertexes.remove(b);c&&(a.Cy.remove(b.ad),b.network=null);return c}ta.prototype.deleteNode=function(a){null!==a&&(v&&D.l(a,H,ta,"deleteNode:node"),a=this.Yn(a),null!==a&&this.uF(a))};
ta.prototype.findVertex=ta.prototype.Yn=function(a){if(null===a)return null;v&&D.l(a,H,ta,"findVertex:node");return this.Cy.oa(a)};ta.prototype.addEdge=ta.prototype.bq=function(a){if(null!==a){v&&D.l(a,va,ta,"addEdge:edge");this.edges.add(a);var b=a.link;null!==b&&null===this.Zx(b)&&this.wy.add(b,a);b=a.toVertex;null!==b&&b.WE(a);b=a.fromVertex;null!==b&&b.UE(a);a.network=this}};
ta.prototype.addLink=function(a){if(null===a)return null;v&&D.l(a,J,ta,"addLink:link");var b=a.Z,c=a.ba,d=this.Zx(a);null===d?(d=this.createEdge(),d.link=a,null!==b&&(d.fromVertex=this.hu(b)),null!==c&&(d.toVertex=this.hu(c)),this.bq(d)):(d.fromVertex=null!==b?this.hu(b):null,d.toVertex=null!==c?this.hu(c):null);return d};ta.prototype.deleteEdge=ta.prototype.pq=function(a){if(null!==a){v&&D.l(a,va,ta,"deleteEdge:edge");var b=a.toVertex;null!==b&&b.tF(a);b=a.fromVertex;null!==b&&b.sF(a);xs(this,a)}};
function xs(a,b){null!==b&&a.edges.remove(b)&&(a.wy.remove(b.link),b.network=null)}ta.prototype.deleteLink=function(a){null!==a&&(v&&D.l(a,J,ta,"deleteLink:link"),a=this.Zx(a),null!==a&&this.pq(a))};ta.prototype.findEdge=ta.prototype.Zx=function(a){if(null===a)return null;v&&D.l(a,J,ta,"findEdge:link");return this.wy.oa(a)};
ta.prototype.linkVertexes=ta.prototype.Jq=function(a,b,c){if(null===a||null===b)return null;v&&(D.l(a,ua,ta,"linkVertexes:fromVertex"),D.l(b,ua,ta,"linkVertexes:toVertex"),null!==c&&D.l(c,J,ta,"linkVertexes:link"));if(a.network===this&&b.network===this){var d=this.createEdge();d.link=c;d.fromVertex=a;d.toVertex=b;this.bq(d);return d}return null};
ta.prototype.reverseEdge=ta.prototype.Qy=function(a){if(null!==a){v&&D.l(a,va,ta,"reverseEdge:edge");var b=a.fromVertex,c=a.toVertex;null!==b&&null!==c&&(b.sF(a),c.tF(a),a.Qy(),b.WE(a),c.UE(a))}};ta.prototype.deleteSelfEdges=ta.prototype.Rx=function(){for(var a=D.hb(),b=this.edges.j;b.next();){var c=b.value;c.fromVertex===c.toVertex&&a.push(c)}b=a.length;for(c=0;c<b;c++)this.pq(a[c]);D.ua(a)};
ta.prototype.deleteArtificialVertexes=function(){for(var a=D.hb(),b=this.vertexes.j;b.next();){var c=b.value;null===c.ad&&a.push(c)}for(var c=a.length,d=0;d<c;d++)this.uF(a[d]);b=D.hb();for(c=this.edges.j;c.next();)d=c.value,null===d.link&&b.push(d);c=b.length;for(d=0;d<c;d++)this.pq(b[d]);D.ua(a);D.ua(b)};function ys(a){for(var b=D.hb(),c=a.edges.j;c.next();){var d=c.value;null!==d.fromVertex&&null!==d.toVertex||b.push(d)}c=b.length;for(d=0;d<c;d++)a.pq(b[d]);D.ua(b)}
ta.prototype.splitIntoSubNetworks=ta.prototype.yK=function(){this.deleteArtificialVertexes();ys(this);this.Rx();for(var a=new K(ta),b=!0;b;)for(var b=!1,c=this.vertexes.j;c.next();){var d=c.value;if(0<d.Ze.count||0<d.Te.count){b=this.$b.createNetwork();a.add(b);zs(this,b,d);b=!0;break}}a.sort(function(a,b){return null===a||null===b||a===b?0:b.vertexes.count-a.vertexes.count});return a};
function zs(a,b,c){if(null!==c&&c.network!==b){ws(a,c);b.km(c);for(var d=c.vc;d.next();){var e=d.value;e.network!==b&&(xs(a,e),b.bq(e),zs(a,b,e.fromVertex))}for(d=c.tc;d.next();)c=d.value,c.network!==b&&(xs(a,c),b.bq(c),zs(a,b,c.toVertex))}}ta.prototype.findAllParts=function(){for(var a=new L(F),b=this.vertexes.j;b.next();)a.add(b.value.ad);for(b=this.edges.j;b.next();)a.add(b.value.link);return a};
function ua(){D.xc(this);this.network=null;this.S=(new C(0,0,10,10)).freeze();this.W=(new N(5,5)).freeze();this.Gd=this.Ud=null;this.Ze=new K(va);this.Te=new K(va)}D.ka("LayoutVertex",ua);ua.prototype.clear=function(){this.Gd=this.Ud=null;this.Ze=new K(va);this.Te=new K(va)};
ua.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutVertex#"+D.Nd(this);if(0<a&&(b+=null!==this.ad?"("+this.ad.toString()+")":"",1<a)){a="";for(var c=!0,d=this.Ze.j;d.next();){var e=d.value;c?c=!1:a+=",";a+=e.toString(0)}e="";c=!0;for(d=this.Te.j;d.next();){var g=d.value;c?c=!1:e+=",";e+=g.toString(0)}b+=" sources: "+a+" destinations: "+e}return b};
D.defineProperty(ua,{data:"data"},function(){return this.Ud},function(a){this.Ud=a;if(null!==a){var b=a.bounds;a=b.x;var c=b.y,d=b.width,b=b.height;this.W.n(d/2,b/2);this.S.n(a,c,d,b)}});
D.defineProperty(ua,{ad:"node"},function(){return this.Gd},function(a){if(this.Gd!==a){v&&null!==a&&D.l(a,H,ua,"node");this.Gd=a;a.Ue();var b=a.Y,c=b.x,d=b.y,e=b.width,b=b.height;isNaN(c)&&(c=0);isNaN(d)&&(d=0);this.S.n(c,d,e,b);if(!(a instanceof I)&&(a=a.Cf.gb(mc),a.F())){this.W.n(a.x-c,a.y-d);return}this.W.n(e/2,b/2)}});D.defineProperty(ua,{lb:"bounds"},function(){return this.S},function(a){this.S.P(a)||(v&&D.l(a,C,ua,"bounds"),this.S.assign(a))});
D.defineProperty(ua,{focus:"focus"},function(){return this.W},function(a){this.W.P(a)||(v&&D.l(a,N,ua,"focus"),this.W.assign(a))});D.defineProperty(ua,{pa:"centerX"},function(){return this.S.x+this.W.x},function(a){var b=this.S;b.x+this.W.x!==a&&(v&&D.p(a,ua,"centerX"),b.Xa(),b.x=a-this.W.x,b.freeze())});D.defineProperty(ua,{wa:"centerY"},function(){return this.S.y+this.W.y},function(a){var b=this.S;b.y+this.W.y!==a&&(v&&D.p(a,ua,"centerY"),b.Xa(),b.y=a-this.W.y,b.freeze())});
D.defineProperty(ua,{Du:"focusX"},function(){return this.W.x},function(a){var b=this.W;b.x!==a&&(b.Xa(),b.x=a,b.freeze())});D.defineProperty(ua,{Eu:"focusY"},function(){return this.W.y},function(a){var b=this.W;b.y!==a&&(b.Xa(),b.y=a,b.freeze())});D.defineProperty(ua,{x:"x"},function(){return this.S.x},function(a){var b=this.S;b.x!==a&&(b.Xa(),b.x=a,b.freeze())});D.defineProperty(ua,{y:"y"},function(){return this.S.y},function(a){var b=this.S;b.y!==a&&(b.Xa(),b.y=a,b.freeze())});
D.defineProperty(ua,{width:"width"},function(){return this.S.width},function(a){var b=this.S;b.width!==a&&(b.Xa(),b.width=a,b.freeze())});D.defineProperty(ua,{height:"height"},function(){return this.S.height},function(a){var b=this.S;b.height!==a&&(b.Xa(),b.height=a,b.freeze())});
ua.prototype.commit=function(){var a=this.Ud;if(null!==a){var b=this.lb,c=a.bounds;D.Qa(c)?(c.x=b.x,c.y=b.y,c.width=b.width,c.height=b.height):a.bounds=b.copy()}else if(a=this.ad,null!==a){b=this.lb;if(!(a instanceof I)){var c=a.Y,d=a.Cf.gb(mc);if(c.F()&&d.F()){a.moveTo(b.x+this.Du-(d.x-c.x),b.y+this.Eu-(d.y-c.y));return}}a.moveTo(b.x,b.y)}};ua.prototype.addSourceEdge=ua.prototype.WE=function(a){null!==a&&(v&&D.l(a,va,ua,"addSourceEdge:edge"),this.Ze.contains(a)||this.Ze.add(a))};
ua.prototype.deleteSourceEdge=ua.prototype.tF=function(a){null!==a&&(v&&D.l(a,va,ua,"deleteSourceEdge:edge"),this.Ze.remove(a))};ua.prototype.addDestinationEdge=ua.prototype.UE=function(a){null!==a&&(v&&D.l(a,va,ua,"addDestinationEdge:edge"),this.Te.contains(a)||this.Te.add(a))};ua.prototype.deleteDestinationEdge=ua.prototype.sF=function(a){null!==a&&(v&&D.l(a,va,ua,"deleteDestinationEdge:edge"),this.Te.remove(a))};
D.w(ua,{xK:"sourceVertexes"},function(){for(var a=new L(ua),b=this.vc;b.next();)a.add(b.value.fromVertex);return a.j});D.w(ua,{AI:"destinationVertexes"},function(){for(var a=new L(ua),b=this.tc;b.next();)a.add(b.value.toVertex);return a.j});D.w(ua,{vertexes:"vertexes"},function(){for(var a=new L(ua),b=this.vc;b.next();)a.add(b.value.fromVertex);for(b=this.tc;b.next();)a.add(b.value.toVertex);return a.j});D.w(ua,{vc:"sourceEdges"},function(){return this.Ze.j});D.w(ua,{tc:"destinationEdges"},function(){return this.Te.j});
D.w(ua,{edges:"edges"},function(){for(var a=new K(va),b=this.vc;b.next();)a.add(b.value);for(b=this.tc;b.next();)a.add(b.value);return a.j});D.w(ua,{LI:"edgesCount"},function(){return this.Ze.count+this.Te.count});var As;ua.standardComparer=As=function(a,b){v&&D.l(a,ua,ua,"standardComparer:m");v&&D.l(b,ua,ua,"standardComparer:n");var c=a.Gd,d=b.Gd;return c?d?(c=c.text,d=d.text,c<d?-1:c>d?1:0):1:null!==d?-1:0};
ua.smartComparer=function(a,b){v&&D.l(a,ua,ua,"smartComparer:m");v&&D.l(b,ua,ua,"smartComparer:n");if(null!==a){if(null!==b){var c=a.Gd,d=b.Gd;if(null!==c){if(null!==d){for(var c=c.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),d=d.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),e=0;e<c.length;e++)if(""!==d[e]&&void 0!==d[e]){var g=parseFloat(c[e]),h=parseFloat(d[e]);if(isNaN(g)){if(!isNaN(h))return 1;if(0!==c[e].localeCompare(d[e]))return c[e].localeCompare(d[e])}else{if(isNaN(h))return-1;
if(0!==g-h)return g-h}}else if(""!==c[e])return 1;return""!==d[e]&&void 0!==d[e]?-1:0}return 1}return null!==d?-1:0}return 1}return null!==b?-1:0};function va(){D.xc(this);this.toVertex=this.fromVertex=this.link=this.data=this.network=null}D.ka("LayoutEdge",va);va.prototype.clear=function(){this.toVertex=this.fromVertex=this.link=this.data=null};
va.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutEdge#"+D.Nd(this);0<a&&(b+=null!==this.link?"("+this.link.toString()+")":"",1<a&&(b+=" "+(this.fromVertex?this.fromVertex.toString():"null")+" --\x3e "+(this.toVertex?this.toVertex.toString():"null")));return b};va.prototype.Qy=function(){var a=this.fromVertex;this.fromVertex=this.toVertex;this.toVertex=a};va.prototype.commit=function(){};
va.prototype.getOtherVertex=va.prototype.WI=function(a){v&&D.l(a,ua,va,"getOtherVertex:v");return this.toVertex===a?this.fromVertex:this.fromVertex===a?this.toVertex:null};function Xn(){0<arguments.length&&D.zd(Xn);Ig.call(this);this.qy=!0;this.cu=this.du=NaN;this.ik=(new Ba(NaN,NaN)).freeze();this.xi=(new Ba(10,10)).freeze();this.we=Bs;this.Bd=Cs;this.wi=Ds;this.fi=Es}D.Ta(Xn,Ig);D.ka("GridLayout",Xn);
Xn.prototype.cloneProtected=function(a){Ig.prototype.cloneProtected.call(this,a);a.du=this.du;a.cu=this.cu;a.ik.assign(this.ik);a.xi.assign(this.xi);a.we=this.we;a.Bd=this.Bd;a.wi=this.wi;a.fi=this.fi};Xn.prototype.qc=function(a){a.Se===Xn?a===Ds||a===Fs||a===Gs||a===Hs?this.sorting=a:a===Cs||a===Is?this.eg=a:a===Bs||a===Js?this.alignment=a:D.k("Unknown enum value: "+a):Ig.prototype.qc.call(this,a)};
Xn.prototype.doLayout=function(a){null===a&&D.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");this.$d=this.initialOrigin(this.$d);var b=this.g;a=this.jI(a);for(var c=a.copy().j;c.next();){var d=c.value;if(d instanceof J){var e=d;if(null!==e.Z||null!==e.ba){a.remove(e);continue}}d.Ue();if(d instanceof I)for(d=d.lc;d.next();)a.remove(d.value)}e=a.Hc();if(0!==e.length){switch(this.sorting){case Hs:e.reverse();break;case Ds:e.sort(this.comparer);
break;case Fs:e.sort(this.comparer),e.reverse()}var g=this.MK;isNaN(g)&&(g=0);var h=this.AH,h=isNaN(h)&&null!==b?Math.max(b.wb.width-b.padding.left-b.padding.right,0):Math.max(this.AH,0);0>=g&&0>=h&&(g=1);a=this.spacing.width;isFinite(a)||(a=0);c=this.spacing.height;isFinite(c)||(c=0);null!==b&&b.Qb("Layout");d=[];switch(this.alignment){case Js:var k=a,l=c,m=Math.max(this.gq.width,1);if(!isFinite(m))for(var n=m=0;n<e.length;n++)var p=e[n],q=p.Ia,m=Math.max(m,q.width);var m=Math.max(m+k,1),r=Math.max(this.gq.height,
1);if(!isFinite(r))for(n=r=0;n<e.length;n++)p=e[n],q=p.Ia,r=Math.max(r,q.height);for(var r=Math.max(r+l,1),s=this.eg,t=this.$d.x,u=t,z=this.$d.y,w=0,y=0,n=0;n<e.length;n++){var p=e[n],q=p.Ia,B=Math.ceil((q.width+k)/m)*m,P=Math.ceil((q.height+l)/r)*r,G=0;switch(s){case Is:G=Math.abs(u-q.width);break;default:G=u+q.width}if(0<g&&w>g-1||0<h&&0<w&&G>h)d.push(new C(0,z,h+k,y)),w=0,u=t,z+=y,y=0;y=Math.max(y,P);P=0;switch(s){case Is:P=-q.width;break;default:P=0}p.moveTo(u+P,z);switch(s){case Is:u-=B;break;
default:u+=B}w++}d.push(new C(0,z,h+k,y));break;case Bs:k=g;l=a;m=c;n=Math.max(this.gq.width,1);p=z=B=0;q=D.O();for(g=0;g<e.length;g++)r=e[g],s=r.Ia,t=mr(r,r.Cf,r.Pf,q),B=Math.max(B,t.x),z=Math.max(z,s.width-t.x),p=Math.max(p,t.y);u=this.eg;switch(u){case Is:B+=l;break;default:z+=l}var n=isFinite(n)?Math.max(n+l,1):Math.max(B+z,1),Q=z=this.$d.x,w=this.$d.y,y=0;h>=B&&(h-=B);for(var B=P=0,G=Math.max(this.gq.height,1),Y=p=0,U=!0,ea=D.O(),g=0;g<e.length;g++){r=e[g];s=r.Ia;t=mr(r,r.Cf,r.Pf,q);if(0<y)switch(u){case Is:Q=
(Q-z-(s.width-t.x))/n;Q=Eb(Math.round(Q),Q)?Math.round(Q):Math.floor(Q);Q=Q*n+z;break;default:Q=(Q-z+t.x)/n,Q=Eb(Math.round(Q),Q)?Math.round(Q):Math.ceil(Q),Q=Q*n+z}else switch(u){case Is:P=Q+t.x+s.width;break;default:P=Q-t.x}var la=0;switch(u){case Is:la=-(Q+t.x)+P;break;default:la=Q+s.width-t.x-P}if(0<k&&y>k-1||0<h&&0<y&&la>h){d.push(new C(0,U?w-p:w,h+l,Y+p+m));for(Q=0;Q<y&&g!==y;Q++){var la=e[g-y+Q],Da=mr(la,la.Cf,la.Pf,ea);la.moveTo(la.position.x,la.position.y+p-Da.y)}Y+=m;w=U?w+Y:w+(Y+p);y=Y=
p=0;Q=z;U=!1}Q===z&&(B=u===Is?Math.max(B,s.width-t.x):Math.min(B,-t.x));p=Math.max(p,t.y);Y=Math.max(Y,s.height-t.y);isFinite(G)&&(Y=Math.max(Y,Math.max(s.height,G)-t.y));U?r.moveTo(Q-t.x,w-t.y):r.moveTo(Q-t.x,w);switch(u){case Is:Q-=t.x+l;break;default:Q+=s.width-t.x+l}y++}d.push(new C(0,w,h+l,(U?Y:Y+p)+m));for(Q=0;Q<y&&g!==y;Q++)la=e[g-y+Q],Da=mr(la,la.Cf,la.Pf,q),la.moveTo(la.position.x,la.position.y+p-Da.y);D.A(q);D.A(ea);if(u===Is)for(g=0;g<d.length;g++)e=d[g],e.width+=B,e.x-=B;else for(g=0;g<
d.length;g++)e=d[g],e.x>B&&(e.width+=e.x-B,e.x=B)}for(k=g=h=e=0;k<d.length;k++)l=d[k],e=Math.min(e,l.x),h=Math.min(h,l.y),g=Math.max(g,l.x+l.width);this.eg===Is?this.commitLayers(d,new N(e+a/2-(g+e),h-c/2)):this.commitLayers(d,new N(e-a/2,h-c/2));null!==b&&b.ld("Layout");this.Af=!0}};Xn.prototype.commitLayers=function(){};D.defineProperty(Xn,{AH:"wrappingWidth"},function(){return this.du},function(a){this.du!==a&&(D.h(a,"number",Xn,"wrappingWidth"),0<a||isNaN(a))&&(this.du=a,this.qy=isNaN(a),this.L())});
D.defineProperty(Xn,{MK:"wrappingColumn"},function(){return this.cu},function(a){this.cu!==a&&(D.h(a,"number",Xn,"wrappingColumn"),0<a||isNaN(a))&&(this.cu=a,this.L())});D.defineProperty(Xn,{gq:"cellSize"},function(){return this.ik},function(a){D.l(a,Ba,Xn,"cellSize");this.ik.P(a)||(this.ik.assign(a),this.L())});D.defineProperty(Xn,{spacing:"spacing"},function(){return this.xi},function(a){D.l(a,Ba,Xn,"spacing");this.xi.P(a)||(this.xi.assign(a),this.L())});
D.defineProperty(Xn,{alignment:"alignment"},function(){return this.we},function(a){this.we!==a&&(D.Da(a,Xn,Xn,"alignment"),a===Bs||a===Js)&&(this.we=a,this.L())});D.defineProperty(Xn,{eg:"arrangement"},function(){return this.Bd},function(a){this.Bd!==a&&(D.Da(a,Xn,Xn,"arrangement"),a===Cs||a===Is)&&(this.Bd=a,this.L())});D.defineProperty(Xn,{sorting:"sorting"},function(){return this.wi},function(a){this.wi!==a&&(D.Da(a,Xn,Xn,"sorting"),a===Gs||a===Hs||a===Ds||a===Fs)&&(this.wi=a,this.L())});
D.defineProperty(Xn,{comparer:"comparer"},function(){return this.fi},function(a){this.fi!==a&&(D.h(a,"function",Xn,"comparer"),this.fi=a,this.L())});var Es;Xn.standardComparer=Es=function(a,b){v&&D.l(a,F,Xn,"standardComparer:a");v&&D.l(b,F,Xn,"standardComparer:b");var c=a.text,d=b.text;return c<d?-1:c>d?1:0};
Xn.smartComparer=function(a,b){v&&D.l(a,F,Xn,"standardComparer:a");v&&D.l(b,F,Xn,"standardComparer:b");if(null!==a){if(null!==b){for(var c=a.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),d=b.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),e=0;e<c.length;e++)if(""!==d[e]&&void 0!==d[e]){var g=parseFloat(c[e]),h=parseFloat(d[e]);if(isNaN(g)){if(!isNaN(h))return 1;if(0!==c[e].localeCompare(d[e]))return c[e].localeCompare(d[e])}else{if(isNaN(h))return-1;
if(0!==g-h)return g-h}}else if(""!==c[e])return 1;return""!==d[e]&&void 0!==d[e]?-1:0}return 1}return null!==b?-1:0};var Js;Xn.Position=Js=D.s(Xn,"Position",0);var Bs;Xn.Location=Bs=D.s(Xn,"Location",1);var Cs;Xn.LeftToRight=Cs=D.s(Xn,"LeftToRight",2);var Is;Xn.RightToLeft=Is=D.s(Xn,"RightToLeft",3);var Gs;Xn.Forward=Gs=D.s(Xn,"Forward",4);var Hs;Xn.Reverse=Hs=D.s(Xn,"Reverse",5);var Ds;Xn.Ascending=Ds=D.s(Xn,"Ascending",6);var Fs;Xn.Descending=Fs=D.s(Xn,"Descending",7);
function Ks(){0<arguments.length&&D.zd(Ks);Ig.call(this);this.Rz=this.cp=this.Vd=0;this.$r=360;this.Qz=Ls;this.Jl=0;this.JC=new N;this.vD=Ls;this.Uv=this.dg=this.JE=0;this.xx=new Ms;this.Vv=this.rn=0;this.NH=600;this.rt=NaN;this.sr=1;this.St=0;this.Ut=360;this.Bd=Ls;this.ga=Ns;this.wi=Os;this.fi=As;this.xi=6;this.ct=Ps}D.Ta(Ks,Ig);D.ka("CircularLayout",Ks);
Ks.prototype.cloneProtected=function(a){Ig.prototype.cloneProtected.call(this,a);a.rt=this.rt;a.sr=this.sr;a.St=this.St;a.Ut=this.Ut;a.Bd=this.Bd;a.ga=this.ga;a.wi=this.wi;a.fi=this.fi;a.xi=this.xi;a.ct=this.ct};Ks.prototype.qc=function(a){if(a.Se===Ks)if(a===Qs||a===Rs||a===Ss||a===Ts||a===Os)this.sorting=a;else if(a===Us||a===Vs||a===Ns||a===Ws)this.direction=a;else if(a===Xs||a===Ys||a===Ls||a===Zs)this.eg=a;else{if(a===$s||a===Ps)this.By=a}else Ig.prototype.qc.call(this,a)};
Ks.prototype.createNetwork=function(){return new at};
Ks.prototype.doLayout=function(a){null===a&&D.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");null===this.network&&(this.network=this.makeNetwork(a));this.$d=this.initialOrigin(this.$d);a=this.network.vertexes;if(1>=a.count)1===a.count&&(a=a.first(),a.pa=0,a.wa=0);else{var b=new K(bt);b.Yc(a.j);a=new K(bt);var c=new K(bt),d;d=this.sort(b);var e=this.Qz,g=this.vD,h=this.Vd,k=this.cp,l=this.Rz,m=this.$r,b=this.Jl,n=this.JE,p=this.dg,q=this.Uv,
e=this.eg,g=this.By,h=this.aK;if(!isFinite(h)||0>=h)h=NaN;k=this.dI;if(!isFinite(k)||0>=k)k=1;l=this.Ne;isFinite(l)||(l=0);m=this.Ef;if(!isFinite(m)||360<m||1>m)m=360;b=this.spacing;isFinite(b)||(b=NaN);e===Zs&&g===$s?e=Ls:e===Zs&&g!==$s&&(g=$s,e=this.eg);if((this.direction===Us||this.direction===Vs)&&this.sorting!==Os){for(var r=0;!(r>=d.length);r+=2){a.add(d.fa(r));if(r+1>=d.length)break;c.add(d.fa(r+1))}this.direction===Us?(this.eg===Zs&&a.reverse(),d=new K(bt),d.Yc(a),d.Yc(c)):(this.eg===Zs&&
c.reverse(),d=new K(bt),d.Yc(c),d.Yc(a))}for(var s=d.length,t=n=0,r=0;r<d.length;r++){var p=l+m*t*(this.direction===Ns?1:-1)/s,u=d.fa(r).diameter;isNaN(u)&&(u=ct(d.fa(r),p));360>m&&(0===r||r===d.length-1)&&(u/=2);n+=u;t++}if(isNaN(h)||e===Zs){isNaN(b)&&(b=6);if(e!==Ls&&e!==Zs){u=-Infinity;for(r=0;r<s;r++){var q=d.fa(r),z=d.fa(r===s-1?0:r+1);isNaN(q.diameter)&&ct(q,0);isNaN(z.diameter)&&ct(z,0);u=Math.max(u,(q.diameter+z.diameter)/2)}q=u+b;e===Xs?(p=2*Math.PI/s,h=(u+b)/p):h=dt(this,q*(360<=m?s:s-1),
k,l*Math.PI/180,m*Math.PI/180)}else h=dt(this,n+(360<=m?s:s-1)*(e!==Zs?b:1.6*b),k,l*Math.PI/180,m*Math.PI/180);p=h*k}else if(p=h*k,t=et(this,h,p,l*Math.PI/180,m*Math.PI/180),isNaN(b)){if(e===Ls||e===Zs)b=(t-n)/(360<=m?s:s-1)}else if(e===Ls||e===Zs)r=(t-n)/(360<=m?s:s-1),r<b?(h=dt(this,n+b*(360<=m?s:s-1),k,l*Math.PI/180,m*Math.PI/180),p=h*k):b=r;else{u=-Infinity;for(r=0;r<s;r++)q=d.fa(r),z=d.fa(r===s-1?0:r+1),isNaN(q.diameter)&&ct(q,0),isNaN(z.diameter)&&ct(z,0),u=Math.max(u,(q.diameter+z.diameter)/
2);q=u+b;r=dt(this,q*(360<=m?s:s-1),k,l*Math.PI/180,m*Math.PI/180);r>h?(h=r,p=h*k):q=t/(360<=m?s:s-1)}this.Qz=e;this.vD=g;this.Vd=h;this.cp=k;this.Rz=l;this.$r=m;this.Jl=b;this.JE=n;this.dg=p;this.Uv=q;b=d;d=this.Qz;e=this.Vd;g=this.Rz;k=this.$r;l=this.Jl;m=this.dg;n=this.Uv;if(this.direction!==Us&&this.direction!==Vs||d!==Zs)if(this.direction===Us||this.direction===Vs){h=0;switch(d){case Ys:h=180*ft(this,e,m,g,n)/Math.PI;break;case Ls:n=b=0;h=a.first();null!==h&&(b=ct(h,Math.PI/2));h=c.first();null!==
h&&(n=ct(h,Math.PI/2));h=180*ft(this,e,m,g,l+(b+n)/2)/Math.PI;break;case Xs:h=k/b.length}if(this.direction===Us){switch(d){case Ys:gt(this,a,g,Ws);break;case Ls:ht(this,a,g,Ws);break;case Xs:it(this,a,k/2,g,Ws)}switch(d){case Ys:gt(this,c,g+h,Ns);break;case Ls:ht(this,c,g+h,Ns);break;case Xs:it(this,c,k/2,g+h,Ns)}}else{switch(d){case Ys:gt(this,c,g,Ws);break;case Ls:ht(this,c,g,Ws);break;case Xs:it(this,c,k/2,g,Ws)}switch(d){case Ys:gt(this,a,g+h,Ns);break;case Ls:ht(this,a,g+h,Ns);break;case Xs:it(this,
a,k/2,g+h,Ns)}}}else switch(d){case Ys:gt(this,b,g,this.direction);break;case Ls:ht(this,b,g,this.direction);break;case Xs:it(this,b,k,g,this.direction);break;case Zs:jt(this,b,k,g,this.direction)}else jt(this,b,k,g-k/2,Ns)}this.updateParts();this.network=null;this.Af=!0};
function it(a,b,c,d,e){var g=a.$r,h=a.Vd;a=a.dg;d=d*Math.PI/180;c=c*Math.PI/180;for(var k=b.length,l=0;l<k;l++){var m=d+(e===Ns?l*c/(360<=g?k:k-1):-(l*c)/k),n=b.fa(l),p=h*Math.tan(m)/a,p=Math.sqrt((h*h+a*a*p*p)/(1+p*p));n.pa=p*Math.cos(m);n.wa=p*Math.sin(m);n.actualAngle=180*m/Math.PI}}
function ht(a,b,c,d){var e=a.Vd,g=a.dg,h=a.Jl;c=c*Math.PI/180;for(var k=b.length,l=0;l<k;l++){var m=b.fa(l),n=b.fa(l===k-1?0:l+1),p=g*Math.sin(c);m.pa=e*Math.cos(c);m.wa=p;m.actualAngle=180*c/Math.PI;isNaN(m.diameter)&&ct(m,0);isNaN(n.diameter)&&ct(n,0);m=ft(a,e,g,d===Ns?c:-c,(m.diameter+n.diameter)/2+h);c+=d===Ns?m:-m}}
function gt(a,b,c,d){var e=a.Vd,g=a.dg,h=a.Uv;c=c*Math.PI/180;for(var k=b.length,l=0;l<k;l++){var m=b.fa(l);m.pa=e*Math.cos(c);m.wa=g*Math.sin(c);m.actualAngle=180*c/Math.PI;m=ft(a,e,g,d===Ns?c:-c,h);c+=d===Ns?m:-m}}function jt(a,b,c,d,e){var g=a.Vv,g=a.$r;a.rn=0;a.xx=new Ms;if(360>c){for(g=d+(e===Ns?g:-g);0>g;)g+=360;g%=360;180<g&&(g-=360);g*=Math.PI/180;a.Vv=g;kt(a,b,c,d,e)}else lt(a,b,c,d,e);a.xx.commit(b)}
function lt(a,b,c,d,e){var g=a.Vd,h=a.Jl,k=a.cp,l=g*Math.cos(d*Math.PI/180),m=a.dg*Math.sin(d*Math.PI/180),n=b.Hc();if(3===n.length)n[0].pa=g,n[0].wa=0,n[1].pa=n[0].pa-n[0].width/2-n[1].width/2-h,n[1].y=n[0].y,n[2].pa=(n[0].pa+n[1].pa)/2,n[2].y=n[0].y-n[2].height-h;else if(4===n.length)n[0].pa=g,n[0].wa=0,n[2].pa=-n[0].pa,n[2].wa=n[0].wa,n[1].pa=0,n[1].y=Math.min(n[0].y,n[2].y)-n[1].height-h,n[3].pa=0,n[3].y=Math.max(n[0].y+n[0].height+h,n[2].y+n[2].height+h);else{for(var g=D.O(),p=0;p<n.length;p++){n[p].pa=
l;n[p].wa=m;if(p>=n.length-1)break;mt(a,l,m,n,p,e,g)||nt(a,l,m,n,p,e,g);l=g.x;m=g.y}D.A(g);a.rn++;if(!(23<a.rn)){var l=n[0].pa,m=n[0].wa,g=n[n.length-1].pa,p=n[n.length-1].wa,q=Math.abs(l-g)-((n[0].width+n[n.length-1].width)/2+h),r=Math.abs(m-p)-((n[0].height+n[n.length-1].height)/2+h),h=0;1>Math.abs(r)?Math.abs(l-g)<(n[0].width+n[n.length-1].width)/2&&(h=0):h=0<r?r:1>Math.abs(q)?0:q;q=!1;q=Math.abs(g)>Math.abs(p)?0<g!==m>p:0<p!==l<g;if(q=e===Ns?q:!q)h=-Math.abs(h),h=Math.min(h,-n[n.length-1].width),
h=Math.min(h,-n[n.length-1].height);a.xx.compare(h,n);1<Math.abs(h)&&(a.Vd=8>a.rn?a.Vd-h/(2*Math.PI):5>n.length&&10<h?a.Vd/2:a.Vd-(0<h?1.7:-2.3),a.dg=a.Vd*k,lt(a,b,c,d,e))}}}
function kt(a,b,c,d,e){for(var g=a.Vd,h=a.dg,k=a.cp,l=g*Math.cos(d*Math.PI/180),m=h*Math.sin(d*Math.PI/180),n=D.O(),p=b.Hc(),q=0;q<p.length;q++){p[q].pa=l;p[q].wa=m;if(q>=p.length-1)break;mt(a,l,m,p,q,e,n)||nt(a,l,m,p,q,e,n);l=n.x;m=n.y}D.A(n);a.rn++;if(!(23<a.rn)){l=Math.atan2(m,l);l=e===Ns?a.Vv-l:l-a.Vv;l=Math.abs(l)<Math.abs(l-2*Math.PI)?l:l-2*Math.PI;g=l*(g+h)/2;h=a.xx;if(Math.abs(g)<Math.abs(h.uq))for(h.uq=g,h.Ho=[],h.gr=[],l=0;l<p.length;l++)h.Ho[l]=p[l].lb.x,h.gr[l]=p[l].lb.y;1<Math.abs(g)&&
(a.Vd=8>a.rn?a.Vd-g/(2*Math.PI):a.Vd-(0<g?1.7:-2.3),a.dg=a.Vd*k,kt(a,b,c,d,e))}}function mt(a,b,c,d,e,g,h){var k=a.Vd,l=a.dg,m=0,n=0;a=(d[e].width+d[e+1].width)/2+a.Jl;var p=!1;if(0<=c!==(g===Ns)){if(m=b+a,m>k){m=b-a;if(m<-k)return h.x=m,h.y=n,!1;p=!0}}else if(m=b-a,m<-k){m=b+a;if(m>k)return h.x=m,h.y=n,!1;p=!0}n=Math.sqrt(1-Math.min(1,m*m/(k*k)))*l;0>c!==p&&(n=-n);if(Math.abs(c-n)>(d[e].height+d[e+1].height)/2)return h.x=m,h.y=n,!1;h.x=m;h.y=n;return!0}
function nt(a,b,c,d,e,g,h){var k=a.Vd,l=a.dg,m=0,n=0;a=(d[e].height+d[e+1].height)/2+a.Jl;d=!1;if(0<=b!==(g===Ns)){if(n=c-a,n<-l){n=c+a;if(n>l){h.x=m;h.y=n;return}d=!0}}else if(n=c+a,n>l){n=c-a;if(n<-l){h.x=m;h.y=n;return}d=!0}m=Math.sqrt(1-Math.min(1,n*n/(l*l)))*k;0>b!==d&&(m=-m);h.x=m;h.y=n}Ks.prototype.commitLayout=function(){this.commitNodes();this.Tu&&this.commitLinks()};
Ks.prototype.commitNodes=function(){var a=this.WH,b=null!==this.group&&null!==this.group.placeholder&&this.group.nd,c=b?this.group.location.copy():null;b?a=new N(0,0):(a.x=this.$d.x+this.Vd,a.y=this.$d.y+this.dg);for(var d=this.network.vertexes.j;d.next();){var e=d.value;e.x+=a.x;e.y+=a.y;e.commit()}b&&(this.group.Ue(),a=this.group.position.copy(),b=this.group.location.copy(),c=c.Mi(b.Mi(a)),this.group.move(c),this.JC=c.Mi(a))};Ks.prototype.commitLinks=function(){for(var a=this.network.edges.j;a.next();)a.value.commit()};
function et(a,b,c,d,e){var g=a.NH;if(.001>Math.abs(a.cp-1))return void 0!==d&&void 0!==e?e*b:2*Math.PI*b;a=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c;for(var h=0,k=0,k=void 0!==d&&void 0!==e?e/(g+1):Math.PI/(2*(g+1)),l=0,m=0;m<=g;m++)l=void 0!==d&&void 0!==e?d+m*e/g:m*Math.PI/(2*g),l=Math.sin(l),h+=Math.sqrt(1-a*a*l*l)*k;return void 0!==d&&void 0!==e?(b>c?b:c)*h:4*(b>c?b:c)*h}function dt(a,b,c,d,e){var g=0,g=void 0!==d&&void 0!==e?et(a,1,c,d,e):et(a,1,c);return b/g}
function ft(a,b,c,d,e){if(.001>Math.abs(a.cp-1))return e/b;var g=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c,h=0;a=2*Math.PI/(700*a.network.vertexes.count);b>c&&(d+=Math.PI/2);for(var k=0;;k++){var l=Math.sin(d+k*a),h=h+(b>c?b:c)*Math.sqrt(1-g*g*l*l)*a;if(h>=e)return k*a}}
Ks.prototype.sort=function(a){switch(this.sorting){case Ss:break;case Ts:a.reverse();break;case Qs:a.sort(this.comparer);break;case Rs:a.sort(this.comparer);a.reverse();break;case Os:for(var b=[],c=0;c<a.length;c++)b.push(0);for(var d=new K(bt),c=0;c<a.length;c++){var e=-1,g=-1;if(0===c)for(var h=0;h<a.length;h++){var k=a.fa(h).LI;k>e&&(e=k,g=h)}else for(h=0;h<a.length;h++)k=b[h],k>e&&(e=k,g=h);d.add(a.fa(g));b[g]=-1;g=a.fa(g);e=0;for(h=g.vc;h.next();)e=a.indexOf(h.value.fromVertex),0>e||0<=b[e]&&
b[e]++;for(g=g.tc;g.next();)e=a.indexOf(g.value.toVertex),0>e||0<=b[e]&&b[e]++}a=[];for(g=0;g<d.length;g++){b=d.fa(g);a[g]=[];for(var l=0,c=b.tc;c.next();)l=d.indexOf(c.value.toVertex),l!==g&&0>a[g].indexOf(l)&&a[g].push(l);for(b=b.vc;b.next();)l=d.indexOf(b.value.fromVertex),l!==g&&0>a[g].indexOf(l)&&a[g].push(l)}h=[];for(g=0;g<a.length;g++)h[g]=0;for(var b=[],k=[],m=[],c=[],e=new K(bt),n=0,g=0;g<a.length;g++){var p=a[g].length;if(1===p)c.push(g);else if(0===p)e.add(d.fa(g));else{if(0===n)b.push(g);
else{for(var q=Infinity,r=Infinity,s=-1,t=[],p=0;p<b.length;p++)0>a[b[p]].indexOf(b[p===b.length-1?0:p+1])&&t.push(p===b.length-1?0:p+1);if(0===t.length)for(p=0;p<b.length;p++)t.push(p);for(p=0;p<t.length;p++){var u=t[p],z,l=a[g];z=k;for(var w=m,y=h,B=u,P=b,G=0,Q=0;Q<z.length;Q++){var Y=y[z[Q]],U=y[w[Q]],ea=0,la=0;Y<U?(ea=Y,la=U):(ea=U,la=Y);if(ea<B&&B<=la)for(Y=0;Y<l.length;Y++)U=l[Y],0>P.indexOf(U)||ea<y[U]&&y[U]<la||ea===y[U]||la===y[U]||G++;else for(Y=0;Y<l.length;Y++)U=l[Y],0>P.indexOf(U)||ea<
y[U]&&y[U]<la&&ea!==y[U]&&la!==y[U]&&G++}z=G;for(y=w=0;y<a[g].length;y++)l=b.indexOf(a[g][y]),0<=l&&(l=Math.abs(u-(l>=u?l+1:l)),w+=l<b.length+1-l?l:b.length+1-l);for(y=0;y<k.length;y++)l=h[k[y]],B=h[m[y]],l>=u&&l++,B>=u&&B++,l>B&&(P=B,B=l,l=P),B-l<(b.length+2)/2===(l<u&&u<=B)&&w++;if(z<q||z===q&&w<r)q=z,r=w,s=u}b.splice(s,0,g);for(p=0;p<b.length;p++)h[b[p]]=p;for(p=0;p<a[g].length;p++)q=a[g][p],0<=b.indexOf(q)&&(k.push(g),m.push(q))}n++}}g=!1;for(h=b.length;;){g=!0;for(k=0;k<c.length;k++)if(m=c[k],
n=a[m][0],l=b.indexOf(n),0<=l){for(r=p=0;r<a[n].length;r++)q=a[n][r],q=b.indexOf(q),0>q||q===l||(s=q>l?q-l:l-q,p+=q<l!==s>h-s?1:-1);b.splice(0>p?l:l+1,0,m);c.splice(k,1);k--}else g=!1;if(g)break;else b.push(c[0]),c.splice(0,1)}for(g=0;g<b.length;g++)e.add(d.fa(b[g]));return e;default:D.k("Invalid sorting type.")}return a};D.defineProperty(Ks,{aK:"radius"},function(){return this.rt},function(a){this.rt!==a&&(D.h(a,"number",Ks,"radius"),0<a||isNaN(a))&&(this.rt=a,this.L())});
D.defineProperty(Ks,{dI:"aspectRatio"},function(){return this.sr},function(a){this.sr!==a&&(D.h(a,"number",Ks,"aspectRatio"),0<a&&(this.sr=a,this.L()))});D.defineProperty(Ks,{Ne:"startAngle"},function(){return this.St},function(a){this.St!==a&&(D.h(a,"number",Ks,"startAngle"),this.St=a,this.L())});D.defineProperty(Ks,{Ef:"sweepAngle"},function(){return this.Ut},function(a){this.Ut!==a&&(D.h(a,"number",Ks,"sweepAngle"),this.Ut=0<a&&360>=a?a:360,this.L())});
D.defineProperty(Ks,{eg:"arrangement"},function(){return this.Bd},function(a){this.Bd!==a&&(D.Da(a,Ks,Ks,"arrangement"),a===Zs||a===Ls||a===Ys||a===Xs)&&(this.Bd=a,this.L())});D.defineProperty(Ks,{direction:"direction"},function(){return this.ga},function(a){this.ga!==a&&(D.Da(a,Ks,Ks,"direction"),a===Ns||a===Ws||a===Us||a===Vs)&&(this.ga=a,this.L())});
D.defineProperty(Ks,{sorting:"sorting"},function(){return this.wi},function(a){this.wi!==a&&(D.Da(a,Ks,Ks,"sorting"),a===Ss||a===Ts||a===Qs||Rs||a===Os)&&(this.wi=a,this.L())});D.defineProperty(Ks,{comparer:"comparer"},function(){return this.fi},function(a){this.fi!==a&&(D.h(a,"function",Ks,"comparer"),this.fi=a,this.L())});D.defineProperty(Ks,{spacing:"spacing"},function(){return this.xi},function(a){this.xi!==a&&(D.h(a,"number",Ks,"spacing"),this.xi=a,this.L())});
D.defineProperty(Ks,{By:"nodeDiameterFormula"},function(){return this.ct},function(a){this.ct!==a&&(D.Da(a,Ks,Ks,"nodeDiameterFormula"),a===Ps||a===$s)&&(this.ct=a,this.L())});D.w(Ks,{PK:"actualXRadius"},function(){return this.Vd});D.w(Ks,{QK:"actualYRadius"},function(){return this.dg});D.w(Ks,{OK:"actualSpacing"},function(){return this.Jl});D.w(Ks,{WH:"actualCenter"},function(){return this.JC});var Ls;Ks.ConstantSpacing=Ls=D.s(Ks,"ConstantSpacing",0);var Ys;
Ks.ConstantDistance=Ys=D.s(Ks,"ConstantDistance",1);var Xs;Ks.ConstantAngle=Xs=D.s(Ks,"ConstantAngle",2);var Zs;Ks.Packed=Zs=D.s(Ks,"Packed",3);var Ns;Ks.Clockwise=Ns=D.s(Ks,"Clockwise",4);var Ws;Ks.Counterclockwise=Ws=D.s(Ks,"Counterclockwise",5);var Us;Ks.BidirectionalLeft=Us=D.s(Ks,"BidirectionalLeft",6);var Vs;Ks.BidirectionalRight=Vs=D.s(Ks,"BidirectionalRight",7);var Ss;Ks.Forwards=Ss=D.s(Ks,"Forwards",8);var Ts;Ks.Reverse=Ts=D.s(Ks,"Reverse",9);var Qs;Ks.Ascending=Qs=D.s(Ks,"Ascending",10);
var Rs;Ks.Descending=Rs=D.s(Ks,"Descending",11);var Os;Ks.Optimized=Os=D.s(Ks,"Optimized",12);var Ps;Ks.Pythagorean=Ps=D.s(Ks,"Pythagorean",13);var $s;Ks.Circular=$s=D.s(Ks,"Circular",14);function Ms(){this.uq=-Infinity;this.gr=this.Ho=null}Ms.prototype.compare=function(a,b){if(0<a&&0>this.uq||Math.abs(a)<Math.abs(this.uq)&&!(0>a&&0<this.uq)){this.uq=a;this.Ho=[];this.gr=[];for(var c=0;c<b.length;c++)this.Ho[c]=b[c].lb.x,this.gr[c]=b[c].lb.y}};
Ms.prototype.commit=function(a){if(null!==this.Ho&&null!==this.gr)for(var b=0;b<this.Ho.length;b++){var c=a.fa(b);c.x=this.Ho[b];c.y=this.gr[b]}};function at(){ta.call(this)}D.Ta(at,ta);D.ka("CircularNetwork",at);at.prototype.createVertex=function(){return new bt};at.prototype.createEdge=function(){return new ot};function bt(){ua.call(this);this.actualAngle=this.diameter=NaN}D.Ta(bt,ua);D.ka("CircularVertex",bt);
function ct(a,b){var c=a.network;if(null===c)return NaN;c=c.$b;if(null===c)return NaN;if(c.eg===Zs)if(c.By===$s)a.diameter=Math.max(a.width,a.height);else{var c=Math.abs(Math.sin(b)),d=Math.abs(Math.cos(b));if(0===c)return a.width;if(0===d)return a.height;a.diameter=Math.min(a.height/c,a.width/d)}else a.diameter=c.By===$s?Math.max(a.width,a.height):Math.sqrt(a.width*a.width+a.height*a.height);return a.diameter}function ot(){va.call(this)}D.Ta(ot,va);D.ka("CircularEdge",ot);
function pt(){0<arguments.length&&D.zd(pt);Ig.call(this);this.Ug=null;this.Cs=0;this.xg=(new Ba(100,100)).freeze();this.rr=!1;this.vi=!0;this.ei=!1;this.Cp=100;this.cs=1;this.fj=1E3;this.Xs=10;this.st=Math;this.$o=.05;this.Zo=50;this.Xo=150;this.Yo=0;this.Qr=10;this.Pr=5}D.Ta(pt,Ig);D.ka("ForceDirectedLayout",pt);
pt.prototype.cloneProtected=function(a){Ig.prototype.cloneProtected.call(this,a);a.xg.assign(this.xg);a.rr=this.rr;a.vi=this.vi;a.ei=this.ei;a.Cp=this.Cp;a.cs=this.cs;a.fj=this.fj;a.Xs=this.Xs;a.st=this.st;a.$o=this.$o;a.Zo=this.Zo;a.Xo=this.Xo;a.Yo=this.Yo;a.Qr=this.Qr;a.Pr=this.Pr};pt.prototype.createNetwork=function(){return new qt};
pt.prototype.doLayout=function(a){null===a&&D.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");null===this.network&&(this.network=this.makeNetwork(a));a=this.FB;if(0<this.network.vertexes.count){this.network.Rx();for(var b=this.network.vertexes.j;b.next();){var c=b.value;c.charge=this.electricalCharge(c);c.mass=this.gravitationalMass(c)}for(b=this.network.edges.j;b.next();)c=b.value,c.stiffness=this.springStiffness(c),c.length=this.springLength(c);
this.LA();this.Cs=0;if(this.needsClusterLayout()){b=this.network;for(c=b.yK().j;c.next();){this.network=c.value;for(var d=this.network.vertexes.j;d.next();){var e=d.value;e.sg=e.vertexes.count;e.ml=1;e.On=null;e.$h=null}rt(this,0,a)}this.network=b;c.reset();v&&D.l(b,qt,pt,"arrangeConnectedGraphs:singletons");for(var d=this.bF,g=c.count,h=!0,k=e=0,l=D.hb(),m=0;m<g+b.vertexes.count+2;m++)l[m]=null;g=0;c.reset();for(var n=D.Ff();c.next();)if(m=c.value,this.computeBounds(m,n),h)h=!1,e=n.x+n.width/2,k=
n.y+n.height/2,l[0]=new N(n.x+n.width+d.width,n.y),l[1]=new N(n.x,n.y+n.height+d.height),g=2;else{var p=st(l,g,e,k,n.width,n.height,d),q=l[p],r=new N(q.x+n.width+d.width,q.y),s=new N(q.x,q.y+n.height+d.height);p+1<g&&l.splice(p+1,0,null);l[p]=r;l[p+1]=s;g++;p=q.x-n.x;q=q.y-n.y;for(m=m.vertexes.j;m.next();)r=m.value,r.pa+=p,r.wa+=q}D.Hb(n);for(m=b.vertexes.j;m.next();)h=m.value,n=h.lb,2>g?(e=n.x+n.width/2,k=n.y+n.height/2,l[0]=new N(n.x+n.width+d.width,n.y),l[1]=new N(n.x,n.y+n.height+d.height),g=
2):(p=st(l,g,e,k,n.width,n.height,d),q=l[p],r=new N(q.x+n.width+d.width,q.y),s=new N(q.x,q.y+n.height+d.height),p+1<g&&l.splice(p+1,0,null),l[p]=r,l[p+1]=s,g++,h.pa=q.x+h.width/2,h.wa=q.y+h.height/2);D.ua(l);for(c.reset();c.next();){d=c.value;for(e=d.vertexes.j;e.next();)b.km(e.value);for(d=d.edges.j;d.next();)b.bq(d.value)}}Ct(this,a);this.updateParts()}this.Cp=a;this.network=null;this.Af=!0};
pt.prototype.needsClusterLayout=function(){if(3>this.network.vertexes.count)return!1;for(var a=0,b=0,c=this.network.vertexes.first().lb,d=this.network.vertexes.j;d.next();){if(d.value.lb.kg(c)&&(a++,2<a))return!0;if(10<b)break;b++}return!1};pt.prototype.computeBounds=function(a,b){for(var c=!0,d=a.vertexes.j;d.next();){var e=d.value;c?(c=!1,b.set(e.lb)):b.lh(e.lb)}return b};
function ju(a,b,c){v&&(D.p(b,pt,"computeClusterLayoutIterations:level"),D.p(c,pt,"computeClusterLayoutIterations:maxiter"));return Math.max(Math.min(a.network.vertexes.count,c*(b+1)/11),10)}
function rt(a,b,c){v&&(D.p(b,pt,"layoutClusters:level"),D.p(c,pt,"layoutClusters:maxiter"));if(ku(a,b)){var d=a.fj;a.fj*=1+1/(b+1);var e=lu(a,b),g=Math.max(0,ju(a,b,c));a.FB+=g;rt(a,b+1,c);Ct(a,g);mu(a,e,b);c=a.Ug;null===c?c=new K(nu):c.clear();c.Yc(e.vertexes);c.sort(function(a,b){return null===a||null===b||a===b?0:b.sg-a.sg});for(e=c.j;e.next();)ou(a,e.value,b);a.fj=d}}
function ku(a,b){v&&D.p(b,pt,"hasClusters:level");if(10<b||3>a.network.vertexes.count)return!1;null===a.Ug?a.Ug=new K(nu):a.Ug.clear();a.Ug.Yc(a.network.vertexes);var c=a.Ug;c.sort(function(a,b){return null===a||null===b||a===b?0:b.sg-a.sg});for(var d=c.count-1;0<=d&&1>=c.fa(d).sg;)d--;return 1<c.count-d}
function lu(a,b){v&&D.p(b,pt,"pushSubNetwork:level");for(var c=a.network,d=new qt,e=a.Ug.j;e.next();){var g=e.value;if(1<g.sg){d.km(g);var h=new pu;h.hz=g.sg;h.iz=g.width;h.gz=g.height;h.CC=g.W.x;h.DC=g.W.y;null===g.$h&&(g.$h=new K(pu));g.$h.add(h);g.ZB=g.$h.count-1}else break}for(var k=c.edges.j;k.next();)if(h=k.value,e=h.fromVertex,g=h.toVertex,e.network===d&&g.network===d)d.bq(h);else if(e.network===d){var l=e.On;null===l&&(l=new K(nu),e.On=l);l.add(g);e.sg--;e.ml+=g.ml}else g.network===d&&(l=
g.On,null===l&&(l=new K(nu),g.On=l),l.add(e),g.sg--,g.ml+=e.ml);for(e=d.edges.j;e.next();)g=e.value,g.length*=Math.max(1,oe((g.fromVertex.ml+g.toVertex.ml)/(4*b+1)));for(e=d.vertexes.j;e.next();)if(g=e.value,l=g.On,null!==l&&0<l.count&&(h=g.$h.fa(g.$h.count-1),h=h.hz-g.sg,!(0>=h))){for(var m=0,n=0,p=l.count-h;p<l.count;p++){for(var q=l.fa(p),r=null,k=q.edges.j;k.next();){var s=k.value;if(s.WI(q)===g){r=s;break}}null!==r&&(n+=r.length,m+=q.width*q.height)}k=g.pa;l=g.wa;p=g.width;q=g.height;r=g.W;s=
p*q;1>s&&(s=1);m=oe((m+s+n*n*4/(h*h))/s);h=(m-1)*p/2;m=(m-1)*q/2;g.lb=new C(k-r.x-h,l-r.y-m,p+2*h,q+2*m);g.focus=new N(r.x+h,r.y+m)}a.network=d;return c}function mu(a,b,c){v&&(D.l(b,qt,pt,"popNetwork:oldnet"),D.p(c,pt,"popNetwork:level"));for(c=a.network.vertexes.j;c.next();){var d=c.value;d.network=b;if(null!==d.$h){var e=d.$h.fa(d.ZB);d.sg=e.hz;var g=e.CC,h=e.DC;d.lb=new C(d.pa-g,d.wa-h,e.iz,e.gz);d.focus=new N(g,h);d.ZB--}}for(c=a.network.edges.j;c.next();)c.value.network=b;a.network=b}
function ou(a,b,c){v&&(D.l(b,nu,pt,"surroundNode:oldnet"),D.p(c,pt,"surroundNode:level"));var d=b.On;if(null!==d&&0!==d.count){c=b.pa;var e=b.wa,g=b.width,h=b.height;null!==b.$h&&0<b.$h.count&&(h=b.$h.fa(0),g=h.iz,h=h.gz);for(var g=oe(g*g+h*h)/2,k=!1,l=h=0,m=0,n=b.vertexes.j;n.next();){var p=n.value;1>=p.sg?l++:(k=!0,m++,h+=Math.atan2(b.wa-p.wa,b.pa-p.pa))}if(0!==l)for(0<m&&(h/=m),m=b=0,b=k?2*Math.PI/(l+1):2*Math.PI/l,0===l%2&&(m=b/2),1<d.count&&d.sort(function(a,b){return null===a||null===b||a===
b?0:b.width*b.height-a.width*a.height}),k=0===l%2?0:1,d=d.j;d.next();)if(l=d.value,!(1<l.sg||a.isFixed(l))){n=null;for(p=l.edges.j;p.next();){n=p.value;break}var p=l.width,q=l.height,p=oe(p*p+q*q)/2,n=g+n.length+p,p=h+(b*(k/2>>1)+m)*(0===k%2?1:-1);l.pa=c+n*Math.cos(p);l.wa=e+n*Math.sin(p);k++}}}
function st(a,b,c,d,e,g,h){var k=9E19,l=-1,m=0;a:for(;m<b;m++){var n=a[m],p=n.x-c,q=n.y-d,p=p*p+q*q;if(p<k){for(q=m-1;0<=q;q--)if(a[q].y>n.y&&a[q].x-n.x<e+h.width)continue a;for(q=m+1;q<b;q++)if(a[q].x>n.x&&a[q].y-n.y<g+h.height)continue a;l=m;k=p}}return l}pt.prototype.LA=function(){if(this.comments)for(var a=this.network.vertexes.j;a.next();)this.addComments(a.value)};
pt.prototype.addComments=function(a){var b=a.ad;if(null!==b)for(b=b.FF();b.next();){var c=b.value;if("Comment"===c.wd&&c.isVisible()){var d=this.network.Yn(c);null===d&&(d=this.network.hu(c));d.charge=this.wI;for(var c=null,e=d.tc;e.next();){var g=e.value;if(g.toVertex===a){c=g;break}}if(null===c)for(e=d.vc;e.next();)if(g=e.value,g.fromVertex===a){c=g;break}null===c&&(c=this.network.Jq(a,d,null));c.length=this.xI}}};
function qu(a,b){v&&(D.l(a,nu,pt,"getNodeDistance:vertexA"),D.l(b,nu,pt,"getNodeDistance:vertexB"));var c=a.S,d=c.x,e=c.y,g=c.width,c=c.height,h=b.S,k=h.x,l=h.y,m=h.width,h=h.height;return d+g<k?e>l+h?(d=d+g-k,e=e-l-h,oe(d*d+e*e)):e+c<l?(d=d+g-k,e=e+c-l,oe(d*d+e*e)):k-(d+g):d>k+m?e>l+h?(d=d-k-m,e=e-l-h,oe(d*d+e*e)):e+c<l?(d=d-k-m,e=e+c-l,oe(d*d+e*e)):d-(k+m):e>l+h?e-(l+h):e+c<l?l-(e+c):.1}
function Ct(a,b){v&&D.p(b,pt,"performIterations:num");a.Ug=null;for(var c=a.Cs+b;a.Cs<c&&(a.Cs++,ru(a)););a.Ug=null}
function ru(a){null===a.Ug&&(a.Ug=new K(nu),a.Ug.Yc(a.network.vertexes));var b=a.Ug.o;if(0>=b.length)return!1;var c=b[0];c.forceX=0;c.forceY=0;for(var d=c.pa,e=d,g=c.wa,h=g,c=1;c<b.length;c++){var k=b[c];k.forceX=0;k.forceY=0;var l=k.pa,k=k.wa,d=Math.min(d,l),e=Math.max(e,l),g=Math.min(g,k),h=Math.max(h,k)}(g=e-d>h-g)?b.sort(function(a,b){return null===a||null===b||a===b?0:a.pa-b.pa}):b.sort(function(a,b){return null===a||null===b||a===b?0:a.wa-b.wa});for(var h=a.fj,m=0,n=0,p=0,c=0;c<b.length;c++){var k=
b[c],l=k.S,q=k.W,d=l.x+q.x,l=l.y+q.y,n=k.charge*a.electricalFieldX(d,l),p=k.charge*a.electricalFieldY(d,l),n=n+k.mass*a.gravitationalFieldX(d,l),p=p+k.mass*a.gravitationalFieldY(d,l);k.forceX+=n;k.forceY+=p;for(q=c+1;q<b.length;q++)if(e=b[q],e!==k){var r=e.S,n=e.W,p=r.x+n.x,r=r.y+n.y;if(d-p>h||p-d>h){if(g)break}else if(l-r>h||r-l>h){if(!g)break}else{var s=qu(k,e);1>s?(n=a.Ky,null===n&&(a.Ky=n=new Ha(0)),m=n.random(),s=n.random(),d>p?(n=Math.abs(e.S.right-k.S.x),n=(1+n)*m):d<p?(n=Math.abs(e.S.x-k.S.right),
n=-(1+n)*m):(n=Math.max(e.width,k.width),n=(1+n)*m-n/2),l>r?(p=Math.abs(e.S.bottom-k.S.y),p=(1+p)*s):d<p?(p=Math.abs(e.S.y-k.S.bottom),p=-(1+p)*s):(p=Math.max(e.height,k.height),p=(1+p)*s-p/2)):(m=-(k.charge*e.charge)/(s*s),n=(p-d)/s*m,p=(r-l)/s*m);k.forceX+=n;k.forceY+=p;e.forceX-=n;e.forceY-=p}}}for(c=a.network.edges.j;c.next();)g=c.value,k=g.fromVertex,e=g.toVertex,l=k.S,q=k.W,d=l.x+q.x,l=l.y+q.y,r=e.S,n=e.W,p=r.x+n.x,r=r.y+n.y,s=qu(k,e),1>s?(n=a.Ky,null===n&&(a.Ky=n=new Ha(0)),m=n.random(),s=
n.random(),n=(d>p?1:-1)*(1+(e.width>k.width?e.width:k.width))*m,p=(l>r?1:-1)*(1+(e.height>k.height?e.height:k.height))*s):(m=g.stiffness*(s-g.length),n=(p-d)/s*m,p=(r-l)/s*m),k.forceX+=n,k.forceY+=p,e.forceX-=n,e.forceY-=p;c=0;d=a.UJ;for(e=0;e<b.length;e++)k=b[e],a.isFixed(k)?a.moveFixedVertex(k):(g=k.forceX,h=k.forceY,g<-d?g=-d:g>d&&(g=d),h<-d?h=-d:h>d&&(h=d),k.pa+=g,k.wa+=h,c=Math.max(c,g*g+h*h));return c>a.CF*a.CF}pt.prototype.moveFixedVertex=function(){};
pt.prototype.commitLayout=function(){this.eC();this.commitNodes();this.Tu&&this.commitLinks()};pt.prototype.eC=function(){if(this.ar)for(var a=this.network.edges.j;a.next();){var b=a.value.link;null!==b&&(b.Ib=Vc,b.Jb=Vc)}};pt.prototype.commitNodes=function(){var a=0,b=0;if(this.cI){var c=D.Ff();this.computeBounds(this.network,c);b=this.$d;a=b.x-c.x;b=b.y-c.y;D.Hb(c)}for(var c=D.Ff(),d=this.network.vertexes.j;d.next();){var e=d.value;if(0!==a||0!==b)c.assign(e.lb),c.x+=a,c.y+=b,e.lb=c;e.commit()}D.Hb(c)};
pt.prototype.commitLinks=function(){for(var a=this.network.edges.j;a.next();)a.value.commit()};pt.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.$o:a};pt.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.Zo:a};pt.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.Xo:a};pt.prototype.electricalFieldX=function(){return 0};pt.prototype.electricalFieldY=function(){return 0};
pt.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.Yo:a};pt.prototype.gravitationalFieldX=function(){return 0};pt.prototype.gravitationalFieldY=function(){return 0};pt.prototype.isFixed=function(a){return a.isFixed};D.w(pt,{vL:"currentIteration"},function(){return this.Cs});D.defineProperty(pt,{bF:"arrangementSpacing"},function(){return this.xg},function(a){D.l(a,Ba,pt,"arrangementSpacing");this.xg.P(a)||(this.xg.assign(a),this.L())});
D.defineProperty(pt,{cI:"arrangesToOrigin"},function(){return this.rr},function(a){this.rr!==a&&(D.h(a,"boolean",pt,"arrangesToOrigin"),this.rr=a,this.L())});D.defineProperty(pt,{ar:"setsPortSpots"},function(){return this.vi},function(a){this.vi!==a&&(D.h(a,"boolean",pt,"setsPortSpots"),this.vi=a,this.L())});D.defineProperty(pt,{comments:"comments"},function(){return this.ei},function(a){this.ei!==a&&(D.h(a,"boolean",pt,"comments"),this.ei=a,this.L())});
D.defineProperty(pt,{FB:"maxIterations"},function(){return this.Cp},function(a){this.Cp!==a&&(D.h(a,"number",pt,"maxIterations"),0<=a&&(this.Cp=a,this.L()))});D.defineProperty(pt,{CF:"epsilonDistance"},function(){return this.cs},function(a){this.cs!==a&&(D.h(a,"number",pt,"epsilonDistance"),0<a&&(this.cs=a,this.L()))});D.defineProperty(pt,{UL:"infinityDistance"},function(){return this.fj},function(a){this.fj!==a&&(D.h(a,"number",pt,"infinityDistance"),1<a&&(this.fj=a,this.L()))});
D.defineProperty(pt,{UJ:"moveLimit"},function(){return this.Xs},function(a){this.Xs!==a&&(D.h(a,"number",pt,"moveLimit"),1<a&&(this.Xs=a,this.L()))});D.defineProperty(pt,{Ky:"randomNumberGenerator"},function(){return this.st},function(a){this.st!==a&&(null!==a&&"function"!==typeof a.random&&D.k('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: '+a),this.st=a)});
D.defineProperty(pt,{HL:"defaultSpringStiffness"},function(){return this.$o},function(a){this.$o!==a&&(D.h(a,"number",pt,"defaultSpringStiffness"),this.$o=a,this.L())});D.defineProperty(pt,{GL:"defaultSpringLength"},function(){return this.Zo},function(a){this.Zo!==a&&(D.h(a,"number",pt,"defaultSpringLength"),this.Zo=a,this.L())});D.defineProperty(pt,{AL:"defaultElectricalCharge"},function(){return this.Xo},function(a){this.Xo!==a&&(D.h(a,"number",pt,"defaultElectricalCharge"),this.Xo=a,this.L())});
D.defineProperty(pt,{BL:"defaultGravitationalMass"},function(){return this.Yo},function(a){this.Yo!==a&&(D.h(a,"number",pt,"defaultGravitationalMass"),this.Yo=a,this.L())});D.defineProperty(pt,{xI:"defaultCommentSpringLength"},function(){return this.Qr},function(a){this.Qr!==a&&(D.h(a,"number",pt,"defaultCommentSpringLength"),this.Qr=a,this.L())});
D.defineProperty(pt,{wI:"defaultCommentElectricalCharge"},function(){return this.Pr},function(a){this.Pr!==a&&(D.h(a,"number",pt,"defaultCommentElectricalCharge"),this.Pr=a,this.L())});function pu(){this.DC=this.CC=this.gz=this.iz=this.hz=0}function qt(){ta.call(this)}D.Ta(qt,ta);D.ka("ForceDirectedNetwork",qt);qt.prototype.createVertex=function(){return new nu};qt.prototype.createEdge=function(){return new su};
function nu(){ua.call(this);this.isFixed=!1;this.mass=this.charge=NaN;this.ml=this.sg=this.forceY=this.forceX=0;this.$h=this.On=null;this.ZB=0}D.Ta(nu,ua);D.ka("ForceDirectedVertex",nu);function su(){va.call(this);this.length=this.stiffness=NaN}D.Ta(su,va);D.ka("ForceDirectedEdge",su);
function tu(){0<arguments.length&&D.zd(tu);Ig.call(this);this.ke=this.hn=25;this.ga=0;this.Wo=uu;this.yp=vu;this.np=wu;this.gn=4;this.Lo=xu;this.tj=yu;this.vi=!0;this.Hs=4;this.Sb=this.Fw=this.Bb=-1;this.Zf=this.Qs=0;this.Xb=this.Xf=this.Yf=this.Jg=this.xe=null;this.Zs=0;this.Ys=this.nn=null;this.Lg=0;this.$s=null;this.MC=new N;this.Ah=[];this.Ah.length=100}D.Ta(tu,Ig);D.ka("LayeredDigraphLayout",tu);
tu.prototype.cloneProtected=function(a){Ig.prototype.cloneProtected.call(this,a);a.hn=this.hn;a.ke=this.ke;a.ga=this.ga;a.Wo=this.Wo;a.yp=this.yp;a.np=this.np;a.gn=this.gn;a.Lo=this.Lo;a.tj=this.tj;a.vi=this.vi;a.Hs=this.Hs};tu.prototype.qc=function(a){a.Se===tu?0===a.name.indexOf("Aggressive")?this.bI=a:0===a.name.indexOf("Cycle")?this.vI=a:0===a.name.indexOf("Init")?this.mJ=a:0===a.name.indexOf("Layer")?this.zJ=a:D.k("Unknown enum value: "+a):Ig.prototype.qc.call(this,a)};
tu.prototype.createNetwork=function(){return new zu};
tu.prototype.doLayout=function(a){null===a&&D.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");null===this.network&&(this.network=this.makeNetwork(a));this.$d=this.initialOrigin(this.$d);this.Fw=-1;this.Zf=this.Qs=0;this.$s=this.Ys=this.nn=null;for(a=0;a<this.Ah.length;a++)this.Ah[a]=null;if(0<this.network.vertexes.count){this.network.Rx();for(a=this.network.edges.j;a.next();)a.value.rev=!1;switch(this.Wo){default:case Au:a=this.network;var b=
0,c=a.vertexes.count-1,d=[];d.length=c+1;for(var e=a.vertexes.j;e.next();)e.value.valid=!0;for(;null!==Bu(a);){for(e=Cu(a);null!==e;)d[c]=e,c--,e.valid=!1,e=Cu(a);for(e=Du(a);null!==e;)d[b]=e,b++,e.valid=!1,e=Du(a);for(var e=null,g=0,h=this.network.vertexes.j;h.next();){var k=h.value;if(k.valid){for(var l=0,m=k.tc;m.next();)m.value.toVertex.valid&&l++;for(var m=0,n=k.vc;n.next();)n.value.fromVertex.valid&&m++;if(null===e||g<l-m)e=k,g=l-m}}null!==e&&(d[b]=e,b++,e.valid=!1)}for(b=0;b<a.vertexes.count;b++)d[b].index=
b;for(d=a.edges.j;d.next();)b=d.value,b.fromVertex.index>b.toVertex.index&&(a.Qy(b),b.rev=!0);break;case uu:for(d=this.network.vertexes.j;d.next();)a=d.value,a.qq=-1,a.finish=-1;for(a=this.network.edges.j;a.next();)a.value.forest=!1;this.Zs=0;for(d.reset();d.next();)b=d.value,0===b.vc.count&&Eu(this,b);for(d.reset();d.next();)b=d.value,-1===b.qq&&Eu(this,b);for(a.reset();a.next();)d=a.value,d.forest||(b=d.fromVertex,c=b.finish,e=d.toVertex,g=e.finish,e.qq<b.qq&&c<g&&(this.network.Qy(d),d.rev=!0))}for(a=
this.network.vertexes.j;a.next();)a.value.layer=-1;this.Bb=-1;this.assignLayers();for(a.reset();a.next();)this.Bb=Math.max(this.Bb,a.value.layer);a=this.network;d=[];for(c=a.edges.j;c.next();)b=c.value,b.valid=!1,d.push(b);for(c=0;c<d.length;c++)if(b=d[c],g=b.fromVertex,e=b.toVertex,!b.valid&&(null!==g.Gd&&null!==e.Gd||g.layer!==e.layer)){m=k=l=h=0;if(null!==b.link){l=b.link;if(null===l)continue;var p=g.Gd,h=e.Gd;if(null===p||null===h)continue;var q=l.Z,k=l.ba,r=l.ic,l=l.wc;b.rev&&(m=q,n=r,q=k,r=
l,k=m,l=n);var s=g.W,m=e.W,t=b.rev?e.S:g.S,n=D.O();p!==q?t.F()&&q.isVisible()&&q.Y.F()?(mr(q,r,mc,n),n.x+=q.Y.x-t.x,n.y+=q.Y.y-t.y):n.assign(s):t.F()?(mr(q,r,mc,n),n.F()||n.assign(s)):n.assign(s);q=b.rev?g.S:e.S;p=D.O();h!==k?q.F()&&k.isVisible()&&k.Y.F()?(mr(k,l,mc,p),p.x+=k.Y.x-q.x,p.y+=k.Y.y-q.y):p.assign(m):q.F()?(mr(k,l,mc,p),p.F()||p.assign(m)):p.assign(m);90===this.ga||270===this.ga?(h=Math.round((n.x-s.x)/this.ke),k=n.x,l=Math.round((p.x-m.x)/this.ke),m=p.x):(h=Math.round((n.y-s.y)/this.ke),
k=n.y,l=Math.round((p.y-m.y)/this.ke),m=p.y);D.A(n);D.A(p);b.portFromColOffset=h;b.portFromPos=k;b.portToColOffset=l;b.portToPos=m}else b.portFromColOffset=0,b.portFromPos=0,b.portToColOffset=0,b.portToPos=0;n=g.layer;p=e.layer;a:if(q=b,r=0,t=q.link,null!==t){var u=t.ic,z=t.wc;if(null!==u&&null!==z){var w=t.Z,s=t.ba;if(null!==w&&null!==s){var y=u.Ib,B=z.Jb;this.ar||(t.Ib.md()||(y=t.Ib),t.Jb.md()||(B=t.Jb));var P=t.jc,G=Fu(this,!0);if(y.md()||y===dc)y=G;var Q=Fu(this,!1);if(B.md()||B===dc)B=Q;if(y.Rj()&&
y.Oj(Q)&&B.Rj()&&B.Oj(G)){r=0;break a}G=t.getLinkPoint(w,u,y,!0,P,s,z,D.O());y=t.getLinkDirection(w,u,G,y,!0,P,s,z);D.A(G);y===Gu(this,q,!0)?r+=1:this.ar&&null!==w&&1===w.ports.count&&q.rev&&(r+=1);y=t.getLinkPoint(s,z,B,!1,P,w,u,D.O());t=t.getLinkDirection(s,z,y,B,!1,P,w,u);D.A(y);t===Gu(this,q,!1)?r+=2:this.ar&&null!==s&&1===s.ports.count&&q.rev&&(r+=2)}}}q=1===r||3===r?!0:!1;if(r=2===r||3===r?!0:!1)s=a.createVertex(),s.Gd=null,s.Ln=1,s.layer=n,s.near=g,a.km(s),g=a.Jq(g,s,b.link),g.valid=!1,g.rev=
b.rev,g.portFromColOffset=h,g.portToColOffset=0,g.portFromPos=k,g.portToPos=0,g=s;t=1;q&&t--;if(n-p>t&&0<n){b.valid=!1;s=a.createVertex();s.Gd=null;s.Ln=2;s.layer=n-1;a.km(s);g=a.Jq(g,s,b.link);g.valid=!0;g.rev=b.rev;g.portFromColOffset=r?0:h;g.portToColOffset=0;g.portFromPos=r?0:k;g.portToPos=0;g=s;for(n--;n-p>t&&0<n;)s=a.createVertex(),s.Gd=null,s.Ln=3,s.layer=n-1,a.km(s),g=a.Jq(g,s,b.link),g.valid=!0,g.rev=b.rev,g.portFromColOffset=0,g.portToColOffset=0,g.portFromPos=0,g.portToPos=0,g=s,n--;g=
a.Jq(s,e,b.link);g.valid=!q;q&&(s.near=e);g.rev=b.rev;g.portFromColOffset=0;g.portToColOffset=l;g.portFromPos=0;g.portToPos=m}else b.valid=!0}d=this.xe=[];for(b=0;b<=this.Bb;b++)d[b]=0;for(a=this.network.vertexes.j;a.next();)a.value.index=-1;this.initializeIndices();this.Fw=-1;for(b=this.Zf=this.Qs=0;b<=this.Bb;b++)d[b]>d[this.Zf]&&(this.Fw=d[b]-1,this.Zf=b),d[b]<d[this.Qs]&&(this.Qs=b);this.$s=[];for(b=0;b<d.length;b++)this.$s[b]=[];for(a.reset();a.next();)d=a.value,this.$s[d.layer][d.index]=d;this.Sb=
-1;for(a=0;a<=this.Bb;a++){d=Hu(this,a);b=0;c=this.xe[a];for(e=0;e<c;e++)g=d[e],b+=this.nodeMinColumnSpace(g,!0),g.column=b,b+=1,b+=this.nodeMinColumnSpace(g,!1);this.Sb=Math.max(this.Sb,b-1);Iu(this,a,d)}this.reduceCrossings();this.straightenAndPack();this.updateParts()}this.network=null;this.Af=!0};tu.prototype.linkMinLength=function(){return 1};function Ju(a){var b=a.fromVertex.Gd;a=a.toVertex.Gd;return null===b&&null===a?8:null===b||null===a?4:1}
tu.prototype.nodeMinLayerSpace=function(a,b){return null===a.Gd?0:90===this.ga||270===this.ga?b?a.W.y+10:a.S.height-a.W.y+10:b?a.W.x+10:a.S.width-a.W.x+10};tu.prototype.nodeMinColumnSpace=function(a,b){if(null===a.Gd)return 0;var c=b?a.NB:a.MB;if(null!==c)return c;c=this.ga;return 90===c||270===c?b?a.NB=a.W.x/this.ke+1|0:a.MB=(a.S.width-a.W.x)/this.ke+1|0:b?a.NB=a.W.y/this.ke+1|0:a.MB=(a.S.height-a.W.y)/this.ke+1|0};
function Ku(a){null===a.nn&&(a.nn=[]);for(var b=0,c=a.network.vertexes.j;c.next();){var d=c.value;a.nn[b]=d.layer;b++;a.nn[b]=d.column;b++;a.nn[b]=d.index;b++}return a.nn}function Lu(a,b){for(var c=0,d=a.network.vertexes.j;d.next();){var e=d.value;e.layer=b[c];c++;e.column=b[c];c++;e.index=b[c];c++}}
function Mu(a,b,c){v&&(D.p(b,tu,"crossingMatrix:unfixedLayer"),D.p(c,tu,"crossingMatrix:direction"));var d=Hu(a,b),e=a.xe[b];if(null===a.Ys||a.Ys.length<e*e)a.Ys=[];for(var g=a.Ys,h=0;h<e;h++){var k=0,l=d[h],m=l.near,n=0;if(null!==m&&m.layer===l.layer)if(n=m.index,n>h)for(var p=h+1;p<n;p++)l=d[p],l.near===m&&l.Ln===m.Ln||k++;else for(p=h-1;p>n;p--)l=d[p],l.near===m&&l.Ln===m.Ln||k++;var m=0,q,r=q=p=l=0,s,t=0,u=0;s=0;var z;if(0<=c)for(n=d[h].Ze,m=0;m<n.count;m++)if(q=n.o[m],q.valid&&q.fromVertex.layer!==
b)for(l=q.fromVertex.index,p=q.portToPos,q=q.portFromPos,r=m+1;r<n.count;r++)s=n.o[r],s.valid&&s.fromVertex.layer!==b&&(t=s.fromVertex.index,u=s.portToPos,s=s.portFromPos,p<u&&(l>t||l===t&&q>s)&&k++,u<p&&(t>l||t===l&&s>q)&&k++);if(0>=c)for(n=d[h].Te,m=0;m<n.count;m++)if(q=n.o[m],q.valid&&q.toVertex.layer!==b)for(l=q.toVertex.index,p=q.portToPos,q=q.portFromPos,r=m+1;r<n.count;r++)s=n.o[r],s.valid&&s.toVertex.layer!==b&&(t=s.toVertex.index,u=s.portToPos,s=s.portFromPos,q<s&&(l>t||l===t&&p>u)&&k++,
s<q&&(t>l||t===l&&u>p)&&k++);g[h*e+h]=k;for(n=h+1;n<e;n++){var w=0,y=0;if(0<=c)for(k=d[h].Ze,z=d[n].Ze,m=0;m<k.count;m++)if(q=k.o[m],q.valid&&q.fromVertex.layer!==b)for(l=q.fromVertex.index,q=q.portFromPos,r=0;r<z.count;r++)s=z.o[r],s.valid&&s.fromVertex.layer!==b&&(t=s.fromVertex.index,s=s.portFromPos,(l<t||l===t&&q<s)&&y++,(t<l||t===l&&s<q)&&w++);if(0>=c)for(k=d[h].Te,z=d[n].Te,m=0;m<k.count;m++)if(q=k.o[m],q.valid&&q.toVertex.layer!==b)for(l=q.toVertex.index,p=q.portToPos,r=0;r<z.count;r++)s=z.o[r],
s.valid&&s.toVertex.layer!==b&&(t=s.toVertex.index,u=s.portToPos,(l<t||l===t&&p<u)&&y++,(t<l||t===l&&u<p)&&w++);g[h*e+n]=w;g[n*e+h]=y}}Iu(a,b,d);return g}tu.prototype.countCrossings=function(){for(var a=0,b=0;b<=this.Bb;b++)for(var c=Mu(this,b,1),d=this.xe[b],e=0;e<d;e++)for(var g=e;g<d;g++)a+=c[e*d+g];return a};
function Nu(a){for(var b=0,c=0;c<=a.Bb;c++){for(var d=a,e=c,g=Hu(d,e),h=d.xe[e],k=0,l=0;l<h;l++){var m=null,m=g[l].Te,n,p=0,q=0;if(null!==m)for(var r=0;r<m.count;r++)n=m.o[r],n.valid&&n.toVertex.layer!==e&&(p=n.fromVertex.column+n.portFromColOffset,q=n.toVertex.column+n.portToColOffset,k+=(Math.abs(p-q)+1)*Ju(n))}Iu(d,e,g);b+=k}return b}
tu.prototype.normalize=function(){var a=Infinity;this.Sb=-1;for(var b=this.network.vertexes.j;b.next();){var c=b.value,a=Math.min(a,c.column-this.nodeMinColumnSpace(c,!0));this.Sb=Math.max(this.Sb,c.column+this.nodeMinColumnSpace(c,!1))}for(b.reset();b.next();)b.value.column-=a;this.Sb-=a};
function Ou(a,b,c){v&&(D.p(b,tu,"barycenters:unfixedLayer"),D.p(c,tu,"barycenters:direction"));for(var d=Hu(a,b),e=a.xe[b],g=[],h=0;h<e;h++){var k=d[h],l=null;0>=c&&(l=k.Ze);var m=null;0<=c&&(m=k.Te);var n=0,p=0,q=k.near;null!==q&&q.layer===k.layer&&(n+=q.column-1,p++);if(null!==l)for(q=0;q<l.count;q++){var k=l.o[q],r=k.fromVertex;k.valid&&!k.rev&&r.layer!==b&&(n+=r.column,p++)}if(null!==m)for(l=0;l<m.count;l++)k=m.o[l],q=k.toVertex,k.valid&&!k.rev&&q.layer!==b&&(n+=q.column,p++);g[h]=0===p?-1:n/
p}Iu(a,b,d);return g}
function Pu(a,b,c){v&&(D.p(b,tu,"medians:unfixedLayer"),D.p(c,tu,"medians:direction"));for(var d=Hu(a,b),e=a.xe[b],g=[],h=0;h<e;h++){var k=d[h],l=null;0>=c&&(l=k.Ze);var m=null;0<=c&&(m=k.Te);var n=0,p=[],q=k.near;null!==q&&q.layer===k.layer&&(p[n]=q.column-1,n++);if(null!==l)for(q=0;q<l.count;q++){var k=l.o[q],r=k.fromVertex;k.valid&&!k.rev&&r.layer!==b&&(p[n]=r.column+k.portFromColOffset,n++)}if(null!==m)for(l=0;l<m.count;l++)k=m.o[l],q=k.toVertex,k.valid&&!k.rev&&q.layer!==b&&(p[n]=q.column+k.portToColOffset,
n++);0===n?g[h]=-1:(p.sort(function(a,b){return a-b}),m=n>>1,g[h]=0!==(n&1)?p[m]:p[m-1]+p[m]>>1)}Iu(a,b,d);return g}function Qu(a,b,c,d,e,g){if(b.component===d){b.component=c;var h=0,k=0;if(e)for(var l=b.tc;l.next();){var k=l.value,m=k.toVertex,h=b.layer-m.layer,k=a.linkMinLength(k);h===k&&Qu(a,m,c,d,e,g)}if(g)for(l=b.vc;l.next();)k=l.value,m=k.fromVertex,h=m.layer-b.layer,k=a.linkMinLength(k),h===k&&Qu(a,m,c,d,e,g)}}
function Ru(a,b,c,d,e,g){if(b.component===d){b.component=c;if(e)for(var h=b.tc;h.next();)Ru(a,h.value.toVertex,c,d,e,g);if(g)for(b=b.vc;b.next();)Ru(a,b.value.fromVertex,c,d,e,g)}}function Bu(a){for(a=a.vertexes.j;a.next();){var b=a.value;if(b.valid)return b}return null}function Cu(a){for(a=a.vertexes.j;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.tc;d.next();)if(d.value.toVertex.valid){c=!1;break}if(c)return b}}return null}
function Du(a){for(a=a.vertexes.j;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.vc;d.next();)if(d.value.fromVertex.valid){c=!1;break}if(c)return b}}return null}function Eu(a,b){b.qq=a.Zs;a.Zs++;for(var c=b.tc;c.next();){var d=c.value,e=d.toVertex;-1===e.qq&&(d.forest=!0,Eu(a,e))}b.finish=a.Zs;a.Zs++}
tu.prototype.assignLayers=function(){switch(this.yp){case Su:Tu(this);break;case Uu:for(var a=0,b=this.network.vertexes.j;b.next();)a=Vu(this,b.value),this.Bb=Math.max(a,this.Bb);for(b.reset();b.next();)a=b.value,a.layer=this.Bb-a.layer;break;default:case vu:Tu(this);for(b=this.network.vertexes.j;b.next();)b.value.valid=!1;for(b.reset();b.next();)a=b.value,0===a.vc.count&&Wu(this,a);a=Infinity;for(b.reset();b.next();)a=Math.min(a,b.value.layer);this.Bb=-1;for(b.reset();b.next();){var c=b.value;c.layer-=
a;this.Bb=Math.max(this.Bb,c.layer)}}};function Tu(a){for(var b=a.network.vertexes.j;b.next();){var c=Xu(a,b.value);a.Bb=Math.max(c,a.Bb)}}function Xu(a,b){var c=0;if(-1===b.layer){for(var d=b.tc;d.next();)var e=d.value,g=e.toVertex,e=a.linkMinLength(e),c=Math.max(c,Xu(a,g)+e);b.layer=c}else c=b.layer;return c}function Vu(a,b){var c=0;if(-1===b.layer){for(var d=b.vc;d.next();)var e=d.value,g=e.fromVertex,e=a.linkMinLength(e),c=Math.max(c,Vu(a,g)+e);b.layer=c}else c=b.layer;return c}
function Wu(a,b){if(!b.valid){b.valid=!0;for(var c=b.tc;c.next();)Wu(a,c.value.toVertex);for(c=a.network.vertexes.j;c.next();)c.value.component=-1;for(var d=b.Ze.o,e=d.length,g=0;g<e;g++){var h=d[g],k=h.fromVertex,l=h.toVertex,h=a.linkMinLength(h);k.layer-l.layer>h&&Qu(a,k,0,-1,!0,!1)}for(Qu(a,b,1,-1,!0,!0);0!==b.component;){for(var k=0,d=Infinity,l=0,m=null,n=a.network.vertexes.j;n.next();){var p=n.value;if(1===p.component){for(var q=0,r=!1,s=p.Ze.o,e=s.length,g=0;g<e;g++){var h=s[g],t=h.fromVertex,
q=q+1;1!==t.component&&(k+=1,t=t.layer-p.layer,h=a.linkMinLength(h),d=Math.min(d,t-h))}h=p.Te.o;e=h.length;for(g=0;g<e;g++)s=h[g].toVertex,q-=1,1!==s.component?k-=1:r=!0;(null===m||q<l)&&!r&&(m=p,l=q)}}if(0<k){for(c.reset();c.next();)e=c.value,1===e.component&&(e.layer+=d);b.component=0}else m.component=0}for(c=a.network.vertexes.j;c.next();)c.value.component=-1;for(Qu(a,b,1,-1,!0,!1);0!==b.component;){g=0;e=Infinity;d=0;h=null;for(k=a.network.vertexes.j;k.next();)if(l=k.value,1===l.component){m=
0;n=!1;r=l.Ze.o;p=r.length;for(q=0;q<p;q++)s=r[q].fromVertex,m+=1,1!==s.component?g+=1:n=!0;r=l.Te.o;p=r.length;for(q=0;q<p;q++)s=r[q],t=s.toVertex,m-=1,1!==t.component&&(g-=1,t=l.layer-t.layer,s=a.linkMinLength(s),e=Math.min(e,t-s));(null===h||m>d)&&!n&&(h=l,d=m)}if(0>g){for(c.reset();c.next();)g=c.value,1===g.component&&(g.layer-=e);b.component=0}else h.component=0}}}
function Gu(a,b,c){return 90===a.ga?c&&!b.rev||!c&&b.rev?270:90:180===a.ga?c&&!b.rev||!c&&b.rev?0:180:270===a.ga?c&&!b.rev||!c&&b.rev?90:270:c&&!b.rev||!c&&b.rev?180:0}
tu.prototype.initializeIndices=function(){switch(this.np){default:case Yu:for(var a=this.network.vertexes.j;a.next();){var b=a.value,c=b.layer;b.index=this.xe[c];this.xe[c]++}break;case wu:a=this.network.vertexes.j;for(b=this.Bb;0<=b;b--)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Zu(this,c);break;case $u:for(a=this.network.vertexes.j,b=0;b<=this.Bb;b++)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&av(this,c)}};
function Zu(a,b){var c=b.layer;b.index=a.xe[c];a.xe[c]++;for(var c=b.Te.Hc(),d=!0;d;)for(var d=!1,e=0;e<c.length-1;e++){var g=c[e],h=c[e+1];g.portFromColOffset>h.portFromColOffset&&(d=!0,c[e]=h,c[e+1]=g)}for(e=0;e<c.length;e++)d=c[e],d.valid&&(d=d.toVertex,-1===d.index&&Zu(a,d))}
function av(a,b){var c=b.layer;b.index=a.xe[c];a.xe[c]++;for(var c=b.Ze.Hc(),d=!0,e=0;d;)for(d=!1,e=0;e<c.length-1;e++){var g=c[e],h=c[e+1];g.portToColOffset>h.portToColOffset&&(d=!0,c[e]=h,c[e+1]=g)}for(e=0;e<c.length;e++)d=c[e],d.valid&&(d=d.fromVertex,-1===d.index&&av(a,d))}
tu.prototype.reduceCrossings=function(){for(var a=this.countCrossings(),b=Ku(this),c=0,d=0,e=0,c=0;c<this.gn;c++){for(d=0;d<=this.Bb;d++)bv(this,d,1),cv(this,d,1);e=this.countCrossings();e<a&&(a=e,b=Ku(this));for(d=this.Bb;0<=d;d--)bv(this,d,-1),cv(this,d,-1);e=this.countCrossings();e<a&&(a=e,b=Ku(this))}Lu(this,b);for(c=0;c<this.gn;c++){for(d=0;d<=this.Bb;d++)bv(this,d,0),cv(this,d,0);e=this.countCrossings();e<a&&(a=e,b=Ku(this));for(d=this.Bb;0<=d;d--)bv(this,d,0),cv(this,d,0);e=this.countCrossings();
e<a&&(a=e,b=Ku(this))}Lu(this,b);var g=!1,h=c=0,k=0,d=0;switch(this.Lo){case dv:break;case ev:for(k=a+1;(d=this.countCrossings())<k;)for(k=d,c=this.Bb;0<=c;c--)for(h=0;h<=c;h++){for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=cv(this,d,-1)||g;e=this.countCrossings();e>=a?Lu(this,b):(a=e,b=Ku(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=cv(this,d,1)||g;e=this.countCrossings();e>=a?Lu(this,b):(a=e,b=Ku(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=cv(this,d,1)||g;e>=a?Lu(this,b):(a=e,b=Ku(this));for(g=!0;g;)for(g=!1,
d=h;d<=c;d++)g=cv(this,d,-1)||g;e>=a?Lu(this,b):(a=e,b=Ku(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=cv(this,d,0)||g;e>=a?Lu(this,b):(a=e,b=Ku(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=cv(this,d,0)||g;e>=a?Lu(this,b):(a=e,b=Ku(this))}break;default:case xu:for(c=this.Bb,h=0,k=a+1;(d=this.countCrossings())<k;){k=d;for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=cv(this,d,-1)||g;e=this.countCrossings();e>=a?Lu(this,b):(a=e,b=Ku(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=cv(this,d,1)||g;e=this.countCrossings();
e>=a?Lu(this,b):(a=e,b=Ku(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=cv(this,d,1)||g;e>=a?Lu(this,b):(a=e,b=Ku(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=cv(this,d,-1)||g;e>=a?Lu(this,b):(a=e,b=Ku(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=cv(this,d,0)||g;e>=a?Lu(this,b):(a=e,b=Ku(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=cv(this,d,0)||g;e>=a?Lu(this,b):(a=e,b=Ku(this))}}Lu(this,b)};
function bv(a,b,c){v&&(D.p(b,tu,"medianBarycenterCrossingReduction:unfixedLayer"),D.p(c,tu,"medianBarycenterCrossingReduction:direction"));var d=0,e=Hu(a,b),g=a.xe[b],h=Pu(a,b,c);c=Ou(a,b,c);for(d=0;d<g;d++)-1===c[d]&&(c[d]=e[d].column),-1===h[d]&&(h[d]=e[d].column);for(var k=!0,l;k;)for(k=!1,d=0;d<g-1;d++)if(h[d+1]<h[d]||h[d+1]===h[d]&&c[d+1]<c[d])k=!0,l=h[d],h[d]=h[d+1],h[d+1]=l,l=c[d],c[d]=c[d+1],c[d+1]=l,l=e[d],e[d]=e[d+1],e[d+1]=l;for(d=h=0;d<g;d++)l=e[d],l.index=d,h+=a.nodeMinColumnSpace(l,
!0),l.column=h,h+=1,h+=a.nodeMinColumnSpace(l,!1);Iu(a,b,e)}
function cv(a,b,c){var d=Hu(a,b),e=a.xe[b];c=Mu(a,b,c);var g=0,h;h=[];for(g=0;g<e;g++)h[g]=-1;var k;k=[];for(g=0;g<e;g++)k[g]=-1;for(var l=!1,m=!0;m;)for(m=!1,g=0;g<e-1;g++){var n=c[d[g].index*e+d[g+1].index],p=c[d[g+1].index*e+d[g].index],q=0,r=0,s=d[g].column,t=d[g+1].column,u=a.nodeMinColumnSpace(d[g],!0),z=a.nodeMinColumnSpace(d[g],!1),w=a.nodeMinColumnSpace(d[g+1],!0),y=a.nodeMinColumnSpace(d[g+1],!1),u=s-u+w,z=t-z+y,w=w=0,B=d[g].vc.j;for(B.reset();B.next();)if(w=B.value,y=w.fromVertex,w.valid&&
y.layer===b){for(w=0;d[w]!==y;)w++;w<g&&(q+=2*(g-w),r+=2*(g+1-w));w===g+1&&(q+=1);w>g+1&&(q+=4*(w-g),r+=4*(w-(g+1)))}B=d[g].tc.j;for(B.reset();B.next();)if(w=B.value,y=w.toVertex,w.valid&&y.layer===b){for(w=0;d[w]!==y;)w++;w===g+1&&(r+=1)}B=d[g+1].vc.j;for(B.reset();B.next();)if(w=B.value,y=w.fromVertex,w.valid&&y.layer===b){for(w=0;d[w]!==y;)w++;w<g&&(q+=2*(g+1-w),r+=2*(g-w));w===g&&(r+=1);w>g+1&&(q+=4*(w-(g+1)),r+=4*(w-g))}B=d[g+1].tc.j;for(B.reset();B.next();)if(w=B.value,y=w.toVertex,w.valid&&
y.layer===b){for(w=0;d[w]!==y;)w++;w===g&&(q+=1)}var w=y=0,B=h[d[g].index],P=k[d[g].index],G=h[d[g+1].index],Q=k[d[g+1].index];-1!==B&&(y+=Math.abs(B-s),w+=Math.abs(B-z));-1!==P&&(y+=Math.abs(P-s),w+=Math.abs(P-z));-1!==G&&(y+=Math.abs(G-t),w+=Math.abs(G-u));-1!==Q&&(y+=Math.abs(Q-t),w+=Math.abs(Q-u));if(r<q-.5||r===q&&p<n-.5||r===q&&p===n&&w<y-.5)m=l=!0,d[g].column=z,d[g+1].column=u,n=d[g],d[g]=d[g+1],d[g+1]=n}for(g=0;g<e;g++)d[g].index=g;Iu(a,b,d);return l}
tu.prototype.straightenAndPack=function(){var a=0,b=!1,c=0!==(this.tj&fv),a=this.tj===yu;1E3<this.network.edges.count&&!a&&(c=!1);if(c){b=[];for(a=a=0;a<=this.Bb;a++)b[a]=0;for(var d=0,e=this.network.vertexes.j;e.next();){var g=e.value,a=g.layer,d=g.column,g=this.nodeMinColumnSpace(g,!1);b[a]=Math.max(b[a],d+g)}for(e.reset();e.next();)g=e.value,a=g.layer,d=g.column,g.column=(8*(this.Sb-b[a])>>1)+8*d;this.Sb*=8}if(0!==(this.tj&gv))for(b=!0;b;){b=!1;for(a=this.Zf+1;a<=this.Bb;a++)b=hv(this,a,1)||b;
for(a=this.Zf-1;0<=a;a--)b=hv(this,a,-1)||b;b=hv(this,this.Zf,0)||b}if(0!==(this.tj&iv)){for(a=this.Zf+1;a<=this.Bb;a++)jv(this,a,1);for(a=this.Zf-1;0<=a;a--)jv(this,a,-1);jv(this,this.Zf,0)}c&&(kv(this,-1),kv(this,1));if(0!==(this.tj&gv))for(b=!0;b;){b=!1;b=hv(this,this.Zf,0)||b;for(a=this.Zf+1;a<=this.Bb;a++)b=hv(this,a,0)||b;for(a=this.Zf-1;0<=a;a--)b=hv(this,a,0)||b}};
function hv(a,b,c){v&&(D.p(b,tu,"bendStraighten:unfixedLayer"),D.p(c,tu,"bendStraighten:direction"));for(var d=!1;lv(a,b,c);)d=!0;return d}
function lv(a,b,c){v&&(D.p(b,tu,"shiftbendStraighten:unfixedLayer"),D.p(c,tu,"shiftbendStraighten:direction"));var d=0,e=Hu(a,b),g=a.xe[b],h=Ou(a,b,-1);if(0<c)for(d=0;d<g;d++)h[d]=-1;var k=Ou(a,b,1);if(0>c)for(d=0;d<g;d++)k[d]=-1;for(var l=!1,m=!0;m;)for(m=!1,d=0;d<g;d++){var n=e[d].column,p=a.nodeMinColumnSpace(e[d],!0),q=a.nodeMinColumnSpace(e[d],!1),r=0,r=0>d-1||n-e[d-1].column-1>p+a.nodeMinColumnSpace(e[d-1],!1)?n-1:n,p=0,p=d+1>=g||e[d+1].column-n-1>q+a.nodeMinColumnSpace(e[d+1],!0)?n+1:n,s=q=
0,t=0,u=0,z=0,w=0;if(0>=c)for(var y=e[d].vc.j;y.next();){var w=y.value,B=w.fromVertex;w.valid&&B.layer!==b&&(u=Ju(w),z=w.portFromColOffset,w=w.portToColOffset,B=B.column,q+=(Math.abs(n+w-(B+z))+1)*u,s+=(Math.abs(r+w-(B+z))+1)*u,t+=(Math.abs(p+w-(B+z))+1)*u)}if(0<=c)for(y=e[d].tc.j;y.next();)w=y.value,B=w.toVertex,w.valid&&B.layer!==b&&(u=Ju(w),z=w.portFromColOffset,w=w.portToColOffset,B=B.column,q+=(Math.abs(n+z-(B+w))+1)*u,s+=(Math.abs(r+z-(B+w))+1)*u,t+=(Math.abs(p+z-(B+w))+1)*u);w=z=u=0;y=h[e[d].index];
B=k[e[d].index];-1!==y&&(u+=Math.abs(y-n),z+=Math.abs(y-r),w+=Math.abs(y-p));-1!==B&&(u+=Math.abs(B-n),z+=Math.abs(B-r),w+=Math.abs(B-p));if(s<q||s===q&&z<u)m=l=!0,e[d].column=r;else if(t<q||t===q&&w<u)m=l=!0,e[d].column=p}Iu(a,b,e);a.normalize();return l}
function jv(a,b,c){v&&(D.p(b,tu,"medianStraighten:unfixedLayer"),D.p(c,tu,"medianStraighten:direction"));var d=0,e=Hu(a,b),g=a.xe[b],h=Pu(a,b,c);c=[];for(d=0;d<g;d++)c[d]=h[d];for(h=!0;h;)for(h=!1,d=0;d<g;d++){var k=e[d].column,l=a.nodeMinColumnSpace(e[d],!0),m=a.nodeMinColumnSpace(e[d],!1),n=0,p=0,q=0,q=p=0;-1===c[d]?0===d&&d===g-1?n=k:0===d?(p=e[d+1].column,n=p-k===m+a.nodeMinColumnSpace(e[d+1],!0)?k-1:k):d===g-1?(q=e[d-1].column,n=k-q===l+a.nodeMinColumnSpace(e[d-1],!1)?k+1:k):(q=e[d-1].column,
q=q+a.nodeMinColumnSpace(e[d-1],!1)+l+1,p=e[d+1].column,p=p-a.nodeMinColumnSpace(e[d+1],!0)-m-1,n=(q+p)/2|0):0===d&&d===g-1?n=c[d]:0===d?(p=e[d+1].column,p=p-a.nodeMinColumnSpace(e[d+1],!0)-m-1,n=Math.min(c[d],p)):d===g-1?(q=e[d-1].column,q=q+a.nodeMinColumnSpace(e[d-1],!1)+l+1,n=Math.max(c[d],q)):(q=e[d-1].column,q=q+a.nodeMinColumnSpace(e[d-1],!1)+l+1,p=e[d+1].column,p=p-a.nodeMinColumnSpace(e[d+1],!0)-m-1,q<c[d]&&c[d]<p?n=c[d]:q>=c[d]?n=q:p<=c[d]&&(n=p));n!==k&&(h=!0,e[d].column=n)}Iu(a,b,e);a.normalize()}
function mv(a,b){v&&(D.p(b,tu,"packAux:column"),D.p(1,tu,"packAux:direction"));for(var c=!0,d=a.network.vertexes.j;d.next();){var e=d.value,g=a.nodeMinColumnSpace(e,!0),h=a.nodeMinColumnSpace(e,!1);if(e.column-g<=b&&e.column+h>=b){c=!1;break}}e=!1;if(c)for(d.reset();d.next();)c=d.value,c.column>b&&(c.column-=1,e=!0);return e}
function nv(a,b){v&&(D.p(b,tu,"tightPackAux:column"),D.p(1,tu,"tightPackAux:direction"));for(var c=b,c=b+1,d=0,e=[],g=[],d=0;d<=a.Bb;d++)e[d]=!1,g[d]=!1;for(var h=a.network.vertexes.j;h.next();){var d=h.value,k=d.column-a.nodeMinColumnSpace(d,!0),l=d.column+a.nodeMinColumnSpace(d,!1);k<=b&&l>=b&&(e[d.layer]=!0);k<=c&&l>=c&&(g[d.layer]=!0)}k=!0;c=!1;for(d=0;d<=a.Bb;d++)k=k&&!(e[d]&&g[d]);if(k)for(h.reset();h.next();)e=h.value,e.column>b&&(e.column-=1,c=!0);return c}
function kv(a,b){v&&D.p(b,tu,"componentPack:direction");for(var c=0;c<=a.Sb;c++)for(;mv(a,c););a.normalize();for(c=0;c<a.Sb;c++)for(;nv(a,c););a.normalize();var c=0,d,e=0,g=0,h=0;if(0<b)for(c=0;c<=a.Sb;c++)for(d=Ku(a),e=Nu(a),g=e+1;e<g;)g=e,ov(a,c,1),h=Nu(a),h>e?Lu(a,d):h<e&&(e=h,d=Ku(a));if(0>b)for(c=a.Sb;0<=c;c--)for(d=Ku(a),e=Nu(a),g=e+1;e<g;)g=e,ov(a,c,-1),h=Nu(a),h>e?Lu(a,d):h<e&&(e=h,d=Ku(a));a.normalize()}
function ov(a,b,c){a.Lg=0;for(var d=a.network.vertexes.j;d.next();)d.value.component=-1;if(0<c)for(d.reset();d.next();){var e=d.value;e.column-a.nodeMinColumnSpace(e,!0)<=b&&(e.component=a.Lg)}if(0>c)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.Lg);a.Lg++;for(d.reset();d.next();)b=d.value,-1===b.component&&(Ru(a,b,a.Lg,-1,!0,!0),a.Lg++);var g=0;b=[];for(g=0;g<a.Lg*a.Lg;g++)b[g]=!1;e=[];for(g=0;g<(a.Bb+1)*(a.Sb+1);g++)e[g]=-1;for(d.reset();d.next();)for(var g=
d.value,h=g.layer,k=Math.max(0,g.column-a.nodeMinColumnSpace(g,!0)),l=Math.min(a.Sb,g.column+a.nodeMinColumnSpace(g,!1));k<=l;k++)e[h*(a.Sb+1)+k]=g.component;for(g=0;g<=a.Bb;g++){if(0<c)for(k=0;k<a.Sb;k++)-1!==e[g*(a.Sb+1)+k]&&-1!==e[g*(a.Sb+1)+k+1]&&e[g*(a.Sb+1)+k]!==e[g*(a.Sb+1)+k+1]&&(b[e[g*(a.Sb+1)+k]*a.Lg+e[g*(a.Sb+1)+k+1]]=!0);if(0>c)for(k=a.Sb;0<k;k--)-1!==e[g*(a.Sb+1)+k]&&-1!==e[g*(a.Sb+1)+k-1]&&e[g*(a.Sb+1)+k]!==e[g*(a.Sb+1)+k-1]&&(b[e[g*(a.Sb+1)+k]*a.Lg+e[g*(a.Sb+1)+k-1]]=!0)}e=[];for(g=
0;g<a.Lg;g++)e[g]=!0;h=new K("number");h.add(0);for(l=0;0!==h.count;)if(l=h.o[h.count-1],h.qd(h.count-1),e[l])for(e[l]=!1,g=0;g<a.Lg;g++)b[l*a.Lg+g]&&h.ce(0,g);if(0<c)for(d.reset();d.next();)a=d.value,e[a.component]&&(a.column-=1);if(0>c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)}
tu.prototype.commitLayout=function(){if(this.ar)for(var a=Fu(this,!0),b=Fu(this,!1),c=this.network.edges.j;c.next();){var d=c.value.link;null!==d&&(d.Ib=a,d.Jb=b)}this.commitNodes();this.QA();this.Tu&&this.commitLinks()};function Fu(a,b){return 270===a.ga?b?$c:gd:90===a.ga?b?gd:$c:180===a.ga?b?ed:fd:b?fd:ed}
tu.prototype.commitNodes=function(){this.Jg=[];this.Yf=[];this.Xf=[];this.Xb=[];for(var a=0;a<=this.Bb;a++)this.Jg[a]=0,this.Yf[a]=0,this.Xf[a]=0,this.Xb[a]=0;for(a=this.network.vertexes.j;a.next();){var b=a.value,c=b.layer;this.Jg[c]=Math.max(this.Jg[c],this.nodeMinLayerSpace(b,!0));this.Yf[c]=Math.max(this.Yf[c],this.nodeMinLayerSpace(b,!1))}for(var b=0,d=this.hn,c=0;c<=this.Bb;c++){var e=d;0>=this.Jg[c]+this.Yf[c]&&(e=0);0<c&&(b+=e/2);90===this.ga||0===this.ga?(b+=this.Yf[c],this.Xf[c]=b,b+=this.Jg[c]):
(b+=this.Jg[c],this.Xf[c]=b,b+=this.Yf[c]);c<this.Bb&&(b+=e/2);this.Xb[c]=b}d=b;b=this.$d;for(c=0;c<=this.Bb;c++)270===this.ga?this.Xf[c]=b.y+this.Xf[c]:90===this.ga?(this.Xf[c]=b.y+d-this.Xf[c],this.Xb[c]=d-this.Xb[c]):180===this.ga?this.Xf[c]=b.x+this.Xf[c]:(this.Xf[c]=b.x+d-this.Xf[c],this.Xb[c]=d-this.Xb[c]);a.reset();for(d=e=Infinity;a.next();){var c=a.value,g=c.layer,h=c.column|0,k=0,l=0;270===this.ga||90===this.ga?(k=b.x+this.ke*h,l=this.Xf[g]):(k=this.Xf[g],l=b.y+this.ke*h);c.pa=k;c.wa=l;
e=Math.min(c.x,e);d=Math.min(c.y,d)}e=b.x-e;b=b.y-d;this.MC=new N(e,b);for(a.reset();a.next();)c=a.value,c.x+=e,c.y+=b,c.commit()};
tu.prototype.QA=function(){for(var a=0,b=this.hn,c=0;c<=this.Bb;c++)a+=this.Jg[c],a+=this.Yf[c];for(var a=a+this.Bb*b,b=[],c=this.ke*this.Sb,d=this.HJ;0<=d;d--)270===this.ga?0===d?b.push(new C(0,0,c,Math.abs(this.Xb[0]))):b.push(new C(0,this.Xb[d-1],c,Math.abs(this.Xb[d-1]-this.Xb[d]))):90===this.ga?0===d?b.push(new C(0,this.Xb[0],c,Math.abs(this.Xb[0]-a))):b.push(new C(0,this.Xb[d],c,Math.abs(this.Xb[d-1]-this.Xb[d]))):180===this.ga?0===d?b.push(new C(0,0,Math.abs(this.Xb[0]),c)):b.push(new C(this.Xb[d-
1],0,Math.abs(this.Xb[d-1]-this.Xb[d]),c)):0===d?b.push(new C(this.Xb[0],0,Math.abs(this.Xb[0]-a),c)):b.push(new C(this.Xb[d],0,Math.abs(this.Xb[d-1]-this.Xb[d]),c));this.commitLayers(b,this.MC)};tu.prototype.commitLayers=function(){};
tu.prototype.commitLinks=function(){for(var a=this.network.edges.j,b;a.next();)b=a.value.link,null!==b&&(b.Lm(),b.iq(),b.Hj());for(a.reset();a.next();)b=a.value.link,null!==b&&b.Fo();for(a.reset();a.next();){var c=a.value;b=c.link;if(null!==b){b.Lm();var d=b,e=d.Z,g=d.ba,h=d.ic,k=d.wc;if(null!==e){var l=e.findVisibleNode();null!==l&&l!==e&&(e=l,h=l.port)}if(null!==g){var m=g.findVisibleNode();null!==m&&m!==g&&(g=m,k=m.port)}var n=b.computeSpot(!0,h),p=b.computeSpot(!1,k),q=c.fromVertex,r=c.toVertex;
if(c.valid){if(b.vf===Vj&&4===b.ta){if(c.rev)var s=e,e=g,g=s,t=h,h=k,k=t;if(q.column===r.column){var u=b.getLinkPoint(e,h,n,!0,!1,g,k),z=b.getLinkPoint(g,k,p,!1,!1,e,h);u.F()||u.set(e.Y.pm);z.F()||z.set(g.Y.pm);b.iq();b.Ej(u.x,u.y);b.Ej((2*u.x+z.x)/3,(2*u.y+z.y)/3);b.Ej((u.x+2*z.x)/3,(u.y+2*z.y)/3);b.Ej(z.x,z.y)}else{var w=!1,y=!1;null!==h&&n===dc&&(w=!0);null!==k&&p===dc&&(y=!0);if(w||y){var B=b.m(0).x,P=b.m(0).y,G=b.m(1).x,Q=b.m(1).y,Y=b.m(2).x,U=b.m(2).y,ea=b.m(3).x,la=b.m(3).y;if(w){90===this.ga||
270===this.ga?(G=B,Q=(P+la)/2):(G=(B+ea)/2,Q=P);b.ia(1,G,Q);var Da=b.getLinkPoint(e,h,n,!0,!1,g,k);Da.F()||Da.set(e.Y.pm);b.ia(0,Da.x,Da.y)}y&&(90===this.ga||270===this.ga?(Y=ea,U=(P+la)/2):(Y=(B+ea)/2,U=la),b.ia(2,Y,U),Da=b.getLinkPoint(g,k,p,!1,!1,e,h),Da.F()||Da.set(g.Y.pm),b.ia(3,Da.x,Da.y))}}}b.Hj()}else if(q.layer===r.layer)b.Hj();else{var La=!1,hb=!1,Aa=0,W=b.zu+1;if(b.jc)hb=!0,Aa=b.ta,4<Aa&&b.points.removeRange(2,Aa-3);else if(b.vf===Vj)La=!0,Aa=b.ta,4<Aa&&b.points.removeRange(2,Aa-3),W=2;
else{var Aa=b.ta,xb=n===dc,Ob=p===dc;2<Aa&&xb&&Ob?b.points.removeRange(1,Aa-2):3<Aa&&xb&&!Ob?b.points.removeRange(1,Aa-3):3<Aa&&!xb&&Ob?b.points.removeRange(2,Aa-2):4<Aa&&!xb&&!Ob&&b.points.removeRange(2,Aa-3)}var Sa,Qc;if(c.rev){for(var Ra=0;null!==r&&q!==r;){Qc=Sa=null;for(var ig=r.vc.j;ig.next();){var jg=ig.value;if(jg.link===c.link&&(Sa=jg.fromVertex,Qc=jg.toVertex,null===Sa.Gd))break}if(Sa!==q)if(ib=b.m(W-1).x,ub=b.m(W-1).y,sa=Sa.pa,oa=Sa.wa,hb)180===this.ga||0===this.ga?2===W?(b.B(W++,ib,ub),
b.B(W++,ib,oa)):(Nd=null!==Qc?Qc.wa:ub,Nd!==oa&&(ab=this.Xb[Sa.layer-1],b.B(W++,ab,ub),b.B(W++,ab,oa))):2===W?(b.B(W++,ib,ub),b.B(W++,sa,ub)):(Jf=null!==Qc?Qc.pa:ib,Jf!==sa&&(ab=this.Xb[Sa.layer-1],b.B(W++,ib,ab),b.B(W++,sa,ab)));else if(2===W)if(Oa=Math.max(10,this.Jg[r.layer]),pb=Math.max(10,this.Yf[r.layer]),La)180===this.ga?sa<=r.S.x?(Ra=r.S.x,b.B(W++,Ra-Oa,oa),b.B(W++,Ra,oa),b.B(W++,Ra+pb,oa)):(b.B(W++,sa-Oa,oa),b.B(W++,sa,oa),b.B(W++,sa+pb,oa)):90===this.ga?oa>=r.S.bottom?(Ra=r.S.y+r.S.height,
b.B(W++,sa,Ra+pb),b.B(W++,sa,Ra),b.B(W++,sa,Ra-Oa)):(b.B(W++,sa,oa+pb),b.B(W++,sa,oa),b.B(W++,sa,oa-Oa)):270===this.ga?oa<=r.S.y?(Ra=r.S.y,b.B(W++,sa,Ra-Oa),b.B(W++,sa,Ra),b.B(W++,sa,Ra+pb)):(b.B(W++,sa,oa-Oa),b.B(W++,sa,oa),b.B(W++,sa,oa+pb)):0===this.ga&&(sa>=r.S.right?(Ra=r.S.x+r.S.width,b.B(W++,Ra+pb,oa),b.B(W++,Ra,oa),b.B(W++,Ra-Oa,oa)):(b.B(W++,sa+pb,oa),b.B(W++,sa,oa),b.B(W++,sa-Oa,oa)));else{b.B(W++,ib,ub);var vd=0;if(180===this.ga||0===this.ga){if(180===this.ga?sa>=r.S.right:sa<=r.S.x)vd=
(0===this.ga?-Oa:pb)/2;b.B(W++,ib+vd,oa)}else{if(270===this.ga?oa>=r.S.bottom:oa<=r.S.y)vd=(90===this.ga?-Oa:pb)/2;b.B(W++,sa,ub+vd)}b.B(W++,sa,oa)}else Oa=Math.max(10,this.Jg[Sa.layer]),pb=Math.max(10,this.Yf[Sa.layer]),180===this.ga?(La&&b.B(W++,sa-Oa,oa),b.B(W++,sa,oa),La&&b.B(W++,sa+pb,oa)):90===this.ga?(La&&b.B(W++,sa,oa+pb),b.B(W++,sa,oa),La&&b.B(W++,sa,oa-Oa)):270===this.ga?(La&&b.B(W++,sa,oa-Oa),b.B(W++,sa,oa),La&&b.B(W++,sa,oa+pb)):(La&&b.B(W++,sa+pb,oa),b.B(W++,sa,oa),La&&b.B(W++,sa-Oa,
oa));r=Sa}if(null===k||n!==dc||hb)if(ib=b.m(W-1).x,ub=b.m(W-1).y,sa=b.m(W).x,oa=b.m(W).y,hb){var wd=this.Yf[q.layer],Rc=0;180===this.ga||0===this.ga?(Rc=ub,Rc>=q.S.y&&Rc<=q.S.bottom&&(180===this.ga?sa>=q.S.x:sa<=q.S.right)&&(Ra=q.pa+(180===this.ga?-wd:wd),Rc=Rc<q.S.y+q.S.height/2?q.S.y-this.ke/2:q.S.bottom+this.ke/2,b.B(W++,Ra,ub),b.B(W++,Ra,Rc)),b.B(W++,sa,Rc)):(Rc=ib,Rc>=q.S.x&&Rc<=q.S.right&&(270===this.ga?oa>=q.S.y:oa<=q.S.bottom)&&(Ra=q.wa+(270===this.ga?-wd:wd),Rc=Rc<q.S.x+q.S.width/2?q.S.x-
this.ke/2:q.S.right+this.ke/2,b.B(W++,ib,Ra),b.B(W++,Rc,Ra)),b.B(W++,Rc,oa));b.B(W++,sa,oa)}else if(La)Oa=Math.max(10,this.Jg[q.layer]),pb=Math.max(10,this.Yf[q.layer]),180===this.ga&&sa>=q.S.x?(Ra=q.S.x+q.S.width,b.ia(W-2,Ra,ub),b.ia(W-1,Ra+pb,ub)):90===this.ga&&oa<=q.S.bottom?(Ra=q.S.y,b.ia(W-2,ib,Ra),b.ia(W-1,ib,Ra-Oa)):270===this.ga&&oa>=q.S.y?(Ra=q.S.y+q.S.height,b.ia(W-2,ib,Ra),b.ia(W-1,ib,Ra+pb)):0===this.ga&&sa<=q.S.right&&(Ra=q.S.x,b.ia(W-2,Ra,ub),b.ia(W-1,Ra-Oa,ub));else{Oa=Math.max(10,
this.Jg[q.layer]);pb=Math.max(10,this.Yf[q.layer]);vd=0;if(180===this.ga||0===this.ga){if(180===this.ga?sa<=q.S.x:sa>=q.S.right)vd=(0===this.ga?pb:-Oa)/2;b.B(W++,sa+vd,ub)}else{if(270===this.ga?oa<=q.S.y:oa>=q.S.bottom)vd=(90===this.ga?pb:-Oa)/2;b.B(W++,ib,oa+vd)}b.B(W++,sa,oa)}}else{for(;null!==q&&q!==r;){Qc=Sa=null;for(var vh=q.tc.j;vh.next();){var $e=vh.value;if($e.link===c.link&&(Sa=$e.toVertex,Qc=$e.fromVertex,null!==Qc.Gd&&(Qc=null),null===Sa.Gd))break}var ib=0,ub=0,sa=0,oa=0,ab=0,Oa=0,pb=0;
if(Sa!==r)if(ib=b.m(W-1).x,ub=b.m(W-1).y,sa=Sa.pa,oa=Sa.wa,hb)if(180===this.ga||0===this.ga){var Nd=null!==Qc?Qc.wa:ub;Nd!==oa&&(ab=this.Xb[Sa.layer],2===W&&(ab=0===this.ga?Math.max(ab,ib):Math.min(ab,ib)),b.B(W++,ab,ub),b.B(W++,ab,oa))}else{var Jf=null!==Qc?Qc.pa:ib;Jf!==sa&&(ab=this.Xb[Sa.layer],2===W&&(ab=90===this.ga?Math.max(ab,ub):Math.min(ab,ub)),b.B(W++,ib,ab),b.B(W++,sa,ab))}else Oa=Math.max(10,this.Jg[Sa.layer]),pb=Math.max(10,this.Yf[Sa.layer]),180===this.ga?(b.B(W++,sa+pb,oa),La&&b.B(W++,
sa,oa),b.B(W++,sa-Oa,oa)):90===this.ga?(b.B(W++,sa,oa-Oa),La&&b.B(W++,sa,oa),b.B(W++,sa,oa+pb)):270===this.ga?(b.B(W++,sa,oa+pb),La&&b.B(W++,sa,oa),b.B(W++,sa,oa-Oa)):(b.B(W++,sa-Oa,oa),La&&b.B(W++,sa,oa),b.B(W++,sa+pb,oa));q=Sa}hb&&(ib=b.m(W-1).x,ub=b.m(W-1).y,sa=b.m(W).x,oa=b.m(W).y,180===this.ga||0===this.ga?ub!==oa&&(ab=0===this.ga?Math.min(Math.max((sa+ib)/2,this.Xb[r.layer]),sa):Math.max(Math.min((sa+ib)/2,this.Xb[r.layer]),sa),b.B(W++,ab,ub),b.B(W++,ab,oa)):ib!==sa&&(ab=90===this.ga?Math.min(Math.max((oa+
ub)/2,this.Xb[r.layer]),oa):Math.max(Math.min((oa+ub)/2,this.Xb[r.layer]),oa),b.B(W++,ib,ab),b.B(W++,sa,ab)))}if(null!==d&&La){if(null!==h){if(n===dc){var ue=b.m(0),de=b.m(2);ue.P(de)||b.ia(1,(ue.x+de.x)/2,(ue.y+de.y)/2)}Da=b.getLinkPoint(e,h,dc,!0,!1,g,k);Da.F()||Da.set(e.Y.pm);b.ia(0,Da.x,Da.y)}null!==k&&(p===dc&&(ue=b.m(b.ta-1),de=b.m(b.ta-3),ue.P(de)||b.ia(b.ta-2,(ue.x+de.x)/2,(ue.y+de.y)/2)),Da=b.getLinkPoint(g,k,dc,!1,!1,e,h),Da.F()||Da.set(g.Y.pm),b.ia(b.ta-1,Da.x,Da.y))}b.Hj();c.commit()}}}for(var jd=
new K(J),wh=this.network.edges.j;wh.next();){var Kf=wh.value.link;null!==Kf&&Kf.jc&&!jd.contains(Kf)&&jd.add(Kf)}if(0<jd.count)if(90===this.ga||270===this.ga){for(var Jg=0,Gb=new K(pv),nc,xd,xh=jd.j;xh.next();){var qb=xh.value;if(null!==qb&&qb.jc)for(var Pa=2;Pa<qb.ta-3;Pa++)if(nc=qb.m(Pa),xd=qb.m(Pa+1),qv(nc.y,xd.y)&&!qv(nc.x,xd.x)){var Pb=new pv;Pb.layer=Math.floor(nc.y/2);var Lf=qb.m(0),Kg=qb.m(qb.ta-1);Pb.first=Lf.x*Lf.x+Lf.y;Pb.ue=Kg.x*Kg.x+Kg.y;Pb.jf=Math.min(nc.x,xd.x);Pb.Ge=Math.max(nc.x,
xd.x);Pb.index=Pa;Pb.link=qb;if(Pa+2<qb.ta){var yh=qb.m(Pa-1),jb=qb.m(Pa+2),yc=0;yh.y<nc.y?yc=jb.y<nc.y?3:nc.x<xd.x?2:1:yh.y>nc.y&&(yc=jb.y>nc.y?0:xd.x<nc.x?2:1);Pb.Pi=yc}Gb.add(Pb)}}if(1<Gb.count){Gb.sort(this.YG);for(var Zb=0;Zb<Gb.count;){for(var ve=Gb.o[Zb].layer,zc=Zb+1;zc<Gb.count&&Gb.o[zc].layer===ve;)zc++;if(1<zc-Zb)for(var Ac=Zb;Ac<zc;){for(var vb=Gb.o[Ac].Ge,oc=Zb+1;oc<zc&&Gb.o[oc].jf<vb;)vb=Math.max(vb,Gb.o[oc].Ge),oc++;var yb=oc-Ac;if(1<yb){Gb.cr(this.Uy,Ac,Ac+yb);for(var Fc=1,eb=Gb.o[Ac].ue,
Pa=Ac;Pa<oc;Pa++){var Ta=Gb.o[Pa];Ta.ue!==eb&&(Fc++,eb=Ta.ue)}Gb.cr(this.XG,Ac,Ac+yb);for(var Lb=1,eb=Gb.o[Ac].first,Pa=Ac;Pa<oc;Pa++)Ta=Gb.o[Pa],Ta.first!==eb&&(Lb++,eb=Ta.first);var yd=!0,kg=Lb;Fc<Lb?(yd=!1,kg=Fc,eb=Gb.o[Ac].ue,Gb.cr(this.Uy,Ac,Ac+yb)):eb=Gb.o[Ac].first;for(var af=0,Pa=Ac;Pa<oc;Pa++){Ta=Gb.o[Pa];(yd?Ta.first:Ta.ue)!==eb&&(af++,eb=yd?Ta.first:Ta.ue);qb=Ta.link;nc=qb.m(Ta.index);xd=qb.m(Ta.index+1);var bf=this.tG*(af-(kg-1)/2);if(!qb.Pj||rv(nc.x,nc.y+bf,xd.x,xd.y+bf))Jg++,qb.Lm(),
qb.ia(Ta.index,nc.x,nc.y+bf),qb.ia(Ta.index+1,xd.x,xd.y+bf),qb.Hj()}}Ac=oc}Zb=zc}}}else{for(var zj=0,Qb=new K(pv),pc,ec,kd=jd.j;kd.next();){var nb=kd.value;if(null!==nb&&nb.jc)for(var Rb=2;Rb<nb.ta-3;Rb++)if(pc=nb.m(Rb),ec=nb.m(Rb+1),qv(pc.x,ec.x)&&!qv(pc.y,ec.y)){var we=new pv;we.layer=Math.floor(pc.x/2);var zb=nb.m(0),ee=nb.m(nb.ta-1);we.first=zb.x+zb.y*zb.y;we.ue=ee.x+ee.y*ee.y;we.jf=Math.min(pc.y,ec.y);we.Ge=Math.max(pc.y,ec.y);we.index=Rb;we.link=nb;if(Rb+2<nb.ta){var zh=nb.m(Rb-1),Ah=nb.m(Rb+
2),Lg=0;zh.x<pc.x?Lg=Ah.x<pc.x?3:pc.y<ec.y?2:1:zh.x>pc.x&&(Lg=Ah.x>pc.x?0:ec.y<pc.y?2:1);we.Pi=Lg}Qb.add(we)}}if(1<Qb.count){Qb.sort(this.YG);for(var ld=0;ld<Qb.count;){for(var Od=Qb.o[ld].layer,fc=ld+1;fc<Qb.count&&Qb.o[fc].layer===Od;)fc++;if(1<fc-ld)for(var Ab=ld;Ab<fc;){for(var zd=Qb.o[Ab].Ge,ob=ld+1;ob<fc&&Qb.o[ob].jf<zd;)zd=Math.max(zd,Qb.o[ob].Ge),ob++;var gc=ob-Ab;if(1<gc){Qb.cr(this.Uy,Ab,Ab+gc);for(var li=1,ad=Qb.o[Ab].ue,Rb=Ab;Rb<ob;Rb++){var Hb=Qb.o[Rb];Hb.ue!==ad&&(li++,ad=Hb.ue)}Qb.cr(this.XG,
Ab,Ab+gc);for(var xe=1,ad=Qb.o[Ab].first,Rb=Ab;Rb<ob;Rb++)Hb=Qb.o[Rb],Hb.first!==ad&&(xe++,ad=Hb.first);var cf=!0,bd=xe;li<xe?(cf=!1,bd=li,ad=Qb.o[Ab].ue,Qb.cr(this.Uy,Ab,Ab+gc)):ad=Qb.o[Ab].first;for(var Mf=0,Rb=Ab;Rb<ob;Rb++){Hb=Qb.o[Rb];(cf?Hb.first:Hb.ue)!==ad&&(Mf++,ad=cf?Hb.first:Hb.ue);nb=Hb.link;pc=nb.m(Hb.index);ec=nb.m(Hb.index+1);var Nf=this.tG*(Mf-(bd-1)/2);if(!nb.Pj||rv(pc.x+Nf,pc.y,ec.x+Nf,ec.y))zj++,nb.Lm(),nb.ia(Hb.index,pc.x+Nf,pc.y),nb.ia(Hb.index+1,ec.x+Nf,ec.y),nb.Hj()}}Ab=ob}ld=
fc}}}};tu.prototype.YG=function(a,b){return a instanceof pv&&b instanceof pv&&a!==b?a.layer<b.layer?-1:a.layer>b.layer?1:a.jf<b.jf?-1:a.jf>b.jf?1:a.Ge<b.Ge?-1:a.Ge>b.Ge?1:0:0};tu.prototype.XG=function(a,b){return a instanceof pv&&b instanceof pv&&a!==b?a.first<b.first?-1:a.first>b.first||a.Pi<b.Pi?1:a.Pi>b.Pi||a.jf<b.jf?-1:a.jf>b.jf?1:a.Ge<b.Ge?-1:a.Ge>b.Ge?1:0:0};
tu.prototype.Uy=function(a,b){return a instanceof pv&&b instanceof pv&&a!==b?a.ue<b.ue?-1:a.ue>b.ue||a.Pi<b.Pi?1:a.Pi>b.Pi||a.jf<b.jf?-1:a.jf>b.jf?1:a.Ge<b.Ge?-1:a.Ge>b.Ge?1:0:0};function qv(a,b){v&&(D.p(a,tu,"isApprox:a"),D.p(b,tu,"isApprox:b"));var c=a-b;return-1<c&&1>c}function rv(a,b,c,d){v&&(D.p(a,tu,"isUnoccupied2:px"),D.p(b,tu,"isUnoccupied2:py"),D.p(c,tu,"isUnoccupied2:qx"),D.p(d,tu,"isUnoccupied2:qy"));return!0}
function Hu(a,b){var c,d=a.xe[b];if(d>=a.Ah.length){c=[];for(var e=0;e<a.Ah.length;e++)c[e]=a.Ah[e];a.Ah=c}void 0===a.Ah[d]||null===a.Ah[d]?c=[]:(c=a.Ah[d],a.Ah[d]=null);d=a.$s[b];for(e=0;e<d.length;e++){var g=d[e];c[g.index]=g}return c}function Iu(a,b,c){a.Ah[a.xe[b]]=c}D.defineProperty(tu,{layerSpacing:"layerSpacing"},function(){return this.hn},function(a){this.hn!==a&&(D.h(a,"number",tu,"layerSpacing"),0<=a&&(this.hn=a,this.L()))});
D.defineProperty(tu,{sL:"columnSpacing"},function(){return this.ke},function(a){this.ke!==a&&(D.h(a,"number",tu,"columnSpacing"),0<a&&(this.ke=a,this.L()))});D.defineProperty(tu,{direction:"direction"},function(){return this.ga},function(a){this.ga!==a&&(D.h(a,"number",tu,"direction"),0===a||90===a||180===a||270===a?(this.ga=a,this.L()):D.k("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))});
D.defineProperty(tu,{angle:"angle"},function(){return this.direction},function(a){this.direction=a});D.defineProperty(tu,{vI:"cycleRemoveOption"},function(){return this.Wo},function(a){this.Wo!==a&&(D.Da(a,tu,tu,"cycleRemoveOption"),a===Au||a===uu)&&(this.Wo=a,this.L())});D.defineProperty(tu,{zJ:"layeringOption"},function(){return this.yp},function(a){this.yp!==a&&(D.Da(a,tu,tu,"layeringOption"),a===vu||a===Su||a===Uu)&&(this.yp=a,this.L())});
D.defineProperty(tu,{mJ:"initializeOption"},function(){return this.np},function(a){this.np!==a&&(D.Da(a,tu,tu,"initializeOption"),a===wu||a===$u||a===Yu)&&(this.np=a,this.L())});D.defineProperty(tu,{$L:"iterations"},function(){return this.gn},function(a){this.gn!==a&&(D.p(a,zu,"iterations"),0<=a&&(this.gn=a,this.L()))});D.defineProperty(tu,{bI:"aggressiveOption"},function(){return this.Lo},function(a){this.Lo!==a&&(D.Da(a,tu,tu,"aggressiveOption"),a===dv||a===xu||a===ev)&&(this.Lo=a,this.L())});
D.defineProperty(tu,{tM:"packOption"},function(){return this.tj},function(a){this.tj!==a&&(D.h(a,"number",tu,"packOption"),0<=a&&8>a&&(this.tj=a,this.L()))});D.defineProperty(tu,{ar:"setsPortSpots"},function(){return this.vi},function(a){this.vi!==a&&(D.h(a,"boolean",tu,"setsPortSpots"),this.vi=a,this.L())});D.defineProperty(tu,{tG:"linkSpacing"},function(){return this.Hs},function(a){this.Hs!==a&&(D.h(a,"number",tu,"linkSpacing"),0<=a&&(this.Hs=a,this.L()))});D.w(tu,{HJ:"maxLayer"},function(){return this.Bb});
D.w(tu,{eM:"maxIndex"},function(){return this.Fw});D.w(tu,{dM:"maxColumn"},function(){return this.Sb});D.w(tu,{jM:"minIndexLayer"},function(){return this.Qs});D.w(tu,{fM:"maxIndexLayer"},function(){return this.Zf});var uu;tu.CycleDepthFirst=uu=D.s(tu,"CycleDepthFirst",0);var Au;tu.CycleGreedy=Au=D.s(tu,"CycleGreedy",1);var vu;tu.LayerOptimalLinkLength=vu=D.s(tu,"LayerOptimalLinkLength",0);var Su;tu.LayerLongestPathSink=Su=D.s(tu,"LayerLongestPathSink",1);var Uu;
tu.LayerLongestPathSource=Uu=D.s(tu,"LayerLongestPathSource",2);var wu;tu.InitDepthFirstOut=wu=D.s(tu,"InitDepthFirstOut",0);var $u;tu.InitDepthFirstIn=$u=D.s(tu,"InitDepthFirstIn",1);var Yu;tu.InitNaive=Yu=D.s(tu,"InitNaive",2);var dv;tu.AggressiveNone=dv=D.s(tu,"AggressiveNone",0);var xu;tu.AggressiveLess=xu=D.s(tu,"AggressiveLess",1);var ev;tu.AggressiveMore=ev=D.s(tu,"AggressiveMore",2);tu.PackNone=0;var fv;tu.PackExpand=fv=1;var gv;tu.PackStraighten=gv=2;var iv;tu.PackMedian=iv=4;var yu;
tu.PackAll=yu=7;function pv(){this.index=this.Ge=this.jf=this.ue=this.first=this.layer=0;this.link=null;this.Pi=0}D.oe(pv,{layer:!0,first:!0,ue:!0,jf:!0,Ge:!0,index:!0,link:!0,Pi:!0});function zu(){ta.call(this)}D.Ta(zu,ta);D.ka("LayeredDigraphNetwork",zu);zu.prototype.createVertex=function(){return new sv};zu.prototype.createEdge=function(){return new tv};
function sv(){ua.call(this);this.index=this.column=this.layer=-1;this.component=NaN;this.near=null;this.valid=!1;this.finish=this.qq=NaN;this.Ln=0;this.MB=this.NB=null}D.Ta(sv,ua);D.ka("LayeredDigraphVertex",sv);function tv(){va.call(this);this.forest=this.rev=this.valid=!1;this.portToPos=this.portFromPos=NaN;this.portToColOffset=this.portFromColOffset=0}D.Ta(tv,va);D.ka("LayeredDigraphEdge",tv);
function Z(){0<arguments.length&&D.zd(Z);Ig.call(this);this.Jd=new L(Object);this.mt=uv;this.Wf=vv;this.bu=wv;this.Cw=xv;this.KC=null;this.ei=!0;this.Bd=yv;this.xg=(new Ba(10,10)).freeze();this.Aa=new zv;this.Ba=new zv;this.xA=[]}D.Ta(Z,Ig);D.ka("TreeLayout",Z);Z.prototype.cloneProtected=function(a){Ig.prototype.cloneProtected.call(this,a);a.mt=this.mt;a.bu=this.bu;a.Cw=this.Cw;a.ei=this.ei;a.Bd=this.Bd;a.xg.assign(this.xg);a.Aa.copyInheritedPropertiesFrom(this.Aa);a.Ba.copyInheritedPropertiesFrom(this.Ba)};
Z.prototype.qc=function(a){a.Se===Z?0===a.name.indexOf("Alignment")?this.alignment=a:0===a.name.indexOf("Arrangement")?this.eg=a:0===a.name.indexOf("Compaction")?this.compaction=a:0===a.name.indexOf("Path")?this.path=a:0===a.name.indexOf("Sorting")?this.sorting=a:0===a.name.indexOf("Style")?this.HK=a:D.k("Unknown enum value: "+a):Ig.prototype.qc.call(this,a)};Z.prototype.createNetwork=function(){return new Av};
Z.prototype.makeNetwork=function(a){function b(a){if(a instanceof H)return!a.Mf&&"Comment"!==a.wd;if(a instanceof J){var b=a.Z;if(null===b||b.Mf||"Comment"===b.wd)return!1;a=a.ba;return null===a||a.Mf||"Comment"===a.wd?!1:!0}return!1}var c=this.createNetwork();c.$b=this;a instanceof E?(c.Sk(a.rg,!0,b),c.Sk(a.links,!0,b)):a instanceof I?c.Sk(a.lc,!1,b):c.Sk(a.j,!1,b);return c};
Z.prototype.doLayout=function(a){null===a&&D.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");null===this.network&&(this.network=this.makeNetwork(a));this.eg!==Bv&&(this.$d=this.initialOrigin(this.$d));var b=this.g;null===b&&a instanceof E&&(b=a);this.Wf=this.path===uv&&null!==b?b.ge?vv:Cv:this.path===uv?vv:this.path;if(0<this.network.vertexes.count){this.network.Rx();for(a=this.network.vertexes.j;a.next();)b=a.value,b.initialized=!1,b.level=
0,b.parent=null,b.children=[];if(0<this.Jd.count){a=new L(zv);for(b=this.Jd.j;b.next();){var c=b.value;c instanceof H?(c=this.network.Yn(c),null!==c&&a.add(c)):c instanceof zv&&a.add(c)}this.Jd=a}0===this.Jd.count&&this.findRoots();for(a=this.Jd.copy().j;a.next();)b=a.value,b.initialized||(b.initialized=!0,Dv(this,b));b=this.network.vertexes;for(a=null;a=Ev(b),0<a.count;)b=Fv(this,a),null!==b&&this.Jd.add(b),b.initialized=!0,Dv(this,b),b=a;for(a=this.Jd.j;a.next();)b=a.value,b instanceof zv&&Gv(this,
b);for(a=this.Jd.j;a.next();)b=a.value,b instanceof zv&&Hv(this,b);for(a=this.Jd.j;a.next();)b=a.value,b instanceof zv&&Iv(this,b);this.LA();if(this.BB===Jv){c=[];for(a=this.network.vertexes.j;a.next();){var d=a.value,b=d.parent;null===b&&(b=d);var b=0===b.angle||180===b.angle,e=c[d.level];void 0===e&&(e=0);c[d.level]=Math.max(e,b?d.width:d.height)}for(d=0;d<c.length;d++)void 0===c[d]&&(c[d]=0);this.KC=c;for(a=this.network.vertexes.j;a.next();)d=a.value,b=d.parent,null===b&&(b=d),0===b.angle||180===
b.angle?(180===b.angle&&(d.Du+=c[d.level]-d.width),d.width=c[d.level]):(270===b.angle&&(d.Eu+=c[d.level]-d.height),d.height=c[d.level])}else if(this.BB===Kv)for(a=this.network.vertexes.j;a.next();){c=a.value;b=0===c.angle||180===c.angle;e=-1;for(d=0;d<c.children.length;d++)var g=c.children[d],e=Math.max(e,b?g.width:g.height);if(0<=e)for(d=0;d<c.children.length;d++)g=c.children[d],b?(180===c.angle&&(g.Du+=e-g.width),g.width=e):(270===c.angle&&(g.Eu+=e-g.height),g.height=e)}for(a=this.Jd.j;a.next();)b=
a.value,b instanceof zv&&this.layoutTree(b);this.arrangeTrees();this.updateParts()}this.network=null;this.Jd=new L(Object);this.Af=!0};function Ev(a){var b=new L(zv);for(a=a.j;a.next();){var c=a.value;c.initialized||b.add(c)}return b}
Z.prototype.findRoots=function(){for(var a=this.network.vertexes,b=a.j;b.next();){var c=b.value;switch(this.Wf){case vv:0===c.vc.count&&this.Jd.add(c);break;case Cv:0===c.tc.count&&this.Jd.add(c);break;default:D.k("Unhandled path value "+this.Wf.toString())}}0===this.Jd.count&&(a=Fv(this,a),null!==a&&this.Jd.add(a))};
function Fv(a,b){for(var c=999999,d=null,e=b.j;e.next();){var g=e.value;switch(a.Wf){case vv:g.vc.count<c&&(c=g.vc.count,d=g);break;case Cv:g.tc.count<c&&(c=g.tc.count,d=g);break;default:D.k("Unhandled path value "+a.Wf.toString())}}return d}
function Dv(a,b){if(null!==b){v&&D.l(b,zv,Z,"walkTree:v");switch(a.Wf){case vv:if(0<b.tc.count){for(var c=new K(zv),d=b.AI;d.next();){var e=d.value;Lv(a,b,e)&&c.add(e)}0<c.count&&(b.children=c.Hc())}break;case Cv:if(0<b.vc.count){c=new K(zv);for(d=b.xK;d.next();)e=d.value,Lv(a,b,e)&&c.add(e);0<c.count&&(b.children=c.Hc())}break;default:D.k("Unhandled path value"+a.Wf.toString())}c=b.children;d=c.length;for(e=0;e<d;e++){var g=c[e];g.initialized=!0;g.level=b.level+1;g.parent=b;a.Jd.remove(g)}for(e=
0;e<d;e++)g=c[e],Dv(a,g)}}function Lv(a,b,c){v&&D.l(b,zv,Z,"walkOK:v");v&&D.l(c,zv,Z,"walkOK:c");if(c.initialized){var d;if(null===b)d=!1;else{v&&D.l(c,zv,Z,"isAncestor:a");v&&D.l(b,zv,Z,"isAncestor:b");for(d=b.parent;null!==d&&d!==c;)d=d.parent;d=d===c}if(d||c.level>b.level)return!1;a.removeChild(c.parent,c)}return!0}
Z.prototype.removeChild=function(a,b){if(null!==a&&null!==b){v&&D.l(a,zv,Z,"removeChild:p");v&&D.l(b,zv,Z,"removeChild:c");for(var c=a.children,d=0,e=0;e<c.length;e++)c[e]===b&&d++;if(0<d){for(var d=Array(c.length-d),g=0,e=0;e<c.length;e++)c[e]!==b&&(d[g++]=c[e]);a.children=d}}};
function Gv(a,b){if(null!==b){v&&D.l(b,zv,Z,"initializeTree:v");a.initializeTreeVertexValues(b);b.alignment===Mv&&a.sortTreeVertexChildren(b);for(var c=0,d=b.Nn,e=0,g=b.children,h=g.length,k=0;k<h;k++){var l=g[k];Gv(a,l);c+=l.descendantCount+1;d=Math.max(d,l.maxChildrenCount);e=Math.max(e,l.maxGenerationCount)}b.descendantCount=c;b.maxChildrenCount=d;b.maxGenerationCount=0<d?e+1:0}}
function Nv(a,b){v&&D.l(b,zv,Z,"mom:v");switch(a.bu){default:case wv:return null!==b.parent?b.parent:a.Aa;case Ov:return null===b.parent?a.Aa:null===b.parent.parent?a.Ba:b.parent;case Pv:return null!==b.parent?null!==b.parent.parent?b.parent.parent:a.Ba:a.Aa;case Qv:var c=!0;if(0===b.Nn)c=!1;else for(var d=b.children,e=d.length,g=0;g<e;g++)if(0<d[g].Nn){c=!1;break}return c&&null!==b.parent?a.Ba:null!==b.parent?b.parent:a.Aa}}
Z.prototype.initializeTreeVertexValues=function(a){v&&D.l(a,zv,Z,"initializeTreeVertexValues:v");var b=Nv(this,a);a.copyInheritedPropertiesFrom(b);if(null!==a.parent&&a.parent.alignment===Mv){for(var b=a.angle,c=a.parent.children,d=0;d<c.length&&a!==c[d];)d++;0===d%2?d!==c.length-1&&(b=90===b?180:180===b?270:270===b?180:270):b=90===b?0:180===b?90:270===b?0:90;a.angle=b}a.initialized=!0};
function Hv(a,b){if(null!==b){v&&D.l(b,zv,Z,"assignTree:v");a.assignTreeVertexValues(b);for(var c=b.children,d=c.length,e=0;e<d;e++)Hv(a,c[e])}}Z.prototype.assignTreeVertexValues=function(){};function Iv(a,b){if(null!==b){v&&D.l(b,zv,Z,"sortTree:v");b.alignment!==Mv&&a.sortTreeVertexChildren(b);for(var c=b.children,d=c.length,e=0;e<d;e++)Iv(a,c[e])}}
Z.prototype.sortTreeVertexChildren=function(a){v&&D.l(a,zv,Z,"sortTreeVertexChildren:v");switch(a.sorting){case Rv:break;case Sv:a.children.reverse();break;case Tv:a.children.sort(a.comparer);break;case Uv:a.children.sort(a.comparer);a.children.reverse();break;default:D.k("Unhandled sorting value "+a.sorting.toString())}};Z.prototype.LA=function(){if(this.comments)for(var a=this.network.vertexes.j;a.next();)this.addComments(a.value)};
Z.prototype.addComments=function(a){v&&D.l(a,zv,Z,"addComments:v");var b=a.angle,c=a.parent,d=0,e=Vv,e=!1;null!==c&&(d=c.angle,e=c.alignment,e=Wv(e));var b=90===b||270===b,d=90===d||270===d,c=0===a.Nn,g=0,h=0,k=0,l=a.commentSpacing;if(null!==a.ad)for(var m=a.ad.FF();m.next();){var n=m.value;"Comment"===n.wd&&n.canLayout()&&(null===a.comments&&(a.comments=[]),a.comments.push(n),n.Ue(),n=n.Ia,b&&!c||!e&&!d&&c||e&&d&&c?(g=Math.max(g,n.width),h+=n.height+Math.abs(k)):(g+=n.width+Math.abs(k),h=Math.max(h,
n.height)),k=l)}null!==a.comments&&(b&&!c||!e&&!d&&c||e&&d&&c?(g+=Math.abs(a.commentMargin),h=Math.max(0,h-a.height)):(h+=Math.abs(a.commentMargin),g=Math.max(0,g-a.width)),e=D.vg(0,0,a.S.width+g,a.S.height+h),a.lb=e,D.Hb(e))};function Wv(a){return a===Xv||a===Mv||a===Yv||a===Zv}function $v(a){return a===Xv||a===Mv}
function aw(a){v&&D.l(a,zv,Z,"isLeftSideBus:v");var b=a.parent;if(null!==b){var c=b.alignment;if(Wv(c)){if($v(c)){b=b.children;for(c=0;c<b.length&&a!==b[c];)c++;return 0===c%2}if(c===Yv)return!0}}return!1}
Z.prototype.layoutComments=function(a){v&&D.l(a,zv,Z,"layoutComments:v");if(null!==a.comments){var b=a.ad.Ia,c=a.parent,d=a.angle,e=0,g=Vv,g=!1;null!==c&&(e=c.angle,g=c.alignment,g=Wv(g));for(var c=90===d||270===d,d=90===e||270===e,h=0===a.Nn,k=aw(a),l=0,m=a.comments,n=m.length,p=D.O(),q=0;q<n;q++){var r=m[q],s=r.Ia;if(c&&!h||!g&&!d&&h||g&&d&&h){if(135<e&&!g||d&&k)if(0<=a.commentMargin)for(p.n(a.S.x-a.commentMargin-s.width,a.S.y+l),r.move(p),r=r.Yg();r.next();){var t=r.value;t.Ib=ed;t.Jb=fd}else for(p.n(a.S.x+
2*a.W.x-a.commentMargin,a.S.y+l),r.move(p),r=r.Yg();r.next();)t=r.value,t.Ib=fd,t.Jb=ed;else if(0<=a.commentMargin)for(p.n(a.S.x+2*a.W.x+a.commentMargin,a.S.y+l),r.move(p),r=r.Yg();r.next();)t=r.value,t.Ib=fd,t.Jb=ed;else for(p.n(a.S.x+a.commentMargin-s.width,a.S.y+l),r.move(p),r=r.Yg();r.next();)t=r.value,t.Ib=ed,t.Jb=fd;l=0<=a.commentSpacing?l+(s.height+a.commentSpacing):l+(a.commentSpacing-s.height)}else{if(135<e&&!g||!d&&k)if(0<=a.commentMargin)for(p.n(a.S.x+l,a.S.y-a.commentMargin-s.height),
r.move(p),r=r.Yg();r.next();)t=r.value,t.Ib=$c,t.Jb=gd;else for(p.n(a.S.x+l,a.S.y+2*a.W.y-a.commentMargin),r.move(p),r=r.Yg();r.next();)t=r.value,t.Ib=gd,t.Jb=$c;else if(0<=a.commentMargin)for(p.n(a.S.x+l,a.S.y+2*a.W.y+a.commentMargin),r.move(p),r=r.Yg();r.next();)t=r.value,t.Ib=gd,t.Jb=$c;else for(p.n(a.S.x+l,a.S.y+a.commentMargin-s.height),r.move(p),r=r.Yg();r.next();)t=r.value,t.Ib=$c,t.Jb=gd;l=0<=a.commentSpacing?l+(s.width+a.commentSpacing):l+(a.commentSpacing-s.width)}}D.A(p);b=l-a.commentSpacing-
(c?b.height:b.width);if(this.Wf===vv)for(e=a.tc;e.next();)a=e.value.link,null===a||a.Pj||(a.xm=0<b?b:NaN);else for(e=a.vc;e.next();)a=e.value.link,null===a||a.Pj||(a.Pm=0<b?b:NaN)}};
Z.prototype.layoutTree=function(a){if(null!==a){v&&D.l(a,zv,Z,"layoutTree:v");for(var b=a.children,c=b.length,d=0;d<c;d++)this.layoutTree(b[d]);switch(a.compaction){case bw:cw(this,a);break;case dw:if(a.alignment===Mv)cw(this,a);else if(v&&D.l(a,zv,Z,"layoutTreeBlock:v"),0===a.Nn){var d=a.parent,b=!1,c=0,e=Vv;null!==d&&(c=d.angle,e=d.alignment,b=Wv(e));d=aw(a);a.sa.n(0,0);a.tb.n(a.width,a.height);null===a.parent||null===a.comments||(180!==c&&270!==c||b)&&!d?a.Wa.n(0,0):180===c&&!b||(90===c||270===
c)&&d?a.Wa.n(a.width-2*a.W.x,0):a.Wa.n(0,a.height-2*a.W.y);a.Vu=null;a.ov=null}else{for(var g=ew(a),b=90===g||270===g,h=0,k=a.children,l=k.length,m=0;m<l;m++)var n=k[m],h=Math.max(h,b?n.tb.width:n.tb.height);var p=a.alignment,d=p===fw,q=p===gw,r=Wv(p),s=Math.max(0,a.breadthLimit),c=hw(a),t=a.nodeSpacing,u=iw(a),z=a.rowSpacing,w=0;if(d||q||a.Vq||a.Wq&&1===a.maxGenerationCount)w=Math.max(0,a.rowIndent);var d=a.width,e=a.height,y=0,B=0,P=0,G=null,Q=null,Y=0,U=0,ea=0,la=0,Da=0,La=0,hb=0,Aa=0,n=0;r&&!$v(p)&&
135<g&&k.reverse();if($v(p))if(1<l)for(m=0;m<l;m++)0===m%2&&m!==l-1?Aa=Math.max(Aa,b?k[m].tb.width:k[m].tb.height):0!==m%2&&(n=Math.max(n,b?k[m].tb.width:k[m].tb.height));else 1===l&&(Aa=b?k[0].tb.width:k[0].tb.height);if(r){switch(p){case Xv:B=135>g?jw(a,k,Aa,y,B):kw(a,k,Aa,y,B);Aa=B.x;y=B.width;B=B.height;break;case Yv:for(m=0;m<l;m++){var n=k[m],W=n.tb,G=0===La?0:z;b?(n.sa.n(h-W.width,la+G),y=Math.max(y,W.width),B=Math.max(B,la+G+W.height),la+=G+W.height):(n.sa.n(ea+G,h-W.height),y=Math.max(y,
ea+G+W.width),B=Math.max(B,W.height),ea+=G+W.width);La++}break;case Zv:for(m=0;m<l;m++)n=k[m],W=n.tb,G=0===La?0:z,b?(n.sa.n(t/2+a.W.x,la+G),y=Math.max(y,W.width),B=Math.max(B,la+G+W.height),la+=G+W.height):(n.sa.n(ea+G,t/2+a.W.y),y=Math.max(y,ea+G+W.width),B=Math.max(B,W.height),ea+=G+W.width),La++}G=Qw(this,2);Q=Qw(this,2);b?(G[0].n(0,0),G[1].n(0,B),Q[0].n(y,0)):(G[0].n(0,0),G[1].n(y,0),Q[0].n(0,B));Q[1].n(y,B)}else for(m=0;m<l;m++){n=k[m];W=n.tb;if(b){0<s&&0<La&&ea+t+W.width>s&&(ea<h&&Rw(a,p,h-
ea,0,hb,m-1),Da++,La=0,hb=m,P=B,ea=0,la=135<g?-B-z:B+z);Sw(this,n,0,la);var xb=0;if(0===La){if(G=n.Vu,Q=n.ov,Y=W.width,U=W.height,null===G||null===Q||g!==ew(n))G=Qw(this,2),Q=Qw(this,2),G[0].n(0,0),G[1].n(0,U),Q[0].n(Y,0),Q[1].n(Y,U)}else{var Ob=D.hb(),U=Tw(this,a,n,G,Q,Y,U,Ob),xb=U.x,G=Ob[0],Q=Ob[1],Y=U.width,U=U.height;D.ua(Ob);ea<W.width&&0>xb&&(Uw(a,-xb,0,hb,m-1),Vw(G,-xb,0),Vw(Q,-xb,0),xb=0)}n.sa.n(xb,la);y=Math.max(y,Y);B=Math.max(B,P+(0===Da?0:z)+W.height);ea=Y}else{0<s&&0<La&&la+t+W.height>
s&&(la<h&&Rw(a,p,0,h-la,hb,m-1),Da++,La=0,hb=m,P=y,la=0,ea=135<g?-y-z:y+z);Sw(this,n,ea,0);xb=0;if(0===La){if(G=n.Vu,Q=n.ov,Y=W.width,U=W.height,null===G||null===Q||g!==ew(n))G=Qw(this,2),Q=Qw(this,2),G[0].n(0,0),G[1].n(Y,0),Q[0].n(0,U),Q[1].n(Y,U)}else Ob=D.hb(),U=Tw(this,a,n,G,Q,Y,U,Ob),xb=U.x,G=Ob[0],Q=Ob[1],Y=U.width,U=U.height,D.ua(Ob),la<W.height&&0>xb&&(Uw(a,0,-xb,hb,m-1),Vw(G,0,-xb),Vw(Q,0,-xb),xb=0);n.sa.n(ea,xb);B=Math.max(B,U);y=Math.max(y,P+(0===Da?0:z)+W.width);la=U}La++}0<Da&&(b?(B+=
Math.max(0,c),ea<y&&Rw(a,p,y-ea,0,hb,l-1),0<w&&(q||Uw(a,w,0,0,l-1),y+=w)):(y+=Math.max(0,c),la<B&&Rw(a,p,0,B-la,hb,l-1),0<w&&(q||Uw(a,0,w,0,l-1),B+=w)));w=q=0;switch(p){case Ww:b?q+=y/2-a.W.x-u/2:w+=B/2-a.W.y-u/2;break;case Vv:0<Da?b?q+=y/2-a.W.x-u/2:w+=B/2-a.W.y-u/2:b?(Aa=k[0].sa.x+k[0].Wa.x,m=k[l-1].sa.x+k[l-1].Wa.x+2*k[l-1].W.x,q+=Aa+(m-Aa)/2-a.W.x-u/2):(Aa=k[0].sa.y+k[0].Wa.y,m=k[l-1].sa.y+k[l-1].Wa.y+2*k[l-1].W.y,w+=Aa+(m-Aa)/2-a.W.y-u/2);break;case fw:b?(q-=u,y+=u):(w-=u,B+=u);break;case gw:b?
(q+=y-a.width+u,y+=u):(w+=B-a.height+u,B+=u);break;case Xv:b?q=1<l?q+(Aa+t/2-a.W.x):q+(k[0].W.x-a.W.x+k[0].Wa.x):w=1<l?w+(Aa+t/2-a.W.y):w+(k[0].W.y-a.W.y+k[0].Wa.y);break;case Yv:b?q+=y+t/2-a.W.x:w+=B+t/2-a.W.y;break;case Zv:break;default:D.k("Unhandled alignment value "+p.toString())}for(m=0;m<l;m++)n=k[m],b?n.sa.n(n.sa.x+n.Wa.x-q,n.sa.y+(135<g?(r?-B:-n.tb.height)+n.Wa.y-c:e+c+n.Wa.y)):n.sa.n(n.sa.x+(135<g?(r?-y:-n.tb.width)+n.Wa.x-c:d+c+n.Wa.x),n.sa.y+n.Wa.y-w);l=k=0;r?b?(y=Xw(a,y,q),0>q&&(q=0),
135<g&&(w+=B+c),B+=e+c,p===Zv&&(k+=t/2+a.W.x),l+=e+c):(135<g&&(q+=y+c),y+=d+c,B=Yw(a,B,w),0>w&&(w=0),p===Zv&&(l+=t/2+a.W.y),k+=d+c):b?(null===a.comments?d>y&&(p=Zw(p,d-y,0),k=p.x,l=p.y,y=d,q=0):y=Xw(a,y,q),0>q&&(k-=q,q=0),135<g&&(w+=B+c),B=Math.max(Math.max(B,e),B+e+c),l+=e+c):(135<g&&(q+=y+c),y=Math.max(Math.max(y,d),y+d+c),null===a.comments?e>B&&(p=Zw(p,0,e-B),k=p.x,l=p.y,B=e,w=0):B=Yw(a,B,w),0>w&&(l-=w,w=0),k+=d+c);if(0<Da)g=Qw(this,4),p=Qw(this,4),b?(g[2].n(0,e+c),g[3].n(g[2].x,B),p[2].n(y,g[2].y),
p[3].n(p[2].x,g[3].y)):(g[2].n(d+c,0),g[3].n(y,g[2].y),p[2].n(g[2].x,B),p[3].n(g[3].x,p[2].y));else{g=Qw(this,G.length+2);p=Qw(this,Q.length+2);for(m=0;m<G.length;m++)r=G[m],g[m+2].n(r.x+k,r.y+l);for(m=0;m<Q.length;m++)r=Q[m],p[m+2].n(r.x+k,r.y+l)}b?(g[0].n(q,0),g[1].n(g[0].x,e),g[2].y<g[1].y&&(g[2].x>g[0].x?g[2].assign(g[1]):g[1].assign(g[2])),g[3].y<g[2].y&&(g[3].x>g[0].x?g[3].assign(g[2]):g[2].assign(g[3])),p[0].n(q+d,0),p[1].n(p[0].x,e),p[2].y<p[1].y&&(p[2].x<p[0].x?p[2].assign(p[1]):p[1].assign(p[2])),
p[3].y<p[2].y&&(p[3].x<p[0].x?p[3].assign(p[2]):p[2].assign(p[3])),g[2].y-=c/2,p[2].y-=c/2):(g[0].n(0,w),g[1].n(d,g[0].y),g[2].x<g[1].x&&(g[2].y>g[0].y?g[2].assign(g[1]):g[1].assign(g[2])),g[3].x<g[2].x&&(g[3].y>g[0].y?g[3].assign(g[2]):g[2].assign(g[3])),p[0].n(0,w+e),p[1].n(d,p[0].y),p[2].x<p[1].x&&(p[2].y<p[0].y?p[2].assign(p[1]):p[1].assign(p[2])),p[3].x<p[2].x&&(p[3].y<p[0].y?p[3].assign(p[2]):p[2].assign(p[3])),g[2].x-=c/2,p[2].x-=c/2);$w(this,G);$w(this,Q);a.Vu=g;a.ov=p;a.Wa.n(q,w);a.tb.n(y,
B)}break;default:D.k("Unhandled compaction value "+a.compaction.toString())}}};
function cw(a,b){v&&D.l(b,zv,Z,"layoutTreeNone:v");if(0===b.Nn){var c=!1,d=0,e=Vv;null!==b.parent&&(d=b.parent.angle,e=b.parent.alignment,c=Wv(e));e=aw(b);b.sa.n(0,0);b.tb.n(b.width,b.height);null===b.parent||null===b.comments||(180!==d&&270!==d||c)&&!e?b.Wa.n(0,0):180===d&&!c||(90===d||270===d)&&e?b.Wa.n(b.width-2*b.W.x,0):b.Wa.n(0,b.height-2*b.W.y)}else{for(var c=ew(b),d=90===c||270===c,g=0,e=b.children,h=e.length,k=0;k<h;k++)var l=e[k],g=Math.max(g,d?l.tb.width:l.tb.height);var m=b.alignment,n=
m===fw,p=m===gw,q=Wv(m),r=Math.max(0,b.breadthLimit),s=hw(b),t=b.nodeSpacing,u=iw(b),z=n||p?0:u/2,w=b.rowSpacing,y=0;if(n||p||b.Vq||b.Wq&&1===b.maxGenerationCount)y=Math.max(0,b.rowIndent);var n=b.width,B=b.height,P=0,G=0,Q=0,Y=0,U=0,ea=0,la=0,Da=0,La=0,hb=0;q&&!$v(m)&&135<c&&e.reverse();if($v(m))if(1<h)for(k=0;k<h;k++){var l=e[k],Aa=l.tb;0===k%2&&k!==h-1?La=Math.max(La,(d?Aa.width:Aa.height)+ax(l)-t):0!==k%2&&(hb=Math.max(hb,(d?Aa.width:Aa.height)+ax(l)-t))}else 1===h&&(La=d?e[0].tb.width:e[0].tb.height);
if(q)switch(m){case Xv:case Mv:G=135>c?jw(b,e,La,P,G):kw(b,e,La,P,G);La=G.x;P=G.width;G=G.height;break;case Yv:for(k=0;k<h;k++)l=e[k],Aa=l.tb,r=0===la?0:w,d?(l.sa.n(g-Aa.width,U+r),P=Math.max(P,Aa.width),G=Math.max(G,U+r+Aa.height),U+=r+Aa.height):(l.sa.n(Y+r,g-Aa.height),P=Math.max(P,Y+r+Aa.width),G=Math.max(G,Aa.height),Y+=r+Aa.width),la++;break;case Zv:for(g=0;g<h;g++)l=e[g],Aa=l.tb,r=0===la?0:w,d?(l.sa.n(t/2+b.W.x,U+r),P=Math.max(P,Aa.width),G=Math.max(G,U+r+Aa.height),U+=r+Aa.height):(l.sa.n(Y+
r,t/2+b.W.y),P=Math.max(P,Y+r+Aa.width),G=Math.max(G,Aa.height),Y+=r+Aa.width),la++}else for(k=0;k<h;k++)l=e[k],Aa=l.tb,d?(0<r&&0<la&&Y+t+Aa.width>r&&(Y<g&&Rw(b,m,g-Y,0,Da,k-1),ea++,la=0,Da=k,Q=G,Y=0,U=135<c?-G-w:G+w),hb=0===la?z:t,Sw(a,l,0,U),l.sa.n(Y+hb,U),P=Math.max(P,Y+hb+Aa.width),G=Math.max(G,Q+(0===ea?0:w)+Aa.height),Y+=hb+Aa.width):(0<r&&0<la&&U+t+Aa.height>r&&(U<g&&Rw(b,m,0,g-U,Da,k-1),ea++,la=0,Da=k,Q=P,U=0,Y=135<c?-P-w:P+w),hb=0===la?z:t,Sw(a,l,Y,0),l.sa.n(Y,U+hb),G=Math.max(G,U+hb+Aa.height),
P=Math.max(P,Q+(0===ea?0:w)+Aa.width),U+=hb+Aa.height),la++;0<ea&&(d?(G+=Math.max(0,s),Y<P&&Rw(b,m,P-Y,0,Da,h-1),0<y&&(p||Uw(b,y,0,0,h-1),P+=y)):(P+=Math.max(0,s),U<G&&Rw(b,m,0,G-U,Da,h-1),0<y&&(p||Uw(b,0,y,0,h-1),G+=y)));y=p=0;switch(m){case Ww:d?p+=P/2-b.W.x-u/2:y+=G/2-b.W.y-u/2;break;case Vv:0<ea?d?p+=P/2-b.W.x-u/2:y+=G/2-b.W.y-u/2:d?(m=e[0].sa.x+e[0].Wa.x,t=e[h-1].sa.x+e[h-1].Wa.x+2*e[h-1].W.x,p+=m+(t-m)/2-b.W.x-u/2):(m=e[0].sa.y+e[0].Wa.y,t=e[h-1].sa.y+e[h-1].Wa.y+2*e[h-1].W.y,y+=m+(t-m)/2-b.W.y-
u/2);break;case fw:d?(p-=u,P+=u):(y-=u,G+=u);break;case gw:d?(p+=P-b.width+u,P+=u):(y+=G-b.height+u,G+=u);break;case Xv:case Mv:d?p=1<h?p+(La+t/2-b.W.x):p+(e[0].W.x-b.W.x+e[0].Wa.x):y=1<h?y+(La+t/2-b.W.y):y+(e[0].W.y-b.W.y+e[0].Wa.y);break;case Yv:d?p+=P+t/2-b.W.x:y+=G+t/2-b.W.y;break;case Zv:break;default:D.k("Unhandled alignment value "+m.toString())}for(k=0;k<h;k++)l=e[k],d?l.sa.n(l.sa.x+l.Wa.x-p,l.sa.y+(135<c?(q?-G:-l.tb.height)+l.Wa.y-s:B+s+l.Wa.y)):l.sa.n(l.sa.x+(135<c?(q?-P:-l.tb.width)+l.Wa.x-
s:n+s+l.Wa.x),l.sa.y+l.Wa.y-y);d?(P=Xw(b,P,p),0>p&&(p=0),135<c&&(y+=G+s),G+=B+s):(135<c&&(p+=P+s),P+=n+s,G=Yw(b,G,y),0>y&&(y=0));b.Wa.n(p,y);b.tb.n(P,G)}}
function jw(a,b,c,d,e){v&&D.l(a,zv,Z,"layoutBusChildrenPosDir:v");var g=b.length;if(0===g)return new C(c,0,d,e);if(1===g){var h=b[0];d=h.tb.width;e=h.tb.height;return new C(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=90===ew(a),n=0,p=0,q=0,r=0;r<g;r++)if(!(0!==r%2||1<g&&r===g-1)){var h=b[r],s=h.tb,t=0===n?0:l;if(m){var u=ax(h)-k;h.sa.n(c-(s.width+u),q+t);d=Math.max(d,s.width+u);e=Math.max(e,q+t+s.height);q+=t+s.height}else u=ax(h)-k,h.sa.n(p+t,c-(s.height+u)),e=Math.max(e,s.height+u),d=Math.max(d,
p+t+s.width),p+=t+s.width;n++}var n=0,z=p,w=q;m?(p=c+k,q=0):(p=0,q=c+k);for(r=0;r<g;r++)0!==r%2&&(h=b[r],s=h.tb,t=0===n?0:l,m?(u=ax(h)-k,h.sa.n(p+u,q+t),d=Math.max(d,p+s.width+u),e=Math.max(e,q+t+s.height),q+=t+s.height):(u=ax(h)-k,h.sa.n(p+t,q+u),d=Math.max(d,p+t+s.width),e=Math.max(e,q+s.height+u),p+=t+s.width),n++);1<g&&1===g%2&&(h=b[g-1],s=h.tb,b=bx(h,m?Math.max(Math.abs(w),Math.abs(q)):Math.max(Math.abs(z),Math.abs(p))),m?(h.sa.n(c+k/2-h.W.x-h.Wa.x,e+b),m=c+k/2-h.W.x-h.Wa.x,d=Math.max(d,m+s.width),
0>m&&(d-=m),e=Math.max(e,Math.max(w,q)+b+s.height),0>h.sa.x&&(c=cx(a,h.sa.x,!1,c,k))):(h.sa.n(d+b,c+k/2-h.W.y-h.Wa.y),d=Math.max(d,Math.max(z,p)+b+s.width),m=c+k/2-h.W.y-h.Wa.y,e=Math.max(e,m+s.height),0>m&&(e-=m),0>h.sa.y&&(c=cx(a,h.sa.y,!0,c,k))));return new C(c,0,d,e)}
function kw(a,b,c,d,e){v&&D.l(a,zv,Z,"layoutBusChildrenNegDir:v");var g=b.length;if(0===g)return new C(c,0,d,e);if(1===g){var h=b[0];d=h.tb.width;e=h.tb.height;return new C(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=270===ew(a),n=0,p=0,q=0,r=0;r<g;r++)if(!(0!==r%2||1<g&&r===g-1)){var h=b[r],s=h.tb,t=0===n?0:l;if(m){var u=ax(h)-k,q=q-(t+s.height);h.sa.n(c-(s.width+u),q);d=Math.max(d,s.width+u);e=Math.max(e,Math.abs(q))}else u=ax(h)-k,p-=t+s.width,h.sa.n(p,c-(s.height+u)),e=Math.max(e,s.height+
u),d=Math.max(d,Math.abs(p));n++}var n=0,z=p,w=q;m?(p=c+k,q=0):(p=0,q=c+k);for(r=0;r<g;r++)0!==r%2&&(h=b[r],s=h.tb,t=0===n?0:l,m?(u=ax(h)-k,q-=t+s.height,h.sa.n(p+u,q),d=Math.max(d,p+s.width+u),e=Math.max(e,Math.abs(q))):(u=ax(h)-k,p-=t+s.width,h.sa.n(p,q+u),e=Math.max(e,q+s.height+u),d=Math.max(d,Math.abs(p))),n++);1<g&&1===g%2&&(h=b[g-1],s=h.tb,l=bx(h,m?Math.max(Math.abs(w),Math.abs(q)):Math.max(Math.abs(z),Math.abs(p))),m?(h.sa.n(c+k/2-h.W.x-h.Wa.x,-e-s.height-l),p=c+k/2-h.W.x-h.Wa.x,d=Math.max(d,
p+s.width),0>p&&(d-=p),e=Math.max(e,Math.abs(Math.min(w,q))+l+s.height),0>h.sa.x&&(c=cx(a,h.sa.x,!1,c,k))):(h.sa.n(-d-s.width-l,c+k/2-h.W.y-h.Wa.y),d=Math.max(d,Math.abs(Math.min(z,p))+l+s.width),p=c+k/2-h.W.y-h.Wa.y,e=Math.max(e,p+s.height),0>p&&(e-=p),0>h.sa.y&&(c=cx(a,h.sa.y,!0,c,k))));for(r=0;r<g;r++)h=b[r],m?h.sa.n(h.sa.x,h.sa.y+e):h.sa.n(h.sa.x+d,h.sa.y);return new C(c,0,d,e)}function ax(a){v&&D.l(a,zv,Z,"fixRelativePostions:child");return null===a.parent?0:a.parent.nodeSpacing}
function bx(a){v&&D.l(a,zv,Z,"fixRelativePostions:lastchild");return null===a.parent?0:a.parent.rowSpacing}function cx(a,b,c,d,e){v&&D.l(a,zv,Z,"fixRelativePostions:v");a=a.children;for(var g=a.length,h=0;h<g;h++)c?a[h].sa.n(a[h].sa.x,a[h].sa.y-b):a[h].sa.n(a[h].sa.x-b,a[h].sa.y);b=a[g-1];return Math.max(d,c?b.Wa.y+b.W.y-e/2:b.Wa.x+b.W.x-e/2)}
function Xw(a,b,c){v&&D.l(a,zv,Z,"calculateSubwidth:v");switch(a.alignment){case Vv:case Ww:var d=b;c+a.width>d&&(d=c+a.width);0>c&&(d-=c);return d;case fw:return a.width>b?a.width:b;case gw:return 2*a.W.x>b?a.width:b+a.width-2*a.W.x;case Xv:case Mv:return d=Math.min(0,c),c=Math.max(b,c+a.width),Math.max(a.width,c-d);case Yv:return a.width-a.W.x+a.nodeSpacing/2+b;case Zv:return Math.max(a.width,a.W.x+a.nodeSpacing/2+b);default:return b}}
function Yw(a,b,c){v&&D.l(a,zv,Z,"calculateSubheight:v");switch(a.alignment){case Vv:case Ww:var d=b;c+a.height>d&&(d=c+a.height);0>c&&(d-=c);return d;case fw:return a.height>b?a.height:b;case gw:return 2*a.W.y>b?a.height:b+a.height-2*a.W.y;case Xv:case Mv:return d=Math.min(0,c),c=Math.max(b,c+a.height),Math.max(a.height,c-d);case Yv:return a.height-a.W.y+a.nodeSpacing/2+b;case Zv:return Math.max(a.height,a.W.y+a.nodeSpacing/2+b);default:return b}}
function Zw(a,b,c){v&&D.l(a,xa,Z,"alignOffset:align");switch(a){case Ww:b/=2;c/=2;break;case Vv:b/=2;c/=2;break;case fw:c=b=0;break;case gw:break;default:D.k("Unhandled alignment value "+a.toString())}return new N(b,c)}function Rw(a,b,c,d,e,g){v&&D.l(a,zv,Z,"shiftRelPosAlign:v");v&&D.l(b,xa,Z,"shiftRelPosAlign:align");b=Zw(b,c,d);Uw(a,b.x,b.y,e,g)}function Uw(a,b,c,d,e){v&&D.l(a,zv,Z,"shiftRelPos:v");if(0!==b||0!==c)for(a=a.children;d<=e;d++){var g=a[d].sa;g.x+=b;g.y+=c}}
function Sw(a,b,c,d){v&&(D.l(b,zv,Z,"recordMidPoints:v"),D.h(c,"number",Z,"recordMidPoints:x"),D.h(d,"number",Z,"recordMidPoints:y"));var e=b.parent;switch(a.Wf){case vv:for(a=b.vc;a.next();)b=a.value,b.fromVertex===e&&b.tt.n(c,d);break;case Cv:for(a=b.tc;a.next();)b=a.value,b.toVertex===e&&b.tt.n(c,d);break;default:D.k("Unhandled path value "+a.Wf.toString())}}function Vw(a,b,c){for(var d=0;d<a.length;d++){var e=a[d];e.x+=b;e.y+=c}}
function Tw(a,b,c,d,e,g,h,k){v&&D.l(b,zv,Z,"mergeFringes:parent");v&&D.l(c,zv,Z,"mergeFringes:child");var l=ew(b),m=90===l||270===l,n=b.nodeSpacing;b=d;var p=e;d=g;e=h;var q=c.Vu,r=c.ov;h=c.tb;var s=m?Math.max(e,h.height):Math.max(d,h.width);if(null===q||l!==ew(c))q=Qw(a,2),r=Qw(a,2),m?(q[0].n(0,0),q[1].n(0,h.height),r[0].n(h.width,0),r[1].n(r[0].x,q[1].y)):(q[0].n(0,0),q[1].n(h.width,0),r[0].n(0,h.height),r[1].n(q[1].x,r[0].y));if(m){c=d;d=9999999;if(!(null===p||2>p.length||null===q||2>q.length))for(m=
l=0;l<p.length&&m<q.length;){e=p[l];var t=q[m];g=t.x;var u=t.y;g+=c;var z=e;l+1<p.length&&(z=p[l+1]);var w=t,t=w.x,w=w.y;m+1<q.length&&(w=q[m+1],t=w.x,w=w.y,t+=c);var y=d;e.y===u?y=g-e.x:e.y>u&&e.y<w?y=g+(e.y-u)/(w-u)*(t-g)-e.x:u>e.y&&u<z.y&&(y=g-(e.x+(u-e.y)/(z.y-e.y)*(z.x-e.x)));y<d&&(d=y);z.y<=e.y?l++:w<=u?m++:(z.y<=w&&l++,w<=z.y&&m++)}c-=d;c+=n;l=q;m=c;if(null===b||2>b.length||null===l||2>l.length)d=null;else{n=Qw(a,b.length+l.length);for(d=g=e=0;g<l.length&&l[g].y<b[0].y;)u=l[g++],n[d++].n(u.x+
m,u.y);for(;e<b.length;)u=b[e++],n[d++].n(u.x,u.y);for(e=b[b.length-1].y;g<l.length&&l[g].y<=e;)g++;for(;g<l.length&&l[g].y>e;)u=l[g++],n[d++].n(u.x+m,u.y);l=Qw(a,d);for(e=0;e<d;e++)l[e].assign(n[e]);$w(a,n);d=l}g=r;u=c;if(null===p||2>p.length||null===g||2>g.length)e=null;else{n=Qw(a,p.length+g.length);for(m=z=l=0;l<p.length&&p[l].y<g[0].y;)e=p[l++],n[m++].n(e.x,e.y);for(;z<g.length;)e=g[z++],n[m++].n(e.x+u,e.y);for(g=g[g.length-1].y;l<p.length&&p[l].y<=g;)l++;for(;l<p.length&&p[l].y>g;)e=p[l++],
n[m++].n(e.x,e.y);e=Qw(a,m);for(l=0;l<m;l++)e[l].assign(n[l]);$w(a,n)}g=Math.max(0,c)+h.width;h=s}else{c=e;d=9999999;if(!(null===p||2>p.length||null===q||2>q.length))for(m=l=0;l<p.length&&m<q.length;)e=p[l],t=q[m],g=t.x,u=t.y,u+=c,z=e,l+1<p.length&&(z=p[l+1]),w=t,t=w.x,w=w.y,m+1<q.length&&(w=q[m+1],t=w.x,w=w.y,w+=c),y=d,e.x===g?y=u-e.y:e.x>g&&e.x<t?y=u+(e.x-g)/(t-g)*(w-u)-e.y:g>e.x&&g<z.x&&(y=u-(e.y+(g-e.x)/(z.x-e.x)*(z.y-e.y))),y<d&&(d=y),z.x<=e.x?l++:t<=g?m++:(z.x<=t&&l++,t<=z.x&&m++);c-=d;c+=n;
l=q;m=c;if(null===b||2>b.length||null===l||2>l.length)d=null;else{n=Qw(a,b.length+l.length);for(d=g=e=0;g<l.length&&l[g].x<b[0].x;)u=l[g++],n[d++].n(u.x,u.y+m);for(;e<b.length;)u=b[e++],n[d++].n(u.x,u.y);for(e=b[b.length-1].x;g<l.length&&l[g].x<=e;)g++;for(;g<l.length&&l[g].x>e;)u=l[g++],n[d++].n(u.x,u.y+m);l=Qw(a,d);for(e=0;e<d;e++)l[e].assign(n[e]);$w(a,n);d=l}g=r;u=c;if(null===p||2>p.length||null===g||2>g.length)e=null;else{n=Qw(a,p.length+g.length);for(m=z=l=0;l<p.length&&p[l].x<g[0].x;)e=p[l++],
n[m++].n(e.x,e.y);for(;z<g.length;)e=g[z++],n[m++].n(e.x,e.y+u);for(g=g[g.length-1].x;l<p.length&&p[l].x<=g;)l++;for(;l<p.length&&p[l].x>g;)e=p[l++],n[m++].n(e.x,e.y);e=Qw(a,m);for(l=0;l<m;l++)e[l].assign(n[l]);$w(a,n)}g=s;h=Math.max(0,c)+h.height}$w(a,b);$w(a,q);$w(a,p);$w(a,r);k[0]=d;k[1]=e;return new C(c,0,g,h)}function Qw(a,b){var c=a.xA[b];if(void 0!==c&&(c=c.pop(),void 0!==c))return c;for(var c=[],d=0;d<b;d++)c[d]=new N;return c}
function $w(a,b){var c=b.length,d=a.xA[c];void 0===d&&(d=[],a.xA[c]=d);d.push(b)}
Z.prototype.arrangeTrees=function(){if(this.Bd===Bv)for(var a=this.Jd.j;a.next();){var b=a.value;if(b instanceof zv){var c=b.ad;if(null!==c){var d=c.position,c=d.x,d=d.y;isFinite(c)||(c=0);isFinite(d)||(d=0);dx(this,b,c,d)}}}else{c=[];for(a=this.Jd.j;a.next();)b=a.value,b instanceof zv&&c.push(b);switch(this.sorting){case Rv:break;case Sv:c.reverse();break;case Tv:c.sort(this.comparer);break;case Uv:c.sort(this.comparer);c.reverse();break;default:D.k("Unhandled sorting value "+this.sorting.toString())}b=
this.$d;a=b.x;b=b.y;for(d=0;d<c.length;d++){var e=c[d];dx(this,e,a+e.Wa.x,b+e.Wa.y);switch(this.Bd){case yv:b+=e.tb.height+this.xg.height;break;case ex:a+=e.tb.width+this.xg.width;break;default:D.k("Unhandled arrangement value "+this.Bd.toString())}}}};function dx(a,b,c,d){if(null!==b){v&&D.l(b,zv,Z,"assignAbsolutePositions:v");b.x=c;b.y=d;b=b.children;for(var e=b.length,g=0;g<e;g++){var h=b[g];dx(a,h,c+h.sa.x,d+h.sa.y)}}}
Z.prototype.commitLayout=function(){this.eC();this.commitNodes();this.QA();this.Tu&&this.commitLinks()};Z.prototype.commitNodes=function(){for(var a=this.network.vertexes.j;a.next();)a.value.commit();for(a.reset();a.next();)this.layoutComments(a.value)};
Z.prototype.QA=function(){if(this.BB===Jv){for(var a=this.KC,b=[],c=null,d=this.network.vertexes.j;d.next();){var e=d.value;null===c?c=e.lb.copy():c.lh(e.lb);var g=b[e.level],g=void 0===g?hw(e):Math.max(g,hw(e));b[e.level]=g}for(d=0;d<b.length;d++)void 0===b[d]&&(b[d]=0);90===this.angle||270===this.angle?(c.jg(this.nodeSpacing/2,this.layerSpacing),e=new N(-this.nodeSpacing/2,-this.layerSpacing/2)):(c.jg(this.layerSpacing,this.nodeSpacing/2),e=new N(-this.layerSpacing/2,-this.nodeSpacing/2));var g=
[],c=90===this.angle||270===this.angle?c.width:c.height,h=0;if(180===this.angle||270===this.angle)for(d=0;d<a.length;d++)h+=a[d]+b[d];for(d=0;d<a.length;d++){var k=a[d]+b[d];270===this.angle?(h-=k,g.push(new C(0,h,c,k))):90===this.angle?(g.push(new C(0,h,c,k)),h+=k):180===this.angle?(h-=k,g.push(new C(h,0,k,c))):(g.push(new C(h,0,k,c)),h+=k)}this.commitLayers(g,e)}};Z.prototype.commitLayers=function(){};Z.prototype.commitLinks=function(){for(var a=this.network.edges.j;a.next();)a.value.commit()};
Z.prototype.eC=function(){for(var a=this.Jd.j;a.next();){var b=a.value;b instanceof zv&&fx(this,b)}};function fx(a,b){if(null!==b){v&&D.l(b,zv,Z,"setPortSpotsTree:v");a.setPortSpots(b);for(var c=b.children,d=c.length,e=0;e<d;e++)fx(a,c[e])}}
Z.prototype.setPortSpots=function(a){v&&D.l(a,zv,Z,"setPortSpots:v");var b=a.alignment;if(Wv(b)){v&&D.l(a,zv,Z,"setPortSpotsBus:v");v&&D.l(b,xa,Z,"setPortSpots:align");var c=this.Wf===vv,d=ew(a),e;switch(d){case 0:e=fd;break;case 90:e=gd;break;case 180:e=ed;break;default:e=$c}var g=a.children,h=g.length;switch(b){case Xv:case Mv:for(b=0;b<h;b++){var k=g[b],k=(c?k.vc:k.tc).first();if(null!==k&&(k=k.link,null!==k)){var l=90===d||270===d?ed:$c;if(1===h||b===h-1&&1===h%2)switch(d){case 0:l=ed;break;case 90:l=
$c;break;case 180:l=fd;break;default:l=gd}else 0===b%2&&(l=90===d||270===d?fd:gd);c?(a.setsPortSpot&&(k.Ib=e),a.setsChildPortSpot&&(k.Jb=l)):(a.setsPortSpot&&(k.Ib=l),a.setsChildPortSpot&&(k.Jb=e))}}break;case Yv:l=90===d||270===d?fd:gd;for(d=c?a.tc:a.vc;d.next();)k=d.value.link,null!==k&&(c?(a.setsPortSpot&&(k.Ib=e),a.setsChildPortSpot&&(k.Jb=l)):(a.setsPortSpot&&(k.Ib=l),a.setsChildPortSpot&&(k.Jb=e)));break;case Zv:for(l=90===d||270===d?ed:$c,d=c?a.tc:a.vc;d.next();)k=d.value.link,null!==k&&(c?
(a.setsPortSpot&&(k.Ib=e),a.setsChildPortSpot&&(k.Jb=l)):(a.setsPortSpot&&(k.Ib=l),a.setsChildPortSpot&&(k.Jb=e)))}}else if(c=ew(a),this.Wf===vv)for(e=a.tc;e.next();){if(d=e.value.link,null!==d){if(a.setsPortSpot)if(a.portSpot.md())switch(c){case 0:d.Ib=fd;break;case 90:d.Ib=gd;break;case 180:d.Ib=ed;break;default:d.Ib=$c}else d.Ib=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.md())switch(c){case 0:d.Jb=ed;break;case 90:d.Jb=$c;break;case 180:d.Jb=fd;break;default:d.Jb=gd}else d.Jb=a.childPortSpot}}else for(e=
a.vc;e.next();)if(d=e.value.link,null!==d){if(a.setsPortSpot)if(a.portSpot.md())switch(c){case 0:d.Jb=fd;break;case 90:d.Jb=gd;break;case 180:d.Jb=ed;break;default:d.Jb=$c}else d.Jb=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.md())switch(c){case 0:d.Ib=ed;break;case 90:d.Ib=$c;break;case 180:d.Ib=fd;break;default:d.Ib=gd}else d.Ib=a.childPortSpot}};function ew(a){a=a.angle;return 45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}
function hw(a){v&&D.l(a,zv,Z,"computeLayerSpacing:v");var b=ew(a),b=90===b||270===b,c=a.layerSpacing;if(0<a.layerSpacingParentOverlap)var d=Math.min(1,a.layerSpacingParentOverlap),c=c-(b?a.height*d:a.width*d);c<(b?-a.height:-a.width)&&(c=b?-a.height:-a.width);return c}function iw(a){v&&D.l(a,zv,Z,"computeNodeIndent:v");var b=ew(a),b=90===b||270===b,c=a.nodeIndent;if(0<a.nodeIndentPastParent)var d=Math.min(1,a.nodeIndentPastParent),c=c+(b?a.width*d:a.height*d);return c=Math.max(0,c)}
D.defineProperty(Z,{DM:"roots"},function(){return this.Jd},function(a){this.Jd!==a&&(D.l(a,L,Z,"roots"),this.Jd=a,this.L())});D.defineProperty(Z,{path:"path"},function(){return this.mt},function(a){this.mt!==a&&(D.Da(a,Z,Z,"path"),this.mt=a,this.L())});D.defineProperty(Z,{HK:"treeStyle"},function(){return this.bu},function(a){this.Bd!==a&&(D.Da(a,Z,Z,"treeStyle"),a===wv||a===Pv||a===Qv||a===Ov)&&(this.bu=a,this.L())});
D.defineProperty(Z,{BB:"layerStyle"},function(){return this.Cw},function(a){this.Bd!==a&&(D.Da(a,Z,Z,"layerStyle"),a===xv||a===Kv||a===Jv)&&(this.Cw=a,this.L())});D.defineProperty(Z,{comments:"comments"},function(){return this.ei},function(a){this.ei!==a&&(D.h(a,"boolean",Z,"comments"),this.ei=a,this.L())});D.defineProperty(Z,{eg:"arrangement"},function(){return this.Bd},function(a){this.Bd!==a&&(D.Da(a,Z,Z,"arrangement"),a===yv||a===ex||a===Bv)&&(this.Bd=a,this.L())});
D.defineProperty(Z,{bF:"arrangementSpacing"},function(){return this.xg},function(a){D.l(a,Ba,Z,"arrangementSpacing");this.xg.P(a)||(this.xg.assign(a),this.L())});D.defineProperty(Z,{CM:"rootDefaults"},function(){return this.Aa},function(a){this.Aa!==a&&(D.l(a,zv,Z,"rootDefaults"),this.Aa=a,this.L())});D.defineProperty(Z,{$K:"alternateDefaults"},function(){return this.Ba},function(a){this.Ba!==a&&(D.l(a,zv,Z,"alternateDefaults"),this.Ba=a,this.L())});
D.defineProperty(Z,{sorting:"sorting"},function(){return this.Aa.sorting},function(a){this.Aa.sorting!==a&&(D.Da(a,Z,Z,"sorting"),a===Rv||a===Sv||a===Tv||Uv)&&(this.Aa.sorting=a,this.L())});D.defineProperty(Z,{comparer:"comparer"},function(){return this.Aa.comparer},function(a){this.Aa.comparer!==a&&(D.h(a,"function",Z,"comparer"),this.Aa.comparer=a,this.L())});
D.defineProperty(Z,{angle:"angle"},function(){return this.Aa.angle},function(a){this.Aa.angle!==a&&(D.h(a,"number",Z,"angle"),0===a||90===a||180===a||270===a?(this.Aa.angle=a,this.L()):D.k("TreeLayout.angle must be 0, 90, 180, or 270"))});D.defineProperty(Z,{alignment:"alignment"},function(){return this.Aa.alignment},function(a){this.Aa.alignment!==a&&(D.Da(a,Z,Z,"alignment"),this.Aa.alignment=a,this.L())});
D.defineProperty(Z,{nodeIndent:"nodeIndent"},function(){return this.Aa.nodeIndent},function(a){this.Aa.nodeIndent!==a&&(D.h(a,"number",Z,"nodeIndent"),0<=a&&(this.Aa.nodeIndent=a,this.L()))});D.defineProperty(Z,{nodeIndentPastParent:"nodeIndentPastParent"},function(){return this.Aa.nodeIndentPastParent},function(a){this.Aa.nodeIndentPastParent!==a&&(D.h(a,"number",Z,"nodeIndentPastParent"),0<=a&&1>=a&&(this.Aa.nodeIndentPastParent=a,this.L()))});
D.defineProperty(Z,{nodeSpacing:"nodeSpacing"},function(){return this.Aa.nodeSpacing},function(a){this.Aa.nodeSpacing!==a&&(D.h(a,"number",Z,"nodeSpacing"),this.Aa.nodeSpacing=a,this.L())});D.defineProperty(Z,{layerSpacing:"layerSpacing"},function(){return this.Aa.layerSpacing},function(a){this.Aa.layerSpacing!==a&&(D.h(a,"number",Z,"layerSpacing"),this.Aa.layerSpacing=a,this.L())});
D.defineProperty(Z,{layerSpacingParentOverlap:"layerSpacingParentOverlap"},function(){return this.Aa.layerSpacingParentOverlap},function(a){this.Aa.layerSpacingParentOverlap!==a&&(D.h(a,"number",Z,"layerSpacingParentOverlap"),0<=a&&1>=a&&(this.Aa.layerSpacingParentOverlap=a,this.L()))});D.defineProperty(Z,{compaction:"compaction"},function(){return this.Aa.compaction},function(a){this.Aa.compaction!==a&&(D.Da(a,Z,Z,"compaction"),a===bw||a===dw)&&(this.Aa.compaction=a,this.L())});
D.defineProperty(Z,{breadthLimit:"breadthLimit"},function(){return this.Aa.breadthLimit},function(a){this.Aa.breadthLimit!==a&&(D.h(a,"number",Z,"breadthLimit"),0<=a&&(this.Aa.breadthLimit=a,this.L()))});D.defineProperty(Z,{rowSpacing:"rowSpacing"},function(){return this.Aa.rowSpacing},function(a){this.Aa.rowSpacing!==a&&(D.h(a,"number",Z,"rowSpacing"),this.Aa.rowSpacing=a,this.L())});
D.defineProperty(Z,{rowIndent:"rowIndent"},function(){return this.Aa.rowIndent},function(a){this.Aa.rowIndent!==a&&(D.h(a,"number",Z,"rowIndent"),0<=a&&(this.Aa.rowIndent=a,this.L()))});D.defineProperty(Z,{commentSpacing:"commentSpacing"},function(){return this.Aa.commentSpacing},function(a){this.Aa.commentSpacing!==a&&(D.h(a,"number",Z,"commentSpacing"),this.Aa.commentSpacing=a,this.L())});
D.defineProperty(Z,{commentMargin:"commentMargin"},function(){return this.Aa.commentMargin},function(a){this.Aa.commentMargin!==a&&(D.h(a,"number",Z,"commentMargin"),this.Aa.commentMargin=a,this.L())});D.defineProperty(Z,{setsPortSpot:"setsPortSpot"},function(){return this.Aa.setsPortSpot},function(a){this.Aa.setsPortSpot!==a&&(D.h(a,"boolean",Z,"setsPortSpot"),this.Aa.setsPortSpot=a,this.L())});
D.defineProperty(Z,{portSpot:"portSpot"},function(){return this.Aa.portSpot},function(a){D.l(a,R,Z,"portSpot");this.Aa.portSpot.P(a)||(this.Aa.portSpot=a,this.L())});D.defineProperty(Z,{setsChildPortSpot:"setsChildPortSpot"},function(){return this.Aa.setsChildPortSpot},function(a){this.Aa.setsChildPortSpot!==a&&(D.h(a,"boolean",Z,"setsChildPortSpot"),this.Aa.setsChildPortSpot=a,this.L())});
D.defineProperty(Z,{childPortSpot:"childPortSpot"},function(){return this.Aa.childPortSpot},function(a){D.l(a,R,Z,"childPortSpot");this.Aa.childPortSpot.P(a)||(this.Aa.childPortSpot=a,this.L())});D.defineProperty(Z,{kL:"alternateSorting"},function(){return this.Ba.sorting},function(a){this.Ba.sorting!==a&&(D.Da(a,Z,Z,"alternateSorting"),a===Rv||a===Sv||a===Tv||Uv)&&(this.Ba.sorting=a,this.L())});
D.defineProperty(Z,{ZK:"alternateComparer"},function(){return this.Ba.comparer},function(a){this.Ba.comparer!==a&&(D.h(a,"function",Z,"alternateComparer"),this.Ba.comparer=a,this.L())});D.defineProperty(Z,{TK:"alternateAngle"},function(){return this.Ba.angle},function(a){this.Ba.angle!==a&&(D.h(a,"number",Z,"alternateAngle"),0===a||90===a||180===a||270===a)&&(this.Ba.angle=a,this.L())});
D.defineProperty(Z,{SK:"alternateAlignment"},function(){return this.Ba.alignment},function(a){this.Ba.alignment!==a&&(D.Da(a,Z,Z,"alternateAlignment"),this.Ba.alignment=a,this.L())});D.defineProperty(Z,{cL:"alternateNodeIndent"},function(){return this.Ba.nodeIndent},function(a){this.Ba.nodeIndent!==a&&(D.h(a,"number",Z,"alternateNodeIndent"),0<=a&&(this.Ba.nodeIndent=a,this.L()))});
D.defineProperty(Z,{dL:"alternateNodeIndentPastParent"},function(){return this.Ba.nodeIndentPastParent},function(a){this.Ba.nodeIndentPastParent!==a&&(D.h(a,"number",Z,"alternateNodeIndentPastParent"),0<=a&&1>=a&&(this.Ba.nodeIndentPastParent=a,this.L()))});D.defineProperty(Z,{eL:"alternateNodeSpacing"},function(){return this.Ba.nodeSpacing},function(a){this.Ba.nodeSpacing!==a&&(D.h(a,"number",Z,"alternateNodeSpacing"),this.Ba.nodeSpacing=a,this.L())});
D.defineProperty(Z,{aL:"alternateLayerSpacing"},function(){return this.Ba.layerSpacing},function(a){this.Ba.layerSpacing!==a&&(D.h(a,"number",Z,"alternateLayerSpacing"),this.Ba.layerSpacing=a,this.L())});D.defineProperty(Z,{bL:"alternateLayerSpacingParentOverlap"},function(){return this.Ba.layerSpacingParentOverlap},function(a){this.Ba.layerSpacingParentOverlap!==a&&(D.h(a,"number",Z,"alternateLayerSpacingParentOverlap"),0<=a&&1>=a&&(this.Ba.layerSpacingParentOverlap=a,this.L()))});
D.defineProperty(Z,{YK:"alternateCompaction"},function(){return this.Ba.compaction},function(a){this.Ba.compaction!==a&&(D.Da(a,Z,Z,"alternateCompaction"),a===bw||a===dw)&&(this.Ba.compaction=a,this.L())});D.defineProperty(Z,{UK:"alternateBreadthLimit"},function(){return this.Ba.breadthLimit},function(a){this.Ba.breadthLimit!==a&&(D.h(a,"number",Z,"alternateBreadthLimit"),0<=a&&(this.Ba.breadthLimit=a,this.L()))});
D.defineProperty(Z,{hL:"alternateRowSpacing"},function(){return this.Ba.rowSpacing},function(a){this.Ba.rowSpacing!==a&&(D.h(a,"number",Z,"alternateRowSpacing"),this.Ba.rowSpacing=a,this.L())});D.defineProperty(Z,{gL:"alternateRowIndent"},function(){return this.Ba.rowIndent},function(a){this.Ba.rowIndent!==a&&(D.h(a,"number",Z,"alternateRowIndent"),0<=a&&(this.Ba.rowIndent=a,this.L()))});
D.defineProperty(Z,{XK:"alternateCommentSpacing"},function(){return this.Ba.commentSpacing},function(a){this.Ba.commentSpacing!==a&&(D.h(a,"number",Z,"alternateCommentSpacing"),this.Ba.commentSpacing=a,this.L())});D.defineProperty(Z,{WK:"alternateCommentMargin"},function(){return this.Ba.commentMargin},function(a){this.Ba.commentMargin!==a&&(D.h(a,"number",Z,"alternateCommentMargin"),this.Ba.commentMargin=a,this.L())});
D.defineProperty(Z,{jL:"alternateSetsPortSpot"},function(){return this.Ba.setsPortSpot},function(a){this.Ba.setsPortSpot!==a&&(D.h(a,"boolean",Z,"alternateSetsPortSpot"),this.Ba.setsPortSpot=a,this.L())});D.defineProperty(Z,{fL:"alternatePortSpot"},function(){return this.Ba.portSpot},function(a){D.l(a,R,Z,"alternatePortSpot");this.Ba.portSpot.P(a)||(this.Ba.portSpot=a,this.L())});
D.defineProperty(Z,{iL:"alternateSetsChildPortSpot"},function(){return this.Ba.setsChildPortSpot},function(a){this.Ba.setsChildPortSpot!==a&&(D.h(a,"boolean",Z,"alternateSetsChildPortSpot"),this.Ba.setsChildPortSpot=a,this.L())});D.defineProperty(Z,{VK:"alternateChildPortSpot"},function(){return this.Ba.childPortSpot},function(a){D.l(a,R,Z,"alternateChildPortSpot");this.Ba.childPortSpot.P(a)||(this.Ba.childPortSpot=a,this.L())});var uv;Z.PathDefault=uv=D.s(Z,"PathDefault",-1);var vv;
Z.PathDestination=vv=D.s(Z,"PathDestination",0);var Cv;Z.PathSource=Cv=D.s(Z,"PathSource",1);var Rv;Z.SortingForwards=Rv=D.s(Z,"SortingForwards",10);var Sv;Z.SortingReverse=Sv=D.s(Z,"SortingReverse",11);var Tv;Z.SortingAscending=Tv=D.s(Z,"SortingAscending",12);var Uv;Z.SortingDescending=Uv=D.s(Z,"SortingDescending",13);var Ww;Z.AlignmentCenterSubtrees=Ww=D.s(Z,"AlignmentCenterSubtrees",20);var Vv;Z.AlignmentCenterChildren=Vv=D.s(Z,"AlignmentCenterChildren",21);var fw;
Z.AlignmentStart=fw=D.s(Z,"AlignmentStart",22);var gw;Z.AlignmentEnd=gw=D.s(Z,"AlignmentEnd",23);var Xv;Z.AlignmentBus=Xv=D.s(Z,"AlignmentBus",24);var Mv;Z.AlignmentBusBranching=Mv=D.s(Z,"AlignmentBusBranching",25);var Yv;Z.AlignmentTopLeftBus=Yv=D.s(Z,"AlignmentTopLeftBus",26);var Zv;Z.AlignmentBottomRightBus=Zv=D.s(Z,"AlignmentBottomRightBus",27);var bw;Z.CompactionNone=bw=D.s(Z,"CompactionNone",30);var dw;Z.CompactionBlock=dw=D.s(Z,"CompactionBlock",31);var wv;
Z.StyleLayered=wv=D.s(Z,"StyleLayered",40);var Qv;Z.StyleLastParents=Qv=D.s(Z,"StyleLastParents",41);var Pv;Z.StyleAlternating=Pv=D.s(Z,"StyleAlternating",42);var Ov;Z.StyleRootOnly=Ov=D.s(Z,"StyleRootOnly",43);var yv;Z.ArrangementVertical=yv=D.s(Z,"ArrangementVertical",50);var ex;Z.ArrangementHorizontal=ex=D.s(Z,"ArrangementHorizontal",51);var Bv;Z.ArrangementFixedRoots=Bv=D.s(Z,"ArrangementFixedRoots",52);var xv;Z.LayerIndividual=xv=D.s(Z,"LayerIndividual",60);var Kv;
Z.LayerSiblings=Kv=D.s(Z,"LayerSiblings",61);var Jv;Z.LayerUniform=Jv=D.s(Z,"LayerUniform",62);function Av(){ta.call(this)}D.Ta(Av,ta);D.ka("TreeNetwork",Av);Av.prototype.createVertex=function(){return new zv};Av.prototype.createEdge=function(){return new gx};
function zv(){ua.call(this);this.initialized=!1;this.parent=null;this.children=[];this.maxGenerationCount=this.maxChildrenCount=this.descendantCount=this.level=0;this.comments=null;this.sa=new N(0,0);this.tb=new Ba(0,0);this.Wa=new N(0,0);this.Wq=this.Vq=this.lK=!1;this.ov=this.Vu=null;this.sorting=Rv;this.comparer=As;this.angle=0;this.alignment=Vv;this.nodeIndentPastParent=this.nodeIndent=0;this.nodeSpacing=20;this.layerSpacing=50;this.layerSpacingParentOverlap=0;this.compaction=dw;this.breadthLimit=
0;this.rowSpacing=25;this.commentSpacing=this.rowIndent=10;this.commentMargin=20;this.setsPortSpot=!0;this.portSpot=Vc;this.setsChildPortSpot=!0;this.childPortSpot=Vc}D.Ta(zv,ua);D.ka("TreeVertex",zv);
zv.prototype.copyInheritedPropertiesFrom=function(a){null!==a&&(this.sorting=a.sorting,this.comparer=a.comparer,this.angle=a.angle,this.alignment=a.alignment,this.nodeIndent=a.nodeIndent,this.nodeIndentPastParent=a.nodeIndentPastParent,this.nodeSpacing=a.nodeSpacing,this.layerSpacing=a.layerSpacing,this.layerSpacingParentOverlap=a.layerSpacingParentOverlap,this.compaction=a.compaction,this.breadthLimit=a.breadthLimit,this.rowSpacing=a.rowSpacing,this.rowIndent=a.rowIndent,this.commentSpacing=a.commentSpacing,
this.commentMargin=a.commentMargin,this.setsPortSpot=a.setsPortSpot,this.portSpot=a.portSpot,this.setsChildPortSpot=a.setsChildPortSpot,this.childPortSpot=a.childPortSpot)};D.w(zv,{Nn:"childrenCount"},function(){return this.children.length});D.defineProperty(zv,{BM:"relativePosition"},function(){return this.sa},function(a){this.sa.set(a)});D.defineProperty(zv,{NM:"subtreeSize"},function(){return this.tb},function(a){this.tb.set(a)});
D.defineProperty(zv,{MM:"subtreeOffset"},function(){return this.Wa},function(a){this.Wa.set(a)});function gx(){va.call(this);this.tt=new N(0,0)}D.Ta(gx,va);D.ka("TreeEdge",gx);
gx.prototype.commit=function(){var a=this.link;if(null!==a&&!a.Pj){var b=this.network.$b,c=null,d=null;switch(b.Wf){case vv:c=this.fromVertex;d=this.toVertex;break;case Cv:c=this.toVertex;d=this.fromVertex;break;default:D.k("Unhandled path value "+b.Wf.toString())}if(null!==c&&null!==d)if(b=this.tt,0!==b.x||0!==b.y||c.lK){var d=c.lb,e=ew(c),g=hw(c),h=c.rowSpacing;a.Fo();var k=a.vf===Vj,l=a.jc,m=0,n,p;a.Lm();if(l||k){for(m=2;4<a.ta;)a.KG(2);n=a.m(1);p=a.m(2)}else{for(m=1;3<a.ta;)a.KG(1);n=a.m(0);p=
a.m(a.ta-1)}var q=a.m(a.ta-1),r=0;0===e?(c.alignment===gw?(r=d.bottom+b.y,0===b.y&&n.y>q.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-iw(c))))):c.alignment===fw?(r=d.top+b.y,0===b.y&&n.y<q.y-c.rowIndent&&(r=Math.max(r,Math.min(n.y,r+iw(c))))):r=c.Vq||c.Wq&&1===c.maxGenerationCount?d.top-c.Wa.y+b.y:d.y+d.height/2+b.y,k?(a.B(m,n.x,r),m++,a.B(m,d.right+g,r),m++,a.B(m,d.right+g+(b.x-h)/3,r),m++,a.B(m,d.right+g+2*(b.x-h)/3,r),m++,a.B(m,d.right+g+(b.x-h),r),m++,a.B(m,p.x,r)):(l&&(a.B(m,d.right+g/2,n.y),
m++),a.B(m,d.right+g/2,r),m++,a.B(m,d.right+g+b.x-(l?h/2:h),r),m++,l&&a.B(m,a.m(m-1).x,p.y))):90===e?(c.alignment===gw?(r=d.right+b.x,0===b.x&&n.x>q.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-iw(c))))):c.alignment===fw?(r=d.left+b.x,0===b.x&&n.x<q.x-c.rowIndent&&(r=Math.max(r,Math.min(n.x,r+iw(c))))):r=c.Vq||c.Wq&&1===c.maxGenerationCount?d.left-c.Wa.x+b.x:d.x+d.width/2+b.x,k?(a.B(m,r,n.y),m++,a.B(m,r,d.bottom+g),m++,a.B(m,r,d.bottom+g+(b.y-h)/3),m++,a.B(m,r,d.bottom+g+2*(b.y-h)/3),m++,a.B(m,r,d.bottom+
g+(b.y-h)),m++,a.B(m,r,p.y)):(l&&(a.B(m,n.x,d.bottom+g/2),m++),a.B(m,r,d.bottom+g/2),m++,a.B(m,r,d.bottom+g+b.y-(l?h/2:h)),m++,l&&a.B(m,p.x,a.m(m-1).y))):180===e?(c.alignment===gw?(r=d.bottom+b.y,0===b.y&&n.y>q.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-iw(c))))):c.alignment===fw?(r=d.top+b.y,0===b.y&&n.y<q.y-c.rowIndent&&(r=Math.max(r,Math.min(n.y,r+iw(c))))):r=c.Vq||c.Wq&&1===c.maxGenerationCount?d.top-c.Wa.y+b.y:d.y+d.height/2+b.y,k?(a.B(m,n.x,r),m++,a.B(m,d.left-g,r),m++,a.B(m,d.left-g+(b.x+
h)/3,r),m++,a.B(m,d.left-g+2*(b.x+h)/3,r),m++,a.B(m,d.left-g+(b.x+h),r),m++,a.B(m,p.x,r)):(l&&(a.B(m,d.left-g/2,n.y),m++),a.B(m,d.left-g/2,r),m++,a.B(m,d.left-g+b.x+(l?h/2:h),r),m++,l&&a.B(m,a.m(m-1).x,p.y))):270===e?(c.alignment===gw?(r=d.right+b.x,0===b.x&&n.x>q.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-iw(c))))):c.alignment===fw?(r=d.left+b.x,0===b.x&&n.x<q.x-c.rowIndent&&(r=Math.max(r,Math.min(n.x,r+iw(c))))):r=c.Vq||c.Wq&&1===c.maxGenerationCount?d.left-c.Wa.x+b.x:d.x+d.width/2+b.x,k?(a.B(m,
r,n.y),m++,a.B(m,r,d.top-g),m++,a.B(m,r,d.top-g+(b.y+h)/3),m++,a.B(m,r,d.top-g+2*(b.y+h)/3),m++,a.B(m,r,d.top-g+(b.y+h)),m++,a.B(m,r,p.y)):(l&&(a.B(m,n.x,d.top-g/2),m++),a.B(m,r,d.top-g/2),m++,a.B(m,r,d.top-g+b.y+(l?h/2:h)),m++,l&&a.B(m,p.x,a.m(m-1).y))):D.k("Invalid angle "+e);a.Hj()}else e=c,g=d,v&&D.l(e,zv,gx,"adjustRouteForAngleChange:parent"),v&&D.l(g,zv,gx,"adjustRouteForAngleChange:child"),a=this.link,c=ew(e),c!==ew(g)&&(b=hw(e),d=e.lb,e=g.lb,0===c&&e.left-d.right<b+1||90===c&&e.top-d.bottom<
b+1||180===c&&d.left-e.right<b+1||270===c&&d.top-e.bottom<b+1||(a.Fo(),e=a.vf===Vj,g=a.jc,h=Wv(this.fromVertex.alignment),a.Lm(),0===c?(c=d.right+b/2,e?4===a.ta&&(b=a.m(3).y,a.ia(1,c-20,a.m(1).y),a.B(2,c-20,b),a.B(3,c,b),a.B(4,c+20,b),a.ia(5,a.m(5).x,b)):g?h?a.ia(3,a.m(2).x,a.m(4).y):6===a.ta&&(a.ia(2,c,a.m(2).y),a.ia(3,c,a.m(3).y)):4===a.ta?a.B(2,c,a.m(2).y):3===a.ta?a.ia(1,c,a.m(2).y):2===a.ta&&a.B(1,c,a.m(1).y)):90===c?(b=d.bottom+b/2,e?4===a.ta&&(c=a.m(3).x,a.ia(1,a.m(1).x,b-20),a.B(2,c,b-20),
a.B(3,c,b),a.B(4,c,b+20),a.ia(5,c,a.m(5).y)):g?h?a.ia(3,a.m(2).x,a.m(4).y):6===a.ta&&(a.ia(2,a.m(2).x,b),a.ia(3,a.m(3).x,b)):4===a.ta?a.B(2,a.m(2).x,b):3===a.ta?a.ia(1,a.m(2).x,b):2===a.ta&&a.B(1,a.m(1).x,b)):180===c?(c=d.left-b/2,e?4===a.ta&&(b=a.m(3).y,a.ia(1,c+20,a.m(1).y),a.B(2,c+20,b),a.B(3,c,b),a.B(4,c-20,b),a.ia(5,a.m(5).x,b)):g?h?a.ia(3,a.m(2).x,a.m(4).y):6===a.ta&&(a.ia(2,c,a.m(2).y),a.ia(3,c,a.m(3).y)):4===a.ta?a.B(2,c,a.m(2).y):3===a.ta?a.ia(1,c,a.m(2).y):2===a.ta&&a.B(1,c,a.m(1).y)):270===
c&&(b=d.top-b/2,e?4===a.ta&&(c=a.m(3).x,a.ia(1,a.m(1).x,b+20),a.B(2,c,b+20),a.B(3,c,b),a.B(4,c,b-20),a.ia(5,c,a.m(5).y)):g?h?a.ia(3,a.m(2).x,a.m(4).y):6===a.ta&&(a.ia(2,a.m(2).x,b),a.ia(3,a.m(3).x,b)):4===a.ta?a.B(2,a.m(2).x,b):3===a.ta?a.ia(1,a.m(2).x,b):2===a.ta&&a.B(1,a.m(1).x,b)),a.Hj()))}};D.defineProperty(gx,{AM:"relativePoint"},function(){return this.tt},function(a){this.tt.set(a)});function hx(){O.call(this);this.bf=null}D.Ta(hx,O);
hx.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.element=this.bf.cloneNode(!0)};hx.prototype.toString=function(){return"HTMLHost("+this.bf.toString()+")#"+D.Nd(this)};
hx.prototype.Zk=function(a,b){var c=this.bf;if(null!==c){var d=this.gb(mc);d.x-=this.Y.width/2;d.y-=this.Y.height/2;d.x-=this.Y.x;d.y-=this.Y.y;var d=b.zv(d),e=b.Kj;null===e||e.contains(c)||e.appendChild(c);e=this.transform;c.style.transform="matrix("+e.m11+","+e.m12+","+e.m21+","+e.m22+","+e.dx+","+e.dy+")";c.style.transformOrigin="0 0";e=d.y;c.style.left=d.x+"px";c.style.top=e+"px"}};
hx.prototype.oo=function(a,b,c,d){var e=this.Ea;isFinite(e.width)&&(a=e.width);isFinite(e.height)&&(b=e.height);var e=this.pf,g=this.$g;c=Math.max(c,g.width);d=Math.max(d,g.height);a=Math.min(e.width,a);b=Math.min(e.height,b);a=Math.max(c,a);b=Math.max(d,b);c=this.bf;null!==c&&(b=c.getBoundingClientRect(),a=b.width,b=b.height);Cb(this.Xc,a,b);Lo(this,0,0,a,b)};hx.prototype.Fj=function(a,b,c,d){So(this,a,b,c,d)};D.w(hx,{Fa:"naturalBounds"},function(){return this.Xc});
D.defineProperty(hx,{element:"element"},function(){return this.bf},function(a){var b=this.bf;b!==a&&(a instanceof HTMLElement||D.k("HTMLHost.element must be an instance of Element."),this.bf=a,a.className="HTMLHost",this.i("element",b,a),this.ra())});aa.version="1.8.33";
window&&(window.module&&"object"===typeof window.module&&"object"===typeof window.module.exports?window.module.exports=aa:window.define&&"function"===typeof window.define&&window.define.amd?(window.go=aa,window.define(aa)):window.go=aa);"undefined"!==typeof module&&"object"===typeof module.exports&&(module.exports=aa); })(window);
|
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.0.5 (2019-05-09)
*/
(function () {
var autosave = (function (domGlobals) {
'use strict';
var Cell = function (initial) {
var value = initial;
var get = function () {
return value;
};
var set = function (v) {
value = v;
};
var clone = function () {
return Cell(get());
};
return {
get: get,
set: set,
clone: clone
};
};
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Delay');
var global$2 = tinymce.util.Tools.resolve('tinymce.util.LocalStorage');
var global$3 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var fireRestoreDraft = function (editor) {
return editor.fire('RestoreDraft');
};
var fireStoreDraft = function (editor) {
return editor.fire('StoreDraft');
};
var fireRemoveDraft = function (editor) {
return editor.fire('RemoveDraft');
};
var parse = function (timeString, defaultTime) {
var multiples = {
s: 1000,
m: 60000
};
var toParse = timeString || defaultTime;
var parsedTime = /^(\d+)([ms]?)$/.exec('' + toParse);
return (parsedTime[2] ? multiples[parsedTime[2]] : 1) * parseInt(toParse, 10);
};
var shouldAskBeforeUnload = function (editor) {
return editor.getParam('autosave_ask_before_unload', true);
};
var getAutoSavePrefix = function (editor) {
var prefix = editor.getParam('autosave_prefix', 'tinymce-autosave-{path}{query}{hash}-{id}-');
prefix = prefix.replace(/\{path\}/g, domGlobals.document.location.pathname);
prefix = prefix.replace(/\{query\}/g, domGlobals.document.location.search);
prefix = prefix.replace(/\{hash\}/g, domGlobals.document.location.hash);
prefix = prefix.replace(/\{id\}/g, editor.id);
return prefix;
};
var shouldRestoreWhenEmpty = function (editor) {
return editor.getParam('autosave_restore_when_empty', false);
};
var getAutoSaveInterval = function (editor) {
return parse(editor.settings.autosave_interval, '30s');
};
var getAutoSaveRetention = function (editor) {
return parse(editor.settings.autosave_retention, '20m');
};
var isEmpty = function (editor, html) {
var forcedRootBlockName = editor.settings.forced_root_block;
html = global$3.trim(typeof html === 'undefined' ? editor.getBody().innerHTML : html);
return html === '' || new RegExp('^<' + forcedRootBlockName + '[^>]*>((\xA0| |[ \t]|<br[^>]*>)+?|)</' + forcedRootBlockName + '>|<br>$', 'i').test(html);
};
var hasDraft = function (editor) {
var time = parseInt(global$2.getItem(getAutoSavePrefix(editor) + 'time'), 10) || 0;
if (new Date().getTime() - time > getAutoSaveRetention(editor)) {
removeDraft(editor, false);
return false;
}
return true;
};
var removeDraft = function (editor, fire) {
var prefix = getAutoSavePrefix(editor);
global$2.removeItem(prefix + 'draft');
global$2.removeItem(prefix + 'time');
if (fire !== false) {
fireRemoveDraft(editor);
}
};
var storeDraft = function (editor) {
var prefix = getAutoSavePrefix(editor);
if (!isEmpty(editor) && editor.isDirty()) {
global$2.setItem(prefix + 'draft', editor.getContent({
format: 'raw',
no_events: true
}));
global$2.setItem(prefix + 'time', new Date().getTime().toString());
fireStoreDraft(editor);
}
};
var restoreDraft = function (editor) {
var prefix = getAutoSavePrefix(editor);
if (hasDraft(editor)) {
editor.setContent(global$2.getItem(prefix + 'draft'), { format: 'raw' });
fireRestoreDraft(editor);
}
};
var startStoreDraft = function (editor, started) {
var interval = getAutoSaveInterval(editor);
if (!started.get()) {
global$1.setInterval(function () {
if (!editor.removed) {
storeDraft(editor);
}
}, interval);
started.set(true);
}
};
var restoreLastDraft = function (editor) {
editor.undoManager.transact(function () {
restoreDraft(editor);
removeDraft(editor);
});
editor.focus();
};
function curry(fn) {
var initialArgs = [];
for (var _i = 1; _i < arguments.length; _i++) {
initialArgs[_i - 1] = arguments[_i];
}
return function () {
var restArgs = [];
for (var _i = 0; _i < arguments.length; _i++) {
restArgs[_i] = arguments[_i];
}
var all = initialArgs.concat(restArgs);
return fn.apply(null, all);
};
}
var get = function (editor) {
return {
hasDraft: curry(hasDraft, editor),
storeDraft: curry(storeDraft, editor),
restoreDraft: curry(restoreDraft, editor),
removeDraft: curry(removeDraft, editor),
isEmpty: curry(isEmpty, editor)
};
};
var global$4 = tinymce.util.Tools.resolve('tinymce.EditorManager');
global$4._beforeUnloadHandler = function () {
var msg;
global$3.each(global$4.get(), function (editor) {
if (editor.plugins.autosave) {
editor.plugins.autosave.storeDraft();
}
if (!msg && editor.isDirty() && shouldAskBeforeUnload(editor)) {
msg = editor.translate('You have unsaved changes are you sure you want to navigate away?');
}
});
return msg;
};
var setup = function (editor) {
domGlobals.window.onbeforeunload = global$4._beforeUnloadHandler;
};
var makeSetupHandler = function (editor, started) {
return function (api) {
api.setDisabled(!hasDraft(editor));
var editorEventCallback = function () {
return api.setDisabled(!hasDraft(editor));
};
editor.on('StoreDraft RestoreDraft RemoveDraft', editorEventCallback);
return function () {
return editor.off('StoreDraft RestoreDraft RemoveDraft', editorEventCallback);
};
};
};
var register = function (editor, started) {
startStoreDraft(editor, started);
editor.ui.registry.addButton('restoredraft', {
tooltip: 'Restore last draft',
icon: 'restore-draft',
onAction: function () {
restoreLastDraft(editor);
},
onSetup: makeSetupHandler(editor, started)
});
editor.ui.registry.addMenuItem('restoredraft', {
text: 'Restore last draft',
icon: 'restore-draft',
onAction: function () {
restoreLastDraft(editor);
},
onSetup: makeSetupHandler(editor, started)
});
};
global.add('autosave', function (editor) {
var started = Cell(false);
setup(editor);
register(editor, started);
editor.on('init', function () {
if (shouldRestoreWhenEmpty(editor) && editor.dom.isEmpty(editor.getBody())) {
restoreDraft(editor);
}
});
return get(editor);
});
function Plugin () {
}
return Plugin;
}(window));
})();
|
lychee.define('tool.UI').requires([
'tool.UIGenerator',
'ui.Main',
'ui.Button',
'ui.Input',
'ui.Lightbox',
'ui.Option',
'ui.Radios',
'ui.Select',
'ui.Textarea'
]).exports(function(lychee, global) {
var Class = function(data) {
this.rulesets = null;
this.settings = lychee.extend({}, this.defaults, data);
this.__exportFlag = false;
this.__state = 'default';
this.__templates = {
button: '',
input: ''
};
this.__init();
this.__generator = new tool.UIGenerator(null);
this.__generator.bind('ready', this.__export, this);
this.__lightbox = new ui.Lightbox('ui-lightbox', 'Exported UI Entity');
ui.Main.get('main').add(this.__lightbox);
var templates = [
'./asset/ui/button.css'
];
this.__preloader = new lychee.Preloader();
this.__preloader.bind('ready', function(assets) {
this.__templates.button = assets[templates[0]];
this.__initUI();
this.rulesets = this.__parse(this.__textarea.get());
this.__refresh();
}, this);
this.__preloader.bind('error', function(urls) {
if (lychee.debug === true) {
console.warn('Preloader error for these urls: ', urls);
}
}, this);
this.__preloader.load(templates, null, 'txt');
};
Class.prototype = {
defaults: {
type: 'button',
width: 300,
height: 200
},
/*
* PRIVATE API
*/
__init: function() {
this.__canvas = document.createElement('canvas');
this.__context = this.__canvas.getContext('2d');
var that = this;
this.__canvas.onmousedown = function() {
that.__state = 'touch';
that.__render();
};
this.__canvas.onmouseup = function() {
that.__state = 'default';
that.__render();
};
this.__canvas.onmouseleave = function() {
that.__state = 'default';
that.__render();
};
var viewport = ui.Main.get('viewport');
viewport.add(this.__canvas);
},
__initUI: function() {
var select = null;
var options = null;
var navi = ui.Main.get('navi');
select = new ui.Select(function(value) {
this.settings.type = value;
this.__refresh();
}, this);
new ui.Option('lychee.ui.Button', 'button').addTo(select);
new ui.Option('lychee.ui.Sprite', 'sprite').addTo(select);
new ui.Option('lychee.ui.Tile', 'tile').addTo(select);
select.set(this.settings.type);
navi.add('Type', select);
navi.add('Width', new ui.Input('number', this.settings.width, function(value) {
this.settings.width = value;
this.__refresh();
}, this));
navi.add('Height', new ui.Input('number', this.settings.height, function(value) {
this.settings.height = value;
this.__refresh();
}, this));
navi.add('Debug Mode', new ui.Radios([ 'on', 'off' ], 'off', function(value) {
if (value === 'on') {
lychee.debug = true;
ui.Main.get('log').show();
} else {
lychee.debug = false;
ui.Main.get('log').clear();
ui.Main.get('log').hide();
}
}, this));
this.__textarea = new ui.Textarea(this.__templates.button, function(value) {
this.rulesets = null;
this.rulesets = this.__parse(value);
this.__refresh();
}, this);
navi.add(null, this.__textarea);
var actions = document.createElement('div');
actions.className = 'ui-actions';
var refresh = new ui.Button('refresh', function() {
this.__refresh();
}, this);
refresh.__element.className = 'cancel';
refresh.addTo(actions);
new ui.Button('export', function() {
this.__refresh(true);
}, this).addTo(actions);
navi.add(null, actions);
},
/*
* PRIVATE API
*/
__parse: function(code) {
var cache = {
'background': {},
'background:touch': {},
'label': {},
'label:touch': {}
};
var ruleset = cache['label'];
var lines = code.split('\n');
for (var l = 0, ll = lines.length; l < ll; l++) {
var line = lines[l].replace(/^\s+/,'').replace(/\s+$/,'');
if (line === '') continue;
if (line.substr(0,1) === '#') {
var id = line.replace(/\{/,'').replace(/\s+$/,'').substr(1);
cache[id] = {};
ruleset = cache[id];
continue;
} else if (line === '}') {
continue;
} else {
var simple = line.match(/([A-Za-z0-9\-]+)\:\s([A-Za-z0-9\#%\s]+)\;/);
var parameters = line.match(/([A-Za-z0-9\-]+)\:\s([A-Za-z0-9]+)\((([0-9\s?\.?]+\,?){1,4})\)\;/);
if (simple) {
ruleset[simple[1]] = simple[2];
} else if (parameters) {
ruleset[parameters[1]] = parameters[2] + '(' + parameters[3] + ')';
} else if (line.substr(0,5) === '-css-') {
var dotpos = line.indexOf(':');
var property = line.substr(5, dotpos - 5);
var value = line.substr(dotpos + 1).replace(/\;/,'').replace(/^\s+/,'').replace(/\s+$/,'');
ruleset[property] = value;
} else {
console.warn('Could not interpret line: ', line);
}
}
}
for (var id in cache) {
if (id.match(/:/)) {
var defaults = id.split(':')[0];
if (cache[defaults]) {
for (var property in cache[defaults]) {
if (cache[id][property] === undefined) {
cache[id][property] = cache[defaults][property];
}
}
}
}
}
return cache;
},
__refresh: function(flag) {
this.__exportFlag = flag === true ? true : false;
ui.Main.get('log').clear();
this.__generator.export(this.settings, this.rulesets);
},
__render: function() {
this.__canvas.width = this.settings.width;
this.__canvas.height = this.settings.height;
this.__context.clearRect(0, 0, this.settings.width, this.settings.height);
this.__renderLayer('background');
this.__renderLayer('label');
},
__renderLayer: function(layer) {
for (var id in this.__data) {
var state = id.match(/:/) ? id.split(':')[1] : 'default';
var layerId = id.match(/:/) ? id.split(':')[0] : id;
var image = this.__data[id].png !== null ? this.__data[id].png : this.__data[id].svg;
if (
layerId === layer
&& image !== null
&& state === this.__state
) {
var x = (this.settings.width - image.width) / 2;
var y = (this.settings.height - image.height) / 2;
this.__context.drawImage(
image,
x,
y
);
}
}
},
__export: function(data) {
this.__data = data;
this.__render();
if (this.__exportFlag === true) {
this.__lightbox.set(null);
// TODO: Show exported lychee.ui entity usage and its settings
this.__lightbox.show();
this.__refresh();
}
}
}
return Class;
});
|
/*!@license
* Infragistics.Web.ClientUI Tree Grid localization resources 15.1.20151.1005
*
* Copyright (c) 2011-2015 Infragistics Inc.
*
* http://www.infragistics.com/
*
*/
/*global jQuery */
(function ($) {
$.ig = $.ig || {};
if (!$.ig.TreeGrid) {
$.ig.TreeGrid = {};
$.extend($.ig.TreeGrid, {
locale: {
fixedVirtualizationNotSupported: '固定仮想化はサポートされていません。行仮想化を有効にするために virtualizationMode を continuous に設定してください。'
}
});
}
})(jQuery); |
/*
Script: StickyWin.Fx.js
Extends StickyWin to create popups that fade in and out.
License:
MIT-style license.
Authors:
Aaron Newton
*/
/*
Script: StickyWin.Fx.js
Extends StickyWin to create popups that fade in and out and can be dragged and resized (requires StickyWin.Fx.Drag.js).
License:
http://www.clientcide.com/wiki/cnet-libraries#license
*/
StickyWin = Class.refactor(StickyWin, {
options: {
//fadeTransition: 'sine:in:out',
fade: true,
fadeDuration: 150
},
hideWin: function(){
if (this.options.fade) this.fade(0);
else this.previous();
},
showWin: function(){
if (this.options.fade) this.fade(1);
else this.previous();
},
hide: function(){
this.previous(this.options.fade);
},
show: function(){
this.previous(this.options.fade);
},
fade: function(to){
if (!this.fadeFx) {
this.win.setStyles({
opacity: 0,
display: 'block'
});
var opts = {
property: 'opacity',
duration: this.options.fadeDuration
};
if (this.options.fadeTransition) opts.transition = this.options.fadeTransition;
this.fadeFx = new Fx.Tween(this.win, opts);
}
if (to > 0) {
this.win.setStyle('display','block');
this.position();
}
this.fadeFx.clearChain();
this.fadeFx.start(to).chain(function (){
if (to == 0) {
this.win.setStyle('display', 'none');
this.fireEvent('onClose');
} else {
this.fireEvent('onDisplay');
}
}.bind(this));
return this;
}
});
StickyWin.Fx = StickyWin; |
/*global ODSA */
"use strict";
// Sequential Tree visualization for bit vectors
$(document).ready(function () {
var av_name = "SequentialTreeBitsCON";
var av = new JSAV(av_name);
var temp1;
var arr = av.ds.array(['1', '1', '0', '0', '1', '1',
'0', '0', '1', '0', '0']);
var bt = av.ds.binarytree({visible: true, nodegap: 35});
bt.root('1');
var a = bt.root();
a.left('1');
var b = a.left();
var d = a.left().right('0');
var c = a.right('1');
var e = a.right().left('1');
var g = a.right().left().left('0');
var f = a.right().right('1');
var h = a.right().right().left('0');
var i = a.right().right().right('0');
a.hide();
// Slide 1
av.umsg("The array shows the structure for a full binary tree. A preorder enumeration would go with this to get the values. This visualization shows a reconstruction of the tree shape.");
av.displayInit();
// Slide 2
av.umsg("The first character 1 means this is an internal node, and it is the root node");
a.show({recursive: false});
bt.layout();
arr.highlight(0);
var ptr = av.pointer("rt", bt.root(), {anchor: "center top", top: -10});
av.step();
// Slide 3
av.umsg("The root's left child is marked '1' for an internal node.");
arr.highlight(1);
arr.unhighlight(0);
av.step();
// Slide 4
av.umsg("We follow to the left child of the root");
b.show({recursive: false});
bt.layout();
ptr.target(b);
a.addClass("processing");
av.step();
// Slide 5
av.umsg("The '0' means that the left child is a leaf. So we do not need tomake a recursive call.");
b.left('0').show();
bt.layout();
arr.highlight(2);
arr.unhighlight(1);
av.step();
// Slide 6
av.umsg("The next '0' means the right child is a leaf as well");
d.show();
bt.layout();
arr.highlight(3);
arr.unhighlight(2);
//point to D
av.step();
// Slide 7
av.umsg("Since we have processed the children, we pop up to the root.");
//point to A
ptr.target(a);
a.removeClass("processing");
av.step();
// Slide 8
av.umsg("The next character in the string represents the root's right child ");
c.show({recursive: false});
bt.layout();
arr.highlight(4);
arr.unhighlight(3);
//point to C
ptr.target(c);
a.addClass("processing");
av.step();
// Slide 9
av.umsg("Continue adding children to the internal nodes");
e.show({recursive: false});
bt.layout();
arr.highlight(5);
arr.unhighlight(4);
//point to E
ptr.target(e);
c.addClass("processing");
av.step();
// Slide 10
av.umsg("Add the leaf node as the next child");
g.show({recursive: false});
bt.layout();
arr.highlight(6);
arr.unhighlight(5);
av.step();
// Slide 11
av.umsg("Add the next leaf node as the right child");
e.right('0').show();
arr.highlight(7);
arr.unhighlight(6);
bt.layout();
av.step();
// Slide 12
av.umsg("We pop back up to the node's parent ");
//point to C
ptr.target(c);
c.removeClass("processing");
av.step();
// Slide 13
av.umsg("Add the next internal node as the right child");
f.show({recursive: false});
bt.layout();
arr.highlight(8);
arr.unhighlight(7);
//point to F
ptr.target(f);
c.addClass("processing");
av.step();
// Slide 14
av.umsg("Add a leaf node as the left child");
h.show({recursive: false});
bt.layout();
arr.highlight(9);
arr.unhighlight(8);
av.step();
// Slide 15
av.umsg("The next character will be the right child");
i.show({recursive: false});
bt.layout();
arr.highlight(10);
arr.unhighlight(9);
av.step();
// Slide 16
av.umsg("The last character represents a leaf node.");
av.step();
// Slide 17
a.removeClass("processing");
c.removeClass("processing");
av.umsg("Now we have reconstructed the entire tree");
av.recorded();
});
|
import {LOAD} from './actions';
export default function(state = {}, action) {
switch (action.type) {
case LOAD:
return action.payload.widgets;
default:
return state;
}
}
|
"use strict";
var JSHINT = require("../..").JSHINT;
var fs = require('fs');
var TestRun = require("../helpers/testhelper").setup.testRun;
/**
* JSHint allows you to specify custom globals as a parameter to the JSHINT
* function so it is not necessary to spam code with jshint-related comments
*/
exports.testCustomGlobals = function (test) {
var code = '(function (test) { return [ fooGlobal, barGlobal ]; }());';
var custom = { fooGlobal: false, barGlobal: false };
test.ok(JSHINT(code, {}, custom));
var report = JSHINT.data();
test.strictEqual(report.implieds, undefined);
test.equal(report.globals.length, 2);
var dict = {};
for (var i = 0, g; g = report.globals[i]; i += 1)
dict[g] = true;
var customKeys = Object.keys(custom);
for (i = 0, g = null; g = customKeys[i]; i += 1)
test.ok(g in dict);
// Regression test (GH-665)
code = [
"/*global bar*/",
"foo = {};",
"bar = {};"
];
TestRun(test)
.addError(2, "Read only.")
.addError(3, "Read only.")
.test(code, { es3: true, unused: true, predef: { foo: false }});
test.done();
};
exports.testUnusedDefinedGlobals = function (test) {
var src = fs.readFileSync(__dirname + "/fixtures/unusedglobals.js", "utf8");
TestRun(test)
.addError(2, "'bar' is defined but never used.")
.test(src, { es3: true, unused: true });
test.done();
};
exports.testImplieds = function (test) {
var src = [
"f = 0;",
"(function() {",
" g = 0;",
"}());",
"h = 0;"
];
var report;
TestRun(test).test(src);
report = JSHINT.data();
test.deepEqual(
report.implieds,
[
{ name: "f", line: [1] },
{ name: "g", line: [3] },
{ name: "h", line: [5] }
]
);
TestRun(test)
.test("__proto__ = 0;", { proto: true });
report = JSHINT.data();
test.deepEqual(report.implieds, [ { name: "__proto__", line: [1] } ]);
test.done();
};
exports.testExportedDefinedGlobals = function (test) {
var src = ["/*global foo, bar */",
"export { bar, foo };"];
// Test should pass
TestRun(test).test(src, { esnext: true, unused: true }, {});
var report = JSHINT.data();
test.deepEqual(report.globals, ['bar', 'foo']);
test.done();
};
exports.testGlobalVarDeclarations = function (test) {
var src = "var a;";
// Test should pass
TestRun(test).test(src, { es3: true, node: true }, {});
var report = JSHINT.data();
test.deepEqual(report.globals, ['a']);
TestRun(test).test("var __proto__;", { proto: true });
report = JSHINT.data();
test.deepEqual(report.globals, ["__proto__"]);
test.done();
};
exports.globalDeclarations = function (test) {
var src = "exports = module.exports = function (test) {};";
// Test should pass
TestRun(test).test(src, { es3: true, node: true }, { exports: true });
// Test should pass as well
src = [
"/*jshint node:true */",
"/*global exports:true */",
"exports = module.exports = function (test) {};"
];
TestRun(test).test(src.join('\n'));
test.done();
};
exports.multilineGlobalDeclarations = function (test) {
var src = fs.readFileSync(__dirname + "/fixtures/multiline-global-declarations.js", "utf8");
TestRun(test)
.addError(12, "'pi' is defined but never used.")
.test(src, { unused: true });
test.done();
};
/** Test that JSHint recognizes `new Array(<expr>)` as a valid expression */
exports.testNewArray = function (test) {
var code = 'new Array(1);';
var code1 = 'new Array(v + 1);';
var code2 = 'new Array("hello", "there", "chaps");';
TestRun(test).test(code);
TestRun(test).test(code1);
TestRun(test).test(code2);
TestRun(test)
.addError(1, "The array literal notation [] is preferable.")
.test('new Array();');
test.done();
};
/** Test that JSHint recognizes `new foo.Array(<expr>)` as a valid expression #527 **/
exports.testNewNonNativeArray = function (test) {
var code = 'new foo.Array();';
var code1 = 'new foo.Array(1);';
var code2 = 'new foo.Array(v + 1);';
var code3 = 'new foo.Array("hello", "there", "chaps");';
TestRun(test).test(code);
TestRun(test).test(code1);
TestRun(test).test(code2);
TestRun(test).test(code3);
test.done();
};
exports.testNonNativeArray = function (test) {
var code1 = 'foo.Array();';
var code2 = 'foo.Array(v + 1);';
var code3 = 'foo.Array("hello", "there", "chaps");';
TestRun(test).test(code1);
TestRun(test).test(code2);
TestRun(test).test(code3);
test.done();
};
/** Test that JSHint recognizes `new Object(<expr>)` as a valid expression */
exports.testNewObject = function (test) {
var code = 'Object(1);';
var code1 = 'new Object(1);';
TestRun(test).test(code);
TestRun(test).test(code1);
TestRun(test)
.addError(1, "The object literal notation {} is preferable.")
.test('Object();');
TestRun(test)
.addError(1, "The object literal notation {} is preferable.")
.test('new Object();');
test.done();
};
/** Test that JSHint recognizes `new foo.Object(<expr>)` as a valid expression #527 **/
exports.testNewNonNativeObject = function (test) {
var code = 'new foo.Object();';
var code1 = 'new foo.Object(1);';
var code2 = 'foo.Object();';
var code3 = 'foo.Object(1);';
TestRun(test).test(code);
TestRun(test).test(code1);
TestRun(test).test(code2);
TestRun(test).test(code3);
test.done();
};
/**
* Test that JSHint allows `undefined` to be a function parameter.
* It is a common pattern to protect against the case when somebody
* overwrites undefined. It also helps with minification.
*
* More info: https://gist.github.com/315916
*/
exports.testUndefinedAsParam = function (test) {
var code = '(function (undefined) {}());';
var code1 = 'var undefined = 1;';
TestRun(test).test(code);
// But it must never tolerate reassigning of undefined
TestRun(test)
.addError(1, "Expected an identifier and instead saw 'undefined' (a reserved word).")
.test(code1);
test.done();
};
/** Tests that JSHint accepts new line after a dot (.) operator */
exports.newLineAfterDot = function (test) {
TestRun(test).test([ "chain().chain().", "chain();" ]);
test.done();
};
/**
* JSHint does not tolerate deleting variables.
* More info: http://perfectionkills.com/understanding-delete/
*/
exports.noDelete = function (test) {
TestRun(test)
.addError(1, 'Variables should not be deleted.')
.test('delete NullReference;');
test.done();
};
/**
* JSHint allows case statement fall through only when it is made explicit
* using special comments.
*/
exports.switchFallThrough = function (test) {
var src = fs.readFileSync(__dirname + '/fixtures/switchFallThrough.js', 'utf8');
TestRun(test)
.addError(3, "Expected a 'break' statement before 'case'.")
.addError(18, "Expected a 'break' statement before 'default'.")
.addError(40, "Unexpected ':'.")
.test(src);
test.done();
};
// GH-490: JSHint shouldn't require break before default if default is
// the first switch statement.
exports.switchDefaultFirst = function (test) {
var src = fs.readFileSync(__dirname + "/fixtures/switchDefaultFirst.js", "utf8");
TestRun(test)
.addError(5, "Expected a 'break' statement before 'default'.")
.test(src);
test.done();
};
exports.testVoid = function (test) {
var code = [
"void(0);",
"void 0;",
"var a = void(1);"
];
TestRun(test).test(code);
test.done();
};
exports.functionScopedOptions = function (test) {
var src = fs.readFileSync(__dirname + '/fixtures/functionScopedOptions.js', 'utf8');
TestRun(test)
.addError(1, "eval can be harmful.")
.addError(8, "eval can be harmful.")
.test(src);
test.done();
};
/** JSHint should not only read jshint, but also jslint options */
exports.jslintOptions = function (test) {
var src = fs.readFileSync(__dirname + '/fixtures/jslintOptions.js', 'utf8');
TestRun(test).test(src);
test.done();
};
exports.jslintInverted = function (test) {
var src = fs.readFileSync(__dirname + '/fixtures/jslintInverted.js', 'utf8');
TestRun(test).test(src);
test.done();
};
exports.jslintRenamed = function (test) {
var src = fs.readFileSync(__dirname + '/fixtures/jslintRenamed.js', 'utf8');
TestRun(test)
.addError(4, "Expected '===' and instead saw '=='.")
.test(src);
test.done();
};
exports.jslintSloppy = function (test) {
var src = "/*jslint sloppy:true */ function test() { return 1; }";
TestRun(test)
.test(src);
test.done();
};
/** JSHint should ignore unrecognized jslint options */
exports.jslintUnrecognized = function (test) {
var src = "/*jslint closure:true */ function test() { return 1; }";
TestRun(test)
.test(src);
test.done();
};
exports.caseExpressions = function (test) {
var src = fs.readFileSync(__dirname + '/fixtures/caseExpressions.js', 'utf8');
TestRun(test)
.test(src);
test.done();
};
exports.returnStatement = function (test) {
var src = fs.readFileSync(__dirname + '/fixtures/return.js', 'utf8');
TestRun(test)
.addError(3, "Did you mean to return a conditional instead of an assignment?")
.addError(38, "Line breaking error 'return'.")
.addError(38, "Missing semicolon.")
.addError(39, "Unnecessary semicolon.")
.test(src, { es3: true });
test.done();
};
exports.argsInCatchReused = function (test) {
var src = fs.readFileSync(__dirname + '/fixtures/trycatch.js', 'utf8');
TestRun(test)
.addError(6, "'e' is already defined.")
.addError(12, "Do not assign to the exception parameter.")
.addError(13, "Do not assign to the exception parameter.")
.addError(24, "'e' is not defined.")
.test(src, { es3: true, undef: true });
test.done();
};
exports.testRawOnError = function (test) {
JSHINT(';', { maxerr: 1 });
test.equal(JSHINT.errors[0].raw, 'Unnecessary semicolon.');
test.equal(JSHINT.errors[1].raw, 'Too many errors.');
test.equal(JSHINT.errors[2], null);
test.done();
};
exports.yesEmptyStmt = function (test) {
var src = fs.readFileSync(__dirname + '/fixtures/emptystmt.js', 'utf8');
TestRun(test)
.addError(1, "Expected an identifier and instead saw ';'.")
.addError(6, "Expected an assignment or function call and instead saw an expression.")
.addError(10, "Unnecessary semicolon.")
.addError(17, "Unnecessary semicolon.")
.test(src, { es3: true, curly: false });
TestRun(test)
.addError(1, "Expected an identifier and instead saw ';'.")
.addError(10, "Unnecessary semicolon.")
.addError(17, "Unnecessary semicolon.")
.test(src, { es3: true, curly: false, expr: true });
test.done();
};
exports.insideEval = function (test) {
var src = fs.readFileSync(__dirname + '/fixtures/insideEval.js', 'utf8');
TestRun(test)
.addError(1, "eval can be harmful.")
.addError(3, "eval can be harmful.")
.addError(5, "eval can be harmful.")
.addError(7, "eval can be harmful.")
.addError(9, "eval can be harmful.")
.addError(11, "Implied eval. Consider passing a function instead of a string.")
.addError(13, "Implied eval. Consider passing a function instead of a string.")
.addError(15, "Implied eval. Consider passing a function instead of a string.")
.addError(17, "Implied eval. Consider passing a function instead of a string.")
// The "TestRun" class (and these errors) probably needs some
// facility for checking the expected scope of the error
.addError(1, "Unexpected early end of program.")
.addError(1, "Unrecoverable syntax error. (100% scanned).")
.addError(1, "Unrecoverable syntax error. (100% scanned).")
.test(src, { es3: true, evil: false });
// Regression test for bug GH-714.
JSHINT(src, { evil: false, maxerr: 1 });
var err = JSHINT.data().errors[1];
test.equal(err.raw, "Too many errors.");
test.equal(err.scope, "(main)");
test.done();
};
exports.escapedEvil = function (test) {
var code = [
"\\u0065val(\"'test'\");"
];
TestRun(test)
.addError(1, "eval can be harmful.")
.test(code, { evil: false });
test.done();
};
// Regression test for GH-394.
exports.noExcOnTooManyUndefined = function (test) {
var code = 'a(); b();';
try {
JSHINT(code, {undef: true, maxerr: 1});
} catch (e) {
test.ok(false, 'Exception was thrown');
}
TestRun(test)
.addError(1, "'a' is not defined.")
.addError(1, "'b' is not defined.")
.test(code, { es3: true, undef: true });
test.done();
};
exports.defensiveSemicolon = function (test) {
var src = fs.readFileSync(__dirname + '/fixtures/gh-226.js', 'utf8');
TestRun(test)
.addError(16, "Unnecessary semicolon.")
.addError(17, "Unnecessary semicolon.")
.test(src, { es3: true, expr: true, laxbreak: true });
test.done();
};
// Test different variants of IIFE
exports.iife = function (test) {
var iife = [
'(function (test) { return; }());',
'(function (test) { return; })();'
];
TestRun(test).test(iife.join('\n'));
test.done();
};
// Tests invalid options when they're passed as function arguments
// For code that tests /*jshint ... */ see parser.js
exports.invalidOptions = function (test) {
TestRun(test)
.addError(0, "Bad option: 'invalid'.")
.test("function test() {}", { es3: true, devel: true, invalid: true });
test.done();
};
exports.multilineArray = function (test) {
var src = fs.readFileSync(__dirname + '/fixtures/gh-334.js', 'utf8');
TestRun(test).test(src);
test.done();
};
exports.testInvalidSource = function (test) {
TestRun(test)
.addError(0, "Input is neither a string nor an array of strings.")
.test(undefined);
TestRun(test)
.addError(0, "Input is neither a string nor an array of strings.")
.test(null);
TestRun(test)
.addError(0, "Input is neither a string nor an array of strings.")
.test({}, {es3: true});
TestRun(test)
.test("", {es3: true});
TestRun(test)
.test([], {es3: true});
test.done();
};
exports.testConstructor = function (test) {
var code = "new Number(5);";
TestRun(test)
.addError(1, "Do not use Number as a constructor.", {
character: 1
})
.test(code, {es3: true});
test.done();
};
exports.missingRadix = function (test) {
var code = "parseInt(20);";
TestRun(test)
.addError(1, "Missing radix parameter.", {
character: 12
})
.test(code, {es3: true});
TestRun(test).test(code);
test.done();
};
exports.NumberNaN = function (test) {
var code = "(function (test) { return Number.NaN; })();";
TestRun(test).test(code, {es3: true});
test.done();
};
exports.htmlEscapement = function (test) {
TestRun(test).test("var a = '<\\!--';", {es3: true});
TestRun(test)
.test("var a = '\\!';", {es3: true});
test.done();
};
// GH-551 regression test.
exports.testSparseArrays = function (test) {
var src = "var arr = ['a',, null,, '',, undefined,,];";
TestRun(test)
.addError(1, "Extra comma. (it breaks older versions of IE)")
.addError(1, "Extra comma. (it breaks older versions of IE)")
.addError(1, "Extra comma. (it breaks older versions of IE)")
.addError(1, "Extra comma. (it breaks older versions of IE)")
.test(src, {es3: true});
TestRun(test)
.test(src, { elision: true }); // es5
test.done();
};
exports.testReserved = function (test) {
var src = fs.readFileSync(__dirname + "/fixtures/reserved.js", "utf8");
TestRun(test)
.addError(1, "Expected an identifier and instead saw 'volatile' (a reserved word).")
.addError(5, "Expected an identifier and instead saw 'let' (a reserved word).")
.addError(10, "Expected an identifier and instead saw 'let' (a reserved word).")
.addError(13, "Expected an identifier and instead saw 'class' (a reserved word).")
.addError(14, "Expected an identifier and instead saw 'else' (a reserved word).")
.addError(15, "Expected an identifier and instead saw 'protected' (a reserved word).")
.test(src, {es3: true});
TestRun(test)
.addError(5, "Expected an identifier and instead saw 'let' (a reserved word).")
.addError(10, "Expected an identifier and instead saw 'let' (a reserved word).")
.test(src, {}); // es5
test.done();
};
// GH-744: Prohibit the use of reserved words as non-property
// identifiers.
exports.testES5Reserved = function (test) {
var src = fs.readFileSync(__dirname + "/fixtures/es5Reserved.js", "utf8");
TestRun(test)
.addError(2, "Expected an identifier and instead saw 'default' (a reserved word).")
.addError(3, "Unexpected 'in'.")
.addError(3, "Expected an identifier and instead saw 'in' (a reserved word).")
.addError(6, "Expected an identifier and instead saw 'default' (a reserved word).")
.addError(7, "Expected an identifier and instead saw 'new' (a reserved word).")
.addError(8, "Expected an identifier and instead saw 'class' (a reserved word).")
.addError(9, "Expected an identifier and instead saw 'default' (a reserved word).")
.addError(10, "Expected an identifier and instead saw 'in' (a reserved word).")
.addError(11, "Expected an identifier and instead saw 'in' (a reserved word).")
.test(src, {es3: true});
TestRun(test)
.addError(6, "Expected an identifier and instead saw 'default' (a reserved word).")
.addError(7, "Expected an identifier and instead saw 'new' (a reserved word).")
.addError(8, "Expected an identifier and instead saw 'class' (a reserved word).")
.addError(11, "Expected an identifier and instead saw 'in' (a reserved word).")
.test(src, {}); // es5
test.done();
};
exports.testCatchBlocks = function (test) {
var src = fs.readFileSync(__dirname + '/fixtures/gh247.js', 'utf8');
TestRun(test)
.addError(19, "'w' is already defined.")
.addError(35, "'u2' used out of scope.")
.addError(36, "'w2' used out of scope.")
.test(src, { es3: true, undef: true, devel: true });
src = fs.readFileSync(__dirname + '/fixtures/gh618.js', 'utf8');
TestRun(test)
.addError(5, "Value of 'x' may be overwritten in IE 8 and earlier.")
.addError(15, "Value of 'y' may be overwritten in IE 8 and earlier.")
.test(src, { es3: true, undef: true, devel: true });
TestRun(test)
.test(src, { es3: true, undef: true, devel: true, node: true });
var code = "try {} catch ({ message }) {}";
TestRun(test, "destructuring in catch blocks' parameter")
.test(code, { esnext: true });
test.done();
};
exports.testNumericParams = function (test) {
TestRun(test)
.test("/*jshint maxparams:4, indent:3, maxlen:false */");
TestRun(test)
.addError(1, "Expected a small integer or 'false' and instead saw 'face'.")
.test("/*jshint maxparams:face */");
test.done();
};
exports.testForIn = function (test) {
var src = [
"(function (o) {",
"for (var i in o) { i(); }",
"}());"
];
TestRun(test)
.test(src, {es3: true});
src = [
"(function (o) {",
"for (i in o) { i(); }",
"}());"
];
TestRun(test)
.addError(2, "Creating global 'for' variable. Should be 'for (var i ...'.")
.test(src, {es3: true});
src = [
"(function (o) {",
"for ('i' in o) { i(); }",
"}());"
];
TestRun(test)
.addError(2, "Expected an identifier and instead saw 'i'.")
.test(src);
src = [
"(function (o) {",
"for (i, j in o) { i(); }",
"for (var x, u in o) { x(); }",
"for (z = 0 in o) { z(); }",
"for (var q = 0 in o) { q(); }",
"})();"
];
TestRun(test, "bad lhs errors")
.addError(2, "Invalid for-in loop left-hand-side: more than one ForBinding.")
.addError(3, "Invalid for-in loop left-hand-side: more than one ForBinding.")
.addError(4, "Invalid for-in loop left-hand-side: initializer is forbidden.")
.addError(5, "Invalid for-in loop left-hand-side: initializer is forbidden.")
.test(src);
src = [
"(function (o) {",
"for (let i, j in o) { i(); }",
"for (const x, u in o) { x(); }",
"for (let z = 0 in o) { z(); }",
"for (const q = 0 in o) { q(); }",
"})();"
];
TestRun(test, "bad lhs errors (lexical)")
.addError(2, "Invalid for-in loop left-hand-side: more than one ForBinding.")
.addError(3, "Invalid for-in loop left-hand-side: more than one ForBinding.")
.addError(4, "Invalid for-in loop left-hand-side: initializer is forbidden.")
.addError(5, "Invalid for-in loop left-hand-side: initializer is forbidden.")
.test(src, { esnext: true });
test.done();
};
exports.testRegexArray = function (test) {
var src = fs.readFileSync(__dirname + "/fixtures/regex_array.js", "utf8");
TestRun(test)
.test(src, {es3: true});
test.done();
};
// Regression test for GH-1070
exports.testUndefinedAssignment = function (test) {
var src = [
"var x = undefined;",
"const y = undefined;",
"let z = undefined;",
"for(var a = undefined; a < 9; a++) {",
" var b = undefined;", // necessary - see gh-1191
" const c = undefined;",
" let d = undefined;",
" var e = function() {",
" var f = undefined;",
" const g = undefined;",
" let h = undefined;",
" };",
"}",
"// jshint -W080",
"var i = undefined;",
"const j = undefined;",
"let k = undefined;",
];
TestRun(test)
.addError(1, "It's not necessary to initialize 'x' to 'undefined'.")
.addError(2, "It's not necessary to initialize 'y' to 'undefined'.")
.addError(3, "It's not necessary to initialize 'z' to 'undefined'.")
.addError(4, "It's not necessary to initialize 'a' to 'undefined'.")
.addError(6, "It's not necessary to initialize 'c' to 'undefined'.")
.addError(7, "It's not necessary to initialize 'd' to 'undefined'.")
.addError(9, "It's not necessary to initialize 'f' to 'undefined'.")
.addError(10, "It's not necessary to initialize 'g' to 'undefined'.")
.addError(11, "It's not necessary to initialize 'h' to 'undefined'.")
.test(src, {esnext: true});
test.done();
};
exports.testES6Modules = function (test) {
var src = fs.readFileSync(__dirname + "/fixtures/es6-import-export.js", "utf8");
var importConstErrors = [
[51, "Attempting to override '$' which is a constant."],
[52, "Attempting to override 'emGet' which is a constant."],
[53, "Attempting to override 'one' which is a constant."],
[54, "Attempting to override '_' which is a constant."],
[55, "Attempting to override 'ember2' which is a constant."],
[57, "'$' has already been declared."],
[58, "'emGet' has already been declared."],
[58, "'set' has already been declared."],
[59, "'_' has already been declared."],
[60, "'ember2' has already been declared."],
[65, "'newImport' was used before it was declared, which is illegal for 'const' variables."]
];
var testRun = TestRun(test);
importConstErrors.forEach(function(error) { testRun.addError.apply(testRun, error); });
testRun.test(src, {esnext: true});
testRun = TestRun(test)
.addError(3, "'import' is only available in ES6 (use esnext option).")
.addError(4, "'import' is only available in ES6 (use esnext option).")
.addError(5, "'import' is only available in ES6 (use esnext option).")
.addError(6, "'import' is only available in ES6 (use esnext option).")
.addError(7, "'import' is only available in ES6 (use esnext option).")
.addError(8, "'import' is only available in ES6 (use esnext option).")
.addError(9, "'import' is only available in ES6 (use esnext option).")
.addError(10, "'import' is only available in ES6 (use esnext option).")
.addError(11, "'import' is only available in ES6 (use esnext option).")
.addError(22, "'export' is only available in ES6 (use esnext option).")
.addError(26, "'export' is only available in ES6 (use esnext option).")
.addError(30, "'export' is only available in ES6 (use esnext option).")
.addError(31, "'export' is only available in ES6 (use esnext option).")
.addError(32, "'export' is only available in ES6 (use esnext option).")
.addError(36, "'export' is only available in ES6 (use esnext option).")
.addError(40, "'export' is only available in ES6 (use esnext option).")
.addError(44, "'export' is only available in ES6 (use esnext option).")
.addError(46, "'export' is only available in ES6 (use esnext option).")
.addError(47, "'class' is available in ES6 (use esnext option) or Mozilla JS extensions (use moz).")
.addError(48, "'export' is only available in ES6 (use esnext option).")
.addError(48, "'class' is available in ES6 (use esnext option) or Mozilla JS extensions (use moz).")
.addError(47, "'export' is only available in ES6 (use esnext option).")
.addError(46, "'class' is available in ES6 (use esnext option) or Mozilla JS extensions (use moz).")
.addError(57, "'import' is only available in ES6 (use esnext option).")
.addError(58, "'import' is only available in ES6 (use esnext option).")
.addError(59, "'import' is only available in ES6 (use esnext option).")
.addError(60, "'import' is only available in ES6 (use esnext option).")
.addError(65, "'import' is only available in ES6 (use esnext option).")
.addError(67, "'export' is only available in ES6 (use esnext option).")
.addError(67, "'function*' is only available in ES6 (use esnext option).")
.addError(67, "'yield' is available in ES6 (use esnext option) or Mozilla JS extensions (use moz).");
importConstErrors.forEach(function(error) { testRun.addError.apply(testRun, error); });
testRun.test(src, {});
var src2 = [
"var a = {",
"import: 'foo',",
"export: 'bar'",
"};"
];
TestRun(test)
.test(src2, {});
test.done();
};
exports.testES6ModulesNamedExportsAffectUnused = function (test) {
// Named Exports should count as used
var src1 = [
"var a = {",
" foo: 'foo',",
" bar: 'bar'",
"};",
"var x = 23;",
"var z = 42;",
"let c = 2;",
"const d = 7;",
"export { c, d };",
"export { a, x };",
"export var b = { baz: 'baz' };",
"export function boo() { return z; }",
"export class MyClass { }",
"export var varone = 1, vartwo = 2;",
"export const constone = 1, consttwo = 2;",
"export let letone = 1, lettwo = 2;",
"export var v1u, v2u;",
"export let l1u, l2u;",
"export const c1u, c2u;",
"export function* gen() { yield 1; }"
];
TestRun(test)
.addError(19, "const 'c1u' is initialized to 'undefined'.")
.addError(19, "const 'c2u' is initialized to 'undefined'.")
.test(src1, {
esnext: true,
unused: true
});
test.done();
};
exports.testConstRedeclaration = function (test) {
// consts cannot be redeclared, but they can shadow
var src = [
"const a = 1;",
"const a = 2;",
"if (a) {",
" const a = 3;",
"}",
"for(const a in a) {",
" const a = 4;",
"}",
"function a() {",
"}",
"function b() {",
"}",
"const b = 1;"
];
TestRun(test)
.addError(2, "'a' has already been declared.")
.addError(9, "'a' has already been declared.")
.addError(13, "'b' has already been declared.")
.test(src, {
esnext: true
});
test.done();
};
exports["test typeof in TDZ"] = function (test) {
var src = [
"let a = typeof b;", // error, use in TDZ
"let b;",
"function d() { return typeof c; }", // d may be called after declaration, no error
"let c = typeof e;", // e is not in scope, no error
"{",
" let e;",
"}"
];
TestRun(test)
.addError(2, "'b' was used before it was declared, which is illegal for 'let' variables.")
.test(src, {
esnext: true
});
test.done();
};
exports.testConstModification = function (test) {
var src = [
"const a = 1;",
"const b = { a: 2 };",
// const errors
"a = 2;",
"b = 2;",
"a++;",
"--a;",
"a += 1;",
"let y = a = 3;",
// valid const access
"b.a++;",
"--b.a;",
"b.a = 3;",
"a.b += 1;",
"const c = () => 1;",
"c();",
"const d = [1, 2, 3];",
"d[0] = 2;",
"let x = -a;",
"x = +a;",
"x = a + 1;",
"x = a * 2;",
"x = a / 2;",
"x = a % 2;",
"x = a & 1;",
"x = a ^ 1;",
"x = a === true;",
"x = a == 1;",
"x = a !== true;",
"x = a != 1;",
"x = a > 1;",
"x = a >= 1;",
"x = a < 1;",
"x = a <= 1;",
"x = 1 + a;",
"x = 2 * a;",
"x = 2 / a;",
"x = 2 % a;",
"x = 1 & a;",
"x = 1 ^ a;",
"x = true === a;",
"x = 1 == a;",
"x = true !== a;",
"x = 1 != a;",
"x = 1 > a;",
"x = 1 >= a;",
"x = 1 < a;",
"x = 1 <= a;",
"x = typeof a;",
"x = a.a;",
"x = a[0];",
"delete a.a;",
"delete a[0];",
"new a();",
"new a;",
"function e() {",
" f++;",
"}",
"const f = 1;",
"e();"
];
TestRun(test)
.addError(3, "Attempting to override 'a' which is a constant.")
.addError(4, "Attempting to override 'b' which is a constant.")
.addError(5, "Attempting to override 'a' which is a constant.")
.addError(6, "Attempting to override 'a' which is a constant.")
.addError(7, "Attempting to override 'a' which is a constant.")
.addError(8, "Attempting to override 'a' which is a constant.")
.addError(8, "You might be leaking a variable (a) here.")
.addError(53, "Missing '()' invoking a constructor.")
.addError(55, "Attempting to override 'f' which is a constant.")
.test(src, {
esnext: true
});
test.done();
};
exports["class declaration export"] = function (test) {
var source = fs.readFileSync(__dirname + "/fixtures/class-declaration.js", "utf8");
TestRun(test).test(source, {
esnext: true,
undef: true
});
test.done();
};
exports["function declaration export"] = function (test) {
var source = fs.readFileSync(__dirname + "/fixtures/function-declaration.js", "utf8");
TestRun(test).test(source, {
esnext: true,
undef: true
});
test.done();
};
exports.classIsBlockScoped = function (test) {
var code = [
"new A();", // use in TDZ
"class A {}",
"class B extends C {}", // use in TDZ
"class C {}",
"new D();", // not defined
"let E = class D {" +
" constructor() { D.static(); }",
" myfunc() { return D; }",
"};",
"new D();", // not defined
"if (true) {",
" class F {}",
"}",
"new F();" // not defined
];
TestRun(test)
.addError(2, "'A' was used before it was declared, which is illegal for 'class' variables.")
.addError(4, "'C' was used before it was declared, which is illegal for 'class' variables.")
.addError(5, "'D' is not defined.")
.addError(9, "'D' is not defined.")
.addError(13, "'F' is not defined.")
.test(code, { esnext: true, undef: true });
test.done();
};
exports.testES6ModulesNamedExportsAffectUndef = function (test) {
// The identifier "foo" is expected to have been defined in the scope
// of this file in order to be exported.
// The example below is roughly similar to this Common JS:
//
// exports.foo = foo;
//
// Thus, the "foo" identifier should be seen as undefined.
var src1 = [
"export { foo };"
];
TestRun(test)
.addError(1, "'foo' is not defined.")
.test(src1, {
esnext: true,
undef: true
});
test.done();
};
exports.testES6ModulesThroughExportDoNotAffectUnused = function (test) {
// "Through" exports do not alter the scope of this file, but instead pass
// the exports from one source on through this source.
// The example below is roughly similar to this Common JS:
//
// var foo;
// exports.foo = require('source').foo;
//
// Thus, the "foo" identifier should be seen as unused.
var src1 = [
"var foo;",
"export { foo } from \"source\";"
];
TestRun(test)
.addError(1, "'foo' is defined but never used.")
.test(src1, {
esnext: true,
unused: true
});
test.done();
};
exports.testES6ModulesThroughExportDoNotAffectUndef = function (test) {
// "Through" exports do not alter the scope of this file, but instead pass
// the exports from one source on through this source.
// The example below is roughly similar to this Common JS:
//
// exports.foo = require('source').foo;
// var bar = foo;
//
// Thus, the "foo" identifier should be seen as undefined.
var src1 = [
"export { foo } from \"source\";",
"var bar = foo;"
];
TestRun(test)
.addError(2, "'foo' is not defined.")
.test(src1, {
esnext: true,
undef: true
});
test.done();
};
exports.testES6ModulesDefaultExportsAffectUnused = function (test) {
// Default Exports should count as used
var src1 = [
"var a = {",
" foo: 'foo',",
" bar: 'bar'",
"};",
"var x = 23;",
"var z = 42;",
"export default { a: a, x: x };",
"export default function boo() { return x + z; }",
"export default class MyClass { }"
];
TestRun(test)
.test(src1, {
esnext: true,
unused: true
});
test.done();
};
exports.testES6ModulesNameSpaceImportsAffectUnused = function (test) {
var src = [
"import * as angular from 'angular';"
];
TestRun(test)
.addError(1, "'angular' is defined but never used.")
.test(src, {
esnext: true,
unused: true
});
test.done();
};
exports.testES6TemplateLiterals = function (test) {
var src = fs.readFileSync(__dirname + "/fixtures/es6-template-literal.js", "utf8");
TestRun(test)
.addError(14, "Octal literals are not allowed in strict mode.")
.addError(21, "Unclosed template literal.")
.test(src, { esnext: true });
test.done();
};
exports.testES6TaggedTemplateLiterals = function (test) {
var src = fs.readFileSync(__dirname + "/fixtures/es6-template-literal-tagged.js", "utf8");
TestRun(test)
.addError(16, "Octal literals are not allowed in strict mode.")
.addError(23, "Unclosed template literal.")
.test(src, { esnext: true });
test.done();
};
exports.testES6TemplateLiteralsUnused = function (test) {
var src = [
"var a = 'hello';",
"alert(`${a} world`);"
];
TestRun(test)
.test(src, { esnext: true, unused: true });
test.done();
};
exports.testES6TaggedTemplateLiteralsUnused = function (test) {
var src = [
"function tag() {}",
"var a = 'hello';",
"alert(tag`${a} world`);"
];
TestRun(test)
.test(src, { esnext: true, unused: true });
test.done();
};
exports.testES6TemplateLiteralsUndef = function (test) {
var src = [
"/* global alert */",
"alert(`${a} world`);"
];
TestRun(test)
.addError(2, "'a' is not defined.")
.test(src, { esnext: true, undef: true });
test.done();
};
exports.testES6TaggedTemplateLiteralsUndef = function (test) {
var src = [
"/* global alert */",
"alert(tag`${a} world`);"
];
TestRun(test)
.addError(2, "'tag' is not defined.")
.addError(2, "'a' is not defined.")
.test(src, { esnext: true, undef: true });
test.done();
};
exports.testES6TemplateLiteralMultiline = function (test) {
var src = [
'let multiline = `',
'this string spans',
'multiple lines',
'`;'
];
TestRun(test).test(src, { esnext: true });
test.done();
};
exports.testES6TemplateLiteralsAreNotDirectives = function (test) {
var src = [
"function fn() {",
"`use strict`;",
"return \"\\077\";",
"}"
];
TestRun(test)
.addError(2, "Expected an assignment or function call and instead saw an expression.")
.test(src, { esnext: true });
var src2 = [
"function fn() {",
"`${\"use strict\"}`;",
"return \"\\077\";",
"}"
];
TestRun(test)
.addError(2, "Expected an assignment or function call and instead saw an expression.")
.test(src2, { esnext: true });
test.done();
};
exports.testES6TemplateLiteralReturnValue = function (test) {
var src = [
'function sayHello(to) {',
' return `Hello, ${to}!`;',
'}',
'print(sayHello("George"));'
];
TestRun(test).test(src, { esnext: true });
var src = [
'function* sayHello(to) {',
' yield `Hello, ${to}!`;',
'}',
'print(sayHello("George"));'
];
TestRun(test).test(src, { esnext: true });
test.done();
};
exports.testES6TemplateLiteralMultilineReturnValue = function (test) {
var src = [
'function sayHello(to) {',
' return `Hello, ',
' ${to}!`;',
'}',
'print(sayHello("George"));'
];
TestRun(test).test(src, { esnext: true });
var src = [
'function* sayHello(to) {',
' yield `Hello, ',
' ${to}!`;',
'}',
'print(sayHello("George"));'
];
TestRun(test).test(src, { esnext: true });
test.done();
};
exports.testES6TaggedTemplateLiteralMultilineReturnValue = function (test) {
var src = [
'function tag() {}',
'function sayHello(to) {',
' return tag`Hello, ',
' ${to}!`;',
'}',
'print(sayHello("George"));'
];
TestRun(test).test(src, { esnext: true });
var src = [
'function tag() {}',
'function* sayHello(to) {',
' yield tag`Hello, ',
' ${to}!`;',
'}',
'print(sayHello("George"));'
];
TestRun(test).test(src, { esnext: true });
test.done();
};
exports.testES6TemplateLiteralMultilineReturnValueWithFunctionCall = function (test) {
var src = [
'function sayHello() {',
' return `Helo',
' monkey`',
' .replace(\'l\', \'ll\');',
'}',
'print(sayHello());',
];
TestRun(test).test(src, { esnext: true });
test.done();
};
exports.testES6TaggedTemplateLiteralMultilineReturnValueWithFunctionCall = function (test) {
var src = [
'function tag() {}',
'function sayHello() {',
' return tag`Helo',
' monkey!!`',
' .replace(\'l\', \'ll\');',
'}',
'print(sayHello());',
];
TestRun(test).test(src, { esnext: true });
test.done();
};
exports.testMultilineReturnValueStringLiteral = function (test) {
var src = [
'function sayHello(to) {',
' return "Hello, \\',
' " + to;',
'}',
'print(sayHello("George"));'
];
TestRun(test).test(src, { multistr: true });
var src = [
'function* sayHello(to) {',
' yield "Hello, \\',
' " + to;',
'}',
'print(sayHello("George"));'
];
TestRun(test).test(src, { esnext: true, multistr: true });
test.done();
};
exports.testES6ExportStarFrom = function (test) {
var src = fs.readFileSync(__dirname + "/fixtures/es6-export-star-from.js", "utf8");
TestRun(test)
.addError(2, "Expected 'from' and instead saw 'foo'.")
.addError(2, "Expected '(string)' and instead saw ';'.")
.addError(2, "Missing semicolon.")
.addError(3, "Expected '(string)' and instead saw '78'.")
.test(src, { esnext: true });
test.done();
};
exports.testPotentialVariableLeak = function (test) {
var a = fs.readFileSync(__dirname + "/fixtures/leak.js", "utf8");
var b = fs.readFileSync(__dirname + "/fixtures/gh1802.js", "utf8");
// Real Error
TestRun(test)
.addError(2, "You might be leaking a variable (b) here.")
.addError(3, "You might be leaking a variable (d) here.")
.addError(4, "You might be leaking a variable (f) here.")
.test(a, { esnext: true });
// False Positive
TestRun(test)
.test(b);
test.done();
};
exports.testDefaultArguments = function (test) {
var src = fs.readFileSync(__dirname + "/fixtures/default-arguments.js", "utf8");
TestRun(test)
.addError(14, "'bar' is not defined.")
.addError(14, "'num3' was used before it was declared, which is illegal for 'param' variables.")
.addError(15, "'num4' was used before it was declared, which is illegal for 'param' variables.")
.addError(18, "Regular parameters should not come after default parameters.")
.addError(27, "'c' is not defined.")
.addError(33, "'d' was used before it was defined.")
.addError(36, "'e' was used before it was declared, which is illegal for 'param' variables.")
.test(src, { esnext: true, undef: true, latedef: true });
TestRun(test)
.addError(14, "'num3' was used before it was declared, which is illegal for 'param' variables.")
.addError(15, "'num4' was used before it was declared, which is illegal for 'param' variables.")
.addError(18, "Regular parameters should not come after default parameters.")
.addError(36, "'e' was used before it was declared, which is illegal for 'param' variables.")
.test(src, { moz: true });
TestRun(test)
.addError(7, "'default parameters' is only available in ES6 (use esnext option).")
.addError(11, "'default parameters' is only available in ES6 (use esnext option).")
.addError(12, "'default parameters' is only available in ES6 (use esnext option).")
.addError(13, "'default parameters' is only available in ES6 (use esnext option).")
.addError(14, "'default parameters' is only available in ES6 (use esnext option).")
.addError(14, "'num3' was used before it was declared, which is illegal for 'param' variables.")
.addError(15, "'default parameters' is only available in ES6 (use esnext option).")
.addError(15, "'num4' was used before it was declared, which is illegal for 'param' variables.")
.addError(18, "'default parameters' is only available in ES6 (use esnext option).")
.addError(18, "Regular parameters should not come after default parameters.")
.addError(26, "'default parameters' is only available in ES6 (use esnext option).")
.addError(31, "'default parameters' is only available in ES6 (use esnext option).")
.addError(33, "'default parameters' is only available in ES6 (use esnext option).")
.addError(35, "'default parameters' is only available in ES6 (use esnext option).")
.addError(36, "'default parameters' is only available in ES6 (use esnext option).")
.addError(36, "'e' was used before it was declared, which is illegal for 'param' variables.")
.test(src, { });
test.done();
};
exports.testDuplicateParamNames = function (test) {
var src = [
"(function() {",
" (function(a, a) { // warns only with shadow",
" })();",
"})();",
"(function() {",
" 'use strict';",
" (function(a, a) { // errors because of strict mode",
" })();",
"})();",
"(function() {",
" (function(a, a) { // errors because of strict mode",
" 'use strict';",
" })();",
"})();",
"(function() {",
" 'use strict';",
" (function(a, a) { // errors *once* because of strict mode",
" 'use strict';",
" })();",
"})();"
];
TestRun(test)
.addError(7, "'a' has already been declared.")
.addError(11, "'a' has already been declared.")
.addError(17, "'a' has already been declared.")
.addError(18, "Unnecessary directive \"use strict\".")
.test(src, { shadow: true });
TestRun(test)
.addError(2, "'a' is already defined.")
.addError(7, "'a' has already been declared.")
.addError(11, "'a' has already been declared.")
.addError(17, "'a' has already been declared.")
.addError(18, "Unnecessary directive \"use strict\".")
.test(src, { shadow: "inner" });
TestRun(test)
.addError(2, "'a' is already defined.")
.addError(7, "'a' has already been declared.")
.addError(11, "'a' has already been declared.")
.addError(17, "'a' has already been declared.")
.addError(18, "Unnecessary directive \"use strict\".")
.test(src, { shadow: "outer" });
TestRun(test)
.addError(2, "'a' is already defined.")
.addError(7, "'a' has already been declared.")
.addError(11, "'a' has already been declared.")
.addError(17, "'a' has already been declared.")
.addError(18, "Unnecessary directive \"use strict\".")
.test(src, { shadow: false });
test.done();
};
// Issue #1324: Make sure that we're not mutating passed options object.
exports.testClonePassedObjects = function (test) {
var options = { predef: ["sup"] };
JSHINT("", options);
test.ok(options.predef.length == 1);
test.done();
};
exports.testMagicProtoVariable = function (test) {
JSHINT("__proto__ = 1;");
test.done();
};
// Issue #1371: column number at end of non-strict comparison (for usability reasons)
exports.testColumnNumAfterNonStrictComparison = function (test) {
var src = "if (1 == 1) {\n" +
" var foo = 2;\n" +
" if (1 != 1){\n" +
" var bar = 3;\n" +
" }\n"+
"}";
TestRun(test)
.addError(1, "Expected '===' and instead saw '=='.", {character: 9})
.addError(3, "Expected '!==' and instead saw '!='.", {character: 11})
.test(src, {eqeqeq: true});
test.done();
};
exports.testArrayPrototypeExtensions = function (test) {
Array.prototype.undefinedPrototypeProperty = undefined;
JSHINT("var x = 123;\nlet y = 456;\nconst z = 123;");
delete Array.prototype.undefinedPrototypeProperty;
test.done();
};
// Issue #1446, PR #1688
exports.testIncorrectJsonDetection = function (test) {
var src = fs.readFileSync(__dirname + "/fixtures/mappingstart.js", "utf8");
// Without the bug fix, a JSON lint error will be raised because the parser
// thinks it is rendering JSON instead of JavaScript.
TestRun(test).test(src);
test.done();
};
exports.testEscapedReservedWords = function (test) {
var code = [
'var v\u0061r = 42;',
'alert(va\u0072);'
];
TestRun(test)
.addError(1, "Expected an identifier and instead saw 'var' (a reserved word).")
.addError(2, "Expected an identifier and instead saw 'var'.")
.test(code);
test.done();
};
exports.testUnnamedFuncStatement = function (test) {
TestRun(test)
.addError(1, "Missing name in function declaration.")
.test("function() {}");
test.done();
};
// GH-1976 "Fixed set property 'type' of undefined in `if` blockstmt"
exports.testUnCleanedForinifcheckneeded = function (test) {
var forinCode = [
"for (var key in a) {",
" console.log(key);",
"}"
];
var ifCode = [
"if(true) {",
"}"
];
try {
JSHINT(forinCode, { maxerr: 1, forin: true });
// Prior to the fix, if the final `forin` check reached the `maxerr` limit,
// the internal `state.forinifcheckneeded` maintained its previous value
// and triggered an error in subsequent invocations of JSHint.
JSHINT(ifCode, { maxerr: 1, forin: true });
} catch(e) {
test.ok(false, "Exception was thrown");
}
test.done();
};
// gh-738 "eval" as an object key should not cause `W061` warnngs
exports.testPermitEvalAsKey = function (test) {
var srcNode = fs.readFileSync(__dirname + "/fixtures/gh-738-node.js", "utf8");
var srcBrowser = fs.readFileSync(__dirname + "/fixtures/gh-738-browser.js", "utf8");
// global calls to eval should still cause warning.
// test a mixture of permitted and disallowed calls
// `global#eval` in `node:true` should still cause warning
// `(document|window)#eval` in `browser:true` should still cause warning
// browser globals
TestRun(test)
.addError(17, "eval can be harmful.")
.addError(19, "eval can be harmful.")
.addError(20, "eval can be harmful.")
.addError(22, "eval can be harmful.")
.addError(23, "eval can be harmful.")
.addError(25, "eval can be harmful.")
.test(srcBrowser, { browser: true });
// node globals
TestRun(test)
.addError(18, "eval can be harmful.")
.addError(19, "eval can be harmful.")
.addError(20, "eval can be harmful.")
.addError(22, "eval can be harmful.")
.test(srcNode, { node: true });
test.done();
};
// gh-2194 jshint confusing arrays at beginning of file with JSON
exports.beginningArraysAreNotJSON = function (test) {
var src = fs.readFileSync(__dirname + "/fixtures/gh-2194.js", "utf8");
TestRun(test)
.test(src);
test.done();
};
exports.labelsOutOfScope = function (test) {
var src = [
"function a() {",
" if (true) {",
" bar: switch(2) {",
" }",
" foo: switch(1) {",
" case 1:",
" (function () {",
" baz: switch(3) {",
" case 3:",
" break foo;",
" case 2:",
" break bar;",
" case 3:",
" break doesnotexist;",
" }",
" })();",
" if (true) {",
" break foo;",
" }",
" break foo;",
" case 2:",
" break bar;",
" case 3:",
" break baz;",
" }",
" }",
"}"
];
TestRun(test)
.addError(10, "'foo' is not a statement label.")
.addError(12, "'bar' is not a statement label.")
.addError(14, "'doesnotexist' is not a statement label.")
.addError(22, "'bar' is not a statement label.")
.addError(24, "'baz' is not a statement label.")
.test(src);
test.done();
};
exports.labelThroughCatch = function (test) {
var src = [
"function labelExample() {",
" 'use strict';",
" var i;",
" example:",
" for (i = 0; i < 10; i += 1) {",
" try {",
" if (i === 5) {",
" break example;",
" } else {",
" throw new Error();",
" }",
" } catch (e) {",
" continue example;",
" }",
" }",
"}"
];
TestRun(test)
.test(src);
test.done();
};
exports.labelDoesNotExistInGlobalScope = function (test) {
var src = [
"switch(1) {",
" case 1:",
" break nonExistent;",
"}"
];
TestRun(test)
.addError(3, "'nonExistent' is not a statement label.")
.test(src);
test.done();
};
exports.labeledBreakWithoutLoop = function (test) {
var src = [
"foo: {",
" break foo;",
"}"
];
TestRun(test)
.test(src);
test.done();
};
// ECMAScript 5.1 § 12.7: labeled continue must refer to an enclosing
// IterationStatement, as opposed to labeled break which is only required to
// refer to an enclosing Statement.
exports.labeledContinueWithoutLoop = function (test) {
var src = [
"foo: switch (i) {",
" case 1:",
" continue foo;",
"}"
];
TestRun(test)
.addError(3, "Unexpected 'continue'.")
.test(src);
test.done();
};
exports.unlabeledBreakWithoutLoop = function(test) {
var src = [
"if (1 == 1) {",
" break;",
"}",
];
TestRun(test)
.addError(2, "Unexpected 'break'.")
.test(src);
test.done();
}
exports.unlabeledContinueWithoutLoop = function(test) {
var src = [
"switch (i) {",
" case 1:",
" continue;", // breakage but not loopage
"}",
"continue;"
];
TestRun(test)
.addError(3, "Unexpected 'continue'.")
.addError(5, "Unexpected 'continue'.")
.test(src);
test.done();
}
exports.labelsContinue = function (test) {
var src = [
"exists: while(true) {",
" if (false) {",
" continue exists;",
" }",
" continue nonExistent;",
"}"
];
TestRun(test)
.addError(5, "'nonExistent' is not a statement label.")
.test(src);
test.done();
};
exports.catchWithNoParam = function (test) {
var src = [
"try{}catch(){}"
];
TestRun(test)
.addError(1, "Expected an identifier and instead saw ')'.")
.test(src);
test.done();
};
exports.catchWithNoParam = function (test) {
var src = [
"try{}",
"if (true) { console.log(); }"
];
TestRun(test)
.addError(2, "Expected 'catch' and instead saw 'if'.")
.test(src);
var src = [
"try{}"
];
TestRun(test)
.addError(1, "Expected 'catch' and instead saw ''.")
.test(src);
test.done();
};
exports["gh-1920"] = function (test) {
var src = [
"for (var key in objects) {",
" if (!objects.hasOwnProperty(key)) {",
" switch (key) {",
" }",
" }",
"}"
];
TestRun(test)
.addError(1, "The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.")
.test(src, { forin: true });
test.done();
};
exports.duplicateProto = function (test) {
var src = [
"(function() {",
" var __proto__;",
" var __proto__;",
"}());"
];
// TODO: Enable this expected warning in the next major release
TestRun(test, "Duplicate `var`s")
//.addError(3, "'__proto__' is already defined.")
.test(src, { proto: true });
src = [
"(function() {",
" let __proto__;",
" let __proto__;",
"}());"
];
TestRun(test, "Duplicate `let`s")
.addError(3, "'__proto__' has already been declared.")
.test(src, { proto: true, esnext: true });
src = [
"(function() {",
" const __proto__ = null;",
" const __proto__ = null;",
"}());"
];
TestRun(test, "Duplicate `const`s")
.addError(3, "'__proto__' has already been declared.")
.test(src, { proto: true, esnext: true });
src = [
"void {",
" __proto__: null,",
" __proto__: null",
"};"
];
// TODO: Enable this expected warning in the next major release
TestRun(test, "Duplicate keys (data)")
//.addError(3, "Duplicate key '__proto__'.")
.test(src, { proto: true });
src = [
"void {",
" __proto__: null,",
" get __proto__() {}",
"};"
];
// TODO: Enable this expected warning in the next major release
TestRun(test, "Duplicate keys (data and accessor)")
//.addError(3, "Duplicate key '__proto__'.")
.test(src, { proto: true });
src = [
"__proto__: while (true) {",
" __proto__: while (true) {",
" break;",
" }",
"}"
];
TestRun(test, "Duplicate labels")
.addError(2, "'__proto__' has already been declared.")
.test(src, { proto: true });
test.done();
};
|
/**
* @fileoverview Discourage use of .call.value()()
* @author Raghav Dua <duaraghav8@gmail.com>
*/
"use strict";
module.exports = {
meta: {
docs: {
description: "Discourage use of .call.value()()",
recommended: true,
type: "error"
},
schema: []
},
create(context) {
function reportIfcallvalueUsed(emitted) {
if (emitted.exit) { return; }
const {node} = emitted, {object, property} = node.callee;
if (node.callee.type === "MemberExpression" && property.type === "Identifier" && property.name === "value"
&& object.type === "MemberExpression" && object.property.type === "Identifier"
&& object.property.name === "call") {
context.report({
node,
location: {
column: context.getSourceCode().getColumn(object.property)
},
message: "Consider using 'transfer' in place of 'call.value()'."
});
}
}
return {
CallExpression: reportIfcallvalueUsed
};
}
};
|
import DemoPage from './DemoPage';
export default class HomePage extends DemoPage {
static async get() {
await browser.get('/demo/#/');
return new HomePage();
}
}
|
// Copyright 2010 The Closure Library Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
goog.provide('goog.ui.editor.LinkDialogTest');
goog.setTestOnly('goog.ui.editor.LinkDialogTest');
goog.require('goog.dom');
goog.require('goog.dom.DomHelper');
goog.require('goog.dom.TagName');
goog.require('goog.editor.BrowserFeature');
goog.require('goog.editor.Link');
goog.require('goog.events');
goog.require('goog.events.Event');
goog.require('goog.events.EventHandler');
goog.require('goog.events.InputHandler');
goog.require('goog.style');
goog.require('goog.testing.MockControl');
goog.require('goog.testing.PropertyReplacer');
goog.require('goog.testing.dom');
goog.require('goog.testing.events');
goog.require('goog.testing.jsunit');
goog.require('goog.testing.mockmatchers');
goog.require('goog.testing.mockmatchers.ArgumentMatcher');
goog.require('goog.ui.editor.AbstractDialog');
goog.require('goog.ui.editor.LinkDialog');
goog.require('goog.ui.editor.messages');
goog.require('goog.userAgent');
var dialog;
var mockCtrl;
var mockLink;
var mockOkHandler;
var mockGetViewportSize;
var mockWindowOpen;
var isNew;
var anchorElem;
var stubs = new goog.testing.PropertyReplacer();
var ANCHOR_TEXT = 'anchor text';
var ANCHOR_URL = 'http://www.google.com/';
var ANCHOR_EMAIL = 'm@r.cos';
var ANCHOR_MAILTO = 'mailto:' + ANCHOR_EMAIL;
function setUp() {
anchorElem = goog.dom.createElement(goog.dom.TagName.A);
goog.dom.appendChild(goog.dom.getDocument().body, anchorElem);
mockCtrl = new goog.testing.MockControl();
mockLink = mockCtrl.createLooseMock(goog.editor.Link);
mockOkHandler = mockCtrl.createLooseMock(goog.events.EventHandler);
isNew = false;
mockLink.isNew();
mockLink.$anyTimes();
mockLink.$does(function() {
return isNew;
});
mockLink.getCurrentText();
mockLink.$anyTimes();
mockLink.$does(function() {
return anchorElem.innerHTML;
});
mockLink.setTextAndUrl(goog.testing.mockmatchers.isString,
goog.testing.mockmatchers.isString);
mockLink.$anyTimes();
mockLink.$does(function(text, url) {
anchorElem.innerHTML = text;
anchorElem.href = url;
});
mockLink.$registerArgumentListVerifier('placeCursorRightOf', function() {
return true;
});
mockLink.placeCursorRightOf(goog.testing.mockmatchers.iBoolean);
mockLink.$anyTimes();
mockLink.getAnchor();
mockLink.$anyTimes();
mockLink.$returns(anchorElem);
mockWindowOpen = mockCtrl.createFunctionMock('open');
stubs.set(window, 'open', mockWindowOpen);
}
function tearDown() {
dialog.dispose();
goog.dom.removeNode(anchorElem);
stubs.reset();
}
function setUpAnchor(href, text, opt_isNew, opt_target, opt_rel) {
anchorElem.href = href;
anchorElem.innerHTML = text;
isNew = !!opt_isNew;
if (opt_target) {
anchorElem.target = opt_target;
}
if (opt_rel) {
anchorElem.rel = opt_rel;
}
}
/**
* Creates and shows the dialog to be tested.
* @param {Document=} opt_document Document to render the dialog into.
* Defaults to the main window's document.
* @param {boolean=} opt_openInNewWindow Whether the open in new window
* checkbox should be shown.
* @param {boolean=} opt_noFollow Whether rel=nofollow checkbox should be
* shown.
*/
function createAndShow(opt_document, opt_openInNewWindow, opt_noFollow) {
dialog = new goog.ui.editor.LinkDialog(new goog.dom.DomHelper(opt_document),
mockLink);
if (opt_openInNewWindow) {
dialog.showOpenLinkInNewWindow(false);
}
if (opt_noFollow) {
dialog.showRelNoFollow();
}
dialog.addEventListener(goog.ui.editor.AbstractDialog.EventType.OK,
mockOkHandler);
dialog.show();
}
/**
* Sets up the mock event handler to expect an OK event with the given text
* and url.
*/
function expectOk(linkText, linkUrl, opt_openInNewWindow, opt_noFollow) {
mockOkHandler.handleEvent(new goog.testing.mockmatchers.ArgumentMatcher(
function(arg) {
return arg.type == goog.ui.editor.AbstractDialog.EventType.OK &&
arg.linkText == linkText &&
arg.linkUrl == linkUrl &&
arg.openInNewWindow == !!opt_openInNewWindow &&
arg.noFollow == !!opt_noFollow;
},
'{linkText: ' + linkText + ', linkUrl: ' + linkUrl +
', openInNewWindow: ' + opt_openInNewWindow +
', noFollow: ' + opt_noFollow + '}'));
}
/**
* Return true if we should use active element in our tests.
* @return {boolean} .
*/
function useActiveElement() {
return goog.editor.BrowserFeature.HAS_ACTIVE_ELEMENT ||
goog.userAgent.WEBKIT && goog.userAgent.isVersionOrHigher(9);
}
/**
* Tests that when you show the dialog for a new link, you can switch
* to the URL view.
* @param {Document=} opt_document Document to render the dialog into.
* Defaults to the main window's document.
*/
function testShowNewLinkSwitchToUrl(opt_document) {
mockCtrl.$replayAll();
setUpAnchor('', '', true); // Must be done before creating the dialog.
createAndShow(opt_document);
var webRadio = dialog.dom.getElement(
goog.ui.editor.LinkDialog.Id_.ON_WEB_TAB).firstChild;
var emailRadio = dialog.dom.getElement(
goog.ui.editor.LinkDialog.Id_.EMAIL_ADDRESS_TAB).firstChild;
assertTrue('Web Radio Button selected', webRadio.checked);
assertFalse('Email Radio Button selected', emailRadio.checked);
if (useActiveElement()) {
assertEquals('Focus should be on url input',
getUrlInput(),
dialog.dom.getActiveElement());
}
emailRadio.click();
assertFalse('Web Radio Button selected', webRadio.checked);
assertTrue('Email Radio Button selected', emailRadio.checked);
if (useActiveElement()) {
assertEquals('Focus should be on url input',
getEmailInput(),
dialog.dom.getActiveElement());
}
mockCtrl.$verifyAll();
}
/**
* Tests that when you show the dialog for a new link, the input fields are
* empty, the web tab is selected and focus is in the url input field.
* @param {Document=} opt_document Document to render the dialog into.
* Defaults to the main window's document.
*/
function testShowForNewLink(opt_document) {
mockCtrl.$replayAll();
setUpAnchor('', '', true); // Must be done before creating the dialog.
createAndShow(opt_document);
assertEquals('Display text input field should be empty',
'',
getDisplayInputText());
assertEquals('Url input field should be empty',
'',
getUrlInputText());
assertEquals('On the web tab should be selected',
goog.ui.editor.LinkDialog.Id_.ON_WEB,
dialog.curTabId_);
if (useActiveElement()) {
assertEquals('Focus should be on url input',
getUrlInput(),
dialog.dom.getActiveElement());
}
mockCtrl.$verifyAll();
}
/**
* Fakes that the mock field is using an iframe and does the same test as
* testShowForNewLink().
*/
function testShowForNewLinkWithDiffAppWindow() {
testShowForNewLink(goog.dom.getElement('appWindowIframe').contentDocument);
}
/**
* Tests that when you show the dialog for a url link, the input fields are
* filled in, the web tab is selected and focus is in the url input field.
*/
function testShowForUrlLink() {
mockCtrl.$replayAll();
setUpAnchor(ANCHOR_URL, ANCHOR_TEXT);
createAndShow();
assertEquals('Display text input field should be filled in',
ANCHOR_TEXT,
getDisplayInputText());
assertEquals('Url input field should be filled in',
ANCHOR_URL,
getUrlInputText());
assertEquals('On the web tab should be selected',
goog.ui.editor.LinkDialog.Id_.ON_WEB,
dialog.curTabId_);
if (useActiveElement()) {
assertEquals('Focus should be on url input',
getUrlInput(),
dialog.dom.getActiveElement());
}
mockCtrl.$verifyAll();
}
/**
* Tests that when you show the dialog for a mailto link, the input fields are
* filled in, the email tab is selected and focus is in the email input field.
*/
function testShowForMailtoLink() {
mockCtrl.$replayAll();
setUpAnchor(ANCHOR_MAILTO, ANCHOR_TEXT);
createAndShow();
assertEquals('Display text input field should be filled in',
ANCHOR_TEXT,
getDisplayInputText());
assertEquals('Email input field should be filled in',
ANCHOR_EMAIL, // The 'mailto:' is not in the input!
getEmailInputText());
assertEquals('Email tab should be selected',
goog.ui.editor.LinkDialog.Id_.EMAIL_ADDRESS,
dialog.curTabId_);
if (useActiveElement()) {
assertEquals('Focus should be on email input',
getEmailInput(),
dialog.dom.getActiveElement());
}
mockCtrl.$verifyAll();
}
/**
* Tests that the display text is autogenerated from the url input in the
* right situations (and not generated when appropriate too).
*/
function testAutogeneration() {
mockCtrl.$replayAll();
setUpAnchor('', '', true);
createAndShow();
// Simulate typing a url when everything is empty, should autogen.
setUrlInputText(ANCHOR_URL);
assertEquals('Display text should have been autogenerated',
ANCHOR_URL,
getDisplayInputText());
// Simulate typing text when url is set, afterwards should not autogen.
setDisplayInputText(ANCHOR_TEXT);
setUrlInputText(ANCHOR_MAILTO);
assertNotEquals('Display text should not have been autogenerated',
ANCHOR_MAILTO,
getDisplayInputText());
assertEquals('Display text should have remained the same',
ANCHOR_TEXT,
getDisplayInputText());
// Simulate typing text equal to existing url, afterwards should autogen.
setDisplayInputText(ANCHOR_MAILTO);
setUrlInputText(ANCHOR_URL);
assertEquals('Display text should have been autogenerated',
ANCHOR_URL,
getDisplayInputText());
mockCtrl.$verifyAll();
}
/**
* Tests that the display text is not autogenerated from the url input in all
* situations when the autogeneration feature is turned off.
*/
function testAutogenerationOff() {
mockCtrl.$replayAll();
setUpAnchor('', '', true);
createAndShow();
// Disable the autogen feature
dialog.setAutogenFeatureEnabled(false);
// Simulate typing a url when everything is empty, should not autogen.
setUrlInputText(ANCHOR_URL);
assertEquals('Display text should not have been autogenerated',
'',
getDisplayInputText());
// Simulate typing text when url is set, afterwards should not autogen.
setDisplayInputText(ANCHOR_TEXT);
setUrlInputText(ANCHOR_MAILTO);
assertNotEquals('Display text should not have been autogenerated',
ANCHOR_MAILTO,
getDisplayInputText());
assertEquals('Display text should have remained the same',
ANCHOR_TEXT,
getDisplayInputText());
// Simulate typing text equal to existing url, afterwards should not
// autogen.
setDisplayInputText(ANCHOR_MAILTO);
setUrlInputText(ANCHOR_URL);
assertEquals('Display text should not have been autogenerated',
ANCHOR_MAILTO,
getDisplayInputText());
mockCtrl.$verifyAll();
}
/**
* Tests that clicking OK with the url tab selected dispatches an event with
* the proper link data.
*/
function testOkForUrl() {
expectOk(ANCHOR_TEXT, ANCHOR_URL);
mockCtrl.$replayAll();
setUpAnchor('', '', true);
createAndShow();
dialog.tabPane_.setSelectedTabId(goog.ui.editor.LinkDialog.Id_.ON_WEB_TAB);
setDisplayInputText(ANCHOR_TEXT);
setUrlInputText(ANCHOR_URL);
goog.testing.events.fireClickSequence(dialog.getOkButtonElement());
mockCtrl.$verifyAll();
}
/**
* Tests that clicking OK with the url tab selected but with an email address
* in the url field dispatches an event with the proper link data.
*/
function testOkForUrlWithEmail() {
expectOk(ANCHOR_TEXT, ANCHOR_MAILTO);
mockCtrl.$replayAll();
setUpAnchor('', '', true);
createAndShow();
dialog.tabPane_.setSelectedTabId(goog.ui.editor.LinkDialog.Id_.ON_WEB_TAB);
setDisplayInputText(ANCHOR_TEXT);
setUrlInputText(ANCHOR_EMAIL);
goog.testing.events.fireClickSequence(dialog.getOkButtonElement());
mockCtrl.$verifyAll();
}
/**
* Tests that clicking OK with the email tab selected dispatches an event with
* the proper link data.
*/
function testOkForEmail() {
expectOk(ANCHOR_TEXT, ANCHOR_MAILTO);
mockCtrl.$replayAll();
setUpAnchor('', '', true);
createAndShow();
dialog.tabPane_.setSelectedTabId(
goog.ui.editor.LinkDialog.Id_.EMAIL_ADDRESS_TAB);
setDisplayInputText(ANCHOR_TEXT);
setEmailInputText(ANCHOR_EMAIL);
goog.testing.events.fireClickSequence(dialog.getOkButtonElement());
mockCtrl.$verifyAll();
}
function testOpenLinkInNewWindowNewLink() {
expectOk(ANCHOR_TEXT, ANCHOR_URL, true);
expectOk(ANCHOR_TEXT, ANCHOR_URL, false);
mockCtrl.$replayAll();
setUpAnchor('', '', true);
createAndShow(undefined, true);
dialog.tabPane_.setSelectedTabId(goog.ui.editor.LinkDialog.Id_.ON_WEB_TAB);
setDisplayInputText(ANCHOR_TEXT);
setUrlInputText(ANCHOR_URL);
assertFalse('"Open in new window" should start unchecked',
getOpenInNewWindowCheckboxChecked());
setOpenInNewWindowCheckboxChecked(true);
assertTrue('"Open in new window" should have gotten checked',
getOpenInNewWindowCheckboxChecked());
goog.testing.events.fireClickSequence(dialog.getOkButtonElement());
// Reopen same dialog
dialog.show();
dialog.tabPane_.setSelectedTabId(goog.ui.editor.LinkDialog.Id_.ON_WEB_TAB);
setDisplayInputText(ANCHOR_TEXT);
setUrlInputText(ANCHOR_URL);
assertTrue('"Open in new window" should remember it was checked',
getOpenInNewWindowCheckboxChecked());
setOpenInNewWindowCheckboxChecked(false);
assertFalse('"Open in new window" should have gotten unchecked',
getOpenInNewWindowCheckboxChecked());
goog.testing.events.fireClickSequence(dialog.getOkButtonElement());
}
function testOpenLinkInNewWindowExistingLink() {
mockCtrl.$replayAll();
// Edit an existing link that already opens in a new window.
setUpAnchor('', '', false, '_blank');
createAndShow(undefined, true);
dialog.tabPane_.setSelectedTabId(goog.ui.editor.LinkDialog.Id_.ON_WEB_TAB);
setDisplayInputText(ANCHOR_TEXT);
setUrlInputText(ANCHOR_URL);
assertTrue('"Open in new window" should start checked for existing link',
getOpenInNewWindowCheckboxChecked());
mockCtrl.$verifyAll();
}
function testRelNoFollowNewLink() {
expectOk(ANCHOR_TEXT, ANCHOR_URL, null, true);
expectOk(ANCHOR_TEXT, ANCHOR_URL, null, false);
mockCtrl.$replayAll();
setUpAnchor('', '', true, true);
createAndShow(null, null, true);
dialog.tabPane_.setSelectedTabId(goog.ui.editor.LinkDialog.Id_.ON_WEB_TAB);
setDisplayInputText(ANCHOR_TEXT);
setUrlInputText(ANCHOR_URL);
assertFalse('rel=nofollow should start unchecked',
dialog.relNoFollowCheckbox_.checked);
// Check rel=nofollow and close the dialog.
dialog.relNoFollowCheckbox_.checked = true;
goog.testing.events.fireClickSequence(dialog.getOkButtonElement());
// Reopen the same dialog.
anchorElem.rel = 'foo nofollow bar';
dialog.show();
dialog.tabPane_.setSelectedTabId(goog.ui.editor.LinkDialog.Id_.ON_WEB_TAB);
setDisplayInputText(ANCHOR_TEXT);
setUrlInputText(ANCHOR_URL);
assertTrue('rel=nofollow should start checked when reopening the dialog',
dialog.relNoFollowCheckbox_.checked);
}
function testRelNoFollowExistingLink() {
mockCtrl.$replayAll();
setUpAnchor('', '', null, null, 'foo nofollow bar');
createAndShow(null, null, true);
assertTrue('rel=nofollow should start checked for existing link',
dialog.relNoFollowCheckbox_.checked);
mockCtrl.$verifyAll();
}
/**
* Test that clicking on the test button opens a new window with the correct
* options.
*/
function testWebTestButton() {
if (goog.userAgent.GECKO) {
// TODO(robbyw): Figure out why this is flaky and fix it.
return;
}
var width, height;
mockWindowOpen(ANCHOR_URL, '_blank',
new goog.testing.mockmatchers.ArgumentMatcher(function(str) {
return str == 'width=' + width + ',height=' + height +
',toolbar=1,scrollbars=1,location=1,statusbar=0,' +
'menubar=1,resizable=1';
}, '3rd arg: (string) window.open() options'));
mockCtrl.$replayAll();
setUpAnchor(ANCHOR_URL, ANCHOR_TEXT);
createAndShow();
// Measure viewport after opening dialog because that might cause scrollbars
// to appear and reduce the viewport size.
var size = goog.dom.getViewportSize(window);
width = Math.max(size.width - 50, 50);
height = Math.max(size.height - 50, 50);
var testLink = goog.testing.dom.findTextNode(
goog.ui.editor.messages.MSG_TEST_THIS_LINK,
dialog.dialogInternal_.getElement());
goog.testing.events.fireClickSequence(testLink.parentNode);
mockCtrl.$verifyAll();
}
/**
* Test that clicking on the test button does not open a new window when
* the event is canceled.
*/
function testWebTestButtonPreventDefault() {
mockCtrl.$replayAll();
setUpAnchor(ANCHOR_URL, ANCHOR_TEXT);
createAndShow();
goog.events.listen(dialog,
goog.ui.editor.LinkDialog.EventType.BEFORE_TEST_LINK,
function(e) {
assertEquals(e.url, ANCHOR_URL);
e.preventDefault();
});
var testLink = goog.testing.dom.findTextNode(
goog.ui.editor.messages.MSG_TEST_THIS_LINK,
dialog.dialogInternal_.getElement());
goog.testing.events.fireClickSequence(testLink.parentNode);
mockCtrl.$verifyAll();
}
/**
* Test that the setTextToDisplayVisible() correctly works.
* options.
*/
function testSetTextToDisplayVisible() {
mockCtrl.$replayAll();
setUpAnchor('', '', true);
createAndShow();
assertNotEquals('none',
goog.style.getStyle(dialog.textToDisplayDiv_, 'display'));
dialog.setTextToDisplayVisible(false);
assertEquals('none',
goog.style.getStyle(dialog.textToDisplayDiv_, 'display'));
dialog.setTextToDisplayVisible(true);
assertNotEquals('none',
goog.style.getStyle(dialog.textToDisplayDiv_, 'display'));
mockCtrl.$verifyAll();
}
function getDisplayInput() {
return dialog.dom.getElement(goog.ui.editor.LinkDialog.Id_.TEXT_TO_DISPLAY);
}
function getDisplayInputText() {
return getDisplayInput().value;
}
function setDisplayInputText(text) {
var textInput = getDisplayInput();
textInput.value = text;
// Fire event so that dialog behaves like when user types.
goog.testing.events.fireBrowserEvent(new goog.events.Event('keyup',
textInput));
}
function getUrlInput() {
var elt = dialog.dom.getElement(goog.ui.editor.LinkDialog.Id_.ON_WEB_INPUT);
assertNotNullNorUndefined('UrlInput must be found', elt);
return elt;
}
function getUrlInputText() {
return getUrlInput().value;
}
function setUrlInputText(text) {
var urlInput = getUrlInput();
urlInput.value = text;
// Fire event so that dialog behaves like when user types.
dialog.urlInputHandler_.dispatchEvent(
goog.events.InputHandler.EventType.INPUT);
}
function getEmailInput() {
var elt = dialog.dom.getElement(
goog.ui.editor.LinkDialog.Id_.EMAIL_ADDRESS_INPUT);
assertNotNullNorUndefined('EmailInput must be found', elt);
return elt;
}
function getEmailInputText() {
return getEmailInput().value;
}
function setEmailInputText(text) {
var emailInput = getEmailInput();
emailInput.value = text;
// Fire event so that dialog behaves like when user types.
dialog.emailInputHandler_.dispatchEvent(
goog.events.InputHandler.EventType.INPUT);
}
function getOpenInNewWindowCheckboxChecked() {
return dialog.openInNewWindowCheckbox_.checked;
}
function setOpenInNewWindowCheckboxChecked(checked) {
dialog.openInNewWindowCheckbox_.checked = checked;
}
|
/**
* Module dependencies.
*/
var transports = require('./transports');
var Emitter = require('component-emitter');
var debug = require('debug')('engine.io-client:socket');
var index = require('indexof');
var parser = require('engine.io-parser');
var parseuri = require('parseuri');
var parsejson = require('parsejson');
var parseqs = require('parseqs');
/**
* Module exports.
*/
module.exports = Socket;
/**
* Noop function.
*
* @api private
*/
function noop(){}
/**
* Socket constructor.
*
* @param {String|Object} uri or options
* @param {Object} options
* @api public
*/
function Socket(uri, opts){
if (!(this instanceof Socket)) return new Socket(uri, opts);
opts = opts || {};
if (uri && 'object' == typeof uri) {
opts = uri;
uri = null;
}
if (uri) {
uri = parseuri(uri);
opts.host = uri.host;
opts.secure = uri.protocol == 'https' || uri.protocol == 'wss';
opts.port = uri.port;
if (uri.query) opts.query = uri.query;
}
this.secure = null != opts.secure ? opts.secure :
(global.location && 'https:' == location.protocol);
if (opts.host) {
var pieces = opts.host.split(':');
opts.hostname = pieces.shift();
if (pieces.length) {
opts.port = pieces.pop();
} else if (!opts.port) {
// if no port is specified manually, use the protocol default
opts.port = this.secure ? '443' : '80';
}
}
this.agent = opts.agent || false;
this.hostname = opts.hostname ||
(global.location ? location.hostname : 'localhost');
this.port = opts.port || (global.location && location.port ?
location.port :
(this.secure ? 443 : 80));
this.query = opts.query || {};
if ('string' == typeof this.query) this.query = parseqs.decode(this.query);
this.upgrade = false !== opts.upgrade;
this.path = (opts.path || '/engine.io').replace(/\/$/, '') + '/';
this.forceJSONP = !!opts.forceJSONP;
this.jsonp = false !== opts.jsonp;
this.forceBase64 = !!opts.forceBase64;
this.enablesXDR = !!opts.enablesXDR;
this.timestampParam = opts.timestampParam || 't';
this.timestampRequests = opts.timestampRequests;
this.transports = opts.transports || ['polling', 'websocket'];
this.readyState = '';
this.writeBuffer = [];
this.callbackBuffer = [];
this.policyPort = opts.policyPort || 843;
this.rememberUpgrade = opts.rememberUpgrade || false;
this.binaryType = null;
this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades;
this.perMessageDeflate = false !== opts.perMessageDeflate ? (opts.perMessageDeflate || true) : false;
// SSL options for Node.js client
this.pfx = opts.pfx || null;
this.key = opts.key || null;
this.passphrase = opts.passphrase || null;
this.cert = opts.cert || null;
this.ca = opts.ca || null;
this.ciphers = opts.ciphers || null;
this.rejectUnauthorized = opts.rejectUnauthorized || null;
this.open();
}
Socket.priorWebsocketSuccess = false;
/**
* Mix in `Emitter`.
*/
Emitter(Socket.prototype);
/**
* Protocol version.
*
* @api public
*/
Socket.protocol = parser.protocol; // this is an int
/**
* Expose deps for legacy compatibility
* and standalone browser access.
*/
Socket.Socket = Socket;
Socket.Transport = require('./transport');
Socket.transports = require('./transports');
Socket.parser = require('engine.io-parser');
/**
* Creates transport of the given type.
*
* @param {String} transport name
* @return {Transport}
* @api private
*/
Socket.prototype.createTransport = function (name) {
debug('creating transport "%s"', name);
var query = clone(this.query);
// append engine.io protocol identifier
query.EIO = parser.protocol;
// transport name
query.transport = name;
// session id if we already have one
if (this.id) query.sid = this.id;
var transport = new transports[name]({
agent: this.agent,
hostname: this.hostname,
port: this.port,
secure: this.secure,
path: this.path,
query: query,
forceJSONP: this.forceJSONP,
jsonp: this.jsonp,
forceBase64: this.forceBase64,
enablesXDR: this.enablesXDR,
timestampRequests: this.timestampRequests,
timestampParam: this.timestampParam,
policyPort: this.policyPort,
socket: this,
pfx: this.pfx,
key: this.key,
passphrase: this.passphrase,
cert: this.cert,
ca: this.ca,
ciphers: this.ciphers,
rejectUnauthorized: this.rejectUnauthorized,
perMessageDeflate: this.perMessageDeflate
});
return transport;
};
function clone (obj) {
var o = {};
for (var i in obj) {
if (obj.hasOwnProperty(i)) {
o[i] = obj[i];
}
}
return o;
}
/**
* Initializes transport to use and starts probe.
*
* @api private
*/
Socket.prototype.open = function () {
var transport;
if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') != -1) {
transport = 'websocket';
} else if (0 == this.transports.length) {
// Emit error on next tick so it can be listened to
var self = this;
setTimeout(function() {
self.emit('error', 'No transports available');
}, 0);
return;
} else {
transport = this.transports[0];
}
this.readyState = 'opening';
// Retry with the next transport if the transport is disabled (jsonp: false)
var transport;
try {
transport = this.createTransport(transport);
} catch (e) {
this.transports.shift();
this.open();
return;
}
transport.open();
this.setTransport(transport);
};
/**
* Sets the current transport. Disables the existing one (if any).
*
* @api private
*/
Socket.prototype.setTransport = function(transport){
debug('setting transport %s', transport.name);
var self = this;
if (this.transport) {
debug('clearing existing transport %s', this.transport.name);
this.transport.removeAllListeners();
}
// set up transport
this.transport = transport;
// set up transport listeners
transport
.on('drain', function(){
self.onDrain();
})
.on('packet', function(packet){
self.onPacket(packet);
})
.on('error', function(e){
self.onError(e);
})
.on('close', function(){
self.onClose('transport close');
});
};
/**
* Probes a transport.
*
* @param {String} transport name
* @api private
*/
Socket.prototype.probe = function (name) {
debug('probing transport "%s"', name);
var transport = this.createTransport(name, { probe: 1 })
, failed = false
, self = this;
Socket.priorWebsocketSuccess = false;
function onTransportOpen(){
if (self.onlyBinaryUpgrades) {
var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary;
failed = failed || upgradeLosesBinary;
}
if (failed) return;
debug('probe transport "%s" opened', name);
transport.send([{ type: 'ping', data: 'probe', options: { compress: true } }]);
transport.once('packet', function (msg) {
if (failed) return;
if ('pong' == msg.type && 'probe' == msg.data) {
debug('probe transport "%s" pong', name);
self.upgrading = true;
self.emit('upgrading', transport);
if (!transport) return;
Socket.priorWebsocketSuccess = 'websocket' == transport.name;
debug('pausing current transport "%s"', self.transport.name);
self.transport.pause(function () {
if (failed) return;
if ('closed' == self.readyState) return;
debug('changing transport and sending upgrade packet');
cleanup();
self.setTransport(transport);
transport.send([{ type: 'upgrade', options: { compress: true } }]);
self.emit('upgrade', transport);
transport = null;
self.upgrading = false;
self.flush();
});
} else {
debug('probe transport "%s" failed', name);
var err = new Error('probe error');
err.transport = transport.name;
self.emit('upgradeError', err);
}
});
}
function freezeTransport() {
if (failed) return;
// Any callback called by transport should be ignored since now
failed = true;
cleanup();
transport.close();
transport = null;
}
//Handle any error that happens while probing
function onerror(err) {
var error = new Error('probe error: ' + err);
error.transport = transport.name;
freezeTransport();
debug('probe transport "%s" failed because of error: %s', name, err);
self.emit('upgradeError', error);
}
function onTransportClose(){
onerror("transport closed");
}
//When the socket is closed while we're probing
function onclose(){
onerror("socket closed");
}
//When the socket is upgraded while we're probing
function onupgrade(to){
if (transport && to.name != transport.name) {
debug('"%s" works - aborting "%s"', to.name, transport.name);
freezeTransport();
}
}
//Remove all listeners on the transport and on self
function cleanup(){
transport.removeListener('open', onTransportOpen);
transport.removeListener('error', onerror);
transport.removeListener('close', onTransportClose);
self.removeListener('close', onclose);
self.removeListener('upgrading', onupgrade);
}
transport.once('open', onTransportOpen);
transport.once('error', onerror);
transport.once('close', onTransportClose);
this.once('close', onclose);
this.once('upgrading', onupgrade);
transport.open();
};
/**
* Called when connection is deemed open.
*
* @api public
*/
Socket.prototype.onOpen = function () {
debug('socket open');
this.readyState = 'open';
Socket.priorWebsocketSuccess = 'websocket' == this.transport.name;
this.emit('open');
this.flush();
// we check for `readyState` in case an `open`
// listener already closed the socket
if ('open' == this.readyState && this.upgrade && this.transport.pause) {
debug('starting upgrade probes');
for (var i = 0, l = this.upgrades.length; i < l; i++) {
this.probe(this.upgrades[i]);
}
}
};
/**
* Handles a packet.
*
* @api private
*/
Socket.prototype.onPacket = function (packet) {
if ('opening' == this.readyState || 'open' == this.readyState) {
debug('socket receive: type "%s", data "%s"', packet.type, packet.data);
this.emit('packet', packet);
// Socket is live - any packet counts
this.emit('heartbeat');
switch (packet.type) {
case 'open':
this.onHandshake(parsejson(packet.data));
break;
case 'pong':
this.setPing();
break;
case 'error':
var err = new Error('server error');
err.code = packet.data;
this.emit('error', err);
break;
case 'message':
this.emit('data', packet.data);
this.emit('message', packet.data);
break;
}
} else {
debug('packet received with socket readyState "%s"', this.readyState);
}
};
/**
* Called upon handshake completion.
*
* @param {Object} handshake obj
* @api private
*/
Socket.prototype.onHandshake = function (data) {
this.emit('handshake', data);
this.id = data.sid;
this.transport.query.sid = data.sid;
this.upgrades = this.filterUpgrades(data.upgrades);
this.pingInterval = data.pingInterval;
this.pingTimeout = data.pingTimeout;
this.onOpen();
// In case open handler closes socket
if ('closed' == this.readyState) return;
this.setPing();
// Prolong liveness of socket on heartbeat
this.removeListener('heartbeat', this.onHeartbeat);
this.on('heartbeat', this.onHeartbeat);
};
/**
* Resets ping timeout.
*
* @api private
*/
Socket.prototype.onHeartbeat = function (timeout) {
clearTimeout(this.pingTimeoutTimer);
var self = this;
self.pingTimeoutTimer = setTimeout(function () {
if ('closed' == self.readyState) return;
self.onClose('ping timeout');
}, timeout || (self.pingInterval + self.pingTimeout));
};
/**
* Pings server every `this.pingInterval` and expects response
* within `this.pingTimeout` or closes connection.
*
* @api private
*/
Socket.prototype.setPing = function () {
var self = this;
clearTimeout(self.pingIntervalTimer);
self.pingIntervalTimer = setTimeout(function () {
debug('writing ping packet - expecting pong within %sms', self.pingTimeout);
self.ping();
self.onHeartbeat(self.pingTimeout);
}, self.pingInterval);
};
/**
* Sends a ping packet.
*
* @api public
*/
Socket.prototype.ping = function () {
this.sendPacket('ping');
};
/**
* Called on `drain` event
*
* @api private
*/
Socket.prototype.onDrain = function() {
for (var i = 0; i < this.prevBufferLen; i++) {
if (this.callbackBuffer[i]) {
this.callbackBuffer[i]();
}
}
this.writeBuffer.splice(0, this.prevBufferLen);
this.callbackBuffer.splice(0, this.prevBufferLen);
// setting prevBufferLen = 0 is very important
// for example, when upgrading, upgrade packet is sent over,
// and a nonzero prevBufferLen could cause problems on `drain`
this.prevBufferLen = 0;
if (this.writeBuffer.length == 0) {
this.emit('drain');
} else {
this.flush();
}
};
/**
* Flush write buffers.
*
* @api private
*/
Socket.prototype.flush = function () {
if ('closed' != this.readyState && this.transport.writable &&
!this.upgrading && this.writeBuffer.length) {
debug('flushing %d packets in socket', this.writeBuffer.length);
this.transport.send(this.writeBuffer);
// keep track of current length of writeBuffer
// splice writeBuffer and callbackBuffer on `drain`
this.prevBufferLen = this.writeBuffer.length;
this.emit('flush');
}
};
/**
* Sends a message.
*
* @param {String} message.
* @param {Function} callback function.
* @param {Object} options.
* @return {Socket} for chaining.
* @api public
*/
Socket.prototype.write =
Socket.prototype.send = function (msg, options, fn) {
this.sendPacket('message', msg, options, fn);
return this;
};
/**
* Sends a packet.
*
* @param {String} packet type.
* @param {String} data.
* @param {Object} options.
* @param {Function} callback function.
* @api private
*/
Socket.prototype.sendPacket = function (type, data, options, fn) {
if ('function' == typeof options) {
fn = options;
options = null;
}
if ('closing' == this.readyState || 'closed' == this.readyState) {
return;
}
options = options || {};
options.compress = false !== options.compress;
var packet = {
type: type,
data: data,
options: options
};
this.emit('packetCreate', packet);
this.writeBuffer.push(packet);
this.callbackBuffer.push(fn);
this.flush();
};
/**
* Closes the connection.
*
* @api private
*/
Socket.prototype.close = function () {
if ('opening' == this.readyState || 'open' == this.readyState) {
this.readyState = 'closing';
var self = this;
function close() {
self.onClose('forced close');
debug('socket closing - telling transport to close');
self.transport.close();
}
function cleanupAndClose() {
self.removeListener('upgrade', cleanupAndClose);
self.removeListener('upgradeError', cleanupAndClose);
close();
}
function waitForUpgrade() {
// wait for upgrade to finish since we can't send packets while pausing a transport
self.once('upgrade', cleanupAndClose);
self.once('upgradeError', cleanupAndClose);
}
if (this.writeBuffer.length) {
this.once('drain', function() {
if (this.upgrading) {
waitForUpgrade();
} else {
close();
}
});
} else if (this.upgrading) {
waitForUpgrade();
} else {
close();
}
}
return this;
};
/**
* Called upon transport error
*
* @api private
*/
Socket.prototype.onError = function (err) {
debug('socket error %j', err);
Socket.priorWebsocketSuccess = false;
this.emit('error', err);
this.onClose('transport error', err);
};
/**
* Called upon transport close.
*
* @api private
*/
Socket.prototype.onClose = function (reason, desc) {
if ('opening' == this.readyState || 'open' == this.readyState || 'closing' == this.readyState) {
debug('socket close with reason: "%s"', reason);
var self = this;
// clear timers
clearTimeout(this.pingIntervalTimer);
clearTimeout(this.pingTimeoutTimer);
// clean buffers in next tick, so developers can still
// grab the buffers on `close` event
setTimeout(function() {
self.writeBuffer = [];
self.callbackBuffer = [];
self.prevBufferLen = 0;
}, 0);
// stop event from firing again for transport
this.transport.removeAllListeners('close');
// ensure transport won't stay open
this.transport.close();
// ignore further transport communication
this.transport.removeAllListeners();
// set ready state
this.readyState = 'closed';
// clear session id
this.id = null;
// emit close event
this.emit('close', reason, desc);
}
};
/**
* Filters upgrades, returning only those matching client transports.
*
* @param {Array} server upgrades
* @api private
*
*/
Socket.prototype.filterUpgrades = function (upgrades) {
var filteredUpgrades = [];
for (var i = 0, j = upgrades.length; i<j; i++) {
if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]);
}
return filteredUpgrades;
};
|
#!/usr/bin/env node
var fs = require('fs')
, path = require('path')
, glob = require('glob')
;
var CERT_PATH = path.join(__dirname, '..', '..', 'SSL_CA_cert_bundle', '*.pem');
var OUTFILE =
path.join(__dirname, '..', 'lib', 'collector', 'ssl', 'certificates.js');
var HEADER =
"/**\n" +
" * certificates.js - CA bundle for SSL communication with RPM.\n" +
" *\n" +
" * This file contains the X509 certificates used to communicate with New Relic\n" +
" * over SSL.\n" +
" */\n\n";
function Certificate() {
this.name = null;
this.body = null;
}
Certificate.prototype.toEntry = function toEntry() {
var output = ' // ' + this.name + '\n';
var rawPEM = this.body.split('\n');
var line;
for (var i = 0; i < rawPEM.length; i++) {
line = rawPEM[i];
// some Thawte certificates have Windows line endings
line = line.replace('\r', '');
if (line.match(/END CERTIFICATE/)) {
output += ' "' + line + '\\n"';
break;
}
else {
output += ' "' + line + '\\n" +\n';
}
}
return output;
};
function loadCerts(root, callback) {
glob(root, function (error, files) {
if (error) return callback(error, null);
var certificates = [];
console.error("Loading %s certficates.", files.length);
var certificate, file;
for (var i = 0; i < files.length; i++) {
file = files[i];
certificate = new Certificate();
certificate.name = path.basename(file, '.pem');
certificate.body = fs.readFileSync(file, 'ascii');
certificates.push(certificate);
}
callback(null, certificates);
});
}
function dumpCerts(error, certs) {
if (error) {
console.error("got %s reading certs; bailing out", error.message);
process.exit(1);
}
fs.writeFileSync(
OUTFILE,
HEADER +
'module.exports = [\n' +
certs.map(function cb_map(cert) { return cert.toEntry(); }).join(',\n\n') +
'\n];\n'
);
}
loadCerts(CERT_PATH, dumpCerts);
|
// @flow
import {mkdirp} from './fileUtils';
import {cloneInto, rebaseRepoMaster} from './git';
import {fs, os, path} from './node';
import semver from 'semver';
const CACHE_REPO_EXPIRY = 1000 * 60; // 1 minute
const REMOTE_REPO_URL = 'https://github.com/flowtype/flow-typed.git';
async function cloneCacheRepo() {
await mkdirp(getCacheRepoDir());
try {
await cloneInto(REMOTE_REPO_URL, getCacheRepoDir());
} catch (e) {
console.error('ERROR: Unable to clone local cache repo!');
throw e;
}
await fs.writeFile(getLastUpdatedFile(), String(Date.now()));
}
let customCacheDir = null;
function getCacheDir() {
return customCacheDir === null
? path.join(os.homedir(), '.flow-typed')
: customCacheDir;
}
function clearCustomCacheDir(): void {
customCacheDir = null;
}
function setCustomCacheDir(dir: string): void {
customCacheDir = dir;
}
function getCacheRepoGitDir() {
return path.join(getCacheRepoDir(), '.git');
}
function getLastUpdatedFile() {
return path.join(getCacheRepoDir(), 'lastUpdated');
}
async function rebaseCacheRepo() {
if (
(await fs.exists(getCacheRepoDir())) &&
(await fs.exists(getCacheRepoGitDir()))
) {
try {
await rebaseRepoMaster(getCacheRepoDir());
} catch (e) {
console.error(
'ERROR: Unable to rebase the local cache repo. ' + e.message,
);
return false;
}
await fs.writeFile(getLastUpdatedFile(), String(Date.now()));
return true;
} else {
await cloneCacheRepo();
return true;
}
}
/**
* Ensure that the CACHE_REPO_DIR exists and is recently rebased.
* (else: create/rebase it)
*/
const cacheRepoEnsureToken = {
lastEnsured: 0,
pendingEnsurance: Promise.resolve(),
};
export async function ensureCacheRepo(
cacheRepoExpiry: number = CACHE_REPO_EXPIRY,
) {
// Only re-run rebase checks if a check hasn't been run in the last 5 minutes
if (cacheRepoEnsureToken.lastEnsured + 5 * 1000 * 60 >= Date.now()) {
return cacheRepoEnsureToken.pendingEnsurance;
}
cacheRepoEnsureToken.lastEnsured = Date.now();
const prevEnsurance = cacheRepoEnsureToken.pendingEnsurance;
return (cacheRepoEnsureToken.pendingEnsurance = prevEnsurance.then(() =>
(async function() {
const repoDirExists = fs.exists(getCacheRepoDir());
const repoGitDirExists = fs.exists(getCacheRepoGitDir());
if (!await repoDirExists || !await repoGitDirExists) {
console.log(`• flow-typed cache not found, fetching from GitHub...`);
await cloneCacheRepo();
} else {
let lastUpdated = 0;
if (await fs.exists(getLastUpdatedFile())) {
// If the LAST_UPDATED_FILE has anything other than just a number in
// it, just assume we need to update.
const lastUpdatedRaw = await fs.readFile(getLastUpdatedFile());
const lastUpdatedNum = parseInt(lastUpdatedRaw, 10);
if (String(lastUpdatedNum) === String(lastUpdatedRaw)) {
lastUpdated = lastUpdatedNum;
}
}
if (lastUpdated + cacheRepoExpiry < Date.now()) {
console.log('• rebasing flow-typed cache...');
const rebaseSuccessful = await rebaseCacheRepo();
if (!rebaseSuccessful) {
console.log(
"\nNOTE: Unable to rebase local cache! If you don't currently " +
"have internet connectivity, no worries -- we'll update the " +
'local cache the next time you do.\n',
);
}
}
}
})(),
));
}
export function getCacheRepoDir() {
return path.join(getCacheDir(), 'repo');
}
export async function verifyCLIVersion(): Promise<void> {
const metadataPath = path.join(
getCacheRepoDir(),
'definitions',
'.cli-metadata.json',
);
const metadata = JSON.parse(String(await fs.readFile(metadataPath)));
const compatibleCLIRange = metadata.compatibleCLIRange;
if (!compatibleCLIRange) {
throw new Error(
`Unable to find the 'compatibleCLIRange' property in ${metadataPath}. ` +
`You might need to update your flow-typed CLI to the latest version.`,
);
}
const thisCLIPkgJsonPath = path.join(__dirname, '..', '..', 'package.json');
const thisCLIPkgJson = JSON.parse(
String(await fs.readFile(thisCLIPkgJsonPath)),
);
const thisCLIVersion = thisCLIPkgJson.version;
if (!semver.satisfies(thisCLIVersion, compatibleCLIRange)) {
throw new Error(
`Please upgrade your flow-typed CLI! This CLI is version ` +
`${thisCLIVersion}, but the latest flow-typed definitions are only ` +
`compatible with flow-typed@${compatibleCLIRange}`,
);
}
}
export {
CACHE_REPO_EXPIRY as _CACHE_REPO_EXPIRY,
cacheRepoEnsureToken as _cacheRepoEnsureToken,
clearCustomCacheDir as _clearCustomCacheDir,
getCacheRepoGitDir as _getCacheRepoGitDir,
getLastUpdatedFile as _getLastUpdatedFile,
REMOTE_REPO_URL as _REMOTE_REPO_URL,
setCustomCacheDir as _setCustomCacheDir,
};
|
'repeat' in String.prototype
|
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import { refType } from '@material-ui/utils';
import SwitchBase from '../internal/SwitchBase';
import CheckBoxOutlineBlankIcon from '../internal/svg-icons/CheckBoxOutlineBlank';
import CheckBoxIcon from '../internal/svg-icons/CheckBox';
import { alpha } from '../styles/colorManipulator';
import IndeterminateCheckBoxIcon from '../internal/svg-icons/IndeterminateCheckBox';
import capitalize from '../utils/capitalize';
import withStyles from '../styles/withStyles';
export const styles = theme => ({
/* Styles applied to the root element. */
root: {
color: theme.palette.text.secondary
},
/* Pseudo-class applied to the root element if `checked={true}`. */
checked: {},
/* Pseudo-class applied to the root element if `disabled={true}`. */
disabled: {},
/* Pseudo-class applied to the root element if `indeterminate={true}`. */
indeterminate: {},
/* Styles applied to the root element if `color="primary"`. */
colorPrimary: {
'&$checked, &$indeterminate': {
color: theme.palette.primary.main,
'&:hover': {
backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity),
// Reset on touch devices, it doesn't add specificity
'@media (hover: none)': {
backgroundColor: 'transparent'
}
}
},
'&$disabled': {
color: theme.palette.action.disabled
}
},
/* Styles applied to the root element if `color="secondary"`. */
colorSecondary: {
'&$checked, &$indeterminate': {
color: theme.palette.secondary.main,
'&:hover': {
backgroundColor: alpha(theme.palette.secondary.main, theme.palette.action.hoverOpacity),
// Reset on touch devices, it doesn't add specificity
'@media (hover: none)': {
backgroundColor: 'transparent'
}
}
},
'&$disabled': {
color: theme.palette.action.disabled
}
}
});
const defaultCheckedIcon = /*#__PURE__*/React.createElement(CheckBoxIcon, null);
const defaultIcon = /*#__PURE__*/React.createElement(CheckBoxOutlineBlankIcon, null);
const defaultIndeterminateIcon = /*#__PURE__*/React.createElement(IndeterminateCheckBoxIcon, null);
const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
const {
checkedIcon = defaultCheckedIcon,
classes,
color = 'secondary',
icon: iconProp = defaultIcon,
indeterminate = false,
indeterminateIcon: indeterminateIconProp = defaultIndeterminateIcon,
inputProps,
size = 'medium'
} = props,
other = _objectWithoutPropertiesLoose(props, ["checkedIcon", "classes", "color", "icon", "indeterminate", "indeterminateIcon", "inputProps", "size"]);
const icon = indeterminate ? indeterminateIconProp : iconProp;
const indeterminateIcon = indeterminate ? indeterminateIconProp : checkedIcon;
return /*#__PURE__*/React.createElement(SwitchBase, _extends({
type: "checkbox",
classes: {
root: clsx(classes.root, classes[`color${capitalize(color)}`], indeterminate && classes.indeterminate),
checked: classes.checked,
disabled: classes.disabled
},
color: color,
inputProps: _extends({
'data-indeterminate': indeterminate
}, inputProps),
icon: /*#__PURE__*/React.cloneElement(icon, {
fontSize: icon.props.fontSize === undefined && size === "small" ? size : icon.props.fontSize
}),
checkedIcon: /*#__PURE__*/React.cloneElement(indeterminateIcon, {
fontSize: indeterminateIcon.props.fontSize === undefined && size === "small" ? size : indeterminateIcon.props.fontSize
}),
ref: ref
}, other));
});
process.env.NODE_ENV !== "production" ? Checkbox.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* If `true`, the component is checked.
*/
checked: PropTypes.bool,
/**
* The icon to display when the component is checked.
* @default <CheckBoxIcon />
*/
checkedIcon: PropTypes.node,
/**
* Override or extend the styles applied to the component.
*/
classes: PropTypes.object,
/**
* The color of the component. It supports those theme colors that make sense for this component.
* @default 'secondary'
*/
color: PropTypes.oneOf(['default', 'primary', 'secondary']),
/**
* If `true`, the checkbox will be disabled.
*/
disabled: PropTypes.bool,
/**
* If `true`, the ripple effect will be disabled.
*/
disableRipple: PropTypes.bool,
/**
* The icon to display when the component is unchecked.
* @default <CheckBoxOutlineBlankIcon />
*/
icon: PropTypes.node,
/**
* The id of the `input` element.
*/
id: PropTypes.string,
/**
* If `true`, the component appears indeterminate.
* This does not set the native input element to indeterminate due
* to inconsistent behavior across browsers.
* However, we set a `data-indeterminate` attribute on the input.
* @default false
*/
indeterminate: PropTypes.bool,
/**
* The icon to display when the component is indeterminate.
* @default <IndeterminateCheckBoxIcon />
*/
indeterminateIcon: PropTypes.node,
/**
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
*/
inputProps: PropTypes.object,
/**
* Pass a ref to the `input` element.
*/
inputRef: refType,
/**
* Callback fired when the state is changed.
*
* @param {object} event The event source of the callback.
* You can pull out the new checked state by accessing `event.target.checked` (boolean).
*/
onChange: PropTypes.func,
/**
* If `true`, the `input` element will be required.
*/
required: PropTypes.bool,
/**
* The size of the checkbox.
* `small` is equivalent to the dense checkbox styling.
* @default 'medium'
*/
size: PropTypes.oneOf(['medium', 'small']),
/**
* The value of the component. The DOM API casts this to a string.
* The browser uses "on" as the default value.
*/
value: PropTypes.any
} : void 0;
export default withStyles(styles, {
name: 'MuiCheckbox'
})(Checkbox); |
/*
* DC Mega Menu - jQuery mega menu
* Copyright (c) 2011 Design Chemical
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
(function($){
//define the defaults for the plugin and how to call it
$.fn.dcMegaMenu = function(options){
//set default options
var defaults = {
classParent: 'dc-mega',
classContainer: 'sub-container',
classSubParent: 'mega-hdr',
classSubLink: 'mega-hdr',
classWidget: 'dc-extra',
rowItems: 3,
speed: 'fast',
effect: 'fade',
event: 'hover',
fullWidth: false,
onLoad : function(){},
beforeOpen : function(){},
beforeClose: function(){}
};
//call in the default otions
var options = $.extend(defaults, options);
var $dcMegaMenuObj = this;
//act upon the element that is passed into the design
return $dcMegaMenuObj.each(function(options){
var clSubParent = defaults.classSubParent;
var clSubLink = defaults.classSubLink;
var clParent = defaults.classParent;
var clContainer = defaults.classContainer;
var clWidget = defaults.classWidget;
megaSetup();
function megaOver(){
var subNav = $('.sub',this);
$(this).addClass('mega-hover');
if(defaults.effect == 'fade'){
$(subNav).fadeIn(defaults.speed);
}
if(defaults.effect == 'slide'){
$(subNav).show(defaults.speed);
}
// beforeOpen callback;
defaults.beforeOpen.call(this);
}
function megaAction(obj){
var subNav = $('.sub',obj);
$(obj).addClass('mega-hover');
if(defaults.effect == 'fade'){
$(subNav).fadeIn(defaults.speed);
}
if(defaults.effect == 'slide'){
$(subNav).show(defaults.speed);
}
// beforeOpen callback;
defaults.beforeOpen.call(this);
}
function megaOut(){
var subNav = $('.sub',this);
$(this).removeClass('mega-hover');
$(subNav).hide();
// beforeClose callback;
defaults.beforeClose.call(this);
}
function megaActionClose(obj){
var subNav = $('.sub',obj);
$(obj).removeClass('mega-hover');
$(subNav).hide();
// beforeClose callback;
defaults.beforeClose.call(this);
}
function megaReset(){
$('li',$dcMegaMenuObj).removeClass('mega-hover');
$('.sub',$dcMegaMenuObj).hide();
}
function megaSetup(){
$arrow = '<span class="dc-mega-icon"></span>';
var clParentLi = clParent+'-li';
var menuWidth = $dcMegaMenuObj.outerWidth();
$('> li',$dcMegaMenuObj).each(function(){
//Set Width of sub
var $mainSub = $('> ul',this);
var $primaryLink = $('> a',this);
if($mainSub.length){
$primaryLink.addClass(clParent).append($arrow);
$mainSub.addClass('sub').wrap('<div class="'+clContainer+'" />');
var pos = $(this).position();
pl = pos.left;
if($('ul',$mainSub).length){
$(this).addClass(clParentLi);
$('.'+clContainer,this).addClass('mega');
$('> li',$mainSub).each(function(){
if(!$(this).hasClass(clWidget)){
$(this).addClass('mega-unit');
if($('> ul',this).length){
$(this).addClass(clSubParent);
$('> a',this).addClass(clSubParent+'-a');
} else {
$(this).addClass(clSubLink);
$('> a',this).addClass(clSubLink+'-a');
}
}
});
// Create Rows
var hdrs = $('.mega-unit',this);
rowSize = parseInt(defaults.rowItems);
for(var i = 0; i < hdrs.length; i+=rowSize){
hdrs.slice(i, i+rowSize).wrapAll('<div class="row" />');
}
// Get Sub Dimensions & Set Row Height
$mainSub.show();
// Get Position of Parent Item
var pw = $(this).width();
var pr = pl + pw;
// Check available right margin
var mr = menuWidth - pr;
// // Calc Width of Sub Menu
var subw = $mainSub.outerWidth();
var totw = $mainSub.parent('.'+clContainer).outerWidth();
var cpad = totw - subw;
if(defaults.fullWidth == true){
var fw = menuWidth - cpad;
$mainSub.parent('.'+clContainer).css({width: fw+'px'});
$dcMegaMenuObj.addClass('full-width');
}
var iw = $('.mega-unit',$mainSub).outerWidth(true);
var rowItems = $('.row:eq(0) .mega-unit',$mainSub).length;
var inneriw = iw * rowItems;
var totiw = inneriw + cpad;
// Set mega header height
$('.row',this).each(function(){
$('.mega-unit:last',this).addClass('last');
var maxValue = undefined;
$('.mega-unit > a',this).each(function(){
var val = parseInt($(this).height());
if (maxValue === undefined || maxValue < val){
maxValue = val;
}
});
$('.mega-unit > a',this).css('height',maxValue+'px');
$(this).css('width',inneriw+'px');
});
// Calc Required Left Margin incl additional required for right align
if(defaults.fullWidth == true){
params = {left: 0};
} else {
var ml = mr < ml ? ml + ml - mr : (totiw - pw)/2;
var subLeft = pl - ml;
// If Left Position Is Negative Set To Left Margin
var params = {left: pl+'px', marginLeft: -ml+'px'};
if(subLeft < 0){
params = {left: 0};
}else if(mr < ml){
params = {right: 0};
}
}
$('.'+clContainer,this).css(params);
// Calculate Row Height
$('.row',$mainSub).each(function(){
var rh = $(this).height();
$('.mega-unit',this).css({height: rh+'px'});
$(this).parent('.row').css({height: rh+'px'});
});
$mainSub.hide();
} else {
$('.'+clContainer,this).addClass('non-mega').css('left',pl+'px');
}
}
});
// Set position of mega dropdown to bottom of main menu
var menuHeight = $('> li > a',$dcMegaMenuObj).outerHeight(true);
$('.'+clContainer,$dcMegaMenuObj).css({top: menuHeight+'px'}).css('z-index','1000');
if(defaults.event == 'hover'){
// HoverIntent Configuration
var config = {
sensitivity: 2,
interval: 100,
over: megaOver,
timeout: 400,
out: megaOut
};
$('li',$dcMegaMenuObj).hoverIntent(config);
}
if(defaults.event == 'click'){
$('body').mouseup(function(e){
if(!$(e.target).parents('.mega-hover').length){
megaReset();
}
});
$('> li > a.'+clParent,$dcMegaMenuObj).click(function(e){
var $parentLi = $(this).parent();
if($parentLi.hasClass('mega-hover')){
megaActionClose($parentLi);
} else {
megaAction($parentLi);
}
e.preventDefault();
});
}
// onLoad callback;
defaults.onLoad.call(this);
}
});
};
})(jQuery); |
'use strict';
// Load modules
const Events = require('events');
const Url = require('url');
const Http = require('http');
const Https = require('https');
const Stream = require('stream');
const Hoek = require('hoek');
const Boom = require('boom');
const Payload = require('./payload');
const Recorder = require('./recorder');
const Tap = require('./tap');
// Declare internals
const internals = {
jsonRegex: /^application\/[a-z.+-]*json$/,
shallowOptions: ['agent', 'payload', 'downstreamRes', 'beforeRedirect', 'redirected']
};
// new instance is exported as module.exports
internals.Client = function (defaults) {
Events.EventEmitter.call(this);
this.agents = {
https: new Https.Agent({ maxSockets: Infinity }),
http: new Http.Agent({ maxSockets: Infinity }),
httpsAllowUnauthorized: new Https.Agent({ maxSockets: Infinity, rejectUnauthorized: false })
};
this._defaults = defaults || {};
};
Hoek.inherits(internals.Client, Events.EventEmitter);
internals.Client.prototype.defaults = function (options) {
options = Hoek.applyToDefaultsWithShallow(options, this._defaults, internals.shallowOptions);
return new internals.Client(options);
};
internals.resolveUrl = function (baseUrl, path) {
if (!path) {
return baseUrl;
}
const parsedBase = Url.parse(baseUrl);
const parsedPath = Url.parse(path);
parsedBase.pathname = parsedBase.pathname + parsedPath.pathname;
parsedBase.pathname = parsedBase.pathname.replace(/[/]{2,}/g, '/');
parsedBase.search = parsedPath.search; // Always use the querystring from the path argument
return Url.format(parsedBase);
};
internals.Client.prototype.request = function (method, url, options, callback, _trace) {
options = Hoek.applyToDefaultsWithShallow(options || {}, this._defaults, internals.shallowOptions);
Hoek.assert(options.payload === null || options.payload === undefined || typeof options.payload === 'string' ||
options.payload instanceof Stream || Buffer.isBuffer(options.payload),
'options.payload must be a string, a Buffer, or a Stream');
Hoek.assert((options.agent === undefined || options.agent === null) || (typeof options.rejectUnauthorized !== 'boolean'),
'options.agent cannot be set to an Agent at the same time as options.rejectUnauthorized is set');
Hoek.assert(options.beforeRedirect === undefined || options.beforeRedirect === null || typeof options.beforeRedirect === 'function',
'options.beforeRedirect must be a function');
Hoek.assert(options.redirected === undefined || options.redirected === null || typeof options.redirected === 'function',
'options.redirected must be a function');
if (options.baseUrl) {
url = internals.resolveUrl(options.baseUrl, url);
delete options.baseUrl;
}
const uri = Url.parse(url);
uri.method = method.toUpperCase();
uri.headers = options.headers;
const payloadSupported = (uri.method !== 'GET' && uri.method !== 'HEAD' && options.payload !== null && options.payload !== undefined);
if (payloadSupported &&
(typeof options.payload === 'string' || Buffer.isBuffer(options.payload))) {
uri.headers = Hoek.clone(uri.headers) || {};
uri.headers['Content-Length'] = Buffer.isBuffer(options.payload) ? options.payload.length : Buffer.byteLength(options.payload);
}
let redirects = (options.hasOwnProperty('redirects') ? options.redirects : false); // Needed to allow 0 as valid value when passed recursively
_trace = (_trace || []);
_trace.push({ method: uri.method, url: url });
const client = (uri.protocol === 'https:' ? Https : Http);
if (options.rejectUnauthorized !== undefined && uri.protocol === 'https:') {
uri.agent = options.rejectUnauthorized ? this.agents.https : this.agents.httpsAllowUnauthorized;
}
else if (options.agent || options.agent === false) {
uri.agent = options.agent;
}
else {
uri.agent = uri.protocol === 'https:' ? this.agents.https : this.agents.http;
}
if (options.secureProtocol !== undefined) {
uri.secureProtocol = options.secureProtocol;
}
const start = Date.now();
const req = client.request(uri);
let shadow = null; // A copy of the streamed request payload when redirects are enabled
let onResponse;
let onError;
let timeoutId;
// Register handlers
const finish = (err, res) => {
if (!callback || err) {
req.abort();
}
req.removeListener('response', onResponse);
req.removeListener('error', onError);
req.on('error', Hoek.ignore);
clearTimeout(timeoutId);
this.emit('response', err, req, res, start, uri);
if (callback) {
return callback(err, res);
}
};
const finishOnce = Hoek.once(finish);
onError = (err) => {
err.trace = _trace;
return finishOnce(Boom.badGateway('Client request error', err));
};
req.once('error', onError);
onResponse = (res) => {
// Pass-through response
const statusCode = res.statusCode;
if (redirects === false ||
[301, 302, 307, 308].indexOf(statusCode) === -1) {
return finishOnce(null, res);
}
// Redirection
const redirectMethod = (statusCode === 301 || statusCode === 302 ? 'GET' : uri.method);
let location = res.headers.location;
res.destroy();
if (redirects === 0) {
return finishOnce(Boom.badGateway('Maximum redirections reached', _trace));
}
if (!location) {
return finishOnce(Boom.badGateway('Received redirection without location', _trace));
}
if (!/^https?:/i.test(location)) {
location = Url.resolve(uri.href, location);
}
const redirectOptions = Hoek.cloneWithShallow(options, internals.shallowOptions);
redirectOptions.payload = shadow || options.payload; // shadow must be ready at this point if set
redirectOptions.redirects = --redirects;
if (options.beforeRedirect) {
options.beforeRedirect(redirectMethod, statusCode, location, redirectOptions);
}
const redirectReq = this.request(redirectMethod, location, redirectOptions, finishOnce, _trace);
if (options.redirected) {
options.redirected(statusCode, location, redirectReq);
}
};
req.once('response', onResponse);
if (options.timeout) {
timeoutId = setTimeout(() => {
return finishOnce(Boom.gatewayTimeout('Client request timeout'));
}, options.timeout);
delete options.timeout;
}
// Write payload
if (payloadSupported) {
if (options.payload instanceof Stream) {
let stream = options.payload;
if (redirects) {
const collector = new Tap();
collector.once('finish', () => {
shadow = collector.collect();
});
stream = options.payload.pipe(collector);
}
stream.pipe(req);
return;
}
req.write(options.payload);
}
// Custom abort method to detect early aborts
const _abort = req.abort;
let aborted = false;
req.abort = () => {
if (!aborted && !req.res && !req.socket) {
process.nextTick(() => {
// Fake an ECONNRESET error
const error = new Error('socket hang up');
error.code = 'ECONNRESET';
finishOnce(error);
});
}
aborted = true;
return _abort.call(req);
};
// Finalize request
req.end();
return req;
};
// read()
internals.Client.prototype.read = function (res, options, callback) {
options = Hoek.applyToDefaultsWithShallow(options || {}, this._defaults, internals.shallowOptions);
// Set stream timeout
const clientTimeout = options.timeout;
let clientTimeoutId = null;
// Finish once
const finish = (err, buffer) => {
clearTimeout(clientTimeoutId);
reader.removeListener('error', onReaderError);
reader.removeListener('finish', onReaderFinish);
res.removeListener('error', onResError);
res.removeListener('close', onResClose);
res.on('error', Hoek.ignore);
if (err ||
!options.json) {
return callback(err, buffer);
}
// Parse JSON
let result;
if (buffer.length === 0) {
return callback(null, null);
}
if (options.json === 'force') {
result = internals.tryParseBuffer(buffer);
return callback(result.err, result.json);
}
// mode is "smart" or true
const contentType = (res.headers && res.headers['content-type']) || '';
const mime = contentType.split(';')[0].trim().toLowerCase();
if (!internals.jsonRegex.test(mime)) {
return callback(null, buffer);
}
result = internals.tryParseBuffer(buffer);
return callback(result.err, result.json);
};
const finishOnce = Hoek.once(finish);
if (clientTimeout &&
clientTimeout > 0) {
clientTimeoutId = setTimeout(() => {
finishOnce(Boom.clientTimeout());
}, clientTimeout);
}
// Hander errors
const onResError = (err) => {
return finishOnce(Boom.internal('Payload stream error', err));
};
const onResClose = () => {
return finishOnce(Boom.internal('Payload stream closed prematurely'));
};
res.once('error', onResError);
res.once('close', onResClose);
// Read payload
const reader = new Recorder({ maxBytes: options.maxBytes });
const onReaderError = (err) => {
if (res.destroy) { // GZip stream has no destroy() method
res.destroy();
}
return finishOnce(err);
};
reader.once('error', onReaderError);
const onReaderFinish = () => {
return finishOnce(null, reader.collect());
};
reader.once('finish', onReaderFinish);
res.pipe(reader);
};
// toReadableStream()
internals.Client.prototype.toReadableStream = function (payload, encoding) {
return new Payload(payload, encoding);
};
// parseCacheControl()
internals.Client.prototype.parseCacheControl = function (field) {
/*
Cache-Control = 1#cache-directive
cache-directive = token [ "=" ( token / quoted-string ) ]
token = [^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+
quoted-string = "(?:[^"\\]|\\.)*"
*/
// 1: directive = 2: token 3: quoted-string
const regex = /(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g;
const header = {};
const error = field.replace(regex, ($0, $1, $2, $3) => {
const value = $2 || $3;
header[$1] = value ? value.toLowerCase() : true;
return '';
});
if (header['max-age']) {
try {
const maxAge = parseInt(header['max-age'], 10);
if (isNaN(maxAge)) {
return null;
}
header['max-age'] = maxAge;
}
catch (err) { }
}
return (error ? null : header);
};
// Shortcuts
internals.Client.prototype.get = function (uri, options, callback) {
return this._shortcutWrap('GET', uri, options, callback);
};
internals.Client.prototype.post = function (uri, options, callback) {
return this._shortcutWrap('POST', uri, options, callback);
};
internals.Client.prototype.patch = function (uri, options, callback) {
return this._shortcutWrap('PATCH', uri, options, callback);
};
internals.Client.prototype.put = function (uri, options, callback) {
return this._shortcutWrap('PUT', uri, options, callback);
};
internals.Client.prototype.delete = function (uri, options, callback) {
return this._shortcutWrap('DELETE', uri, options, callback);
};
// Wrapper so that shortcut can be optimized with required params
internals.Client.prototype._shortcutWrap = function (method, uri /* [options], callback */) {
const options = (typeof arguments[2] === 'function' ? {} : arguments[2]);
const callback = (typeof arguments[2] === 'function' ? arguments[2] : arguments[3]);
return this._shortcut(method, uri, options, callback);
};
internals.Client.prototype._shortcut = function (method, uri, options, callback) {
return this.request(method, uri, options, (err, res) => {
if (err) {
return callback(err);
}
this.read(res, options, (err, payload) => {
return callback(err, res, payload);
});
});
};
internals.tryParseBuffer = function (buffer) {
const result = {
json: null,
err: null
};
try {
const json = JSON.parse(buffer.toString());
result.json = json;
}
catch (err) {
result.err = err;
}
return result;
};
module.exports = new internals.Client();
|
YUI.add('gallery-view-bind-datastick', function (Y, NAME) {
function DataStick() {}
DataStick._handlers = [];
DataStick.addHandler = function(handlers) {
handlers = Y.Array.map(Y.Array.flatten([handlers]), function(handler) {
return Y.mix({
updateModel: true,
updateView: true,
updateMethod: 'text'
}, handler, true);
});
this._handlers = this._handlers.concat(handlers);
};
DataStick.prototype = {
_modelBindings: null,
unbindAttrs: function(model) {
Y.Array.each(this._modelBindings, Y.bind(function(binding, i) {
if (model && binding.model !== model) {
return false;
}
binding.model.detach(binding.event, binding.fn);
delete this._modelBindings[i];
}, this));
this._modelBindings = Y.Array.filter(this._modelBindings, function(b) {
return b;
});
this.get('container').detach('stick' + (model ? ':' + model.get('clientId') : ''));
},
bindAttrs: function(optionalModel, optionalBindings) {
var self = this,
model = optionalModel || this.get('model');
var namespace = 'stick:' + model.get('clientId'),
bindings = optionalBindings || this.bindings || {};
if (!this._modelBindings) {
this._modelBindings = [];
}
this.unbindAttrs(optionalModel);
Y.Array.each(Y.Object.keys(bindings), function(selector) {
var container, options, modelAttr, config,
binding = bindings[selector] || {},
bindKey = Y.guid();
if (selector != 'container') {
container = self.get('container').all(selector);
} else {
container = Y.NodeList(self.get('container'));
selector = '';
}
if (container.isEmpty()) {
return;
}
if (Y.Lang.isString(binding)) {
binding = { observe: binding };
}
config = getConfiguration(container, binding);
modelAttr = config.observe;
options = Y.mix({ bindKey: bindKey}, config.setOptions || {}, true);
initializeAttributes(self, container, config, model, modelAttr);
initializeVisible(self, container, config, model, modelAttr);
if (modelAttr) {
Y.Array.each(config.events || [], function (type) {
var event = type, // Need to fix to work with YUI prefixes
method = function(event) {
var val = config.getVal.call(self, container, event, config);
if (evaluateBoolean(self, config.updateModel, val, config)) {
setAttr(model, modelAttr, val, options, self, config);
}
};
if (selector === '') {
self.get('container').on(event, method);
} else {
self.get('container').delegate(event, method, selector)
}
});
Y.Array.each(Y.Array.flatten([modelAttr]), function (attr) {
observeModelEvent(model, self, attr + 'Change',
function(e) {
if (e.bindKey != bindKey) {
var model = e.currentTarget;
updateViewBindEl(self, container, config, getAttr(model, modelAttr, config, self, e), model);
}
});
});
updateViewBindEl(self, container, config,
getAttr(model, modelAttr, config, self),
model, true);
}
applyViewFn(self, config.initialize, container, model, config);
});
this._originalDestroy = this.destroy;
this.destroy = function() {
self.unbindAttrs();
if (self._originalDestroy) {
self._originalDestroy.apply(arguments);
}
}
}
};
/* Utility functions */
var evaluatePath = function(obj, path) {
var parts = (path || '').split('.');
var result = Y.Array.reduce(parts, obj, function(memo, i) {return memo[i]; });
return result == null ? obj : result;
};
var applyViewFn = function(view, fn) {
if (fn) {
return (Y.Lang.isString(fn) ? view[fn] : fn).apply(view, Y.Array(arguments, 2));
}
};
var getSelectedOption = function($select) {
return $select.get('options').filter(function(option) {
return option.selected;
});
};
var evaluateBoolean = function(view, reference) {
if (Y.Lang.isBoolean(reference)) {
return reference;
} else if (Y.Lang.isFunction(reference) || Y.Lang.isString(reference)) {
return applyViewFn.apply(this, Y.Array(arguments));
}
return false;
};
var observeModelEvent = function(model, view, event, fn) {
model.on(event, fn, view);
view._modelBindings.push({
model: model,
event: event,
fn: fn
});
}
var setAttr = function(model, attr, val, options, context, config) {
if (config.onSet) {
val = applyViewFn(context, config.onSet, val, config);
}
model.set(attr, val, options);
};
var getAttr = function(model, attr, config, context, event) {
var val,
retrieveVal = function(field) {
var retrieved;
if (event && field === event.attrName) {
retrieved = config.escape ? Y.Escape.html(event.newVal) : event.newVal;
} else {
retrieved = config.escape ? Y.Escape.html(model.get(field)) : model.get(field);
}
return Y.Lang.isUndefined(retrieved) || Y.Lang.isNull(retrieved) ? '' : retrieved;
};
val = Y.Lang.isArray(attr) ? Y.Array.map(attr, retrieveVal) : retrieveVal(attr);
return config.onGet ? applyViewFn(context, config.onGet, val, config) : val;
};
var getConfiguration = function($el, binding) {
var handlers = [{
updateModel: false,
updateView: true,
updateMethod: 'text',
update: function($el, val, m, opts) { $el.set(opts.updateMethod, val); },
getVal: function($el, e, opts) { return $el.get(opts.updateMethod); }
}];
Y.Array.each(DataStick._handlers, function(handler) {
if ($el.item(0).test(handler.selector)) {
handlers.push(handler);
}
});
handlers.push(binding);
var config = Y.Array.reduce(handlers, {}, function(prev, curr) {
return Y.mix(prev, curr, true);
});
delete config.selector;
return config;
}
var initializeAttributes = function(view, $el, config, model, modelAttr) {
var props = ['autofocus', 'autoplay', 'async', 'checked', 'controls',
'defer', 'disabled', 'hidden', 'loop', 'multiple', 'open',
'readonly', 'required', 'scoped', 'selected'];
Y.Array.each(config.attributes || [], function(attrConfig) {
var lastClass = '',
observed = attrConfig.observe || (attrConfig.observe = modelAttr),
updateAttr = function() {
var isProperty = Y.Array.indexOf(props, attrConfig.name, true) > -1,
updateType = isProperty ? 'prop' : 'attr',
val = getAttr(model, observed, attrConfig, view);
if (attrConfig.name === 'class') {
$el.removeClass(lastClass).addClass(val);
lastClass = val;
} else {
$el[updateType](attrConfig.name, val);
}
};
Y.Array.each(Y.Array.flatten([observed]), function(attr) {
observeModelEvent(model, view, attr + 'Change', updateAttr);
});
updateAttr();
});
}
var initializeVisible = function(view, $el, config, model, modelAttr) {
if (config.visible == null) {
return;
}
var visibleCb = function() {
var visible = config.visible,
visibleFn = config.visibleFn,
val = getAttr(model, modelAttr, config, view),
isVisible = !!val;
if (Y.Lang.isFunction(visible) || Y.Lang.isString(visible)) {
isVisible = applyViewFn(view, visible, val, config);
}
if (visibleFn) {
applyViewFn(view, visibleFn, $el, isVisible, config);
} else {
if (isVisible) {
$el.show();
} else {
$el.hide();
}
}
};
Y.Array.each(Y.Array.flatten([modelAttr]), function(attr) {
observeModelEvent(model, view, attr + 'Change', visibleCb);
});
visibleCb();
};
var updateViewBindEl = function(view, $el, config, val, model, isInitializing) {
if (!evaluateBoolean(view, config.updateView, val, config)) {
return;
}
config.update.call(view, $el, val, model, config);
if (!isInitializing) {
applyViewFn(view, config.afterUpdate, $el, val, config);
}
};
DataStick.addHandler([{
selector: '[contenteditable="true"]',
updateMethod: 'innerHTML',
events: ['keyup', 'change', 'paste', 'cut']
}, {
selector: 'input',
events: ['keyup', 'change', 'paste', 'cut'],
update: function($el, val) { $el.item(0).set('value', val); },
getVal: function($el) {
var val = $el.item(0).get('value');
if ($el.item(0).test('[type="number"]')) {
return val == null ? val : Number(val);
} else {
return val;
}
}
}, {
selector: 'input[type="radio"]',
events: ['change'],
update: function($el, val) {
$el.filter('[value="' + val + '"]').set('checked', true);
},
getVal: function($el) {
return $el.filter(function(option) {
return option.checked;
}).item(0).get('value');
}
}, {
selector: 'input[type="checkbox"]',
events: ['change'],
update: function($el, val, model, options) {
if ($el.size() > 1) {
Y.Array.each($el, function(el) {
if (Y.Array.indexOf(val, Y.one(el).get('value')) > -1) {
Y.one(el).set('checked', true);
} else {
Y.one(el).set('checked', false);
}
});
} else {
if (Y.Lang.isBoolean(val)) {
$el.item(0).set('checked', val);
} else {
$el.item(0).set('checked', val == $el.item(0).get('value'));
}
}
},
getVal: function($el) {
var val;
if ($el.size() > 1) {
val = [];
$el.each(function(node) {
if (node.get('checked')) {
val.push(node.get('value'));
}
});
} else {
var node = $el.item(0),
boxval;
val = node.get('checked');
boxval = node.get('value');
if (boxval != 'on' && boxval != null) {
if (val) {
val = node.get('value');
} else {
val = null;
}
}
}
return val;
}
}
]);
Y.namespace('DataBind').Stick = DataStick;
}, 'gallery-2013.10.09-22-56', {"requires": ["view"]});
|
define('lodash/array/takeWhile', ['exports', 'lodash/internal/baseCallback', 'lodash/internal/baseWhile'], function (exports, _lodashInternalBaseCallback, _lodashInternalBaseWhile) {
'use strict';
/**
* Creates a slice of `array` with elements taken from the beginning. Elements
* are taken until `predicate` returns falsey. The predicate is bound to
* `thisArg` and invoked with three arguments: (value, index, array).
*
* If a property name is provided for `predicate` the created `_.property`
* style callback returns the property value of the given element.
*
* If a value is also provided for `thisArg` the created `_.matchesProperty`
* style callback returns `true` for elements that have a matching property
* value, else `false`.
*
* If an object is provided for `predicate` the created `_.matches` style
* callback returns `true` for elements that have the properties of the given
* object, else `false`.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to query.
* @param {Function|Object|string} [predicate=_.identity] The function invoked
* per iteration.
* @param {*} [thisArg] The `this` binding of `predicate`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.takeWhile([1, 2, 3], function(n) {
* return n < 3;
* });
* // => [1, 2]
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false},
* { 'user': 'pebbles', 'active': true }
* ];
*
* // using the `_.matches` callback shorthand
* _.pluck(_.takeWhile(users, { 'user': 'barney', 'active': false }), 'user');
* // => ['barney']
*
* // using the `_.matchesProperty` callback shorthand
* _.pluck(_.takeWhile(users, 'active', false), 'user');
* // => ['barney', 'fred']
*
* // using the `_.property` callback shorthand
* _.pluck(_.takeWhile(users, 'active'), 'user');
* // => []
*/
function takeWhile(array, predicate, thisArg) {
return array && array.length ? (0, _lodashInternalBaseWhile['default'])(array, (0, _lodashInternalBaseCallback['default'])(predicate, thisArg, 3)) : [];
}
exports['default'] = takeWhile;
}); |
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'clipboard', 'sv', {
copy: 'Kopiera',
copyError: 'Säkerhetsinställningar i Er webbläsare tillåter inte åtgärden kopiera. Använd (Ctrl/Cmd+C) istället.',
cut: 'Klipp ut',
cutError: 'Säkerhetsinställningar i Er webbläsare tillåter inte åtgärden klipp ut. Använd (Ctrl/Cmd+X) istället.',
paste: 'Klistra in',
pasteArea: 'Paste Area',
pasteMsg: 'Var god och klistra in Er text i rutan nedan genom att använda (<strong>Ctrl/Cmd+V</strong>) klicka sen på OK.',
securityMsg: 'På grund av din webbläsares säkerhetsinställningar kan verktyget inte få åtkomst till urklippsdatan. Var god och använd detta fönster istället.',
title: 'Klistra in'
} );
|
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* A Video object that takes a previously loaded Video from the Phaser Cache and handles playback of it.
*
* Alternatively it takes a getUserMedia feed from an active webcam and streams the contents of that to
* the Video instead (see `startMediaStream` method)
*
* The video can then be applied to a Sprite as a texture. If multiple Sprites share the same Video texture and playback
* changes (i.e. you pause the video, or seek to a new time) then this change will be seen across all Sprites simultaneously.
*
* Due to a bug in IE11 you cannot play a video texture to a Sprite in WebGL. For IE11 force Canvas mode.
*
* If you need each Sprite to be able to play a video fully independently then you will need one Video object per Sprite.
* Please understand the obvious performance implications of doing this, and the memory required to hold videos in RAM.
*
* On some mobile browsers such as iOS Safari, you cannot play a video until the user has explicitly touched the screen.
* This works in the same way as audio unlocking. Phaser will handle the touch unlocking for you, however unlike with audio
* it's worth noting that every single Video needs to be touch unlocked, not just the first one. You can use the `changeSource`
* method to try and work around this limitation, but see the method help for details.
*
* Small screen devices, especially iPod and iPhone will launch the video in its own native video player,
* outside of the Safari browser. There is no way to avoid this, it's a device imposed limitation.
*
* @class Phaser.Video
* @constructor
* @param {Phaser.Game} game - A reference to the currently running game.
* @param {string|null} [key=null] - The key of the video file in the Phaser.Cache that this Video object will play. Set to `null` or leave undefined if you wish to use a webcam as the source. See `startMediaStream` to start webcam capture.
* @param {string|null} [url=null] - If the video hasn't been loaded then you can provide a full URL to the file here (make sure to set key to null)
*/
Phaser.Video = function (game, key, url) {
if (key === undefined) { key = null; }
if (url === undefined) { url = null; }
/**
* @property {Phaser.Game} game - A reference to the currently running game.
*/
this.game = game;
/**
* @property {string} key - The key of the Video in the Cache, if stored there. Will be `null` if this Video is using the webcam instead.
* @default null
*/
this.key = key;
/**
* @property {number} width - The width of the video in pixels.
* @default
*/
this.width = 0;
/**
* @property {number} height - The height of the video in pixels.
* @default
*/
this.height = 0;
/**
* @property {number} type - The const type of this object.
* @default
*/
this.type = Phaser.VIDEO;
/**
* @property {boolean} disableTextureUpload - If true this video will never send its image data to the GPU when its dirty flag is true. This only applies in WebGL.
*/
this.disableTextureUpload = false;
/**
* @property {boolean} touchLocked - true if this video is currently locked awaiting a touch event. This happens on some mobile devices, such as iOS.
* @default
*/
this.touchLocked = false;
/**
* @property {Phaser.Signal} onPlay - This signal is dispatched when the Video starts to play. It sends 3 parameters: a reference to the Video object, if the video is set to loop or not and the playback rate.
*/
this.onPlay = new Phaser.Signal();
/**
* @property {Phaser.Signal} onChangeSource - This signal is dispatched if the Video source is changed. It sends 3 parameters: a reference to the Video object and the new width and height of the new video source.
*/
this.onChangeSource = new Phaser.Signal();
/**
* @property {Phaser.Signal} onComplete - This signal is dispatched when the Video completes playback, i.e. enters an 'ended' state. Videos set to loop will never dispatch this signal.
*/
this.onComplete = new Phaser.Signal();
/**
* @property {Phaser.Signal} onAccess - This signal is dispatched if the user allows access to their webcam.
*/
this.onAccess = new Phaser.Signal();
/**
* @property {Phaser.Signal} onError - This signal is dispatched if an error occurs either getting permission to use the webcam (for a Video Stream) or when trying to play back a video file.
*/
this.onError = new Phaser.Signal();
/**
* This signal is dispatched if when asking for permission to use the webcam no response is given within a the Video.timeout limit.
* This may be because the user has picked `Not now` in the permissions window, or there is a delay in establishing the LocalMediaStream.
* @property {Phaser.Signal} onTimeout
*/
this.onTimeout = new Phaser.Signal();
/**
* @property {integer} timeout - The amount of ms allowed to elapsed before the Video.onTimeout signal is dispatched while waiting for webcam access.
* @default
*/
this.timeout = 15000;
/**
* @property {integer} _timeOutID - setTimeout ID.
* @private
*/
this._timeOutID = null;
/**
* @property {HTMLVideoElement} video - The HTML Video Element that is added to the document.
*/
this.video = null;
/**
* @property {MediaStream} videoStream - The Video Stream data. Only set if this Video is streaming from the webcam via `startMediaStream`.
*/
this.videoStream = null;
/**
* @property {boolean} isStreaming - Is there a streaming video source? I.e. from a webcam.
*/
this.isStreaming = false;
/**
* When starting playback of a video Phaser will monitor its readyState using a setTimeout call.
* The setTimeout happens once every `Video.retryInterval` ms. It will carry on monitoring the video
* state in this manner until the `retryLimit` is reached and then abort.
* @property {integer} retryLimit
* @default
*/
this.retryLimit = 20;
/**
* @property {integer} retry - The current retry attempt.
* @default
*/
this.retry = 0;
/**
* @property {integer} retryInterval - The number of ms between each retry at monitoring the status of a downloading video.
* @default
*/
this.retryInterval = 500;
/**
* @property {integer} _retryID - The callback ID of the retry setTimeout.
* @private
*/
this._retryID = null;
/**
* @property {boolean} _codeMuted - Internal mute tracking var.
* @private
* @default
*/
this._codeMuted = false;
/**
* @property {boolean} _muted - Internal mute tracking var.
* @private
* @default
*/
this._muted = false;
/**
* @property {boolean} _codePaused - Internal paused tracking var.
* @private
* @default
*/
this._codePaused = false;
/**
* @property {boolean} _paused - Internal paused tracking var.
* @private
* @default
*/
this._paused = false;
/**
* @property {boolean} _pending - Internal var tracking play pending.
* @private
* @default
*/
this._pending = false;
/**
* @property {boolean} _autoplay - Internal var tracking autoplay when changing source.
* @private
* @default
*/
this._autoplay = false;
/**
* @property {function} _endCallback - The addEventListener ended function.
* @private
*/
this._endCallback = null;
/**
* @property {function} _playCallback - The addEventListener playing function.
* @private
*/
this._playCallback = null;
if (key && this.game.cache.checkVideoKey(key))
{
var _video = this.game.cache.getVideo(key);
if (_video.isBlob)
{
this.createVideoFromBlob(_video.data);
}
else
{
this.video = _video.data;
}
this.width = this.video.videoWidth;
this.height = this.video.videoHeight;
}
else if (url)
{
this.createVideoFromURL(url, false);
}
/**
* @property {PIXI.BaseTexture} baseTexture - The PIXI.BaseTexture.
* @default
*/
if (this.video && !url)
{
this.baseTexture = new PIXI.BaseTexture(this.video);
this.baseTexture.forceLoaded(this.width, this.height);
}
else
{
this.baseTexture = new PIXI.BaseTexture(PIXI.TextureCache['__default'].baseTexture.source);
this.baseTexture.forceLoaded(this.width, this.height);
}
/**
* @property {PIXI.Texture} texture - The PIXI.Texture.
* @default
*/
this.texture = new PIXI.Texture(this.baseTexture);
/**
* @property {Phaser.Frame} textureFrame - The Frame this video uses for rendering.
* @default
*/
this.textureFrame = new Phaser.Frame(0, 0, 0, this.width, this.height, 'video');
this.texture.setFrame(this.textureFrame);
this.texture.valid = false;
if (key !== null && this.video)
{
this.texture.valid = this.video.canplay;
}
/**
* A snapshot grabbed from the video. This is initially black. Populate it by calling Video.grab().
* When called the BitmapData is updated with a grab taken from the current video playing or active video stream.
* If Phaser has been compiled without BitmapData support this property will always be `null`.
*
* @property {Phaser.BitmapData} snapshot
* @readOnly
*/
this.snapshot = null;
if (Phaser.BitmapData)
{
this.snapshot = new Phaser.BitmapData(this.game, '', this.width, this.height);
}
if (!this.game.device.cocoonJS && (this.game.device.iOS || this.game.device.android) || (window['PhaserGlobal'] && window['PhaserGlobal'].fakeiOSTouchLock))
{
this.setTouchLock();
}
else
{
if (_video)
{
_video.locked = false;
}
}
};
Phaser.Video.prototype = {
/**
* Connects to an external media stream for the webcam, rather than using a local one.
*
* @method Phaser.Video#connectToMediaStream
* @param {HTMLVideoElement} video - The HTML Video Element that the stream uses.
* @param {MediaStream} stream - The Video Stream data.
* @return {Phaser.Video} This Video object for method chaining.
*/
connectToMediaStream: function (video, stream) {
if (video && stream)
{
this.video = video;
this.videoStream = stream;
this.isStreaming = true;
this.baseTexture.source = this.video;
this.updateTexture(null, this.video.videoWidth, this.video.videoHeight);
this.onAccess.dispatch(this);
}
return this;
},
/**
* Instead of playing a video file this method allows you to stream video data from an attached webcam.
*
* As soon as this method is called the user will be prompted by their browser to "Allow" access to the webcam.
* If they allow it the webcam feed is directed to this Video. Call `Video.play` to start the stream.
*
* If they block the webcam the onError signal will be dispatched containing the NavigatorUserMediaError
* or MediaStreamError event.
*
* You can optionally set a width and height for the stream. If set the input will be cropped to these dimensions.
* If not given then as soon as the stream has enough data the video dimensions will be changed to match the webcam device.
* You can listen for this with the onChangeSource signal.
*
* @method Phaser.Video#startMediaStream
* @param {boolean} [captureAudio=false] - Controls if audio should be captured along with video in the video stream.
* @param {integer} [width] - The width is used to create the video stream. If not provided the video width will be set to the width of the webcam input source.
* @param {integer} [height] - The height is used to create the video stream. If not provided the video height will be set to the height of the webcam input source.
* @return {Phaser.Video} This Video object for method chaining or false if the device doesn't support getUserMedia.
*/
startMediaStream: function (captureAudio, width, height) {
if (captureAudio === undefined) { captureAudio = false; }
if (width === undefined) { width = null; }
if (height === undefined) { height = null; }
if (!this.game.device.getUserMedia)
{
this.onError.dispatch(this, 'No getUserMedia');
return false;
}
if (this.videoStream !== null)
{
if (this.videoStream['active'])
{
this.videoStream.active = false;
}
else
{
this.videoStream.stop();
}
}
this.removeVideoElement();
this.video = document.createElement("video");
this.video.setAttribute('autoplay', 'autoplay');
if (width !== null)
{
this.video.width = width;
}
if (height !== null)
{
this.video.height = height;
}
// Request access to the webcam
this._timeOutID = window.setTimeout(this.getUserMediaTimeout.bind(this), this.timeout);
try {
navigator.getUserMedia(
{ "audio": captureAudio, "video": true },
this.getUserMediaSuccess.bind(this),
this.getUserMediaError.bind(this)
);
}
catch (error)
{
this.getUserMediaError(error);
}
return this;
},
/**
* @method Phaser.Video#getUserMediaTimeout
* @private
*/
getUserMediaTimeout: function () {
clearTimeout(this._timeOutID);
this.onTimeout.dispatch(this);
},
/**
* @method Phaser.Video#getUserMediaError
* @private
*/
getUserMediaError: function (event) {
clearTimeout(this._timeOutID);
this.onError.dispatch(this, event);
},
/**
* @method Phaser.Video#getUserMediaSuccess
* @private
*/
getUserMediaSuccess: function (stream) {
clearTimeout(this._timeOutID);
// Attach the stream to the video
this.videoStream = stream;
// Set the source of the video element with the stream from the camera
if (this.video.mozSrcObject !== undefined)
{
this.video.mozSrcObject = stream;
}
else
{
this.video.src = (window.URL && window.URL.createObjectURL(stream)) || stream;
}
var self = this;
this.video.onloadeddata = function () {
var retry = 10;
function checkStream () {
if (retry > 0)
{
if (self.video.videoWidth > 0)
{
// Patch for Firefox bug where the height can't be read from the video
var width = self.video.videoWidth;
var height = self.video.videoHeight;
if (isNaN(self.video.videoHeight))
{
height = width / (4/3);
}
self.video.play();
self.isStreaming = true;
self.baseTexture.source = self.video;
self.updateTexture(null, width, height);
self.onAccess.dispatch(self);
}
else
{
window.setTimeout(checkStream, 500);
}
}
else
{
console.warn('Unable to connect to video stream. Webcam error?');
}
retry--;
}
checkStream();
};
},
/**
* Creates a new Video element from the given Blob. The Blob must contain the video data in the correct encoded format.
* This method is typically called by the Phaser.Loader and Phaser.Cache for you, but is exposed publicly for convenience.
*
* @method Phaser.Video#createVideoFromBlob
* @param {Blob} blob - The Blob containing the video data: `Blob([new Uint8Array(data)])`
* @return {Phaser.Video} This Video object for method chaining.
*/
createVideoFromBlob: function (blob) {
var _this = this;
this.video = document.createElement("video");
this.video.controls = false;
this.video.setAttribute('autoplay', 'autoplay');
this.video.addEventListener('loadeddata', function (event) { _this.updateTexture(event); }, true);
this.video.src = window.URL.createObjectURL(blob);
this.video.canplay = true;
return this;
},
/**
* Creates a new Video element from the given URL.
*
* @method Phaser.Video#createVideoFromURL
* @param {string} url - The URL of the video.
* @param {boolean} [autoplay=false] - Automatically start the video?
* @return {Phaser.Video} This Video object for method chaining.
*/
createVideoFromURL: function (url, autoplay) {
if (autoplay === undefined) { autoplay = false; }
// Invalidate the texture while we wait for the new one to load (crashes IE11 otherwise)
if (this.texture)
{
this.texture.valid = false;
}
this.video = document.createElement("video");
this.video.controls = false;
if (autoplay)
{
this.video.setAttribute('autoplay', 'autoplay');
}
this.video.src = url;
this.video.canplay = true;
this.video.load();
this.retry = this.retryLimit;
this._retryID = window.setTimeout(this.checkVideoProgress.bind(this), this.retryInterval);
this.key = url;
return this;
},
/**
* Called automatically if the video source changes and updates the internal texture dimensions.
* Then dispatches the onChangeSource signal.
*
* @method Phaser.Video#updateTexture
* @param {object} [event] - The event which triggered the texture update.
* @param {integer} [width] - The new width of the video. If undefined `video.videoWidth` is used.
* @param {integer} [height] - The new height of the video. If undefined `video.videoHeight` is used.
*/
updateTexture: function (event, width, height) {
var change = false;
if (width === undefined || width === null) { width = this.video.videoWidth; change = true; }
if (height === undefined || height === null) { height = this.video.videoHeight; }
this.width = width;
this.height = height;
if (this.baseTexture.source !== this.video)
{
this.baseTexture.source = this.video;
}
this.baseTexture.forceLoaded(width, height);
this.texture.frame.resize(width, height);
this.texture.width = width;
this.texture.height = height;
this.texture.valid = true;
if (this.snapshot)
{
this.snapshot.resize(width, height);
}
if (change && this.key !== null)
{
this.onChangeSource.dispatch(this, width, height);
if (this._autoplay)
{
this.video.play();
this.onPlay.dispatch(this, this.loop, this.playbackRate);
}
}
},
/**
* Called when the video completes playback (reaches and ended state).
* Dispatches the Video.onComplete signal.
*
* @method Phaser.Video#complete
*/
complete: function () {
this.onComplete.dispatch(this);
},
/**
* Starts this video playing if it's not already doing so.
*
* @method Phaser.Video#play
* @param {boolean} [loop=false] - Should the video loop automatically when it reaches the end? Please note that at present some browsers (i.e. Chrome) do not support *seamless* video looping.
* @param {number} [playbackRate=1] - The playback rate of the video. 1 is normal speed, 2 is x2 speed, and so on. You cannot set a negative playback rate.
* @return {Phaser.Video} This Video object for method chaining.
*/
play: function (loop, playbackRate) {
if (loop === undefined) { loop = false; }
if (playbackRate === undefined) { playbackRate = 1; }
if (this.game.sound.onMute)
{
this.game.sound.onMute.add(this.setMute, this);
this.game.sound.onUnMute.add(this.unsetMute, this);
if (this.game.sound.mute)
{
this.setMute();
}
}
this.game.onPause.add(this.setPause, this);
this.game.onResume.add(this.setResume, this);
this._endCallback = this.complete.bind(this);
this.video.addEventListener('ended', this._endCallback, true);
if (loop)
{
this.video.loop = 'loop';
}
else
{
this.video.loop = '';
}
this.video.playbackRate = playbackRate;
if (this.touchLocked)
{
this._pending = true;
}
else
{
this._pending = false;
if (this.key !== null)
{
if (this.video.readyState !== 4)
{
this.retry = this.retryLimit;
this._retryID = window.setTimeout(this.checkVideoProgress.bind(this), this.retryInterval);
}
else
{
this._playCallback = this.playHandler.bind(this);
this.video.addEventListener('playing', this._playCallback, true);
}
}
this.video.play();
this.onPlay.dispatch(this, loop, playbackRate);
}
return this;
},
/**
* Called when the video starts to play. Updates the texture.
*
* @method Phaser.Video#playHandler
* @private
*/
playHandler: function () {
this.video.removeEventListener('playing', this._playCallback, true);
this.updateTexture();
},
/**
* Stops the video playing.
*
* This removes all locally set signals.
*
* If you only wish to pause playback of the video, to resume at a later time, use `Video.paused = true` instead.
* If the video hasn't finished downloading calling `Video.stop` will not abort the download. To do that you need to
* call `Video.destroy` instead.
*
* If you are using a video stream from a webcam then calling Stop will disconnect the MediaStream session and disable the webcam.
*
* @method Phaser.Video#stop
* @return {Phaser.Video} This Video object for method chaining.
*/
stop: function () {
if (this.game.sound.onMute)
{
this.game.sound.onMute.remove(this.setMute, this);
this.game.sound.onUnMute.remove(this.unsetMute, this);
}
this.game.onPause.remove(this.setPause, this);
this.game.onResume.remove(this.setResume, this);
// Stream or file?
if (this.isStreaming)
{
if (this.video.mozSrcObject)
{
this.video.mozSrcObject.stop();
this.video.src = null;
}
else
{
this.video.src = "";
if (this.videoStream['active'])
{
this.videoStream.active = false;
}
else
{
if (this.videoStream.getTracks)
{
this.videoStream.getTracks().forEach(function (track) {
track.stop();
});
}
else
{
this.videoStream.stop();
}
}
}
this.videoStream = null;
this.isStreaming = false;
}
else
{
this.video.removeEventListener('ended', this._endCallback, true);
this.video.removeEventListener('playing', this._playCallback, true);
if (this.touchLocked)
{
this._pending = false;
}
else
{
this.video.pause();
}
}
return this;
},
/**
* Updates the given Display Objects so they use this Video as their texture.
* This will replace any texture they will currently have set.
*
* @method Phaser.Video#add
* @param {Phaser.Sprite|Phaser.Sprite[]|Phaser.Image|Phaser.Image[]} object - Either a single Sprite/Image or an Array of Sprites/Images.
* @return {Phaser.Video} This Video object for method chaining.
*/
add: function (object) {
if (Array.isArray(object))
{
for (var i = 0; i < object.length; i++)
{
if (object[i]['loadTexture'])
{
object[i].loadTexture(this);
}
}
}
else
{
object.loadTexture(this);
}
return this;
},
/**
* Creates a new Phaser.Image object, assigns this Video to be its texture, adds it to the world then returns it.
*
* @method Phaser.Video#addToWorld
* @param {number} [x=0] - The x coordinate to place the Image at.
* @param {number} [y=0] - The y coordinate to place the Image at.
* @param {number} [anchorX=0] - Set the x anchor point of the Image. A value between 0 and 1, where 0 is the top-left and 1 is bottom-right.
* @param {number} [anchorY=0] - Set the y anchor point of the Image. A value between 0 and 1, where 0 is the top-left and 1 is bottom-right.
* @param {number} [scaleX=1] - The horizontal scale factor of the Image. A value of 1 means no scaling. 2 would be twice the size, and so on.
* @param {number} [scaleY=1] - The vertical scale factor of the Image. A value of 1 means no scaling. 2 would be twice the size, and so on.
* @return {Phaser.Image} The newly added Image object.
*/
addToWorld: function (x, y, anchorX, anchorY, scaleX, scaleY) {
scaleX = scaleX || 1;
scaleY = scaleY || 1;
var image = this.game.add.image(x, y, this);
image.anchor.set(anchorX, anchorY);
image.scale.set(scaleX, scaleY);
return image;
},
/**
* If the game is running in WebGL this will push the texture up to the GPU if it's dirty.
* This is called automatically if the Video is being used by a Sprite, otherwise you need to remember to call it in your render function.
* If you wish to suppress this functionality set Video.disableTextureUpload to `true`.
*
* @method Phaser.Video#render
*/
render: function () {
if (!this.disableTextureUpload && this.playing)
{
this.baseTexture.dirty();
}
},
/**
* Internal handler called automatically by the Video.mute setter.
*
* @method Phaser.Video#setMute
* @private
*/
setMute: function () {
if (this._muted)
{
return;
}
this._muted = true;
this.video.muted = true;
},
/**
* Internal handler called automatically by the Video.mute setter.
*
* @method Phaser.Video#unsetMute
* @private
*/
unsetMute: function () {
if (!this._muted || this._codeMuted)
{
return;
}
this._muted = false;
this.video.muted = false;
},
/**
* Internal handler called automatically by the Video.paused setter.
*
* @method Phaser.Video#setPause
* @private
*/
setPause: function () {
if (this._paused || this.touchLocked)
{
return;
}
this._paused = true;
this.video.pause();
},
/**
* Internal handler called automatically by the Video.paused setter.
*
* @method Phaser.Video#setResume
* @private
*/
setResume: function () {
if (!this._paused || this._codePaused || this.touchLocked)
{
return;
}
this._paused = false;
if (!this.video.ended)
{
this.video.play();
}
},
/**
* On some mobile browsers you cannot play a video until the user has explicitly touched the video to allow it.
* Phaser handles this via the `setTouchLock` method. However if you have 3 different videos, maybe an "Intro", "Start" and "Game Over"
* split into three different Video objects, then you will need the user to touch-unlock every single one of them.
*
* You can avoid this by using just one Video object and simply changing the video source. Once a Video element is unlocked it remains
* unlocked, even if the source changes. So you can use this to your benefit to avoid forcing the user to 'touch' the video yet again.
*
* As you'd expect there are limitations. So far we've found that the videos need to be in the same encoding format and bitrate.
* This method will automatically handle a change in video dimensions, but if you try swapping to a different bitrate we've found it
* cannot render the new video on iOS (desktop browsers cope better).
*
* When the video source is changed the video file is requested over the network. Listen for the `onChangeSource` signal to know
* when the new video has downloaded enough content to be able to be played. Previous settings such as the volume and loop state
* are adopted automatically by the new video.
*
* @method Phaser.Video#changeSource
* @param {string} src - The new URL to change the video.src to.
* @param {boolean} [autoplay=true] - Should the video play automatically after the source has been updated?
* @return {Phaser.Video} This Video object for method chaining.
*/
changeSource: function (src, autoplay) {
if (autoplay === undefined) { autoplay = true; }
// Invalidate the texture while we wait for the new one to load (crashes IE11 otherwise)
this.texture.valid = false;
this.video.pause();
this.retry = this.retryLimit;
this._retryID = window.setTimeout(this.checkVideoProgress.bind(this), this.retryInterval);
this.video.src = src;
this.video.load();
this._autoplay = autoplay;
if (!autoplay)
{
this.paused = true;
}
return this;
},
/**
* Internal callback that monitors the download progress of a video after changing its source.
*
* @method Phaser.Video#checkVideoProgress
* @private
*/
checkVideoProgress: function () {
// if (this.video.readyState === 2 || this.video.readyState === 4)
if (this.video.readyState === 4)
{
// We've got enough data to update the texture for playback
this.updateTexture();
}
else
{
this.retry--;
if (this.retry > 0)
{
this._retryID = window.setTimeout(this.checkVideoProgress.bind(this), this.retryInterval);
}
else
{
console.warn('Phaser.Video: Unable to start downloading video in time', this.isStreaming);
}
}
},
/**
* Sets the Input Manager touch callback to be Video.unlock.
* Required for mobile video unlocking. Mostly just used internally.
*
* @method Phaser.Video#setTouchLock
*/
setTouchLock: function () {
this.game.input.touch.addTouchLockCallback(this.unlock, this);
this.touchLocked = true;
},
/**
* Enables the video on mobile devices, usually after the first touch.
* If the SoundManager hasn't been unlocked then this will automatically unlock that as well.
* Only one video can be pending unlock at any one time.
*
* @method Phaser.Video#unlock
*/
unlock: function () {
this.touchLocked = false;
this.video.play();
this.onPlay.dispatch(this, this.loop, this.playbackRate);
if (this.key)
{
var _video = this.game.cache.getVideo(this.key);
if (_video && !_video.isBlob)
{
_video.locked = false;
}
}
return true;
},
/**
* Grabs the current frame from the Video or Video Stream and renders it to the Video.snapshot BitmapData.
*
* You can optionally set if the BitmapData should be cleared or not, the alpha and the blend mode of the draw.
*
* If you need more advanced control over the grabbing them call `Video.snapshot.copy` directly with the same parameters as BitmapData.copy.
*
* @method Phaser.Video#grab
* @param {boolean} [clear=false] - Should the BitmapData be cleared before the Video is grabbed? Unless you are using alpha or a blend mode you can usually leave this set to false.
* @param {number} [alpha=1] - The alpha that will be set on the video before drawing. A value between 0 (fully transparent) and 1, opaque.
* @param {string} [blendMode=null] - The composite blend mode that will be used when drawing. The default is no blend mode at all. This is a Canvas globalCompositeOperation value such as 'lighter' or 'xor'.
* @return {Phaser.BitmapData} A reference to the Video.snapshot BitmapData object for further method chaining.
*/
grab: function (clear, alpha, blendMode) {
if (clear === undefined) { clear = false; }
if (alpha === undefined) { alpha = 1; }
if (blendMode === undefined) { blendMode = null; }
if (this.snapshot === null)
{
console.warn('Video.grab cannot run because Phaser.BitmapData is unavailable');
return;
}
if (clear)
{
this.snapshot.cls();
}
this.snapshot.copy(this.video, 0, 0, this.width, this.height, 0, 0, this.width, this.height, 0, 0, 0, 1, 1, alpha, blendMode);
return this.snapshot;
},
/**
* Removes the Video element from the DOM by calling parentNode.removeChild on itself.
* Also removes the autoplay and src attributes and nulls the reference.
*
* @method Phaser.Video#removeVideoElement
*/
removeVideoElement: function () {
if (!this.video)
{
return;
}
if (this.video.parentNode)
{
this.video.parentNode.removeChild(this.video);
}
while (this.video.hasChildNodes())
{
this.video.removeChild(this.video.firstChild);
}
this.video.removeAttribute('autoplay');
this.video.removeAttribute('src');
this.video = null;
},
/**
* Destroys the Video object. This calls `Video.stop` and then `Video.removeVideoElement`.
* If any Sprites are using this Video as their texture it is up to you to manage those.
*
* @method Phaser.Video#destroy
*/
destroy: function () {
this.stop();
this.removeVideoElement();
if (this.touchLocked)
{
this.game.input.touch.removeTouchLockCallback(this.unlock, this);
}
if (this._retryID)
{
window.clearTimeout(this._retryID);
}
}
};
/**
* @name Phaser.Video#currentTime
* @property {number} currentTime - The current time of the video in seconds. If set the video will attempt to seek to that point in time.
*/
Object.defineProperty(Phaser.Video.prototype, "currentTime", {
get: function () {
return (this.video) ? this.video.currentTime : 0;
},
set: function (value) {
this.video.currentTime = value;
}
});
/**
* @name Phaser.Video#duration
* @property {number} duration - The duration of the video in seconds.
* @readOnly
*/
Object.defineProperty(Phaser.Video.prototype, "duration", {
get: function () {
return (this.video) ? this.video.duration : 0;
}
});
/**
* @name Phaser.Video#progress
* @property {number} progress - The progress of this video. This is a value between 0 and 1, where 0 is the start and 1 is the end of the video.
* @readOnly
*/
Object.defineProperty(Phaser.Video.prototype, "progress", {
get: function () {
return (this.video) ? (this.video.currentTime / this.video.duration) : 0;
}
});
/**
* @name Phaser.Video#mute
* @property {boolean} mute - Gets or sets the muted state of the Video.
*/
Object.defineProperty(Phaser.Video.prototype, "mute", {
get: function () {
return this._muted;
},
set: function (value) {
value = value || null;
if (value)
{
if (this._muted)
{
return;
}
this._codeMuted = true;
this.setMute();
}
else
{
if (!this._muted)
{
return;
}
this._codeMuted = false;
this.unsetMute();
}
}
});
/**
* Gets or sets the paused state of the Video.
* If the video is still touch locked (such as on iOS devices) this call has no effect.
*
* @name Phaser.Video#paused
* @property {boolean} paused
*/
Object.defineProperty(Phaser.Video.prototype, "paused", {
get: function () {
return this._paused;
},
set: function (value) {
value = value || null;
if (this.touchLocked)
{
return;
}
if (value)
{
if (this._paused)
{
return;
}
this._codePaused = true;
this.setPause();
}
else
{
if (!this._paused)
{
return;
}
this._codePaused = false;
this.setResume();
}
}
});
/**
* @name Phaser.Video#volume
* @property {number} volume - Gets or sets the volume of the Video, a value between 0 and 1. The value given is clamped to the range 0 to 1.
*/
Object.defineProperty(Phaser.Video.prototype, "volume", {
get: function () {
return (this.video) ? this.video.volume : 1;
},
set: function (value) {
if (value < 0)
{
value = 0;
}
else if (value > 1)
{
value = 1;
}
if (this.video)
{
this.video.volume = value;
}
}
});
/**
* @name Phaser.Video#playbackRate
* @property {number} playbackRate - Gets or sets the playback rate of the Video. This is the speed at which the video is playing.
*/
Object.defineProperty(Phaser.Video.prototype, "playbackRate", {
get: function () {
return (this.video) ? this.video.playbackRate : 1;
},
set: function (value) {
if (this.video)
{
this.video.playbackRate = value;
}
}
});
/**
* Gets or sets if the Video is set to loop.
* Please note that at present some browsers (i.e. Chrome) do not support *seamless* video looping.
* If the video isn't yet set this will always return false.
*
* @name Phaser.Video#loop
* @property {boolean} loop
*/
Object.defineProperty(Phaser.Video.prototype, "loop", {
get: function () {
return (this.video) ? this.video.loop : false;
},
set: function (value) {
if (value && this.video)
{
this.video.loop = 'loop';
}
else if (this.video)
{
this.video.loop = '';
}
}
});
/**
* @name Phaser.Video#playing
* @property {boolean} playing - True if the video is currently playing (and not paused or ended), otherwise false.
* @readOnly
*/
Object.defineProperty(Phaser.Video.prototype, "playing", {
get: function () {
return !(this.video.paused && this.video.ended);
}
});
Phaser.Video.prototype.constructor = Phaser.Video;
|
var searchData=
[
['pixeltype',['PixelType',['../classitk_1_1_hough_transform2_d_circles_image_filter.html#a88a57e954ace33a3e498bc925aa4b891',1,'itk::HoughTransform2DCirclesImageFilter']]],
['pointer',['Pointer',['../classitk_1_1_hough_transform2_d_circles_image_filter.html#ad94c471797f2eddd6ab11c85d5694ece',1,'itk::HoughTransform2DCirclesImageFilter']]]
];
|
describe("BASIC CRUD SCENARIOS", function() {
require("./basic");
});
describe("VALIDATE SCENARIOS", function() {
require("./validate");
});
describe("REPORT SCENARIOS", function() {
require("./report");
}); |
import Ember from '../index'; // testing reexports
// From sindresourhus/semver-regex https://github.com/sindresorhus/semver-regex/blob/795b05628d96597ebcbe6d31ef4a432858365582/index.js#L3
const SEMVER_REGEX = /^\bv?(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?\b$/;
QUnit.module('ember-metal/core/main');
QUnit.test('Ember registers itself', function() {
let lib = Ember.libraries._registry[0];
equal(lib.name, 'Ember');
equal(lib.version, Ember.VERSION);
});
QUnit.test('Ember.VERSION is in alignment with SemVer v2.0.0', function () {
ok(SEMVER_REGEX.test(Ember.VERSION), `Ember.VERSION (${Ember.VERSION})is valid SemVer v2.0.0`);
});
QUnit.test('SEMVER_REGEX properly validates and invalidates version numbers', function () {
function validateVersionString(versionString, expectedResult) {
equal(SEMVER_REGEX.test(versionString), expectedResult);
}
// Postive test cases
validateVersionString('1.11.3', true);
validateVersionString('1.0.0-beta.16.1', true);
validateVersionString('1.12.1+canary.aba1412', true);
validateVersionString('2.0.0-beta.1+canary.bb344775', true);
// Negative test cases
validateVersionString('1.11.3.aba18a', false);
validateVersionString('1.11', false);
});
QUnit.test('Ember.keys is deprecated', function() {
expectDeprecation(function() {
Ember.keys({});
}, 'Ember.keys is deprecated in favor of Object.keys');
});
QUnit.test('Ember.create is deprecated', function() {
expectDeprecation(function() {
Ember.create(null);
}, 'Ember.create is deprecated in favor of Object.create');
});
QUnit.test('Ember.Backburner is deprecated', function() {
expectDeprecation(function() {
new Ember.Backburner(['foo']);
}, 'Usage of Ember.Backburner is deprecated.');
});
QUnit.test('Ember.K is deprecated', function(assert) {
expectDeprecation(function() {
let obj = {
noop: Ember.K
};
assert.equal(obj, obj.noop());
}, 'Ember.K is deprecated in favor of defining a function inline.');
});
|
/**
* Initializes an object clone.
*
* @private
* @param {Object} object The object to clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneObject(object) {
var Ctor = object.constructor;
if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) {
Ctor = Object;
}
return new Ctor();
}
export default initCloneObject; |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
function getDecimals(n) {
n = n + '';
var i = n.indexOf('.');
return (i == -1) ? 0 : n.length - i - 1;
}
function getVF(n, opt_precision) {
var v = opt_precision;
if (undefined === v) {
v = Math.min(getDecimals(n), 3);
}
var base = Math.pow(10, v);
var f = ((n * base) | 0) % base;
return {v: v, f: f};
}
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"Munkyo",
"Eigulo"
],
"DAY": [
"Sabiiti",
"Balaza",
"Owokubili",
"Owokusatu",
"Olokuna",
"Olokutaanu",
"Olomukaaga"
],
"MONTH": [
"Janwaliyo",
"Febwaliyo",
"Marisi",
"Apuli",
"Maayi",
"Juuni",
"Julaayi",
"Agusito",
"Sebuttemba",
"Okitobba",
"Novemba",
"Desemba"
],
"SHORTDAY": [
"Sabi",
"Bala",
"Kubi",
"Kusa",
"Kuna",
"Kuta",
"Muka"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mar",
"Apu",
"Maa",
"Juu",
"Jul",
"Agu",
"Seb",
"Oki",
"Nov",
"Des"
],
"fullDate": "EEEE, d MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y h:mm:ss a",
"mediumDate": "d MMM y",
"mediumTime": "h:mm:ss a",
"short": "dd/MM/y h:mm a",
"shortDate": "dd/MM/y",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "UGX",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "xog-ug",
"pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); |
/*jslint browser: true, todo: true, vars: true, nomen: true */
/**
* A collection of useful function provided on a single Utils object.
* @module Utils
* @author Erik Pearson <eapearson@lbl.gov>
* @version 0.0.2
*
* @todo complete testing
* @todo determine if methods are unused, and if so, remove them
* @todo move the xProp methods to their own module
* @todo add exception and async testing
* @todo move any kbase api methods into kb.utils.api
*/
/**
* Any Javsascript type.
*
* @typedef {(object|string|number|boolean|undefined|function)} Any
*/
/**
* An ordered list of properties that specify a path into an object. Each
* path item represents a property name of the current object. The first
* item represents a property of the immediate object, the second a property
* of the value of the first property, if that contained an object, and so
* forth. The canonical representation is an array of strings, but a string
* with property components separated by dots is a natural and easier form
* for people.
*
* @typedef {(string|string[])} PropertyPath
*/
define(['bluebird', 'jquery'], function (Promise, $) {
"use strict";
var Utils = Object.create({}, {
version: {
value: '0.0.2',
writable: false
},
/**
* Get the value for property from an object. The property may
* be provided as string or array of strings. If a string, it
* will be converted to an array by splitting at each period (.).
* The array of strings forms a "path" into the object.
*
* @function getProp
*
* @param {object} obj - The object containing the property
* @param {string|string[]} props - The path into the object on
* which to find the value.
* @param {Any} defaultValue - A value to return if the property was not
* found. Defaults to undefined.
*
* @returns {Any} - The property value, if found, or the
* default value, if not.
*
* @example
* var room = {livingroom: {chair: {color: 'red'}}}
* var color = U.getProp(room, 'livingroom.chair.color');
* // color === 'red';
*
* @static
*/
getProp: {
value: function (obj, props, defaultValue) {
if (typeof props === 'string') {
props = props.split('.');
} else if (!(props instanceof Array)) {
throw new TypeError('Invalid type for key: ' + (typeof props));
}
var i;
for (i = 0; i < props.length; i += 1) {
if ((obj === undefined) ||
(typeof obj !== 'object') ||
(obj === null)) {
return defaultValue;
}
obj = obj[props[i]];
}
if (obj === undefined) {
return defaultValue;
} else {
return obj;
}
}
},
/**
* Determine whether a nested property exists on the given
* object.
*
* @function hasProp
*
* @param {object} obj - The object in question
* @param {PropertyPath} propPath - The property to be
* inspected.
*
* @returns {boolean} - true if the property exists, false
* otherwise.
*
* @example
* var obj = {earth: {northamerica: {unitedstates: {california: {berkeley: {university: 'ucb'}}}}}};
* var hasUniversity = U.hasProp(obj, 'earth.northamerica.unitedstates.california.berkeley.university');
* // hasUniversity === true
*
* @static
*/
hasProp: {
value: function (obj, propPath) {
if (typeof propPath === 'string') {
propPath = propPath.split('.');
}
var i;
for (i = 0; i < propPath.length; i += 1) {
if ((obj === undefined) ||
(typeof obj !== 'object') ||
(obj === null)) {
return false;
}
obj = obj[propPath[i]];
}
if (obj === undefined) {
return false;
} else {
return true;
}
}
},
/**
* Set the nested property of the object to the given value.
* Since this is a nested property, the final property key
* is the one that actually gets the value, any prior property
* path components are used to "walk" the object to that
* property.
*
* @function setProp
*
* @param {object} obj - the object in which to set the property
* @param {string|string[]} path - the property path on which to
* set the property value
* @param {any} value - the value to set on the property
*
* @static
*/
setProp: {
value: function (obj, path, value) {
if (typeof path === 'string') {
path = path.split('.');
}
if (path.length === 0) {
return;
}
// pop off the last property for setting at the end.
var propKey = path.pop(),
key;
// Walk the path, creating empty objects if need be.
while (path.length > 0) {
key = path.shift();
if (obj[key] === undefined) {
obj[key] = {};
}
obj = obj[key];
}
// Finally set the property.
obj[propKey] = value;
return value;
}
},
/**
* Increments a numeric property by a 1 or a given optional value.
* Creates the property if it does not exist, setting the initial
* value to the increment value.
*
* @function incrProp
*
* @param {object} obj - the object on which to increment the property
* @param {string|string[]} path - the property path on which to
* increment the property
* @param {value} [increment=1] - the value by which to increment
* the property
*
* @returns {number|undefined} the new value of the incremented
* property or undefined if an invalid property is supplied.
*
* @throws {TypeError} Thrown if the target property contains a
* non-numeric value.
*
* @example
* var obj = {cars: 0};
* Utils.incrProp(obj, cars);
* // {cars: 1}
*
* @example
* var obj = {countdown: 10};
* Utils.incrProp(obj, countdown, -1);
* // {countdown: 9}
*
* @static
*/
incrProp: {
value: function (obj, path, increment) {
if (typeof path === 'string') {
path = path.split('.');
}
if (path.length === 0) {
return;
}
increment = (increment === undefined) ? 1 : increment;
var propKey = path.pop(),
key;
while (path.length > 0) {
key = path.shift();
if (obj[key] === undefined) {
obj[key] = {};
}
obj = obj[key];
}
if (obj[propKey] === undefined) {
obj[propKey] = increment;
} else {
if (typeof obj[propKey] === 'number') {
obj[propKey] += increment;
} else {
throw new Error('Can only increment a number');
}
}
return obj[propKey];
}
},
/**
* For a given object delets a property specified by a path
*
* @function deleteProp
*
* @param {object} - the object on which to remove the property
* @param {string|string[]} - the property specified as a path to delete
*
* @returns {boolean} - true if the deletion was carried out, false
* if the property could not be found.
*
* @example
* var obj = {pets: {fido: {type: 'dog'}, {spot: {type: 'lizard'}}};
* U.deleteProp(obj, 'pets.spot');
* // {pets: {fido: {type: 'dog'}}}
*
* @static
*/
deleteProp: {
value: function (obj, path) {
if (typeof path === 'string') {
path = path.split('.');
}
if (path.length === 0) {
return;
}
var propKey = path.pop(),
key;
while (path.length > 0) {
key = path.shift();
if (obj[key] === undefined) {
return false;
}
obj = obj[key];
}
delete obj[propKey];
return true;
}
},
/**
* Calls a kbase service client method inside of a promise. Returns
* a promise that can be used in promises-style composition.
* KBase service clients are generated by the kbase type compiler,
* and follow an unvarying call pattern of:
* Client.method(data, successFunction, errorFunction)
* Note: the name of this function was chosen to be short and
* context-free -- the context provided by the specific client
* and method provided as input (and thus appearing in the
* call to promise). More descriptive might be
* KBaseServiceClientMethodCallPromise, but ...
*
* @function promise
*
* @param {object} client - An instance of a KBase service client
* @param {string} method - the name of a method on the service client
* @param {any} arg1 - an arbitrary object passed directly to the
* method. It should be a json-compatible object, for that is what
* is passed to the service endpoint (via ajax).
*
* @returns {Promise} a promise which when fulfilled with supply
* the return value from the kbase api call.
*
* @throws {TypeError} - if the method is not found on the client
*
* @static
*
* @todo testing
*/
promise: {
value: function (client, method, arg1) {
return new Promise(function (resolve, reject) {
if (!client[method]) {
throw new TypeError('Invalid KBase Client call; method "' + method + '" not found in client "' + client.constructor + '"');
}
client[method](arg1,
function (result) {
resolve(result);
},
function (err) {
reject(err);
});
});
}
},
/**
* Get a node from within a json schema specification object.
*
* @function getSchemaNode
*
* @param {object} schema - a json schmea object
* @param {PropertyPath} propPath - the path to the schema node
*
* @returns {Any} the value at the specified node.
*
* @static
*
* @todo is this really used? If so, needs own module
* @todo testing
*/
getSchemaNode: {
value: function (schema, propPath) {
var props = propPath.split('.'),
i;
// doesn't handle arrays now.
for (i = 0; i < props.length; (i += 1)) {
var prop = props[i];
// Get the node.
switch (schema.type) {
case 'object':
var field = schema.properties[prop];
if (!field) {
throw 'Field ' + prop + ' in ' + propPath + ' not found.';
}
schema = field;
break;
case 'string':
case 'integer':
case 'boolean':
default:
throw 'Cannot get a node on type type ' + schema.type;
}
}
return schema;
}
},
/**
* The old classic standby - determines if an arbitrary value is
* considered to be blank, empty, devoid of information.
* This is very useful in the context of rendering a value for
* human consumption, also for validation.
* A value is considered blank if:
* it is undefined, it is null
* it is a string or array of 0 length
* it is an object with 0 own property names
* This leaves any number, boolean, or function as non-blank.
*
* @function isBlank
*
* @param {Any} value - any javascript value of any type
*
* @returns {boolean} - true if the object is considered blank,
* false otherwise.
*
* @static
*/
isBlank: {
value: function (value) {
if (value === undefined) {
return true;
} else if (typeof value === 'object') {
if (value === null) {
return true;
} else if (value.push && value.pop) {
if (value.length === 0) {
return true;
}
} else {
if (Object.getOwnPropertyNames(value).length === 0) {
return true;
}
}
} else if (typeof value === 'string' && value.length === 0) {
return true;
}
return false;
}
},
/**
* Given two objects, overlays the second on top of the first,
* ensuring that any property on the second exists on the first,
* creating or overwriting properties as necessary.
* Why another mix/extend/merge? I wanted to be in control of
* policy regarding the overwriting, or not, of properties.
* E.g. I consider null to be a value indicating lack of any
* other value, whereas undefined indicates no value, but we
* don't know whether it might have a value.
*
* @function merge
*
* @param {object} objA - the target object, will be modified
* @param {object} objB - the source object
*
* @returns {object} - the merged object
*
* @throws {TypeError} if a destination property value cannot
* support a sub-property, yet the merge calls for it.
*
* @static
*/
merge: {
value: function (objA, objB) {
var Merger = {
init: function (obj) {
this.dest = obj;
return this;
},
getType: function (x) {
var t = typeof x;
if (t === 'object') {
if (x === null) {
return 'null';
} else if (x.pop && x.push) {
return 'array';
} else {
return 'object';
}
} else {
return t;
}
},
merge: function (dest, obj) {
this.dest = dest;
switch (this.getType(obj)) {
case 'string':
case 'integer':
case 'boolean':
case 'null':
throw new TypeError("Can't merge a '" + (typeof obj) + "'");
break;
case 'object':
return this.mergeObject(obj);
break;
case 'array':
return this.mergeArray(obj);
break;
default:
throw new TypeError("Can't merge a '" + (typeof obj) + "'");
}
},
mergeObject: function (obj) {
var keys = Object.keys(obj);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var val = obj[key];
var t = this.getType(val);
switch (t) {
case 'string':
case 'number':
case 'boolean':
case 'null':
this.dest[key] = val;
break;
case 'object':
if (!this.dest[key]) {
this.dest[key] = {};
}
this.dest[key] = Object.create(Merger).init(this.dest[key]).mergeObject(obj[key]);
break;
case 'array':
if (!this.dest[key]) {
this.dest[key] = [];
} else {
this.dest[key] = [];
}
this.dest[key] = Object.create(Merger).init(this.dest[key]).mergeArray(obj[key]);
break;
case 'undefined':
if (this.dest[key]) {
delete this.dest[key];
}
break;
}
}
return this.dest;
},
mergeArray: function (arr) {
var deleted = false;
for (var i = 0; i < arr.length; i++) {
var val = arr[i];
var t = this.getType(val);
switch (t) {
case 'string':
case 'number':
case 'boolean':
case 'null':
this.dest[i] = val;
break;
case 'object':
if (!this.dest[i]) {
this.dest[i] = {};
}
this.dest[i] = Object.create(Merger).init(this.dest[i]).mergeObject(arr[i]);
break;
case 'array':
if (!this.dest[i]) {
this.dest[i] = [];
}
this.dest[i] = Object.create(Merger).init(this.dest[i]).mergeArray(arr[i]);
break;
case 'undefined':
if (this.dest[i]) {
this.dest[i] = undefined;
}
break;
}
}
if (deleted) {
return this.dest.filter(function (value) {
if (value === undefined) {
return false;
} else {
return true;
}
});
} else {
return this.dest;
}
}
};
if (objB === undefined) {
return objA;
} else {
return Object.create(Merger).merge(objA, objB);
}
}
},
shallowMerge: {
value: function (objA, objB) {
if (!objB) {
return objA;
}
if (!objA) {
throw new Error('First argument not an object');
}
Object.keys(objB).forEach(function (key) {
objA[key] = objB[key];
});
return objA;
}
},
/**
* Given an ISO8601 date in full regalia, with a GMT/UTC timezone offset attached
* in #### format, reformat the date into ISO8601 with no timezone.
* Javascript (at present) does not like timezone attached and assumes all such
* datetime strings are UTC.
* YYYY-MM-DDThh:mm:ss[+-]hh[:]mm
* where the +is + or -, and the : in the timezone is optional.
*
* @function iso8601ToDate
*
* @param {string} dateString - an string encoding a date-time in iso8601 format
*
* @returns {Date} - a date object representing the same time as provided in the input.
*
* @throws {TypeError} if the input date string does not parse strictly as
* an ISO8601 full date format.
*
* @static
*/
iso8601ToDate: {
value: function (dateString) {
if (!dateString) {
return null;
}
var isoRE = /(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)([\+\-])(\d\d)(:?[\:]*)(\d\d)/;
var dateParts = isoRE.exec(dateString);
if (!dateParts) {
throw new TypeError('Invalid Date Format for ' + dateString);
}
// This is why we do this -- JS insists on the colon in the tz offset.
var offset = dateParts[7] + dateParts[8] + ':' + dateParts[10];
var newDateString = dateParts[1] + '-' + dateParts[2] + '-' + dateParts[3] + 'T' + dateParts[4] + ':' + dateParts[5] + ':' + dateParts[6] + offset;
return new Date(newDateString);
}
},
/**
* Shows a date with a more human oriented approach to expressing the difference
* between the current date and the subject date.
*
* @function niceElapsedTime
*
* @param {Date|string|integer} - a Javascript date object,
* a parsable date string or a UTC time in milliseconds (from
* 1/1/1970)
*
* @returns {string} - a formatted representation of the time elapsed
* from the given date to the present moment.
*
* @example
* If a time a time is within the last hour, express it in minutes.
* If it is in the last day, express it in hours.
* If it is yesterday, yesterday.
* If it is any other date in the past, use the date, with no time.
* If it is in the past and it is not a date, append "ago", as in "3 hours ago"
* If it is in the future, prepend "in", as in "in 5 minues"
*
* @static
*
*/
niceElapsedTime: {
value: function (dateObj, nowDateObj) {
if (typeof dateObj === 'string') {
var date = new Date(dateObj);
} else if (typeof dateObj === 'number') {
var date = new Date(dateObj);
} else {
var date = dateObj;
}
if (nowDateObj === undefined) {
var now = new Date();
} else if (typeof nowDateObj === 'string') {
var now = new Date(nowDateObj);
} else {
var now = nowDateObj;
}
var shortMonths = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var elapsed = Math.round((now.getTime() - date.getTime()) / 1000);
var elapsedAbs = Math.abs(elapsed);
// Within the last 7 days...
if (elapsedAbs < 60 * 60 * 24 * 7) {
if (elapsedAbs === 0) {
return 'now';
} else if (elapsedAbs < 60) {
var measure = elapsed;
var measureAbs = elapsedAbs;
var unit = 'second';
} else if (elapsedAbs < 60 * 60) {
var measure = Math.round(elapsed / 60);
var measureAbs = Math.round(elapsedAbs / 60);
var unit = 'minute';
} else if (elapsedAbs < 60 * 60 * 24) {
var measure = Math.round(elapsed / 3600);
var measureAbs = Math.round(elapsedAbs / 3600);
var unit = 'hour';
} else if (elapsedAbs < 60 * 60 * 24 * 7) {
var measure = Math.round(elapsed / (3600 * 24));
var measureAbs = Math.round(elapsedAbs / (3600 * 24));
var unit = 'day';
}
if (measureAbs > 1) {
unit += 's';
}
var prefix = null;
var suffix = null;
if (measure < 0) {
var prefix = 'in';
} else if (measure > 0) {
var suffix = 'ago';
}
return (prefix ? prefix + ' ' : '') + measureAbs + ' ' + unit + (suffix ? ' ' + suffix : '');
} else {
// otherwise show the actual date, with or without the year.
if (now.getFullYear() === date.getFullYear()) {
return shortMonths[date.getMonth()] + " " + date.getDate();
} else {
return shortMonths[date.getMonth()] + " " + date.getDate() + ", " + date.getFullYear();
}
}
}
},
/**
* Displays a friendly timestamp, with full date and time details
* down to the minute, in local time.
*
* @function niceTimestamp
*
* @params {string|number|Date} - A date in either a Date object
* or a form that can be converted by the Date constructor.
*
* @returns {string} a friendly formatted timestamp.
*
* @static
*/
niceTimestamp: {
value: function (dateObj) {
if (typeof dateObj === 'string') {
var date = new Date(dateObj);
} else if (typeof dateObj === 'number') {
var date = new Date(dateObj);
} else {
var date = dateObj;
}
var shortMonths = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var minutes = date.getMinutes();
if (minutes < 10) {
minutes = "0" + minutes;
}
if (date.getHours() >= 12) {
if (date.getHours() !== 12) {
var time = (date.getHours() - 12) + ":" + minutes + "pm";
} else {
var time = "12:" + minutes + "pm";
}
} else {
var time = date.getHours() + ":" + minutes + "am";
}
var timestamp = shortMonths[date.getMonth()] + " " + date.getDate() + ", " + date.getFullYear() + " at " + time;
return timestamp;
}
},
/**
* Given a number, formats it in a manner appropriate for
* representing a file size. It uses recognizable units,
* bytes, K, M, G, T and attempts to show at meaningful scale.
*
* @function fileSizeFormat
*
* @params {number} - the size of the file
*
* @returns {string} a formatted string representing the size of the
* file in recognizable units.
*
* @static
*
* @todo complete, test
* @todo there is a complete version somewhere else
*/
fileSizeFormat: {
value: function (num) {
if (typeof num === 'string') {
var num = parseInt(num);
}
var pieces = [];
while (num > 0) {
var group = num % 1000;
pieces.unshift(group + '');
num = Math.floor(num / 1000);
if (num > 0) {
pieces.unshift(',');
}
}
return pieces.join('') + ' bytes';
}
},
/**
* Do an ajax call wrapped in a promise.
*
* @function getJSON
*
* @param {string} path - the url to get
* @param {integer} timeout - how long to wait before returning an error
*
* @static
*/
// TODO: is this really used? It does not appear to be.
getJSON: {
value: function (path, timeout) {
// web just wrap the jquery ajax promise in a REAL Q promise.
// JQuery ajax config handles the json conversion.
// If we want more control, we could just handle the jquery promise
// first, and then return a promise.
return new Promise.resolve($.ajax(path, {
type: 'GET',
dataType: 'json',
timeout: timeout || 10000
}));
}
},
/**
* Convert an object to an array, transforming the key and value
* into properties of a simple object which becomes the array
* element values.
*
* @function object_to_array
*
* @param {object} obj - some object
* @param {string} keyName - becomes the property name of each
* array item holding the key value
* @param {string} valueName - becomes the property name of each
* array item holding the object.
*
* @returns {array} an array of simple objects of two proerties,
* holding the key and value of for each original property of the
* input object.
*
* @static
*/
object_to_array: {
value: function (obj, keyName, valueName) {
var keys = Object.keys(obj);
var arr = [];
for (var i in keys) {
var newObj = {};
newObj[keyName] = keys[i];
newObj[valueName] = obj[keys[i]];
arr.push(newObj);
}
return arr;
}
},
/**
* Given an array of objects...
*
* @function mapAnd
*
* @param {object[][]} arrs - an array of arrays
* @param {function} run - apply to each
*
* @return {boolean}
*
* @todo is this used? it does not appear to be.
*/
mapAnd: {
value: function (arrs, fun) {
var keys = Object.keys(arrs[0]);
for (var i = 0; i < arrs[0].length; i++) {
var args = [];
for (var j = 0; j < arrs.length; j++) {
args.push(arrs[j][i]);
if (!fun.call(null, args)) {
return false;
}
}
}
return true;
}
},
/**
* Determines, through a thorough and deep inspection, whether
* two values are equal. Inspects all array items in order,
* all object properties.
*
* @function isEqual
*
* @param {Any} v1 - a value to compare to a second
* @param {Any} v2 - another value to compare to the first
*
* @returns {boolean} true if the two values are equal, false
* otherwise.
*
* @static
*/
isEqual: {
value: function (v1, v2) {
var _this = this;
var path = [];
var iseq = function (v1, v2) {
var t1 = typeof v1;
var t2 = typeof v2;
if (t1 !== t2) {
return false;
}
switch (t1) {
case 'string':
case 'number':
case 'boolean':
if (v1 !== v2) {
return false;
}
break;
case 'undefined':
if (t2 !== 'undefined') {
return false;
}
break;
case 'object':
if (v1 instanceof Array) {
if (v1.length !== v2.length) {
return false;
} else {
for (var i = 0; i < v1.length; i++) {
path.push(i);
if (!iseq(v1[i], v2[i])) {
return false;
}
path.pop();
}
}
} else if (v1 === null) {
if (v2 !== null) {
return false;
}
} else if (v2 === null) {
return false;
} else {
var k1 = Object.keys(v1);
var k2 = Object.keys(v2);
if (k1.length !== k2.length) {
return false;
}
for (var i = 0; i < k1.length; i++) {
path.push(k1[i]);
if (!iseq(v1[k1[i]], v2[k1[i]])) {
return false;
}
path.pop();
}
}
}
return true;
}.bind(this);
return iseq(v1, v2);
}
},
// from kbapi.js
// dang, this is so very specific
objTable: {
value: function(p) {
var obj = p.obj,
keys = p.keys;
// option to use nicely formated keys as labels
if (p.keysAsLabels ) {
var labels = [];
for (var i in keys) {
var str = keys[i].key.replace(/(id|Id)/g, 'ID');
var words = str.split(/_/g);
for (var j in words) {
words[j] = words[j].charAt(0).toUpperCase() + words[j].slice(1);
}
var name = words.join(' ');
labels.push(name);
}
} else if ('labels' in p) {
var labels = p.labels;
} else {
// if labels are specified in key objects, use them
for (var i in keys) {
var key_obj = keys[i];
if ('label' in key_obj) {
labels.push(key_obj.label);
} else {
labels.push(key_obj.key)
}
}
}
var table = $('<table class="table table-striped table-bordered">');
for (var i in keys) {
var key = keys[i];
var row = $('<tr>');
if (p.bold) {
var label = $('<td><b>'+labels[i]+'</b></td>');
} else {
var label = $('<td>'+labels[i]+'</td>');
}
var value = $('<td>');
if ('format' in key) {
var val = key.format(obj);
value.append(val);
} else if (key.type === 'bool') {
value.append((obj[key.key] === 1 ? 'True' : 'False'));
} else {
value.append(obj[key.key]);
}
row.append(label, value);
table.append(row);
}
return table;
}
}
});
return Utils;
}); |
/**
* @class Ext.grid.plugin.RowEditing
* @extends Ext.grid.plugin.Editing
*
* The Ext.grid.plugin.RowEditing plugin injects editing at a row level for a Grid. When editing begins,
* a small floating dialog will be shown for the appropriate row. Each editable column will show a field
* for editing. There is a button to save or cancel all changes for the edit.
*
* The field that will be used for the editor is defined at the
* {@link Ext.grid.column.Column#field field}. The editor can be a field instance or a field configuration.
* If an editor is not specified for a particular column then that column won't be editable and the value of
* the column will be displayed.
*
* The editor may be shared for each column in the grid, or a different one may be specified for each column.
* An appropriate field type should be chosen to match the data structure that it will be editing. For example,
* to edit a date, it would be useful to specify {@link Ext.form.field.Date} as the editor.
*
* {@img Ext.grid.plugin.RowEditing/Ext.grid.plugin.RowEditing.png Ext.grid.plugin.RowEditing plugin}
*
* ## Example Usage
*
* Ext.create('Ext.data.Store', {
* storeId:'simpsonsStore',
* fields:['name', 'email', 'phone'],
* data:{'items':[
* {"name":"Lisa", "email":"lisa@simpsons.com", "phone":"555-111-1224"},
* {"name":"Bart", "email":"bart@simpsons.com", "phone":"555--222-1234"},
* {"name":"Homer", "email":"home@simpsons.com", "phone":"555-222-1244"},
* {"name":"Marge", "email":"marge@simpsons.com", "phone":"555-222-1254"}
* ]},
* proxy: {
* type: 'memory',
* reader: {
* type: 'json',
* root: 'items'
* }
* }
* });
*
* Ext.create('Ext.grid.Panel', {
* title: 'Simpsons',
* store: Ext.data.StoreManager.lookup('simpsonsStore'),
* columns: [
* {header: 'Name', dataIndex: 'name', field: 'textfield'},
* {header: 'Email', dataIndex: 'email', flex:1,
* editor: {
* xtype:'textfield',
* allowBlank:false
* }
* },
* {header: 'Phone', dataIndex: 'phone'}
* ],
* selType: 'rowmodel',
* plugins: [
* Ext.create('Ext.grid.plugin.RowEditing', {
* clicksToEdit: 1
* })
* ],
* height: 200,
* width: 400,
* renderTo: Ext.getBody()
* });
*/
Ext.define('Ext.grid.plugin.RowEditing', {
extend: 'Ext.grid.plugin.Editing',
alias: 'plugin.rowediting',
requires: [
'Ext.grid.RowEditor'
],
editStyle: 'row',
/**
* @cfg {Boolean} autoCancel
* `true` to automatically cancel any pending changes when the row editor begins editing a new row.
* `false` to force the user to explicitly cancel the pending changes. Defaults to `true`.
* @markdown
*/
autoCancel: true,
/**
* @cfg {Number} clicksToMoveEditor
* The number of clicks to move the row editor to a new row while it is visible and actively editing another row.
* This will default to the same value as {@link Ext.grid.plugin.Editing#clicksToEdit clicksToEdit}.
* @markdown
*/
/**
* @cfg {Boolean} errorSummary
* `true` to show a {@link Ext.tip.ToolTip tooltip} that summarizes all validation errors present
* in the row editor. Set to `false` to prevent the tooltip from showing. Defaults to `true`.
* @markdown
*/
errorSummary: true,
/**
* @event beforeedit
* Fires before row editing is triggered. The edit event object has the following properties <br />
* <ul style="padding:5px;padding-left:16px;">
* <li>grid - The grid this editor is on</li>
* <li>view - The grid view</li>
* <li>store - The grid store</li>
* <li>record - The record being edited</li>
* <li>row - The grid table row</li>
* <li>column - The grid {@link Ext.grid.column.Column Column} defining the column that initiated the edit</li>
* <li>rowIdx - The row index that is being edited</li>
* <li>colIdx - The column index that initiated the edit</li>
* <li>cancel - Set this to true to cancel the edit or return false from your handler.</li>
* </ul>
* @param {Ext.grid.plugin.Editing} editor
* @param {Object} e An edit event (see above for description)
*/
/**
* @event edit
* Fires after a row is edited. The edit event object has the following properties <br />
* <ul style="padding:5px;padding-left:16px;">
* <li>grid - The grid this editor is on</li>
* <li>view - The grid view</li>
* <li>store - The grid store</li>
* <li>record - The record being edited</li>
* <li>row - The grid table row</li>
* <li>column - The grid {@link Ext.grid.column.Column Column} defining the column that initiated the edit</li>
* <li>rowIdx - The row index that is being edited</li>
* <li>colIdx - The column index that initiated the edit</li>
* </ul>
*
* <pre><code>
grid.on('edit', onEdit, this);
function onEdit(e) {
// execute an XHR to send/commit data to the server, in callback do (if successful):
e.record.commit();
};
* </code></pre>
* @param {Ext.grid.plugin.Editing} editor
* @param {Object} e An edit event (see above for description)
*/
/**
* @event validateedit
* Fires after a cell is edited, but before the value is set in the record. Return false
* to cancel the change. The edit event object has the following properties <br />
* <ul style="padding:5px;padding-left:16px;">
* <li>grid - The grid this editor is on</li>
* <li>view - The grid view</li>
* <li>store - The grid store</li>
* <li>record - The record being edited</li>
* <li>row - The grid table row</li>
* <li>column - The grid {@link Ext.grid.column.Column Column} defining the column that initiated the edit</li>
* <li>rowIdx - The row index that is being edited</li>
* <li>colIdx - The column index that initiated the edit</li>
* <li>cancel - Set this to true to cancel the edit or return false from your handler.</li>
* </ul>
* Usage example showing how to remove the red triangle (dirty record indicator) from some
* records (not all). By observing the grid's validateedit event, it can be cancelled if
* the edit occurs on a targeted row (for example) and then setting the field's new value
* in the Record directly:
* <pre><code>
grid.on('validateedit', function(e) {
var myTargetRow = 6;
if (e.rowIdx == myTargetRow) {
e.cancel = true;
e.record.data[e.field] = e.value;
}
});
* </code></pre>
* @param {Ext.grid.plugin.Editing} editor
* @param {Object} e An edit event (see above for description)
*/
constructor: function() {
var me = this;
me.callParent(arguments);
if (!me.clicksToMoveEditor) {
me.clicksToMoveEditor = me.clicksToEdit;
}
me.autoCancel = !!me.autoCancel;
},
/**
* @private
* AbstractComponent calls destroy on all its plugins at destroy time.
*/
destroy: function() {
var me = this;
Ext.destroy(me.editor);
me.callParent(arguments);
},
/**
* Start editing the specified record, using the specified Column definition to define which field is being edited.
* @param {Model} record The Store data record which backs the row to be edited.
* @param {Model} columnHeader The Column object defining the column to be edited.
* @override
*/
startEdit: function(record, columnHeader) {
var me = this,
editor = me.getEditor();
if (me.callParent(arguments) === false) {
return false;
}
// Fire off our editor
if (editor.beforeEdit() !== false) {
editor.startEdit(me.context.record, me.context.column);
}
},
// private
cancelEdit: function() {
var me = this;
if (me.editing) {
me.getEditor().cancelEdit();
me.callParent(arguments);
}
},
// private
completeEdit: function() {
var me = this;
if (me.editing && me.validateEdit()) {
me.editing = false;
me.fireEvent('edit', me.context);
}
},
// private
validateEdit: function() {
var me = this;
return me.callParent(arguments) && me.getEditor().completeEdit();
},
// private
getEditor: function() {
var me = this;
if (!me.editor) {
me.editor = me.initEditor();
}
return me.editor;
},
// private
initEditor: function() {
var me = this,
grid = me.grid,
view = me.view,
headerCt = grid.headerCt;
return Ext.create('Ext.grid.RowEditor', {
autoCancel: me.autoCancel,
errorSummary: me.errorSummary,
fields: headerCt.getGridColumns(),
hidden: true,
// keep a reference..
editingPlugin: me,
renderTo: view.el
});
},
// private
initEditTriggers: function() {
var me = this,
grid = me.grid,
view = me.view,
headerCt = grid.headerCt,
moveEditorEvent = me.clicksToMoveEditor === 1 ? 'click' : 'dblclick';
me.callParent(arguments);
if (me.clicksToMoveEditor !== me.clicksToEdit) {
me.mon(view, 'cell' + moveEditorEvent, me.moveEditorByClick, me);
}
view.on('render', function() {
// Column events
me.mon(headerCt, {
add: me.onColumnAdd,
remove: me.onColumnRemove,
columnresize: me.onColumnResize,
columnhide: me.onColumnHide,
columnshow: me.onColumnShow,
columnmove: me.onColumnMove,
scope: me
});
}, me, { single: true });
},
startEditByClick: function() {
var me = this;
if (!me.editing || me.clicksToMoveEditor === me.clicksToEdit) {
me.callParent(arguments);
}
},
moveEditorByClick: function() {
var me = this;
if (me.editing) {
me.superclass.startEditByClick.apply(me, arguments);
}
},
// private
onColumnAdd: function(ct, column) {
if (column.isHeader) {
var me = this,
editor;
me.initFieldAccessors(column);
editor = me.getEditor();
if (editor && editor.onColumnAdd) {
editor.onColumnAdd(column);
}
}
},
// private
onColumnRemove: function(ct, column) {
if (column.isHeader) {
var me = this,
editor = me.getEditor();
if (editor && editor.onColumnRemove) {
editor.onColumnRemove(column);
}
me.removeFieldAccessors(column);
}
},
// private
onColumnResize: function(ct, column, width) {
if (column.isHeader) {
var me = this,
editor = me.getEditor();
if (editor && editor.onColumnResize) {
editor.onColumnResize(column, width);
}
}
},
// private
onColumnHide: function(ct, column) {
// no isHeader check here since its already a columnhide event.
var me = this,
editor = me.getEditor();
if (editor && editor.onColumnHide) {
editor.onColumnHide(column);
}
},
// private
onColumnShow: function(ct, column) {
// no isHeader check here since its already a columnshow event.
var me = this,
editor = me.getEditor();
if (editor && editor.onColumnShow) {
editor.onColumnShow(column);
}
},
// private
onColumnMove: function(ct, column, fromIdx, toIdx) {
// no isHeader check here since its already a columnmove event.
var me = this,
editor = me.getEditor();
if (editor && editor.onColumnMove) {
editor.onColumnMove(column, fromIdx, toIdx);
}
},
// private
setColumnField: function(column, field) {
var me = this;
me.callParent(arguments);
me.getEditor().setField(column.field, column);
}
}); |
var searchData=
[
['clientptr',['ClientPtr',['../namespace_jmcpp.html#a9de7efd098bc057245ccf113c8b8c682',1,'Jmcpp']]],
['conversationid',['ConversationId',['../namespace_jmcpp.html#a311efbb4afe3e944cc9adcaff7e08ea4',1,'Jmcpp']]]
];
|
import fs from 'fs'
import { sync as globSync } from 'glob'
import { sync as mkdirpSync } from 'mkdirp'
import * as i18n from '../lib/i18n'
const MESSAGES_PATTERN = './_translations/**/*.json'
const LANG_DIR = './_translations/lang/'
// Ensure output folder exists
mkdirpSync(LANG_DIR)
// Aggregates the default messages that were extracted from the example app's
// React components via the React Intl Babel plugin. An error will be thrown if
// there are messages in different components that use the same `id`. The result
// is a flat collection of `id: message` pairs for the app's default locale.
let defaultMessages = globSync(MESSAGES_PATTERN)
.map(filename => fs.readFileSync(filename, 'utf8'))
.map(file => JSON.parse(file))
.reduce((collection, descriptors) => {
descriptors.forEach(({ id, defaultMessage, description }) => {
if (collection.hasOwnProperty(id))
throw new Error(`Duplicate message id: ${id}`)
collection[id] = { defaultMessage, description }
})
return collection
}, {})
// Sort keys by name
const messageKeys = Object.keys(defaultMessages)
messageKeys.sort()
defaultMessages = messageKeys.reduce((acc, key) => {
acc[key] = defaultMessages[key]
return acc
}, {})
// Build the XLIFF document for the available languages
i18n.en = messageKeys.reduce((acc, key) => {
acc[key] = defaultMessages[key].defaultMessage
return acc
}, {})
Object.keys(i18n).forEach(lang => {
const langDoc = i18n[lang]
const units = buildUnits(defaultMessages, langDoc)
fs.writeFileSync(`${LANG_DIR}${lang}.xml`, buildXliffDocument(lang, units))
})
function buildUnits (source, target) {
return Object.keys(source).map(key => {
const sourceMessage = source[key]
const targetMessage = target[key]
return buildXliffUnit(key,
sourceMessage.description, sourceMessage.defaultMessage,
targetMessage, targetMessage ? 'translated' : undefined)
})
}
function buildXliffUnit (id, note, source, target, state = 'initial') {
return `
<unit id="${id}">
<notes>
<note>${note || ''}</note>
</notes>
<segment state="${state}">
<source><![CDATA[${source}]]></source>
<target><![CDATA[${target || ''}]]></target>
</segment>
</unit>
`
}
function buildXliffDocument (lang, units) {
/*eslint-disable max-len*/
return `
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="${lang}">
<file id="f1">
${units.join('')}
</file>
</xliff>
`
/*eslint-enable max-len*/
}
|
class C {
#x = 1;
#p = ({ #x: x }) => {}
}
|
pc.extend(pc, (function() {
var TagsCache = function(key) {
this._index = { };
this._key = key || null;
};
TagsCache.prototype = {
addItem: function(item) {
var tags = item.tags._list;
for(var i = 0; i < tags.length; i++)
this.add(tags[i], item);
},
removeItem: function(item) {
var tags = item.tags._list;
for(var i = 0; i < tags.length; i++)
this.remove(tags[i], item);
},
add: function(tag, item) {
// already in cache
if (this._index[tag] && this._index[tag].list.indexOf(item) !== -1)
return;
// create index for tag
if (! this._index[tag]) {
this._index[tag] = {
list: [ ]
};
// key indexing is available
if (this._key)
this._index[tag].keys = { };
}
// add to index list
this._index[tag].list.push(item);
// add to index keys
if (this._key)
this._index[tag].keys[item[this._key]] = item;
},
remove: function(tag, item) {
// no index created for that tag
if (! this._index[tag])
return;
// check if item not in cache
if (this._key) {
// by key
if (! this._index[tag].keys[item[this._key]])
return;
} else {
// by position in list
var ind = this._index[tag].indexOf(item);
if (ind === -1)
return;
}
// remove item from index list
this._index[tag].list.splice(ind, 1);
// rmeove item from index keys
if (this._key)
delete this._index[tag].keys[item[this._key]];
// if index empty, remove it
if (this._index[tag].list.length === 0)
delete this._index[tag];
},
find: function(args) {
var self = this;
var index = { };
var items = [ ];
var i, n, t;
var item, tag, tags, tagsRest, list, missingIndex;
for(i = 0; i < args.length; i++) {
tag = args[i];
if (tag instanceof Array) {
if (tag.length === 0)
continue;
if (tag.length === 1) {
tag = tag[0];
} else {
// check if all indexes are in present
missingIndex = false;
for(t = 0; t < tag.length; t++) {
if (! this._index[tag[t]]) {
missingIndex = true;
break;
}
}
if (missingIndex)
continue;
// sort tags by least number of matches first
tags = tag.slice(0).sort(function(a, b) {
return self._index[a].list.length - self._index[b].list.length;
});
// remainder of tags for `has` checks
tagsRest = tags.slice(1);
if (tagsRest.length === 1)
tagsRest = tagsRest[0];
for(n = 0; n < this._index[tags[0]].list.length; n++) {
item = this._index[tags[0]].list[n];
if ((this._key ? ! index[item[this._key]] : (items.indexOf(item) === -1)) && item.tags.has(tagsRest)) {
if (this._key)
index[item[this._key]] = true;
items.push(item);
}
}
continue;
}
}
if (tag && typeof(tag) === 'string' && this._index[tag]) {
for(n = 0; n < this._index[tag].list.length; n++) {
item = this._index[tag].list[n];
if (this._key) {
if (! index[item[this._key]]) {
index[item[this._key]] = true;
items.push(item);
}
} else if (items.indexOf(item) === -1) {
items.push(item);
}
}
}
}
return items;
}
};
/**
* @name pc.Tags
* @class Set of tag names
* @constructor Create an instance of a Tags.
* @param {Object} parent (optional) Parent object who tags belong to.
* Note: Tags are used as addition of `pc.Entity` and `pc.Asset` as `tags` field.
*/
/**
* @event
* @name pc.Tags#add
* @param {String} tag Name of a tag added to a set.
* @param {Object} parent Parent object who tags belong to.
*/
/**
* @event
* @name pc.Tags#remove
* @param {String} tag Name of a tag removed from a set.
* @param {Object} parent Parent object who tags belong to.
*/
/**
* @event
* @name pc.Tags#change
* @param {Object} [parent] Parent object who tags belong to.
* @description Fires when tags been added / removed.
* It will fire once on bult changes, while `add`/`remove` will fire on each tag operation
*/
var Tags = function(parent) {
this._index = { };
this._list = [ ];
this._parent = parent;
pc.events.attach(this);
};
Tags.prototype = {
/**
* @function
* @name pc.Tags#add
* @description Add a tag, duplicates are ignored. Can be array or comma separated arguments for multiple tags.
* @param {String} name Name of a tag, or array of tags
* @returns {Boolean} true if any tag were added
* @example
* tags.add('level-1');
* @example
* tags.add('ui', 'settings');
* @example
* tags.add([ 'level-2', 'mob' ]);
*/
add: function() {
var changed = false;
var tags = this._processArguments(arguments, true);
if (! tags.length)
return changed;
for (var i = 0; i < tags.length; i++) {
if (this._index[tags[i]])
continue;
changed = true;
this._index[tags[i]] = true;
this._list.push(tags[i]);
this.fire('add', tags[i], this._parent);
}
if (changed)
this.fire('change', this._parent);
return changed;
},
/**
* @function
* @name pc.Tags#remove
* @description Remove tag.
* @param {String} name Name of a tag or array of tags
* @returns {Boolean} true if any tag were removed
* @example
* tags.remove('level-1');
* @example
* tags.remove('ui', 'settings');
* @example
* tags.remove([ 'level-2', 'mob' ]);
*/
remove: function() {
var changed = false;
if (! this._list.length)
return changed;
var tags = this._processArguments(arguments, true);
if (! tags.length)
return changed;
for (var i = 0; i < tags.length; i++) {
if (! this._index[tags[i]])
continue;
changed = true;
delete this._index[tags[i]];
this._list.splice(this._list.indexOf(tags[i]), 1);
this.fire('remove', tags[i], this._parent);
}
if (changed)
this.fire('change', this._parent);
return changed;
},
/**
* @function
* @name pc.Tags#clear
* @description Remove all tags.
* @example
* tags.clear();
*/
clear: function() {
if (! this._list.length)
return;
var tags = this._list.slice(0);
this._list = [ ];
this._index = { };
for(var i = 0; i < tags.length; i++)
this.fire('remove', tags[i], this._parent);
this.fire('change', this._parent);
},
/**
* @function
* @name pc.Tags#has
* @description Check if tags satisfy filters.
* Filters can be provided by simple name of tag, as well as by array of tags.
* When an array is provided it will check if tags contain each tag within the array.
* If any of comma separated argument is satisfied, then it will return true.
* Any number of combinations are valid, and order is irrelevant.
* @param {String} name of tag, or array of names
* @returns {Boolean} true if filters are satisfied
* @example
* tags.has('player'); // player
* @example
* tags.has('mob', 'player'); // player OR mob
* @example
* tags.has([ 'level-1', 'mob' ]); // monster AND level-1
* @example
* tags.has([ 'ui', 'settings' ], [ 'ui', 'levels' ]); // (ui AND settings) OR (ui AND levels)
*/
has: function() {
if (! this._list.length)
return false;
var tags = this._processArguments(arguments);
if (! tags.length)
return false;
for(var i = 0; i < tags.length; i++) {
if (tags[i].length === 1) {
// single occurance
if (this._index[tags[i][0]])
return true;
} else {
// combined occurance
var multiple = true;
for(var t = 0; t < tags[i].length; t++) {
if (this._index[tags[i][t]])
continue;
multiple = false;
break;
}
if (multiple)
return true;
}
}
return false;
},
/**
* @function
* @name pc.Tags#list
* @description Returns immutable array of tags
* @returns {[String]} copy of tags array
*/
list: function() {
return this._list.slice(0);
},
_processArguments: function(args, flat) {
var tags = [ ];
var tmp = [ ];
if (! args || ! args.length)
return tags;
for(var i = 0; i < args.length; i++) {
if (args[i] instanceof Array) {
if (! flat)
tmp = [ ];
for(var t = 0; t < args[i].length; t++) {
if (typeof(args[i][t]) !== 'string')
continue;
if (flat) {
tags.push(args[i][t]);
} else {
tmp.push(args[i][t]);
}
}
if (! flat && tmp.length)
tags.push(tmp);
} else if (typeof(args[i]) === 'string') {
if (flat) {
tags.push(args[i]);
} else {
tags.push([ args[i] ]);
}
}
}
return tags;
},
};
/**
* @field
* @readonly
* @type Number
* @name pc.Tags#size
* @description Number of tags in set
*/
Object.defineProperty(Tags.prototype, 'size', {
get: function () {
return this._list.length;
}
});
return {
TagsCache: TagsCache,
Tags: Tags
};
}()));
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: First expression is evaluated first, and then second expression
es5id: 11.8.6_A2.4_T1
description: Checking with "="
---*/
//CHECK#1
var OBJECT = 0;
if ((OBJECT = Object, {}) instanceof OBJECT !== true) {
$ERROR('#1: var OBJECT = 0; (OBJECT = Object, {}) instanceof OBJECT === true');
}
//CHECK#2
var object = {};
if (object instanceof (object = 0, Object) !== true) {
$ERROR('#2: var object = {}; object instanceof (object = 0, Object) === true');
}
|
/**
* This version is supported by all browsers that support native JSON parsing:
* - Firefox 3.5+
* - Chrome 4.0+
* - Safari 4.0+
* - Opera 10.5+
* - Internet Explorer 8.0+
*
* If you want this version to work with other browsers, you can use the JSON parsing methods of your favorite Javascript
* framework (e.g. jQuery, Dojo, YUI, Mootools, etc.)
*
* Note for IE8 users: if you include MidiBridge.js (or preferably the minified version of it: midibridge-0.5.min.js) in your html,
* the method addEventListener will be added to the window object. In fact this method is just a wrapper around the attachEvent method,
* see code at the bottom of this file.
*/
(function() {
var midiBridge = {
NOTE_OFF : 0x80, //128
NOTE_ON : 0x90, //144
POLY_PRESSURE : 0xA0, //160
CONTROL_CHANGE : 0xB0, //176
PROGRAM_CHANGE : 0xC0, //192
CHANNEL_PRESSURE : 0xD0, //208
PITCH_BEND : 0xE0, //224
SYSTEM_EXCLUSIVE : 0xF0, //240
NOTE_NAMES_SHARP : "sharp",
NOTE_NAMES_FLAT : "flat",
NOTE_NAMES_SOUNDFONT : "soundfont",
NOTE_NAMES_ENHARMONIC_SHARP : "enh-sharp",
NOTE_NAMES_ENHARMONIC_FLAT : "enh-flat"
};
//human readable representation of status byte midi data
var status = [];
status[0x80] = "NOTE OFF";
status[0x90] = "NOTE ON";
status[0xA0] = "POLY PRESSURE";
status[0xB0] = "CONTROL CHANGE";
status[0xC0] = "PROGRAM CHANGE";
status[0xD0] = "CHANNEL PRESSURE";
status[0xE0] = "PITCH BEND";
status[0xF0] = "SYSTEM EXCLUSIVE";
//notenames in different modi
var noteNames = {
"sharp" : ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"],
"flat" : ["C", "Dâ™", "D", "Eâ™", "E", "F", "Gâ™", "G", "Aâ™", "A", "Bâ™", "B"],
"soundfont" : ["C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab", "A", "Bb", "B"],
"enh-sharp" : ["B#", "C#", "C##", "D#", "D##", "E#", "F#", "F##", "G#", "G##", "A#", "A##"],
"enh-flat" : ["Dâ™â™", "Dâ™", "Eâ™â™", "Eâ™", "Fâ™", "Gâ™â™", "Gâ™", "Aâ™â™", "Aâ™", "Bâ™", "Bâ™", "Câ™"]
}
//variable that holds a reference to the JSON parser method of your liking, defaults to native JSON parsing
var parseJSON = JSON.parse;
//method that gets called when midi note events arrive from the applet
var ondata = null;
var onerror = null;
var onready = null;
//the applet object
var applet = null;
var connectAllInputs = false;
var connectFirstInput = false;
var connectFirstOutput = false;
var connectAllInputsToFirstOutput = true;
var javaDir = "java";
var devices = {};
midiBridge.version = "0.5.1";
midiBridge.ready = false;
midiBridge.noteNameModus = midiBridge.NOTE_NAMES_SHARP;
/**
* static method called to initialize the MidiBridge
* possible arguments:
* 1) callback [function] callback when midi data has arrived
* 2) config object
* - ready : [function] callback when midibridge is ready/initialized
* - error : [function] callback in case of an error
* - data : [function] callback when midi data has arrived
* - connectAllInputs : [true,false] all found midi input devices get connected automatically
* - connectFirstInput : [true,false] the first found midi input device gets connected automatically
* - connectFirstOutput : [true,false] the first found midi output device gets connected automatically
* - connectAllInputsToFirstOutput : [true,false] all found midi input devices will be automatically connected to the first found midi output device
* - javaDir : [string] the folder where you store the midiapplet.jar on your webserver, defaults to "java"
*/
midiBridge.init = function(arg) {
//var args = Array.prototype.slice.call(arguments);
if( typeof arg === "function") {
ondata = arg;
} else if( typeof arg === "object") {
var config = arg;
connectAllInputs = config.connectAllInputs;
connectFirstInput = config.connectFirstInput;
connectFirstOutput = config.connectFirstOutput;
connectAllInputsToFirstOutput = config.connectAllInputsToFirstOutput;
ondata = config.data;
onready = config.ready;
onerror = config.error;
switch(true) {
case connectAllInputs && connectFirstOutput:
connectAllInputs = false;
connectFirstInput = false;
connectFirstOutput = false;
connectAllInputsToFirstOutput = true;
break;
case connectAllInputsToFirstOutput:
connectAllInputs = false;
connectFirstInput = false;
connectFirstInput = false;
connectFirstOutput = false;
break;
case connectFirstInput:
connectAllInputs = false;
connectAllInputsToFirstOutput = false;
break;
case connectFirstOutput:
connectAllInputs = false;
connectAllInputsToFirstOutput = false;
break;
case connectAllInputs:
connectFirstInput = false;
connectFirstOutput = false;
connectAllInputsToFirstOutput = false;
break;
}
}
/**
* Very simple java plugin detection
*/
if(!navigator.javaEnabled()) {
if(onerror) {
onerror("no java plugin found; install or enable the java plugin")
} else {
console.log("no java plugin found; install or enable the java plugin");
}
return;
}
/**
* If you are using the JSON parse method of your favorite Javascript framework replace the followingn lines by onlu:
*
* loadJava();
*/
loadJava();
};
/**
* static method called by the applet
*/
midiBridge.msgFromJava = function(jsonString) {
var data = parseJSON(jsonString);
var msgId = data.msgId;
//console.log(jsonString);
//console.log(msgId);
switch(msgId) {
case "upgrade-java":
if(onerror) {
onerror("please upgrade your java plugin!")
} else {
console.log("please upgrade your java plugin!");
}
break;
case "midi-started":
getApplet();
if(applet) {
devices = data.devices;
midiBridge.ready = true;
if(connectAllInputs) {
midiBridge.connectAllInputs();
}
if(connectFirstInput) {
midiBridge.connectFirstInput();
}
if(connectFirstOutput) {
midiBridge.connectFirstOutput();
}
if(connectAllInputsToFirstOutput) {
midiBridge.connectAllInputsToFirstOutput();
}
if(onready) {
onready("midibridge started");
}
}
//console.log("applet:",applet);
break;
case "midi-data":
if(ondata) {
ondata(new MidiMessage(data));
}
break;
case "error":
if(onerror) {
onerror(data.code);
}
break;
}
};
/**
* Send a midi event from javascript to java
* @param status : the midi status byte, e.g. NOTE ON, NOTE OFF, PITCH BEND and so on
* @param channel : the midi channel that this event will be sent to 0 - 15
* @param data1 : the midi note number
* @param data2 : the second data byte, when the status byte is NOTE ON or NOTE OFF, data2 is the velocity
*/
midiBridge.sendMidiEvent = function(status, channel, data1, data2) {
if(checkIfReady()) {
return parseJSON(applet.processMidiEvent(status, channel, data1, data2));
}
};
/**
* Get the list of all currently connected midi devices
*/
midiBridge.getDevices = function() {
return devices;
};
/**
* Refresh the list of all currently connected midi devices
*/
midiBridge.refreshDevices = function() {
if(checkIfReady()) {
return parseJSON(applet.getDevices());
}
};
/**
* Connect all found midi inputs to the midibridge right after the midibridge has been initialized
*/
midiBridge.connectAllInputs = function() {
if(checkIfReady()) {
return parseJSON(applet.connectAllInputs());
}
};
/**
* Connect the first found midi input to the midibridge right after the midibridge has been initialized
*/
midiBridge.connectFirstInput = function() {
if(checkIfReady()) {
return parseJSON(applet.connectFirstInput());
}
};
/**
* Connect the first found midi output to the midibridge right after the midibridge has been initialized
*/
midiBridge.connectFirstOutput = function() {
if(checkIfReady()) {
return parseJSON(applet.connectFirstOutput());
}
};
/**
* Connect the first found midi output to all connected midi inputs right after the midibridge has been initialized
*/
midiBridge.connectAllInputsToFirstOutput = function() {
if(checkIfReady()) {
return parseJSON(applet.connectAllInputsToFirstOutput());
}
};
/**
* Connect midi a midi input to the bridge, and/or a midi input to a midi output
* @param midiInId : [int] id of the midi input that will be connected to the bridge, use the ids as retrieved by getDevices()
* @param midiOutId : [int] optional, the id of the midi output that will be connected to the chosen midi input
* @param filter : [array] an array containing status codes that will *not* be sent from the chosen midi input to the chosen midi output
* e.g. if you supply the array [midiBridge.PITCH_BEND, midiBridge.POLY_PRESSURE], pitch bend and poly pressure midi messages will not be forwarded to the output
*/
midiBridge.addConnection = function(midiInId, midiOutId, filter) {
if(checkIfReady()) {
midiOutId = midiOutId == undefined ? -1 : midiOutId;
filter = filter == undefined ? [] : filter;
return parseJSON(applet.addConnection(midiInId, midiOutId, filter));
}
};
/**
* Remove a midi connection between between an input and the midibridge, and/or the given in- and output
* @param midiIdIn : [int] the midi input
* @param midiIdOut : [int] optional, the midi output
*/
midiBridge.removeConnection = function(midiInId, midiOutId) {
if(checkIfReady()) {
return parseJSON(applet.removeConnection(midiInId, midiOutId));
}
};
/**
* All previously setup midi connections will be disconnected
*/
midiBridge.disconnectAll = function() {
if(checkIfReady()) {
return parseJSON(applet.disconnectAll());
}
};
midiBridge.loadBase64String = function(data){
return parseJSON(applet.loadBase64String(data));
}
midiBridge.playBase64String = function(data){
return parseJSON(applet.playBase64String(data));
}
midiBridge.loadMidiFile = function(url){
return parseJSON(applet.loadMidiFile(url));
}
midiBridge.playMidiFile = function(url){
return parseJSON(applet.playMidiFile(url));
}
midiBridge.startSequencer = function(){
applet.startSequencer();
}
midiBridge.pauseSequencer = function(){
applet.pauseSequencer();
}
midiBridge.stopSequencer = function(){
applet.stopSequencer();
}
midiBridge.closeSequencer = function(){
applet.closeSequencer();
}
midiBridge.getSequencerPosition = function(){
return applet.getSequencerPosition();
}
midiBridge.setSequencerPosition = function(pos){
applet.setSequencerPosition(pos);
}
/**
* Check if a midiBridge function is called before initialization
*/
function checkIfReady() {
if(!midiBridge.ready) {
if(onerror) {
onerror("midibridge not ready!");
}
return "midibridge not ready!";
}
return true;
}
/**
* A div with the applet object is added to the body of your html document
*/
function loadJava() {
//console.log("loadJava");
var javaDiv = document.createElement("div");
javaDiv.setAttribute("id", "midibridge-java");
var html = "";
html += '<object tabindex="0" id="midibridge-applet" type="application/x-java-applet" height="1" width="1">';
html += '<param name="codebase" value="' + javaDir + '/" />';
html += '<param name="archive" value="midiapplet.jar" />';
html += '<param name="code" value="net.abumarkub.midi.applet.MidiApplet" />';
html += '<param name="scriptable" value="true" />';
html += '<param name="minJavaVersion" value="1.5" />';
//html += 'Your browser needs the Java plugin to use the midibridge. You can download it <a href="http://www.java.com/en/" target="blank" title="abumarkub midibridge download java" rel="abumarkub midibridge download java">here</a>';
html += '</object>';
javaDiv.innerHTML = html;
document.body.appendChild(javaDiv);
}
/**
* class MidiMessage is used to wrap the midi note data that arrives from the applet
*/
var MidiMessage = (function()//constructor
{
var _constructor = function(data) {
this.data1 = data.data1;
this.data2 = data.data2;
this.status = data.status;
this.status = this.data2 == 0 && this.status == midiBridge.NOTE_ON ? midiBridge.NOTE_OFF : this.status;
this.channel = data.channel;
this.noteName = midiBridge.getNoteName(this.data1, midiBridge.noteNameModus);
this.statusCode = midiBridge.getStatus(this.status);
this.microsecond = data.microsecond;
this.time = midiBridge.getNiceTime(this.microsecond);
};
_constructor.prototype = {
toString : function() {
var s = "";
s += this.noteName + " " + this.statusCode + " " + this.data1 + " " + this.data2 + " " + this.status;
s += this.microsecond ? this.microsecond + " " + this.time : "";
//console.log(s);
return s;
},
toJSONString : function() {
var s;
if(this.microsecond){
s= "{'notename':" + this.noteName + ", 'status':" + this.status + ", 'data1':" + this.data1 + ", 'data2':" + this.data2 + ", 'microsecond':" + this.microsecond + ", 'time':" + this.time + "}";
}else{
s= "{'notename':" + this.noteName + ", 'status':" + this.status + ", 'data1':" + this.data1 + ", 'data2':" + this.data2 + "}";
}
//console.log(s);
return s;
}
}
return _constructor;
})();
midiBridge.getNoteName = function(noteNumber, mode) {
var octave = Math.floor(((noteNumber) / 12) - 1);
var noteName = noteNames[mode][noteNumber % 12];
return noteName + "" + octave;
};
midiBridge.getNoteNumber = function(noteName, octave) {
var index = -1;
noteName = noteName.toUpperCase();
for(var key in noteNames) {
var modus = noteNames[key];
for(var i = 0, max = modus.length; i < max; i++) {
if(modus[i] === noteName) {
index = i;
break;
}
}
}
if(index === -1) {
return "invalid note name";
}
noteNumber = (12 + index) + (octave * 12);
return noteNumber;
}
midiBridge.getStatus = function($statusCode) {
return status[$statusCode];
};
midiBridge.getNiceTime = function(microseconds)
{
//console.log(microseconds);
var r = "";
var t = (microseconds / 1000 / 1000) >> 0;
var h = (t / (60 * 60)) >> 0;
var m = ((t % (60 * 60)) / 60) >> 0;
var s = t % (60);
var ms = (((microseconds /1000) - (h * 3600000) - (m * 60000) - (s * 1000)) + 0.5) >> 0;
//console.log(t,h,m,s,ms);
r += h > 0 ? h + ":" : "";
r += h > 0 ? m < 10 ? "0" + m : m : m;
r += ":";
r += s < 10 ? "0" + s : s;
r += ":";
r += ms == 0 ? "000" : ms < 10 ? "00" + ms : ms < 100 ? "0" + ms : ms;
return r;
}
function getApplet() {
try {
applet = midiBridge.getObject("midibridge-applet");
} catch(e) {
//console.log(e)
//Firefox needs more time to initialize the Applet
setTimeout(getApplet, 25);
return;
}
}
midiBridge.getObject = function(objectName) {
var ua = navigator.userAgent.toLowerCase();
//console.log(ua);
if(ua.indexOf("msie") !== -1 || ua.indexOf("webkit") !== -1) {
return window[objectName];
} else {
return document[objectName];
}
}
//add addEventListener to IE8
if(!window.addEventListener) {
window.addEventListener = function($id, $callback, $bubble) {
window.attachEvent('onload', $callback);
}
}
window.midiBridge = midiBridge;
})(window); |
/* @flow */
/**
* describe
*/
describe('desc', () => {});
// $FlowExpectedError[incompatible-call] number. This type is incompatible with function type.
describe('desc', 12);
// $FlowExpectedError[incompatible-call] number. This type is incompatible with undefined.
describe('desc', () => 1);
// $FlowExpectedError[incompatible-call] number. This type is incompatible with string.
describe(12, () => {});
/**
* describe.skip
*/
describe.skip('desc', () => {});
// $FlowExpectedError[incompatible-call] number. This type is incompatible with function type.
describe.skip('desc', 12);
// $FlowExpectedError[incompatible-call] number. This type is incompatible with undefined.
describe.skip('desc', () => 1);
// $FlowExpectedError[incompatible-call] number. This type is incompatible with string.
describe.skip(12, () => {});
/**
* describe.only
*/
describe.only('desc', () => {});
// $FlowExpectedError[incompatible-call] number. This type is incompatible with function type.
describe.only('desc', 12);
// $FlowExpectedError[incompatible-call] number. This type is incompatible with undefined.
describe.only('desc', () => 1);
// $FlowExpectedError[incompatible-call] number. This type is incompatible with string.
describe.only(12, () => {});
/**
* describe.timeout
*/
describe.timeout(1000);
// $FlowExpectedError[incompatible-call] string. This type is incompatible with number.
describe.timeout('1000');
|
import React from 'react'
import { Header, Icon } from 'semantic-ui-react'
const HeaderExampleSettingsIcon = () => (
<Header as='h2'>
<Icon name='settings' />
<Header.Content>
Account Settings
<Header.Subheader>
Manage your preferences
</Header.Subheader>
</Header.Content>
</Header>
)
export default HeaderExampleSettingsIcon
|
$(function()
{
$('#maps_vector_tabs a[data-toggle="tab"]').on('shown.bs.tab', function (e)
{
if ($(this).attr('data-init'))
return;
$(this).attr('data-init', 1);
switch ($(this).attr('href'))
{
case '#tab1':
initWorldMapGDP();
break;
case '#tab2':
initWorldMapMarkers();
break;
case '#tab3':
initUSAUnemployment();
break;
case '#tab4':
initRegionSelection();
break;
case '#tab5':
initFranceElections();
break;
case '#tab6':
initRandomColors();
break;
case '#tab7':
initMallMap();
break;
case '#tab8':
initProjectionMap();
break;
}
});
$(window).on('load', function(){
setTimeout(function(){
initWorldMapMarkers();
}, 100);
});
}); |
import { DivMode } from "../../../../Enums/Modes/DivMode";
export class DivEvent {
constructor() {
this.elementId = "repulse-div";
this.enable = false;
this.mode = DivMode.repulse;
}
get el() {
return this.elementId;
}
set el(value) {
this.elementId = value;
}
load(data) {
if (data !== undefined) {
if (data.elementId !== undefined) {
this.elementId = data.elementId;
}
else if (data.el !== undefined) {
this.el = data.el;
}
if (data.enable !== undefined) {
this.enable = data.enable;
}
if (data.mode !== undefined) {
this.mode = data.mode;
}
}
}
}
//# sourceMappingURL=DivEvent.js.map |
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _jsxRuntime = require("../../lib/jsxRuntime");
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _classNames = require("../../lib/classNames");
var _getClassName = require("../../helpers/getClassName");
var _usePlatform = require("../../hooks/usePlatform");
var _withAdaptivity = require("../../hoc/withAdaptivity");
var _excluded = ["children", "size", "sizeX"];
var CardGrid = function CardGrid(_ref) {
var children = _ref.children,
size = _ref.size,
sizeX = _ref.sizeX,
restProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
var platform = (0, _usePlatform.usePlatform)();
return (0, _jsxRuntime.createScopedElement)("div", (0, _extends2.default)({}, restProps, {
vkuiClass: (0, _classNames.classNames)((0, _getClassName.getClassName)("CardGrid", platform), "CardGrid--".concat(size), "CardGrid--sizeX-".concat(sizeX))
}), children);
};
CardGrid.defaultProps = {
size: "s"
}; // eslint-disable-next-line import/no-default-export
var _default = (0, _withAdaptivity.withAdaptivity)(CardGrid, {
sizeX: true
});
exports.default = _default;
//# sourceMappingURL=CardGrid.js.map |
/*
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'a11yhelp', 'it',
{
accessibilityHelp :
{
title : 'Istruzioni di Accessibilità',
contents : 'Contenuti di Aiuto. Per chiudere questa finestra premi ESC.',
legend :
[
{
name : 'Generale',
items :
[
{
name : 'Barra degli strumenti Editor',
legend:
'Premi ${toolbarFocus} per navigare fino alla barra degli strumenti. Muoviti tra i gruppi della barra degli strumenti con i tasti Tab e Maiusc-Tab. Spostati tra il successivo ed il precedente pulsante della barra degli strumenti usando le frecce direzionali Destra e Sinistra. Premi Spazio o Invio per attivare il pulsante della barra degli strumenti.'
},
{
name : 'Finestra Editor',
legend :
'All\'interno di una finestra di dialogo, premi Tab per navigare fino al campo successivo della finestra di dialogo, premi Maiusc-Tab per tornare al campo precedente, premi Invio per inviare la finestra di dialogo, premi Esc per uscire. Per le finestre che hanno schede multiple, premi Alt+F10 per navigare nella lista delle schede. Quindi spostati alla scheda successiva con il tasto Tab oppure con la Freccia Destra. Torna alla scheda precedente con Maiusc+Tab oppure con la Freccia Sinistra. Premi Spazio o Invio per scegliere la scheda.'
},
{
name : 'Menù contestuale Editor',
legend :
'Premi ${contextMenu} o TASTO APPLICAZIONE per aprire il menu contestuale. Dunque muoviti all\'opzione successiva del menu con il tasto TAB o con la Freccia Sotto. Muoviti all\'opzione precedente con MAIUSC+TAB o con Freccia Sopra. Premi SPAZIO o INVIO per scegliere l\'opzione di menu. Apri il sottomenu dell\'opzione corrente con SPAZIO o INVIO oppure con la Freccia Destra. Torna indietro al menu superiore con ESC oppure Freccia Sinistra. Chiudi il menu contestuale con ESC.'
},
{
name : 'Box Lista Editor',
legend :
'Dentro un box-lista, muoviti al prossimo elemento della lista con TAB o con la Freccia direzionale giù. Spostati all\'elemento precedente con MAIUSC+TAB oppure con Freccia direzionale sopra. Premi SPAZIO o INVIO per scegliere l\'opzione della lista. Premi ESC per chiudere il box-lista.'
},
{
name : 'Barra percorso elementi editor',
legend :
'Premi ${elementsPathFocus} per navigare tra gli elementi della barra percorso. Muoviti al prossimo pulsante di elemento con TAB o la Freccia direzionale destra. Muoviti al pulsante precedente con MAIUSC+TAB o la Freccia Direzionale Sinistra. Premi SPAZIO o INVIO per scegliere l\'elemento nell\'editor.'
}
]
},
{
name : 'Comandi',
items :
[
{
name : ' Annulla comando',
legend : 'Premi ${undo}'
},
{
name : ' Ripeti comando',
legend : 'Premi ${redo}'
},
{
name : ' Comando Grassetto',
legend : 'Premi ${bold}'
},
{
name : ' Comando Corsivo',
legend : 'Premi ${italic}'
},
{
name : ' Comando Sottolineato',
legend : 'Premi ${underline}'
},
{
name : ' Comando Link',
legend : 'Premi ${link}'
},
{
name : ' Comando riduci barra degli strumenti',
legend : 'Premi ${toolbarCollapse}'
},
{
name : ' Aiuto Accessibilità',
legend : 'Premi ${a11yHelp}'
}
]
}
]
}
});
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var React=_interopRequireWildcard(require("react"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(_getRequireWildcardCache=function(e){return e?r:t})(e)}function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};t=_getRequireWildcardCache(t);if(t&&t.has(e))return t.get(e);var r,o,n={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&((o=c?Object.getOwnPropertyDescriptor(e,r):null)&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]);return n.default=e,t&&t.set(e,n),n}const AccordionContext=React.createContext({});"production"!==process.env.NODE_ENV&&(AccordionContext.displayName="AccordionContext");var _default=AccordionContext;exports.default=_default; |
define("JBrowse/Store/SeqFeature/GFF3Tabix", [
'dojo/_base/declare',
'dojo/_base/lang',
'dojo/_base/array',
'dojo/Deferred',
'JBrowse/Model/SimpleFeature',
'JBrowse/Store/SeqFeature',
'JBrowse/Store/DeferredStatsMixin',
'JBrowse/Store/DeferredFeaturesMixin',
'JBrowse/Store/TabixIndexedFile',
'JBrowse/Store/SeqFeature/GlobalStatsEstimationMixin',
'JBrowse/Model/XHRBlob',
'JBrowse/Store/SeqFeature/GFF3/Parser',
'JBrowse/Util/GFF3'
],
function(
declare,
lang,
array,
Deferred,
SimpleFeature,
SeqFeatureStore,
DeferredStatsMixin,
DeferredFeaturesMixin,
TabixIndexedFile,
GlobalStatsEstimationMixin,
XHRBlob,
Parser,
GFF3
) {
return declare( [ SeqFeatureStore, DeferredStatsMixin, DeferredFeaturesMixin, GlobalStatsEstimationMixin ],
{
constructor: function( args ) {
var thisB = this;
var tbiBlob = args.tbi ||
new XHRBlob(
this.resolveUrl(
this.getConf('tbiUrlTemplate',[]) || this.getConf('urlTemplate',[])+'.tbi'
)
);
var fileBlob = args.file ||
new XHRBlob(
this.resolveUrl( this.getConf('urlTemplate',[]) )
);
this.indexedData = new TabixIndexedFile(
{
tbi: tbiBlob,
file: fileBlob,
browser: this.browser,
chunkSizeLimit: args.chunkSizeLimit || 1000000
});
this.getHeader()
.then( function( header ) {
thisB._deferred.features.resolve({success:true});
thisB._estimateGlobalStats()
.then(
function( stats ) {
thisB.globalStats = stats;
thisB._deferred.stats.resolve( stats );
},
lang.hitch( thisB, '_failAllDeferred' )
);
},
lang.hitch( thisB, '_failAllDeferred' )
);
},
getHeader: function() {
var thisB = this;
return this._parsedHeader || ( this._parsedHeader = function() {
var d = new Deferred();
var reject = lang.hitch( d, 'reject' );
thisB.indexedData.indexLoaded.then( function() {
var maxFetch = thisB.indexedData.index.firstDataLine
? thisB.indexedData.index.firstDataLine.block + thisB.indexedData.data.blockSize - 1
: null;
thisB.indexedData.data.read(
0,
maxFetch,
function( bytes ) {
d.resolve( thisB.header );
},
reject
);
},
reject
);
return d;
}.call(this));
},
_getFeatures: function( query, featureCallback, finishedCallback, errorCallback ) {
var thisB = this;
var f=featureCallback;
var parser = new Parser(
{
featureCallback: function(fs) {
array.forEach( fs, function( feature ) {
var feat = thisB._formatFeature(feature);
f(feat);
});
},
endCallback: function() {
finishedCallback();
}
});
thisB.getHeader().then( function() {
thisB.indexedData.getLines(
query.ref || thisB.refSeq.name,
query.start,
query.end,
function( line ) {
parser._buffer_feature( thisB.lineToFeature(line) );
},
function() {
parser.finish();
},
errorCallback
);
}, errorCallback );
},
lineToFeature: function( line ) {
var attributes = GFF3.parse_attributes( line.fields[8] );
var ref = line.fields[0];
var source = line.fields[1];
var type = line.fields[2];
var strand = {'-':-1,'.':0,'+':1}[line.fields[6]];
var remove_id;
if( !attributes.ID ) {
attributes.ID = [line.fields.join('/')];
remove_id = true;
}
var featureData = {
start: line.start,
end: line.end,
strand: strand,
child_features: [],
seq_id: line.ref,
attributes: attributes,
type: type,
source: source,
remove_id: remove_id
};
return featureData;
},
// flatten array like [ [1,2], [3,4] ] to [ 1,2,3,4 ]
_flattenOneLevel: function( ar ) {
var r = [];
for( var i = 0; i<ar.length; i++ ) {
r.push.apply( r, ar[i] );
}
return r;
},
_featureData: function( data ) {
var f = lang.mixin( {}, data );
delete f.child_features;
delete f.data;
delete f.derived_features;
f.start -= 1; // convert to interbase
for( var a in data.attributes ) {
f[ a.toLowerCase() ] = data.attributes[a].join(',');
}
if(f.remove_id) {
delete f.remove_id;
delete f.id;
}
delete f.attributes;
var sub = array.map( this._flattenOneLevel( data.child_features ), this._featureData, this );
if( sub.length )
f.subfeatures = sub;
return f;
},
_formatFeature: function( data ) {
var f = new SimpleFeature({
data: this._featureData( data ),
id: (data.attributes.ID||[])[0]
});
f._reg_seq_id = this.browser.regularizeReferenceName( data.seq_id );
return f;
},
/**
* Interrogate whether a store has data for a given reference
* sequence. Calls the given callback with either true or false.
*
* Implemented as a binary interrogation because some stores are
* smart enough to regularize reference sequence names, while
* others are not.
*/
hasRefSeq: function( seqName, callback, errorCallback ) {
return this.indexedData.index.hasRefSeq( seqName, callback, errorCallback );
},
saveStore: function() {
return {
urlTemplate: this.config.file.url,
tbiUrlTemplate: this.config.tbi.url
};
}
});
});
|
module.exports={A:{A:{"1":"E B A","2":"J C G UB"},B:{"1":"D X g H L"},C:{"1":"0 2 4 F I J C G E B A D X g H L M N O P Q R S T U V W u Y Z a b c d e f K h i j k l m n o p q r w x v z t s","2":"1 SB QB","36":"PB"},D:{"1":"0 2 4 8 H L M N O P Q R S T U V W u Y Z a b c d e f K h i j k l m n o p q r w x v z t s EB AB TB BB CB","516":"F I J C G E B A D X g"},E:{"1":"C G E B A HB IB JB KB","772":"7 F I J DB FB GB"},F:{"1":"5 6 A D H L M N O P Q R S T U V W u Y Z a b c d e f K h i j k l m n o p q r NB OB RB y","2":"E LB","36":"MB"},G:{"1":"G A XB YB ZB aB bB cB","4":"3 7 9 WB","516":"VB"},H:{"132":"dB"},I:{"1":"s iB jB","36":"eB","516":"1 3 F hB","548":"fB gB"},J:{"1":"C B"},K:{"1":"5 6 B A D K y"},L:{"1":"8"},M:{"1":"t"},N:{"1":"B A"},O:{"1":"kB"},P:{"1":"F I"},Q:{"1":"lB"},R:{"1":"mB"}},B:4,C:"CSS3 Background-image options"};
|
/**
* @license
* Copyright 2016 Palantir Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
"use strict";
/* tslint:disable:object-literal-key-quotes */
exports.rules = {
"adjacent-overload-signatures": true,
"align": [true,
"parameters",
"statements",
],
"array-type": [true, "array-simple"],
"arrow-parens": true,
"class-name": true,
"comment-format": [true,
"check-space",
],
"curly": true,
"cyclomatic-complexity": false,
"eofline": true,
"forin": true,
"indent": [true, "spaces"],
"interface-name": [true, "always-prefix"],
"jsdoc-format": true,
"label-position": true,
"max-classes-per-file": [true, 1],
"max-line-length": [true, 120],
"member-access": true,
"member-ordering": [true, {
"order": "statics-first",
}],
"new-parens": true,
"no-any": false,
"no-arg": true,
"no-bitwise": true,
"no-conditional-assignment": true,
"no-consecutive-blank-lines": true,
"no-console": [true,
"debug",
"info",
"log",
"time",
"timeEnd",
"trace",
],
"no-construct": true,
"no-debugger": true,
"no-empty": true,
"no-eval": true,
"no-internal-module": true,
"no-namespace": true,
"no-parameter-properties": false,
"no-reference": true,
"no-shadowed-variable": true,
"no-string-literal": true,
"no-switch-case-fall-through": false,
"no-trailing-whitespace": true,
"no-unsafe-finally": true,
"no-unused-expression": true,
"no-unused-new": true,
// disable this rule as it is very heavy performance-wise and not that useful
"no-use-before-declare": false,
"no-var-keyword": true,
"no-var-requires": true,
"object-literal-key-quotes": [true, "consistent-as-needed"],
"object-literal-shorthand": true,
"object-literal-sort-keys": true,
"one-line": [true,
"check-catch",
"check-else",
"check-finally",
"check-open-brace",
"check-whitespace",
],
"one-variable-per-declaration": [true,
"ignore-for-loop",
],
"only-arrow-functions": [true, "allow-declarations"],
"ordered-imports": [true, {
"import-sources-order": "case-insensitive",
"named-imports-order": "case-insensitive",
}],
"prefer-for-of": true,
"quotemark": [true, "double", "avoid-escape"],
"radix": true,
"semicolon": [true, "always"],
"switch-default": true,
"trailing-comma": [true, {
"multiline": "always",
"singleline": "never",
}],
"triple-equals": [true, "allow-null-check"],
"typedef": false,
"typedef-whitespace": [true, {
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace",
}, {
"call-signature": "onespace",
"index-signature": "onespace",
"parameter": "onespace",
"property-declaration": "onespace",
"variable-declaration": "onespace",
}],
"use-isnan": true,
"variable-name": [true,
"ban-keywords",
"check-format",
"allow-pascal-case",
],
"whitespace": [true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type",
"check-typecast",
],
};
exports.jsRules = {
"align": [true,
"parameters",
"statements",
],
"class-name": true,
"curly": true,
"eofline": true,
"forin": true,
"indent": [true, "spaces"],
"jsdoc-format": true,
"label-position": true,
"max-line-length": [true, 120],
"new-parens": true,
"no-arg": true,
"no-bitwise": true,
"no-conditional-assignment": true,
"no-consecutive-blank-lines": true,
"no-console": [true,
"debug",
"info",
"log",
"time",
"timeEnd",
"trace",
],
"no-construct": true,
"no-debugger": true,
"no-duplicate-variable": true,
"no-empty": true,
"no-eval": true,
"no-reference": true,
"no-shadowed-variable": true,
"no-string-literal": true,
"no-switch-case-fall-through": false,
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-unused-new": true,
// disable this rule as it is very heavy performance-wise and not that useful
"no-use-before-declare": false,
"object-literal-sort-keys": true,
"one-line": [true,
"check-catch",
"check-else",
"check-finally",
"check-open-brace",
"check-whitespace",
],
"one-variable-per-declaration": [true,
"ignore-for-loop",
],
"quotemark": [true, "double", "avoid-escape"],
"radix": true,
"semicolon": [true, "always"],
"switch-default": true,
"trailing-comma": [true, {
"multiline": "always",
"singleline": "never",
}],
"triple-equals": [true, "allow-null-check"],
"use-isnan": true,
"variable-name": [true,
"ban-keywords",
"check-format",
"allow-pascal-case",
],
"whitespace": [true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type",
"check-typecast",
],
};
/* tslint:enable:object-literal-key-quotes */
|
/* flatpickr v4.4.5, @license MIT */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.mk = {})));
}(this, (function (exports) { 'use strict';
var fp = typeof window !== "undefined" && window.flatpickr !== undefined ? window.flatpickr : {
l10ns: {}
};
var Macedonian = {
weekdays: {
shorthand: ["Не", "По", "Вт", "Ср", "Че", "Пе", "Са"],
longhand: ["Недела", "Понеделник", "Вторник", "Среда", "Четврток", "Петок", "Сабота"]
},
months: {
shorthand: ["Јан", "Фев", "Мар", "Апр", "Мај", "Јун", "Јул", "Авг", "Сеп", "Окт", "Ное", "Дек"],
longhand: ["Јануари", "Февруари", "Март", "Април", "Мај", "Јуни", "Јули", "Август", "Септември", "Октомври", "Ноември", "Декември"]
},
firstDayOfWeek: 1,
weekAbbreviation: "Нед.",
rangeSeparator: " до "
};
fp.l10ns.mk = Macedonian;
var mk = fp.l10ns;
exports.Macedonian = Macedonian;
exports.default = mk;
Object.defineProperty(exports, '__esModule', { value: true });
})));
|
/**
* @author Andrei Kashcha (aka anvaka) / https://github.com/anvaka
*/
module.exports = webglInputManager;
var createInputEvents = require('../WebGL/webglInputEvents.js');
function webglInputManager(graph, graphics) {
var inputEvents = createInputEvents(graphics),
draggedNode = null,
internalHandlers = {},
pos = {x : 0, y : 0};
inputEvents.mouseDown(function (node, e) {
draggedNode = node;
pos.x = e.clientX;
pos.y = e.clientY;
inputEvents.mouseCapture(draggedNode);
var handlers = internalHandlers[node.id];
if (handlers && handlers.onStart) {
handlers.onStart(e, pos);
}
return true;
}).mouseUp(function (node) {
inputEvents.releaseMouseCapture(draggedNode);
draggedNode = null;
var handlers = internalHandlers[node.id];
if (handlers && handlers.onStop) {
handlers.onStop();
}
return true;
}).mouseMove(function (node, e) {
if (draggedNode) {
var handlers = internalHandlers[draggedNode.id];
if (handlers && handlers.onDrag) {
handlers.onDrag(e, {x : e.clientX - pos.x, y : e.clientY - pos.y });
}
pos.x = e.clientX;
pos.y = e.clientY;
return true;
}
});
return {
/**
* Called by renderer to listen to drag-n-drop events from node. E.g. for SVG
* graphics we may listen to DOM events, whereas for WebGL we graphics
* should provide custom eventing mechanism.
*
* @param node - to be monitored.
* @param handlers - object with set of three callbacks:
* onStart: function(),
* onDrag: function(e, offset),
* onStop: function()
*/
bindDragNDrop : function (node, handlers) {
internalHandlers[node.id] = handlers;
if (!handlers) {
delete internalHandlers[node.id];
}
}
};
}
|
angular.module('myApp.home', []);
(function () {
'use strict';
angular.module('myApp.home')
.controller('HomeController', [homeController]);
function homeController() {
var vm = this;
}
})();
|
/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'list', 'fo', {
bulletedlist: 'Punktmerktur listi',
numberedlist: 'Talmerktur listi'
});
|
(function(f, define){
define([ "./kendo.mobile.view", "./kendo.mobile.loader" ], f);
})(function(){
var __meta__ = {
id: "mobile.pane",
name: "Pane",
category: "mobile",
description: "Mobile Pane",
depends: [ "mobile.view", "mobile.loader" ],
hidden: true
};
(function($, undefined) {
var kendo = window.kendo,
mobile = kendo.mobile,
roleSelector = kendo.roleSelector,
ui = mobile.ui,
Widget = ui.Widget,
ViewEngine = mobile.ViewEngine,
View = ui.View,
Loader = mobile.ui.Loader,
EXTERNAL = "external",
HREF = "href",
DUMMY_HREF = "#!",
NAVIGATE = "navigate",
VIEW_SHOW = "viewShow",
SAME_VIEW_REQUESTED = "sameViewRequested",
OS = kendo.support.mobileOS,
SKIP_TRANSITION_ON_BACK_BUTTON = OS.ios && !OS.appMode && OS.flatVersion >= 700,
WIDGET_RELS = /popover|actionsheet|modalview|drawer/,
BACK = "#:back",
attrValue = kendo.attrValue,
// navigation element roles
buttonRoles = "button backbutton detailbutton listview-link",
linkRoles = "tab";
var Pane = Widget.extend({
init: function(element, options) {
var that = this;
Widget.fn.init.call(that, element, options);
options = that.options;
element = that.element;
element.addClass("km-pane");
if (that.options.collapsible) {
element.addClass("km-collapsible-pane");
}
this.history = [];
this.historyCallback = function(url, params, backButtonPressed) {
var transition = that.transition;
that.transition = null;
// swiping back in iOS leaves the app in a very broken state if we perform a transition
if (SKIP_TRANSITION_ON_BACK_BUTTON && backButtonPressed) {
transition = "none";
}
return that.viewEngine.showView(url, transition, params);
};
this._historyNavigate = function(url) {
if (url === BACK) {
if (that.history.length === 1) {
return;
}
that.history.pop();
url = that.history[that.history.length - 1];
} else {
that.history.push(url);
}
that.historyCallback(url, kendo.parseQueryStringParams(url));
};
this._historyReplace = function(url) {
var params = kendo.parseQueryStringParams(url);
that.history[that.history.length - 1] = url;
that.historyCallback(url, params);
};
that.loader = new Loader(element, {
loading: that.options.loading
});
that.viewEngine = new ViewEngine({
container: element,
transition: options.transition,
modelScope: options.modelScope,
rootNeeded: !options.initial,
serverNavigation: options.serverNavigation,
remoteViewURLPrefix: options.root || "",
layout: options.layout,
loader: that.loader
});
that.viewEngine.bind("showStart", function() {
that.loader.transition();
that.closeActiveDialogs();
});
that.viewEngine.bind("after", function(e) {
that.loader.transitionDone();
});
that.viewEngine.bind(VIEW_SHOW, function(e) {
that.trigger(VIEW_SHOW, e);
});
that.viewEngine.bind("loadStart", function() {
that.loader.show();
});
that.viewEngine.bind("loadComplete", function() {
that.loader.hide();
});
that.viewEngine.bind(SAME_VIEW_REQUESTED, function() {
that.trigger(SAME_VIEW_REQUESTED);
});
that.viewEngine.bind("viewTypeDetermined", function(e) {
if (!e.remote || !that.options.serverNavigation) {
that.trigger(NAVIGATE, { url: e.url });
}
});
this._setPortraitWidth();
kendo.onResize(function() {
that._setPortraitWidth();
});
that._setupAppLinks();
},
closeActiveDialogs: function() {
var dialogs = this.element.find(roleSelector("actionsheet popover modalview")).filter(":visible");
dialogs.each(function() {
kendo.widgetInstance($(this), ui).close();
});
},
navigateToInitial: function() {
var initial = this.options.initial;
if (initial) {
this.navigate(initial);
}
},
options: {
name: "Pane",
portraitWidth: "",
transition: "",
layout: "",
collapsible: false,
initial: null,
modelScope: window,
loading: "<h1>Loading...</h1>"
},
events: [
NAVIGATE,
VIEW_SHOW,
SAME_VIEW_REQUESTED
],
append: function(html) {
return this.viewEngine.append(html);
},
destroy: function() {
Widget.fn.destroy.call(this);
this.viewEngine.destroy();
this.userEvents.destroy();
},
navigate: function(url, transition) {
if (url instanceof View) {
url = url.id;
}
this.transition = transition;
this._historyNavigate(url);
},
replace: function(url, transition) {
if (url instanceof View) {
url = url.id;
}
this.transition = transition;
this._historyReplace(url);
},
bindToRouter: function(router) {
var that = this,
options = that.options,
initial = options.initial,
viewEngine = this.viewEngine;
router.bind("init", function(e) {
var url = e.url,
attrUrl = router.pushState ? url : "/";
viewEngine.rootView.attr(kendo.attr("url"), attrUrl);
if (url === "/" && initial) {
router.navigate(initial, true);
e.preventDefault(); // prevents from executing routeMissing, by default
}
});
router.bind("routeMissing", function(e) {
if (!that.historyCallback(e.url, e.params, e.backButtonPressed)) {
e.preventDefault();
}
});
router.bind("same", function() {
that.trigger(SAME_VIEW_REQUESTED);
});
that._historyNavigate = function(url) {
router.navigate(url);
};
that._historyReplace = function(url) {
router.replace(url);
};
},
hideLoading: function() {
this.loader.hide();
},
showLoading: function() {
this.loader.show();
},
changeLoadingMessage: function(message) {
this.loader.changeMessage(message);
},
view: function() {
return this.viewEngine.view();
},
_setPortraitWidth: function() {
var width,
portraitWidth = this.options.portraitWidth;
if (portraitWidth) {
width = kendo.mobile.application.element.is(".km-vertical") ? portraitWidth : "auto";
this.element.css("width", width);
}
},
_setupAppLinks: function() {
var that = this;
this.element.handler(this)
.on("down", roleSelector(linkRoles), "_mouseup")
.on("click", roleSelector(linkRoles + " " + buttonRoles), "_appLinkClick");
this.userEvents = new kendo.UserEvents(this.element, {
filter: roleSelector(buttonRoles),
tap: function(e) {
e.event.currentTarget = e.touch.currentTarget;
that._mouseup(e.event);
}
});
},
_appLinkClick: function (e) {
var href = $(e.currentTarget).attr("href");
var remote = href && href[0] !== "#" && this.options.serverNavigation;
if(!remote && attrValue($(e.currentTarget), "rel") != EXTERNAL) {
e.preventDefault();
}
},
_mouseup: function(e) {
if (e.which > 1 || e.isDefaultPrevented()) {
return;
}
var pane = this,
link = $(e.currentTarget),
transition = attrValue(link, "transition"),
rel = attrValue(link, "rel") || "",
target = attrValue(link, "target"),
href = link.attr(HREF),
delayedTouchEnd = SKIP_TRANSITION_ON_BACK_BUTTON && link[0].offsetHeight === 0,
remote = href && href[0] !== "#" && this.options.serverNavigation;
if (delayedTouchEnd || remote || rel === EXTERNAL || (typeof href === "undefined") || href === DUMMY_HREF) {
return;
}
// Prevent iOS address bar progress display for in app navigation
link.attr(HREF, DUMMY_HREF);
setTimeout(function() { link.attr(HREF, href); });
if (rel.match(WIDGET_RELS)) {
kendo.widgetInstance($(href), ui).openFor(link);
// if propagation is not stopped and actionsheet is opened from tabstrip,
// the actionsheet is closed immediately.
if (rel === "actionsheet" || rel === "drawer") {
e.stopPropagation();
}
} else {
if (target === "_top") {
pane = mobile.application.pane;
}
else if (target) {
pane = $("#" + target).data("kendoMobilePane");
}
pane.navigate(href, transition);
}
e.preventDefault();
}
});
Pane.wrap = function(element) {
if (!element.is(roleSelector("view"))) {
element = element.wrap('<div data-' + kendo.ns + 'role="view" data-stretch="true"></div>').parent();
}
var paneContainer = element.wrap('<div class="km-pane-wrapper"><div></div></div>').parent(),
pane = new Pane(paneContainer);
pane.navigate("");
return pane;
};
ui.plugin(Pane);
})(window.kendo.jQuery);
return window.kendo;
}, typeof define == 'function' && define.amd ? define : function(_, f){ f(); });
|
var InfiniteComputer = require('./infinite_computer.js');
for(var InfiniteComputer____Key in InfiniteComputer){if(InfiniteComputer.hasOwnProperty(InfiniteComputer____Key)){ConstantInfiniteComputer[InfiniteComputer____Key]=InfiniteComputer[InfiniteComputer____Key];}}var ____SuperProtoOfInfiniteComputer=InfiniteComputer===null?null:InfiniteComputer.prototype;ConstantInfiniteComputer.prototype=Object.create(____SuperProtoOfInfiniteComputer);ConstantInfiniteComputer.prototype.constructor=ConstantInfiniteComputer;ConstantInfiniteComputer.__superConstructor__=InfiniteComputer;function ConstantInfiniteComputer(){"use strict";if(InfiniteComputer!==null){InfiniteComputer.apply(this,arguments);}}
Object.defineProperty(ConstantInfiniteComputer.prototype,"getTotalScrollableHeight",{writable:true,configurable:true,value:function() {"use strict";
return this.heightData * this.numberOfChildren;
}});
Object.defineProperty(ConstantInfiniteComputer.prototype,"getDisplayIndexStart",{writable:true,configurable:true,value:function(windowTop) {"use strict";
return Math.floor(windowTop / this.heightData);
}});
Object.defineProperty(ConstantInfiniteComputer.prototype,"getDisplayIndexEnd",{writable:true,configurable:true,value:function(windowBottom) {"use strict";
var nonZeroIndex = Math.ceil(windowBottom / this.heightData);
if (nonZeroIndex > 0) {
return nonZeroIndex - 1;
}
return nonZeroIndex;
}});
Object.defineProperty(ConstantInfiniteComputer.prototype,"getTopSpacerHeight",{writable:true,configurable:true,value:function(displayIndexStart) {"use strict";
return displayIndexStart * this.heightData;
}});
Object.defineProperty(ConstantInfiniteComputer.prototype,"getBottomSpacerHeight",{writable:true,configurable:true,value:function(displayIndexEnd) {"use strict";
var nonZeroIndex = displayIndexEnd + 1;
return Math.max(0, (this.numberOfChildren - nonZeroIndex) * this.heightData);
}});
module.exports = ConstantInfiniteComputer;
|
define([
"intern!tdd",
"intern/chai!assert",
"dojo/_base/declare",
"dojo/query",
"dgrid/Grid",
"dgrid/ColumnSet",
"dgrid/test/data/base"
], function(test, assert, declare, query, Grid, ColumnSet){
var grid;
function runClassNameTests(){
var domNode = grid.domNode,
node;
assert.strictEqual(query(".dgrid-cell.field-order", domNode).length, 10,
"Each row (including header) should contain a cell with the field-order class");
assert.strictEqual(query(".dgrid-cell.field-name", domNode).length, 10,
"Each row (including header) should contain a cell with the field-name class");
assert.strictEqual(query(".dgrid-cell.field-description", domNode).length, 10,
"Each row (including header) should contain a cell with the field-description class");
assert.strictEqual(query(".dgrid-cell.field-name.name-column.main-column", domNode).length, 10,
"Each row's (including header's) field-name cell should also have the name-column and main-column classes");
assert.strictEqual(query(".dgrid-cell.field-description.desc-row", domNode).length, 9,
"Each body row's description cell should also have the desc-row class");
node = query(".dgrid-header .dgrid-cell.field-description", domNode)[0];
assert.strictEqual(node.className.indexOf("undefined"), -1,
"Header row's description cell should NOT contain 'undefined' due to className returning ''");
assert.isTrue(query(".dgrid-content .dgrid-cell.field-description", domNode).every(function(cell){
return (/desc-\w+ desc-row/).test(cell.className);
}),
"Each body row's description cell has two desc-* classes (one being desc-row)");
}
test.suite("columns", function(){
test.afterEach(function(){
grid.destroy();
});
test.test("className property", function(){
grid = new Grid({
columns: {
order: "Order",
name: {
label: "Name",
className: "name-column main-column"
},
description: {
label: "Description",
className: function(object){
return object ?
"desc-" + object.name.replace(/ /g, "") + " desc-row" :
"";
}
}
}
});
document.body.appendChild(grid.domNode);
grid.startup();
grid.renderArray(testOrderedData);
runClassNameTests();
});
});
test.suite("columnSets", function(){
test.afterEach(function(){
grid.destroy();
});
test.test("className property", function(){
grid = new (declare([Grid, ColumnSet]))({
columnSets: [
[[
{ field: "order", label: "Order" },
{
field: "name",
label: "Name",
className: "name-column main-column"
}
]], [[
{
field: "description",
label: "Description",
className: function(object){
return object ?
"desc-" + object.name.replace(/ /g, "") + " desc-row" :
"";
}
}
]]
]
});
document.body.appendChild(grid.domNode);
grid.startup();
grid.renderArray(testOrderedData);
runClassNameTests();
});
});
}); |
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(d,l,p){d!=Array.prototype&&d!=Object.prototype&&(d[l]=p.value)};$jscomp.getGlobal=function(d){return"undefined"!=typeof window&&window===d?d:"undefined"!=typeof global&&null!=global?global:d};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";
$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(d){return $jscomp.SYMBOL_PREFIX+(d||"")+$jscomp.symbolCounter_++};
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var d=$jscomp.global.Symbol.iterator;d||(d=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[d]&&$jscomp.defineProperty(Array.prototype,d,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(d){var l=0;return $jscomp.iteratorPrototype(function(){return l<d.length?{done:!1,value:d[l++]}:{done:!0}})};
$jscomp.iteratorPrototype=function(d){$jscomp.initSymbolIterator();d={next:d};d[$jscomp.global.Symbol.iterator]=function(){return this};return d};$jscomp.iteratorFromArray=function(d,l){$jscomp.initSymbolIterator();d instanceof String&&(d+="");var p=0,m={next:function(){if(p<d.length){var e=p++;return{value:l(e,d[e]),done:!1}}m.next=function(){return{done:!0,value:void 0}};return m.next()}};m[Symbol.iterator]=function(){return m};return m};
$jscomp.polyfill=function(d,l,p,m){if(l){p=$jscomp.global;d=d.split(".");for(m=0;m<d.length-1;m++){var e=d[m];e in p||(p[e]={});p=p[e]}d=d[d.length-1];m=p[d];l=l(m);l!=m&&null!=l&&$jscomp.defineProperty(p,d,{configurable:!0,writable:!0,value:l})}};$jscomp.polyfill("Array.prototype.keys",function(d){return d?d:function(){return $jscomp.iteratorFromArray(this,function(d){return d})}},"es6","es3");
(function(d,l,p){function m(a,b){function f(){}f.prototype=a;a=new f;for(var c in b)a[c]=b[c];b.toString!==Object.prototype.toString&&(a.toString=b.toString);return a}function e(a,b){if(null==b)return null;null==b.__id__&&(b.__id__=K++);var f;null==a.hx__closures__?a.hx__closures__={}:f=a.hx__closures__[b.__id__];null==f&&(f=function(){return f.method.apply(f.scope,arguments)},f.scope=a,f.method=b,a.hx__closures__[b.__id__]=f);return f}var D=function(){this.bufferList=new t;this.types=new t;this.types.set("mp3",
"audio/mpeg");this.types.set("ogg","audio/ogg");this.types.set("wav","audio/wav");this.types.set("aac","audio/aac");this.types.set("m4a","audio/x-m4a")};D.__name__=!0;D.prototype={checkWebAudioAPISupport:function(){return null!=g.field(window,"AudioContext")||null!=g.field(window,"webkitAudioContext")},unlockAudio:function(){if(null!=this.audioContext){var a=this.audioContext.createBuffer(1,1,c.preferredSampleRate),b=this.audioContext.createBufferSource();b.buffer=a;b.connect(this.audioContext.destination);
null!=g.field(b,"start")?b.start(0):b.noteOn(0);null!=b.onended?b.onended=e(this,this._unlockCallback):w.delay(e(this,this._unlockCallback),1);"suspended"==this.audioContext.state&&this.audioContext.resume()}else a=window.document.createElement("audio"),b=window.document.createElement("source"),b.src="data:audio/wave;base64,UklGRjIAAABXQVZFZm10IBIAAAABAAEAQB8AAEAfAAABAAgAAABmYWN0BAAAAAAAAABkYXRhAAAAAA==",a.appendChild(b),window.document.appendChild(a),a.play(),null!=c.__touchUnlockCallback&&c.__touchUnlockCallback(),
c.dom.ontouchend=null},_unlockCallback:function(){null!=c.__touchUnlockCallback&&c.__touchUnlockCallback();c.dom.ontouchend=null},createAudioContext:function(){if(null==this.audioContext)try{null!=g.field(window,"AudioContext")?this.audioContext=new AudioContext:null!=g.field(window,"webkitAudioContext")&&(this.audioContext=new webkitAudioContext),this.masterGainNode=this.createGain()}catch(a){a instanceof u&&(a=a.val),this.audioContext=null}return this.audioContext},createGain:function(){return null!=
this.audioContext.createGain?this.audioContext.createGain():g.callMethod(this.audioContext,g.field(this.audioContext,"createGainNode"),[])},destroy:function(){null!=this.audioContext&&null!=this.audioContext.close&&""!=this.audioContext.close&&this.audioContext.close();this.types=this.bufferList=this.audioContext=null},__class__:D};var v=function(a,b){this._b64=new n("(^data:audio).*(;base64,)","i");null!=a&&""!=a&&null!=c.audioManager&&(this.isSpriteSound=!1,this.url=a,this._muted=this._isPlaying=
this._isLoaded=!1,this._duration=0,this._options=q.setDefaultOptions(b),this.rate=this._options.playbackRate)};v.__name__=!0;v.prototype={isReady:function(){return this._isLoaded},__class__:v};var n=function(a,b){b=b.split("u").join("");this.r=new RegExp(a,b)};n.__name__=!0;n.prototype={match:function(a){this.r.global&&(this.r.lastIndex=0);this.r.m=this.r.exec(a);this.r.s=a;return null!=this.r.m},matched:function(a){if(null!=this.r.m&&0<=a&&a<this.r.m.length)return this.r.m[a];throw new u("EReg::matched");
},__class__:n};var B=function(){};B.__name__=!0;B.prototype={__class__:B};var z=function(a,b,f){v.call(this,a,b);this._snd=c.dom.createElement("audio");null==f?this._addSource(a):this._snd.appendChild(f);this._options.preload&&this.load();this._b64.match(a)};z.__name__=!0;z.__interfaces__=[B];z.__super__=v;z.prototype=m(v.prototype,{load:function(a){var b=this;this._isLoaded||(this._snd.autoplay=this._options.autoplay,this._snd.loop=this._options.loop,this._snd.volume=this._options.volume,this._snd.playbackRate=
this.rate,null!=a&&(this._options.onload=a),this._snd.preload=this._options.preload?"auto":"metadata",null!=this._options.onload&&(this._isLoaded=!0,this._snd.onloadeddata=function(){b._options.onload(b)}),this._snd.onplaying=function(){b._isLoaded=!0;b._isPlaying=!0},this._snd.onended=function(){b._isPlaying=!1;if(null!=b._options.onend)b._options.onend(b)},null!=this._options.onerror&&(this._snd.onerror=function(){b._options.onerror(b)}),this._snd.load());return this},getDuration:function(){return this._isLoaded?
this._duration=this._snd.duration:0},_addSource:function(a){this.source=c.dom.createElement("source");this.source.src=a;var b=this._getExt(a);null!=c.audioManager.types.get(b)&&(a=this._getExt(a),this.source.type=c.audioManager.types.get(a));this._snd.appendChild(this.source);return this.source},_getExt:function(a){return a.split(".").pop()},setVolume:function(a,b){0<=a&&1>=a&&(this._options.volume=a);this._isLoaded&&(this._snd.volume=this._options.volume)},getVolume:function(a){return this._options.volume},
mute:function(a,b){this._isLoaded&&(this._snd.muted=a,q.isiOS()&&(a&&this.isPlaying()?(this._muted=!0,this._snd.pause()):this._muted&&(this._muted=!1,this._snd.play())))},toggleMute:function(a){this.mute(!this._muted)},play:function(a,b){var f=this;this.spriteName=a;if(!this._isLoaded||null==this._snd)return-1;if(this._isPlaying)if(this._options.autostop)this.stop(this.spriteName);else{var k=h.__cast(this._snd.cloneNode(!0),HTMLAudioElement);4==k.readyState?(k.currentTime=0,k.play()):k.oncanplay=
function(){k.currentTime=0;k.play()};k.onended=function(){c.dom.removeChild(k)}}if(this._muted)return-1;this.isSpriteSound&&null!=b&&(this._snd.currentTime=null==this._pauseTime?b.start:this._pauseTime,null!=this._tmr&&this._tmr.stop(),this._tmr=w.delay(function(){null!=b.loop&&b.loop?f.play(f.spriteName,b):f.stop(f.spriteName)},Math.ceil(1E3*b.duration)));4==this._snd.readyState?this._snd.play():this._snd.oncanplay=function(){f._snd.play()};this._pauseTime=null;return 0},togglePlay:function(a){this._isPlaying?
this.pause():this.play()},isPlaying:function(a){return this._isPlaying},loop:function(a){this._isLoaded&&null!=this._snd&&(this._snd.loop=a)},autoStop:function(a){this._options.autostop=a},stop:function(a){this._isLoaded&&null!=this._snd&&(this._snd.currentTime=0,this._snd.pause(),this._isPlaying=!1,null!=this._tmr&&this._tmr.stop())},pause:function(a){this._isLoaded&&null!=this._snd&&(this._snd.pause(),this._pauseTime=this._snd.currentTime,this._isPlaying=!1,null!=this._tmr&&this._tmr.stop())},playbackRate:function(a,
b){return null==a?this.rate:this.rate=this._snd.playbackRate=a},setTime:function(a){!this._isLoaded||null==this._snd||a>this._snd.duration||(this._snd.currentTime=a)},getTime:function(){return null!=this._snd&&this._isLoaded&&this._isPlaying?this._snd.currentTime:0},onEnd:function(a,b){this._options.onend=a;return this},onLoad:function(a){this._options.onload=a;return this},onError:function(a){this._options.onerror=a;return this},destroy:function(){null!=this._snd&&(this._snd.pause(),this._snd.removeChild(this.source),
this._snd=this.source=null);this._isPlaying=!1},__class__:z});var x=function(){};x.__name__=!0;x.cca=function(a,b){a=a.charCodeAt(b);if(a==a)return a};x.indexOf=function(a,b,f){var c=a.length;0>f&&(f+=c,0>f&&(f=0));for(;f<c;){if(a[f]===b)return f;f++}return-1};Math.__name__=!0;var g=function(){};g.__name__=!0;g.field=function(a,b){try{return a[b]}catch(f){return f instanceof u&&(f=f.val),null}};g.callMethod=function(a,b,f){return b.apply(a,f)};g.fields=function(a){var b=[];if(null!=a){var f=Object.prototype.hasOwnProperty,
c;for(c in a)"__id__"!=c&&"hx__closures__"!=c&&f.call(a,c)&&b.push(c)}return b};var y=function(){};y.__name__=!0;y.string=function(a){return h.__string_rec(a,"")};y.parseInt=function(a){var b=parseInt(a,10);0!=b||120!=x.cca(a,1)&&88!=x.cca(a,1)||(b=parseInt(a));return isNaN(b)?null:b};var c=l.Waud=function(){};c.__name__=!0;c.init=function(a){null==c.__audioElement&&(null==a&&(a=window.document),c.dom=a,c.__audioElement=c.dom.createElement("audio"),null==c.audioManager&&(c.audioManager=new D),c.isWebAudioSupported=
c.audioManager.checkWebAudioAPISupport(),c.isHTML5AudioSupported=null!=g.field(window,"Audio"),c.isWebAudioSupported&&(c.audioContext=c.audioManager.createAudioContext()),c.sounds=new t,c._volume=1,c._sayHello())};c._sayHello=function(){var a=c.isWebAudioSupported?"Web Audio":"HTML5 Audio";1<window.navigator.userAgent.toLowerCase().indexOf("chrome")?window.console.log.apply(window.console,["\n %c %c %c WAUD%c.%cJS%c v"+c.version+" - "+a+" %c %c http://www.waudjs.com %c %c %c \ud83d\udce2 \n\n","background: #32BEA6; padding:5px 0;",
"background: #32BEA6; padding:5px 0;","color: #E70000; background: #29162B; padding:5px 0;","color: #F3B607; background: #29162B; padding:5px 0;","color: #32BEA6; background: #29162B; padding:5px 0;","color: #999999; background: #29162B; padding:5px 0;","background: #32BEA6; padding:5px 0;","background: #B8FCEF; padding:5px 0;","background: #32BEA6; padding:5px 0;","color: #E70000; background: #32BEA6; padding:5px 0;","color: #FF2424; background: #FFFFFF; padding:5px 0;"]):window.console.log("WAUD.JS v"+
c.version+" - "+a+" - http://www.waudjs.com")};c.autoMute=function(){c._focusManager=new r;c._focusManager.focus=function(){c.mute(!1)};c._focusManager.blur=function(){c.mute(!0)}};c.enableTouchUnlock=function(a){c.__touchUnlockCallback=a;c.dom.ontouchend=(F=c.audioManager,e(F,F.unlockAudio))};c.setVolume=function(a){if(((a|0)===a||"number"==typeof a)&&0<=a&&1>=a){if(c._volume=a,null!=c.sounds)for(var b=c.sounds.iterator();b.hasNext();)b.next().setVolume(a)}else window.console.warn("Volume should be a number between 0 and 1. Received: "+
a)};c.getVolume=function(){return c._volume};c.mute=function(a){null==a&&(a=!0);c.isMuted=a;if(null!=c.sounds)for(var b=c.sounds.iterator();b.hasNext();)b.next().mute(a)};c.playbackRate=function(a){if(null==a)return c._playbackRate;if(null!=c.sounds)for(var b=c.sounds.iterator();b.hasNext();)b.next().playbackRate(a);return c._playbackRate=a};c.stop=function(){if(null!=c.sounds)for(var a=c.sounds.iterator();a.hasNext();)a.next().stop()};c.pause=function(){if(null!=c.sounds)for(var a=c.sounds.iterator();a.hasNext();)a.next().pause()};
c.playSequence=function(a,b,f,k){null==k&&(k=-1);if(null!=a&&0!=a.length){for(var d=0,e=a.length;d<e;){var g=d++;null==c.sounds.get(a[g])&&a.splice(g,1)}var h=null;h=function(){if(0<a.length){var d=a.shift(),e=c.sounds.get(d);e.play();if(0<k)w.delay(function(){null!=f&&f(d);h()},k);else e.onEnd(function(a){null!=f&&f(d);h()})}else null!=b&&b()};h()}};c.getFormatSupportString=function(){var a="OGG: "+c.__audioElement.canPlayType('audio/ogg; codecs="vorbis"');a+=", WAV: "+c.__audioElement.canPlayType('audio/wav; codecs="1"');
a+=", MP3: "+c.__audioElement.canPlayType("audio/mpeg;");a+=", AAC: "+c.__audioElement.canPlayType("audio/aac;");return a+=", M4A: "+c.__audioElement.canPlayType("audio/x-m4a;")};c.isSupported=function(){if(null==c.isWebAudioSupported||null==c.isHTML5AudioSupported)c.isWebAudioSupported=c.audioManager.checkWebAudioAPISupport(),c.isHTML5AudioSupported=null!=g.field(window,"Audio");return c.isWebAudioSupported||c.isHTML5AudioSupported};c.isOGGSupported=function(){var a=c.__audioElement.canPlayType('audio/ogg; codecs="vorbis"');
return c.isHTML5AudioSupported&&null!=a&&("probably"==a||"maybe"==a)};c.isWAVSupported=function(){var a=c.__audioElement.canPlayType('audio/wav; codecs="1"');return c.isHTML5AudioSupported&&null!=a&&("probably"==a||"maybe"==a)};c.isMP3Supported=function(){var a=c.__audioElement.canPlayType("audio/mpeg;");return c.isHTML5AudioSupported&&null!=a&&("probably"==a||"maybe"==a)};c.isAACSupported=function(){var a=c.__audioElement.canPlayType("audio/aac;");return c.isHTML5AudioSupported&&null!=a&&("probably"==
a||"maybe"==a)};c.isM4ASupported=function(){var a=c.__audioElement.canPlayType("audio/x-m4a;");return c.isHTML5AudioSupported&&null!=a&&("probably"==a||"maybe"==a)};c.getSampleRate=function(){return null!=c.audioContext?c.audioContext.sampleRate:0};c.destroy=function(){if(null!=c.sounds)for(var a=c.sounds.iterator();a.hasNext();)a.next().destroy();c.sounds=null;null!=c.audioManager&&c.audioManager.destroy();c.audioManager=null;c.audioContext=null;c.__audioElement=null;null!=c._focusManager&&(c._focusManager.clearEvents(),
c._focusManager.blur=null,c._focusManager.focus=null,c._focusManager=null)};d=l.WaudBase64Pack=function(a,b,f,k,d,e){null==e&&(e=!1);null!=c.audioManager&&(this._sequentialLoad=e,0<a.indexOf(".json")&&(this.progress=0,this._options=q.setDefaultOptions(d),this._loadCount=this._soundCount=this._totalSize=0,this._onLoaded=b,this._onProgress=f,this._onError=k,this._sounds=new t,this._loadBase64Json(a)))};d.__name__=!0;d.prototype={_loadBase64Json:function(a){var b=this,c=new n('"meta":.[0-9]*,[0-9]*.',
"i"),k=new XMLHttpRequest;k.open("GET",a,!0);null!=this._onProgress&&(k.onprogress=function(a){if(c.match(k.responseText)&&0==b._totalSize){var f=JSON.parse("{"+c.matched(0)+"}");b._totalSize=f.meta[1]}b.progress=a.lengthComputable?a.loaded/a.total:a.loaded/b._totalSize;1<b.progress&&(b.progress=1);b._onProgress(.8*b.progress)});null!=this._onError&&(k.onerror=function(a){b._onError()});k.onreadystatechange=function(){if(4==k.readyState)switch(k.status){case 200:var a=JSON.parse(k.responseText);b._soundsToLoad=
new t;b._soundIds=[];for(var c=0,f=g.fields(a);c<f.length;){var d=f[c];++c;if("meta"!=d)if(a instanceof Array&&null==a.__enum__){b._soundIds.push(g.field(a,d).name);var e=g.field(a,d).name;d="data:"+y.string(g.field(a,d).mime)+";base64,"+y.string(g.field(a,d).data);b._soundsToLoad.set(e,d)}else b._soundIds.push(d),e=g.field(a,d),b._soundsToLoad.set(d,e)}b._soundCount=b._soundIds.length;if(b._sequentialLoad)b._createSound(b._soundIds.shift());else for(;0<b._soundIds.length;)b._createSound(b._soundIds.shift());
break;case 404:b._onError()}};k.send(null)},_createSound:function(a){var b=this;new C(this._soundsToLoad.get(a),{onload:function(f){b._sounds.set(a,f);c.sounds.set(a,f);if(null!=b._options.onload)b._options.onload(f);b._checkProgress()},onerror:function(c){b._sounds.set(a,null);if(null!=b._options.onerror)b._options.onerror(c);b._checkProgress()&&null!=b._onError&&b._onError()},autoplay:this._options.autoplay,autostop:this._options.autostop,loop:this._options.loop,onend:this._options.onend,playbackRate:this._options.playbackRate,
preload:this._options.preload,volume:this._options.volume,webaudio:this._options.webaudio})},_checkProgress:function(){this._loadCount++;null!=this._onProgress&&this._onProgress(.8+this._loadCount/this._soundCount*.19999999999999996);if(this._loadCount==this._soundCount)return this._soundsToLoad=null,null!=this._onLoaded&&this._onLoaded(this._sounds),!0;this._sequentialLoad&&this._createSound(this._soundIds.shift());return!1},__class__:d};var r=l.WaudFocusManager=function(){var a=this;this._currentState=
this._visibilityChange=this._hidden="";null!=g.field(window.document,"hidden")?(this._hidden="hidden",this._visibilityChange="visibilitychange"):null!=g.field(window.document,"mozHidden")?(this._hidden="mozHidden",this._visibilityChange="mozvisibilitychange"):null!=g.field(window.document,"msHidden")?(this._hidden="msHidden",this._visibilityChange="msvisibilitychange"):null!=g.field(window.document,"webkitHidden")&&(this._hidden="webkitHidden",this._visibilityChange="webkitvisibilitychange");null!=
g.field(window,"addEventListener")?(window.addEventListener("focus",e(this,this._focus)),window.addEventListener("blur",e(this,this._blur)),window.addEventListener("pageshow",e(this,this._focus)),window.addEventListener("pagehide",e(this,this._blur)),document.addEventListener(this._visibilityChange,e(this,this._handleVisibilityChange))):null!=g.field(window,"attachEvent")?(window.attachEvent("onfocus",e(this,this._focus)),window.attachEvent("onblur",e(this,this._blur)),window.attachEvent("pageshow",
e(this,this._focus)),window.attachEvent("pagehide",e(this,this._blur)),document.attachEvent(this._visibilityChange,e(this,this._handleVisibilityChange))):window.onload=function(){window.onfocus=e(a,a._focus);window.onblur=e(a,a._blur);window.onpageshow=e(a,a._focus);window.onpagehide=e(a,a._blur)}};r.__name__=!0;r.prototype={_handleVisibilityChange:function(){null!=g.field(window.document,this._hidden)&&g.field(window.document,this._hidden)&&null!=this.blur?this.blur():null!=this.focus&&this.focus()},
_focus:function(){"focus"!=this._currentState&&null!=this.focus&&this.focus();this._currentState="focus"},_blur:function(){"blur"!=this._currentState&&null!=this.blur&&this.blur();this._currentState="blur"},clearEvents:function(){null!=g.field(window,"removeEventListener")?(window.removeEventListener("focus",e(this,this._focus)),window.removeEventListener("blur",e(this,this._blur)),window.removeEventListener("pageshow",e(this,this._focus)),window.removeEventListener("pagehide",e(this,this._blur)),
window.removeEventListener(this._visibilityChange,e(this,this._handleVisibilityChange))):null!=g.field(window,"removeEvent")?(window.removeEvent("onfocus",e(this,this._focus)),window.removeEvent("onblur",e(this,this._blur)),window.removeEvent("pageshow",e(this,this._focus)),window.removeEvent("pagehide",e(this,this._blur)),window.removeEvent(this._visibilityChange,e(this,this._handleVisibilityChange))):(window.onfocus=null,window.onblur=null,window.onpageshow=null,window.onpagehide=null)},__class__:r};
var C=l.WaudSound=function(a,b){null!=c.audioManager&&(this.rate=1,this._options=b,0<a.indexOf(".json")?(this.isSpriteSound=!0,this._spriteDuration=0,this._spriteSounds=new t,this._spriteSoundEndCallbacks=new t,this._loadSpriteJson(a)):(this.isSpriteSound=!1,this._init(a)),(new n("(^data:audio).*(;base64,)","i")).match(a)&&(a="snd"+(new Date).getTime()),c.sounds.set(a,this))};C.__name__=!0;C.__interfaces__=[B];C.prototype={_loadSpriteJson:function(a){var b=this,c=new XMLHttpRequest;c.open("GET",a,
!0);c.onreadystatechange=function(){if(4==c.readyState&&200==c.status){b._spriteData=JSON.parse(c.responseText);var f=b._spriteData.src;-1<a.indexOf("/")&&(f=a.substring(0,a.lastIndexOf("/")+1)+f);b._init(f)}};c.send(null)},_init:function(a){var b=this;this.url=a;if(c.isWebAudioSupported&&c.useWebAudio&&(null==this._options||null==this._options.webaudio||this._options.webaudio))this.isSpriteSound?this._loadSpriteSound(this.url):this._snd=new A(this.url,this._options);else if(c.isHTML5AudioSupported)if(null!=
this._spriteData&&null!=this._spriteData.sprite){var f=0;var k=null!=this._options&&null!=this._options.onload?this._options.onload:null;null==this._options&&(this._options={});this._options.onload=function(a){f++;f==b._spriteData.sprite.length&&null!=k&&k(a)};this._options.onerror=function(a){f++;f==b._spriteData.sprite.length&&null!=k&&k(a)};a=0;for(var d=this._spriteData.sprite;a<d.length;){var e=d[a];++a;var g=new z(this.url,this._options);g.isSpriteSound=!0;this._spriteSounds.set(e.name,g)}}else this._snd=
new z(this.url,this._options)},getDuration:function(){return this.isSpriteSound?this._spriteDuration:null==this._snd?0:this._snd.getDuration()},setVolume:function(a,b){(a|0)===a||"number"==typeof a?this.isSpriteSound?null!=b&&null!=this._spriteSounds.get(b)&&this._spriteSounds.get(b).setVolume(a):null!=this._snd&&this._snd.setVolume(a):window.console.warn("Volume should be a number between 0 and 1. Received: "+a)},getVolume:function(a){return this.isSpriteSound?null!=a&&null!=this._spriteSounds.get(a)?
this._spriteSounds.get(a).getVolume():0:null==this._snd?0:this._snd.getVolume()},mute:function(a,b){if(this.isSpriteSound)if(null!=b&&null!=this._spriteSounds.get(b))this._spriteSounds.get(b).mute(a);else for(b=this._spriteSounds.iterator();b.hasNext();)b.next().mute(a);else null!=this._snd&&this._snd.mute(a)},toggleMute:function(a){if(this.isSpriteSound)if(null!=a&&null!=this._spriteSounds.get(a))this._spriteSounds.get(a).toggleMute();else for(a=this._spriteSounds.iterator();a.hasNext();)a.next().toggleMute();
else null!=this._snd&&this._snd.toggleMute()},load:function(a){if(null==this._snd||this.isSpriteSound)return null;this._snd.load(a);return this},isReady:function(){if(this.isSpriteSound){if(null==this._spriteData)return!1;for(var a=this._spriteSounds.iterator();a.hasNext();)if(!a.next().isReady())return!1;return!0}return null!=this._snd&&this._snd.isReady()},play:function(a,b){if(this.isSpriteSound)if(null!=a){for(var c=0,d=this._spriteData.sprite;c<d.length;){var e=d[c];++c;if(e.name==a){b=e;break}}if(null==
b)return null;if(null!=this._spriteSounds.get(a))return this._spriteSounds.get(a).play(a,b)}else return null;return null==this._snd?null:this._snd.play(a,b)},togglePlay:function(a){this.isSpriteSound?null!=a&&null!=this._spriteSounds.get(a)&&this._spriteSounds.get(a).togglePlay():null!=this._snd&&this._snd.togglePlay()},isPlaying:function(a){return this.isSpriteSound?null!=a&&null!=this._spriteSounds.get(a)?this._spriteSounds.get(a).isPlaying():!1:null==this._snd?!1:this._snd.isPlaying()},loop:function(a){null==
this._snd||this.isSpriteSound||this._snd.loop(a)},autoStop:function(a){null!=this._snd&&this._snd.autoStop(a)},stop:function(a){if(this.isSpriteSound)if(null!=a&&null!=this._spriteSounds.get(a))this._spriteSounds.get(a).stop();else for(a=this._spriteSounds.iterator();a.hasNext();)a.next().stop();else null!=this._snd&&this._snd.stop()},pause:function(a){if(this.isSpriteSound)if(null!=a&&null!=this._spriteSounds.get(a))this._spriteSounds.get(a).pause();else for(a=this._spriteSounds.iterator();a.hasNext();)a.next().pause();
else null!=this._snd&&this._snd.pause()},playbackRate:function(a,b){if(null!=a){if(this.isSpriteSound)if(null!=b&&null!=this._spriteSounds.get(b))this._spriteSounds.get(b).playbackRate(a);else for(b=this._spriteSounds.iterator();b.hasNext();)b.next().playbackRate(a);else null!=this._snd&&this._snd.playbackRate(a);return this.rate=a}return this.rate},setTime:function(a){null==this._snd||this.isSpriteSound||this._snd.setTime(a)},getTime:function(){return null==this._snd||this.isSpriteSound?0:this._snd.getTime()},
onEnd:function(a,b){return this.isSpriteSound?(null!=b&&this._spriteSoundEndCallbacks.set(b,a),this):null!=this._snd?(this._snd.onEnd(a),this):null},onLoad:function(a){if(null==this._snd||this.isSpriteSound)return null;this._snd.onLoad(a);return this},onError:function(a){if(null==this._snd||this.isSpriteSound)return null;this._snd.onError(a);return this},destroy:function(){if(this.isSpriteSound)for(var a=this._spriteSounds.iterator();a.hasNext();)a.next().destroy();else null!=this._snd&&(this._snd.destroy(),
this._snd=null)},_loadSpriteSound:function(a){var b=new XMLHttpRequest;b.open("GET",a,!0);b.responseType="arraybuffer";b.onload=e(this,this._onSpriteSoundLoaded);b.onerror=e(this,this._onSpriteSoundError);b.send()},_onSpriteSoundLoaded:function(a){c.audioManager.audioContext.decodeAudioData(a.target.response,e(this,this._decodeSuccess),e(this,this._onSpriteSoundError))},_onSpriteSoundError:function(){if(null!=this._options&&null!=this._options.onerror)this._options.onerror(this)},_decodeSuccess:function(a){if(null==
a)this._onSpriteSoundError();else{c.audioManager.bufferList.set(this.url,a);this._spriteDuration=a.duration;if(null!=this._options&&null!=this._options.onload)this._options.onload(this);for(var b=0,f=this._spriteData.sprite;b<f.length;){var d=f[b];++b;var g=new A(this.url,this._options,!0,a.duration);g.isSpriteSound=!0;this._spriteSounds.set(d.name,g);g.onEnd(e(this,this._spriteOnEnd),d.name)}}},_spriteOnEnd:function(a){null!=this._spriteSoundEndCallbacks.get(a.spriteName)&&this._spriteSoundEndCallbacks.get(a.spriteName)(a)},
__class__:C};var q=l.WaudUtils=function(){};q.__name__=!0;q.isAndroid=function(a){null==a&&(a=window.navigator.userAgent);return(new n("Android","i")).match(a)};q.isiOS=function(a){null==a&&(a=window.navigator.userAgent);return(new n("(iPad|iPhone|iPod)","i")).match(a)};q.isWindowsPhone=function(a){null==a&&(a=window.navigator.userAgent);return(new n("(IEMobile|Windows Phone)","i")).match(a)};q.isFirefox=function(a){null==a&&(a=window.navigator.userAgent);return(new n("Firefox","i")).match(a)};q.isOpera=
function(a){null==a&&(a=window.navigator.userAgent);return(new n("Opera","i")).match(a)||null!=g.field(window,"opera")};q.isChrome=function(a){null==a&&(a=window.navigator.userAgent);return(new n("Chrome","i")).match(a)};q.isSafari=function(a){null==a&&(a=window.navigator.userAgent);return(new n("Safari","i")).match(a)};q.isMobile=function(a){null==a&&(a=window.navigator.userAgent);return(new n("(iPad|iPhone|iPod|Android|webOS|BlackBerry|Windows Phone|IEMobile)","i")).match(a)};q.getiOSVersion=function(a){null==
a&&(a=window.navigator.userAgent);var b=new n("[0-9_]+?[0-9_]+?[0-9_]+","i"),c=[];if(b.match(a)){a=b.matched(0).split("_");b=[];for(c=0;c<a.length;){var d=a[c];++c;b.push(y.parseInt(d))}c=b}return c};q.setDefaultOptions=function(a){null==a&&(a={});a.autoplay=null!=a.autoplay?a.autoplay:c.defaults.autoplay;a.autostop=null!=a.autostop?a.autostop:c.defaults.autostop;a.webaudio=null!=a.webaudio?a.webaudio:c.defaults.webaudio;a.preload=null!=a.preload?a.preload:c.defaults.preload;a.loop=null!=a.loop?a.loop:
c.defaults.loop;a.onload=null!=a.onload?a.onload:c.defaults.onload;a.onend=null!=a.onend?a.onend:c.defaults.onend;a.onerror=null!=a.onerror?a.onerror:c.defaults.onerror;if(null==a.volume||0>a.volume||1<a.volume)a.volume=c.defaults.volume;if(null==a.playbackRate||0>=a.playbackRate||4<=a.playbackRate)a.playbackRate=c.defaults.playbackRate;return a};var A=function(a,b,f,d){null==d&&(d=0);null==f&&(f=!1);v.call(this,a,b);this._pauseTime=this._playStartTime=0;this._srcNodes=[];this._gainNodes=[];this._currentSoundProps=
null;this._isLoaded=f;this._duration=d;this._manager=c.audioManager;this._b64.match(a)?this._decodeAudio(this._base64ToArrayBuffer(a)):this._options.preload&&!f&&this.load()};A.__name__=!0;A.__interfaces__=[B];A.__super__=v;A.prototype=m(v.prototype,{load:function(a){if(!this._isLoaded){var b=new XMLHttpRequest;b.open("GET",this.url,!0);b.responseType="arraybuffer";b.onload=e(this,this._onSoundLoaded);b.onerror=e(this,this._error);b.send();null!=a&&(this._options.onload=a)}return this},_base64ToArrayBuffer:function(a){a=
window.atob(a.split(",")[1]);for(var b=a.length,c=new Uint8Array(new ArrayBuffer(b)),d=0;d<b;){var e=d++;c[e]=x.cca(a,e)}return c.buffer},_onSoundLoaded:function(a){this._manager.audioContext.decodeAudioData(a.target.response,e(this,this._decodeSuccess),e(this,this._error))},_decodeAudio:function(a){this._manager.audioContext.decodeAudioData(a,e(this,this._decodeSuccess),e(this,this._error))},_error:function(){if(null!=this._options.onerror)this._options.onerror(this)},_decodeSuccess:function(a){if(null==
a)this._error();else{this._manager.bufferList.set(this.url,a);this._isLoaded=!0;this._duration=a.duration;if(null!=this._options.onload)this._options.onload(this);this._options.autoplay&&this.play()}},_makeSource:function(a){var b=this._manager.audioContext.createBufferSource();b.buffer=a;this._gainNode=this._manager.createGain();b.connect(this._gainNode);b.playbackRate.value=this.rate;this._gainNode.connect(this._manager.masterGainNode);this._manager.masterGainNode.connect(this._manager.audioContext.destination);
this._srcNodes.push(b);this._gainNodes.push(this._gainNode);if(this._muted)this._gainNode.gain.value=0;else try{this._gainNode.gain.value=this._options.volume,this._gainNode.gain.setTargetAtTime(this._options.volume,this._manager.audioContext.currentTime,.015)}catch(f){f instanceof u&&(f=f.val)}return b},getDuration:function(){return this._isLoaded?this._duration:0},play:function(a,b){var c=this;this.spriteName=a;this._isPlaying&&this._options.autostop&&this.stop(this.spriteName);if(!this._isLoaded)return-1;
var d=0,e=-1;this.isSpriteSound&&null!=b&&(this._currentSoundProps=b,d=b.start+this._pauseTime,e=b.duration);a=null!=this._manager.bufferList?this._manager.bufferList.get(this.url):null;null!=a&&(this.source=this._makeSource(a),0<=d&&-1<e?this._start(0,d,e):(this._start(0,this._pauseTime,this.source.buffer.duration),this.source.loop=this._options.loop),this._playStartTime=this._manager.audioContext.currentTime,this._isPlaying=!0,this.source.onended=function(){c._isPlaying&&(c._pauseTime=0);c._isPlaying=
!1;if(c.isSpriteSound&&null!=b&&null!=b.loop&&b.loop&&0<=d&&-1<e)c.destroy(),c.play(c.spriteName,b);else if(null!=c._options.onend)c._options.onend(c)});return x.indexOf(this._srcNodes,this.source,0)},_start:function(a,b,c){null!=g.field(this.source,"start")?this.source.start(a,b,c):null!=g.field(this.source,"noteGrainOn")?g.callMethod(this.source,g.field(this.source,"noteGrainOn"),[a,b,c]):null!=g.field(this.source,"noteOn")&&g.callMethod(this.source,g.field(this.source,"noteOn"),[a,b,c])},togglePlay:function(a){this._isPlaying?
this.pause():this.play()},isPlaying:function(a){return this._isPlaying},loop:function(a){this._options.loop=a;null!=this.source&&(this.source.loop=a)},setVolume:function(a,b){this._options.volume=a;null!=this._gainNode&&this._isLoaded&&!this._muted&&(this._gainNode.gain.value=this._options.volume)},getVolume:function(a){return this._options.volume},mute:function(a,b){this._muted=a;null!=this._gainNode&&this._isLoaded&&(this._gainNode.gain.value=a?0:this._options.volume)},toggleMute:function(a){this.mute(!this._muted)},
autoStop:function(a){this._options.autostop=a},stop:function(a){this._pauseTime=0;null!=this.source&&this._isLoaded&&this._isPlaying&&this.destroy()},pause:function(a){null!=this.source&&this._isLoaded&&this._isPlaying&&(this.destroy(),this._pauseTime+=this._manager.audioContext.currentTime-this._playStartTime,null)},playbackRate:function(a,b){if(null==a)return this.rate;b=0;for(var c=this._srcNodes;b<c.length;){var d=c[b];++b;d.playbackRate.value=a}return this.rate=a},setTime:function(a){!this._isLoaded||
a>this._duration||(this._isPlaying?(this.stop(),this._pauseTime=a,this.play()):this._pauseTime=a)},getTime:function(){return null!=this.source&&this._isLoaded&&this._isPlaying?this._manager.audioContext.currentTime-this._playStartTime+this._pauseTime:0},onEnd:function(a,b){this._options.onend=a;return this},onLoad:function(a){this._options.onload=a;return this},onError:function(a){this._options.onerror=a;return this},destroy:function(){for(var a=0,b=this._srcNodes;a<b.length;){var c=b[a];++a;null!=
g.field(c,"stop")?c.stop(0):null!=g.field(c,"noteOff")&&g.callMethod(c,g.field(c,"noteOff"),[0]);c.disconnect()}a=0;for(b=this._gainNodes;a<b.length;)c=b[a],++a,c.disconnect();this._srcNodes=[];this._gainNodes=[];this._isPlaying=!1},__class__:A});l=function(){};l.__name__=!0;var w=function(a){var b=this;this.id=setInterval(function(){b.run()},a)};w.__name__=!0;w.delay=function(a,b){var c=new w(b);c.run=function(){c.stop();a()};return c};w.prototype={stop:function(){null!=this.id&&(clearInterval(this.id),
this.id=null)},run:function(){},__class__:w};var E=function(a,b){this.map=a;this.keys=b;this.index=0;this.count=b.length};E.__name__=!0;E.prototype={hasNext:function(){return this.index<this.count},next:function(){return this.map.get(this.keys[this.index++])},__class__:E};var t=function(){this.h={}};t.__name__=!0;t.__interfaces__=[l];t.prototype={set:function(a,b){null!=H[a]?this.setReserved(a,b):this.h[a]=b},get:function(a){return null!=H[a]?this.getReserved(a):this.h[a]},setReserved:function(a,
b){null==this.rh&&(this.rh={});this.rh["$"+a]=b},getReserved:function(a){return null==this.rh?null:this.rh["$"+a]},arrayKeys:function(){var a=[],b;for(b in this.h)this.h.hasOwnProperty(b)&&a.push(b);if(null!=this.rh)for(b in this.rh)36==b.charCodeAt(0)&&a.push(b.substr(1));return a},iterator:function(){return new E(this,this.arrayKeys())},__class__:t};var u=function(a){Error.call(this);this.val=a;this.message=String(a);Error.captureStackTrace&&Error.captureStackTrace(this,u)};u.__name__=!0;u.__super__=
Error;u.prototype=m(Error.prototype,{__class__:u});var h=function(){};h.__name__=!0;h.getClass=function(a){if(a instanceof Array&&null==a.__enum__)return Array;var b=a.__class__;if(null!=b)return b;a=h.__nativeClassName(a);return null!=a?h.__resolveNativeClass(a):null};h.__string_rec=function(a,b){if(null==a)return"null";if(5<=b.length)return"<...>";var c=typeof a;"function"==c&&(a.__name__||a.__ename__)&&(c="object");switch(c){case "object":if(a instanceof Array){if(a.__enum__){if(2==a.length)return a[0];
c=a[0]+"(";b+="\t";for(var d=2,e=a.length;d<e;){var g=d++;c=2!=g?c+(","+h.__string_rec(a[g],b)):c+h.__string_rec(a[g],b)}return c+")"}c=a.length;d="[";b+="\t";for(e=0;e<c;)g=e++,d+=(0<g?",":"")+h.__string_rec(a[g],b);return d+"]"}try{d=a.toString}catch(G){return G instanceof u&&(G=G.val),"???"}if(null!=d&&d!=Object.toString&&"function"==typeof d&&(c=a.toString(),"[object Object]"!=c))return c;c=null;d="{\n";b+="\t";e=null!=a.hasOwnProperty;for(c in a)e&&!a.hasOwnProperty(c)||"prototype"==c||"__class__"==
c||"__super__"==c||"__interfaces__"==c||"__properties__"==c||(2!=d.length&&(d+=", \n"),d+=b+c+" : "+h.__string_rec(a[c],b));b=b.substring(1);return d+("\n"+b+"}");case "function":return"<function>";case "string":return a;default:return String(a)}};h.__interfLoop=function(a,b){if(null==a)return!1;if(a==b)return!0;var c=a.__interfaces__;if(null!=c)for(var d=0,e=c.length;d<e;){var g=d++;g=c[g];if(g==b||h.__interfLoop(g,b))return!0}return h.__interfLoop(a.__super__,b)};h.__instanceof=function(a,b){if(null==
b)return!1;switch(b){case L:return(a|0)===a;case I:return"number"==typeof a;case J:return"boolean"==typeof a;case String:return"string"==typeof a;case Array:return a instanceof Array&&null==a.__enum__;case M:return!0;default:if(null!=a)if("function"==typeof b){if(a instanceof b||h.__interfLoop(h.getClass(a),b))return!0}else{if("object"==typeof b&&h.__isNativeObj(b)&&a instanceof b)return!0}else return!1;return b==N&&null!=a.__name__||b==O&&null!=a.__ename__?!0:a.__enum__==b}};h.__cast=function(a,
b){if(h.__instanceof(a,b))return a;throw new u("Cannot cast "+y.string(a)+" to "+y.string(b));};h.__nativeClassName=function(a){a=h.__toStr.call(a).slice(8,-1);return"Object"==a||"Function"==a||"Math"==a||"JSON"==a?null:a};h.__isNativeObj=function(a){return null!=h.__nativeClassName(a)};h.__resolveNativeClass=function(a){return p[a]};var F,K=0;Array.prototype.indexOf&&(x.indexOf=function(a,b,c){return Array.prototype.indexOf.call(a,b,c)});String.prototype.__class__=String;String.__name__=!0;Array.__name__=
!0;Date.prototype.__class__=Date;Date.__name__=["Date"];var L={__name__:["Int"]},M={__name__:["Dynamic"]},I=Number;I.__name__=["Float"];var J=Boolean;J.__ename__=["Bool"];var N={__name__:["Class"]},O={},H={};c.PROBABLY="probably";c.MAYBE="maybe";c.version="1.0.1";c.useWebAudio=!0;c.defaults={autoplay:!1,autostop:!0,loop:!1,preload:!0,webaudio:!0,volume:1,playbackRate:1};c.preferredSampleRate=44100;c.isMuted=!1;c._playbackRate=1;d.JSON_PER=.8;r.FOCUS_STATE="focus";r.BLUR_STATE="blur";r.ON_FOCUS="onfocus";
r.ON_BLUR="onblur";r.PAGE_SHOW="pageshow";r.PAGE_HIDE="pagehide";r.WINDOW="window";r.DOCUMENT="document";h.__toStr={}.toString})("undefined"!=typeof console?console:{log:function(){}},"undefined"!=typeof window?window:exports,"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this);
|
/*!
* Waterwheel Carousel
* Version 2.3.0
* http://www.bkosborne.com
*
* Copyright 2011-2013 Brian Osborne
* Dual licensed under GPLv3 or MIT
* Copies of the licenses have been distributed
* with this plugin.
*
* Plugin written by Brian Osborne
* for use with the jQuery JavaScript Framework
* http://www.jquery.com
*/
;(function ($) {
'use strict';
$.fn.waterwheelCarousel = function (startingOptions) {
// Adds support for intializing multiple carousels from the same selector group
if (this.length > 1) {
this.each(function() {
$(this).waterwheelCarousel(startingOptions);
});
return this; // allow chaining
}
var carousel = this;
var options = {};
var data = {};
function initializeCarouselData() {
data = {
itemsContainer: $(carousel),
totalItems: $(carousel).find('img').length,
containerWidth: $(carousel).width(),
containerHeight: $(carousel).height(),
currentCenterItem: null,
previousCenterItem: null,
items: [],
calculations: [],
carouselRotationsLeft: 0,
currentlyMoving: false,
itemsAnimating: 0,
currentSpeed: options.speed,
intervalTimer: null,
currentDirection: 'forward',
leftItemsCount: 0,
rightItemsCount: 0,
performingSetup: true
};
data.itemsContainer.find('img').removeClass(options.activeClassName);
}
/**
* This function will set the autoplay for the carousel to
* automatically rotate it given the time in the options
* Can clear the autoplay by passing in true
*/
function autoPlay(stop) {
// clear timer
clearTimeout(data.autoPlayTimer);
// as long as no stop command, and autoplay isn't zeroed...
if (!stop && options.autoPlay !== 0) {
// set timer...
data.autoPlayTimer = setTimeout(function () {
// to move the carousl in either direction...
if (options.autoPlay > 0) {
moveOnce('forward');
} else {
moveOnce('backward');
}
}, Math.abs(options.autoPlay));
}
}
/**
* This function will preload all the images in the carousel before
* calling the passed in callback function. This is only used so we can
* properly determine the width and height of the items. This is not needed
* if a user instead manually specifies that information.
*/
function preload(callback) {
if (options.preloadImages === false) {
callback();
return;
}
var $imageElements = data.itemsContainer.find('img'), loadedImages = 0, totalImages = $imageElements.length;
$imageElements.each(function () {
$(this).bind('load', function () {
// Add to number of images loaded and see if they are all done yet
loadedImages += 1;
if (loadedImages === totalImages) {
// All done, perform callback
callback();
return;
}
});
// May need to manually reset the src to get the load event to fire
// http://stackoverflow.com/questions/7137737/ie9-problems-with-jquery-load-event-not-firing
$(this).attr('src', $(this).attr('src'));
// If browser has cached the images, it may not call trigger a load. Detect this and do it ourselves
if (this.complete) {
$(this).trigger('load');
}
});
}
/**
* Makes a record of the original width and height of all the items in the carousel.
* If we re-intialize the carousel, these values can be used to re-establish their
* original dimensions.
*/
function setOriginalItemDimensions() {
data.itemsContainer.find('img').each(function () {
if ($(this).data('original_width') == undefined || options.forcedImageWidth > 0) {
$(this).data('original_width', $(this).width());
}
if ($(this).data('original_height') == undefined || options.forcedImageHeight > 0) {
$(this).data('original_height', $(this).height());
}
});
}
/**
* Users can pass in a specific width and height that should be applied to every image.
* While this option can be used in conjunction with the image preloader, the intended
* use case is for when the preloader is turned off and the images don't have defined
* dimensions in CSS. The carousel needs dimensions one way or another to work properly.
*/
function forceImageDimensionsIfEnabled() {
if (options.forcedImageWidth && options.forcedImageHeight) {
data.itemsContainer.find('img').each(function () {
$(this).width(options.forcedImageWidth);
$(this).height(options.forcedImageHeight);
});
}
}
/**
* For each "visible" item slot (# of flanking items plus the middle),
* we pre-calculate all of the properties that the item should possess while
* occupying that slot. This saves us some time during the actual animation.
*/
function preCalculatePositionProperties() {
// The 0 index is the center item in the carousel
var $firstItem = data.itemsContainer.find('img:first');
data.calculations[0] = {
distance: 0,
offset: 0,
opacity: 1
}
// Then, for each number of flanking items (plus one more, see below), we
// perform the calcations based on our user options
var horizonOffset = options.horizonOffset;
var separation = options.separation;
for (var i = 1; i <= options.flankingItems + 2; i++) {
if (i > 1) {
horizonOffset *= options.horizonOffsetMultiplier;
separation *= options.separationMultiplier;
}
data.calculations[i] = {
distance: data.calculations[i-1].distance + separation,
offset: data.calculations[i-1].offset + horizonOffset,
opacity: data.calculations[i-1].opacity * options.opacityMultiplier
}
}
// We performed 1 extra set of calculations above so that the items that
// are moving out of sight (based on # of flanking items) gracefully animate there
// However, we need them to animate to hidden, so we set the opacity to 0 for
// that last item
if (options.edgeFadeEnabled) {
data.calculations[options.flankingItems+1].opacity = 0;
} else {
data.calculations[options.flankingItems+1] = {
distance: 0,
offset: 0,
opacity: 0
}
}
}
/**
* Here we prep the carousel and its items, like setting default CSS
* attributes. All items start in the middle position by default
* and will "fan out" from there during the first animation
*/
function setupCarousel() {
// Fill in a data array with jQuery objects of all the images
data.items = data.itemsContainer.find('img');
for (var i = 0; i < data.totalItems; i++) {
data.items[i] = $(data.items[i]);
}
// May need to set the horizon if it was set to auto
if (options.horizon === 0) {
if (options.orientation === 'horizontal') {
options.horizon = data.containerHeight / 2;
} else {
options.horizon = data.containerWidth / 2;
}
}
// Default all the items to the center position
data.itemsContainer
.css('position','relative')
.find('img')
.each(function () {
// Figure out where the top and left positions for center should be
var centerPosLeft, centerPosTop;
if (options.orientation === 'horizontal') {
centerPosLeft = (data.containerWidth / 2) - ($(this).data('original_width') / 2);
centerPosTop = options.horizon - ($(this).data('original_height') / 2);
} else {
centerPosLeft = options.horizon - ($(this).data('original_width') / 2);
centerPosTop = (data.containerHeight / 2) - ($(this).data('original_height') / 2);
}
$(this)
// Apply positioning and layering to the images
.css({
'left': centerPosLeft,
'top': centerPosTop,
'visibility': 'visible',
'position': 'absolute',
'z-index': 0,
'opacity': 0
})
// Give each image a data object so it remembers specific data about
// it's original form
.data({
top: centerPosTop,
left: centerPosLeft,
oldPosition: 0,
currentPosition: 0,
depth: 0,
opacity: 0
})
// The image has been setup... Now we can show it
.show();
});
}
/**
* All the items to the left and right of the center item need to be
* animated to their starting positions. This function will
* figure out what items go where and will animate them there
*/
function setupStarterRotation() {
options.startingItem = (options.startingItem === 0) ? Math.round(data.totalItems / 2) : options.startingItem;
data.rightItemsCount = Math.ceil((data.totalItems-1) / 2);
data.leftItemsCount = Math.floor((data.totalItems-1) / 2);
// We are in effect rotating the carousel, so we need to set that
data.carouselRotationsLeft = 1;
// Center item
moveItem(data.items[options.startingItem-1], 0);
data.items[options.startingItem-1].css('opacity', 1);
// All the items to the right of center
var itemIndex = options.startingItem - 1;
for (var pos = 1; pos <= data.rightItemsCount; pos++) {
(itemIndex < data.totalItems - 1) ? itemIndex += 1 : itemIndex = 0;
data.items[itemIndex].css('opacity', 1);
moveItem(data.items[itemIndex], pos);
}
// All items to left of center
var itemIndex = options.startingItem - 1;
for (var pos = -1; pos >= data.leftItemsCount*-1; pos--) {
(itemIndex > 0) ? itemIndex -= 1 : itemIndex = data.totalItems - 1;
data.items[itemIndex].css('opacity', 1);
moveItem(data.items[itemIndex], pos);
}
}
/**
* Given the item and position, this function will calculate the new data
* for the item. One the calculations are done, it will store that data in
* the items data object
*/
function performCalculations($item, newPosition) {
var newDistanceFromCenter = Math.abs(newPosition);
// Distance to the center
if (newDistanceFromCenter < options.flankingItems + 1) {
var calculations = data.calculations[newDistanceFromCenter];
} else {
var calculations = data.calculations[options.flankingItems + 1];
}
var distanceFactor = Math.pow(options.sizeMultiplier, newDistanceFromCenter)
var newWidth = distanceFactor * $item.data('original_width');
var newHeight = distanceFactor * $item.data('original_height');
var widthDifference = Math.abs($item.width() - newWidth);
var heightDifference = Math.abs($item.height() - newHeight);
var newOffset = calculations.offset
var newDistance = calculations.distance;
if (newPosition < 0) {
newDistance *= -1;
}
if (options.orientation == 'horizontal') {
var center = data.containerWidth / 2;
var newLeft = center + newDistance - (newWidth / 2);
var newTop = options.horizon - newOffset - (newHeight / 2);
} else {
var center = data.containerHeight / 2;
var newLeft = options.horizon - newOffset - (newWidth / 2);
var newTop = center + newDistance - (newHeight / 2);
}
var newOpacity;
if (newPosition === 0) {
newOpacity = 1;
} else {
newOpacity = calculations.opacity;
}
// Depth will be reverse distance from center
var newDepth = options.flankingItems + 2 - newDistanceFromCenter;
$item.data('width',newWidth);
$item.data('height',newHeight);
$item.data('top',newTop);
$item.data('left',newLeft);
$item.data('oldPosition',$item.data('currentPosition'));
$item.data('depth',newDepth);
$item.data('opacity',newOpacity);
}
function moveItem($item, newPosition) {
// Only want to physically move the item if it is within the boundaries
// or in the first position just outside either boundary
if (Math.abs(newPosition) <= options.flankingItems + 1) {
performCalculations($item, newPosition);
data.itemsAnimating++;
$item
.css('z-index',$item.data().depth)
// Animate the items to their new position values
.animate({
left: $item.data().left,
width: $item.data().width,
height: $item.data().height,
top: $item.data().top,
opacity: $item.data().opacity
}, data.currentSpeed, options.animationEasing, function () {
// Animation for the item has completed, call method
itemAnimationComplete($item, newPosition);
});
} else {
$item.data('currentPosition', newPosition)
// Move the item to the 'hidden' position if hasn't been moved yet
// This is for the intitial setup
if ($item.data('oldPosition') === 0) {
$item.css({
'left': $item.data().left,
'width': $item.data().width,
'height': $item.data().height,
'top': $item.data().top,
'opacity': $item.data().opacity,
'z-index': $item.data().depth
});
}
}
}
/**
* This function is called once an item has finished animating to its
* given position. Several different statements are executed here, such as
* dealing with the animation queue
*/
function itemAnimationComplete($item, newPosition) {
data.itemsAnimating--;
$item.data('currentPosition', newPosition);
// Keep track of what items came and left the center position,
// so we can fire callbacks when all the rotations are completed
if (newPosition === 0) {
data.currentCenterItem = $item;
}
// all items have finished their rotation, lets clean up
if (data.itemsAnimating === 0) {
data.carouselRotationsLeft -= 1;
data.currentlyMoving = false;
// If there are still rotations left in the queue, rotate the carousel again
// we pass in zero because we don't want to add any additional rotations
if (data.carouselRotationsLeft > 0) {
rotateCarousel(0);
// Otherwise there are no more rotations and...
} else {
// Reset the speed of the carousel to original
data.currentSpeed = options.speed;
data.currentCenterItem.addClass(options.activeClassName);
if (data.performingSetup === false) {
options.movedToCenter(data.currentCenterItem);
options.movedFromCenter(data.previousCenterItem);
}
data.performingSetup = false;
// reset & initate the autoPlay
autoPlay();
}
}
}
/**
* Function called to rotate the carousel the given number of rotations
* in the given direciton. Will check to make sure the carousel should
* be able to move, and then adjust speed and move items
*/
function rotateCarousel(rotations) {
// Check to see that a rotation is allowed
if (data.currentlyMoving === false) {
// Remove active class from the center item while we rotate
data.currentCenterItem.removeClass(options.activeClassName);
data.currentlyMoving = true;
data.itemsAnimating = 0;
data.carouselRotationsLeft += rotations;
if (options.quickerForFurther === true) {
// Figure out how fast the carousel should rotate
if (rotations > 1) {
data.currentSpeed = options.speed / rotations;
}
// Assure the speed is above the minimum to avoid weird results
data.currentSpeed = (data.currentSpeed < 100) ? 100 : data.currentSpeed;
}
// Iterate thru each item and move it
for (var i = 0; i < data.totalItems; i++) {
var $item = $(data.items[i]);
var currentPosition = $item.data('currentPosition');
var newPosition;
if (data.currentDirection == 'forward') {
newPosition = currentPosition - 1;
} else {
newPosition = currentPosition + 1;
}
// We keep both sides as even as possible to allow circular rotation to work.
// We will "wrap" the item arround to the other side by negating its current position
var flankingAllowance = (newPosition > 0) ? data.rightItemsCount : data.leftItemsCount;
if (Math.abs(newPosition) > flankingAllowance) {
newPosition = currentPosition * -1;
// If there's an uneven number of "flanking" items, we need to compenstate for that
// when we have an item switch sides. The right side will always have 1 more in that case
if (data.totalItems % 2 == 0) {
newPosition += 1;
}
}
moveItem($item, newPosition);
}
}
}
/**
* The event handler when an image within the carousel is clicked
* This function will rotate the carousel the correct number of rotations
* to get the clicked item to the center, or will fire the custom event
* the user passed in if the center item is clicked
*/
$(this).find('img').bind("click", function () {
var itemPosition = $(this).data().currentPosition;
if (options.imageNav == false) {
return;
}
// Don't allow hidden items to be clicked
if (Math.abs(itemPosition) >= options.flankingItems + 1) {
return;
}
// Do nothing if the carousel is already moving
if (data.currentlyMoving) {
return;
}
data.previousCenterItem = data.currentCenterItem;
// Remove autoplay
autoPlay(true);
options.autoPlay = 0;
var rotations = Math.abs(itemPosition);
if (itemPosition == 0) {
options.clickedCenter($(this));
} else {
// Fire the 'moving' callbacks
options.movingFromCenter(data.currentCenterItem);
options.movingToCenter($(this));
if (itemPosition < 0) {
data.currentDirection = 'backward';
rotateCarousel(rotations);
} else if (itemPosition > 0) {
data.currentDirection = 'forward';
rotateCarousel(rotations);
}
}
});
/**
* The user may choose to wrap the images is link tags. If they do this, we need to
* make sure that they aren't active for certain situations
*/
$(this).find('a').bind("click", function (event) {
var isCenter = $(this).find('img').data('currentPosition') == 0;
// should we disable the links?
if (options.linkHandling === 1 || // turn off all links
(options.linkHandling === 2 && !isCenter)) // turn off all links except center
{
event.preventDefault();
return false;
}
});
function nextItemFromCenter() {
var $next = data.currentCenterItem.next();
if ($next.length <= 0) {
$next = data.currentCenterItem.parent().children().first();
}
return $next;
}
function prevItemFromCenter() {
var $prev = data.currentCenterItem.prev();
if ($prev.length <= 0) {
$prev = data.currentCenterItem.parent().children().last();
}
return $prev;
}
/**
* Intiate a move of the carousel in either direction. Takes care of firing
* the 'moving' callbacks
*/
function moveOnce(direction) {
if (data.currentlyMoving === false) {
data.previousCenterItem = data.currentCenterItem;
options.movingFromCenter(data.currentCenterItem);
if (direction == 'backward') {
options.movingToCenter(prevItemFromCenter());
data.currentDirection = 'backward';
} else if (direction == 'forward') {
options.movingToCenter(nextItemFromCenter());
data.currentDirection = 'forward';
}
}
rotateCarousel(1);
}
/**
* Navigation with arrow keys
*/
$(document).keydown(function(e) {
if (options.keyboardNav) {
// arrow left or up
if ((e.which === 37 && options.orientation == 'horizontal') || (e.which === 38 && options.orientation == 'vertical')) {
autoPlay(true);
options.autoPlay = 0;
moveOnce('backward');
// arrow right or down
} else if ((e.which === 39 && options.orientation == 'horizontal') || (e.which === 40 && options.orientation == 'vertical')) {
autoPlay(true);
options.autoPlay = 0;
moveOnce('forward');
}
// should we override the normal functionality for the arrow keys?
if (options.keyboardNavOverride && (
(options.orientation == 'horizontal' && (e.which === 37 || e.which === 39)) ||
(options.orientation == 'vertical' && (e.which === 38 || e.which === 40))
)) {
e.preventDefault();
return false;
}
}
});
/**
* Public API methods
*/
this.reload = function (newOptions) {
if (typeof newOptions === "object") {
var combineDefaultWith = newOptions;
} else {
var combineDefaultWith = {};
}
options = $.extend({}, $.fn.waterwheelCarousel.defaults, newOptions);
initializeCarouselData();
data.itemsContainer.find('img').hide();
forceImageDimensionsIfEnabled();
preload(function () {
setOriginalItemDimensions();
preCalculatePositionProperties();
setupCarousel();
setupStarterRotation();
});
}
this.next = function() {
autoPlay(true);
options.autoPlay = 0;
moveOnce('forward');
}
this.prev = function () {
autoPlay(true);
options.autoPlay = 0;
moveOnce('backward');
}
this.reload(startingOptions);
return this;
};
$.fn.waterwheelCarousel.defaults = {
// number tweeks to change apperance
startingItem: 1, // item to place in the center of the carousel. Set to 0 for auto
separation: 175, // distance between items in carousel
separationMultiplier: 0.6, // multipled by separation distance to increase/decrease distance for each additional item
horizonOffset: 0, // offset each item from the "horizon" by this amount (causes arching)
horizonOffsetMultiplier: 1, // multipled by horizon offset to increase/decrease offset for each additional item
sizeMultiplier: 0.7, // determines how drastically the size of each item changes
opacityMultiplier: 0.8, // determines how drastically the opacity of each item changes
horizon: 0, // how "far in" the horizontal/vertical horizon should be set from the container wall. 0 for auto
flankingItems: 3, // the number of items visible on either side of the center
// animation
speed: 300, // speed in milliseconds it will take to rotate from one to the next
animationEasing: 'linear', // the easing effect to use when animating
quickerForFurther: true, // set to true to make animations faster when clicking an item that is far away from the center
edgeFadeEnabled: false, // when true, items fade off into nothingness when reaching the edge. false to have them move behind the center image
// misc
linkHandling: 2, // 1 to disable all (used for facebox), 2 to disable all but center (to link images out)
autoPlay: 0, // indicate the speed in milliseconds to wait before autorotating. 0 to turn off. Can be negative
orientation: 'horizontal', // indicate if the carousel should be 'horizontal' or 'vertical'
activeClassName: 'carousel-center', // the name of the class given to the current item in the center
keyboardNav: false, // set to true to move the carousel with the arrow keys
keyboardNavOverride: true, // set to true to override the normal functionality of the arrow keys (prevents scrolling)
imageNav: true, // clicking a non-center image will rotate that image to the center
// preloader
preloadImages: true, // disable/enable the image preloader.
forcedImageWidth: 0, // specify width of all images; otherwise the carousel tries to calculate it
forcedImageHeight: 0, // specify height of all images; otherwise the carousel tries to calculate it
// callback functions
movingToCenter: $.noop, // fired when an item is about to move to the center position
movedToCenter: $.noop, // fired when an item has finished moving to the center
clickedCenter: $.noop, // fired when the center item has been clicked
movingFromCenter: $.noop, // fired when an item is about to leave the center position
movedFromCenter: $.noop // fired when an item has finished moving from the center
};
})(jQuery);
|
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
const resolve = require('rollup-plugin-node-resolve');
const sourcemaps = require('rollup-plugin-sourcemaps');
const globals = {
'@angular/animations': 'ng.animations',
'@angular/animations/browser': 'ng.animations.browser',
'@angular/core': 'ng.core',
'@angular/common': 'ng.common',
'@angular/common/http': 'ng.common.http',
'@angular/compiler': 'ng.compiler',
'@angular/http': 'ng.http',
'@angular/platform-browser': 'ng.platformBrowser',
'@angular/platform-browser/animations': 'ng.platformBrowser.animations',
'@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic',
'rxjs/Observable': 'Rx',
'rxjs/Observer': 'Rx',
'rxjs/Subject': 'Rx',
'rxjs/Subscription': 'Rx',
'rxjs/operator/toPromise': 'Rx.Observable.prototype',
'rxjs/operator/filter': 'Rx.Observable.prototype',
'rxjs/operator/first': 'Rx.Observable.prototype'
};
module.exports = {
entry: '../../dist/packages-dist/platform-server/esm5/platform-server.js',
dest: '../../dist/packages-dist/platform-server/bundles/platform-server.umd.js',
format: 'umd',
exports: 'named',
amd: {id: '@angular/platform-server'},
moduleName: 'ng.platformServer',
plugins: [resolve(), sourcemaps()],
external: Object.keys(globals),
globals: globals
};
|
let x: typeof import('./x');
let Y: import('./y').Y;
let z: import("/z").foo.bar<string>; |
/*
Copyright 2013 Sub Protocol and other contributors
http://subprotocol.com/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
// A simple 2-dimensional vector implementation
module.exports = Vec2
function Vec2(x, y) {
this.x = x || 0;
this.y = y || 0;
}
Vec2.prototype.add = function(v) {
return new Vec2(this.x + v.x, this.y + v.y);
}
Vec2.prototype.sub = function(v) {
return new Vec2(this.x - v.x, this.y - v.y);
}
Vec2.prototype.mul = function(v) {
return new Vec2(this.x * v.x, this.y * v.y);
}
Vec2.prototype.div = function(v) {
return new Vec2(this.x / v.x, this.y / v.y);
}
Vec2.prototype.scale = function(coef) {
return new Vec2(this.x*coef, this.y*coef);
}
Vec2.prototype.mutableSet = function(v) {
this.x = v.x;
this.y = v.y;
return this;
}
Vec2.prototype.mutableAdd = function(v) {
this.x += v.x;
this.y += v.y;
return this;
}
Vec2.prototype.mutableSub = function(v) {
this.x -= v.x;
this.y -= v.y;
return this;
}
Vec2.prototype.mutableMul = function(v) {
this.x *= v.x;
this.y *= v.y;
return this;
}
Vec2.prototype.mutableDiv = function(v) {
this.x /= v.x;
this.y /= v.y;
return this;
}
Vec2.prototype.mutableScale = function(coef) {
this.x *= coef;
this.y *= coef;
return this;
}
Vec2.prototype.equals = function(v) {
return this.x == v.x && this.y == v.y;
}
Vec2.prototype.epsilonEquals = function(v, epsilon) {
return Math.abs(this.x - v.x) <= epsilon && Math.abs(this.y - v.y) <= epsilon;
}
Vec2.prototype.length = function(v) {
return Math.sqrt(this.x*this.x + this.y*this.y);
}
Vec2.prototype.length2 = function(v) {
return this.x*this.x + this.y*this.y;
}
Vec2.prototype.dist = function(v) {
return Math.sqrt(this.dist2(v));
}
Vec2.prototype.dist2 = function(v) {
var x = v.x - this.x;
var y = v.y - this.y;
return x*x + y*y;
}
Vec2.prototype.normal = function() {
var m = Math.sqrt(this.x*this.x + this.y*this.y);
return new Vec2(this.x/m, this.y/m);
}
Vec2.prototype.dot = function(v) {
return this.x*v.x + this.y*v.y;
}
Vec2.prototype.angle = function(v) {
return Math.atan2(this.x*v.y-this.y*v.x,this.x*v.x+this.y*v.y);
}
Vec2.prototype.angle2 = function(vLeft, vRight) {
return vLeft.sub(this).angle(vRight.sub(this));
}
Vec2.prototype.rotate = function(origin, theta) {
var x = this.x - origin.x;
var y = this.y - origin.y;
return new Vec2(x*Math.cos(theta) - y*Math.sin(theta) + origin.x, x*Math.sin(theta) + y*Math.cos(theta) + origin.y);
}
Vec2.prototype.toString = function() {
return "(" + this.x + ", " + this.y + ")";
}
function test_Vec2() {
var assert = function(label, expression) {
console.log("Vec2(" + label + "): " + (expression == true ? "PASS" : "FAIL"));
if (expression != true)
throw "assertion failed";
};
assert("equality", (new Vec2(5,3).equals(new Vec2(5,3))));
assert("epsilon equality", (new Vec2(1,2).epsilonEquals(new Vec2(1.01,2.02), 0.03)));
assert("epsilon non-equality", !(new Vec2(1,2).epsilonEquals(new Vec2(1.01,2.02), 0.01)));
assert("addition", (new Vec2(1,1)).add(new Vec2(2, 3)).equals(new Vec2(3, 4)));
assert("subtraction", (new Vec2(4,3)).sub(new Vec2(2, 1)).equals(new Vec2(2, 2)));
assert("multiply", (new Vec2(2,4)).mul(new Vec2(2, 1)).equals(new Vec2(4, 4)));
assert("divide", (new Vec2(4,2)).div(new Vec2(2, 2)).equals(new Vec2(2, 1)));
assert("scale", (new Vec2(4,3)).scale(2).equals(new Vec2(8, 6)));
assert("mutable set", (new Vec2(1,1)).mutableSet(new Vec2(2, 3)).equals(new Vec2(2, 3)));
assert("mutable addition", (new Vec2(1,1)).mutableAdd(new Vec2(2, 3)).equals(new Vec2(3, 4)));
assert("mutable subtraction", (new Vec2(4,3)).mutableSub(new Vec2(2, 1)).equals(new Vec2(2, 2)));
assert("mutable multiply", (new Vec2(2,4)).mutableMul(new Vec2(2, 1)).equals(new Vec2(4, 4)));
assert("mutable divide", (new Vec2(4,2)).mutableDiv(new Vec2(2, 2)).equals(new Vec2(2, 1)));
assert("mutable scale", (new Vec2(4,3)).mutableScale(2).equals(new Vec2(8, 6)));
assert("length", Math.abs((new Vec2(4,4)).length() - 5.65685) <= 0.00001);
assert("length2", (new Vec2(2,4)).length2() == 20);
assert("dist", Math.abs((new Vec2(2,4)).dist(new Vec2(3,5)) - 1.4142135) <= 0.000001);
assert("dist2", (new Vec2(2,4)).dist2(new Vec2(3,5)) == 2);
var normal = (new Vec2(2,4)).normal()
assert("normal", Math.abs(normal.length() - 1.0) <= 0.00001 && normal.epsilonEquals(new Vec2(0.4472, 0.89443), 0.0001));
assert("dot", (new Vec2(2,3)).dot(new Vec2(4,1)) == 11);
assert("angle", (new Vec2(0,-1)).angle(new Vec2(1,0))*(180/Math.PI) == 90);
assert("angle2", (new Vec2(1,1)).angle2(new Vec2(1,0), new Vec2(2,1))*(180/Math.PI) == 90);
assert("rotate", (new Vec2(2,0)).rotate(new Vec2(1,0), Math.PI/2).equals(new Vec2(1,1)));
assert("toString", (new Vec2(2,4)) == "(2, 4)");
}
|
module.exports={A:{A:{"1":"B A","2":"J C G E VB"},B:{"1":"D Y g H L"},C:{"1":"0 1 3 4 5 S T U V W X v Z a b c d e f K h i j k l m n o p q r s x y u t","2":"TB z RB QB","33":"A D Y g H L M N O P Q R","164":"F I J C G E B"},D:{"1":"0 1 3 4 5 9 T U V W X v Z a b c d e f K h i j k l m n o p q r s x y u t FB BB UB CB DB","2":"F I J C G E","33":"R S","164":"N O P Q","420":"B A D Y g H L M"},E:{"1":"C G E B A HB IB JB KB LB","2":"8 F I EB GB","33":"J"},F:{"1":"H L M N O P Q R S T U V W X v Z a b c d e f K h i j k l m n o p q r s","2":"6 7 E A D MB NB OB PB SB w"},G:{"1":"G A YB ZB aB bB cB dB","2":"2 8 AB WB","33":"XB"},H:{"2":"eB"},I:{"1":"t jB kB","2":"2 z F fB gB hB iB"},J:{"1":"B","2":"C"},K:{"1":"K","2":"6 7 B A D w"},L:{"1":"9"},M:{"1":"u"},N:{"1":"B A"},O:{"1":"lB"},P:{"1":"F I"},Q:{"1":"mB"},R:{"1":"nB"}},B:1,C:"requestAnimationFrame"};
|
/* globals LDAP:true, LDAPJS */
/* exported LDAP */
const ldapjs = LDAPJS;
const logger = new Logger('LDAP', {
sections: {
connection: 'Connection',
bind: 'Bind',
search: 'Search',
auth: 'Auth'
}
});
LDAP = class LDAP {
constructor() {
const self = this;
self.ldapjs = ldapjs;
self.connected = false;
self.options = {
host: RocketChat.settings.get('LDAP_Host'),
port: RocketChat.settings.get('LDAP_Port'),
connect_timeout: RocketChat.settings.get('LDAP_Connect_Timeout'),
idle_timeout: RocketChat.settings.get('LDAP_Idle_Timeout'),
encryption: RocketChat.settings.get('LDAP_Encryption'),
ca_cert: RocketChat.settings.get('LDAP_CA_Cert'),
reject_unauthorized: RocketChat.settings.get('LDAP_Reject_Unauthorized') || false,
domain_base: RocketChat.settings.get('LDAP_Domain_Base'),
use_custom_domain_search: RocketChat.settings.get('LDAP_Use_Custom_Domain_Search'),
custom_domain_search: RocketChat.settings.get('LDAP_Custom_Domain_Search'),
domain_search_user: RocketChat.settings.get('LDAP_Domain_Search_User'),
domain_search_password: RocketChat.settings.get('LDAP_Domain_Search_Password'),
domain_search_filter: RocketChat.settings.get('LDAP_Domain_Search_Filter'),
domain_search_user_id: RocketChat.settings.get('LDAP_Domain_Search_User_ID'),
domain_search_object_class: RocketChat.settings.get('LDAP_Domain_Search_Object_Class'),
domain_search_object_category: RocketChat.settings.get('LDAP_Domain_Search_Object_Category'),
group_filter_enabled: RocketChat.settings.get('LDAP_Group_Filter_Enable'),
group_filter_object_class: RocketChat.settings.get('LDAP_Group_Filter_ObjectClass'),
group_filter_group_id_attribute: RocketChat.settings.get('LDAP_Group_Filter_Group_Id_Attribute'),
group_filter_group_member_attribute: RocketChat.settings.get('LDAP_Group_Filter_Group_Member_Attribute'),
group_filter_group_member_format: RocketChat.settings.get('LDAP_Group_Filter_Group_Member_Format'),
group_filter_group_name: RocketChat.settings.get('LDAP_Group_Filter_Group_Name')
};
self.connectSync = Meteor.wrapAsync(self.connectAsync, self);
self.searchAllSync = Meteor.wrapAsync(self.searchAllAsync, self);
}
connectAsync(callback) {
const self = this;
logger.connection.info('Init setup');
let replied = false;
const connectionOptions = {
url: `${ self.options.host }:${ self.options.port }`,
timeout: 1000 * 60 * 10,
connectTimeout: self.options.connect_timeout,
idleTimeout: self.options.idle_timeout,
reconnect: false
};
const tlsOptions = {
rejectUnauthorized: self.options.reject_unauthorized
};
if (self.options.ca_cert && self.options.ca_cert !== '') {
// Split CA cert into array of strings
const chainLines = RocketChat.settings.get('LDAP_CA_Cert').split('\n');
let cert = [];
const ca = [];
chainLines.forEach(function(line) {
cert.push(line);
if (line.match(/-END CERTIFICATE-/)) {
ca.push(cert.join('\n'));
cert = [];
}
});
tlsOptions.ca = ca;
}
if (self.options.encryption === 'ssl') {
connectionOptions.url = `ldaps://${ connectionOptions.url }`;
connectionOptions.tlsOptions = tlsOptions;
} else {
connectionOptions.url = `ldap://${ connectionOptions.url }`;
}
logger.connection.info('Connecting', connectionOptions.url);
logger.connection.debug('connectionOptions', connectionOptions);
self.client = ldapjs.createClient(connectionOptions);
self.bindSync = Meteor.wrapAsync(self.client.bind, self.client);
self.client.on('error', function(error) {
logger.connection.error('connection', error);
if (replied === false) {
replied = true;
callback(error, null);
}
});
if (self.options.encryption === 'tls') {
// Set host parameter for tls.connect which is used by ldapjs starttls. This shouldn't be needed in newer nodejs versions (e.g v5.6.0).
// https://github.com/RocketChat/Rocket.Chat/issues/2035
// https://github.com/mcavage/node-ldapjs/issues/349
tlsOptions.host = self.options.host;
logger.connection.info('Starting TLS');
logger.connection.debug('tlsOptions', tlsOptions);
self.client.starttls(tlsOptions, null, function(error, response) {
if (error) {
logger.connection.error('TLS connection', error);
if (replied === false) {
replied = true;
callback(error, null);
}
return;
}
logger.connection.info('TLS connected');
self.connected = true;
if (replied === false) {
replied = true;
callback(null, response);
}
});
} else {
self.client.on('connect', function(response) {
logger.connection.info('LDAP connected');
self.connected = true;
if (replied === false) {
replied = true;
callback(null, response);
}
});
}
setTimeout(function() {
if (replied === false) {
logger.connection.error('connection time out', connectionOptions.timeout);
replied = true;
callback(new Error('Timeout'));
}
}, connectionOptions.timeout);
}
getDomainBindSearch() {
const self = this;
if (self.options.use_custom_domain_search === true) {
let custom_domain_search;
try {
custom_domain_search = JSON.parse(self.options.custom_domain_search);
} catch (error) {
throw new Error('Invalid Custom Domain Search JSON');
}
return {
filter: custom_domain_search.filter,
domain_search_user: custom_domain_search.userDN || '',
domain_search_password: custom_domain_search.password || ''
};
}
const filter = ['(&'];
if (self.options.domain_search_object_category !== '') {
filter.push(`(objectCategory=${ self.options.domain_search_object_category })`);
}
if (self.options.domain_search_object_class !== '') {
filter.push(`(objectclass=${ self.options.domain_search_object_class })`);
}
if (self.options.domain_search_filter !== '') {
filter.push(`(${ self.options.domain_search_filter })`);
}
const domain_search_user_id = self.options.domain_search_user_id.split(',');
if (domain_search_user_id.length === 1) {
filter.push(`(${ domain_search_user_id[0] }=#{username})`);
} else {
filter.push('(|');
domain_search_user_id.forEach((item) => {
filter.push(`(${ item }=#{username})`);
});
filter.push(')');
}
filter.push(')');
return {
filter: filter.join(''),
domain_search_user: self.options.domain_search_user || '',
domain_search_password: self.options.domain_search_password || ''
};
}
bindIfNecessary() {
const self = this;
if (self.domainBinded === true) {
return;
}
const domain_search = self.getDomainBindSearch();
if (domain_search.domain_search_user !== '' && domain_search.domain_search_password !== '') {
logger.bind.info('Binding admin user', domain_search.domain_search_user);
self.bindSync(domain_search.domain_search_user, domain_search.domain_search_password);
self.domainBinded = true;
}
}
searchUsersSync(username) {
const self = this;
self.bindIfNecessary();
const domain_search = self.getDomainBindSearch();
const searchOptions = {
filter: domain_search.filter.replace(/#{username}/g, username),
scope: 'sub'
};
logger.search.info('Searching user', username);
logger.search.debug('searchOptions', searchOptions);
logger.search.debug('domain_base', self.options.domain_base);
return self.searchAllSync(self.options.domain_base, searchOptions);
}
getUserByIdSync(id, attribute) {
const self = this;
self.bindIfNecessary();
const Unique_Identifier_Field = RocketChat.settings.get('LDAP_Unique_Identifier_Field').split(',');
let filter;
if (attribute) {
filter = new self.ldapjs.filters.EqualityFilter({
attribute,
value: new Buffer(id, 'hex')
});
} else {
const filters = [];
Unique_Identifier_Field.forEach(function(item) {
filters.push(new self.ldapjs.filters.EqualityFilter({
attribute: item,
value: new Buffer(id, 'hex')
}));
});
filter = new self.ldapjs.filters.OrFilter({filters});
}
const searchOptions = {
filter,
scope: 'sub'
};
logger.search.info('Searching by id', id);
logger.search.debug('search filter', searchOptions.filter.toString());
logger.search.debug('domain_base', self.options.domain_base);
const result = self.searchAllSync(self.options.domain_base, searchOptions);
if (!Array.isArray(result) || result.length === 0) {
return;
}
if (result.length > 1) {
logger.search.error('Search by id', id, 'returned', result.length, 'records');
}
return result[0];
}
getUserByUsernameSync(username) {
const self = this;
self.bindIfNecessary();
const domain_search = self.getDomainBindSearch();
const searchOptions = {
filter: domain_search.filter.replace(/#{username}/g, username),
scope: 'sub'
};
logger.search.info('Searching user', username);
logger.search.debug('searchOptions', searchOptions);
logger.search.debug('domain_base', self.options.domain_base);
const result = self.searchAllSync(self.options.domain_base, searchOptions);
if (!Array.isArray(result) || result.length === 0) {
return;
}
if (result.length > 1) {
logger.search.error('Search by username', username, 'returned', result.length, 'records');
}
return result[0];
}
isUserInGroup(username) {
const self = this;
if (!self.options.group_filter_enabled) {
return true;
}
const filter = ['(&'];
if (self.options.group_filter_object_class !== '') {
filter.push(`(objectclass=${ self.options.group_filter_object_class })`);
}
if (self.options.group_filter_group_member_attribute !== '') {
filter.push(`(${ self.options.group_filter_group_member_attribute }=${ self.options.group_filter_group_member_format })`);
}
if (self.options.group_filter_group_id_attribute !== '') {
filter.push(`(${ self.options.group_filter_group_id_attribute }=${ self.options.group_filter_group_name })`);
}
filter.push(')');
const searchOptions = {
filter: filter.join('').replace(/#{username}/g, username),
scope: 'sub'
};
logger.search.debug('Group filter LDAP:', searchOptions.filter);
const result = self.searchAllSync(self.options.domain_base, searchOptions);
if (!Array.isArray(result) || result.length === 0) {
return false;
}
return true;
}
searchAllAsync(domain_base, options, callback) {
const self = this;
self.client.search(domain_base, options, function(error, res) {
if (error) {
logger.search.error(error);
callback(error);
return;
}
res.on('error', function(error) {
logger.search.error(error);
callback(error);
return;
});
const entries = [];
const jsonEntries = [];
res.on('searchEntry', function(entry) {
entries.push(entry);
jsonEntries.push(entry.json);
});
res.on('end', function(/*result*/) {
logger.search.info('Search result count', entries.length);
logger.search.debug('Search result', JSON.stringify(jsonEntries, null, 2));
callback(null, entries);
});
});
}
authSync(dn, password) {
const self = this;
logger.auth.info('Authenticating', dn);
try {
self.bindSync(dn, password);
logger.auth.info('Authenticated', dn);
return true;
} catch (error) {
logger.auth.info('Not authenticated', dn);
logger.auth.debug('error', error);
return false;
}
}
disconnect() {
const self = this;
self.connected = false;
logger.connection.info('Disconecting');
self.client.unbind();
}
};
|
/*!
* froala_editor v2.7.3 (https://www.froala.com/wysiwyg-editor)
* License https://froala.com/wysiwyg-editor/terms/
* Copyright 2014-2017 Froala Labs
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node/CommonJS
module.exports = function( root, jQuery ) {
if ( jQuery === undefined ) {
// require('jQuery') returns a factory that requires window to
// build a jQuery instance, we normalize how we use modules
// that require this pattern but the window provided is a noop
// if it's defined (how jquery works)
if ( typeof window !== 'undefined' ) {
jQuery = require('jquery');
}
else {
jQuery = require('jquery')(root);
}
}
return factory(jQuery);
};
} else {
// Browser globals
factory(window.jQuery);
}
}(function ($) {
/**
* Hebrew
*/
$.FE.LANGUAGE['he'] = {
translation: {
// Place holder
"Type something": "\u05d4\u05e7\u05dc\u05d3 \u05db\u05d0\u05df",
// Basic formatting
"Bold": "\u05de\u05d5\u05d3\u05d2\u05e9",
"Italic": "\u05de\u05d5\u05d8\u05d4",
"Underline": "\u05e7\u05d5 \u05ea\u05d7\u05ea\u05d9",
"Strikethrough": "\u05e7\u05d5 \u05d0\u05de\u05e6\u05e2\u05d9",
// Main buttons
"Insert": "\u05d4\u05d5\u05e1\u05e4\u05ea",
"Delete": "\u05de\u05d7\u05d9\u05e7\u05d4",
"Cancel": "\u05d1\u05d9\u05d8\u05d5\u05dc",
"OK": "\u05d1\u05e6\u05e2",
"Back": "\u05d1\u05d7\u05d6\u05e8\u05d4",
"Remove": "\u05d4\u05e1\u05e8",
"More": "\u05d9\u05d5\u05ea\u05e8",
"Update": "\u05e2\u05d3\u05db\u05d5\u05df",
"Style": "\u05e1\u05d2\u05e0\u05d5\u05df",
// Font
"Font Family": "\u05d2\u05d5\u05e4\u05df",
"Font Size": "\u05d2\u05d5\u05d3\u05dc \u05d4\u05d2\u05d5\u05e4\u05df",
// Colors
"Colors": "\u05e6\u05d1\u05e2\u05d9\u05dd",
"Background": "\u05e8\u05e7\u05e2",
"Text": "\u05d4\u05d8\u05e1\u05d8",
"HEX Color": "צבע הקס",
// Paragraphs
"Paragraph Format": "\u05e4\u05d5\u05e8\u05de\u05d8",
"Normal": "\u05e8\u05d2\u05d9\u05dc",
"Code": "\u05e7\u05d5\u05d3",
"Heading 1": "1 \u05db\u05d5\u05ea\u05e8\u05ea",
"Heading 2": "2 \u05db\u05d5\u05ea\u05e8\u05ea",
"Heading 3": "3 \u05db\u05d5\u05ea\u05e8\u05ea",
"Heading 4": "4 \u05db\u05d5\u05ea\u05e8\u05ea",
// Style
"Paragraph Style": "\u05e1\u05d2\u05e0\u05d5\u05df \u05e4\u05e1\u05e7\u05d4",
"Inline Style": "\u05e1\u05d2\u05e0\u05d5\u05df \u05de\u05d5\u05d1\u05e0\u05d4",
// Alignment
"Align": "\u05d9\u05d9\u05e9\u05d5\u05e8",
"Align Left": "\u05d9\u05d9\u05e9\u05d5\u05e8 \u05dc\u05e9\u05de\u05d0\u05dc",
"Align Center": "\u05d9\u05d9\u05e9\u05d5\u05e8 \u05dc\u05de\u05e8\u05db\u05d6",
"Align Right": "\u05d9\u05d9\u05e9\u05d5\u05e8 \u05dc\u05d9\u05de\u05d9\u05df",
"Align Justify": "\u05d9\u05d9\u05e9\u05d5\u05e8 \u05de\u05dc\u05d0",
"None": "\u05d0\u05e3 \u05d0\u05d7\u05d3",
// Lists
"Ordered List": "\u05d4\u05d5\u05e1\u05e4\u05ea \u05e8\u05e9\u05d9\u05de\u05d4 \u05de\u05de\u05d5\u05e1\u05e4\u05e8\u05ea",
"Unordered List": "\u05d4\u05d5\u05e1\u05e4\u05ea \u05e8\u05e9\u05d9\u05de\u05d4",
// Indent
"Decrease Indent": "\u05d4\u05e7\u05d8\u05e0\u05ea \u05db\u05e0\u05d9\u05e1\u05d4",
"Increase Indent": "\u05d4\u05d2\u05d3\u05dc\u05ea \u05db\u05e0\u05d9\u05e1\u05d4",
// Links
"Insert Link": "\u05d4\u05d5\u05e1\u05e4\u05ea \u05e7\u05d9\u05e9\u05d5\u05e8",
"Open in new tab": "\u05dc\u05e4\u05ea\u05d5\u05d7 \u05d1\u05d8\u05d0\u05d1 \u05d7\u05d3\u05e9",
"Open Link": "\u05e7\u05d9\u05e9\u05d5\u05e8 \u05e4\u05ea\u05d5\u05d7",
"Edit Link": "\u05e7\u05d9\u05e9\u05d5\u05e8 \u05e2\u05e8\u05d9\u05db\u05d4",
"Unlink": "\u05d4\u05e1\u05e8\u05ea \u05d4\u05e7\u05d9\u05e9\u05d5\u05e8",
"Choose Link": "\u05dc\u05d1\u05d7\u05d5\u05e8 \u05e7\u05d9\u05e9\u05d5\u05e8",
// Images
"Insert Image": "\u05d4\u05d5\u05e1\u05e4\u05ea \u05ea\u05de\u05d5\u05e0\u05d4",
"Upload Image": "\u05ea\u05de\u05d5\u05e0\u05ea \u05d4\u05e2\u05dc\u05d0\u05d4",
"By URL": "URL \u05e2\u05dc \u05d9\u05d3\u05d9",
"Browse": "\u05dc\u05d2\u05dc\u05d5\u05e9",
"Drop image": "\u05e9\u05d7\u05e8\u05e8 \u05d0\u05ea \u05d4\u05ea\u05de\u05d5\u05e0\u05d4 \u05db\u05d0\u05df",
"or click": "\u05d0\u05d5 \u05dc\u05d7\u05e5",
"Manage Images": "\u05e0\u05d9\u05d4\u05d5\u05dc \u05d4\u05ea\u05de\u05d5\u05e0\u05d5\u05ea",
"Loading": "\u05d8\u05e2\u05d9\u05e0\u05d4",
"Deleting": "\u05de\u05d7\u05d9\u05e7\u05d4",
"Tags": "\u05ea\u05d2\u05d9\u05dd",
"Are you sure? Image will be deleted.": "\u05d4\u05d0\u05dd \u05d0\u05ea\u05d4 \u05d1\u05d8\u05d5\u05d7\u003f \u05d4\u05ea\u05de\u05d5\u05e0\u05d4 \u05ea\u05de\u05d7\u05e7\u002e",
"Replace": "\u05dc\u05d4\u05d7\u05dc\u05d9\u05e3",
"Uploading": "\u05d4\u05e2\u05dc\u05d0\u05d4",
"Loading image": "\u05ea\u05de\u05d5\u05e0\u05ea \u05d8\u05e2\u05d9\u05e0\u05d4",
"Display": "\u05ea\u05e6\u05d5\u05d2\u05d4",
"Inline": "\u05d1\u05e9\u05d5\u05e8\u05d4",
"Break Text": "\u05d8\u05e7\u05e1\u05d8 \u05d4\u05e4\u05e1\u05e7\u05d4",
"Alternate Text": "\u05d8\u05e7\u05e1\u05d8 \u05d7\u05dc\u05d5\u05e4\u05d9",
"Change Size": "\u05d2\u05d5\u05d3\u05dc \u05e9\u05d9\u05e0\u05d5\u05d9",
"Width": "\u05e8\u05d5\u05d7\u05d1",
"Height": "\u05d2\u05d5\u05d1\u05d4",
"Something went wrong. Please try again.": "\u05de\u05e9\u05d4\u05d5 \u05d4\u05e9\u05ea\u05d1\u05e9. \u05d1\u05d1\u05e7\u05e9\u05d4 \u05e0\u05e1\u05d4 \u05e9\u05d5\u05d1.",
"Image Caption": "כיתוב תמונה",
"Advanced Edit": "עריכה מתקדמת",
// Video
"Insert Video": "\u05d4\u05d5\u05e1\u05e4\u05ea \u05d5\u05d9\u05d3\u05d9\u05d0\u05d5",
"Embedded Code": "\u05e7\u05d5\u05d3 \u05de\u05d5\u05d8\u05d1\u05e2",
"Paste in a video URL": "הדבק בכתובת אתר של סרטון",
"Drop video": "ירידה וידאו",
"Your browser does not support HTML5 video.": "הדפדפן שלך אינו תומך וידאו html5.",
"Upload Video": "להעלות וידאו",
// Tables
"Insert Table": "\u05d4\u05db\u05e0\u05e1 \u05d8\u05d1\u05dc\u05d4",
"Table Header": "\u05db\u05d5\u05ea\u05e8\u05ea \u05d8\u05d1\u05dc\u05d4",
"Remove Table": "\u05d4\u05e1\u05e8 \u05e9\u05d5\u05dc\u05d7\u05df",
"Table Style": "\u05e1\u05d2\u05e0\u05d5\u05df \u05d8\u05d1\u05dc\u05d4",
"Horizontal Align": "\u05d0\u05d5\u05e4\u05e7\u05d9\u05ea \u05dc\u05d9\u05d9\u05e9\u05e8",
"Row": "\u05e9\u05d5\u05e8\u05d4",
"Insert row above": "\u05d4\u05d5\u05e1\u05e4\u05ea \u05e9\u05d5\u05e8\u05d4 \u05dc\u05e4\u05e0\u05d9",
"Insert row below": "\u05d4\u05d5\u05e1\u05e4\u05ea \u05e9\u05d5\u05e8\u05d4 \u05d0\u05d7\u05e8\u05d9",
"Delete row": "\u05de\u05d7\u05d9\u05e7\u05ea \u05e9\u05d5\u05e8\u05d4",
"Column": "\u05d8\u05d5\u05e8",
"Insert column before": "\u05d4\u05d5\u05e1\u05e4\u05ea \u05d8\u05d5\u05e8 \u05dc\u05e4\u05e0\u05d9",
"Insert column after": "\u05d4\u05d5\u05e1\u05e4\u05ea \u05d8\u05d5\u05e8 \u05d0\u05d7\u05e8\u05d9",
"Delete column": "\u05de\u05d7\u05d9\u05e7\u05ea \u05d8\u05d5\u05e8",
"Cell": "\u05ea\u05d0",
"Merge cells": "\u05de\u05d6\u05d2 \u05ea\u05d0\u05d9\u05dd",
"Horizontal split": "\u05e4\u05e6\u05dc \u05d0\u05d5\u05e4\u05e7\u05d9",
"Vertical split": "\u05e4\u05e6\u05dc \u05d0\u05e0\u05db\u05d9",
"Cell Background": "\u05e8\u05e7\u05e2 \u05ea\u05d0",
"Vertical Align": "\u05d9\u05d9\u05e9\u05d5\u05e8 \u05d0\u05e0\u05db\u05d9",
"Top": "\u05e2\u05b6\u05dc\u05b4\u05d9\u05d5\u05b9\u05df",
"Middle": "\u05ea\u05b4\u05d9\u05db\u05d5\u05b9\u05e0\u05b4\u05d9",
"Bottom": "\u05ea\u05d7\u05ea\u05d5\u05df",
"Align Top": "\u05dc\u05d9\u05d9\u05e9\u05e8 \u05e2\u05b6\u05dc\u05b4\u05d9\u05d5\u05b9\u05df",
"Align Middle": "\u05dc\u05d9\u05d9\u05e9\u05e8 \u05ea\u05b4\u05d9\u05db\u05d5\u05b9\u05e0\u05b4\u05d9",
"Align Bottom": "\u05dc\u05d9\u05d9\u05e9\u05e8 \u05ea\u05d7\u05ea\u05d5\u05df",
"Cell Style": "\u05e1\u05d2\u05e0\u05d5\u05df \u05ea\u05d0",
// Files
"Upload File": "\u05d4\u05e2\u05dc\u05d0\u05ea \u05e7\u05d5\u05d1\u05e5",
"Drop file": "\u05d6\u05e8\u05d5\u05e7 \u05e7\u05d5\u05d1\u05e5 \u05db\u05d0\u05df",
// Emoticons
"Emoticons": "\u05e1\u05de\u05d9\u05d9\u05dc\u05d9\u05dd",
"Grinning face": "\u05d7\u05d9\u05d9\u05da \u05e4\u05e0\u05d9\u05dd",
"Grinning face with smiling eyes": "\u05d7\u05d9\u05d9\u05da \u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05e2\u05d9\u05e0\u05d9\u05d9\u05dd \u05de\u05d7\u05d9\u05d9\u05db\u05d5\u05ea",
"Face with tears of joy": "\u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05d3\u05de\u05e2\u05d5\u05ea \u05e9\u05dc \u05e9\u05de\u05d7\u05d4",
"Smiling face with open mouth": "\u05d7\u05d9\u05d5\u05da \u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05e4\u05d4 \u05e4\u05ea\u05d5\u05d7",
"Smiling face with open mouth and smiling eyes": "\u05d7\u05d9\u05d5\u05da \u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05e4\u05d4 \u05e4\u05ea\u05d5\u05d7 \u05d5\u05de\u05d7\u05d9\u05d9\u05da \u05e2\u05d9\u05e0\u05d9\u05d9\u05dd",
"Smiling face with open mouth and cold sweat": "\u05d7\u05d9\u05d5\u05da \u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05e4\u05d4 \u05e4\u05ea\u05d5\u05d7 \u05d5\u05d6\u05d9\u05e2\u05d4 \u05e7\u05e8\u05d4",
"Smiling face with open mouth and tightly-closed eyes": "\u05d7\u05d9\u05d5\u05da \u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05e4\u05d4 \u05e4\u05ea\u05d5\u05d7 \u05d5\u05e2\u05d9\u05e0\u05d9\u05d9\u05dd \u05d1\u05d7\u05d5\u05d6\u05e7\u05d4\u002d\u05e1\u05d2\u05d5\u05e8\u05d5\u05ea",
"Smiling face with halo": "\u05d7\u05d9\u05d5\u05da \u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05d4\u05d9\u05dc\u05d4",
"Smiling face with horns": "\u05d7\u05d9\u05d5\u05da \u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05e7\u05e8\u05e0\u05d5\u05ea",
"Winking face": "\u05e7\u05e8\u05d9\u05e6\u05d4 \u05e4\u05e0\u05d9\u05dd",
"Smiling face with smiling eyes": "\u05d7\u05d9\u05d5\u05da \u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05e2\u05d9\u05e0\u05d9\u05d9\u05dd \u05de\u05d7\u05d9\u05d9\u05db\u05d5\u05ea",
"Face savoring delicious food": "\u05e4\u05e0\u05d9\u05dd \u05de\u05ea\u05e2\u05e0\u05d2 \u05d0\u05d5\u05db\u05dc \u05d8\u05e2\u05d9\u05dd",
"Relieved face": "\u05e4\u05e0\u05d9\u05dd \u05e9\u05dc \u05d4\u05e7\u05dc\u05d4",
"Smiling face with heart-shaped eyes": "\u05d7\u05d9\u05d5\u05da \u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05e2\u05d9\u05e0\u05d9\u05d9\u05dd \u05d1\u05e6\u05d5\u05e8\u05ea \u05dc\u05d1",
"Smiling face with sunglasses": "\u05d7\u05d9\u05d5\u05da \u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05de\u05e9\u05e7\u05e4\u05d9 \u05e9\u05de\u05e9",
"Smirking face": "\u05d4\u05d9\u05d0 \u05d7\u05d9\u05d9\u05db\u05d4 \u05d7\u05d9\u05d5\u05da \u05e0\u05d1\u05d6\u05d4 \u05e4\u05e0\u05d9\u05dd",
"Neutral face": "\u05e4\u05e0\u05d9\u05dd \u05e0\u05d9\u05d8\u05e8\u05dc\u05d9",
"Expressionless face": "\u05d1\u05e4\u05e0\u05d9\u05dd \u05d7\u05ea\u05d5\u05dd",
"Unamused face": "\u05e4\u05e0\u05d9\u05dd \u05dc\u05d0 \u05de\u05e9\u05d5\u05e2\u05e9\u05e2\u05d9\u05dd",
"Face with cold sweat": "\u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05d6\u05d9\u05e2\u05d4 \u05e7\u05e8\u05d4",
"Pensive face": "\u05d1\u05e4\u05e0\u05d9\u05dd \u05de\u05d4\u05d5\u05e8\u05d4\u05e8",
"Confused face": "\u05e4\u05e0\u05d9\u05dd \u05de\u05d1\u05d5\u05dc\u05d1\u05dc\u05d9\u05dd",
"Confounded face": "\u05e4\u05e0\u05d9\u05dd \u05de\u05d1\u05d5\u05dc\u05d1\u05dc",
"Kissing face": "\u05e0\u05e9\u05d9\u05e7\u05d5\u05ea \u05e4\u05e0\u05d9\u05dd",
"Face throwing a kiss": "\u05e4\u05e0\u05d9\u05dd \u05dc\u05d6\u05e8\u05d5\u05e7 \u05e0\u05e9\u05d9\u05e7\u05d4",
"Kissing face with smiling eyes": "\u05e0\u05e9\u05d9\u05e7\u05d5\u05ea \u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05e2\u05d9\u05e0\u05d9\u05d9\u05dd \u05de\u05d7\u05d9\u05d9\u05db\u05d5\u05ea",
"Kissing face with closed eyes": "\u05e0\u05e9\u05d9\u05e7\u05d5\u05ea \u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05e2\u05d9\u05e0\u05d9\u05d9\u05dd \u05e1\u05d2\u05d5\u05e8\u05d5\u05ea",
"Face with stuck out tongue": "\u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05dc\u05e9\u05d5\u05df \u05d1\u05dc\u05d8\u05d5",
"Face with stuck out tongue and winking eye": "\u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05dc\u05e9\u05d5\u05df \u05ea\u05e7\u05d5\u05e2\u05d4 \u05d4\u05d7\u05d5\u05e6\u05d4 \u05d5\u05e2\u05d9\u05df \u05e7\u05d5\u05e8\u05e6\u05ea",
"Face with stuck out tongue and tightly-closed eyes": "\u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05dc\u05e9\u05d5\u05df \u05ea\u05e7\u05d5\u05e2\u05d4 \u05d4\u05d7\u05d5\u05e6\u05d4 \u05d5\u05e2\u05d9\u05e0\u05d9\u05d9\u05dd \u05d1\u05d7\u05d5\u05d6\u05e7\u05d4\u002d\u05e1\u05d2\u05d5\u05e8\u05d5\u05ea",
"Disappointed face": "\u05e4\u05e0\u05d9\u05dd \u05de\u05d0\u05d5\u05db\u05d6\u05d1\u05d9\u05dd",
"Worried face": "\u05e4\u05e0\u05d9\u05dd \u05de\u05d5\u05d3\u05d0\u05d2\u05d9\u05dd",
"Angry face": "\u05e4\u05e0\u05d9\u05dd \u05db\u05d5\u05e2\u05e1\u05d9\u05dd",
"Pouting face": "\u05de\u05e9\u05d5\u05e8\u05d1\u05d1 \u05e4\u05e0\u05d9\u05dd",
"Crying face": "\u05d1\u05db\u05d9 \u05e4\u05e0\u05d9\u05dd",
"Persevering face": "\u05d4\u05ea\u05de\u05d3\u05ea \u05e4\u05e0\u05d9\u05dd",
"Face with look of triumph": "\u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05de\u05d1\u05d8 \u05e9\u05dc \u05e0\u05e6\u05d7\u05d5\u05df",
"Disappointed but relieved face": "\u05de\u05d0\u05d5\u05db\u05d6\u05d1 \u05d0\u05d1\u05dc \u05d4\u05d5\u05e7\u05dc \u05e4\u05e0\u05d9\u05dd",
"Frowning face with open mouth": "\u05e7\u05de\u05d8 \u05d0\u05ea \u05de\u05e6\u05d7 \u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05e4\u05d4 \u05e4\u05ea\u05d5\u05d7",
"Anguished face": "\u05e4\u05e0\u05d9\u05dd \u05de\u05d9\u05d5\u05e1\u05e8\u05d9\u05dd",
"Fearful face": "\u05e4\u05e0\u05d9\u05dd \u05e9\u05d7\u05e9\u05e9\u05d5",
"Weary face": "\u05e4\u05e0\u05d9\u05dd \u05d5\u05d9\u05e8\u05d9",
"Sleepy face": "\u05e4\u05e0\u05d9\u05dd \u05e9\u05dc \u05e1\u05dc\u05d9\u05e4\u05d9",
"Tired face": "\u05e4\u05e0\u05d9\u05dd \u05e2\u05d9\u05d9\u05e4\u05d9\u05dd",
"Grimacing face": "\u05d4\u05d5\u05d0 \u05d4\u05e2\u05d5\u05d5\u05d4 \u05d0\u05ea \u05e4\u05e0\u05d9 \u05e4\u05e0\u05d9\u05dd",
"Loudly crying face": "\u05d1\u05e7\u05d5\u05dc \u05e8\u05dd \u05d1\u05d5\u05db\u05d4 \u05e4\u05e0\u05d9\u05dd",
"Face with open mouth": "\u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05e4\u05d4 \u05e4\u05ea\u05d5\u05d7",
"Hushed face": "\u05e4\u05e0\u05d9\u05dd \u05e9\u05d5\u05e7\u05d8\u05d9\u05dd",
"Face with open mouth and cold sweat": "\u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05e4\u05d4 \u05e4\u05ea\u05d5\u05d7 \u05d5\u05d6\u05d9\u05e2\u05d4 \u05e7\u05e8\u05d4\u0022",
"Face screaming in fear": "\u05e4\u05e0\u05d9\u05dd \u05e6\u05d5\u05e8\u05d7\u05d9\u05dd \u05d1\u05e4\u05d7\u05d3",
"Astonished face": "\u05e4\u05e0\u05d9\u05d5 \u05e0\u05d3\u05d4\u05de\u05d5\u05ea",
"Flushed face": "\u05e4\u05e0\u05d9\u05d5 \u05e1\u05de\u05d5\u05e7\u05d5\u05ea",
"Sleeping face": "\u05e9\u05d9\u05e0\u05d4 \u05e4\u05e0\u05d9\u05dd",
"Dizzy face": "\u05e4\u05e0\u05d9\u05dd \u05e9\u05dc \u05d3\u05d9\u05d6\u05d9",
"Face without mouth": "\u05e4\u05e0\u05d9\u05dd \u05dc\u05dc\u05d0 \u05e4\u05d4",
"Face with medical mask": "\u05e4\u05e0\u05d9\u05dd \u05e2\u05dd \u05de\u05e1\u05db\u05d4 \u05e8\u05e4\u05d5\u05d0\u05d9\u05ea",
// Line breaker
"Break": "\u05d4\u05e4\u05e1\u05e7\u05d4",
// Math
"Subscript": "\u05db\u05ea\u05d1 \u05ea\u05d7\u05ea\u05d9",
"Superscript": "\u05e2\u05d9\u05dc\u05d9",
// Full screen
"Fullscreen": "\u05de\u05e1\u05da \u05de\u05dc\u05d0",
// Horizontal line
"Insert Horizontal Line": "\u05d4\u05d5\u05e1\u05e4\u05ea \u05e7\u05d5 \u05d0\u05d5\u05e4\u05e7\u05d9",
// Clear formatting
"Clear Formatting": "\u05dc\u05d4\u05e1\u05d9\u05e8 \u05e2\u05d9\u05e6\u05d5\u05d1",
// Undo, redo
"Undo": "\u05d1\u05d9\u05d8\u05d5\u05dc",
"Redo": "\u05d1\u05e6\u05e2 \u05e9\u05d5\u05d1",
// Select all
"Select All": "\u05d1\u05d7\u05e8 \u05d4\u05db\u05dc",
// Code view
"Code View": "\u05ea\u05e6\u05d5\u05d2\u05ea \u05e7\u05d5\u05d3",
// Quote
"Quote": "\u05e6\u05d9\u05d8\u05d5\u05d8",
"Increase": "\u05dc\u05d4\u05d2\u05d1\u05d9\u05e8",
"Decrease": "\u05d9\u05e8\u05d9\u05d3\u05d4",
// Quick Insert
"Quick Insert": "\u05db\u05e0\u05e1 \u05de\u05d4\u05d9\u05e8",
// Spcial Characters
"Special Characters": "תווים מיוחדים",
"Latin": "לָטִינִית",
"Greek": "יווני",
"Cyrillic": "קירילית",
"Punctuation": "פיסוק",
"Currency": "מַטְבֵּעַ",
"Arrows": "חצים",
"Math": "מתמטיקה",
"Misc": "שונות",
// Print.
"Print": "הדפס",
// Spell Checker.
"Spell Checker": "בודק איות",
// Help
"Help": "עֶזרָה",
"Shortcuts": "קיצורי דרך",
"Inline Editor": "עורך מוטבע",
"Show the editor": "להראות את העורך",
"Common actions": "פעולות נפוצות",
"Copy": "עותק",
"Cut": "גזירה",
"Paste": "לְהַדבִּיק",
"Basic Formatting": "עיצוב בסיסי",
"Increase quote level": "רמת ציטוט",
"Decrease quote level": "רמת ציטוט ירידה",
"Image / Video": "תמונה / וידאו",
"Resize larger": "גודל גדול יותר",
"Resize smaller": "גודל קטן יותר",
"Table": "שולחן",
"Select table cell": "בחר תא תא - -",
"Extend selection one cell": "להאריך את הבחירה תא אחד",
"Extend selection one row": "להאריך את הבחירה שורה אחת",
"Navigation": "ניווט",
"Focus popup / toolbar": "מוקד קופץ / סרגל הכלים",
"Return focus to previous position": "חזרה להתמקד קודם",
// Embed.ly
"Embed URL": "כתובת אתר להטביע",
"Paste in a URL to embed": "הדבק כתובת אתר להטביע",
// Word Paste.
"The pasted content is coming from a Microsoft Word document. Do you want to keep the format or clean it up?": "התוכן המודבק מגיע ממסמך Word של Microsoft. האם ברצונך לשמור את הפורמט או לנקות אותו?",
"Keep": "לִשְׁמוֹר",
"Clean": "לְנַקוֹת",
"Word Paste Detected": "הדבק מילה זוהתה"
},
direction: "rtl"
};
}));
|
/**
* theme.js
*
* Copyright, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
/*global tinymce:true */
tinymce.ThemeManager.add('modern', function(editor) {
var self = this, settings = editor.settings, Factory = tinymce.ui.Factory, each = tinymce.each, DOM = tinymce.DOM;
// Default menus
var defaultMenus = {
file: {title: 'File', items: 'newdocument'},
edit: {title: 'Edit', items: 'undo redo | cut copy paste pastetext | selectall'},
insert: {title: 'Insert', items: '|'},
view: {title: 'View', items: 'visualaid |'},
format: {title: 'Format', items: 'bold italic underline strikethrough superscript subscript | formats | removeformat'},
table: {title: 'Table'},
tools: {title: 'Tools'}
};
var defaultToolbar = "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | " +
"bullist numlist outdent indent | link image";
/**
* Creates the toolbars from config and returns a toolbar array.
*
* @return {Array} Array with toolbars.
*/
function createToolbars() {
var toolbars = [];
function addToolbar(items) {
var toolbarItems = [], buttonGroup;
if (!items) {
return;
}
each(items.split(/[ ,]/), function(item) {
var itemName;
function bindSelectorChanged() {
var selection = editor.selection;
if (itemName == "bullist") {
selection.selectorChanged('ul > li', function(state, args) {
var nodeName, i = args.parents.length;
while (i--) {
nodeName = args.parents[i].nodeName;
if (nodeName == "OL" || nodeName == "UL") {
break;
}
}
item.active(state && nodeName == "UL");
});
}
if (itemName == "numlist") {
selection.selectorChanged('ol > li', function(state, args) {
var nodeName, i = args.parents.length;
while (i--) {
nodeName = args.parents[i].nodeName;
if (nodeName == "OL" || nodeName == "UL") {
break;
}
}
item.active(state && nodeName == "OL");
});
}
if (item.settings.stateSelector) {
selection.selectorChanged(item.settings.stateSelector, function(state) {
item.active(state);
}, true);
}
if (item.settings.disabledStateSelector) {
selection.selectorChanged(item.settings.disabledStateSelector, function(state) {
item.disabled(state);
});
}
}
if (item == "|") {
buttonGroup = null;
} else {
if (Factory.has(item)) {
item = {type: item};
if (settings.toolbar_items_size) {
item.size = settings.toolbar_items_size;
}
toolbarItems.push(item);
buttonGroup = null;
} else {
if (!buttonGroup) {
buttonGroup = {type: 'buttongroup', items: []};
toolbarItems.push(buttonGroup);
}
if (editor.buttons[item]) {
// TODO: Move control creation to some UI class
itemName = item;
item = editor.buttons[itemName];
if (typeof(item) == "function") {
item = item();
}
item.type = item.type || 'button';
if (settings.toolbar_items_size) {
item.size = settings.toolbar_items_size;
}
item = Factory.create(item);
buttonGroup.items.push(item);
if (editor.initialized) {
bindSelectorChanged();
} else {
editor.on('init', bindSelectorChanged);
}
}
}
}
});
toolbars.push({type: 'toolbar', layout: 'flow', items: toolbarItems});
return true;
}
// Convert toolbar array to multiple options
if (tinymce.isArray(settings.toolbar)) {
// Empty toolbar array is the same as a disabled toolbar
if (settings.toolbar.length === 0) {
return;
}
tinymce.each(settings.toolbar, function(toolbar, i) {
settings["toolbar" + (i + 1)] = toolbar;
});
delete settings.toolbar;
}
// Generate toolbar<n>
for (var i = 1; i < 10; i++) {
if (!addToolbar(settings["toolbar" + i])) {
break;
}
}
// Generate toolbar or default toolbar unless it's disabled
if (!toolbars.length && settings.toolbar !== false) {
addToolbar(settings.toolbar || defaultToolbar);
}
if (toolbars.length) {
return {
type: 'panel',
layout: 'stack',
classes: "toolbar-grp",
ariaRoot: true,
ariaRemember: true,
items: toolbars
};
}
}
/**
* Creates the menu buttons based on config.
*
* @return {Array} Menu buttons array.
*/
function createMenuButtons() {
var name, menuButtons = [];
function createMenuItem(name) {
var menuItem;
if (name == '|') {
return {text: '|'};
}
menuItem = editor.menuItems[name];
return menuItem;
}
function createMenu(context) {
var menuButton, menu, menuItems, isUserDefined, removedMenuItems;
removedMenuItems = tinymce.makeMap((settings.removed_menuitems || '').split(/[ ,]/));
// User defined menu
if (settings.menu) {
menu = settings.menu[context];
isUserDefined = true;
} else {
menu = defaultMenus[context];
}
if (menu) {
menuButton = {text: menu.title};
menuItems = [];
// Default/user defined items
each((menu.items || '').split(/[ ,]/), function(item) {
var menuItem = createMenuItem(item);
if (menuItem && !removedMenuItems[item]) {
menuItems.push(createMenuItem(item));
}
});
// Added though context
if (!isUserDefined) {
each(editor.menuItems, function(menuItem) {
if (menuItem.context == context) {
if (menuItem.separator == 'before') {
menuItems.push({text: '|'});
}
if (menuItem.prependToContext) {
menuItems.unshift(menuItem);
} else {
menuItems.push(menuItem);
}
if (menuItem.separator == 'after') {
menuItems.push({text: '|'});
}
}
});
}
for (var i = 0; i < menuItems.length; i++) {
if (menuItems[i].text == '|') {
if (i === 0 || i == menuItems.length - 1) {
menuItems.splice(i, 1);
}
}
}
menuButton.menu = menuItems;
if (!menuButton.menu.length) {
return null;
}
}
return menuButton;
}
var defaultMenuBar = [];
if (settings.menu) {
for (name in settings.menu) {
defaultMenuBar.push(name);
}
} else {
for (name in defaultMenus) {
defaultMenuBar.push(name);
}
}
var enabledMenuNames = typeof(settings.menubar) == "string" ? settings.menubar.split(/[ ,]/) : defaultMenuBar;
for (var i = 0; i < enabledMenuNames.length; i++) {
var menu = enabledMenuNames[i];
menu = createMenu(menu);
if (menu) {
menuButtons.push(menu);
}
}
return menuButtons;
}
/**
* Adds accessibility shortcut keys to panel.
*
* @param {tinymce.ui.Panel} panel Panel to add focus to.
*/
function addAccessibilityKeys(panel) {
function focus(type) {
var item = panel.find(type)[0];
if (item) {
item.focus(true);
}
}
editor.shortcuts.add('Alt+F9', '', function() {
focus('menubar');
});
editor.shortcuts.add('Alt+F10', '', function() {
focus('toolbar');
});
editor.shortcuts.add('Alt+F11', '', function() {
focus('elementpath');
});
panel.on('cancel', function() {
editor.focus();
});
}
/**
* Resizes the editor to the specified width, height.
*/
function resizeTo(width, height) {
var containerElm, iframeElm, containerSize, iframeSize;
function getSize(elm) {
return {
width: elm.clientWidth,
height: elm.clientHeight
};
}
containerElm = editor.getContainer();
iframeElm = editor.getContentAreaContainer().firstChild;
containerSize = getSize(containerElm);
iframeSize = getSize(iframeElm);
if (width !== null) {
width = Math.max(settings.min_width || 100, width);
width = Math.min(settings.max_width || 0xFFFF, width);
DOM.setStyle(containerElm, 'width', width + (containerSize.width - iframeSize.width));
DOM.setStyle(iframeElm, 'width', width);
}
height = Math.max(settings.min_height || 100, height);
height = Math.min(settings.max_height || 0xFFFF, height);
DOM.setStyle(iframeElm, 'height', height);
editor.fire('ResizeEditor');
}
function resizeBy(dw, dh) {
var elm = editor.getContentAreaContainer();
self.resizeTo(elm.clientWidth + dw, elm.clientHeight + dh);
}
/**
* Renders the inline editor UI.
*
* @return {Object} Name/value object with theme data.
*/
function renderInlineUI(args) {
var panel, inlineToolbarContainer;
if (settings.fixed_toolbar_container) {
inlineToolbarContainer = DOM.select(settings.fixed_toolbar_container)[0];
}
function reposition() {
if (panel && panel.moveRel && panel.visible() && !panel._fixed) {
// TODO: This is kind of ugly and doesn't handle multiple scrollable elements
var scrollContainer = editor.selection.getScrollContainer(), body = editor.getBody();
var deltaX = 0, deltaY = 0;
if (scrollContainer) {
var bodyPos = DOM.getPos(body), scrollContainerPos = DOM.getPos(scrollContainer);
deltaX = Math.max(0, scrollContainerPos.x - bodyPos.x);
deltaY = Math.max(0, scrollContainerPos.y - bodyPos.y);
}
panel.fixed(false).moveRel(body, editor.rtl ? ['tr-br', 'br-tr'] : ['tl-bl', 'bl-tl', 'tr-br']).moveBy(deltaX, deltaY);
}
}
function show() {
if (panel) {
panel.show();
reposition();
DOM.addClass(editor.getBody(), 'mce-edit-focus');
}
}
function hide() {
if (panel) {
panel.hide();
DOM.removeClass(editor.getBody(), 'mce-edit-focus');
}
}
function render() {
if (panel) {
if (!panel.visible()) {
show();
}
return;
}
// Render a plain panel inside the inlineToolbarContainer if it's defined
panel = self.panel = Factory.create({
type: inlineToolbarContainer ? 'panel' : 'floatpanel',
role: 'application',
classes: 'tinymce tinymce-inline',
layout: 'flex',
direction: 'column',
align: 'stretch',
autohide: false,
autofix: true,
fixed: !!inlineToolbarContainer,
border: 1,
items: [
settings.menubar === false ? null : {type: 'menubar', border: '0 0 1 0', items: createMenuButtons()},
createToolbars()
]
});
// Add statusbar
/*if (settings.statusbar !== false) {
panel.add({type: 'panel', classes: 'statusbar', layout: 'flow', border: '1 0 0 0', items: [
{type: 'elementpath'}
]});
}*/
editor.fire('BeforeRenderUI');
panel.renderTo(inlineToolbarContainer || document.body).reflow();
addAccessibilityKeys(panel);
show();
editor.on('nodeChange', reposition);
editor.on('activate', show);
editor.on('deactivate', hide);
editor.nodeChanged();
}
settings.content_editable = true;
editor.on('focus', function() {
// Render only when the CSS file has been loaded
if (args.skinUiCss) {
tinymce.DOM.styleSheetLoader.load(args.skinUiCss, render, render);
} else {
render();
}
});
editor.on('blur hide', hide);
// Remove the panel when the editor is removed
editor.on('remove', function() {
if (panel) {
panel.remove();
panel = null;
}
});
// Preload skin css
if (args.skinUiCss) {
tinymce.DOM.styleSheetLoader.load(args.skinUiCss);
}
return {};
}
/**
* Renders the iframe editor UI.
*
* @param {Object} args Details about target element etc.
* @return {Object} Name/value object with theme data.
*/
function renderIframeUI(args) {
var panel, resizeHandleCtrl, startSize;
if (args.skinUiCss) {
tinymce.DOM.loadCSS(args.skinUiCss);
}
// Basic UI layout
panel = self.panel = Factory.create({
type: 'panel',
role: 'application',
classes: 'tinymce',
style: 'visibility: hidden',
layout: 'stack',
border: 1,
items: [
settings.menubar === false ? null : {type: 'menubar', border: '0 0 1 0', items: createMenuButtons()},
createToolbars(),
{type: 'panel', name: 'iframe', layout: 'stack', classes: 'edit-area', html: '', border: '1 0 0 0'}
]
});
if (settings.resize !== false) {
resizeHandleCtrl = {
type: 'resizehandle',
direction: settings.resize,
onResizeStart: function() {
var elm = editor.getContentAreaContainer().firstChild;
startSize = {
width: elm.clientWidth,
height: elm.clientHeight
};
},
onResize: function(e) {
if (settings.resize == 'both') {
resizeTo(startSize.width + e.deltaX, startSize.height + e.deltaY);
} else {
resizeTo(null, startSize.height + e.deltaY);
}
}
};
}
// Add statusbar if needed
if (settings.statusbar !== false) {
panel.add({type: 'panel', name: 'statusbar', classes: 'statusbar', layout: 'flow', border: '1 0 0 0', ariaRoot: true, items: [
{type: 'elementpath'},
resizeHandleCtrl
]});
}
if (settings.readonly) {
panel.find('*').disabled(true);
}
editor.fire('BeforeRenderUI');
panel.renderBefore(args.targetNode).reflow();
if (settings.width) {
tinymce.DOM.setStyle(panel.getEl(), 'width', settings.width);
}
// Remove the panel when the editor is removed
editor.on('remove', function() {
panel.remove();
panel = null;
});
// Add accesibility shortkuts
addAccessibilityKeys(panel);
return {
iframeContainer: panel.find('#iframe')[0].getEl(),
editorContainer: panel.getEl()
};
}
/**
* Renders the UI for the theme. This gets called by the editor.
*
* @param {Object} args Details about target element etc.
* @return {Object} Theme UI data items.
*/
self.renderUI = function(args) {
var skin = settings.skin !== false ? settings.skin || 'lightgray' : false;
if (skin) {
var skinUrl = settings.skin_url;
if (skinUrl) {
skinUrl = editor.documentBaseURI.toAbsolute(skinUrl);
} else {
skinUrl = tinymce.baseURL + '/skins/' + skin;
}
// Load special skin for IE7
// TODO: Remove this when we drop IE7 support
if (tinymce.Env.documentMode <= 7) {
args.skinUiCss = skinUrl + '/skin.ie7.min.css';
} else {
args.skinUiCss = skinUrl + '/skin.min.css';
}
// Load content.min.css or content.inline.min.css
editor.contentCSS.push(skinUrl + '/content' + (editor.inline ? '.inline' : '') + '.min.css');
}
// Handle editor setProgressState change
editor.on('ProgressState', function(e) {
self.throbber = self.throbber || new tinymce.ui.Throbber(self.panel.getEl('body'));
if (e.state) {
self.throbber.show(e.time);
} else {
self.throbber.hide();
}
});
if (settings.inline) {
return renderInlineUI(args);
}
return renderIframeUI(args);
};
self.resizeTo = resizeTo;
self.resizeBy = resizeBy;
});
|
// # Backup Database
// Provides for backing up the database before making potentially destructive changes
var fs = require('fs'),
path = require('path'),
Promise = require('bluebird'),
config = require('../../config'),
logging = require('../../logging'),
utils = require('../../utils'),
exporter = require('../export'),
writeExportFile,
backup;
writeExportFile = function writeExportFile(exportResult) {
var filename = path.resolve(utils.url.urlJoin(config.get('paths').contentPath, 'data', exportResult.filename));
return Promise.promisify(fs.writeFile)(filename, JSON.stringify(exportResult.data)).return(filename);
};
/**
* ## Backup
* does an export, and stores this in a local file
* @returns {Promise<*>}
*/
backup = function backup() {
logging.info('Creating database backup');
var props = {
data: exporter.doExport(),
filename: exporter.fileName()
};
return Promise.props(props)
.then(writeExportFile)
.then(function successMessage(filename) {
logging.info('Database backup written to: ' + filename);
});
};
module.exports = backup;
|
/// Copyright (c) 2009 Microsoft Corporation
///
/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
/// that the following conditions are met:
/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
/// the following disclaimer.
/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
/// the following disclaimer in the documentation and/or other materials provided with the distribution.
/// * Neither the name of Microsoft nor the names of its contributors may be used to
/// endorse or promote products derived from this software without specific prior written permission.
///
/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ES5Harness.registerTest( {
id: "15.4.4.15-8-2",
path: "TestCases/chapter15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-2.js",
description: "Array.prototype.lastIndexOf must return correct index(Number)",
test: function testcase() {
var obj = {toString:function(){return 0}};
var one = 1;
var _float = -(4/3);
var a = new Array(+0,true,0,-0, false,undefined,null,"0",obj, _float,-(4/3),-1.3333333333333,"str",one, 1, false);
if (a.lastIndexOf(-(4/3)) === 10 && // a[10]=-(4/3)
a.lastIndexOf(0) === 3 && // a[3] = -0, but using === -0 and 0 are equal
a.lastIndexOf(-0) ===3 && // a[3] = -0
a.lastIndexOf(1) === 14 ) // a[14] = 1
{
return true;
}
},
precondition: function prereq() {
return fnExists(Array.prototype.lastIndexOf);
}
});
|
/*
Translation from original CKEDITOR language files:
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang("base64image","vi",{
"alt":"Chú thích ảnh",
"lockRatio":"Giữ nguyên tỷ lệ",
"vSpace":"Khoảng đệm dọc",
"hSpace":"Khoảng đệm ngang",
"border":"Đường viền"
}); |
/*global describe, it, before, after */
/*jshint expr:true*/
var testUtils = require('../../../utils'),
should = require('should'),
supertest = require('supertest'),
express = require('express'),
ghost = require('../../../../../core'),
httpServer,
request;
describe('User API', function () {
var accesstoken = '';
before(function (done) {
var app = express();
// starting ghost automatically populates the db
// TODO: prevent db init, and manage bringing up the DB with fixtures ourselves
ghost({app: app}).then(function (_httpServer) {
httpServer = _httpServer;
request = supertest.agent(app);
}).then(function () {
return testUtils.doAuth(request);
}).then(function (token) {
accesstoken = token;
done();
}).catch(function (e) {
console.log('Ghost Error: ', e);
console.log(e.stack);
});
});
after(function (done) {
testUtils.clearData().then(function () {
httpServer.close();
done();
});
});
describe('Browse', function () {
it('returns dates in ISO 8601 format', function (done) {
request.get(testUtils.API.getApiQuery('users/'))
.set('Authorization', 'Bearer ' + accesstoken)
.expect('Content-Type', /json/)
.expect(200)
.end(function (err, res) {
if (err) {
return done(err);
}
var jsonResponse = res.body;
jsonResponse.users.should.exist;
testUtils.API.checkResponse(jsonResponse, 'users');
jsonResponse.users.should.have.length(1);
testUtils.API.checkResponse(jsonResponse.users[0], 'user', ['roles']);
testUtils.API.isISO8601(jsonResponse.users[0].last_login).should.be.true;
testUtils.API.isISO8601(jsonResponse.users[0].created_at).should.be.true;
testUtils.API.isISO8601(jsonResponse.users[0].updated_at).should.be.true;
done();
});
});
it('can retrieve all users', function (done) {
request.get(testUtils.API.getApiQuery('users/'))
.set('Authorization', 'Bearer ' + accesstoken)
.expect('Content-Type', /json/)
.expect(200)
.end(function (err, res) {
if (err) {
return done(err);
}
should.not.exist(res.headers['x-cache-invalidate']);
var jsonResponse = res.body;
jsonResponse.users.should.exist;
testUtils.API.checkResponse(jsonResponse, 'users');
jsonResponse.users.should.have.length(1);
testUtils.API.checkResponse(jsonResponse.users[0], 'user', ['roles']);
done();
});
});
});
describe('Read', function () {
it('can retrieve a user by "me"', function (done) {
request.get(testUtils.API.getApiQuery('users/me/'))
.set('Authorization', 'Bearer ' + accesstoken)
.expect('Content-Type', /json/)
.expect(200)
.end(function (err, res) {
if (err) {
return done(err);
}
should.not.exist(res.headers['x-cache-invalidate']);
var jsonResponse = res.body;
jsonResponse.users.should.exist;
should.not.exist(jsonResponse.meta);
jsonResponse.users.should.have.length(1);
testUtils.API.checkResponse(jsonResponse.users[0], 'user', ['roles']);
done();
});
});
it('can retrieve a user by id', function (done) {
request.get(testUtils.API.getApiQuery('users/1/'))
.set('Authorization', 'Bearer ' + accesstoken)
.expect('Content-Type', /json/)
.expect(200)
.end(function (err, res) {
if (err) {
return done(err);
}
should.not.exist(res.headers['x-cache-invalidate']);
var jsonResponse = res.body;
jsonResponse.users.should.exist;
should.not.exist(jsonResponse.meta);
jsonResponse.users.should.have.length(1);
testUtils.API.checkResponse(jsonResponse.users[0], 'user', ['roles']);
done();
});
});
it('can retrieve a user by slug', function (done) {
request.get(testUtils.API.getApiQuery('users/slug/joe-bloggs/'))
.set('Authorization', 'Bearer ' + accesstoken)
.expect('Content-Type', /json/)
.expect(200)
.end(function (err, res) {
if (err) {
return done(err);
}
should.not.exist(res.headers['x-cache-invalidate']);
var jsonResponse = res.body;
jsonResponse.users.should.exist;
should.not.exist(jsonResponse.meta);
jsonResponse.users.should.have.length(1);
testUtils.API.checkResponse(jsonResponse.users[0], 'user', ['roles']);
done();
});
});
it('can retrieve a user by email', function (done) {
request.get(testUtils.API.getApiQuery('users/email/jbloggs%40example.com/'))
.set('Authorization', 'Bearer ' + accesstoken)
.expect('Content-Type', /json/)
.expect(200)
.end(function (err, res) {
if (err) {
return done(err);
}
should.not.exist(res.headers['x-cache-invalidate']);
var jsonResponse = res.body;
jsonResponse.users.should.exist;
should.not.exist(jsonResponse.meta);
jsonResponse.users.should.have.length(1);
testUtils.API.checkResponse(jsonResponse.users[0], 'user', ['roles']);
done();
});
});
it('can retrieve a user with role', function (done) {
request.get(testUtils.API.getApiQuery('users/me/?include=roles'))
.set('Authorization', 'Bearer ' + accesstoken)
.expect('Content-Type', /json/)
.expect(200)
.end(function (err, res) {
if (err) {
return done(err);
}
should.not.exist(res.headers['x-cache-invalidate']);
var jsonResponse = res.body;
jsonResponse.users.should.exist;
should.not.exist(jsonResponse.meta);
jsonResponse.users.should.have.length(1);
testUtils.API.checkResponse(jsonResponse.users[0], 'user', ['roles']);
testUtils.API.checkResponse(jsonResponse.users[0].roles[0], 'role');
done();
});
});
it('can retrieve a user with role and permissions', function (done) {
request.get(testUtils.API.getApiQuery('users/me/?include=roles,roles.permissions'))
.set('Authorization', 'Bearer ' + accesstoken)
.expect('Content-Type', /json/)
.expect(200)
.end(function (err, res) {
if (err) {
return done(err);
}
should.not.exist(res.headers['x-cache-invalidate']);
var jsonResponse = res.body;
jsonResponse.users.should.exist;
should.not.exist(jsonResponse.meta);
jsonResponse.users.should.have.length(1);
testUtils.API.checkResponse(jsonResponse.users[0], 'user', ['roles']);
testUtils.API.checkResponse(jsonResponse.users[0].roles[0], 'role', ['permissions']);
// testUtils.API.checkResponse(jsonResponse.users[0].roles[0].permissions[0], 'permission');
done();
});
});
it('can retrieve a user by slug with role and permissions', function (done) {
request.get(testUtils.API.getApiQuery('users/slug/joe-bloggs/?include=roles,roles.permissions'))
.set('Authorization', 'Bearer ' + accesstoken)
.expect('Content-Type', /json/)
.expect(200)
.end(function (err, res) {
if (err) {
return done(err);
}
should.not.exist(res.headers['x-cache-invalidate']);
var jsonResponse = res.body;
jsonResponse.users.should.exist;
should.not.exist(jsonResponse.meta);
jsonResponse.users.should.have.length(1);
testUtils.API.checkResponse(jsonResponse.users[0], 'user', ['roles']);
testUtils.API.checkResponse(jsonResponse.users[0].roles[0], 'role', ['permissions']);
// testUtils.API.checkResponse(jsonResponse.users[0].roles[0].permissions[0], 'permission');
done();
});
});
it('can\'t retrieve non existent user by id', function (done) {
request.get(testUtils.API.getApiQuery('users/99/'))
.set('Authorization', 'Bearer ' + accesstoken)
.expect('Content-Type', /json/)
.expect(404)
.end(function (err, res) {
if (err) {
return done(err);
}
should.not.exist(res.headers['x-cache-invalidate']);
var jsonResponse = res.body;
jsonResponse.should.exist;
jsonResponse.errors.should.exist;
testUtils.API.checkResponseValue(jsonResponse.errors[0], ['message', 'type']);
done();
});
});
it('can\'t retrieve non existent user by slug', function (done) {
request.get(testUtils.API.getApiQuery('users/slug/blargh/'))
.set('Authorization', 'Bearer ' + accesstoken)
.expect('Content-Type', /json/)
.expect(404)
.end(function (err, res) {
if (err) {
return done(err);
}
should.not.exist(res.headers['x-cache-invalidate']);
var jsonResponse = res.body;
jsonResponse.should.exist;
jsonResponse.errors.should.exist;
testUtils.API.checkResponseValue(jsonResponse.errors[0], ['message', 'type']);
done();
});
});
});
describe('Edit', function () {
it('can edit a user', function (done) {
request.get(testUtils.API.getApiQuery('users/me/'))
.set('Authorization', 'Bearer ' + accesstoken)
.expect('Content-Type', /json/)
.end(function (err, res) {
if (err) {
return done(err);
}
var jsonResponse = res.body,
changedValue = 'http://joe-bloggs.ghost.org',
dataToSend;
jsonResponse.users[0].should.exist;
testUtils.API.checkResponse(jsonResponse.users[0], 'user', ['roles']);
dataToSend = { users: [
{website: changedValue}
]};
request.put(testUtils.API.getApiQuery('users/me/'))
.set('Authorization', 'Bearer ' + accesstoken)
.send(dataToSend)
.expect('Content-Type', /json/)
.expect(200)
.end(function (err, res) {
if (err) {
return done(err);
}
var putBody = res.body;
res.headers['x-cache-invalidate'].should.eql('/*');
putBody.users[0].should.exist;
putBody.users[0].website.should.eql(changedValue);
putBody.users[0].email.should.eql(jsonResponse.users[0].email);
testUtils.API.checkResponse(putBody.users[0], 'user', ['roles']);
done();
});
});
});
it('can\'t edit a user with invalid accesstoken', function (done) {
request.get(testUtils.API.getApiQuery('users/me/'))
.set('Authorization', 'Bearer ' + accesstoken)
.expect('Content-Type', /json/)
.end(function (err, res) {
if (err) {
return done(err);
}
var jsonResponse = res.body,
changedValue = 'joe-bloggs.ghost.org';
jsonResponse.users[0].should.exist;
jsonResponse.users[0].website = changedValue;
request.put(testUtils.API.getApiQuery('users/me/'))
.set('Authorization', 'Bearer ' + 'invalidtoken')
.send(jsonResponse)
.expect(401)
.end(function (err, res) {
if (err) {
return done(err);
}
done();
});
});
});
});
});
|
version https://git-lfs.github.com/spec/v1
oid sha256:b6eecf88673deee924a61fa33d335bae7f15669f4fb8f6add3ce258b96fdfb36
size 2178
|
#!/usr/bin/env node
var manifest = require('./manifest.json'),
command = require('./index.js'),
options = require('dm-core').cli(manifest)
;
command(options, process.stdin).pipe(process.stdout);
|
CKEDITOR.plugins.setLang("codesnippet","vi",{button:"Chèn đoạn mã",codeContents:"Nội dung mã",emptySnippetError:"Một đoạn mã không thể để trống.",language:"Ngôn ngữ",title:"Đoạn mã",pathName:"mã dính"}); |
/*! jQuery UI - v1.10.4 - 2014-02-09
* http://jqueryui.com
* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
jQuery(function(t){t.datepicker.regional.mk={closeText:"Затвори",prevText:"<",nextText:">",currentText:"Денес",monthNames:["Јануари","Февруари","Март","Април","Мај","Јуни","Јули","Август","Септември","Октомври","Ноември","Декември"],monthNamesShort:["Јан","Фев","Мар","Апр","Мај","Јун","Јул","Авг","Сеп","Окт","Ное","Дек"],dayNames:["Недела","Понеделник","Вторник","Среда","Четврток","Петок","Сабота"],dayNamesShort:["Нед","Пон","Вто","Сре","Чет","Пет","Саб"],dayNamesMin:["Не","По","Вт","Ср","Че","Пе","Са"],weekHeader:"Сед",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.datepicker.setDefaults(t.datepicker.regional.mk)}); |
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'font', 'lv', {
fontSize: {
label: 'Izmērs',
voiceLabel: 'Fonta izmeŗs',
panelTitle: 'Izmērs'
},
label: 'Šrifts',
panelTitle: 'Šrifts',
voiceLabel: 'Fonts'
} );
|
/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang("specialchar","it",{euro:"Simbolo Euro",lsquo:"Virgoletta singola sinistra",rsquo:"Virgoletta singola destra",ldquo:"Virgolette aperte",rdquo:"Virgolette chiuse",ndash:"Trattino",mdash:"Trattino lungo",iexcl:"Punto esclavamativo invertito",cent:"Simbolo Cent",pound:"Simbolo Sterlina",curren:"Simbolo Moneta",yen:"Simbolo Yen",brvbar:"Barra interrotta",sect:"Simbolo di sezione",uml:"Dieresi",copy:"Simbolo Copyright",ordf:"Indicatore ordinale femminile",laquo:"Virgolette basse aperte",
not:"Nessun segno",reg:"Simbolo Registrato",macr:"Macron",deg:"Simbolo Grado",sup2:"Apice Due",sup3:"Apice Tre",acute:"Accento acuto",micro:"Simbolo Micro",para:"Simbolo Paragrafo",middot:"Punto centrale",cedil:"Cediglia",sup1:"Apice Uno",ordm:"Indicatore ordinale maschile",raquo:"Virgolette basse chiuse",frac14:"Frazione volgare un quarto",frac12:"Frazione volgare un mezzo",frac34:"Frazione volgare tre quarti",iquest:"Punto interrogativo invertito",Agrave:"Lettera maiuscola latina A con accento grave",
Aacute:"Lettera maiuscola latina A con accento acuto",Acirc:"Lettera maiuscola latina A con accento circonflesso",Atilde:"Lettera maiuscola latina A con tilde",Auml:"Lettera maiuscola latina A con dieresi",Aring:"Lettera maiuscola latina A con anello sopra",AElig:"Lettera maiuscola latina AE",Ccedil:"Lettera maiuscola latina C con cediglia",Egrave:"Lettera maiuscola latina E con accento grave",Eacute:"Lettera maiuscola latina E con accento acuto",Ecirc:"Lettera maiuscola latina E con accento circonflesso",
Euml:"Lettera maiuscola latina E con dieresi",Igrave:"Lettera maiuscola latina I con accento grave",Iacute:"Lettera maiuscola latina I con accento acuto",Icirc:"Lettera maiuscola latina I con accento circonflesso",Iuml:"Lettera maiuscola latina I con dieresi",ETH:"Lettera maiuscola latina Eth",Ntilde:"Lettera maiuscola latina N con tilde",Ograve:"Lettera maiuscola latina O con accento grave",Oacute:"Lettera maiuscola latina O con accento acuto",Ocirc:"Lettera maiuscola latina O con accento circonflesso",
Otilde:"Lettera maiuscola latina O con tilde",Ouml:"Lettera maiuscola latina O con dieresi",times:"Simbolo di moltiplicazione",Oslash:"Lettera maiuscola latina O barrata",Ugrave:"Lettera maiuscola latina U con accento grave",Uacute:"Lettera maiuscola latina U con accento acuto",Ucirc:"Lettera maiuscola latina U con accento circonflesso",Uuml:"Lettera maiuscola latina U con accento circonflesso",Yacute:"Lettera maiuscola latina Y con accento acuto",THORN:"Lettera maiuscola latina Thorn",szlig:"Lettera latina minuscola doppia S",
agrave:"Lettera minuscola latina a con accento grave",aacute:"Lettera minuscola latina a con accento acuto",acirc:"Lettera minuscola latina a con accento circonflesso",atilde:"Lettera minuscola latina a con tilde",auml:"Lettera minuscola latina a con dieresi",aring:"Lettera minuscola latina a con anello superiore",aelig:"Lettera minuscola latina ae",ccedil:"Lettera minuscola latina c con cediglia",egrave:"Lettera minuscola latina e con accento grave",eacute:"Lettera minuscola latina e con accento acuto",
ecirc:"Lettera minuscola latina e con accento circonflesso",euml:"Lettera minuscola latina e con dieresi",igrave:"Lettera minuscola latina i con accento grave",iacute:"Lettera minuscola latina i con accento acuto",icirc:"Lettera minuscola latina i con accento circonflesso",iuml:"Lettera minuscola latina i con dieresi",eth:"Lettera minuscola latina eth",ntilde:"Lettera minuscola latina n con tilde",ograve:"Lettera minuscola latina o con accento grave",oacute:"Lettera minuscola latina o con accento acuto",
ocirc:"Lettera minuscola latina o con accento circonflesso",otilde:"Lettera minuscola latina o con tilde",ouml:"Lettera minuscola latina o con dieresi",divide:"Simbolo di divisione",oslash:"Lettera minuscola latina o barrata",ugrave:"Lettera minuscola latina u con accento grave",uacute:"Lettera minuscola latina u con accento acuto",ucirc:"Lettera minuscola latina u con accento circonflesso",uuml:"Lettera minuscola latina u con dieresi",yacute:"Lettera minuscola latina y con accento acuto",thorn:"Lettera minuscola latina thorn",
yuml:"Lettera minuscola latina y con dieresi",OElig:"Legatura maiuscola latina OE",oelig:"Legatura minuscola latina oe",372:"Lettera maiuscola latina W con accento circonflesso",374:"Lettera maiuscola latina Y con accento circonflesso",373:"Lettera minuscola latina w con accento circonflesso",375:"Lettera minuscola latina y con accento circonflesso",sbquo:"Singola virgoletta bassa low-9",8219:"Singola virgoletta bassa low-9 inversa",bdquo:"Doppia virgoletta bassa low-9",hellip:"Ellissi orizzontale",
trade:"Simbolo TM",9658:"Puntatore nero rivolto verso destra",bull:"Punto",rarr:"Freccia verso destra",rArr:"Doppia freccia verso destra",hArr:"Doppia freccia sinistra destra",diams:"Simbolo nero diamante",asymp:"Quasi uguale a"});
|
/*
* Ext JS Library 2.2.1
* Copyright(c) 2006-2009, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
/**
* @class Ext.KeyMap
* Handles mapping keys to actions for an element. One key map can be used for multiple actions.
* The constructor accepts the same config object as defined by {@link #addBinding}.
* If you bind a callback function to a KeyMap, anytime the KeyMap handles an expected key
* combination it will call the function with this signature (if the match is a multi-key
* combination the callback will still be called only once): (String key, Ext.EventObject e)
* A KeyMap can also handle a string representation of keys.<br />
* Usage:
<pre><code>
// map one key by key code
var map = new Ext.KeyMap("my-element", {
key: 13, // or Ext.EventObject.ENTER
fn: myHandler,
scope: myObject
});
// map multiple keys to one action by string
var map = new Ext.KeyMap("my-element", {
key: "a\r\n\t",
fn: myHandler,
scope: myObject
});
// map multiple keys to multiple actions by strings and array of codes
var map = new Ext.KeyMap("my-element", [
{
key: [10,13],
fn: function(){ alert("Return was pressed"); }
}, {
key: "abc",
fn: function(){ alert('a, b or c was pressed'); }
}, {
key: "\t",
ctrl:true,
shift:true,
fn: function(){ alert('Control + shift + tab was pressed.'); }
}
]);
</code></pre>
* <b>Note: A KeyMap starts enabled</b>
* @constructor
* @param {Mixed} el The element to bind to
* @param {Object} config The config (see {@link #addBinding})
* @param {String} eventName (optional) The event to bind to (defaults to "keydown")
*/
Ext.KeyMap = function(el, config, eventName){
this.el = Ext.get(el);
this.eventName = eventName || "keydown";
this.bindings = [];
if(config){
this.addBinding(config);
}
this.enable();
};
Ext.KeyMap.prototype = {
/**
* True to stop the event from bubbling and prevent the default browser action if the
* key was handled by the KeyMap (defaults to false)
* @type Boolean
*/
stopEvent : false,
/**
* Add a new binding to this KeyMap. The following config object properties are supported:
* <pre>
Property Type Description
---------- --------------- ----------------------------------------------------------------------
key String/Array A single keycode or an array of keycodes to handle
shift Boolean True to handle key only when shift is pressed (defaults to false)
ctrl Boolean True to handle key only when ctrl is pressed (defaults to false)
alt Boolean True to handle key only when alt is pressed (defaults to false)
handler Function The function to call when KeyMap finds the expected key combination
fn Function Alias of handler (for backwards-compatibility)
scope Object The scope of the callback function
stopEvent Boolean True to stop the event
</pre>
*
* Usage:
* <pre><code>
// Create a KeyMap
var map = new Ext.KeyMap(document, {
key: Ext.EventObject.ENTER,
fn: handleKey,
scope: this
});
//Add a new binding to the existing KeyMap later
map.addBinding({
key: 'abc',
shift: true,
fn: handleKey,
scope: this
});
</code></pre>
* @param {Object/Array} config A single KeyMap config or an array of configs
*/
addBinding : function(config){
if(Ext.isArray(config)){
for(var i = 0, len = config.length; i < len; i++){
this.addBinding(config[i]);
}
return;
}
var keyCode = config.key,
shift = config.shift,
ctrl = config.ctrl,
alt = config.alt,
fn = config.fn || config.handler,
scope = config.scope;
if (config.stopEvent) {
this.stopEvent = config.stopEvent;
}
if(typeof keyCode == "string"){
var ks = [];
var keyString = keyCode.toUpperCase();
for(var j = 0, len = keyString.length; j < len; j++){
ks.push(keyString.charCodeAt(j));
}
keyCode = ks;
}
var keyArray = Ext.isArray(keyCode);
var handler = function(e){
if((!shift || e.shiftKey) && (!ctrl || e.ctrlKey) && (!alt || e.altKey)){
var k = e.getKey();
if(keyArray){
for(var i = 0, len = keyCode.length; i < len; i++){
if(keyCode[i] == k){
if(this.stopEvent){
e.stopEvent();
}
fn.call(scope || window, k, e);
return;
}
}
}else{
if(k == keyCode){
if(this.stopEvent){
e.stopEvent();
}
fn.call(scope || window, k, e);
}
}
}
};
this.bindings.push(handler);
},
/**
* Shorthand for adding a single key listener
* @param {Number/Array/Object} key Either the numeric key code, array of key codes or an object with the
* following options:
* {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}
* @param {Function} fn The function to call
* @param {Object} scope (optional) The scope of the function
*/
on : function(key, fn, scope){
var keyCode, shift, ctrl, alt;
if(typeof key == "object" && !Ext.isArray(key)){
keyCode = key.key;
shift = key.shift;
ctrl = key.ctrl;
alt = key.alt;
}else{
keyCode = key;
}
this.addBinding({
key: keyCode,
shift: shift,
ctrl: ctrl,
alt: alt,
fn: fn,
scope: scope
})
},
// private
handleKeyDown : function(e){
if(this.enabled){ //just in case
var b = this.bindings;
for(var i = 0, len = b.length; i < len; i++){
b[i].call(this, e);
}
}
},
/**
* Returns true if this KeyMap is enabled
* @return {Boolean}
*/
isEnabled : function(){
return this.enabled;
},
/**
* Enables this KeyMap
*/
enable: function(){
if(!this.enabled){
this.el.on(this.eventName, this.handleKeyDown, this);
this.enabled = true;
}
},
/**
* Disable this KeyMap
*/
disable: function(){
if(this.enabled){
this.el.removeListener(this.eventName, this.handleKeyDown, this);
this.enabled = false;
}
}
}; |
/*istanbul ignore next*/"use strict";
var _stringify = require("babel-runtime/core-js/json/stringify");
var _stringify2 = _interopRequireDefault(_stringify);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var convertSourceMap = require("convert-source-map");
var pathExists = require("path-exists");
var sourceMap = require("source-map");
var slash = require("slash");
var path = require("path");
var util = require("./util");
var fs = require("fs");
var _ = require("lodash");
module.exports = function (commander, filenames, opts) {
if (commander.sourceMaps === "inline") {
opts.sourceMaps = true;
}
var results = [];
var buildResult = function buildResult() {
var map = new sourceMap.SourceMapGenerator({
file: path.basename(commander.outFile || "") || "stdout",
sourceRoot: opts.sourceRoot
});
var code = "";
var offset = 0;
_.each(results, function (result) {
var filename = result.filename || "stdout";
code += result.code + "\n";
if (result.map) {
/*istanbul ignore next*/
(function () {
var consumer = new sourceMap.SourceMapConsumer(result.map);
var sourceFilename = filename;
if (commander.outFile) {
sourceFilename = path.relative(path.dirname(commander.outFile), sourceFilename);
}
sourceFilename = slash(sourceFilename);
map._sources.add(sourceFilename);
map.setSourceContent(sourceFilename, result.actual);
consumer.eachMapping(function (mapping) {
map._mappings.add({
generatedLine: mapping.generatedLine + offset,
generatedColumn: mapping.generatedColumn,
originalLine: mapping.source == null ? null : mapping.originalLine,
originalColumn: mapping.source == null ? null : mapping.originalColumn,
source: mapping.source == null ? null : sourceFilename
});
});
offset = code.split("\n").length;
})();
}
});
// add the inline sourcemap comment if we've either explicitly asked for inline source
// maps, or we've requested them without any output file
if (commander.sourceMaps === "inline" || !commander.outFile && commander.sourceMaps) {
code += "\n" + convertSourceMap.fromObject(map).toComment();
}
return {
map: map,
code: code
};
};
var output = function output() {
var result = buildResult();
if (commander.outFile) {
// we've requested for a sourcemap to be written to disk
if (commander.sourceMaps && commander.sourceMaps !== "inline") {
var mapLoc = commander.outFile + ".map";
result.code = util.addSourceMappingUrl(result.code, mapLoc);
fs.writeFileSync(mapLoc, /*istanbul ignore next*/(0, _stringify2.default)(result.map));
}
fs.writeFileSync(commander.outFile, result.code);
} else {
process.stdout.write(result.code + "\n");
}
};
var stdin = function stdin() {
var code = "";
process.stdin.setEncoding("utf8");
process.stdin.on("readable", function () {
var chunk = process.stdin.read();
if (chunk !== null) code += chunk;
});
process.stdin.on("end", function () {
results.push(util.transform(commander.filename, code));
output();
});
};
var walk = function walk() {
var _filenames = [];
results = [];
_.each(filenames, function (filename) {
if (!pathExists.sync(filename)) return;
var stat = fs.statSync(filename);
if (stat.isDirectory()) {
/*istanbul ignore next*/
(function () {
var dirname = filename;
_.each(util.readdirFilter(filename), function (filename) {
_filenames.push(path.join(dirname, filename));
});
})();
} else {
_filenames.push(filename);
}
});
_.each(_filenames, function (filename) {
if (util.shouldIgnore(filename)) return;
var data = util.compile(filename);
if (data.ignored) return;
results.push(data);
});
output();
};
var files = function files() {
walk();
if (commander.watch) {
var chokidar = util.requireChokidar();
chokidar.watch(filenames, {
persistent: true,
ignoreInitial: true
}).on("all", function (type, filename) {
if (util.shouldIgnore(filename) || !util.canCompile(filename, commander.extensions)) return;
if (type === "add" || type === "change") {
util.log(type + " " + filename);
try {
walk();
} catch (err) {
console.error(err.stack);
}
}
});
}
};
if (filenames.length) {
files();
} else {
stdin();
}
}; |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
function AggressiveMergingPlugin(options) {
if(options !== undefined && typeof options !== "object" || Array.isArray(options)) {
throw new Error("Argument should be an options object. To use defaults, pass in nothing.\nFor more info on options, see http://webpack.github.io/docs/list-of-plugins.html");
}
this.options = options || {};
}
module.exports = AggressiveMergingPlugin;
AggressiveMergingPlugin.prototype.apply = function(compiler) {
var options = this.options;
var minSizeReduce = options.minSizeReduce || 1.5;
function getParentsWeight(chunk) {
return chunk.parents.map(function(p) {
return p.initial ? options.entryChunkMultiplicator || 10 : 1;
}).reduce(function(a, b) {
return a + b;
}, 0);
}
compiler.plugin("compilation", function(compilation) {
compilation.plugin("optimize-chunks", function(chunks) {
var combinations = [];
chunks.forEach(function(a, idx) {
if(a.initial) return;
for(var i = 0; i < idx; i++) {
var b = chunks[i];
if(b.initial) continue;
combinations.push([b, a]);
}
});
combinations.forEach(function(pair) {
var a = pair[0].size({
chunkOverhead: 0
});
var b = pair[1].size({
chunkOverhead: 0
});
var ab = pair[0].integratedSize(pair[1], {
chunkOverhead: 0
});
pair.push({
a: a,
b: b,
ab: ab
});
if(ab === false) {
pair.unshift(false);
} else if(options.moveToParents) {
var aOnly = ab - b;
var bOnly = ab - a;
var common = a + b - ab;
var newSize = common + getParentsWeight(pair[0]) * aOnly + getParentsWeight(pair[1]) * bOnly;
pair.push({
aOnly: aOnly,
bOnly: bOnly,
common: common,
newSize: newSize
});
} else {
var newSize = ab;
}
pair.unshift((a + b) / newSize);
});
combinations = combinations.filter(function(pair) {
return pair[0] !== false;
});
combinations.sort(function(a, b) {
return b[0] - a[0];
});
var pair = combinations[0];
if(!pair) return;
if(pair[0] < minSizeReduce) return;
if(options.moveToParents) {
var commonModules = pair[1].modules.filter(function(m) {
return pair[2].modules.indexOf(m) >= 0;
});
var aOnlyModules = pair[1].modules.filter(function(m) {
return commonModules.indexOf(m) < 0;
});
var bOnlyModules = pair[2].modules.filter(function(m) {
return commonModules.indexOf(m) < 0;
});
aOnlyModules.forEach(function(m) {
pair[1].removeModule(m);
m.removeChunk(pair[1]);
pair[1].parents.forEach(function(c) {
c.addModule(m);
m.addChunk(c);
});
});
bOnlyModules.forEach(function(m) {
pair[2].removeModule(m);
m.removeChunk(pair[2]);
pair[2].parents.forEach(function(c) {
c.addModule(m);
m.addChunk(c);
});
});
}
if(pair[1].integrate(pair[2], "aggressive-merge")) {
chunks.splice(chunks.indexOf(pair[2]), 1);
this.restartApplyPlugins();
}
});
});
};
|
// Copyright: 2015 AlignAlytics
// License: "https://github.com/PMSI-AlignAlytics/dimple/blob/master/MIT-LICENSE.txt"
// Source: /src/methods/_createClass.js
dimple._createClass = function (stringArray) {
var i,
returnArray = [],
replacer;
replacer = function(s) {
var c = s.charCodeAt(0),
returnString = "-";
if (c >= 65 && c <= 90) {
returnString = s.toLowerCase();
}
return returnString;
};
if (stringArray.length > 0) {
for (i = 0; i < stringArray.length; i += 1) {
if (stringArray[i]) {
/*jslint regexp: true */
returnArray.push("dimple-" + stringArray[i].toString().replace(/[^a-z0-9]/g, replacer));
/*jslint regexp: false */
}
}
} else {
returnArray = ["dimple-all"];
}
return returnArray.join(" ");
}; |
declare export var x: number;
|
define(["intern!object","intern/chai!assert","../../../fx/easing"],function(n,i,o){n({name:"dojo/fx/easing",module:{"full of functions":function(){for(var n in o)i.isFunction(o[n])}},"performs some calculation":function(){for(var n in o)i.isFalse(isNaN(o[n](.5)))}})}); |
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'placeholder', 'cy', {
title: 'Priodweddau\'r Daliwr Geiriau',
toolbar: 'Daliwr Geiriau',
name: 'Enw\'r Daliwr Geiriau',
invalidName: 'Dyw\'r daliwr geiriau methu â bod yn wag ac na all gynnyws y nodau [, ], <, > ',
pathName: 'daliwr geiriau'
} );
|
/* global angular */
(function () {
'use strict';
angular
.module('plugins.seen')
.factory('seenService', seenService);
function seenService($http, exception) {
return {
getSeen: getSeen,
deleteEntryById: deleteEntryById
};
function getSeen(options) {
return $http.get('/api/seen/', {
params: options,
etagCache: true
})
.catch(callFailed);
}
function deleteEntryById(id) {
return $http.delete('/api/seen/' + id + '/')
.catch(callFailed);
}
function callFailed(error) {
return exception.catcher(error);
}
}
}()); |
$(function($){var storage,fail,uid;try{uid=new Date;(storage=window.localStorage).setItem(uid,uid);fail=storage.getItem(uid)!=uid;storage.removeItem(uid);fail&&(storage=false);}catch(e){}
if(storage){try{var usedSkin=localStorage.getItem('config-skin');if(usedSkin!=''){$('#skin-colors .skin-changer').removeClass('active');$('#skin-colors .skin-changer[data-skin="'+usedSkin+'"]').addClass('active');}
var fixedHeader=localStorage.getItem('config-fixed-header');if(fixedHeader=='fixed-header'){$('body').addClass(fixedHeader);$('#config-fixed-header').prop('checked',true);}
var fixedFooter=localStorage.getItem('config-fixed-footer');if(fixedFooter=='fixed-footer'){$('body').addClass(fixedFooter);$('#config-fixed-footer').prop('checked',true);}
var boxedLayout=localStorage.getItem('config-boxed-layout');if(boxedLayout=='boxed-layout'){$('body').addClass(boxedLayout);$('#config-boxed-layout').prop('checked',true);}
var rtlLayout=localStorage.getItem('config-rtl-layout');if(rtlLayout=='rtl'){$('body').addClass(rtlLayout);$('#config-rtl-layout').prop('checked',true);}
var fixedLeftmenu=localStorage.getItem('config-fixed-leftmenu');if(fixedLeftmenu=='fixed-leftmenu'){$('body').addClass(fixedLeftmenu);$('#config-fixed-sidebar').prop('checked',true);if($('#page-wrapper').hasClass('nav-small')){$('#page-wrapper').removeClass('nav-small');}
$('.fixed-leftmenu #col-left').nanoScroller({alwaysVisible:true,iOSNativeScrolling:false,preventPageScrolling:true,contentClass:'col-left-nano-content'});}}
catch(e){console.log(e);}}
$('#config-tool-cog').on('click',function(){$('#config-tool').toggleClass('closed');});$('#config-fixed-header').on('change',function(){var fixedHeader='';if($(this).is(':checked')){$('body').addClass('fixed-header');fixedHeader='fixed-header';}
else{$('body').removeClass('fixed-header');if($('#config-fixed-sidebar').is(':checked')){$('#config-fixed-sidebar').prop('checked',false);$('#config-fixed-sidebar').trigger('change');location.reload();}}
writeStorage(storage,'config-fixed-header',fixedHeader);});$('#config-fixed-footer').on('change',function(){var fixedFooter='';if($(this).is(':checked')){$('body').addClass('fixed-footer');fixedFooter='fixed-footer';}
else{$('body').removeClass('fixed-footer');}
writeStorage(storage,'config-fixed-footer',fixedFooter);});$('#config-boxed-layout').on('change',function(){var boxedLayout='';if($(this).is(':checked')){$('body').addClass('boxed-layout');boxedLayout='boxed-layout';}
else{$('body').removeClass('boxed-layout');}
writeStorage(storage,'config-boxed-layout',boxedLayout);});$('#config-rtl-layout').on('change',function(){var rtlLayout='';if($(this).is(':checked')){rtlLayout='rtl';}
else{}
writeStorage(storage,'config-rtl-layout',rtlLayout);location.reload();});$('#config-fixed-sidebar').on('change',function(){var fixedSidebar='';if($(this).is(':checked')){if(!$('#config-fixed-header').is(':checked')){$('#config-fixed-header').prop('checked',true);$('#config-fixed-header').trigger('change');}
if($('#page-wrapper').hasClass('nav-small')){$('#page-wrapper').removeClass('nav-small');}
$('body').addClass('fixed-leftmenu');fixedSidebar='fixed-leftmenu';$('.fixed-leftmenu #col-left').nanoScroller({alwaysVisible:true,iOSNativeScrolling:false,preventPageScrolling:true,contentClass:'col-left-nano-content'});writeStorage(storage,'config-fixed-leftmenu',fixedSidebar);}
else{$('body').removeClass('fixed-leftmenu');writeStorage(storage,'config-fixed-leftmenu',fixedSidebar);location.reload();}});if(!storage){$('#config-fixed-header').prop('checked',false);$('#config-fixed-footer').prop('checked',false);$('#config-fixed-sidebar').prop('checked',false);$('#config-boxed-layout').prop('checked',false);$('#config-rtl-layout').prop('checked',false);}
$('#skin-colors .skin-changer').on('click',function(){$('body').removeClassPrefix('theme-');$('body').addClass($(this).data('skin'));$('#skin-colors .skin-changer').removeClass('active');$(this).addClass('active');writeStorage(storage,'config-skin',$(this).data('skin'));});});function writeStorage(storage,key,value){if(storage){try{localStorage.setItem(key,value);}
catch(e){console.log(e);}}}
$.fn.removeClassPrefix=function(prefix){this.each(function(i,el){var classes=el.className.split(" ").filter(function(c){return c.lastIndexOf(prefix,0)!==0;});el.className=classes.join(" ");});return this;}; |
//+ Jonas Raoni Soares Silva
//@ http://jsfromhell.com/classes/binary-parser [v1.0]
var chr = String.fromCharCode;
var p = exports.BinaryParser = function( bigEndian, allowExceptions ){
this.bigEndian = bigEndian;
this.allowExceptions = allowExceptions;
};
var Buffer = exports.BinaryParser.Buffer = function( bigEndian, buffer ){
this.bigEndian = bigEndian || 0;
this.buffer = [];
this.setBuffer( buffer );
};
Buffer.prototype.setBuffer = function( data ){
if( data ){
for( var l, i = l = data.length, b = this.buffer = new Array( l ); i; b[l - i] = data.charCodeAt( --i ) );
this.bigEndian && b.reverse();
}
};
Buffer.prototype.hasNeededBits = function( neededBits ){
return this.buffer.length >= -( -neededBits >> 3 );
};
Buffer.prototype.checkBuffer = function( neededBits ){
if( !this.hasNeededBits( neededBits ) )
throw new Error( "checkBuffer::missing bytes" );
};
Buffer.prototype.readBits = function( start, length ){
//shl fix: Henri Torgemane ~1996 (compressed by Jonas Raoni)
function shl( a, b ){
for( ; b--; a = ( ( a %= 0x7fffffff + 1 ) & 0x40000000 ) == 0x40000000 ? a * 2 : ( a - 0x40000000 ) * 2 + 0x7fffffff + 1 );
return a;
}
if( start < 0 || length <= 0 )
return 0;
this.checkBuffer( start + length );
for( var offsetLeft, offsetRight = start % 8, curByte = this.buffer.length - ( start >> 3 ) - 1, lastByte = this.buffer.length + ( -( start + length ) >> 3 ), diff = curByte - lastByte, sum = ( ( this.buffer[ curByte ] >> offsetRight ) & ( ( 1 << ( diff ? 8 - offsetRight : length ) ) - 1 ) ) + ( diff && ( offsetLeft = ( start + length ) % 8 ) ? ( this.buffer[ lastByte++ ] & ( ( 1 << offsetLeft ) - 1 ) ) << ( diff-- << 3 ) - offsetRight : 0 ); diff; sum += shl( this.buffer[ lastByte++ ], ( diff-- << 3 ) - offsetRight ) );
return sum;
};
p.warn = function( msg ){
if( this.allowExceptions )
throw new Error( msg );
return 1;
};
p.decodeFloat = function( data, precisionBits, exponentBits ){
var b = new this.Buffer( this.bigEndian, data );
b.checkBuffer( precisionBits + exponentBits + 1 );
var bias = Math.pow( 2, exponentBits - 1 ) - 1, signal = b.readBits( precisionBits + exponentBits, 1 ), exponent = b.readBits( precisionBits, exponentBits ), significand = 0,
divisor = 2, curByte = b.buffer.length + ( -precisionBits >> 3 ) - 1;
do{
for( var byteValue = b.buffer[ ++curByte ], startBit = precisionBits % 8 || 8, mask = 1 << startBit; mask >>= 1; ( byteValue & mask ) && ( significand += 1 / divisor ), divisor *= 2 );
}while( precisionBits -= startBit );
return exponent == ( bias << 1 ) + 1 ? significand ? NaN : signal ? -Infinity : +Infinity : ( 1 + signal * -2 ) * ( exponent || significand ? !exponent ? Math.pow( 2, -bias + 1 ) * significand : Math.pow( 2, exponent - bias ) * ( 1 + significand ) : 0 );
};
p.decodeInt = function( data, bits, signed, forceBigEndian ){
var b = new this.Buffer( this.bigEndian||forceBigEndian, data ), x = b.readBits( 0, bits ), max = Math.pow( 2, bits );
return signed && x >= max / 2 ? x - max : x;
};
p.encodeFloat = function( data, precisionBits, exponentBits ){
var bias = Math.pow( 2, exponentBits - 1 ) - 1, minExp = -bias + 1, maxExp = bias, minUnnormExp = minExp - precisionBits,
status = isNaN( n = parseFloat( data ) ) || n == -Infinity || n == +Infinity ? n : 0,
exp = 0, len = 2 * bias + 1 + precisionBits + 3, bin = new Array( len ),
signal = ( n = status !== 0 ? 0 : n ) < 0, n = Math.abs( n ), intPart = Math.floor( n ), floatPart = n - intPart,
i, lastBit, rounded, j, result;
for( i = len; i; bin[--i] = 0 );
for( i = bias + 2; intPart && i; bin[--i] = intPart % 2, intPart = Math.floor( intPart / 2 ) );
for( i = bias + 1; floatPart > 0 && i; ( bin[++i] = ( ( floatPart *= 2 ) >= 1 ) - 0 ) && --floatPart );
for( i = -1; ++i < len && !bin[i]; );
if( bin[( lastBit = precisionBits - 1 + ( i = ( exp = bias + 1 - i ) >= minExp && exp <= maxExp ? i + 1 : bias + 1 - ( exp = minExp - 1 ) ) ) + 1] ){
if( !( rounded = bin[lastBit] ) ){
for( j = lastBit + 2; !rounded && j < len; rounded = bin[j++] );
}
for( j = lastBit + 1; rounded && --j >= 0; ( bin[j] = !bin[j] - 0 ) && ( rounded = 0 ) );
}
for( i = i - 2 < 0 ? -1 : i - 3; ++i < len && !bin[i]; );
if( ( exp = bias + 1 - i ) >= minExp && exp <= maxExp )
++i;
else if( exp < minExp ){
exp != bias + 1 - len && exp < minUnnormExp && this.warn( "encodeFloat::float underflow" );
i = bias + 1 - ( exp = minExp - 1 );
}
if( intPart || status !== 0 ){
this.warn( intPart ? "encodeFloat::float overflow" : "encodeFloat::" + status );
exp = maxExp + 1;
i = bias + 2;
if( status == -Infinity )
signal = 1;
else if( isNaN( status ) )
bin[i] = 1;
}
for( n = Math.abs( exp + bias ), j = exponentBits + 1, result = ""; --j; result = ( n % 2 ) + result, n = n >>= 1 );
for( n = 0, j = 0, i = ( result = ( signal ? "1" : "0" ) + result + bin.slice( i, i + precisionBits ).join( "" ) ).length, r = []; i; j = ( j + 1 ) % 8 ){
n += ( 1 << j ) * result.charAt( --i );
if( j == 7 ){
r[r.length] = String.fromCharCode( n );
n = 0;
}
}
r[r.length] = n ? String.fromCharCode( n ) : "";
return ( this.bigEndian ? r.reverse() : r ).join( "" );
};
p.encodeInt = function( data, bits, signed, forceBigEndian ){
var max = Math.pow( 2, bits );
( data >= max || data < -( max / 2 ) ) && this.warn( "encodeInt::overflow" ) && ( data = 0 );
data < 0 && ( data += max );
for( var r = []; data; r[r.length] = String.fromCharCode( data % 256 ), data = Math.floor( data / 256 ) );
for( bits = -( -bits >> 3 ) - r.length; bits--; r[r.length] = "\0" );
return ( (this.bigEndian||forceBigEndian) ? r.reverse() : r ).join( "" );
};
p.toSmall = function( data ){ return this.decodeInt( data, 8, true ); };
p.fromSmall = function( data ){ return this.encodeInt( data, 8, true ); };
p.toByte = function( data ){ return this.decodeInt( data, 8, false ); };
p.fromByte = function( data ){ return this.encodeInt( data, 8, false ); };
p.toShort = function( data ){ return this.decodeInt( data, 16, true ); };
p.fromShort = function( data ){ return this.encodeInt( data, 16, true ); };
p.toWord = function( data ){ return this.decodeInt( data, 16, false ); };
p.fromWord = function( data ){ return this.encodeInt( data, 16, false ); };
p.toInt = function( data ){ return this.decodeInt( data, 32, true ); };
p.fromInt = function( data ){ return this.encodeInt( data, 32, true ); };
p.toLong = function( data ){ return this.decodeInt( data, 64, true ); };
p.fromLong = function( data ){ return this.encodeInt( data, 64, true ); };
p.toDWord = function( data ){ return this.decodeInt( data, 32, false ); };
p.fromDWord = function( data ){ return this.encodeInt( data, 32, false ); };
p.toQWord = function( data ){ return this.decodeInt( data, 64, true ); };
p.fromQWord = function( data ){ return this.encodeInt( data, 64, true ); };
p.toFloat = function( data ){ return this.decodeFloat( data, 23, 8 ); };
p.fromFloat = function( data ){ return this.encodeFloat( data, 23, 8 ); };
p.toDouble = function( data ){ return this.decodeFloat( data, 52, 11 ); };
p.fromDouble = function( data ){ return this.encodeFloat( data, 52, 11 ); };
// Factor out the encode so it can be shared by add_header and push_int32
p.encode_int32 = function(number) {
var a, b, c, d, unsigned;
unsigned = (number < 0) ? (number + 0x100000000) : number;
a = Math.floor(unsigned / 0xffffff);
unsigned &= 0xffffff;
b = Math.floor(unsigned / 0xffff);
unsigned &= 0xffff;
c = Math.floor(unsigned / 0xff);
unsigned &= 0xff;
d = Math.floor(unsigned);
return chr(a) + chr(b) + chr(c) + chr(d);
};
p.encode_int64 = function(number) {
var a, b, c, d, e, f, g, h, unsigned;
unsigned = (number < 0) ? (number + 0x10000000000000000) : number;
a = Math.floor(unsigned / 0xffffffffffffff);
unsigned &= 0xffffffffffffff;
b = Math.floor(unsigned / 0xffffffffffff);
unsigned &= 0xffffffffffff;
c = Math.floor(unsigned / 0xffffffffff);
unsigned &= 0xffffffffff;
d = Math.floor(unsigned / 0xffffffff);
unsigned &= 0xffffffff;
e = Math.floor(unsigned / 0xffffff);
unsigned &= 0xffffff;
f = Math.floor(unsigned / 0xffff);
unsigned &= 0xffff;
g = Math.floor(unsigned / 0xff);
unsigned &= 0xff;
h = Math.floor(unsigned);
return chr(a) + chr(b) + chr(c) + chr(d) + chr(e) + chr(f) + chr(g) + chr(h);
};
/**
UTF8 methods
**/
// Take a raw binary string and return a utf8 string
p.decode_utf8 = function(a) {
var string = "";
var i = 0;
var c = c1 = c2 = 0;
while ( i < a.length ) {
c = a.charCodeAt(i);
if (c < 128) {
string += String.fromCharCode(c);
i++;
} else if((c > 191) && (c < 224)) {
c2 = a.charCodeAt(i+1);
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
i += 2;
} else {
c2 = a.charCodeAt(i+1);
c3 = a.charCodeAt(i+2);
string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
i += 3;
}
}
return string;
};
// Encode a cstring correctly
p.encode_cstring = function(s) {
return unescape(encodeURIComponent(s)) + p.fromByte(0);
};
// Take a utf8 string and return a binary string
p.encode_utf8 = function(s) {
var a="";
for (var n=0; n< s.length; n++) {
var c=s.charCodeAt(n);
if (c<128) {
a += String.fromCharCode(c);
} else if ((c>127)&&(c<2048)) {
a += String.fromCharCode( (c>>6) | 192) ;
a += String.fromCharCode( (c&63) | 128);
} else {
a += String.fromCharCode( (c>>12) | 224);
a += String.fromCharCode( ((c>>6) & 63) | 128);
a += String.fromCharCode( (c&63) | 128);
}
}
return a;
};
p.pprint = function(s) {
var util = require('util');
for (var i=0; i<s.length; i++) {
if (s.charCodeAt(i)<32) {util.puts(s.charCodeAt(i)+' : ');}
else {util.puts(s.charCodeAt(i)+' : '+ s.charAt(i));}
}
};
p.hprint = function(s) {
var util = require('util');
for (var i=0; i<s.length; i++) {
if (s.charCodeAt(i)<32) {util.puts(s.charCodeAt(i)+' : ');}
else {util.puts(s.charCodeAt(i).toString(16)+' : '+ s.charAt(i));}
}
};
p.hex = function(s) {
var util = require('util');
var string = ''
for (var i=0; i<s.length; i++) {
var c = s.charCodeAt(i).toString(16);
c = c.length == 1 ? "0" + c : c;
string = string + c;
}
return string;
};
|
var R = require('..');
var eq = require('./shared/eq');
describe('splitAt', function() {
it('splits an array at a given index', function() {
eq(R.splitAt(1, [1, 2, 3]), [[1], [2, 3]]);
});
it('splits a string at a given index', function() {
eq(R.splitAt(5, 'hello world'), ['hello', ' world']);
});
it('is curried', function() {
var splitAtThree = R.splitAt(3);
eq(splitAtThree('foobar'), ['foo', 'bar']);
});
it('can handle index greater than array length', function() {
eq(R.splitAt(4, [1, 2]), [[1, 2], []]);
});
it('can support negative index', function() {
eq(R.splitAt(-1, 'foobar'), ['fooba', 'r']);
});
});
|
import*as React from"react";import vkBridge from"@vkontakte/vk-bridge";import{platform}from"../../lib/platform";var Appearance,Scheme,WebviewType;!function(e){e.DARK="dark",e.LIGHT="light"}(Appearance=Appearance||{}),function(e){e.DEPRECATED_CLIENT_LIGHT="client_light",e.DEPRECATED_CLIENT_DARK="client_dark",e.VKCOM="vkcom",e.BRIGHT_LIGHT="bright_light",e.SPACE_GRAY="space_gray",e.VKCOM_LIGHT="vkcom_light",e.VKCOM_DARK="vkcom_dark"}(Scheme=Scheme||{}),function(e){e.VKAPPS="vkapps",e.INTERNAL="internal"}(WebviewType=WebviewType||{});var defaultConfigProviderProps={webviewType:WebviewType.VKAPPS,isWebView:vkBridge.isWebView(),scheme:Scheme.BRIGHT_LIGHT,transitionMotionEnabled:!0,platform:platform()},ConfigProviderContext=React.createContext(defaultConfigProviderProps);export{Appearance,Scheme,WebviewType,defaultConfigProviderProps,ConfigProviderContext}; |
/**
* @fileoverview Tests for arrow-parens
* @author Jxck
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
var rule = require("../../../lib/rules/arrow-parens"),
RuleTester = require("../../../lib/testers/rule-tester");
//------------------------------------------------------------------------------
// Tests
//------------------------------------------------------------------------------
var ruleTester = new RuleTester();
var valid = [
{ code: "() => {}", parserOptions: { ecmaVersion: 6 } },
{ code: "(a) => {}", parserOptions: { ecmaVersion: 6 } },
{ code: "(a) => a", parserOptions: { ecmaVersion: 6 } },
{ code: "(a) => {\n}", parserOptions: { ecmaVersion: 6 } },
{ code: "a.then((foo) => {});", parserOptions: { ecmaVersion: 6 } },
{ code: "a.then((foo) => { if (true) {}; });", parserOptions: { ecmaVersion: 6 } },
// as-needed
{ code: "() => {}", options: ["as-needed"], parserOptions: { ecmaVersion: 6 } },
{ code: "a => {}", options: ["as-needed"], parserOptions: { ecmaVersion: 6 } },
{ code: "a => a", options: ["as-needed"], parserOptions: { ecmaVersion: 6 } },
{ code: "([a, b]) => {}", options: ["as-needed"], parserOptions: { ecmaVersion: 6 } },
{ code: "({ a, b }) => {}", options: ["as-needed"], parserOptions: { ecmaVersion: 6 } },
{ code: "(a = 10) => {}", options: ["as-needed"], parserOptions: { ecmaVersion: 6 } },
{ code: "(...a) => a[0]", options: ["as-needed"], parserOptions: { ecmaVersion: 6 } },
{ code: "(a, b) => {}", options: ["as-needed"], parserOptions: { ecmaVersion: 6 } }
];
var message = "Expected parentheses around arrow function argument.";
var asNeededMessage = "Unexpected parentheses around single function argument";
var type = "ArrowFunctionExpression";
var invalid = [
{
code: "a => {}",
parserOptions: { ecmaVersion: 6 },
errors: [{
line: 1,
column: 1,
message: message,
type: type
}]
},
{
code: "a => a",
parserOptions: { ecmaVersion: 6 },
errors: [{
line: 1,
column: 1,
message: message,
type: type
}]
},
{
code: "a => {\n}",
parserOptions: { ecmaVersion: 6 },
errors: [{
line: 1,
column: 1,
message: message,
type: type
}]
},
{
code: "a.then(foo => {});",
parserOptions: { ecmaVersion: 6 },
errors: [{
line: 1,
column: 8,
message: message,
type: type
}]
},
{
code: "a.then(foo => a);",
parserOptions: { ecmaVersion: 6 },
errors: [{
line: 1,
column: 8,
message: message,
type: type
}]
},
{
code: "a(foo => { if (true) {}; });",
parserOptions: { ecmaVersion: 6 },
errors: [{
line: 1,
column: 3,
message: message,
type: type
}]
},
// as-needed
{
code: "(a) => a",
options: ["as-needed"],
parserOptions: { ecmaVersion: 6 },
errors: [{
line: 1,
column: 1,
message: asNeededMessage,
type: type
}]
},
{
code: "(b) => b",
options: ["as-needed"],
parserOptions: { ecmaVersion: 6 },
errors: [{
line: 1,
column: 1,
message: asNeededMessage,
type: type
}]
}
];
ruleTester.run("arrow-parens", rule, {
valid: valid,
invalid: invalid
});
|
#!/usr/bin/env node
var optimist = require('optimist');
var htmlToText = require('../lib/html-to-text');
var argv = optimist
.string('tables')
.default('wordwrap', 80)
.default('ignore-href', false)
.default('ignore-image', false)
.default('noLinkBrackets', false)
.argv;
var text = '';
process.title = 'html-to-text';
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function data(data) {
text += data;
});
process.stdin.on('end', function end() {
text = htmlToText.fromString(text, {
tables: interpretTables(argv.tables),
wordwrap: argv.wordwrap,
ignoreHref: argv['ignore-href'],
ignoreImage: argv['ignore-image'],
noLinkBrackets: argv['noLinkBrackets']
});
process.stdout.write(text + '\n', 'utf-8');
});
function interpretTables(tables) {
if (!tables || tables === '' || tables === 'false') {
return [];
}
return tables === 'true' || tables.split(',');
}
|
version https://git-lfs.github.com/spec/v1
oid sha256:48e170461cabcfdc8fd28d3c58d5fd67732c2121f4c4fddc0fa9131d6659d9fa
size 2283
|
module.exports={title:"Informatica",slug:"informatica",svg:'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Informatica icon</title><path d="M12 0l3.547 10.788-4.5-1.255-.25 4.43 7.121 4.035V18h.001l5.919-6zm-.64.65L.162 12l6.32 6.407L12 24l5.184-5.255-9.736-3.856z"/></svg>',get path(){return this.svg.match(/<path\s+d="([^"]*)/)[1]},source:"https://www.informatica.com/content/dam/informatica-com/en/images/cc02v2/logo-informatica.svg",hex:"FF4D00"}; |
exports.parentHref = function (href) {
return href.split('/').slice(0, -1).join('/')
}
|
var five = require("../lib/johnny-five.js");
var board = new five.Board();
board.on("ready", function() {
var proximity = new five.Proximity({
controller: "GP2Y0A21YK",
pin: "A0"
});
proximity.on("data", function() {
console.log(this.cm + "cm", this.in + "in");
});
proximity.on("change", function() {
console.log("The obstruction has moved.");
});
});
|
version https://git-lfs.github.com/spec/v1
oid sha256:da9733ee27be9fd22bcc850d5c85eedc4316ba512b0237d5e32b02ee704a56f7
size 5383
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Slow = (function () {
function Slow() {
this.factor = 3;
this.radius = 200;
}
Object.defineProperty(Slow.prototype, "active", {
get: function () {
return false;
},
set: function (_value) {
},
enumerable: true,
configurable: true
});
Slow.prototype.load = function (data) {
if (data !== undefined) {
if (data.factor !== undefined) {
this.factor = data.factor;
}
if (data.radius !== undefined) {
this.radius = data.radius;
}
}
};
return Slow;
}());
exports.Slow = Slow;
|
module.exports={title:"Salesforce",slug:"salesforce",svg:'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Salesforce icon</title><path d="M10.006 5.415a4.195 4.195 0 013.045-1.306c1.56 0 2.954.9 3.69 2.205.63-.3 1.35-.45 2.1-.45 2.85 0 5.159 2.34 5.159 5.22s-2.31 5.22-5.176 5.22c-.345 0-.69-.044-1.02-.104a3.75 3.75 0 01-3.3 1.95c-.6 0-1.155-.15-1.65-.375A4.314 4.314 0 018.88 20.4a4.302 4.302 0 01-4.05-2.82c-.27.062-.54.076-.825.076-2.204 0-4.005-1.8-4.005-4.05 0-1.5.811-2.805 2.01-3.51-.255-.57-.39-1.2-.39-1.846 0-2.58 2.1-4.65 4.65-4.65 1.53 0 2.85.705 3.72 1.8"/></svg>',get path(){return this.svg.match(/<path\s+d="([^"]*)/)[1]},source:"https://www.salesforce.com/styleguide/elements/logos",hex:"00A1E0"}; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.