gojs
Version:
Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams
120 lines • 941 kB
JavaScript
/*
* GoJS v2.3.8 JavaScript Library for HTML Diagrams, https://gojs.net
* GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation, https://www.nwoods.com.
* Copyright (C) 1998-2023 by Northwoods Software Corporation. All Rights Reserved.
* THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/2.3.8/license.html.
* DO NOT MODIFY THIS FILE. DO NOT DISTRIBUTE A MODIFIED COPY OF THE CONTENTS OF THIS FILE.
*/
(function() { var t;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}function ba(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:aa(a)}}function da(a){for(var b,c=[];!(b=a.next()).done;)c.push(b.value);return c}var ea="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},fa;
if("function"==typeof Object.setPrototypeOf)fa=Object.setPrototypeOf;else{var ha;a:{var ia={a:!0},ja={};try{ja.__proto__=ia;ha=ja.a;break a}catch(a){}ha=!1}fa=ha?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var ka=fa;
function la(a,b){a.prototype=ea(b.prototype);a.prototype.constructor=a;if(ka)ka(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.OA=b.prototype}
var ma="undefined"!=typeof global&&null!=global?global:self,oa="function"==typeof Object.assign?Object.assign:function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c];if(d)for(var e in d)Object.prototype.hasOwnProperty.call(d,e)&&(a[e]=d[e])}return a},pa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};
function qa(a,b){if(b){var c=ma;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&pa(c,a,{writable:!0,value:b})}}qa("Object.assign",function(a){return a||oa});qa("Array.prototype.fill",function(a){return a?a:function(a,c,d){var b=this.length||0;0>c&&(c=Math.max(0,b+c));if(null==d||d>b)d=b;d=Number(d);0>d&&(d=Math.max(0,b+d));for(c=Number(c||0);c<d;c++)this[c]=a;return this}});var x="object"===typeof globalThis&&globalThis||"object"===typeof global&&global.global===global&&global||"object"===typeof self&&self.self===self&&self||{};void 0===x.requestAnimationFrame&&(void 0===x.setImmediate?x.requestAnimationFrame=function(a){x.setTimeout(a,0)}:x.requestAnimationFrame=x.setImmediate);function ra(){}function sa(a,b){var c=-1;return function(){var d=this,e=arguments;-1!==c&&x.clearTimeout(c);c=ta(function(){c=-1;a.apply(d,e)},b)}}function ta(a,b){return x.setTimeout(a,b)}
function ua(a){return x.document.createElement(a)}function C(a){throw Error(a);}function va(a,b){a="The object is frozen, so its properties cannot be set: "+a.toString();void 0!==b&&(a+=" to value: "+b);C(a)}function xa(a,b,c,d){c=null===c?"*":"string"===typeof c?c:"function"===typeof c&&"string"===typeof c.className?c.className:"";void 0!==d&&(c+="."+d);C(c+" is not in the range "+b+": "+a)}function ya(a){x.console&&x.console.log(a)}function za(a){return"object"===typeof a&&null!==a}
function Aa(a){return Array.isArray(a)||x.NodeList&&a instanceof x.NodeList||x.HTMLCollection&&a instanceof x.HTMLCollection}function Ba(a){return Array.prototype.slice.call(a)}function Ca(a,b,c){Array.isArray(a)?b>=a.length?a.push(c):a.splice(b,0,c):C("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)}function Da(a,b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):C("Cannot remove an object from an HTMLCollection or NodeList at "+b)}
function Ea(){var a=Fa.pop();return void 0===a?[]:a}function Ga(a){a.length=0;Fa.push(a)}function Ha(a){if("function"===typeof a){if(a.className)return a.className;if(a.name)return a.name;var b=a.toString();b=b.substring(9,b.indexOf("(")).trim();if(""!==b)return a._className=b}else if(za(a)&&a.constructor)return Ha(a.constructor);return typeof a}
function Ia(a){var b=a;za(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()}function Ja(a,b){if(a.hasOwnProperty(b))return!0;for(a=Object.getPrototypeOf(a);a&&a!==Function;){if(a.hasOwnProperty(b))return!0;var c=a.AA;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1}
function Ka(a,b,c){Object.defineProperty(La.prototype,a,{get:b,set:c})}
function Ma(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);c=[];for(var d=0,e=0;e<a.length;e+=2)c[d++]=b[a.substr(e,2)];a=c.join("");a=""===a?"0":a;b=[];for(c=0;256>c;c++)b[c]=c;for(c=d=0;256>c;c++)d=(d+b[c]+119)%256,e=b[c],b[c]=b[d],b[d]=e;d=c=0;for(var f="",g=0;g<a.length;g++)c=(c+1)%256,d=(d+b[c])%256,e=b[c],b[c]=b[d],b[d]=e,f+=String.fromCharCode(a.charCodeAt(g)^b[(b[c]+b[d])%256]);return f}
var Na=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("Trident/7"),Oa=void 0!==x.navigator&&void 0!==x.navigator.platform&&null!==x.navigator.platform.match(/(iPhone|iPod|iPad|Mac)/i),Fa=[];Object.freeze([]);ra.className="Util";ra.Dx="32ab5ff3b26f42dc0ed90f21472913b5";ra.adym="gojs.net";ra.vfo="28e645fdbb";ra.className="Util";function E(a,b,c){Qa(this);this.j=a;this.xa=b;this.m=c}E.prototype.toString=function(){return"EnumValue."+this.xa};
function Ra(a,b){return void 0===b||null===b||""===b?null:a[b]}ma.Object.defineProperties(E.prototype,{classType:{get:function(){return this.j}},name:{get:function(){return this.xa}},value:{get:function(){return this.m}}});E.className="EnumValue";function Sa(){this.cw=[]}Sa.prototype.toString=function(){return this.cw.join("")};Sa.prototype.add=function(a){""!==a&&this.cw.push(a)};Sa.className="StringBuilder";
function Ta(){}Ta.className="PropertyCollection";
var Wa={CA:!1,HA:!1,EA:!1,GA:!1,LA:!1,JA:!1,mx:!1,DA:null,trace:function(a){x.console&&x.console.log(a)},FA:function(a,b,c,d){a.strokeStyle="red";a.fillStyle="red";a.font="8px sans-serif";a.beginPath();a.moveTo(-10,0);a.lineTo(10,0);a.moveTo(0,-10);a.lineTo(0,10);a.stroke();a.setTransform(1,0,0,1,0,0);a.scale(c,c);a.transform(b.m11,b.m12,b.m21,b.m22,b.dx,b.dy);a.lineWidth=2;a.beginPath();a.moveTo(d.left,d.top+20);a.lineTo(d.left,d.top);a.lineTo(d.left+20,d.top);a.moveTo(d.right,d.bottom-20);a.lineTo(d.right,
d.bottom);a.lineTo(d.right-20,d.bottom);a.stroke();a.fillText("DB: "+Math.round(d.x)+", "+Math.round(d.y)+", "+Math.round(d.width)+", "+Math.round(d.height),d.left,d.top-5)},BA:function(a){var b={},c;for(c in a){b.x=c;if("licenseKey"!==b.x){var d=a[b.x];if(void 0!==d.prototype){b.Zl=Object.getOwnPropertyNames(d.prototype);for(var e={Tj:0};e.Tj<b.Zl.length;e={Tj:e.Tj},e.Tj++){var f=Object.getOwnPropertyDescriptor(d.prototype,b.Zl[e.Tj]);void 0!==f.get&&void 0===f.set&&Object.defineProperty(d.prototype,
b.Zl[e.Tj],{set:function(a,b){return function(){throw Error("Property "+a.Zl[b.Tj]+" of "+a.x+" is read-only.");}}(b,e)})}}}b={Zl:b.Zl,x:b.x}}}};function Xa(){}Xa.prototype.reset=function(){};Xa.prototype.next=function(){return!1};Xa.prototype.Ad=function(){return!1};Xa.prototype.first=function(){return null};Xa.prototype.any=function(){return!1};Xa.prototype.all=function(){return!0};Xa.prototype.each=function(){return this};Xa.prototype.map=function(){return this};Xa.prototype.filter=function(){return this};
Xa.prototype.ce=function(){};Xa.prototype.toString=function(){return"EmptyIterator"};ma.Object.defineProperties(Xa.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}});Xa.prototype.first=Xa.prototype.first;Xa.prototype.hasNext=Xa.prototype.Ad;Xa.prototype.next=Xa.prototype.next;Xa.prototype.reset=Xa.prototype.reset;var Ya=null;Xa.className="EmptyIterator";Ya=new Xa;function Za(a){this.key=-1;this.value=a}
Za.prototype.reset=function(){this.key=-1};Za.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1};Za.prototype.Ad=function(){return this.next()};Za.prototype.first=function(){this.key=0;return this.value};Za.prototype.any=function(a){this.key=-1;return a(this.value)};Za.prototype.all=function(a){this.key=-1;return a(this.value)};Za.prototype.each=function(a){this.key=-1;a(this.value);return this};Za.prototype.map=function(a){return new Za(a(this.value))};
Za.prototype.filter=function(a){return a(this.value)?new Za(this.value):Ya};Za.prototype.ce=function(){this.value=null};Za.prototype.toString=function(){return"SingletonIterator("+this.value+")"};ma.Object.defineProperties(Za.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}});Za.prototype.first=Za.prototype.first;Za.prototype.hasNext=Za.prototype.Ad;Za.prototype.next=Za.prototype.next;
Za.prototype.reset=Za.prototype.reset;Za.className="SingletonIterator";function $a(a){this.Bb=a;this.qf=null;a.Sa=null;this.qa=a.Ja;this.Za=-1}$a.prototype.reset=function(){var a=this.Bb;a.Sa=null;this.qa=a.Ja;this.Za=-1};$a.prototype.next=function(){var a=this.Bb;if(a.Ja!==this.qa&&0>this.key)return!1;a=a.s;var b=a.length,c=++this.Za,d=this.qf;if(null!==d)for(;c<b;){var e=a[c];if(d(e))return this.key=this.Za=c,this.value=e,!0;c++}else{if(c<b)return this.key=c,this.value=a[c],!0;this.ce()}return!1};
$a.prototype.Ad=function(){return this.next()};$a.prototype.first=function(){var a=this.Bb;this.qa=a.Ja;this.Za=0;a=a.s;var b=a.length,c=this.qf;if(null!==c){for(var d=0;d<b;){var e=a[d];if(c(e))return this.key=this.Za=d,this.value=e;d++}return null}return 0<b?(a=a[0],this.key=0,this.value=a):null};$a.prototype.any=function(a){var b=this.Bb;b.Sa=null;this.Za=-1;b=b.s;for(var c=b.length,d=this.qf,e=0;e<c;e++){var f=b[e];if((null===d||d(f))&&a(f))return!0}return!1};
$a.prototype.all=function(a){var b=this.Bb;b.Sa=null;this.Za=-1;b=b.s;for(var c=b.length,d=this.qf,e=0;e<c;e++){var f=b[e];if((null===d||d(f))&&!a(f))return!1}return!0};$a.prototype.each=function(a){var b=this.Bb;b.Sa=null;this.Za=-1;b=b.s;for(var c=b.length,d=this.qf,e=0;e<c;e++){var f=b[e];(null===d||d(f))&&a(f)}return this};
$a.prototype.map=function(a){var b=this.Bb;b.Sa=null;this.Za=-1;var c=[];b=b.s;for(var d=b.length,e=this.qf,f=0;f<d;f++){var g=b[f];(null===e||e(g))&&c.push(a(g))}a=new F;a.s=c;a.xb();return a.iterator};$a.prototype.filter=function(a){var b=this.Bb;b.Sa=null;this.Za=-1;var c=[];b=b.s;for(var d=b.length,e=this.qf,f=0;f<d;f++){var g=b[f];(null===e||e(g))&&a(g)&&c.push(g)}a=new F;a.s=c;a.xb();return a.iterator};
$a.prototype.ce=function(){this.key=-1;this.value=null;this.qa=-1;this.qf=null;this.Bb.Sa=this};$a.prototype.toString=function(){return"ListIterator@"+this.Za+"/"+this.Bb.count};
ma.Object.defineProperties($a.prototype,{iterator:{get:function(){return this}},predicate:{get:function(){return this.qf},set:function(a){this.qf=a}},count:{get:function(){var a=this.qf;if(null!==a){for(var b=0,c=this.Bb.s,d=c.length,e=0;e<d;e++)a(c[e])&&b++;return b}return this.Bb.s.length}}});$a.prototype.first=$a.prototype.first;$a.prototype.hasNext=$a.prototype.Ad;$a.prototype.next=$a.prototype.next;
$a.prototype.reset=$a.prototype.reset;$a.className="ListIterator";function ab(a){this.Bb=a;a.Hg=null;this.qa=a.Ja;this.Za=a.s.length}ab.prototype.reset=function(){var a=this.Bb;a.Hg=null;this.qa=a.Ja;this.Za=a.s.length};ab.prototype.next=function(){var a=this.Bb;if(a.Ja!==this.qa&&0>this.key)return!1;var b=--this.Za;if(0<=b)return this.key=b,this.value=a.s[b],!0;this.ce();return!1};ab.prototype.Ad=function(){return this.next()};
ab.prototype.first=function(){var a=this.Bb;this.qa=a.Ja;var b=a.s;this.Za=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};ab.prototype.any=function(a){var b=this.Bb;b.Hg=null;b=b.s;var c=b.length;this.Za=c;for(--c;0<=c;c--)if(a(b[c]))return!0;return!1};ab.prototype.all=function(a){var b=this.Bb;b.Hg=null;b=b.s;var c=b.length;this.Za=c;for(--c;0<=c;c--)if(!a(b[c]))return!1;return!0};
ab.prototype.each=function(a){var b=this.Bb;b.Hg=null;b=b.s;var c=b.length;this.Za=c;for(--c;0<=c;c--)a(b[c]);return this};ab.prototype.map=function(a){var b=this.Bb;b.Hg=null;var c=[];b=b.s;var d=b.length;this.Za=d;for(--d;0<=d;d--)c.push(a(b[d]));a=new F;a.s=c;a.xb();return a.iterator};ab.prototype.filter=function(a){var b=this.Bb;b.Hg=null;var c=[];b=b.s;var d=b.length;this.Za=d;for(--d;0<=d;d--){var e=b[d];a(e)&&c.push(e)}a=new F;a.s=c;a.xb();return a.iterator};
ab.prototype.ce=function(){this.key=-1;this.value=null;this.qa=-1;this.Bb.Hg=this};ab.prototype.toString=function(){return"ListIteratorBackwards("+this.Za+"/"+this.Bb.count+")"};ma.Object.defineProperties(ab.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.Bb.s.length}}});ab.prototype.first=ab.prototype.first;ab.prototype.hasNext=ab.prototype.Ad;ab.prototype.next=ab.prototype.next;ab.prototype.reset=ab.prototype.reset;
ab.className="ListIteratorBackwards";function F(a){Qa(this);this._isFrozen=!1;this.s=[];this.Ja=0;this.Hg=this.Sa=null;"string"===typeof a&&C("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=F.prototype;t.xb=function(){var a=this.Ja;a++;999999999<a&&(a=0);this.Ja=a};t.freeze=function(){this._isFrozen=!0;return this};t.ja=function(){this._isFrozen=!1;return this};t.toString=function(){return"List()#"+bb(this)};
t.add=function(a){if(null===a)return this;this._isFrozen&&va(this,a);this.s.push(a);this.xb();return this};t.push=function(a){this.add(a)};t.addAll=function(a){if(null===a)return this;this._isFrozen&&va(this);var b=this.s;if(Aa(a))for(var c=a.length,d=0;d<c;d++)b.push(a[d]);else for(a=a.iterator;a.next();)b.push(a.value);this.xb();return this};t.clear=function(){this._isFrozen&&va(this);this.s.length=0;this.xb()};t.contains=function(a){return null===a?!1:-1!==this.s.indexOf(a)};t.has=function(a){return this.contains(a)};
t.indexOf=function(a){return null===a?-1:this.s.indexOf(a)};t.L=function(a){var b=this.s;(0>a||a>=b.length)&&xa(a,"0 <= i < length",F,"elt:i");return b[a]};t.get=function(a){return this.L(a)};t.bd=function(a,b){var c=this.s;(0>a||a>=c.length)&&xa(a,"0 <= i < length",F,"setElt:i");this._isFrozen&&va(this,a);c[a]=b};t.set=function(a,b){this.bd(a,b)};t.first=function(){var a=this.s;return 0===a.length?null:a[0]};t.ic=function(){var a=this.s,b=a.length;return 0<b?a[b-1]:null};
t.pop=function(){this._isFrozen&&va(this);var a=this.s;return 0<a.length?a.pop():null};F.prototype.any=function(a){for(var b=this.s,c=b.length,d=0;d<c;d++)if(a(b[d]))return!0;return!1};F.prototype.all=function(a){for(var b=this.s,c=b.length,d=0;d<c;d++)if(!a(b[d]))return!1;return!0};F.prototype.each=function(a){for(var b=this.s,c=b.length,d=0;d<c;d++)a(b[d]);return this};F.prototype.map=function(a){for(var b=new F,c=[],d=this.s,e=d.length,f=0;f<e;f++)c.push(a(d[f]));b.s=c;b.xb();return b};
F.prototype.filter=function(a){for(var b=new F,c=[],d=this.s,e=d.length,f=0;f<e;f++){var g=d[f];a(g)&&c.push(g)}b.s=c;b.xb();return b};t=F.prototype;t.Gb=function(a,b){0>a&&xa(a,">= 0",F,"insertAt:i");this._isFrozen&&va(this,a);var c=this.s;a>=c.length?c.push(b):c.splice(a,0,b);this.xb()};t.remove=function(a){if(null===a)return!1;this._isFrozen&&va(this,a);var b=this.s;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.xb();return!0};t.delete=function(a){return this.remove(a)};
t.mb=function(a){var b=this.s;(0>a||a>=b.length)&&xa(a,"0 <= i < length",F,"removeAt:i");this._isFrozen&&va(this,a);a===b.length-1?b.pop():b.splice(a,1);this.xb()};t.removeRange=function(a,b){var c=this.s,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._isFrozen&&va(this);for(var e=a,f=b+1;f<d;)c[e++]=c[f++];c.length=d-(b-a+1);this.xb();return this};
F.prototype.copy=function(){var a=new F,b=this.s;0<b.length&&(a.s=Array.prototype.slice.call(b));return a};t=F.prototype;t.Fa=function(){for(var a=this.s,b=this.count,c=Array(b),d=0;d<b;d++)c[d]=a[d];return c};t.Gv=function(){for(var a=new H,b=this.s,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};t.sort=function(a){this._isFrozen&&va(this);this.s.sort(a);this.xb();return this};
t.zi=function(a,b,c){var d=this.s,e=d.length;void 0===b&&(b=0);void 0===c&&(c=e);this._isFrozen&&va(this);var f=c-b;if(1>=f)return this;(0>b||b>=e-1)&&xa(b,"0 <= from < length",F,"sortRange:from");if(2===f)return c=d[b],e=d[b+1],0<a(c,e)&&(d[b]=e,d[b+1]=c,this.xb()),this;if(0===b)if(c>=e)d.sort(a);else for(b=d.slice(0,c),b.sort(a),a=0;a<c;a++)d[a]=b[a];else if(c>=e)for(c=d.slice(b),c.sort(a),a=b;a<e;a++)d[a]=c[a-b];else for(e=d.slice(b,c),e.sort(a),a=b;a<c;a++)d[a]=e[a-b];this.xb();return this};
t.reverse=function(){this._isFrozen&&va(this);this.s.reverse();this.xb();return this};
ma.Object.defineProperties(F.prototype,{_dataArray:{get:function(){return this.s}},count:{get:function(){return this.s.length}},size:{get:function(){return this.s.length}},length:{get:function(){return this.s.length}},iterator:{get:function(){if(0>=this.s.length)return Ya;var a=this.Sa;return null!==a?(a.reset(),a):new $a(this)}},iteratorBackwards:{
get:function(){if(0>=this.s.length)return Ya;var a=this.Hg;return null!==a?(a.reset(),a):new ab(this)}}});F.prototype.reverse=F.prototype.reverse;F.prototype.sortRange=F.prototype.zi;F.prototype.sort=F.prototype.sort;F.prototype.toSet=F.prototype.Gv;F.prototype.toArray=F.prototype.Fa;F.prototype.removeRange=F.prototype.removeRange;F.prototype.removeAt=F.prototype.mb;F.prototype["delete"]=F.prototype.delete;F.prototype.remove=F.prototype.remove;F.prototype.insertAt=F.prototype.Gb;
F.prototype.pop=F.prototype.pop;F.prototype.last=F.prototype.ic;F.prototype.first=F.prototype.first;F.prototype.set=F.prototype.set;F.prototype.setElt=F.prototype.bd;F.prototype.get=F.prototype.get;F.prototype.elt=F.prototype.L;F.prototype.indexOf=F.prototype.indexOf;F.prototype.has=F.prototype.has;F.prototype.contains=F.prototype.contains;F.prototype.clear=F.prototype.clear;F.prototype.addAll=F.prototype.addAll;F.prototype.push=F.prototype.push;F.prototype.add=F.prototype.add;F.prototype.thaw=F.prototype.ja;
F.prototype.freeze=F.prototype.freeze;F.className="List";function cb(a){this.eg=a;a.Sa=null;this.qa=a.Ja;this.sa=null}cb.prototype.reset=function(){var a=this.eg;a.Sa=null;this.qa=a.Ja;this.sa=null};cb.prototype.next=function(){var a=this.eg;if(a.Ja!==this.qa&&null===this.key)return!1;var b=this.sa;b=null===b?a.ea:b.va;if(null!==b)return this.sa=b,this.value=b.value,this.key=b.key,!0;this.ce();return!1};cb.prototype.Ad=function(){return this.next()};
cb.prototype.first=function(){var a=this.eg;this.qa=a.Ja;a=a.ea;if(null!==a){this.sa=a;var b=a.value;this.key=a.key;return this.value=b}return null};cb.prototype.any=function(a){var b=this.eg;this.sa=b.Sa=null;for(b=b.ea;null!==b;){if(a(b.value))return!0;b=b.va}return!1};cb.prototype.all=function(a){var b=this.eg;this.sa=b.Sa=null;for(b=b.ea;null!==b;){if(!a(b.value))return!1;b=b.va}return!0};cb.prototype.each=function(a){var b=this.eg;this.sa=b.Sa=null;for(b=b.ea;null!==b;)a(b.value),b=b.va;return this};
cb.prototype.map=function(a){var b=this.eg;b.Sa=null;var c=new F;for(b=b.ea;null!==b;)c.add(a(b.value)),b=b.va;return c.iterator};cb.prototype.filter=function(a){var b=this.eg;b.Sa=null;var c=new F;for(b=b.ea;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.va}return c.iterator};cb.prototype.ce=function(){this.value=this.key=null;this.qa=-1;this.eg.Sa=this};cb.prototype.toString=function(){return null!==this.sa?"SetIterator@"+this.sa.value:"SetIterator"};
ma.Object.defineProperties(cb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.eg.Rb}}});cb.prototype.first=cb.prototype.first;cb.prototype.hasNext=cb.prototype.Ad;cb.prototype.next=cb.prototype.next;cb.prototype.reset=cb.prototype.reset;cb.className="SetIterator";
function H(a){Qa(this);this._isFrozen=!1;this.Sb={};this.Rb=0;this.Sa=null;this.Ja=0;this.kf=this.ea=null;"string"===typeof a&&C("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=H.prototype;t.xb=function(){var a=this.Ja;a++;999999999<a&&(a=0);this.Ja=a};t.freeze=function(){this._isFrozen=!0;return this};t.ja=function(){this._isFrozen=!1;return this};t.toString=function(){return"Set()#"+bb(this)};
t.add=function(a){if(null===a)return this;this._isFrozen&&va(this,a);var b=a;za(a)&&(b=fb(a));void 0===this.Sb[b]&&(this.Rb++,a=new ib(a,a),this.Sb[b]=a,b=this.kf,null===b?this.ea=a:(a.kl=b,b.va=a),this.kf=a,this.xb());return this};t.addAll=function(a){if(null===a)return this;this._isFrozen&&va(this);if(Aa(a))for(var b=a.length,c=0;c<b;c++)this.add(a[c]);else for(a=a.iterator;a.next();)this.add(a.value);return this};
t.contains=function(a){if(null===a)return!1;var b=a;return za(a)&&(b=bb(a),void 0===b)?!1:void 0!==this.Sb[b]};t.has=function(a){return this.contains(a)};t.Sy=function(a){if(null===a)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0};t.Ty=function(a){if(null===a)return!0;for(a=a.iterator;a.next();)if(this.contains(a.value))return!0;return!1};t.first=function(){var a=this.ea;return null===a?null:a.value};
H.prototype.any=function(a){for(var b=this.ea;null!==b;){if(a(b.value))return!0;b=b.va}return!1};H.prototype.all=function(a){for(var b=this.ea;null!==b;){if(!a(b.value))return!1;b=b.va}return!0};H.prototype.each=function(a){for(var b=this.ea;null!==b;)a(b.value),b=b.va;return this};H.prototype.map=function(a){for(var b=new H,c=this.ea;null!==c;)b.add(a(c.value)),c=c.va;return b};H.prototype.filter=function(a){for(var b=new H,c=this.ea;null!==c;){var d=c.value;a(d)&&b.add(d);c=c.va}return b};t=H.prototype;
t.remove=function(a){if(null===a)return!1;this._isFrozen&&va(this,a);var b=a;if(za(a)&&(b=bb(a),void 0===b))return!1;a=this.Sb[b];if(void 0===a)return!1;var c=a.va,d=a.kl;null!==c&&(c.kl=d);null!==d&&(d.va=c);this.ea===a&&(this.ea=c);this.kf===a&&(this.kf=d);delete this.Sb[b];this.Rb--;this.xb();return!0};t.delete=function(a){return this.remove(a)};
t.fp=function(a){if(null===a)return this;this._isFrozen&&va(this);if(Aa(a))for(var b=a.length,c=0;c<b;c++)this.remove(a[c]);else for(a=a.iterator;a.next();)this.remove(a.value);return this};t.nA=function(a){if(null===a||0===this.count)return this;this._isFrozen&&va(this);var b=new H;b.addAll(a);a=[];for(var c=this.iterator;c.next();){var d=c.value;b.contains(d)||a.push(d)}this.fp(a);return this};
t.clear=function(){this._isFrozen&&va(this);this.Sb={};this.Rb=0;null!==this.Sa&&this.Sa.reset();this.kf=this.ea=null;this.xb()};H.prototype.copy=function(){var a=new H,b=this.Sb,c;for(c in b)a.add(b[c].value);return a};H.prototype.Fa=function(){var a=Array(this.Rb),b=this.Sb,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};H.prototype.Fv=function(){var a=new F,b=this.Sb,c;for(c in b)a.add(b[c].value);return a};function Qa(a){a.__gohashid=jb++}
function fb(a){var b=a.__gohashid;void 0===b&&(b=jb++,a.__gohashid=b);return b}function bb(a){return a.__gohashid}ma.Object.defineProperties(H.prototype,{count:{get:function(){return this.Rb}},size:{get:function(){return this.Rb}},iterator:{get:function(){if(0>=this.Rb)return Ya;var a=this.Sa;return null!==a?(a.reset(),a):new cb(this)}}});H.prototype.toList=H.prototype.Fv;H.prototype.toArray=H.prototype.Fa;
H.prototype.clear=H.prototype.clear;H.prototype.retainAll=H.prototype.nA;H.prototype.removeAll=H.prototype.fp;H.prototype["delete"]=H.prototype.delete;H.prototype.remove=H.prototype.remove;H.prototype.first=H.prototype.first;H.prototype.containsAny=H.prototype.Ty;H.prototype.containsAll=H.prototype.Sy;H.prototype.has=H.prototype.has;H.prototype.contains=H.prototype.contains;H.prototype.addAll=H.prototype.addAll;H.prototype.add=H.prototype.add;H.prototype.thaw=H.prototype.ja;H.prototype.freeze=H.prototype.freeze;
var jb=1;H.className="Set";H.uniqueHash=Qa;H.hashIdUnique=fb;H.hashId=bb;function kb(a){this.ma=a;this.qa=a.Ja;this.sa=null}kb.prototype.reset=function(){this.qa=this.ma.Ja;this.sa=null};kb.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&null===this.key)return!1;var b=this.sa;b=null===b?a.ea:b.va;if(null!==b)return this.sa=b,this.value=this.key=a=b.key,!0;this.ce();return!1};kb.prototype.Ad=function(){return this.next()};
kb.prototype.first=function(){var a=this.ma;this.qa=a.Ja;a=a.ea;return null!==a?(this.sa=a,this.value=this.key=a=a.key):null};kb.prototype.any=function(a){var b=this.ma;this.sa=null;for(b=b.ea;null!==b;){if(a(b.key))return!0;b=b.va}return!1};kb.prototype.all=function(a){var b=this.ma;this.sa=null;for(b=b.ea;null!==b;){if(!a(b.key))return!1;b=b.va}return!0};kb.prototype.each=function(a){var b=this.ma;this.sa=null;for(b=b.ea;null!==b;)a(b.key),b=b.va;return this};
kb.prototype.map=function(a){var b=this.ma;this.sa=null;var c=new F;for(b=b.ea;null!==b;)c.add(a(b.key)),b=b.va;return c.iterator};kb.prototype.filter=function(a){var b=this.ma;this.sa=null;var c=new F;for(b=b.ea;null!==b;){var d=b.key;a(d)&&c.add(d);b=b.va}return c.iterator};kb.prototype.ce=function(){this.value=this.key=null;this.qa=-1};kb.prototype.toString=function(){return null!==this.sa?"MapKeySetIterator@"+this.sa.value:"MapKeySetIterator"};
ma.Object.defineProperties(kb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Rb}}});kb.prototype.first=kb.prototype.first;kb.prototype.hasNext=kb.prototype.Ad;kb.prototype.next=kb.prototype.next;kb.prototype.reset=kb.prototype.reset;kb.className="MapKeySetIterator";function lb(a){H.call(this);Qa(this);this._isFrozen=!0;this.ma=a}la(lb,H);t=lb.prototype;t.freeze=function(){return this};t.ja=function(){return this};
t.toString=function(){return"MapKeySet("+this.ma.toString()+")"};t.add=function(){C("This Set is read-only: "+this.toString())};t.contains=function(a){return this.ma.contains(a)};t.has=function(a){return this.contains(a)};t.remove=function(){C("This Set is read-only: "+this.toString())};t.delete=function(a){return this.remove(a)};t.clear=function(){C("This Set is read-only: "+this.toString())};t.first=function(){var a=this.ma.ea;return null!==a?a.key:null};
lb.prototype.any=function(a){for(var b=this.ma.ea;null!==b;){if(a(b.key))return!0;b=b.va}return!1};lb.prototype.all=function(a){for(var b=this.ma.ea;null!==b;){if(!a(b.key))return!1;b=b.va}return!0};lb.prototype.each=function(a){for(var b=this.ma.ea;null!==b;)a(b.key),b=b.va;return this};lb.prototype.map=function(a){for(var b=new H,c=this.ma.ea;null!==c;)b.add(a(c.key)),c=c.va;return b};lb.prototype.filter=function(a){for(var b=new H,c=this.ma.ea;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.va}return b};
lb.prototype.copy=function(){return new lb(this.ma)};lb.prototype.Gv=function(){var a=new H,b=this.ma.Sb,c;for(c in b)a.add(b[c].key);return a};lb.prototype.Fa=function(){var a=this.ma.Sb,b=Array(this.ma.Rb),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};lb.prototype.Fv=function(){var a=new F,b=this.ma.Sb,c;for(c in b)a.add(b[c].key);return a};
ma.Object.defineProperties(lb.prototype,{count:{get:function(){return this.ma.Rb}},size:{get:function(){return this.ma.Rb}},iterator:{get:function(){return 0>=this.ma.Rb?Ya:new kb(this.ma)}}});lb.prototype.toList=lb.prototype.Fv;lb.prototype.toArray=lb.prototype.Fa;lb.prototype.toSet=lb.prototype.Gv;lb.prototype.first=lb.prototype.first;lb.prototype.clear=lb.prototype.clear;lb.prototype["delete"]=lb.prototype.delete;
lb.prototype.remove=lb.prototype.remove;lb.prototype.has=lb.prototype.has;lb.prototype.contains=lb.prototype.contains;lb.prototype.add=lb.prototype.add;lb.prototype.thaw=lb.prototype.ja;lb.prototype.freeze=lb.prototype.freeze;lb.className="MapKeySet";function mb(a){this.ma=a;a.jf=null;this.qa=a.Ja;this.sa=null}mb.prototype.reset=function(){var a=this.ma;a.jf=null;this.qa=a.Ja;this.sa=null};
mb.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&null===this.key)return!1;var b=this.sa;b=null===b?a.ea:b.va;if(null!==b)return this.sa=b,this.value=b.value,this.key=b.key,!0;this.ce();return!1};mb.prototype.Ad=function(){return this.next()};mb.prototype.first=function(){var a=this.ma;this.qa=a.Ja;a=a.ea;if(null!==a){this.sa=a;var b=a.value;this.key=a.key;return this.value=b}return null};
mb.prototype.any=function(a){var b=this.ma;this.sa=b.jf=null;for(b=b.ea;null!==b;){if(a(b.value))return!0;b=b.va}return!1};mb.prototype.all=function(a){var b=this.ma;this.sa=b.jf=null;for(b=b.ea;null!==b;){if(!a(b.value))return!1;b=b.va}return!0};mb.prototype.each=function(a){var b=this.ma;this.sa=b.jf=null;for(b=b.ea;null!==b;)a(b.value),b=b.va;return this};mb.prototype.map=function(a){var b=this.ma;this.sa=b.jf=null;var c=new F;for(b=b.ea;null!==b;)c.add(a(b.value)),b=b.va;return c.iterator};
mb.prototype.filter=function(a){var b=this.ma;this.sa=b.jf=null;var c=new F;for(b=b.ea;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.va}return c.iterator};mb.prototype.ce=function(){this.value=this.key=null;this.qa=-1;this.ma.jf=this};mb.prototype.toString=function(){return null!==this.sa?"MapValueSetIterator@"+this.sa.value:"MapValueSetIterator"};ma.Object.defineProperties(mb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Rb}}});
mb.prototype.first=mb.prototype.first;mb.prototype.hasNext=mb.prototype.Ad;mb.prototype.next=mb.prototype.next;mb.prototype.reset=mb.prototype.reset;mb.className="MapValueSetIterator";function ib(a,b){this.key=a;this.value=b;this.kl=this.va=null}ib.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};ib.className="KeyValuePair";function nb(a){this.ma=a;a.Sa=null;this.qa=a.Ja;this.sa=null}nb.prototype.reset=function(){var a=this.ma;a.Sa=null;this.qa=a.Ja;this.sa=null};
nb.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&null===this.key)return!1;var b=this.sa;b=null===b?a.ea:b.va;if(null!==b)return this.sa=b,this.key=b.key,this.value=b.value,!0;this.ce();return!1};nb.prototype.Ad=function(){return this.next()};nb.prototype.first=function(){var a=this.ma;this.qa=a.Ja;a=a.ea;return null!==a?(this.sa=a,this.key=a.key,this.value=a.value,a):null};nb.prototype.any=function(a){var b=this.ma;this.sa=b.Sa=null;for(b=b.ea;null!==b;){if(a(b))return!0;b=b.va}return!1};
nb.prototype.all=function(a){var b=this.ma;this.sa=b.Sa=null;for(b=b.ea;null!==b;){if(!a(b))return!1;b=b.va}return!0};nb.prototype.each=function(a){var b=this.ma;this.sa=b.Sa=null;for(b=b.ea;null!==b;)a(b),b=b.va;return this};nb.prototype.map=function(a){var b=this.ma;this.sa=b.Sa=null;var c=new F;for(b=b.ea;null!==b;)c.add(a(b)),b=b.va;return c.iterator};nb.prototype.filter=function(a){var b=this.ma;this.sa=b.Sa=null;var c=new F;for(b=b.ea;null!==b;)a(b)&&c.add(b),b=b.va;return c.iterator};
nb.prototype.ce=function(){this.value=this.key=null;this.qa=-1;this.ma.Sa=this};nb.prototype.toString=function(){return null!==this.sa?"MapIterator@"+this.sa:"MapIterator"};ma.Object.defineProperties(nb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Rb}}});nb.prototype.first=nb.prototype.first;nb.prototype.hasNext=nb.prototype.Ad;nb.prototype.next=nb.prototype.next;nb.prototype.reset=nb.prototype.reset;
nb.className="MapIterator";function ob(a){Qa(this);this._isFrozen=!1;this.Sb={};this.Rb=0;this.jf=this.Sa=null;this.Ja=0;this.kf=this.ea=null;"string"===typeof a&&C("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=ob.prototype;t.xb=function(){var a=this.Ja;a++;999999999<a&&(a=0);this.Ja=a};t.freeze=function(){this._isFrozen=!0;return this};t.ja=function(){this._isFrozen=!1;return this};t.toString=function(){return"Map()#"+bb(this)};
t.add=function(a,b){this._isFrozen&&va(this,a);var c=a;za(a)&&(c=fb(a));var d=this.Sb[c];void 0===d?(this.Rb++,a=new ib(a,b),this.Sb[c]=a,c=this.kf,null===c?this.ea=a:(a.kl=c,c.va=a),this.kf=a,this.xb()):d.value=b;return this};t.set=function(a,b){return this.add(a,b)};
t.addAll=function(a){if(null===a)return this;if(Aa(a))for(var b=a.length,c=0;c<b;c++){var d=a[c];this.add(d.key,d.value)}else if(a instanceof ob)for(a=a.iterator;a.next();)this.add(a.key,a.value);else for(a=a.iterator;a.next();)b=a.value,this.add(b.key,b.value);return this};t.first=function(){return this.ea};ob.prototype.any=function(a){for(var b=this.ea;null!==b;){if(a(b))return!0;b=b.va}return!1};ob.prototype.all=function(a){for(var b=this.ea;null!==b;){if(!a(b))return!1;b=b.va}return!0};
ob.prototype.each=function(a){for(var b=this.ea;null!==b;)a(b),b=b.va;return this};ob.prototype.map=function(a){for(var b=new ob,c=this.ea;null!==c;)b.add(c.key,a(c)),c=c.va;return b};ob.prototype.filter=function(a){for(var b=new ob,c=this.ea;null!==c;)a(c)&&b.add(c.key,c.value),c=c.va;return b};t=ob.prototype;t.contains=function(a){var b=a;return za(a)&&(b=bb(a),void 0===b)?!1:void 0!==this.Sb[b]};t.has=function(a){return this.contains(a)};
t.I=function(a){var b=a;if(za(a)&&(b=bb(a),void 0===b))return null;a=this.Sb[b];return void 0===a?null:a.value};t.get=function(a){return this.I(a)};t.remove=function(a){if(null===a)return!1;this._isFrozen&&va(this,a);var b=a;if(za(a)&&(b=bb(a),void 0===b))return!1;a=this.Sb[b];if(void 0===a)return!1;var c=a.va,d=a.kl;null!==c&&(c.kl=d);null!==d&&(d.va=c);this.ea===a&&(this.ea=c);this.kf===a&&(this.kf=d);delete this.Sb[b];this.Rb--;this.xb();return!0};t.delete=function(a){return this.remove(a)};
t.clear=function(){this._isFrozen&&va(this);this.Sb={};this.Rb=0;null!==this.Sa&&this.Sa.reset();null!==this.jf&&this.jf.reset();this.kf=this.ea=null;this.xb()};ob.prototype.copy=function(){var a=new ob,b=this.Sb,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};ob.prototype.Fa=function(){var a=this.Sb,b=Array(this.Rb),c=0,d;for(d in a){var e=a[d];b[c]=new ib(e.key,e.value);c++}return b};ob.prototype.Lf=function(){return new lb(this)};
ma.Object.defineProperties(ob.prototype,{count:{get:function(){return this.Rb}},size:{get:function(){return this.Rb}},iterator:{get:function(){if(0>=this.count)return Ya;var a=this.Sa;return null!==a?(a.reset(),a):new nb(this)}},iteratorKeys:{get:function(){return 0>=this.count?Ya:new kb(this)}},iteratorValues:{get:function(){if(0>=this.count)return Ya;
var a=this.jf;return null!==a?(a.reset(),a):new mb(this)}}});ob.prototype.toKeySet=ob.prototype.Lf;ob.prototype.toArray=ob.prototype.Fa;ob.prototype.clear=ob.prototype.clear;ob.prototype["delete"]=ob.prototype.delete;ob.prototype.remove=ob.prototype.remove;ob.prototype.get=ob.prototype.get;ob.prototype.getValue=ob.prototype.I;ob.prototype.has=ob.prototype.has;ob.prototype.contains=ob.prototype.contains;ob.prototype.first=ob.prototype.first;ob.prototype.addAll=ob.prototype.addAll;
ob.prototype.set=ob.prototype.set;ob.prototype.add=ob.prototype.add;ob.prototype.thaw=ob.prototype.ja;ob.prototype.freeze=ob.prototype.freeze;ob.className="Map";function J(a,b){void 0===a?this.y=this.x=0:"number"===typeof a&&"number"===typeof b?(this.x=a,this.y=b):C("Invalid arguments to Point constructor: "+a+", "+b);this._isFrozen=!1}var pb,qb,rb,sb,tb;J.prototype.assign=function(a){this.x=a.x;this.y=a.y;return this};J.prototype.h=function(a,b){this.x=a;this.y=b;return this};
J.prototype.sg=function(a,b){this.x=a;this.y=b;return this};J.prototype.set=function(a){this.x=a.x;this.y=a.y;return this};J.prototype.copy=function(){var a=new J;a.x=this.x;a.y=this.y;return a};t=J.prototype;t.ia=function(){this._isFrozen=!0;Object.freeze(this);return this};t.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};
t.ja=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this._isFrozen=!1;return this};function ub(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 J(c,e)}return new J}function vb(a){return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.C=function(a){return a instanceof J?this.x===a.x&&this.y===a.y:!1};
t.hi=function(a,b){return this.x===a&&this.y===b};t.Xa=function(a){return K.B(this.x,a.x)&&K.B(this.y,a.y)};t.add=function(a){this.x+=a.x;this.y+=a.y;return this};t.re=function(a){this.x-=a.x;this.y-=a.y;return this};t.offset=function(a,b){this.x+=a;this.y+=b;return this};
J.prototype.rotate=function(a){if(0===a)return this;var b=this.x,c=this.y;if(0===b&&0===c)return this;360<=a?a-=360:0>a&&(a+=360);if(90===a){a=0;var d=1}else 180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));this.x=a*b-d*c;this.y=d*b+a*c;return this};t=J.prototype;t.scale=function(a,b){this.x*=a;this.y*=b;return this};t.Bf=function(a){var b=a.x-this.x;a=a.y-this.y;return b*b+a*a};t.zd=function(a,b){a-=this.x;b-=this.y;return a*a+b*b};
t.normalize=function(){var a=this.x,b=this.y,c=Math.sqrt(a*a+b*b);0<c&&(this.x=a/c,this.y=b/c);return this};t.ab=function(a){return wb(a.x-this.x,a.y-this.y)};t.direction=function(a,b){return wb(a-this.x,b-this.y)};function wb(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}t.Ry=function(a,b){return K.El(a.x,a.y,b.x,b.y,this.x,this.y)};
t.dA=function(a,b,c,d){K.qh(a,b,c,d,this.x,this.y,this);return this};t.eA=function(a,b){K.qh(a.x,a.y,b.x,b.y,this.x,this.y,this);return this};t.sA=function(a,b,c,d){K.No(this.x,this.y,a,b,c,d,this);return this};t.tA=function(a,b){K.No(this.x,this.y,a.x,a.y,b.width,b.height,this);return this};t.xi=function(a,b){this.x=a.x+b.x*a.width+b.offsetX;this.y=a.y+b.y*a.height+b.offsetY;return this};t.yi=function(a,b,c,d,e){this.x=a+e.x*c+e.offsetX;this.y=b+e.y*d+e.offsetY;return this};
t.transform=function(a){a.Ga(this);return this};function xb(a,b){b.Cd(a);return a}function yb(a,b,c,d,e,f){var g=e-c,h=f-d,k=g*g+h*h;c-=a;d-=b;var l=-c*g-d*h;if(0>=l||l>=k)return g=e-a,h=f-b,Math.min(c*c+d*d,g*g+h*h);a=g*d-h*c;return a*a/k}function zb(a,b,c,d){a=c-a;b=d-b;return a*a+b*b}function Ab(a,b,c,d){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}
t.w=function(){return isFinite(this.x)&&isFinite(this.y)};J.alloc=function(){var a=Bb.pop();return void 0===a?new J:a};J.allocAt=function(a,b){var c=Bb.pop();if(void 0===c)return new J(a,b);c.x=a;c.y=b;return c};J.free=function(a){Bb.push(a)};J.prototype.isReal=J.prototype.w;J.prototype.setSpot=J.prototype.yi;J.prototype.setRectSpot=J.prototype.xi;J.prototype.snapToGridPoint=J.prototype.tA;J.prototype.snapToGrid=J.prototype.sA;J.prototype.projectOntoLineSegmentPoint=J.prototype.eA;
J.prototype.projectOntoLineSegment=J.prototype.dA;J.intersectingLineSegments=function(a,b,c,d,e,f,g,h){return K.Ql(a,b,c,d,e,f,g,h)};J.prototype.compareWithLineSegmentPoint=J.prototype.Ry;J.compareWithLineSegment=function(a,b,c,d,e,f){return K.El(a,b,c,d,e,f)};J.prototype.direction=J.prototype.direction;J.prototype.directionPoint=J.prototype.ab;J.prototype.normalize=J.prototype.normalize;J.prototype.distanceSquared=J.prototype.zd;J.prototype.distanceSquaredPoint=J.prototype.Bf;J.prototype.scale=J.prototype.scale;
J.prototype.rotate=J.prototype.rotate;J.prototype.offset=J.prototype.offset;J.prototype.subtract=J.prototype.re;J.prototype.add=J.prototype.add;J.prototype.equalsApprox=J.prototype.Xa;J.prototype.equalTo=J.prototype.hi;J.prototype.equals=J.prototype.C;J.prototype.set=J.prototype.set;J.prototype.setTo=J.prototype.sg;var Bb=[];J.className="Point";J.parse=ub;J.stringify=vb;J.distanceLineSegmentSquared=yb;J.distanceSquared=zb;J.direction=Ab;J.Origin=pb=(new J(0,0)).ia();
J.InfiniteTopLeft=qb=(new J(-Infinity,-Infinity)).ia();J.InfiniteBottomRight=rb=(new J(Infinity,Infinity)).ia();J.SixPoint=sb=(new J(6,6)).ia();J.NoPoint=tb=(new J(NaN,NaN)).ia();J.parse=ub;J.stringify=vb;J.distanceLineSegmentSquared=yb;J.distanceSquared=zb;J.direction=Ab;
function L(a,b){void 0===a?this.height=this.width=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.width=a,this.height=b):C("Invalid arguments to Size constructor: "+a+", "+b);this._isFrozen=!1}var Cb,Gb,Hb,Ib,Jb,Kb,Lb;L.prototype.assign=function(a){this.width=a.width;this.height=a.height;return this};L.prototype.h=function(a,b){this.width=a;this.height=b;return this};L.prototype.sg=function(a,b){this.width=a;this.height=b;return this};
L.prototype.set=function(a){this.width=a.width;this.height=a.height;return this};L.prototype.copy=function(){var a=new L;a.width=this.width;a.height=this.height;return a};t=L.prototype;t.ia=function(){this._isFrozen=!0;Object.freeze(this);return this};t.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.ja=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this._isFrozen=!1;return this};
function Mb(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 L(c,e)}return new L}function Nb(a){return a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Size("+this.width+","+this.height+")"};t.C=function(a){return a instanceof L?this.width===a.width&&this.height===a.height:!1};t.hi=function(a,b){return this.width===a&&this.height===b};
t.Xa=function(a){return K.B(this.width,a.width)&&K.B(this.height,a.height)};t.Ac=function(a,b){a=this.width+a;this.width=0<=a?a:0;b=this.height+b;this.height=0<=b?b:0;return this};t.w=function(){return isFinite(this.width)&&isFinite(this.height)};L.alloc=function(){var a=Ob.pop();return void 0===a?new L:a};L.free=function(a){Ob.push(a)};L.prototype.isReal=L.prototype.w;L.prototype.inflate=L.prototype.Ac;L.prototype.equalsApprox=L.prototype.Xa;L.prototype.equalTo=L.prototype.hi;
L.prototype.equals=L.prototype.C;L.prototype.set=L.prototype.set;L.prototype.setTo=L.prototype.sg;var Ob=[];L.className="Size";L.parse=Mb;L.stringify=Nb;L.ZeroSize=Cb=(new L(0,0)).ia();L.OneSize=Gb=(new L(1,1)).ia();L.SixSize=Hb=(new L(6,6)).ia();L.EightSize=Ib=(new L(8,8)).ia();L.TenSize=Jb=(new L(10,10)).ia();L.InfiniteSize=Kb=(new L(Infinity,Infinity)).ia();L.NoSize=Lb=(new L(NaN,NaN)).ia();L.parse=Mb;L.stringify=Nb;
function N(a,b,c,d){void 0===a?this.height=this.width=this.y=this.x=0:"number"===typeof a&&"number"===typeof b&&"number"===typeof c&&(0<=c||isNaN(c))&&"number"===typeof d&&(0<=d||isNaN(d))?(this.x=a,this.y=b,this.width=c,this.height=d):a instanceof J?(c=a.x,a=a.y,b instanceof J?(d=b.x,b=b.y,this.x=Math.min(c,d),this.y=Math.min(a,b),this.width=Math.abs(c-d),this.height=Math.abs(a-b)):b instanceof L?(this.x=c,this.y=a,this.width=b.width,this.height=b.height):C("Incorrect second argument supplied to Rect constructor "+
b)):C("Invalid arguments to Rect constructor: "+a+", "+b+", "+c+", "+d);this._isFrozen=!1}t=N.prototype;t.assign=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this};t.h=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};function Pb(a,b,c){a.width=b;a.height=c}t.sg=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};t.set=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this};
t.cd=function(a){this.x=a.x;this.y=a.y;return this};t.rA=function(a){this.width=a.width;this.height=a.height;return this};N.prototype.copy=function(){var a=new N;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;return a};t=N.prototype;t.ia=function(){this._isFrozen=!0;Object.freeze(this);return this};t.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};
t.ja=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this._isFrozen=!1;return this};function Qb(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 f=0;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));for(var g=0;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return new N(c,e,f,g)}return new N}
function Rb(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};t.C=function(a){return a instanceof N?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1};t.hi=function(a,b,c,d){return this.x===a&&this.y===b&&this.width===c&&this.height===d};t.Xa=function(a){return K.B(this.x,a.x)&&K.B(this.y,a.y)&&K.B(this.width,a.width)&&K.B(this.height,a.height)};
function Ub(a,b){return K.$(a.x,b.x)&&K.$(a.y,b.y)&&K.$(a.width,b.width)&&K.$(a.height,b.height)}t.ca=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y};t.Re=function(a){return this.x<=a.x&&a.x+a.width<=this.x+this.width&&this.y<=a.y&&a.y+a.height<=this.y+this.height};t.contains=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return this.x<=a&&a+c<=this.x+this.width&&this.y<=b&&b+d<=this.y+this.height};t.offset=function(a,b){this.x+=a;this.y+=b;return this};
t.Ac=function(a,b){return Vb(this,b,a,b,a)};t.Co=function(a){return Vb(this,a.top,a.right,a.bottom,a.left)};t.Dv=function(a){return Vb(this,-a.top,-a.right,-a.bottom,-a.left)};t.Hz=function(a,b,c,d){return Vb(this,a,b,c,d)};function Vb(a,b,c,d,e){var f=a.width;c+e<=-f?(a.x+=f/2,a.width=0):(a.x-=e,a.width+=c+e);c=a.height;b+d<=-c?(a.y+=c/2,a.height=0):(a.y-=b,a.height+=b+d);return a}t.Cx=function(a){return Wb(this,a.x,a.y,a.width,a.height)};t.Uu=function(a,b,c,d){return Wb(this,a,b,c,d)};
function Wb(a,b,c,d,e){var f=Math.max(a.x,b),g=Math.max(a.y,c);b=Math.min(a.x+a.width,b+d);c=Math.min(a.y+a.height,c+e);a.x=f;a.y=g;a.width=Math.max(0,b-f);a.height=Math.max(0,c-g);return a}t.Xc=function(a){return this.Vu(a.x,a.y,a.width,a.height)};t.Vu=function(a,b,c,d){var e=this.width,f=this.x;if(Infinity!==e&&Infinity!==c&&(e+=f,c+=a,isNaN(c)||isNaN(e)||f>c||a>e))return!1;a=this.height;c=this.y;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0};
function Xb(a,b){var c=a.width,d=a.x,e=b.x-10;if(d>b.width+10+10+e||e>c+d)return!1;c=a.height;a=a.y;d=b.y-10;return a>b.height+10+10+d||d>c+a?!1:!0}t.Ye=function(a){return Yb(this,a.x,a.y,0,0)};t.dd=function(a){return Yb(this,a.x,a.y,a.width,a.height)};t.Iv=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return Yb(this,a,b,c,d)};
function Yb(a,b,c,d,e){var f=Math.min(a.x,b),g=Math.min(a.y,c);b=Math.max(a.x+a.width,b+d);c=Math.max(a.y+a.height,c+e);a.x=f;a.y=g;a.width=b-f;a.height=c-g;return a}t.yi=function(a,b,c){this.x=a-c.offsetX-c.x*this.width;this.y=b-c.offsetY-c.y*this.height;return this};function Zb(a,b,c,d,e,f,g,h){void 0===g&&(g=0);void 0===h&&(h=0);return a<=e&&e+g<=a+c&&b<=f&&f+h<=b+d}function $b(a,b,c,d,e,f,g,h){return a>g+e||e>c+a?!1:b>h+f||f>d+b?!1:!0}
t.w=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.Mz=function(){return 0===this.width&&0===this.height};N.alloc=function(){var a=ac.pop();return void 0===a?new N:a};N.allocAt=function(a,b,c,d){var e=ac.pop();return void 0===e?new N(a,b,c,d):e.h(a,b,c,d)};N.free=function(a){ac.push(a)};
ma.Object.defineProperties(N.prototype,{left:{get:function(){return this.x},set:function(a){this.x=a}},top:{get:function(){return this.y},set:function(a){this.y=a}},right:{get:function(){return this.x+this.width},set:function(a){this.x+=a-(this.x+this.width)}},bottom:{get:function(){return this.y+this.height},set:function(a){this.y+=a-(this.y+this.height)}},position:{
get:function(){return new J(this.x,this.y)},set:function(a){this.x=a.x;this.y=a.y}},size:{get:function(){return new L(this.width,this.height)},set:function(a){this.width=a.width;this.height=a.height}},center:{get:function(){return new J(this.x+this.width/2,this.y+this.height/2)},set:function(a){this.x=a.x-this.width/2;this.y=a.y-this.height/2}},centerX:{get:function(){return this.x+this.width/2},
set:function(a){this.x=a-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(a){this.y=a-this.height/2}}});N.prototype.isEmpty=N.prototype.Mz;N.prototype.isReal=N.prototype.w;N.intersectsLineSegment=function(a,b,c,d,e,f,g,h){return K.Ex(a,b,c,d,e,f,g,h)};N.prototype.setSpot=N.prototype.yi;N.prototype.union=N.prototype.Iv;N.prototype.unionRect=N.prototype.dd;N.prototype.unionPoint=N.prototype.Ye;N.prototype.intersects=N.prototype.Vu;
N.prototype.intersectsRect=N.prototype.Xc;N.prototype.intersect=N.prototype.Uu;N.prototype.intersectRect=N.prototype.Cx;N.prototype.grow=N.prototype.Hz;N.prototype.subtractMargin=N.prototype.Dv;N.prototype.addMargin=N.prototype.Co;N.prototype.inflate=N.prototype.Ac;N.prototype.offset=N.prototype.offset;N.prototype.contains=N.prototype.contains;N.prototype.containsRect=N.prototype.Re;N.prototype.containsPoint=N.prototype.ca;N.prototype.equalsApprox=N.prototype.Xa;N.prototype.equalTo=N.prototype.hi;
N.prototype.equals=N.prototype.C;N.prototype.setSize=N.prototype.rA;N.prototype.setPoint=N.prototype.cd;N.prototype.set=N.prototype.set;N.prototype.setTo=N.prototype.sg;var bc=null,cc=null,ac=[];N.className="Rect";N.parse=Qb;N.stringify=Rb;N.contains=Zb;N.intersects=$b;N.ZeroRect=bc=(new N(0,0,0,0)).ia();N.NoRect=cc=(new N(NaN,NaN,NaN,NaN)).ia();N.parse=Qb;N.stringify=Rb;N.contains=Zb;N.intersects=$b;
function dc(a,b,c,d){void 0===a?this.left=this.bottom=this.right=this.top=0:void 0===b?this.left=this.bottom=this.right=this.top=a:void 0===c?(this.top=a,this.right=b,this.bottom=a,this.left=b):void 0!==d?(this.top=a,this.right=b,this.bottom=c,this.left=d):C("Invalid arguments to Margin constructor: "+a+", "+b+", "+c+", "+d);this._isFrozen=!1}dc.prototype.assign=function(a){this.top=a.top;this.right=a.right;this.bottom=a