-
Notifications
You must be signed in to change notification settings - Fork 1
/
react-digraph.js
2 lines (2 loc) · 351 KB
/
react-digraph.js
1
2
/*! For license information please see react-digraph.js.LICENSE.txt */
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(self,(()=>{return t={850:(t,e,n)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==r(t)&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=401)}([function(t,e){t.exports=n(440)},function(t,e,n){var r;try{r={cloneDeep:n(313),constant:n(75),defaults:n(314),each:n(107),filter:n(110),find:n(315),flatten:n(137),forEach:n(108),forIn:n(322),has:n(121),isUndefined:n(122),last:n(323),map:n(123),mapValues:n(324),max:n(325),merge:n(327),min:n(333),minBy:n(334),now:n(335),pick:n(336),range:n(341),reduce:n(125),sortBy:n(344),uniqueId:n(349),values:n(130),zipObject:n(350)}}catch(t){}r||(r=window._),t.exports=r},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){"use strict";var r=n(1),o=n(7).Graph;function i(t,e,n,o){var i;do{i=r.uniqueId(o)}while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}function a(t){return r.max(r.map(t.nodes(),(function(e){var n=t.node(e).rank;if(!r.isUndefined(n))return n})))}t.exports={addDummyNode:i,simplify:function(t){var e=(new o).setGraph(t.graph());return r.forEach(t.nodes(),(function(n){e.setNode(n,t.node(n))})),r.forEach(t.edges(),(function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},o=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})})),e},asNonCompoundGraph:function(t){var e=new o({multigraph:t.isMultigraph()}).setGraph(t.graph());return r.forEach(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),r.forEach(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=r.map(t.nodes(),(function(e){var n={};return r.forEach(t.outEdges(e),(function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return r.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=r.map(t.nodes(),(function(e){var n={};return r.forEach(t.inEdges(e),(function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return r.zipObject(t.nodes(),e)},intersectRect:function(t,e){var n,r,o=t.x,i=t.y,a=e.x-o,s=e.y-i,u=t.width/2,c=t.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*u>Math.abs(a)*c?(s<0&&(c=-c),n=c*a/s,r=c):(a<0&&(u=-u),n=u,r=u*s/a),{x:o+n,y:i+r}},buildLayerMatrix:function(t){var e=r.map(r.range(a(t)+1),(function(){return[]}));return r.forEach(t.nodes(),(function(n){var o=t.node(n),i=o.rank;r.isUndefined(i)||(e[i][o.order]=n)})),e},normalizeRanks:function(t){var e=r.min(r.map(t.nodes(),(function(e){return t.node(e).rank})));r.forEach(t.nodes(),(function(n){var o=t.node(n);r.has(o,"rank")&&(o.rank-=e)}))},removeEmptyRanks:function(t){var e=r.min(r.map(t.nodes(),(function(e){return t.node(e).rank}))),n=[];r.forEach(t.nodes(),(function(r){var o=t.node(r).rank-e;n[o]||(n[o]=[]),n[o].push(r)}));var o=0,i=t.graph().nodeRankFactor;r.forEach(n,(function(e,n){r.isUndefined(e)&&n%i!=0?--o:o&&r.forEach(e,(function(e){t.node(e).rank+=o}))}))},addBorderNode:function(t,e,n,r){var o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=r),i(t,"border",o,e)},maxRank:a,partition:function(t,e){var n={lhs:[],rhs:[]};return r.forEach(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:function(t,e){var n=r.now();try{return e()}finally{console.log(t+" time: "+(r.now()-n)+"ms")}},notime:function(t,e){return e()}}},function(t,e,n){e.Point2D=n(381),e.Vector2D=n(382),e.Matrix2D=n(383)},function(t,e,n){var r;try{r={clone:n(200),constant:n(75),each:n(107),filter:n(110),has:n(121),isArray:n(2),isEmpty:n(277),isFunction:n(26),isUndefined:n(122),keys:n(12),map:n(123),reduce:n(125),size:n(280),transform:n(286),union:n(287),values:n(130)}}catch(t){}r||(r=window._),t.exports=r},function(t,e){t.exports=function(t){var e=r(t);return null!=t&&("object"==e||"function"==e)}},function(t,e,n){var r;try{r=n(198)}catch(t){}r||(r=window.graphlib),t.exports=r},function(t,e,n){var o=n(90),i="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,a=o||i||Function("return this")();t.exports=a},function(t,e){t.exports=function(t){return null!=t&&"object"==r(t)}},function(t,e,n){var r=n(26),o=n(69);t.exports=function(t){return null!=t&&o(t.length)&&!r(t)}},function(t,e,n){var o=n(257),i=n(267),a=n(18),s=n(2),u=n(274);t.exports=function(t){return"function"==typeof t?t:null==t?a:"object"==r(t)?s(t)?i(t[0],t[1]):o(t):u(t)}},function(t,e,n){var r=n(93),o=n(71),i=n(10);t.exports=function(t){return i(t)?r(t):o(t)}},function(t,e,n){e.intersect=n(375),e.shape=n(144).newShape},,function(t,e,n){var r=n(211),o=n(217);t.exports=function(t,e){var n=o(t,e);return r(n)?n:void 0}},function(t,e,n){var r=n(21),o=n(213),i=n(214),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?o(t):i(t)}},function(t,e,n){var r=n(93),o=n(237),i=n(10);t.exports=function(t){return i(t)?r(t,!0):o(t)}},function(t,e){t.exports=function(t){return t}},,function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(8).Symbol;t.exports=r},function(t,e,n){(function(t){var o=n(8),i=n(233),a=e&&!e.nodeType&&e,s=a&&"object"==r(t)&&t&&!t.nodeType&&t,u=s&&s.exports===a?o.Buffer:void 0,c=(u?u.isBuffer:void 0)||i;t.exports=c}).call(this,n(68)(t))},function(t,e,n){var r=n(242),o=n(65),i=n(243),a=n(102),s=n(244),u=n(16),c=n(91),l="[object Map]",f="[object Promise]",h="[object Set]",y="[object WeakMap]",p="[object DataView]",d=c(r),x=c(o),v=c(i),g=c(a),m=c(s),w=u;(r&&w(new r(new ArrayBuffer(1)))!=p||o&&w(new o)!=l||i&&w(i.resolve())!=f||a&&w(new a)!=h||s&&w(new s)!=y)&&(w=function(t){var e=u(t),n="[object Object]"==e?t.constructor:void 0,r=n?c(n):"";if(r)switch(r){case d:return p;case x:return l;case v:return f;case g:return h;case m:return y}return e}),t.exports=w},function(t,e,n){var o=n(16),i=n(9);t.exports=function(t){return"symbol"==r(t)||i(t)&&"[object Symbol]"==o(t)}},function(t,e,n){t.exports={graphlib:n(7),layout:n(312),debug:n(373),util:{time:n(3).time,notime:n(3).notime},version:n(374)}},function(t,e,n){var r=n(16),o=n(6);t.exports=function(t){if(!o(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e,n){var r=n(41),o=n(42);t.exports=function(t,e,n,i){var a=!n;n||(n={});for(var s=-1,u=e.length;++s<u;){var c=e[s],l=i?i(n[c],t[c],c,n,t):void 0;void 0===l&&(l=t[c]),a?o(n,c,l):r(n,c,l)}return n}},function(t,e,n){var r=n(232),o=n(9),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(t){return o(t)&&a.call(t,"callee")&&!s.call(t,"callee")};t.exports=u},function(t,e,n){var r=n(234),o=n(44),i=n(70),a=i&&i.isTypedArray,s=a?o(a):r;t.exports=s},function(t,e,n){var r=n(24);t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},function(t,e,n){e.Point2D=n(376),e.Vector2D=n(377),e.Matrix2D=n(378)},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n,r,o,i=t[1]||"",a=t[3];if(!a)return i;if(e&&"function"==typeof btoa){var s=(n=a,r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),"/*# ".concat(o," */")),u=a.sources.map((function(t){return"/*# sourceURL=".concat(a.sourceRoot||"").concat(t," */")}));return[i].concat(u).concat([s]).join("\n")}return[i].join("\n")}(e,t);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var o={};if(r)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(o[a]=!0)}for(var s=0;s<t.length;s++){var u=[].concat(t[s]);r&&o[u[0]]||(n&&(u[2]?u[2]="".concat(n," and ").concat(u[2]):u[2]=n),e.push(u))}},e}},,,,function(t,e,n){var r=n(37),o=n(206),i=n(207),a=n(208),s=n(209),u=n(210);function c(t){var e=this.__data__=new r(t);this.size=e.size}c.prototype.clear=o,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=s,c.prototype.set=u,t.exports=c},function(t,e,n){var r=n(201),o=n(202),i=n(203),a=n(204),s=n(205);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,t.exports=u},function(t,e,n){var r=n(20);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},function(t,e,n){var r=n(15)(Object,"create");t.exports=r},function(t,e,n){var r=n(226);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},function(t,e,n){var r=n(42),o=n(20),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];i.call(t,e)&&o(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},function(t,e,n){var r=n(92);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},function(t,e){var n=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var o=r(t);return!!(e=null==e?9007199254740991:e)&&("number"==o||"symbol"!=o&&n.test(t))&&t>-1&&t%1==0&&t<e}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e){var n=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},function(t,e,n){var r=n(94)(Object.getPrototypeOf,Object);t.exports=r},function(t,e,n){var r=n(76),o=n(255)(r);t.exports=o},function(t,e,n){var r=n(49),o=n(30);t.exports=function(t,e){for(var n=0,i=(e=r(e,t)).length;null!=t&&n<i;)t=t[o(e[n++])];return n&&n==i?t:void 0}},function(t,e,n){var r=n(2),o=n(79),i=n(269),a=n(117);t.exports=function(t,e){return r(t)?t:o(t,e)?[t]:i(a(t))}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}},function(t,e,n){var r=n(18),o=n(126),i=n(127);t.exports=function(t,e){return i(o(t,e,r),t+"")}},function(t,e,n){var o=n(20),i=n(10),a=n(43),s=n(6);t.exports=function(t,e,n){if(!s(n))return!1;var u=r(e);return!!("number"==u?i(n)&&a(e,n.length):"string"==u&&e in n)&&o(n[e],t)}},function(t,e,n){"use strict";var r=n(1);t.exports={longestPath:function(t){var e={};r.forEach(t.sources(),(function n(o){var i=t.node(o);if(r.has(e,o))return i.rank;e[o]=!0;var a=r.min(r.map(t.outEdges(o),(function(e){return n(e.w)-t.edge(e).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),i.rank=a}))},slack:function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}}},function(t,e){t.exports=n(32)},,,,,,,function(t,e,n){var r=n(62),o=n(63);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]),r(o,{insert:"head",singleton:!1}),t.exports=o.locals||{}},function(t,e,n){"use strict";var r,o=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),i=[];function a(t){for(var e=-1,n=0;n<i.length;n++)if(i[n].identifier===t){e=n;break}return e}function s(t,e){for(var n={},r=[],o=0;o<t.length;o++){var s=t[o],u=e.base?s[0]+e.base:s[0],c=n[u]||0,l="".concat(u," ").concat(c);n[u]=c+1;var f=a(l),h={css:s[1],media:s[2],sourceMap:s[3]};-1!==f?(i[f].references++,i[f].updater(h)):i.push({identifier:l,updater:d(h,e),references:1}),r.push(l)}return r}function u(t){var e=document.createElement("style"),r=t.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(t){e.setAttribute(t,r[t])})),"function"==typeof t.insert)t.insert(e);else{var a=o(t.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(e)}return e}var c,l=(c=[],function(t,e){return c[t]=e,c.filter(Boolean).join("\n")});function f(t,e,n,r){var o=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(t.styleSheet)t.styleSheet.cssText=l(e,o);else{var i=document.createTextNode(o),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(i,a[e]):t.appendChild(i)}}function h(t,e,n){var r=n.css,o=n.media,i=n.sourceMap;if(o?t.setAttribute("media",o):t.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}var y=null,p=0;function d(t,e){var n,r,o;if(e.singleton){var i=p++;n=y||(y=u(e)),r=f.bind(null,n,i,!1),o=f.bind(null,n,i,!0)}else n=u(e),r=h.bind(null,n,e),o=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else o()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=(void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r));var n=s(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var r=0;r<n.length;r++){var o=a(n[r]);i[o].references--}for(var u=s(t,e),c=0;c<n.length;c++){var l=a(n[c]);0===i[l].references&&(i[l].updater(),i.splice(l,1))}n=u}}}},function(t,e,n){"use strict";n.r(e);var r=n(32),o=n.n(r)()(!0);o.push([t.i,".view-wrapper{height:100%;width:100%;margin:0;display:flex;box-shadow:none;background:#f9f9f9;transition:opacity 0.167s;opacity:1;outline:none;user-select:none;position:relative}.view-wrapper>.graph{align-content:stretch;flex:1;width:100%;height:100%}.view-wrapper .node .shape>use.node{color:#1e90ff;stroke:#000;fill:#fff;filter:url(#dropshadow);stroke-width:0.5px;cursor:pointer;user-select:none}.view-wrapper .node .shape>use.node.hovered{stroke:#1e90ff}.view-wrapper .node .shape>use.node.selected{color:#fff;stroke:#1e90ff;stroke-width:1px;fill:#1e90ff}.view-wrapper .node .node-text{fill:#000;cursor:pointer;user-select:none}.view-wrapper .node .node-text.selected{fill:#fff;stroke:#fff}.view-wrapper .edge{color:#fff;stroke:#1e90ff;stroke-width:2px;marker-end:url(#end-arrow);cursor:pointer}.view-wrapper .edge .edge-text{stroke-width:0.5px;fill:#1e90ff;stroke:#1e90ff;cursor:pointer;user-select:none}.view-wrapper .edge .edge-text.edge-label-text{font-size:11px;stroke:none;fill:black}.view-wrapper .edge.selected{color:#1e90ff;stroke:#1e90ff}.view-wrapper .edge.selected .edge-text{fill:#fff;stroke:#fff}.view-wrapper .edge-mouse-handler{stroke:black;opacity:0;color:transparent;stroke-width:15px;cursor:pointer;pointer-events:all}.view-wrapper .arrow{fill:#1e90ff}.view-wrapper .graph-controls{position:absolute;bottom:30px;left:15px;display:grid;grid-template-columns:auto auto auto;grid-gap:15px;align-items:center;user-select:none}.view-wrapper .graph-controls>.slider-wrapper{background-color:#fff;color:#1e90ff;border:solid 1px #d3d3d3;padding:6.5px;border-radius:2px}.view-wrapper .graph-controls>.slider-wrapper>span{display:inline-block;vertical-align:middle}.view-wrapper .graph-controls>.slider-wrapper>.slider{position:relative;margin-left:4px;margin-right:4px;cursor:pointer;vertical-align:middle}.view-wrapper .graph-controls .slider-button{background-color:#fff;fill:#1e90ff;border:solid 1px #d3d3d3;outline:none;width:31px;height:31px;border-radius:2px;cursor:pointer;margin:0}.view-wrapper .graph-controls .slider-button>svg{vertical-align:middle}.view-wrapper .circle{fill:#d3d3d3}\n","",{version:3,sources:["webpack://styles/main.scss"],names:[],mappings:"AAuBA,cACE,WAAY,CACZ,UAAW,CACX,QAAS,CACT,YAAa,CACb,eAAgB,CAChB,kBATwB,CAUxB,yBAA0B,CAC1B,SAAU,CACV,YAAa,CACb,gBAAiB,CACjB,iBAAkB,CAXpB,qBAcI,qBAAsB,CACtB,MAAO,CACP,UAAW,CACX,WAAY,CAjBhB,oCAuBQ,aA9BkB,CA+BlB,WA7BU,CA8BV,SA/BW,CAgCX,uBAAwB,CACxB,kBAAmB,CACnB,cAAe,CACf,gBAAiB,CA7BzB,4CAgCU,cAvCgB,CAO1B,6CAmCU,UAzCS,CA0CT,cA3CgB,CA4ChB,gBAAiB,CACjB,YA7CgB,CAO1B,+BA4CM,SAjDY,CAkDZ,cAAe,CACf,gBAAiB,CA9CvB,wCAgDQ,SAtDW,CAuDX,WAvDW,CAMnB,oBAuDI,UA7De,CA8Df,cA/DsB,CAgEtB,gBAAiB,CACjB,0BAA2B,CAC3B,cAAe,CA3DnB,+BA8DM,kBAAmB,CACnB,YAtEoB,CAuEpB,cAvEoB,CAyEpB,cAAe,CACf,gBAAiB,CAnEvB,+CAsEQ,cAAe,CACf,WAAY,CACZ,UAAW,CAxEnB,6BA6EM,aApFoB,CAqFpB,cArFoB,CAO1B,wCAiFQ,SAvFW,CAwFX,WAxFW,CAMnB,kCAwFI,YAAa,CACb,SAAU,CACV,iBAAkB,CAClB,iBAAkB,CAClB,cAAe,CACf,kBAAmB,CA7FvB,qBAiGI,YAxGsB,CAO1B,8BAqGI,iBAAkB,CAClB,WAAY,CACZ,SAAU,CACV,YAAa,CACb,oCAAqC,CACrC,aAAc,CACd,kBAAmB,CACnB,gBAAiB,CA5GrB,8CA+GM,qBArHa,CAsHb,aAvHoB,CAwHpB,wBArHgB,CAsHhB,aAAc,CACd,iBAAkB,CAnHxB,mDAsHQ,oBAAqB,CACrB,qBAAsB,CAvH9B,sDA2HQ,iBAAkB,CAClB,eAAgB,CAChB,gBAAiB,CACjB,cAAe,CACf,qBAAsB,CA/H9B,6CAoIM,qBA1Ia,CA2Ib,YA5IoB,CA6IpB,wBA1IgB,CA2IhB,YAAa,CACb,UA1IY,CA2IZ,WA3IY,CA4IZ,iBAAkB,CAClB,cAAe,CACf,QAAS,CA5If,iDA+IQ,qBAAsB,CA/I9B,sBAqJI,YAzJkB",sourcesContent:['/*\n Copyright(c) 2018 Uber Technologies, Inc.\n\n Licensed under the Apache License, Version 2.0 (the "License");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an "AS IS" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\n$primary-color: dodgerblue;\n$light-color: white;\n$dark-color: black;\n$light-grey: lightgrey;\n$background-color: #f9f9f9;\n$button-size: 31px;\n\n.view-wrapper {\n height: 100%;\n width: 100%;\n margin: 0;\n display: flex;\n box-shadow: none;\n background: $background-color;\n transition: opacity 0.167s;\n opacity: 1;\n outline: none;\n user-select: none;\n position: relative;\n\n > .graph {\n align-content: stretch;\n flex: 1;\n width: 100%;\n height: 100%;\n }\n\n .node {\n .shape {\n > use.node {\n color: $primary-color;\n stroke: $dark-color;\n fill: $light-color;\n filter: url(#dropshadow);\n stroke-width: 0.5px;\n cursor: pointer;\n user-select: none;\n\n &.hovered {\n stroke: $primary-color;\n }\n &.selected {\n color: $light-color;\n stroke: $primary-color;\n stroke-width: 1px;\n fill: $primary-color;\n }\n }\n }\n\n .node-text {\n fill: $dark-color;\n cursor: pointer;\n user-select: none;\n &.selected {\n fill: $light-color;\n stroke: $light-color;\n }\n }\n }\n\n .edge {\n color: $light-color;\n stroke: $primary-color;\n stroke-width: 2px;\n marker-end: url(#end-arrow);\n cursor: pointer;\n\n .edge-text {\n stroke-width: 0.5px;\n fill: $primary-color;\n stroke: $primary-color;\n\n cursor: pointer;\n user-select: none;\n\n &.edge-label-text {\n font-size: 11px; \n stroke: none;\n fill: black;\n }\n }\n\n &.selected {\n color: $primary-color;\n stroke: $primary-color;\n\n .edge-text {\n fill: $light-color;\n stroke: $light-color;\n }\n }\n }\n\n .edge-mouse-handler {\n stroke: black;\n opacity: 0;\n color: transparent;\n stroke-width: 15px;\n cursor: pointer;\n pointer-events: all;\n }\n\n .arrow {\n fill: $primary-color;\n }\n\n .graph-controls {\n position: absolute;\n bottom: 30px;\n left: 15px;\n display: grid;\n grid-template-columns: auto auto auto;\n grid-gap: 15px;\n align-items: center;\n user-select: none;\n\n > .slider-wrapper {\n background-color: $light-color;\n color: $primary-color;\n border: solid 1px $light-grey;\n padding: 6.5px;\n border-radius: 2px;\n\n > span {\n display: inline-block;\n vertical-align: middle;\n }\n\n > .slider {\n position: relative;\n margin-left: 4px;\n margin-right: 4px;\n cursor: pointer;\n vertical-align: middle;\n }\n }\n\n .slider-button {\n background-color: $light-color;\n fill: $primary-color;\n border: solid 1px $light-grey;\n outline: none;\n width: $button-size;\n height: $button-size;\n border-radius: 2px;\n cursor: pointer;\n margin: 0;\n\n > svg {\n vertical-align: middle;\n }\n }\n }\n\n .circle {\n fill: $light-grey;\n }\n}\n'],sourceRoot:""}]),e.default=o},function(t,e,n){"use strict";var o=n(5);t.exports=a;var i="\0";function a(t){this._isDirected=!o.has(t,"directed")||t.directed,this._isMultigraph=!!o.has(t,"multigraph")&&t.multigraph,this._isCompound=!!o.has(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=o.constant(void 0),this._defaultEdgeLabelFn=o.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function s(t,e){t[e]?t[e]++:t[e]=1}function u(t,e){--t[e]||delete t[e]}function c(t,e,n,r){var i=""+e,a=""+n;if(!t&&i>a){var s=i;i=a,a=s}return i+""+a+""+(o.isUndefined(r)?"\0":r)}function l(t,e,n,r){var o=""+e,i=""+n;if(!t&&o>i){var a=o;o=i,i=a}var s={v:o,w:i};return r&&(s.name=r),s}function f(t,e){return c(t,e.v,e.w,e.name)}a.prototype._nodeCount=0,a.prototype._edgeCount=0,a.prototype.isDirected=function(){return this._isDirected},a.prototype.isMultigraph=function(){return this._isMultigraph},a.prototype.isCompound=function(){return this._isCompound},a.prototype.setGraph=function(t){return this._label=t,this},a.prototype.graph=function(){return this._label},a.prototype.setDefaultNodeLabel=function(t){return o.isFunction(t)||(t=o.constant(t)),this._defaultNodeLabelFn=t,this},a.prototype.nodeCount=function(){return this._nodeCount},a.prototype.nodes=function(){return o.keys(this._nodes)},a.prototype.sources=function(){var t=this;return o.filter(this.nodes(),(function(e){return o.isEmpty(t._in[e])}))},a.prototype.sinks=function(){var t=this;return o.filter(this.nodes(),(function(e){return o.isEmpty(t._out[e])}))},a.prototype.setNodes=function(t,e){var n=arguments,r=this;return o.each(t,(function(t){n.length>1?r.setNode(t,e):r.setNode(t)})),this},a.prototype.setNode=function(t,e){return o.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=i,this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},a.prototype.node=function(t){return this._nodes[t]},a.prototype.hasNode=function(t){return o.has(this._nodes,t)},a.prototype.removeNode=function(t){var e=this;if(o.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],o.each(this.children(t),(function(t){e.setParent(t)})),delete this._children[t]),o.each(o.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],o.each(o.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},a.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(o.isUndefined(e))e=i;else{for(var n=e+="";!o.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},a.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},a.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==i)return e}},a.prototype.children=function(t){if(o.isUndefined(t)&&(t=i),this._isCompound){var e=this._children[t];if(e)return o.keys(e)}else{if(t===i)return this.nodes();if(this.hasNode(t))return[]}},a.prototype.predecessors=function(t){var e=this._preds[t];if(e)return o.keys(e)},a.prototype.successors=function(t){var e=this._sucs[t];if(e)return o.keys(e)},a.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return o.union(e,this.successors(t))},a.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},a.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;o.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),o.each(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var r={};function i(t){var o=n.parent(t);return void 0===o||e.hasNode(o)?(r[t]=o,o):o in r?r[o]:i(o)}return this._isCompound&&o.each(e.nodes(),(function(t){e.setParent(t,i(t))})),e},a.prototype.setDefaultEdgeLabel=function(t){return o.isFunction(t)||(t=o.constant(t)),this._defaultEdgeLabelFn=t,this},a.prototype.edgeCount=function(){return this._edgeCount},a.prototype.edges=function(){return o.values(this._edgeObjs)},a.prototype.setPath=function(t,e){var n=this,r=arguments;return o.reduce(t,(function(t,o){return r.length>1?n.setEdge(t,o,e):n.setEdge(t,o),o})),this},a.prototype.setEdge=function(){var t,e,n,i,a=!1,u=arguments[0];"object"==r(u)&&null!==u&&"v"in u?(t=u.v,e=u.w,n=u.name,2===arguments.length&&(i=arguments[1],a=!0)):(t=u,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),t=""+t,e=""+e,o.isUndefined(n)||(n=""+n);var f=c(this._isDirected,t,e,n);if(o.has(this._edgeLabels,f))return a&&(this._edgeLabels[f]=i),this;if(!o.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[f]=a?i:this._defaultEdgeLabelFn(t,e,n);var h=l(this._isDirected,t,e,n);return t=h.v,e=h.w,Object.freeze(h),this._edgeObjs[f]=h,s(this._preds[e],t),s(this._sucs[t],e),this._in[e][f]=h,this._out[t][f]=h,this._edgeCount++,this},a.prototype.edge=function(t,e,n){var r=1===arguments.length?f(this._isDirected,arguments[0]):c(this._isDirected,t,e,n);return this._edgeLabels[r]},a.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?f(this._isDirected,arguments[0]):c(this._isDirected,t,e,n);return o.has(this._edgeLabels,r)},a.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?f(this._isDirected,arguments[0]):c(this._isDirected,t,e,n),o=this._edgeObjs[r];return o&&(t=o.v,e=o.w,delete this._edgeLabels[r],delete this._edgeObjs[r],u(this._preds[e],t),u(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},a.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=o.values(n);return e?o.filter(r,(function(t){return t.v===e})):r}},a.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=o.values(n);return e?o.filter(r,(function(t){return t.w===e})):r}},a.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}},function(t,e,n){var r=n(15)(n(8),"Map");t.exports=r},function(t,e,n){var r=n(218),o=n(225),i=n(227),a=n(228),s=n(229);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,t.exports=u},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},function(t,e,n){(function(t){var o=n(90),i=e&&!e.nodeType&&e,a=i&&"object"==r(t)&&t&&!t.nodeType&&t,s=a&&a.exports===i&&o.process,u=function(){try{return a&&a.require&&a.require("util").types||s&&s.binding&&s.binding("util")}catch(t){}}();t.exports=u}).call(this,n(68)(t))},function(t,e,n){var r=n(45),o=n(235),i=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return o(t);var e=[];for(var n in Object(t))i.call(t,n)&&"constructor"!=n&&e.push(n);return e}},function(t,e,n){var r=n(97),o=n(98),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(t){return null==t?[]:(t=Object(t),r(a(t),(function(e){return i.call(t,e)})))}:o;t.exports=s},function(t,e){t.exports=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}},function(t,e,n){var r=n(103);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},function(t,e){t.exports=function(t){return function(){return t}}},function(t,e,n){var r=n(77),o=n(12);t.exports=function(t,e){return t&&r(t,e,o)}},function(t,e,n){var r=n(254)();t.exports=r},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}},function(t,e,n){var o=n(2),i=n(24),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;t.exports=function(t,e){if(o(t))return!1;var n=r(t);return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!i(t))||s.test(t)||!a.test(t)||null!=e&&t in Object(e)}},function(t,e,n){var r=n(73),o=n(288);t.exports=function t(e,n,i,a,s){var u=-1,c=e.length;for(i||(i=o),s||(s=[]);++u<c;){var l=e[u];n>0&&i(l)?n>1?t(l,n-1,i,a,s):r(s,l):a||(s[s.length]=l)}return s}},function(t,e,n){var r=n(24);t.exports=function(t,e,n){for(var o=-1,i=t.length;++o<i;){var a=t[o],s=e(a);if(null!=s&&(void 0===u?s==s&&!r(s):n(s,u)))var u=s,c=a}return c}},function(t,e,n){function r(t,e){this.init(t,e)}r.prototype.init=function(t,e){this.name=t,this.args=e},t.exports=r},function(t,e,n){var o=n(0),i=/-([a-z])/g,a=/^--[a-zA-Z0-9-]+$|^[^-]+$/,s=o.version.split(".")[0]>=16;t.exports={PRESERVE_CUSTOM_ATTRIBUTES:s,camelCase:function(t){if("string"!=typeof t)throw new TypeError("First argument must be a string");return a.test(t)?t:t.toLowerCase().replace(i,(function(t,e){return e.toUpperCase()}))},invertObject:function(t,e){if(!t||"object"!=r(t))throw new TypeError("First argument must be an object");var n,o,i="function"==typeof e,a={},s={};for(n in t)o=t[n],i&&(a=e(n,o))&&2===a.length?s[a[0]]=a[1]:"string"==typeof o&&(s[o]=n);return s},isCustomComponent:function(t,e){if(-1===t.indexOf("-"))return e&&"string"==typeof e.is;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}}},,,,,,function(t,e,n){var r=n(36),o=n(67),i=n(41),a=n(230),s=n(236),u=n(95),c=n(96),l=n(239),f=n(240),h=n(100),y=n(241),p=n(23),d=n(245),x=n(246),v=n(105),g=n(2),m=n(22),w=n(250),b=n(6),_=n(252),E=n(12),A=n(17),M="[object Arguments]",C="[object Function]",k="[object Object]",N={};N[M]=N["[object Array]"]=N["[object ArrayBuffer]"]=N["[object DataView]"]=N["[object Boolean]"]=N["[object Date]"]=N["[object Float32Array]"]=N["[object Float64Array]"]=N["[object Int8Array]"]=N["[object Int16Array]"]=N["[object Int32Array]"]=N["[object Map]"]=N["[object Number]"]=N[k]=N["[object RegExp]"]=N["[object Set]"]=N["[object String]"]=N["[object Symbol]"]=N["[object Uint8Array]"]=N["[object Uint8ClampedArray]"]=N["[object Uint16Array]"]=N["[object Uint32Array]"]=!0,N["[object Error]"]=N[C]=N["[object WeakMap]"]=!1,t.exports=function t(e,n,P,O,S,T){var j,I=1&n,R=2&n,L=4&n;if(P&&(j=S?P(e,O,S,T):P(e)),void 0!==j)return j;if(!b(e))return e;var B=g(e);if(B){if(j=d(e),!I)return c(e,j)}else{var D=p(e),z=D==C||"[object GeneratorFunction]"==D;if(m(e))return u(e,I);if(D==k||D==M||z&&!S){if(j=R||z?{}:v(e),!I)return R?f(e,s(j,e)):l(e,a(j,e))}else{if(!N[D])return S?e:{};j=x(e,D,I)}}T||(T=new r);var U=T.get(e);if(U)return U;T.set(e,j),_(e)?e.forEach((function(r){j.add(t(r,n,P,r,e,T))})):w(e)&&e.forEach((function(r,o){j.set(o,t(r,n,P,o,e,T))}));var F=B?void 0:(L?R?y:h:R?A:E)(e);return o(F||e,(function(r,o){F&&(r=e[o=r]),i(j,o,t(r,n,P,o,e,T))})),j}},function(t,e,n){(function(e){var n="object"==r(e)&&e&&e.Object===Object&&e;t.exports=n}).call(this,n(212))},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e,n){var r=n(15),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},function(t,e,n){var r=n(231),o=n(28),i=n(2),a=n(22),s=n(43),u=n(29),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=i(t),l=!n&&o(t),f=!n&&!l&&a(t),h=!n&&!l&&!f&&u(t),y=n||l||f||h,p=y?r(t.length,String):[],d=p.length;for(var x in t)!e&&!c.call(t,x)||y&&("length"==x||f&&("offset"==x||"parent"==x)||h&&("buffer"==x||"byteLength"==x||"byteOffset"==x)||s(x,d))||p.push(x);return p}},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){(function(t){var o=n(8),i=e&&!e.nodeType&&e,a=i&&"object"==r(t)&&t&&!t.nodeType&&t,s=a&&a.exports===i?o.Buffer:void 0,u=s?s.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=u?u(n):new t.constructor(n);return t.copy(r),r}}).call(this,n(68)(t))},function(t,e){t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a,n,t)&&(i[o++]=a)}return i}},function(t,e){t.exports=function(){return[]}},function(t,e,n){var r=n(73),o=n(46),i=n(72),a=n(98),s=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)r(e,i(t)),t=o(t);return e}:a;t.exports=s},function(t,e,n){var r=n(101),o=n(72),i=n(12);t.exports=function(t){return r(t,i,o)}},function(t,e,n){var r=n(73),o=n(2);t.exports=function(t,e,n){var i=e(t);return o(t)?i:r(i,n(t))}},function(t,e,n){var r=n(15)(n(8),"Set");t.exports=r},function(t,e,n){var r=n(8).Uint8Array;t.exports=r},function(t,e,n){var r=n(74);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},function(t,e,n){var r=n(106),o=n(46),i=n(45);t.exports=function(t){return"function"!=typeof t.constructor||i(t)?{}:r(o(t))}},function(t,e,n){var r=n(6),o=Object.create,i=function(){function t(){}return function(e){if(!r(e))return{};if(o)return o(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=i},function(t,e,n){t.exports=n(108)},function(t,e,n){var r=n(67),o=n(47),i=n(109),a=n(2);t.exports=function(t,e){return(a(t)?r:o)(t,i(e))}},function(t,e,n){var r=n(18);t.exports=function(t){return"function"==typeof t?t:r}},function(t,e,n){var r=n(97),o=n(256),i=n(11),a=n(2);t.exports=function(t,e){return(a(t)?r:o)(t,i(e,3))}},function(t,e,n){var r=n(259),o=n(9);t.exports=function t(e,n,i,a,s){return e===n||(null==e||null==n||!o(e)&&!o(n)?e!=e&&n!=n:r(e,n,i,a,t,s))}},function(t,e,n){var r=n(113),o=n(262),i=n(114);t.exports=function(t,e,n,a,s,u){var c=1&n,l=t.length,f=e.length;if(l!=f&&!(c&&f>l))return!1;var h=u.get(t),y=u.get(e);if(h&&y)return h==e&&y==t;var p=-1,d=!0,x=2&n?new r:void 0;for(u.set(t,e),u.set(e,t);++p<l;){var v=t[p],g=e[p];if(a)var m=c?a(g,v,p,e,t,u):a(v,g,p,t,e,u);if(void 0!==m){if(m)continue;d=!1;break}if(x){if(!o(e,(function(t,e){if(!i(x,e)&&(v===t||s(v,t,n,a,u)))return x.push(e)}))){d=!1;break}}else if(v!==g&&!s(v,g,n,a,u)){d=!1;break}}return u.delete(t),u.delete(e),d}},function(t,e,n){var r=n(66),o=n(260),i=n(261);function a(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e<n;)this.add(t[e])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,t.exports=a},function(t,e){t.exports=function(t,e){return t.has(e)}},function(t,e,n){var r=n(6);t.exports=function(t){return t==t&&!r(t)}},function(t,e){t.exports=function(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}}},function(t,e,n){var r=n(272);t.exports=function(t){return null==t?"":r(t)}},function(t,e,n){var r=n(273),o=n(119);t.exports=function(t,e){return null!=t&&o(t,e,r)}},function(t,e,n){var r=n(49),o=n(28),i=n(2),a=n(43),s=n(69),u=n(30);t.exports=function(t,e,n){for(var c=-1,l=(e=r(e,t)).length,f=!1;++c<l;){var h=u(e[c]);if(!(f=null!=t&&n(t,h)))break;t=t[h]}return f||++c!=l?f:!!(l=null==t?0:t.length)&&s(l)&&a(h,l)&&(i(t)||o(t))}},function(t,e){t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},function(t,e,n){var r=n(276),o=n(119);t.exports=function(t,e){return null!=t&&o(t,e,r)}},function(t,e){t.exports=function(t){return void 0===t}},function(t,e,n){var r=n(50),o=n(11),i=n(124),a=n(2);t.exports=function(t,e){return(a(t)?r:i)(t,o(e,3))}},function(t,e,n){var r=n(47),o=n(10);t.exports=function(t,e){var n=-1,i=o(t)?Array(t.length):[];return r(t,(function(t,r,o){i[++n]=e(t,r,o)})),i}},function(t,e,n){var r=n(278),o=n(47),i=n(11),a=n(279),s=n(2);t.exports=function(t,e,n){var u=s(t)?r:a,c=arguments.length<3;return u(t,i(e,4),n,c,o)}},function(t,e,n){var r=n(289),o=Math.max;t.exports=function(t,e,n){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,s=o(i.length-e,0),u=Array(s);++a<s;)u[a]=i[e+a];a=-1;for(var c=Array(e+1);++a<e;)c[a]=i[a];return c[e]=n(u),r(t,this,c)}}},function(t,e,n){var r=n(290),o=n(291)(r);t.exports=o},function(t,e){t.exports=function(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}},function(t,e,n){var r=n(10),o=n(9);t.exports=function(t){return o(t)&&r(t)}},function(t,e,n){var r=n(300),o=n(12);t.exports=function(t){return null==t?[]:r(t,o(t))}},function(t,e,n){var r=n(5),o=n(132);t.exports=function(t,e,n,r){return function(t,e,n,r){var i,a,s={},u=new o,c=function(t){var e=t.v!==i?t.v:t.w,r=s[e],o=n(t),c=a.distance+o;if(o<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+o);c<r.distance&&(r.distance=c,r.predecessor=i,u.decrease(e,c))};for(t.nodes().forEach((function(t){var n=t===e?0:Number.POSITIVE_INFINITY;s[t]={distance:n},u.add(t,n)}));u.size()>0&&(i=u.removeMin(),(a=s[i]).distance!==Number.POSITIVE_INFINITY);)r(i).forEach(c);return s}(t,String(e),n||i,r||function(e){return t.outEdges(e)})};var i=r.constant(1)},function(t,e,n){var r=n(5);function o(){this._arr=[],this._keyIndices={}}t.exports=o,o.prototype.size=function(){return this._arr.length},o.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},o.prototype.has=function(t){return r.has(this._keyIndices,t)},o.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},o.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},o.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!r.has(n,t)){var o=this._arr,i=o.length;return n[t]=i,o.push({key:t,priority:e}),this._decrease(i),!0}return!1},o.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},o.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},o.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,o=t;n<e.length&&(o=e[n].priority<e[o].priority?n:o,r<e.length&&(o=e[r].priority<e[o].priority?r:o),o!==t&&(this._swap(t,o),this._heapify(o)))},o.prototype._decrease=function(t){for(var e,n=this._arr,r=n[t].priority;0!==t&&!(n[e=t>>1].priority<r);)this._swap(t,e),t=e},o.prototype._swap=function(t,e){var n=this._arr,r=this._keyIndices,o=n[t],i=n[e];n[t]=i,n[e]=o,r[i.key]=t,r[o.key]=e}},function(t,e,n){var r=n(5);t.exports=function(t){var e=0,n=[],o={},i=[];function a(s){var u=o[s]={onStack:!0,lowlink:e,index:e++};if(n.push(s),t.successors(s).forEach((function(t){r.has(o,t)?o[t].onStack&&(u.lowlink=Math.min(u.lowlink,o[t].index)):(a(t),u.lowlink=Math.min(u.lowlink,o[t].lowlink))})),u.lowlink===u.index){var c,l=[];do{c=n.pop(),o[c].onStack=!1,l.push(c)}while(s!==c);i.push(l)}}return t.nodes().forEach((function(t){r.has(o,t)||a(t)})),i}},function(t,e,n){var r=n(5);function o(t){var e={},n={},o=[];if(r.each(t.sinks(),(function a(s){if(r.has(n,s))throw new i;r.has(e,s)||(n[s]=!0,e[s]=!0,r.each(t.predecessors(s),a),delete n[s],o.push(s))})),r.size(e)!==t.nodeCount())throw new i;return o}function i(){}t.exports=o,o.CycleException=i,i.prototype=new Error},function(t,e,n){var r=n(5);function o(t,e,n,i,a,s){r.has(i,e)||(i[e]=!0,n||s.push(e),r.each(a(e),(function(e){o(t,e,n,i,a,s)})),n&&s.push(e))}t.exports=function(t,e,n){r.isArray(e)||(e=[e]);var i=(t.isDirected()?t.successors:t.neighbors).bind(t),a=[],s={};return r.each(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);o(t,e,"post"===n,s,i,a)})),a}},function(t,e,n){var r=n(319);t.exports=function(t){return t?1/0===(t=r(t))||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},function(t,e,n){var r=n(80);t.exports=function(t){return null!=t&&t.length?r(t,1):[]}},function(t,e,n){var r=n(42),o=n(20);t.exports=function(t,e,n){(void 0!==n&&!o(t[e],n)||void 0===n&&!(e in t))&&r(t,e,n)}},function(t,e){t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},function(t,e){t.exports=function(t,e){return t<e}},function(t,e,n){"use strict";var r=n(1),o=n(7).Graph,i=n(53).slack;function a(t,e){return r.forEach(t.nodes(),(function n(o){r.forEach(e.nodeEdges(o),(function(r){var a=r.v,s=o===a?r.w:a;t.hasNode(s)||i(e,r)||(t.setNode(s,{}),t.setEdge(o,s,{}),n(s))}))})),t.nodeCount()}function s(t,e){return r.minBy(e.edges(),(function(n){if(t.hasNode(n.v)!==t.hasNode(n.w))return i(e,n)}))}function u(t,e,n){r.forEach(t.nodes(),(function(t){e.node(t).rank+=n}))}t.exports=function(t){var e,n,r=new o({directed:!1}),c=t.nodes()[0],l=t.nodeCount();for(r.setNode(c,{});a(r,t)<l;)e=s(r,t),n=r.hasNode(e.v)?i(t,e):-i(t,e),u(r,t,n);return r}},function(t,e,n){e.Polynomial=n(143),e.SqrtPolynomial=n(379)},function(t,e,n){function r(){this.init(arguments)}r.TOLERANCE=1e-6,r.ACCURACY=15,r.interpolate=function(t,e,n,r,o){if(t.constructor!==Array||e.constructor!==Array)throw new Error("Polynomial.interpolate: xs and ys must be arrays");if(isNaN(n)||isNaN(r)||isNaN(o))throw new Error("Polynomial.interpolate: n, offset, and x must be numbers");for(var i=0,a=0,s=new Array(n),u=new Array(n),c=0,l=Math.abs(o-t[r]),f=0;f<n;f++){var h=Math.abs(o-t[r+f]);h<l&&(c=f,l=h),s[f]=u[f]=e[r+f]}i=e[r+c],c--;for(var y=1;y<n;y++){for(f=0;f<n-y;f++){var p=t[r+f]-o,d=t[r+f+y]-o,x=s[f+1]-u[f],v=p-d;if(0==v)break;v=x/v,u[f]=d*v,s[f]=p*v}i+=a=2*(c+1)<n-y?s[c+1]:u[c--]}return{y:i,dy:a}},r.prototype.init=function(t){this.coefs=new Array;for(var e=t.length-1;e>=0;e--)this.coefs.push(t[e]);this._variable="t",this._s=0},r.prototype.eval=function(t){if(isNaN(t))throw new Error("Polynomial.eval: parameter must be a number");for(var e=0,n=this.coefs.length-1;n>=0;n--)e=e*t+this.coefs[n];return e},r.prototype.add=function(t){for(var e=new r,n=this.getDegree(),o=t.getDegree(),i=Math.max(n,o),a=0;a<=i;a++){var s=a<=n?this.coefs[a]:0,u=a<=o?t.coefs[a]:0;e.coefs[a]=s+u}return e},r.prototype.multiply=function(t){for(var e=new r,n=0;n<=this.getDegree()+t.getDegree();n++)e.coefs.push(0);for(n=0;n<=this.getDegree();n++)for(var o=0;o<=t.getDegree();o++)e.coefs[n+o]+=this.coefs[n]*t.coefs[o];return e},r.prototype.divide_scalar=function(t){for(var e=0;e<this.coefs.length;e++)this.coefs[e]/=t},r.prototype.simplify=function(){for(var t=this.getDegree();t>=0&&Math.abs(this.coefs[t])<=1e-15;t--)this.coefs.pop()},r.prototype.bisection=function(t,e){var n,o=this.eval(t),i=this.eval(e);if(Math.abs(o)<=r.TOLERANCE)n=t;else if(Math.abs(i)<=r.TOLERANCE)n=e;else if(o*i<=0)for(var a=Math.log(e-t),s=Math.LN10*r.ACCURACY,u=Math.ceil((a+s)/Math.LN2),c=0;c<u;c++){n=.5*(t+e);var l=this.eval(n);if(Math.abs(l)<=r.TOLERANCE)break;l*o<0?(e=n,i=l):(t=n,o=l)}return n},r.prototype.toString=function(){for(var t=new Array,e=new Array,n=this.coefs.length-1;n>=0;n--){var r=Math.round(1e3*this.coefs[n])/1e3;if(0!=r){var o=r<0?" - ":" + ";r=Math.abs(r),n>0&&(1==r?r=this._variable:r+=this._variable),n>1&&(r+="^"+n),e.push(o),t.push(r)}}e[0]=" + "==e[0]?"":"-";var i="";for(n=0;n<t.length;n++)i+=e[n]+t[n];return i},r.prototype.trapezoid=function(t,e,n){if(isNaN(t)||isNaN(e)||isNaN(n))throw new Error("Polynomial.trapezoid: parameters must be numbers");var r=e-t;if(1==n){var o=this.eval(t),i=this.eval(e);this._s=.5*r*(o+i)}else{for(var a=1<<n-2,s=r/a,u=t+.5*s,c=0,l=0;l<a;l++)c+=this.eval(u),u+=s;this._s=.5*(this._s+r*c/a)}if(isNaN(this._s))throw new Error("Polynomial.trapezoid: this._s is NaN");return this._s},r.prototype.simpson=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Polynomial.simpson: parameters must be numbers");for(var n=e-t,r=.5*n*(this.eval(t)+this.eval(e)),o=r,i=4*r/3,a=i,s=r,u=1,c=2;c<=20;c++){for(var l=n/u,f=t+.5*l,h=0,y=1;y<=u;y++)h+=this.eval(f),f+=l;if(i=(4*(r=o=.5*(o+n*h/u))-s)/3,Math.abs(i-a)<1e-7*Math.abs(a))break;a=i,s=r,u<<=1}return i},r.prototype.romberg=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Polynomial.romberg: parameters must be numbers");var n=new Array(21),o=new Array(21),i={y:0,dy:0};o[0]=1;for(var a=1;a<=20&&(n[a-1]=this.trapezoid(t,e,a),!(a>=3&&(i=r.interpolate(o,n,3,a-3,0),Math.abs(i.dy)<=1e-6*i.y)));a++)n[a]=n[a-1],o[a]=.25*o[a-1];return i.y},r.prototype.getDegree=function(){return this.coefs.length-1},r.prototype.getDerivative=function(){for(var t=new r,e=1;e<this.coefs.length;e++)t.coefs.push(e*this.coefs[e]);return t},r.prototype.getRoots=function(){var t;switch(this.simplify(),this.getDegree()){case 0:default:t=new Array;break;case 1:t=this.getLinearRoot();break;case 2:t=this.getQuadraticRoots();break;case 3:t=this.getCubicRoots();break;case 4:t=this.getQuarticRoots()}return t},r.prototype.getRootsInInterval=function(t,e){var n,r=new Array;if(1==this.getDegree())null!=(n=this.bisection(t,e))&&r.push(n);else{var o=this.getDerivative().getRootsInInterval(t,e);if(o.length>0){for(null!=(n=this.bisection(t,o[0]))&&r.push(n),i=0;i<=o.length-2;i++)null!=(n=this.bisection(o[i],o[i+1]))&&r.push(n);null!=(n=this.bisection(o[o.length-1],e))&&r.push(n)}else null!=(n=this.bisection(t,e))&&r.push(n)}return r},r.prototype.getLinearRoot=function(){var t=new Array,e=this.coefs[1];return 0!=e&&t.push(-this.coefs[0]/e),t},r.prototype.getQuadraticRoots=function(){var t=new Array;if(2==this.getDegree()){var e=this.coefs[2],n=this.coefs[1]/e,r=n*n-this.coefs[0]/e*4;if(r>0){var o=Math.sqrt(r);t.push(.5*(-n+o)),t.push(.5*(-n-o))}else 0==r&&t.push(.5*-n)}return t},r.prototype.getCubicRoots=function(){var t=new Array;if(3==this.getDegree()){var e=this.coefs[3],n=this.coefs[2]/e,r=this.coefs[1]/e,o=(3*r-n*n)/3,i=(2*n*n*n-9*r*n+this.coefs[0]/e*27)/27,a=n/3,s=i*i/4+o*o*o/27,u=i/2,c=this.zeroErrorEstimate();if(Math.abs(s)<=c&&(s=0),s>0){var l,f=Math.sqrt(s);l=(v=-u+f)>=0?Math.pow(v,1/3):-Math.pow(-v,1/3),(v=-u-f)>=0?l+=Math.pow(v,1/3):l-=Math.pow(-v,1/3),t.push(l-a)}else if(s<0){var h=Math.sqrt(-o/3),y=Math.atan2(Math.sqrt(-s),-u)/3,p=Math.cos(y),d=Math.sin(y),x=Math.sqrt(3);t.push(2*h*p-a),t.push(-h*(p+x*d)-a),t.push(-h*(p-x*d)-a)}else{var v;v=u>=0?-Math.pow(u,1/3):Math.pow(-u,1/3),t.push(2*v-a),t.push(-v-a)}}return t};var o=function(t){return"number"==typeof t?t?t<0?-1:1:t==t?t:NaN:NaN};r.prototype.getQuarticRoots=function(){var t=[],e=this.getDegree();if(4==e){var n=new r;n.coefs=this.coefs.slice(),n.divide_scalar(n.coefs[e]),Math.abs(n.coefs[0])<10*1e-15*Math.abs(n.coefs[3])&&(n.coefs[0]=0);var i,a=n.getDerivative(),s=a.getRoots().sort((function(t,e){return t-e})),u=[],c=s.length-1,l=this.bounds();maxabsX=Math.max(Math.abs(l.minX),Math.abs(l.maxX));var f=this.zeroErrorEstimate(maxabsX);for(i=0;i<=c;i++)u.push(n.eval(s[i]));for(i=0;i<=c;i++)Math.abs(u[i])<f&&(u[i]=0);i=0;var h=Math.max(.1*(l.maxX-l.minX)/e,1e-15),y=[],p=[];if(c>-1){for(0!=u[0]?o(u[0])!=o(n.eval(s[0]-h)-u[0])&&(y.push(s[0]-h),p.push([l.minX,s[0]])):(t.push(s[0],s[0]),i++);i<c;i++)0==u[i+1]?(t.push(s[i+1],s[i+1]),i++):o(u[i])!=o(u[i+1])&&(y.push((s[i]+s[i+1])/2),p.push([s[i],s[i+1]]));0!=u[c]&&o(u[c])!=o(n.eval(s[c]+h)-u[c])&&(y.push(s[c]+h),p.push([s[c],l.maxX]))}var d=function(t){return n.eval(t)},x=function(t){return a.eval(t)};if(y.length>0)for(i=0;i<y.length;i++)y[i]=r.newton_secant_bisection(y[i],d,x,32,p[i][0],p[i][1]);t=t.concat(y)}return t},r.prototype.zeroErrorEstimate=function(t){var e=this;if(void 0===t){var n=e.bounds();t=Math.max(Math.abs(n.minX),Math.abs(n.maxX))}if(t<.001)return 2*Math.abs(e.eval(1e-15));var r=e.coefs.length-1,o=e.coefs[r];return 10*1e-15*e.coefs.reduce((function(e,n,r){var i=n/o*Math.pow(t,r);return i>e?i:e}),0)},r.prototype.bounds_UpperReal_Fujiwara=function(){var t=this.coefs,e=t.length-1,n=t[e];1!=n&&(t=this.coefs.map((function(t){return t/n})));var r,o=t.map((function(t,n){return n<e?Math.pow(Math.abs(0==n?t/2:t),1/(e-n)):t})),i=function(t,e,n){return r(n)&&(t.max<e?(t.nearmax=t.max,t.max=e):t.nearmax<e&&(t.nearmax=e)),t};r=function(n){return n<e&&t[n]<0};var a=o.reduce(i,{max:0,nearmax:0});return r=function(n){return n<e&&(e%2==n%2?t[n]<0:t[n]>0)},{negX:-2*o.reduce(i,{max:0,nearmax:0}).max,posX:2*a.max}},r.prototype.bounds_LowerReal_Fujiwara=function(){var t=new r;t.coefs=this.coefs.slice().reverse();var e=t.bounds_UpperReal_Fujiwara();return e.negX=1/e.negX,e.posX=1/e.posX,e},r.prototype.bounds=function(){var t=this.bounds_UpperReal_Fujiwara(),e={minX:t.negX,maxX:t.posX};return 0===t.negX&&0===t.posX||(0===t.negX?e.minX=this.bounds_LowerReal_Fujiwara().posX:0===t.posX&&(e.maxX=this.bounds_LowerReal_Fujiwara().negX),e.minX>e.maxX&&(e.minX=e.maxX=0)),e},r.newton_secant_bisection=function(t,e,n,r,i,a){var s,u,c,l,f,h,p=0,d=0;s=t;var x=Math.pow(10,-14),v="number"==typeof i&&"number"==typeof a;if(v){if(i>a)throw new Error("newton root finding: min must be greater than max");if(f=e(i),h=e(a),o(f)==o(h))throw new Error("newton root finding: y values of bounds must be of opposite sign")}var g,m=function(){return Math.abs(c)<=x*Math.abs(s)||d==s-c-s};for(g=0;g<r;g++){if(0==(u=n(s))){if(0==p)throw new Error("newton root finding: df(x) is zero");u=p}if(p=u,y=e(s),c=y/u,l=s-c,m())break;if(v){if(o(y)==o(h))a=s,h=y;else{if(o(y)!=o(f)){s=l;break}i=s,f=y}if(l<i||l>a){if(o(f)==o(h))break;var w=h-f,b=a-i;if(c=0==w?s-(i+.5*b):Math.abs(w/Math.min(f,h))>50?s-(i+b*(.5+(Math.abs(f)<Math.abs(h)?-.25:.25))):s-(i-f/w*b),l=s-c,m())break}}d=s-l,s=l}return s},t.exports=r},function(t,e,n){var r=n(31).Point2D;function o(t,e){this.init(t,e)}o.prototype.init=function(t,e){this.type=t,this.params=e,this.meta={}},o.TYPE={};var i=o.TYPE;function a(t){return t.split(" ").map((function(t){return t=t.split(","),new r(t[0],t[1])}))}i.LINE="Line",i.RECT="Rectangle",i.ROUNDRECT="RoundRectangle",i.CIRCLE="Circle",i.ELLIPSE="Ellipse",i.POLYGON="Polygon",i.POLYLINE="Polyline",i.PATH="Path",i.ARC="Arc",i.BEZIER2="Bezier2",i.BEZIER3="Bezier3",o.newShape=function(t,e){return"line"===(t=t.toLowerCase())?o.newLine(new r(e.x1,e.y1),new r(e.x2,e.y2)):"rect"===t?e.rx>0||e.ry>0?o.newRoundRect(e.x,e.y,e.width,e.height,e.rx,e.ry):o.newRect(e.x,e.y,e.width,e.height):"circle"===t?o.newCircle(new r(e.cx,e.cy),e.r):"ellipse"===t?o.newEllipse(new r(e.cx,e.cy),e.rx,e.ry):"polygon"===t?o.newPolygon(a(e.points)):"polyline"===t?o.newPolyline(a(e.points)):"path"===t?o.newPath(e.d):void 0},o.newArc=function(t,e,n,a,s,u,c){var l=function(t,e,n,o,i,a,s){function u(t,e,n,r){var o=t*n+e*r,i=Math.sqrt((t*t+e*e)*(n*n+r*r)),a=Math.acos(o/i);return t*r-e*n<0&&(a=-a),a}i=i*Math.PI/180;var c,l=Math.cos(i),f=Math.sin(i),h=t.subtract(e).divide(2),y=h.x*l+h.y*f,p=h.x*-f+h.y*l,d=y*y,x=p*p,v=d/(n*n)+x/(o*o);v>1&&(n*=c=Math.sqrt(v),o*=c);var g=n*n,m=o*o,w=g*x,b=m*d;c=(g*m-w-b)/(w+b),Math.abs(c)<1e-6&&(c=0);var _=Math.sqrt(c);a==s&&(_=-_);for(var E=t.add(e).divide(2),A=_*n*p/o,M=_*-o*y/n,C=(y-A)/n,k=(y+A)/n,N=(p-M)/o,P=(p+M)/o,O=u(1,0,C,N),S=u(C,N,-k,-P),T=2*Math.PI;S>T;)S-=T;for(;S<0;)S+=T;return 0==s&&(S-=T),{center:new r(A*l-M*f+E.x,A*f+M*l+E.y),rx:n,ry:o,theta1:O,deltaTheta:S}}(t,e,n,a,s,u,c);return new o(i.ARC,[l.center,l.rx,l.ry,s*Math.PI/180,l.theta1,l.deltaTheta])},o.newBezier2=function(t,e,n){return new o(i.BEZIER2,[t,e,n])},o.newBezier3=function(t,e,n,r){return new o(i.BEZIER3,[t,e,n,r])},o.newCircle=function(t,e){return new o(i.CIRCLE,[t,e])},o.newEllipse=function(t,e,n){return new o(i.ELLIPSE,[t,e,n])},o.newLine=function(t,e){return new o(i.LINE,[t,e])},o.newPolygon=function(t){return new o(i.POLYGON,[t])},o.newPolyline=function(t){return new o(i.POLYLINE,[t])},o.newRect=function(t,e,n,a){var s=[];return s.push(new r(t,e)),s.push(new r(t+n,e)),s.push(new r(t+n,e+a)),s.push(new r(t,e+a)),new o(i.RECT,[s])};var s=function(t){return t*Math.PI/180};function u(t,e){arguments.length>0&&this.init(t,e)}o.newRoundRect=function(t,e,n,a,u,c){if(0===u&&0===c)return o.newRect(t,e,n,a);0===u&&(u=c),0===c&&(c=u),u>n/2&&(u=n/2),c>a/2&&(u=a/2);var l=[],f=t,h=t+u,y=t+n-u,p=t+n,d=e,x=e+c,v=e+a-c,g=e+a;return l.push(new o(i.ARC,[new r(h,x),u,c,0,s(180),s(90)])),l.push(new o(i.LINE,[new r(h,d),new r(y,d)])),l.push(new o(i.ARC,[new r(y,x),u,c,0,s(-90),s(90)])),l.push(new o(i.LINE,[new r(p,x),new r(p,v)])),l.push(new o(i.ARC,[new r(y,v),u,c,0,s(0),s(90)])),l.push(new o(i.LINE,[new r(y,g),new r(h,g)])),l.push(new o(i.ARC,[new r(h,v),u,c,0,s(90),s(90)])),l.push(new o(i.LINE,[new r(f,v),new r(f,x)])),l[l.length-1].meta.closePath=!0,new o(i.ROUNDRECT,[l])},u.prototype.init=function(t,e){this.type=t,this.text=e},u.prototype.typeis=function(t){return this.type==t};var c={};function l(t,e,n){arguments.length>0&&this.init(t,e,n)}function f(t,e){arguments.length>0&&this.init("A",t,e)}function h(t,e){arguments.length>0&&this.init("Q",t,e)}function y(t,e){arguments.length>0&&this.init("C",t,e)}function p(t,e){arguments.length>0&&this.init("H",t,e)}function d(t,e){arguments.length>0&&this.init("V",t,e)}function x(t,e){arguments.length>0&&this.init("L",t,e)}function v(t,e){arguments.length>0&&this.init("M",t,e)}function g(t,e){arguments.length>0&&this.init("T",t,e)}function m(t,e){arguments.length>0&&this.init("S",t,e)}function w(t,e,n){arguments.length>0&&this.init(t,e,n)}function b(t,e){arguments.length>0&&this.init("z",t,e)}function _(t,e){arguments.length>0&&this.init("q",t,e)}function E(t,e){arguments.length>0&&this.init("c",t,e)}function A(t,e){arguments.length>0&&this.init("l",t,e)}function M(t,e){arguments.length>0&&this.init("m",t,e)}function C(t,e){arguments.length>0&&this.init("t",t,e)}function k(t,e){arguments.length>0&&this.init("s",t,e)}c.COMMAND=0,c.NUMBER=1,c.EOD=2,c.PARAMS={A:["rx","ry","x-axis-rotation","large-arc-flag","sweep-flag","x","y"],a:["rx","ry","x-axis-rotation","large-arc-flag","sweep-flag","x","y"],C:["x1","y1","x2","y2","x","y"],c:["x1","y1","x2","y2","x","y"],H:["x"],h:["x"],L:["x","y"],l:["x","y"],M:["x","y"],m:["x","y"],Q:["x1","y1","x","y"],q:["x1","y1","x","y"],S:["x2","y2","x","y"],s:["x2","y2","x","y"],T:["x","y"],t:["x","y"],V:["y"],v:["y"],Z:[],z:[]},o.newPath=function(t){for(var e=function(t){for(var e=new Array;""!=t;)if(t.match(/^([ \t\r\n,]+)/))t=t.substr(RegExp.$1.length);else if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]=new u(c.COMMAND,RegExp.$1),t=t.substr(RegExp.$1.length);else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))throw new Error("Unrecognized segment command: "+t);e[e.length]=new u(c.NUMBER,parseFloat(RegExp.$1)),t=t.substr(RegExp.$1.length)}return e[e.length]=new u(c.EOD,null),e}(t),n=0,r=e[n],a="BOD",s=[];!r.typeis(c.EOD);){var l,w=new Array;if("BOD"==a){if("M"!=r.text&&"m"!=r.text)throw new Error("Path data must begin with a moveto command");n++,l=c.PARAMS[r.text].length,a=r.text}else r.typeis(c.NUMBER)?l=c.PARAMS[a].length:(n++,l=c.PARAMS[r.text].length,a=r.text);if(!(n+l<e.length))throw new Error("Path data ended before all parameters were found");for(var N=n;N<n+l;N++){var P=e[N];if(!P.typeis(c.NUMBER))throw new Error("Parameter type is not a number: "+a+","+P.text);w[w.length]=P.text}var O,S=s.length,T=0==S?null:s[S-1];switch(a){case"A":O=new f(w,T);break;case"C":O=new y(w,T);break;case"c":O=new E(w,T);break;case"H":O=new p(w,T);break;case"V":O=new d(w,T);break;case"L":O=new x(w,T);break;case"l":O=new A(w,T);break;case"M":O=new v(w,T);break;case"m":O=new M(w,T);break;case"Q":O=new h(w,T);break;case"q":O=new _(w,T);break;case"S":O=new m(w,T);break;case"s":O=new k(w,T);break;case"T":O=new g(w,T);break;case"t":O=new C(w,T);break;case"Z":case"z":O=new b(w,T);break;default:throw new Error("Unsupported segment type: "+a)}s.push(O),r=e[n+=l],"M"==a&&(a="L"),"m"==a&&(a="l")}var j=[];for(N=0;N<s.length;N++){var I=s[N].getIntersectionParams();I&&j.push(I)}return new o(i.PATH,[j])},l.prototype.init=function(t,e,n){this.command=t,this.previous=n,this.points=[];for(var o=0;o<e.length;)this.points.push(new r(e[o],e[o+1])),o+=2},l.prototype.getLastPoint=function(){return this.points[this.points.length-1]},l.prototype.getIntersectionParams=function(){return null},f.prototype=new l,f.prototype.constructor=h,f.superclass=l.prototype,f.prototype.init=function(t,e,n){var r=new Array,o=e.pop(),i=e.pop();r.push(i,o),f.superclass.init.call(this,t,r,n),this.rx=parseFloat(e.shift()),this.ry=parseFloat(e.shift()),this.angle=parseFloat(e.shift()),this.arcFlag=parseFloat(e.shift()),this.sweepFlag=parseFloat(e.shift())},f.prototype.getIntersectionParams=function(){return o.newArc(this.previous.getLastPoint(),this.points[0],this.rx,this.ry,this.angle,this.arcFlag,this.sweepFlag)},h.prototype=new l,h.prototype.constructor=h,h.superclass=l.prototype,h.prototype.getIntersectionParams=function(){return o.newBezier2(this.previous.getLastPoint(),this.points[0],this.points[1])},y.prototype=new l,y.prototype.constructor=y,y.superclass=l.prototype,y.prototype.getLastControlPoint=function(){return this.points[1]},y.prototype.getIntersectionParams=function(){return o.newBezier3(this.previous.getLastPoint(),this.points[0],this.points[1],this.points[2])},p.prototype=new l,p.prototype.constructor=p,p.superclass=l.prototype,p.prototype.init=function(t,e,n){var r=n.getLastPoint(),o=new Array;o.push(e.pop(),r.y),p.superclass.init.call(this,t,o,n)},d.prototype=new l,d.prototype.constructor=d,d.superclass=l.prototype,d.prototype.init=function(t,e,n){var r=n.getLastPoint(),o=new Array;o.push(r.x,e.pop()),d.superclass.init.call(this,t,o,n)},x.prototype=new l,x.prototype.constructor=x,x.superclass=l.prototype,x.prototype.getIntersectionParams=function(){return o.newLine(this.previous.getLastPoint(),this.points[0])},v.prototype=new l,v.prototype.constructor=v,v.superclass=l.prototype,g.prototype=new l,g.prototype.constructor=g,g.superclass=l.prototype,g.prototype.getControlPoint=function(){var t,e=this.previous.getLastPoint();if(this.previous.command.match(/^[QqTt]$/)){var n=this.previous.getControlPoint().subtract(e);t=e.subtract(n)}else t=e;return t},g.prototype.getIntersectionParams=function(){return o.newBezier2(this.previous.getLastPoint(),this.getControlPoint(),this.points[0])},m.prototype=new l,m.prototype.constructor=m,m.superclass=l.prototype,m.prototype.getFirstControlPoint=function(){var t,e=this.previous.getLastPoint();if(this.previous.command.match(/^[SsCc]$/)){var n=this.previous.getLastControlPoint().subtract(e);t=e.subtract(n)}else t=e;return t},m.prototype.getLastControlPoint=function(){return this.points[0]},m.prototype.getIntersectionParams=function(){return o.newBezier3(this.previous.getLastPoint(),this.getFirstControlPoint(),this.points[0],this.points[1])},w.prototype=new l,w.prototype.constructor=w,w.superclass=l.prototype,w.prototype.init=function(t,e,n){var o;this.command=t,this.previous=n,this.points=[],o=this.previous?this.previous.getLastPoint():new r(0,0);for(var i=0;i<e.length;){var a=new r(o.x+e[i],o.y+e[i+1]);this.points.push(a),i+=2}},b.prototype=new w,b.prototype.constructor=b,b.superclass=w.prototype,b.prototype.getLastPoint=function(){for(var t,e=this.previous;e;){if(e.command.match(/^[mMzZ]$/)){t=e.getLastPoint();break}e=e.previous}return t},b.prototype.getIntersectionParams=function(){return o.newLine(this.previous.getLastPoint(),this.getLastPoint())},_.prototype=new w,_.prototype.constructor=_,_.superclass=w.prototype,_.prototype.getControlPoint=function(){return this.points[0]},_.prototype.getIntersectionParams=function(){return o.newBezier2(this.previous.getLastPoint(),this.points[0],this.points[1])},E.prototype=new w,E.prototype.constructor=E,E.superclass=w.prototype,E.prototype.getLastControlPoint=function(){return this.points[1]},E.prototype.getIntersectionParams=function(){return o.newBezier3(this.previous.getLastPoint(),this.points[0],this.points[1],this.points[2])},A.prototype=new w,A.prototype.constructor=A,A.superclass=w.prototype,A.prototype.toString=function(){var t,e;return new Array,t=this.previous?this.previous.getLastPoint():new Point(0,0),e=this.points[0].subtract(t),this.previous.constructor!=this.constuctor&&this.previous.constructor!=M&&(cmd=this.command),cmd+e.toString()},A.prototype.getIntersectionParams=function(){return o.newLine(this.previous.getLastPoint(),this.points[0])},M.prototype=new w,M.prototype.constructor=M,M.superclass=w.prototype,C.prototype=new w,C.prototype.constructor=C,C.superclass=w.prototype,C.prototype.getControlPoint=function(){var t,e=this.previous.getLastPoint();if(this.previous.command.match(/^[QqTt]$/)){var n=this.previous.getControlPoint().subtract(e);t=e.subtract(n)}else t=e;return t},C.prototype.getIntersectionParams=function(){return o.newBezier2(this.previous.getLastPoint(),this.getControlPoint(),this.points[0])},k.prototype=new w,k.prototype.constructor=k,k.superclass=w.prototype,k.prototype.getFirstControlPoint=function(){var t,e=this.previous.getLastPoint();if(this.previous.command.match(/^[SsCc]$/)){var n=this.previous.getLastControlPoint().subtract(e);t=e.subtract(n)}else t=e;return t},k.prototype.getLastControlPoint=function(){return this.points[0]},k.prototype.getIntersectionParams=function(){return o.newBezier3(this.previous.getLastPoint(),this.getFirstControlPoint(),this.points[0],this.points[1])},t.exports=o},function(t,e){function n(t){this.init(t)}n.prototype.init=function(t){this.status=t,this.points=[]},n.prototype.appendPoint=function(t){this.points.push(t)},n.prototype.appendPoints=function(t){this.points=this.points.concat(t)},t.exports=n},function(t,e,n){function r(){this.init(arguments)}r.TOLERANCE=1e-6,r.ACCURACY=15,r.interpolate=function(t,e,n,r,o){if(t.constructor!==Array||e.constructor!==Array)throw new Error("Polynomial.interpolate: xs and ys must be arrays");if(isNaN(n)||isNaN(r)||isNaN(o))throw new Error("Polynomial.interpolate: n, offset, and x must be numbers");for(var i=0,a=0,s=new Array(n),u=new Array(n),c=0,l=Math.abs(o-t[r]),f=0;f<n;f++){var h=Math.abs(o-t[r+f]);h<l&&(c=f,l=h),s[f]=u[f]=e[r+f]}i=e[r+c],c--;for(var y=1;y<n;y++){for(f=0;f<n-y;f++){var p=t[r+f]-o,d=t[r+f+y]-o,x=s[f+1]-u[f],v=p-d;if(0==v)throw new Error("Unable to interpolate polynomial. Two numbers in n were identical (to within roundoff)");v=x/v,u[f]=d*v,s[f]=p*v}i+=a=2*(c+1)<n-y?s[c+1]:u[c--]}return{y:i,dy:a}},r.prototype.init=function(t){this.coefs=new Array;for(var e=t.length-1;e>=0;e--)this.coefs.push(t[e]);this._variable="t",this._s=0},r.prototype.eval=function(t){if(isNaN(t))throw new Error("Polynomial.eval: parameter must be a number");for(var e=0,n=this.coefs.length-1;n>=0;n--)e=e*t+this.coefs[n];return e},r.prototype.add=function(t){for(var e=new r,n=this.getDegree(),o=t.getDegree(),i=Math.max(n,o),a=0;a<=i;a++){var s=a<=n?this.coefs[a]:0,u=a<=o?t.coefs[a]:0;e.coefs[a]=s+u}return e},r.prototype.multiply=function(t){for(var e=new r,n=0;n<=this.getDegree()+t.getDegree();n++)e.coefs.push(0);for(n=0;n<=this.getDegree();n++)for(var o=0;o<=t.getDegree();o++)e.coefs[n+o]+=this.coefs[n]*t.coefs[o];return e},r.prototype.divide_scalar=function(t){for(var e=0;e<this.coefs.length;e++)this.coefs[e]/=t},r.prototype.simplify=function(t){void 0===t&&(t=1e-12);for(var e=this.getDegree();e>=0&&Math.abs(this.coefs[e])<=t;e--)this.coefs.pop()},r.prototype.bisection=function(t,e){var n,o=this.eval(t),i=this.eval(e);if(Math.abs(o)<=r.TOLERANCE)n=t;else if(Math.abs(i)<=r.TOLERANCE)n=e;else if(o*i<=0)for(var a=Math.log(e-t),s=Math.LN10*r.ACCURACY,u=Math.ceil((a+s)/Math.LN2),c=0;c<u;c++){n=.5*(t+e);var l=this.eval(n);if(Math.abs(l)<=r.TOLERANCE)break;l*o<0?(e=n,i=l):(t=n,o=l)}return n},r.prototype.toString=function(){for(var t=new Array,e=new Array,n=this.coefs.length-1;n>=0;n--){var r=Math.round(1e3*this.coefs[n])/1e3;if(0!=r){var o=r<0?" - ":" + ";r=Math.abs(r),n>0&&(1==r?r=this._variable:r+=this._variable),n>1&&(r+="^"+n),e.push(o),t.push(r)}}e[0]=" + "==e[0]?"":"-";var i="";for(n=0;n<t.length;n++)i+=e[n]+t[n];return i},r.prototype.trapezoid=function(t,e,n){if(isNaN(t)||isNaN(e)||isNaN(n))throw new Error("Polynomial.trapezoid: parameters must be numbers");var r=e-t;if(1==n){var o=this.eval(t),i=this.eval(e);this._s=.5*r*(o+i)}else{for(var a=1<<n-2,s=r/a,u=t+.5*s,c=0,l=0;l<a;l++)c+=this.eval(u),u+=s;this._s=.5*(this._s+r*c/a)}if(isNaN(this._s))throw new Error("Polynomial.trapezoid: this._s is NaN");return this._s},r.prototype.simpson=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Polynomial.simpson: parameters must be numbers");for(var n=e-t,r=.5*n*(this.eval(t)+this.eval(e)),o=r,i=4*r/3,a=i,s=r,u=1,c=2;c<=20;c++){for(var l=n/u,f=t+.5*l,h=0,y=1;y<=u;y++)h+=this.eval(f),f+=l;if(i=(4*(r=o=.5*(o+n*h/u))-s)/3,Math.abs(i-a)<1e-7*Math.abs(a))break;a=i,s=r,u<<=1}return i},r.prototype.romberg=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Polynomial.romberg: parameters must be numbers");var n=new Array(21),o=new Array(21),i={y:0,dy:0};o[0]=1;for(var a=1;a<=20&&(n[a-1]=this.trapezoid(t,e,a),!(a>=3&&(i=r.interpolate(o,n,3,a-3,0),Math.abs(i.dy)<=1e-6*i.y)));a++)n[a]=n[a-1],o[a]=.25*o[a-1];return i.y},r.prototype.getDegree=function(){return this.coefs.length-1},r.prototype.getDerivative=function(){for(var t=new r,e=1;e<this.coefs.length;e++)t.coefs.push(e*this.coefs[e]);return t},r.prototype.getRoots=function(){var t;switch(this.simplify(),this.getDegree()){case 0:default:t=[];break;case 1:t=this.getLinearRoot();break;case 2:t=this.getQuadraticRoots();break;case 3:t=this.getCubicRoots();break;case 4:t=this.getQuarticRoots()}return t},r.prototype.getRootsInInterval=function(t,e){var n,r=new Array;if(1==this.getDegree())null!=(n=this.bisection(t,e))&&r.push(n);else{var o=this.getDerivative().getRootsInInterval(t,e);if(o.length>0){for(null!=(n=this.bisection(t,o[0]))&&r.push(n),i=0;i<=o.length-2;i++)null!=(n=this.bisection(o[i],o[i+1]))&&r.push(n);null!=(n=this.bisection(o[o.length-1],e))&&r.push(n)}else null!=(n=this.bisection(t,e))&&r.push(n)}return r},r.prototype.getLinearRoot=function(){var t=[],e=this.coefs[1];return 0!=e&&t.push(-this.coefs[0]/e),t},r.prototype.getQuadraticRoots=function(){var t=[];if(2==this.getDegree()){var e=this.coefs[2],n=this.coefs[1]/e,r=n*n-this.coefs[0]/e*4;if(r>0){var o=Math.sqrt(r);t.push(.5*(-n+o)),t.push(.5*(-n-o))}else 0==r&&t.push(.5*-n)}return t},r.prototype.getCubicRoots=function(){var t=[];if(3==this.getDegree()){var e=this.coefs[3],n=this.coefs[2]/e,r=this.coefs[1]/e,o=(3*r-n*n)/3,i=(2*n*n*n-9*r*n+this.coefs[0]/e*27)/27,a=n/3,s=i*i/4+o*o*o/27,u=i/2,c=this.zeroErrorEstimate();if(Math.abs(s)<=c&&(s=0),s>0){var l,f=Math.sqrt(s);l=(v=-u+f)>=0?Math.pow(v,1/3):-Math.pow(-v,1/3),(v=-u-f)>=0?l+=Math.pow(v,1/3):l-=Math.pow(-v,1/3),t.push(l-a)}else if(s<0){var h=Math.sqrt(-o/3),y=Math.atan2(Math.sqrt(-s),-u)/3,p=Math.cos(y),d=Math.sin(y),x=Math.sqrt(3);t.push(2*h*p-a),t.push(-h*(p+x*d)-a),t.push(-h*(p-x*d)-a)}else{var v;v=u>=0?-Math.pow(u,1/3):Math.pow(-u,1/3),t.push(2*v-a),t.push(-v-a)}}return t};var o=function(t){return"number"==typeof t?t?t<0?-1:1:t==t?t:NaN:NaN};r.prototype.getQuarticRoots=function(){var t=[],e=this.getDegree();if(4==e){var n=new r;n.coefs=this.coefs.slice(),n.divide_scalar(n.coefs[e]),Math.abs(n.coefs[0])<10*1e-15*Math.abs(n.coefs[3])&&(n.coefs[0]=0);var i,a=n.getDerivative(),s=a.getRoots().sort((function(t,e){return t-e})),u=[],c=s.length-1,l=this.bounds();maxabsX=Math.max(Math.abs(l.minX),Math.abs(l.maxX));var f=this.zeroErrorEstimate(maxabsX);for(i=0;i<=c;i++)u.push(n.eval(s[i]));for(i=0;i<=c;i++)Math.abs(u[i])<f&&(u[i]=0);i=0;var h=Math.max(.1*(l.maxX-l.minX)/e,1e-15),y=[],p=[];if(c>-1){for(0!=u[0]?o(u[0])!=o(n.eval(s[0]-h)-u[0])&&(y.push(s[0]-h),p.push([l.minX,s[0]])):(t.push(s[0],s[0]),i++);i<c;i++)0==u[i+1]?(t.push(s[i+1],s[i+1]),i++):o(u[i])!=o(u[i+1])&&(y.push((s[i]+s[i+1])/2),p.push([s[i],s[i+1]]));0!=u[c]&&o(u[c])!=o(n.eval(s[c]+h)-u[c])&&(y.push(s[c]+h),p.push([s[c],l.maxX]))}var d=function(t){return n.eval(t)},x=function(t){return a.eval(t)};if(y.length>0)for(i=0;i<y.length;i++)y[i]=r.newton_secant_bisection(y[i],d,x,32,p[i][0],p[i][1]);t=t.concat(y)}return t},r.prototype.zeroErrorEstimate=function(t){var e=this;if(void 0===t){var n=e.bounds();t=Math.max(Math.abs(n.minX),Math.abs(n.maxX))}if(t<.001)return 2*Math.abs(e.eval(1e-15));var r=e.coefs.length-1,o=e.coefs[r];return 10*1e-15*e.coefs.reduce((function(e,n,r){var i=n/o*Math.pow(t,r);return i>e?i:e}),0)},r.prototype.bounds_UpperReal_Fujiwara=function(){var t=this.coefs,e=t.length-1,n=t[e];1!=n&&(t=this.coefs.map((function(t){return t/n})));var r,o=t.map((function(t,n){return n<e?Math.pow(Math.abs(0==n?t/2:t),1/(e-n)):t})),i=function(t,e,n){return r(n)&&(t.max<e?(t.nearmax=t.max,t.max=e):t.nearmax<e&&(t.nearmax=e)),t};r=function(n){return n<e&&t[n]<0};var a=o.reduce(i,{max:0,nearmax:0});return r=function(n){return n<e&&(e%2==n%2?t[n]<0:t[n]>0)},{negX:-2*o.reduce(i,{max:0,nearmax:0}).max,posX:2*a.max}},r.prototype.bounds_LowerReal_Fujiwara=function(){var t=new r;t.coefs=this.coefs.slice().reverse();var e=t.bounds_UpperReal_Fujiwara();return e.negX=1/e.negX,e.posX=1/e.posX,e},r.prototype.bounds=function(){var t=this.bounds_UpperReal_Fujiwara(),e={minX:t.negX,maxX:t.posX};return 0===t.negX&&0===t.posX||(0===t.negX?e.minX=this.bounds_LowerReal_Fujiwara().posX:0===t.posX&&(e.maxX=this.bounds_LowerReal_Fujiwara().negX),e.minX>e.maxX&&(e.minX=e.maxX=0)),e},r.newton_secant_bisection=function(t,e,n,r,i,a){var s,u,c,l,f,h,p=0,d=0;s=t;var x=Math.pow(10,-14),v="number"==typeof i&&"number"==typeof a;if(v){if(i>a)throw new Error("newton root finding: min must be greater than max");if(f=e(i),h=e(a),o(f)==o(h))throw new Error("newton root finding: y values of bounds must be of opposite sign")}var g,m=function(){return Math.abs(c)<=x*Math.abs(s)||d==s-c-s};for(g=0;g<r;g++){if(0==(u=n(s))){if(0==p)throw new Error("newton root finding: df(x) is zero");u=p}if(p=u,y=e(s),c=y/u,l=s-c,m())break;if(v){if(o(y)==o(h))a=s,h=y;else{if(o(y)!=o(f)){s=l;break}i=s,f=y}if(l<i||l>a){if(o(f)==o(h))break;var w=h-f,b=a-i;if(c=0==w?s-(i+.5*b):Math.abs(w/Math.min(f,h))>50?s-(i+b*(.5+(Math.abs(f)<Math.abs(h)?-.25:.25))):s-(i-f/w*b),l=s-c,m())break}}d=s-l,s=l}return s},t.exports=r},function(t,e,n){"use strict";var r=n(392);function o(t,e){return(t&e)===e}n(393);var i={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32,injectDOMPropertyConfig:function(t){var e=i,n=t.Properties||{},a=t.DOMAttributeNamespaces||{},u=t.DOMAttributeNames||{},c=t.DOMPropertyNames||{},l=t.DOMMutationMethods||{};for(var f in t.isCustomAttribute&&s._isCustomAttributeFunctions.push(t.isCustomAttribute),n){s.properties.hasOwnProperty(f)&&r("48",f);var h=f.toLowerCase(),y=n[f],p={attributeName:h,attributeNamespace:null,propertyName:f,mutationMethod:null,mustUseProperty:o(y,e.MUST_USE_PROPERTY),hasBooleanValue:o(y,e.HAS_BOOLEAN_VALUE),hasNumericValue:o(y,e.HAS_NUMERIC_VALUE),hasPositiveNumericValue:o(y,e.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:o(y,e.HAS_OVERLOADED_BOOLEAN_VALUE)};if(p.hasBooleanValue+p.hasNumericValue+p.hasOverloadedBooleanValue<=1||r("50",f),u.hasOwnProperty(f)){var d=u[f];p.attributeName=d}a.hasOwnProperty(f)&&(p.attributeNamespace=a[f]),c.hasOwnProperty(f)&&(p.propertyName=c[f]),l.hasOwnProperty(f)&&(p.mutationMethod=l[f]),s.properties[f]=p}}},a=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",s={ID_ATTRIBUTE_NAME:"data-reactid",ROOT_ATTRIBUTE_NAME:"data-reactroot",ATTRIBUTE_NAME_START_CHAR:a,ATTRIBUTE_NAME_CHAR:a+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",properties:{},getPossibleStandardName:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(t){for(var e=0;e<s._isCustomAttributeFunctions.length;e++)if((0,s._isCustomAttributeFunctions[e])(t))return!0;return!1},injection:i};t.exports=s},function(t,e,n){"use strict";function r(t){for(var e,n={},r=0,o=t.length;r<o;r++)n[(e=t[r]).name]=e.value;return n}t.exports={formatAttributes:r,formatDOM:function t(e,n,o){n=n||null;for(var i,a,s,u=[],c=0,l=e.length;c<l;c++){switch(i=e[c],s={next:null,prev:u[c-1]||null,parent:n},(a=u[c-1])&&(a.next=s),0!==i.nodeName.indexOf("#")&&(s.name=i.nodeName.toLowerCase(),s.attribs={},i.attributes&&i.attributes.length&&(s.attribs=r(i.attributes))),i.nodeType){case 1:"script"===s.name||"style"===s.name?s.type=s.name:s.type="tag",s.children=t(i.childNodes,s);break;case 3:s.type="text",s.data=i.nodeValue;break;case 8:s.type="comment",s.data=i.nodeValue}u.push(s)}return o&&(u.unshift({name:o.substring(0,o.indexOf(" ")).toLowerCase(),data:o,type:"directive",next:u[0]?u[0]:null,prev:null,parent:n}),u[1]&&(u[1].prev=u[0])),u},isIE:function(t){return t?document.documentMode===t:/(MSIE |Trident\/|Edge\/)/.test(navigator.userAgent)}}},function(t,e,n){"use strict";var o=Array.isArray,i=Object.keys,a=Object.prototype.hasOwnProperty;t.exports=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==r(e)&&"object"==r(n)){var s,u,c,l=o(e),f=o(n);if(l&&f){if((u=e.length)!=n.length)return!1;for(s=u;0!=s--;)if(!t(e[s],n[s]))return!1;return!0}if(l!=f)return!1;var h=e instanceof Date,y=n instanceof Date;if(h!=y)return!1;if(h&&y)return e.getTime()==n.getTime();var p=e instanceof RegExp,d=n instanceof RegExp;if(p!=d)return!1;if(p&&d)return e.toString()==n.toString();var x=i(e);if((u=x.length)!==i(n).length)return!1;for(s=u;0!=s--;)if(!a.call(n,x[s]))return!1;for(s=u;0!=s--;)if(!t(e[c=x[s]],n[c]))return!1;return!0}return e!=e&&n!=n}},function(t,e,n){e.Intersection=n(384),e.IntersectionArgs=n(82),e.Shapes=n(387),e.AffineShapes=n(388),e.IntersectionQuery=n(389),e.Point2D=n(4).Point2D,e.Vector2D=n(4).Vector2D,e.Matrix2D=n(4).Matrix2D},function(t,e,n){var r=n(390),o=n(399),i={decodeEntities:!0,lowerCaseAttributeNames:!1};t.exports=function(t,e){if("string"!=typeof t)throw new TypeError("First argument must be a string");return r(o(t,i),e)}},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"></path></svg>'},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){var r=n(199);t.exports={Graph:r.Graph,json:n(302),alg:n(303),version:r.version}},function(t,e,n){t.exports={Graph:n(64),version:n(301)}},function(t,e,n){var r=n(89);t.exports=function(t){return r(t,4)}},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var r=n(38),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0||(n==e.length-1?e.pop():o.call(e,n,1),--this.size,0))}},function(t,e,n){var r=n(38);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},function(t,e,n){var r=n(38);t.exports=function(t){return r(this.__data__,t)>-1}},function(t,e,n){var r=n(38);t.exports=function(t,e){var n=this.__data__,o=r(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}},function(t,e,n){var r=n(37);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(37),o=n(65),i=n(66);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var r=n(26),o=n(215),i=n(6),a=n(91),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,f=c.hasOwnProperty,h=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(r(t)?h:s).test(a(t))}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==("undefined"==typeof window?"undefined":r(window))&&(n=window)}t.exports=n},function(t,e,n){var r=n(21),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var o=a.call(t);return r&&(e?t[s]=n:delete t[s]),o}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var r,o=n(216),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!i&&i in t}},function(t,e,n){var r=n(8)["__core-js_shared__"];t.exports=r},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var r=n(219),o=n(37),i=n(65);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},function(t,e,n){var r=n(220),o=n(221),i=n(222),a=n(223),s=n(224);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,t.exports=u},function(t,e,n){var r=n(39);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,n){var r=n(39),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(e,t)?e[t]:void 0}},function(t,e,n){var r=n(39),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:o.call(e,t)}},function(t,e,n){var r=n(39);t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?"__lodash_hash_undefined__":e,this}},function(t,e,n){var r=n(40);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=r(t);return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,n){var r=n(40);t.exports=function(t){return r(this,t).get(t)}},function(t,e,n){var r=n(40);t.exports=function(t){return r(this,t).has(t)}},function(t,e,n){var r=n(40);t.exports=function(t,e){var n=r(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this}},function(t,e,n){var r=n(27),o=n(12);t.exports=function(t,e){return t&&r(e,o(e),t)}},function(t,e){t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},function(t,e,n){var r=n(16),o=n(9);t.exports=function(t){return o(t)&&"[object Arguments]"==r(t)}},function(t,e){t.exports=function(){return!1}},function(t,e,n){var r=n(16),o=n(69),i=n(9),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return i(t)&&o(t.length)&&!!a[r(t)]}},function(t,e,n){var r=n(94)(Object.keys,Object);t.exports=r},function(t,e,n){var r=n(27),o=n(17);t.exports=function(t,e){return t&&r(e,o(e),t)}},function(t,e,n){var r=n(6),o=n(45),i=n(238),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=o(t),n=[];for(var s in t)("constructor"!=s||!e&&a.call(t,s))&&n.push(s);return n}},function(t,e){t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},function(t,e,n){var r=n(27),o=n(72);t.exports=function(t,e){return r(t,o(t),e)}},function(t,e,n){var r=n(27),o=n(99);t.exports=function(t,e){return r(t,o(t),e)}},function(t,e,n){var r=n(101),o=n(99),i=n(17);t.exports=function(t){return r(t,i,o)}},function(t,e,n){var r=n(15)(n(8),"DataView");t.exports=r},function(t,e,n){var r=n(15)(n(8),"Promise");t.exports=r},function(t,e,n){var r=n(15)(n(8),"WeakMap");t.exports=r},function(t,e){var n=Object.prototype.hasOwnProperty;t.exports=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&n.call(t,"index")&&(r.index=t.index,r.input=t.input),r}},function(t,e,n){var r=n(74),o=n(247),i=n(248),a=n(249),s=n(104);t.exports=function(t,e,n){var u=t.constructor;switch(e){case"[object ArrayBuffer]":return r(t);case"[object Boolean]":case"[object Date]":return new u(+t);case"[object DataView]":return o(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(t,n);case"[object Map]":case"[object Set]":return new u;case"[object Number]":case"[object String]":return new u(t);case"[object RegExp]":return i(t);case"[object Symbol]":return a(t)}}},function(t,e,n){var r=n(74);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}},function(t,e){var n=/\w*$/;t.exports=function(t){var e=new t.constructor(t.source,n.exec(t));return e.lastIndex=t.lastIndex,e}},function(t,e,n){var r=n(21),o=r?r.prototype:void 0,i=o?o.valueOf:void 0;t.exports=function(t){return i?Object(i.call(t)):{}}},function(t,e,n){var r=n(251),o=n(44),i=n(70),a=i&&i.isMap,s=a?o(a):r;t.exports=s},function(t,e,n){var r=n(23),o=n(9);t.exports=function(t){return o(t)&&"[object Map]"==r(t)}},function(t,e,n){var r=n(253),o=n(44),i=n(70),a=i&&i.isSet,s=a?o(a):r;t.exports=s},function(t,e,n){var r=n(23),o=n(9);t.exports=function(t){return o(t)&&"[object Set]"==r(t)}},function(t,e){t.exports=function(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),s=a.length;s--;){var u=a[t?s:++o];if(!1===n(i[u],u,i))break}return e}}},function(t,e,n){var r=n(10);t.exports=function(t,e){return function(n,o){if(null==n)return n;if(!r(n))return t(n,o);for(var i=n.length,a=e?i:-1,s=Object(n);(e?a--:++a<i)&&!1!==o(s[a],a,s););return n}}},function(t,e,n){var r=n(47);t.exports=function(t,e){var n=[];return r(t,(function(t,r,o){e(t,r,o)&&n.push(t)})),n}},function(t,e,n){var r=n(258),o=n(266),i=n(116);t.exports=function(t){var e=o(t);return 1==e.length&&e[0][2]?i(e[0][0],e[0][1]):function(n){return n===t||r(n,t,e)}}},function(t,e,n){var r=n(36),o=n(111);t.exports=function(t,e,n,i){var a=n.length,s=a,u=!i;if(null==t)return!s;for(t=Object(t);a--;){var c=n[a];if(u&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++a<s;){var l=(c=n[a])[0],f=t[l],h=c[1];if(u&&c[2]){if(void 0===f&&!(l in t))return!1}else{var y=new r;if(i)var p=i(f,h,l,t,e,y);if(!(void 0===p?o(h,f,3,i,y):p))return!1}}return!0}},function(t,e,n){var r=n(36),o=n(112),i=n(263),a=n(265),s=n(23),u=n(2),c=n(22),l=n(29),f="[object Arguments]",h="[object Array]",y="[object Object]",p=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,d,x,v){var g=u(t),m=u(e),w=g?h:s(t),b=m?h:s(e),_=(w=w==f?y:w)==y,E=(b=b==f?y:b)==y,A=w==b;if(A&&c(t)){if(!c(e))return!1;g=!0,_=!1}if(A&&!_)return v||(v=new r),g||l(t)?o(t,e,n,d,x,v):i(t,e,w,n,d,x,v);if(!(1&n)){var M=_&&p.call(t,"__wrapped__"),C=E&&p.call(e,"__wrapped__");if(M||C){var k=M?t.value():t,N=C?e.value():e;return v||(v=new r),x(k,N,n,d,v)}}return!!A&&(v||(v=new r),a(t,e,n,d,x,v))}},function(t,e){t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}},function(t,e,n){var r=n(21),o=n(103),i=n(20),a=n(112),s=n(264),u=n(78),c=r?r.prototype:void 0,l=c?c.valueOf:void 0;t.exports=function(t,e,n,r,c,f,h){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!f(new o(t),new o(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var y=s;case"[object Set]":var p=1&r;if(y||(y=u),t.size!=e.size&&!p)return!1;var d=h.get(t);if(d)return d==e;r|=2,h.set(t,e);var x=a(y(t),y(e),r,c,f,h);return h.delete(t),x;case"[object Symbol]":if(l)return l.call(t)==l.call(e)}return!1}},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}},function(t,e,n){var r=n(100),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,i,a,s){var u=1&n,c=r(t),l=c.length;if(l!=r(e).length&&!u)return!1;for(var f=l;f--;){var h=c[f];if(!(u?h in e:o.call(e,h)))return!1}var y=s.get(t),p=s.get(e);if(y&&p)return y==e&&p==t;var d=!0;s.set(t,e),s.set(e,t);for(var x=u;++f<l;){var v=t[h=c[f]],g=e[h];if(i)var m=u?i(g,v,h,e,t,s):i(v,g,h,t,e,s);if(!(void 0===m?v===g||a(v,g,n,i,s):m)){d=!1;break}x||(x="constructor"==h)}if(d&&!x){var w=t.constructor,b=e.constructor;w==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof w&&w instanceof w&&"function"==typeof b&&b instanceof b||(d=!1)}return s.delete(t),s.delete(e),d}},function(t,e,n){var r=n(115),o=n(12);t.exports=function(t){for(var e=o(t),n=e.length;n--;){var i=e[n],a=t[i];e[n]=[i,a,r(a)]}return e}},function(t,e,n){var r=n(111),o=n(268),i=n(118),a=n(79),s=n(115),u=n(116),c=n(30);t.exports=function(t,e){return a(t)&&s(e)?u(c(t),e):function(n){var a=o(n,t);return void 0===a&&a===e?i(n,t):r(e,a,3)}}},function(t,e,n){var r=n(48);t.exports=function(t,e,n){var o=null==t?void 0:r(t,e);return void 0===o?n:o}},function(t,e,n){var r=n(270),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=r((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(o,(function(t,n,r,o){e.push(r?o.replace(i,"$1"):n||t)})),e}));t.exports=a},function(t,e,n){var r=n(271);t.exports=function(t){var e=r(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}},function(t,e,n){var r=n(66);function o(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function n(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(o.Cache||r),n}o.Cache=r,t.exports=o},function(t,e,n){var r=n(21),o=n(50),i=n(2),a=n(24),s=r?r.prototype:void 0,u=s?s.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(a(e))return u?u.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}},function(t,e){t.exports=function(t,e){return null!=t&&e in Object(t)}},function(t,e,n){var r=n(120),o=n(275),i=n(79),a=n(30);t.exports=function(t){return i(t)?r(a(t)):o(t)}},function(t,e,n){var r=n(48);t.exports=function(t){return function(e){return r(e,t)}}},function(t,e){var n=Object.prototype.hasOwnProperty;t.exports=function(t,e){return null!=t&&n.call(t,e)}},function(t,e,n){var r=n(71),o=n(23),i=n(28),a=n(2),s=n(10),u=n(22),c=n(45),l=n(29),f=Object.prototype.hasOwnProperty;t.exports=function(t){if(null==t)return!0;if(s(t)&&(a(t)||"string"==typeof t||"function"==typeof t.splice||u(t)||l(t)||i(t)))return!t.length;var e=o(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(c(t))return!r(t).length;for(var n in t)if(f.call(t,n))return!1;return!0}},function(t,e){t.exports=function(t,e,n,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n}},function(t,e){t.exports=function(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n}},function(t,e,n){var r=n(71),o=n(23),i=n(10),a=n(281),s=n(282);t.exports=function(t){if(null==t)return 0;if(i(t))return a(t)?s(t):t.length;var e=o(t);return"[object Map]"==e||"[object Set]"==e?t.size:r(t).length}},function(t,e,n){var r=n(16),o=n(2),i=n(9);t.exports=function(t){return"string"==typeof t||!o(t)&&i(t)&&"[object String]"==r(t)}},function(t,e,n){var r=n(283),o=n(284),i=n(285);t.exports=function(t){return o(t)?i(t):r(t)}},function(t,e,n){var r=n(120)("length");t.exports=r},function(t,e){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");t.exports=function(t){return n.test(t)}},function(t,e){var n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",o="[^\\ud800-\\udfff]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",s="(?:"+n+"|"+r+")?",u="[\\ufe0e\\ufe0f]?",c=u+s+"(?:\\u200d(?:"+[o,i,a].join("|")+")"+u+s+")*",l="(?:"+[o+n+"?",n,i,a,"[\\ud800-\\udfff]"].join("|")+")",f=RegExp(r+"(?="+r+")|"+l+c,"g");t.exports=function(t){for(var e=f.lastIndex=0;f.test(t);)++e;return e}},function(t,e,n){var r=n(67),o=n(106),i=n(76),a=n(11),s=n(46),u=n(2),c=n(22),l=n(26),f=n(6),h=n(29);t.exports=function(t,e,n){var y=u(t),p=y||c(t)||h(t);if(e=a(e,4),null==n){var d=t&&t.constructor;n=p?y?new d:[]:f(t)&&l(d)?o(s(t)):{}}return(p?r:i)(t,(function(t,r,o){return e(n,t,r,o)})),n}},function(t,e,n){var r=n(80),o=n(51),i=n(292),a=n(129),s=o((function(t){return i(r(t,1,a,!0))}));t.exports=s},function(t,e,n){var r=n(21),o=n(28),i=n(2),a=r?r.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||o(t)||!!(a&&t&&t[a])}},function(t,e){t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},function(t,e,n){var r=n(75),o=n(92),i=n(18),a=o?function(t,e){return o(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:i;t.exports=a},function(t,e){var n=Date.now;t.exports=function(t){var e=0,r=0;return function(){var o=n(),i=16-(o-r);if(r=o,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(113),o=n(293),i=n(297),a=n(114),s=n(298),u=n(78);t.exports=function(t,e,n){var c=-1,l=o,f=t.length,h=!0,y=[],p=y;if(n)h=!1,l=i;else if(f>=200){var d=e?null:s(t);if(d)return u(d);h=!1,l=a,p=new r}else p=e?[]:y;t:for(;++c<f;){var x=t[c],v=e?e(x):x;if(x=n||0!==x?x:0,h&&v==v){for(var g=p.length;g--;)if(p[g]===v)continue t;e&&p.push(v),y.push(x)}else l(p,v,n)||(p!==y&&p.push(v),y.push(x))}return y}},function(t,e,n){var r=n(294);t.exports=function(t,e){return!(null==t||!t.length)&&r(t,e,0)>-1}},function(t,e,n){var r=n(128),o=n(295),i=n(296);t.exports=function(t,e,n){return e==e?i(t,e,n):r(t,o,n)}},function(t,e){t.exports=function(t){return t!=t}},function(t,e){t.exports=function(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}},function(t,e){t.exports=function(t,e,n){for(var r=-1,o=null==t?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}},function(t,e,n){var r=n(102),o=n(299),i=n(78),a=r&&1/i(new r([,-0]))[1]==1/0?function(t){return new r(t)}:o;t.exports=a},function(t,e){t.exports=function(){}},function(t,e,n){var r=n(50);t.exports=function(t,e){return r(e,(function(e){return t[e]}))}},function(t,e){t.exports="2.1.8"},function(t,e,n){var r=n(5),o=n(64);function i(t){return r.map(t.nodes(),(function(e){var n=t.node(e),o=t.parent(e),i={v:e};return r.isUndefined(n)||(i.value=n),r.isUndefined(o)||(i.parent=o),i}))}function a(t){return r.map(t.edges(),(function(e){var n=t.edge(e),o={v:e.v,w:e.w};return r.isUndefined(e.name)||(o.name=e.name),r.isUndefined(n)||(o.value=n),o}))}t.exports={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:i(t),edges:a(t)};return r.isUndefined(t.graph())||(e.value=r.clone(t.graph())),e},read:function(t){var e=new o(t.options).setGraph(t.value);return r.each(t.nodes,(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),r.each(t.edges,(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}}},function(t,e,n){t.exports={components:n(304),dijkstra:n(131),dijkstraAll:n(305),findCycles:n(306),floydWarshall:n(307),isAcyclic:n(308),postorder:n(309),preorder:n(310),prim:n(311),tarjan:n(133),topsort:n(134)}},function(t,e,n){var r=n(5);t.exports=function(t){var e,n={},o=[];function i(o){r.has(n,o)||(n[o]=!0,e.push(o),r.each(t.successors(o),i),r.each(t.predecessors(o),i))}return r.each(t.nodes(),(function(t){e=[],i(t),e.length&&o.push(e)})),o}},function(t,e,n){var r=n(131),o=n(5);t.exports=function(t,e,n){return o.transform(t.nodes(),(function(o,i){o[i]=r(t,i,e,n)}),{})}},function(t,e,n){var r=n(5),o=n(133);t.exports=function(t){return r.filter(o(t),(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))}},function(t,e,n){var r=n(5);t.exports=function(t,e,n){return function(t,e,n){var r={},o=t.nodes();return o.forEach((function(t){r[t]={},r[t][t]={distance:0},o.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var o=n.v===t?n.w:n.v,i=e(n);r[t][o]={distance:i,predecessor:t}}))})),o.forEach((function(t){var e=r[t];o.forEach((function(n){var i=r[n];o.forEach((function(n){var r=i[t],o=e[n],a=i[n],s=r.distance+o.distance;s<a.distance&&(a.distance=s,a.predecessor=o.predecessor)}))}))})),r}(t,e||o,n||function(e){return t.outEdges(e)})};var o=r.constant(1)},function(t,e,n){var r=n(134);t.exports=function(t){try{r(t)}catch(t){if(t instanceof r.CycleException)return!1;throw t}return!0}},function(t,e,n){var r=n(135);t.exports=function(t,e){return r(t,e,"post")}},function(t,e,n){var r=n(135);t.exports=function(t,e){return r(t,e,"pre")}},function(t,e,n){var r=n(5),o=n(64),i=n(132);t.exports=function(t,e){var n,a=new o,s={},u=new i;function c(t){var r=t.v===n?t.w:t.v,o=u.priority(r);if(void 0!==o){var i=e(t);i<o&&(s[r]=n,u.decrease(r,i))}}if(0===t.nodeCount())return a;r.each(t.nodes(),(function(t){u.add(t,Number.POSITIVE_INFINITY),a.setNode(t)})),u.decrease(t.nodes()[0],0);for(var l=!1;u.size()>0;){if(n=u.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(n).forEach(c)}return a}},function(t,e,n){"use strict";var r=n(1),o=n(352),i=n(355),a=n(356),s=n(3).normalizeRanks,u=n(358),c=n(3).removeEmptyRanks,l=n(359),f=n(360),h=n(361),y=n(362),p=n(371),d=n(3),x=n(7).Graph;t.exports=function(t,e){var n=e&&e.debugTiming?d.time:d.notime;n("layout",(function(){var e=n(" buildLayoutGraph",(function(){return function(t){var e=new x({multigraph:!0,compound:!0}),n=C(t.graph());return e.setGraph(r.merge({},g,M(n,v),r.pick(n,m))),r.forEach(t.nodes(),(function(n){var o=C(t.node(n));e.setNode(n,r.defaults(M(o,w),b)),e.setParent(n,t.parent(n))})),r.forEach(t.edges(),(function(n){var o=C(t.edge(n));e.setEdge(n,r.merge({},E,M(o,_),r.pick(o,A)))})),e}(t)}));n(" runLayout",(function(){!function(t,e){e(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep/=2,r.forEach(t.edges(),(function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(t)})),e(" removeSelfEdges",(function(){!function(t){r.forEach(t.edges(),(function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}}))}(t)})),e(" acyclic",(function(){o.run(t)})),e(" nestingGraph.run",(function(){l.run(t)})),e(" rank",(function(){a(d.asNonCompoundGraph(t))})),e(" injectEdgeLabelProxies",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),o={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e};d.addDummyNode(t,"edge-proxy",o,"_ep")}}))}(t)})),e(" removeEmptyRanks",(function(){c(t)})),e(" nestingGraph.cleanup",(function(){l.cleanup(t)})),e(" normalizeRanks",(function(){s(t)})),e(" assignRankMinMax",(function(){!function(t){var e=0;r.forEach(t.nodes(),(function(n){var o=t.node(n);o.borderTop&&(o.minRank=t.node(o.borderTop).rank,o.maxRank=t.node(o.borderBottom).rank,e=r.max(e,o.maxRank))})),t.graph().maxRank=e}(t)})),e(" removeEdgeLabelProxies",(function(){!function(t){r.forEach(t.nodes(),(function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}(t)})),e(" normalize.run",(function(){i.run(t)})),e(" parentDummyChains",(function(){u(t)})),e(" addBorderSegments",(function(){f(t)})),e(" order",(function(){y(t)})),e(" insertSelfEdges",(function(){!function(t){var e=d.buildLayerMatrix(t);r.forEach(e,(function(e){var n=0;r.forEach(e,(function(e,o){var i=t.node(e);i.order=o+n,r.forEach(i.selfEdges,(function(e){d.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:o+ ++n,e:e.e,label:e.label},"_se")})),delete i.selfEdges}))}))}(t)})),e(" adjustCoordinateSystem",(function(){h.adjust(t)})),e(" position",(function(){p(t)})),e(" positionSelfEdges",(function(){!function(t){r.forEach(t.nodes(),(function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),o=r.x+r.width/2,i=r.y,a=n.x-o,s=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:o+2*a/3,y:i-s},{x:o+5*a/6,y:i-s},{x:o+a,y:i},{x:o+5*a/6,y:i+s},{x:o+2*a/3,y:i+s}],n.label.x=n.x,n.label.y=n.y}}))}(t)})),e(" removeBorderNodes",(function(){!function(t){r.forEach(t.nodes(),(function(e){if(t.children(e).length){var n=t.node(e),o=t.node(n.borderTop),i=t.node(n.borderBottom),a=t.node(r.last(n.borderLeft)),s=t.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(i.y-o.y),n.x=a.x+n.width/2,n.y=o.y+n.height/2}})),r.forEach(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}(t)})),e(" normalize.undo",(function(){i.undo(t)})),e(" fixupEdgeLabelCoords",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(t)})),e(" undoCoordinateSystem",(function(){h.undo(t)})),e(" translateGraph",(function(){!function(t){var e=Number.POSITIVE_INFINITY,n=0,o=Number.POSITIVE_INFINITY,i=0,a=t.graph(),s=a.marginx||0,u=a.marginy||0;function c(t){var r=t.x,a=t.y,s=t.width,u=t.height;e=Math.min(e,r-s/2),n=Math.max(n,r+s/2),o=Math.min(o,a-u/2),i=Math.max(i,a+u/2)}r.forEach(t.nodes(),(function(e){c(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.has(n,"x")&&c(n)})),e-=s,o-=u,r.forEach(t.nodes(),(function(n){var r=t.node(n);r.x-=e,r.y-=o})),r.forEach(t.edges(),(function(n){var i=t.edge(n);r.forEach(i.points,(function(t){t.x-=e,t.y-=o})),r.has(i,"x")&&(i.x-=e),r.has(i,"y")&&(i.y-=o)})),a.width=n-e+s,a.height=i-o+u}(t)})),e(" assignNodeIntersects",(function(){!function(t){r.forEach(t.edges(),(function(e){var n,r,o=t.edge(e),i=t.node(e.v),a=t.node(e.w);o.points?(n=o.points[0],r=o.points[o.points.length-1]):(o.points=[],n=a,r=i),o.points.unshift(d.intersectRect(i,n)),o.points.push(d.intersectRect(a,r))}))}(t)})),e(" reversePoints",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))}(t)})),e(" acyclic.undo",(function(){o.undo(t)}))}(e,n)})),n(" updateInputGraph",(function(){!function(t,e){r.forEach(t.nodes(),(function(n){var r=t.node(n),o=e.node(n);r&&(r.x=o.x,r.y=o.y,e.children(n).length&&(r.width=o.width,r.height=o.height))})),r.forEach(t.edges(),(function(n){var o=t.edge(n),i=e.edge(n);o.points=i.points,r.has(i,"x")&&(o.x=i.x,o.y=i.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,e)}))}))};var v=["nodesep","edgesep","ranksep","marginx","marginy"],g={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},m=["acyclicer","ranker","rankdir","align"],w=["width","height"],b={width:0,height:0},_=["minlen","weight","width","height","labeloffset"],E={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},A=["labelpos"];function M(t,e){return r.mapValues(r.pick(t,e),Number)}function C(t){var e={};return r.forEach(t,(function(t,n){e[n.toLowerCase()]=t})),e}},function(t,e,n){var r=n(89);t.exports=function(t){return r(t,5)}},function(t,e,n){var r=n(51),o=n(20),i=n(52),a=n(17),s=Object.prototype,u=s.hasOwnProperty,c=r((function(t,e){t=Object(t);var n=-1,r=e.length,c=r>2?e[2]:void 0;for(c&&i(e[0],e[1],c)&&(r=1);++n<r;)for(var l=e[n],f=a(l),h=-1,y=f.length;++h<y;){var p=f[h],d=t[p];(void 0===d||o(d,s[p])&&!u.call(t,p))&&(t[p]=l[p])}return t}));t.exports=c},function(t,e,n){var r=n(316)(n(317));t.exports=r},function(t,e,n){var r=n(11),o=n(10),i=n(12);t.exports=function(t){return function(e,n,a){var s=Object(e);if(!o(e)){var u=r(n,3);e=i(e),n=function(t){return u(s[t],t,s)}}var c=t(e,n,a);return c>-1?s[u?e[c]:c]:void 0}}},function(t,e,n){var r=n(128),o=n(11),i=n(318),a=Math.max;t.exports=function(t,e,n){var s=null==t?0:t.length;if(!s)return-1;var u=null==n?0:i(n);return u<0&&(u=a(s+u,0)),r(t,o(e,3),u)}},function(t,e,n){var r=n(136);t.exports=function(t){var e=r(t),n=e%1;return e==e?n?e-n:e:0}},function(t,e,n){var r=n(320),o=n(6),i=n(24),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return NaN;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=s.test(t);return n||u.test(t)?c(t.slice(2),n?2:8):a.test(t)?NaN:+t}},function(t,e,n){var r=n(321),o=/^\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(o,""):t}},function(t,e){var n=/\s/;t.exports=function(t){for(var e=t.length;e--&&n.test(t.charAt(e)););return e}},function(t,e,n){var r=n(77),o=n(109),i=n(17);t.exports=function(t,e){return null==t?t:r(t,o(e),i)}},function(t,e){t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},function(t,e,n){var r=n(42),o=n(76),i=n(11);t.exports=function(t,e){var n={};return e=i(e,3),o(t,(function(t,o,i){r(n,o,e(t,o,i))})),n}},function(t,e,n){var r=n(81),o=n(326),i=n(18);t.exports=function(t){return t&&t.length?r(t,i,o):void 0}},function(t,e){t.exports=function(t,e){return t>e}},function(t,e,n){var r=n(328),o=n(332)((function(t,e,n){r(t,e,n)}));t.exports=o},function(t,e,n){var r=n(36),o=n(138),i=n(77),a=n(329),s=n(6),u=n(17),c=n(139);t.exports=function t(e,n,l,f,h){e!==n&&i(n,(function(i,u){if(h||(h=new r),s(i))a(e,n,u,l,t,f,h);else{var y=f?f(c(e,u),i,u+"",e,n,h):void 0;void 0===y&&(y=i),o(e,u,y)}}),u)}},function(t,e,n){var r=n(138),o=n(95),i=n(104),a=n(96),s=n(105),u=n(28),c=n(2),l=n(129),f=n(22),h=n(26),y=n(6),p=n(330),d=n(29),x=n(139),v=n(331);t.exports=function(t,e,n,g,m,w,b){var _=x(t,n),E=x(e,n),A=b.get(E);if(A)r(t,n,A);else{var M=w?w(_,E,n+"",t,e,b):void 0,C=void 0===M;if(C){var k=c(E),N=!k&&f(E),P=!k&&!N&&d(E);M=E,k||N||P?c(_)?M=_:l(_)?M=a(_):N?(C=!1,M=o(E,!0)):P?(C=!1,M=i(E,!0)):M=[]:p(E)||u(E)?(M=_,u(_)?M=v(_):y(_)&&!h(_)||(M=s(E))):C=!1}C&&(b.set(E,M),m(M,E,g,w,b),b.delete(E)),r(t,n,M)}}},function(t,e,n){var r=n(16),o=n(46),i=n(9),a=Function.prototype,s=Object.prototype,u=a.toString,c=s.hasOwnProperty,l=u.call(Object);t.exports=function(t){if(!i(t)||"[object Object]"!=r(t))return!1;var e=o(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==l}},function(t,e,n){var r=n(27),o=n(17);t.exports=function(t){return r(t,o(t))}},function(t,e,n){var r=n(51),o=n(52);t.exports=function(t){return r((function(e,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(i--,a):void 0,s&&o(n[0],n[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++r<i;){var u=n[r];u&&t(e,u,r,a)}return e}))}},function(t,e,n){var r=n(81),o=n(140),i=n(18);t.exports=function(t){return t&&t.length?r(t,i,o):void 0}},function(t,e,n){var r=n(81),o=n(11),i=n(140);t.exports=function(t,e){return t&&t.length?r(t,o(e,2),i):void 0}},function(t,e,n){var r=n(8);t.exports=function(){return r.Date.now()}},function(t,e,n){var r=n(337),o=n(340)((function(t,e){return null==t?{}:r(t,e)}));t.exports=o},function(t,e,n){var r=n(338),o=n(118);t.exports=function(t,e){return r(t,e,(function(e,n){return o(t,n)}))}},function(t,e,n){var r=n(48),o=n(339),i=n(49);t.exports=function(t,e,n){for(var a=-1,s=e.length,u={};++a<s;){var c=e[a],l=r(t,c);n(l,c)&&o(u,i(c,t),l)}return u}},function(t,e,n){var r=n(41),o=n(49),i=n(43),a=n(6),s=n(30);t.exports=function(t,e,n,u){if(!a(t))return t;for(var c=-1,l=(e=o(e,t)).length,f=l-1,h=t;null!=h&&++c<l;){var y=s(e[c]),p=n;if("__proto__"===y||"constructor"===y||"prototype"===y)return t;if(c!=f){var d=h[y];void 0===(p=u?u(d,y,h):void 0)&&(p=a(d)?d:i(e[c+1])?[]:{})}r(h,y,p),h=h[y]}return t}},function(t,e,n){var r=n(137),o=n(126),i=n(127);t.exports=function(t){return i(o(t,void 0,r),t+"")}},function(t,e,n){var r=n(342)();t.exports=r},function(t,e,n){var r=n(343),o=n(52),i=n(136);t.exports=function(t){return function(e,n,a){return a&&"number"!=typeof a&&o(e,n,a)&&(n=a=void 0),e=i(e),void 0===n?(n=e,e=0):n=i(n),a=void 0===a?e<n?1:-1:i(a),r(e,n,a,t)}}},function(t,e){var n=Math.ceil,r=Math.max;t.exports=function(t,e,o,i){for(var a=-1,s=r(n((e-t)/(o||1)),0),u=Array(s);s--;)u[i?s:++a]=t,t+=o;return u}},function(t,e,n){var r=n(80),o=n(345),i=n(51),a=n(52),s=i((function(t,e){if(null==t)return[];var n=e.length;return n>1&&a(t,e[0],e[1])?e=[]:n>2&&a(e[0],e[1],e[2])&&(e=[e[0]]),o(t,r(e,1),[])}));t.exports=s},function(t,e,n){var r=n(50),o=n(48),i=n(11),a=n(124),s=n(346),u=n(44),c=n(347),l=n(18),f=n(2);t.exports=function(t,e,n){e=e.length?r(e,(function(t){return f(t)?function(e){return o(e,1===t.length?t[0]:t)}:t})):[l];var h=-1;e=r(e,u(i));var y=a(t,(function(t,n,o){return{criteria:r(e,(function(e){return e(t)})),index:++h,value:t}}));return s(y,(function(t,e){return c(t,e,n)}))}},function(t,e){t.exports=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}},function(t,e,n){var r=n(348);t.exports=function(t,e,n){for(var o=-1,i=t.criteria,a=e.criteria,s=i.length,u=n.length;++o<s;){var c=r(i[o],a[o]);if(c)return o>=u?c:c*("desc"==n[o]?-1:1)}return t.index-e.index}},function(t,e,n){var r=n(24);t.exports=function(t,e){if(t!==e){var n=void 0!==t,o=null===t,i=t==t,a=r(t),s=void 0!==e,u=null===e,c=e==e,l=r(e);if(!u&&!l&&!a&&t>e||a&&s&&c&&!u&&!l||o&&s&&c||!n&&c||!i)return 1;if(!o&&!a&&!l&&t<e||l&&n&&i&&!o&&!a||u&&n&&i||!s&&i||!c)return-1}return 0}},function(t,e,n){var r=n(117),o=0;t.exports=function(t){var e=++o;return r(t)+e}},function(t,e,n){var r=n(41),o=n(351);t.exports=function(t,e){return o(t||[],e||[],r)}},function(t,e){t.exports=function(t,e,n){for(var r=-1,o=t.length,i=e.length,a={};++r<o;){var s=r<i?e[r]:void 0;n(a,t[r],s)}return a}},function(t,e,n){"use strict";var r=n(1),o=n(353);t.exports={run:function(t){var e="greedy"===t.graph().acyclicer?o(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],n={},o={};return r.forEach(t.nodes(),(function i(a){r.has(o,a)||(o[a]=!0,n[a]=!0,r.forEach(t.outEdges(a),(function(t){r.has(n,t.w)?e.push(t):i(t.w)})),delete n[a])})),e}(t);r.forEach(e,(function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,r.uniqueId("rev"))}))},undo:function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}}},function(t,e,n){var r=n(1),o=n(7).Graph,i=n(354);t.exports=function(t,e){if(t.nodeCount()<=1)return[];var n=function(t,e){var n=new o,a=0,s=0;r.forEach(t.nodes(),(function(t){n.setNode(t,{v:t,in:0,out:0})})),r.forEach(t.edges(),(function(t){var r=n.edge(t.v,t.w)||0,o=e(t),i=r+o;n.setEdge(t.v,t.w,i),s=Math.max(s,n.node(t.v).out+=o),a=Math.max(a,n.node(t.w).in+=o)}));var c=r.range(s+a+3).map((function(){return new i})),l=a+1;return r.forEach(n.nodes(),(function(t){u(c,l,n.node(t))})),{graph:n,buckets:c,zeroIdx:l}}(t,e||a),c=function(t,e,n){for(var r,o=[],i=e[e.length-1],a=e[0];t.nodeCount();){for(;r=a.dequeue();)s(t,e,n,r);for(;r=i.dequeue();)s(t,e,n,r);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(r=e[u].dequeue()){o=o.concat(s(t,e,n,r,!0));break}}return o}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(c,(function(e){return t.outEdges(e.v,e.w)})),!0)};var a=r.constant(1);function s(t,e,n,o,i){var a=i?[]:void 0;return r.forEach(t.inEdges(o.v),(function(r){var o=t.edge(r),s=t.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,u(e,n,s)})),r.forEach(t.outEdges(o.v),(function(r){var o=t.edge(r),i=r.w,a=t.node(i);a.in-=o,u(e,n,a)})),t.removeNode(o.v),a}function u(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}},function(t,e){function n(){var t={};t._next=t._prev=t,this._sentinel=t}function r(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function o(t,e){if("_next"!==t&&"_prev"!==t)return e}t.exports=n,n.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;if(e!==t)return r(e),e},n.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&r(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},n.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,o)),n=n._prev;return"["+t.join(", ")+"]"}},function(t,e,n){"use strict";var r=n(1),o=n(3);t.exports={run:function(t){t.graph().dummyChains=[],r.forEach(t.edges(),(function(e){!function(t,e){var n,r,i,a=e.v,s=t.node(a).rank,u=e.w,c=t.node(u).rank,l=e.name,f=t.edge(e),h=f.labelRank;if(c!==s+1){for(t.removeEdge(e),i=0,++s;s<c;++i,++s)f.points=[],r={width:0,height:0,edgeLabel:f,edgeObj:e,rank:s},n=o.addDummyNode(t,"edge",r,"_d"),s===h&&(r.width=f.width,r.height=f.height,r.dummy="edge-label",r.labelpos=f.labelpos),t.setEdge(a,n,{weight:f.weight},l),0===i&&t.graph().dummyChains.push(n),a=n;t.setEdge(a,u,{weight:f.weight},l)}}(t,e)}))},undo:function(t){r.forEach(t.graph().dummyChains,(function(e){var n,r=t.node(e),o=r.edgeLabel;for(t.setEdge(r.edgeObj,o);r.dummy;)n=t.successors(e)[0],t.removeNode(e),o.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(o.x=r.x,o.y=r.y,o.width=r.width,o.height=r.height),e=n,r=t.node(e)}))}}},function(t,e,n){"use strict";var r=n(53).longestPath,o=n(141),i=n(357);t.exports=function(t){switch(t.graph().ranker){case"network-simplex":default:!function(t){i(t)}(t);break;case"tight-tree":!function(t){r(t),o(t)}(t);break;case"longest-path":a(t)}};var a=r},function(t,e,n){"use strict";var r=n(1),o=n(141),i=n(53).slack,a=n(53).longestPath,s=n(7).alg.preorder,u=n(7).alg.postorder,c=n(3).simplify;function l(t){t=c(t),a(t);var e,n=o(t);for(y(n),f(n,t);e=d(n);)v(n,t,e,x(n,t,e))}function f(t,e){var n=u(t,t.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(t,e,n){var r=t.node(n).parent;t.edge(n,r).cutvalue=h(t,e,n)}(t,e,n)}))}function h(t,e,n){var o=t.node(n).parent,i=!0,a=e.edge(n,o),s=0;return a||(i=!1,a=e.edge(o,n)),s=a.weight,r.forEach(e.nodeEdges(n),(function(r){var a,u,c=r.v===n,l=c?r.w:r.v;if(l!==o){var f=c===i,h=e.edge(r).weight;if(s+=f?h:-h,a=n,u=l,t.hasEdge(a,u)){var y=t.edge(n,l).cutvalue;s+=f?-y:y}}})),s}function y(t,e){arguments.length<2&&(e=t.nodes()[0]),p(t,{},1,e)}function p(t,e,n,o,i){var a=n,s=t.node(o);return e[o]=!0,r.forEach(t.neighbors(o),(function(i){r.has(e,i)||(n=p(t,e,n,i,o))})),s.low=a,s.lim=n++,i?s.parent=i:delete s.parent,n}function d(t){return r.find(t.edges(),(function(e){return t.edge(e).cutvalue<0}))}function x(t,e,n){var o=n.v,a=n.w;e.hasEdge(o,a)||(o=n.w,a=n.v);var s=t.node(o),u=t.node(a),c=s,l=!1;s.lim>u.lim&&(c=u,l=!0);var f=r.filter(e.edges(),(function(e){return l===g(0,t.node(e.v),c)&&l!==g(0,t.node(e.w),c)}));return r.minBy(f,(function(t){return i(e,t)}))}function v(t,e,n,o){var i=n.v,a=n.w;t.removeEdge(i,a),t.setEdge(o.v,o.w,{}),y(t),f(t,e),function(t,e){var n=r.find(t.nodes(),(function(t){return!e.node(t).parent})),o=s(t,n);o=o.slice(1),r.forEach(o,(function(n){var r=t.node(n).parent,o=e.edge(n,r),i=!1;o||(o=e.edge(r,n),i=!0),e.node(n).rank=e.node(r).rank+(i?o.minlen:-o.minlen)}))}(t,e)}function g(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}t.exports=l,l.initLowLimValues=y,l.initCutValues=f,l.calcCutValue=h,l.leaveEdge=d,l.enterEdge=x,l.exchangeEdges=v},function(t,e,n){var r=n(1);t.exports=function(t){var e=function(t){var e={},n=0;return r.forEach(t.children(),(function o(i){var a=n;r.forEach(t.children(i),o),e[i]={low:a,lim:n++}})),e}(t);r.forEach(t.graph().dummyChains,(function(n){for(var r=t.node(n),o=r.edgeObj,i=function(t,e,n,r){var o,i,a=[],s=[],u=Math.min(e[n].low,e[r].low),c=Math.max(e[n].lim,e[r].lim);o=n;do{o=t.parent(o),a.push(o)}while(o&&(e[o].low>u||c>e[o].lim));for(i=o,o=r;(o=t.parent(o))!==i;)s.push(o);return{path:a.concat(s.reverse()),lca:i}}(t,e,o.v,o.w),a=i.path,s=i.lca,u=0,c=a[u],l=!0;n!==o.w;){if(r=t.node(n),l){for(;(c=a[u])!==s&&t.node(c).maxRank<r.rank;)u++;c===s&&(l=!1)}if(!l){for(;u<a.length-1&&t.node(c=a[u+1]).minRank<=r.rank;)u++;c=a[u]}t.setParent(n,c),n=t.successors(n)[0]}}))}},function(t,e,n){var r=n(1),o=n(3);function i(t,e,n,a,s,u,c){var l=t.children(c);if(l.length){var f=o.addBorderNode(t,"_bt"),h=o.addBorderNode(t,"_bb"),y=t.node(c);t.setParent(f,c),y.borderTop=f,t.setParent(h,c),y.borderBottom=h,r.forEach(l,(function(r){i(t,e,n,a,s,u,r);var o=t.node(r),l=o.borderTop?o.borderTop:r,y=o.borderBottom?o.borderBottom:r,p=o.borderTop?a:2*a,d=l!==y?1:s-u[c]+1;t.setEdge(f,l,{weight:p,minlen:d,nestingEdge:!0}),t.setEdge(y,h,{weight:p,minlen:d,nestingEdge:!0})})),t.parent(c)||t.setEdge(e,f,{weight:0,minlen:s+u[c]})}else c!==e&&t.setEdge(e,c,{weight:0,minlen:n})}t.exports={run:function(t){var e=o.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};function n(o,i){var a=t.children(o);a&&a.length&&r.forEach(a,(function(t){n(t,i+1)})),e[o]=i}return r.forEach(t.children(),(function(t){n(t,1)})),e}(t),a=r.max(r.values(n))-1,s=2*a+1;t.graph().nestingRoot=e,r.forEach(t.edges(),(function(e){t.edge(e).minlen*=s}));var u=function(t){return r.reduce(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}(t)+1;r.forEach(t.children(),(function(r){i(t,e,s,u,a,n,r)})),t.graph().nodeRankFactor=s},cleanup:function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,r.forEach(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}}},function(t,e,n){var r=n(1),o=n(3);function i(t,e,n,r,i,a){var s={width:0,height:0,rank:a,borderType:e},u=i[e][a-1],c=o.addDummyNode(t,"border",s,n);i[e][a]=c,t.setParent(c,r),u&&t.setEdge(u,c,{weight:1})}t.exports=function(t){r.forEach(t.children(),(function e(n){var o=t.children(n),a=t.node(n);if(o.length&&r.forEach(o,e),r.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,u=a.maxRank+1;s<u;++s)i(t,"borderLeft","_bl",n,a,s),i(t,"borderRight","_br",n,a,s)}}))}},function(t,e,n){"use strict";var r=n(1);function o(t){r.forEach(t.nodes(),(function(e){i(t.node(e))})),r.forEach(t.edges(),(function(e){i(t.edge(e))}))}function i(t){var e=t.width;t.width=t.height,t.height=e}function a(t){t.y=-t.y}function s(t){var e=t.x;t.x=t.y,t.y=e}t.exports={adjust:function(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||o(t)},undo:function(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){r.forEach(t.nodes(),(function(e){a(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.forEach(n.points,a),r.has(n,"y")&&a(n)}))}(t),"lr"!==e&&"rl"!==e||(function(t){r.forEach(t.nodes(),(function(e){s(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.forEach(n.points,s),r.has(n,"x")&&s(n)}))}(t),o(t))}}},function(t,e,n){"use strict";var r=n(1),o=n(363),i=n(364),a=n(365),s=n(369),u=n(370),c=n(7).Graph,l=n(3);function f(t,e,n){return r.map(e,(function(e){return s(t,e,n)}))}function h(t,e){var n=new c;r.forEach(t,(function(t){var o=t.graph().root,i=a(t,o,n,e);r.forEach(i.vs,(function(e,n){t.node(e).order=n})),u(t,n,i.vs)}))}function y(t,e){r.forEach(e,(function(e){r.forEach(e,(function(e,n){t.node(e).order=n}))}))}t.exports=function(t){var e=l.maxRank(t),n=f(t,r.range(1,e+1),"inEdges"),a=f(t,r.range(e-1,-1,-1),"outEdges"),s=o(t);y(t,s);for(var u,c=Number.POSITIVE_INFINITY,p=0,d=0;d<4;++p,++d){h(p%2?n:a,p%4>=2),s=l.buildLayerMatrix(t);var x=i(t,s);x<c&&(d=0,u=r.cloneDeep(s),c=x)}y(t,u)}},function(t,e,n){"use strict";var r=n(1);t.exports=function(t){var e={},n=r.filter(t.nodes(),(function(e){return!t.children(e).length})),o=r.max(r.map(n,(function(e){return t.node(e).rank}))),i=r.map(r.range(o+1),(function(){return[]})),a=r.sortBy(n,(function(e){return t.node(e).rank}));return r.forEach(a,(function n(o){if(!r.has(e,o)){e[o]=!0;var a=t.node(o);i[a.rank].push(o),r.forEach(t.successors(o),n)}})),i}},function(t,e,n){"use strict";var r=n(1);function o(t,e,n){for(var o=r.zipObject(n,r.map(n,(function(t,e){return e}))),i=r.flatten(r.map(e,(function(e){return r.sortBy(r.map(t.outEdges(e),(function(e){return{pos:o[e.w],weight:t.edge(e).weight}})),"pos")})),!0),a=1;a<n.length;)a<<=1;var s=2*a-1;a-=1;var u=r.map(new Array(s),(function(){return 0})),c=0;return r.forEach(i.forEach((function(t){var e=t.pos+a;u[e]+=t.weight;for(var n=0;e>0;)e%2&&(n+=u[e+1]),u[e=e-1>>1]+=t.weight;c+=t.weight*n}))),c}t.exports=function(t,e){for(var n=0,r=1;r<e.length;++r)n+=o(t,e[r-1],e[r]);return n}},function(t,e,n){var r=n(1),o=n(366),i=n(367),a=n(368);t.exports=function t(e,n,s,u){var c=e.children(n),l=e.node(n),f=l?l.borderLeft:void 0,h=l?l.borderRight:void 0,y={};f&&(c=r.filter(c,(function(t){return t!==f&&t!==h})));var p=o(e,c);r.forEach(p,(function(n){if(e.children(n.v).length){var o=t(e,n.v,s,u);y[n.v]=o,r.has(o,"barycenter")&&(i=n,a=o,r.isUndefined(i.barycenter)?(i.barycenter=a.barycenter,i.weight=a.weight):(i.barycenter=(i.barycenter*i.weight+a.barycenter*a.weight)/(i.weight+a.weight),i.weight+=a.weight))}var i,a}));var d=i(p,s);!function(t,e){r.forEach(t,(function(t){t.vs=r.flatten(t.vs.map((function(t){return e[t]?e[t].vs:t})),!0)}))}(d,y);var x=a(d,u);if(f&&(x.vs=r.flatten([f,x.vs,h],!0),e.predecessors(f).length)){var v=e.node(e.predecessors(f)[0]),g=e.node(e.predecessors(h)[0]);r.has(x,"barycenter")||(x.barycenter=0,x.weight=0),x.barycenter=(x.barycenter*x.weight+v.order+g.order)/(x.weight+2),x.weight+=2}return x}},function(t,e,n){var r=n(1);t.exports=function(t,e){return r.map(e,(function(e){var n=t.inEdges(e);if(n.length){var o=r.reduce(n,(function(e,n){var r=t.edge(n),o=t.node(n.v);return{sum:e.sum+r.weight*o.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:o.sum/o.weight,weight:o.weight}}return{v:e}}))}},function(t,e,n){"use strict";var r=n(1);t.exports=function(t,e){var n={};return r.forEach(t,(function(t,e){var o=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};r.isUndefined(t.barycenter)||(o.barycenter=t.barycenter,o.weight=t.weight)})),r.forEach(e.edges(),(function(t){var e=n[t.v],o=n[t.w];r.isUndefined(e)||r.isUndefined(o)||(o.indegree++,e.out.push(n[t.w]))})),function(t){var e=[];function n(t){return function(e){e.merged||(r.isUndefined(e.barycenter)||r.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&function(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function o(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){var i=t.pop();e.push(i),r.forEach(i.in.reverse(),n(i)),r.forEach(i.out,o(i))}return r.map(r.filter(e,(function(t){return!t.merged})),(function(t){return r.pick(t,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(t){return!t.indegree})))}},function(t,e,n){var r=n(1),o=n(3);function i(t,e,n){for(var o;e.length&&(o=r.last(e)).i<=n;)e.pop(),t.push(o.vs),n++;return n}t.exports=function(t,e){var n,a=o.partition(t,(function(t){return r.has(t,"barycenter")})),s=a.lhs,u=r.sortBy(a.rhs,(function(t){return-t.i})),c=[],l=0,f=0,h=0;s.sort((n=!!e,function(t,e){return t.barycenter<e.barycenter?-1:t.barycenter>e.barycenter?1:n?e.i-t.i:t.i-e.i})),h=i(c,u,h),r.forEach(s,(function(t){h+=t.vs.length,c.push(t.vs),l+=t.barycenter*t.weight,f+=t.weight,h=i(c,u,h)}));var y={vs:r.flatten(c,!0)};return f&&(y.barycenter=l/f,y.weight=f),y}},function(t,e,n){var r=n(1),o=n(7).Graph;t.exports=function(t,e,n){var i=function(t){for(var e;t.hasNode(e=r.uniqueId("_root")););return e}(t),a=new o({compound:!0}).setGraph({root:i}).setDefaultNodeLabel((function(e){return t.node(e)}));return r.forEach(t.nodes(),(function(o){var s=t.node(o),u=t.parent(o);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(a.setNode(o),a.setParent(o,u||i),r.forEach(t[n](o),(function(e){var n=e.v===o?e.w:e.v,i=a.edge(n,o),s=r.isUndefined(i)?0:i.weight;a.setEdge(n,o,{weight:t.edge(e).weight+s})})),r.has(s,"minRank")&&a.setNode(o,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))})),a}},function(t,e,n){var r=n(1);t.exports=function(t,e,n){var o,i={};r.forEach(n,(function(n){for(var r,a,s=t.parent(n);s;){if((r=t.parent(s))?(a=i[r],i[r]=s):(a=o,o=s),a&&a!==s)return void e.setEdge(a,s);s=r}}))}},function(t,e,n){"use strict";var r=n(1),o=n(3),i=n(372).positionX;t.exports=function(t){(function(t){var e=o.buildLayerMatrix(t),n=t.graph().ranksep,i=0;r.forEach(e,(function(e){var o=r.max(r.map(e,(function(e){return t.node(e).height})));r.forEach(e,(function(e){t.node(e).y=i+o/2})),i+=o+n}))})(t=o.asNonCompoundGraph(t)),r.forEach(i(t),(function(e,n){t.node(n).x=e}))}},function(t,e,n){"use strict";var r=n(1),o=n(7).Graph,i=n(3);function a(t,e){var n={};return r.reduce(e,(function(e,o){var i=0,a=0,s=e.length,c=r.last(o);return r.forEach(o,(function(e,l){var f=function(t,e){if(t.node(e).dummy)return r.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),h=f?t.node(f).order:s;(f||e===c)&&(r.forEach(o.slice(a,l+1),(function(e){r.forEach(t.predecessors(e),(function(r){var o=t.node(r),a=o.order;!(a<i||h<a)||o.dummy&&t.node(e).dummy||u(n,r,e)}))})),a=l+1,i=h)})),o})),n}function s(t,e){var n={};function o(e,o,i,a,s){var c;r.forEach(r.range(o,i),(function(o){c=e[o],t.node(c).dummy&&r.forEach(t.predecessors(c),(function(e){var r=t.node(e);r.dummy&&(r.order<a||r.order>s)&&u(n,e,c)}))}))}return r.reduce(e,(function(e,n){var i,a=-1,s=0;return r.forEach(n,(function(r,u){if("border"===t.node(r).dummy){var c=t.predecessors(r);c.length&&(i=t.node(c[0]).order,o(n,s,u,a,i),s=u,a=i)}o(n,s,n.length,i,e.length)})),n})),n}function u(t,e,n){if(e>n){var r=e;e=n,n=r}var o=t[e];o||(t[e]=o={}),o[n]=!0}function c(t,e,n){if(e>n){var o=e;e=n,n=o}return r.has(t[e],n)}function l(t,e,n,o){var i={},a={},s={};return r.forEach(e,(function(t){r.forEach(t,(function(t,e){i[t]=t,a[t]=t,s[t]=e}))})),r.forEach(e,(function(t){var e=-1;r.forEach(t,(function(t){var u=o(t);if(u.length){u=r.sortBy(u,(function(t){return s[t]}));for(var l=(u.length-1)/2,f=Math.floor(l),h=Math.ceil(l);f<=h;++f){var y=u[f];a[t]===t&&e<s[y]&&!c(n,t,y)&&(a[y]=t,a[t]=i[t]=i[y],e=s[y])}}}))})),{root:i,align:a}}function f(t,e,n,i,a){var s={},u=function(t,e,n,i){var a=new o,s=t.graph(),u=function(t,e,n){return function(o,i,a){var s,u=o.node(i),c=o.node(a),l=0;if(l+=u.width/2,r.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=-u.width/2;break;case"r":s=u.width/2}if(s&&(l+=n?s:-s),s=0,l+=(u.dummy?e:t)/2,l+=(c.dummy?e:t)/2,l+=c.width/2,r.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":s=c.width/2;break;case"r":s=-c.width/2}return s&&(l+=n?s:-s),s=0,l}}(s.nodesep,s.edgesep,i);return r.forEach(e,(function(e){var o;r.forEach(e,(function(e){var r=n[e];if(a.setNode(r),o){var i=n[o],s=a.edge(i,r);a.setEdge(i,r,Math.max(u(t,e,o),s||0))}o=e}))})),a}(t,e,n,a),c=a?"borderLeft":"borderRight";function l(t,e){for(var n=u.nodes(),r=n.pop(),o={};r;)o[r]?t(r):(o[r]=!0,n.push(r),n=n.concat(e(r))),r=n.pop()}return l((function(t){s[t]=u.inEdges(t).reduce((function(t,e){return Math.max(t,s[e.v]+u.edge(e))}),0)}),u.predecessors.bind(u)),l((function(e){var n=u.outEdges(e).reduce((function(t,e){return Math.min(t,s[e.w]-u.edge(e))}),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==c&&(s[e]=Math.max(s[e],n))}),u.successors.bind(u)),r.forEach(i,(function(t){s[t]=s[n[t]]})),s}function h(t,e){return r.minBy(r.values(e),(function(e){var n=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return r.forIn(e,(function(e,r){var i=function(t,e){return t.node(e).width}(t,r)/2;n=Math.max(e+i,n),o=Math.min(e-i,o)})),n-o}))}function y(t,e){var n=r.values(e),o=r.min(n),i=r.max(n);r.forEach(["u","d"],(function(n){r.forEach(["l","r"],(function(a){var s,u=n+a,c=t[u];if(c!==e){var l=r.values(c);(s="l"===a?o-r.min(l):i-r.max(l))&&(t[u]=r.mapValues(c,(function(t){return t+s})))}}))}))}function p(t,e){return r.mapValues(t.ul,(function(n,o){if(e)return t[e.toLowerCase()][o];var i=r.sortBy(r.map(t,o));return(i[1]+i[2])/2}))}t.exports={positionX:function(t){var e,n=i.buildLayerMatrix(t),o=r.merge(a(t,n),s(t,n)),u={};r.forEach(["u","d"],(function(i){e="u"===i?n:r.values(n).reverse(),r.forEach(["l","r"],(function(n){"r"===n&&(e=r.map(e,(function(t){return r.values(t).reverse()})));var a=("u"===i?t.predecessors:t.successors).bind(t),s=l(0,e,o,a),c=f(t,e,s.root,s.align,"r"===n);"r"===n&&(c=r.mapValues(c,(function(t){return-t}))),u[i+n]=c}))}));var c=h(t,u);return y(u,c),p(u,t.graph().align)},findType1Conflicts:a,findType2Conflicts:s,addConflict:u,hasConflict:c,verticalAlignment:l,horizontalCompaction:f,alignCoordinates:y,findSmallestWidthAlignment:h,balance:p}},function(t,e,n){var r=n(1),o=n(3),i=n(7).Graph;t.exports={debugOrdering:function(t){var e=o.buildLayerMatrix(t),n=new i({compound:!0,multigraph:!0}).setGraph({});return r.forEach(t.nodes(),(function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)})),r.forEach(t.edges(),(function(t){n.setEdge(t.v,t.w,{},t.name)})),r.forEach(e,(function(t,e){var o="layer"+e;n.setNode(o,{rank:"same"}),r.reduce(t,(function(t,e){return n.setEdge(t,e,{style:"invis"}),e}))})),n}}},function(t,e){t.exports="0.8.5"},function(t,e,n){var r=n(31).Point2D,o=n(31).Vector2D,i=n(31).Matrix2D,a=n(142).Polynomial,s=n(144),u=n(145),c=n(380),l=s.TYPE;function f(t,e){if(0!==t.length&&0!==e.length)for(var n,r=function(t,e){return t<e.x&&(t=e.x),t<e.y&&(t=e.y),t},o=t.reduce(r,0),i=100*(o=e.reduce(r,o))*1e-15*Math.SQRT2,a=0;a<t.length;){for(n=0;n<e.length;n++)if(t[a].distanceFrom(e[n])<=i){t.splice(a,1);break}n==e.length&&a++}}var h={intersectPathShape:function(t,e,n,r){for(var o,i,a,s=new u,c=t.params[0],l=0;l<c.length;l++)a=p(c[l],e,n,r),o||(o=a),i&&(f(i.points,a.points),s.appendPoints(i.points)),i=a;return i&&s.appendPoints(i.points),s},intersectLinesShape:function(t,e,n,r,o){var i,a,c=s.TYPE,l=t.params[0],h=new s(c.LINE,[0,0]),y=new u,d=function(t,o){h.params[0]=l[t],h.params[1]=l[o],f((i=p(h,e,n,r)).points,[l[o]]),y.appendPoints(i.points)};for(a=0;a<l.length-1;a++)d(a,a+1);return(void 0!==o&&o||t.type===c.RECT||t.type===c.POLYGON)&&d(l.length-1,0),y},intersectArcShape:function(t,e,n,a){n=n||i.IDENTITY,a=a||i.IDENTITY;var u,c=t.params[0],l=t.params[1],f=t.params[2],h=t.params[3],y=t.params[4],d=t.params[5];return n.isIdentity()&&0===h||(n=n.multiply(i.IDENTITY.translate(c.x,c.y).rotate(h)),c=new r(0,0),h=0),u=function(t,e,n,r,a,s,u,c){if(0===t.points.length)return t;if(c&&!c.isIdentity())var l=c.inverse();var f=[],h=new o(1,0),y=2*Math.PI,p=u<0,d=Math.abs(u)>Math.PI,x=(new i).scaleNonUniform(1,r/n).rotate(s),v=(new i).scaleNonUniform(1,r/n).rotate(s+u);s=(h.angleBetween(h.transform(x))+y)%y,u=h.transform(x).angleBetween(h.transform(v)),u=(d?y-Math.abs(u):Math.abs(u))*(p?-1:1);for(var g,m,w=(new i).rotate(a).multiply(x),b=0;b<t.points.length;b++)g=t.points[b],m=h.transform(w).angleBetween(o.fromPoints(e,l?g.transform(l):g)),u>=0?(m=(m+2*y)%y)<=u&&f.push(g):(m=(m-2*y)%y)>=u&&f.push(g);return t.points=f,t}(u=p(s.newEllipse(c,l,f),e,n,a),c,l,f,h,y,d,n),u},intersectEllipseEllipse:function(t,e,n,o,i,s){var c,l,f,h,y,p,d,x,v,g,m,w,b=[n*n,0,e*e,-2*n*n*t.x,-2*e*e*t.y,n*n*t.x*t.x+e*e*t.y*t.y-e*e*n*n],_=[s*s,0,i*i,-2*s*s*o.x,-2*i*i*o.y,s*s*o.x*o.x+i*i*o.y*o.y-i*i*s*s],E=(f=(c=b)[0]*(l=_)[1]-l[0]*c[1],new a(f*(x=c[1]*l[2]-l[1]*c[2])-(h=c[0]*l[2]-l[0]*c[2])*h,f*(m=c[1]*l[4]-l[1]*c[4]-(c[2]*l[3]-l[2]*c[3]))+(y=c[0]*l[3]-l[0]*c[3])*x-2*h*(p=c[0]*l[4]-l[0]*c[4]),f*(g=c[1]*l[5]-l[1]*c[5]+(c[3]*l[4]-l[3]*c[4]))+y*m-p*p-2*h*(d=c[0]*l[5]-l[0]*c[5]),f*(v=c[3]*l[5]-l[3]*c[5])+y*g-2*p*d,y*v-d*d)),A=E.getRoots(),M=.001*(b[0]*b[0]+2*b[1]*b[1]+b[2]*b[2]),C=.001*(_[0]*_[0]+2*_[1]*_[1]+_[2]*_[2]),k=new u,N=function(t,e,n){return Math.max(e,Math.min(n,t))};for(w=0;w<A.length;w++)A[w]=N(A[w],t.y-n,t.y+n),A[w]=N(A[w],o.y-s,o.y+s);A.sort((function(t,e){return t-e}));for(var P=[],O=0;O<A.length;O++){var S=new a(b[0],b[3]+A[O]*b[1],b[5]+A[O]*(b[4]+A[O]*b[2]));Math.abs(S.coefs[0])<10*1e-15*Math.abs(S.coefs[2])&&(S.coefs[0]=0);var T=S.getRoots();P.push(0);for(var j=0;j<T.length;j++){var I=(b[0]*T[j]+b[1]*A[O]+b[3])*T[j]+(b[2]*A[O]+b[4])*A[O]+b[5];Math.abs(I)<M&&(I=(_[0]*T[j]+_[1]*A[O]+_[3])*T[j]+(_[2]*A[O]+_[4])*A[O]+_[5],Math.abs(I)<C&&(k.appendPoint(new r(T[j],A[O])),P[O]+=1))}}if(k.points.length<=0)return k;var R=k.points;if(8==R.length)(R=R.splice(0,6)).splice(2,2);else if(7==R.length)(R=R.splice(0,6)).splice(2,2),R.splice(P.indexOf(1),1);else if(6==R.length)R.splice(2,2),P.indexOf(0)>-1?R[0].distanceFrom(R[1])<R[2].distanceFrom(R[3])?R.splice(0,1):R.splice(2,1):P[0]==P[3]&&R.splice(1,2);else if(4==R.length)(2==A.length||4==A.length&&(2==P[0]&&2==P[1]||2==P[2]&&2==P[3]))&&R.splice(2,2);else if((3==R.length||5==R.length)&&(w=P.indexOf(2))>-1){3==R.length&&(w%=2);var L,B,D,z=w+(w%2?-1:2);L=R[w].distanceFrom(R[w+1]),B=R[w].distanceFrom(R[z]),D=R[w+1].distanceFrom(R[z]),L<B&&L<D?R.splice(w,1):R.splice(z,1)}var U=E.zeroErrorEstimate();for(U*=100*Math.SQRT2,w=0;w<R.length-1;)R[w].distanceFrom(R[w+1])<U?R.splice(w+1,1):w++;return k.points=R,k},intersectEllipseLine:function(t,e,n,r,i){var a,s=new o(r.x,r.y),c=o.fromPoints(r,i),l=new o(t.x,t.y),f=s.subtract(l),h=new o(c.x/(e*e),c.y/(n*n)),y=new o(f.x/(e*e),f.y/(n*n)),p=c.dot(h),d=c.dot(y),x=d*d-p*(t=f.dot(y)-1),v=1e-15,g=10*Math.max(Math.abs(p),Math.abs(d),Math.abs(t))*v;if(Math.abs(x)<g&&(x=0),x<0)a=new u("Outside");else if(x>0){var m=Math.sqrt(x),w=(-d-m)/p,b=(-d+m)/p;b=b>1?b-v:b<0?b+v:b,((w=w>1?w-v:w<0?w+v:w)<0||1<w)&&(b<0||1<b)?a=new u(w<0&&b<0||w>1&&b>1?"Outside":"Inside"):(a=new u,0<=w&&w<=1&&a.appendPoint(r.lerp(i,w)),0<=b&&b<=1&&a.appendPoint(r.lerp(i,b)))}else{var _=-d/p;0<=_&&_<=1?(a=new u).appendPoint(r.lerp(i,_)):a=new u("Outside")}return a},intersectLineLine:function(t,e,n,o){var i,a=(o.x-n.x)*(t.y-n.y)-(o.y-n.y)*(t.x-n.x),s=(e.x-t.x)*(t.y-n.y)-(e.y-t.y)*(t.x-n.x),c=(o.y-n.y)*(e.x-t.x)-(o.x-n.x)*(e.y-t.y);if(0!==c){var l=a/c,f=s/c;0<=l&&l<=1&&0<=f&&f<=1?(i=new u).points.push(new r(t.x+l*(e.x-t.x),t.y+l*(e.y-t.y))):i=new u}else i=new u(0===a||0===s?"Coincident":"Parallel");return i},intersectRayRay:function(t,e,n,o){var i,a=(o.x-n.x)*(t.y-n.y)-(o.y-n.y)*(t.x-n.x),s=(e.x-t.x)*(t.y-n.y)-(e.y-t.y)*(t.x-n.x),c=(o.y-n.y)*(e.x-t.x)-(o.x-n.x)*(e.y-t.y);if(0!==c){var l=a/c;(i=new u).points.push(new r(t.x+l*(e.x-t.x),t.y+l*(e.y-t.y)))}else i=new u(0===a||0===s?"Coincident":"Parallel");return i}},y={};function p(t,e,n,o){var a,s,c=t,f=e;if(null!==c&&null!==f)if(s=y[c.type])a=s(c,f,n,o);else if(s=y[f.type])a=s(f,c,o,n);else{var p,d,x,v,g;c.type===l.CIRCLE?(d=[c.params[0],c.params[1],c.params[1]],v=l.ELLIPSE):(d=c.params.slice(),v=c.type),f.type===l.CIRCLE?(x=[f.params[0],f.params[1],f.params[1]],g=l.ELLIPSE):(x=f.params.slice(),g=f.type);var m,w=n instanceof i&&o instanceof i;if(w)if(v===l.ELLIPSE&&g===l.ELLIPSE){var b,_,E,A=d[0],M=d[1],C=d[2],k=x[0],N=x[1],P=x[2];n=n.multiply(i.IDENTITY.translate(A.x,A.y).scaleNonUniform(M/1,C/1)),A=new r(0,0),M=C=1,o=o.multiply(i.IDENTITY.translate(k.x,k.y).scaleNonUniform(N,P)),k=new r(0,0),N=P=1,b=(E=n.inverse().multiply(o).getDecomposition()).rotation.inverse().multiply(E.translation.inverse()),N=(_=E.scale).a,P=_.d,A=A.transform(b),m=n.multiply(b.inverse()),d[0]=A,d[1]=M,d[2]=C,x[0]=k,x[1]=N,x[2]=P}else{var O,S=function(t,e,n){var r=function(t){e[t]=e[t].transform(n)};if(t===l.LINE)r(0),r(1);else if(t===l.BEZIER2)r(0),r(1),r(2);else{if(t!==l.BEZIER3)throw new Error("Unknown shape: "+t);r(0),r(1),r(2),r(3)}};g===l.ELLIPSE&&(O=x,x=d,d=O,O=g,g=v,v=O,O=o,o=n,n=O),v===l.ELLIPSE?(A=d[0],M=d[1],C=d[2],n=n.multiply(i.IDENTITY.translate(A.x,A.y).scaleNonUniform(M/1,C/1)),A=new r(0,0),M=C=1,S(g,x,_=n.inverse().multiply(o)),m=n,d[0]=A,d[1]=M,d[2]=C):(S(v,d,n),S(g,x,o),m=i.IDENTITY)}if(v<g?(s="intersect"+v+g,p=d.concat(x)):(s="intersect"+g+v,p=x.concat(d)),a=h[s].apply(null,p),w)for(var T=0;T<a.points.length;T++)a.points[T]=a.points[T].transform(m)}else a=new u;return a}for(var d in y[l.PATH]=h.intersectPathShape,y[l.POLYLINE]=h.intersectLinesShape,y[l.POLYGON]=h.intersectLinesShape,y[l.RECT]=h.intersectLinesShape,y[l.ROUNDRECT]=h.intersectPathShape,y[l.ARC]=h.intersectArcShape,c)c.hasOwnProperty(d)&&(h[d]=c[d]);t.exports=p},function(t,e,n){function r(t,e){Object.defineProperties(this,{x:{value:t,writable:!1,enumerable:!0,configurable:!1},y:{value:e,writable:!1,enumerable:!0,configurable:!1}})}r.prototype.clone=function(){return new this.constructor(this.x,this.y)},r.prototype.add=function(t){return new this.constructor(this.x+t.x,this.y+t.y)},r.prototype.subtract=function(t){return new this.constructor(this.x-t.x,this.y-t.y)},r.prototype.multiply=function(t){return new this.constructor(this.x*t,this.y*t)},r.prototype.divide=function(t){return new this.constructor(this.x/t,this.y/t)},r.prototype.equals=function(t){return this.x===t.x&&this.y===t.y},r.prototype.lerp=function(t,e){var n=1-e;return new this.constructor(this.x*n+t.x*e,this.y*n+t.y*e)},r.prototype.distanceFrom=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},r.prototype.min=function(t){return new this.constructor(Math.min(this.x,t.x),Math.min(this.y,t.y))},r.prototype.max=function(t){return new this.constructor(Math.max(this.x,t.x),Math.max(this.y,t.y))},r.prototype.transform=function(t){return new this.constructor(t.a*this.x+t.c*this.y+t.e,t.b*this.x+t.d*this.y+t.f)},r.prototype.toString=function(){return"point("+this.x+","+this.y+")"},t.exports=r},function(t,e,n){function r(t,e){Object.defineProperties(this,{x:{value:t,writable:!1,enumerable:!0,configurable:!1},y:{value:e,writable:!1,enumerable:!0,configurable:!1}})}r.fromPoints=function(t,e){return new r(e.x-t.x,e.y-t.y)},r.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},r.prototype.magnitude=function(){return this.x*this.x+this.y*this.y},r.prototype.dot=function(t){return this.x*t.x+this.y*t.y},r.prototype.cross=function(t){return this.x*t.y-this.y*t.x},r.prototype.determinant=function(t){return this.x*t.y-this.y*t.x},r.prototype.unit=function(){return this.divide(this.length())},r.prototype.add=function(t){return new this.constructor(this.x+t.x,this.y+t.y)},r.prototype.subtract=function(t){return new this.constructor(this.x-t.x,this.y-t.y)},r.prototype.multiply=function(t){return new this.constructor(this.x*t,this.y*t)},r.prototype.divide=function(t){return new this.constructor(this.x/t,this.y/t)},r.prototype.angleBetween=function(t){var e=this.dot(t)/(this.length()*t.length());e=Math.max(-1,Math.min(e,1));var n=Math.acos(e);return this.cross(t)<0?-n:n},r.prototype.perp=function(){return new this.constructor(-this.y,this.x)},r.prototype.perpendicular=function(t){return this.subtract(this.project(t))},r.prototype.project=function(t){var e=this.dot(t)/t.dot(t);return t.multiply(e)},r.prototype.transform=function(t){return new this.constructor(t.a*this.x+t.c*this.y,t.b*this.x+t.d*this.y)},r.prototype.equals=function(t){return this.x===t.x&&this.y===t.y},r.prototype.toString=function(){return"vector("+this.x+","+this.y+")"},t.exports=r},function(t,e,n){function r(t,e,n,r,o,i){Object.defineProperties(this,{a:{value:void 0!==t?t:1,writable:!1,enumerable:!0,configurable:!1},b:{value:void 0!==e?e:0,writable:!1,enumerable:!0,configurable:!1},c:{value:void 0!==n?n:0,writable:!1,enumerable:!0,configurable:!1},d:{value:void 0!==r?r:1,writable:!1,enumerable:!0,configurable:!1},e:{value:void 0!==o?o:0,writable:!1,enumerable:!0,configurable:!1},f:{value:void 0!==i?i:0,writable:!1,enumerable:!0,configurable:!1}})}r.IDENTITY=new r(1,0,0,1,0,0),r.IDENTITY.isIdentity=function(){return!0},r.prototype.multiply=function(t){return this.isIdentity()?t:t.isIdentity()?this:new this.constructor(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.e+this.c*t.f+this.e,this.b*t.e+this.d*t.f+this.f)},r.prototype.inverse=function(){if(this.isIdentity())return this;var t=this.a*this.d-this.b*this.c;if(0===t)throw"Matrix is not invertible";var e=1/t,n=this.f*this.c-this.e*this.d,r=this.e*this.b-this.f*this.a;return new this.constructor(this.d*e,-this.b*e,-this.c*e,this.a*e,n*e,r*e)},r.prototype.translate=function(t,e){return new this.constructor(this.a,this.b,this.c,this.d,this.a*t+this.c*e+this.e,this.b*t+this.d*e+this.f)},r.prototype.scale=function(t){return new this.constructor(this.a*t,this.b*t,this.c*t,this.d*t,this.e,this.f)},r.prototype.scaleAt=function(t,e){var n=e.x-t*e.x,r=e.y-t*e.y;return new this.constructor(this.a*t,this.b*t,this.c*t,this.d*t,this.a*n+this.c*r+this.e,this.b*n+this.d*r+this.f)},r.prototype.scaleNonUniform=function(t,e){return new this.constructor(this.a*t,this.b*t,this.c*e,this.d*e,this.e,this.f)},r.prototype.scaleNonUniformAt=function(t,e,n){var r=n.x-t*n.x,o=n.y-e*n.y;return new this.constructor(this.a*t,this.b*t,this.c*e,this.d*e,this.a*r+this.c*o+this.e,this.b*r+this.d*o+this.f)},r.prototype.rotate=function(t){var e=Math.cos(t),n=Math.sin(t);return new this.constructor(this.a*e+this.c*n,this.b*e+this.d*n,this.a*-n+this.c*e,this.b*-n+this.d*e,this.e,this.f)},r.prototype.rotateAt=function(t,e){var n=Math.cos(t),r=Math.sin(t),o=-e.x+e.x*n-e.y*r,i=-e.y+e.y*n+e.x*r;return new this.constructor(this.a*n+this.c*r,this.b*n+this.d*r,this.a*-r+this.c*n,this.b*-r+this.d*n,this.a*o+this.c*i+this.e,this.b*o+this.d*i+this.f)},r.prototype.rotateFromVector=function(t){var e=t.unit(),n=e.x,r=e.y;return new this.constructor(this.a*n+this.c*r,this.b*n+this.d*r,this.a*-r+this.c*n,this.b*-r+this.d*n,this.e,this.f)},r.prototype.flipX=function(){return new this.constructor(-this.a,-this.b,this.c,this.d,this.e,this.f)},r.prototype.flipY=function(){return new this.constructor(this.a,this.b,-this.c,-this.d,this.e,this.f)},r.prototype.skewX=function(t){var e=Math.tan(t);return new this.constructor(this.a,this.b,this.a*e+this.c,this.b*e+this.d,this.e,this.f)},r.prototype.skewY=function(t){var e=Math.tan(t);return new this.constructor(this.a+this.c*e,this.b+this.d*e,this.c,this.d,this.e,this.f)},r.prototype.isIdentity=function(){return 1===this.a&&0===this.b&&0===this.c&&1===this.d&&0===this.e&&0===this.f},r.prototype.isInvertible=function(){return this.a*this.d-this.b*this.c!=0},r.prototype.getScale=function(){return{scaleX:Math.sqrt(this.a*this.a+this.c*this.c),scaleY:Math.sqrt(this.b*this.b+this.d*this.d)}},r.prototype.getDecomposition=function(){var t=.5*(this.a+this.d),e=.5*(this.a-this.d),n=.5*(this.b+this.c),r=.5*(this.b-this.c),o=Math.sqrt(t*t+r*r),i=Math.sqrt(e*e+n*n),a=o+i,s=o-i,u=Math.atan2(n,e),c=Math.atan2(r,t),l=.5*(c-u),f=.5*(c+u);return{translation:new this.constructor(1,0,0,1,this.e,this.f),rotation:this.constructor.IDENTITY.rotate(f),scale:new this.constructor(a,0,0,s,0,0),rotation0:this.constructor.IDENTITY.rotate(l)}},r.prototype.equals=function(t){return this.a===t.a&&this.b===t.b&&this.c===t.c&&this.d===t.d&&this.e===t.e&&this.f===t.f},r.prototype.toString=function(){return"matrix("+[this.a,this.b,this.c,this.d,this.e,this.f].join(",")+")"},t.exports=r},function(t,e,n){var r=n(143);function o(){this.init(arguments)}o.VERSION=1,o.prototype=new r,o.prototype.constructor=o,o.superclass=r.prototype,o.prototype.eval=function(t){var e=o.superclass.eval.call(this,t);if(Math.abs(e)<1e-7&&(e=0),e<0)throw new Error("SqrtPolynomial.eval: cannot take square root of negative number");return Math.sqrt(e)},o.prototype.toString=function(){return"sqrt("+o.superclass.toString.call(this)+")"},t.exports=o},function(t,e,n){var r=n(145),o=n(31),i=o.Point2D,a=o.Vector2D,s=n(142).Polynomial;function u(t){t.sort((function(t,e){return t-e}));for(var e=1;e<t.length;)Math.abs(t[e]-t[e-1])<1e-15?t.splice(e,1):e++}t.exports={},t.exports.intersectBezier2Bezier2=function(t,e,n,o,a,u){var c,l,f,h,y,p,d,x,v,g,m,w,b,_,E,A,M=new r;c=e.multiply(-2),f=t.add(c.add(n)),c=t.multiply(-2),l=e.multiply(2),h=c.add(l),y=new i(t.x,t.y),c=a.multiply(-2),p=o.add(c.add(u)),c=o.multiply(-2),l=a.multiply(2),d=c.add(l),x=new i(o.x,o.y),0===f.y?(w=(g=f.x*(y.y-x.y))+(m=g-h.x*h.y),b=h.y*h.y,v=new s(f.x*p.y*p.y,2*f.x*d.y*p.y,f.x*d.y*d.y-p.x*b-p.y*g-p.y*m,-d.x*b-d.y*g-d.y*m,(y.x-x.x)*b+(y.y-x.y)*m)):(g=f.x*p.y-f.y*p.x,m=f.x*d.y-d.x*f.y,w=h.x*f.y-h.y*f.x,b=y.y-x.y,_=f.y*(y.x-x.x)-f.x*b,E=-h.y*w+f.y*_,A=w*w,v=new s(g*g,2*g*m,(-p.y*A+f.y*m*m+f.y*g*_+g*E)/f.y,(-d.y*A+f.y*m*_+m*E)/f.y,(b*A+_*E)/f.y));for(var C=v.getRoots(),k=0;k<C.length;k++){var N=C[k];if(0<=N&&N<=1){var P=new s(f.x,h.x,y.x-x.x-N*d.x-N*N*p.x).getRoots(),O=new s(f.y,h.y,y.y-x.y-N*d.y-N*N*p.y).getRoots();if(P.length>0&&O.length>0)t:for(var S=0;S<P.length;S++){var T=P[S];if(0<=T&&T<=1)for(var j=0;j<O.length;j++)if(Math.abs(T-O[j])<1e-4){M.points.push(p.multiply(N*N).add(d.multiply(N).add(x)));break t}}}}return M},t.exports.intersectBezier2Bezier3=function(t,e,n,o,c,l,f){var h,y,p,d,x,v,g,m,w,b,_,E=new r;h=e.multiply(-2),x=t.add(h.add(n)),h=t.multiply(-2),y=e.multiply(2),v=h.add(y),g=new i(t.x,t.y),h=o.multiply(-1),y=c.multiply(3),p=l.multiply(-3),d=h.add(y.add(p.add(f))),m=new a(d.x,d.y),h=o.multiply(3),y=c.multiply(-6),p=l.multiply(3),d=h.add(y.add(p)),w=new a(d.x,d.y),h=o.multiply(-3),y=c.multiply(3),p=h.add(y),b=new a(p.x,p.y),_=new a(o.x,o.y);var A=g.x*g.x,M=g.y*g.y,C=v.x*v.x,k=v.y*v.y,N=x.x*x.x,P=x.y*x.y,O=_.x*_.x,S=_.y*_.y,T=b.x*b.x,j=b.y*b.y,I=w.x*w.x,R=w.y*w.y,L=m.x*m.x,B=m.y*m.y,D=new s(-2*x.x*x.y*m.x*m.y+N*B+P*L,-2*x.x*x.y*w.x*m.y-2*x.x*x.y*w.y*m.x+2*P*w.x*m.x+2*N*w.y*m.y,-2*x.x*b.x*x.y*m.y-2*x.x*x.y*b.y*m.x-2*x.x*x.y*w.x*w.y+2*b.x*P*m.x+P*I+N*(2*b.y*m.y+R),2*g.x*x.x*x.y*m.y+2*g.y*x.x*x.y*m.x+v.x*v.y*x.x*m.y+v.x*v.y*x.y*m.x-2*_.x*x.x*x.y*m.y-2*x.x*_.y*x.y*m.x-2*x.x*b.x*x.y*w.y-2*x.x*x.y*b.y*w.x-2*g.x*P*m.x-2*g.y*N*m.y+2*_.x*P*m.x+2*b.x*P*w.x-k*x.x*m.x-C*x.y*m.y+N*(2*_.y*m.y+2*b.y*w.y),2*g.x*x.x*x.y*w.y+2*g.y*x.x*x.y*w.x+v.x*v.y*x.x*w.y+v.x*v.y*x.y*w.x-2*_.x*x.x*x.y*w.y-2*x.x*_.y*x.y*w.x-2*x.x*b.x*x.y*b.y-2*g.x*P*w.x-2*g.y*N*w.y+2*_.x*P*w.x-k*x.x*w.x-C*x.y*w.y+T*P+N*(2*_.y*w.y+j),2*g.x*x.x*x.y*b.y+2*g.y*x.x*b.x*x.y+v.x*v.y*x.x*b.y+v.x*v.y*b.x*x.y-2*_.x*x.x*x.y*b.y-2*x.x*_.y*b.x*x.y-2*g.x*b.x*P-2*g.y*N*b.y+2*_.x*b.x*P-k*x.x*b.x-C*x.y*b.y+2*N*_.y*b.y,-2*g.x*g.y*x.x*x.y-g.x*v.x*v.y*x.y-g.y*v.x*v.y*x.x+2*g.x*x.x*_.y*x.y+2*g.y*_.x*x.x*x.y+v.x*_.x*v.y*x.y+v.x*v.y*x.x*_.y-2*_.x*x.x*_.y*x.y-2*g.x*_.x*P+g.x*k*x.x+g.y*C*x.y-2*g.y*N*_.y-_.x*k*x.x-C*_.y*x.y+A*P+M*N+O*P+N*S).getRootsInInterval(0,1);u(D);for(var z=0;z<D.length;z++){var U=D[z],F=new s(x.x,v.x,g.x-_.x-U*b.x-U*U*w.x-U*U*U*m.x).getRoots(),q=new s(x.y,v.y,g.y-_.y-U*b.y-U*U*w.y-U*U*U*m.y).getRoots();if(F.length>0&&q.length>0)t:for(var Y=0;Y<F.length;Y++){var V=F[Y];if(0<=V&&V<=1)for(var H=0;H<q.length;H++)if(Math.abs(V-q[H])<1e-4){var X=m.multiply(U*U*U).add(w.multiply(U*U).add(b.multiply(U).add(_)));E.points.push(new i(X.x,X.y));break t}}}return E},t.exports.intersectBezier2Ellipse=function(t,e,n,o,a,u){var c,l,f,h,y,p=new r;c=e.multiply(-2),f=t.add(c.add(n)),c=t.multiply(-2),l=e.multiply(2),h=c.add(l),y=new i(t.x,t.y);for(var d=a*a,x=u*u,v=new s(x*f.x*f.x+d*f.y*f.y,2*(x*f.x*h.x+d*f.y*h.y),x*(2*f.x*y.x+h.x*h.x)+d*(2*f.y*y.y+h.y*h.y)-2*(x*o.x*f.x+d*o.y*f.y),2*(x*h.x*(y.x-o.x)+d*h.y*(y.y-o.y)),x*(y.x*y.x+o.x*o.x)+d*(y.y*y.y+o.y*o.y)-2*(x*o.x*y.x+d*o.y*y.y)-d*x).getRoots(),g=0;g<v.length;g++){var m=v[g];0<=m&&m<=1&&p.points.push(f.multiply(m*m).add(h.multiply(m).add(y)))}return p},t.exports.intersectBezier2Line=function(t,e,n,o,u){var c,l,f,h,y,p,d,x=o.min(u),v=o.max(u),g=new r;c=e.multiply(-2),f=t.add(c.add(n)),c=t.multiply(-2),l=e.multiply(2),h=c.add(l),y=new i(t.x,t.y),d=new a(o.y-u.y,u.x-o.x),p=o.x*u.y-u.x*o.y,roots=new s(d.dot(f),d.dot(h),d.dot(y)+p).getRoots();for(var m=0;m<roots.length;m++){var w=roots[m];if(0<=w&&w<=1){var b=t.lerp(e,w),_=e.lerp(n,w),E=b.lerp(_,w);o.x==u.x?x.y<=E.y&&E.y<=v.y&&g.appendPoint(E):o.y==u.y?x.x<=E.x&&E.x<=v.x&&g.appendPoint(E):x.x<=E.x&&E.x<=v.x&&x.y<=E.y&&E.y<=v.y&&g.appendPoint(E)}}return g},t.exports.intersectBezier3Bezier3=function(t,e,n,o,c,l,f,h){var y,p,d,x,v,g,m,w,b,_,E,A,M=new r;y=t.multiply(-1),p=e.multiply(3),d=n.multiply(-3),x=y.add(p.add(d.add(o))),v=new a(x.x,x.y),y=t.multiply(3),p=e.multiply(-6),d=n.multiply(3),x=y.add(p.add(d)),g=new a(x.x,x.y),y=t.multiply(-3),p=e.multiply(3),d=y.add(p),m=new a(d.x,d.y),w=new a(t.x,t.y),y=c.multiply(-1),p=l.multiply(3),d=f.multiply(-3),x=y.add(p.add(d.add(h))),b=new a(x.x,x.y),y=c.multiply(3),p=l.multiply(-6),d=f.multiply(3),x=y.add(p.add(d)),_=new a(x.x,x.y),y=c.multiply(-3),p=l.multiply(3),d=y.add(p),E=new a(d.x,d.y),A=new a(c.x,c.y);var C=w.x*w.x,k=w.x*w.x*w.x,N=w.y*w.y,P=w.y*w.y*w.y,O=m.x*m.x,S=m.x*m.x*m.x,T=m.y*m.y,j=m.y*m.y*m.y,I=g.x*g.x,R=g.x*g.x*g.x,L=g.y*g.y,B=g.y*g.y*g.y,D=v.x*v.x,z=v.x*v.x*v.x,U=v.y*v.y,F=v.y*v.y*v.y,q=A.x*A.x,Y=A.x*A.x*A.x,V=A.y*A.y,H=A.y*A.y*A.y,X=E.x*E.x,$=E.x*E.x*E.x,W=E.y*E.y,Z=_.x*_.x,G=_.x*_.x*_.x,K=_.y*_.y,Q=b.x*b.x,J=b.x*b.x*b.x,tt=b.y*b.y,et=b.y*b.y*b.y,nt=new s(-z*et+F*J-3*v.x*U*Q*b.y+3*D*v.y*b.x*tt,-6*v.x*_.x*U*b.x*b.y+6*D*v.y*_.y*b.x*b.y+3*_.x*F*Q-3*z*_.y*tt-3*v.x*U*_.y*Q+3*D*_.x*v.y*tt,-6*E.x*v.x*U*b.x*b.y-6*v.x*_.x*U*_.y*b.x+6*D*_.x*v.y*_.y*b.y+3*E.x*F*Q+3*Z*F*b.x+3*E.x*D*v.y*tt-3*v.x*E.y*U*Q-3*v.x*Z*U*b.y+D*v.y*b.x*(6*E.y*b.y+3*K)+z*(-E.y*tt-2*K*b.y-b.y*(2*E.y*b.y+K)),m.x*g.y*v.x*v.y*b.x*b.y-m.y*g.x*v.x*v.y*b.x*b.y+6*E.x*_.x*F*b.x+3*m.x*g.x*v.x*v.y*tt+6*w.x*v.x*U*b.x*b.y-3*m.x*g.x*U*b.x*b.y-3*m.y*g.y*v.x*v.y*Q-6*w.y*D*v.y*b.x*b.y-6*A.x*v.x*U*b.x*b.y+3*m.y*g.y*D*b.x*b.y-2*g.x*L*v.x*b.x*b.y-6*E.x*v.x*_.x*U*b.y-6*E.x*v.x*U*_.y*b.x-6*v.x*E.y*_.x*U*b.x+6*E.x*D*v.y*_.y*b.y+2*I*g.y*v.y*b.x*b.y+G*F-3*w.x*F*Q+3*w.y*z*tt+3*A.x*F*Q+B*v.x*Q-R*v.y*tt-3*w.x*D*v.y*tt+3*w.y*v.x*U*Q-2*m.x*g.y*D*tt+m.x*g.y*U*Q-m.y*g.x*D*tt+2*m.y*g.x*U*Q+3*A.x*D*v.y*tt-g.x*L*v.y*Q-3*A.y*v.x*U*Q+I*g.y*v.x*tt-3*v.x*Z*U*_.y+D*v.y*b.x*(6*A.y*b.y+6*E.y*_.y)+D*_.x*v.y*(6*E.y*b.y+3*K)+z*(-2*E.y*_.y*b.y-A.y*tt-_.y*(2*E.y*b.y+K)-b.y*(2*A.y*b.y+2*E.y*_.y)),6*m.x*g.x*v.x*v.y*_.y*b.y+m.x*g.y*v.x*_.x*v.y*b.y+m.x*g.y*v.x*v.y*_.y*b.x-m.y*g.x*v.x*_.x*v.y*b.y-m.y*g.x*v.x*v.y*_.y*b.x-6*m.y*g.y*v.x*_.x*v.y*b.x-6*w.x*_.x*F*b.x+6*A.x*_.x*F*b.x+6*w.y*z*_.y*b.y+2*B*v.x*_.x*b.x-2*R*v.y*_.y*b.y+6*w.x*v.x*_.x*U*b.y+6*w.x*v.x*U*_.y*b.x+6*w.y*v.x*_.x*U*b.x-3*m.x*g.x*_.x*U*b.y-3*m.x*g.x*U*_.y*b.x+2*m.x*g.y*_.x*U*b.x+4*m.y*g.x*_.x*U*b.x-6*w.x*D*v.y*_.y*b.y-6*w.y*D*_.x*v.y*b.y-6*w.y*D*v.y*_.y*b.x-4*m.x*g.y*D*_.y*b.y-6*A.x*v.x*_.x*U*b.y-6*A.x*v.x*U*_.y*b.x-2*m.y*g.x*D*_.y*b.y+3*m.y*g.y*D*_.x*b.y+3*m.y*g.y*D*_.y*b.x-2*g.x*L*v.x*_.x*b.y-2*g.x*L*v.x*_.y*b.x-2*g.x*L*_.x*v.y*b.x-6*A.y*v.x*_.x*U*b.x-6*E.x*v.x*E.y*U*b.x-6*E.x*v.x*_.x*U*_.y+6*A.x*D*v.y*_.y*b.y+2*I*g.y*v.x*_.y*b.y+2*I*g.y*_.x*v.y*b.y+2*I*g.y*v.y*_.y*b.x+3*E.x*Z*F+3*X*F*b.x-3*v.x*E.y*Z*U-3*X*v.x*U*b.y+D*_.x*v.y*(6*A.y*b.y+6*E.y*_.y)+D*v.y*b.x*(6*A.y*_.y+3*W)+E.x*D*v.y*(6*E.y*b.y+3*K)+z*(-2*A.y*_.y*b.y-b.y*(2*A.y*_.y+W)-E.y*(2*E.y*b.y+K)-_.y*(2*A.y*b.y+2*E.y*_.y)),m.x*E.x*g.y*v.x*v.y*b.y+m.x*g.y*v.x*E.y*v.y*b.x+m.x*g.y*v.x*_.x*v.y*_.y-m.y*g.x*E.x*v.x*v.y*b.y-m.y*g.x*v.x*E.y*v.y*b.x-m.y*g.x*v.x*_.x*v.y*_.y-6*m.y*E.x*g.y*v.x*v.y*b.x-6*w.x*E.x*F*b.x+6*A.x*E.x*F*b.x+2*E.x*B*v.x*b.x+6*w.x*E.x*v.x*U*b.y+6*w.x*v.x*E.y*U*b.x+6*w.x*v.x*_.x*U*_.y+6*w.y*E.x*v.x*U*b.x-3*m.x*g.x*E.x*U*b.y-3*m.x*g.x*E.y*U*b.x-3*m.x*g.x*_.x*U*_.y+2*m.x*E.x*g.y*U*b.x+4*m.y*g.x*E.x*U*b.x-6*w.y*E.x*D*v.y*b.y-6*w.y*D*E.y*v.y*b.x-6*w.y*D*_.x*v.y*_.y-6*A.x*E.x*v.x*U*b.y-6*A.x*v.x*E.y*U*b.x-6*A.x*v.x*_.x*U*_.y+3*m.y*E.x*g.y*D*b.y-3*m.y*g.y*v.x*Z*v.y+3*m.y*g.y*D*E.y*b.x+3*m.y*g.y*D*_.x*_.y-2*g.x*E.x*L*v.x*b.y-2*g.x*E.x*L*v.y*b.x-2*g.x*L*v.x*E.y*b.x-2*g.x*L*v.x*_.x*_.y-6*A.y*E.x*v.x*U*b.x-6*E.x*v.x*E.y*_.x*U+6*A.y*D*E.y*v.y*b.x+2*I*E.x*g.y*v.y*b.y+2*I*g.y*E.y*v.y*b.x+2*I*g.y*_.x*v.y*_.y-3*w.x*Z*F+3*A.x*Z*F+3*X*_.x*F+B*v.x*Z+3*w.y*v.x*Z*U+m.x*g.y*Z*U+2*m.y*g.x*Z*U-g.x*L*Z*v.y-3*A.y*v.x*Z*U-3*X*v.x*U*_.y+I*g.y*v.x*(2*E.y*b.y+K)+m.x*g.x*v.x*v.y*(6*E.y*b.y+3*K)+E.x*D*v.y*(6*A.y*b.y+6*E.y*_.y)+R*v.y*(-2*E.y*b.y-K)+w.y*z*(6*E.y*b.y+3*K)+m.y*g.x*D*(-2*E.y*b.y-K)+m.x*g.y*D*(-4*E.y*b.y-2*K)+w.x*D*v.y*(-6*E.y*b.y-3*K)+D*_.x*v.y*(6*A.y*_.y+3*W)+A.x*D*v.y*(6*E.y*b.y+3*K)+z*(-2*A.y*E.y*b.y-_.y*(2*A.y*_.y+W)-A.y*(2*E.y*b.y+K)-E.y*(2*A.y*b.y+2*E.y*_.y)),-w.x*m.x*g.y*v.x*v.y*b.y+w.x*m.y*g.x*v.x*v.y*b.y+6*w.x*m.y*g.y*v.x*v.y*b.x-6*w.y*m.x*g.x*v.x*v.y*b.y-w.y*m.x*g.y*v.x*v.y*b.x+w.y*m.y*g.x*v.x*v.y*b.x+m.x*m.y*g.x*g.y*v.x*b.y-m.x*m.y*g.x*g.y*v.y*b.x+m.x*A.x*g.y*v.x*v.y*b.y+m.x*A.y*g.y*v.x*v.y*b.x+m.x*E.x*g.y*v.x*v.y*_.y+m.x*g.y*v.x*E.y*_.x*v.y-A.x*m.y*g.x*v.x*v.y*b.y-6*A.x*m.y*g.y*v.x*v.y*b.x-m.y*g.x*A.y*v.x*v.y*b.x-m.y*g.x*E.x*v.x*v.y*_.y-m.y*g.x*v.x*E.y*_.x*v.y-6*m.y*E.x*g.y*v.x*_.x*v.y-6*w.x*A.x*F*b.x-6*w.x*E.x*_.x*F-2*w.x*B*v.x*b.x+6*A.x*E.x*_.x*F+2*A.x*B*v.x*b.x+2*E.x*B*v.x*_.x+2*w.y*R*v.y*b.y-6*w.x*w.y*v.x*U*b.x+3*w.x*m.x*g.x*U*b.y-2*w.x*m.x*g.y*U*b.x-4*w.x*m.y*g.x*U*b.x+3*w.y*m.x*g.x*U*b.x+6*w.x*w.y*D*v.y*b.y+6*w.x*A.x*v.x*U*b.y-3*w.x*m.y*g.y*D*b.y+2*w.x*g.x*L*v.x*b.y+2*w.x*g.x*L*v.y*b.x+6*w.x*A.y*v.x*U*b.x+6*w.x*E.x*v.x*U*_.y+6*w.x*v.x*E.y*_.x*U+4*w.y*m.x*g.y*D*b.y+6*w.y*A.x*v.x*U*b.x+2*w.y*m.y*g.x*D*b.y-3*w.y*m.y*g.y*D*b.x+2*w.y*g.x*L*v.x*b.x+6*w.y*E.x*v.x*_.x*U-3*m.x*A.x*g.x*U*b.y+2*m.x*A.x*g.y*U*b.x+m.x*m.y*L*v.x*b.x-3*m.x*g.x*A.y*U*b.x-3*m.x*g.x*E.x*U*_.y-3*m.x*g.x*E.y*_.x*U+2*m.x*E.x*g.y*_.x*U+4*A.x*m.y*g.x*U*b.x+4*m.y*g.x*E.x*_.x*U-2*w.x*I*g.y*v.y*b.y-6*w.y*A.x*D*v.y*b.y-6*w.y*A.y*D*v.y*b.x-6*w.y*E.x*D*v.y*_.y-2*w.y*I*g.y*v.x*b.y-2*w.y*I*g.y*v.y*b.x-6*w.y*D*E.y*_.x*v.y-m.x*m.y*I*v.y*b.y-2*m.x*T*v.x*v.y*b.x+3*A.x*m.y*g.y*D*b.y-2*A.x*g.x*L*v.x*b.y-2*A.x*g.x*L*v.y*b.x-6*A.x*A.y*v.x*U*b.x-6*A.x*E.x*v.x*U*_.y-6*A.x*v.x*E.y*_.x*U+3*m.y*A.y*g.y*D*b.x+3*m.y*E.x*g.y*D*_.y+3*m.y*g.y*D*E.y*_.x-2*g.x*A.y*L*v.x*b.x-2*g.x*E.x*L*v.x*_.y-2*g.x*E.x*L*_.x*v.y-2*g.x*L*v.x*E.y*_.x-6*A.y*E.x*v.x*_.x*U-T*g.x*g.y*v.x*b.x+2*A.x*I*g.y*v.y*b.y+6*A.y*D*E.y*_.x*v.y+2*O*m.y*v.x*v.y*b.y+O*g.x*g.y*v.y*b.y+2*I*A.y*g.y*v.y*b.x+2*I*E.x*g.y*v.y*_.y+2*I*g.y*E.y*_.x*v.y+$*F+3*C*F*b.x-3*N*z*b.y+3*q*F*b.x+j*D*b.x-S*U*b.y-m.x*T*D*b.y+O*m.y*U*b.x-3*C*v.x*U*b.y+3*N*D*v.y*b.x-O*L*v.x*b.y+T*I*v.y*b.x-3*X*v.x*E.y*U-3*q*v.x*U*b.y+3*V*D*v.y*b.x+m.x*g.x*v.x*v.y*(6*A.y*b.y+6*E.y*_.y)+R*v.y*(-2*A.y*b.y-2*E.y*_.y)+w.y*z*(6*A.y*b.y+6*E.y*_.y)+m.y*g.x*D*(-2*A.y*b.y-2*E.y*_.y)+I*g.y*v.x*(2*A.y*b.y+2*E.y*_.y)+m.x*g.y*D*(-4*A.y*b.y-4*E.y*_.y)+w.x*D*v.y*(-6*A.y*b.y-6*E.y*_.y)+A.x*D*v.y*(6*A.y*b.y+6*E.y*_.y)+E.x*D*v.y*(6*A.y*_.y+3*W)+z*(-2*A.y*E.y*_.y-V*b.y-E.y*(2*A.y*_.y+W)-A.y*(2*A.y*b.y+2*E.y*_.y)),-w.x*m.x*g.y*v.x*v.y*_.y+w.x*m.y*g.x*v.x*v.y*_.y+6*w.x*m.y*g.y*v.x*_.x*v.y-6*w.y*m.x*g.x*v.x*v.y*_.y-w.y*m.x*g.y*v.x*_.x*v.y+w.y*m.y*g.x*v.x*_.x*v.y+m.x*m.y*g.x*g.y*v.x*_.y-m.x*m.y*g.x*g.y*_.x*v.y+m.x*A.x*g.y*v.x*v.y*_.y+m.x*A.y*g.y*v.x*_.x*v.y+m.x*E.x*g.y*v.x*E.y*v.y-A.x*m.y*g.x*v.x*v.y*_.y-6*A.x*m.y*g.y*v.x*_.x*v.y-m.y*g.x*A.y*v.x*_.x*v.y-m.y*g.x*E.x*v.x*E.y*v.y-6*w.x*A.x*_.x*F-2*w.x*B*v.x*_.x+2*A.x*B*v.x*_.x+2*w.y*R*v.y*_.y-6*w.x*w.y*v.x*_.x*U+3*w.x*m.x*g.x*U*_.y-2*w.x*m.x*g.y*_.x*U-4*w.x*m.y*g.x*_.x*U+3*w.y*m.x*g.x*_.x*U+6*w.x*w.y*D*v.y*_.y+6*w.x*A.x*v.x*U*_.y-3*w.x*m.y*g.y*D*_.y+2*w.x*g.x*L*v.x*_.y+2*w.x*g.x*L*_.x*v.y+6*w.x*A.y*v.x*_.x*U+6*w.x*E.x*v.x*E.y*U+4*w.y*m.x*g.y*D*_.y+6*w.y*A.x*v.x*_.x*U+2*w.y*m.y*g.x*D*_.y-3*w.y*m.y*g.y*D*_.x+2*w.y*g.x*L*v.x*_.x-3*m.x*A.x*g.x*U*_.y+2*m.x*A.x*g.y*_.x*U+m.x*m.y*L*v.x*_.x-3*m.x*g.x*A.y*_.x*U-3*m.x*g.x*E.x*E.y*U+4*A.x*m.y*g.x*_.x*U-2*w.x*I*g.y*v.y*_.y-6*w.y*A.x*D*v.y*_.y-6*w.y*A.y*D*_.x*v.y-6*w.y*E.x*D*E.y*v.y-2*w.y*I*g.y*v.x*_.y-2*w.y*I*g.y*_.x*v.y-m.x*m.y*I*v.y*_.y-2*m.x*T*v.x*_.x*v.y+3*A.x*m.y*g.y*D*_.y-2*A.x*g.x*L*v.x*_.y-2*A.x*g.x*L*_.x*v.y-6*A.x*A.y*v.x*_.x*U-6*A.x*E.x*v.x*E.y*U+3*m.y*A.y*g.y*D*_.x+3*m.y*E.x*g.y*D*E.y-2*g.x*A.y*L*v.x*_.x-2*g.x*E.x*L*v.x*E.y-T*g.x*g.y*v.x*_.x+2*A.x*I*g.y*v.y*_.y-3*m.y*X*g.y*v.x*v.y+6*A.y*E.x*D*E.y*v.y+2*O*m.y*v.x*v.y*_.y+O*g.x*g.y*v.y*_.y+2*I*A.y*g.y*_.x*v.y+2*I*E.x*g.y*E.y*v.y-3*w.x*X*F+3*A.x*X*F+3*C*_.x*F-3*N*z*_.y+3*q*_.x*F+X*B*v.x+j*D*_.x-S*U*_.y+3*w.y*X*v.x*U-m.x*T*D*_.y+m.x*X*g.y*U+2*m.y*g.x*X*U+O*m.y*_.x*U-g.x*X*L*v.y-3*A.y*X*v.x*U-3*C*v.x*U*_.y+3*N*D*_.x*v.y-O*L*v.x*_.y+T*I*_.x*v.y-3*q*v.x*U*_.y+3*V*D*_.x*v.y+I*g.y*v.x*(2*A.y*_.y+W)+m.x*g.x*v.x*v.y*(6*A.y*_.y+3*W)+R*v.y*(-2*A.y*_.y-W)+w.y*z*(6*A.y*_.y+3*W)+m.y*g.x*D*(-2*A.y*_.y-W)+m.x*g.y*D*(-4*A.y*_.y-2*W)+w.x*D*v.y*(-6*A.y*_.y-3*W)+A.x*D*v.y*(6*A.y*_.y+3*W)+z*(-2*A.y*W-V*_.y-A.y*(2*A.y*_.y+W)),-w.x*m.x*g.y*v.x*E.y*v.y+w.x*m.y*g.x*v.x*E.y*v.y+6*w.x*m.y*E.x*g.y*v.x*v.y-6*w.y*m.x*g.x*v.x*E.y*v.y-w.y*m.x*E.x*g.y*v.x*v.y+w.y*m.y*g.x*E.x*v.x*v.y-m.x*m.y*g.x*E.x*g.y*v.y+m.x*m.y*g.x*g.y*v.x*E.y+m.x*A.x*g.y*v.x*E.y*v.y+6*m.x*g.x*A.y*v.x*E.y*v.y+m.x*A.y*E.x*g.y*v.x*v.y-A.x*m.y*g.x*v.x*E.y*v.y-6*A.x*m.y*E.x*g.y*v.x*v.y-m.y*g.x*A.y*E.x*v.x*v.y-6*w.x*A.x*E.x*F-2*w.x*E.x*B*v.x+6*w.y*A.y*z*E.y+2*A.x*E.x*B*v.x+2*w.y*R*E.y*v.y-2*R*A.y*E.y*v.y-6*w.x*w.y*E.x*v.x*U+3*w.x*m.x*g.x*E.y*U-2*w.x*m.x*E.x*g.y*U-4*w.x*m.y*g.x*E.x*U+3*w.y*m.x*g.x*E.x*U+6*w.x*w.y*D*E.y*v.y+6*w.x*A.x*v.x*E.y*U-3*w.x*m.y*g.y*D*E.y+2*w.x*g.x*E.x*L*v.y+2*w.x*g.x*L*v.x*E.y+6*w.x*A.y*E.x*v.x*U+4*w.y*m.x*g.y*D*E.y+6*w.y*A.x*E.x*v.x*U+2*w.y*m.y*g.x*D*E.y-3*w.y*m.y*E.x*g.y*D+2*w.y*g.x*E.x*L*v.x-3*m.x*A.x*g.x*E.y*U+2*m.x*A.x*E.x*g.y*U+m.x*m.y*E.x*L*v.x-3*m.x*g.x*A.y*E.x*U+4*A.x*m.y*g.x*E.x*U-6*w.x*A.y*D*E.y*v.y-2*w.x*I*g.y*E.y*v.y-6*w.y*A.x*D*E.y*v.y-6*w.y*A.y*E.x*D*v.y-2*w.y*I*E.x*g.y*v.y-2*w.y*I*g.y*v.x*E.y-m.x*m.y*I*E.y*v.y-4*m.x*A.y*g.y*D*E.y-2*m.x*T*E.x*v.x*v.y+3*A.x*m.y*g.y*D*E.y-2*A.x*g.x*E.x*L*v.y-2*A.x*g.x*L*v.x*E.y-6*A.x*A.y*E.x*v.x*U-2*m.y*g.x*A.y*D*E.y+3*m.y*A.y*E.x*g.y*D-2*g.x*A.y*E.x*L*v.x-T*g.x*E.x*g.y*v.x+6*A.x*A.y*D*E.y*v.y+2*A.x*I*g.y*E.y*v.y+2*O*m.y*v.x*E.y*v.y+O*g.x*g.y*E.y*v.y+2*I*A.y*E.x*g.y*v.y+2*I*A.y*g.y*v.x*E.y+3*C*E.x*F-3*N*z*E.y+3*q*E.x*F+j*E.x*D-S*E.y*U-3*V*z*E.y-m.x*T*D*E.y+O*m.y*E.x*U-3*C*v.x*E.y*U+3*N*E.x*D*v.y-O*L*v.x*E.y+T*I*E.x*v.y-3*q*v.x*E.y*U+3*V*E.x*D*v.y,w.x*w.y*m.x*g.y*v.x*v.y-w.x*w.y*m.y*g.x*v.x*v.y+w.x*m.x*m.y*g.x*g.y*v.y-w.y*m.x*m.y*g.x*g.y*v.x-w.x*m.x*A.y*g.y*v.x*v.y+6*w.x*A.x*m.y*g.y*v.x*v.y+w.x*m.y*g.x*A.y*v.x*v.y-w.y*m.x*A.x*g.y*v.x*v.y-6*w.y*m.x*g.x*A.y*v.x*v.y+w.y*A.x*m.y*g.x*v.x*v.y-m.x*A.x*m.y*g.x*g.y*v.y+m.x*m.y*g.x*A.y*g.y*v.x+m.x*A.x*A.y*g.y*v.x*v.y-A.x*m.y*g.x*A.y*v.x*v.y-2*w.x*A.x*B*v.x+2*w.y*R*A.y*v.y-3*w.x*w.y*m.x*g.x*U-6*w.x*w.y*A.x*v.x*U+3*w.x*w.y*m.y*g.y*D-2*w.x*w.y*g.x*L*v.x-2*w.x*m.x*A.x*g.y*U-w.x*m.x*m.y*L*v.x+3*w.x*m.x*g.x*A.y*U-4*w.x*A.x*m.y*g.x*U+3*w.y*m.x*A.x*g.x*U+6*w.x*w.y*A.y*D*v.y+2*w.x*w.y*I*g.y*v.y+2*w.x*m.x*T*v.x*v.y+2*w.x*A.x*g.x*L*v.y+6*w.x*A.x*A.y*v.x*U-3*w.x*m.y*A.y*g.y*D+2*w.x*g.x*A.y*L*v.x+w.x*T*g.x*g.y*v.x+w.y*m.x*m.y*I*v.y+4*w.y*m.x*A.y*g.y*D-3*w.y*A.x*m.y*g.y*D+2*w.y*A.x*g.x*L*v.x+2*w.y*m.y*g.x*A.y*D+m.x*A.x*m.y*L*v.x-3*m.x*A.x*g.x*A.y*U-2*w.x*I*A.y*g.y*v.y-6*w.y*A.x*A.y*D*v.y-2*w.y*A.x*I*g.y*v.y-2*w.y*O*m.y*v.x*v.y-w.y*O*g.x*g.y*v.y-2*w.y*I*A.y*g.y*v.x-2*m.x*A.x*T*v.x*v.y-m.x*m.y*I*A.y*v.y+3*A.x*m.y*A.y*g.y*D-2*A.x*g.x*A.y*L*v.x-A.x*T*g.x*g.y*v.x+3*N*m.x*g.x*v.x*v.y+3*m.x*g.x*V*v.x*v.y+2*A.x*I*A.y*g.y*v.y-3*C*m.y*g.y*v.x*v.y+2*O*m.y*A.y*v.x*v.y+O*g.x*A.y*g.y*v.y-3*q*m.y*g.y*v.x*v.y-k*F+P*z+Y*F-H*z-3*w.x*q*F-w.x*j*D+3*C*A.x*F+w.y*S*U+3*w.y*V*z+A.x*j*D+C*B*v.x-3*N*A.y*z-N*R*v.y+q*B*v.x-S*A.y*U-R*V*v.y-w.x*O*m.y*U+w.y*m.x*T*D-3*w.x*N*D*v.y-w.x*T*I*v.y+w.y*O*L*v.x-m.x*T*A.y*D+3*C*w.y*v.x*U+C*m.x*g.y*U+2*C*m.y*g.x*U-2*N*m.x*g.y*D-N*m.y*g.x*D+O*A.x*m.y*U-3*w.x*V*D*v.y+3*w.y*q*v.x*U+m.x*q*g.y*U-2*m.x*V*g.y*D+A.x*T*I*v.y-m.y*g.x*V*D-C*g.x*L*v.y-3*C*A.y*v.x*U+3*N*A.x*D*v.y+N*I*g.y*v.x-O*A.y*L*v.x+2*q*m.y*g.x*U+3*A.x*V*D*v.y-q*g.x*L*v.y-3*q*A.y*v.x*U+I*V*g.y*v.x).getRootsInInterval(0,1);u(nt);for(var rt=0;rt<nt.length;rt++){var ot=nt[rt],it=new s(v.x,g.x,m.x,w.x-A.x-ot*E.x-ot*ot*_.x-ot*ot*ot*b.x).getRoots(),at=new s(v.y,g.y,m.y,w.y-A.y-ot*E.y-ot*ot*_.y-ot*ot*ot*b.y).getRoots();if(it.length>0&&at.length>0)t:for(var st=0;st<it.length;st++){var ut=it[st];if(0<=ut&&ut<=1)for(var ct=0;ct<at.length;ct++)if(Math.abs(ut-at[ct])<1e-4){var lt=b.multiply(ot*ot*ot).add(_.multiply(ot*ot).add(E.multiply(ot).add(A)));M.points.push(new i(lt.x,lt.y));break t}}}return M},t.exports.intersectBezier3Ellipse=function(t,e,n,o,c,l,f){var h,y,p,d,x,v,g,m,w=new r;h=t.multiply(-1),y=e.multiply(3),p=n.multiply(-3),d=h.add(y.add(p.add(o))),x=new a(d.x,d.y),h=t.multiply(3),y=e.multiply(-6),p=n.multiply(3),d=h.add(y.add(p)),v=new a(d.x,d.y),h=t.multiply(-3),y=e.multiply(3),p=h.add(y),g=new a(p.x,p.y),m=new a(t.x,t.y);var b=l*l,_=f*f,E=new s(x.x*x.x*_+x.y*x.y*b,2*(x.x*v.x*_+x.y*v.y*b),2*(x.x*g.x*_+x.y*g.y*b)+v.x*v.x*_+v.y*v.y*b,2*x.x*_*(m.x-c.x)+2*x.y*b*(m.y-c.y)+2*(v.x*g.x*_+v.y*g.y*b),2*v.x*_*(m.x-c.x)+2*v.y*b*(m.y-c.y)+g.x*g.x*_+g.y*g.y*b,2*g.x*_*(m.x-c.x)+2*g.y*b*(m.y-c.y),m.x*m.x*_-2*m.y*c.y*b-2*m.x*c.x*_+m.y*m.y*b+c.x*c.x*_+c.y*c.y*b-b*_).getRootsInInterval(0,1);u(E);for(var A=0;A<E.length;A++){var M=E[A],C=x.multiply(M*M*M).add(v.multiply(M*M).add(g.multiply(M).add(m)));w.points.push(new i(C.x,C.y))}return w},t.exports.intersectBezier3Line=function(t,e,n,o,i,u){var c,l,f,h,y,p,d,x,v,g,m=i.min(u),w=i.max(u),b=new r;c=t.multiply(-1),l=e.multiply(3),f=n.multiply(-3),h=c.add(l.add(f.add(o))),y=new a(h.x,h.y),c=t.multiply(3),l=e.multiply(-6),f=n.multiply(3),h=c.add(l.add(f)),p=new a(h.x,h.y),c=t.multiply(-3),l=e.multiply(3),f=c.add(l),d=new a(f.x,f.y),x=new a(t.x,t.y),g=new a(i.y-u.y,u.x-i.x),v=i.x*u.y-u.x*i.y,roots=new s(g.dot(y),g.dot(p),g.dot(d),g.dot(x)+v).getRoots();for(var _=0;_<roots.length;_++){var E=roots[_];if(0<=E&&E<=1){var A=t.lerp(e,E),M=e.lerp(n,E),C=n.lerp(o,E),k=A.lerp(M,E),N=M.lerp(C,E),P=k.lerp(N,E);i.x==u.x?m.y<=P.y&&P.y<=w.y&&b.appendPoint(P):i.y==u.y?m.x<=P.x&&P.x<=w.x&&b.appendPoint(P):m.x<=P.x&&P.x<=w.x&&m.y<=P.y&&P.y<=w.y&&b.appendPoint(P)}}return b}},function(t,e,n){function r(t,e){Object.defineProperties(this,{x:{value:void 0!==t?t:0,writable:!1,enumerable:!0,configurable:!1},y:{value:void 0!==e?e:0,writable:!1,enumerable:!0,configurable:!1}})}r.prototype.clone=function(){return new this.constructor(this.x,this.y)},r.prototype.add=function(t){return new this.constructor(this.x+t.x,this.y+t.y)},r.prototype.subtract=function(t){return new this.constructor(this.x-t.x,this.y-t.y)},r.prototype.multiply=function(t){return new this.constructor(this.x*t,this.y*t)},r.prototype.divide=function(t){return new this.constructor(this.x/t,this.y/t)},r.prototype.equals=function(t){return this.x===t.x&&this.y===t.y},r.prototype.precisionEquals=function(t,e){return Math.abs(this.x-t.x)<e&&Math.abs(this.y-t.y)<e},r.prototype.lerp=function(t,e){var n=1-e;return new this.constructor(this.x*n+t.x*e,this.y*n+t.y*e)},r.prototype.distanceFrom=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},r.prototype.min=function(t){return new this.constructor(Math.min(this.x,t.x),Math.min(this.y,t.y))},r.prototype.max=function(t){return new this.constructor(Math.max(this.x,t.x),Math.max(this.y,t.y))},r.prototype.transform=function(t){return new this.constructor(t.a*this.x+t.c*this.y+t.e,t.b*this.x+t.d*this.y+t.f)},r.prototype.toString=function(){return"point("+this.x+","+this.y+")"},t.exports=r},function(t,e,n){function r(t,e){Object.defineProperties(this,{x:{value:void 0!==t?t:0,writable:!1,enumerable:!0,configurable:!1},y:{value:void 0!==e?e:0,writable:!1,enumerable:!0,configurable:!1}})}r.fromPoints=function(t,e){return new r(e.x-t.x,e.y-t.y)},r.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},r.prototype.magnitude=function(){return this.x*this.x+this.y*this.y},r.prototype.dot=function(t){return this.x*t.x+this.y*t.y},r.prototype.cross=function(t){return this.x*t.y-this.y*t.x},r.prototype.determinant=function(t){return this.x*t.y-this.y*t.x},r.prototype.unit=function(){return this.divide(this.length())},r.prototype.add=function(t){return new this.constructor(this.x+t.x,this.y+t.y)},r.prototype.subtract=function(t){return new this.constructor(this.x-t.x,this.y-t.y)},r.prototype.multiply=function(t){return new this.constructor(this.x*t,this.y*t)},r.prototype.divide=function(t){return new this.constructor(this.x/t,this.y/t)},r.prototype.angleBetween=function(t){var e=this.dot(t)/(this.length()*t.length());e=Math.max(-1,Math.min(e,1));var n=Math.acos(e);return this.cross(t)<0?-n:n},r.prototype.perp=function(){return new this.constructor(-this.y,this.x)},r.prototype.perpendicular=function(t){return this.subtract(this.project(t))},r.prototype.project=function(t){var e=this.dot(t)/t.dot(t);return t.multiply(e)},r.prototype.transform=function(t){return new this.constructor(t.a*this.x+t.c*this.y,t.b*this.x+t.d*this.y)},r.prototype.equals=function(t){return this.x===t.x&&this.y===t.y},r.prototype.precisionEquals=function(t,e){return Math.abs(this.x-t.x)<e&&Math.abs(this.y-t.y)<e},r.prototype.toString=function(){return"vector("+this.x+","+this.y+")"},t.exports=r},function(t,e,n){function r(t,e,n){Object.defineProperty(t,e,{value:n,writable:!1,enumerable:!0,configurable:!1})}function o(t,e,n,o,i,a){r(this,"a",void 0!==t?t:1),r(this,"b",void 0!==e?e:0),r(this,"c",void 0!==n?n:0),r(this,"d",void 0!==o?o:1),r(this,"e",void 0!==i?i:0),r(this,"f",void 0!==a?a:0)}r(o,"IDENTITY",new o(1,0,0,1,0,0)),r(o.IDENTITY,"isIdentity",(function(){return!0})),o.translation=function(t,e){return new o(1,0,0,1,t,e)},o.scaling=function(t){return new o(t,0,0,t,0,0)},o.scalingAt=function(t,e){return new o(t,0,0,t,e.x-e.x*t,e.y-e.y*t)},o.nonUniformScaling=function(t,e){return new o(t,0,0,e,0,0)},o.nonUniformScalingAt=function(t,e,n){return new o(t,0,0,e,n.x-n.x*t,n.y-n.y*e)},o.rotation=function(t){var e=Math.cos(t),n=Math.sin(t);return new o(e,n,-n,e,0,0)},o.rotationAt=function(t,e){var n=Math.cos(t),r=Math.sin(t);return new o(n,r,-r,n,e.x-e.x*n+e.y*r,e.y-e.y*n-e.x*r)},o.rotationFromVector=function(t){var e=t.unit(),n=e.x,r=e.y;return new o(n,r,-r,n,0,0)},o.xFlip=function(){return new o(-1,0,0,1,0,0)},o.yFlip=function(){return new o(1,0,0,-1,0,0)},o.xSkew=function(t){return new o(1,0,Math.tan(t),1,0,0)},o.ySkew=function(t){return new o(1,Math.tan(t),0,1,0,0)},o.prototype.multiply=function(t){return this.isIdentity()?t:t.isIdentity()?this:new this.constructor(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.e+this.c*t.f+this.e,this.b*t.e+this.d*t.f+this.f)},o.prototype.inverse=function(){if(this.isIdentity())return this;var t=this.a*this.d-this.b*this.c;if(0===t)throw"Matrix is not invertible";var e=1/t,n=this.f*this.c-this.e*this.d,r=this.e*this.b-this.f*this.a;return new this.constructor(this.d*e,-this.b*e,-this.c*e,this.a*e,n*e,r*e)},o.prototype.translate=function(t,e){return new this.constructor(this.a,this.b,this.c,this.d,this.a*t+this.c*e+this.e,this.b*t+this.d*e+this.f)},o.prototype.scale=function(t){return new this.constructor(this.a*t,this.b*t,this.c*t,this.d*t,this.e,this.f)},o.prototype.scaleAt=function(t,e){var n=e.x-t*e.x,r=e.y-t*e.y;return new this.constructor(this.a*t,this.b*t,this.c*t,this.d*t,this.a*n+this.c*r+this.e,this.b*n+this.d*r+this.f)},o.prototype.scaleNonUniform=function(t,e){return new this.constructor(this.a*t,this.b*t,this.c*e,this.d*e,this.e,this.f)},o.prototype.scaleNonUniformAt=function(t,e,n){var r=n.x-t*n.x,o=n.y-e*n.y;return new this.constructor(this.a*t,this.b*t,this.c*e,this.d*e,this.a*r+this.c*o+this.e,this.b*r+this.d*o+this.f)},o.prototype.rotate=function(t){var e=Math.cos(t),n=Math.sin(t);return new this.constructor(this.a*e+this.c*n,this.b*e+this.d*n,this.a*-n+this.c*e,this.b*-n+this.d*e,this.e,this.f)},o.prototype.rotateAt=function(t,e){var n=Math.cos(t),r=Math.sin(t),o=e.x,i=e.y,a=this.a*n+this.c*r,s=this.b*n+this.d*r,u=this.c*n-this.a*r,c=this.d*n-this.b*r;return new this.constructor(a,s,u,c,(this.a-a)*o+(this.c-u)*i+this.e,(this.b-s)*o+(this.d-c)*i+this.f)},o.prototype.rotateFromVector=function(t){var e=t.unit(),n=e.x,r=e.y;return new this.constructor(this.a*n+this.c*r,this.b*n+this.d*r,this.a*-r+this.c*n,this.b*-r+this.d*n,this.e,this.f)},o.prototype.flipX=function(){return new this.constructor(-this.a,-this.b,this.c,this.d,this.e,this.f)},o.prototype.flipY=function(){return new this.constructor(this.a,this.b,-this.c,-this.d,this.e,this.f)},o.prototype.skewX=function(t){var e=Math.tan(t);return new this.constructor(this.a,this.b,this.c+this.a*e,this.d+this.b*e,this.e,this.f)},o.prototype.skewY=function(t){var e=Math.tan(t);return new this.constructor(this.a+this.c*e,this.b+this.d*e,this.c,this.d,this.e,this.f)},o.prototype.isIdentity=function(){return 1===this.a&&0===this.b&&0===this.c&&1===this.d&&0===this.e&&0===this.f},o.prototype.isInvertible=function(){return this.a*this.d-this.b*this.c!=0},o.prototype.getScale=function(){return{scaleX:Math.sqrt(this.a*this.a+this.c*this.c),scaleY:Math.sqrt(this.b*this.b+this.d*this.d)}},o.prototype.getDecomposition=function(){var t=.5*(this.a+this.d),e=.5*(this.a-this.d),n=.5*(this.b+this.c),r=.5*(this.b-this.c),o=Math.sqrt(t*t+r*r),i=Math.sqrt(e*e+n*n),a=o+i,s=o-i,u=Math.atan2(n,e),c=Math.atan2(r,t),l=.5*(c-u),f=.5*(c+u);return{translation:new this.constructor(1,0,0,1,this.e,this.f),rotation:this.constructor.IDENTITY.rotate(f),scale:new this.constructor(a,0,0,s,0,0),rotation0:this.constructor.IDENTITY.rotate(l)}},o.prototype.equals=function(t){return this.a===t.a&&this.b===t.b&&this.c===t.c&&this.d===t.d&&this.e===t.e&&this.f===t.f},o.prototype.precisionEquals=function(t,e){return Math.abs(this.a-t.a)<e&&Math.abs(this.b-t.b)<e&&Math.abs(this.c-t.c)<e&&Math.abs(this.d-t.d)<e&&Math.abs(this.e-t.e)<e&&Math.abs(this.f-t.f)<e},o.prototype.toString=function(){return"matrix("+[this.a,this.b,this.c,this.d,this.e,this.f].join(",")+")"},t.exports=o},function(t,e,n){var r=n(4).Point2D,o=n(4).Vector2D,i=n(385).Polynomial;function a(t){var e=t.slice();return e.push(t[0]),e}function s(t){this.init(t)}s.prototype.init=function(t){this.status=t,this.points=new Array},s.prototype.appendPoint=function(t){this.points.push(t)},s.prototype.appendPoints=function(t){this.points=this.points.concat(t)},s.intersect=function(t,e){var n;if(null!=t&&null!=e)if("Path"==t.name)n=s.intersectPathShape(t,e);else if("Path"==e.name)n=s.intersectPathShape(e,t);else{var r,o;if(t.name<e.name?(r="intersect"+t.name+e.name,o=t.args.concat(e.args)):(r="intersect"+e.name+t.name,o=e.args.concat(t.args)),!(r in s))throw new Error("Intersection not available: "+r);n=s[r].apply(null,o)}else n=new s("No Intersection");return n},s.intersectPathShape=function(t,e){for(var n=new s("No Intersection"),r=t.args.length,o=0;o<r;o++){var i=t.args[o],a=s.intersect(i,e);n.appendPoints(a.points)}return n.points.length>0&&(n.status="Intersection"),n},s.intersectBezier2Bezier2=function(t,e,n,o,a,u){var c,l,f,h,y,p,d=new s("No Intersection");x=e.multiply(-2),c=t.add(x.add(n)),x=t.multiply(-2),v=e.multiply(2),l=x.add(v),f=new r(t.x,t.y),x=a.multiply(-2),h=o.add(x.add(u)),x=o.multiply(-2),v=a.multiply(2),y=x.add(v),p=new r(o.x,o.y);for(var x=c.x*l.y-l.x*c.y,v=h.x*l.y-l.x*h.y,g=y.x*l.y-l.x*y.y,m=l.x*(f.y-p.y)+l.y*(-f.x+p.x),w=h.x*c.y-c.x*h.y,b=y.x*c.y-c.x*y.y,_=c.x*(f.y-p.y)+c.y*(-f.x+p.x),E=new i(-w*w,-2*w*b,x*v-b*b-2*w*_,x*g-2*b*_,x*m-_*_).getRoots(),A=0;A<E.length;A++){var M=E[A];if(0<=M&&M<=1){var C=new i(c.x,l.x,f.x-p.x-M*y.x-M*M*h.x);C.simplify();var k=C.getRoots(),N=new i(c.y,l.y,f.y-p.y-M*y.y-M*M*h.y);N.simplify();var P=N.getRoots();if(k.length>0&&P.length>0)t:for(var O=0;O<k.length;O++){var S=k[O];if(0<=S&&S<=1)for(var T=0;T<P.length;T++)if(Math.abs(S-P[T])<1e-4){d.points.push(h.multiply(M*M).add(y.multiply(M).add(p)));break t}}}}return d.points.length>0&&(d.status="Intersection"),d},s.intersectBezier2Bezier3=function(t,e,n,a,u,c,l){var f,h,y,p,d,x,v,g,m,w,b,_=new s("No Intersection");f=e.multiply(-2),d=t.add(f.add(n)),f=t.multiply(-2),h=e.multiply(2),x=f.add(h),v=new r(t.x,t.y),f=a.multiply(-1),h=u.multiply(3),y=c.multiply(-3),p=f.add(h.add(y.add(l))),g=new o(p.x,p.y),f=a.multiply(3),h=u.multiply(-6),y=c.multiply(3),p=f.add(h.add(y)),m=new o(p.x,p.y),f=a.multiply(-3),h=u.multiply(3),y=f.add(h),w=new o(y.x,y.y),b=new o(a.x,a.y);for(var E=v.x*v.x,A=v.y*v.y,M=x.x*x.x,C=x.y*x.y,k=d.x*d.x,N=d.y*d.y,P=b.x*b.x,O=b.y*b.y,S=w.x*w.x,T=w.y*w.y,j=m.x*m.x,I=m.y*m.y,R=g.x*g.x,L=g.y*g.y,B=new i(-2*d.x*d.y*g.x*g.y+k*L+N*R,-2*d.x*d.y*m.x*g.y-2*d.x*d.y*m.y*g.x+2*N*m.x*g.x+2*k*m.y*g.y,-2*d.x*w.x*d.y*g.y-2*d.x*d.y*w.y*g.x-2*d.x*d.y*m.x*m.y+2*w.x*N*g.x+N*j+k*(2*w.y*g.y+I),2*v.x*d.x*d.y*g.y+2*v.y*d.x*d.y*g.x+x.x*x.y*d.x*g.y+x.x*x.y*d.y*g.x-2*b.x*d.x*d.y*g.y-2*d.x*b.y*d.y*g.x-2*d.x*w.x*d.y*m.y-2*d.x*d.y*w.y*m.x-2*v.x*N*g.x-2*v.y*k*g.y+2*b.x*N*g.x+2*w.x*N*m.x-C*d.x*g.x-M*d.y*g.y+k*(2*b.y*g.y+2*w.y*m.y),2*v.x*d.x*d.y*m.y+2*v.y*d.x*d.y*m.x+x.x*x.y*d.x*m.y+x.x*x.y*d.y*m.x-2*b.x*d.x*d.y*m.y-2*d.x*b.y*d.y*m.x-2*d.x*w.x*d.y*w.y-2*v.x*N*m.x-2*v.y*k*m.y+2*b.x*N*m.x-C*d.x*m.x-M*d.y*m.y+S*N+k*(2*b.y*m.y+T),2*v.x*d.x*d.y*w.y+2*v.y*d.x*w.x*d.y+x.x*x.y*d.x*w.y+x.x*x.y*w.x*d.y-2*b.x*d.x*d.y*w.y-2*d.x*b.y*w.x*d.y-2*v.x*w.x*N-2*v.y*k*w.y+2*b.x*w.x*N-C*d.x*w.x-M*d.y*w.y+2*k*b.y*w.y,-2*v.x*v.y*d.x*d.y-v.x*x.x*x.y*d.y-v.y*x.x*x.y*d.x+2*v.x*d.x*b.y*d.y+2*v.y*b.x*d.x*d.y+x.x*b.x*x.y*d.y+x.x*x.y*d.x*b.y-2*b.x*d.x*b.y*d.y-2*v.x*b.x*N+v.x*C*d.x+v.y*M*d.y-2*v.y*k*b.y-b.x*C*d.x-M*b.y*d.y+E*N+A*k+P*N+k*O).getRootsInInterval(0,1),D=0;D<B.length;D++){var z=B[D],U=new i(d.x,x.x,v.x-b.x-z*w.x-z*z*m.x-z*z*z*g.x).getRoots(),F=new i(d.y,x.y,v.y-b.y-z*w.y-z*z*m.y-z*z*z*g.y).getRoots();if(U.length>0&&F.length>0)t:for(var q=0;q<U.length;q++){var Y=U[q];if(0<=Y&&Y<=1)for(var V=0;V<F.length;V++)if(Math.abs(Y-F[V])<1e-4){_.points.push(g.multiply(z*z*z).add(m.multiply(z*z).add(w.multiply(z).add(b))));break t}}}return _.points.length>0&&(_.status="Intersection"),_},s.intersectBezier2Circle=function(t,e,n,r,o){return s.intersectBezier2Ellipse(t,e,n,r,o,o)},s.intersectBezier2Ellipse=function(t,e,n,o,a,u){var c,l,f,h,y,p=new s("No Intersection");c=e.multiply(-2),f=t.add(c.add(n)),c=t.multiply(-2),l=e.multiply(2),h=c.add(l),y=new r(t.x,t.y);for(var d=a*a,x=u*u,v=new i(x*f.x*f.x+d*f.y*f.y,2*(x*f.x*h.x+d*f.y*h.y),x*(2*f.x*y.x+h.x*h.x)+d*(2*f.y*y.y+h.y*h.y)-2*(x*o.x*f.x+d*o.y*f.y),2*(x*h.x*(y.x-o.x)+d*h.y*(y.y-o.y)),x*(y.x*y.x+o.x*o.x)+d*(y.y*y.y+o.y*o.y)-2*(x*o.x*y.x+d*o.y*y.y)-d*x).getRoots(),g=0;g<v.length;g++){var m=v[g];0<=m&&m<=1&&p.points.push(f.multiply(m*m).add(h.multiply(m).add(y)))}return p.points.length>0&&(p.status="Intersection"),p},s.intersectBezier2Line=function(t,e,n,a,u){var c,l,f,h,y,p,d,x=a.min(u),v=a.max(u),g=new s("No Intersection");c=e.multiply(-2),f=t.add(c.add(n)),c=t.multiply(-2),l=e.multiply(2),h=c.add(l),y=new r(t.x,t.y),d=new o(a.y-u.y,u.x-a.x),p=a.x*u.y-u.x*a.y,roots=new i(d.dot(f),d.dot(h),d.dot(y)+p).getRoots();for(var m=0;m<roots.length;m++){var w=roots[m];if(0<=w&&w<=1){var b=t.lerp(e,w),_=e.lerp(n,w),E=b.lerp(_,w);a.x==u.x?x.y<=E.y&&E.y<=v.y&&(g.status="Intersection",g.appendPoint(E)):a.y==u.y?x.x<=E.x&&E.x<=v.x&&(g.status="Intersection",g.appendPoint(E)):x.x<=E.x&&E.x<=v.x&&x.y<=E.y&&E.y<=v.y&&(g.status="Intersection",g.appendPoint(E))}}return g},s.intersectBezier2Polygon=function(t,e,n,r){return s.intersectBezier2Polyline(t,e,n,a(r))},s.intersectBezier2Polyline=function(t,e,n,r){for(var o=new s("No Intersection"),i=r.length,a=0;a<i-1;a++){var u=r[a],c=r[a+1],l=s.intersectBezier2Line(t,e,n,u,c);o.appendPoints(l.points)}return o.points.length>0&&(o.status="Intersection"),o},s.intersectBezier2Rectangle=function(t,e,n,o,i){var a=o.min(i),u=o.max(i),c=new r(u.x,a.y),l=new r(a.x,u.y),f=s.intersectBezier2Line(t,e,n,a,c),h=s.intersectBezier2Line(t,e,n,c,u),y=s.intersectBezier2Line(t,e,n,u,l),p=s.intersectBezier2Line(t,e,n,l,a),d=new s("No Intersection");return d.appendPoints(f.points),d.appendPoints(h.points),d.appendPoints(y.points),d.appendPoints(p.points),d.points.length>0&&(d.status="Intersection"),d},s.intersectBezier3Bezier3=function(t,e,n,r,a,u,c,l){var f,h,y,p,d,x,v,g,m,w=new s("No Intersection");b=t.multiply(-1),_=e.multiply(3),f=n.multiply(-3),k=b.add(_.add(f.add(r))),h=new o(k.x,k.y),b=t.multiply(3),_=e.multiply(-6),f=n.multiply(3),k=b.add(_.add(f)),y=new o(k.x,k.y),b=t.multiply(-3),_=e.multiply(3),f=b.add(_),p=new o(f.x,f.y),d=new o(t.x,t.y),b=a.multiply(-1),_=u.multiply(3),f=c.multiply(-3),k=b.add(_.add(f.add(l))),x=new o(k.x,k.y),b=a.multiply(3),_=u.multiply(-6),f=c.multiply(3),k=b.add(_.add(f)),v=new o(k.x,k.y),b=a.multiply(-3),_=u.multiply(3),f=b.add(_),g=new o(f.x,f.y),m=new o(a.x,a.y);var b=h.x*y.y-y.x*h.y,_=h.x*p.y-p.x*h.y,E=h.x*d.y-d.x*h.y+m.x*h.y-h.x*m.y,A=g.x*h.y-h.x*g.y,M=v.x*h.y-h.x*v.y,C=x.x*h.y-h.x*x.y,k=h.x*p.y-p.x*h.y,N=h.x*d.y+y.x*p.y-p.x*y.y-d.x*h.y+m.x*h.y-h.x*m.y,P=g.x*h.y-h.x*g.y,O=v.x*h.y-h.x*v.y,S=x.x*h.y-h.x*x.y,T=y.x*d.y-d.x*y.y+m.x*y.y-y.x*m.y,j=g.x*y.y-y.x*g.y,I=v.x*y.y-y.x*v.y,R=x.x*y.y-y.x*x.y,L=h.x*d.y-d.x*h.y+m.x*h.y-h.x*m.y,B=g.x*h.y-h.x*g.y,D=v.x*h.y-h.x*v.y,z=x.x*h.y-h.x*x.y,U=y.x*d.y-d.x*y.y+m.x*y.y-y.x*m.y,F=g.x*y.y-y.x*g.y,q=v.x*y.y-y.x*v.y,Y=x.x*y.y-y.x*x.y,V=p.x*d.y-d.x*p.y+m.x*p.y-p.x*m.y,H=g.x*p.y-p.x*g.y,X=v.x*p.y-p.x*v.y,$=x.x*p.y-p.x*x.y,W=new i(-C*S*z,-C*S*D-C*O*z-M*S*z,-C*S*B-C*O*D-M*S*D-C*P*z-M*O*z-A*S*z,-C*S*L-C*O*B-M*S*B-C*P*D-M*O*D-A*S*D-C*N*z-M*P*z-A*O*z-E*S*z+_*R*z+C*k*Y-b*R*Y+b*S*$,-C*O*L-M*S*L-C*P*B-M*O*B-A*S*B-C*N*D-M*P*D-A*O*D-E*S*D+_*R*D-M*N*z-A*P*z-E*O*z+_*I*z+C*k*q-b*R*q+M*k*Y-b*I*Y+b*S*X+b*O*$,-C*P*L-M*O*L-A*S*L-C*N*B-M*P*B-A*O*B-E*S*B+_*R*B-M*N*D-A*P*D-E*O*D+_*I*D-A*N*z-E*P*z+_*j*z+C*k*F-b*R*F+M*k*q-b*I*q+A*k*Y-b*j*Y+b*S*H+b*O*X+b*P*$,-C*N*L-M*P*L-A*O*L-E*S*L+_*R*L-M*N*B-A*P*B-E*O*B+_*I*B-A*N*D-E*P*D+_*j*D-E*N*z+_*T*z+C*k*U-b*R*U+M*k*F-b*I*F+A*k*q-b*j*q+E*k*Y-b*T*Y+b*S*V+b*O*H+b*P*X-_*k*$+b*N*$,-M*N*L-A*P*L-E*O*L+_*I*L-A*N*B-E*P*B+_*j*B-E*N*D+_*T*D+M*k*U-b*I*U+A*k*F-b*j*F+E*k*q-b*T*q+b*O*V+b*P*H-_*k*X+b*N*X,-A*N*L-E*P*L+_*j*L-E*N*B+_*T*B+A*k*U-b*j*U+E*k*F-b*T*F+b*P*V-_*k*H+b*N*H,-E*N*L+_*T*L+E*k*U-b*T*U-_*k*V+b*N*V);W.simplify();for(var Z=W.getRootsInInterval(0,1),G=0;G<Z.length;G++){var K=Z[G],Q=new i(h.x,y.x,p.x,d.x-m.x-K*g.x-K*K*v.x-K*K*K*x.x);Q.simplify(),xRoots=Q.getRoots();var J=new i(h.y,y.y,p.y,d.y-m.y-K*g.y-K*K*v.y-K*K*K*x.y);if(J.simplify(),yRoots=J.getRoots(),xRoots.length>0&&yRoots.length>0)t:for(var tt=0;tt<xRoots.length;tt++){var et=xRoots[tt];if(0<=et&&et<=1)for(var nt=0;nt<yRoots.length;nt++)if(Math.abs(et-yRoots[nt])<1e-4){w.points.push(x.multiply(K*K*K).add(v.multiply(K*K).add(g.multiply(K).add(m))));break t}}}return w.points.length>0&&(w.status="Intersection"),w},s.intersectBezier3Circle=function(t,e,n,r,o,i){return s.intersectBezier3Ellipse(t,e,n,r,o,i,i)},s.intersectBezier3Ellipse=function(t,e,n,r,a,u,c){var l,f,h,y,p,d,x,v,g=new s("No Intersection");l=t.multiply(-1),f=e.multiply(3),h=n.multiply(-3),y=l.add(f.add(h.add(r))),p=new o(y.x,y.y),l=t.multiply(3),f=e.multiply(-6),h=n.multiply(3),y=l.add(f.add(h)),d=new o(y.x,y.y),l=t.multiply(-3),f=e.multiply(3),h=l.add(f),x=new o(h.x,h.y),v=new o(t.x,t.y);for(var m=u*u,w=c*c,b=new i(p.x*p.x*w+p.y*p.y*m,2*(p.x*d.x*w+p.y*d.y*m),2*(p.x*x.x*w+p.y*x.y*m)+d.x*d.x*w+d.y*d.y*m,2*p.x*w*(v.x-a.x)+2*p.y*m*(v.y-a.y)+2*(d.x*x.x*w+d.y*x.y*m),2*d.x*w*(v.x-a.x)+2*d.y*m*(v.y-a.y)+x.x*x.x*w+x.y*x.y*m,2*x.x*w*(v.x-a.x)+2*x.y*m*(v.y-a.y),v.x*v.x*w-2*v.y*a.y*m-2*v.x*a.x*w+v.y*v.y*m+a.x*a.x*w+a.y*a.y*m-m*w).getRootsInInterval(0,1),_=0;_<b.length;_++){var E=b[_];g.points.push(p.multiply(E*E*E).add(d.multiply(E*E).add(x.multiply(E).add(v))))}return g.points.length>0&&(g.status="Intersection"),g},s.intersectBezier3Line=function(t,e,n,r,a,u){var c,l,f,h,y,p,d,x,v,g,m=a.min(u),w=a.max(u),b=new s("No Intersection");c=t.multiply(-1),l=e.multiply(3),f=n.multiply(-3),h=c.add(l.add(f.add(r))),y=new o(h.x,h.y),c=t.multiply(3),l=e.multiply(-6),f=n.multiply(3),h=c.add(l.add(f)),p=new o(h.x,h.y),c=t.multiply(-3),l=e.multiply(3),f=c.add(l),d=new o(f.x,f.y),x=new o(t.x,t.y),g=new o(a.y-u.y,u.x-a.x),v=a.x*u.y-u.x*a.y,roots=new i(g.dot(y),g.dot(p),g.dot(d),g.dot(x)+v).getRoots();for(var _=0;_<roots.length;_++){var E=roots[_];if(0<=E&&E<=1){var A=t.lerp(e,E),M=e.lerp(n,E),C=n.lerp(r,E),k=A.lerp(M,E),N=M.lerp(C,E),P=k.lerp(N,E);a.x==u.x?m.y<=P.y&&P.y<=w.y&&(b.status="Intersection",b.appendPoint(P)):a.y==u.y?m.x<=P.x&&P.x<=w.x&&(b.status="Intersection",b.appendPoint(P)):m.x<=P.x&&P.x<=w.x&&m.y<=P.y&&P.y<=w.y&&(b.status="Intersection",b.appendPoint(P))}}return b},s.intersectBezier3Polygon=function(t,e,n,r,o){return this.intersectBezier3Polyline(t,e,n,r,a(o))},s.intersectBezier3Polyline=function(t,e,n,r,o){for(var i=new s("No Intersection"),a=o.length,u=0;u<a-1;u++){var c=o[u],l=o[u+1],f=s.intersectBezier3Line(t,e,n,r,c,l);i.appendPoints(f.points)}return i.points.length>0&&(i.status="Intersection"),i},s.intersectBezier3Rectangle=function(t,e,n,o,i,a){var u=i.min(a),c=i.max(a),l=new r(c.x,u.y),f=new r(u.x,c.y),h=s.intersectBezier3Line(t,e,n,o,u,l),y=s.intersectBezier3Line(t,e,n,o,l,c),p=s.intersectBezier3Line(t,e,n,o,c,f),d=s.intersectBezier3Line(t,e,n,o,f,u),x=new s("No Intersection");return x.appendPoints(h.points),x.appendPoints(y.points),x.appendPoints(p.points),x.appendPoints(d.points),x.points.length>0&&(x.status="Intersection"),x},s.intersectCircleCircle=function(t,e,n,o){var i,a=e+o,u=Math.abs(e-o),c=t.distanceFrom(n);if(c>a)i=new s("Outside");else if(c<u)i=new s("Inside");else{i=new s("Intersection");var l=(e*e-o*o+c*c)/(2*c),f=Math.sqrt(e*e-l*l),h=t.lerp(n,l/c),y=f/c;i.points.push(new r(h.x-y*(n.y-t.y),h.y+y*(n.x-t.x))),i.points.push(new r(h.x+y*(n.y-t.y),h.y-y*(n.x-t.x)))}return i},s.intersectCircleEllipse=function(t,e,n,r,o){return s.intersectEllipseEllipse(t,e,e,n,r,o)},s.intersectCircleLine=function(t,e,n,r){var o,i=(r.x-n.x)*(r.x-n.x)+(r.y-n.y)*(r.y-n.y),a=2*((r.x-n.x)*(n.x-t.x)+(r.y-n.y)*(n.y-t.y)),u=a*a-4*i*(t.x*t.x+t.y*t.y+n.x*n.x+n.y*n.y-2*(t.x*n.x+t.y*n.y)-e*e);if(u<0)o=new s("Outside");else if(0==u)o=new s("Tangent");else{var c=Math.sqrt(u),l=(-a+c)/(2*i),f=(-a-c)/(2*i);(l<0||l>1)&&(f<0||f>1)?o=new s(l<0&&f<0||l>1&&f>1?"Outside":"Inside"):(o=new s("Intersection"),0<=l&&l<=1&&o.points.push(n.lerp(r,l)),0<=f&&f<=1&&o.points.push(n.lerp(r,f)))}return o},s.intersectCirclePolygon=function(t,e,n){return this.intersectCirclePolyline(t,e,a(n))},s.intersectCirclePolyline=function(t,e,n){for(var r,o=new s("No Intersection"),i=n.length,a=0;a<i-1;a++){var u=n[a],c=n[a+1];r=s.intersectCircleLine(t,e,u,c),o.appendPoints(r.points)}return o.points.length>0?o.status="Intersection":o.status=r.status,o},s.intersectCircleRectangle=function(t,e,n,o){var i=n.min(o),a=n.max(o),u=new r(a.x,i.y),c=new r(i.x,a.y),l=s.intersectCircleLine(t,e,i,u),f=s.intersectCircleLine(t,e,u,a),h=s.intersectCircleLine(t,e,a,c),y=s.intersectCircleLine(t,e,c,i),p=new s("No Intersection");return p.appendPoints(l.points),p.appendPoints(f.points),p.appendPoints(h.points),p.appendPoints(y.points),p.points.length>0?p.status="Intersection":p.status=l.status,p},s.intersectEllipseEllipse=function(t,e,n,o,a,u){for(var c=[n*n,0,e*e,-2*n*n*t.x,-2*e*e*t.y,n*n*t.x*t.x+e*e*t.y*t.y-e*e*n*n],l=[u*u,0,a*a,-2*u*u*o.x,-2*a*a*o.y,u*u*o.x*o.x+a*a*o.y*o.y-a*a*u*u],f=s.bezout(c,l).getRoots(),h=.001*(c[0]*c[0]+2*c[1]*c[1]+c[2]*c[2]),y=.001*(l[0]*l[0]+2*l[1]*l[1]+l[2]*l[2]),p=new s("No Intersection"),d=0;d<f.length;d++)for(var x=new i(c[0],c[3]+f[d]*c[1],c[5]+f[d]*(c[4]+f[d]*c[2])).getRoots(),v=0;v<x.length;v++){var g=(c[0]*x[v]+c[1]*f[d]+c[3])*x[v]+(c[2]*f[d]+c[4])*f[d]+c[5];Math.abs(g)<h&&(g=(l[0]*x[v]+l[1]*f[d]+l[3])*x[v]+(l[2]*f[d]+l[4])*f[d]+l[5],Math.abs(g)<y&&p.appendPoint(new r(x[v],f[d])))}return p.points.length>0&&(p.status="Intersection"),p},s.intersectEllipseLine=function(t,e,n,r,i){var a,u=new o(r.x,r.y),c=o.fromPoints(r,i),l=new o(t.x,t.y),f=u.subtract(l),h=new o(c.x/(e*e),c.y/(n*n)),y=new o(f.x/(e*e),f.y/(n*n)),p=c.dot(h),d=c.dot(y),x=d*d-p*(t=f.dot(y)-1);if(x<0)a=new s("Outside");else if(x>0){var v=Math.sqrt(x),g=(-d-v)/p,m=(-d+v)/p;(g<0||1<g)&&(m<0||1<m)?a=new s(g<0&&m<0||g>1&&m>1?"Outside":"Inside"):(a=new s("Intersection"),0<=g&&g<=1&&a.appendPoint(r.lerp(i,g)),0<=m&&m<=1&&a.appendPoint(r.lerp(i,m)))}else{var w=-d/p;0<=w&&w<=1?(a=new s("Intersection")).appendPoint(r.lerp(i,w)):a=new s("Outside")}return a},s.intersectEllipsePolygon=function(t,e,n,r){return this.intersectEllipsePolyline(t,e,n,a(r))},s.intersectEllipsePolyline=function(t,e,n,r){for(var o=new s("No Intersection"),i=r.length,a=0;a<i-1;a++){var u=r[a],c=r[a+1],l=s.intersectEllipseLine(t,e,n,u,c);o.appendPoints(l.points)}return o.points.length>0&&(o.status="Intersection"),o},s.intersectEllipseRectangle=function(t,e,n,o,i){var a=o.min(i),u=o.max(i),c=new r(u.x,a.y),l=new r(a.x,u.y),f=s.intersectEllipseLine(t,e,n,a,c),h=s.intersectEllipseLine(t,e,n,c,u),y=s.intersectEllipseLine(t,e,n,u,l),p=s.intersectEllipseLine(t,e,n,l,a),d=new s("No Intersection");return d.appendPoints(f.points),d.appendPoints(h.points),d.appendPoints(y.points),d.appendPoints(p.points),d.points.length>0&&(d.status="Intersection"),d},s.intersectLineLine=function(t,e,n,o){var i,a=(o.x-n.x)*(t.y-n.y)-(o.y-n.y)*(t.x-n.x),u=(e.x-t.x)*(t.y-n.y)-(e.y-t.y)*(t.x-n.x),c=(o.y-n.y)*(e.x-t.x)-(o.x-n.x)*(e.y-t.y);if(0!=c){var l=a/c,f=u/c;0<=l&&l<=1&&0<=f&&f<=1?(i=new s("Intersection")).points.push(new r(t.x+l*(e.x-t.x),t.y+l*(e.y-t.y))):i=new s("No Intersection")}else i=new s(0==a||0==u?"Coincident":"Parallel");return i},s.intersectLinePolygon=function(t,e,n){return this.intersectLinePolyline(t,e,a(n))},s.intersectLinePolyline=function(t,e,n){for(var r=new s("No Intersection"),o=n.length,i=0;i<o-1;i++){var a=n[i],u=n[i+1],c=s.intersectLineLine(t,e,a,u);r.appendPoints(c.points)}return r.points.length>0&&(r.status="Intersection"),r},s.intersectLineRectangle=function(t,e,n,o){var i=n.min(o),a=n.max(o),u=new r(a.x,i.y),c=new r(i.x,a.y),l=s.intersectLineLine(i,u,t,e),f=s.intersectLineLine(u,a,t,e),h=s.intersectLineLine(a,c,t,e),y=s.intersectLineLine(c,i,t,e),p=new s("No Intersection");return p.appendPoints(l.points),p.appendPoints(f.points),p.appendPoints(h.points),p.appendPoints(y.points),p.points.length>0&&(p.status="Intersection"),p},s.intersectPolygonPolygon=function(t,e){return this.intersectPolylinePolyline(a(t),a(e))},s.intersectPolygonPolyline=function(t,e){return this.intersectPolylinePolyline(a(t),e)},s.intersectPolygonRectangle=function(t,e,n){return this.intersectPolylineRectangle(a(t),e,n)},s.intersectPolylinePolyline=function(t,e){for(var n=new s("No Intersection"),r=t.length,o=0;o<r-1;o++){var i=t[o],a=t[o+1],u=s.intersectLinePolyline(i,a,e);n.appendPoints(u.points)}return n.points.length>0&&(n.status="Intersection"),n},s.intersectPolylineRectangle=function(t,e,n){var o=e.min(n),i=e.max(n),a=new r(i.x,o.y),u=new r(o.x,i.y),c=s.intersectLinePolyline(o,a,t),l=s.intersectLinePolyline(a,i,t),f=s.intersectLinePolyline(i,u,t),h=s.intersectLinePolyline(u,o,t),y=new s("No Intersection");return y.appendPoints(c.points),y.appendPoints(l.points),y.appendPoints(f.points),y.appendPoints(h.points),y.points.length>0&&(y.status="Intersection"),y},s.intersectRectangleRectangle=function(t,e,n,o){var i=t.min(e),a=t.max(e),u=new r(a.x,i.y),c=new r(i.x,a.y),l=s.intersectLineRectangle(i,u,n,o),f=s.intersectLineRectangle(u,a,n,o),h=s.intersectLineRectangle(a,c,n,o),y=s.intersectLineRectangle(c,i,n,o),p=new s("No Intersection");return p.appendPoints(l.points),p.appendPoints(f.points),p.appendPoints(h.points),p.appendPoints(y.points),p.points.length>0&&(p.status="Intersection"),p},s.intersectRayRay=function(t,e,n,o){var i,a=(o.x-n.x)*(t.y-n.y)-(o.y-n.y)*(t.x-n.x),u=(e.x-t.x)*(t.y-n.y)-(e.y-t.y)*(t.x-n.x),c=(o.y-n.y)*(e.x-t.x)-(o.x-n.x)*(e.y-t.y);if(0!=c){var l=a/c;(i=new s("Intersection")).points.push(new r(t.x+l*(e.x-t.x),t.y+l*(e.y-t.y)))}else i=new s(0==a||0==u?"Coincident":"Parallel");return i},s.bezout=function(t,e){var n=t[0]*e[1]-e[0]*t[1],r=t[0]*e[2]-e[0]*t[2],o=t[0]*e[3]-e[0]*t[3],a=t[0]*e[4]-e[0]*t[4],s=t[0]*e[5]-e[0]*t[5],u=t[1]*e[2]-e[1]*t[2],c=t[1]*e[4]-e[1]*t[4],l=t[1]*e[5]-e[1]*t[5],f=t[2]*e[3]-e[2]*t[3],h=t[3]*e[4]-e[3]*t[4],y=t[3]*e[5]-e[3]*t[5],p=l+h,d=c-f;return new i(n*u-r*r,n*d+o*u-2*r*a,n*p+o*d-a*a-2*r*s,n*y+o*p-2*a*s,o*y-s*s)},t.exports=s},function(t,e,n){e.Polynomial=n(146),e.SqrtPolynomial=n(386)},function(t,e,n){var r=n(146);function o(){this.init(arguments)}o.VERSION=1,o.prototype=new r,o.prototype.constructor=o,o.superclass=r.prototype,o.prototype.eval=function(t){var e=o.superclass.eval.call(this,t);if(Math.abs(e)<1e-7&&(e=0),e<0)throw new Error("SqrtPolynomial.eval: cannot take square root of negative number");return Math.sqrt(e)},o.prototype.toString=function(){return"sqrt("+o.superclass.toString.call(this)+")"},t.exports=o},function(t,e,n){var r=n(4).Point2D,o=n(82),i={quadraticBezier:function(t,e,n,i,a,s){return new o("Bezier2",[new r(t,e),new r(n,i),new r(a,s)])},cubicBezier:function(t,e,n,i,a,s,u,c){return new o("Bezier3",[new r(t,e),new r(n,i),new r(a,s),new r(u,c)])},circle:function(t,e,n){return new o("Circle",[new r(t,e),n])},ellipse:function(t,e,n,i){return new o("Ellipse",[new r(t,e),n,i])},line:function(t,e,n,i){return new o("Line",[new r(t,e),new r(n,i)])},path:function(t){return new o("Path",t)},polygon:function(t){for(var e=[],n=0;n<t.length;n+=2)e.push(new r(t[n],t[n+1]));return new o("Polygon",[e])},polyline:function(t){for(var e=[],n=0;n<t.length;n+=2)e.push(new r(t[n],t[n+1]));return new o("Polyline",[e])},rectangle:function(t,e,n,i){return new o("Rectangle",[new r(t,e),new r(t+n,e+i)])}};t.exports=i},function(t,e,n){n(4).Point2D;var r=n(82),o={quadraticBezier:function(t,e,n){return new r("Bezier2",[t,e,n])},cubicBezier:function(t,e,n,o){return new r("Bezier3",[t,e,n,o])},circle:function(t,e){return new r("Circle",[t,e])},ellipse:function(t,e,n){return new r("Ellipse",[t,e,n])},line:function(t,e){return new r("Line",[t,e])},path:function(t){return new r("Path",[t])},polygon:function(t){return new r("Polygon",[t])},polyline:function(t){return new r("Polyline",[t])},rectangle:function(t,e){return new r("Rectangle",[t,t.add(e)])}};t.exports=o},function(t,e,n){var r=n(4).Vector2D,o={pointInCircle:function(t,e,n){return r.fromPoints(e,t).length()<=n},pointInEllipse:function(t,e,n,r){var o=t.subtract(e);return o.x*o.x/(n*n)+o.y*o.y/(r*r)<=1},pointInPolyline:function(t,e){for(var n,r=e.length,o=0,i=e[0],a=1;a<=r;a++){var s=e[a%r],u=Math.min(i.y,s.y),c=Math.max(i.y,s.y),l=Math.max(i.x,s.x);i.y!=s.y&&u<t.y&&t.y<=c&&t.x<=l&&(n=(t.y-i.y)*(s.x-i.x)/(s.y-i.y)+i.x,(i.x==s.x||t.x<=n)&&o++),i=s}return o%2==1}};o.pointInPolygon=o.pointInPolyline,o.pointInRectangle=function(t,e,n){return e.x<=t.x&&t.x<n.x&&e.y<=t.y&&t.y<n.y},t.exports=o},function(t,e,n){var r=n(0),o=n(391),i=n(83);function a(t){return i.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===t.type&&i.isCustomComponent(t.name,t.attribs)}t.exports=function t(e,n){for(var i,s,u,c,l=[],f="function"==typeof(n=n||{}).replace,h=0,y=e.length;h<y;h++)if(i=e[h],f&&(s=n.replace(i),r.isValidElement(s)))y>1&&(s=r.cloneElement(s,{key:s.key||h})),l.push(s);else if("text"!==i.type){if(u=i.attribs,a(i)||(u=o(i.attribs)),c=null,"script"===i.type||"style"===i.type)i.children[0]&&(u.dangerouslySetInnerHTML={__html:i.children[0].data});else{if("tag"!==i.type)continue;"textarea"===i.name&&i.children[0]?u.defaultValue=i.children[0].data:i.children&&i.children.length&&(c=t(i.children,n))}y>1&&(u.key=h),l.push(r.createElement(i.name,u,c))}else l.push(i.data);return 1===l.length?l[0]:l}},function(t,e,n){var r=n(147),o=n(394),i=n(397),a=n(83),s=o.config,u=o.HTMLDOMPropertyConfig.isCustomAttribute;r.injection.injectDOMPropertyConfig(o.HTMLDOMPropertyConfig),t.exports=function(t){t=t||{};var e,n,o,c={};for(e in t)n=t[e],u(e)?c[e]=n:(o=s.html[e.toLowerCase()])?r.properties.hasOwnProperty(o)&&r.properties[o].hasBooleanValue?c[o]=!0:c[o]=n:(o=s.svg[e])?c[o]=n:a.PRESERVE_CUSTOM_ATTRIBUTES&&(c[e]=n);return null!=t.style&&(c.style=function(t){if("string"!=typeof t)throw new TypeError("First argument must be a string.");var e={};return i(t,(function(t,n){t&&n&&(e[a.camelCase(t)]=n)})),e}(t.style)),c}},function(t,e,n){"use strict";t.exports=function(t){for(var e=arguments.length-1,n="Minified React error #"+t+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+t,r=0;r<e;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,o,i,a,s){if(!t){var u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,i,a,s],l=0;(u=new Error(e.replace(/%s/g,(function(){return c[l++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}}},function(t,e,n){var r,o=n(395),i=n(396),a=n(83),s={html:{},svg:{}};for(r in s.html=a.invertObject(o.DOMAttributeNames),o.Properties)s.html[r.toLowerCase()]=r;for(r in s.svg=a.invertObject(i.DOMAttributeNames),i.Properties)s.html[r]=r;t.exports={config:s,HTMLDOMPropertyConfig:o,SVGDOMPropertyConfig:i}},function(t,e,n){"use strict";var r=n(147),o=r.injection.MUST_USE_PROPERTY,i=r.injection.HAS_BOOLEAN_VALUE,a=r.injection.HAS_NUMERIC_VALUE,s=r.injection.HAS_POSITIVE_NUMERIC_VALUE,u=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE,c={isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+r.ATTRIBUTE_NAME_CHAR+"]*$")),Properties:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:i,allowTransparency:0,alt:0,as:0,async:i,autoComplete:0,autoPlay:i,capture:i,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:o|i,cite:0,classID:0,className:0,cols:s,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:i,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:i,defer:i,dir:0,disabled:i,download:u,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:i,formTarget:0,frameBorder:0,headers:0,height:0,hidden:i,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:i,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:o|i,muted:o|i,name:0,nonce:0,noValidate:i,open:i,optimum:0,pattern:0,placeholder:0,playsInline:i,poster:0,preload:0,profile:0,radioGroup:0,readOnly:i,referrerPolicy:0,rel:0,required:i,reversed:i,role:0,rows:s,rowSpan:a,sandbox:0,scope:0,scoped:i,scrolling:0,seamless:i,selected:o|i,shape:0,size:s,sizes:0,span:s,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:a,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:i,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{},DOMMutationMethods:{value:function(t,e){if(null==e)return t.removeAttribute("value");("number"!==t.type||!1===t.hasAttribute("value")||t.validity&&!t.validity.badInput&&t.ownerDocument.activeElement!==t)&&t.setAttribute("value",""+e)}}};t.exports=c},function(t,e,n){"use strict";var r="http://www.w3.org/1999/xlink",o="http://www.w3.org/XML/1998/namespace",i={accentHeight:"accent-height",accumulate:0,additive:0,alignmentBaseline:"alignment-baseline",allowReorder:"allowReorder",alphabetic:0,amplitude:0,arabicForm:"arabic-form",ascent:0,attributeName:"attributeName",attributeType:"attributeType",autoReverse:"autoReverse",azimuth:0,baseFrequency:"baseFrequency",baseProfile:"baseProfile",baselineShift:"baseline-shift",bbox:0,begin:0,bias:0,by:0,calcMode:"calcMode",capHeight:"cap-height",clip:0,clipPath:"clip-path",clipRule:"clip-rule",clipPathUnits:"clipPathUnits",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",contentScriptType:"contentScriptType",contentStyleType:"contentStyleType",cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:"diffuseConstant",direction:0,display:0,divisor:0,dominantBaseline:"dominant-baseline",dur:0,dx:0,dy:0,edgeMode:"edgeMode",elevation:0,enableBackground:"enable-background",end:0,exponent:0,externalResourcesRequired:"externalResourcesRequired",fill:0,fillOpacity:"fill-opacity",fillRule:"fill-rule",filter:0,filterRes:"filterRes",filterUnits:"filterUnits",floodColor:"flood-color",floodOpacity:"flood-opacity",focusable:0,fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",glyphRef:"glyphRef",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",hanging:0,horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",ideographic:0,imageRendering:"image-rendering",in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:"kernelMatrix",kernelUnitLength:"kernelUnitLength",kerning:0,keyPoints:"keyPoints",keySplines:"keySplines",keyTimes:"keyTimes",lengthAdjust:"lengthAdjust",letterSpacing:"letter-spacing",lightingColor:"lighting-color",limitingConeAngle:"limitingConeAngle",local:0,markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",markerHeight:"markerHeight",markerUnits:"markerUnits",markerWidth:"markerWidth",mask:0,maskContentUnits:"maskContentUnits",maskUnits:"maskUnits",mathematical:0,mode:0,numOctaves:"numOctaves",offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pathLength:"pathLength",patternContentUnits:"patternContentUnits",patternTransform:"patternTransform",patternUnits:"patternUnits",pointerEvents:"pointer-events",points:0,pointsAtX:"pointsAtX",pointsAtY:"pointsAtY",pointsAtZ:"pointsAtZ",preserveAlpha:"preserveAlpha",preserveAspectRatio:"preserveAspectRatio",primitiveUnits:"primitiveUnits",r:0,radius:0,refX:"refX",refY:"refY",renderingIntent:"rendering-intent",repeatCount:"repeatCount",repeatDur:"repeatDur",requiredExtensions:"requiredExtensions",requiredFeatures:"requiredFeatures",restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:"shape-rendering",slope:0,spacing:0,specularConstant:"specularConstant",specularExponent:"specularExponent",speed:0,spreadMethod:"spreadMethod",startOffset:"startOffset",stdDeviation:"stdDeviation",stemh:0,stemv:0,stitchTiles:"stitchTiles",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",string:0,stroke:0,strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",surfaceScale:"surfaceScale",systemLanguage:"systemLanguage",tableValues:"tableValues",targetX:"targetX",targetY:"targetY",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",textLength:"textLength",to:0,transform:0,u1:0,u2:0,underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicode:0,unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",values:0,vectorEffect:"vector-effect",version:0,vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",viewBox:"viewBox",viewTarget:"viewTarget",visibility:0,widths:0,wordSpacing:"word-spacing",writingMode:"writing-mode",x:0,xHeight:"x-height",x1:0,x2:0,xChannelSelector:"xChannelSelector",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlns:0,xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space",y:0,y1:0,y2:0,yChannelSelector:"yChannelSelector",z:0,zoomAndPan:"zoomAndPan"},a={Properties:{},DOMAttributeNamespaces:{xlinkActuate:r,xlinkArcrole:r,xlinkHref:r,xlinkRole:r,xlinkShow:r,xlinkTitle:r,xlinkType:r,xmlBase:o,xmlLang:o,xmlSpace:o},DOMAttributeNames:{}};Object.keys(i).forEach((function(t){a.Properties[t]=0,i[t]&&(a.DOMAttributeNames[t]=i[t])})),t.exports=a},function(t,e,n){var r=n(398);t.exports=function(t,e){if(!t||"string"!=typeof t)return null;for(var n,o,i,a=r("p{"+t+"}").stylesheet.rules[0].declarations,s=null,u="function"==typeof e,c=0,l=a.length;c<l;c++)o=(n=a[c]).property,i=n.value,u?e(o,i,n):i&&(s||(s={}),s[o]=i);return s}},function(t,e){var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function o(t){return t?t.replace(/^\s+|\s+$/g,""):""}function i(t,e){var n=t&&"string"==typeof t.type,o=n?t:e;for(var a in t){var s=t[a];Array.isArray(s)?s.forEach((function(t){i(t,o)})):s&&"object"==r(s)&&i(s,o)}return n&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:e||null}),t}t.exports=function(t,e){e=e||{};var r=1,a=1;function s(t){var e=t.match(/\n/g);e&&(r+=e.length);var n=t.lastIndexOf("\n");a=~n?t.length-n:a+t.length}function u(){var t={line:r,column:a};return function(e){return e.position=new c(t),x(),e}}function c(t){this.start=t,this.end={line:r,column:a},this.source=e.source}c.prototype.content=t;var l=[];function f(n){var o=new Error(e.source+":"+r+":"+a+": "+n);if(o.reason=n,o.filename=e.source,o.line=r,o.column=a,o.source=t,!e.silent)throw o;l.push(o)}function h(){return d(/^{\s*/)}function y(){return d(/^}/)}function p(){var e,n=[];for(x(),v(n);t.length&&"}"!=t.charAt(0)&&(e=N()||P());)!1!==e&&(n.push(e),v(n));return n}function d(e){var n=e.exec(t);if(n){var r=n[0];return s(r),t=t.slice(r.length),n}}function x(){d(/^\s*/)}function v(t){var e;for(t=t||[];e=g();)!1!==e&&t.push(e);return t}function g(){var e=u();if("/"==t.charAt(0)&&"*"==t.charAt(1)){for(var n=2;""!=t.charAt(n)&&("*"!=t.charAt(n)||"/"!=t.charAt(n+1));)++n;if(n+=2,""===t.charAt(n-1))return f("End of comment missing");var r=t.slice(2,n-2);return a+=2,s(r),t=t.slice(n),a+=2,e({type:"comment",comment:r})}}function m(){var t=d(/^([^{]+)/);if(t)return o(t[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(t){return t.replace(/,/g,"")})).split(/\s*(?![^(]*\)),\s*/).map((function(t){return t.replace(/\u200C/g,",")}))}function w(){var t=u(),e=d(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(e){if(e=o(e[0]),!d(/^:\s*/))return f("property missing ':'");var r=d(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),i=t({type:"declaration",property:e.replace(n,""),value:r?o(r[0]).replace(n,""):""});return d(/^[;\s]*/),i}}function b(){var t,e=[];if(!h())return f("missing '{'");for(v(e);t=w();)!1!==t&&(e.push(t),v(e));return y()?e:f("missing '}'")}function _(){for(var t,e=[],n=u();t=d(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)e.push(t[1]),d(/^,\s*/);if(e.length)return n({type:"keyframe",values:e,declarations:b()})}var E,A=k("import"),M=k("charset"),C=k("namespace");function k(t){var e=new RegExp("^@"+t+"\\s*([^;]+);");return function(){var n=u(),r=d(e);if(r){var o={type:t};return o[t]=r[1].trim(),n(o)}}}function N(){if("@"==t[0])return function(){var t=u();if(e=d(/^@([-\w]+)?keyframes\s*/)){var e,n=e[1];if(!(e=d(/^([-\w]+)\s*/)))return f("@keyframes missing name");var r,o=e[1];if(!h())return f("@keyframes missing '{'");for(var i=v();r=_();)i.push(r),i=i.concat(v());return y()?t({type:"keyframes",name:o,vendor:n,keyframes:i}):f("@keyframes missing '}'")}}()||function(){var t=u(),e=d(/^@media *([^{]+)/);if(e){var n=o(e[1]);if(!h())return f("@media missing '{'");var r=v().concat(p());return y()?t({type:"media",media:n,rules:r}):f("@media missing '}'")}}()||function(){var t=u(),e=d(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(e)return t({type:"custom-media",name:o(e[1]),media:o(e[2])})}()||function(){var t=u(),e=d(/^@supports *([^{]+)/);if(e){var n=o(e[1]);if(!h())return f("@supports missing '{'");var r=v().concat(p());return y()?t({type:"supports",supports:n,rules:r}):f("@supports missing '}'")}}()||A()||M()||C()||function(){var t=u(),e=d(/^@([-\w]+)?document *([^{]+)/);if(e){var n=o(e[1]),r=o(e[2]);if(!h())return f("@document missing '{'");var i=v().concat(p());return y()?t({type:"document",document:r,vendor:n,rules:i}):f("@document missing '}'")}}()||function(){var t=u();if(d(/^@page */)){var e=m()||[];if(!h())return f("@page missing '{'");for(var n,r=v();n=w();)r.push(n),r=r.concat(v());return y()?t({type:"page",selectors:e,declarations:r}):f("@page missing '}'")}}()||function(){var t=u();if(d(/^@host\s*/)){if(!h())return f("@host missing '{'");var e=v().concat(p());return y()?t({type:"host",rules:e}):f("@host missing '}'")}}()||function(){var t=u();if(d(/^@font-face\s*/)){if(!h())return f("@font-face missing '{'");for(var e,n=v();e=w();)n.push(e),n=n.concat(v());return y()?t({type:"font-face",declarations:n}):f("@font-face missing '}'")}}()}function P(){var t=u(),e=m();return e?(v(),t({type:"rule",selectors:e,declarations:b()})):f("selector missing")}return i((E=p(),{type:"stylesheet",stylesheet:{source:e.source,rules:E,parsingErrors:l}}))}},function(t,e,n){"use strict";var r=n(400),o=n(148),i=o.formatDOM,a=o.isIE(9),s=/<(![a-zA-Z\s]+)>/;t.exports=function(t){if("string"!=typeof t)throw new TypeError("First argument must be a string.");if(!t)return[];var e,n=t.match(s);return n&&n[1]&&(e=n[1],a&&(t=t.replace(n[0],""))),i(r(t),null,e)}},function(t,e,n){"use strict";var o,i,a,s=n(148).isIE,u="html",c="body",l="head",f=/<([a-zA-Z]+[0-9]?)/,h=/<\/head>/i,y=/<\/body>/i,p=/<(area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)(.*?)\/?>/gi,d=s(),x=s(9);if("function"==typeof window.DOMParser){var v=new window.DOMParser,g=x?"text/xml":"text/html";o=function(t,e){return e&&(t=["<",e,">",t,"</",e,">"].join("")),x&&(t=t.replace(p,"<$1$2$3/>")),v.parseFromString(t,g)}}if("object"==r(document.implementation)){var m=document.implementation.createHTMLDocument(d?"HTML_DOM_PARSER_TITLE":void 0);i=function(t,e){if(e)return m.documentElement.getElementsByTagName(e)[0].innerHTML=t,m;try{return m.documentElement.innerHTML=t,m}catch(e){if(o)return o(t)}}}var w=document.createElement("template");w.content&&(a=function(t){return w.innerHTML=t,w.content.childNodes});var b=i||o;t.exports=function(t){var e,n,r,i,s=t.match(f);switch(s&&s[1]&&(e=s[1].toLowerCase()),e){case u:if(o)return n=o(t),h.test(t)||(r=n.getElementsByTagName(l)[0])&&r.parentNode.removeChild(r),y.test(t)||(r=n.getElementsByTagName(c)[0])&&r.parentNode.removeChild(r),n.getElementsByTagName(u);break;case l:if(b)return i=b(t).getElementsByTagName(l),y.test(t)?i[0].parentNode.childNodes:i;break;case c:if(b)return i=b(t).getElementsByTagName(c),h.test(t)?i[0].parentNode.childNodes:i;break;default:if(a)return a(t);if(b)return b(t,c).getElementsByTagName(c)[0].childNodes}return[]}},function(t,e,n){"use strict";n.r(e),n.d(e,"Edge",(function(){return Ws})),n.d(e,"GraphUtils",(function(){return Ns})),n.d(e,"Node",(function(){return lu})),n.d(e,"BwdlTransformer",(function(){return Ou})),n.d(e,"GraphView",(function(){return Au}));var o=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},i=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return o(e(t),n)}),{left:function(e,n,r,o){for(null==r&&(r=0),null==o&&(o=e.length);r<o;){var i=r+o>>>1;t(e[i],n)<0?r=i+1:o=i}return r},right:function(e,n,r,o){for(null==r&&(r=0),null==o&&(o=e.length);r<o;){var i=r+o>>>1;t(e[i],n)>0?o=i:r=i+1}return r}}}(o);i.right,i.left;var a=Array.prototype;a.slice,a.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2),Array.prototype.slice;var s={value:function(){}};function u(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new c(r)}function c(t){this._=t}function l(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function f(t,e){for(var n,r=0,o=t.length;r<o;++r)if((n=t[r]).name===e)return n.value}function h(t,e,n){for(var r=0,o=t.length;r<o;++r)if(t[r].name===e){t[r]=s,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}c.prototype=u.prototype={constructor:c,on:function(t,e){var n,r=this._,o=l(t+"",r),i=-1,a=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++i<a;)if(n=(t=o[i]).type)r[n]=h(r[n],t.name,e);else if(null==e)for(n in r)r[n]=h(r[n],t.name,null);return this}for(;++i<a;)if((n=(t=o[i]).type)&&(n=f(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new c(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,n=(r=this._[t]).length;i<n;++i)r[i].value.apply(e,o)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],o=0,i=r.length;o<i;++o)r[o].value.apply(e,n)}};var y=u;function p(){}var d=function(t){return null==t?p:function(){return this.querySelector(t)}};function x(){return[]}var v=function(t){return null==t?x:function(){return this.querySelectorAll(t)}},g=function(t){return function(){return this.matches(t)}},m=function(t){return new Array(t.length)};function w(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function b(t,e,n,r,o,i){for(var a,s=0,u=e.length,c=i.length;s<c;++s)(a=e[s])?(a.__data__=i[s],r[s]=a):n[s]=new w(t,i[s]);for(;s<u;++s)(a=e[s])&&(o[s]=a)}function _(t,e,n,r,o,i,a){var s,u,c,l={},f=e.length,h=i.length,y=new Array(f);for(s=0;s<f;++s)(u=e[s])&&(y[s]=c="$"+a.call(u,u.__data__,s,e),c in l?o[s]=u:l[c]=u);for(s=0;s<h;++s)(u=l[c="$"+a.call(t,i[s],s,i)])?(r[s]=u,u.__data__=i[s],l[c]=null):n[s]=new w(t,i[s]);for(s=0;s<f;++s)(u=e[s])&&l[y[s]]===u&&(o[s]=u)}function E(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}w.prototype={constructor:w,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var A="http://www.w3.org/1999/xhtml",M={svg:"http://www.w3.org/2000/svg",xhtml:A,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},C=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),M.hasOwnProperty(e)?{space:M[e],local:t}:t};function k(t){return function(){this.removeAttribute(t)}}function N(t){return function(){this.removeAttributeNS(t.space,t.local)}}function P(t,e){return function(){this.setAttribute(t,e)}}function O(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function S(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function T(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var j=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function I(t){return function(){this.style.removeProperty(t)}}function R(t,e,n){return function(){this.style.setProperty(t,e,n)}}function L(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function B(t,e){return t.style.getPropertyValue(e)||j(t).getComputedStyle(t,null).getPropertyValue(e)}function D(t){return function(){delete this[t]}}function z(t,e){return function(){this[t]=e}}function U(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function F(t){return t.trim().split(/^|\s+/)}function q(t){return t.classList||new Y(t)}function Y(t){this._node=t,this._names=F(t.getAttribute("class")||"")}function V(t,e){for(var n=q(t),r=-1,o=e.length;++r<o;)n.add(e[r])}function H(t,e){for(var n=q(t),r=-1,o=e.length;++r<o;)n.remove(e[r])}function X(t){return function(){V(this,t)}}function $(t){return function(){H(this,t)}}function W(t,e){return function(){(e.apply(this,arguments)?V:H)(this,t)}}function Z(){this.textContent=""}function G(t){return function(){this.textContent=t}}function K(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function Q(){this.innerHTML=""}function J(t){return function(){this.innerHTML=t}}function tt(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function et(){this.nextSibling&&this.parentNode.appendChild(this)}function nt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function rt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===A&&e.documentElement.namespaceURI===A?e.createElement(t):e.createElementNS(n,t)}}function ot(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}Y.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var it=function(t){var e=C(t);return(e.local?ot:rt)(e)};function at(){return null}function st(){var t=this.parentNode;t&&t.removeChild(this)}function ut(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ct(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}var lt={},ft=null;function ht(t,e,n){return t=yt(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function yt(t,e,n){return function(r){var o=ft;ft=r;try{t.call(this,this.__data__,e,n)}finally{ft=o}}}function pt(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function dt(t){return function(){var e=this.__on;if(e){for(var n,r=0,o=-1,i=e.length;r<i;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++o]=n:this.removeEventListener(n.type,n.listener,n.capture);++o?e.length=o:delete this.__on}}}function xt(t,e,n){var r=lt.hasOwnProperty(t.type)?ht:yt;return function(o,i,a){var s,u=this.__on,c=r(e,i,a);if(u)for(var l=0,f=u.length;l<f;++l)if((s=u[l]).type===t.type&&s.name===t.name)return this.removeEventListener(s.type,s.listener,s.capture),this.addEventListener(s.type,s.listener=c,s.capture=n),void(s.value=e);this.addEventListener(t.type,c,n),s={type:t.type,name:t.name,value:e,listener:c,capture:n},u?u.push(s):this.__on=[s]}}function vt(t,e,n,r){var o=ft;t.sourceEvent=ft,ft=t;try{return e.apply(n,r)}finally{ft=o}}function gt(t,e,n){var r=j(t),o=r.CustomEvent;"function"==typeof o?o=new o(e,n):(o=r.document.createEvent("Event"),n?(o.initEvent(e,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function mt(t,e){return function(){return gt(this,t,e)}}function wt(t,e){return function(){return gt(this,t,e.apply(this,arguments))}}"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(lt={mouseenter:"mouseover",mouseleave:"mouseout"}));var bt=[null];function _t(t,e){this._groups=t,this._parents=e}function Et(){return new _t([[document.documentElement]],bt)}_t.prototype=Et.prototype={constructor:_t,select:function(t){"function"!=typeof t&&(t=d(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,a,s=e[o],u=s.length,c=r[o]=new Array(u),l=0;l<u;++l)(i=s[l])&&(a=t.call(i,i.__data__,l,s))&&("__data__"in i&&(a.__data__=i.__data__),c[l]=a);return new _t(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=v(t));for(var e=this._groups,n=e.length,r=[],o=[],i=0;i<n;++i)for(var a,s=e[i],u=s.length,c=0;c<u;++c)(a=s[c])&&(r.push(t.call(a,a.__data__,c,s)),o.push(a));return new _t(r,o)},filter:function(t){"function"!=typeof t&&(t=g(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,a=e[o],s=a.length,u=r[o]=[],c=0;c<s;++c)(i=a[c])&&t.call(i,i.__data__,c,a)&&u.push(i);return new _t(r,this._parents)},data:function(t,e){if(!t)return p=new Array(this.size()),l=-1,this.each((function(t){p[++l]=t})),p;var n,r=e?_:b,o=this._parents,i=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var a=i.length,s=new Array(a),u=new Array(a),c=new Array(a),l=0;l<a;++l){var f=o[l],h=i[l],y=h.length,p=t.call(f,f&&f.__data__,l,o),d=p.length,x=u[l]=new Array(d),v=s[l]=new Array(d);r(f,h,x,v,c[l]=new Array(y),p,e);for(var g,m,w=0,E=0;w<d;++w)if(g=x[w]){for(w>=E&&(E=w+1);!(m=v[E])&&++E<d;);g._next=m||null}}return(s=new _t(s,o))._enter=u,s._exit=c,s},enter:function(){return new _t(this._enter||this._groups.map(m),this._parents)},exit:function(){return new _t(this._exit||this._groups.map(m),this._parents)},join:function(t,e,n){var r=this.enter(),o=this,i=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=e&&(o=e(o)),null==n?i.remove():n(i),r&&o?r.merge(o).order():o},merge:function(t){for(var e=this._groups,n=t._groups,r=e.length,o=n.length,i=Math.min(r,o),a=new Array(r),s=0;s<i;++s)for(var u,c=e[s],l=n[s],f=c.length,h=a[s]=new Array(f),y=0;y<f;++y)(u=c[y]||l[y])&&(h[y]=u);for(;s<r;++s)a[s]=e[s];return new _t(a,this._parents)},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,o=t[e],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=E);for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var a,s=n[i],u=s.length,c=o[i]=new Array(u),l=0;l<u;++l)(a=s[l])&&(c[l]=a);c.sort(e)}return new _t(o,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),e=-1;return this.each((function(){t[++e]=this})),t},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var o,i=e[n],a=0,s=i.length;a<s;++a)(o=i[a])&&t.call(o,o.__data__,a,i);return this},attr:function(t,e){var n=C(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?N:k:"function"==typeof e?n.local?T:S:n.local?O:P)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?I:"function"==typeof e?L:R)(t,e,null==n?"":n)):B(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?D:"function"==typeof e?U:z)(t,e)):this.node()[t]},classed:function(t,e){var n=F(t+"");if(arguments.length<2){for(var r=q(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof e?W:e?X:$)(n,e))},text:function(t){return arguments.length?this.each(null==t?Z:("function"==typeof t?K:G)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?Q:("function"==typeof t?tt:J)(t)):this.node().innerHTML},raise:function(){return this.each(et)},lower:function(){return this.each(nt)},append:function(t){var e="function"==typeof t?t:it(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:it(t),r=null==e?at:"function"==typeof e?e:d(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(st)},clone:function(t){return this.select(t?ct:ut)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,o,i=pt(t+""),a=i.length;if(!(arguments.length<2)){for(s=e?xt:dt,null==n&&(n=!1),r=0;r<a;++r)this.each(s(i[r],e,n));return this}var s=this.node().__on;if(s)for(var u,c=0,l=s.length;c<l;++c)for(r=0,u=s[c];r<a;++r)if((o=i[r]).type===u.type&&o.name===u.name)return u.value},dispatch:function(t,e){return this.each(("function"==typeof e?wt:mt)(t,e))}};var At=Et,Mt=function(t){return"string"==typeof t?new _t([[document.querySelector(t)]],[document.documentElement]):new _t([[t]],bt)};function Ct(){ft.stopImmediatePropagation()}var kt=function(){ft.preventDefault(),ft.stopImmediatePropagation()},Nt=function(t){var e=t.document.documentElement,n=Mt(t).on("dragstart.drag",kt,!0);"onselectstart"in e?n.on("selectstart.drag",kt,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")};function Pt(t,e){var n=t.document.documentElement,r=Mt(t).on("dragstart.drag",null);e&&(r.on("click.drag",kt,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Ot=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function St(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Tt(){}var jt=.7,It=1/jt,Rt="\\s*([+-]?\\d+)\\s*",Lt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Bt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Dt=/^#([0-9a-f]{3,8})$/,zt=new RegExp("^rgb\\("+[Rt,Rt,Rt]+"\\)$"),Ut=new RegExp("^rgb\\("+[Bt,Bt,Bt]+"\\)$"),Ft=new RegExp("^rgba\\("+[Rt,Rt,Rt,Lt]+"\\)$"),qt=new RegExp("^rgba\\("+[Bt,Bt,Bt,Lt]+"\\)$"),Yt=new RegExp("^hsl\\("+[Lt,Bt,Bt]+"\\)$"),Vt=new RegExp("^hsla\\("+[Lt,Bt,Bt,Lt]+"\\)$"),Ht={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Xt(){return this.rgb().formatHex()}function $t(){return this.rgb().formatRgb()}function Wt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Dt.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Zt(e):3===n?new Jt(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Gt(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Gt(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=zt.exec(t))?new Jt(e[1],e[2],e[3],1):(e=Ut.exec(t))?new Jt(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Ft.exec(t))?Gt(e[1],e[2],e[3],e[4]):(e=qt.exec(t))?Gt(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Yt.exec(t))?re(e[1],e[2]/100,e[3]/100,1):(e=Vt.exec(t))?re(e[1],e[2]/100,e[3]/100,e[4]):Ht.hasOwnProperty(t)?Zt(Ht[t]):"transparent"===t?new Jt(NaN,NaN,NaN,0):null}function Zt(t){return new Jt(t>>16&255,t>>8&255,255&t,1)}function Gt(t,e,n,r){return r<=0&&(t=e=n=NaN),new Jt(t,e,n,r)}function Kt(t){return t instanceof Tt||(t=Wt(t)),t?new Jt((t=t.rgb()).r,t.g,t.b,t.opacity):new Jt}function Qt(t,e,n,r){return 1===arguments.length?Kt(t):new Jt(t,e,n,null==r?1:r)}function Jt(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function te(){return"#"+ne(this.r)+ne(this.g)+ne(this.b)}function ee(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function ne(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function re(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ie(t,e,n,r)}function oe(t){if(t instanceof ie)return new ie(t.h,t.s,t.l,t.opacity);if(t instanceof Tt||(t=Wt(t)),!t)return new ie;if(t instanceof ie)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,o=Math.min(e,n,r),i=Math.max(e,n,r),a=NaN,s=i-o,u=(i+o)/2;return s?(a=e===i?(n-r)/s+6*(n<r):n===i?(r-e)/s+2:(e-n)/s+4,s/=u<.5?i+o:2-i-o,a*=60):s=u>0&&u<1?0:a,new ie(a,s,u,t.opacity)}function ie(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function ae(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function se(t,e,n,r,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*n+(1+3*t+3*i-3*a)*r+a*o)/6}Ot(Tt,Wt,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Xt,formatHex:Xt,formatHsl:function(){return oe(this).formatHsl()},formatRgb:$t,toString:$t}),Ot(Jt,Qt,St(Tt,{brighter:function(t){return t=null==t?It:Math.pow(It,t),new Jt(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?jt:Math.pow(jt,t),new Jt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:te,formatHex:te,formatRgb:ee,toString:ee})),Ot(ie,(function(t,e,n,r){return 1===arguments.length?oe(t):new ie(t,e,n,null==r?1:r)}),St(Tt,{brighter:function(t){return t=null==t?It:Math.pow(It,t),new ie(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?jt:Math.pow(jt,t),new ie(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,o=2*n-r;return new Jt(ae(t>=240?t-240:t+120,o,r),ae(t,o,r),ae(t<120?t+240:t-120,o,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var ue=function(t){return function(){return t}};function ce(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):ue(isNaN(t)?e:t)}var le=function t(e){var n=function(t){return 1==(t=+t)?ce:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):ue(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=Qt(t)).r,(e=Qt(e)).r),o=n(t.g,e.g),i=n(t.b,e.b),a=ce(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function fe(t){return function(e){var n,r,o=e.length,i=new Array(o),a=new Array(o),s=new Array(o);for(n=0;n<o;++n)r=Qt(e[n]),i[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return i=t(i),a=t(a),s=t(s),r.opacity=1,function(t){return r.r=i(t),r.g=a(t),r.b=s(t),r+""}}}fe((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),o=t[r],i=t[r+1],a=r>0?t[r-1]:2*o-i,s=r<e-1?t[r+2]:2*i-o;return se((n-r/e)*e,a,o,i,s)}})),fe((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),o=t[(r+e-1)%e],i=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return se((n-r/e)*e,o,i,a,s)}}));var he,ye,pe=function(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}},de=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,xe=new RegExp(de.source,"g"),ve=function(t,e){var n,r,o,i=de.lastIndex=xe.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(n=de.exec(t))&&(r=xe.exec(e));)(o=r.index)>i&&(o=e.slice(i,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:pe(n,r)})),i=xe.lastIndex;return i<e.length&&(o=e.slice(i),s[a]?s[a]+=o:s[++a]=o),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var n,r=0;r<e;++r)s[(n=u[r]).i]=n.x(t);return s.join("")})},ge=function(){for(var t,e=ft;t=e.sourceEvent;)e=t;return e},me=function(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]},we=function(t,e,n){arguments.length<3&&(n=e,e=ge().changedTouches);for(var r,o=0,i=e?e.length:0;o<i;++o)if((r=e[o]).identifier===n)return me(t,r);return null},be=function(t){var e=ge();return e.changedTouches&&(e=e.changedTouches[0]),me(t,e)},_e=0,Ee=0,Ae=0,Me=0,Ce=0,ke=0,Ne="object"==("undefined"==typeof performance?"undefined":r(performance))&&performance.now?performance:Date,Pe="object"==("undefined"==typeof window?"undefined":r(window))&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Oe(){return Ce||(Pe(Se),Ce=Ne.now()+ke)}function Se(){Ce=0}function Te(){this._call=this._time=this._next=null}function je(t,e,n){var r=new Te;return r.restart(t,e,n),r}function Ie(){Ce=(Me=Ne.now())+ke,_e=Ee=0;try{!function(){Oe(),++_e;for(var t,e=he;e;)(t=Ce-e._time)>=0&&e._call.call(null,t),e=e._next;--_e}()}finally{_e=0,function(){for(var t,e,n=he,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:he=e);ye=t,Le(r)}(),Ce=0}}function Re(){var t=Ne.now(),e=t-Me;e>1e3&&(ke-=e,Me=t)}function Le(t){_e||(Ee&&(Ee=clearTimeout(Ee)),t-Ce>24?(t<1/0&&(Ee=setTimeout(Ie,t-Ne.now()-ke)),Ae&&(Ae=clearInterval(Ae))):(Ae||(Me=Ne.now(),Ae=setInterval(Re,1e3)),_e=1,Pe(Ie)))}Te.prototype=je.prototype={constructor:Te,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Oe():+n)+(null==e?0:+e),this._next||ye===this||(ye?ye._next=this:he=this,ye=this),this._call=t,this._time=n,Le()},stop:function(){this._call&&(this._call=null,this._time=1/0,Le())}};var Be=function(t,e,n){var r=new Te;return e=null==e?0:+e,r.restart((function(n){r.stop(),t(n+e)}),e,n),r},De=y("start","end","cancel","interrupt"),ze=[],Ue=function(t,e,n,r,o,i){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,o=t.__transition;function i(u){var c,l,f,h;if(1!==n.state)return s();for(c in o)if((h=o[c]).name===n.name){if(3===h.state)return Be(i);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete o[c]):+c<e&&(h.state=6,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete o[c])}if(Be((function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(u))})),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(f=n.tween.length),c=0,l=-1;c<f;++c)(h=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(r[++l]=h);r.length=l+1}}function a(e){for(var o=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(s),n.state=5,1),i=-1,a=r.length;++i<a;)r[i].call(t,o);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),s())}function s(){for(var r in n.state=6,n.timer.stop(),delete o[e],o)return;delete t.__transition}o[e]=n,n.timer=je((function(t){n.state=1,n.timer.restart(i,n.delay,n.time),n.delay<=t&&i(t-n.delay)}),0,n.time)}(t,n,{name:e,index:r,group:o,on:De,tween:ze,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})};function Fe(t,e){var n=Ye(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function qe(t,e){var n=Ye(t,e);if(n.state>3)throw new Error("too late; already running");return n}function Ye(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var Ve,He,Xe,$e,We=function(t,e){var n,r,o,i=t.__transition,a=!0;if(i){for(o in e=null==e?null:e+"",i)(n=i[o]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete i[o]):a=!1;a&&delete t.__transition}},Ze=180/Math.PI,Ge={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},Ke=function(t,e,n,r,o,i){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(e,t)*Ze,skewX:Math.atan(u)*Ze,scaleX:a,scaleY:s}};function Qe(t,e,n,r){function o(t){return t.length?t.pop()+" ":""}return function(i,a){var s=[],u=[];return i=t(i),a=t(a),function(t,r,o,i,a,s){if(t!==o||r!==i){var u=a.push("translate(",null,e,null,n);s.push({i:u-4,x:pe(t,o)},{i:u-2,x:pe(r,i)})}else(o||i)&&a.push("translate("+o+e+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,s,u),function(t,e,n,i){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),i.push({i:n.push(o(n)+"rotate(",null,r)-2,x:pe(t,e)})):e&&n.push(o(n)+"rotate("+e+r)}(i.rotate,a.rotate,s,u),function(t,e,n,i){t!==e?i.push({i:n.push(o(n)+"skewX(",null,r)-2,x:pe(t,e)}):e&&n.push(o(n)+"skewX("+e+r)}(i.skewX,a.skewX,s,u),function(t,e,n,r,i,a){if(t!==n||e!==r){var s=i.push(o(i)+"scale(",null,",",null,")");a.push({i:s-4,x:pe(t,n)},{i:s-2,x:pe(e,r)})}else 1===n&&1===r||i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,u),i=a=null,function(t){for(var e,n=-1,r=u.length;++n<r;)s[(e=u[n]).i]=e.x(t);return s.join("")}}}var Je=Qe((function(t){return"none"===t?Ge:(Ve||(Ve=document.createElement("DIV"),He=document.documentElement,Xe=document.defaultView),Ve.style.transform=t,t=Xe.getComputedStyle(He.appendChild(Ve),null).getPropertyValue("transform"),He.removeChild(Ve),t=t.slice(7,-1).split(","),Ke(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),tn=Qe((function(t){return null==t?Ge:($e||($e=document.createElementNS("http://www.w3.org/2000/svg","g")),$e.setAttribute("transform",t),(t=$e.transform.baseVal.consolidate())?(t=t.matrix,Ke(t.a,t.b,t.c,t.d,t.e,t.f)):Ge)}),", ",")",")");function en(t,e){var n,r;return function(){var o=qe(this,t),i=o.tween;if(i!==n)for(var a=0,s=(r=n=i).length;a<s;++a)if(r[a].name===e){(r=r.slice()).splice(a,1);break}o.tween=r}}function nn(t,e,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var i=qe(this,t),a=i.tween;if(a!==r){o=(r=a).slice();for(var s={name:e,value:n},u=0,c=o.length;u<c;++u)if(o[u].name===e){o[u]=s;break}u===c&&o.push(s)}i.tween=o}}function rn(t,e,n){var r=t._id;return t.each((function(){var t=qe(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return Ye(t,r).value[e]}}var on=function(t,e){var n;return("number"==typeof e?pe:e instanceof Wt?le:(n=Wt(e))?(e=n,le):ve)(t,e)};function an(t){return function(){this.removeAttribute(t)}}function sn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function un(t,e,n){var r,o,i=n+"";return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function cn(t,e,n){var r,o,i=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function ln(t,e,n){var r,o,i;return function(){var a,s,u=n(this);if(null!=u)return(a=this.getAttribute(t))===(s=u+"")?null:a===r&&s===o?i:(o=s,i=e(r=a,u));this.removeAttribute(t)}}function fn(t,e,n){var r,o,i;return function(){var a,s,u=n(this);if(null!=u)return(a=this.getAttributeNS(t.space,t.local))===(s=u+"")?null:a===r&&s===o?i:(o=s,i=e(r=a,u));this.removeAttributeNS(t.space,t.local)}}function hn(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function yn(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function pn(t,e){var n,r;function o(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&yn(t,o)),n}return o._value=e,o}function dn(t,e){var n,r;function o(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&hn(t,o)),n}return o._value=e,o}function xn(t,e){return function(){Fe(this,t).delay=+e.apply(this,arguments)}}function vn(t,e){return e=+e,function(){Fe(this,t).delay=e}}function gn(t,e){return function(){qe(this,t).duration=+e.apply(this,arguments)}}function mn(t,e){return e=+e,function(){qe(this,t).duration=e}}function wn(t,e){if("function"!=typeof e)throw new Error;return function(){qe(this,t).ease=e}}function bn(t,e,n){var r,o,i=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Fe:qe;return function(){var a=i(this,t),s=a.on;s!==r&&(o=(r=s).copy()).on(e,n),a.on=o}}var _n=At.prototype.constructor;function En(t){return function(){this.style.removeProperty(t)}}function An(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Mn(t,e,n){var r,o;function i(){var i=e.apply(this,arguments);return i!==o&&(r=(o=i)&&An(t,i,n)),r}return i._value=e,i}function Cn(t){return function(e){this.textContent=t.call(this,e)}}function kn(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&Cn(r)),e}return r._value=t,r}var Nn=0;function Pn(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function On(){return++Nn}var Sn=At.prototype;Pn.prototype=function(t){return At().transition(t)}.prototype={constructor:Pn,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=d(t));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a)for(var s,u,c=r[a],l=c.length,f=i[a]=new Array(l),h=0;h<l;++h)(s=c[h])&&(u=t.call(s,s.__data__,h,c))&&("__data__"in s&&(u.__data__=s.__data__),f[h]=u,Ue(f[h],e,n,h,f,Ye(s,n)));return new Pn(i,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=v(t));for(var r=this._groups,o=r.length,i=[],a=[],s=0;s<o;++s)for(var u,c=r[s],l=c.length,f=0;f<l;++f)if(u=c[f]){for(var h,y=t.call(u,u.__data__,f,c),p=Ye(u,n),d=0,x=y.length;d<x;++d)(h=y[d])&&Ue(h,e,n,d,y,p);i.push(y),a.push(u)}return new Pn(i,a,e,n)},filter:function(t){"function"!=typeof t&&(t=g(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,a=e[o],s=a.length,u=r[o]=[],c=0;c<s;++c)(i=a[c])&&t.call(i,i.__data__,c,a)&&u.push(i);return new Pn(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,o=n.length,i=Math.min(r,o),a=new Array(r),s=0;s<i;++s)for(var u,c=e[s],l=n[s],f=c.length,h=a[s]=new Array(f),y=0;y<f;++y)(u=c[y]||l[y])&&(h[y]=u);for(;s<r;++s)a[s]=e[s];return new Pn(a,this._parents,this._name,this._id)},selection:function(){return new _n(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=On(),r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],u=s.length,c=0;c<u;++c)if(a=s[c]){var l=Ye(a,e);Ue(a,t,n,c,s,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new Pn(r,this._parents,t,n)},call:Sn.call,nodes:Sn.nodes,node:Sn.node,size:Sn.size,empty:Sn.empty,each:Sn.each,on:function(t,e){var n=this._id;return arguments.length<2?Ye(this.node(),n).on.on(t):this.each(bn(n,t,e))},attr:function(t,e){var n=C(t),r="transform"===n?tn:on;return this.attrTween(t,"function"==typeof e?(n.local?fn:ln)(n,r,rn(this,"attr."+t,e)):null==e?(n.local?sn:an)(n):(n.local?cn:un)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=C(t);return this.tween(n,(r.local?pn:dn)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?Je:on;return null==e?this.styleTween(t,function(t,e){var n,r,o;return function(){var i=B(this,t),a=(this.style.removeProperty(t),B(this,t));return i===a?null:i===n&&a===r?o:o=e(n=i,r=a)}}(t,r)).on("end.style."+t,En(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,o,i;return function(){var a=B(this,t),s=n(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=B(this,t)),a===u?null:a===r&&u===o?i:(o=u,i=e(r=a,s))}}(t,r,rn(this,"style."+t,e))).each(function(t,e){var n,r,o,i,a="style."+e,s="end."+a;return function(){var u=qe(this,t),c=u.on,l=null==u.value[a]?i||(i=En(e)):void 0;c===n&&o===l||(r=(n=c).copy()).on(s,o=l),u.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,o,i=n+"";return function(){var a=B(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,Mn(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(rn(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,kn(t))},remove:function(){return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}));var t},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,o=Ye(this.node(),n).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===t)return r.value;return null}return this.each((null==e?en:nn)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?xn:vn)(e,t)):Ye(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?gn:mn)(e,t)):Ye(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(wn(e,t)):Ye(this.node(),e).ease},end:function(){var t,e,n=this,r=n._id,o=n.size();return new Promise((function(i,a){var s={value:a},u={value:function(){0==--o&&i()}};n.each((function(){var n=qe(this,r),o=n.on;o!==t&&((e=(t=o).copy())._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),n.on=e}))}))}};var Tn={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function jn(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))return Tn.time=Oe(),Tn;return n}function In(t){return{type:t}}At.prototype.interrupt=function(t){return this.each((function(){We(this,t)}))},At.prototype.transition=function(t){var e,n;t instanceof Pn?(e=t._id,t=t._name):(e=On(),(n=Tn).time=Oe(),t=null==t?null:t+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],u=s.length,c=0;c<u;++c)(a=s[c])&&Ue(a,t,e,c,s,n||jn(a,e));return new Pn(r,this._parents,t,e)},["w","e"].map(In),["n","s"].map(In),["n","w","e","s","nw","ne","sw","se"].map(In),Math.cos,Math.sin,Math.PI,Math.max,Array.prototype.slice;var Rn=Math.PI,Ln=2*Rn,Bn=1e-6,Dn=Ln-Bn;function zn(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Un(){return new zn}zn.prototype=Un.prototype={constructor:zn,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,o,i){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+o)+","+(this._y1=+i)},arcTo:function(t,e,n,r,o){t=+t,e=+e,n=+n,r=+r,o=+o;var i=this._x1,a=this._y1,s=n-t,u=r-e,c=i-t,l=a-e,f=c*c+l*l;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(f>Bn)if(Math.abs(l*s-u*c)>Bn&&o){var h=n-i,y=r-a,p=s*s+u*u,d=h*h+y*y,x=Math.sqrt(p),v=Math.sqrt(f),g=o*Math.tan((Rn-Math.acos((p+f-d)/(2*x*v)))/2),m=g/v,w=g/x;Math.abs(m-1)>Bn&&(this._+="L"+(t+m*c)+","+(e+m*l)),this._+="A"+o+","+o+",0,0,"+ +(l*h>c*y)+","+(this._x1=t+w*s)+","+(this._y1=e+w*u)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},arc:function(t,e,n,r,o,i){t=+t,e=+e,i=!!i;var a=(n=+n)*Math.cos(r),s=n*Math.sin(r),u=t+a,c=e+s,l=1^i,f=i?r-o:o-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+u+","+c:(Math.abs(this._x1-u)>Bn||Math.abs(this._y1-c)>Bn)&&(this._+="L"+u+","+c),n&&(f<0&&(f=f%Ln+Ln),f>Dn?this._+="A"+n+","+n+",0,1,"+l+","+(t-a)+","+(e-s)+"A"+n+","+n+",0,1,"+l+","+(this._x1=u)+","+(this._y1=c):f>Bn&&(this._+="A"+n+","+n+",0,"+ +(f>=Rn)+","+l+","+(this._x1=t+n*Math.cos(o))+","+(this._y1=e+n*Math.sin(o))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var Fn=Un,qn="$";function Yn(){}function Vn(t,e){var n=new Yn;if(t instanceof Yn)t.each((function(t,e){n.set(e,t)}));else if(Array.isArray(t)){var r,o=-1,i=t.length;if(null==e)for(;++o<i;)n.set(o,t[o]);else for(;++o<i;)n.set(e(r=t[o],o,t),r)}else if(t)for(var a in t)n.set(a,t[a]);return n}function Hn(){}Yn.prototype=Vn.prototype={constructor:Yn,has:function(t){return qn+t in this},get:function(t){return this[qn+t]},set:function(t,e){return this[qn+t]=e,this},remove:function(t){var e=qn+t;return e in this&&delete this[e]},clear:function(){for(var t in this)t[0]===qn&&delete this[t]},keys:function(){var t=[];for(var e in this)e[0]===qn&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)e[0]===qn&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)e[0]===qn&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)e[0]===qn&&++t;return t},empty:function(){for(var t in this)if(t[0]===qn)return!1;return!0},each:function(t){for(var e in this)e[0]===qn&&t(this[e],e.slice(1),this)}};var Xn=Vn.prototype;Hn.prototype=function(t,e){var n=new Hn;if(t instanceof Hn)t.each((function(t){n.add(t)}));else if(t){var r=-1,o=t.length;if(null==e)for(;++r<o;)n.add(t[r]);else for(;++r<o;)n.add(e(t[r],r,t))}return n}.prototype={constructor:Hn,has:Xn.has,add:function(t){return this[qn+(t+="")]=t,this},remove:Xn.remove,clear:Xn.clear,values:Xn.keys,size:Xn.size,empty:Xn.empty,each:Xn.each},Array.prototype.slice;var $n=function(t){return function(){return t}};function Wn(t,e,n,r,o,i,a,s,u,c){this.target=t,this.type=e,this.subject=n,this.identifier=r,this.active=o,this.x=i,this.y=a,this.dx=s,this.dy=u,this._=c}function Zn(){return!ft.ctrlKey&&!ft.button}function Gn(){return this.parentNode}function Kn(t){return null==t?{x:ft.x,y:ft.y}:t}function Qn(){return navigator.maxTouchPoints||"ontouchstart"in this}function Jn(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var o,i,a,s,u,c,l,f,h,y=t._root,p={data:r},d=t._x0,x=t._y0,v=t._x1,g=t._y1;if(!y)return t._root=p,t;for(;y.length;)if((c=e>=(i=(d+v)/2))?d=i:v=i,(l=n>=(a=(x+g)/2))?x=a:g=a,o=y,!(y=y[f=l<<1|c]))return o[f]=p,t;if(s=+t._x.call(null,y.data),u=+t._y.call(null,y.data),e===s&&n===u)return p.next=y,o?o[f]=p:t._root=p,t;do{o=o?o[f]=new Array(4):t._root=new Array(4),(c=e>=(i=(d+v)/2))?d=i:v=i,(l=n>=(a=(x+g)/2))?x=a:g=a}while((f=l<<1|c)==(h=(u>=a)<<1|s>=i));return o[h]=y,o[f]=p,t}Wn.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var tr=function(t,e,n,r,o){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=o};function er(t){return t[0]}function nr(t){return t[1]}function rr(t,e,n,r,o,i){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=o,this._y1=i,this._root=void 0}function or(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var ir=function(t,e,n){var r=new rr(null==e?er:e,null==n?nr:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}.prototype=rr.prototype;ir.copy=function(){var t,e,n=new rr(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=or(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var o=0;o<4;++o)(e=r.source[o])&&(e.length?t.push({source:e,target:r.target[o]=new Array(4)}):r.target[o]=or(e));return n},ir.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return Jn(this.cover(e,n),e,n,t)},ir.addAll=function(t){var e,n,r,o,i=t.length,a=new Array(i),s=new Array(i),u=1/0,c=1/0,l=-1/0,f=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(o=+this._y.call(null,e))||(a[n]=r,s[n]=o,r<u&&(u=r),r>l&&(l=r),o<c&&(c=o),o>f&&(f=o));if(u>l||c>f)return this;for(this.cover(u,c).cover(l,f),n=0;n<i;++n)Jn(this,a[n],s[n],t[n]);return this},ir.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,o=this._x1,i=this._y1;if(isNaN(n))o=(n=Math.floor(t))+1,i=(r=Math.floor(e))+1;else{for(var a,s,u=o-n,c=this._root;n>t||t>=o||r>e||e>=i;)switch(s=(e<r)<<1|t<n,(a=new Array(4))[s]=c,c=a,u*=2,s){case 0:o=n+u,i=r+u;break;case 1:n=o-u,i=r+u;break;case 2:o=n+u,r=i-u;break;case 3:n=o-u,r=i-u}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=r,this._x1=o,this._y1=i,this},ir.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},ir.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},ir.find=function(t,e,n){var r,o,i,a,s,u,c,l=this._x0,f=this._y0,h=this._x1,y=this._y1,p=[],d=this._root;for(d&&p.push(new tr(d,l,f,h,y)),null==n?n=1/0:(l=t-n,f=e-n,h=t+n,y=e+n,n*=n);u=p.pop();)if(!(!(d=u.node)||(o=u.x0)>h||(i=u.y0)>y||(a=u.x1)<l||(s=u.y1)<f))if(d.length){var x=(o+a)/2,v=(i+s)/2;p.push(new tr(d[3],x,v,a,s),new tr(d[2],o,v,x,s),new tr(d[1],x,i,a,v),new tr(d[0],o,i,x,v)),(c=(e>=v)<<1|t>=x)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=u)}else{var g=t-+this._x.call(null,d.data),m=e-+this._y.call(null,d.data),w=g*g+m*m;if(w<n){var b=Math.sqrt(n=w);l=t-b,f=e-b,h=t+b,y=e+b,r=d.data}}return r},ir.remove=function(t){if(isNaN(i=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,o,i,a,s,u,c,l,f,h,y=this._root,p=this._x0,d=this._y0,x=this._x1,v=this._y1;if(!y)return this;if(y.length)for(;;){if((c=i>=(s=(p+x)/2))?p=s:x=s,(l=a>=(u=(d+v)/2))?d=u:v=u,e=y,!(y=y[f=l<<1|c]))return this;if(!y.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;y.data!==t;)if(r=y,!(y=y.next))return this;return(o=y.next)&&delete y.next,r?(o?r.next=o:delete r.next,this):e?(o?e[f]=o:delete e[f],(y=e[0]||e[1]||e[2]||e[3])&&y===(e[3]||e[2]||e[1]||e[0])&&!y.length&&(n?n[h]=y:this._root=y),this):(this._root=o,this)},ir.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},ir.root=function(){return this._root},ir.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},ir.visit=function(t){var e,n,r,o,i,a,s=[],u=this._root;for(u&&s.push(new tr(u,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(u=e.node,r=e.x0,o=e.y0,i=e.x1,a=e.y1)&&u.length){var c=(r+i)/2,l=(o+a)/2;(n=u[3])&&s.push(new tr(n,c,l,i,a)),(n=u[2])&&s.push(new tr(n,r,l,c,a)),(n=u[1])&&s.push(new tr(n,c,o,i,l)),(n=u[0])&&s.push(new tr(n,r,o,c,l))}return this},ir.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new tr(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var o=e.node;if(o.length){var i,a=e.x0,s=e.y0,u=e.x1,c=e.y1,l=(a+u)/2,f=(s+c)/2;(i=o[0])&&n.push(new tr(i,a,s,l,f)),(i=o[1])&&n.push(new tr(i,l,s,u,f)),(i=o[2])&&n.push(new tr(i,a,f,l,c)),(i=o[3])&&n.push(new tr(i,l,f,u,c))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},ir.x=function(t){return arguments.length?(this._x=t,this):this._x},ir.y=function(t){return arguments.length?(this._y=t,this):this._y},Math.PI,Math.sqrt(5);var ar=function(){return Math.random()},sr=(function t(e){function n(t,n){return t=null==t?0:+t,n=null==n?1:+n,1===arguments.length?(n=t,t=0):n-=t,function(){return e()*n+t}}return n.source=t,n}(ar),function t(e){function n(t,n){var r,o;return t=null==t?0:+t,n=null==n?1:+n,function(){var i;if(null!=r)i=r,r=null;else do{r=2*e()-1,i=2*e()-1,o=r*r+i*i}while(!o||o>1);return t+n*i*Math.sqrt(-2*Math.log(o)/o)}}return n.source=t,n}(ar)),ur=(function t(e){function n(){var t=sr.source(e).apply(this,arguments);return function(){return Math.exp(t())}}return n.source=t,n}(ar),function t(e){function n(t){return function(){for(var n=0,r=0;r<t;++r)n+=e();return n}}return n.source=t,n}(ar));(function t(e){function n(t){var n=ur.source(e)(t);return function(){return n()/t}}return n.source=t,n})(ar),function t(e){function n(t){return function(){return-Math.log(1-e())/t}}return n.source=t,n}(ar);var cr=Array.prototype;cr.map,cr.slice;var lr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function fr(t){if(!(e=lr.exec(t)))throw new Error("invalid format: "+t);var e;return new hr({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function hr(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function yr(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}fr.prototype=hr.prototype,hr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var pr,dr,xr=function(t,e){var n=yr(t,e);if(!n)return t+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")},vr={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return xr(100*t,e)},r:xr,s:function(t,e){var n=yr(t,e);if(!n)return t+"";var r=n[0],o=n[1],i=o-(pr=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=r.length;return i===a?r:i>a?r+new Array(i-a+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+yr(t,Math.max(0,e+i-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},gr=function(t){return t},mr=Array.prototype.map,wr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];dr=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?gr:(e=mr.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var o=t.length,i=[],a=0,s=e[0],u=0;o>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),i.push(t.substring(o-=s,o+s)),!((u+=s+1)>r));)s=e[a=(a+1)%e.length];return i.reverse().join(n)}),o=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?gr:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(mr.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"-":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=fr(t)).fill,n=t.align,f=t.sign,h=t.symbol,y=t.zero,p=t.width,d=t.comma,x=t.precision,v=t.trim,g=t.type;"n"===g?(d=!0,g="g"):vr[g]||(void 0===x&&(x=12),v=!0,g="g"),(y||"0"===e&&"="===n)&&(y=!0,e="0",n="=");var m="$"===h?o:"#"===h&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",w="$"===h?i:/[%p]/.test(g)?u:"",b=vr[g],_=/[defgprs%]/.test(g);function E(t){var o,i,u,h=m,E=w;if("c"===g)E=b(t)+E,t="";else{var A=(t=+t)<0||1/t<0;if(t=isNaN(t)?l:b(Math.abs(t),x),v&&(t=function(t){t:for(var e,n=t.length,r=1,o=-1;r<n;++r)switch(t[r]){case".":o=e=r;break;case"0":0===o&&(o=r),e=r;break;default:if(!+t[r])break t;o>0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t}(t)),A&&0==+t&&"+"!==f&&(A=!1),h=(A?"("===f?f:c:"-"===f||"("===f?"":f)+h,E=("s"===g?wr[8+pr/3]:"")+E+(A&&"("===f?")":""),_)for(o=-1,i=t.length;++o<i;)if(48>(u=t.charCodeAt(o))||u>57){E=(46===u?a+t.slice(o+1):t.slice(o))+E,t=t.slice(0,o);break}}d&&!y&&(t=r(t,1/0));var M=h.length+t.length+E.length,C=M<p?new Array(p-M+1).join(e):"";switch(d&&y&&(t=r(C+t,C.length?p-E.length:1/0),C=""),n){case"<":t=h+t+E+C;break;case"=":t=h+C+t+E;break;case"^":t=C.slice(0,M=C.length>>1)+h+t+E+C.slice(M);break;default:t=C+h+t+E}return s(t)}return x=void 0===x?6:/[gprs]/.test(g)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x)),E.toString=function(){return t+""},E}return{format:f,formatPrefix:function(t,e){var n=f(((t=fr(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=yr(Math.abs(t)))?t[1]:NaN}(e)/3))),o=Math.pow(10,-r),i=wr[8+r/3];return function(t){return n(o*t)+i}}}}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),dr.format,dr.formatPrefix;var br=new Date,_r=new Date;function Er(t,e,n,r){function o(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return o.floor=function(e){return t(e=new Date(+e)),e},o.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},o.round=function(t){var e=o(t),n=o.ceil(t);return t-e<n-t?e:n},o.offset=function(t,n){return e(t=new Date(+t),null==n?1:Math.floor(n)),t},o.range=function(n,r,i){var a,s=[];if(n=o.ceil(n),i=null==i?1:Math.floor(i),!(n<r&&i>0))return s;do{s.push(a=new Date(+n)),e(n,i),t(n)}while(a<n&&n<r);return s},o.filter=function(n){return Er((function(e){if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(o.count=function(e,r){return br.setTime(+e),_r.setTime(+r),t(br),t(_r),Math.floor(n(br,_r))},o.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?o.filter(r?function(e){return r(e)%t==0}:function(e){return o.count(0,e)%t==0}):o:null}),o}var Ar=Er((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));Ar.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Er((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var Mr=Ar,Cr=(Ar.range,Er((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()}))),kr=(Cr.range,1e3),Nr=6e4,Pr=36e5,Or=864e5,Sr=6048e5;function Tr(t){return Er((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Nr)/Sr}))}var jr=Tr(0),Ir=Tr(1),Rr=Tr(2),Lr=Tr(3),Br=Tr(4),Dr=Tr(5),zr=Tr(6),Ur=(jr.range,Ir.range,Rr.range,Lr.range,Br.range,Dr.range,zr.range,Er((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Nr)/Or}),(function(t){return t.getDate()-1}))),Fr=Ur,qr=(Ur.range,Er((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*kr-t.getMinutes()*Nr)}),(function(t,e){t.setTime(+t+e*Pr)}),(function(t,e){return(e-t)/Pr}),(function(t){return t.getHours()}))),Yr=(qr.range,Er((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*kr)}),(function(t,e){t.setTime(+t+e*Nr)}),(function(t,e){return(e-t)/Nr}),(function(t){return t.getMinutes()}))),Vr=(Yr.range,Er((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+e*kr)}),(function(t,e){return(e-t)/kr}),(function(t){return t.getUTCSeconds()}))),Hr=(Vr.range,Er((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t})));function Xr(t){return Er((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/Sr}))}Hr.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Er((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):Hr:null},Hr.range;var $r=Xr(0),Wr=Xr(1),Zr=Xr(2),Gr=Xr(3),Kr=Xr(4),Qr=Xr(5),Jr=Xr(6),to=($r.range,Wr.range,Zr.range,Gr.range,Kr.range,Qr.range,Jr.range,Er((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/Or}),(function(t){return t.getUTCDate()-1}))),eo=to,no=(to.range,Er((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()})));no.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Er((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var ro=no;function oo(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function io(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function ao(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}no.range;var so,uo={"-":"",_:" ",0:"0"},co=/^\s*\d+/,lo=/^%/,fo=/[\\^$*+?|[\]().{}]/g;function ho(t,e,n){var r=t<0?"-":"",o=(r?-t:t)+"",i=o.length;return r+(i<n?new Array(n-i+1).join(e)+o:o)}function yo(t){return t.replace(fo,"\\$&")}function po(t){return new RegExp("^(?:"+t.map(yo).join("|")+")","i")}function xo(t){for(var e={},n=-1,r=t.length;++n<r;)e[t[n].toLowerCase()]=n;return e}function vo(t,e,n){var r=co.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function go(t,e,n){var r=co.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function mo(t,e,n){var r=co.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function wo(t,e,n){var r=co.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function bo(t,e,n){var r=co.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function _o(t,e,n){var r=co.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Eo(t,e,n){var r=co.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Ao(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Mo(t,e,n){var r=co.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function Co(t,e,n){var r=co.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function ko(t,e,n){var r=co.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function No(t,e,n){var r=co.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Po(t,e,n){var r=co.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Oo(t,e,n){var r=co.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function So(t,e,n){var r=co.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function To(t,e,n){var r=co.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function jo(t,e,n){var r=co.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Io(t,e,n){var r=lo.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Ro(t,e,n){var r=co.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Lo(t,e,n){var r=co.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Bo(t,e){return ho(t.getDate(),e,2)}function Do(t,e){return ho(t.getHours(),e,2)}function zo(t,e){return ho(t.getHours()%12||12,e,2)}function Uo(t,e){return ho(1+Fr.count(Mr(t),t),e,3)}function Fo(t,e){return ho(t.getMilliseconds(),e,3)}function qo(t,e){return Fo(t,e)+"000"}function Yo(t,e){return ho(t.getMonth()+1,e,2)}function Vo(t,e){return ho(t.getMinutes(),e,2)}function Ho(t,e){return ho(t.getSeconds(),e,2)}function Xo(t){var e=t.getDay();return 0===e?7:e}function $o(t,e){return ho(jr.count(Mr(t)-1,t),e,2)}function Wo(t){var e=t.getDay();return e>=4||0===e?Br(t):Br.ceil(t)}function Zo(t,e){return t=Wo(t),ho(Br.count(Mr(t),t)+(4===Mr(t).getDay()),e,2)}function Go(t){return t.getDay()}function Ko(t,e){return ho(Ir.count(Mr(t)-1,t),e,2)}function Qo(t,e){return ho(t.getFullYear()%100,e,2)}function Jo(t,e){return ho((t=Wo(t)).getFullYear()%100,e,2)}function ti(t,e){return ho(t.getFullYear()%1e4,e,4)}function ei(t,e){var n=t.getDay();return ho((t=n>=4||0===n?Br(t):Br.ceil(t)).getFullYear()%1e4,e,4)}function ni(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+ho(e/60|0,"0",2)+ho(e%60,"0",2)}function ri(t,e){return ho(t.getUTCDate(),e,2)}function oi(t,e){return ho(t.getUTCHours(),e,2)}function ii(t,e){return ho(t.getUTCHours()%12||12,e,2)}function ai(t,e){return ho(1+eo.count(ro(t),t),e,3)}function si(t,e){return ho(t.getUTCMilliseconds(),e,3)}function ui(t,e){return si(t,e)+"000"}function ci(t,e){return ho(t.getUTCMonth()+1,e,2)}function li(t,e){return ho(t.getUTCMinutes(),e,2)}function fi(t,e){return ho(t.getUTCSeconds(),e,2)}function hi(t){var e=t.getUTCDay();return 0===e?7:e}function yi(t,e){return ho($r.count(ro(t)-1,t),e,2)}function pi(t){var e=t.getUTCDay();return e>=4||0===e?Kr(t):Kr.ceil(t)}function di(t,e){return t=pi(t),ho(Kr.count(ro(t),t)+(4===ro(t).getUTCDay()),e,2)}function xi(t){return t.getUTCDay()}function vi(t,e){return ho(Wr.count(ro(t)-1,t),e,2)}function gi(t,e){return ho(t.getUTCFullYear()%100,e,2)}function mi(t,e){return ho((t=pi(t)).getUTCFullYear()%100,e,2)}function wi(t,e){return ho(t.getUTCFullYear()%1e4,e,4)}function bi(t,e){var n=t.getUTCDay();return ho((t=n>=4||0===n?Kr(t):Kr.ceil(t)).getUTCFullYear()%1e4,e,4)}function _i(){return"+0000"}function Ei(){return"%"}function Ai(t){return+t}function Mi(t){return Math.floor(+t/1e3)}so=function(t){var e=t.dateTime,n=t.date,r=t.time,o=t.periods,i=t.days,a=t.shortDays,s=t.months,u=t.shortMonths,c=po(o),l=xo(o),f=po(i),h=xo(i),y=po(a),p=xo(a),d=po(s),x=xo(s),v=po(u),g=xo(u),m={a:function(t){return a[t.getDay()]},A:function(t){return i[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:Bo,e:Bo,f:qo,g:Jo,G:ei,H:Do,I:zo,j:Uo,L:Fo,m:Yo,M:Vo,p:function(t){return o[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Ai,s:Mi,S:Ho,u:Xo,U:$o,V:Zo,w:Go,W:Ko,x:null,X:null,y:Qo,Y:ti,Z:ni,"%":Ei},w={a:function(t){return a[t.getUTCDay()]},A:function(t){return i[t.getUTCDay()]},b:function(t){return u[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:ri,e:ri,f:ui,g:mi,G:bi,H:oi,I:ii,j:ai,L:si,m:ci,M:li,p:function(t){return o[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Ai,s:Mi,S:fi,u:hi,U:yi,V:di,w:xi,W:vi,x:null,X:null,y:gi,Y:wi,Z:_i,"%":Ei},b={a:function(t,e,n){var r=y.exec(e.slice(n));return r?(t.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=h[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=v.exec(e.slice(n));return r?(t.m=g[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=d.exec(e.slice(n));return r?(t.m=x[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,n,r){return A(t,e,n,r)},d:ko,e:ko,f:jo,g:Eo,G:_o,H:Po,I:Po,j:No,L:To,m:Co,M:Oo,p:function(t,e,n){var r=c.exec(e.slice(n));return r?(t.p=l[r[0].toLowerCase()],n+r[0].length):-1},q:Mo,Q:Ro,s:Lo,S:So,u:go,U:mo,V:wo,w:vo,W:bo,x:function(t,e,r){return A(t,n,e,r)},X:function(t,e,n){return A(t,r,e,n)},y:Eo,Y:_o,Z:Ao,"%":Io};function _(t,e){return function(n){var r,o,i,a=[],s=-1,u=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===t.charCodeAt(s)&&(a.push(t.slice(u,s)),null!=(o=uo[r=t.charAt(++s)])?r=t.charAt(++s):o="e"===r?" ":"0",(i=e[r])&&(r=i(n,o)),a.push(r),u=s+1);return a.push(t.slice(u,s)),a.join("")}}function E(t,e){return function(n){var r,o,i=ao(1900,void 0,1);if(A(i,t,n+="",0)!=n.length)return null;if("Q"in i)return new Date(i.Q);if("s"in i)return new Date(1e3*i.s+("L"in i?i.L:0));if(e&&!("Z"in i)&&(i.Z=0),"p"in i&&(i.H=i.H%12+12*i.p),void 0===i.m&&(i.m="q"in i?i.q:0),"V"in i){if(i.V<1||i.V>53)return null;"w"in i||(i.w=1),"Z"in i?(o=(r=io(ao(i.y,0,1))).getUTCDay(),r=o>4||0===o?Wr.ceil(r):Wr(r),r=eo.offset(r,7*(i.V-1)),i.y=r.getUTCFullYear(),i.m=r.getUTCMonth(),i.d=r.getUTCDate()+(i.w+6)%7):(o=(r=oo(ao(i.y,0,1))).getDay(),r=o>4||0===o?Ir.ceil(r):Ir(r),r=Fr.offset(r,7*(i.V-1)),i.y=r.getFullYear(),i.m=r.getMonth(),i.d=r.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:"W"in i?1:0),o="Z"in i?io(ao(i.y,0,1)).getUTCDay():oo(ao(i.y,0,1)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(o+5)%7:i.w+7*i.U-(o+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,io(i)):oo(i)}}function A(t,e,n,r){for(var o,i,a=0,s=e.length,u=n.length;a<s;){if(r>=u)return-1;if(37===(o=e.charCodeAt(a++))){if(o=e.charAt(a++),!(i=b[o in uo?e.charAt(a++):o])||(r=i(t,n,r))<0)return-1}else if(o!=n.charCodeAt(r++))return-1}return r}return m.x=_(n,m),m.X=_(r,m),m.c=_(e,m),w.x=_(n,w),w.X=_(r,w),w.c=_(e,w),{format:function(t){var e=_(t+="",m);return e.toString=function(){return t},e},parse:function(t){var e=E(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=_(t+="",w);return e.toString=function(){return t},e},utcParse:function(t){var e=E(t+="",!0);return e.toString=function(){return t},e}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),so.format,so.parse,so.utcFormat,so.utcParse;var Ci=Er((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),ki=(Ci.range,Er((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*Pr)}),(function(t,e){return(e-t)/Pr}),(function(t){return t.getUTCHours()}))),Ni=(ki.range,Er((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*Nr)}),(function(t,e){return(e-t)/Nr}),(function(t){return t.getUTCMinutes()})));Ni.range;var Pi=function(t){return function(){return t}};function Oi(t){this._context=t}Oi.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var Si=function(t){return new Oi(t)};function Ti(t){return t[0]}function ji(t){return t[1]}function Ii(){this._=null}function Ri(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Li(t,e){var n=e,r=e.R,o=n.U;o?o.L===n?o.L=r:o.R=r:t._=r,r.U=o,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function Bi(t,e){var n=e,r=e.L,o=n.U;o?o.L===n?o.L=r:o.R=r:t._=r,r.U=o,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function Di(t){for(;t.L;)t=t.L;return t}Ii.prototype={constructor:Ii,insert:function(t,e){var n,r,o;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=Di(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(r=n.U).L?(o=r.R)&&o.C?(n.C=o.C=!1,r.C=!0,t=r):(t===n.R&&(Li(this,n),n=(t=n).U),n.C=!1,r.C=!0,Bi(this,r)):(o=r.L)&&o.C?(n.C=o.C=!1,r.C=!0,t=r):(t===n.L&&(Bi(this,n),n=(t=n).U),n.C=!1,r.C=!0,Li(this,r)),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,r,o=t.U,i=t.L,a=t.R;if(n=i?a?Di(a):i:a,o?o.L===t?o.L=n:o.R=n:this._=n,i&&a?(r=n.C,n.C=t.C,n.L=i,i.U=n,n!==a?(o=n.U,n.U=t.U,t=n.R,o.L=t,n.R=a,a.U=n):(n.U=o,o=n,t=n.R)):(r=t.C,t=n),t&&(t.U=o),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===o.L){if((e=o.R).C&&(e.C=!1,o.C=!0,Li(this,o),e=o.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,Bi(this,e),e=o.R),e.C=o.C,o.C=e.R.C=!1,Li(this,o),t=this._;break}}else if((e=o.L).C&&(e.C=!1,o.C=!0,Bi(this,o),e=o.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,Li(this,e),e=o.L),e.C=o.C,o.C=e.L.C=!1,Bi(this,o),t=this._;break}e.C=!0,t=o,o=o.U}while(!t.C);t&&(t.C=!1)}}};var zi=Ii;function Ui(t,e,n,r){var o=[null,null],i=la.push(o)-1;return o.left=t,o.right=e,n&&qi(o,t,e,n),r&&qi(o,e,t,r),ua[t.index].halfedges.push(i),ua[e.index].halfedges.push(i),o}function Fi(t,e,n){var r=[e,n];return r.left=t,r}function qi(t,e,n,r){t[0]||t[1]?t.left===n?t[1]=r:t[0]=r:(t[0]=r,t.left=e,t.right=n)}function Yi(t,e,n,r,o){var i,a=t[0],s=t[1],u=a[0],c=a[1],l=0,f=1,h=s[0]-u,y=s[1]-c;if(i=e-u,h||!(i>0)){if(i/=h,h<0){if(i<l)return;i<f&&(f=i)}else if(h>0){if(i>f)return;i>l&&(l=i)}if(i=r-u,h||!(i<0)){if(i/=h,h<0){if(i>f)return;i>l&&(l=i)}else if(h>0){if(i<l)return;i<f&&(f=i)}if(i=n-c,y||!(i>0)){if(i/=y,y<0){if(i<l)return;i<f&&(f=i)}else if(y>0){if(i>f)return;i>l&&(l=i)}if(i=o-c,y||!(i<0)){if(i/=y,y<0){if(i>f)return;i>l&&(l=i)}else if(y>0){if(i<l)return;i<f&&(f=i)}return!(l>0||f<1)||(l>0&&(t[0]=[u+l*h,c+l*y]),f<1&&(t[1]=[u+f*h,c+f*y]),!0)}}}}}function Vi(t,e,n,r,o){var i=t[1];if(i)return!0;var a,s,u=t[0],c=t.left,l=t.right,f=c[0],h=c[1],y=l[0],p=l[1],d=(f+y)/2,x=(h+p)/2;if(p===h){if(d<e||d>=r)return;if(f>y){if(u){if(u[1]>=o)return}else u=[d,n];i=[d,o]}else{if(u){if(u[1]<n)return}else u=[d,o];i=[d,n]}}else if(s=x-(a=(f-y)/(p-h))*d,a<-1||a>1)if(f>y){if(u){if(u[1]>=o)return}else u=[(n-s)/a,n];i=[(o-s)/a,o]}else{if(u){if(u[1]<n)return}else u=[(o-s)/a,o];i=[(n-s)/a,n]}else if(h<p){if(u){if(u[0]>=r)return}else u=[e,a*e+s];i=[r,a*r+s]}else{if(u){if(u[0]<e)return}else u=[r,a*r+s];i=[e,a*e+s]}return t[0]=u,t[1]=i,!0}function Hi(t,e){var n=t.site,r=e.left,o=e.right;return n===o&&(o=r,r=n),o?Math.atan2(o[1]-r[1],o[0]-r[0]):(n===r?(r=e[1],o=e[0]):(r=e[0],o=e[1]),Math.atan2(r[0]-o[0],o[1]-r[1]))}function Xi(t,e){return e[+(e.left!==t.site)]}function $i(t,e){return e[+(e.left===t.site)]}var Wi,Zi=[];function Gi(){Ri(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ki(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,o=t.site,i=n.site;if(r!==i){var a=o[0],s=o[1],u=r[0]-a,c=r[1]-s,l=i[0]-a,f=i[1]-s,h=2*(u*f-c*l);if(!(h>=-ha)){var y=u*u+c*c,p=l*l+f*f,d=(f*y-c*p)/h,x=(u*p-l*y)/h,v=Zi.pop()||new Gi;v.arc=t,v.site=o,v.x=d+a,v.y=(v.cy=x+s)+Math.sqrt(d*d+x*x),t.circle=v;for(var g=null,m=ca._;m;)if(v.y<m.y||v.y===m.y&&v.x<=m.x){if(!m.L){g=m.P;break}m=m.L}else{if(!m.R){g=m;break}m=m.R}ca.insert(g,v),g||(Wi=v)}}}}function Qi(t){var e=t.circle;e&&(e.P||(Wi=e.N),ca.remove(e),Zi.push(e),Ri(e),t.circle=null)}var Ji=[];function ta(){Ri(this),this.edge=this.site=this.circle=null}function ea(t){var e=Ji.pop()||new ta;return e.site=t,e}function na(t){Qi(t),sa.remove(t),Ji.push(t),Ri(t)}function ra(t){var e=t.circle,n=e.x,r=e.cy,o=[n,r],i=t.P,a=t.N,s=[t];na(t);for(var u=i;u.circle&&Math.abs(n-u.circle.x)<fa&&Math.abs(r-u.circle.cy)<fa;)i=u.P,s.unshift(u),na(u),u=i;s.unshift(u),Qi(u);for(var c=a;c.circle&&Math.abs(n-c.circle.x)<fa&&Math.abs(r-c.circle.cy)<fa;)a=c.N,s.push(c),na(c),c=a;s.push(c),Qi(c);var l,f=s.length;for(l=1;l<f;++l)c=s[l],u=s[l-1],qi(c.edge,u.site,c.site,o);u=s[0],(c=s[f-1]).edge=Ui(u.site,c.site,null,o),Ki(u),Ki(c)}function oa(t){for(var e,n,r,o,i=t[0],a=t[1],s=sa._;s;)if((r=ia(s,a)-i)>fa)s=s.L;else{if(!((o=i-aa(s,a))>fa)){r>-fa?(e=s.P,n=s):o>-fa?(e=s,n=s.N):e=n=s;break}if(!s.R){e=s;break}s=s.R}!function(t){ua[t.index]={site:t,halfedges:[]}}(t);var u=ea(t);if(sa.insert(e,u),e||n){if(e===n)return Qi(e),n=ea(e.site),sa.insert(u,n),u.edge=n.edge=Ui(e.site,u.site),Ki(e),void Ki(n);if(n){Qi(e),Qi(n);var c=e.site,l=c[0],f=c[1],h=t[0]-l,y=t[1]-f,p=n.site,d=p[0]-l,x=p[1]-f,v=2*(h*x-y*d),g=h*h+y*y,m=d*d+x*x,w=[(x*g-y*m)/v+l,(h*m-d*g)/v+f];qi(n.edge,c,p,w),u.edge=Ui(c,t,null,w),n.edge=Ui(t,p,null,w),Ki(e),Ki(n)}else u.edge=Ui(e.site,u.site)}}function ia(t,e){var n=t.site,r=n[0],o=n[1],i=o-e;if(!i)return r;var a=t.P;if(!a)return-1/0;var s=(n=a.site)[0],u=n[1],c=u-e;if(!c)return s;var l=s-r,f=1/i-1/c,h=l/c;return f?(-h+Math.sqrt(h*h-2*f*(l*l/(-2*c)-u+c/2+o-i/2)))/f+r:(r+s)/2}function aa(t,e){var n=t.N;if(n)return ia(n,e);var r=t.site;return r[1]===e?r[0]:1/0}var sa,ua,ca,la,fa=1e-6,ha=1e-12;function ya(t,e){return e[1]-t[1]||e[0]-t[0]}function pa(t,e){var n,r,o,i=t.sort(ya).pop();for(la=[],ua=new Array(t.length),sa=new zi,ca=new zi;;)if(o=Wi,i&&(!o||i[1]<o.y||i[1]===o.y&&i[0]<o.x))i[0]===n&&i[1]===r||(oa(i),n=i[0],r=i[1]),i=t.pop();else{if(!o)break;ra(o.arc)}if(function(){for(var t,e,n,r,o=0,i=ua.length;o<i;++o)if((t=ua[o])&&(r=(e=t.halfedges).length)){var a=new Array(r),s=new Array(r);for(n=0;n<r;++n)a[n]=n,s[n]=Hi(t,la[e[n]]);for(a.sort((function(t,e){return s[e]-s[t]})),n=0;n<r;++n)s[n]=e[a[n]];for(n=0;n<r;++n)e[n]=s[n]}}(),e){var a=+e[0][0],s=+e[0][1],u=+e[1][0],c=+e[1][1];!function(t,e,n,r){for(var o,i=la.length;i--;)Vi(o=la[i],t,e,n,r)&&Yi(o,t,e,n,r)&&(Math.abs(o[0][0]-o[1][0])>fa||Math.abs(o[0][1]-o[1][1])>fa)||delete la[i]}(a,s,u,c),function(t,e,n,r){var o,i,a,s,u,c,l,f,h,y,p,d,x=ua.length,v=!0;for(o=0;o<x;++o)if(i=ua[o]){for(a=i.site,s=(u=i.halfedges).length;s--;)la[u[s]]||u.splice(s,1);for(s=0,c=u.length;s<c;)p=(y=$i(i,la[u[s]]))[0],d=y[1],f=(l=Xi(i,la[u[++s%c]]))[0],h=l[1],(Math.abs(p-f)>fa||Math.abs(d-h)>fa)&&(u.splice(s,0,la.push(Fi(a,y,Math.abs(p-t)<fa&&r-d>fa?[t,Math.abs(f-t)<fa?h:r]:Math.abs(d-r)<fa&&n-p>fa?[Math.abs(h-r)<fa?f:n,r]:Math.abs(p-n)<fa&&d-e>fa?[n,Math.abs(f-n)<fa?h:e]:Math.abs(d-e)<fa&&p-t>fa?[Math.abs(h-e)<fa?f:t,e]:null))-1),++c);c&&(v=!1)}if(v){var g,m,w,b=1/0;for(o=0,v=null;o<x;++o)(i=ua[o])&&(w=(g=(a=i.site)[0]-t)*g+(m=a[1]-e)*m)<b&&(b=w,v=i);if(v){var _=[t,e],E=[t,r],A=[n,r],M=[n,e];v.halfedges.push(la.push(Fi(a=v.site,_,E))-1,la.push(Fi(a,E,A))-1,la.push(Fi(a,A,M))-1,la.push(Fi(a,M,_))-1)}}for(o=0;o<x;++o)(i=ua[o])&&(i.halfedges.length||delete ua[o])}(a,s,u,c)}this.edges=la,this.cells=ua,sa=ca=la=ua=null}pa.prototype={constructor:pa,polygons:function(){var t=this.edges;return this.cells.map((function(e){var n=e.halfedges.map((function(n){return Xi(e,t[n])}));return n.data=e.site.data,n}))},triangles:function(){var t=[],e=this.edges;return this.cells.forEach((function(n,r){if(i=(o=n.halfedges).length)for(var o,i,a,s,u,c,l=n.site,f=-1,h=e[o[i-1]],y=h.left===l?h.right:h.left;++f<i;)a=y,y=(h=e[o[f]]).left===l?h.right:h.left,a&&y&&r<a.index&&r<y.index&&(u=a,c=y,((s=l)[0]-c[0])*(u[1]-s[1])-(s[0]-u[0])*(c[1]-s[1])<0)&&t.push([l.data,a.data,y.data])})),t},links:function(){return this.edges.filter((function(t){return t.right})).map((function(t){return{source:t.left.data,target:t.right.data}}))},find:function(t,e,n){for(var r,o,i=this,a=i._found||0,s=i.cells.length;!(o=i.cells[a]);)if(++a>=s)return null;var u=t-o.site[0],c=e-o.site[1],l=u*u+c*c;do{o=i.cells[r=a],a=null,o.halfedges.forEach((function(n){var r=i.edges[n],s=r.left;if(s!==o.site&&s||(s=r.right)){var u=t-s[0],c=e-s[1],f=u*u+c*c;f<l&&(l=f,a=s.index)}}))}while(null!==a);return i._found=r,null==n||l<=n*n?o.site:null}};var da=Math.SQRT2;function xa(t){return((t=Math.exp(t))+1/t)/2}var va=function(t,e){var n,r,o=t[0],i=t[1],a=t[2],s=e[0],u=e[1],c=e[2],l=s-o,f=u-i,h=l*l+f*f;if(h<1e-12)r=Math.log(c/a)/da,n=function(t){return[o+t*l,i+t*f,a*Math.exp(da*t*r)]};else{var y=Math.sqrt(h),p=(c*c-a*a+4*h)/(2*a*2*y),d=(c*c-a*a-4*h)/(2*c*2*y),x=Math.log(Math.sqrt(p*p+1)-p),v=Math.log(Math.sqrt(d*d+1)-d);r=(v-x)/da,n=function(t){var e,n=t*r,s=xa(x),u=a/(2*y)*(s*(e=da*n+x,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(x));return[o+u*l,i+u*f,a*s/xa(da*n+x)]}}return n.duration=1e3*r,n},ga=function(t){return function(){return t}};function ma(t,e,n){this.target=t,this.type=e,this.transform=n}function wa(t,e,n){this.k=t,this.x=e,this.y=n}wa.prototype={constructor:wa,scale:function(t){return 1===t?this:new wa(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new wa(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ba=new wa(1,0,0);function _a(){ft.stopImmediatePropagation()}wa.prototype;var Ea=function(){ft.preventDefault(),ft.stopImmediatePropagation()};function Aa(){return!ft.ctrlKey&&!ft.button}function Ma(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Ca(){return this.__zoom||ba}function ka(){return-ft.deltaY*(1===ft.deltaMode?.05:ft.deltaMode?1:.002)}function Na(){return navigator.maxTouchPoints||"ontouchstart"in this}function Pa(t,e,n){var r=t.invertX(e[0][0])-n[0][0],o=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}var Oa=n(0),Sa=n.n(Oa),Ta=n(54),ja=n.n(Ta);n(61);var Ia=function(){function t(e){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=void 0,(n="graphViewProps")in this?Object.defineProperty(this,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[n]=r,this.graphViewProps=e}var e,n;return e=t,(n=[{key:"calculatePosition",value:function(t){return t}},{key:"adjustNodes",value:function(t,e){for(var n=null,r=0;r<t.length;r++){n=t[r];var o=this.calculatePosition({x:n.x||0,y:n.y||0});n.x=o.x,n.y=o.y}return t}},{key:"getPositionForNode",value:function(t){return this.calculatePosition(t)}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ra(t){return Ra="function"==typeof Symbol&&"symbol"==r(Symbol.iterator)?function(t){return r(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)},Ra(t)}function La(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ba(t,e){return Ba=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ba(t,e)}function Da(t,e){if(e&&("object"===Ra(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function za(t){return za=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},za(t)}var Ua=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ba(t,e)}(o,t);var e,n,r=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=za(t);if(e){var o=za(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Da(this,n)}}(o);function o(){return La(this,o),r.apply(this,arguments)}return e=o,(n=[{key:"calculatePosition",value:function(t){return t}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(Ia),Fa=Ua;function qa(t){return qa="function"==typeof Symbol&&"symbol"==r(Symbol.iterator)?function(t){return r(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)},qa(t)}function Ya(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Va(t,e){return Va=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Va(t,e)}function Ha(t,e){if(e&&("object"===qa(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Xa(t){return Xa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xa(t)}var $a=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Va(t,e)}(o,t);var e,n,r=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Xa(t);if(e){var o=Xa(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ha(this,n)}}(o);function o(){return Ya(this,o),r.apply(this,arguments)}return e=o,(n=[{key:"calculatePosition",value:function(t){var e=t.x,n=t.y,r=this.graphViewProps.gridSpacing,o=(r=r||10)/2,i=e||0,a=n||0;if(e&&(e-o)%r!=0){var s=1;(e-o)%r<o&&(s=-1),i=r*Math.round(e/r)+o*s}if(n&&(n-o)%r!=0){var u=1;(n-o)%r<o&&(u=-1),a=r*Math.round(n/r)+o*u}return{x:i,y:a}}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(Ia),Wa=$a,Za=n(25);function Ga(t){return Ga="function"==typeof Symbol&&"symbol"==r(Symbol.iterator)?function(t){return r(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)},Ga(t)}function Ka(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qa(t,e){return Qa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qa(t,e)}function Ja(t,e){if(e&&("object"===Ga(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ts(t){return ts=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ts(t)}var es=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qa(t,e)}(o,t);var e,n,r=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ts(t);if(e){var o=ts(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ja(this,n)}}(o);function o(){return Ka(this,o),r.apply(this,arguments)}return e=o,(n=[{key:"adjustNodes",value:function(t,e){var n=this.graphViewProps,r=n.nodeKey,o=n.nodeSize,i=n.nodeHeight,a=n.nodeWidth,s=n.nodeSpacingMultiplier,u=new Za.graphlib.Graph;u.setGraph({}),u.setDefaultEdgeLabel((function(){return{}}));var c,l,f=s||1.5,h=(o||1)*f;return i&&(c=i*f),a&&(l=a*f),t.forEach((function(t){if(e){var n=t[r],o="key-".concat(n),i=e[o];0===i.incomingEdges.length&&0===i.outgoingEdges.length||(u.setNode(o,{width:l||h,height:c||h}),i.outgoingEdges.forEach((function(t){u.setEdge(o,"key-".concat(t.target))})))}})),Za.layout(u),u.nodes().forEach((function(t){var n=e[t],r=u.node(t);n.node.x=r.x,n.node.y=r.y})),t}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(Wa),ns=es;function rs(t){return rs="function"==typeof Symbol&&"symbol"==r(Symbol.iterator)?function(t){return r(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)},rs(t)}function os(){return os=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},os.apply(this,arguments)}function is(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function as(t,e){return as=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},as(t,e)}function ss(t,e){if(e&&("object"===rs(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function us(t){return us=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},us(t)}var cs=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&as(t,e)}(o,t);var e,n,r=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=us(t);if(e){var o=us(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ss(this,n)}}(o);function o(){return is(this,o),r.apply(this,arguments)}return e=o,(n=[{key:"adjustNodes",value:function(t,e){var n=this.graphViewProps,r=n.nodeKey,o=n.nodeSize,i=n.nodeHeight,a=n.nodeWidth,s=n.nodeSizeOverridesAllowed,u=n.nodeSpacingMultiplier,c=n.nodeLocationOverrides,l=n.graphConfig,f=u||1.5,h=(o||1)*f,y=new Za.graphlib.Graph,p=i?i*f:h,d=a?a*f:h,x=l&&l.renderOrphanEnabled||!1;if(y.setGraph(os({rankdir:"LR"},l)),y.setDefaultEdgeLabel((function(){return{}})),t.forEach((function(t){if(e){var n=t.sizeOverrides,o=(n=void 0===n?{}:n).width,i=n.height,a=t[r],u="key-".concat(a),c=e[u];(x||0!==c.incomingEdges.length||0!==c.outgoingEdges.length)&&(y.setNode(u,{width:s&&o?o:d,height:s&&i?i:p}),c.outgoingEdges.forEach((function(t){y.setEdge(u,"key-".concat(t.target))})))}})),Za.layout(y),c)for(var v in c)if(Object.prototype.hasOwnProperty.call(c,v)){var g="key-".concat(v),m=y.node(g),w=c[v];m&&w&&(m.x=w.x,m.y=w.y)}return y.nodes().forEach((function(t){var n=e[t],r=y.node(t);n.node.x=r.x,n.node.y=r.y})),t}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(Wa),ls={None:Fa,SnapToGrid:Wa,VerticalTree:ns,HorizontalTree:cs},fs=function(t){var e=t.backgroundFillId,n=void 0===e?"#grid":e,r=t.gridSize,o=void 0===r?40960:r,i=t.renderBackground;return null!=i?i(o):Oa.createElement("rect",{className:"background",x:-(o||0)/4,y:-(o||0)/4,width:o,height:o,fill:"url(".concat(n||"",")")})},hs=.15,ys=function(t){var e=t.edgeArrowSize,n=void 0===e?8:e;return 0===n?null:Oa.createElement("marker",{id:"end-arrow",key:"end-arrow",viewBox:"0 -".concat(n/2," ").concat(n," ").concat(n),refX:"".concat(n/2),markerWidth:"".concat(n),markerHeight:"".concat(n),orient:"auto"},Oa.createElement("path",{className:"arrow",d:"M0,-".concat(n/2,"L").concat(n,",0L0,").concat(n/2),width:"".concat(n),height:"".concat(n)}))},ps=function(t){var e=t.gridDotSize,n=void 0===e?2:e,r=t.gridSpacing,o=void 0===r?36:r;return Oa.createElement("circle",{className:"circle",cx:(o||0)/2,cy:(o||0)/2,r:n})},ds=function(t){var e=t.gridSpacing,n=t.gridDotSize;return Oa.createElement("pattern",{id:"grid",key:"grid",width:e,height:e,patternUnits:"userSpaceOnUse"},Oa.createElement(ps,{gridSpacing:e,gridDotSize:n}))},xs=function(){return Oa.createElement("filter",{id:"dropshadow",key:"dropshadow",height:"130%"},Oa.createElement("feGaussianBlur",{in:"SourceAlpha",stdDeviation:"3"}),Oa.createElement("feOffset",{dx:"2",dy:"2",result:"offsetblur"}),Oa.createElement("feComponentTransfer",null,Oa.createElement("feFuncA",{type:"linear",slope:"0.1"})),Oa.createElement("feMerge",null,Oa.createElement("feMergeNode",null),Oa.createElement("feMergeNode",{in:"SourceGraphic"})))};function vs(t){return function(t){if(Array.isArray(t))return ms(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||gs(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gs(t,e){if(t){if("string"==typeof t)return ms(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ms(t,e):void 0}}function ms(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ws(t){var e=[];return Object.keys(t).forEach((function(n){var r=t[n].shapeId?t[n].shapeId.replace("#",""):"graphdef";e.push(Sa.a.cloneElement(t[n].shape,{key:"".concat(r,"-").concat(e.length+1)}))})),e}var bs=function(t){var e=t.gridDotSize,n=void 0===e?2:e,r=t.edgeArrowSize,o=void 0===r?8:r,i=t.gridSpacing,a=void 0===i?36:i,s=t.nodeTypes,u=t.nodeSubtypes,c=t.edgeTypes,l=t.renderDefs,f=void 0===l?function(){return null}:l,h=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(t){s=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(t)||gs(t,2)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(Object(Oa.useState)([])),y=h[0],p=h[1];return Object(Oa.useEffect)((function(){var t=[].concat(vs(ws(s)),vs(ws(u)),vs(ws(c)));p(t)}),[s,u,c]),Sa.a.createElement("defs",null,y,Sa.a.createElement(ys,{edgeArrowSize:o}),Sa.a.createElement(ds,{gridSpacing:a,gridDotSize:n}),Sa.a.createElement(xs,null),f())},_s=n(149),Es=n.n(_s);function As(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ms(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ms(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Ms(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Cs(t){return Cs="function"==typeof Symbol&&"symbol"==r(Symbol.iterator)?function(t){return r(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)},Cs(t)}var ks=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n;return e=t,n=[{key:"getNodesMap",value:function(t,e){for(var n={},r=Object.keys(t).map((function(e){return t[e]})),o=null,i=0;i<r.length;i++)o=r[i],n["key-".concat(o[e])]={children:[],incomingEdges:[],node:o,originalArrIndex:i,outgoingEdges:[],parents:[]};return n}},{key:"getEdgesMap",value:function(t){for(var e={},n=null,r=0;r<t.length;r++)null!=(n=t[r]).target&&(e["".concat(null!=n.source?n.source:"","_").concat(n.target)]={edge:n,originalArrIndex:r});return e}},{key:"linkNodesAndEdges",value:function(t,e){for(var n=null,r=null,o=null,i=0;i<e.length;i++)if(null!=(o=e[i]).target){var a="key-".concat(null!=o.source?o.source:""),s="key-".concat(o.target);n=t[a],r=t[s],n&&r?(n.outgoingEdges.push(o),r.incomingEdges.push(o),n.children.push(r),r.parents.push(n)):console.warn("react-digraph: Found orphaned edges")}}},{key:"removeElementFromDom",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document,n=e.querySelector("[id='".concat(t,"']"));return!(!n||!n.parentNode||(n.parentNode.removeChild(n),0))}},{key:"findParent",value:function(e,n,r){var o,i;return!e||r&&null!=e&&null!==(o=e.matches)&&void 0!==o&&o.call(e,r)?null:null!=e&&null!==(i=e.matches)&&void 0!==i&&i.call(e,n)?e:null!=e&&e.parentNode?t.findParent(e.parentNode,n,r):null}},{key:"classNames",value:function(){for(var t="",e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];for(var o=function(){var e=a[i];"string"==typeof e||"number"==typeof e?t+=" ".concat(e):"object"!==Cs(e)||Array.isArray(e)||null===e?Array.isArray(e)&&(t+=" ".concat(e.join(" "))):Object.keys(e).forEach((function(n){e[n]&&(t+=" ".concat(n))}))},i=0,a=n;i<a.length;i++)o();return t.trim()}},{key:"yieldingLoop",value:function(t,e,n,r){var o=0;!function i(){for(var a=Math.min(o+e,t);o<a;++o)n.call(null,o);o<t?setTimeout(i,0):r&&r.call(null)}()}},{key:"hasNodeShallowChanged",value:function(t,e){return!this.isEqual(t,e)}},{key:"isEqual",value:function(t,e){return Es()(t,e)}},{key:"findNodesWithinArea",value:function(t,e,n,r){var o=Math.min(t.x,e.x),i=Math.min(t.y,e.y),a=Math.max(e.x,t.x),s=Math.max(e.y,t.y),u=new Map;return n.forEach((function(t){t.x>=o&&t.x<=a&&t.y>=i&&t.y<=s&&u.set(t[r],t)})),u}},{key:"findConnectedEdgesForNodes",value:function(t,e,n){var r,o=new Map,i=As(t);try{for(i.s();!(r=i.n()).done;){var a,s=r.value,u=As(t);try{for(u.s();!(a=u.n()).done;){var c=a.value,l=e["".concat(s[1][n],"_").concat(c[1][n])],f=e["".concat(c[1][n],"_").concat(s[1][n])];null!=l&&o.set("".concat(l.edge.source,"_").concat(l.edge.target),l.edge),null!=f&&o.set("".concat(f.edge.source,"_").concat(f.edge.target),f.edge)}}catch(t){u.e(t)}finally{u.f()}}}catch(t){i.e(t)}finally{i.f()}return o}}],n&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Ns=ks;function Ps(t){var e=t.handleText,n=t.edgeHandleTranslation;return Sa.a.createElement("text",{className:"edge-text edge-handle-text",textAnchor:"middle",alignmentBaseline:"central",dominantBaseline:"middle",transform:"".concat(n)},e)}function Os(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ss(t){var e=t.data,n=t.edgeHandleRotation,r=t.edgeHandleTranslation,o=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(t){s=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(t)||function(t,e){if(t){if("string"==typeof t)return Os(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Os(t,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(n),i=o[0],a=o[1]?"".concat(e.label_to||"").concat(e.label_from?" ↔ ".concat(e.label_from):""):"".concat(e.label_from||"").concat(e.label_to?" ↔ ".concat(e.label_to):"");return Sa.a.createElement("text",{className:"edge-text edge-label-text",textAnchor:"middle",alignmentBaseline:"central",transform:"".concat(r," ").concat(i," translate(0,-5)")},a)}var Ts=n(13),js=n(4),Is=n(150);function Rs(t,e,n,r,o){var i={xOff:0,yOff:0,intersect:{type:"none",point:{x:0,y:0}}},a=Vs(o),s=t.getBoundingClientRect(),u=t.getAttribute("width"),c=t.getAttribute("height"),l=u?parseFloat(u):s.width,f=c?parseFloat(c):s.height,h=n.x||0,y=n.y||0,p=e.x||0,d=e.y||0,x=y-f/2,v=y+f/2,g=h-l/2,m=h+l/2,w=Object(Ts.shape)("line",{x1:p,y1:d,x2:h,y2:y}),b={topLeft:new js.Point2D(g,x),bottomRight:new js.Point2D(m,v)},_=[b.topLeft,new js.Point2D(b.bottomRight.x,b.topLeft.y),b.bottomRight,new js.Point2D(b.topLeft.x,b.bottomRight.y)],E=b.topLeft.lerp(b.bottomRight,.5),A=t.getAttribute("transform"),M=A?A.replace(/(rotate.[0-9]*.)|[^]/g,"$1"):null,C=0;M&&(M=M.replace(/^rotate\(|\)$/g,""),C=parseFloat(M)*Math.PI/180);var k=js.Matrix2D.rotationAt(C,E),N=_.map((function(t){return t.transform(k)})),P=Is.Intersection.intersectLinePolygon(w.params[0],w.params[1],N);if(P.points.length>0){var O=0,S=0,T=P.points[0].x,j=P.points[0].y;T>g&&T<m&&j>y?S=a.height:T>g&&T<m&&j<y?S=-a.height:O=j>x&&j<v&&T<h?-a.width:a.width,i.xOff=h-T-(r?O/1.25:0),i.yOff=y-j-(r?S/1.25:0),i.intersect=P.points[0]}return i}function Ls(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4?arguments[4]:void 0,i={xOff:0,yOff:0,intersect:{type:"none",point:{x:0,y:0}}},a=Vs(o),s=t.getBoundingClientRect(),u=s.width||t.parentElement.getAttribute("width"),c=s.height||t.parentElement.getAttribute("height"),l=(null==n?void 0:n.x)||0,f=(null==n?void 0:n.y)||0,h=(null==e?void 0:e.x)||0,y=(null==e?void 0:e.y)||0,p=f-c/2,d=f+c/2,x=l-u/2,v=l+u/2,g=t.getAttribute("d");if(/^M/.test(g)){var m=(g=g.replace(/^M /,"")).split(/[ ,]+/);m=m.map((function(t,e){var n=!1;return/Z$/.test(t)&&(t=t.replace(/Z$/,""),n=!0),e%2==0?parseFloat(t)+x+(n?"Z":""):parseFloat(t)+p+(n?"Z":"")}));var w=Object(Ts.intersect)(Object(Ts.shape)("path",{d:"M "+m.join(" ")}),Object(Ts.shape)("line",{x1:h,y1:y,x2:l,y2:f}));if(w.points.length>0){var b=0,_=0,E=w.points[0].x,A=w.points[0].y,M=1;if(E>x&&E<v){var C=A-f;M=A<f?-1:1,_=a.height*M,_*=Math.min(Math.abs(C),1)}if(A>p&&A<d){var k=E-l;M=E<l?-1:1,b=a.width*M,b*=Math.min(Math.abs(k),1)}i.xOff=l-E-(r?b/1.25:0),i.yOff=f-A-(r?_/1.25:0),i.intersect=w.points[0]}return i}}function Bs(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4?arguments[4]:void 0,i={xOff:0,yOff:0,intersect:{type:"none",point:{x:0,y:0}}},a=Vs(o),s=a.width,u=a.height,c=t.getBoundingClientRect(),l=t.parentElement,f=l.getAttribute("width"),h=l.getAttribute("width");f&&(f=parseFloat(f)),h&&(h=parseFloat(h));var y=f||c.width,p=h||c.height,d=n.x||0,x=n.y||0,v=e.x||0,g=e.y||0,m=1.25,w=y/2+(r?s/m:0),b=p/2+(r?u/m:0),_=Object(Ts.intersect)(Object(Ts.shape)("ellipse",{rx:w,ry:b,cx:d,cy:x}),Object(Ts.shape)("line",{x1:v,y1:g,x2:d,y2:x}));if(_.points.length>0){var E=_.points[0].x,A=_.points[0].y;i.xOff=d-E,i.yOff=x-A,i.intersect=_.points[0]}return i}function Ds(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function zs(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ds(Object(n),!0).forEach((function(e){Us(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ds(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Us(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Fs(t,e){return e.type&&t[e.type]?t[e.type].shapeId:t.emptyEdge?t.emptyEdge.shapeId:null}function qs(t,e,n,r){var o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=arguments.length>5?arguments[5]:void 0,a={xOff:0,yOff:0,intersect:{type:"none",point:{x:0,y:0}}};if(null==n||null==n[r])return a;var s=i.querySelector("[id='node-".concat(n[r],"']"));if(!s)return a;var u=s.querySelector("use.node");if(!u||u&&!u.getAttribute)return a;var c=u.getAttribute("href");if(c||(c=u.getAttributeNS("http://www.w3.org/1999/xlink","href")),!c)return a;var l=i.querySelector("defs>".concat(c," rect:not([data-intersect-ignore=true])")),f=l?null:i.querySelector("defs>".concat(c," path:not([data-intersect-ignore=true])")),h=f||f?null:i.querySelector("defs>".concat(c," circle:not([data-intersect-ignore=true]), defs>").concat(c," ellipse:not([data-intersect-ignore=true]), defs>").concat(c," polygon:not([data-intersect-ignore=true])"));return zs(zs({},a),l?Rs(l,e,n,o,i):f?Ls(f,e,n,o,i):Bs(h,e,n,o,i))}function Ys(t,e){var n=((null==e?void 0:e.x)||0)-((null==t?void 0:t.x)||0),r=((null==e?void 0:e.y)||0)-((null==t?void 0:t.y)||0);return Math.atan2(r,n)}function Vs(t){var e=t.querySelector("defs>marker>.arrow"),n=e.getBoundingClientRect();return{bottom:n.bottom,top:n.top,height:n.height||e.getAttribute("height"),width:n.width||e.getAttribute("width"),left:n.left,right:n.right,y:n.y,x:n.x}}function Hs(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Xs(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Hs(Object(n),!0).forEach((function(e){$s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hs(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function $s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ws=function(t){var e=t.data,n=t.edgeTypes,r=t.viewWrapperElem,o=t.edgeHandleSize,i=void 0===o?50:o,a=t.isSelected,s=void 0!==a&&a,u=t.rotateEdgeHandle,c=void 0===u||u,l=t.nodeSize,f=void 0===l?0:l,h=t.sourceNode,y=t.targetNode,p=t.nodeKey,d=t.isBeingDragged,x=void 0!==d&&d,v=Object(Oa.useRef)(),g=Object(Oa.useRef)(),m=function(t){var e=-(t||0)/2;return"translate(".concat(e,", ").concat(e,")")}(i),w=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=!1,n=180*Ys(arguments.length>1?arguments[1]:void 0,arguments.length>2?arguments[2]:void 0)/Math.PI;return t&&(n=-n),(n>90||n<-90)&&(n+=180,e=!0),["rotate(".concat(n,")"),e]}(!1,h,y),b=function(t,e,n,r,o,i){var a=n&&n.x?n.x:0,s=n&&n.y?n.y:0,u=e&&e.x?e.x:0,c=e&&e.y?e.y:0,l=qs(o||0,n,e,r,!1,i),f=qs(o||0,e,n,r,!0,i);return function(t){return function(){var t=Ti,e=ji,n=Pi(!0),r=null,o=Si,i=null;function a(a){var s,u,c,l=a.length,f=!1;for(null==r&&(i=o(c=Fn())),s=0;s<=l;++s)!(s<l&&n(u=a[s],s,a))===f&&((f=!f)?i.lineStart():i.lineEnd()),f&&i.point(+t(u,s,a),+e(u,s,a));if(c)return i=null,c+""||null}return a.x=function(e){return arguments.length?(t="function"==typeof e?e:Pi(+e),a):t},a.y=function(t){return arguments.length?(e="function"==typeof t?t:Pi(+t),a):e},a.defined=function(t){return arguments.length?(n="function"==typeof t?t:Pi(!!t),a):n},a.curve=function(t){return arguments.length?(o=t,null!=r&&(i=o(r)),a):o},a.context=function(t){return arguments.length?(null==t?r=i=null:i=o(r=t),a):r},a}().x((function(t){return t.x})).y((function(t){return t.y}))(t)}([{x:u-l.xOff,y:c-l.yOff},{x:a-f.xOff,y:s-f.yOff}])}(0,h,y,p,f,r),_=function(t){var e=t.replace(/^M/,"").replace(/L/,",").split(","),n=parseFloat(e[2])-parseFloat(e[0]),r=parseFloat(e[3])-parseFloat(e[1]),o=parseFloat(e[0])+n/2,i=parseFloat(e[1])+r/2;return"translate(".concat(o,", ").concat(i,")")}(b),E=function(t,e,n,r){var o=t,i=r?n[0]:"",a=e;return"".concat(o," ").concat(i," ").concat(a)}(_,m,w,c);if(!r)return null;var A="".concat(null!=e.source?e.source:"","_").concat(e.target),M=Ns.classNames("edge",e.type,{selected:s}),C={pointerEvents:x?"none":"auto"};return Sa.a.createElement("g",{className:"edge-container","data-source":e.source,"data-target":e.target},Sa.a.createElement("g",{className:M},Sa.a.createElement("path",{ref:v,className:"edge-path",d:b||void 0,style:Xs({},C)}),Sa.a.createElement("use",{href:Fs(n,e),width:i,height:i,transform:E,style:Xs({transform:E},C)}),e.handleText&&Sa.a.createElement(Ps,{handleText:e.handleText,edgeHandleTranslation:_}),e.label_from&&e.label_to&&Sa.a.createElement(Ss,{data:e,edgeHandleRotation:w,edgeHandleTranslation:_})),Sa.a.createElement("g",{className:"edge-mouse-handler"},Sa.a.createElement("title",null,e.handleTooltipText),Sa.a.createElement("path",{className:"edge-overlay-path",ref:g,id:A,"data-source":e.source,"data-target":e.target,d:b||void 0,style:Xs({},C)})))},Zs=n(151),Gs=n.n(Zs);function Ks(t,e,n){return 100*(t-e)/(n-e)}function Qs(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hs,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1.5;return Object(Oa.useMemo)((function(){return Ks(t,e,n)}),[n,e,t])}var Js=n(152),tu=n.n(Js),eu=Gs()(tu.a),nu=function(){return eu},ru=function(t){var e=t.maxZoom,n=void 0===e?1.5:e,r=t.minZoom,o=void 0===r?hs:r,i=t.zoomLevel,a=t.zoomToFit,s=t.modifyZoom,u=Object(Oa.useCallback)((function(t){var e=function(t,e,n){return t*(n-e)/100+e}(t.target.value,o,n);e<=(n||0)&&e>=(o||0)&&s(e-i)}),[o,n,i,s]),c=Qs(o,o,n),l=Qs(n,o,n),f=Qs(i,o,n);return Sa.a.createElement("div",{className:"graph-controls"},Sa.a.createElement("div",{className:"slider-wrapper"},Sa.a.createElement("span",null,"-"),Sa.a.createElement("input",{type:"range",className:"slider",min:c,max:l,value:f,onChange:u,step:"1"}),Sa.a.createElement("span",null,"+")),Sa.a.createElement("button",{type:"button",className:"slider-button",onMouseDown:a},Sa.a.createElement(nu,null)))},ou=Sa.a.forwardRef((function(t,e){var n=t.startPoint,r=t.endPoint,o=r.x-n.x,i=r.y-n.y;return Sa.a.createElement("rect",{className:"highlight-area",width:Math.abs(o),height:Math.abs(i),ref:e,x:o>0?n.x:r.x,y:i>0?n.y:r.y,style:{fill:"rgb(0, 149, 210)",fillOpacity:.15,stroke:"rgba(57, 165, 209, 0.5)",strokeWidth:2}})})),iu=function(t){var e=t.data,n=t.nodeTypes,r=t.isSelected,o=t.maxTitleChars,i=void 0===o?12:o,a=t.lineOffset,s=void 0===a?18:a,u=Object(Oa.useRef)(),c=e.title,l=Object(Oa.useMemo)((function(){return Ns.classNames("node-text",{selected:r})}),[r]),f=Object(Oa.useCallback)((function(t){t.stopPropagation()}),[]),h=Object(Oa.useMemo)((function(){return function(t,e){return t.type&&e[t.type]?e[t.type].typeText:e.emptyNode?e.emptyNode.typeText:null}(e,n)}),[e,n]);return Object(Oa.useEffect)((function(){Mt(u.current).on("click",(function(){return f(ft)}))}),[f]),Sa.a.createElement("text",{ref:u,className:l,textAnchor:"middle",xmlns:"http://www.w3.org/2000/svg"},!!h&&Sa.a.createElement("tspan",{opacity:"0.5"},h),c&&Sa.a.createElement("tspan",{x:0,dy:s,fontSize:"10px",xmlns:"http://www.w3.org/2000/svg"},c.length>i?c.substr(0,i):c),c&&Sa.a.createElement("title",null,c))};function au(t,e){return t&&e[t]?e[t].shapeId:e.emptyNode?e.emptyNode.shapeId:null}function su(t){var e=t.data,n=t.nodeTypes,r=t.nodeSubtypes,o=(t.nodeKey,t.nodeSize),i=t.nodeWidth,a=t.nodeHeight,s=t.selected,u=void 0!==s&&s,c=t.hovered,l=void 0!==c&&c,f=o||a||154,h=o||i||154,y=Ns.classNames("shape"),p=Object(Oa.useMemo)((function(){return Ns.classNames("node",{selected:u,hovered:l})}),[u,l]),d=Object(Oa.useMemo)((function(){return Ns.classNames("subtype-shape",{selected:u})}),[u]),x=au(e.type,n)||"",v=au(e.subtype,r)||"",g=Object(Oa.useMemo)((function(){return x?document.querySelector("defs>".concat(x)):null}),[x]),m=g?g.getAttribute("width"):0,w=g?g.getAttribute("height"):0;return h=m?parseInt(m,10):h,f=w?parseInt(w,10):f,Sa.a.createElement("g",{className:y,width:h,height:f,xmlns:"http://www.w3.org/2000/svg"},!!e.subtype&&Sa.a.createElement("use",{className:d,x:-h/2,y:-f/2,width:h,height:f,href:v,xmlns:"http://www.w3.org/2000/svg"}),Sa.a.createElement("use",{className:p,x:-h/2,y:-f/2,width:h,height:f,href:x,xmlns:"http://www.w3.org/2000/svg"}))}function uu(){return uu=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},uu.apply(this,arguments)}function cu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var lu=function(t){var e=t.data,n=t.id,r=t.nodeKey,o=t.opacity,i=t.nodeTypes,a=t.nodeSubtypes,s=t.isSelected,u=void 0!==s&&s,c=t.nodeSize,l=t.nodeHeight,f=t.nodeWidth,h=t.maxTitleChars,p=void 0===h?12:h,d=t.centerNodeOnMove,x=void 0===d||d,v=t.layoutEngine,g=t.viewWrapperElem,m=t.renderNodeText,w=t.renderNode,b=t.onNodeMouseEnter,_=void 0===b?function(){}:b,E=t.onNodeMouseLeave,A=void 0===E?function(){}:E,M=t.onNodeMove,C=void 0===M?function(){}:M,k=t.onNodeSelected,N=void 0===k?function(){}:k,P=t.onNodeUpdate,O=void 0===P?function(){return Promise.resolve()}:P,S=Object(Oa.useRef)(!1),T=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(t){s=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(t)||function(t,e){if(t){if("string"==typeof t)return cu(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cu(t,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(Object(Oa.useState)(!1)),j=T[0],I=T[1],R=Object(Oa.useRef)(),L=Object(Oa.useRef)(),B=Object(Oa.useRef)();B.current={x:e.x||0,y:e.y||0,pointerOffset:null};var D=Object(Oa.useCallback)((function(t){I(!0),_(t,e)}),[_,e]),z=Object(Oa.useCallback)((function(t){var n;(t&&!t.relatedTarget||t&&(null===(n=t.relatedTarget)||void 0===n||!n.matches(".edge-overlay-path"))&&!Ns.findParent(t.relatedTarget,"g.node","svg.graph"))&&(I(!1),A(t,e))}),[A,e]),U=Object(Oa.useCallback)((function(){R.current&&(L.current||(L.current=R.current.parentElement.nextSibling),R.current.parentElement.parentElement.appendChild(R.current.parentElement))}),[]),F=Object(Oa.useCallback)((function(t){var n;if(R.current){var o=t.sourceEvent,i=o.shiftKey||S.current;S.current=!1,B.current.pointerOffset=null,null!==(n=L.current)&&void 0!==n&&n.parentElement&&L.current.parentElement.insertBefore(R.current.parentElement,L.current);var a=function(){return N(e,e[r],i,o)};O(B.current,e[r],i).then(a).catch(a)}}),[O,e,r,N]),q=Object(Oa.useCallback)((function(t){var n=t.sourceEvent.shiftKey,o={x:t.x,y:t.y,pointerOffset:B.current.pointerOffset};if(x||(o.pointerOffset=o.pointerOffset||{x:t.x-(e.x||0),y:t.y-(e.y||0)},o.x-=o.pointerOffset.x,o.y-=o.pointerOffset.y),n){S.current=!0;var i=qs(c||154,e,o,r,!0,g);o.x+=i.xOff,o.y+=i.yOff}else!S.current&&v&&uu(o,v.getPositionForNode(o));B.current={x:o.x,y:o.y,pointerOffset:o.pointerOffset},C(o,e[r],n||S.current)}),[x,e,v,r,c,C,g]);Object(Oa.useEffect)((function(){var t=function(){var t,e,n,r,o=Zn,i=Gn,a=Kn,s=Qn,u={},c=y("start","drag","end"),l=0,f=0;function h(t){t.on("mousedown.drag",p).filter(s).on("touchstart.drag",v).on("touchmove.drag",g).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(){if(!r&&o.apply(this,arguments)){var a=w("mouse",i.apply(this,arguments),be,this,arguments);a&&(Mt(ft.view).on("mousemove.drag",d,!0).on("mouseup.drag",x,!0),Nt(ft.view),Ct(),n=!1,t=ft.clientX,e=ft.clientY,a("start"))}}function d(){if(kt(),!n){var r=ft.clientX-t,o=ft.clientY-e;n=r*r+o*o>f}u.mouse("drag")}function x(){Mt(ft.view).on("mousemove.drag mouseup.drag",null),Pt(ft.view,n),kt(),u.mouse("end")}function v(){if(o.apply(this,arguments)){var t,e,n=ft.changedTouches,r=i.apply(this,arguments),a=n.length;for(t=0;t<a;++t)(e=w(n[t].identifier,r,we,this,arguments))&&(Ct(),e("start"))}}function g(){var t,e,n=ft.changedTouches,r=n.length;for(t=0;t<r;++t)(e=u[n[t].identifier])&&(kt(),e("drag"))}function m(){var t,e,n=ft.changedTouches,o=n.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),t=0;t<o;++t)(e=u[n[t].identifier])&&(Ct(),e("end"))}function w(t,e,n,r,o){var i,s,f,y=n(e,t),p=c.copy();if(vt(new Wn(h,"beforestart",i,t,l,y[0],y[1],0,0,p),(function(){return null!=(ft.subject=i=a.apply(r,o))&&(s=i.x-y[0]||0,f=i.y-y[1]||0,!0)})))return function a(c){var d,x=y;switch(c){case"start":u[t]=a,d=l++;break;case"end":delete u[t],--l;case"drag":y=n(e,t),d=l}vt(new Wn(h,c,i,t,d,y[0]+s,y[1]+f,y[0]-x[0],y[1]-x[1],p),p.apply,p,[c,r,o])}}return h.filter=function(t){return arguments.length?(o="function"==typeof t?t:$n(!!t),h):o},h.container=function(t){return arguments.length?(i="function"==typeof t?t:$n(t),h):i},h.subject=function(t){return arguments.length?(a="function"==typeof t?t:$n(t),h):a},h.touchable=function(t){return arguments.length?(s="function"==typeof t?t:$n(!!t),h):s},h.on=function(){var t=c.on.apply(c,arguments);return t===c?h:t},h.clickDistance=function(t){return arguments.length?(f=(t=+t)*t,h):Math.sqrt(f)},h}().on("drag",(function(){return q(ft)})).on("start",U).on("end",(function(){return F(ft)}));Mt(R.current).call(t)}),[F,U,q,D]);var Y=Object(Oa.useMemo)((function(){return Ns.classNames("node",e.type,{hovered:j,isSelected:u})}),[e.type,j,u]),V=B.current,H=V.x,X=V.y;return Sa.a.createElement("g",{className:Y,onMouseOver:D,onMouseOut:z,id:n,ref:R,opacity:o,transform:"translate(".concat(H,", ").concat(X,")"),style:{transform:"matrix(1, 0, 0, 1, ".concat(H,", ").concat(X,")")}},w?w(R,e,e[r],u,j):Sa.a.createElement(su,{data:e,nodeKey:r,nodeTypes:i,nodeSubtypes:a,nodeSize:c,nodeHeight:l,nodeWidth:f,selected:u,hovered:j}),m?m(e,n,u):Sa.a.createElement(iu,{data:e,nodeTypes:i,isSelected:u,maxTitleChars:p}))};function fu(t){return fu="function"==typeof Symbol&&"symbol"==r(Symbol.iterator)?function(t){return r(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)},fu(t)}function hu(){return hu=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},hu.apply(this,arguments)}function yu(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){s=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return pu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pu(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function du(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function xu(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?du(Object(n),!0).forEach((function(e){_u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):du(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function vu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function gu(t,e){return gu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},gu(t,e)}function mu(t,e){if(e&&("object"===fu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return wu(t)}function wu(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function bu(t){return bu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bu(t)}function _u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Eu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&gu(t,e)}(i,t);var e,n,r,o=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=bu(t);if(e){var o=bu(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return mu(this,n)}}(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),_u(wu(e=o.call(this,t)),"nodeTimeouts",void 0),_u(wu(e),"edgeTimeouts",void 0),_u(wu(e),"renderNodesTimeout",void 0),_u(wu(e),"renderEdgesTimeout",void 0),_u(wu(e),"zoom",void 0),_u(wu(e),"viewWrapper",void 0),_u(wu(e),"graphSvg",void 0),_u(wu(e),"entities",void 0),_u(wu(e),"graphControlsWrapper",void 0),_u(wu(e),"highlightAreaRef",void 0),_u(wu(e),"selectedView",void 0),_u(wu(e),"view",void 0),_u(wu(e),"layoutEngine",void 0),_u(wu(e),"removeOldEdges",(function(t,n){for(var r=null,o=0;o<t.length;o++)null!=(r=t[o]).source&&null!=r.target&&n["".concat(r.source,"_").concat(r.target)]||e.removeEdgeElement(r.source,r.target)})),_u(wu(e),"handleDelete",(function(t){var n,r,o,i,a=e.props,s=a.canDeleteSelected,u=a.readOnly,c=a.onDeleteSelected,l=a.onSelect;!u&&(null!=t&&null!==(n=t.nodes)&&void 0!==n&&n.size||null!=t&&null!==(r=t.edges)&&void 0!==r&&r.size)&&s&&s(t)&&(null===(o=t.nodes)||void 0===o||o.forEach((function(t){e.deleteNode(t)})),null===(i=t.edges)||void 0===i||i.forEach((function(t){e.deleteEdge(t)})),c&&c(t),l&&l({nodes:null,edges:null}))})),_u(wu(e),"handleKeyDown",(function(t){var n,r,o,i,a=e.props,s=a.selected,u=a.disableBackspace,c=a.allowCopyEdges,l=a.onUndo,f=a.onCopySelected,h=a.onPasteSelected,y=e.state,p=y.focused,d=y.mousePosition;if(p)switch(t.key){case"Delete":case"Backspace":if("Backspace"===t.key&&u)break;s&&(null!==(n=s.nodes)&&void 0!==n&&n.size||null!==(r=s.edges)&&void 0!==r&&r.size)&&e.handleDelete(s);break;case"z":e.isControlKeyPressed(t)&&l&&l();break;case"c":e.isControlKeyPressed(t)&&(null!=s&&null!==(o=s.nodes)&&void 0!==o&&o.size||c&&null!=s&&null!==(i=s.edges)&&void 0!==i&&i.size)&&f&&f();break;case"v":if(e.isControlKeyPressed(t)&&s){var x=d||{x:0,y:0},v=x.x,g=x.y;h&&h(s,{x:v,y:g})}}})),_u(wu(e),"handleEdgeSelected",(function(t){var n=t.target.dataset,r=n.source,o=n.target,i=e.props.onSelect,a={svgClicked:!0,focused:!0};if(null!=r&&null!=o){if(null==e.getEdgeBySourceTarget(r,o))return;var s=e.getEdgeBySourceTarget(r,o).originalArrIndex;a=xu(xu({},a),{},{selectedEdgeObj:{componentUpToDate:!1,edge:e.state.edges[s]}}),e.setState(a);var u=e.state.edges[s],c="".concat(u.source,"_").concat(u.target);i&&i({nodes:null,edges:new Map([[c,u]])})}else e.setState(a)})),_u(wu(e),"handleMultipleSelected",(function(t,n){var r=e.props,o=r.nodes,i=r.nodeKey,a=r.onSelect,s=e.state.edgesMap,u=Ns.findNodesWithinArea(t,n,o,i),c=Ns.findConnectedEdgesForNodes(u,s,i);a&&a({nodes:u,edges:c})})),_u(wu(e),"handleSvgClicked",(function(t,n){var r,o=e.props,i=o.onBackgroundClick,a=o.onSelect,s=o.readOnly,u=o.onCreateNode,c=o.onPasteSelected,l=o.selected,f=e.state,h=f.selectingNode,y=f.selectionStart,p=f.selectionEnd,d=ft;if(e.isPartOfEdge(d.target))e.handleEdgeSelected(d);else{if(d.shiftKey&&e.isControlKeyPressed(d)&&y&&p)return e.handleMultipleSelected(y,p),void e.setState({selectionStart:null,selectionEnd:null});if(h)e.setState({focused:!0,selectingNode:!1,svgClicked:!0});else{if(!ft.shiftKey&&i&&ft.target.classList.contains("background")){var x=be(ft.target);i(x[0],x[1],ft)}if(c&&!s&&e.isControlKeyPressed(ft)&&null!=l&&null!==(r=l.nodes)&&void 0!==r&&r.size){var v=be(ft.target);c(l,{x:v[0],y:v[1]})}else if(!s&&ft.shiftKey&&u){var g=be(ft.target);u(g[0],g[1],ft)}else e.setState({selectedNodeObj:null,focused:!0,svgClicked:!0}),a&&a({nodes:null,edges:null})}}})),_u(wu(e),"handleContextmenu",(function(){var t=e.props.onContextMenu;if("function"==typeof t){var n=be(ft.target);t(n[0],n[1],ft)}})),_u(wu(e),"handleDocumentClick",(function(t){t&&t.target&&null!=t.target.ownerSVGElement&&t.target.ownerSVGElement===e.graphSvg.current||e.setState({documentClicked:!0,focused:!1,svgClicked:!1})})),_u(wu(e),"handleDocumentMouseDown",(function(){var t=e.state.selectionStart,n=e.props.allowMultiselect,r=ft;if(n&&r.shiftKey&&e.isControlKeyPressed(r)){var o=yu(be(e.highlightAreaRef.current||r.target),2),i=o[0],a=o[1];t||e.setState({selectionStart:{x:i,y:a}})}})),_u(wu(e),"handleDocumentMouseMove",(function(){var t=e.props.allowMultiselect,n=ft,r=yu(be(e.highlightAreaRef.current||n.target),2),o=r[0],i=r[1],a={mousePosition:{x:o,y:i}};t&&(a=n.shiftKey&&e.isControlKeyPressed(n)?xu(xu({},a),{},{selectionEnd:{x:o,y:i}}):xu(xu({},a),{},{selectionStart:null,selectionEnd:null})),e.setState(a)})),_u(wu(e),"handleNodeMove",(function(t,n,r){var o=e.props,i=o.canCreateEdge,a=o.readOnly,s=o.selected,u=o.nodeKey,c=o.onSelect,l=e.state,f=l.draggingEdge,h=l.nodesMap,y=e.getNodeById(n);if(y&&!a){var p=y.node;if(r||f)(i&&i(p)||r)&&(e.syncRenderEdge({source:n,targetPosition:t}),e.setState({draggingEdge:!0}));else{var d,x,v,g=p.x||0,m=p.y||0;p.x=t.x,p.y=t.y,e.asyncRenderNode(p),null!=s&&null!==(d=s.nodes)&&void 0!==d&&d.size&&((null==s||null===(x=s.nodes)||void 0===x?void 0:x.has(p[u]))?null==s||null===(v=s.nodes)||void 0===v||v.forEach((function(n,r){var o=r;if(o!==p[u]){var i=e.getNodeById(o);if(i){var a=i.node,s=t.x+((a.x||0)-g),c=t.y+((a.y||0)-m);a.x=s,a.y=c,e.asyncRenderNode(a)}}})):(e.setState({selectedNodeObj:null}),c&&c({nodes:null,edges:null}))),e.setState({nodesMap:xu({},h),componentUpToDate:!1})}}})),_u(wu(e),"removeCustomEdge",(function(){Ns.removeElementFromDom("edge-custom-container",e.viewWrapper.current)})),_u(wu(e),"endDragEdge",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};e.setState(xu(xu({},t),{},{componentUpToDate:!1,draggedEdge:null,draggingEdge:!1}),n)})),_u(wu(e),"handleNodeUpdate",(function(t,n,r){var o=e.props,i=o.onUpdateNode,a=o.readOnly,s=o.selected,u=o.nodeKey,c=e.state,l=c.draggingEdge,f=c.hoveredNode,h=c.edgeEndNode;if(a)return Promise.resolve();var y=Promise.resolve();if(r&&f&&h)e.createNewEdge();else{l&&(e.removeCustomEdge(),e.endDragEdge());var p=e.getNodeById(n);if(p&&(e.hasLayoutEngine()?e.layoutEngineAdjustNodes():(hu(p.node,t),e.renderConnectedEdgesFromNode(p,!0)),i)){var d,x,v,g=new Map;null!=s&&null!==(d=s.nodes)&&void 0!==d&&d.size?null==s||null===(v=s.nodes)||void 0===v||v.forEach((function(t,n){var r,o=null===(r=e.getNodeById(n))||void 0===r?void 0:r.node;o&&g.set(t[u],o)})):null!=s&&null!==(x=s.nodes)&&void 0!==x&&x.size&&(g=(null==s?void 0:s.nodes)||new Map),y=i(p.node,g,t)||Promise.resolve()}}return e.setState({componentUpToDate:!1,focused:!0,hoveredNode:!1,svgClicked:!0}),y})),_u(wu(e),"handleNodeMouseEnter",(function(t,n){var r=e.state,o=r.draggingEdge,i=r.hoveredNodeData;i&&n!==i&&o?e.setState({edgeEndNode:n}):e.setState({hoveredNode:!0,hoveredNodeData:n})})),_u(wu(e),"handleNodeMouseLeave",(function(t,n){e.setState({edgeEndNode:null})})),_u(wu(e),"handleNodeSelected",(function(t,n,r,o){var i=e.props,a=i.selected,s=i.onSelect,u=i.nodeKey,c=i.allowMultiselect,l={componentUpToDate:!1,selectedNodeObj:{nodeId:n,node:t}};if(e.setState(l),!r){var f,h=!1;c&&(h=null==a||null===(f=a.nodes)||void 0===f?void 0:f.has(t[u])),h||s&&s({nodes:new Map([[t[u],t]]),edges:null},o)}})),_u(wu(e),"handleZoomStart",(function(t){var n=t.sourceEvent;if(e.props.readOnly||!n||n&&!n.buttons)return!1;if(n&&!n.target.matches(".edge-overlay-path"))return!1;var r=n.target.id,o=e.state.edgesMap&&e.state.edgesMap[r]?e.state.edgesMap[r].edge:null;if(!e.isArrowClicked(o)||!o)return!1;e.removeEdgeElement(o.source,o.target),e.setState({draggingEdge:!0,draggedEdge:o}),e.dragEdge(o,be)})),_u(wu(e),"handleZoom",(function(t){var n=e.state.draggingEdge,r=t.transform;if(n){if(n)return e.dragEdge(void 0,be),!1}else Mt(e.view).attr("transform",r),e.state.viewTransform!==r&&e.setState({viewTransform:r,draggedEdge:null,draggingEdge:!1},(function(){e.renderGraphControls()}))})),_u(wu(e),"handleZoomEnd",(function(){var t=e.state,n=t.draggingEdge,r=t.draggedEdge,o=t.edgeEndNode,i=e.props,a=i.nodeKey,s=i.onSwapEdge;if(n&&r){var u=xu({},e.state.draggedEdge);e.removeCustomEdge(),e.endDragEdge(void 0,(function(){var t=e.getNodeById(r.source),n=e.getNodeById(r.target);if(t&&n){var i=t.node;o&&!e.getEdgeBySourceTarget(r.source,o[a])&&e.canSwap(i,o,r)?(u.target=o[a],e.syncRenderEdge(u),s&&s(t.node,o,r)):e.syncRenderEdge(r)}}))}else n&&!r&&e.endDragEdge()})),_u(wu(e),"handleZoomToFit",(function(){var t=Mt(e.entities).node();if(t){var n=t.getBBox?t.getBBox():null;n&&e.handleZoomToFitImpl(n,e.props.zoomDur)}})),_u(wu(e),"handleZoomToFitImpl",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e.viewWrapper.current){var r=Mt(e.viewWrapper.current).node(),o=r.clientWidth,i=r.clientHeight,a=e.props.minZoom||0,s=e.props.maxZoom||2,u={k:(a+s)/2,x:0,y:0};if(t.width>0&&t.height>0){var c=t.width,l=t.height,f=t.x+t.width/2,h=t.y+t.height/2;u.k=.9/Math.max(c/o,l/i),u.k<a?u.k=a:u.k>s&&(u.k=s),u.x=o/2-u.k*f,u.y=i/2-u.k*h}e.setZoom(u.k,u.x,u.y,n)}})),_u(wu(e),"modifyZoom",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=Mt(e.viewWrapper.current).node(),a={x:i.clientWidth/2,y:i.clientHeight/2},s=e.zoom.scaleExtent(),u=e.state.viewTransform,c={k:u.k,x:u.x,y:u.y},l=c.k*(1+t);if(c.k=l,l<s[0]||l>s[1])return!1;var f={x:(a.x-c.x)/c.k,y:(a.y-c.y)/c.k},h={x:f.x*c.k+c.x,y:f.y*c.k+c.y};return c.x+=a.x-h.x+n,c.y+=a.y-h.y+r,e.setZoom(c.k,c.x,c.y,o),!0})),_u(wu(e),"isNodeSelected",(function(t){var n,r=e.props,o=r.nodeKey,i=r.selected;return!(null==i||null===(n=i.nodes)||void 0===n||!n.has(t[o]))})),_u(wu(e),"isEdgeSelected",(function(t){var n,r=e.props.selected,o="".concat(t.source,"_").concat(t.target);return!(null==r||null===(n=r.edges)||void 0===n||!n.has(o))})),_u(wu(e),"getNodeComponent",(function(t,n){var r=e.props,o=r.nodeTypes,i=r.nodeSubtypes,a=r.nodeSize,s=r.nodeHeight,u=r.nodeWidth,c=r.renderNode,l=r.renderNodeText,f=r.nodeKey,h=r.maxTitleChars,y=r.centerNodeOnMove;return Oa.createElement(lu,{key:t,id:t,data:n,nodeTypes:o,nodeSize:a,nodeWidth:u,nodeHeight:s,nodeKey:f,nodeSubtypes:i,onNodeMouseEnter:e.handleNodeMouseEnter,onNodeMouseLeave:e.handleNodeMouseLeave,onNodeMove:e.handleNodeMove,onNodeUpdate:e.handleNodeUpdate,onNodeSelected:e.handleNodeSelected,renderNode:c,renderNodeText:l,isSelected:e.isNodeSelected(n),layoutEngine:e.layoutEngine,viewWrapperElem:e.viewWrapper.current,centerNodeOnMove:y,maxTitleChars:h})})),_u(wu(e),"renderNodes",(function(){e.entities&&e.state.nodes.forEach((function(t,n){e.asyncRenderNode(t)}))})),_u(wu(e),"getEdgeComponent",(function(t){var n=e.props.rotateEdgeHandle,r=e.getNodeById(t.source),o=null==r?void 0:r.node,i=e.getNodeById(t.target),a=null==i?void 0:i.node,s=t.targetPosition,u=e.props,c=u.edgeTypes,l=u.edgeHandleSize,f=u.nodeSize,h=u.nodeKey;return o&&(a||t.targetPosition)?Oa.createElement(Ws,{data:t,edgeTypes:c,edgeHandleSize:l,nodeSize:f,sourceNode:o,targetNode:a||s,nodeKey:h,viewWrapperElem:e.viewWrapper.current,isSelected:e.isEdgeSelected(t),rotateEdgeHandle:n,isBeingDragged:!!s}):null})),_u(wu(e),"renderEdge",(function(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e.entities)return null;var i="".concat(t,"-container"),a="".concat(t,"-custom-container"),s=e.state.draggedEdge,u=e.props.afterRenderEdge,c=e.viewWrapper.current.querySelector("[id='".concat(i,"']"));if(o&&c)c.style.display="none",i="".concat(t,"-custom-container"),c=e.viewWrapper.current.querySelector("[id='".concat(i,"']"));else if(c){var l=e.viewWrapper.current.querySelector("[id='".concat(a,"']"));c.style.display="",l&&l.remove()}if(!c&&r!==s){var f=document.createElementNS("http://www.w3.org/2000/svg","g");f.id=i,e.entities.appendChild(f),c=f}return c&&(ja.a.render(n,c),u)?u(t,n,r,c,e.isEdgeSelected(r)):void 0})),_u(wu(e),"asyncRenderEdge",(function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null!=t.source&&null!=t.target){var r="edges-".concat(t.source,"-").concat(t.target);cancelAnimationFrame(e.edgeTimeouts[r]),e.edgeTimeouts[r]=requestAnimationFrame((function(){e.syncRenderEdge(t,n)}))}})),_u(wu(e),"renderEdges",(function(){var t=e.state,n=t.edges,r=t.draggingEdge;if(e.entities&&!r)for(var o=0;o<n.length;o++)e.asyncRenderEdge(n[o])})),e.nodeTimeouts={},e.edgeTimeouts={},e.renderNodesTimeout=null,e.renderEdgesTimeout=null,e.viewWrapper=Oa.createRef(),e.graphSvg=Oa.createRef(),e.highlightAreaRef=Oa.createRef(),t.layoutEngineType&&(e.layoutEngine=new ls[t.layoutEngineType](t)),e.state={componentUpToDate:!1,draggedEdge:null,draggingEdge:!1,edgeEndNode:null,edges:[],edgesMap:{},hoveredNode:!1,hoveredNodeData:null,nodes:[],nodesMap:{},selectedEdgeObj:null,selectedNodeObj:null,selectingNode:!1,documentClicked:!1,svgClicked:!1,focused:!0},e}return e=i,n=[{key:"componentDidMount",value:function(){var t=this,e=this.props,n=e.initialBBox,r=e.zoomDelay,o=e.minZoom,i=e.maxZoom;if(document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("mousedown",this.handleDocumentClick,{capture:!0,passive:!0}),this.zoom=function(){var t,e,n=Aa,r=Ma,o=Pa,i=ka,a=Na,s=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,l=va,f=y("start","zoom","end"),h=500,p=0;function d(t){t.property("__zoom",Ca).on("wheel.zoom",_).on("mousedown.zoom",E).on("dblclick.zoom",A).filter(a).on("touchstart.zoom",M).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(t,e){return(e=Math.max(s[0],Math.min(s[1],e)))===t.k?t:new wa(e,t.x,t.y)}function v(t,e,n){var r=e[0]-n[0]*t.k,o=e[1]-n[1]*t.k;return r===t.x&&o===t.y?t:new wa(t.k,r,o)}function g(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function m(t,e,n){t.on("start.zoom",(function(){w(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){w(this,arguments).end()})).tween("zoom",(function(){var t=this,o=arguments,i=w(t,o),a=r.apply(t,o),s=null==n?g(a):"function"==typeof n?n.apply(t,o):n,u=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),c=t.__zoom,f="function"==typeof e?e.apply(t,o):e,h=l(c.invert(s).concat(u/c.k),f.invert(s).concat(u/f.k));return function(t){if(1===t)t=f;else{var e=h(t),n=u/e[2];t=new wa(n,s[0]-e[0]*n,s[1]-e[1]*n)}i.zoom(null,t)}}))}function w(t,e,n){return!n&&t.__zooming||new b(t,e)}function b(t,e){this.that=t,this.args=e,this.active=0,this.extent=r.apply(t,e),this.taps=0}function _(){if(n.apply(this,arguments)){var t=w(this,arguments),e=this.__zoom,r=Math.max(s[0],Math.min(s[1],e.k*Math.pow(2,i.apply(this,arguments)))),a=be(this);if(t.wheel)t.mouse[0][0]===a[0]&&t.mouse[0][1]===a[1]||(t.mouse[1]=e.invert(t.mouse[0]=a)),clearTimeout(t.wheel);else{if(e.k===r)return;t.mouse=[a,e.invert(a)],We(this),t.start()}Ea(),t.wheel=setTimeout(c,150),t.zoom("mouse",o(v(x(e,r),t.mouse[0],t.mouse[1]),t.extent,u))}function c(){t.wheel=null,t.end()}}function E(){if(!e&&n.apply(this,arguments)){var t=w(this,arguments,!0),r=Mt(ft.view).on("mousemove.zoom",c,!0).on("mouseup.zoom",l,!0),i=be(this),a=ft.clientX,s=ft.clientY;Nt(ft.view),_a(),t.mouse=[i,this.__zoom.invert(i)],We(this),t.start()}function c(){if(Ea(),!t.moved){var e=ft.clientX-a,n=ft.clientY-s;t.moved=e*e+n*n>p}t.zoom("mouse",o(v(t.that.__zoom,t.mouse[0]=be(t.that),t.mouse[1]),t.extent,u))}function l(){r.on("mousemove.zoom mouseup.zoom",null),Pt(ft.view,t.moved),Ea(),t.end()}}function A(){if(n.apply(this,arguments)){var t=this.__zoom,e=be(this),i=t.invert(e),a=t.k*(ft.shiftKey?.5:2),s=o(v(x(t,a),e,i),r.apply(this,arguments),u);Ea(),c>0?Mt(this).transition().duration(c).call(m,s,e):Mt(this).call(d.transform,s)}}function M(){if(n.apply(this,arguments)){var e,r,o,i,a=ft.touches,s=a.length,u=w(this,arguments,ft.changedTouches.length===s);for(_a(),r=0;r<s;++r)o=a[r],i=[i=we(this,a,o.identifier),this.__zoom.invert(i),o.identifier],u.touch0?u.touch1||u.touch0[2]===i[2]||(u.touch1=i,u.taps=0):(u.touch0=i,e=!0,u.taps=1+!!t);t&&(t=clearTimeout(t)),e&&(u.taps<2&&(t=setTimeout((function(){t=null}),h)),We(this),u.start())}}function C(){if(this.__zooming){var e,n,r,i,a=w(this,arguments),s=ft.changedTouches,c=s.length;for(Ea(),t&&(t=clearTimeout(t)),a.taps=0,e=0;e<c;++e)n=s[e],r=we(this,s,n.identifier),a.touch0&&a.touch0[2]===n.identifier?a.touch0[0]=r:a.touch1&&a.touch1[2]===n.identifier&&(a.touch1[0]=r);if(n=a.that.__zoom,a.touch1){var l=a.touch0[0],f=a.touch0[1],h=a.touch1[0],y=a.touch1[1],p=(p=h[0]-l[0])*p+(p=h[1]-l[1])*p,d=(d=y[0]-f[0])*d+(d=y[1]-f[1])*d;n=x(n,Math.sqrt(p/d)),r=[(l[0]+h[0])/2,(l[1]+h[1])/2],i=[(f[0]+y[0])/2,(f[1]+y[1])/2]}else{if(!a.touch0)return;r=a.touch0[0],i=a.touch0[1]}a.zoom("touch",o(v(n,r,i),a.extent,u))}}function k(){if(this.__zooming){var t,n,r=w(this,arguments),o=ft.changedTouches,i=o.length;for(_a(),e&&clearTimeout(e),e=setTimeout((function(){e=null}),h),t=0;t<i;++t)n=o[t],r.touch0&&r.touch0[2]===n.identifier?delete r.touch0:r.touch1&&r.touch1[2]===n.identifier&&delete r.touch1;if(r.touch1&&!r.touch0&&(r.touch0=r.touch1,delete r.touch1),r.touch0)r.touch0[1]=this.__zoom.invert(r.touch0[0]);else if(r.end(),2===r.taps){var a=Mt(this).on("dblclick.zoom");a&&a.apply(this,arguments)}}}return d.transform=function(t,e,n){var r=t.selection?t.selection():t;r.property("__zoom",Ca),t!==r?m(t,e,n):r.interrupt().each((function(){w(this,arguments).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},d.scaleBy=function(t,e,n){d.scaleTo(t,(function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)}),n)},d.scaleTo=function(t,e,n){d.transform(t,(function(){var t=r.apply(this,arguments),i=this.__zoom,a=null==n?g(t):"function"==typeof n?n.apply(this,arguments):n,s=i.invert(a),c="function"==typeof e?e.apply(this,arguments):e;return o(v(x(i,c),a,s),t,u)}),n)},d.translateBy=function(t,e,n){d.transform(t,(function(){return o(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),u)}))},d.translateTo=function(t,e,n,i){d.transform(t,(function(){var t=r.apply(this,arguments),a=this.__zoom,s=null==i?g(t):"function"==typeof i?i.apply(this,arguments):i;return o(ba.translate(s[0],s[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,u)}),i)},b.prototype={start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){vt(new ma(d,t,this.that.__zoom),f.apply,f,[t,this.that,this.args])}},d.wheelDelta=function(t){return arguments.length?(i="function"==typeof t?t:ga(+t),d):i},d.filter=function(t){return arguments.length?(n="function"==typeof t?t:ga(!!t),d):n},d.touchable=function(t){return arguments.length?(a="function"==typeof t?t:ga(!!t),d):a},d.extent=function(t){return arguments.length?(r="function"==typeof t?t:ga([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),d):r},d.scaleExtent=function(t){return arguments.length?(s[0]=+t[0],s[1]=+t[1],d):[s[0],s[1]]},d.translateExtent=function(t){return arguments.length?(u[0][0]=+t[0][0],u[1][0]=+t[1][0],u[0][1]=+t[0][1],u[1][1]=+t[1][1],d):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},d.constrain=function(t){return arguments.length?(o=t,d):o},d.duration=function(t){return arguments.length?(c=+t,d):c},d.interpolate=function(t){return arguments.length?(l=t,d):l},d.on=function(){var t=f.on.apply(f,arguments);return t===f?d:t},d.clickDistance=function(t){return arguments.length?(p=(t=+t)*t,d):Math.sqrt(p)},d}().filter(this.zoomFilter.bind(this)).scaleExtent([o||0,i||0]).on("start",(function(){t.handleZoomStart(ft)})).on("zoom",(function(){t.handleZoom(ft)})).on("end",this.handleZoomEnd),Mt(this.viewWrapper.current).on("touchstart",this.containZoom).on("touchmove",this.containZoom).on("click",this.handleSvgClicked).on("contextmenu",this.handleContextmenu).select("svg").call(this.zoom),Mt(this.graphSvg.current).on("mousedown",this.handleDocumentMouseDown).on("mousemove",this.handleDocumentMouseMove),this.selectedView=Mt(this.view),n)return this.handleZoomToFitImpl(n,0),void this.renderView();this.renderView(),setTimeout((function(){null!=t.viewWrapper.current&&t.handleZoomToFit()}),r)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("click",this.handleDocumentClick)}},{key:"shouldComponentUpdate",value:function(t,e){var n=this.props,r=n.nodes,o=n.edges,i=n.selected,a=n.readOnly,s=n.layoutEngineType,u=n.allowMultiselect,c=this.state.selectionEnd;return t.nodes!==r||t.edges!==o||!e.componentUpToDate||t.selected!==i||t.readOnly!==a||t.layoutEngineType!==s||t.allowMultiselect!==u||!Ns.isEqual(e.selectionEnd,c)}},{key:"componentDidUpdate",value:function(t,e){var n=this.state,r=n.nodesMap,o=n.edgesMap,i=this.props,a=i.allowMultiselect,s=i.selected;this.layoutEngineAdjustNodes();var u=this.hasLayoutEngine();this.removeOldEdges(e.edges,o),this.removeOldNodes(e.nodes,e.nodesMap,r),this.addNewNodes(this.state.nodes,e.nodesMap,s,t.selected,u),this.addNewEdges(this.state.edges,e.edgesMap,s,t.selected,u),t.allowMultiselect!==a&&this.renderGraphControls(),this.setState({componentUpToDate:!0})}},{key:"isControlKeyPressed",value:function(t){return t.metaKey||t.ctrlKey}},{key:"hasLayoutEngine",value:function(){var t=this.props.layoutEngineType;return!(!t||!ls[t])}},{key:"layoutEngineAdjustNodes",value:function(){var t=this.props.layoutEngineType,e=this.state,n=e.nodes,r=e.nodesMap;if(n&&t&&this.hasLayoutEngine()){this.layoutEngine=new ls[t](this.props);var o=this.layoutEngine.adjustNodes(n,r);this.setState({nodes:o})}}},{key:"getNodeById",value:function(t,e){var n=e||this.state.nodesMap;return n?n["key-".concat(null!=t?t:"")]:null}},{key:"getEdgeBySourceTarget",value:function(t,e){return this.state.edgesMap?this.state.edgesMap["".concat(t,"_").concat(e)]:null}},{key:"addNewNodes",value:function(t,e,n,r){var o=this,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!this.state.draggingEdge){var a=this.props.nodeKey,s=null,u=null,c=null,l=null;Ns.yieldingLoop(t.length,50,(function(r){var f,h;s=t[r],u=o.getNodeById(s[a],e),c=null==n||null===(f=n.nodes)||void 0===f?void 0:f.get(s[a]),l=null==n||null===(h=n.nodes)||void 0===h?void 0:h.get(s[a]),null!=u&&(!Ns.isEqual(u.node,s)||c!==l&&c&&s[a]===c[a]||l&&s[a]===l[a])?o.asyncRenderNode(s):!i&&u||o.asyncRenderNode(s)}))}}},{key:"removeOldNodes",value:function(t,e,n){for(var r=this,o=this.props.nodeKey,i=0;i<t.length;i++){var a=t[i][o];if(!this.getNodeById(a,n)){var s=this.getNodeById(a,e);s&&(s.outgoingEdges.forEach((function(t){r.removeEdgeElement(t.source,t.target)})),s.incomingEdges.forEach((function(t){r.removeEdgeElement(t.source,t.target)})));var u="nodes-".concat(a);cancelAnimationFrame(this.nodeTimeouts[u]),Ns.removeElementFromDom("node-".concat(a,"-container"),this.viewWrapper.current)}}}},{key:"addNewEdges",value:function(t,e,n,r){var o=this,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!this.state.draggingEdge){var a=null,s=null,u=null,c=null,l=null;Ns.yieldingLoop(t.length,50,(function(n){null!=(a=t[n]).source&&null!=!a.target&&(s="".concat(a.source,"_").concat(a.target),u=e[s],(i||!u||!Ns.isEqual(u.edge,a)||a===c||l&&a===l)&&o.asyncRenderEdge(a))}))}}},{key:"removeEdgeElement",value:function(t,e){var n="".concat(t,"-").concat(e);Ns.removeElementFromDom("edge-".concat(n,"-container"),this.viewWrapper.current)}},{key:"canSwap",value:function(t,e,n){var r=this.props.canSwapEdge;return e&&t!==e&&(n.source!==t[this.props.nodeKey]||n.target!==e[this.props.nodeKey])&&r&&r(t,e,n)}},{key:"deleteNode",value:function(t){var e=t[this.props.nodeKey];this.setState({componentUpToDate:!1,hoveredNode:!1}),Ns.removeElementFromDom("node-".concat(e,"-container"),this.viewWrapper.current)}},{key:"deleteEdge",value:function(t){var e=t.source,n=t.target;null!=e&&null!=n&&(this.setState({componentUpToDate:!1}),null!=t.source&&null!=t.target&&(Ns.removeElementFromDom("edge-".concat(t.source,"-").concat(t.target,"-custom-container"),this.viewWrapper.current),Ns.removeElementFromDom("edge-".concat(t.source,"-").concat(t.target,"-container"),this.viewWrapper.current)))}},{key:"isPartOfEdge",value:function(t){return!!Ns.findParent(t,".edge-container","svg.graph")}},{key:"createNewEdge",value:function(){var t=this.props,e=t.canCreateEdge,n=t.nodeKey,r=t.onCreateEdge,o=this.state,i=o.edgesMap,a=o.edgeEndNode,s=o.hoveredNodeData;if(s&&(this.removeCustomEdge(),a)){var u="".concat(s[n],"_").concat(a[n]),c="".concat(a[n],"_").concat(s[n]);i&&s!==a&&e&&e(s,a)&&!i[u]&&!i[c]?(this.endDragEdge(),r&&r(s,a)):this.endDragEdge({edgeEndNode:null})}}},{key:"isArrowClicked",value:function(t){var e=this.props,n=e.edgeArrowSize,r=e.onArrowClicked,o=ft.sourceEvent.target,i=n||0;if(!t||"path"!==o.tagName)return!1;var a=be(o);if(null==t.target)return!1;var s=a[0],u=a[1],c=function(t){var e={source:{x:0,y:0},target:{x:0,y:0}};if(t){var n=t.getAttribute("d"),r=(n=(n=n&&n.replace(/^M/,""))&&n.replace(/L/,","))&&n.split(",")||[];4===(r=r.map((function(t){return parseFloat(t)}))).length&&(e.source.x=r[0],e.source.y=r[1],e.target.x=r[2],e.target.y=r[3])}return e}(function(t,e){return e.querySelector("[id='edge-".concat(t.source,"-").concat(t.target,"-container']>.edge-container>.edge>.edge-path"))}(t,this.viewWrapper.current));return r&&s<c.target.x+i&&s>c.target.x-i&&u<c.target.y+i&&u>c.target.y-i&&r(t),s<c.target.x+i&&s>c.target.x-i&&u<c.target.y+i&&u>c.target.y-i}},{key:"zoomFilter",value:function(){return!ft.button&&!this.isControlKeyPressed(ft)}},{key:"containZoom",value:function(){(ft.button||this.isControlKeyPressed(ft))&&ft.stopImmediatePropagation()}},{key:"getMouseCoordinates",value:function(t){var e=[0,0];return this.selectedView&&t&&(e=t(this.selectedView.node())),e}},{key:"dragEdge",value:function(t,e){var n=this.props,r=n.nodeSize,o=n.nodeKey;if(t=t||this.state.draggedEdge){var i=this.getMouseCoordinates(e),a={x:i[0],y:i[1]},s=qs(r,this.getNodeById(t.source).node,a,o);a.x+=s.xOff,a.y+=s.yOff,this.syncRenderEdge({source:t.source,targetPosition:a}),this.setState({draggedEdge:t,draggingEdge:!0})}}},{key:"setZoom",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=ba.translate(e,n).scale(t);Mt(this.viewWrapper.current).select("svg").transition().duration(r).call(this.zoom.transform,o)}},{key:"renderView",value:function(){this.selectedView.attr("transform",this.state.viewTransform),clearTimeout(this.renderNodesTimeout),this.renderNodesTimeout=setTimeout(this.renderNodes)}},{key:"asyncRenderNode",value:function(t){var e=this,n=this.props.nodeKey,r="nodes-".concat(t[n]);cancelAnimationFrame(this.nodeTimeouts[r]),this.nodeTimeouts[r]=requestAnimationFrame((function(){e.syncRenderNode(t)}))}},{key:"syncRenderNode",value:function(t){var e=this.props.nodeKey,n="node-".concat(t[e]),r=this.getNodeComponent(n,t),o=this.getNodeById(t[e]);this.renderNode(n,r),o&&this.renderConnectedEdgesFromNode(o)}},{key:"renderNode",value:function(t,e){if(!this.entities)return null;var n="".concat(t,"-container"),r=this.viewWrapper.current.querySelector("[id='".concat(n,"']"));r||((r=document.createElementNS("http://www.w3.org/2000/svg","g")).id=n,this.entities.appendChild(r));var o=e;ja.a.render(o,r)}},{key:"renderConnectedEdgesFromNode",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.state.draggingEdge||(t.incomingEdges.forEach((function(t){e.asyncRenderEdge(t,n)})),t.outgoingEdges.forEach((function(t){e.asyncRenderEdge(t,n)})))}},{key:"syncRenderEdge",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null!=t.source){var n=null!=t.target?"".concat(t.source,"-").concat(t.target):"custom",r="edge-".concat(n),o=this.getEdgeComponent(t);this.renderEdge(r,o,t,e)}}},{key:"renderGraphControls",value:function(){var t=this.props,e=t.showGraphControls,n=t.minZoom,r=t.maxZoom,o=t.allowMultiselect,i=this.state.viewTransform;e&&this.graphControlsWrapper&&ja.a.render(Oa.createElement(ru,{minZoom:n,maxZoom:r,zoomLevel:i?i.k:1,zoomToFit:this.handleZoomToFit,modifyZoom:this.modifyZoom,allowMultiselect:o}),this.graphControlsWrapper)}},{key:"render",value:function(){var t=this,e=this.props,n=e.edgeArrowSize,r=e.gridSpacing,o=e.gridDotSize,i=e.nodeTypes,a=e.nodeSubtypes,s=e.edgeTypes,u=e.showGraphControls,c=e.renderDefs,l=e.gridSize,f=e.backgroundFillId,h=e.renderBackground,y=this.state,p=y.selectionStart,d=y.selectionEnd;return Oa.createElement("div",{className:"view-wrapper",ref:this.viewWrapper},Oa.createElement("svg",{className:"graph",ref:this.graphSvg,xmlns:"http://www.w3.org/2000/svg"},Oa.createElement(bs,{edgeArrowSize:n,gridSpacing:r,gridDotSize:o,nodeTypes:i,nodeSubtypes:a,edgeTypes:s,renderDefs:c}),Oa.createElement("g",{className:"view",ref:function(e){return t.view=e}},Oa.createElement(fs,{gridSize:l,backgroundFillId:f,renderBackground:h}),Oa.createElement("g",{className:"entities",ref:function(e){return t.entities=e}}),p&&Oa.createElement(ou,{ref:this.highlightAreaRef,startPoint:p,endPoint:d}))),u&&Oa.createElement("div",{id:"react-digraph-graph-controls-wrapper",ref:function(e){return t.graphControlsWrapper=e},className:"graph-controls-wrapper"}))}},{key:"panToEntity",value:function(t,e){var n=this.state.viewTransform,r=this.viewWrapper.current,o=t?t.getBBox():null,i=this.props.maxZoom||2;if(r&&o){var a=r.clientWidth,s=r.clientHeight,u={k:n?n.k:0,x:0,y:0},c=o.x+o.width/2,l=o.y+o.height/2;e&&(u.k=.9/Math.max(o.width/a,o.height/s),u.k>i&&(u.k=i)),u.x=a/2-u.k*c,u.y=s/2-u.k*l,this.setZoom(u.k,u.x,u.y,this.props.zoomDur)}}},{key:"panToNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.entities){var n=this.entities.querySelector("[id='node-".concat(t,"-container']"));this.panToEntity(n,e)}}},{key:"panToEdge",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.entities){var r=this.entities.querySelector("[id='edge-".concat(t,"-").concat(e,"-container']"));this.panToEntity(r,n)}}}],r=[{key:"getDerivedStateFromProps",value:function(t,e){var n=t.edges,r=t.nodeKey,o=t.nodes,i=Ns.getNodesMap(o,r),a=Ns.getEdgesMap(n);return Ns.linkNodesAndEdges(i,n),0===e.nodes.length&&t.layoutEngineType&&ls[t.layoutEngineType]&&(o=new ls[t.layoutEngineType](t).adjustNodes(o,i)),{componentUpToDate:!0,edges:n,edgesMap:a,nodes:o,nodesMap:i,readOnly:t.readOnly,selectionChanged:!1}}}],n&&vu(e.prototype,n),r&&vu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(Oa.Component);_u(Eu,"defaultProps",{canCreateEdge:function(t,e){return!0},canSwapEdge:function(){return!0},canDeleteSelected:function(){return!0},allowMultiselect:!0,allowCopyEdges:!1,edgeArrowSize:8,gridSpacing:36,layoutEngineType:"None",maxZoom:1.5,minZoom:.15,nodeSize:154,nodeWidth:154,nodeHeight:154,readOnly:!1,showGraphControls:!0,zoomDelay:1e3,zoomDur:750,rotateEdgeHandle:!0,centerNodeOnMove:!0});var Au=Eu;function Mu(t){return Mu="function"==typeof Symbol&&"symbol"==r(Symbol.iterator)?function(t){return r(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)},Mu(t)}function Cu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ku(t,e){return ku=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ku(t,e)}function Nu(t,e){if(e&&("object"===Mu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Pu(t){return Pu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pu(t)}var Ou=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ku(t,e)}(o,t);var e,n,r=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Pu(t);if(e){var o=Pu(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Nu(this,n)}}(o);function o(){return Cu(this,o),r.apply(this,arguments)}return e=o,n=[{key:"transform",value:function(t){if(!t.States)return{edges:[],nodes:[]};var e=Object.keys(t.States),n=[],r=[];return e.forEach((function(e){var o=t.States[e];if(o){var i={title:e,type:o.Type,x:o.x||0,y:o.y||0};e===t.StartAt?n.unshift(i):n.push(i),"Choice"===o.Type?(o.Choices.forEach((function(n){t.States[n.Next]&&r.push({source:e,target:n.Next})})),o.Default&&r.push({source:e,target:o.Default})):o.Next&&t.States[o.Next]&&r.push({source:e,target:o.Next})}})),{edges:r,nodes:n}}},{key:"revert",value:function(t){return t}}],n&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n;return e=t,n=[{key:"transform",value:function(t){return{edges:[],nodes:[]}}},{key:"revert",value:function(t){return t}}],n&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}());e.default=Au}])},440:t=>{t.exports=function(){return this.React}()},32:t=>{t.exports=function(){return this.ReactDOM}()}},e={},function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}(850);var t,e}));