UNPKG

jh-gojs

Version:

Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams

121 lines 915 kB
/* * GoJS v2.2.3 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-2022 by Northwoods Software Corporation. All Rights Reserved. * THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/2.2.3/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},ka={};try{ka.__proto__=ia;ha=ka.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 la=fa; function ma(a,b){a.prototype=ea(b.prototype);a.prototype.constructor=a;if(la)la(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.oB=b.prototype} var na="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},qa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)}; function ra(a,b){if(b){var c=na;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&&qa(c,a,{writable:!0,value:b})}}ra("Object.assign",function(a){return a||oa});ra("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 sa(){}function ta(a,b){var c=-1;return function(){var d=this,e=arguments;-1!==c&&x.clearTimeout(c);c=ua(function(){c=-1;a.apply(d,e)},b)}}function ua(a,b){return x.setTimeout(a,b)} function va(a){return x.document.createElement(a)}function C(a){throw Error(a);}function wa(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 Ia(a){a.length=0;Fa.push(a)}function Ja(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 Ja(a.constructor);return typeof a} function Ka(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 La(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.aB;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1} function Ma(a,b,c){Object.defineProperty(Pa.prototype,a,{get:b,set:c})} function Qa(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 Ra=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("Trident/7"),Sa=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("Edge/"),Ta=void 0!==x.navigator&&void 0!==x.navigator.platform&&0<=x.navigator.platform.toUpperCase().indexOf("MAC"),Ua=void 0!==x.navigator&&void 0!==x.navigator.platform&&null!==x.navigator.platform.match(/(iPhone|iPod|iPad)/i),Fa=[];Object.freeze([]);sa.className="Util";sa.Dx="32ab5ff3b26f42dc0ed90f21462913b5";sa.adym="gojs.net";sa.vfo="28e644fdb0";sa.className="Util"; function D(a,b,c){Va(this);this.j=a;this.na=b;this.o=c}D.prototype.toString=function(){return"EnumValue."+this.na};function Wa(a,b){return void 0===b||null===b||""===b?null:a[b]}na.Object.defineProperties(D.prototype,{classType:{get:function(){return this.j}},name:{get:function(){return this.na}},value:{get:function(){return this.o}}});D.className="EnumValue";function Xa(){this.Gw=[]}Xa.prototype.toString=function(){return this.Gw.join("")}; Xa.prototype.add=function(a){""!==a&&this.Gw.push(a)};Xa.className="StringBuilder";function Ya(){}Ya.className="PropertyCollection"; var Za={cB:!1,hB:!1,eB:!1,gB:!1,mB:!1,kB:!1,Ox:!1,dB:null,trace:function(a){x.console&&x.console.log(a)},fB: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)},bB: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.km=Object.getOwnPropertyNames(d.prototype);for(var e={bk:0};e.bk<b.km.length;e={bk:e.bk},e.bk++){var f=Object.getOwnPropertyDescriptor(d.prototype,b.km[e.bk]);void 0!==f.get&&void 0===f.set&&Object.defineProperty(d.prototype, b.km[e.bk],{set:function(a,b){return function(){throw Error("Property "+a.km[b.bk]+" of "+a.x+" is read-only.");}}(b,e)})}}}b={km:b.km,x:b.x}}}};function $a(){}$a.prototype.reset=function(){};$a.prototype.next=function(){return!1};$a.prototype.qd=function(){return!1};$a.prototype.first=function(){return null};$a.prototype.any=function(){return!1};$a.prototype.all=function(){return!0};$a.prototype.each=function(){return this};$a.prototype.map=function(){return this};$a.prototype.filter=function(){return this}; $a.prototype.Ud=function(){};$a.prototype.toString=function(){return"EmptyIterator"};na.Object.defineProperties($a.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}});$a.prototype.first=$a.prototype.first;$a.prototype.hasNext=$a.prototype.qd;$a.prototype.next=$a.prototype.next;$a.prototype.reset=$a.prototype.reset;var ab=null;$a.className="EmptyIterator";ab=new $a;function bb(a){this.key=-1;this.value=a} bb.prototype.reset=function(){this.key=-1};bb.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1};bb.prototype.qd=function(){return this.next()};bb.prototype.first=function(){this.key=0;return this.value};bb.prototype.any=function(a){this.key=-1;return a(this.value)};bb.prototype.all=function(a){this.key=-1;return a(this.value)};bb.prototype.each=function(a){this.key=-1;a(this.value);return this};bb.prototype.map=function(a){return new bb(a(this.value))}; bb.prototype.filter=function(a){return a(this.value)?new bb(this.value):ab};bb.prototype.Ud=function(){this.value=null};bb.prototype.toString=function(){return"SingletonIterator("+this.value+")"};na.Object.defineProperties(bb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}});bb.prototype.first=bb.prototype.first;bb.prototype.hasNext=bb.prototype.qd;bb.prototype.next=bb.prototype.next; bb.prototype.reset=bb.prototype.reset;bb.className="SingletonIterator";function db(a){this.qb=a;this.ef=null;a.Ja=null;this.ia=a.Da;this.Ra=-1}db.prototype.reset=function(){var a=this.qb;a.Ja=null;this.ia=a.Da;this.Ra=-1};db.prototype.next=function(){var a=this.qb;if(a.Da!==this.ia&&0>this.key)return!1;a=a.m;var b=a.length,c=++this.Ra,d=this.ef;if(null!==d)for(;c<b;){var e=a[c];if(d(e))return this.key=this.Ra=c,this.value=e,!0;c++}else{if(c<b)return this.key=c,this.value=a[c],!0;this.Ud()}return!1}; db.prototype.qd=function(){return this.next()};db.prototype.first=function(){var a=this.qb;this.ia=a.Da;this.Ra=0;a=a.m;var b=a.length,c=this.ef;if(null!==c){for(var d=0;d<b;){var e=a[d];if(c(e))return this.key=this.Ra=d,this.value=e;d++}return null}return 0<b?(a=a[0],this.key=0,this.value=a):null};db.prototype.any=function(a){var b=this.qb;b.Ja=null;this.Ra=-1;b=b.m;for(var c=b.length,d=this.ef,e=0;e<c;e++){var f=b[e];if((null===d||d(f))&&a(f))return!0}return!1}; db.prototype.all=function(a){var b=this.qb;b.Ja=null;this.Ra=-1;b=b.m;for(var c=b.length,d=this.ef,e=0;e<c;e++){var f=b[e];if((null===d||d(f))&&!a(f))return!1}return!0};db.prototype.each=function(a){var b=this.qb;b.Ja=null;this.Ra=-1;b=b.m;for(var c=b.length,d=this.ef,e=0;e<c;e++){var f=b[e];(null===d||d(f))&&a(f)}return this}; db.prototype.map=function(a){var b=this.qb;b.Ja=null;this.Ra=-1;var c=[];b=b.m;for(var d=b.length,e=this.ef,f=0;f<d;f++){var g=b[f];(null===e||e(g))&&c.push(a(g))}a=new F;a.m=c;a.lb();return a.iterator};db.prototype.filter=function(a){var b=this.qb;b.Ja=null;this.Ra=-1;var c=[];b=b.m;for(var d=b.length,e=this.ef,f=0;f<d;f++){var g=b[f];(null===e||e(g))&&a(g)&&c.push(g)}a=new F;a.m=c;a.lb();return a.iterator}; db.prototype.Ud=function(){this.key=-1;this.value=null;this.ia=-1;this.ef=null;this.qb.Ja=this};db.prototype.toString=function(){return"ListIterator@"+this.Ra+"/"+this.qb.count}; na.Object.defineProperties(db.prototype,{iterator:{get:function(){return this}},predicate:{get:function(){return this.ef},set:function(a){this.ef=a}},count:{get:function(){var a=this.ef;if(null!==a){for(var b=0,c=this.qb.m,d=c.length,e=0;e<d;e++)a(c[e])&&b++;return b}return this.qb.m.length}}});db.prototype.first=db.prototype.first;db.prototype.hasNext=db.prototype.qd;db.prototype.next=db.prototype.next; db.prototype.reset=db.prototype.reset;db.className="ListIterator";function eb(a){this.qb=a;a.Tg=null;this.ia=a.Da;this.Ra=a.m.length}eb.prototype.reset=function(){var a=this.qb;a.Tg=null;this.ia=a.Da;this.Ra=a.m.length};eb.prototype.next=function(){var a=this.qb;if(a.Da!==this.ia&&0>this.key)return!1;var b=--this.Ra;if(0<=b)return this.key=b,this.value=a.m[b],!0;this.Ud();return!1};eb.prototype.qd=function(){return this.next()}; eb.prototype.first=function(){var a=this.qb;this.ia=a.Da;var b=a.m;this.Ra=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};eb.prototype.any=function(a){var b=this.qb;b.Tg=null;b=b.m;var c=b.length;this.Ra=c;for(--c;0<=c;c--)if(a(b[c]))return!0;return!1};eb.prototype.all=function(a){var b=this.qb;b.Tg=null;b=b.m;var c=b.length;this.Ra=c;for(--c;0<=c;c--)if(!a(b[c]))return!1;return!0}; eb.prototype.each=function(a){var b=this.qb;b.Tg=null;b=b.m;var c=b.length;this.Ra=c;for(--c;0<=c;c--)a(b[c]);return this};eb.prototype.map=function(a){var b=this.qb;b.Tg=null;var c=[];b=b.m;var d=b.length;this.Ra=d;for(--d;0<=d;d--)c.push(a(b[d]));a=new F;a.m=c;a.lb();return a.iterator};eb.prototype.filter=function(a){var b=this.qb;b.Tg=null;var c=[];b=b.m;var d=b.length;this.Ra=d;for(--d;0<=d;d--){var e=b[d];a(e)&&c.push(e)}a=new F;a.m=c;a.lb();return a.iterator}; eb.prototype.Ud=function(){this.key=-1;this.value=null;this.ia=-1;this.qb.Tg=this};eb.prototype.toString=function(){return"ListIteratorBackwards("+this.Ra+"/"+this.qb.count+")"};na.Object.defineProperties(eb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.qb.m.length}}});eb.prototype.first=eb.prototype.first;eb.prototype.hasNext=eb.prototype.qd;eb.prototype.next=eb.prototype.next;eb.prototype.reset=eb.prototype.reset; eb.className="ListIteratorBackwards";function F(a){Va(this);this.v=!1;this.m=[];this.Da=0;this.Tg=this.Ja=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.lb=function(){var a=this.Da;a++;999999999<a&&(a=0);this.Da=a};t.freeze=function(){this.v=!0;return this};t.ea=function(){this.v=!1;return this};t.toString=function(){return"List()#"+ib(this)}; t.add=function(a){if(null===a)return this;this.v&&wa(this,a);this.m.push(a);this.lb();return this};t.push=function(a){this.add(a)};t.addAll=function(a){if(null===a)return this;this.v&&wa(this);var b=this.m;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.lb();return this};t.clear=function(){this.v&&wa(this);this.m.length=0;this.lb()};t.contains=function(a){return null===a?!1:-1!==this.m.indexOf(a)};t.has=function(a){return this.contains(a)}; t.indexOf=function(a){return null===a?-1:this.m.indexOf(a)};t.J=function(a){var b=this.m;(0>a||a>=b.length)&&xa(a,"0 <= i < length",F,"elt:i");return b[a]};t.get=function(a){return this.J(a)};t.Pc=function(a,b){var c=this.m;(0>a||a>=c.length)&&xa(a,"0 <= i < length",F,"setElt:i");this.v&&wa(this,a);c[a]=b};t.set=function(a,b){this.Pc(a,b)};t.first=function(){var a=this.m;return 0===a.length?null:a[0]};t.$b=function(){var a=this.m,b=a.length;return 0<b?a[b-1]:null}; t.pop=function(){this.v&&wa(this);var a=this.m;return 0<a.length?a.pop():null};F.prototype.any=function(a){for(var b=this.m,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.m,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.m,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.m,e=d.length,f=0;f<e;f++)c.push(a(d[f]));b.m=c;b.lb();return b}; F.prototype.filter=function(a){for(var b=new F,c=[],d=this.m,e=d.length,f=0;f<e;f++){var g=d[f];a(g)&&c.push(g)}b.m=c;b.lb();return b};t=F.prototype;t.vb=function(a,b){0>a&&xa(a,">= 0",F,"insertAt:i");this.v&&wa(this,a);var c=this.m;a>=c.length?c.push(b):c.splice(a,0,b);this.lb()};t.remove=function(a){if(null===a)return!1;this.v&&wa(this,a);var b=this.m;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.lb();return!0};t.delete=function(a){return this.remove(a)}; t.eb=function(a){var b=this.m;(0>a||a>=b.length)&&xa(a,"0 <= i < length",F,"removeAt:i");this.v&&wa(this,a);a===b.length-1?b.pop():b.splice(a,1);this.lb()};t.removeRange=function(a,b){var c=this.m,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.v&&wa(this);for(var e=a,f=b+1;f<d;)c[e++]=c[f++];c.length=d-(b-a+1);this.lb();return this};F.prototype.copy=function(){var a=new F,b=this.m;0<b.length&&(a.m=Array.prototype.slice.call(b));return a}; t=F.prototype;t.ya=function(){for(var a=this.m,b=this.count,c=Array(b),d=0;d<b;d++)c[d]=a[d];return c};t.Yv=function(){for(var a=new G,b=this.m,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};t.sort=function(a){this.v&&wa(this);this.m.sort(a);this.lb();return this}; t.Vi=function(a,b,c){var d=this.m,e=d.length;void 0===b&&(b=0);void 0===c&&(c=e);this.v&&wa(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.lb()),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.lb();return this}; t.reverse=function(){this.v&&wa(this);this.m.reverse();this.lb();return this}; na.Object.defineProperties(F.prototype,{_dataArray:{get:function(){return this.m}},count:{get:function(){return this.m.length}},size:{get:function(){return this.m.length}},length:{get:function(){return this.m.length}},iterator:{get:function(){if(0>=this.m.length)return ab;var a=this.Ja;return null!==a?(a.reset(),a):new db(this)}},iteratorBackwards:{ get:function(){if(0>=this.m.length)return ab;var a=this.Tg;return null!==a?(a.reset(),a):new eb(this)}}});F.prototype.reverse=F.prototype.reverse;F.prototype.sortRange=F.prototype.Vi;F.prototype.sort=F.prototype.sort;F.prototype.toSet=F.prototype.Yv;F.prototype.toArray=F.prototype.ya;F.prototype.removeRange=F.prototype.removeRange;F.prototype.removeAt=F.prototype.eb;F.prototype["delete"]=F.prototype.delete;F.prototype.remove=F.prototype.remove;F.prototype.insertAt=F.prototype.vb; F.prototype.pop=F.prototype.pop;F.prototype.last=F.prototype.$b;F.prototype.first=F.prototype.first;F.prototype.set=F.prototype.set;F.prototype.setElt=F.prototype.Pc;F.prototype.get=F.prototype.get;F.prototype.elt=F.prototype.J;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.ea; F.prototype.freeze=F.prototype.freeze;F.className="List";function jb(a){this.gg=a;a.Ja=null;this.ia=a.Da;this.ka=null}jb.prototype.reset=function(){var a=this.gg;a.Ja=null;this.ia=a.Da;this.ka=null};jb.prototype.next=function(){var a=this.gg;if(a.Da!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.oa;if(null!==b)return this.ka=b,this.value=b.value,this.key=b.key,!0;this.Ud();return!1};jb.prototype.qd=function(){return this.next()}; jb.prototype.first=function(){var a=this.gg;this.ia=a.Da;a=a.ba;if(null!==a){this.ka=a;var b=a.value;this.key=a.key;return this.value=b}return null};jb.prototype.any=function(a){var b=this.gg;this.ka=b.Ja=null;for(b=b.ba;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};jb.prototype.all=function(a){var b=this.gg;this.ka=b.Ja=null;for(b=b.ba;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};jb.prototype.each=function(a){var b=this.gg;this.ka=b.Ja=null;for(b=b.ba;null!==b;)a(b.value),b=b.oa;return this}; jb.prototype.map=function(a){var b=this.gg;b.Ja=null;var c=new F;for(b=b.ba;null!==b;)c.add(a(b.value)),b=b.oa;return c.iterator};jb.prototype.filter=function(a){var b=this.gg;b.Ja=null;var c=new F;for(b=b.ba;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.oa}return c.iterator};jb.prototype.Ud=function(){this.value=this.key=null;this.ia=-1;this.gg.Ja=this};jb.prototype.toString=function(){return null!==this.ka?"SetIterator@"+this.ka.value:"SetIterator"}; na.Object.defineProperties(jb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.gg.Ib}}});jb.prototype.first=jb.prototype.first;jb.prototype.hasNext=jb.prototype.qd;jb.prototype.next=jb.prototype.next;jb.prototype.reset=jb.prototype.reset;jb.className="SetIterator"; function G(a){Va(this);this.v=!1;this.Jb={};this.Ib=0;this.Ja=null;this.Da=0;this.$e=this.ba=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=G.prototype;t.lb=function(){var a=this.Da;a++;999999999<a&&(a=0);this.Da=a};t.freeze=function(){this.v=!0;return this};t.ea=function(){this.v=!1;return this};t.toString=function(){return"Set()#"+ib(this)}; t.add=function(a){if(null===a)return this;this.v&&wa(this,a);var b=a;za(a)&&(b=kb(a));void 0===this.Jb[b]&&(this.Ib++,a=new lb(a,a),this.Jb[b]=a,b=this.$e,null===b?this.ba=a:(a.xl=b,b.oa=a),this.$e=a,this.lb());return this};t.addAll=function(a){if(null===a)return this;this.v&&wa(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=ib(a),void 0===b)?!1:void 0!==this.Jb[b]};t.has=function(a){return this.contains(a)};t.oz=function(a){if(null===a)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0};t.pz=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.ba;return null===a?null:a.value}; G.prototype.any=function(a){for(var b=this.ba;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};G.prototype.all=function(a){for(var b=this.ba;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};G.prototype.each=function(a){for(var b=this.ba;null!==b;)a(b.value),b=b.oa;return this};G.prototype.map=function(a){for(var b=new G,c=this.ba;null!==c;)b.add(a(c.value)),c=c.oa;return b};G.prototype.filter=function(a){for(var b=new G,c=this.ba;null!==c;){var d=c.value;a(d)&&b.add(d);c=c.oa}return b};t=G.prototype; t.remove=function(a){if(null===a)return!1;this.v&&wa(this,a);var b=a;if(za(a)&&(b=ib(a),void 0===b))return!1;a=this.Jb[b];if(void 0===a)return!1;var c=a.oa,d=a.xl;null!==c&&(c.xl=d);null!==d&&(d.oa=c);this.ba===a&&(this.ba=c);this.$e===a&&(this.$e=d);delete this.Jb[b];this.Ib--;this.lb();return!0};t.delete=function(a){return this.remove(a)}; t.pq=function(a){if(null===a)return this;this.v&&wa(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.LA=function(a){if(null===a||0===this.count)return this;this.v&&wa(this);var b=new G;b.addAll(a);a=[];for(var c=this.iterator;c.next();){var d=c.value;b.contains(d)||a.push(d)}this.pq(a);return this};t.clear=function(){this.v&&wa(this);this.Jb={};this.Ib=0;null!==this.Ja&&this.Ja.reset();this.$e=this.ba=null;this.lb()}; G.prototype.copy=function(){var a=new G,b=this.Jb,c;for(c in b)a.add(b[c].value);return a};G.prototype.ya=function(){var a=Array(this.Ib),b=this.Jb,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};G.prototype.Xv=function(){var a=new F,b=this.Jb,c;for(c in b)a.add(b[c].value);return a};function Va(a){a.__gohashid=mb++}function kb(a){var b=a.__gohashid;void 0===b&&(b=mb++,a.__gohashid=b);return b}function ib(a){return a.__gohashid} na.Object.defineProperties(G.prototype,{count:{get:function(){return this.Ib}},size:{get:function(){return this.Ib}},iterator:{get:function(){if(0>=this.Ib)return ab;var a=this.Ja;return null!==a?(a.reset(),a):new jb(this)}}});G.prototype.toList=G.prototype.Xv;G.prototype.toArray=G.prototype.ya;G.prototype.clear=G.prototype.clear;G.prototype.retainAll=G.prototype.LA;G.prototype.removeAll=G.prototype.pq; G.prototype["delete"]=G.prototype.delete;G.prototype.remove=G.prototype.remove;G.prototype.first=G.prototype.first;G.prototype.containsAny=G.prototype.pz;G.prototype.containsAll=G.prototype.oz;G.prototype.has=G.prototype.has;G.prototype.contains=G.prototype.contains;G.prototype.addAll=G.prototype.addAll;G.prototype.add=G.prototype.add;G.prototype.thaw=G.prototype.ea;G.prototype.freeze=G.prototype.freeze;var mb=1;G.className="Set";G.uniqueHash=Va;G.hashIdUnique=kb;G.hashId=ib; function nb(a){this.ga=a;this.ia=a.Da;this.ka=null}nb.prototype.reset=function(){this.ia=this.ga.Da;this.ka=null};nb.prototype.next=function(){var a=this.ga;if(a.Da!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.oa;if(null!==b)return this.ka=b,this.value=this.key=a=b.key,!0;this.Ud();return!1};nb.prototype.qd=function(){return this.next()};nb.prototype.first=function(){var a=this.ga;this.ia=a.Da;a=a.ba;return null!==a?(this.ka=a,this.value=this.key=a=a.key):null}; nb.prototype.any=function(a){var b=this.ga;this.ka=null;for(b=b.ba;null!==b;){if(a(b.key))return!0;b=b.oa}return!1};nb.prototype.all=function(a){var b=this.ga;this.ka=null;for(b=b.ba;null!==b;){if(!a(b.key))return!1;b=b.oa}return!0};nb.prototype.each=function(a){var b=this.ga;this.ka=null;for(b=b.ba;null!==b;)a(b.key),b=b.oa;return this};nb.prototype.map=function(a){var b=this.ga;this.ka=null;var c=new F;for(b=b.ba;null!==b;)c.add(a(b.key)),b=b.oa;return c.iterator}; nb.prototype.filter=function(a){var b=this.ga;this.ka=null;var c=new F;for(b=b.ba;null!==b;){var d=b.key;a(d)&&c.add(d);b=b.oa}return c.iterator};nb.prototype.Ud=function(){this.value=this.key=null;this.ia=-1};nb.prototype.toString=function(){return null!==this.ka?"MapKeySetIterator@"+this.ka.value:"MapKeySetIterator"};na.Object.defineProperties(nb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ga.Ib}}}); nb.prototype.first=nb.prototype.first;nb.prototype.hasNext=nb.prototype.qd;nb.prototype.next=nb.prototype.next;nb.prototype.reset=nb.prototype.reset;nb.className="MapKeySetIterator";function ob(a){G.call(this);Va(this);this.v=!0;this.ga=a}ma(ob,G);t=ob.prototype;t.freeze=function(){return this};t.ea=function(){return this};t.toString=function(){return"MapKeySet("+this.ga.toString()+")"};t.add=function(){C("This Set is read-only: "+this.toString())};t.contains=function(a){return this.ga.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.ga.ba;return null!==a?a.key:null};ob.prototype.any=function(a){for(var b=this.ga.ba;null!==b;){if(a(b.key))return!0;b=b.oa}return!1};ob.prototype.all=function(a){for(var b=this.ga.ba;null!==b;){if(!a(b.key))return!1;b=b.oa}return!0}; ob.prototype.each=function(a){for(var b=this.ga.ba;null!==b;)a(b.key),b=b.oa;return this};ob.prototype.map=function(a){for(var b=new G,c=this.ga.ba;null!==c;)b.add(a(c.key)),c=c.oa;return b};ob.prototype.filter=function(a){for(var b=new G,c=this.ga.ba;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.oa}return b};ob.prototype.copy=function(){return new ob(this.ga)};ob.prototype.Yv=function(){var a=new G,b=this.ga.Jb,c;for(c in b)a.add(b[c].key);return a}; ob.prototype.ya=function(){var a=this.ga.Jb,b=Array(this.ga.Ib),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};ob.prototype.Xv=function(){var a=new F,b=this.ga.Jb,c;for(c in b)a.add(b[c].key);return a};na.Object.defineProperties(ob.prototype,{count:{get:function(){return this.ga.Ib}},size:{get:function(){return this.ga.Ib}},iterator:{get:function(){return 0>=this.ga.Ib?ab:new nb(this.ga)}}}); ob.prototype.toList=ob.prototype.Xv;ob.prototype.toArray=ob.prototype.ya;ob.prototype.toSet=ob.prototype.Yv;ob.prototype.first=ob.prototype.first;ob.prototype.clear=ob.prototype.clear;ob.prototype["delete"]=ob.prototype.delete;ob.prototype.remove=ob.prototype.remove;ob.prototype.has=ob.prototype.has;ob.prototype.contains=ob.prototype.contains;ob.prototype.add=ob.prototype.add;ob.prototype.thaw=ob.prototype.ea;ob.prototype.freeze=ob.prototype.freeze;ob.className="MapKeySet"; function pb(a){this.ga=a;a.Ze=null;this.ia=a.Da;this.ka=null}pb.prototype.reset=function(){var a=this.ga;a.Ze=null;this.ia=a.Da;this.ka=null};pb.prototype.next=function(){var a=this.ga;if(a.Da!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.oa;if(null!==b)return this.ka=b,this.value=b.value,this.key=b.key,!0;this.Ud();return!1};pb.prototype.qd=function(){return this.next()}; pb.prototype.first=function(){var a=this.ga;this.ia=a.Da;a=a.ba;if(null!==a){this.ka=a;var b=a.value;this.key=a.key;return this.value=b}return null};pb.prototype.any=function(a){var b=this.ga;this.ka=b.Ze=null;for(b=b.ba;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};pb.prototype.all=function(a){var b=this.ga;this.ka=b.Ze=null;for(b=b.ba;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};pb.prototype.each=function(a){var b=this.ga;this.ka=b.Ze=null;for(b=b.ba;null!==b;)a(b.value),b=b.oa;return this}; pb.prototype.map=function(a){var b=this.ga;this.ka=b.Ze=null;var c=new F;for(b=b.ba;null!==b;)c.add(a(b.value)),b=b.oa;return c.iterator};pb.prototype.filter=function(a){var b=this.ga;this.ka=b.Ze=null;var c=new F;for(b=b.ba;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.oa}return c.iterator};pb.prototype.Ud=function(){this.value=this.key=null;this.ia=-1;this.ga.Ze=this};pb.prototype.toString=function(){return null!==this.ka?"MapValueSetIterator@"+this.ka.value:"MapValueSetIterator"}; na.Object.defineProperties(pb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ga.Ib}}});pb.prototype.first=pb.prototype.first;pb.prototype.hasNext=pb.prototype.qd;pb.prototype.next=pb.prototype.next;pb.prototype.reset=pb.prototype.reset;pb.className="MapValueSetIterator";function lb(a,b){this.key=a;this.value=b;this.xl=this.oa=null}lb.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"}; lb.className="KeyValuePair";function qb(a){this.ga=a;a.Ja=null;this.ia=a.Da;this.ka=null}qb.prototype.reset=function(){var a=this.ga;a.Ja=null;this.ia=a.Da;this.ka=null};qb.prototype.next=function(){var a=this.ga;if(a.Da!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.oa;if(null!==b)return this.ka=b,this.key=b.key,this.value=b.value,!0;this.Ud();return!1};qb.prototype.qd=function(){return this.next()}; qb.prototype.first=function(){var a=this.ga;this.ia=a.Da;a=a.ba;return null!==a?(this.ka=a,this.key=a.key,this.value=a.value,a):null};qb.prototype.any=function(a){var b=this.ga;this.ka=b.Ja=null;for(b=b.ba;null!==b;){if(a(b))return!0;b=b.oa}return!1};qb.prototype.all=function(a){var b=this.ga;this.ka=b.Ja=null;for(b=b.ba;null!==b;){if(!a(b))return!1;b=b.oa}return!0};qb.prototype.each=function(a){var b=this.ga;this.ka=b.Ja=null;for(b=b.ba;null!==b;)a(b),b=b.oa;return this}; qb.prototype.map=function(a){var b=this.ga;this.ka=b.Ja=null;var c=new F;for(b=b.ba;null!==b;)c.add(a(b)),b=b.oa;return c.iterator};qb.prototype.filter=function(a){var b=this.ga;this.ka=b.Ja=null;var c=new F;for(b=b.ba;null!==b;)a(b)&&c.add(b),b=b.oa;return c.iterator};qb.prototype.Ud=function(){this.value=this.key=null;this.ia=-1;this.ga.Ja=this};qb.prototype.toString=function(){return null!==this.ka?"MapIterator@"+this.ka:"MapIterator"}; na.Object.defineProperties(qb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ga.Ib}}});qb.prototype.first=qb.prototype.first;qb.prototype.hasNext=qb.prototype.qd;qb.prototype.next=qb.prototype.next;qb.prototype.reset=qb.prototype.reset;qb.className="MapIterator"; function H(a){Va(this);this.v=!1;this.Jb={};this.Ib=0;this.Ze=this.Ja=null;this.Da=0;this.$e=this.ba=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.lb=function(){var a=this.Da;a++;999999999<a&&(a=0);this.Da=a};t.freeze=function(){this.v=!0;return this};t.ea=function(){this.v=!1;return this};t.toString=function(){return"Map()#"+ib(this)}; t.add=function(a,b){this.v&&wa(this,a);var c=a;za(a)&&(c=kb(a));var d=this.Jb[c];void 0===d?(this.Ib++,a=new lb(a,b),this.Jb[c]=a,c=this.$e,null===c?this.ba=a:(a.xl=c,c.oa=a),this.$e=a,this.lb()):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 H)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.ba};H.prototype.any=function(a){for(var b=this.ba;null!==b;){if(a(b))return!0;b=b.oa}return!1};H.prototype.all=function(a){for(var b=this.ba;null!==b;){if(!a(b))return!1;b=b.oa}return!0}; H.prototype.each=function(a){for(var b=this.ba;null!==b;)a(b),b=b.oa;return this};H.prototype.map=function(a){for(var b=new H,c=this.ba;null!==c;)b.add(c.key,a(c)),c=c.oa;return b};H.prototype.filter=function(a){for(var b=new H,c=this.ba;null!==c;)a(c)&&b.add(c.key,c.value),c=c.oa;return b};t=H.prototype;t.contains=function(a){var b=a;return za(a)&&(b=ib(a),void 0===b)?!1:void 0!==this.Jb[b]};t.has=function(a){return this.contains(a)}; t.H=function(a){var b=a;if(za(a)&&(b=ib(a),void 0===b))return null;a=this.Jb[b];return void 0===a?null:a.value};t.get=function(a){return this.H(a)};t.remove=function(a){if(null===a)return!1;this.v&&wa(this,a);var b=a;if(za(a)&&(b=ib(a),void 0===b))return!1;a=this.Jb[b];if(void 0===a)return!1;var c=a.oa,d=a.xl;null!==c&&(c.xl=d);null!==d&&(d.oa=c);this.ba===a&&(this.ba=c);this.$e===a&&(this.$e=d);delete this.Jb[b];this.Ib--;this.lb();return!0};t.delete=function(a){return this.remove(a)}; t.clear=function(){this.v&&wa(this);this.Jb={};this.Ib=0;null!==this.Ja&&this.Ja.reset();null!==this.Ze&&this.Ze.reset();this.$e=this.ba=null;this.lb()};H.prototype.copy=function(){var a=new H,b=this.Jb,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};H.prototype.ya=function(){var a=this.Jb,b=Array(this.Ib),c=0,d;for(d in a){var e=a[d];b[c]=new lb(e.key,e.value);c++}return b};H.prototype.If=function(){return new ob(this)}; na.Object.defineProperties(H.prototype,{count:{get:function(){return this.Ib}},size:{get:function(){return this.Ib}},iterator:{get:function(){if(0>=this.count)return ab;var a=this.Ja;return null!==a?(a.reset(),a):new qb(this)}},iteratorKeys:{get:function(){return 0>=this.count?ab:new nb(this)}},iteratorValues:{get:function(){if(0>=this.count)return ab; var a=this.Ze;return null!==a?(a.reset(),a):new pb(this)}}});H.prototype.toKeySet=H.prototype.If;H.prototype.toArray=H.prototype.ya;H.prototype.clear=H.prototype.clear;H.prototype["delete"]=H.prototype.delete;H.prototype.remove=H.prototype.remove;H.prototype.get=H.prototype.get;H.prototype.getValue=H.prototype.H;H.prototype.has=H.prototype.has;H.prototype.contains=H.prototype.contains;H.prototype.first=H.prototype.first;H.prototype.addAll=H.prototype.addAll;H.prototype.set=H.prototype.set; H.prototype.add=H.prototype.add;H.prototype.thaw=H.prototype.ea;H.prototype.freeze=H.prototype.freeze;H.className="Map";function K(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.v=!1}K.prototype.assign=function(a){this.x=a.x;this.y=a.y;return this};K.prototype.h=function(a,b){this.x=a;this.y=b;return this};K.prototype.tg=function(a,b){this.x=a;this.y=b;return this}; K.prototype.set=function(a){this.x=a.x;this.y=a.y;return this};K.prototype.copy=function(){var a=new K;a.x=this.x;a.y=this.y;return a};t=K.prototype;t.ca=function(){this.v=!0;Object.freeze(this);return this};t.I=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};t.ea=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this.v=!1;return this}; function rb(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 K(c,e)}return new K}function sb(a){return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.A=function(a){return a instanceof K?this.x===a.x&&this.y===a.y:!1};t.Fi=function(a,b){return this.x===a&&this.y===b};t.Ua=function(a){return M.w(this.x,a.x)&&M.w(this.y,a.y)}; t.add=function(a){this.x+=a.x;this.y+=a.y;return this};t.ie=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};K.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=K.prototype; t.scale=function(a,b){this.x*=a;this.y*=b;return this};t.xf=function(a){var b=a.x-this.x;a=a.y-this.y;return b*b+a*a};t.pd=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.Pa=function(a){return tb(a.x-this.x,a.y-this.y)};t.direction=function(a,b){return tb(a-this.x,b-this.y)}; function tb(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.nz=function(a,b){return M.Xl(a.x,a.y,b.x,b.y,this.x,this.y)};t.BA=function(a,b,c,d){M.Ih(a,b,c,d,this.x,this.y,this);return this};t.CA=function(a,b){M.Ih(a.x,a.y,b.x,b.y,this.x,this.y,this);return this};t.QA=function(a,b,c,d){M.Xp(this.x,this.y,a,b,c,d,this);return this}; t.RA=function(a,b){M.Xp(this.x,this.y,a.x,a.y,b.width,b.height,this);return this};t.Ti=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.Ui=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.Aa(this);return this};function ub(a,b){b.Hd(a);return a} function vb(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 wb(a,b,c,d){a=c-a;b=d-b;return a*a+b*b}function xb(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.u=function(){return isFinite(this.x)&&isFinite(this.y)}; K.alloc=function(){var a=yb.pop();return void 0===a?new K:a};K.allocAt=function(a,b){var c=yb.pop();if(void 0===c)return new K(a,b);c.x=a;c.y=b;return c};K.free=function(a){yb.push(a)};K.prototype.isReal=K.prototype.u;K.prototype.setSpot=K.prototype.Ui;K.prototype.setRectSpot=K.prototype.Ti;K.prototype.snapToGridPoint=K.prototype.RA;K.prototype.snapToGrid=K.prototype.QA;K.prototype.projectOntoLineSegmentPoint=K.prototype.CA;K.prototype.projectOntoLineSegment=K.prototype.BA; K.intersectingLineSegments=function(a,b,c,d,e,f,g,h){return M.dm(a,b,c,d,e,f,g,h)};K.prototype.compareWithLineSegmentPoint=K.prototype.nz;K.compareWithLineSegment=function(a,b,c,d,e,f){return M.Xl(a,b,c,d,e,f)};K.prototype.direction=K.prototype.direction;K.prototype.directionPoint=K.prototype.Pa;K.prototype.normalize=K.prototype.normalize;K.prototype.distanceSquared=K.prototype.pd;K.prototype.distanceSquaredPoint=K.prototype.xf;K.prototype.scale=K.prototype.scale;K.prototype.rotate=K.prototype.rotate; K.prototype.offset=K.prototype.offset;K.prototype.subtract=K.prototype.ie;K.prototype.add=K.prototype.add;K.prototype.equalsApprox=K.prototype.Ua;K.prototype.equalTo=K.prototype.Fi;K.prototype.equals=K.prototype.A;K.prototype.set=K.prototype.set;K.prototype.setTo=K.prototype.tg;var zb=null,Ab=null,Db=null,Eb=null,Fb=null,yb=[];K.className="Point";K.parse=rb;K.stringify=sb;K.distanceLineSegmentSquared=vb;K.distanceSquared=wb;K.direction=xb;K.Origin=zb=(new K(0,0)).ca(); K.InfiniteTopLeft=Ab=(new K(-Infinity,-Infinity)).ca();K.InfiniteBottomRight=Db=(new K(Infinity,Infinity)).ca();K.SixPoint=Eb=(new K(6,6)).ca();K.NoPoint=Fb=(new K(NaN,NaN)).ca();K.parse=rb;K.stringify=sb;K.distanceLineSegmentSquared=vb;K.distanceSquared=wb;K.direction=xb;function Gb(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.v=!1} var Hb,Ib,Jb,Kb,Lb,Mb,Nb;Gb.prototype.assign=function(a){this.width=a.width;this.height=a.height;return this};Gb.prototype.h=function(a,b){this.width=a;this.height=b;return this};Gb.prototype.tg=function(a,b){this.width=a;this.height=b;return this};Gb.prototype.set=function(a){this.width=a.width;this.height=a.height;return this};Gb.prototype.copy=function(){var a=new Gb;a.width=this.width;a.height=this.height;return a};t=Gb.prototype;t.ca=function(){this.v=!0;Object.freeze(this);return this}; t.I=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};t.ea=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this.v=!1;return this};function Ob(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 Gb(c,e)}return new Gb}function Pb(a){return a.width.toString()+" "+a.height.toString()} t.toString=function(){return"Size("+this.width+","+this.height+")"};t.A=function(a){return a instanceof Gb?this.width===a.width&&this.height===a.height:!1};t.Fi=function(a,b){return this.width===a&&this.height===b};t.Ua=function(a){return M.w(this.width,a.width)&&M.w(this.height,a.height)};t.u=function(){return isFinite(this.width)&&isFinite(this.height)};Gb.alloc=function(){var a=Qb.pop();return void 0===a?new Gb:a};Gb.free=function(a){Qb.push(a)};Gb.prototype.isReal=Gb.prototype.u; Gb.prototype.equalsApprox=Gb.prototype.Ua;Gb.prototype.equalTo=Gb.prototype.Fi;Gb.prototype.equals=Gb.prototype.A;Gb.prototype.set=Gb.prototype.set;Gb.prototype.setTo=Gb.prototype.tg;var Qb=[];Gb.className="Size";Gb.parse=Ob;Gb.stringify=Pb;Gb.ZeroSize=Hb=(new Gb(0,0)).ca();Gb.OneSize=Ib=(new Gb(1,1)).ca();Gb.SixSize=Jb=(new Gb(6,6)).ca();Gb.EightSize=Kb=(new Gb(8,8)).ca();Gb.TenSize=Lb=(new Gb(10,10)).ca();Gb.InfiniteSize=Mb=(new Gb(Infinity,Infinity)).ca();Gb.NoSize=Nb=(new Gb(NaN,NaN)).ca(); Gb.parse=Ob;Gb.stringify=Pb; 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 K?(c=a.x,a=a.y,b instanceof K?(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 Gb?(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.v=!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 Rb(a,b,c){a.width=b;a.height=c}t.tg=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.Qc=function(a){this.x=a.x;this.y=a.y;return this};t.PA=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.ca=function(){this.v=!0;Object.freeze(this);return this};t.I=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this}; t.ea=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this.v=!1;return this};function Sb(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 Tb(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.A=function(a){return a instanceof N?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1};t.Fi=function(a,b,c,d){return this.x===a&&this.y===b&&this.width===c&&this.height===d};t.Ua=function(a){return M.w(this.x,a.x)&&M.w(this.y,a.y)&&M.w(this.width,a.width)&&M.w(this.height,a.height)}; function Ub(a,b){return M.aa(a.x,b.x)&&M.aa(a.y,b.y)&&M.aa(a.width,b.width)&&M.aa(a.height,b.height)}t.$=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y};t.Ge=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.Kc=function(a,b){return Vb(this,b,a,b,a)};t.Mp=function(a){return Vb(this,a.top,a.right,a.bottom,a.left)};t.Vv=function(a){return Vb(this,-a.top,-a.right,-a.bottom,-a.left)};t.eA=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.ey=function(a){return Zb(this,a.x,a.y,a.width,a.height)}; t.hv=function(a,b,c,d){return Zb(this,a,b,c,d)};function Zb(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.Mc=function(a){return this.iv(a.x,a.y,a.width,a.height)}; t.iv=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 $b(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.Oe=function(a){return ac(this,a.x,a.y,0,0)};t.Rc=function(a){return ac(this,a.x,a.y,a.width,a.height)}; t.aw=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return ac(this,a,b,c,d)};function ac(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.Ui=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 bc(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 fc(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.u=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.kA=function(){return 0===this.width&&0===this.height};N.alloc=function(){var a=gc.pop();return void 0===a?new N:a};N.allocAt=function(a,b,c,d){var e=gc.pop();return void 0===e?new N(a,b,c,d):e.h(a,b,c,d)};N.free=function(a){gc.push(a)}; na.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 K(this.x,this.y)},set:function(a){this.x=a.x;this.y=a.y}},size:{get:function(){return new Gb(this.width,this.height)},set:function(a){this.width=a.width;this.height=a.height}},center:{get:function(){return new K(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.kA;N.prototype.isReal=N.prototype.u;N.intersectsLineSegment=function(a,b,c,d,e,f,g,h){return M.gy(a,b,c,d,e,f,g,h)};N.prototype.setSpot=N.prototype.Ui;N.prototype.union=N.prototype.aw;N.prototype.unionRect=N.prototype.Rc;N.prototype.unionPoint=N.prototype.Oe;N.prototype.intersects=N.prototype.iv; N.prototype.intersectsRect=N.prototype.Mc;N.prototype.intersect=N.prototype.hv;N.prototype.intersectRect=N.prototype.ey;N.prototype.grow=N.prototype.eA;N.prototype.subtractMargin=N.prototype.Vv;N.prototype.addMargin=N.prototype.Mp;N.prototype.inflate=N.prototype.Kc;N.prototype.offset=N.prototype.offset;N.prototype.contains=N.prototype.contains;N.prototype.containsRect=N.prototype.Ge;N.prototype.containsPoint=N.prototype.$;N.prototype.equalsApprox=N.prototype.Ua;N.prototype.equalTo=N.prototype.Fi; N.prototype.equals=N.prototype.A;N.prototype.setSize=N.prototype.PA;N.prototype.setPoint=N.prototype.Qc;N.prototype.set=N.prototype.set;N.prototype.setTo=N.prototype.tg;var hc=null,kc=null,gc=[];N.className="Rect";N.parse=Sb;N.stringify=Tb;N.contains=bc;N.intersects=fc;N.ZeroRect=hc=(new N(0,0,0,0)).ca();N.NoRect=kc=(new N(NaN,NaN,NaN,NaN)).ca();N.parse=Sb;N.stringify=Tb;N.contains=bc;N.intersects=fc; function lc(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.v=!1}lc.prototype.assign=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this}; lc.prototype.tg=function(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d;return this};lc.prototype.set=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this};lc.prototype.copy=function(){var a=new lc;a.top=this.top;a.right=this.r