UNPKG

560 kBJavaScriptView Raw
1/**
2 * vis-network - network
3 * http://visjs.org/
4 *
5 * A dynamic, browser-based visualization library.
6 *
7 * @version 6.0.0
8 * @date 2019-09-11T08:31:03Z
9 *
10 * @copyright (c) 2011-2017 Almende B.V, http://almende.com
11 * @copyright (c) 2018-2019 visjs contributors, https://github.com/visjs
12 *
13 * @license
14 * vis.js is dual licensed under both
15 *
16 * 1. The Apache 2.0 License
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * and
20 *
21 * 2. The MIT License
22 * http://opensource.org/licenses/MIT
23 *
24 * vis.js may be distributed under either license.
25 */(function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):(e=e||self,t(e.vis=e.vis||{}))})(this,function(e){'use strict';var bo=Math.cos,_o=Math.sin,vo=Math.round,ko=Math.pow,wo=String.prototype,xo=Math.ceil,So=Math.abs,Oo=Math.PI,Do=Math.atan2,To=Math.sqrt,Eo=Math.floor,Co=Math.max,Mo=Math.min;function t(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function o(e,t){return t={exports:{}},e(t,t.exports),t.exports}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function d(e,t){var o=Object.keys(e);return Object.getOwnPropertySymbols&&o.push.apply(o,Object.getOwnPropertySymbols(e)),t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o}function s(e){for(var t=1,o;t<arguments.length;t++)o=null==arguments[t]?{}:arguments[t],t%2?d(o,!0).forEach(function(t){a(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):d(o).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))});return e}function r(e){return l(e)||u(e)||p()}function l(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t<e.length;t++)o[t]=e[t];return o}}function u(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function p(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function h(e,t){var o=t||0,n=Od;return n[e[o++]]+n[e[o++]]+n[e[o++]]+n[e[o++]]+"-"+n[e[o++]]+n[e[o++]]+"-"+n[e[o++]]+n[e[o++]]+"-"+n[e[o++]]+n[e[o++]]+"-"+n[e[o++]]+n[e[o++]]+n[e[o++]]+n[e[o++]]+n[e[o++]]+n[e[o++]]}function g(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=1<arguments.length?arguments[1]:void 0,o=2<arguments.length?arguments[2]:void 0,n=t&&o||0;"string"==typeof e&&(t="binary"===e?Array(16):void 0,e={});var i=e.random||(e.rng||Td)();if(i[6]=64|15&i[6],i[8]=128|63&i[8],t)for(var a=0;16>a;a++)t[n+a]=i[a];return t||h(i)}function m(e){return e instanceof Number||"number"==typeof e}function y(e){if(e)for(;!0===e.hasChildNodes();){var t=e.firstChild;t&&(y(t),e.removeChild(t))}}function f(e){return e instanceof String||"string"==typeof e}function _(e){return"object"===n(e)&&null!==e}function v(e){if(e instanceof Date)return!0;if(f(e)){var t=Fd.exec(e);if(t)return!0;if(!isNaN(Date.parse(e)))return!0}return!1}function w(e){return Sd.isMoment(e)}function x(e,t,o,n){var i=!1;!0===n&&(i=null===t[o]&&e[o]!==void 0),i?delete e[o]:e[o]=t[o]}function S(e,t){var o=!!(2<arguments.length&&arguments[2]!==void 0)&&arguments[2];for(var i in e)if(t[i]!==void 0)if(null===t[i]||"object"!==n(t[i]))x(e,t,i,o);else{var a=e[i],d=t[i];_(a)&&_(d)&&S(a,d,o)}}function O(e,t){if(!Array.isArray(e))throw new Error("Array with property names expected as first argument");for(var o=arguments.length,n=Array(2<o?o-2:0),i=2;i<o;i++)n[i-2]=arguments[i];for(var a=0,d=n,s;a<d.length;a++){s=d[a];for(var r=0,l;r<e.length;r++)l=e[r],s&&Object.prototype.hasOwnProperty.call(s,l)&&(t[l]=s[l])}return t}function D(e,t,o){var n=!!(3<arguments.length&&arguments[3]!==void 0)&&arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var i=0,a;i<e.length;i++)if(a=e[i],Object.prototype.hasOwnProperty.call(o,a))if(o[a]&&o[a].constructor===Object)void 0===t[a]&&(t[a]={}),t[a].constructor===Object?E(t[a],o[a],!1,n):x(t,o,a,n);else if(Array.isArray(o[a]))throw new TypeError("Arrays are not supported by deepExtend");else x(t,o,a,n);return t}function T(e,t,o){var n=!!(3<arguments.length&&arguments[3]!==void 0)&&arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var a in o)if(Object.prototype.hasOwnProperty.call(o,a)&&-1===e.indexOf(a))if(o[a]&&o[a].constructor===Object)void 0===t[a]&&(t[a]={}),t[a].constructor===Object?E(t[a],o[a]):x(t,o,a,n);else if(Array.isArray(o[a])){t[a]=[];for(var d=0;d<o[a].length;d++)t[a].push(o[a][d])}else x(t,o,a,n);return t}function E(e,t){var o=!!(2<arguments.length&&arguments[2]!==void 0)&&arguments[2],n=!!(3<arguments.length&&arguments[3]!==void 0)&&arguments[3];for(var i in t)(Object.prototype.hasOwnProperty.call(t,i)||!0===o)&&(t[i]&&Object.getPrototypeOf(t[i])===Object.prototype?void 0===e[i]?e[i]=E({},t[i],o):e[i]&&Object.getPrototypeOf(e[i])===Object.prototype?E(e[i],t[i],o):x(e,t,i,n):Array.isArray(t[i])?e[i]=t[i].slice():x(e,t,i,n));return e}function C(e,t){if(e.length!==t.length)return!1;for(var o=0,n=e.length;o<n;o++)if(e[o]!=t[o])return!1;return!0}function M(e,t){var o;if(void 0!==e){if(null===e)return null;if(!t)return e;if("string"!=typeof t&&!(t instanceof String))throw new Error("Type must be a string");switch(t){case"boolean":case"Boolean":return!!e;case"number":case"Number":return f(e)&&!isNaN(Date.parse(e))?Sd(e).valueOf():+e.valueOf();case"string":case"String":return e+"";case"Date":if(m(e))return new Date(e);if(e instanceof Date)return new Date(e.valueOf());if(w(e))return new Date(e.valueOf());if(f(e))return o=Fd.exec(e),o?new Date(+o[1]):Sd(new Date(e)).toDate();throw new Error("Cannot convert object of type "+I(e)+" to type Date");case"Moment":if(m(e))return Sd(e);if(e instanceof Date)return Sd(e.valueOf());if(w(e))return Sd(e);if(f(e))return o=Fd.exec(e),o?Sd(+o[1]):Sd(e);throw new Error("Cannot convert object of type "+I(e)+" to type Date");case"ISODate":if(m(e))return new Date(e);if(e instanceof Date)return e.toISOString();if(w(e))return e.toDate().toISOString();if(f(e))return o=Fd.exec(e),o?new Date(+o[1]).toISOString():Sd(e).format();throw new Error("Cannot convert object of type "+I(e)+" to type ISODate");case"ASPDate":if(m(e))return"/Date("+e+")/";if(e instanceof Date||w(e))return"/Date("+e.valueOf()+")/";if(f(e)){o=Fd.exec(e);var n;return n=o?new Date(+o[1]).valueOf():new Date(e).valueOf(),"/Date("+n+")/"}throw new Error("Cannot convert object of type "+I(e)+" to type ASPDate");default:throw new Error("Unknown type ".concat(t));}}}function I(e){var t=n(e);return"object"===t?null===e?"null":e instanceof Boolean?"Boolean":e instanceof Number?"Number":e instanceof String?"String":Array.isArray(e)?"Array":e instanceof Date?"Date":"Object":"number"===t?"Number":"boolean"===t?"Boolean":"string"===t?"String":void 0===t?"undefined":t}function P(e,t){return[].concat(r(e),[t])}function F(e){return e.slice()}function N(e){return e.getBoundingClientRect().left}function Y(e){return e.getBoundingClientRect().right}function R(e){return e.getBoundingClientRect().top}function z(e,t){var o=e.className.split(" "),n=t.split(" ");o=o.concat(n.filter(function(e){return 0>o.indexOf(e)})),e.className=o.join(" ")}function B(e,t){var o=e.className.split(" "),n=t.split(" ");o=o.filter(function(e){return 0>n.indexOf(e)}),e.className=o.join(" ")}function L(e,t){if(Array.isArray(e))for(var o=e.length,n=0;n<o;n++)t(e[n],n,e);else for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t(e[a],a,e)}function A(e,t,o){return e[t]!==o&&(e[t]=o,!0)}function H(e){var t=!1;return function(){t||(t=!0,requestAnimationFrame(function(){t=!1,e()}))}}function W(e,t,o,n){e.addEventListener?(n===void 0&&(n=!1),"mousewheel"===t&&0<=navigator.userAgent.indexOf("Firefox")&&(t="DOMMouseScroll"),e.addEventListener(t,o,n)):e.attachEvent("on"+t,o)}function U(e,t,o,n){e.removeEventListener?(n===void 0&&(n=!1),"mousewheel"===t&&0<=navigator.userAgent.indexOf("Firefox")&&(t="DOMMouseScroll"),e.removeEventListener(t,o,n)):e.detachEvent("on"+t,o)}function V(e){if(e||(e=window.event),!e);else e.preventDefault?e.preventDefault():e.returnValue=!1}function G(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:window.event,t=null;if(!e);else e.target?t=e.target:e.srcElement&&(t=e.srcElement);return t instanceof Element?null!=t.nodeType&&3==t.nodeType&&(t=t.parentNode,!(t instanceof Element))?null:t:null}function q(e,t){for(var o=e;o;){if(o===t)return!0;if(o.parentNode)o=o.parentNode;else return!1}return!1}function X(e){var t;switch(e.length){case 3:case 4:return t=Yd.exec(e),t?{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16)}:null;case 6:case 7:return t=Nd.exec(e),t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null;default:return null;}}function Z(e,t){if(-1!==e.indexOf("rgba"))return e;if(-1!==e.indexOf("rgb")){var o=e.substr(e.indexOf("(")+1).replace(")","").split(",");return"rgba("+o[0]+","+o[1]+","+o[2]+","+t+")"}var n=X(e);return null==n?e:"rgba("+n.r+","+n.g+","+n.b+","+t+")"}function $(e,t,o){return"#"+(16777216+(e<<16)+(t<<8)+o).toString(16).slice(1)}function K(e,t){if(f(e)){var o=e;if(ae(o)){var n=o.substr(4).substr(0,o.length-5).split(",").map(function(e){return parseInt(e)});o=$(n[0],n[1],n[2])}if(!0===ie(o)){var i=ne(o),a={h:i.h,s:.8*i.s,v:Mo(1,1.02*i.v)},d={h:i.h,s:Mo(1,1.25*i.s),v:.8*i.v},s=oe(d.h,d.s,d.v),r=oe(a.h,a.s,a.v);return{background:o,border:s,highlight:{background:r,border:s},hover:{background:r,border:s}}}return{background:o,border:o,highlight:{background:o,border:o},hover:{background:o,border:o}}}if(t){var l={background:e.background||t.background,border:e.border||t.border,highlight:f(e.highlight)?{border:e.highlight,background:e.highlight}:{background:e.highlight&&e.highlight.background||t.highlight.background,border:e.highlight&&e.highlight.border||t.highlight.border},hover:f(e.hover)?{border:e.hover,background:e.hover}:{border:e.hover&&e.hover.border||t.hover.border,background:e.hover&&e.hover.background||t.hover.background}};return l}var c={background:e.background||void 0,border:e.border||void 0,highlight:f(e.highlight)?{border:e.highlight,background:e.highlight}:{background:e.highlight&&e.highlight.background||void 0,border:e.highlight&&e.highlight.border||void 0},hover:f(e.hover)?{border:e.hover,background:e.hover}:{border:e.hover&&e.hover.border||void 0,background:e.hover&&e.hover.background||void 0}};return c}function Q(e,t,o){e/=255,t/=255,o/=255;var n=Mo(e,Mo(t,o)),i=Co(e,Co(t,o));if(n===i)return{h:0,s:0,v:n};var a=e===n?t-o:o===n?e-t:o-e,d=e===n?3:o===n?1:5;return{h:60*(d-a/(i-n))/360,s:(i-n)/i,v:i}}function J(e,t){var o=Hd.split(e.style.cssText),n=Hd.split(t),i=s({},o,{},n);e.style.cssText=Hd.join(i)}function ee(e,t){var o=Hd.split(e.style.cssText),n=Hd.split(t);for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&delete o[i];e.style.cssText=Hd.join(o)}function te(e,o,n){var a=Eo(6*e),i=6*e-a,d=n*(1-o),s=n*(1-i*o),l=n*(1-(1-i)*o),t,c,u;switch(a%6){case 0:t=n,c=l,u=d;break;case 1:t=s,c=n,u=d;break;case 2:t=d,c=n,u=l;break;case 3:t=d,c=s,u=n;break;case 4:t=l,c=d,u=n;break;case 5:t=n,c=d,u=s;}return{r:Eo(255*t),g:Eo(255*c),b:Eo(255*u)}}function oe(e,t,o){var n=te(e,t,o);return $(n.r,n.g,n.b)}function ne(e){var t=X(e);if(!t)throw new TypeError("'".concat(e,"' is not a valid color."));return Q(t.r,t.g,t.b)}function ie(e){var t=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e);return t}function ae(e){return Rd.test(e)}function de(e){return zd.test(e)}function se(e,t){if(null!==t&&"object"===n(t)){for(var o=Object.create(t),a=0;a<e.length;a++)Object.prototype.hasOwnProperty.call(t,e[a])&&"object"==n(t[e[a]])&&(o[e[a]]=re(t[e[a]]));return o}return null}function re(e){if(null===e||"object"!==n(e))return null;if(e instanceof Element)return e;var t=Object.create(e);for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&"object"==n(e[o])&&(t[o]=re(e[o]));return t}function le(e,t){for(var o=0;o<e.length;o++){var n=e[o],a=void 0;for(a=o;0<a&&0>t(n,e[a-1]);a--)e[a]=e[a-1];e[a]=n}return e}function ce(e,t,o){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{},a=function(e){return null!==e&&e!==void 0},d=function(e){return null!==e&&"object"===n(e)};if(!d(e))throw new Error("Parameter mergeTarget must be an object");if(!d(t))throw new Error("Parameter options must be an object");if(!a(o))throw new Error("Parameter option must have a value");if(!d(i))throw new Error("Parameter globalOptions must be an object");var s=function(e,t,o){d(e[o])||(e[o]={});var n=t[o],i=e[o];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i[a]=n[a])},r=t[o],l=d(i)&&!function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}(i),c=l?i[o]:void 0,u=c?c.enabled:void 0;if(void 0!==r){if("boolean"==typeof r)return d(e[o])||(e[o]={}),void(e[o].enabled=r);if(null===r&&!d(e[o]))if(a(c))e[o]=Object.create(c);else return;if(d(r)){var p=!0;void 0===r.enabled?void 0!==u&&(p=c.enabled):p=r.enabled,s(e,t,o),e[o].enabled=p}}}function ue(e,t,o,n){for(var i=0,a=0,d=e.length-1;a<=d&&i<1e4;){var s=Eo((a+d)/2),r=e[s],l=n===void 0?r[o]:r[o][n],c=t(l);if(0==c)return s;-1==c?a=s+1:d=s-1;i++}return-1}function pe(e,t,o,n,i){var a=0,d=0,s=e.length-1,r,l,c,u;for(i=null==i?function(e,t){return e==t?0:e<t?-1:1}:i;d<=s&&10000>a;){if(u=Eo(.5*(s+d)),r=e[Co(0,u-1)][o],l=e[u][o],c=e[Mo(e.length-1,u+1)][o],0==i(l,t))return u;if(0>i(r,t)&&0<i(l,t))return"before"==n?Co(0,u-1):u;if(0>i(l,t)&&0<i(c,t))return"before"==n?u:Mo(e.length-1,u+1);0>i(l,t)?d=u+1:s=u-1,a++}return-1}function he(){var e=document.createElement("p");e.style.width="100%",e.style.height="200px";var t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),document.body.appendChild(t);var o=e.offsetWidth;t.style.overflow="scroll";var n=e.offsetWidth;return o==n&&(n=t.clientWidth),document.body.removeChild(t),o-n}function ge(e,t){var o;Array.isArray(t)||(t=[t]);var n=!0,a=!1,d=void 0;try{for(var s=e[Symbol.iterator](),r,l;!(n=(r=s.next()).done);n=!0)if(l=r.value,l){o=l[t[0]];for(var c=1;c<t.length;c++)o&&(o=o[t[c]]);if("undefined"!=typeof o)break}}catch(e){a=!0,d=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw d}}return o}function me(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function ye(e,t){return t={exports:{}},e(t,t.exports),t.exports}function fe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function be(e,t){for(var o=0,n;o<t.length;o++)n=t[o],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}function _e(e,t,o){return t&&be(e.prototype,t),o&&be(e,o),e}function ve(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ke(e,t){return t&&("object"===Gd(t)||"function"==typeof t)?t:Zd(e)}function we(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Qd(e,t)}function xe(e,t){var o=t||0,n=es;return n[e[o++]]+n[e[o++]]+n[e[o++]]+n[e[o++]]+"-"+n[e[o++]]+n[e[o++]]+"-"+n[e[o++]]+n[e[o++]]+"-"+n[e[o++]]+n[e[o++]]+"-"+n[e[o++]]+n[e[o++]]+n[e[o++]]+n[e[o++]]+n[e[o++]]+n[e[o++]]}function Se(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=1<arguments.length?arguments[1]:void 0,o=2<arguments.length?arguments[2]:void 0,n=t&&o||0;"string"==typeof e&&(t="binary"===e?Array(16):void 0,e={});var i=e.random||(e.rng||os)();if(i[6]=64|15&i[6],i[8]=128|63&i[8],t)for(var a=0;16>a;a++)t[n+a]=i[a];return t||xe(i)}function Oe(e){return Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Oe(e)}function De(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function Te(e,t){return t={exports:{}},e(t,t.exports),t.exports}function Ee(e){return e instanceof Number||"number"==typeof e}function Ce(e){return e instanceof String||"string"==typeof e}function Me(e){return ls.isMoment(e)}function Ie(e,t){var o;if(void 0!==e){if(null===e)return null;if(!t)return e;if("string"!=typeof t&&!(t instanceof String))throw new Error("Type must be a string");switch(t){case"boolean":case"Boolean":return!!e;case"number":case"Number":return Ce(e)&&!isNaN(Date.parse(e))?ls(e).valueOf():+e.valueOf();case"string":case"String":return e+"";case"Date":if(Ee(e))return new Date(e);if(e instanceof Date)return new Date(e.valueOf());if(Me(e))return new Date(e.valueOf());if(Ce(e))return o=bs.exec(e),o?new Date(+o[1]):ls(new Date(e)).toDate();throw new Error("Cannot convert object of type "+Pe(e)+" to type Date");case"Moment":if(Ee(e))return ls(e);if(e instanceof Date)return ls(e.valueOf());if(Me(e))return ls(e);if(Ce(e))return o=bs.exec(e),o?ls(+o[1]):ls(e);throw new Error("Cannot convert object of type "+Pe(e)+" to type Date");case"ISODate":if(Ee(e))return new Date(e);if(e instanceof Date)return e.toISOString();if(Me(e))return e.toDate().toISOString();if(Ce(e))return o=bs.exec(e),o?new Date(+o[1]).toISOString():ls(e).format();throw new Error("Cannot convert object of type "+Pe(e)+" to type ISODate");case"ASPDate":if(Ee(e))return"/Date("+e+")/";if(e instanceof Date)return"/Date("+e.valueOf()+")/";if(Ce(e)){o=bs.exec(e);var n;return n=o?new Date(+o[1]).valueOf():new Date(e).valueOf(),"/Date("+n+")/"}throw new Error("Cannot convert object of type "+Pe(e)+" to type ASPDate");default:throw new Error("Unknown type ".concat(t));}}}function Pe(e){var t=Oe(e);return"object"===t?null===e?"null":e instanceof Boolean?"Boolean":e instanceof Number?"Number":e instanceof String?"String":Array.isArray(e)?"Array":e instanceof Date?"Date":"Object":"number"===t?"Number":"boolean"===t?"Boolean":"string"===t?"String":void 0===t?"undefined":t}function Fe(e){return"string"==typeof e||"number"==typeof e}function Ne(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t<e.length;t++)o[t]=e[t];return o}}function Ye(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function Re(e,t){var o=Object.keys(e);return Object.getOwnPropertySymbols&&o.push.apply(o,Object.getOwnPropertySymbols(e)),t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o}function ze(e){for(var t=1,o;t<arguments.length;t++)o=null==arguments[t]?{}:arguments[t],t%2?Re(o,!0).forEach(function(t){Vd(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Re(o).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))});return e}function Be(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function Le(e,t){return t={exports:{}},e(t,t.exports),t.exports}function Ae(e){return Ps=e,Ke()}function He(){Fs=0,Ns=Ps.charAt(0)}function je(){Fs++,Ns=Ps.charAt(Fs)}function We(){return Ps.charAt(Fs+1)}function Ue(e){return zs.test(e)}function Ve(e,t){if(e||(e={}),t)for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);return e}function Ge(e,t,n){for(var i=t.split("."),a=e;i.length;){var d=i.shift();i.length?(!a[d]&&(a[d]={}),a=a[d]):a[d]=n}}function qe(e,t){for(var o=null,n=[e],a=e,d,s;a.parent;)n.push(a.parent),a=a.parent;if(a.nodes)for(d=0,s=a.nodes.length;d<s;d++)if(t.id===a.nodes[d].id){o=a.nodes[d];break}for(o||(o={id:t.id},e.node&&(o.attr=Ve(o.attr,e.node))),d=n.length-1;0<=d;d--){var r=n[d];r.nodes||(r.nodes=[]),-1===r.nodes.indexOf(o)&&r.nodes.push(o)}t.attr&&(o.attr=Ve(o.attr,t.attr))}function Xe(e,t){if(e.edges||(e.edges=[]),e.edges.push(t),e.edge){var o=Ve({},e.edge);t.attr=Ve(o,t.attr)}}function Ze(e,t,o,n,i){var a={from:t,to:o,type:n};return e.edge&&(a.attr=Ve({},e.edge)),a.attr=Ve(a.attr||{},i),null!=i&&i.hasOwnProperty("arrows")&&null!=i.arrows&&(a.arrows={to:{enabled:!0,type:i.arrows.type}},i.arrows=null),a}function $e(){for(Rs=Ms.NULL,Ys="";" "===Ns||"\t"===Ns||"\n"===Ns||"\r"===Ns;)je();do{var e=!1;if("#"===Ns){for(var t=Fs-1;" "===Ps.charAt(t)||"\t"===Ps.charAt(t);)t--;if("\n"===Ps.charAt(t)||""===Ps.charAt(t)){for(;""!=Ns&&"\n"!=Ns;)je();e=!0}}if("/"===Ns&&"/"===We()){for(;""!=Ns&&"\n"!=Ns;)je();e=!0}if("/"===Ns&&"*"===We()){for(;""!=Ns;)if("*"===Ns&&"/"===We()){je(),je();break}else je();e=!0}for(;" "===Ns||"\t"===Ns||"\n"===Ns||"\r"===Ns;)je()}while(e);if(""===Ns)return void(Rs=Ms.DELIMITER);var o=Ns+We();if(Is[o])return Rs=Ms.DELIMITER,Ys=o,je(),void je();if(Is[Ns])return Rs=Ms.DELIMITER,Ys=Ns,void je();if(Ue(Ns)||"-"===Ns){for(Ys+=Ns,je();Ue(Ns);)Ys+=Ns,je();return"false"===Ys?Ys=!1:"true"===Ys?Ys=!0:!isNaN(+Ys)&&(Ys=+Ys),void(Rs=Ms.IDENTIFIER)}if("\""===Ns){for(je();""!=Ns&&("\""!=Ns||"\""===Ns&&"\""===We());)"\""===Ns?(Ys+=Ns,je()):"\\"===Ns&&"n"===We()?(Ys+="\n",je()):Ys+=Ns,je();if("\""!=Ns)throw dt("End of string \" expected");return je(),void(Rs=Ms.IDENTIFIER)}for(Rs=Ms.UNKNOWN;""!=Ns;)Ys+=Ns,je();throw new SyntaxError("Syntax error in part \""+st(Ys,30)+"\"")}function Ke(){var e={};if(He(),$e(),"strict"===Ys&&(e.strict=!0,$e()),("graph"===Ys||"digraph"===Ys)&&(e.type=Ys,$e()),Rs===Ms.IDENTIFIER&&(e.id=Ys,$e()),"{"!=Ys)throw dt("Angle bracket { expected");if($e(),Qe(e),"}"!=Ys)throw dt("Angle bracket } expected");if($e(),""!==Ys)throw dt("End of file expected");return $e(),delete e.node,delete e.edge,delete e.graph,e}function Qe(e){for(;""!==Ys&&"}"!=Ys;)Je(e),";"===Ys&&$e()}function Je(e){var t=et(e);if(t)return void nt(e,t);var o=tt(e);if(!o){if(Rs!=Ms.IDENTIFIER)throw dt("Identifier expected");var n=Ys;if($e(),"="===Ys){if($e(),Rs!=Ms.IDENTIFIER)throw dt("Identifier expected");e[n]=Ys,$e()}else ot(e,n)}}function et(e){var t=null;if("subgraph"===Ys&&(t={},t.type="subgraph",$e(),Rs===Ms.IDENTIFIER&&(t.id=Ys,$e())),"{"===Ys){if($e(),t||(t={}),t.parent=e,t.node=e.node,t.edge=e.edge,t.graph=e.graph,Qe(t),"}"!=Ys)throw dt("Angle bracket } expected");$e(),delete t.node,delete t.edge,delete t.graph,delete t.parent,e.subgraphs||(e.subgraphs=[]),e.subgraphs.push(t)}return t}function tt(e){return"node"===Ys?($e(),e.node=it(),"node"):"edge"===Ys?($e(),e.edge=it(),"edge"):"graph"===Ys?($e(),e.graph=it(),"graph"):null}function ot(e,t){var o={id:t},n=it();n&&(o.attr=n),qe(e,o),nt(e,t)}function nt(e,t){for(;"->"===Ys||"--"===Ys;){var o=Ys,n;$e();var i=et(e);if(i)n=i;else{if(Rs!=Ms.IDENTIFIER)throw dt("Identifier or subgraph expected");n=Ys,qe(e,{id:n}),$e()}var a=it(),d=Ze(e,t,n,o,a);Xe(e,d),t=n}}function it(){for(var e=null,t={dashed:!0,solid:!1,dotted:[1,5]},o={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},n=[],a=[],d;"["===Ys;){for($e(),e={};""!==Ys&&"]"!=Ys;){if(Rs!=Ms.IDENTIFIER)throw dt("Attribute name expected");var s=Ys;if($e(),"="!=Ys)throw dt("Equal sign = expected");if($e(),Rs!=Ms.IDENTIFIER)throw dt("Attribute value expected");var r=Ys;"style"===s&&(r=t[r]);var l;"arrowhead"===s&&(l=o[r],s="arrows",r={to:{enabled:!0,type:l}}),"arrowtail"===s&&(l=o[r],s="arrows",r={from:{enabled:!0,type:l}}),n.push({attr:e,name:s,value:r}),a.push(s),$e(),","==Ys&&$e()}if("]"!=Ys)throw dt("Bracket ] expected");$e()}if(a.includes("dir")){var c={arrows:{}};for(d=0;d<n.length;d++)if(!("arrows"===n[d].name))"dir"===n[d].name&&(c.dir=d);else if(null!=n[d].value.to)c.arrows.to=d;else if(null!=n[d].value.from)c.arrows.from=d;else throw dt("Invalid value of arrows");var u=n[c.dir].value;if(!a.includes("arrows"))if("both"===u)n.push({attr:n[c.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),c.arrows.to=n.length-1,n.push({attr:n[c.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),c.arrows.from=n.length-1;else if("forward"===u)n.push({attr:n[c.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),c.arrows.to=n.length-1;else if("back"===u)n.push({attr:n[c.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),c.arrows.from=n.length-1;else if("none"===u)n.push({attr:n[c.dir].attr,name:"arrows",value:""}),c.arrows.to=n.length-1;else throw dt("Invalid dir type \""+u+"\"");var p,h;if("both"===u)c.arrows.to&&c.arrows.from?(h=n[c.arrows.to].value.to.type,p=n[c.arrows.from].value.from.type,n[c.arrows.to]={attr:n[c.arrows.to].attr,name:n[c.arrows.to].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:p}}},n.splice(c.arrows.from,1)):c.arrows.to?(h=n[c.arrows.to].value.to.type,p="arrow",n[c.arrows.to]={attr:n[c.arrows.to].attr,name:n[c.arrows.to].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:p}}}):c.arrows.from&&(h="arrow",p=n[c.arrows.from].value.from.type,n[c.arrows.from]={attr:n[c.arrows.from].attr,name:n[c.arrows.from].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:p}}});else if("back"===u)c.arrows.to&&c.arrows.from?(h="",p=n[c.arrows.from].value.from.type,n[c.arrows.from]={attr:n[c.arrows.from].attr,name:n[c.arrows.from].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:p}}}):c.arrows.to?(h="",p="arrow",c.arrows.from=c.arrows.to,n[c.arrows.from]={attr:n[c.arrows.from].attr,name:n[c.arrows.from].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:p}}}):c.arrows.from&&(h="",p=n[c.arrows.from].value.from.type,n[c.arrows.to]={attr:n[c.arrows.from].attr,name:n[c.arrows.from].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:p}}}),n[c.arrows.from]={attr:n[c.arrows.from].attr,name:n[c.arrows.from].name,value:{from:{enabled:!0,type:n[c.arrows.from].value.from.type}}};else if("none"===u){var g;g=c.arrows.to?c.arrows.to:c.arrows.from,n[g]={attr:n[g].attr,name:n[g].name,value:""}}else if("forward"===u)c.arrows.to&&c.arrows.from?(h=n[c.arrows.to].value.to.type,p="",n[c.arrows.to]={attr:n[c.arrows.to].attr,name:n[c.arrows.to].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:p}}}):c.arrows.to?(h=n[c.arrows.to].value.to.type,p="",n[c.arrows.to]={attr:n[c.arrows.to].attr,name:n[c.arrows.to].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:p}}}):c.arrows.from&&(h="arrow",p="",c.arrows.to=c.arrows.from,n[c.arrows.to]={attr:n[c.arrows.to].attr,name:n[c.arrows.to].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:p}}}),n[c.arrows.to]={attr:n[c.arrows.to].attr,name:n[c.arrows.to].name,value:{to:{enabled:!0,type:n[c.arrows.to].value.to.type}}};else throw dt("Invalid dir type \""+u+"\"");n.splice(c.dir,1)}var m;if(a.includes("penwidth")){var y=[];for(m=n.length,d=0;d<m;d++)"width"!==n[d].name&&("penwidth"===n[d].name&&(n[d].name="width"),y.push(n[d]));n=y}for(m=n.length,d=0;d<m;d++)Ge(n[d].attr,n[d].name,n[d].value);return e}function dt(e){return new SyntaxError(e+", got \""+st(Ys,30)+"\" (char "+Fs+")")}function st(e,t){return e.length<=t?e:e.substr(0,27)+"..."}function rt(e,t,o){Array.isArray(e)?e.forEach(function(e){Array.isArray(t)?t.forEach(function(t){o(e,t)}):o(e,t)}):Array.isArray(t)?t.forEach(function(t){o(e,t)}):o(e,t)}function lt(e,t,o){for(var n=t.split("."),a=n.pop(),d=e,s=0,r;s<n.length;s++)r=n[s],r in d||(d[r]={}),d=d[r];return d[a]=o,e}function ct(e,t){var o={};for(var n in e)if(e.hasOwnProperty(n)){var i=t[n];Array.isArray(i)?i.forEach(function(t){lt(o,t,e[n])}):"string"==typeof i?lt(o,i,e[n]):lt(o,n,e[n])}return o}function ut(e,t){var o={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};null!=t&&(null!=t.fixed&&(o.nodes.fixed=t.fixed),null!=t.parseColor&&(o.nodes.parseColor=t.parseColor),null!=t.inheritColor&&(o.edges.inheritColor=t.inheritColor));var n=e.edges,i=n.map(function(e){var t={from:e.source,id:e.id,to:e.target};return null!=e.attributes&&(t.attributes=e.attributes),null!=e.label&&(t.label=e.label),null!=e.attributes&&null!=e.attributes.title&&(t.title=e.attributes.title),"Directed"===e.type&&(t.arrows="to"),e.color&&!1===o.edges.inheritColor&&(t.color=e.color),t}),a=e.nodes.map(function(e){var t={id:e.id,fixed:o.nodes.fixed&&null!=e.x&&null!=e.y};return null!=e.attributes&&(t.attributes=e.attributes),null!=e.label&&(t.label=e.label),null!=e.size&&(t.size=e.size),null!=e.attributes&&null!=e.attributes.title&&(t.title=e.attributes.title),null!=e.title&&(t.title=e.title),null!=e.x&&(t.x=e.x),null!=e.y&&(t.y=e.y),null!=e.color&&(!0===o.nodes.parseColor?t.color=e.color:t.color={background:e.color,border:e.color,highlight:{background:e.color,border:e.color},hover:{background:e.color,border:e.color}}),t});return{nodes:a,edges:i}}function pt(){return pt=Object.assign||function(e){for(var t=1,o;t<arguments.length;t++)for(var n in o=arguments[t],o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n]);return e},pt.apply(this,arguments)}function ht(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function gt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mt(e,t){for(var o=t[0].toUpperCase()+t.slice(1),n=0,a,d;n<Xs.length;){if(a=Xs[n],d=a?a+o:t,d in e)return d;n++}}function yt(){if(!tr)return!1;var e={},t=Js.CSS&&Js.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(o){return e[o]=!t||Js.CSS.supports("touch-action",o)}),e}function ft(e,t,o){if(e)if(e.forEach)e.forEach(t,o);else if(void 0!==e.length)for(n=0;n<e.length;)t.call(o,e[n],n,e),n++;else for(var n in e)e.hasOwnProperty(n)&&t.call(o,e[n],n,e)}function bt(e,t){return"function"===typeof e?e.apply(t?t[0]||void 0:void 0,t):e}function _t(e,t){return-1<e.indexOf(t)}function vt(e){if(_t(e,"none"))return"none";var t=_t(e,"pan-x"),o=_t(e,"pan-y");return t&&o?"none":t||o?t?"pan-x":"pan-y":_t(e,"manipulation")?"manipulation":"auto"}function kt(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function wt(e){var t=e.length;if(1===t)return{x:$s(e[0].clientX),y:$s(e[0].clientY)};for(var o=0,n=0,a=0;a<t;)o+=e[a].clientX,n+=e[a].clientY,a++;return{x:$s(o/t),y:$s(n/t)}}function xt(e){for(var t=[],o=0;o<e.pointers.length;)t[o]={clientX:$s(e.pointers[o].clientX),clientY:$s(e.pointers[o].clientY)},o++;return{timeStamp:Qs(),pointers:t,center:wt(t),deltaX:e.deltaX,deltaY:e.deltaY}}function St(e,t,o){o||(o=Or);var n=t[o[0]]-e[o[0]],i=t[o[1]]-e[o[1]];return To(n*n+i*i)}function Ot(e,t,o){o||(o=Or);var n=t[o[0]]-e[o[0]],i=t[o[1]]-e[o[1]];return 180*Do(i,n)/Oo}function Dt(e,t){return e===t?1:Ks(e)>=Ks(t)?0>e?2:4:0>t?8:16}function Tt(e,t){var o=t.center,n=e.offsetDelta||{},i=e.prevDelta||{},a=e.prevInput||{};(t.eventType===1||a.eventType===4)&&(i=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},n=e.offsetDelta={x:o.x,y:o.y}),t.deltaX=i.x+(o.x-n.x),t.deltaY=i.y+(o.y-n.y)}function Et(e,t,o){return{x:t/e||0,y:o/e||0}}function Ct(e,t){return St(t[0],t[1],Dr)/St(e[0],e[1],Dr)}function Mt(e,t){return Ot(t[1],t[0],Dr)+Ot(e[1],e[0],Dr)}function It(e,t){var o=e.lastInterval||t,n=t.timeStamp-o.timeStamp,i,a,d,s;if(t.eventType!==8&&(n>25||o.velocity===void 0)){var r=t.deltaX-o.deltaX,l=t.deltaY-o.deltaY,c=Et(n,r,l);a=c.x,d=c.y,i=Ks(c.x)>Ks(c.y)?c.x:c.y,s=Dt(r,l),e.lastInterval=t}else i=o.velocity,a=o.velocityX,d=o.velocityY,s=o.direction;t.velocity=i,t.velocityX=a,t.velocityY=d,t.direction=s}function Pt(e,t){var o=e.session,n=t.pointers,i=n.length;o.firstInput||(o.firstInput=xt(t)),1<i&&!o.firstMultiple?o.firstMultiple=xt(t):1===i&&(o.firstMultiple=!1);var a=o.firstInput,d=o.firstMultiple,s=d?d.center:a.center,r=t.center=wt(n);t.timeStamp=Qs(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=Ot(s,r),t.distance=St(s,r),Tt(o,t),t.offsetDirection=Dt(t.deltaX,t.deltaY);var l=Et(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=Ks(l.x)>Ks(l.y)?l.x:l.y,t.scale=d?Ct(d.pointers,n):1,t.rotation=d?Mt(d.pointers,n):0,t.maxPointers=o.prevInput?t.pointers.length>o.prevInput.maxPointers?t.pointers.length:o.prevInput.maxPointers:t.pointers.length,It(o,t);var c=e.element;kt(t.srcEvent.target,c)&&(c=t.srcEvent.target),t.target=c}function Ft(e,t,o){var n=o.pointers.length,i=o.changedPointers.length,a=t&1&&0==n-i;o.isFirst=!!a,o.isFinal=!!(t&12&&0==n-i),a&&(e.session={}),o.eventType=t,Pt(e,o),e.emit("hammer.input",o),e.recognize(o),e.session.prevInput=o}function Nt(e){return e.trim().split(/\s+/g)}function Yt(e,t,o){ft(Nt(t),function(t){e.addEventListener(t,o,!1)})}function Rt(e,t,o){ft(Nt(t),function(t){e.removeEventListener(t,o,!1)})}function zt(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||window}function Bt(e,t,o){if(e.indexOf&&!o)return e.indexOf(t);for(var n=0;n<e.length;){if(o&&e[n][o]==t||!o&&e[n]===t)return n;n++}return-1}function Lt(e){return Array.prototype.slice.call(e,0)}function At(e,t,o){for(var n=[],a=[],d=0,s;d<e.length;)s=t?e[d][t]:e[d],0>Bt(a,s)&&n.push(e[d]),a[d]=s,d++;return o&&(t?n=n.sort(function(e,o){return e[t]>o[t]}):n=n.sort()),n}function Ht(e,t){var o=Lt(e.touches),n=this.targetIds;if(3&t&&1===o.length)return n[o[0].identifier]=!0,[o,o];var a=Lt(e.changedTouches),d=[],s=this.target,r,l;if(l=o.filter(function(e){return kt(e.target,s)}),1===t)for(r=0;r<l.length;)n[l[r].identifier]=!0,r++;for(r=0;r<a.length;)n[a[r].identifier]&&d.push(a[r]),12&t&&delete n[a[r].identifier],r++;return d.length?[At(l.concat(d),"identifier",!0),d]:void 0}function jt(e){var t=e.changedPointers,o=t[0];if(o.identifier===this.primaryTouch){var n={x:o.clientX,y:o.clientY},a=this.lastTouches;this.lastTouches.push(n);var d=function(){var e=a.indexOf(n);-1<e&&a.splice(e,1)};setTimeout(d,2500)}}function Wt(e,t){e&1?(this.primaryTouch=t.changedPointers[0].identifier,jt.call(this,t)):e&12&&jt.call(this,t)}function Ut(e){for(var o=e.srcEvent.clientX,n=e.srcEvent.clientY,a=0;a<this.lastTouches.length;a++){var d=this.lastTouches[a],t=So(o-d.x),s=So(n-d.y);if(t<=25&&s<=25)return!0}return!1}function Vt(e){var t=e.options.inputClass,o;return o=t?t:lr?Fr:cr?Yr:rr?Br:zr,new o(e,Ft)}function Gt(e,t,o){return!!Array.isArray(e)&&(ft(e,o[t],o),!0)}function qt(){return Gr++}function Xt(e,t){var o=t.manager;return o?o.get(e):e}function Zt(e){if(e&16)return"cancel";return 8&e?"end":4&e?"move":2&e?"start":""}function $t(e,t){var o=e.element;if(o.style){var n;ft(e.options.cssProps,function(i,a){n=mt(o.style,a),t?(e.oldCssProps[n]=o.style[n],o.style[n]=i):o.style[n]=e.oldCssProps[n]||""}),t||(e.oldCssProps={})}}function Kt(e,t){var o=document.createEvent("Event");o.initEvent(e,!0,!0),o.gesture=t,t.target.dispatchEvent(o)}function Qt(e,t){var o=Lt(e.touches),n=Lt(e.changedTouches);return 12&t&&(o=At(o.concat(n),"identifier",!0)),[o,n]}function Jt(e){if(e===16)return"down";return 8===e?"up":2===e?"left":4===e?"right":""}function eo(t,o,n){return function(){var i=new Error("get-stack-trace"),e=i&&i.stack?i.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",a=window.console&&(window.console.warn||window.console.log);return a&&a.call(window.console,"DEPRECATED METHOD: "+o+"\n"+n+" AT \n",e),t.apply(this,arguments)}}function to(e,t,o){var n=t.prototype,i;i=e.prototype=Object.create(n),i.constructor=e,i._super=n,o&&qs(i,o)}function oo(e,t){return function(){return e.apply(t,arguments)}}function no(e){this.active=!1,this.dom={container:e},this.dom.overlay=document.createElement("div"),this.dom.overlay.className="vis-overlay",this.dom.container.appendChild(this.dom.overlay),this.hammer=ll(this.dom.overlay),this.hammer.on("tap",this._onTapOverlay.bind(this));var t=this;["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach(function(e){t.hammer.on(e,function(e){e.stopPropagation()})}),document&&document.body&&(this.onClick=function(o){io(o.target,e)||t.deactivate()},document.body.addEventListener("click",this.onClick)),this.keycharm!==void 0&&this.keycharm.destroy(),this.keycharm=Us(),this.escListener=this.deactivate.bind(this)}function io(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function ao(e,t){for(var o=0,n;o<t.length;o++)n=t[o],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}function so(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function ro(e,t){var o=[],n=!0,i=!1,a=void 0;try{for(var d=e[Symbol.iterator](),s;!(n=(s=d.next()).done)&&(o.push(s.value),!(t&&o.length===t));n=!0);}catch(e){i=!0,a=e}finally{try{n||null==d["return"]||d["return"]()}finally{if(i)throw a}}return o}function lo(e,t){return bl(e)||_l(e,t)||vl()}function co(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)}return o}function uo(e){for(var t=1,o;t<arguments.length;t++)o=null==arguments[t]?{}:arguments[t],t%2?co(o,!0).forEach(function(t){fl(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):co(o).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))});return e}function po(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)}return o}function ho(e){for(var t=1,o;t<arguments.length;t++)o=null==arguments[t]?{}:arguments[t],t%2?po(o,!0).forEach(function(t){fl(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):po(o).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))});return e}function go(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)}return o}function mo(e){for(var t=1,o;t<arguments.length;t++)o=null==arguments[t]?{}:arguments[t],t%2?go(o,!0).forEach(function(t){fl(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):go(o).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))});return e}function yo(){var e;window!==void 0&&(e=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),window.requestAnimationFrame=void 0===e?function(e){e()}:e}function fo(e,t,o){var n=this;if(!(this instanceof fo))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:ul,clickToUse:!1},Wd.extend(this.options,this.defaultOptions),this.body={container:e,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:this.on.bind(this),off:this.off.bind(this),emit:this.emit.bind(this),once:this.once.bind(this)},eventListeners:{onTap:function(){},onTouch:function(){},onDoubleTap:function(){},onHold:function(){},onDragStart:function(){},onDrag:function(){},onDragEnd:function(){},onMouseWheel:function(){},onPinch:function(){},onMouseMove:function(){},onRelease:function(){},onContext:function(){}},data:{nodes:null,edges:null},functions:{createNode:function(){},createEdge:function(){},getPointer:function(){}},modules:{},view:{scale:1,translation:{x:0,y:0}}},this.bindEventListeners(),this.images=new ml(function(){return n.body.emitter.emit("_requestRedraw")}),this.groups=new yl,this.canvas=new qc(this.body),this.selectionHandler=new Qc(this.body,this.canvas),this.interactionHandler=new Kc(this.body,this.canvas,this.selectionHandler),this.view=new Xc(this.body,this.canvas),this.renderer=new Ac(this.body,this.canvas),this.physics=new Rc(this.body),this.layoutEngine=new du(this.body),this.clustering=new Lc(this.body),this.manipulation=new su(this.body,this.canvas,this.selectionHandler),this.nodesHandler=new nc(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new Tc(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new wu(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(o),this.setData(t)}var Io="undefined"==typeof globalThis?"undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?{}:self:global:window:globalThis,Po=o(function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}),Fo=o(function(e){var t=e.exports={version:"2.6.9"};"number"==typeof __e&&(__e=t)}),No=Fo.version,Yo=o(function(e){var t=Po["__core-js_shared__"]||(Po["__core-js_shared__"]={});(e.exports=function(e,o){return t[e]||(t[e]=o===void 0?{}:o)})("versions",[]).push({version:Fo.version,mode:"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})}),Ro=0,b=Math.random(),zo=function(e){return"Symbol(".concat(e===void 0?"":e,")_",(++Ro+b).toString(36))},Bo=o(function(e){var t=Yo("wks"),o=Po.Symbol,n="function"==typeof o,i=e.exports=function(e){return t[e]||(t[e]=n&&o[e]||(n?o:zo)("Symbol."+e))};i.store=t}),Lo={f:Bo},Ao=function(e){return"object"==typeof e?null!==e:"function"==typeof e},Ho=function(e){if(!Ao(e))throw TypeError(e+" is not an object!");return e},jo=function(e){try{return!!e()}catch(t){return!0}},Wo=!jo(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),Uo=Po.document,Vo=Ao(Uo)&&Ao(Uo.createElement),Go=function(e){return Vo?Uo.createElement(e):{}},qo=!Wo&&!jo(function(){return 7!=Object.defineProperty(Go("div"),"a",{get:function(){return 7}}).a}),Xo=function(e,t){if(!Ao(e))return e;var o,n;if(t&&"function"==typeof(o=e.toString)&&!Ao(n=o.call(e)))return n;if("function"==typeof(o=e.valueOf)&&!Ao(n=o.call(e)))return n;if(!t&&"function"==typeof(o=e.toString)&&!Ao(n=o.call(e)))return n;throw TypeError("Can't convert object to primitive value")},Zo=Object.defineProperty,$o=Wo?Object.defineProperty:function(e,t,o){if(Ho(e),t=Xo(t,!0),Ho(o),qo)try{return Zo(e,t,o)}catch(t){}if("get"in o||"set"in o)throw TypeError("Accessors not supported!");return"value"in o&&(e[t]=o.value),e},Ko={f:$o},Qo=Ko.f,Jo=function(e){var t=Fo.Symbol||(Fo.Symbol=Po.Symbol||{});"_"==e.charAt(0)||e in t||Qo(t,e,{value:Lo.f(e)})};Jo("asyncIterator");var en={}.hasOwnProperty,tn=function(e,t){return en.call(e,t)},on=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},nn=Wo?function(e,t,o){return Ko.f(e,t,on(1,o))}:function(e,t,o){return e[t]=o,e},an=Yo("native-function-to-string",Function.toString),dn=o(function(e){var t=zo("src"),o="toString",n=(""+an).split(o);Fo.inspectSource=function(e){return an.call(e)},(e.exports=function(e,o,i,a){var d="function"==typeof i;d&&(tn(i,"name")||nn(i,"name",o));e[o]===i||(d&&(tn(i,t)||nn(i,t,e[o]?""+e[o]:n.join(o+""))),e===Po?e[o]=i:a?e[o]?e[o]=i:nn(e,o,i):(delete e[o],nn(e,o,i)))})(Function.prototype,o,function(){return"function"==typeof this&&this[t]||an.call(this)})}),sn=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},rn=function(e,t,o){return(sn(e),void 0===t)?e:1===o?function(o){return e.call(t,o)}:2===o?function(o,n){return e.call(t,o,n)}:3===o?function(o,n,i){return e.call(t,o,n,i)}:function(){return e.apply(t,arguments)}},ln="prototype",cn=function(e,t,o){var n=e&cn.F,i=e&cn.G,a=e&cn.S,d=e&cn.P,s=e&cn.B,r=i?Po:a?Po[t]||(Po[t]={}):(Po[t]||{})[ln],l=i?Fo:Fo[t]||(Fo[t]={}),c=l[ln]||(l[ln]={}),u,p,h,g;for(u in i&&(o=t),o)p=!n&&r&&void 0!==r[u],h=(p?r:o)[u],g=s&&p?rn(h,Po):d&&"function"==typeof h?rn(Function.call,h):h,r&&dn(r,u,h,e&cn.U),l[u]!=h&&nn(l,u,g),d&&c[u]!=h&&(c[u]=h)};Po.core=Fo,cn.F=1,cn.G=2,cn.S=4,cn.P=8,cn.B=16,cn.W=32,cn.U=64,cn.R=128;var un=cn,pn=o(function(e){var t=zo("meta"),o=Ko.f,n=0,i=Object.isExtensible||function(){return!0},a=!jo(function(){return i(Object.preventExtensions({}))}),d=function(e){o(e,t,{value:{i:"O"+ ++n,w:{}}})},s=e.exports={KEY:t,NEED:!1,fastKey:function(e,o){if(!Ao(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!tn(e,t)){if(!i(e))return"F";if(!o)return"E";d(e)}return e[t].i},getWeak:function(e,o){if(!tn(e,t)){if(!i(e))return!0;if(!o)return!1;d(e)}return e[t].w},onFreeze:function(e){return a&&s.NEED&&i(e)&&!tn(e,t)&&d(e),e}}}),hn=pn.KEY,gn=pn.NEED,mn=pn.fastKey,yn=pn.getWeak,fn=pn.onFreeze,bn=Ko.f,_n=Bo("toStringTag"),vn=function(e,t,o){e&&!tn(e=o?e:e.prototype,_n)&&bn(e,_n,{configurable:!0,value:t})},kn={}.toString,wn=function(e){return kn.call(e).slice(8,-1)},xn=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==wn(e)?e.split(""):Object(e)},Sn=function(e){if(e==null)throw TypeError("Can't call method on "+e);return e},On=function(e){return xn(Sn(e))},Dn=function(e){return isNaN(e=+e)?0:(0<e?Eo:xo)(e)},Tn=function(e){return 0<e?Mo(Dn(e),9007199254740991):0},En=function(e,t){return e=Dn(e),0>e?Co(e+t,0):Mo(e,t)},Cn=Yo("keys"),Mn=function(e){return Cn[e]||(Cn[e]=zo(e))},In=function(e){return function(t,o,n){var i=On(t),a=Tn(i.length),d=En(n,a),s;if(e&&o!=o){for(;a>d;)if(s=i[d++],s!=s)return!0;}else for(;a>d;d++)if((e||d in i)&&i[d]===o)return e||d||0;return!e&&-1}}(!1),Pn=Mn("IE_PROTO"),Fn=function(e,t){var o=On(e),n=0,a=[],d;for(d in o)d!=Pn&&tn(o,d)&&a.push(d);for(;t.length>n;)tn(o,d=t[n++])&&(~In(a,d)||a.push(d));return a},Nn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Yn=Object.keys||function(e){return Fn(e,Nn)},Rn=Object.getOwnPropertySymbols,zn={f:Rn},Bn={}.propertyIsEnumerable,Ln={f:Bn},An=function(e){var t=Yn(e),o=zn.f;if(o)for(var n=o(e),a=Ln.f,d=0,s;n.length>d;)a.call(e,s=n[d++])&&t.push(s);return t},Hn=Array.isArray||function(e){return"Array"==wn(e)},jn=function(e){return Object(Sn(e))},Wn=Wo?Object.defineProperties:function(e,t){Ho(e);for(var o=Yn(t),n=o.length,a=0,d;n>a;)Ko.f(e,d=o[a++],t[d]);return e},Un=Po.document,Vn=Un&&Un.documentElement,Gn=Mn("IE_PROTO"),qn=function(){},Xn="prototype",Zn=function(){var e=Go("iframe"),t=Nn.length,o="<",n=">",a;for(e.style.display="none",Vn.appendChild(e),e.src="javascript:",a=e.contentWindow.document,a.open(),a.write(o+"script"+n+"document.F=Object"+o+"/script"+n),a.close(),Zn=a.F;t--;)delete Zn[Xn][Nn[t]];return Zn()},$n=Object.create||function(e,t){var o;return null===e?o=Zn():(qn[Xn]=Ho(e),o=new qn,qn[Xn]=null,o[Gn]=e),void 0===t?o:Wn(o,t)},Kn=Nn.concat("length","prototype"),Qn=Object.getOwnPropertyNames||function(e){return Fn(e,Kn)},Jn={f:Qn},ei=Jn.f,ti={}.toString,oi="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],ni=function(e){try{return ei(e)}catch(t){return oi.slice()}},ii={f:function(e){return oi&&"[object Window]"==ti.call(e)?ni(e):ei(On(e))}},ai=Object.getOwnPropertyDescriptor,di=Wo?ai:function(e,t){if(e=On(e),t=Xo(t,!0),qo)try{return ai(e,t)}catch(t){}return tn(e,t)?on(!Ln.f.call(e,t),e[t]):void 0},si={f:di},ri=pn.KEY,li=si.f,ci=Ko.f,ui=ii.f,pi=Po.Symbol,hi=Po.JSON,gi=hi&&hi.stringify,mi="prototype",yi=Bo("_hidden"),fi=Bo("toPrimitive"),bi={}.propertyIsEnumerable,_i=Yo("symbol-registry"),vi=Yo("symbols"),ki=Yo("op-symbols"),wi=Object[mi],xi="function"==typeof pi&&!!zn.f,Si=Po.QObject,Oi=!Si||!Si[mi]||!Si[mi].findChild,Di=Wo&&jo(function(){return 7!=$n(ci({},"a",{get:function(){return ci(this,"a",{value:7}).a}})).a})?function(e,t,o){var n=li(wi,t);n&&delete wi[t],ci(e,t,o),n&&e!==wi&&ci(wi,t,n)}:ci,Ti=function(e){var t=vi[e]=$n(pi[mi]);return t._k=e,t},Ei=xi&&"symbol"==typeof pi.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof pi},Ci=function(e,t,o){return e===wi&&Ci(ki,t,o),Ho(e),t=Xo(t,!0),Ho(o),tn(vi,t)?(o.enumerable?(tn(e,yi)&&e[yi][t]&&(e[yi][t]=!1),o=$n(o,{enumerable:on(0,!1)})):(!tn(e,yi)&&ci(e,yi,on(1,{})),e[yi][t]=!0),Di(e,t,o)):ci(e,t,o)},Mi=function(e,t){Ho(e);for(var o=An(t=On(t)),n=0,a=o.length,d;a>n;)Ci(e,d=o[n++],t[d]);return e},Ii=function(e){var t=bi.call(this,e=Xo(e,!0));return(this!==wi||!tn(vi,e)||tn(ki,e))&&(!(t||!tn(this,e)||!tn(vi,e)||tn(this,yi)&&this[yi][e])||t)},Pi=function(e,t){if(e=On(e),t=Xo(t,!0),e!==wi||!tn(vi,t)||tn(ki,t)){var o=li(e,t);return o&&tn(vi,t)&&!(tn(e,yi)&&e[yi][t])&&(o.enumerable=!0),o}},Fi=function(e){for(var t=ui(On(e)),o=[],n=0,a;t.length>n;)tn(vi,a=t[n++])||a==yi||a==ri||o.push(a);return o},Ni=function(e){for(var t=e===wi,o=ui(t?ki:On(e)),n=[],a=0,d;o.length>a;)tn(vi,d=o[a++])&&(!t||tn(wi,d))&&n.push(vi[d]);return n};xi||(pi=function(){if(this instanceof pi)throw TypeError("Symbol is not a constructor!");var e=zo(0<arguments.length?arguments[0]:void 0),t=function(o){this===wi&&t.call(ki,o),tn(this,yi)&&tn(this[yi],e)&&(this[yi][e]=!1),Di(this,e,on(1,o))};return Wo&&Oi&&Di(wi,e,{configurable:!0,set:t}),Ti(e)},dn(pi[mi],"toString",function(){return this._k}),si.f=Pi,Ko.f=Ci,Jn.f=ii.f=Fi,Ln.f=Ii,zn.f=Ni,Wo&&!!1&&dn(wi,"propertyIsEnumerable",Ii,!0),Lo.f=function(e){return Ti(Bo(e))}),un(un.G+un.W+un.F*!xi,{Symbol:pi});for(var Yi=["hasInstance","isConcatSpreadable","iterator","match","replace","search","species","split","toPrimitive","toStringTag","unscopables"],Ri=0;Yi.length>Ri;)Bo(Yi[Ri++]);for(var zi=Yn(Bo.store),Bi=0;zi.length>Bi;)Jo(zi[Bi++]);un(un.S+un.F*!xi,"Symbol",{for:function(e){return tn(_i,e+="")?_i[e]:_i[e]=pi(e)},keyFor:function(e){if(!Ei(e))throw TypeError(e+" is not a symbol!");for(var t in _i)if(_i[t]===e)return t},useSetter:function(){Oi=!0},useSimple:function(){Oi=!1}}),un(un.S+un.F*!xi,"Object",{create:function(e,t){return t===void 0?$n(e):Mi($n(e),t)},defineProperty:Ci,defineProperties:Mi,getOwnPropertyDescriptor:Pi,getOwnPropertyNames:Fi,getOwnPropertySymbols:Ni});var Li=jo(function(){zn.f(1)});un(un.S+un.F*Li,"Object",{getOwnPropertySymbols:function(e){return zn.f(jn(e))}}),hi&&un(un.S+un.F*(!xi||jo(function(){var e=pi();return"[null]"!=gi([e])||"{}"!=gi({a:e})||"{}"!=gi(Object(e))})),"JSON",{stringify:function(e){for(var t=[e],o=1,n,a;arguments.length>o;)t.push(arguments[o++]);if(a=n=t[1],(Ao(n)||void 0!==e)&&!Ei(e))return Hn(n)||(n=function(e,t){if("function"==typeof a&&(t=a.call(this,e,t)),!Ei(t))return t}),t[1]=n,gi.apply(hi,t)}}),pi[mi][fi]||nn(pi[mi],fi,pi[mi].valueOf),vn(pi,"Symbol"),vn(Math,"Math",!0),vn(Po.JSON,"JSON",!0);(function(e,t){var o=(Fo.Object||{})[e]||Object[e],n={};n[e]=t(o),un(un.S+un.F*jo(function(){o(1)}),"Object",n)})("keys",function(){return function(e){return Yn(jn(e))}});var Ai=function(){var e=Ho(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t};Wo&&"g"!=/./g.flags&&Ko.f(RegExp.prototype,"flags",{configurable:!0,get:Ai});var Hi=/./.toString,ji=function(e){dn(RegExp.prototype,"toString",e,!0)};jo(function(){return"/a/b"!=Hi.call({source:"a",flags:"b"})})?ji(function(){var e=Ho(this);return"/".concat(e.source,"/","flags"in e?e.flags:!Wo&&e instanceof RegExp?Ai.call(e):void 0)}):Hi.name!="toString"&&ji(function(){return Hi.call(this)});var Wi=function(e){return function(t,o){var n=Sn(t)+"",d=Dn(o),i=n.length,s,r;return 0>d||d>=i?e?"":void 0:(s=n.charCodeAt(d),55296>s||56319<s||d+1===i||56320>(r=n.charCodeAt(d+1))||57343<r?e?n.charAt(d):s:e?n.slice(d,d+2):(s-55296<<10)+(r-56320)+65536)}}(!0),at=function(e,t,o){return t+(o?Wi(e,t).length:1)},Ui=Bo("toStringTag"),Vi="Arguments"==wn(function(){return arguments}()),Gi=function(e,t){try{return e[t]}catch(t){}},qi=function(e){var t,o,n;return e===void 0?"Undefined":null===e?"Null":"string"==typeof(o=Gi(t=Object(e),Ui))?o:Vi?wn(t):"Object"==(n=wn(t))&&"function"==typeof t.callee?"Arguments":n},Xi=RegExp.prototype.exec,Zi=function(e,t){var o=e.exec;if("function"==typeof o){var n=o.call(e,t);if("object"!=typeof n)throw new TypeError("RegExp exec method returned something other than an Object or null");return n}if("RegExp"!==qi(e))throw new TypeError("RegExp#exec called on incompatible receiver");return Xi.call(e,t)},$i=RegExp.prototype.exec,Ki=wo.replace,Qi=$i,Ji="lastIndex",ea=function(){var e=/a/,t=/b*/g;return $i.call(e,"a"),$i.call(t,"a"),0!==e[Ji]||0!==t[Ji]}(),ta=/()??/.exec("")[1]!==void 0;(ea||ta)&&(Qi=function(e){var t=this,o,n,a,d;return ta&&(n=new RegExp("^"+t.source+"$(?!\\s)",Ai.call(t))),ea&&(o=t[Ji]),a=$i.call(t,e),ea&&a&&(t[Ji]=t.global?a.index+a[0].length:o),ta&&a&&1<a.length&&Ki.call(a[0],n,function(){for(d=1;d<arguments.length-2;d++)void 0===arguments[d]&&(a[d]=void 0)}),a});var oa=Qi;un({target:"RegExp",proto:!0,forced:oa!==/./.exec},{exec:oa});var na=Bo("species"),ia=!jo(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),aa=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var o="ab".split(e);return 2===o.length&&"a"===o[0]&&"b"===o[1]}(),da=function(e,t,o){var n=Bo(e),i=!jo(function(){var t={};return t[n]=function(){return 7},7!=""[e](t)}),a=i?!jo(function(){var t=!1,o=/a/;return o.exec=function(){return t=!0,null},"split"===e&&(o.constructor={},o.constructor[na]=function(){return o}),o[n](""),!t}):void 0;if(!i||!a||"replace"===e&&!ia||"split"===e&&!aa){var d=/./[n],s=o(Sn,n,""[e],function(e,t,o,n,a){return t.exec===oa?i&&!a?{done:!0,value:d.call(t,o,n)}:{done:!0,value:e.call(o,t,n)}:{done:!1}}),r=s[0],l=s[1];dn(String.prototype,e,r),nn(RegExp.prototype,n,2==t?function(e,t){return l.call(e,this,t)}:function(e){return l.call(e,this)})}},sa=/\$([$&`']|\d\d?|<[^>]*>)/g,ra=/\$([$&`']|\d\d?)/g,la=function(e){return e===void 0?e:e+""};da("replace",2,function(e,t,o,n){function a(e,t,i,a,d,s){var r=i+e.length,l=a.length,n=ra;return void 0!==d&&(d=jn(d),n=sa),o.call(s,n,function(o,s){var c;switch(s.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,i);case"'":return t.slice(r);case"<":c=d[s.slice(1,-1)];break;default:var u=+s;if(0==u)return o;if(u>l){var n=Eo(u/10);return 0===n?o:n<=l?void 0===a[n-1]?s.charAt(1):a[n-1]+s.charAt(1):o}c=a[u-1];}return void 0===c?"":c})}return[function(n,i){var a=e(this),d=n==null?void 0:n[t];return d===void 0?o.call(a+"",n,i):d.call(n,a,i)},function(e,t){var d=n(o,e,this,t);if(d.done)return d.value;var s=Ho(e),r=this+"",l="function"==typeof t;l||(t=t+"");var c=s.global;if(c){var u=s.unicode;s.lastIndex=0}for(var p=[],h;(h=Zi(s,r),null!==h)&&!(p.push(h),!c);){var g=h[0]+"";""==g&&(s.lastIndex=at(r,Tn(s.lastIndex),u))}for(var m="",y=0,f=0;f<p.length;f++){h=p[f];for(var b=h[0]+"",_=Co(Mo(Dn(h.index),r.length),0),v=[],k=1;k<h.length;k++)v.push(la(h[k]));var w=h.groups;if(l){var x=[b].concat(v,_,r);w!==void 0&&x.push(w);var S=t.apply(void 0,x)+""}else S=a(b,r,_,v,w,t);_>=y&&(m+=r.slice(y,_)+S,y=_+b.length)}return m+r.slice(y)}]});var ca=Bo("unscopables"),ua=Array.prototype;ua[ca]==null&&nn(ua,ca,{});var pa=function(e){ua[ca][e]=!0},ha=function(e,t){return{value:t,done:!!e}},ga={},ma={};nn(ma,Bo("iterator"),function(){return this});var ya=function(e,t,o){e.prototype=$n(ma,{next:on(1,o)}),vn(e,t+" Iterator")},fa=Mn("IE_PROTO"),ba=Object.prototype,_a=Object.getPrototypeOf||function(e){return e=jn(e),tn(e,fa)?e[fa]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?ba:null},va=Bo("iterator"),ka=!([].keys&&"next"in[].keys()),wa="keys",xa="values",Sa=function(){return this},Oa=function(e,t,o,n,i,a,d){ya(o,t,n);var s=function(e){return!ka&&e in u?u[e]:e===wa?function(){return new o(this,e)}:e===xa?function(){return new o(this,e)}:function(){return new o(this,e)}},r=t+" Iterator",l=i==xa,c=!1,u=e.prototype,p=u[va]||u["@@iterator"]||i&&u[i],h=p||s(i),g=i?l?s("entries"):h:void 0,m="Array"==t?u.entries||p:p,y,f,b;if(m&&(b=_a(m.call(new e)),b!==Object.prototype&&b.next&&(vn(b,r,!0),"function"!=typeof b[va]&&nn(b,va,Sa))),l&&p&&p.name!==xa&&(c=!0,h=function(){return p.call(this)}),(ka||c||!u[va])&&nn(u,va,h),ga[t]=h,ga[r]=Sa,i)if(y={values:l?h:s(xa),keys:a?h:s(wa),entries:g},d)for(f in y)f in u||dn(u,f,y[f]);else un(un.P+un.F*(ka||c),t,y);return y},Da=Oa(Array,"Array",function(e,t){this._t=On(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,o=this._i++;return!e||o>=e.length?(this._t=void 0,ha(1)):"keys"==t?ha(0,o):"values"==t?ha(0,e[o]):ha(0,[o,e[o]])},"values");ga.Arguments=ga.Array,pa("keys"),pa("values"),pa("entries");for(var Ta=Bo("iterator"),Ea=Bo("toStringTag"),Ca=ga.Array,Ma={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},Ia=Yn(Ma),Pa=0;Pa<Ia.length;Pa++){var Fa=Ia[Pa],Na=Ma[Fa],Ya=Po[Fa],Ra=Ya&&Ya.prototype,za;if(Ra&&(Ra[Ta]||nn(Ra,Ta,Ca),Ra[Ea]||nn(Ra,Ea,Fa),ga[Fa]=Ca,Na))for(za in Da)Ra[za]||dn(Ra,za,Da[za],!0)}({})[Bo("toStringTag")]="z",dn(Object.prototype,"toString",function(){return"[object "+qi(this)+"]"},!0);var Ba=Ln.f,La=function(e){return function(t){for(var o=On(t),n=Yn(o),a=n.length,d=0,s=[],r;a>d;)r=n[d++],(!Wo||Ba.call(o,r))&&s.push(e?[r,o[r]]:o[r]);return s}}(!1);un(un.S,"Object",{values:function(e){return La(e)}});var Aa=Bo("match"),Ha=function(e){var t;return Ao(e)&&((t=e[Aa])===void 0?"RegExp"==wn(e):!!t)},ja=Bo("species"),Wa=function(e,t){var o=Ho(e).constructor,n;return o===void 0||(n=Ho(o)[ja])==null?t:sn(n)},Ua=[].push,Va="split",Ga="length",qa="lastIndex",Xa=4294967295,Za=!jo(function(){RegExp(Xa,"y")});da("split",2,function(e,t,o,n){var a;return a="c"=="abbc"[Va](/(b)*/)[1]||4!="test"[Va](/(?:)/,-1)[Ga]||2!="ab"[Va](/(?:ab)*/)[Ga]||4!="."[Va](/(.?)(.?)/)[Ga]||1<"."[Va](/()()/)[Ga]||""[Va](/.?/)[Ga]?function(e,t){var n=this+"";if(void 0===e&&0===t)return[];if(!Ha(e))return o.call(n,e,t);for(var i=[],a=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,s=void 0===t?Xa:t>>>0,r=new RegExp(e.source,a+"g"),l,c,u;(l=oa.call(r,n))&&(c=r[qa],!(c>d&&(i.push(n.slice(d,l.index)),1<l[Ga]&&l.index<n[Ga]&&Ua.apply(i,l.slice(1)),u=l[0][Ga],d=c,i[Ga]>=s)));)r[qa]===l.index&&r[qa]++;return d===n[Ga]?(u||!r.test(""))&&i.push(""):i.push(n.slice(d)),i[Ga]>s?i.slice(0,s):i}:"0"[Va](void 0,0)[Ga]?function(e,t){return void 0===e&&0===t?[]:o.call(this,e,t)}:o,[function(o,n){var i=e(this),d=null==o?void 0:o[t];return void 0===d?a.call(i+"",o,n):d.call(o,i,n)},function(t,d){var s=n(a,t,this,d,a!==o);if(s.done)return s.value;var r=Ho(t),l=this+"",c=Wa(r,RegExp),u=r.unicode,h=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(Za?"y":"g"),g=new c(Za?r:"^(?:"+r.source+")",h),m=void 0===d?Xa:d>>>0;if(0===m)return[];if(0===l.length)return null===Zi(g,l)?[l]:[];for(var y=0,f=0,b=[];f<l.length;){g.lastIndex=Za?f:0;var _=Zi(g,Za?l:l.slice(f)),v;if(null===_||(v=Mo(Tn(g.lastIndex+(Za?0:f)),l.length))===y)f=at(l,f,u);else{if(b.push(l.slice(y,f)),b.length===m)return b;for(var k=1;k<=_.length-1;k++)if(b.push(_[k]),b.length===m)return b;f=y=v}}return b.push(l.slice(y)),b}]});var $a=Object.assign,Ka=!$a||jo(function(){var e={},t={},o=Symbol(),n="abcdefghijklmnopqrst";return e[o]=7,n.split("").forEach(function(e){t[e]=e}),7!=$a({},e)[o]||Object.keys($a({},t)).join("")!=n})?function(e){for(var t=jn(e),o=arguments.length,n=1,i=zn.f,a=Ln.f;o>n;)for(var d=xn(arguments[n++]),s=i?Yn(d).concat(i(d)):Yn(d),r=s.length,l=0,c;r>l;)c=s[l++],(!Wo||a.call(d,c))&&(t[c]=d[c]);return t}:$a;un(un.S+un.F,"Object",{assign:Ka});var Qa=function(e,t){if(Ho(e),!Ao(t)&&null!==t)throw TypeError(t+": can't set as prototype!")},Ja={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,o){try{o=rn(Function.call,si.f(Object.prototype,"__proto__").set,2),o(e,[]),t=!(e instanceof Array)}catch(o){t=!0}return function(e,n){return Qa(e,n),t?e.__proto__=n:o(e,n),e}}({},!1):void 0),check:Qa},ed=Ja.set,td=function(e,t,o){var n=t.constructor,i;return n!==o&&"function"==typeof n&&(i=n.prototype)!==o.prototype&&Ao(i)&&ed&&ed(e,i),e},od="\t\n\x0B\f\r \xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF",nd="["+od+"]",ad="\u200B\x85",dd=RegExp("^"+nd+nd+"*"),sd=RegExp(nd+nd+"*$"),rd=function(e,t,o){var n={},i=jo(function(){return!!od[e]()||ad[e]()!=ad}),a=n[e]=i?t(ld):od[e];o&&(n[o]=a),un(un.P+un.F*i,"String",n)},ld=rd.trim=function(e,t){return e=Sn(e)+"",1&t&&(e=e.replace(dd,"")),2&t&&(e=e.replace(sd,"")),e},cd=Jn.f,ud=si.f,pd=Ko.f,hd=rd.trim,gd="Number",md=Po[gd],yd=md,fd=md.prototype,bd=wn($n(fd))==gd,_d="trim"in wo,vd=function(e){var t=Xo(e,!1);if("string"==typeof t&&2<t.length){t=_d?t.trim():hd(t,3);var o=t.charCodeAt(0),n,a,d;if(43===o||45===o){if(n=t.charCodeAt(2),88===n||120===n)return NaN;}else if(48===o){switch(t.charCodeAt(1)){case 66:case 98:a=2,d=49;break;case 79:case 111:a=8,d=55;break;default:return+t;}for(var s=t.slice(2),r=0,c=s.length,l;r<c;r++)if(l=s.charCodeAt(r),48>l||l>d)return NaN;return parseInt(s,a)}}return+t};if(!md(" 0o1")||!md("0b1")||md("+0x1")){md=function(e){var t=1>arguments.length?0:e,o=this;return o instanceof md&&(bd?jo(function(){fd.valueOf.call(o)}):wn(o)!=gd)?td(new yd(vd(t)),o,md):vd(t)};for(var kd=Wo?cd(yd):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),wd=0,xd;kd.length>wd;wd++)tn(yd,xd=kd[wd])&&!tn(md,xd)&&pd(md,xd,ud(yd,xd));md.prototype=fd,fd.constructor=md,dn(Po,gd,md)}for(var Sd=o(function(e){(function(t,o){e.exports=o()})(Io,function(){function o(){return Ht.apply(null,arguments)}function n(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function i(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function a(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function d(e){return void 0===e}function s(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function r(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function l(e,t){var o=[],n;for(n=0;n<e.length;++n)o.push(t(e[n],n));return o}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function u(e,t){for(var o in t)c(t,o)&&(e[o]=t[o]);return c(t,"toString")&&(e.toString=t.toString),c(t,"valueOf")&&(e.valueOf=t.valueOf),e}function p(e,t,o,n){return Ke(e,t,o,n,!0).utc()}function h(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function g(e){return null==e._pf&&(e._pf=h()),e._pf}function m(e){if(null==e._isValid){var t=g(e),o=jt.call(t.parsedDateParts,function(e){return null!=e}),n=!isNaN(e._d.getTime())&&0>t.overflow&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&o);if(e._strict&&(n=n&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null==Object.isFrozen||!Object.isFrozen(e))e._isValid=n;else return n}return e._isValid}function y(e){var t=p(NaN);return null==e?g(t).userInvalidated=!0:u(g(t),e),t}function f(e,t){var o,n,a;if(d(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),d(t._i)||(e._i=t._i),d(t._f)||(e._f=t._f),d(t._l)||(e._l=t._l),d(t._strict)||(e._strict=t._strict),d(t._tzm)||(e._tzm=t._tzm),d(t._isUTC)||(e._isUTC=t._isUTC),d(t._offset)||(e._offset=t._offset),d(t._pf)||(e._pf=g(t)),d(t._locale)||(e._locale=t._locale),0<Wt.length)for(o=0;o<Wt.length;o++)n=Wt[o],a=t[n],d(a)||(e[n]=a);return e}function b(e){f(this,e),this._d=new Date(null==e._d?NaN:e._d.getTime()),this.isValid()||(this._d=new Date(NaN)),!1===Ut&&(Ut=!0,o.updateOffset(this),Ut=!1)}function _(e){return e instanceof b||null!=e&&null!=e._isAMomentObject}function v(e){return 0>e?xo(e)||0:Eo(e)}function k(e){var t=+e,o=0;return 0!=t&&isFinite(t)&&(o=v(t)),o}function w(e,t,o){var n=Mo(e.length,t.length),a=So(e.length-t.length),d=0,s;for(s=0;s<n;s++)(o&&e[s]!==t[s]||!o&&k(e[s])!==k(t[s]))&&d++;return d+a}function x(e){!1===o.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function S(e,t){var n=!0;return u(function(){if(null!=o.deprecationHandler&&o.deprecationHandler(null,e),n){for(var a=[],d=0,s;d<arguments.length;d++){if(s="","object"==typeof arguments[d]){for(var r in s+="\n["+d+"] ",arguments[0])s+=r+": "+arguments[0][r]+", ";s=s.slice(0,-2)}else s=arguments[d];a.push(s)}x(e+"\nArguments: "+Array.prototype.slice.call(a).join("")+"\n"+new Error().stack),n=!1}return t.apply(this,arguments)},t)}function O(e,t){null!=o.deprecationHandler&&o.deprecationHandler(e,t),Vt[e]||(x(t),Vt[e]=!0)}function D(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function T(e){var t,o;for(o in e)t=e[o],D(t)?this[o]=t:this["_"+o]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function E(e,t){var o=u({},e),n;for(n in t)c(t,n)&&(i(e[n])&&i(t[n])?(o[n]={},u(o[n],e[n]),u(o[n],t[n])):null==t[n]?delete o[n]:o[n]=t[n]);for(n in e)c(e,n)&&!c(t,n)&&i(e[n])&&(o[n]=u({},o[n]));return o}function C(e){null!=e&&this.set(e)}function M(e,t,o){var n=this._calendar[e]||this._calendar.sameElse;return D(n)?n.call(t,o):n}function I(e){var t=this._longDateFormat[e],o=this._longDateFormat[e.toUpperCase()];return t||!o?t:(this._longDateFormat[e]=o.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])}function P(e,t){var o=e.toLowerCase();Xt[o]=Xt[o+"s"]=Xt[t]=e}function F(e){return"string"==typeof e?Xt[e]||Xt[e.toLowerCase()]:void 0}function N(e){var t={},o,n;for(n in e)c(e,n)&&(o=F(n),o&&(t[o]=e[n]));return t}function Y(e,t){Zt[e]=t}function R(e){var t=[];for(var o in e)t.push({unit:o,priority:Zt[o]});return t.sort(function(e,t){return e.priority-t.priority}),t}function z(e,t,o){var n=""+So(e),i=t-n.length;return(0<=e?o?"+":"":"-")+ko(10,Co(0,i)).toString().substr(1)+n}function B(e,t,o,n){var i=n;"string"==typeof n&&(i=function(){return this[n]()}),e&&(Jt[e]=i),t&&(Jt[t[0]]=function(){return z(i.apply(this,arguments),t[1],t[2])}),o&&(Jt[o]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function L(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function A(e){var t=e.match($t),o,n;for(o=0,n=t.length;o<n;o++)t[o]=Jt[t[o]]?Jt[t[o]]:L(t[o]);return function(o){var a="",d;for(d=0;d<n;d++)a+=D(t[d])?t[d].call(o,e):t[d];return a}}function H(e,t){return e.isValid()?(t=j(t,e.localeData()),Qt[t]=Qt[t]||A(t),Qt[t](e)):e.localeData().invalidDate()}function j(e,t){function o(e){return t.longDateFormat(e)||e}var n=5;for(Kt.lastIndex=0;0<=n&&Kt.test(e);)e=e.replace(Kt,o),Kt.lastIndex=0,n-=1;return e}function W(e,t,o){bo[e]=D(t)?t:function(e){return e&&o?o:t}}function U(e,t){return c(bo,e)?bo[e](t._strict,t._locale):new RegExp(V(e))}function V(e){return G(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,o,n,i){return t||o||n||i}))}function G(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function q(e,t){var o=t,n;for("string"==typeof e&&(e=[e]),s(t)&&(o=function(e,o){o[t]=k(e)}),n=0;n<e.length;n++)_o[e[n]]=o}function X(e,t){q(e,function(e,o,n,i){n._w=n._w||{},t(e,n._w,n,i)})}function Z(e,t,o){null!=t&&c(_o,e)&&_o[e](t,o._a,o,e)}function $(e){return K(e)?366:365}function K(e){return 0==e%4&&0!=e%100||0==e%400}function Q(e,t){return function(n){return null==n?J(this,e):(ee(this,e,n),o.updateOffset(this,t),this)}}function J(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function ee(e,t,o){e.isValid()&&!isNaN(o)&&("FullYear"===t&&K(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](o,e.month(),ne(o,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](o))}function te(e,t){if("object"==typeof e){e=N(e);for(var o=R(e),n=0;n<o.length;n++)this[o[n].unit](e[o[n].unit])}else if(e=F(e),D(this[e]))return this[e](t);return this}function oe(e,t){return(e%t+t)%t}function ne(e,t){if(isNaN(e)||isNaN(t))return NaN;var o=oe(t,12);return e+=(t-o)/12,1===o?K(e)?29:28:31-o%7%2}function ie(e,t,o){var n=e.toLocaleLowerCase(),a,d,s;if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],a=0;12>a;++a)s=p([2e3,a]),this._shortMonthsParse[a]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[a]=this.months(s,"").toLocaleLowerCase();return o?"MMM"===t?(d=No.call(this._shortMonthsParse,n),-1===d?null:d):(d=No.call(this._longMonthsParse,n),-1===d?null:d):"MMM"===t?(d=No.call(this._shortMonthsParse,n),-1!==d)?d:(d=No.call(this._longMonthsParse,n),-1===d?null:d):(d=No.call(this._longMonthsParse,n),-1!==d)?d:(d=No.call(this._shortMonthsParse,n),-1===d?null:d)}function ae(e,t,o){var n,a,d;if(this._monthsParseExact)return ie.call(this,e,t,o);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;12>n;n++){if(a=p([2e3,n]),o&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),o||this._monthsParse[n]||(d="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[n]=new RegExp(d.replace(".",""),"i")),o&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(o&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!o&&this._monthsParse[n].test(e))return n}}function de(e,t){var o;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=k(t);else if(t=e.localeData().monthsParse(t),!s(t))return e;return o=Mo(e.date(),ne(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,o),e}function se(e){return null==e?J(this,"Month"):(de(this,e),o.updateOffset(this,!0),this)}function re(){function e(e,t){return t.length-e.length}var t=[],o=[],n=[],a,d;for(a=0;12>a;a++)d=p([2e3,a]),t.push(this.monthsShort(d,"")),o.push(this.months(d,"")),n.push(this.months(d,"")),n.push(this.monthsShort(d,""));for(t.sort(e),o.sort(e),n.sort(e),a=0;12>a;a++)t[a]=G(t[a]),o[a]=G(o[a]);for(a=0;24>a;a++)n[a]=G(n[a]);this._monthsRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function le(e,t,o,n,i,a,d){var s;return 100>e&&0<=e?(s=new Date(e+400,t,o,n,i,a,d),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,o,n,i,a,d),s}function ce(e){var t;if(100>e&&0<=e){var o=Array.prototype.slice.call(arguments);o[0]=e+400,t=new Date(Date.UTC.apply(null,o)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)}else t=new Date(Date.UTC.apply(null,arguments));return t}function ue(e,t,o){var n=7+t-o,i=(7+ce(e,0,n).getUTCDay()-t)%7;return-i+n-1}function pe(e,t,o,n,i){var a=ue(e,n,i),d=1+7*(t-1)+(7+o-n)%7+a,s,r;return 0>=d?(s=e-1,r=$(s)+d):d>$(e)?(s=e+1,r=d-$(e)):(s=e,r=d),{year:s,dayOfYear:r}}function he(e,t,o){var n=ue(e.year(),t,o),i=Eo((e.dayOfYear()-n-1)/7)+1,a,d;return 1>i?(d=e.year()-1,a=i+ge(d,t,o)):i>ge(e.year(),t,o)?(a=i-ge(e.year(),t,o),d=e.year()+1):(d=e.year(),a=i),{week:a,year:d}}function ge(e,t,o){var n=ue(e,t,o),i=ue(e+1,t,o);return($(e)-n+i)/7}function me(e,t){return"string"==typeof e?isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10):e}function ye(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function fe(e,t){return e.slice(t,7).concat(e.slice(0,t))}function be(e,t,o){var n=e.toLocaleLowerCase(),a,d,s;if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],a=0;7>a;++a)s=p([2e3,1]).day(a),this._minWeekdaysParse[a]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[a]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[a]=this.weekdays(s,"").toLocaleLowerCase();return o?"dddd"===t?(d=No.call(this._weekdaysParse,n),-1===d?null:d):"ddd"===t?(d=No.call(this._shortWeekdaysParse,n),-1===d?null:d):(d=No.call(this._minWeekdaysParse,n),-1===d?null:d):"dddd"===t?(d=No.call(this._weekdaysParse,n),-1!==d)?d:(d=No.call(this._shortWeekdaysParse,n),-1!==d)?d:(d=No.call(this._minWeekdaysParse,n),-1===d?null:d):"ddd"===t?(d=No.call(this._shortWeekdaysParse,n),-1!==d)?d:(d=No.call(this._weekdaysParse,n),-1!==d)?d:(d=No.call(this._minWeekdaysParse,n),-1===d?null:d):(d=No.call(this._minWeekdaysParse,n),-1!==d)?d:(d=No.call(this._weekdaysParse,n),-1!==d)?d:(d=No.call(this._shortWeekdaysParse,n),-1===d?null:d)}function _e(e,t,o){var n,a,d;if(this._weekdaysParseExact)return be.call(this,e,t,o);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;7>n;n++){if(a=p([2e3,1]).day(n),o&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(d="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[n]=new RegExp(d.replace(".",""),"i")),o&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(o&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(o&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;if(!o&&this._weekdaysParse[n].test(e))return n}}function ve(){function e(e,t){return t.length-e.length}var t=[],o=[],n=[],a=[],d,s,r,l,c;for(d=0;7>d;d++)s=p([2e3,1]).day(d),r=this.weekdaysMin(s,""),l=this.weekdaysShort(s,""),c=this.weekdays(s,""),t.push(r),o.push(l),n.push(c),a.push(r),a.push(l),a.push(c);for(t.sort(e),o.sort(e),n.sort(e),a.sort(e),d=0;7>d;d++)o[d]=G(o[d]),n[d]=G(n[d]),a[d]=G(a[d]);this._weekdaysRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function ke(){return this.hours()%12||12}function we(e,t){B(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function xe(e,t){return t._meridiemParse}function Se(e){return e?e.toLowerCase().replace("_","-"):e}function Oe(e){for(var t=0,o,n,a,d;t<e.length;){for(d=Se(e[t]).split("-"),o=d.length,n=Se(e[t+1]),n=n?n.split("-"):null;0<o;){if(a=De(d.slice(0,o).join("-")),a)return a;if(n&&n.length>=o&&w(d,n,!0)>=o-1)break;o--}t++}return Ko}function De(o){var n=null;if(!Ho[o]&&!0&&e&&e.exports)try{n=Ko._abbr;t("./locale/"+o),Te(n)}catch(t){}return Ho[o]}function Te(e,t){var o;return e&&(o=d(t)?Ce(e):Ee(e,t),o?Ko=o:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Ko._abbr}function Ee(e,t){if(null!==t){var o=Ao,n;if(t.abbr=e,null!=Ho[e])O("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),o=Ho[e]._config;else if(null!=t.parentLocale)if(null!=Ho[t.parentLocale])o=Ho[t.parentLocale]._config;else if(n=De(t.parentLocale),null!=n)o=n._config;else return jo[t.parentLocale]||(jo[t.parentLocale]=[]),jo[t.parentLocale].push({name:e,config:t}),null;return Ho[e]=new C(E(o,t)),jo[e]&&jo[e].forEach(function(e){Ee(e.name,e.config)}),Te(e),Ho[e]}return delete Ho[e],null}function Ce(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Ko;if(!n(e)){if(t=De(e),t)return t;e=[e]}return Oe(e)}function Me(){return Gt(Ho)}function Ie(e){var t=e._a,o;return t&&-2===g(e).overflow&&(o=0>t[1]||11<t[1]?1:1>t[2]||t[2]>ne(t[0],t[1])?2:0>t[3]||24<t[3]||24===t[3]&&(0!==t[4]||0!==t[5]||0!==t[6])?3:0>t[4]||59<t[4]?4:0>t[5]||59<t[5]?5:0>t[6]||999<t[6]?6:-1,g(e)._overflowDayOfYear&&(0>o||2<o)&&(o=2),g(e)._overflowWeeks&&-1===o&&(o=7),g(e)._overflowWeekday&&-1===o&&(o=8),g(e).overflow=o),e}function Pe(e,t,o){return null==e?null==t?o:t:e}function Fe(e){var t=new Date(o.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Ne(e){var t=[],o,n,a,d,s;if(!e._d){for(a=Fe(e),e._w&&null==e._a[2]&&null==e._a[1]&&Ye(e),null!=e._dayOfYear&&(s=Pe(e._a[0],a[0]),(e._dayOfYear>$(s)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),n=ce(s,0,e._dayOfYear),e._a[1]=n.getUTCMonth(),e._a[2]=n.getUTCDate()),o=0;3>o&&null==e._a[o];++o)e._a[o]=t[o]=a[o];for(;7>o;o++)e._a[o]=t[o]=null==e._a[o]?2===o?1:0:e._a[o];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?ce:le).apply(null,t),d=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&"undefined"!=typeof e._w.d&&e._w.d!==d&&(g(e).weekdayMismatch=!0)}}function Ye(e){var t,o,n,i,a,d,s,r;if(t=e._w,null!=t.GG||null!=t.W||null!=t.E)a=1,d=4,o=Pe(t.GG,e._a[0],he(Qe(),1,4).year),n=Pe(t.W,1),i=Pe(t.E,1),(1>i||7<i)&&(r=!0);else{a=e._locale._week.dow,d=e._locale._week.doy;var l=he(Qe(),a,d);o=Pe(t.gg,e._a[0],l.year),n=Pe(t.w,l.week),null==t.d?null==t.e?i=a:(i=t.e+a,(0>t.e||6<t.e)&&(r=!0)):(i=t.d,(0>i||6<i)&&(r=!0))}1>n||n>ge(o,a,d)?g(e)._overflowWeeks=!0:null==r?(s=pe(o,n,i,a,d),e._a[0]=s.year,e._dayOfYear=s.dayOfYear):g(e)._overflowWeekday=!0}function Re(e){var t=e._i,o=Wo.exec(t)||Uo.exec(t),n,a,d,s,r,c;if(o){for(g(e).iso=!0,n=0,a=Go.length;n<a;n++)if(Go[n][1].exec(o[1])){s=Go[n][0],d=!1!==Go[n][2];break}if(null==s)return void(e._isValid=!1);if(o[3]){for(n=0,a=qo.length;n<a;n++)if(qo[n][1].exec(o[3])){r=(o[2]||" ")+qo[n][0];break}if(null==r)return void(e._isValid=!1)}if(!d&&null!=r)return void(e._isValid=!1);if(o[4])if(Vo.exec(o[4]))c="Z";else return void(e._isValid=!1);e._f=s+(r||"")+(c||""),Ue(e)}else e._isValid=!1}function ze(e,t,o,n,i,a){var d=[Be(e),Ro.indexOf(t),parseInt(o,10),parseInt(n,10),parseInt(i,10)];return a&&d.push(parseInt(a,10)),d}function Be(e){var t=parseInt(e,10);return 49>=t?2e3+t:999>=t?1900+t:t}function Le(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Ae(e,t,o){if(e){var n=zo.indexOf(e),i=new Date(t[0],t[1],t[2]).getDay();if(n!==i)return g(o).weekdayMismatch=!0,o._isValid=!1,!1}return!0}function He(e,t,o){if(e)return $o[e];if(t)return 0;var n=parseInt(o,10),i=n%100;return 60*((n-i)/100)+i}function je(e){var t=Zo.exec(Le(e._i));if(t){var o=ze(t[4],t[3],t[2],t[5],t[6],t[7]);if(!Ae(t[1],o,e))return;e._a=o,e._tzm=He(t[8],t[9],t[10]),e._d=ce.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),g(e).rfc2822=!0}else e._isValid=!1}function We(e){var t=Xo.exec(e._i);if(null!==t)return void(e._d=new Date(+t[1]));if(Re(e),!1===e._isValid)delete e._isValid;else return;if(je(e),!1===e._isValid)delete e._isValid;else return;o.createFromInputFallback(e)}function Ue(e){if(e._f===o.ISO_8601)return void Re(e);if(e._f===o.RFC_2822)return void je(e);e._a=[],g(e).empty=!0;var t=""+e._i,n=t.length,a=0,d,s,r,l,c;for(r=j(e._f,e._locale).match($t)||[],d=0;d<r.length;d++)l=r[d],s=(t.match(U(l,e))||[])[0],s&&(c=t.substr(0,t.indexOf(s)),0<c.length&&g(e).unusedInput.push(c),t=t.slice(t.indexOf(s)+s.length),a+=s.length),Jt[l]?(s?g(e).empty=!1:g(e).unusedTokens.push(l),Z(l,s,e)):e._strict&&!s&&g(e).unusedTokens.push(l);g(e).charsLeftOver=n-a,0<t.length&&g(e).unusedInput.push(t),12>=e._a[3]&&!0===g(e).bigHour&&0<e._a[3]&&(g(e).bigHour=void 0),g(e).parsedDateParts=e._a.slice(0),g(e).meridiem=e._meridiem,e._a[3]=Ve(e._locale,e._a[3],e._meridiem),Ne(e),Ie(e)}function Ve(e,t,o){var n;return null==o?t:null==e.meridiemHour?null==e.isPM?t:(n=e.isPM(o),n&&12>t&&(t+=12),n||12!==t||(t=0),t):e.meridiemHour(t,o)}function Ge(e){var t,o,n,a,d;if(0===e._f.length)return g(e).invalidFormat=!0,void(e._d=new Date(NaN));for(a=0;a<e._f.length;a++)(d=0,t=f({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[a],Ue(t),!!m(t))&&(d+=g(t).charsLeftOver,d+=10*g(t).unusedTokens.length,g(t).score=d,(null==n||d<n)&&(n=d,o=t));u(e,o||t)}function qe(e){if(!e._d){var t=N(e._i);e._a=l([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Ne(e)}}function Xe(e){var t=new b(Ie(Ze(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Ze(e){var t=e._i,o=e._f;return(e._locale=e._locale||Ce(e._l),null===t||void 0===o&&""===t)?y({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),_(t))?new b(Ie(t)):(r(t)?e._d=t:n(o)?Ge(e):o?Ue(e):$e(e),m(e)||(e._d=null),e)}function $e(e){var t=e._i;d(t)?e._d=new Date(o.now()):r(t)?e._d=new Date(t.valueOf()):"string"==typeof t?We(e):n(t)?(e._a=l(t.slice(0),function(e){return parseInt(e,10)}),Ne(e)):i(t)?qe(e):s(t)?e._d=new Date(t):o.createFromInputFallback(e)}function Ke(e,t,o,d,s){var r={};return(!0===o||!1===o)&&(d=o,o=void 0),(i(e)&&a(e)||n(e)&&0===e.length)&&(e=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=s,r._l=o,r._i=e,r._f=t,r._strict=d,Xe(r)}function Qe(e,t,o,n){return Ke(e,t,o,n,!1)}function Je(e,t){var o,a;if(1===t.length&&n(t[0])&&(t=t[0]),!t.length)return Qe();for(o=t[0],a=1;a<t.length;++a)(!t[a].isValid()||t[a][e](o))&&(o=t[a]);return o}function et(e){for(var t in e)if(-1===No.call(en,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var o=!1,n=0;n<en.length;++n)if(e[en[n]]){if(o)return!1;parseFloat(e[en[n]])!==k(e[en[n]])&&(o=!0)}return!0}function tt(e){var t=N(e),o=t.year||0,n=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,d=t.day||0,s=t.hour||0,r=t.minute||0,l=t.second||0,c=t.millisecond||0;this._isValid=et(t),this._milliseconds=+c+1e3*l+6e4*r+60*(60*(1e3*s)),this._days=+d+7*a,this._months=+i+3*n+12*o,this._data={},this._locale=Ce(),this._bubble()}function ot(e){return e instanceof tt}function nt(e){return 0>e?-1*vo(-1*e):vo(e)}function it(e,t){B(e,0,0,function(){var e=this.utcOffset(),o="+";return 0>e&&(e=-e,o="-"),o+z(~~(e/60),2)+t+z(~~e%60,2)})}function at(e,t){var o=(t||"").match(e);if(null===o)return null;var n=o[o.length-1]||[],i=(n+"").match(tn)||["-",0,0],a=+(60*i[1])+k(i[2]);return 0===a?0:"+"===i[0]?a:-a}function dt(e,t){var n,i;return t._isUTC?(n=t.clone(),i=(_(e)||r(e)?e.valueOf():Qe(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+i),o.updateOffset(n,!1),n):Qe(e).local()}function st(e){return 15*-vo(e._d.getTimezoneOffset()/15)}function rt(){if(!d(this._isDSTShifted))return this._isDSTShifted;var e={};if(f(e,this),e=Ze(e),e._a){var t=e._isUTC?p(e._a):Qe(e._a);this._isDSTShifted=this.isValid()&&0<w(e._a,t.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted}function lt(){return!!this.isValid()&&this._isUTC&&0===this._offset}function ct(e,t){var o=e,n=null,i,a,d;return ot(e)?o={ms:e._milliseconds,d:e._days,M:e._months}:s(e)?(o={},t?o[t]=e:o.milliseconds=e):(n=on.exec(e))?(i="-"===n[1]?-1:1,o={y:0,d:k(n[2])*i,h:k(n[3])*i,m:k(n[4])*i,s:k(n[5])*i,ms:k(nt(1e3*n[6]))*i}):(n=nn.exec(e))?(i="-"===n[1]?-1:1,o={y:ut(n[2],i),M:ut(n[3],i),w:ut(n[4],i),d:ut(n[5],i),h:ut(n[6],i),m:ut(n[7],i),s:ut(n[8],i)}):null==o?o={}:"object"==typeof o&&(("from"in o)||("to"in o))&&(d=ht(Qe(o.from),Qe(o.to)),o={},o.ms=d.milliseconds,o.M=d.months),a=new tt(o),ot(e)&&c(e,"_locale")&&(a._locale=e._locale),a}function ut(e,t){var o=e&&parseFloat(e.replace(",","."));return(isNaN(o)?0:o)*t}function pt(e,t){var o={};return o.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(o.months,"M").isAfter(t)&&--o.months,o.milliseconds=+t-+e.clone().add(o.months,"M"),o}function ht(e,t){var o;return e.isValid()&&t.isValid()?(t=dt(t,e),e.isBefore(t)?o=pt(e,t):(o=pt(t,e),o.milliseconds=-o.milliseconds,o.months=-o.months),o):{milliseconds:0,months:0}}function gt(e,t){return function(o,n){var i,a;return null===n||isNaN(+n)||(O(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=o,o=n,n=a),o="string"==typeof o?+o:o,i=ct(o,n),mt(this,i,e),this}}function mt(e,t,n,i){var a=t._milliseconds,d=nt(t._days),s=nt(t._months);e.isValid()&&(i=null==i||i,s&&de(e,J(e,"Month")+s*n),d&&ee(e,"Date",J(e,"Date")+d*n),a&&e._d.setTime(e._d.valueOf()+a*n),i&&o.updateOffset(e,d||s))}function yt(e,t){var o=12*(t.year()-e.year())+(t.month()-e.month()),n=e.clone().add(o,"months"),i,a;return 0>t-n?(i=e.clone().add(o-1,"months"),a=(t-n)/(n-i)):(i=e.clone().add(o+1,"months"),a=(t-n)/(i-n)),-(o+a)||0}function ft(e){var t;return void 0===e?this._locale._abbr:(t=Ce(e),null!=t&&(this._locale=t),this)}function bt(){return this._locale}function _t(e,t){return(e%t+t)%t}function vt(e,t,o){return 100>e&&0<=e?new Date(e+400,t,o)-12622780800000:new Date(e,t,o).valueOf()}function kt(e,t,o){return 100>e&&0<=e?Date.UTC(e+400,t,o)-12622780800000:Date.UTC(e,t,o)}function wt(e,t){B(0,[e,e.length],0,t)}function xt(e,t,o,n,i){var a;return null==e?he(this,n,i).year:(a=ge(e,n,i),t>a&&(t=a),St.call(this,e,t,o,n,i))}function St(e,t,o,n,i){var a=pe(e,t,o,n,i),d=ce(a.year,0,a.dayOfYear);return this.year(d.getUTCFullYear()),this.month(d.getUTCMonth()),this.date(d.getUTCDate()),this}function Ot(e,t){t[6]=k(1e3*("0."+e))}function Dt(e){return e}function Tt(e,t,o,n){var i=Ce(),a=p().set(n,t);return i[o](a,e)}function Et(e,t,o){if(s(e)&&(t=e,e=void 0),e=e||"",null!=t)return Tt(e,t,o,"month");var n=[],a;for(a=0;12>a;a++)n[a]=Tt(e,a,o,"month");return n}function Ct(e,t,o,n){"boolean"==typeof e?(s(t)&&(o=t,t=void 0),t=t||""):(t=e,o=t,e=!1,s(t)&&(o=t,t=void 0),t=t||"");var a=Ce(),d=e?a._week.dow:0;if(null!=o)return Tt(t,(o+d)%7,n,"day");var r=[],l;for(l=0;7>l;l++)r[l]=Tt(t,(l+d)%7,n,"day");return r}function Mt(e,t,o,n){var i=ct(t,o);return e._milliseconds+=n*i._milliseconds,e._days+=n*i._days,e._months+=n*i._months,e._bubble()}function It(e){return 0>e?Eo(e):xo(e)}function Pt(e){return 4800*e/146097}function Ft(e){return 146097*e/4800}function Nt(e){return function(){return this.as(e)}}function Yt(e){return function(){return this.isValid()?this._data[e]:NaN}}function Rt(e,t,o,n,i){return i.relativeTime(t||1,!!o,e,n)}function zt(e,t,o){var n=ct(e).abs(),i=Pn(n.as("s")),d=Pn(n.as("m")),s=Pn(n.as("h")),r=Pn(n.as("d")),l=Pn(n.as("M")),c=Pn(n.as("y")),u=i<=Fn.ss&&["s",i]||i<Fn.s&&["ss",i]||1>=d&&["m"]||d<Fn.m&&["mm",d]||1>=s&&["h"]||s<Fn.h&&["hh",s]||1>=r&&["d"]||r<Fn.d&&["dd",r]||1>=l&&["M"]||l<Fn.M&&["MM",l]||1>=c&&["y"]||["yy",c];return u[2]=t,u[3]=0<+e,u[4]=o,Rt.apply(null,u)}function Bt(e){return void 0===e?Pn:"function"==typeof e&&(Pn=e,!0)}function Lt(e){return(0<e)-(0>e)||+e}function At(){if(!this.isValid())return this.localeData().invalidDate();var e=Nn(this._milliseconds)/1e3,t=Nn(this._days),o=Nn(this._months),n,i,a;n=v(e/60),i=v(n/60),e%=60,n%=60,a=v(o/12),o%=12;var d=a,r=o,l=t,c=i,u=n,p=e?e.toFixed(3).replace(/\.?0+$/,""):"",s=this.asSeconds();if(!s)return"P0D";var h=0>s?"-":"",g=Lt(this._months)===Lt(s)?"":"-",m=Lt(this._days)===Lt(s)?"":"-",y=Lt(this._milliseconds)===Lt(s)?"":"-";return h+"P"+(d?g+d+"Y":"")+(r?g+r+"M":"")+(l?m+l+"D":"")+(c||u||p?"T":"")+(c?y+c+"H":"")+(u?y+u+"M":"")+(p?y+p+"S":"")}var Ht,jt;jt=Array.prototype.some?Array.prototype.some:function(e){for(var o=Object(this),t=o.length>>>0,n=0;n<t;n++)if((n in o)&&e.call(this,o[n],n,o))return!0;return!1};var Wt=o.momentProperties=[],Ut=!1,Vt={};o.suppressDeprecationWarnings=!1,o.deprecationHandler=null;var Gt=Object.keys?Object.keys:function(e){var t=[],o;for(o in e)c(e,o)&&t.push(o);return t};var qt=/\d{1,2}/,Xt={},Zt={},$t=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Kt=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Qt={},Jt={},eo=/\d/,to=/\d\d/,oo=/\d{3}/,no=/\d{4}/,io=/[+-]?\d{6}/,ao=/\d\d?/,so=/\d\d\d\d?/,ro=/\d\d\d\d\d\d?/,lo=/\d{1,3}/,co=/\d{1,4}/,uo=/[+-]?\d{1,6}/,po=/\d+/,ho=/[+-]?\d+/,go=/Z|[+-]\d\d:?\d\d/gi,mo=/Z|[+-]\d\d(?::?\d\d)?/gi,yo=/[+-]?\d+(\.\d{1,3})?/,fo=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,bo={},_o={},wo=0,Oo=1,Do=2,To=3,Io=4,Po=5;B("Y",0,0,function(){var e=this.year();return 9999>=e?""+e:"+"+e}),B(0,["YY",2],0,function(){return this.year()%100}),B(0,["YYYY",4],0,"year"),B(0,["YYYYY",5],0,"year"),B(0,["YYYYYY",6,!0],0,"year"),P("year","y"),Y("year",1),W("Y",ho),W("YY",ao,to),W("YYYY",co,no),W("YYYYY",uo,io),W("YYYYYY",uo,io),q(["YYYYY","YYYYYY"],wo),q("YYYY",function(e,t){t[wo]=2===e.length?o.parseTwoDigitYear(e):k(e)}),q("YY",function(e,t){t[wo]=o.parseTwoDigitYear(e)}),q("Y",function(e,t){t[wo]=parseInt(e,10)}),o.parseTwoDigitYear=function(e){return k(e)+(68<k(e)?1900:2e3)};var Fo=Q("FullYear",!0),No;No=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},B("M",["MM",2],"Mo",function(){return this.month()+1}),B("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),B("MMMM",0,0,function(e){return this.localeData().months(this,e)}),P("month","M"),Y("month",8),W("M",ao),W("MM",ao,to),W("MMM",function(e,t){return t.monthsShortRegex(e)}),W("MMMM",function(e,t){return t.monthsRegex(e)}),q(["M","MM"],function(e,t){t[Oo]=k(e)-1}),q(["MMM","MMMM"],function(e,t,o,n){var i=o._locale.monthsParse(e,n,o._strict);null==i?g(o).invalidMonth=e:t[Oo]=i});var Yo=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ro=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];B("w",["ww",2],"wo","week"),B("W",["WW",2],"Wo","isoWeek"),P("week","w"),P("isoWeek","W"),Y("week",5),Y("isoWeek",5),W("w",ao),W("ww",ao,to),W("W",ao),W("WW",ao,to),X(["w","ww","W","WW"],function(e,t,o,n){t[n.substr(0,1)]=k(e)});B("d",0,"do","day"),B("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),B("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),B("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),B("e",0,0,"weekday"),B("E",0,0,"isoWeekday"),P("day","d"),P("weekday","e"),P("isoWeekday","E"),Y("day",11),Y("weekday",11),Y("isoWeekday",11),W("d",ao),W("e",ao),W("E",ao),W("dd",function(e,t){return t.weekdaysMinRegex(e)}),W("ddd",function(e,t){return t.weekdaysShortRegex(e)}),W("dddd",function(e,t){return t.weekdaysRegex(e)}),X(["dd","ddd","dddd"],function(e,t,o,n){var i=o._locale.weekdaysParse(e,n,o._strict);null==i?g(o).invalidWeekday=e:t.d=i}),X(["d","e","E"],function(e,t,o,n){t[n]=k(e)});var zo=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];B("H",["HH",2],0,"hour"),B("h",["hh",2],0,ke),B("k",["kk",2],0,function(){return this.hours()||24}),B("hmm",0,0,function(){return""+ke.apply(this)+z(this.minutes(),2)}),B("hmmss",0,0,function(){return""+ke.apply(this)+z(this.minutes(),2)+z(this.seconds(),2)}),B("Hmm",0,0,function(){return""+this.hours()+z(this.minutes(),2)}),B("Hmmss",0,0,function(){return""+this.hours()+z(this.minutes(),2)+z(this.seconds(),2)}),we("a",!0),we("A",!1),P("hour","h"),Y("hour",13),W("a",xe),W("A",xe),W("H",ao),W("h",ao),W("k",ao),W("HH",ao,to),W("hh",ao,to),W("kk",ao,to),W("hmm",so),W("hmmss",ro),W("Hmm",so),W("Hmmss",ro),q(["H","HH"],To),q(["k","kk"],function(e,t){var o=k(e);t[To]=24===o?0:o}),q(["a","A"],function(e,t,o){o._isPm=o._locale.isPM(e),o._meridiem=e}),q(["h","hh"],function(e,t,o){t[To]=k(e),g(o).bigHour=!0}),q("hmm",function(e,t,o){var n=e.length-2;t[To]=k(e.substr(0,n)),t[Io]=k(e.substr(n)),g(o).bigHour=!0}),q("hmmss",function(e,t,o){var n=e.length-4,i=e.length-2;t[To]=k(e.substr(0,n)),t[Io]=k(e.substr(n,2)),t[Po]=k(e.substr(i)),g(o).bigHour=!0}),q("Hmm",function(e,t){var o=e.length-2;t[To]=k(e.substr(0,o)),t[Io]=k(e.substr(o))}),q("Hmmss",function(e,t){var o=e.length-4,n=e.length-2;t[To]=k(e.substr(0,o)),t[Io]=k(e.substr(o,2)),t[Po]=k(e.substr(n))});var Bo=/[ap]\.?m?\.?/i,Lo=Q("Hours",!0),Ao={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:qt,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:Ro,week:{dow:0,doy:6},weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekdaysShort:zo,meridiemParse:Bo},Ho={},jo={},Wo=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Uo=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Vo=/Z|[+-]\d\d(?::?\d\d)?/,Go=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],qo=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Xo=/^\/?Date\((\-?\d+)/i,Zo=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,$o={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480},Ko;o.createFromInputFallback=S("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),o.ISO_8601=function(){},o.RFC_2822=function(){};var Qo=S("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Qe.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:y()}),Jo=S("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Qe.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:y()}),en=["year","quarter","month","week","day","hour","minute","second","millisecond"];it("Z",":"),it("ZZ",""),W("Z",mo),W("ZZ",mo),q(["Z","ZZ"],function(e,t,o){o._useUTC=!0,o._tzm=at(mo,e)});var tn=/([\+\-]|\d\d)/gi;o.updateOffset=function(){};var on=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,nn=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;ct.fn=tt.prototype,ct.invalid=function(){return ct(NaN)};var an=gt(1,"add"),dn=gt(-1,"subtract");o.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",o.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var sn=S("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});B(0,["gg",2],0,function(){return this.weekYear()%100}),B(0,["GG",2],0,function(){return this.isoWeekYear()%100}),wt("gggg","weekYear"),wt("ggggg","weekYear"),wt("GGGG","isoWeekYear"),wt("GGGGG","isoWeekYear"),P("weekYear","gg"),P("isoWeekYear","GG"),Y("weekYear",1),Y("isoWeekYear",1),W("G",ho),W("g",ho),W("GG",ao,to),W("gg",ao,to),W("GGGG",co,no),W("gggg",co,no),W("GGGGG",uo,io),W("ggggg",uo,io),X(["gggg","ggggg","GGGG","GGGGG"],function(e,t,o,n){t[n.substr(0,2)]=k(e)}),X(["gg","GG"],function(e,t,n,i){t[i]=o.parseTwoDigitYear(e)}),B("Q",0,"Qo","quarter"),P("quarter","Q"),Y("quarter",7),W("Q",eo),q("Q",function(e,t){t[Oo]=3*(k(e)-1)}),B("D",["DD",2],"Do","date"),P("date","D"),Y("date",9),W("D",ao),W("DD",ao,to),W("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),q(["D","DD"],Do),q("Do",function(e,t){t[Do]=k(e.match(ao)[0])});var rn=Q("Date",!0);B("DDD",["DDDD",3],"DDDo","dayOfYear"),P("dayOfYear","DDD"),Y("dayOfYear",4),W("DDD",lo),W("DDDD",oo),q(["DDD","DDDD"],function(e,t,o){o._dayOfYear=k(e)}),B("m",["mm",2],0,"minute"),P("minute","m"),Y("minute",14),W("m",ao),W("mm",ao,to),q(["m","mm"],Io);var ln=Q("Minutes",!1);B("s",["ss",2],0,"second"),P("second","s"),Y("second",15),W("s",ao),W("ss",ao,to),q(["s","ss"],Po);var cn=Q("Seconds",!1);B("S",0,0,function(){return~~(this.millisecond()/100)}),B(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),B(0,["SSS",3],0,"millisecond"),B(0,["SSSS",4],0,function(){return 10*this.millisecond()}),B(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),B(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),B(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),B(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),B(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),P("millisecond","ms"),Y("millisecond",16),W("S",lo,eo),W("SS",lo,to),W("SSS",lo,oo);var un;for(un="SSSS";9>=un.length;un+="S")W(un,po);for(un="S";9>=un.length;un+="S")q(un,Ot);var pn=Q("Milliseconds",!1);B("z",0,0,"zoneAbbr"),B("zz",0,0,"zoneName");var hn=b.prototype;hn.add=an,hn.calendar=function(e,t){var n=e||Qe(),i=dt(n,this).startOf("day"),a=o.calendarFormat(this,i)||"sameElse",d=t&&(D(t[a])?t[a].call(this,n):t[a]);return this.format(d||this.localeData().calendar(a,this,Qe(n)))},hn.clone=function(){return new b(this)},hn.diff=function(e,t,o){var n,i,a;return this.isValid()?(n=dt(e,this),!n.isValid())?NaN:(i=6e4*(n.utcOffset()-this.utcOffset()),t=F(t),(a="year"===t?yt(this,n)/12:"month"===t?yt(this,n):"quarter"===t?yt(this,n)/3:"second"===t?(this-n)/1e3:"minute"===t?(this-n)/6e4:"hour"===t?(this-n)/36e5:"day"===t?(this-n-i)/864e5:"week"===t?(this-n-i)/6048e5:this-n,o?a:v(a))):NaN},hn.endOf=function(e){var t;if(e=F(e),void 0===e||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?kt:vt;return"year"===e?t=n(this.year()+1,0,1)-1:"quarter"===e?t=n(this.year(),this.month()-this.month()%3+3,1)-1:"month"===e?t=n(this.year(),this.month()+1,1)-1:"week"===e?t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1:"isoWeek"===e?t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1:"day"===e||"date"===e?t=n(this.year(),this.month(),this.date()+1)-1:"hour"===e?(t=this._d.valueOf(),t+=3600000-_t(t+(this._isUTC?0:60000*this.utcOffset()),3600000)-1):"minute"===e?(t=this._d.valueOf(),t+=60000-_t(t,60000)-1):"second"===e?(t=this._d.valueOf(),t+=1000-_t(t,1000)-1):void 0,this._d.setTime(t),o.updateOffset(this,!0),this},hn.format=function(e){e||(e=this.isUtc()?o.defaultFormatUtc:o.defaultFormat);var t=H(this,e);return this.localeData().postformat(t)},hn.from=function(e,t){return this.isValid()&&(_(e)&&e.isValid()||Qe(e).isValid())?ct({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},hn.fromNow=function(e){return this.from(Qe(),e)},hn.to=function(e,t){return this.isValid()&&(_(e)&&e.isValid()||Qe(e).isValid())?ct({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},hn.toNow=function(e){return this.to(Qe(),e)},hn.get=function(e){return e=F(e),D(this[e])?this[e]():this},hn.invalidAt=function(){return g(this).overflow},hn.isAfter=function(e,t){var o=_(e)?e:Qe(e);return!!(this.isValid()&&o.isValid())&&(t=F(t)||"millisecond","millisecond"===t?this.valueOf()>o.valueOf():o.valueOf()<this.clone().startOf(t).valueOf())},hn.isBefore=function(e,t){var o=_(e)?e:Qe(e);return!!(this.isValid()&&o.isValid())&&(t=F(t)||"millisecond","millisecond"===t?this.valueOf()<o.valueOf():this.clone().endOf(t).valueOf()<o.valueOf())},hn.isBetween=function(e,t,o,n){var i=_(e)?e:Qe(e),a=_(t)?t:Qe(t);return!!(this.isValid()&&i.isValid()&&a.isValid())&&(n=n||"()",("("===n[0]?this.isAfter(i,o):!this.isBefore(i,o))&&(")"===n[1]?this.isBefore(a,o):!this.isAfter(a,o)))},hn.isSame=function(e,t){var o=_(e)?e:Qe(e),n;return!!(this.isValid()&&o.isValid())&&(t=F(t)||"millisecond","millisecond"===t?this.valueOf()===o.valueOf():(n=o.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},hn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},hn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},hn.isValid=function(){return m(this)},hn.lang=sn,hn.locale=ft,hn.localeData=bt,hn.max=Jo,hn.min=Qo,hn.parsingFlags=function(){return u({},g(this))},hn.set=te,hn.startOf=function(e){var t;if(e=F(e),void 0===e||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?kt:vt;return"year"===e?t=n(this.year(),0,1):"quarter"===e?t=n(this.year(),this.month()-this.month()%3,1):"month"===e?t=n(this.year(),this.month(),1):"week"===e?t=n(this.year(),this.month(),this.date()-this.weekday()):"isoWeek"===e?t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)):"day"===e||"date"===e?t=n(this.year(),this.month(),this.date()):"hour"===e?(t=this._d.valueOf(),t-=_t(t+(this._isUTC?0:60000*this.utcOffset()),3600000)):"minute"===e?(t=this._d.valueOf(),t-=_t(t,60000)):"second"===e?(t=this._d.valueOf(),t-=_t(t,1000)):void 0,this._d.setTime(t),o.updateOffset(this,!0),this},hn.subtract=dn,hn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},hn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},hn.toDate=function(){return new Date(this.valueOf())},hn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,o=t?this.clone().utc():this;return 0>o.year()||9999<o.year()?H(o,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):D(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+1e3*(60*this.utcOffset())).toISOString().replace("Z",H(o,"Z")):H(o,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},hn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var o="["+e+"(\"]",n=0<=this.year()&&9999>=this.year()?"YYYY":"YYYYYY",i=t+"[\")]";return this.format(o+n+"-MM-DD[T]HH:mm:ss.SSS"+i)},hn.toJSON=function(){return this.isValid()?this.toISOString():null},hn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},hn.unix=function(){return Eo(this.valueOf()/1e3)},hn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},hn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},hn.year=Fo,hn.isLeapYear=function(){return K(this.year())},hn.weekYear=function(e){return xt.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},hn.isoWeekYear=function(e){return xt.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},hn.quarter=hn.quarters=function(e){return null==e?xo((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},hn.month=se,hn.daysInMonth=function(){return ne(this.year(),this.month())},hn.week=hn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},hn.isoWeek=hn.isoWeeks=function(e){var t=he(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},hn.weeksInYear=function(){var e=this.localeData()._week;return ge(this.year(),e.dow,e.doy)},hn.isoWeeksInYear=function(){return ge(this.year(),1,4)},hn.date=rn,hn.day=hn.days=function(e){if(!this.isValid())return null==e?NaN:this;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null==e?t:(e=me(e,this.localeData()),this.add(e-t,"d"))},hn.weekday=function(e){if(!this.isValid())return null==e?NaN:this;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},hn.isoWeekday=function(e){if(!this.isValid())return null==e?NaN:this;if(null!=e){var t=ye(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},hn.dayOfYear=function(e){var t=vo((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},hn.hour=hn.hours=Lo,hn.minute=hn.minutes=ln,hn.second=hn.seconds=cn,hn.millisecond=hn.milliseconds=pn,hn.utcOffset=function(e,t,n){var i=this._offset||0,a;if(!this.isValid())return null==e?NaN:this;if(null!=e){if("string"!=typeof e)16>So(e)&&!n&&(e*=60);else if(e=at(mo,e),null===e)return this;return!this._isUTC&&t&&(a=st(this)),this._offset=e,this._isUTC=!0,null!=a&&this.add(a,"m"),i!==e&&(!t||this._changeInProgress?mt(this,ct(e-i,"m"),1,!1):!this._changeInProgress&&(this._changeInProgress=!0,o.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:st(this)},hn.utc=function(e){return this.utcOffset(0,e)},hn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(st(this),"m")),this},hn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=at(go,this._i);null==e?this.utcOffset(0,!0):this.utcOffset(e)}return this},hn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Qe(e).utcOffset():0,0==(this.utcOffset()-e)%60)},hn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},hn.isLocal=function(){return!!this.isValid()&&!this._isUTC},hn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},hn.isUtc=lt,hn.isUTC=lt,hn.zoneAbbr=function(){return this._isUTC?"UTC":""},hn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},hn.dates=S("dates accessor is deprecated. Use date instead.",rn),hn.months=S("months accessor is deprecated. Use month instead",se),hn.years=S("years accessor is deprecated. Use year instead",Fo),hn.zone=S("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null==e?-this.utcOffset():("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this)}),hn.isDSTShifted=S("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",rt);var gn=C.prototype;gn.calendar=M,gn.longDateFormat=I,gn.invalidDate=function(){return this._invalidDate},gn.ordinal=function(e){return this._ordinal.replace("%d",e)},gn.preparse=Dt,gn.postformat=Dt,gn.relativeTime=function(e,t,o,n){var i=this._relativeTime[o];return D(i)?i(e,t,o,n):i.replace(/%d/i,e)},gn.pastFuture=function(e,t){var o=this._relativeTime[0<e?"future":"past"];return D(o)?o(t):o.replace(/%s/i,t)},gn.set=T,gn.months=function(e,t){return e?n(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Yo).test(t)?"format":"standalone"][e.month()]:n(this._months)?this._months:this._months.standalone},gn.monthsShort=function(e,t){return e?n(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Yo.test(t)?"format":"standalone"][e.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},gn.monthsParse=ae,gn.monthsRegex=function(e){return this._monthsParseExact?(c(this,"_monthsRegex")||re.call(this),e?this._monthsStrictRegex:this._monthsRegex):(c(this,"_monthsRegex")||(this._monthsRegex=fo),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},gn.monthsShortRegex=function(e){return this._monthsParseExact?(c(this,"_monthsRegex")||re.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(c(this,"_monthsShortRegex")||(this._monthsShortRegex=fo),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},gn.week=function(e){return he(e,this._week.dow,this._week.doy).week},gn.firstDayOfYear=function(){return this._week.doy},gn.firstDayOfWeek=function(){return this._week.dow},gn.weekdays=function(e,t){var o=n(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?fe(o,this._week.dow):e?o[e.day()]:o},gn.weekdaysMin=function(e){return!0===e?fe(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},gn.weekdaysShort=function(e){return!0===e?fe(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},gn.weekdaysParse=_e,gn.weekdaysRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||ve.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(c(this,"_weekdaysRegex")||(this._weekdaysRegex=fo),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},gn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||ve.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(c(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=fo),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},gn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||ve.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(c(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=fo),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},gn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},gn.meridiem=function(e,t,o){return 11<e?o?"pm":"PM":o?"am":"AM"},Te("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,o=1===k(e%100/10)?"th":1==t?"st":2==t?"nd":3==t?"rd":"th";return e+o}}),o.lang=S("moment.lang is deprecated. Use moment.locale instead.",Te),o.langData=S("moment.langData is deprecated. Use moment.localeData instead.",Ce);var mn=So,yn=Nt("ms"),fn=Nt("s"),bn=Nt("m"),_n=Nt("h"),vn=Nt("d"),kn=Nt("w"),wn=Nt("M"),xn=Nt("Q"),Sn=Nt("y"),On=Yt("milliseconds"),Dn=Yt("seconds"),Tn=Yt("minutes"),En=Yt("hours"),Cn=Yt("days"),Mn=Yt("months"),In=Yt("years"),Pn=vo,Fn={ss:44,s:45,m:45,h:22,d:26,M:11},Nn=So,Yn=tt.prototype;return Yn.isValid=function(){return this._isValid},Yn.abs=function(){var e=this._data;return this._milliseconds=mn(this._milliseconds),this._days=mn(this._days),this._months=mn(this._months),e.milliseconds=mn(e.milliseconds),e.seconds=mn(e.seconds),e.minutes=mn(e.minutes),e.hours=mn(e.hours),e.months=mn(e.months),e.years=mn(e.years),this},Yn.add=function(e,t){return Mt(this,e,t,1)},Yn.subtract=function(e,t){return Mt(this,e,t,-1)},Yn.as=function(e){if(!this.isValid())return NaN;var t=this._milliseconds,o,n;if(e=F(e),"month"===e||"quarter"===e||"year"===e)switch(o=this._days+t/864e5,n=this._months+Pt(o),e){case"month":return n;case"quarter":return n/3;case"year":return n/12;}else switch(o=this._days+vo(Ft(this._months)),e){case"week":return o/7+t/6048e5;case"day":return o+t/864e5;case"hour":return 24*o+t/36e5;case"minute":return 1440*o+t/6e4;case"second":return 86400*o+t/1e3;case"millisecond":return Eo(864e5*o)+t;default:throw new Error("Unknown unit "+e);}},Yn.asMilliseconds=yn,Yn.asSeconds=fn,Yn.asMinutes=bn,Yn.asHours=_n,Yn.asDays=vn,Yn.asWeeks=kn,Yn.asMonths=wn,Yn.asQuarters=xn,Yn.asYears=Sn,Yn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+2592e6*(this._months%12)+31536e6*k(this._months/12):NaN},Yn._bubble=function(){var e=this._milliseconds,t=this._days,o=this._months,n=this._data,i,a,d,s,r;return 0<=e&&0<=t&&0<=o||0>=e&&0>=t&&0>=o||(e+=864e5*It(Ft(o)+t),t=0,o=0),n.milliseconds=e%1e3,i=v(e/1e3),n.seconds=i%60,a=v(i/60),n.minutes=a%60,d=v(a/60),n.hours=d%24,t+=v(d/24),r=v(Pt(t)),o+=r,t-=It(Ft(r)),s=v(o/12),o%=12,n.days=t,n.months=o,n.years=s,this},Yn.clone=function(){return ct(this)},Yn.get=function(e){return e=F(e),this.isValid()?this[e+"s"]():NaN},Yn.milliseconds=On,Yn.seconds=Dn,Yn.minutes=Tn,Yn.hours=En,Yn.days=Cn,Yn.weeks=function(){return v(this.days()/7)},Yn.months=Mn,Yn.years=In,Yn.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),o=zt(this,!e,t);return e&&(o=t.pastFuture(+this,o)),t.postformat(o)},Yn.toISOString=At,Yn.toString=At,Yn.toJSON=At,Yn.locale=ft,Yn.localeData=bt,Yn.toIsoString=S("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",At),Yn.lang=sn,B("X",0,0,"unix"),B("x",0,0,"valueOf"),W("x",ho),W("X",yo),q("X",function(e,t,o){o._d=new Date(1e3*parseFloat(e,10))}),q("x",function(e,t,o){o._d=new Date(k(e))}),o.version="2.24.0",function(e){Ht=e}(Qe),o.fn=hn,o.min=function(){var e=[].slice.call(arguments,0);return Je("isBefore",e)},o.max=function(){var e=[].slice.call(arguments,0);return Je("isAfter",e)},o.now=function(){return Date.now?Date.now():+new Date},o.utc=p,o.unix=function(e){return Qe(1e3*e)},o.months=function(e,t){return Et(e,t,"months")},o.isDate=r,o.locale=Te,o.invalid=y,o.duration=ct,o.isMoment=_,o.weekdays=function(e,t,o){return Ct(e,t,o,"weekdays")},o.parseZone=function(){return Qe.apply(null,arguments).parseZone()},o.localeData=Ce,o.isDuration=ot,o.monthsShort=function(e,t){return Et(e,t,"monthsShort")},o.weekdaysMin=function(e,t,o){return Ct(e,t,o,"weekdaysMin")},o.defineLocale=Ee,o.updateLocale=function(e,t){if(null!=t){var o=Ao,n,i;i=De(e),null!=i&&(o=i._config),t=E(o,t),n=new C(t),n.parentLocale=Ho[e],Ho[e]=n,Te(e)}else null!=Ho[e]&&(null==Ho[e].parentLocale?null!=Ho[e]&&delete Ho[e]:Ho[e]=Ho[e].parentLocale);return Ho[e]},o.locales=Me,o.weekdaysShort=function(e,t,o){return Ct(e,t,o,"weekdaysShort")},o.normalizeUnits=F,o.relativeTimeRounding=Bt,o.relativeTimeThreshold=function(e,t){return void 0!==Fn[e]&&(void 0===t?Fn[e]:(Fn[e]=t,"s"===e&&(Fn.ss=t-1),!0))},o.calendarFormat=function(e,t){var o=e.diff(t,"days",!0);return-6>o?"sameElse":-1>o?"lastWeek":0>o?"lastDay":1>o?"sameDay":2>o?"nextDay":7>o?"nextWeek":"sameElse"},o.prototype=hn,o.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},o})}),Od=[],Dd=0;256>Dd;Dd++)Od[Dd]=(Dd+256).toString(16).substr(1);for(var Td=function(){if("undefined"!=typeof crypto&&crypto.getRandomValues){var e=new Uint8Array(16);return function(){return crypto.getRandomValues(e),e}}var t=Array(16);return function(){for(var e=0,o;16>e;e++)0==(3&e)&&(o=4294967296*Math.random()),t[e]=255&o>>>((3&e)<<3);return t}}(),Ed=[],Cd=0;256>Cd;Cd++)Ed[Cd]=(Cd+256).toString(16).substr(1);for(var Md=Td(),Id=[1|Md[0],Md[1],Md[2],Md[3],Md[4],Md[5]],Pd=16383&(Md[6]<<8|Md[7]),Fd=/^\/?Date\((-?\d+)/i,Nd=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Yd=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Rd=/^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i,zd=/^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i,Bd=Object.assign,Ld=Object.values,Ad={asBoolean:function(e,t){return"function"==typeof e&&(e=e()),null==e?t||null:!1!=e},asNumber:function(e,t){return"function"==typeof e&&(e=e()),null==e?t||null:+e||t||null},asString:function(e,t){return"function"==typeof e&&(e=e()),null==e?t||null:e+""},asSize:function(e,t){return"function"==typeof e&&(e=e()),f(e)?e:m(e)?e+"px":t||null},asElement:function(e,t){return"function"==typeof e&&(e=e()),e||t||null}},Hd={split:function(e){var t={};return e.split(";").forEach(function(e){if(""!=e.trim()){var o=e.split(":"),n=o[0].trim(),i=o[1].trim();t[n]=i}}),t},join:function(e){return Object.keys(e).map(function(t){return t+": "+e[t]}).join("; ")}},jd={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return .5>e?2*e*e:-1+(4-2*e)*e},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return .5>e?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return .5>e?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return .5>e?16*e*e*e*e*e:1+16*--e*e*e*e*e}},Wd=Object.freeze({isNumber:m,recursiveDOMDelete:y,isString:f,isObject:_,isDate:v,isMoment:w,fillIfDefined:S,extend:Bd,selectiveExtend:O,selectiveDeepExtend:D,selectiveNotDeepExtend:T,deepExtend:E,equalArray:C,convert:M,getType:I,copyAndExtendArray:P,copyArray:F,getAbsoluteLeft:N,getAbsoluteRight:Y,getAbsoluteTop:R,addClassName:z,removeClassName:B,forEach:L,toArray:Ld,updateProperty:A,throttle:H,addEventListener:W,removeEventListener:U,preventDefault:V,getTarget:G,hasParent:q,option:Ad,hexToRGB:X,overrideOpacity:Z,RGBToHex:$,parseColor:K,RGBToHSV:Q,addCssText:J,removeCssText:ee,HSVToRGB:te,HSVToHex:oe,hexToHSV:ne,isValidHex:ie,isValidRGB:ae,isValidRGBA:de,selectiveBridgeObject:se,bridgeObject:re,insertSort:le,mergeOptions:ce,binarySearchCustom:ue,binarySearchValue:pe,easingFunctions:jd,getScrollBarWidth:he,topMost:ge,randomUUID:g}),Ud=Object.freeze({default:Wd,HSVToHex:oe,HSVToRGB:te,RGBToHSV:Q,RGBToHex:$,addClassName:z,addCssText:J,addEventListener:W,binarySearchCustom:ue,binarySearchValue:pe,bridgeObject:re,convert:M,copyAndExtendArray:P,copyArray:F,deepExtend:E,easingFunctions:jd,equalArray:C,extend:Bd,fillIfDefined:S,forEach:L,getAbsoluteLeft:N,getAbsoluteRight:Y,getAbsoluteTop:R,getScrollBarWidth:he,getTarget:G,getType:I,hasParent:q,hexToHSV:ne,hexToRGB:X,insertSort:le,isDate:v,isMoment:w,isNumber:m,isObject:_,isString:f,isValidHex:ie,isValidRGB:ae,isValidRGBA:de,mergeOptions:ce,option:Ad,overrideOpacity:Z,parseColor:K,preventDefault:V,randomUUID:g,recursiveDOMDelete:y,removeClassName:B,removeCssText:ee,removeEventListener:U,selectiveBridgeObject:se,selectiveDeepExtend:D,selectiveExtend:O,selectiveNotDeepExtend:T,throttle:H,toArray:Ld,topMost:ge,updateProperty:A}),Vd=me,Gd=ye(function(e){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function o(n){return e.exports="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?o=function(e){return t(e)}:o=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":t(e)},o(n)}e.exports=o}),qd=fe,Xd=_e,Zd=ve,$d=ke,Kd=ye(function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(n)}e.exports=t}),Qd=ye(function(e){function t(n,o){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(n,o)}e.exports=t}),Jd=we,es=[],ts=0;256>ts;ts++)es[ts]=(ts+256).toString(16).substr(1);for(var os=function(){if("undefined"!=typeof crypto&&crypto.getRandomValues){var e=new Uint8Array(16);return function(){return crypto.getRandomValues(e),e}}var t=Array(16);return function(){for(var e=0,o;16>e;e++)0==(3&e)&&(o=4294967296*Math.random()),t[e]=255&o>>>((3&e)<<3);return t}}(),ns=[],is=0;256>is;is++)ns[is]=(is+256).toString(16).substr(1);for(var as=os(),ds=[1|as[0],as[1],as[2],as[3],as[4],as[5]],ss=16383&(as[6]<<8|as[7]),rs="undefined"==typeof globalThis?"undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?{}:self:global:window:globalThis,ls=Te(function(e){(function(t,o){e.exports=o()})(rs,function(){function t(){return Ht.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function n(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function i(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function a(e){return void 0===e}function d(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function s(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function r(e,t){var o=[],n;for(n=0;n<e.length;++n)o.push(t(e[n],n));return o}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){for(var o in t)l(t,o)&&(e[o]=t[o]);return l(t,"toString")&&(e.toString=t.toString),l(t,"valueOf")&&(e.valueOf=t.valueOf),e}function u(e,t,o,n){return Ke(e,t,o,n,!0).utc()}function p(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function h(e){return null==e._pf&&(e._pf=p()),e._pf}function g(e){if(null==e._isValid){var t=h(e),o=jt.call(t.parsedDateParts,function(e){return null!=e}),n=!isNaN(e._d.getTime())&&0>t.overflow&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&o);if(e._strict&&(n=n&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null==Object.isFrozen||!Object.isFrozen(e))e._isValid=n;else return n}return e._isValid}function m(e){var t=u(NaN);return null==e?h(t).userInvalidated=!0:c(h(t),e),t}function y(e,t){var o,n,d;if(a(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),a(t._i)||(e._i=t._i),a(t._f)||(e._f=t._f),a(t._l)||(e._l=t._l),a(t._strict)||(e._strict=t._strict),a(t._tzm)||(e._tzm=t._tzm),a(t._isUTC)||(e._isUTC=t._isUTC),a(t._offset)||(e._offset=t._offset),a(t._pf)||(e._pf=h(t)),a(t._locale)||(e._locale=t._locale),0<Wt.length)for(o=0;o<Wt.length;o++)n=Wt[o],d=t[n],a(d)||(e[n]=d);return e}function f(e){y(this,e),this._d=new Date(null==e._d?NaN:e._d.getTime()),this.isValid()||(this._d=new Date(NaN)),!1===Ut&&(Ut=!0,t.updateOffset(this),Ut=!1)}function b(e){return e instanceof f||null!=e&&null!=e._isAMomentObject}function _(e){return 0>e?xo(e)||0:Eo(e)}function v(e){var t=+e,o=0;return 0!=t&&isFinite(t)&&(o=_(t)),o}function k(e,t,o){var n=Mo(e.length,t.length),a=So(e.length-t.length),d=0,s;for(s=0;s<n;s++)(o&&e[s]!==t[s]||!o&&v(e[s])!==v(t[s]))&&d++;return d+a}function w(e){!1===t.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function x(e,o){var n=!0;return c(function(){if(null!=t.deprecationHandler&&t.deprecationHandler(null,e),n){for(var a=[],d=0,s;d<arguments.length;d++){if(s="","object"==typeof arguments[d]){for(var r in s+="\n["+d+"] ",arguments[0])s+=r+": "+arguments[0][r]+", ";s=s.slice(0,-2)}else s=arguments[d];a.push(s)}w(e+"\nArguments: "+Array.prototype.slice.call(a).join("")+"\n"+new Error().stack),n=!1}return o.apply(this,arguments)},o)}function S(e,o){null!=t.deprecationHandler&&t.deprecationHandler(e,o),Vt[e]||(w(o),Vt[e]=!0)}function O(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function D(e){var t,o;for(o in e)t=e[o],O(t)?this[o]=t:this["_"+o]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function T(e,t){var o=c({},e),i;for(i in t)l(t,i)&&(n(e[i])&&n(t[i])?(o[i]={},c(o[i],e[i]),c(o[i],t[i])):null==t[i]?delete o[i]:o[i]=t[i]);for(i in e)l(e,i)&&!l(t,i)&&n(e[i])&&(o[i]=c({},o[i]));return o}function E(e){null!=e&&this.set(e)}function C(e,t,o){var n=this._calendar[e]||this._calendar.sameElse;return O(n)?n.call(t,o):n}function M(e){var t=this._longDateFormat[e],o=this._longDateFormat[e.toUpperCase()];return t||!o?t:(this._longDateFormat[e]=o.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])}function I(e,t){var o=e.toLowerCase();Xt[o]=Xt[o+"s"]=Xt[t]=e}function P(e){return"string"==typeof e?Xt[e]||Xt[e.toLowerCase()]:void 0}function F(e){var t={},o,n;for(n in e)l(e,n)&&(o=P(n),o&&(t[o]=e[n]));return t}function N(e,t){Zt[e]=t}function Y(e){var t=[];for(var o in e)t.push({unit:o,priority:Zt[o]});return t.sort(function(e,t){return e.priority-t.priority}),t}function R(e,t,o){var n=""+So(e),i=t-n.length;return(0<=e?o?"+":"":"-")+ko(10,Co(0,i)).toString().substr(1)+n}function z(e,t,o,n){var i=n;"string"==typeof n&&(i=function(){return this[n]()}),e&&(Jt[e]=i),t&&(Jt[t[0]]=function(){return R(i.apply(this,arguments),t[1],t[2])}),o&&(Jt[o]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function B(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function L(e){var t=e.match($t),o,n;for(o=0,n=t.length;o<n;o++)t[o]=Jt[t[o]]?Jt[t[o]]:B(t[o]);return function(o){var a="",d;for(d=0;d<n;d++)a+=O(t[d])?t[d].call(o,e):t[d];return a}}function A(e,t){return e.isValid()?(t=H(t,e.localeData()),Qt[t]=Qt[t]||L(t),Qt[t](e)):e.localeData().invalidDate()}function H(e,t){function o(e){return t.longDateFormat(e)||e}var n=5;for(Kt.lastIndex=0;0<=n&&Kt.test(e);)e=e.replace(Kt,o),Kt.lastIndex=0,n-=1;return e}function j(e,t,o){bo[e]=O(t)?t:function(e){return e&&o?o:t}}function W(e,t){return l(bo,e)?bo[e](t._strict,t._locale):new RegExp(U(e))}function U(e){return V(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,o,n,i){return t||o||n||i}))}function V(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function G(e,t){var o=t,n;for("string"==typeof e&&(e=[e]),d(t)&&(o=function(e,o){o[t]=v(e)}),n=0;n<e.length;n++)_o[e[n]]=o}function q(e,t){G(e,function(e,o,n,i){n._w=n._w||{},t(e,n._w,n,i)})}function X(e,t,o){null!=t&&l(_o,e)&&_o[e](t,o._a,o,e)}function Z(e){return $(e)?366:365}function $(e){return 0==e%4&&0!=e%100||0==e%400}function K(e,o){return function(n){return null==n?Q(this,e):(J(this,e,n),t.updateOffset(this,o),this)}}function Q(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function J(e,t,o){e.isValid()&&!isNaN(o)&&("FullYear"===t&&$(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](o,e.month(),oe(o,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](o))}function ee(e,t){if("object"==typeof e){e=F(e);for(var o=Y(e),n=0;n<o.length;n++)this[o[n].unit](e[o[n].unit])}else if(e=P(e),O(this[e]))return this[e](t);return this}function te(e,t){return(e%t+t)%t}function oe(e,t){if(isNaN(e)||isNaN(t))return NaN;var o=te(t,12);return e+=(t-o)/12,1===o?$(e)?29:28:31-o%7%2}function ne(e,t,o){var n=e.toLocaleLowerCase(),a,d,s;if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],a=0;12>a;++a)s=u([2e3,a]),this._shortMonthsParse[a]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[a]=this.months(s,"").toLocaleLowerCase();return o?"MMM"===t?(d=No.call(this._shortMonthsParse,n),-1===d?null:d):(d=No.call(this._longMonthsParse,n),-1===d?null:d):"MMM"===t?(d=No.call(this._shortMonthsParse,n),-1!==d)?d:(d=No.call(this._longMonthsParse,n),-1===d?null:d):(d=No.call(this._longMonthsParse,n),-1!==d)?d:(d=No.call(this._shortMonthsParse,n),-1===d?null:d)}function ie(e,t,o){var n,a,d;if(this._monthsParseExact)return ne.call(this,e,t,o);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;12>n;n++){if(a=u([2e3,n]),o&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),o||this._monthsParse[n]||(d="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[n]=new RegExp(d.replace(".",""),"i")),o&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(o&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!o&&this._monthsParse[n].test(e))return n}}function ae(e,t){var o;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=v(t);else if(t=e.localeData().monthsParse(t),!d(t))return e;return o=Mo(e.date(),oe(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,o),e}function de(e){return null==e?Q(this,"Month"):(ae(this,e),t.updateOffset(this,!0),this)}function se(){function e(e,t){return t.length-e.length}var t=[],o=[],n=[],a,d;for(a=0;12>a;a++)d=u([2e3,a]),t.push(this.monthsShort(d,"")),o.push(this.months(d,"")),n.push(this.months(d,"")),n.push(this.monthsShort(d,""));for(t.sort(e),o.sort(e),n.sort(e),a=0;12>a;a++)t[a]=V(t[a]),o[a]=V(o[a]);for(a=0;24>a;a++)n[a]=V(n[a]);this._monthsRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function re(e,t,o,n,i,a,d){var s;return 100>e&&0<=e?(s=new Date(e+400,t,o,n,i,a,d),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,o,n,i,a,d),s}function le(e){var t;if(100>e&&0<=e){var o=Array.prototype.slice.call(arguments);o[0]=e+400,t=new Date(Date.UTC.apply(null,o)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)}else t=new Date(Date.UTC.apply(null,arguments));return t}function ce(e,t,o){var n=7+t-o,i=(7+le(e,0,n).getUTCDay()-t)%7;return-i+n-1}function ue(e,t,o,n,i){var a=ce(e,n,i),d=1+7*(t-1)+(7+o-n)%7+a,s,r;return 0>=d?(s=e-1,r=Z(s)+d):d>Z(e)?(s=e+1,r=d-Z(e)):(s=e,r=d),{year:s,dayOfYear:r}}function pe(e,t,o){var n=ce(e.year(),t,o),i=Eo((e.dayOfYear()-n-1)/7)+1,a,d;return 1>i?(d=e.year()-1,a=i+he(d,t,o)):i>he(e.year(),t,o)?(a=i-he(e.year(),t,o),d=e.year()+1):(d=e.year(),a=i),{week:a,year:d}}function he(e,t,o){var n=ce(e,t,o),i=ce(e+1,t,o);return(Z(e)-n+i)/7}function ge(e,t){return"string"==typeof e?isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10):e}function me(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function ye(e,t){return e.slice(t,7).concat(e.slice(0,t))}function fe(e,t,o){var n=e.toLocaleLowerCase(),a,d,s;if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],a=0;7>a;++a)s=u([2e3,1]).day(a),this._minWeekdaysParse[a]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[a]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[a]=this.weekdays(s,"").toLocaleLowerCase();return o?"dddd"===t?(d=No.call(this._weekdaysParse,n),-1===d?null:d):"ddd"===t?(d=No.call(this._shortWeekdaysParse,n),-1===d?null:d):(d=No.call(this._minWeekdaysParse,n),-1===d?null:d):"dddd"===t?(d=No.call(this._weekdaysParse,n),-1!==d)?d:(d=No.call(this._shortWeekdaysParse,n),-1!==d)?d:(d=No.call(this._minWeekdaysParse,n),-1===d?null:d):"ddd"===t?(d=No.call(this._shortWeekdaysParse,n),-1!==d)?d:(d=No.call(this._weekdaysParse,n),-1!==d)?d:(d=No.call(this._minWeekdaysParse,n),-1===d?null:d):(d=No.call(this._minWeekdaysParse,n),-1!==d)?d:(d=No.call(this._weekdaysParse,n),-1!==d)?d:(d=No.call(this._shortWeekdaysParse,n),-1===d?null:d)}function be(e,t,o){var n,a,d;if(this._weekdaysParseExact)return fe.call(this,e,t,o);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;7>n;n++){if(a=u([2e3,1]).day(n),o&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(d="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[n]=new RegExp(d.replace(".",""),"i")),o&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(o&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(o&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;if(!o&&this._weekdaysParse[n].test(e))return n}}function _e(){function e(e,t){return t.length-e.length}var t=[],o=[],n=[],a=[],d,s,r,l,c;for(d=0;7>d;d++)s=u([2e3,1]).day(d),r=this.weekdaysMin(s,""),l=this.weekdaysShort(s,""),c=this.weekdays(s,""),t.push(r),o.push(l),n.push(c),a.push(r),a.push(l),a.push(c);for(t.sort(e),o.sort(e),n.sort(e),a.sort(e),d=0;7>d;d++)o[d]=V(o[d]),n[d]=V(n[d]),a[d]=V(a[d]);this._weekdaysRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function ve(){return this.hours()%12||12}function ke(e,t){z(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function we(e,t){return t._meridiemParse}function xe(e){return e?e.toLowerCase().replace("_","-"):e}function Se(e){for(var t=0,o,n,a,d;t<e.length;){for(d=xe(e[t]).split("-"),o=d.length,n=xe(e[t+1]),n=n?n.split("-"):null;0<o;){if(a=Oe(d.slice(0,o).join("-")),a)return a;if(n&&n.length>=o&&k(d,n,!0)>=o-1)break;o--}t++}return Ko}function Oe(t){var o=null;if(!Ho[t]&&!0&&e&&e.exports)try{o=Ko._abbr;De("./locale/"+t),Te(o)}catch(t){}return Ho[t]}function Te(e,t){var o;return e&&(o=a(t)?Ce(e):Ee(e,t),o?Ko=o:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Ko._abbr}function Ee(e,t){if(null!==t){var o=Ao,n;if(t.abbr=e,null!=Ho[e])S("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),o=Ho[e]._config;else if(null!=t.parentLocale)if(null!=Ho[t.parentLocale])o=Ho[t.parentLocale]._config;else if(n=Oe(t.parentLocale),null!=n)o=n._config;else return jo[t.parentLocale]||(jo[t.parentLocale]=[]),jo[t.parentLocale].push({name:e,config:t}),null;return Ho[e]=new E(T(o,t)),jo[e]&&jo[e].forEach(function(e){Ee(e.name,e.config)}),Te(e),Ho[e]}return delete Ho[e],null}function Ce(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Ko;if(!o(e)){if(t=Oe(e),t)return t;e=[e]}return Se(e)}function Me(){return Gt(Ho)}function Ie(e){var t=e._a,o;return t&&-2===h(e).overflow&&(o=0>t[1]||11<t[1]?1:1>t[2]||t[2]>oe(t[0],t[1])?2:0>t[3]||24<t[3]||24===t[3]&&(0!==t[4]||0!==t[5]||0!==t[6])?3:0>t[4]||59<t[4]?4:0>t[5]||59<t[5]?5:0>t[6]||999<t[6]?6:-1,h(e)._overflowDayOfYear&&(0>o||2<o)&&(o=2),h(e)._overflowWeeks&&-1===o&&(o=7),h(e)._overflowWeekday&&-1===o&&(o=8),h(e).overflow=o),e}function Pe(e,t,o){return null==e?null==t?o:t:e}function Fe(e){var o=new Date(t.now());return e._useUTC?[o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()]:[o.getFullYear(),o.getMonth(),o.getDate()]}function Ne(e){var t=[],o,n,a,d,s;if(!e._d){for(a=Fe(e),e._w&&null==e._a[2]&&null==e._a[1]&&Ye(e),null!=e._dayOfYear&&(s=Pe(e._a[0],a[0]),(e._dayOfYear>Z(s)||0===e._dayOfYear)&&(h(e)._overflowDayOfYear=!0),n=le(s,0,e._dayOfYear),e._a[1]=n.getUTCMonth(),e._a[2]=n.getUTCDate()),o=0;3>o&&null==e._a[o];++o)e._a[o]=t[o]=a[o];for(;7>o;o++)e._a[o]=t[o]=null==e._a[o]?2===o?1:0:e._a[o];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?le:re).apply(null,t),d=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&"undefined"!=typeof e._w.d&&e._w.d!==d&&(h(e).weekdayMismatch=!0)}}function Ye(e){var t,o,n,i,a,d,s,r;if(t=e._w,null!=t.GG||null!=t.W||null!=t.E)a=1,d=4,o=Pe(t.GG,e._a[0],pe(Qe(),1,4).year),n=Pe(t.W,1),i=Pe(t.E,1),(1>i||7<i)&&(r=!0);else{a=e._locale._week.dow,d=e._locale._week.doy;var l=pe(Qe(),a,d);o=Pe(t.gg,e._a[0],l.year),n=Pe(t.w,l.week),null==t.d?null==t.e?i=a:(i=t.e+a,(0>t.e||6<t.e)&&(r=!0)):(i=t.d,(0>i||6<i)&&(r=!0))}1>n||n>he(o,a,d)?h(e)._overflowWeeks=!0:null==r?(s=ue(o,n,i,a,d),e._a[0]=s.year,e._dayOfYear=s.dayOfYear):h(e)._overflowWeekday=!0}function Re(e){var t=e._i,o=Wo.exec(t)||Uo.exec(t),n,a,d,s,r,c;if(o){for(h(e).iso=!0,n=0,a=Go.length;n<a;n++)if(Go[n][1].exec(o[1])){s=Go[n][0],d=!1!==Go[n][2];break}if(null==s)return void(e._isValid=!1);if(o[3]){for(n=0,a=qo.length;n<a;n++)if(qo[n][1].exec(o[3])){r=(o[2]||" ")+qo[n][0];break}if(null==r)return void(e._isValid=!1)}if(!d&&null!=r)return void(e._isValid=!1);if(o[4])if(Vo.exec(o[4]))c="Z";else return void(e._isValid=!1);e._f=s+(r||"")+(c||""),Ue(e)}else e._isValid=!1}function ze(e,t,o,n,i,a){var d=[Be(e),Ro.indexOf(t),parseInt(o,10),parseInt(n,10),parseInt(i,10)];return a&&d.push(parseInt(a,10)),d}function Be(e){var t=parseInt(e,10);return 49>=t?2e3+t:999>=t?1900+t:t}function Le(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Ae(e,t,o){if(e){var n=zo.indexOf(e),i=new Date(t[0],t[1],t[2]).getDay();if(n!==i)return h(o).weekdayMismatch=!0,o._isValid=!1,!1}return!0}function He(e,t,o){if(e)return $o[e];if(t)return 0;var n=parseInt(o,10),i=n%100;return 60*((n-i)/100)+i}function je(e){var t=Zo.exec(Le(e._i));if(t){var o=ze(t[4],t[3],t[2],t[5],t[6],t[7]);if(!Ae(t[1],o,e))return;e._a=o,e._tzm=He(t[8],t[9],t[10]),e._d=le.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),h(e).rfc2822=!0}else e._isValid=!1}function We(e){var o=Xo.exec(e._i);if(null!==o)return void(e._d=new Date(+o[1]));if(Re(e),!1===e._isValid)delete e._isValid;else return;if(je(e),!1===e._isValid)delete e._isValid;else return;t.createFromInputFallback(e)}function Ue(e){if(e._f===t.ISO_8601)return void Re(e);if(e._f===t.RFC_2822)return void je(e);e._a=[],h(e).empty=!0;var o=""+e._i,n=o.length,a=0,d,s,r,l,c;for(r=H(e._f,e._locale).match($t)||[],d=0;d<r.length;d++)l=r[d],s=(o.match(W(l,e))||[])[0],s&&(c=o.substr(0,o.indexOf(s)),0<c.length&&h(e).unusedInput.push(c),o=o.slice(o.indexOf(s)+s.length),a+=s.length),Jt[l]?(s?h(e).empty=!1:h(e).unusedTokens.push(l),X(l,s,e)):e._strict&&!s&&h(e).unusedTokens.push(l);h(e).charsLeftOver=n-a,0<o.length&&h(e).unusedInput.push(o),12>=e._a[3]&&!0===h(e).bigHour&&0<e._a[3]&&(h(e).bigHour=void 0),h(e).parsedDateParts=e._a.slice(0),h(e).meridiem=e._meridiem,e._a[3]=Ve(e._locale,e._a[3],e._meridiem),Ne(e),Ie(e)}function Ve(e,t,o){var n;return null==o?t:null==e.meridiemHour?null==e.isPM?t:(n=e.isPM(o),n&&12>t&&(t+=12),n||12!==t||(t=0),t):e.meridiemHour(t,o)}function Ge(e){var t,o,n,a,d;if(0===e._f.length)return h(e).invalidFormat=!0,void(e._d=new Date(NaN));for(a=0;a<e._f.length;a++)(d=0,t=y({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[a],Ue(t),!!g(t))&&(d+=h(t).charsLeftOver,d+=10*h(t).unusedTokens.length,h(t).score=d,(null==n||d<n)&&(n=d,o=t));c(e,o||t)}function qe(e){if(!e._d){var t=F(e._i);e._a=r([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Ne(e)}}function Xe(e){var t=new f(Ie(Ze(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Ze(e){var t=e._i,n=e._f;return(e._locale=e._locale||Ce(e._l),null===t||void 0===n&&""===t)?m({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),b(t))?new f(Ie(t)):(s(t)?e._d=t:o(n)?Ge(e):n?Ue(e):$e(e),g(e)||(e._d=null),e)}function $e(e){var i=e._i;a(i)?e._d=new Date(t.now()):s(i)?e._d=new Date(i.valueOf()):"string"==typeof i?We(e):o(i)?(e._a=r(i.slice(0),function(e){return parseInt(e,10)}),Ne(e)):n(i)?qe(e):d(i)?e._d=new Date(i):t.createFromInputFallback(e)}function Ke(e,t,a,d,s){var r={};return(!0===a||!1===a)&&(d=a,a=void 0),(n(e)&&i(e)||o(e)&&0===e.length)&&(e=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=s,r._l=a,r._i=e,r._f=t,r._strict=d,Xe(r)}function Qe(e,t,o,n){return Ke(e,t,o,n,!1)}function Je(e,t){var n,a;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Qe();for(n=t[0],a=1;a<t.length;++a)(!t[a].isValid()||t[a][e](n))&&(n=t[a]);return n}function et(e){for(var t in e)if(-1===No.call(en,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var o=!1,n=0;n<en.length;++n)if(e[en[n]]){if(o)return!1;parseFloat(e[en[n]])!==v(e[en[n]])&&(o=!0)}return!0}function tt(e){var t=F(e),o=t.year||0,n=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,d=t.day||0,s=t.hour||0,r=t.minute||0,l=t.second||0,c=t.millisecond||0;this._isValid=et(t),this._milliseconds=+c+1e3*l+6e4*r+60*(60*(1e3*s)),this._days=+d+7*a,this._months=+i+3*n+12*o,this._data={},this._locale=Ce(),this._bubble()}function ot(e){return e instanceof tt}function nt(e){return 0>e?-1*vo(-1*e):vo(e)}function it(e,t){z(e,0,0,function(){var e=this.utcOffset(),o="+";return 0>e&&(e=-e,o="-"),o+R(~~(e/60),2)+t+R(~~e%60,2)})}function at(e,t){var o=(t||"").match(e);if(null===o)return null;var n=o[o.length-1]||[],i=(n+"").match(tn)||["-",0,0],a=+(60*i[1])+v(i[2]);return 0===a?0:"+"===i[0]?a:-a}function dt(e,o){var n,i;return o._isUTC?(n=o.clone(),i=(b(e)||s(e)?e.valueOf():Qe(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+i),t.updateOffset(n,!1),n):Qe(e).local()}function st(e){return 15*-vo(e._d.getTimezoneOffset()/15)}function rt(){if(!a(this._isDSTShifted))return this._isDSTShifted;var e={};if(y(e,this),e=Ze(e),e._a){var t=e._isUTC?u(e._a):Qe(e._a);this._isDSTShifted=this.isValid()&&0<k(e._a,t.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted}function lt(){return!!this.isValid()&&this._isUTC&&0===this._offset}function ct(e,t){var o=e,n=null,i,a,s;return ot(e)?o={ms:e._milliseconds,d:e._days,M:e._months}:d(e)?(o={},t?o[t]=e:o.milliseconds=e):(n=on.exec(e))?(i="-"===n[1]?-1:1,o={y:0,d:v(n[2])*i,h:v(n[3])*i,m:v(n[4])*i,s:v(n[5])*i,ms:v(nt(1e3*n[6]))*i}):(n=nn.exec(e))?(i="-"===n[1]?-1:1,o={y:ut(n[2],i),M:ut(n[3],i),w:ut(n[4],i),d:ut(n[5],i),h:ut(n[6],i),m:ut(n[7],i),s:ut(n[8],i)}):null==o?o={}:"object"==typeof o&&(("from"in o)||("to"in o))&&(s=ht(Qe(o.from),Qe(o.to)),o={},o.ms=s.milliseconds,o.M=s.months),a=new tt(o),ot(e)&&l(e,"_locale")&&(a._locale=e._locale),a}function ut(e,t){var o=e&&parseFloat(e.replace(",","."));return(isNaN(o)?0:o)*t}function pt(e,t){var o={};return o.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(o.months,"M").isAfter(t)&&--o.months,o.milliseconds=+t-+e.clone().add(o.months,"M"),o}function ht(e,t){var o;return e.isValid()&&t.isValid()?(t=dt(t,e),e.isBefore(t)?o=pt(e,t):(o=pt(t,e),o.milliseconds=-o.milliseconds,o.months=-o.months),o):{milliseconds:0,months:0}}function gt(e,t){return function(o,n){var i,a;return null===n||isNaN(+n)||(S(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=o,o=n,n=a),o="string"==typeof o?+o:o,i=ct(o,n),mt(this,i,e),this}}function mt(e,o,n,i){var a=o._milliseconds,d=nt(o._days),s=nt(o._months);e.isValid()&&(i=null==i||i,s&&ae(e,Q(e,"Month")+s*n),d&&J(e,"Date",Q(e,"Date")+d*n),a&&e._d.setTime(e._d.valueOf()+a*n),i&&t.updateOffset(e,d||s))}function yt(e,t){var o=12*(t.year()-e.year())+(t.month()-e.month()),n=e.clone().add(o,"months"),i,a;return 0>t-n?(i=e.clone().add(o-1,"months"),a=(t-n)/(n-i)):(i=e.clone().add(o+1,"months"),a=(t-n)/(i-n)),-(o+a)||0}function ft(e){var t;return void 0===e?this._locale._abbr:(t=Ce(e),null!=t&&(this._locale=t),this)}function bt(){return this._locale}function _t(e,t){return(e%t+t)%t}function vt(e,t,o){return 100>e&&0<=e?new Date(e+400,t,o)-12622780800000:new Date(e,t,o).valueOf()}function kt(e,t,o){return 100>e&&0<=e?Date.UTC(e+400,t,o)-12622780800000:Date.UTC(e,t,o)}function wt(e,t){z(0,[e,e.length],0,t)}function xt(e,t,o,n,i){var a;return null==e?pe(this,n,i).year:(a=he(e,n,i),t>a&&(t=a),St.call(this,e,t,o,n,i))}function St(e,t,o,n,i){var a=ue(e,t,o,n,i),d=le(a.year,0,a.dayOfYear);return this.year(d.getUTCFullYear()),this.month(d.getUTCMonth()),this.date(d.getUTCDate()),this}function Ot(e,t){t[6]=v(1e3*("0."+e))}function Dt(e){return e}function Tt(e,t,o,n){var i=Ce(),a=u().set(n,t);return i[o](a,e)}function Et(e,t,o){if(d(e)&&(t=e,e=void 0),e=e||"",null!=t)return Tt(e,t,o,"month");var n=[],a;for(a=0;12>a;a++)n[a]=Tt(e,a,o,"month");return n}function Ct(e,t,o,n){"boolean"==typeof e?(d(t)&&(o=t,t=void 0),t=t||""):(t=e,o=t,e=!1,d(t)&&(o=t,t=void 0),t=t||"");var a=Ce(),s=e?a._week.dow:0;if(null!=o)return Tt(t,(o+s)%7,n,"day");var r=[],l;for(l=0;7>l;l++)r[l]=Tt(t,(l+s)%7,n,"day");return r}function Mt(e,t,o,n){var i=ct(t,o);return e._milliseconds+=n*i._milliseconds,e._days+=n*i._days,e._months+=n*i._months,e._bubble()}function It(e){return 0>e?Eo(e):xo(e)}function Pt(e){return 4800*e/146097}function Ft(e){return 146097*e/4800}function Nt(e){return function(){return this.as(e)}}function Yt(e){return function(){return this.isValid()?this._data[e]:NaN}}function Rt(e,t,o,n,i){return i.relativeTime(t||1,!!o,e,n)}function zt(e,t,o){var n=ct(e).abs(),i=Pn(n.as("s")),d=Pn(n.as("m")),s=Pn(n.as("h")),r=Pn(n.as("d")),l=Pn(n.as("M")),c=Pn(n.as("y")),u=i<=Fn.ss&&["s",i]||i<Fn.s&&["ss",i]||1>=d&&["m"]||d<Fn.m&&["mm",d]||1>=s&&["h"]||s<Fn.h&&["hh",s]||1>=r&&["d"]||r<Fn.d&&["dd",r]||1>=l&&["M"]||l<Fn.M&&["MM",l]||1>=c&&["y"]||["yy",c];return u[2]=t,u[3]=0<+e,u[4]=o,Rt.apply(null,u)}function Bt(e){return void 0===e?Pn:"function"==typeof e&&(Pn=e,!0)}function Lt(e){return(0<e)-(0>e)||+e}function At(){if(!this.isValid())return this.localeData().invalidDate();var e=Nn(this._milliseconds)/1e3,t=Nn(this._days),o=Nn(this._months),n,i,a;n=_(e/60),i=_(n/60),e%=60,n%=60,a=_(o/12),o%=12;var d=a,r=o,l=t,c=i,u=n,p=e?e.toFixed(3).replace(/\.?0+$/,""):"",s=this.asSeconds();if(!s)return"P0D";var h=0>s?"-":"",g=Lt(this._months)===Lt(s)?"":"-",m=Lt(this._days)===Lt(s)?"":"-",y=Lt(this._milliseconds)===Lt(s)?"":"-";return h+"P"+(d?g+d+"Y":"")+(r?g+r+"M":"")+(l?m+l+"D":"")+(c||u||p?"T":"")+(c?y+c+"H":"")+(u?y+u+"M":"")+(p?y+p+"S":"")}var Ht,jt;jt=Array.prototype.some?Array.prototype.some:function(e){for(var o=Object(this),t=o.length>>>0,n=0;n<t;n++)if((n in o)&&e.call(this,o[n],n,o))return!0;return!1};var Wt=t.momentProperties=[],Ut=!1,Vt={};t.suppressDeprecationWarnings=!1,t.deprecationHandler=null;var Gt=Object.keys?Object.keys:function(e){var t=[],o;for(o in e)l(e,o)&&t.push(o);return t};var qt=/\d{1,2}/,Xt={},Zt={},$t=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Kt=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Qt={},Jt={},eo=/\d/,to=/\d\d/,oo=/\d{3}/,no=/\d{4}/,io=/[+-]?\d{6}/,ao=/\d\d?/,so=/\d\d\d\d?/,ro=/\d\d\d\d\d\d?/,lo=/\d{1,3}/,co=/\d{1,4}/,uo=/[+-]?\d{1,6}/,po=/\d+/,ho=/[+-]?\d+/,go=/Z|[+-]\d\d:?\d\d/gi,mo=/Z|[+-]\d\d(?::?\d\d)?/gi,yo=/[+-]?\d+(\.\d{1,3})?/,fo=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,bo={},_o={},wo=0,Oo=1,Do=2,To=3,Io=4,Po=5;z("Y",0,0,function(){var e=this.year();return 9999>=e?""+e:"+"+e}),z(0,["YY",2],0,function(){return this.year()%100}),z(0,["YYYY",4],0,"year"),z(0,["YYYYY",5],0,"year"),z(0,["YYYYYY",6,!0],0,"year"),I("year","y"),N("year",1),j("Y",ho),j("YY",ao,to),j("YYYY",co,no),j("YYYYY",uo,io),j("YYYYYY",uo,io),G(["YYYYY","YYYYYY"],wo),G("YYYY",function(e,o){o[wo]=2===e.length?t.parseTwoDigitYear(e):v(e)}),G("YY",function(e,o){o[wo]=t.parseTwoDigitYear(e)}),G("Y",function(e,t){t[wo]=parseInt(e,10)}),t.parseTwoDigitYear=function(e){return v(e)+(68<v(e)?1900:2e3)};var Fo=K("FullYear",!0),No;No=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},z("M",["MM",2],"Mo",function(){return this.month()+1}),z("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),z("MMMM",0,0,function(e){return this.localeData().months(this,e)}),I("month","M"),N("month",8),j("M",ao),j("MM",ao,to),j("MMM",function(e,t){return t.monthsShortRegex(e)}),j("MMMM",function(e,t){return t.monthsRegex(e)}),G(["M","MM"],function(e,t){t[Oo]=v(e)-1}),G(["MMM","MMMM"],function(e,t,o,n){var i=o._locale.monthsParse(e,n,o._strict);null==i?h(o).invalidMonth=e:t[Oo]=i});var Yo=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ro=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];z("w",["ww",2],"wo","week"),z("W",["WW",2],"Wo","isoWeek"),I("week","w"),I("isoWeek","W"),N("week",5),N("isoWeek",5),j("w",ao),j("ww",ao,to),j("W",ao),j("WW",ao,to),q(["w","ww","W","WW"],function(e,t,o,n){t[n.substr(0,1)]=v(e)});z("d",0,"do","day"),z("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),z("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),z("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),z("e",0,0,"weekday"),z("E",0,0,"isoWeekday"),I("day","d"),I("weekday","e"),I("isoWeekday","E"),N("day",11),N("weekday",11),N("isoWeekday",11),j("d",ao),j("e",ao),j("E",ao),j("dd",function(e,t){return t.weekdaysMinRegex(e)}),j("ddd",function(e,t){return t.weekdaysShortRegex(e)}),j("dddd",function(e,t){return t.weekdaysRegex(e)}),q(["dd","ddd","dddd"],function(e,t,o,n){var i=o._locale.weekdaysParse(e,n,o._strict);null==i?h(o).invalidWeekday=e:t.d=i}),q(["d","e","E"],function(e,t,o,n){t[n]=v(e)});var zo=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];z("H",["HH",2],0,"hour"),z("h",["hh",2],0,ve),z("k",["kk",2],0,function(){return this.hours()||24}),z("hmm",0,0,function(){return""+ve.apply(this)+R(this.minutes(),2)}),z("hmmss",0,0,function(){return""+ve.apply(this)+R(this.minutes(),2)+R(this.seconds(),2)}),z("Hmm",0,0,function(){return""+this.hours()+R(this.minutes(),2)}),z("Hmmss",0,0,function(){return""+this.hours()+R(this.minutes(),2)+R(this.seconds(),2)}),ke("a",!0),ke("A",!1),I("hour","h"),N("hour",13),j("a",we),j("A",we),j("H",ao),j("h",ao),j("k",ao),j("HH",ao,to),j("hh",ao,to),j("kk",ao,to),j("hmm",so),j("hmmss",ro),j("Hmm",so),j("Hmmss",ro),G(["H","HH"],To),G(["k","kk"],function(e,t){var o=v(e);t[To]=24===o?0:o}),G(["a","A"],function(e,t,o){o._isPm=o._locale.isPM(e),o._meridiem=e}),G(["h","hh"],function(e,t,o){t[To]=v(e),h(o).bigHour=!0}),G("hmm",function(e,t,o){var n=e.length-2;t[To]=v(e.substr(0,n)),t[Io]=v(e.substr(n)),h(o).bigHour=!0}),G("hmmss",function(e,t,o){var n=e.length-4,i=e.length-2;t[To]=v(e.substr(0,n)),t[Io]=v(e.substr(n,2)),t[Po]=v(e.substr(i)),h(o).bigHour=!0}),G("Hmm",function(e,t){var o=e.length-2;t[To]=v(e.substr(0,o)),t[Io]=v(e.substr(o))}),G("Hmmss",function(e,t){var o=e.length-4,n=e.length-2;t[To]=v(e.substr(0,o)),t[Io]=v(e.substr(o,2)),t[Po]=v(e.substr(n))});var Bo=/[ap]\.?m?\.?/i,Lo=K("Hours",!0),Ao={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:qt,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:Ro,week:{dow:0,doy:6},weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekdaysShort:zo,meridiemParse:Bo},Ho={},jo={},Wo=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Uo=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Vo=/Z|[+-]\d\d(?::?\d\d)?/,Go=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],qo=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Xo=/^\/?Date\((\-?\d+)/i,Zo=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,$o={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480},Ko;t.createFromInputFallback=x("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),t.ISO_8601=function(){},t.RFC_2822=function(){};var Qo=x("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Qe.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:m()}),Jo=x("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Qe.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:m()}),en=["year","quarter","month","week","day","hour","minute","second","millisecond"];it("Z",":"),it("ZZ",""),j("Z",mo),j("ZZ",mo),G(["Z","ZZ"],function(e,t,o){o._useUTC=!0,o._tzm=at(mo,e)});var tn=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var on=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,nn=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;ct.fn=tt.prototype,ct.invalid=function(){return ct(NaN)};var an=gt(1,"add"),dn=gt(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var sn=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});z(0,["gg",2],0,function(){return this.weekYear()%100}),z(0,["GG",2],0,function(){return this.isoWeekYear()%100}),wt("gggg","weekYear"),wt("ggggg","weekYear"),wt("GGGG","isoWeekYear"),wt("GGGGG","isoWeekYear"),I("weekYear","gg"),I("isoWeekYear","GG"),N("weekYear",1),N("isoWeekYear",1),j("G",ho),j("g",ho),j("GG",ao,to),j("gg",ao,to),j("GGGG",co,no),j("gggg",co,no),j("GGGGG",uo,io),j("ggggg",uo,io),q(["gggg","ggggg","GGGG","GGGGG"],function(e,t,o,n){t[n.substr(0,2)]=v(e)}),q(["gg","GG"],function(e,o,n,i){o[i]=t.parseTwoDigitYear(e)}),z("Q",0,"Qo","quarter"),I("quarter","Q"),N("quarter",7),j("Q",eo),G("Q",function(e,t){t[Oo]=3*(v(e)-1)}),z("D",["DD",2],"Do","date"),I("date","D"),N("date",9),j("D",ao),j("DD",ao,to),j("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),G(["D","DD"],Do),G("Do",function(e,t){t[Do]=v(e.match(ao)[0])});var rn=K("Date",!0);z("DDD",["DDDD",3],"DDDo","dayOfYear"),I("dayOfYear","DDD"),N("dayOfYear",4),j("DDD",lo),j("DDDD",oo),G(["DDD","DDDD"],function(e,t,o){o._dayOfYear=v(e)}),z("m",["mm",2],0,"minute"),I("minute","m"),N("minute",14),j("m",ao),j("mm",ao,to),G(["m","mm"],Io);var ln=K("Minutes",!1);z("s",["ss",2],0,"second"),I("second","s"),N("second",15),j("s",ao),j("ss",ao,to),G(["s","ss"],Po);var cn=K("Seconds",!1);z("S",0,0,function(){return~~(this.millisecond()/100)}),z(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),z(0,["SSS",3],0,"millisecond"),z(0,["SSSS",4],0,function(){return 10*this.millisecond()}),z(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),z(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),z(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),z(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),z(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),I("millisecond","ms"),N("millisecond",16),j("S",lo,eo),j("SS",lo,to),j("SSS",lo,oo);var un;for(un="SSSS";9>=un.length;un+="S")j(un,po);for(un="S";9>=un.length;un+="S")G(un,Ot);var pn=K("Milliseconds",!1);z("z",0,0,"zoneAbbr"),z("zz",0,0,"zoneName");var hn=f.prototype;hn.add=an,hn.calendar=function(e,o){var n=e||Qe(),i=dt(n,this).startOf("day"),a=t.calendarFormat(this,i)||"sameElse",d=o&&(O(o[a])?o[a].call(this,n):o[a]);return this.format(d||this.localeData().calendar(a,this,Qe(n)))},hn.clone=function(){return new f(this)},hn.diff=function(e,t,o){var n,i,a;return this.isValid()?(n=dt(e,this),!n.isValid())?NaN:(i=6e4*(n.utcOffset()-this.utcOffset()),t=P(t),(a="year"===t?yt(this,n)/12:"month"===t?yt(this,n):"quarter"===t?yt(this,n)/3:"second"===t?(this-n)/1e3:"minute"===t?(this-n)/6e4:"hour"===t?(this-n)/36e5:"day"===t?(this-n-i)/864e5:"week"===t?(this-n-i)/6048e5:this-n,o?a:_(a))):NaN},hn.endOf=function(e){var o;if(e=P(e),void 0===e||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?kt:vt;return"year"===e?o=n(this.year()+1,0,1)-1:"quarter"===e?o=n(this.year(),this.month()-this.month()%3+3,1)-1:"month"===e?o=n(this.year(),this.month()+1,1)-1:"week"===e?o=n(this.year(),this.month(),this.date()-this.weekday()+7)-1:"isoWeek"===e?o=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1:"day"===e||"date"===e?o=n(this.year(),this.month(),this.date()+1)-1:"hour"===e?(o=this._d.valueOf(),o+=3600000-_t(o+(this._isUTC?0:60000*this.utcOffset()),3600000)-1):"minute"===e?(o=this._d.valueOf(),o+=60000-_t(o,60000)-1):"second"===e?(o=this._d.valueOf(),o+=1000-_t(o,1000)-1):void 0,this._d.setTime(o),t.updateOffset(this,!0),this},hn.format=function(e){e||(e=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var o=A(this,e);return this.localeData().postformat(o)},hn.from=function(e,t){return this.isValid()&&(b(e)&&e.isValid()||Qe(e).isValid())?ct({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},hn.fromNow=function(e){return this.from(Qe(),e)},hn.to=function(e,t){return this.isValid()&&(b(e)&&e.isValid()||Qe(e).isValid())?ct({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},hn.toNow=function(e){return this.to(Qe(),e)},hn.get=function(e){return e=P(e),O(this[e])?this[e]():this},hn.invalidAt=function(){return h(this).overflow},hn.isAfter=function(e,t){var o=b(e)?e:Qe(e);return!!(this.isValid()&&o.isValid())&&(t=P(t)||"millisecond","millisecond"===t?this.valueOf()>o.valueOf():o.valueOf()<this.clone().startOf(t).valueOf())},hn.isBefore=function(e,t){var o=b(e)?e:Qe(e);return!!(this.isValid()&&o.isValid())&&(t=P(t)||"millisecond","millisecond"===t?this.valueOf()<o.valueOf():this.clone().endOf(t).valueOf()<o.valueOf())},hn.isBetween=function(e,t,o,n){var i=b(e)?e:Qe(e),a=b(t)?t:Qe(t);return!!(this.isValid()&&i.isValid()&&a.isValid())&&(n=n||"()",("("===n[0]?this.isAfter(i,o):!this.isBefore(i,o))&&(")"===n[1]?this.isBefore(a,o):!this.isAfter(a,o)))},hn.isSame=function(e,t){var o=b(e)?e:Qe(e),n;return!!(this.isValid()&&o.isValid())&&(t=P(t)||"millisecond","millisecond"===t?this.valueOf()===o.valueOf():(n=o.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},hn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},hn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},hn.isValid=function(){return g(this)},hn.lang=sn,hn.locale=ft,hn.localeData=bt,hn.max=Jo,hn.min=Qo,hn.parsingFlags=function(){return c({},h(this))},hn.set=ee,hn.startOf=function(e){var o;if(e=P(e),void 0===e||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?kt:vt;return"year"===e?o=n(this.year(),0,1):"quarter"===e?o=n(this.year(),this.month()-this.month()%3,1):"month"===e?o=n(this.year(),this.month(),1):"week"===e?o=n(this.year(),this.month(),this.date()-this.weekday()):"isoWeek"===e?o=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)):"day"===e||"date"===e?o=n(this.year(),this.month(),this.date()):"hour"===e?(o=this._d.valueOf(),o-=_t(o+(this._isUTC?0:60000*this.utcOffset()),3600000)):"minute"===e?(o=this._d.valueOf(),o-=_t(o,60000)):"second"===e?(o=this._d.valueOf(),o-=_t(o,1000)):void 0,this._d.setTime(o),t.updateOffset(this,!0),this},hn.subtract=dn,hn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},hn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},hn.toDate=function(){return new Date(this.valueOf())},hn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,o=t?this.clone().utc():this;return 0>o.year()||9999<o.year()?A(o,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):O(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+1e3*(60*this.utcOffset())).toISOString().replace("Z",A(o,"Z")):A(o,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},hn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var o="["+e+"(\"]",n=0<=this.year()&&9999>=this.year()?"YYYY":"YYYYYY",i=t+"[\")]";return this.format(o+n+"-MM-DD[T]HH:mm:ss.SSS"+i)},hn.toJSON=function(){return this.isValid()?this.toISOString():null},hn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},hn.unix=function(){return Eo(this.valueOf()/1e3)},hn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},hn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},hn.year=Fo,hn.isLeapYear=function(){return $(this.year())},hn.weekYear=function(e){return xt.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},hn.isoWeekYear=function(e){return xt.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},hn.quarter=hn.quarters=function(e){return null==e?xo((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},hn.month=de,hn.daysInMonth=function(){return oe(this.year(),this.month())},hn.week=hn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},hn.isoWeek=hn.isoWeeks=function(e){var t=pe(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},hn.weeksInYear=function(){var e=this.localeData()._week;return he(this.year(),e.dow,e.doy)},hn.isoWeeksInYear=function(){return he(this.year(),1,4)},hn.date=rn,hn.day=hn.days=function(e){if(!this.isValid())return null==e?NaN:this;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null==e?t:(e=ge(e,this.localeData()),this.add(e-t,"d"))},hn.weekday=function(e){if(!this.isValid())return null==e?NaN:this;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},hn.isoWeekday=function(e){if(!this.isValid())return null==e?NaN:this;if(null!=e){var t=me(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},hn.dayOfYear=function(e){var t=vo((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},hn.hour=hn.hours=Lo,hn.minute=hn.minutes=ln,hn.second=hn.seconds=cn,hn.millisecond=hn.milliseconds=pn,hn.utcOffset=function(e,o,n){var i=this._offset||0,a;if(!this.isValid())return null==e?NaN:this;if(null!=e){if("string"!=typeof e)16>So(e)&&!n&&(e*=60);else if(e=at(mo,e),null===e)return this;return!this._isUTC&&o&&(a=st(this)),this._offset=e,this._isUTC=!0,null!=a&&this.add(a,"m"),i!==e&&(!o||this._changeInProgress?mt(this,ct(e-i,"m"),1,!1):!this._changeInProgress&&(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:st(this)},hn.utc=function(e){return this.utcOffset(0,e)},hn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(st(this),"m")),this},hn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=at(go,this._i);null==e?this.utcOffset(0,!0):this.utcOffset(e)}return this},hn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Qe(e).utcOffset():0,0==(this.utcOffset()-e)%60)},hn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},hn.isLocal=function(){return!!this.isValid()&&!this._isUTC},hn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},hn.isUtc=lt,hn.isUTC=lt,hn.zoneAbbr=function(){return this._isUTC?"UTC":""},hn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},hn.dates=x("dates accessor is deprecated. Use date instead.",rn),hn.months=x("months accessor is deprecated. Use month instead",de),hn.years=x("years accessor is deprecated. Use year instead",Fo),hn.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null==e?-this.utcOffset():("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this)}),hn.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",rt);var gn=E.prototype;gn.calendar=C,gn.longDateFormat=M,gn.invalidDate=function(){return this._invalidDate},gn.ordinal=function(e){return this._ordinal.replace("%d",e)},gn.preparse=Dt,gn.postformat=Dt,gn.relativeTime=function(e,t,o,n){var i=this._relativeTime[o];return O(i)?i(e,t,o,n):i.replace(/%d/i,e)},gn.pastFuture=function(e,t){var o=this._relativeTime[0<e?"future":"past"];return O(o)?o(t):o.replace(/%s/i,t)},gn.set=D,gn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Yo).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},gn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Yo.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},gn.monthsParse=ie,gn.monthsRegex=function(e){return this._monthsParseExact?(l(this,"_monthsRegex")||se.call(this),e?this._monthsStrictRegex:this._monthsRegex):(l(this,"_monthsRegex")||(this._monthsRegex=fo),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},gn.monthsShortRegex=function(e){return this._monthsParseExact?(l(this,"_monthsRegex")||se.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(l(this,"_monthsShortRegex")||(this._monthsShortRegex=fo),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},gn.week=function(e){return pe(e,this._week.dow,this._week.doy).week},gn.firstDayOfYear=function(){return this._week.doy},gn.firstDayOfWeek=function(){return this._week.dow},gn.weekdays=function(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?ye(n,this._week.dow):e?n[e.day()]:n},gn.weekdaysMin=function(e){return!0===e?ye(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},gn.weekdaysShort=function(e){return!0===e?ye(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},gn.weekdaysParse=be,gn.weekdaysRegex=function(e){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||_e.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(l(this,"_weekdaysRegex")||(this._weekdaysRegex=fo),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},gn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||_e.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(l(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=fo),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},gn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||_e.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(l(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=fo),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},gn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},gn.meridiem=function(e,t,o){return 11<e?o?"pm":"PM":o?"am":"AM"},Te("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,o=1===v(e%100/10)?"th":1==t?"st":2==t?"nd":3==t?"rd":"th";return e+o}}),t.lang=x("moment.lang is deprecated. Use moment.locale instead.",Te),t.langData=x("moment.langData is deprecated. Use moment.localeData instead.",Ce);var mn=So,yn=Nt("ms"),fn=Nt("s"),bn=Nt("m"),_n=Nt("h"),vn=Nt("d"),kn=Nt("w"),wn=Nt("M"),xn=Nt("Q"),Sn=Nt("y"),On=Yt("milliseconds"),Dn=Yt("seconds"),Tn=Yt("minutes"),En=Yt("hours"),Cn=Yt("days"),Mn=Yt("months"),In=Yt("years"),Pn=vo,Fn={ss:44,s:45,m:45,h:22,d:26,M:11},Nn=So,Yn=tt.prototype;return Yn.isValid=function(){return this._isValid},Yn.abs=function(){var e=this._data;return this._milliseconds=mn(this._milliseconds),this._days=mn(this._days),this._months=mn(this._months),e.milliseconds=mn(e.milliseconds),e.seconds=mn(e.seconds),e.minutes=mn(e.minutes),e.hours=mn(e.hours),e.months=mn(e.months),e.years=mn(e.years),this},Yn.add=function(e,t){return Mt(this,e,t,1)},Yn.subtract=function(e,t){return Mt(this,e,t,-1)},Yn.as=function(e){if(!this.isValid())return NaN;var t=this._milliseconds,o,n;if(e=P(e),"month"===e||"quarter"===e||"year"===e)switch(o=this._days+t/864e5,n=this._months+Pt(o),e){case"month":return n;case"quarter":return n/3;case"year":return n/12;}else switch(o=this._days+vo(Ft(this._months)),e){case"week":return o/7+t/6048e5;case"day":return o+t/864e5;case"hour":return 24*o+t/36e5;case"minute":return 1440*o+t/6e4;case"second":return 86400*o+t/1e3;case"millisecond":return Eo(864e5*o)+t;default:throw new Error("Unknown unit "+e);}},Yn.asMilliseconds=yn,Yn.asSeconds=fn,Yn.asMinutes=bn,Yn.asHours=_n,Yn.asDays=vn,Yn.asWeeks=kn,Yn.asMonths=wn,Yn.asQuarters=xn,Yn.asYears=Sn,Yn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+2592e6*(this._months%12)+31536e6*v(this._months/12):NaN},Yn._bubble=function(){var e=this._milliseconds,t=this._days,o=this._months,n=this._data,i,a,d,s,r;return 0<=e&&0<=t&&0<=o||0>=e&&0>=t&&0>=o||(e+=864e5*It(Ft(o)+t),t=0,o=0),n.milliseconds=e%1e3,i=_(e/1e3),n.seconds=i%60,a=_(i/60),n.minutes=a%60,d=_(a/60),n.hours=d%24,t+=_(d/24),r=_(Pt(t)),o+=r,t-=It(Ft(r)),s=_(o/12),o%=12,n.days=t,n.months=o,n.years=s,this},Yn.clone=function(){return ct(this)},Yn.get=function(e){return e=P(e),this.isValid()?this[e+"s"]():NaN},Yn.milliseconds=On,Yn.seconds=Dn,Yn.minutes=Tn,Yn.hours=En,Yn.days=Cn,Yn.weeks=function(){return _(this.days()/7)},Yn.months=Mn,Yn.years=In,Yn.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),o=zt(this,!e,t);return e&&(o=t.pastFuture(+this,o)),t.postformat(o)},Yn.toISOString=At,Yn.toString=At,Yn.toJSON=At,Yn.locale=ft,Yn.localeData=bt,Yn.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",At),Yn.lang=sn,z("X",0,0,"unix"),z("x",0,0,"valueOf"),j("x",ho),j("X",yo),G("X",function(e,t,o){o._d=new Date(1e3*parseFloat(e,10))}),G("x",function(e,t,o){o._d=new Date(v(e))}),t.version="2.24.0",function(e){Ht=e}(Qe),t.fn=hn,t.min=function(){var e=[].slice.call(arguments,0);return Je("isBefore",e)},t.max=function(){var e=[].slice.call(arguments,0);return Je("isAfter",e)},t.now=function(){return Date.now?Date.now():+new Date},t.utc=u,t.unix=function(e){return Qe(1e3*e)},t.months=function(e,t){return Et(e,t,"months")},t.isDate=s,t.locale=Te,t.invalid=m,t.duration=ct,t.isMoment=b,t.weekdays=function(e,t,o){return Ct(e,t,o,"weekdays")},t.parseZone=function(){return Qe.apply(null,arguments).parseZone()},t.localeData=Ce,t.isDuration=ot,t.monthsShort=function(e,t){return Et(e,t,"monthsShort")},t.weekdaysMin=function(e,t,o){return Ct(e,t,o,"weekdaysMin")},t.defineLocale=Ee,t.updateLocale=function(e,t){if(null!=t){var o=Ao,n,i;i=Oe(e),null!=i&&(o=i._config),t=T(o,t),n=new E(t),n.parentLocale=Ho[e],Ho[e]=n,Te(e)}else null!=Ho[e]&&(null==Ho[e].parentLocale?null!=Ho[e]&&delete Ho[e]:Ho[e]=Ho[e].parentLocale);return Ho[e]},t.locales=Me,t.weekdaysShort=function(e,t,o){return Ct(e,t,o,"weekdaysShort")},t.normalizeUnits=P,t.relativeTimeRounding=Bt,t.relativeTimeThreshold=function(e,t){return void 0!==Fn[e]&&(void 0===t?Fn[e]:(Fn[e]=t,"s"===e&&(Fn.ss=t-1),!0))},t.calendarFormat=function(e,t){var o=e.diff(t,"days",!0);return-6>o?"sameElse":-1>o?"lastWeek":0>o?"lastDay":1>o?"sameDay":2>o?"nextDay":7>o?"nextWeek":"sameElse"},t.prototype=hn,t.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},t})}),cs=[],us=0;256>us;us++)cs[us]=(us+256).toString(16).substr(1);for(var ps=function(){if("undefined"!=typeof crypto&&crypto.getRandomValues){var e=new Uint8Array(16);return function(){return crypto.getRandomValues(e),e}}var t=Array(16);return function(){for(var e=0,o;16>e;e++)0==(3&e)&&(o=4294967296*Math.random()),t[e]=255&o>>>((3&e)<<3);return t}}(),hs=[],gs=0;256>gs;gs++)hs[gs]=(gs+256).toString(16).substr(1);var ms=ps(),ys=[1|ms[0],ms[1],ms[2],ms[3],ms[4],ms[5]],fs=16383&(ms[6]<<8|ms[7]),bs=/^\/?Date\((-?\d+)/i,_s=function(){function e(t){qd(this,e),this._queue=[],this._timeout=null,this._extended=null,this.delay=null,this.max=1/0,this.setOptions(t)}return Xd(e,[{key:"setOptions",value:function(e){e&&"undefined"!=typeof e.delay&&(this.delay=e.delay),e&&"undefined"!=typeof e.max&&(this.max=e.max),this._flushIfNeeded()}},{key:"destroy",value:function(){if(this.flush(),this._extended){for(var e=this._extended.object,t=this._extended.methods,o=0,n;o<t.length;o++)n=t[o],n.original?e[n.name]=n.original:delete e[n.name];this._extended=null}}},{key:"replace",value:function(e,t){var o=this,n=e[t];if(!n)throw new Error("Method "+t+" undefined");e[t]=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];o.queue({args:t,fn:n,context:this})}}},{key:"queue",value:function(e){"function"==typeof e?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}},{key:"_flushIfNeeded",value:function(){var e=this;this._queue.length>this.max&&this.flush(),null!=this._timeout&&(clearTimeout(this._timeout),this._timeout=null),0<this.queue.length&&"number"==typeof this.delay&&(this._timeout=setTimeout(function(){e.flush()},this.delay))}},{key:"flush",value:function(){this._queue.splice(0).forEach(function(e){e.fn.apply(e.context||e.fn,e.args||[])})}}],[{key:"extend",value:function(t,o){var n=new e(o);if(void 0!==t.flush)throw new Error("Target object already has a property flush");t.flush=function(){n.flush()};var a=[{name:"flush",original:void 0}];if(o&&o.replace)for(var d=0,s;d<o.replace.length;d++)s=o.replace[d],a.push({name:s,original:t[s]}),n.replace(t,s);return n._extended={object:t,methods:a},n}}]),e}(),vs=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")},ks=function(e){return Ne(e)||Ye(e)||vs()},ws=function(){function e(){qd(this,e),this._subscribers={"*":[],add:[],remove:[],update:[]},this.subscribe=e.prototype.on,this.unsubscribe=e.prototype.off}return Xd(e,[{key:"_trigger",value:function(e,t,o){if("*"===e)throw new Error("Cannot trigger event *");for(var n=[].concat(ks(this._subscribers[e]),ks(this._subscribers["*"])),a=0,d=n.length,s;a<d;a++)s=n[a],s.callback&&s.callback(e,t,null==o?null:o)}},{key:"on",value:function(e,t){this._subscribers[e].push({callback:t})}},{key:"off",value:function(e,t){this._subscribers[e]=this._subscribers[e].filter(function(e){return e.callback!==t})}}]),e}(),xs=function(e){function t(e,o){var n;if(qd(this,t),n=$d(this,Kd(t).call(this)),e&&!Array.isArray(e)&&(o=e,e=[]),n._options=o||{},n._data=Object.create({}),n.length=0,n._idProp=n._options.fieldId||"id",n._type={},n._options.type)for(var a=Object.keys(n._options.type),d=0,s=a.length;d<s;d++){var r=a[d],l=n._options.type[r];n._type[r]="Date"==l||"ISODate"==l||"ASPDate"==l?"Date":l}return e&&e.length&&n.add(e),n.setOptions(o),n}return Jd(t,e),Xd(t,[{key:"setOptions",value:function(e){e&&void 0!==e.queue&&(!1===e.queue?this._queue&&(this._queue.destroy(),delete this._queue):(!this._queue&&(this._queue=_s.extend(this,{replace:["add","update","remove"]})),e.queue&&"object"===Gd(e.queue)&&this._queue.setOptions(e.queue)))}},{key:"add",value:function(e,t){var o=[],n;if(Array.isArray(e))for(var a=0,d=e.length;a<d;a++)n=this._addItem(e[a]),o.push(n);else if(e&&"object"===Gd(e))n=this._addItem(e),o.push(n);else throw new Error("Unknown dataType");return o.length&&this._trigger("add",{items:o},t),o}},{key:"update",value:function(e,t){var o=this,n=[],a=[],d=[],s=[],r=this._idProp,l=function(e){var t=e[r];if(null!=t&&o._data[t]){var i=e,l=Object.assign({},o._data[t]),c=o._updateItem(i);a.push(c),s.push(i),d.push(l)}else{var u=o._addItem(e);n.push(u)}};if(Array.isArray(e))for(var c=0,u=e.length;c<u;c++)e[c]&&"object"===Gd(e[c])?l(e[c]):console.warn("Ignoring input item, which is not an object at index "+c);else if(e&&"object"===Gd(e))l(e);else throw new Error("Unknown dataType");if(n.length&&this._trigger("add",{items:n},t),a.length){this._trigger("update",{items:a,oldData:d,data:s},t)}return n.concat(a)}},{key:"get",value:function(e,t){var o=void 0,n=void 0,a=void 0;Fe(e)?(o=e,a=t):Array.isArray(e)?(n=e,a=t):a=e;var d=a&&"Object"===a.returnType?"Object":"Array",s=a&&a.type||this._options.type,r=a&&a.filter,l=[],c=null,u=null,p=null;if(null!=o)c=this._getItem(o,s),c&&r&&!r(c)&&(c=null);else if(null!=n)for(var h=0,g=n.length;h<g;h++)c=this._getItem(n[h],s),null!=c&&(!r||r(c))&&l.push(c);else{u=Object.keys(this._data);for(var m=0,y=u.length;m<y;m++)p=u[m],c=this._getItem(p,s),null!=c&&(!r||r(c))&&l.push(c)}if(a&&a.order&&null==o&&this._sort(l,a.order),a&&a.fields){var f=a.fields;if(null!=o&&null!=c)c=this._filterFields(c,f);else for(var b=0,_=l.length;b<_;b++)l[b]=this._filterFields(l[b],f)}if("Object"==d){for(var v={},k=0,w=l.length;k<w;k++){var x=l[k],S=x[this._idProp];v[S]=x}return v}return null==o?l:c}},{key:"getIds",value:function(e){var t=this._data,o=e&&e.filter,n=e&&e.order,a=e&&e.type||this._options.type,d=Object.keys(t),s=[],r,l;if(o){if(n){l=[];for(var c=0,u=d.length,p;c<u;c++)p=d[c],r=this._getItem(p,a),o(r)&&l.push(r);this._sort(l,n);for(var h=0,g=l.length;h<g;h++)s.push(l[h][this._idProp])}else for(var m=0,y=d.length,f;m<y;m++)f=d[m],r=this._getItem(f,a),o(r)&&s.push(r[this._idProp]);}else if(n){l=[];for(var b=0,_=d.length,v;b<_;b++)v=d[b],l.push(t[v]);this._sort(l,n);for(var k=0,w=l.length;k<w;k++)s.push(l[k][this._idProp])}else for(var x=0,S=d.length,O;x<S;x++)O=d[x],r=t[O],s.push(r[this._idProp]);return s}},{key:"getDataSet",value:function(){return this}},{key:"forEach",value:function(e,t){var o=t&&t.filter,n=t&&t.type||this._options.type,a=this._data,d=Object.keys(a);if(t&&t.order)for(var s=this.get(t),r=0,l=s.length;r<l;r++){var c=s[r],u=c[this._idProp];e(c,u)}else for(var p=0,h=d.length;p<h;p++){var g=d[p],m=this._getItem(g,n);(!o||o(m))&&e(m,g)}}},{key:"map",value:function(e,t){for(var o=t&&t.filter,n=t&&t.type||this._options.type,a=[],d=this._data,s=Object.keys(d),r=0,l=s.length;r<l;r++){var c=s[r],u=this._getItem(c,n);(!o||o(u))&&a.push(e(u,c))}return t&&t.order&&this._sort(a,t.order),a}},{key:"_filterFields",value:function(e,t){return e?(Array.isArray(t)?t:Object.keys(t)).reduce(function(t,o){return t[o]=e[o],t},{}):e}},{key:"_sort",value:function(e,t){if("string"==typeof t){var o=t;e.sort(function(e,t){var n=e[o],i=t[o];return n>i?1:n<i?-1:0})}else if("function"==typeof t)e.sort(t);else throw new TypeError("Order must be a function or a string")}},{key:"remove",value:function(e,t){for(var o=[],n=[],a=Array.isArray(e)?e:[e],d=0,s=a.length,r;d<s;d++)if(r=this._remove(a[d]),r){var l=r[this._idProp];null!=l&&(o.push(l),n.push(r))}return o.length&&this._trigger("remove",{items:o,oldData:n},t),o}},{key:"_remove",value:function(e){var t;if(Fe(e)?t=e:e&&"object"===Gd(e)&&(t=e[this._idProp]),null!=t&&this._data[t]){var o=this._data[t];return delete this._data[t],--this.length,o}return null}},{key:"clear",value:function(e){for(var t=Object.keys(this._data),o=[],n=0,a=t.length;n<a;n++)o.push(this._data[t[n]]);return this._data={},this.length=0,this._trigger("remove",{items:t,oldData:o},e),t}},{key:"max",value:function e(t){for(var o=this._data,n=Object.keys(o),e=null,a=null,d=0,s=n.length;d<s;d++){var r=n[d],l=o[r],c=l[t];null!=c&&(null==a||c>a)&&(e=l,a=c)}return e}},{key:"min",value:function e(t){for(var o=this._data,n=Object.keys(o),e=null,a=null,d=0,s=n.length;d<s;d++){var r=n[d],l=o[r],c=l[t];null!=c&&(null==a||c<a)&&(e=l,a=c)}return e}},{key:"distinct",value:function(e){for(var t=this._data,o=Object.keys(t),n=[],a=this._options.type&&this._options.type[e]||null,d=0,s=0,r=o.length;s<r;s++){for(var l=o[s],c=t[l],u=c[e],p=!1,h=0;h<d;h++)if(n[h]==u){p=!0;break}p||void 0===u||(n[d]=u,d++)}if(a)for(var g=0,m=n.length;g<m;g++)n[g]=Ie(n[g],a);return n}},{key:"_addItem",value:function(e){var t=e[this._idProp];if(null==t)t=Se(),e[this._idProp]=t;else if(this._data[t])throw new Error("Cannot add item: item with id "+t+" already exists");for(var o={},n=Object.keys(e),a=0,d=n.length;a<d;a++){var s=n[a],r=this._type[s];o[s]=Ie(e[s],r)}return this._data[t]=o,this.length++,t}},{key:"_getItem",value:function(e,t){var o=this._data[e];if(!o)return null;var n=Object.keys(o),a;if(t){a={};for(var d=0,s=n.length;d<s;d++){var r=n[d],l=o[r];a[r]=Ie(l,t[r])}}else a=ze({},o);return null==a[this._idProp]&&(a[this._idProp]=o.id),a}},{key:"_updateItem",value:function(e){var t=e[this._idProp];if(null==t)throw new Error("Cannot update item: item has no id (item: "+JSON.stringify(e)+")");var o=this._data[t];if(!o)throw new Error("Cannot update item: no item with id "+t+" found");for(var n=Object.keys(e),a=0,d=n.length;a<d;a++){var s=n[a],r=this._type[s];o[s]=Ie(e[s],r)}return t}}]),t}(ws),Ss=function(e){function t(e,o){var n;return qd(this,t),n=$d(this,Kd(t).call(this)),n.length=0,n._ids={},n._options=o||{},n.listener=n._onEvent.bind(Zd(n)),n.setData(e),n}return Jd(t,e),Xd(t,[{key:"setData",value:function(e){if(this._data){this._data.off&&this._data.off("*",this.listener);var t=this._data.getIds({filter:this._options.filter}),o=this._data.get(t);this._ids={},this.length=0,this._trigger("remove",{items:t,oldData:o})}if(null!=e){this._data=e;for(var n=this._data.getIds({filter:this._options.filter}),a=0,d=n.length,s;a<d;a++)s=n[a],this._ids[s]=!0;this.length=n.length,this._trigger("add",{items:n})}else this._data=new xs;this._data.on&&this._data.on("*",this.listener)}},{key:"refresh",value:function(){for(var e=this._data.getIds({filter:this._options.filter}),t=Object.keys(this._ids),o={},n=[],a=[],d=[],s=0,r=e.length,l;s<r;s++)l=e[s],o[l]=!0,this._ids[l]||(n.push(l),this._ids[l]=!0);for(var c=0,u=t.length;c<u;c++){var p=t[c],h=this._data.get(p);null==h?console.error("If you see this, report it please."):!o[p]&&(a.push(p),d.push(h),delete this._ids[p])}this.length+=n.length-a.length,n.length&&this._trigger("add",{items:n}),a.length&&this._trigger("remove",{items:a,oldData:d})}},{key:"get",value:function(e,t){if(null==this._data)return null;var o=null,n;Fe(e)||Array.isArray(e)?(o=e,n=t):n=e;var i=Object.assign({},this._options,n),a=this._options.filter,d=n&&n.filter;return a&&d&&(i.filter=function(e){return a(e)&&d(e)}),null==o?this._data.get(i):this._data.get(o,i)}},{key:"getIds",value:function(e){if(this._data.length){var t=this._options.filter,o=null==e?null:e.filter,n;return n=o?t?function(e){return t(e)&&o(e)}:o:t,this._data.getIds({filter:n,order:e&&e.order})}return[]}},{key:"forEach",value:function(e,t){if(this._data){var o=this._options.filter,n=t&&t.filter,i;i=n?o?function(e){return o(e)&&n(e)}:n:o,this._data.forEach(e,{filter:i,order:t&&t.order})}}},{key:"map",value:function(e,t){if(this._data){var o=this._options.filter,n=t&&t.filter,i;return i=n?o?function(e){return o(e)&&n(e)}:n:o,this._data.map(e,{filter:i,order:t&&t.order})}return[]}},{key:"getDataSet",value:function(){return this._data.getDataSet()}},{key:"_onEvent",value:function(e,t,o){if(t&&t.items&&this._data){var n=t.items,a=[],d=[],s=[],r=[],l=[],c=[];switch(e){case"add":for(var u=0,p=n.length;u<p;u++){var h=n[u],g=this.get(h);g&&(this._ids[h]=!0,a.push(h))}break;case"update":for(var m=0,y=n.length;m<y;m++){var f=n[m],b=this.get(f);b?this._ids[f]?(d.push(f),l.push(t.data[m]),r.push(t.oldData[m])):(this._ids[f]=!0,a.push(f)):this._ids[f]&&(delete this._ids[f],s.push(f),c.push(t.oldData[m]))}break;case"remove":for(var _=0,v=n.length,k;_<v;_++)k=n[_],this._ids[k]&&(delete this._ids[k],s.push(k),c.push(t.oldData[_]));}this.length+=a.length-s.length,a.length&&this._trigger("add",{items:a},o),d.length&&this._trigger("update",{items:d,oldData:r,data:l},o),s.length&&this._trigger("remove",{items:s,oldData:c},o)}}}]),t}(ws),Os=Object.freeze({default:{DataSet:xs,DataView:Ss,Queue:_s},DataSet:xs,DataView:Ss,Queue:_s});"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.circle=function(e,t,o){this.beginPath(),this.arc(e,t,o,0,2*Oo,!1),this.closePath()},CanvasRenderingContext2D.prototype.square=function(e,t,o){this.beginPath(),this.rect(e-o,t-o,2*o,2*o),this.closePath()},CanvasRenderingContext2D.prototype.triangle=function(e,t,o){this.beginPath(),o*=1.15,t+=.275*o;var n=2*o,i=n/2,a=To(3)/6*n,d=To(n*n-i*i);this.moveTo(e,t-(d-a)),this.lineTo(e+i,t+a),this.lineTo(e-i,t+a),this.lineTo(e,t-(d-a)),this.closePath()},CanvasRenderingContext2D.prototype.triangleDown=function(e,t,o){this.beginPath(),o*=1.15,t-=.275*o;var n=2*o,i=n/2,a=To(3)/6*n,d=To(n*n-i*i);this.moveTo(e,t+(d-a)),this.lineTo(e+i,t-a),this.lineTo(e-i,t-a),this.lineTo(e,t+(d-a)),this.closePath()},CanvasRenderingContext2D.prototype.star=function(e,t,o){this.beginPath(),o*=.82,t+=.1*o;for(var i=0,a;10>i;i++)a=0==i%2?1.3*o:.5*o,this.lineTo(e+a*_o(2*i*Oo/10),t-a*bo(2*i*Oo/10));this.closePath()},CanvasRenderingContext2D.prototype.diamond=function(e,t,o){this.beginPath(),this.lineTo(e,t+o),this.lineTo(e+o,t),this.lineTo(e,t-o),this.lineTo(e-o,t),this.closePath()},CanvasRenderingContext2D.prototype.roundRect=function(e,t,o,n,i){var a=Oo/180;0>o-2*i&&(i=o/2),0>n-2*i&&(i=n/2),this.beginPath(),this.moveTo(e+i,t),this.lineTo(e+o-i,t),this.arc(e+o-i,t+i,i,270*a,360*a,!1),this.lineTo(e+o,t+n-i),this.arc(e+o-i,t+n-i,i,0,90*a,!1),this.lineTo(e+i,t+n),this.arc(e+i,t+n-i,i,90*a,180*a,!1),this.lineTo(e,t+i),this.arc(e+i,t+i,i,180*a,270*a,!1),this.closePath()},CanvasRenderingContext2D.prototype.ellipse_vis=function(e,t,o,n){var i=.5522848,a=o/2*i,d=n/2*i,s=e+o,r=t+n,l=e+o/2,c=t+n/2;this.beginPath(),this.moveTo(e,c),this.bezierCurveTo(e,c-d,l-a,t,l,t),this.bezierCurveTo(l+a,t,s,c-d,s,c),this.bezierCurveTo(s,c+d,l+a,r,l,r),this.bezierCurveTo(l-a,r,e,c+d,e,c),this.closePath()},CanvasRenderingContext2D.prototype.database=function(e,t,o,n){var i=o,a=n*(1/3),d=.5522848,s=i/2*d,r=a/2*d,l=e+i,c=t+a,u=e+i/2,p=t+a/2,h=t+(n-a/2),g=t+n;this.beginPath(),this.moveTo(l,p),this.bezierCurveTo(l,p+r,u+s,c,u,c),this.bezierCurveTo(u-s,c,e,p+r,e,p),this.bezierCurveTo(e,p-r,u-s,t,u,t),this.bezierCurveTo(u+s,t,l,p-r,l,p),this.lineTo(l,h),this.bezierCurveTo(l,h+r,u+s,g,u,g),this.bezierCurveTo(u-s,g,e,h+r,e,h),this.lineTo(e,p)},CanvasRenderingContext2D.prototype.dashedLine=function(e,t,o,n,i){this.beginPath(),this.moveTo(e,t);for(var a=i.length,d=o-e,s=n-t,r=s/d,l=To(d*d+s*s),c=0,u=!0,p=0,h=+i[0];.1<=l;)h=+i[c++%a],h>l&&(h=l),p=To(h*h/(1+r*r)),p=0>d?-p:p,e+=p,t+=r*p,!0===u?this.lineTo(e,t):this.moveTo(e,t),l-=h,u=!u},CanvasRenderingContext2D.prototype.hexagon=function(e,t,o){this.beginPath();var n=2*Oo/6;this.moveTo(e+o,t);for(var a=1;a<6;a++)this.lineTo(e+o*bo(n*a),t+o*_o(n*a));this.closePath()});var Ds="undefined"==typeof globalThis?"undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?{}:self:global:window:globalThis,Ts=Le(function(e){function t(e){if(e)return o(e)}function o(e){for(var o in t.prototype)e[o]=t.prototype[o];return e}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function o(){this.off(e,o),t.apply(this,arguments)}return o.fn=t,this.on(e,o),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var o=this._callbacks["$"+e];if(!o)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var n=0,a;n<o.length;n++)if(a=o[n],a===t||a.fn===t){o.splice(n,1);break}return 0===o.length&&delete this._callbacks["$"+e],this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=Array(arguments.length-1),o=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(o){o=o.slice(0);for(var n=0,a=o.length;n<a;++n)o[n].apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}}),Es={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},Cs=Object.create(Es);Cs.color="color.color",Cs.style="dashes";var Ms={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},Is={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},Ps="",Fs=0,Ns="",Ys="",Rs=Ms.NULL,zs=/[a-zA-Z_0-9.:#]/,Bs=Ae,Ls=function(e){var t=Ae(e),o={nodes:[],edges:[],options:{}};if(t.nodes&&t.nodes.forEach(function(e){var t={id:e.id,label:(e.label||e.id)+""};Ve(t,ct(e.attr,Es)),t.image&&(t.shape="image"),o.nodes.push(t)}),t.edges){var n=function(e){var t={from:e.from,to:e.to};return Ve(t,ct(e.attr,Cs)),null==t.arrows&&"->"===e.type&&(t.arrows="to"),t};t.edges.forEach(function(e){var t,i;t=e.from instanceof Object?e.from.nodes:{id:e.from},i=e.to instanceof Object?e.to.nodes:{id:e.to},e.from instanceof Object&&e.from.edges&&e.from.edges.forEach(function(e){var t=n(e);o.edges.push(t)}),rt(t,i,function(t,i){var a=Ze(o,t.id,i.id,e.type,e.attr),d=n(a);o.edges.push(d)}),e.to instanceof Object&&e.to.edges&&e.to.edges.forEach(function(e){var t=n(e);o.edges.push(t)})})}return t.attr&&(o.options=t.attr),o},As={parseDOT:Bs,DOTToGraph:Ls},Hs=Object.freeze({default:As,__moduleExports:As,parseDOT:Bs,DOTToGraph:Ls}),js=Object.freeze({parseGephi:ut}),Ws=Object.freeze({}),Us=Le(function(e){(function(t,o){e.exports=o()})(Ds,function(){function e(e){var t=String.fromCharCode,o=e&&e.preventDefault||!1,n=e&&e.container||window,a={},d={keydown:{},keyup:{}},s={},r;for(r=97;122>=r;r++)s[t(r)]={code:65+(r-97),shift:!1};for(r=65;90>=r;r++)s[t(r)]={code:r,shift:!0};for(r=0;9>=r;r++)s[""+r]={code:48+r,shift:!1};for(r=1;12>=r;r++)s["F"+r]={code:111+r,shift:!1};for(r=0;9>=r;r++)s["num"+r]={code:96+r,shift:!1};s["num*"]={code:106,shift:!1},s["num+"]={code:107,shift:!1},s["num-"]={code:109,shift:!1},s["num/"]={code:111,shift:!1},s["num."]={code:110,shift:!1},s.left={code:37,shift:!1},s.up={code:38,shift:!1},s.right={code:39,shift:!1},s.down={code:40,shift:!1},s.space={code:32,shift:!1},s.enter={code:13,shift:!1},s.shift={code:16,shift:void 0},s.esc={code:27,shift:!1},s.backspace={code:8,shift:!1},s.tab={code:9,shift:!1},s.ctrl={code:17,shift:!1},s.alt={code:18,shift:!1},s["delete"]={code:46,shift:!1},s.pageup={code:33,shift:!1},s.pagedown={code:34,shift:!1},s["="]={code:187,shift:!1},s["-"]={code:189,shift:!1},s["]"]={code:221,shift:!1},s["["]={code:219,shift:!1};var l=function(e){u(e,"keydown")},c=function(e){u(e,"keyup")},u=function(e,t){if(void 0!==d[t][e.keyCode]){for(var n=d[t][e.keyCode],a=0;a<n.length;a++)void 0===n[a].shift?n[a].fn(e):!0==n[a].shift&&!0==e.shiftKey?n[a].fn(e):!1==n[a].shift&&!1==e.shiftKey&&n[a].fn(e);!0==o&&e.preventDefault()}};return a.bind=function(e,t,o){if(void 0===o&&(o="keydown"),void 0===s[e])throw new Error("unsupported key: "+e);void 0===d[o][s[e].code]&&(d[o][s[e].code]=[]),d[o][s[e].code].push({fn:t,shift:s[e].shift})},a.bindAll=function(e,t){for(var o in void 0===t&&(t="keydown"),s)s.hasOwnProperty(o)&&a.bind(o,e,t)},a.getKey=function(e){for(var t in s)if(s.hasOwnProperty(t)){if(!0==e.shiftKey&&!0==s[t].shift&&e.keyCode==s[t].code)return t;if(!1==e.shiftKey&&!1==s[t].shift&&e.keyCode==s[t].code)return t;if(e.keyCode==s[t].code&&"shift"==t)return t}return"unknown key, currently not supported"},a.unbind=function(e,t,o){if(void 0===o&&(o="keydown"),void 0===s[e])throw new Error("unsupported key: "+e);if(void 0!==t){var n=[],a=d[o][s[e].code];if(void 0!==a)for(var r=0;r<a.length;r++)(a[r].fn!=t||a[r].shift!=s[e].shift)&&n.push(d[o][s[e].code][r]);d[o][s[e].code]=n}else d[o][s[e].code]=[]},a.reset=function(){d={keydown:{},keyup:{}}},a.destroy=function(){d={keydown:{},keyup:{}},n.removeEventListener("keydown",l,!0),n.removeEventListener("keyup",c,!0)},n.addEventListener("keydown",l,!0),n.addEventListener("keyup",c,!0),a}return e})}),Vs=Object.freeze({default:Us,__moduleExports:Us}),Gs;Gs="function"==typeof Object.assign?Object.assign:function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),o=1,n;o<arguments.length;o++)if(n=arguments[o],void 0!==n&&null!==n)for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i]);return t};var qs=Gs,Xs=["","webkit","Moz","MS","ms","o"],Zs="undefined"==typeof document?{style:{}}:document.createElement("div"),$s=vo,Ks=So,Qs=Date.now,Js;Js="undefined"==typeof window?{}:window;var er=mt(Zs.style,"touchAction"),tr=er!==void 0,or="compute",nr="none",ir="pan-x",ar="pan-y",dr=yt(),sr=/mobile|tablet|ip(ad|hone|od)|android/i,rr="ontouchstart"in Js,lr=mt(Js,"PointerEvent")!==void 0,cr=rr&&sr.test(navigator.userAgent),ur="touch",pr="mouse",hr=1,gr=2,mr=4,yr=8,fr=1,br=2,_r=4,vr=8,kr=16,wr=br|_r,xr=vr|kr,Sr=wr|xr,Or=["x","y"],Dr=["clientX","clientY"],Tr=function(){function e(e,t){this.manager=e,this.set(t)}var t=e.prototype;return t.set=function(e){e===or&&(e=this.compute()),tr&&this.manager.element.style&&dr[e]&&(this.manager.element.style[er]=e),this.actions=e.toLowerCase().trim()},t.update=function(){this.set(this.manager.options.touchAction)},t.compute=function(){var e=[];return ft(this.manager.recognizers,function(t){bt(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),vt(e.join(" "))},t.preventDefaults=function(e){var t=e.srcEvent,o=e.offsetDirection;if(this.manager.session.prevented)return void t.preventDefault();var n=this.actions,i=_t(n,nr)&&!dr[nr],a=_t(n,ar)&&!dr[ar],d=_t(n,ir)&&!dr[ir];if(i){var s=1===e.pointers.length,r=2>e.distance,l=250>e.deltaTime;if(s&&r&&l)return}return d&&a?void 0:i||a&&o&wr||d&&o&xr?this.preventSrc(t):void 0},t.preventSrc=function(e){this.manager.session.prevented=!0,e.preventDefault()},e}(),Er=function(){function e(e,t){var o=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){bt(e.options.enable,[e])&&o.handler(t)},this.init()}var t=e.prototype;return t.handler=function(){},t.init=function(){this.evEl&&Yt(this.element,this.evEl,this.domHandler),this.evTarget&&Yt(this.target,this.evTarget,this.domHandler),this.evWin&&Yt(zt(this.element),this.evWin,this.domHandler)},t.destroy=function(){this.evEl&&Rt(this.element,this.evEl,this.domHandler),this.evTarget&&Rt(this.target,this.evTarget,this.domHandler),this.evWin&&Rt(zt(this.element),this.evWin,this.domHandler)},e}(),Cr={pointerdown:hr,pointermove:gr,pointerup:mr,pointercancel:yr,pointerout:yr},Mr={2:ur,3:"pen",4:pr,5:"kinect"},Ir="pointerdown",Pr="pointermove pointerup pointercancel";Js.MSPointerEvent&&!Js.PointerEvent&&(Ir="MSPointerDown",Pr="MSPointerMove MSPointerUp MSPointerCancel");var Fr=function(e){function t(){var o=t.prototype,n;return o.evEl=Ir,o.evWin=Pr,n=e.apply(this,arguments)||this,n.store=n.manager.session.pointerEvents=[],n}ht(t,e);var o=t.prototype;return o.handler=function(e){var t=this.store,o=!1,n=e.type.toLowerCase().replace("ms",""),i=Cr[n],a=Mr[e.pointerType]||e.pointerType,d=Bt(t,e.pointerId,"pointerId");i&hr&&(0===e.button||a===ur)?0>d&&(t.push(e),d=t.length-1):i&(mr|yr)&&(o=!0),0>d||(t[d]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:a,srcEvent:e}),o&&t.splice(d,1))},t}(Er),Nr={touchstart:hr,touchmove:gr,touchend:mr,touchcancel:yr},Yr=function(e){function t(){var o;return t.prototype.evTarget="touchstart touchmove touchend touchcancel",o=e.apply(this,arguments)||this,o.targetIds={},o}ht(t,e);var o=t.prototype;return o.handler=function(e){var t=Nr[e.type],o=Ht.call(this,e,t);o&&this.callback(this.manager,t,{pointers:o[0],changedPointers:o[1],pointerType:ur,srcEvent:e})},t}(Er),Rr={mousedown:hr,mousemove:gr,mouseup:mr},zr=function(e){function t(){var o=t.prototype,n;return o.evEl="mousedown",o.evWin="mousemove mouseup",n=e.apply(this,arguments)||this,n.pressed=!1,n}ht(t,e);var o=t.prototype;return o.handler=function(e){var t=Rr[e.type];t&hr&&0===e.button&&(this.pressed=!0),t&gr&&1!==e.which&&(t=mr),this.pressed&&(t&mr&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:pr,srcEvent:e}))},t}(Er),Br=function(){var e=function(e){function t(t,o){var n;return n=e.call(this,t,o)||this,n.handler=function(e,t,o){var i=o.pointerType===ur,a=o.pointerType===pr;if(!(a&&o.sourceCapabilities&&o.sourceCapabilities.firesTouchEvents)){if(i)Wt.call(gt(gt(n)),t,o);else if(a&&Ut.call(gt(gt(n)),o))return;n.callback(e,t,o)}},n.touch=new Yr(n.manager,n.handler),n.mouse=new zr(n.manager,n.handler),n.primaryTouch=null,n.lastTouches=[],n}ht(t,e);var o=t.prototype;return o.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(Er);return e}(),Lr=1,Ar=2,Hr=4,jr=8,Wr=jr,Ur=16,Vr=32,Gr=1,qr=function(){function e(e){void 0===e&&(e={}),this.options=pt({enable:!0},e),this.id=qt(),this.manager=null,this.state=Lr,this.simultaneous={},this.requireFail=[]}var t=e.prototype;return t.set=function(e){return qs(this.options,e),this.manager&&this.manager.touchAction.update(),this},t.recognizeWith=function(e){if(Gt(e,"recognizeWith",this))return this;var t=this.simultaneous;return e=Xt(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},t.dropRecognizeWith=function(e){return Gt(e,"dropRecognizeWith",this)?this:(e=Xt(e,this),delete this.simultaneous[e.id],this)},t.requireFailure=function(e){if(Gt(e,"requireFailure",this))return this;var t=this.requireFail;return e=Xt(e,this),-1===Bt(t,e)&&(t.push(e),e.requireFailure(this)),this},t.dropRequireFailure=function(e){if(Gt(e,"dropRequireFailure",this))return this;e=Xt(e,this);var t=Bt(this.requireFail,e);return-1<t&&this.requireFail.splice(t,1),this},t.hasRequireFailures=function(){return 0<this.requireFail.length},t.canRecognizeWith=function(e){return!!this.simultaneous[e.id]},t.emit=function e(t){function e(n){o.manager.emit(n,t)}var o=this,n=this.state;n<jr&&e(o.options.event+Zt(n)),e(o.options.event),t.additionalEvent&&e(t.additionalEvent),n>=jr&&e(o.options.event+Zt(n))},t.tryEmit=function(e){return this.canEmit()?this.emit(e):void(this.state=Vr)},t.canEmit=function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(Vr|Lr)))return!1;e++}return!0},t.recognize=function(e){var t=qs({},e);return bt(this.options.enable,[this,t])?void(this.state&(Wr|Ur|Vr)&&(this.state=Lr),this.state=this.process(t),this.state&(Ar|Hr|jr|Ur)&&this.tryEmit(t)):(this.reset(),void(this.state=Vr))},t.process=function(){},t.getTouchAction=function(){},t.reset=function(){},e}(),Xr={domEvents:!1,touchAction:or,enable:!0,inputTarget:null,inputClass:null,preset:[],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Zr=2,$r=function(){function e(e,t){var o=this;this.options=qs({},Xr,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=Vt(this),this.touchAction=new Tr(this,this.options.touchAction),$t(this,!0),ft(this.options.recognizers,function(e){var t=o.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}var t=e.prototype;return t.set=function(e){return qs(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},t.stop=function(e){this.session.stopped=e?Zr:1},t.recognize=function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var o=this.recognizers,n=t.curRecognizer,a;(!n||n&&n.state&Wr)&&(t.curRecognizer=null,n=null);for(var d=0;d<o.length;)a=o[d],t.stopped!==Zr&&(!n||a===n||a.canRecognizeWith(n))?a.recognize(e):a.reset(),!n&&a.state&(Ar|Hr|jr)&&(t.curRecognizer=a,n=a),d++}},t.get=function(e){if(e instanceof qr)return e;for(var t=this.recognizers,o=0;o<t.length;o++)if(t[o].options.event===e)return t[o];return null},t.add=function(e){if(Gt(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},t.remove=function(e){if(Gt(e,"remove",this))return this;var t=this.get(e);if(e){var o=this.recognizers,n=Bt(o,t);-1!==n&&(o.splice(n,1),this.touchAction.update())}return this},t.on=function(e,t){if(void 0===e||void 0===t)return this;var o=this.handlers;return ft(Nt(e),function(e){o[e]=o[e]||[],o[e].push(t)}),this},t.off=function(e,t){if(void 0===e)return this;var o=this.handlers;return ft(Nt(e),function(e){t?o[e]&&o[e].splice(Bt(o[e],t),1):delete o[e]}),this},t.emit=function(e,t){this.options.domEvents&&Kt(e,t);var o=this.handlers[e]&&this.handlers[e].slice();if(o&&o.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var n=0;n<o.length;)o[n](t),n++}},t.destroy=function(){this.element&&$t(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},e}(),Kr={touchstart:hr,touchmove:gr,touchend:mr,touchcancel:yr},Qr=function(e){function t(){var o=t.prototype,n;return o.evTarget="touchstart",o.evWin="touchstart touchmove touchend touchcancel",n=e.apply(this,arguments)||this,n.started=!1,n}ht(t,e);var o=t.prototype;return o.handler=function(e){var t=Kr[e.type];if(t===hr&&(this.started=!0),!!this.started){var o=Qt.call(this,e,t);t&(mr|yr)&&0==o[0].length-o[1].length&&(this.started=!1),this.callback(this.manager,t,{pointers:o[0],changedPointers:o[1],pointerType:ur,srcEvent:e})}},t}(Er),Jr=function(e){function t(t){return void 0===t&&(t={}),e.call(this,pt({pointers:1},t))||this}ht(t,e);var o=t.prototype;return o.attrTest=function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},o.process=function(e){var t=this.state,o=e.eventType,n=t&(Ar|Hr),i=this.attrTest(e);return n&&(o&yr||!i)?t|Ur:n||i?o&mr?t|jr:t&Ar?t|Hr:Ar:Vr},t}(qr),el=function(e){function t(t){var o;return void 0===t&&(t={}),o=e.call(this,pt({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this,o.pTime=!1,o.pCenter=!1,o._timer=null,o._input=null,o.count=0,o}ht(t,e);var o=t.prototype;return o.getTouchAction=function(){return["manipulation"]},o.process=function(e){var t=this,o=this.options,n=e.pointers.length===o.pointers,i=e.distance<o.threshold,a=e.deltaTime<o.time;if(this.reset(),e.eventType&hr&&0===this.count)return this.failTimeout();if(i&&a&&n){if(e.eventType!==mr)return this.failTimeout();var d=!this.pTime||e.timeStamp-this.pTime<o.interval,s=!this.pCenter||St(this.pCenter,e.center)<o.posThreshold;this.pTime=e.timeStamp,this.pCenter=e.center,s&&d?this.count+=1:this.count=1,this._input=e;var r=this.count%o.taps;if(0==r)return this.hasRequireFailures()?(this._timer=setTimeout(function(){t.state=Wr,t.tryEmit()},o.interval),Ar):Wr}return Vr},o.failTimeout=function(){var e=this;return this._timer=setTimeout(function(){e.state=Vr},this.options.interval),Vr},o.reset=function(){clearTimeout(this._timer)},o.emit=function(){this.state===Wr&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},t}(qr),tl=function(e){function t(t){var o;return void 0===t&&(t={}),o=e.call(this,pt({event:"pan",threshold:10,pointers:1,direction:Sr},t))||this,o.pX=null,o.pY=null,o}ht(t,e);var o=t.prototype;return o.getTouchAction=function(){var e=this.options.direction,t=[];return e&wr&&t.push(ar),e&xr&&t.push(ir),t},o.directionTest=function(e){var t=this.options,o=!0,n=e.distance,i=e.direction,a=e.deltaX,d=e.deltaY;return i&t.direction||(t.direction&wr?(i=0===a?fr:0>a?br:_r,o=a!==this.pX,n=So(e.deltaX)):(i=0===d?fr:0>d?vr:kr,o=d!==this.pY,n=So(e.deltaY))),e.direction=i,o&&n>t.threshold&&i&t.direction},o.attrTest=function(e){return Jr.prototype.attrTest.call(this,e)&&(this.state&Ar||!(this.state&Ar)&&this.directionTest(e))},o.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var o=Jt(t.direction);o&&(t.additionalEvent=this.options.event+o),e.prototype.emit.call(this,t)},t}(Jr),ol=function(e){function t(t){return void 0===t&&(t={}),e.call(this,pt({event:"swipe",threshold:10,velocity:.3,direction:wr|xr,pointers:1},t))||this}ht(t,e);var o=t.prototype;return o.getTouchAction=function(){return tl.prototype.getTouchAction.call(this)},o.attrTest=function(t){var o=this.options.direction,n;return o&(wr|xr)?n=t.overallVelocity:o&wr?n=t.overallVelocityX:o&xr&&(n=t.overallVelocityY),e.prototype.attrTest.call(this,t)&&o&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers===this.options.pointers&&Ks(n)>this.options.velocity&&t.eventType&mr},o.emit=function(e){var t=Jt(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)},t}(Jr),nl=function(e){function t(t){return void 0===t&&(t={}),e.call(this,pt({event:"pinch",threshold:0,pointers:2},t))||this}ht(t,e);var o=t.prototype;return o.getTouchAction=function(){return[nr]},o.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(So(t.scale-1)>this.options.threshold||this.state&Ar)},o.emit=function(t){if(1!==t.scale){var o=1>t.scale?"in":"out";t.additionalEvent=this.options.event+o}e.prototype.emit.call(this,t)},t}(Jr),il=function(e){function t(t){return void 0===t&&(t={}),e.call(this,pt({event:"rotate",threshold:0,pointers:2},t))||this}ht(t,e);var o=t.prototype;return o.getTouchAction=function(){return[nr]},o.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(So(t.rotation)>this.options.threshold||this.state&Ar)},t}(Jr),al=function(e){function t(t){var o;return void 0===t&&(t={}),o=e.call(this,pt({event:"press",pointers:1,time:251,threshold:9},t))||this,o._timer=null,o._input=null,o}ht(t,e);var o=t.prototype;return o.getTouchAction=function(){return["auto"]},o.process=function(e){var t=this,o=this.options,n=e.pointers.length===o.pointers,i=e.distance<o.threshold,a=e.deltaTime>o.time;if(this._input=e,!i||!n||e.eventType&(mr|yr)&&!a)this.reset();else if(e.eventType&hr)this.reset(),this._timer=setTimeout(function(){t.state=Wr,t.tryEmit()},o.time);else if(e.eventType&mr)return Wr;return Vr},o.reset=function(){clearTimeout(this._timer)},o.emit=function(e){this.state!==Wr||(e&&e.eventType&mr?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=Qs(),this.manager.emit(this.options.event,this._input)))},t}(qr),dl=eo(function(e,t,o){for(var n=Object.keys(t),a=0;a<n.length;)(!o||o&&void 0===e[n[a]])&&(e[n[a]]=t[n[a]]),a++;return e},"extend","Use `assign`."),sl=eo(function(e,t){return dl(e,t,!0)},"merge","Use `assign`."),rl=function(){var e=function(e,t){return void 0===t&&(t={}),new $r(e,pt({recognizers:[[il,{enable:!1}],[nl,{enable:!1},["rotate"]],[ol,{direction:wr}],[tl,{direction:wr},["swipe"]],[el],[el,{event:"doubletap",taps:2},["tap"]],[al]]},t))};return e.VERSION="2.0.15",e.DIRECTION_ALL=Sr,e.DIRECTION_DOWN=kr,e.DIRECTION_LEFT=br,e.DIRECTION_RIGHT=_r,e.DIRECTION_UP=vr,e.DIRECTION_HORIZONTAL=wr,e.DIRECTION_VERTICAL=xr,e.DIRECTION_NONE=fr,e.DIRECTION_DOWN=kr,e.INPUT_START=hr,e.INPUT_MOVE=gr,e.INPUT_END=mr,e.INPUT_CANCEL=yr,e.STATE_POSSIBLE=Lr,e.STATE_BEGAN=Ar,e.STATE_CHANGED=Hr,e.STATE_ENDED=jr,e.STATE_RECOGNIZED=Wr,e.STATE_CANCELLED=Ur,e.STATE_FAILED=Vr,e.Manager=$r,e.Input=Er,e.TouchAction=Tr,e.TouchInput=Yr,e.MouseInput=zr,e.PointerEventInput=Fr,e.TouchMouseInput=Br,e.SingleTouchInput=Qr,e.Recognizer=qr,e.AttrRecognizer=Jr,e.Tap=el,e.Pan=tl,e.Swipe=ol,e.Pinch=nl,e.Rotate=il,e.Press=al,e.on=Yt,e.off=Rt,e.each=ft,e.merge=sl,e.extend=dl,e.bindFn=oo,e.assign=qs,e.inherit=to,e.bindFn=oo,e.prefixed=mt,e.toArray=Lt,e.inArray=Bt,e.uniqueArray=At,e.splitStr=Nt,e.boolOrFn=bt,e.hasParent=kt,e.addEventListeners=Yt,e.removeEventListeners=Rt,e.defaults=Xr,e}(),ll=Le(function(e){function t(){var e=function(){};return{on:e,off:e,destroy:e,emit:e,get:function(){return{set:e}}}}if("undefined"!=typeof window){var o=window.Hammer||rl;e.exports=o}else e.exports=function(){return t()}}),cl=Object.freeze({default:ll,__moduleExports:ll});(function(e){return e&&e["default"]||e})(Ws),Ts(no.prototype),no.current=null,no.prototype.destroy=function(){this.deactivate(),this.dom.overlay.parentNode.removeChild(this.dom.overlay),this.onClick&&document.body.removeEventListener("click",this.onClick),this.keycharm!==void 0&&this.keycharm.destroy(),this.keycharm=null,this.hammer.destroy(),this.hammer=null},no.prototype.activate=function(){no.current&&no.current.deactivate(),no.current=this,this.active=!0,this.dom.overlay.style.display="none",Wd.addClassName(this.dom.container,"vis-active"),this.emit("change"),this.emit("activate"),this.keycharm.bind("esc",this.escListener)},no.prototype.deactivate=function(){this.active=!1,this.dom.overlay.style.display="",Wd.removeClassName(this.dom.container,"vis-active"),this.keycharm.unbind("esc",this.escListener),this.emit("change"),this.emit("deactivate")},no.prototype._onTapOverlay=function(e){this.activate(),e.stopPropagation()};var ul=Le(function(e,t){t.en={edit:"Edit",del:"Delete selected",back:"Back",addNode:"Add Node",addEdge:"Add Edge",editNode:"Edit Node",editEdge:"Edit Edge",addDescription:"Click in an empty space to place a new node.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",createEdgeError:"Cannot link edges to a cluster.",deleteClusterError:"Clusters cannot be deleted.",editClusterError:"Clusters cannot be edited."},t.en_EN=t.en,t.en_US=t.en,t.de={edit:"Editieren",del:"L\xF6sche Auswahl",back:"Zur\xFCck",addNode:"Knoten hinzuf\xFCgen",addEdge:"Kante hinzuf\xFCgen",editNode:"Knoten editieren",editEdge:"Kante editieren",addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",createEdgeError:"Es ist nicht m\xF6glich, Kanten mit Clustern zu verbinden.",deleteClusterError:"Cluster k\xF6nnen nicht gel\xF6scht werden.",editClusterError:"Cluster k\xF6nnen nicht editiert werden."},t.de_DE=t.de,t.es={edit:"Editar",del:"Eliminar selecci\xF3n",back:"Atr\xE1s",addNode:"A\xF1adir nodo",addEdge:"A\xF1adir arista",editNode:"Editar nodo",editEdge:"Editar arista",addDescription:"Haga clic en un lugar vac\xEDo para colocar un nuevo nodo.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",createEdgeError:"No se puede conectar una arista a un grupo.",deleteClusterError:"No es posible eliminar grupos.",editClusterError:"No es posible editar grupos."},t.es_ES=t.es,t.it={edit:"Modifica",del:"Cancella la selezione",back:"Indietro",addNode:"Aggiungi un nodo",addEdge:"Aggiungi un vertice",editNode:"Modifica il nodo",editEdge:"Modifica il vertice",addDescription:"Clicca per aggiungere un nuovo nodo",edgeDescription:"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",editEdgeDescription:"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",createEdgeError:"Non si possono collegare vertici ad un cluster",deleteClusterError:"I cluster non possono essere cancellati",editClusterError:"I clusters non possono essere modificati."},t.it_IT=t.it,t.nl={edit:"Wijzigen",del:"Selectie verwijderen",back:"Terug",addNode:"Node toevoegen",addEdge:"Link toevoegen",editNode:"Node wijzigen",editEdge:"Link wijzigen",addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",createEdgeError:"Kan geen link maken naar een cluster.",deleteClusterError:"Clusters kunnen niet worden verwijderd.",editClusterError:"Clusters kunnen niet worden aangepast."},t.nl_NL=t.nl,t.nl_BE=t.nl,t["pt-br"]={edit:"Editar",del:"Remover selecionado",back:"Voltar",addNode:"Adicionar n\xF3",addEdge:"Adicionar aresta",editNode:"Editar n\xF3",editEdge:"Editar aresta",addDescription:"Clique em um espa\xE7o em branco para adicionar um novo n\xF3",edgeDescription:"Clique em um n\xF3 e arraste a aresta at\xE9 outro n\xF3 para conect\xE1-los",editEdgeDescription:"Clique nos pontos de controle e os arraste para um n\xF3 para conect\xE1-los",createEdgeError:"N\xE3o foi poss\xEDvel linkar arestas a um cluster.",deleteClusterError:"Clusters n\xE3o puderam ser removidos.",editClusterError:"Clusters n\xE3o puderam ser editados."},t["pt-BR"]=t["pt-br"],t.pt_BR=t["pt-br"],t.pt_br=t["pt-br"],t.ru={edit:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C",del:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0435",back:"\u041D\u0430\u0437\u0430\u0434",addNode:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0443\u0437\u0435\u043B",addEdge:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0440\u0435\u0431\u0440\u043E",editNode:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0443\u0437\u0435\u043B",editEdge:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0440\u0435\u0431\u0440\u043E",addDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u0432 \u0441\u0432\u043E\u0431\u043E\u0434\u043D\u043E\u0435 \u043C\u0435\u0441\u0442\u043E, \u0447\u0442\u043E\u0431\u044B \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u0443\u0437\u0435\u043B.",edgeDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u043D\u0430 \u0443\u0437\u0435\u043B \u0438 \u043F\u0440\u043E\u0442\u044F\u043D\u0438\u0442\u0435 \u0440\u0435\u0431\u0440\u043E \u043A \u0434\u0440\u0443\u0433\u043E\u043C\u0443 \u0443\u0437\u043B\u0443, \u0447\u0442\u043E\u0431\u044B \u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u0438\u0445.",editEdgeDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u043D\u0430 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u044B\u0435 \u0442\u043E\u0447\u043A\u0438 \u0438 \u043F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0438\u0445 \u0432 \u0443\u0437\u0435\u043B, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0441\u044F \u043A \u043D\u0435\u043C\u0443.",createEdgeError:"\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u0440\u0435\u0431\u0440\u0430 \u0432 \u043A\u043B\u0430\u0441\u0442\u0435\u0440.",deleteClusterError:"\u041A\u043B\u0430\u0441\u0442\u0435\u0440\u044B \u043D\u0435 \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u0443\u0434\u0430\u043B\u0435\u043D\u044B",editClusterError:"\u041A\u043B\u0430\u0441\u0442\u0435\u0440\u044B \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F."},t.ru_RU=t.ru,t.cn={edit:"\u7F16\u8F91",del:"\u5220\u9664\u9009\u5B9A",back:"\u8FD4\u56DE",addNode:"\u6DFB\u52A0\u8282\u70B9",addEdge:"\u6DFB\u52A0\u8FDE\u63A5\u7EBF",editNode:"\u7F16\u8F91\u8282\u70B9",editEdge:"\u7F16\u8F91\u8FDE\u63A5\u7EBF",addDescription:"\u5355\u51FB\u7A7A\u767D\u5904\u653E\u7F6E\u65B0\u8282\u70B9\u3002",edgeDescription:"\u5355\u51FB\u67D0\u4E2A\u8282\u70B9\u5E76\u5C06\u8BE5\u8FDE\u63A5\u7EBF\u62D6\u52A8\u5230\u53E6\u4E00\u4E2A\u8282\u70B9\u4EE5\u8FDE\u63A5\u5B83\u4EEC\u3002",editEdgeDescription:"\u5355\u51FB\u63A7\u5236\u8282\u70B9\u5E76\u5C06\u5B83\u4EEC\u62D6\u5230\u8282\u70B9\u4E0A\u8FDE\u63A5\u3002",createEdgeError:"\u65E0\u6CD5\u5C06\u8FDE\u63A5\u7EBF\u8FDE\u63A5\u5230\u7FA4\u96C6\u3002",deleteClusterError:"\u65E0\u6CD5\u5220\u9664\u7FA4\u96C6\u3002",editClusterError:"\u65E0\u6CD5\u7F16\u8F91\u7FA4\u96C6\u3002"},t.zh_CN=t.cn,t.uk={edit:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438",del:"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u043E\u0431\u0440\u0430\u043D\u0435",back:"\u041D\u0430\u0437\u0430\u0434",addNode:"\u0414\u043E\u0434\u0430\u0442\u0438 \u0432\u0443\u0437\u043E\u043B",addEdge:"\u0414\u043E\u0434\u0430\u0442\u0438 \u043A\u0440\u0430\u0439",editNode:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u0432\u0443\u0437\u043E\u043B",editEdge:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u043A\u0440\u0430\u0439",addDescription:"K\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u0432\u0456\u043B\u044C\u043D\u0435 \u043C\u0456\u0441\u0446\u0435, \u0449\u043E\u0431 \u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0438\u0439 \u0432\u0443\u0437\u043E\u043B.",edgeDescription:"\u041A\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u0432\u0443\u0437\u043E\u043B \u0456 \u043F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u043A\u0440\u0430\u0439 \u0434\u043E \u0456\u043D\u0448\u043E\u0433\u043E \u0432\u0443\u0437\u043B\u0430, \u0449\u043E\u0431 \u0457\u0445 \u0437'\u0454\u0434\u043D\u0430\u0442\u0438.",editEdgeDescription:"\u041A\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u0456 \u0442\u043E\u0447\u043A\u0438 \u0456 \u043F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u0457\u0445 \u0443 \u0432\u0443\u0437\u043E\u043B, \u0449\u043E\u0431 \u043F\u0456\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u0438\u0441\u044F \u0434\u043E \u043D\u044C\u043E\u0433\u043E.",createEdgeError:"\u041D\u0435 \u043C\u043E\u0436\u043B\u0438\u0432\u043E \u043E\u0431'\u0454\u0434\u043D\u0430\u0442\u0438 \u043A\u0440\u0430\u0457 \u0432 \u0433\u0440\u0443\u043F\u0443.",deleteClusterError:"\u0413\u0440\u0443\u043F\u0438 \u043D\u0435 \u043C\u043E\u0436\u0443\u0442\u044C \u0431\u0443\u0442\u0438 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u0456.",editClusterError:"\u0413\u0440\u0443\u043F\u0438 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0456 \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u043D\u043D\u044F."},t.uk_UA=t.uk,t.fr={edit:"Editer",del:"Effacer la selection",back:"Retour",addNode:"Ajouter un noeud",addEdge:"Ajouter un lien",editNode:"Editer le noeud",editEdge:"Editer le lien",addDescription:"Cliquez dans un endroit vide pour placer un noeud.",edgeDescription:"Cliquez sur un noeud et glissez le lien vers un autre noeud pour les connecter.",editEdgeDescription:"Cliquez sur les points de contr\xF4le et glissez-les pour connecter un noeud.",createEdgeError:"Impossible de cr\xE9er un lien vers un cluster.",deleteClusterError:"Les clusters ne peuvent pas \xEAtre \xE9ffac\xE9s.",editClusterError:"Les clusters ne peuvent pas \xEAtre \xE9dites."},t.fr_FR=t.fr,t.cs={edit:"Upravit",del:"Smazat v\xFDb\u011Br",back:"Zp\u011Bt",addNode:"P\u0159idat vrchol",addEdge:"P\u0159idat hranu",editNode:"Upravit vrchol",editEdge:"Upravit hranu",addDescription:"Kluknut\xEDm do pr\xE1zdn\xE9ho prostoru m\u016F\u017Eete p\u0159idat nov\xFD vrchol.",edgeDescription:"P\u0159eta\u017Een\xEDm z jednoho vrcholu do druh\xE9ho m\u016F\u017Eete spojit tyto vrcholy novou hranou.",editEdgeDescription:"P\u0159eta\u017Een\xEDm kontroln\xEDho vrcholu hrany ji m\u016F\u017Eete p\u0159ipojit k jin\xE9mu vrcholu.",createEdgeError:"Nelze p\u0159ipojit hranu ke shluku.",deleteClusterError:"Nelze mazat shluky.",editClusterError:"Nelze upravovat shluky."},t.cs_CZ=t.cs}),pl=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},hl=function(e,t,o){return t&&ao(e.prototype,t),o&&ao(e,o),e},gl=function(){function e(){pl(this,e),this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}return hl(e,[{key:"init",value:function(){if(!this.initialized()){this.src=this.image.src;var e=this.image.width,t=this.image.height;this.width=e,this.height=t;var o=Eo(t/2),n=Eo(t/4),i=Eo(t/8),a=Eo(t/16),d=Eo(e/2),s=Eo(e/4),r=Eo(e/8),l=Eo(e/16);this.canvas.width=3*s,this.canvas.height=o,this.coordinates=[[0,0,d,o],[d,0,s,n],[d,n,r,i],[5*r,n,l,a]],this._fillMipMap()}}},{key:"initialized",value:function(){return void 0!==this.coordinates}},{key:"_fillMipMap",value:function(){var e=this.canvas.getContext("2d"),t=this.coordinates[0];e.drawImage(this.image,t[0],t[1],t[2],t[3]);for(var o=1;o<this.NUM_ITERATIONS;o++){var n=this.coordinates[o-1],i=this.coordinates[o];e.drawImage(this.canvas,n[0],n[1],n[2],n[3],i[0],i[1],i[2],i[3])}}},{key:"drawImageAtPosition",value:function(e,t,o,n,i,a){if(this.initialized())if(2<t){t*=.5;for(var d=0;2<t&&d<this.NUM_ITERATIONS;)t*=.5,d+=1;d>=this.NUM_ITERATIONS&&(d=this.NUM_ITERATIONS-1);var s=this.coordinates[d];e.drawImage(this.canvas,s[0],s[1],s[2],s[3],o,n,i,a)}else e.drawImage(this.image,o,n,i,a)}}]),e}(),ml=function(){function e(t){pl(this,e),this.images={},this.imageBroken={},this.callback=t}return hl(e,[{key:"_tryloadBrokenUrl",value:function(e,t,o){return void 0===e||void 0===o?void 0:void 0===t?void console.warn("No broken url image defined"):void(o.image.onerror=function(){console.error("Could not load brokenImage:",t)},o.image.src=t)}},{key:"_redrawWithImage",value:function(e){this.callback&&this.callback(e)}},{key:"load",value:function(e,t){var o=this,n=this.images[e];if(n)return n;var i=new gl;return this.images[e]=i,i.image.onload=function(){o._fixImageCoordinates(i.image),i.init(),o._redrawWithImage(i)},i.image.onerror=function(){console.error("Could not load image:",e),o._tryloadBrokenUrl(e,t,i)},i.image.src=e,i}},{key:"_fixImageCoordinates",value:function(e){0===e.width&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}}]),e}(),yl=function(){function e(){pl(this,e),this.clear(),this.defaultIndex=0,this.groupsArray=[],this.groupIndex=0,this.defaultGroups=[{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},{border:"#FFA500",background:"#FFFF00",highlight:{border:"#FFA500",background:"#FFFFA3"},hover:{border:"#FFA500",background:"#FFFFA3"}},{border:"#FA0A10",background:"#FB7E81",highlight:{border:"#FA0A10",background:"#FFAFB1"},hover:{border:"#FA0A10",background:"#FFAFB1"}},{border:"#41A906",background:"#7BE141",highlight:{border:"#41A906",background:"#A1EC76"},hover:{border:"#41A906",background:"#A1EC76"}},{border:"#E129F0",background:"#EB7DF4",highlight:{border:"#E129F0",background:"#F0B3F5"},hover:{border:"#E129F0",background:"#F0B3F5"}},{border:"#7C29F0",background:"#AD85E4",highlight:{border:"#7C29F0",background:"#D3BDF0"},hover:{border:"#7C29F0",background:"#D3BDF0"}},{border:"#C37F00",background:"#FFA807",highlight:{border:"#C37F00",background:"#FFCA66"},hover:{border:"#C37F00",background:"#FFCA66"}},{border:"#4220FB",background:"#6E6EFD",highlight:{border:"#4220FB",background:"#9B9BFD"},hover:{border:"#4220FB",background:"#9B9BFD"}},{border:"#FD5A77",background:"#FFC0CB",highlight:{border:"#FD5A77",background:"#FFD1D9"},hover:{border:"#FD5A77",background:"#FFD1D9"}},{border:"#4AD63A",background:"#C2FABC",highlight:{border:"#4AD63A",background:"#E6FFE3"},hover:{border:"#4AD63A",background:"#E6FFE3"}},{border:"#990000",background:"#EE0000",highlight:{border:"#BB0000",background:"#FF3333"},hover:{border:"#BB0000",background:"#FF3333"}},{border:"#FF6000",background:"#FF6000",highlight:{border:"#FF6000",background:"#FF6000"},hover:{border:"#FF6000",background:"#FF6000"}},{border:"#97C2FC",background:"#2B7CE9",highlight:{border:"#D2E5FF",background:"#2B7CE9"},hover:{border:"#D2E5FF",background:"#2B7CE9"}},{border:"#399605",background:"#255C03",highlight:{border:"#399605",background:"#255C03"},hover:{border:"#399605",background:"#255C03"}},{border:"#B70054",background:"#FF007E",highlight:{border:"#B70054",background:"#FF007E"},hover:{border:"#B70054",background:"#FF007E"}},{border:"#AD85E4",background:"#7C29F0",highlight:{border:"#D3BDF0",background:"#7C29F0"},hover:{border:"#D3BDF0",background:"#7C29F0"}},{border:"#4557FA",background:"#000EA1",highlight:{border:"#6E6EFD",background:"#000EA1"},hover:{border:"#6E6EFD",background:"#000EA1"}},{border:"#FFC0CB",background:"#FD5A77",highlight:{border:"#FFD1D9",background:"#FD5A77"},hover:{border:"#FFD1D9",background:"#FD5A77"}},{border:"#C2FABC",background:"#74D66A",highlight:{border:"#E6FFE3",background:"#74D66A"},hover:{border:"#E6FFE3",background:"#74D66A"}},{border:"#EE0000",background:"#990000",highlight:{border:"#FF3333",background:"#BB0000"},hover:{border:"#FF3333",background:"#BB0000"}}],this.options={},this.defaultOptions={useDefaultGroups:!0},Wd.extend(this.options,this.defaultOptions)}return hl(e,[{key:"setOptions",value:function(e){var t=["useDefaultGroups"];if(void 0!==e)for(var o in e)if(e.hasOwnProperty(o)&&-1===t.indexOf(o)){var n=e[o];this.add(o,n)}}},{key:"clear",value:function(){this.groups={},this.groupsArray=[]}},{key:"get",value:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],o=this.groups[e];if(void 0===o&&t)if(!1===this.options.useDefaultGroups&&0<this.groupsArray.length){var n=this.groupIndex%this.groupsArray.length;this.groupIndex++,o={},o.color=this.groups[this.groupsArray[n]],this.groups[e]=o}else{var i=this.defaultIndex%this.defaultGroups.length;this.defaultIndex++,o={},o.color=this.defaultGroups[i],this.groups[e]=o}return o}},{key:"add",value:function(e,t){return this.groups[e]=t,this.groupsArray.push(e),t}}]),e}(),fl=so,bl=function(e){if(Array.isArray(e))return e},_l=ro,vl=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")},kl=lo,wl=Le(function(e){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function o(n){return e.exports="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?o=function(e){return t(e)}:o=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":t(e)},o(n)}e.exports=o}),xl=function(){function e(){pl(this,e)}return hl(e,null,[{key:"choosify",value:function(e,t){var o=["node","edge","label"],n=!0,i=Wd.topMost(t,"chosen");if("boolean"==typeof i)n=i;else if("object"===wl(i)){if(-1===o.indexOf(e))throw new Error("choosify: subOption '"+e+"' should be one of '"+o.join("', '")+"'");var a=Wd.topMost(t,["chosen",e]);("boolean"==typeof a||"function"==typeof a)&&(n=a)}return n}},{key:"pointInRect",value:function(e,t,o){if(0>=e.width||0>=e.height)return!1;if(void 0!==o){var n={x:t.x-o.x,y:t.y-o.y};if(0!==o.angle){var i=-o.angle,a={x:bo(i)*n.x-_o(i)*n.y,y:_o(i)*n.x+bo(i)*n.y};t=a}else t=n}var d=e.x+e.width,s=e.y+e.width;return e.left<t.x&&d>t.x&&e.top<t.y&&s>t.y}},{key:"isValidLabel",value:function(e){return"string"==typeof e&&""!==e}}]),e}(),Sl=function(){function e(t){pl(this,e),this.measureText=t,this.current=0,this.width=0,this.height=0,this.lines=[]}return hl(e,[{key:"_add",value:function(e,t){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"normal";void 0===this.lines[e]&&(this.lines[e]={width:0,height:0,blocks:[]});var n=t;(void 0===t||""===t)&&(n=" ");var i=this.measureText(n,o),a=Object.assign({},i.values);a.text=t,a.width=i.width,a.mod=o,(void 0===t||""===t)&&(a.width=0),this.lines[e].blocks.push(a),this.lines[e].width+=a.width}},{key:"curWidth",value:function(){var e=this.lines[this.current];return void 0===e?0:e.width}},{key:"append",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,e,t)}},{key:"newLine",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,e,t),this.current++}},{key:"determineLineHeights",value:function(){for(var e=0;e<this.lines.length;e++){var t=this.lines[e],o=0;if(void 0!==t.blocks)for(var n=0,i;n<t.blocks.length;n++)i=t.blocks[n],o<i.height&&(o=i.height);t.height=o}}},{key:"determineLabelSize",value:function(){for(var e=0,t=0,o=0,n;o<this.lines.length;o++)n=this.lines[o],n.width>e&&(e=n.width),t+=n.height;this.width=e,this.height=t}},{key:"removeEmptyBlocks",value:function(){for(var e=[],t=0,o;t<this.lines.length;t++)if(o=this.lines[t],0!==o.blocks.length){if(t==this.lines.length-1&&0===o.width)continue;var n={};Object.assign(n,o),n.blocks=[];for(var i=void 0,a=[],d=0,s;d<o.blocks.length;d++)s=o.blocks[d],0===s.width?void 0===i&&(i=s):a.push(s);0===a.length&&void 0!==i&&a.push(i),n.blocks=a,e.push(n)}return e}},{key:"finalize",value:function(){this.determineLineHeights(),this.determineLabelSize();var e=this.removeEmptyBlocks();return{width:this.width,height:this.height,lines:e}}}]),e}(),Ol={"<b>":/<b>/,"<i>":/<i>/,"<code>":/<code>/,"</b>":/<\/b>/,"</i>":/<\/i>/,"</code>":/<\/code>/,"*":/\*/,_:/\_/,"`":/`/,afterBold:/[^\*]/,afterItal:/[^_]/,afterMono:/[^`]/},Dl=function(){function e(t){pl(this,e),this.text=t,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}return hl(e,[{key:"mod",value:function(){return 0===this.modStack.length?"normal":this.modStack[0]}},{key:"modName",value:function(){return 0===this.modStack.length?"normal":"mono"===this.modStack[0]?"mono":this.bold&&this.ital?"boldital":this.bold?"bold":this.ital?"ital":void 0}},{key:"emitBlock",value:function(){this.spacing&&(this.add(" "),this.spacing=!1),0<this.buffer.length&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}},{key:"add",value:function(e){" "===e&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1)," "!=e&&(this.buffer+=e)}},{key:"parseWS",value:function(e){return!!/[ \t]/.test(e)&&(this.mono?this.add(e):this.spacing=!0,!0)}},{key:"setTag",value:function(e){this.emitBlock(),this[e]=!0,this.modStack.unshift(e)}},{key:"unsetTag",value:function(e){this.emitBlock(),this[e]=!1,this.modStack.shift()}},{key:"parseStartTag",value:function(e,t){return!(this.mono||this[e]||!this.match(t))&&(this.setTag(e),!0)}},{key:"match",value:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],o=this.prepareRegExp(e),n=kl(o,2),i=n[0],a=n[1],d=i.test(this.text.substr(this.position,a));return d&&t&&(this.position+=a-1),d}},{key:"parseEndTag",value:function(e,t,o){var n=this.mod()===e;return n="mono"===e?n&&this.mono:n&&!this.mono,!!(n&&this.match(t))&&(void 0===o?this.unsetTag(e):(this.position===this.text.length-1||this.match(o,!1))&&this.unsetTag(e),!0)}},{key:"replace",value:function(e,t){return!!this.match(e)&&(this.add(t),this.position+=length-1,!0)}},{key:"prepareRegExp",value:function(e){var t,o;if(e instanceof RegExp)o=e,t=1;else{var n=Ol[e];o=void 0===n?new RegExp(e):n,t=e.length}return[o,t]}}]),e}(),Tl=function(){function e(t,o,n,i){var a=this;pl(this,e),this.ctx=t,this.parent=o,this.selected=n,this.hover=i;this.lines=new Sl(function(e,o){if(void 0===e)return 0;var d=a.parent.getFormattingValues(t,n,i,o),s=0;if(""!==e){var r=a.ctx.measureText(e);s=r.width}return{width:s,values:d}})}return hl(e,[{key:"process",value:function(e){if(!xl.isValidLabel(e))return this.lines.finalize();var t=this.parent.fontOptions;e=e.replace(/\r\n/g,"\n"),e=e.replace(/\r/g,"\n");var o=(e+"").split("\n"),n=o.length;if(t.multi){for(var a=0,d;a<n;a++)if(d=this.splitBlocks(o[a],t.multi),void 0!==d){if(0===d.length){this.lines.newLine("");continue}if(0<t.maxWdt)for(var s=0;s<d.length;s++){var r=d[s].mod,l=d[s].text;this.splitStringIntoLines(l,r,!0)}else for(var c=0;c<d.length;c++){var u=d[c].mod,p=d[c].text;this.lines.append(p,u)}this.lines.newLine()}}else if(0<t.maxWdt)for(var h=0;h<n;h++)this.splitStringIntoLines(o[h]);else for(var g=0;g<n;g++)this.lines.newLine(o[g]);return this.lines.finalize()}},{key:"decodeMarkupSystem",value:function(e){var t="none";return"markdown"===e||"md"===e?t="markdown":(!0===e||"html"===e)&&(t="html"),t}},{key:"splitHtmlBlocks",value:function(e){for(var t=new Dl(e),o=function(e){if(/&/.test(e)){var o=t.replace(t.text,"&lt;","<")||t.replace(t.text,"&amp;","&");return o||t.add("&"),!0}return!1};t.position<t.text.length;){var n=t.text.charAt(t.position),i=t.parseWS(n)||/</.test(n)&&(t.parseStartTag("bold","<b>")||t.parseStartTag("ital","<i>")||t.parseStartTag("mono","<code>")||t.parseEndTag("bold","</b>")||t.parseEndTag("ital","</i>")||t.parseEndTag("mono","</code>"))||o(n);i||t.add(n),t.position++}return t.emitBlock(),t.blocks}},{key:"splitMarkdownBlocks",value:function(e){for(var t=this,o=new Dl(e),n=!0,i=function(e){return!!/\\/.test(e)&&(o.position<t.text.length+1&&(o.position++,e=t.text.charAt(o.position),/ \t/.test(e)?o.spacing=!0:(o.add(e),n=!1)),!0)};o.position<o.text.length;){var a=o.text.charAt(o.position),d=o.parseWS(a)||i(a)||(n||o.spacing)&&(o.parseStartTag("bold","*")||o.parseStartTag("ital","_")||o.parseStartTag("mono","`"))||o.parseEndTag("bold","*","afterBold")||o.parseEndTag("ital","_","afterItal")||o.parseEndTag("mono","`","afterMono");d||(o.add(a),n=!1),o.position++}return o.emitBlock(),o.blocks}},{key:"splitBlocks",value:function(e,t){var o=this.decodeMarkupSystem(t);return"none"===o?[{text:e,mod:"normal"}]:"markdown"===o?this.splitMarkdownBlocks(e):"html"===o?this.splitHtmlBlocks(e):void 0}},{key:"overMaxWidth",value:function(e){var t=this.ctx.measureText(e).width;return this.lines.curWidth()+t>this.parent.fontOptions.maxWdt}},{key:"getLongestFit",value:function(e){for(var t="",o=0;o<e.length;){var n=""===t?"":" ",i=t+n+e[o];if(this.overMaxWidth(i))break;t=i,o++}return o}},{key:"getLongestFitWord",value:function(e){for(var t=0;t<e.length&&!this.overMaxWidth(e.slice(0,t));)t++;return t}},{key:"splitStringIntoLines",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"normal",o=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2];this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");for(var n=e.split("\r"),i;0<n.length;)if(i=this.getLongestFit(n),0===i){var a=n[0],d=this.getLongestFitWord(a);this.lines.newLine(a.slice(0,d),t),n[0]=a.slice(d)}else{var s=i;" "===n[i-1]?i--:" "===n[s]&&s++;var r=n.slice(0,i).join("");i==n.length&&o?this.lines.append(r,t):this.lines.newLine(r,t),n=n.slice(s)}}}]),e}(),El=["bold","ital","boldital","mono"],Cl=function(){function e(t,o){var n=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2];pl(this,e),this.body=t,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(o),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=n}return hl(e,[{key:"setOptions",value:function(e){if(this.elementOptions=e,this.initFontOptions(e.font),xl.isValidLabel(e.label)?this.labelDirty=!0:e.label=void 0,void 0!==e.font&&null!==e.font)if("string"==typeof e.font)this.baseSize=this.fontOptions.size;else if("object"===wl(e.font)){var t=e.font.size;void 0!==t&&(this.baseSize=t)}}},{key:"initFontOptions",value:function(t){var o=this;return Wd.forEach(El,function(e){o.fontOptions[e]={}}),e.parseFontString(this.fontOptions,t)?void(this.fontOptions.vadjust=0):void Wd.forEach(t,function(e,t){void 0!==e&&null!==e&&"object"!==wl(e)&&(o.fontOptions[t]=e)})}},{key:"constrain",value:function(e){var t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},o=Wd.topMost(e,"widthConstraint");if("number"==typeof o)t.maxWdt=+o,t.minWdt=+o;else if("object"===wl(o)){var n=Wd.topMost(e,["widthConstraint","maximum"]);"number"==typeof n&&(t.maxWdt=+n);var i=Wd.topMost(e,["widthConstraint","minimum"]);"number"==typeof i&&(t.minWdt=+i)}var a=Wd.topMost(e,"heightConstraint");if("number"==typeof a)t.minHgt=+a;else if("object"===wl(a)){var d=Wd.topMost(e,["heightConstraint","minimum"]);"number"==typeof d&&(t.minHgt=+d);var s=Wd.topMost(e,["heightConstraint","valign"]);"string"==typeof s&&("top"===s||"bottom"===s)&&(t.valign=s)}return t}},{key:"update",value:function(e,t){this.setOptions(e,!0),this.propagateFonts(t),Wd.deepExtend(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=xl.choosify("label",t)}},{key:"adjustSizes",value:function(e){var t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);var o=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=o)}},{key:"addFontOptionsToPile",value:function(e,t){for(var o=0;o<t.length;++o)this.addFontToPile(e,t[o])}},{key:"addFontToPile",value:function(e,t){if(void 0!==t&&void 0!==t.font&&null!==t.font){var o=t.font;e.push(o)}}},{key:"getBasicOptions",value:function(t){for(var o={},i=0;i<t.length;++i){var a=t[i],d={};e.parseFontString(d,a)&&(a=d),Wd.forEach(a,function(e,t){void 0===e||o.hasOwnProperty(t)||(-1===El.indexOf(t)?o[t]=e:o[t]={})})}return o}},{key:"getFontOption",value:function(t,o,i){for(var a=0,d,s;a<t.length;++a)if(s=t[a],s.hasOwnProperty(o)){if(d=s[o],void 0===d||null===d)continue;var r={};if(e.parseFontString(r,d)&&(d=r),d.hasOwnProperty(i))return d[i]}if(this.fontOptions.hasOwnProperty(i))return this.fontOptions[i];throw new Error("Did not find value for multi-font for property: '"+i+"'")}},{key:"getFontOptions",value:function(e,t){for(var o={},n=["color","size","face","mod","vadjust"],a=0,d;a<n.length;++a)d=n[a],o[d]=this.getFontOption(e,t,d);return o}},{key:"propagateFonts",value:function(e){var t=this,o=[];this.addFontOptionsToPile(o,e),this.fontOptions=this.getBasicOptions(o);for(var n=function(e){var n=El[e],i=t.fontOptions[n],a=t.getFontOptions(o,n);Wd.forEach(a,function(e,t){i[t]=e}),i.size=+i.size,i.vadjust=+i.vadjust},a=0;a<El.length;++a)n(a)}},{key:"draw",value:function(e,t,o,n,i){var a=5<arguments.length&&void 0!==arguments[5]?arguments[5]:"middle";if(void 0!==this.elementOptions.label){var d=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&d<this.elementOptions.scaling.label.drawThreshold-1||(d>=this.elementOptions.scaling.label.maxVisible&&(d=+this.elementOptions.scaling.label.maxVisible/this.body.view.scale),this.calculateLabelSize(e,n,i,t,o,a),this._drawBackground(e),this._drawText(e,t,this.size.yLine,a,d))}}},{key:"_drawBackground",value:function(e){if(void 0!==this.fontOptions.background&&"none"!==this.fontOptions.background){e.fillStyle=this.fontOptions.background;var t=this.getSize();e.fillRect(t.left,t.top,t.width,t.height)}}},{key:"_drawText",value:function(e,t,o){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:"middle",a=4<arguments.length?arguments[4]:void 0,d=this._setAlignment(e,t,o,n),s=kl(d,2);t=s[0],o=s[1],e.textAlign="left",t-=this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&("top"===this.fontOptions.valign&&(o-=(this.size.height-this.size.labelHeight)/2),"bottom"===this.fontOptions.valign&&(o+=(this.size.height-this.size.labelHeight)/2));for(var r=0,l;r<this.lineCount;r++)if(l=this.lines[r],l&&l.blocks){var c=0;this.isEdgeLabel||"center"===this.fontOptions.align?c+=(this.size.width-l.width)/2:"right"===this.fontOptions.align&&(c+=this.size.width-l.width);for(var u=0,p;u<l.blocks.length;u++){p=l.blocks[u],e.font=p.font;var h=this._getColor(p.color,a,p.strokeColor),g=kl(h,2),m=g[0],f=g[1];0<p.strokeWidth&&(e.lineWidth=p.strokeWidth,e.strokeStyle=f,e.lineJoin="round"),e.fillStyle=m,0<p.strokeWidth&&e.strokeText(p.text,t+c,o+p.vadjust),e.fillText(p.text,t+c,o+p.vadjust),c+=p.width}o+=l.height}}},{key:"_setAlignment",value:function(e,t,o,n){if(this.isEdgeLabel&&"horizontal"!==this.fontOptions.align&&!1===this.pointToSelf){t=0,o=0;"top"===this.fontOptions.align?(e.textBaseline="alphabetic",o-=4):"bottom"===this.fontOptions.align?(e.textBaseline="hanging",o+=4):e.textBaseline="middle"}else e.textBaseline=n;return[t,o]}},{key:"_getColor",value:function(e,t,o){var n=e||"#000000",i=o||"#ffffff";if(t<=this.elementOptions.scaling.label.drawThreshold){var a=Co(0,Mo(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));n=Wd.overrideOpacity(n,a),i=Wd.overrideOpacity(i,a)}return[n,i]}},{key:"getTextSize",value:function(e){var t=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1],o=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2];return this._processLabel(e,t,o),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}},{key:"getSize",value:function(){var e=this.size.left,t=this.size.top-1;if(this.isEdgeLabel){var o=.5*-this.size.width;switch(this.fontOptions.align){case"middle":e=o,t=.5*-this.size.height;break;case"top":e=o,t=-(this.size.height+2);break;case"bottom":e=o,t=2;}}var n={left:e,top:t,width:this.size.width,height:this.size.height};return n}},{key:"calculateLabelSize",value:function(e,t,o){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,a=5<arguments.length&&void 0!==arguments[5]?arguments[5]:"middle";this._processLabel(e,t,o),this.size.left=n-.5*this.size.width,this.size.top=i-.5*this.size.height,this.size.yLine=i+.5*(1-this.lineCount)*this.fontOptions.size,"hanging"===a&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}},{key:"getFormattingValues",value:function(e,t,o,n){var i=function(e,t,o){return"normal"===t?"mod"===o?"":e[o]:void 0===e[t][o]?e[o]:e[t][o]},a={color:i(this.fontOptions,n,"color"),size:i(this.fontOptions,n,"size"),face:i(this.fontOptions,n,"face"),mod:i(this.fontOptions,n,"mod"),vadjust:i(this.fontOptions,n,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(t||o)&&("normal"===n&&!0===this.fontOptions.chooser&&this.elementOptions.labelHighlightBold?a.mod="bold":"function"==typeof this.fontOptions.chooser&&this.fontOptions.chooser(a,this.elementOptions.id,t,o));var d="";return void 0!==a.mod&&""!==a.mod&&(d+=a.mod+" "),d+=a.size+"px "+a.face,e.font=d.replace(/"/g,""),a.font=e.font,a.height=a.size,a}},{key:"differentState",value:function(e,t){return e!==this.selectedState||t!==this.hoverState}},{key:"_processLabelText",value:function(e,t,o,n){var i=new Tl(e,this,t,o);return i.process(n)}},{key:"_processLabel",value:function(e,t,o){if(!1!==this.labelDirty||this.differentState(t,o)){var n=this._processLabelText(e,t,o,this.elementOptions.label);0<this.fontOptions.minWdt&&n.width<this.fontOptions.minWdt&&(n.width=this.fontOptions.minWdt),this.size.labelHeight=n.height,0<this.fontOptions.minHgt&&n.height<this.fontOptions.minHgt&&(n.height=this.fontOptions.minHgt),this.lines=n.lines,this.lineCount=n.lines.length,this.size.width=n.width,this.size.height=n.height,this.selectedState=t,this.hoverState=o,this.labelDirty=!1}}},{key:"visible",value:function(){if(0===this.size.width||0===this.size.height||void 0===this.elementOptions.label)return!1;var e=this.fontOptions.size*this.body.view.scale;return!(e<this.elementOptions.scaling.label.drawThreshold-1)}}],[{key:"parseFontString",value:function(e,t){if(!t||"string"!=typeof t)return!1;var o=t.split(" ");return e.size=+o[0].replace("px",""),e.face=o[1],e.color=o[2],!0}}]),e}(),Ml=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},Il=function(e,t){return t&&("object"===wl(t)||"function"==typeof t)?t:Ml(e)},Pl=Le(function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(n)}e.exports=t}),Fl=Le(function(e){function t(n,o){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(n,o)}e.exports=t}),Nl=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Fl(e,t)},Yl=function(){function e(t,o,n){pl(this,e),this.body=o,this.labelModule=n,this.setOptions(t),this.top=void 0,this.left=void 0,this.height=void 0,this.width=void 0,this.radius=void 0,this.margin=void 0,this.refreshNeeded=!0,this.boundingBox={top:0,left:0,right:0,bottom:0}}return hl(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"_setMargins",value:function(e){this.margin={},this.options.margin&&("object"==wl(this.options.margin)?(this.margin.top=this.options.margin.top,this.margin.right=this.options.margin.right,this.margin.bottom=this.options.margin.bottom,this.margin.left=this.options.margin.left):(this.margin.top=this.options.margin,this.margin.right=this.options.margin,this.margin.bottom=this.options.margin,this.margin.left=this.options.margin)),e.adjustSizes(this.margin)}},{key:"_distanceToBorder",value:function(e,t){var o=this.options.borderWidth;return this.resize(e),Mo(So(this.width/2/bo(t)),So(this.height/2/_o(t)))+o}},{key:"enableShadow",value:function(e,t){t.shadow&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}},{key:"disableShadow",value:function(e,t){t.shadow&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}},{key:"enableBorderDashes",value:function(e,t){if(!1!==t.borderDashes)if(void 0!==e.setLineDash){var o=t.borderDashes;!0===o&&(o=[5,15]),e.setLineDash(o)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1}},{key:"disableBorderDashes",value:function(e,t){!1!==t.borderDashes&&(void 0===e.setLineDash?(console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1):e.setLineDash([0]))}},{key:"needsRefresh",value:function(e,t){return!0===this.refreshNeeded?(this.refreshNeeded=!1,!0):void 0===this.width||this.labelModule.differentState(e,t)}},{key:"initContextForDraw",value:function(e,t){var o=t.borderWidth/this.body.view.scale;e.lineWidth=Mo(this.width,o),e.strokeStyle=t.borderColor,e.fillStyle=t.color}},{key:"performStroke",value:function(e,t){var o=t.borderWidth/this.body.view.scale;e.save(),0<o&&(this.enableBorderDashes(e,t),e.stroke(),this.disableBorderDashes(e,t)),e.restore()}},{key:"performFill",value:function(e,t){this.enableShadow(e,t),e.fill(),this.disableShadow(e,t),this.performStroke(e,t)}},{key:"_addBoundingBoxMargin",value:function(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}},{key:"_updateBoundingBox",value:function(e,t,o,n,i){void 0!==o&&this.resize(o,n,i),this.left=e-this.width/2,this.top=t-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}},{key:"updateBoundingBox",value:function(e,t,o,n,i){this._updateBoundingBox(e,t,o,n,i)}},{key:"getDimensionsFromLabel",value:function(e,t,o){this.textSize=this.labelModule.getTextSize(e,t,o);var n=this.textSize.width,i=this.textSize.height,a=14;return 0===n&&(n=a,i=a),{width:n,height:i}}}]),e}(),Rl=function(e){function t(e,o,n){var i;return pl(this,t),i=Il(this,Pl(t).call(this,e,o,n)),i._setMargins(n),i}return Nl(t,e),hl(t,[{key:"resize",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.selected,o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(t,o)){var n=this.getDimensionsFromLabel(e,t,o);this.width=n.width+this.margin.right+this.margin.left,this.height=n.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}},{key:"draw",value:function(e,t,o,n,i,a){this.resize(e,n,i),this.left=t-this.width/2,this.top=o-this.height/2,this.initContextForDraw(e,a),e.roundRect(this.left,this.top,this.width,this.height,a.borderRadius),this.performFill(e,a),this.updateBoundingBox(t,o,e,n,i),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,i)}},{key:"updateBoundingBox",value:function(e,t,o,n,i){this._updateBoundingBox(e,t,o,n,i);var a=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(a)}},{key:"distanceToBorder",value:function(e,t){this.resize(e);var o=this.options.borderWidth;return Mo(So(this.width/2/bo(t)),So(this.height/2/_o(t)))+o}}]),t}(Yl),zl=function(e){function t(e,o,n){var i;return pl(this,t),i=Il(this,Pl(t).call(this,e,o,n)),i.labelOffset=0,i.selected=!1,i}return Nl(t,e),hl(t,[{key:"setOptions",value:function(e,t,o){this.options=e,void 0===t&&void 0===o||this.setImages(t,o)}},{key:"setImages",value:function(e,t){t&&this.selected?(this.imageObj=t,this.imageObjAlt=e):(this.imageObj=e,this.imageObjAlt=t)}},{key:"switchImages",value:function(e){var t=e&&!this.selected||!e&&this.selected;if(this.selected=e,void 0!==this.imageObjAlt&&t){var o=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=o}}},{key:"_getImagePadding",value:function(){var e={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){var t=this.options.imagePadding;"object"==wl(t)?(e.top=t.top,e.right=t.right,e.bottom=t.bottom,e.left=t.left):(e.top=t,e.right=t,e.bottom=t,e.left=t)}return e}},{key:"_resizeImage",value:function(){var e,t;if(!1===this.options.shapeProperties.useImageSize){var o=1,n=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?o=this.imageObj.width/this.imageObj.height:n=this.imageObj.height/this.imageObj.width),e=2*this.options.size*o,t=2*this.options.size*n}else{var i=this._getImagePadding();e=this.imageObj.width+i.left+i.right,t=this.imageObj.height+i.top+i.bottom}this.width=e,this.height=t,this.radius=.5*this.width}},{key:"_drawRawCircle",value:function(e,t,o,n){this.initContextForDraw(e,n),e.circle(t,o,n.size),this.performFill(e,n)}},{key:"_drawImageAtPosition",value:function(e,t){if(0!=this.imageObj.width){e.globalAlpha=1,this.enableShadow(e,t);var o=1;!0===this.options.shapeProperties.interpolation&&(o=this.imageObj.width/this.width/this.body.view.scale);var n=this._getImagePadding(),i=this.left+n.left,a=this.top+n.top,d=this.width-n.left-n.right,s=this.height-n.top-n.bottom;this.imageObj.drawImageAtPosition(e,o,i,a,d,s),this.disableShadow(e,t)}}},{key:"_drawImageLabel",value:function(e,t,o,n,i){var a=0,d;if(void 0!==this.height){a=.5*this.height;var s=this.labelModule.getTextSize(e,n,i);1<=s.lineCount&&(a+=s.height/2)}d=o+a,this.options.label&&(this.labelOffset=a),this.labelModule.draw(e,t,d,n,i,"hanging")}}]),t}(Yl),Bl=function(e){function t(e,o,n){var i;return pl(this,t),i=Il(this,Pl(t).call(this,e,o,n)),i._setMargins(n),i}return Nl(t,e),hl(t,[{key:"resize",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.selected,o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(t,o)){var n=this.getDimensionsFromLabel(e,t,o),i=Co(n.width+this.margin.right+this.margin.left,n.height+this.margin.top+this.margin.bottom);this.options.size=i/2,this.width=i,this.height=i,this.radius=this.width/2}}},{key:"draw",value:function(e,t,o,n,i,a){this.resize(e,n,i),this.left=t-this.width/2,this.top=o-this.height/2,this._drawRawCircle(e,t,o,a),this.updateBoundingBox(t,o),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,o,n,i)}},{key:"updateBoundingBox",value:function(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size}},{key:"distanceToBorder",value:function(e){return this.resize(e),.5*this.width}}]),t}(zl),Ll=function(e){function t(e,o,n,i,a){var d;return pl(this,t),d=Il(this,Pl(t).call(this,e,o,n)),d.setImages(i,a),d}return Nl(t,e),hl(t,[{key:"resize",value:function(){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.selected,t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.hover,o=void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height;if(o){var n=2*this.options.size;return this.width=n,this.height=n,void(this.radius=.5*this.width)}this.needsRefresh(e,t)&&this._resizeImage()}},{key:"draw",value:function(e,t,o,n,i,a){this.switchImages(n),this.resize(),this.left=t-this.width/2,this.top=o-this.height/2,this._drawRawCircle(e,t,o,a),e.save(),e.clip(),this._drawImageAtPosition(e,a),e.restore(),this._drawImageLabel(e,t,o,n,i),this.updateBoundingBox(t,o)}},{key:"updateBoundingBox",value:function(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,this.boundingBox.left=Mo(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Co(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Co(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}},{key:"distanceToBorder",value:function(e){return this.resize(e),.5*this.width}}]),t}(zl),Al=function(e){function t(e,o,n){var i;return pl(this,t),i=Il(this,Pl(t).call(this,e,o,n)),i._setMargins(n),i}return Nl(t,e),hl(t,[{key:"resize",value:function(e,t,o){if(this.needsRefresh(t,o)){var n=this.getDimensionsFromLabel(e,t,o),i=n.width+this.margin.right+this.margin.left;this.width=i,this.height=i,this.radius=this.width/2}}},{key:"draw",value:function(e,t,o,n,i,a){this.resize(e,n,i),this.left=t-this.width/2,this.top=o-this.height/2,this.initContextForDraw(e,a),e.database(t-this.width/2,o-this.height/2,this.width,this.height),this.performFill(e,a),this.updateBoundingBox(t,o,e,n,i),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,i)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(Yl),Hl=function(e){function t(e,o,n){return pl(this,t),Il(this,Pl(t).call(this,e,o,n))}return Nl(t,e),hl(t,[{key:"resize",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.selected,o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.hover,n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{size:this.options.size};if(this.needsRefresh(t,o)){this.labelModule.getTextSize(e,t,o);var i=2*n.size;this.width=i,this.height=i,this.radius=.5*this.width}}},{key:"_drawShape",value:function(e,t,o,n,i,a,d,s){if(this.resize(e,a,d,s),this.left=n-this.width/2,this.top=i-this.height/2,this.initContextForDraw(e,s),e[t](n,i,s.size),this.performFill(e,s),void 0!==this.options.icon&&void 0!==this.options.icon.code&&(e.font=(a?"bold ":"")+this.height/2+"px "+(this.options.icon.face||"FontAwesome"),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",e.fillText(this.options.icon.code,n,i)),void 0!==this.options.label){this.labelModule.calculateLabelSize(e,a,d,n,i,"hanging");var r=i+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(e,n,r,a,d,"hanging")}this.updateBoundingBox(n,i)}},{key:"updateBoundingBox",value:function(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,void 0!==this.options.label&&0<this.labelModule.size.width&&(this.boundingBox.left=Mo(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Co(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Co(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}}]),t}(Yl),jl=function(e){function t(e,o,n){return pl(this,t),Il(this,Pl(t).call(this,e,o,n))}return Nl(t,e),hl(t,[{key:"draw",value:function(e,t,o,n,i,a){this._drawShape(e,"diamond",4,t,o,n,i,a)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(Hl),Wl=function(e){function t(e,o,n){return pl(this,t),Il(this,Pl(t).call(this,e,o,n))}return Nl(t,e),hl(t,[{key:"draw",value:function(e,t,o,n,i,a){this._drawShape(e,"circle",2,t,o,n,i,a)}},{key:"distanceToBorder",value:function(e){return this.resize(e),this.options.size}}]),t}(Hl),Ul=function(e){function t(e,o,n){return pl(this,t),Il(this,Pl(t).call(this,e,o,n))}return Nl(t,e),hl(t,[{key:"resize",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.selected,o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(t,o)){var n=this.getDimensionsFromLabel(e,t,o);this.height=2*n.height,this.width=n.width+n.height,this.radius=.5*this.width}}},{key:"draw",value:function(e,t,o,n,i,a){this.resize(e,n,i),this.left=t-.5*this.width,this.top=o-.5*this.height,this.initContextForDraw(e,a),e.ellipse_vis(this.left,this.top,this.width,this.height),this.performFill(e,a),this.updateBoundingBox(t,o,e,n,i),this.labelModule.draw(e,t,o,n,i)}},{key:"distanceToBorder",value:function(e,t){this.resize(e);var o=.5*this.width,n=.5*this.height,i=_o(t)*o,a=bo(t)*n;return o*n/To(i*i+a*a)}}]),t}(Yl),Vl=function(e){function t(e,o,n){var i;return pl(this,t),i=Il(this,Pl(t).call(this,e,o,n)),i._setMargins(n),i}return Nl(t,e),hl(t,[{key:"resize",value:function(e,t,o){this.needsRefresh(t,o)&&(this.iconSize={width:+this.options.icon.size,height:+this.options.icon.size},this.width=this.iconSize.width+this.margin.right+this.margin.left,this.height=this.iconSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}},{key:"draw",value:function(e,t,o,n,i,a){if(this.resize(e,n,i),this.options.icon.size=this.options.icon.size||50,this.left=t-this.width/2,this.top=o-this.height/2,this._icon(e,t,o,n,i,a),void 0!==this.options.label){this.labelModule.draw(e,this.left+this.iconSize.width/2+this.margin.left,o+this.height/2+5,n)}this.updateBoundingBox(t,o)}},{key:"updateBoundingBox",value:function(e,t){if(this.boundingBox.top=t-.5*this.options.icon.size,this.boundingBox.left=e-.5*this.options.icon.size,this.boundingBox.right=e+.5*this.options.icon.size,this.boundingBox.bottom=t+.5*this.options.icon.size,void 0!==this.options.label&&0<this.labelModule.size.width){this.boundingBox.left=Mo(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Co(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Co(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+5)}}},{key:"_icon",value:function(e,t,o,n,i,a){var d=+this.options.icon.size;void 0===this.options.icon.code?console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally."):(e.font=(n?"bold ":"")+d+"px "+this.options.icon.face,e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",this.enableShadow(e,a),e.fillText(this.options.icon.code,t,o),this.disableShadow(e,a))}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(Yl),Gl=function(e){function t(e,o,n,i,a){var d;return pl(this,t),d=Il(this,Pl(t).call(this,e,o,n)),d.setImages(i,a),d}return Nl(t,e),hl(t,[{key:"resize",value:function(){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.selected,t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.hover,o=void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height;if(o){var n=2*this.options.size;return this.width=n,void(this.height=n)}this.needsRefresh(e,t)&&this._resizeImage()}},{key:"draw",value:function(e,t,o,n,i,a){if(this.switchImages(n),this.resize(),this.left=t-this.width/2,this.top=o-this.height/2,!0===this.options.shapeProperties.useBorderWithImage){var d=this.options.borderWidth,s=this.options.borderWidthSelected||2*this.options.borderWidth,r=(n?s:d)/this.body.view.scale;e.lineWidth=Mo(this.width,r),e.beginPath(),e.strokeStyle=n?this.options.color.highlight.border:i?this.options.color.hover.border:this.options.color.border,e.fillStyle=n?this.options.color.highlight.background:i?this.options.color.hover.background:this.options.color.background,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),e.fill(),this.performStroke(e,a),e.closePath()}this._drawImageAtPosition(e,a),this._drawImageLabel(e,t,o,n,i),this.updateBoundingBox(t,o)}},{key:"updateBoundingBox",value:function(e,t){this.resize(),this._updateBoundingBox(e,t),void 0!==this.options.label&&0<this.labelModule.size.width&&(this.boundingBox.left=Mo(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Co(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Co(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(zl),ql=function(e){function t(e,o,n){return pl(this,t),Il(this,Pl(t).call(this,e,o,n))}return Nl(t,e),hl(t,[{key:"draw",value:function(e,t,o,n,i,a){this._drawShape(e,"square",2,t,o,n,i,a)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(Hl),Xl=function(e){function t(e,o,n){return pl(this,t),Il(this,Pl(t).call(this,e,o,n))}return Nl(t,e),hl(t,[{key:"draw",value:function(e,t,o,n,i,a){this._drawShape(e,"hexagon",4,t,o,n,i,a)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(Hl),Zl=function(e){function t(e,o,n){return pl(this,t),Il(this,Pl(t).call(this,e,o,n))}return Nl(t,e),hl(t,[{key:"draw",value:function(e,t,o,n,i,a){this._drawShape(e,"star",4,t,o,n,i,a)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(Hl),$l=function(e){function t(e,o,n){var i;return pl(this,t),i=Il(this,Pl(t).call(this,e,o,n)),i._setMargins(n),i}return Nl(t,e),hl(t,[{key:"resize",value:function(e,t,o){this.needsRefresh(t,o)&&(this.textSize=this.labelModule.getTextSize(e,t,o),this.width=this.textSize.width+this.margin.right+this.margin.left,this.height=this.textSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}},{key:"draw",value:function(e,t,o,n,i,a){this.resize(e,n,i),this.left=t-this.width/2,this.top=o-this.height/2,this.enableShadow(e,a),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,i),this.disableShadow(e,a),this.updateBoundingBox(t,o,e,n,i)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(Yl),Kl=function(e){function t(e,o,n){return pl(this,t),Il(this,Pl(t).call(this,e,o,n))}return Nl(t,e),hl(t,[{key:"draw",value:function(e,t,o,n,i,a){this._drawShape(e,"triangle",3,t,o,n,i,a)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(Hl),Ql=function(e){function t(e,o,n){return pl(this,t),Il(this,Pl(t).call(this,e,o,n))}return Nl(t,e),hl(t,[{key:"draw",value:function(e,t,o,n,i,a){this._drawShape(e,"triangleDown",3,t,o,n,i,a)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(Hl),Jl=!1,ec="background: #FFeeee; color: #dd0000",tc=function(){function e(){pl(this,e)}return hl(e,null,[{key:"validate",value:function(t,o,n){Jl=!1,eu=o;var i=o;return void 0!==n&&(i=o[n]),e.parse(t,i,[]),Jl}},{key:"parse",value:function(t,o,n){for(var i in t)t.hasOwnProperty(i)&&e.check(i,t,o,n)}},{key:"check",value:function(t,o,n,i){if(void 0===n[t]&&void 0===n.__any__)return void e.getSuggestion(t,n,i);var a=t,d=!0;void 0===n[t]&&void 0!==n.__any__&&(a="__any__",d="object"===e.getType(o[t]));var s=n[a];d&&void 0!==s.__type__&&(s=s.__type__),e.checkFields(t,o,n,a,s,i)}},{key:"checkFields",value:function(t,o,n,i,a,d){var s=function(o){console.log("%c"+o+e.printLocation(d,t),ec)},r=e.getType(o[t]),l=a[r];void 0===l?void 0===a.any&&(s("Invalid type received for \""+t+"\". Expected: "+e.print(Object.keys(a))+". Received ["+r+"] \""+o[t]+"\""),Jl=!0):"array"===e.getType(l)&&-1===l.indexOf(o[t])?(s("Invalid option detected in \""+t+"\". Allowed values are:"+e.print(l)+" not \""+o[t]+"\". "),Jl=!0):"object"===r&&"__any__"!==i&&(d=Wd.copyAndExtendArray(d,t),e.parse(o[t],n[i],d))}},{key:"getType",value:function(e){var t=wl(e);return"object"===t?null===e?"null":e instanceof Boolean?"boolean":e instanceof Number?"number":e instanceof String?"string":Array.isArray(e)?"array":e instanceof Date?"date":void 0===e.nodeType?!0===e._isAMomentObject?"moment":"object":"dom":"number"===t?"number":"boolean"===t?"boolean":"string"===t?"string":void 0===t?"undefined":t}},{key:"getSuggestion",value:function(t,o,n){var i=e.findInOptions(t,o,n,!1),a=e.findInOptions(t,eu,[],!0),d;d=void 0===i.indexMatch?a.distance<=4&&i.distance>a.distance?" in "+e.printLocation(i.path,t,"")+"Perhaps it was misplaced? Matching option found at: "+e.printLocation(a.path,a.closestMatch,""):i.distance<=8?". Did you mean \""+i.closestMatch+"\"?"+e.printLocation(i.path,t):". Did you mean one of these: "+e.print(Object.keys(o))+e.printLocation(n,t):" in "+e.printLocation(i.path,t,"")+"Perhaps it was incomplete? Did you mean: \""+i.indexMatch+"\"?\n\n",console.log("%cUnknown option detected: \""+t+"\""+d,ec),Jl=!0}},{key:"findInOptions",value:function(t,o,n){var i=!!(3<arguments.length&&void 0!==arguments[3])&&arguments[3],a=1e9,d="",s=[],r=t.toLowerCase(),l=void 0;for(var c in o){var u=void 0;if(void 0!==o[c].__type__&&!0===i){var p=e.findInOptions(t,o[c],Wd.copyAndExtendArray(n,c));a>p.distance&&(d=p.closestMatch,s=p.path,a=p.distance,l=p.indexMatch)}else-1!==c.toLowerCase().indexOf(r)&&(l=c),u=e.levenshteinDistance(t,c),a>u&&(d=c,s=Wd.copyArray(n),a=u)}return{closestMatch:d,path:s,distance:a,indexMatch:l}}},{key:"printLocation",value:function(e,t){for(var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"Problem value found at: \n",n="\n\n"+o+"options = {\n",a=0;a<e.length;a++){for(var d=0;d<a+1;d++)n+=" ";n+=e[a]+": {\n"}for(var s=0;s<e.length+1;s++)n+=" ";n+=t+"\n";for(var r=0;r<e.length+1;r++){for(var l=0;l<e.length-r;l++)n+=" ";n+="}\n"}return n+"\n\n"}},{key:"print",value:function(e){return JSON.stringify(e).replace(/(\")|(\[)|(\])|(,"__type__")/g,"").replace(/(\,)/g,", ")}},{key:"levenshteinDistance",value:function(e,t){if(0===e.length)return t.length;if(0===t.length)return e.length;var o=[],n;for(n=0;n<=t.length;n++)o[n]=[n];var a;for(a=0;a<=e.length;a++)o[0][a]=a;for(n=1;n<=t.length;n++)for(a=1;a<=e.length;a++)o[n][a]=t.charAt(n-1)==e.charAt(a-1)?o[n-1][a-1]:Mo(o[n-1][a-1]+1,Mo(o[n][a-1]+1,o[n-1][a]+1));return o[t.length][e.length]}}]),e}(),oc=function(){function e(t,o,n,i,a,d){pl(this,e),this.options=Wd.bridgeObject(a),this.globalOptions=a,this.defaultOptions=d,this.body=o,this.edges=[],this.id=void 0,this.imagelist=n,this.grouplist=i,this.x=void 0,this.y=void 0,this.baseSize=this.options.size,this.baseFontSize=this.options.font.size,this.predefinedPosition=!1,this.selected=!1,this.hover=!1,this.labelModule=new Cl(this.body,this.options,!1),this.setOptions(t)}return hl(e,[{key:"attachEdge",value:function(e){-1===this.edges.indexOf(e)&&this.edges.push(e)}},{key:"detachEdge",value:function(e){var t=this.edges.indexOf(e);-1!=t&&this.edges.splice(t,1)}},{key:"setOptions",value:function(t){var o=this.options.shape;if(t){if("undefined"!=typeof t.color&&(this._localColor=t.color),void 0!==t.id&&(this.id=t.id),void 0===this.id)throw new Error("Node must have an id");e.checkMass(t,this.id),void 0!==t.x&&(null===t.x?(this.x=void 0,this.predefinedPosition=!1):(this.x=parseInt(t.x),this.predefinedPosition=!0)),void 0!==t.y&&(null===t.y?(this.y=void 0,this.predefinedPosition=!1):(this.y=parseInt(t.y),this.predefinedPosition=!0)),void 0!==t.size&&(this.baseSize=t.size),void 0!==t.value&&(t.value=parseFloat(t.value)),e.parseOptions(this.options,t,!0,this.globalOptions,this.grouplist);var n=[t,this.options,this.defaultOptions];return this.chooser=xl.choosify("node",n),this._load_images(),this.updateLabelModule(t),this.updateShape(o),void 0!==t.hidden||void 0!==t.physics}}},{key:"_load_images",value:function(){if(("circularImage"===this.options.shape||"image"===this.options.shape)&&void 0===this.options.image)throw new Error("Option image must be defined for node type '"+this.options.shape+"'");if(void 0!==this.options.image){if(void 0===this.imagelist)throw new Error("Internal Error: No images provided");if("string"==typeof this.options.image)this.imageObj=this.imagelist.load(this.options.image,this.options.brokenImage,this.id);else{if(void 0===this.options.image.unselected)throw new Error("No unselected image provided");this.imageObj=this.imagelist.load(this.options.image.unselected,this.options.brokenImage,this.id),this.imageObjAlt=void 0===this.options.image.selected?void 0:this.imagelist.load(this.options.image.selected,this.options.brokenImage,this.id)}}}},{key:"getFormattingValues",value:function(){var e={color:this.options.color.background,borderWidth:this.options.borderWidth,borderColor:this.options.color.border,size:this.options.size,borderDashes:this.options.shapeProperties.borderDashes,borderRadius:this.options.shapeProperties.borderRadius,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y};return this.selected||this.hover?!0===this.chooser?this.selected?(e.borderWidth*=2,e.color=this.options.color.highlight.background,e.borderColor=this.options.color.highlight.border,e.shadow=this.options.shadow.enabled):this.hover&&(e.color=this.options.color.hover.background,e.borderColor=this.options.color.hover.border,e.shadow=this.options.shadow.enabled):"function"==typeof this.chooser&&(this.chooser(e,this.options.id,this.selected,this.hover),!1===e.shadow&&(e.shadowColor!==this.options.shadow.color||e.shadowSize!==this.options.shadow.size||e.shadowX!==this.options.shadow.x||e.shadowY!==this.options.shadow.y)&&(e.shadow=!0)):e.shadow=this.options.shadow.enabled,e}},{key:"updateLabelModule",value:function(t){(void 0===this.options.label||null===this.options.label)&&(this.options.label=""),e.updateGroupOptions(this.options,uo({},t,{color:t&&t.color||this._localColor||void 0}),this.grouplist);var o=this.grouplist.get(this.options.group,!1),n=[t,this.options,o,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,n),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateShape",value:function(e){if(e===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case"box":this.shape=new Rl(this.options,this.body,this.labelModule);break;case"circle":this.shape=new Bl(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new Ll(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"database":this.shape=new Al(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new jl(this.options,this.body,this.labelModule);break;case"dot":this.shape=new Wl(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new Ul(this.options,this.body,this.labelModule);break;case"icon":this.shape=new Vl(this.options,this.body,this.labelModule);break;case"image":this.shape=new Gl(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new ql(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new Xl(this.options,this.body,this.labelModule);break;case"star":this.shape=new Zl(this.options,this.body,this.labelModule);break;case"text":this.shape=new $l(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new Kl(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new Ql(this.options,this.body,this.labelModule);break;default:this.shape=new Ul(this.options,this.body,this.labelModule);}this.needsRefresh()}},{key:"select",value:function(){this.selected=!0,this.needsRefresh()}},{key:"unselect",value:function(){this.selected=!1,this.needsRefresh()}},{key:"needsRefresh",value:function(){this.shape.refreshNeeded=!0}},{key:"getTitle",value:function(){return this.options.title}},{key:"distanceToBorder",value:function(e,t){return this.shape.distanceToBorder(e,t)}},{key:"isFixed",value:function(){return this.options.fixed.x&&this.options.fixed.y}},{key:"isSelected",value:function(){return this.selected}},{key:"getValue",value:function(){return this.options.value}},{key:"getLabelSize",value:function(){return this.labelModule.size()}},{key:"setValueRange",value:function(e,t,o){if(void 0!==this.options.value){var n=this.options.scaling.customScalingFunction(e,t,o,this.options.value),i=this.options.scaling.max-this.options.scaling.min;if(!0===this.options.scaling.label.enabled){var a=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+n*a}this.options.size=this.options.scaling.min+n*i}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}},{key:"draw",value:function(e){var t=this.getFormattingValues();this.shape.draw(e,this.x,this.y,this.selected,this.hover,t)}},{key:"updateBoundingBox",value:function(e){this.shape.updateBoundingBox(this.x,this.y,e)}},{key:"resize",value:function(e){var t=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,t)}},{key:"getItemsOnPoint",value:function(e){var t=[];return this.labelModule.visible()&&xl.pointInRect(this.labelModule.getSize(),e)&&t.push({nodeId:this.id,labelId:0}),xl.pointInRect(this.shape.boundingBox,e)&&t.push({nodeId:this.id}),t}},{key:"isOverlappingWith",value:function(e){return this.shape.left<e.right&&this.shape.left+this.shape.width>e.left&&this.shape.top<e.bottom&&this.shape.top+this.shape.height>e.top}},{key:"isBoundingBoxOverlappingWith",value:function(e){return this.shape.boundingBox.left<e.right&&this.shape.boundingBox.right>e.left&&this.shape.boundingBox.top<e.bottom&&this.shape.boundingBox.bottom>e.top}}],[{key:"updateGroupOptions",value:function(e,t,o){if(void 0!==o){var n=e.group;if(void 0!==t&&void 0!==t.group&&n!==t.group)throw new Error("updateGroupOptions: group values in options don't match.");if("number"==typeof n||"string"==typeof n&&""!=n){var i=o.get(n),a=["font"];void 0!==t&&void 0!==t.color&&null!=t.color&&a.push("color"),Wd.selectiveNotDeepExtend(a,e,i),e.color=Wd.parseColor(e.color)}}}},{key:"parseOptions",value:function(t,o){var n=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2],i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},a=4<arguments.length?arguments[4]:void 0;if(Wd.selectiveNotDeepExtend(["color","fixed","shadow"],t,o,n),e.checkMass(o),Wd.mergeOptions(t,o,"shadow",i),void 0!==o.color&&null!==o.color){var d=Wd.parseColor(o.color);Wd.fillIfDefined(t.color,d)}else!0===n&&null===o.color&&(t.color=Wd.bridgeObject(i.color));void 0!==o.fixed&&null!==o.fixed&&("boolean"==typeof o.fixed?(t.fixed.x=o.fixed,t.fixed.y=o.fixed):(void 0!==o.fixed.x&&"boolean"==typeof o.fixed.x&&(t.fixed.x=o.fixed.x),void 0!==o.fixed.y&&"boolean"==typeof o.fixed.y&&(t.fixed.y=o.fixed.y))),!0===n&&null===o.font&&(t.font=Wd.bridgeObject(i.font)),e.updateGroupOptions(t,o,a),void 0!==o.scaling&&Wd.mergeOptions(t.scaling,o.scaling,"label",i.scaling)}},{key:"checkMass",value:function(e,t){if(void 0!==e.mass&&0>=e.mass){var o="";void 0!==t&&(o=" in node id: "+t),console.log("%cNegative or zero mass disallowed"+o+", setting mass to 1.",ec),e.mass=1}}}]),e}(),nc=function(){function e(t,o,n,i){var a=this;if(pl(this,e),this.body=t,this.images=o,this.groups=n,this.layoutEngine=i,this.body.functions.createNode=this.create.bind(this),this.nodesListeners={add:function(e,t){a.add(t.items)},update:function(e,t){a.update(t.items,t.data,t.oldData)},remove:function(e,t){a.remove(t.items)}},this.defaultOptions={borderWidth:1,borderWidthSelected:2,brokenImage:void 0,color:{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},fixed:{x:!1,y:!1},font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:0,strokeColor:"#ffffff",align:"center",vadjust:0,multi:!1,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"monospace",vadjust:2}},group:void 0,hidden:!1,icon:{face:"FontAwesome",code:void 0,size:50,color:"#2B7CE9"},image:void 0,imagePadding:{top:0,right:0,bottom:0,left:0},label:void 0,labelHighlightBold:!0,level:void 0,margin:{top:5,right:5,bottom:5,left:5},mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(e,t,o,n){if(t===e)return .5;return Co(0,(n-e)*(1/(t-e)))}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},shape:"ellipse",shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1},size:25,title:void 0,value:void 0,x:void 0,y:void 0},0>=this.defaultOptions.mass)throw"Internal error: mass in defaultOptions of NodesHandler may not be zero or negative";this.options=Wd.bridgeObject(this.defaultOptions),this.bindEventListeners()}return hl(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("refreshNodes",this.refresh.bind(this)),this.body.emitter.on("refresh",this.refresh.bind(this)),this.body.emitter.on("destroy",function(){Wd.forEach(e.nodesListeners,function(t,o){e.body.data.nodes&&e.body.data.nodes.off(o,t)}),delete e.body.functions.createNode,delete e.nodesListeners.add,delete e.nodesListeners.update,delete e.nodesListeners.remove,delete e.nodesListeners})}},{key:"setOptions",value:function(e){if(void 0!==e){if(oc.parseOptions(this.options,e),void 0!==e.shape)for(var t in this.body.nodes)this.body.nodes.hasOwnProperty(t)&&this.body.nodes[t].updateShape();if(void 0!==e.font)for(var o in this.body.nodes)this.body.nodes.hasOwnProperty(o)&&(this.body.nodes[o].updateLabelModule(),this.body.nodes[o].needsRefresh());if(void 0!==e.size)for(var n in this.body.nodes)this.body.nodes.hasOwnProperty(n)&&this.body.nodes[n].needsRefresh();(void 0!==e.hidden||void 0!==e.physics)&&this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(e){var t=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1],o=this.body.data.nodes;if(e instanceof xs||e instanceof Ss)this.body.data.nodes=e;else if(Array.isArray(e))this.body.data.nodes=new xs,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new xs;else throw new TypeError("Array or DataSet expected");if(o&&Wd.forEach(this.nodesListeners,function(e,t){o.off(t,e)}),this.body.nodes={},this.body.data.nodes){var n=this;Wd.forEach(this.nodesListeners,function(e,t){n.body.data.nodes.on(t,e)});var i=this.body.data.nodes.getIds();this.add(i,!0)}!1===t&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var t=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1],o=[],n=0,a;n<e.length;n++){a=e[n];var d=this.body.data.nodes.get(a),s=this.create(d);o.push(s),this.body.nodes[a]=s}this.layoutEngine.positionInitially(o),!1===t&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(e,t,o){for(var n=this.body.nodes,a=!1,d=0;d<e.length;d++){var s=e[d],r=n[s],l=t[d];void 0===r?(a=!0,r=this.create(l),n[s]=r):r.setOptions(l)&&(a=!0)}a||void 0===o||(a=t.some(function(e,t){var n=o[t];return n&&n.level!==e.level})),!0===a?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}},{key:"remove",value:function(e){for(var t=this.body.nodes,o=0,n;o<e.length;o++)n=e[o],delete t[n];this.body.emitter.emit("_dataChanged")}},{key:"create",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:oc;return new t(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}},{key:"refresh",value:function(){var e=this,t=!!(0<arguments.length&&void 0!==arguments[0])&&arguments[0];Wd.forEach(this.body.nodes,function(o,n){var i=e.body.data.nodes.get(n);void 0!==i&&(!0===t&&o.setOptions({x:null,y:null}),o.setOptions({fixed:!1}),o.setOptions(i))})}},{key:"getPositions",value:function(e){var t={};if(void 0===e)for(var o=0,n;o<this.body.nodeIndices.length;o++)n=this.body.nodes[this.body.nodeIndices[o]],t[this.body.nodeIndices[o]]={x:vo(n.x),y:vo(n.y)};else if(!0===Array.isArray(e)){for(var a=0;a<e.length;a++)if(void 0!==this.body.nodes[e[a]]){var d=this.body.nodes[e[a]];t[e[a]]={x:vo(d.x),y:vo(d.y)}}}else if(void 0!==this.body.nodes[e]){var s=this.body.nodes[e];t[e]={x:vo(s.x),y:vo(s.y)}}return t}},{key:"storePositions",value:function(){var e=[],t=this.body.data.nodes.getDataSet();for(var o in t._data)if(t._data.hasOwnProperty(o)){var n=this.body.nodes[o];(t._data[o].x!=vo(n.x)||t._data[o].y!=vo(n.y))&&e.push({id:n.id,x:vo(n.x),y:vo(n.y)})}t.update(e)}},{key:"getBoundingBox",value:function(e){if(void 0!==this.body.nodes[e])return this.body.nodes[e].shape.boundingBox}},{key:"getConnectedNodes",value:function(e,t){var o=[];if(void 0!==this.body.nodes[e])for(var n=this.body.nodes[e],a={},d=0,s;d<n.edges.length;d++)s=n.edges[d],"to"!==t&&s.toId==n.id?void 0===a[s.fromId]&&(o.push(s.fromId),a[s.fromId]=!0):"from"!==t&&s.fromId==n.id&&void 0===a[s.toId]&&(o.push(s.toId),a[s.toId]=!0);return o}},{key:"getConnectedEdges",value:function(e){var t=[];if(void 0!==this.body.nodes[e])for(var o=this.body.nodes[e],n=0;n<o.edges.length;n++)t.push(o.edges[n].id);else console.log("NodeId provided for getConnectedEdges does not exist. Provided: ",e);return t}},{key:"moveNode",value:function(e,t,o){var n=this;void 0===this.body.nodes[e]?console.log("Node id supplied to moveNode does not exist. Provided: ",e):(this.body.nodes[e].x=+t,this.body.nodes[e].y=+o,setTimeout(function(){n.body.emitter.emit("startSimulation")},0))}}]),e}(),ic=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Pl(e),null!==e););return e},ac=Le(function(e){function t(o,n,i){return e.exports="undefined"!=typeof Reflect&&Reflect.get?t=Reflect.get:t=function(e,t,o){var n=ic(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(o):i.value}},t(o,n,i||o)}e.exports=t}),dc=function(){function e(){pl(this,e)}return hl(e,null,[{key:"transform",value:function(e,t){Array.isArray(e)||(e=[e]);for(var o=t.point.x,n=t.point.y,a=t.angle,d=t.length,s=0;s<e.length;++s){var r=e[s],l=r.x*bo(a)-r.y*_o(a),c=r.x*_o(a)+r.y*bo(a);r.x=o+d*l,r.y=n+d*c}}},{key:"drawPath",value:function(e,t){e.beginPath(),e.moveTo(t[0].x,t[0].y);for(var o=1;o<t.length;++o)e.lineTo(t[o].x,t[o].y);e.closePath()}}]),e}(),sc=function(e){function t(){return pl(this,t),Il(this,Pl(t).apply(this,arguments))}return Nl(t,e),hl(t,null,[{key:"draw",value:function(e,t){var o=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];dc.transform(o,t),dc.drawPath(e,o)}}]),t}(dc),rc=function(){function e(){pl(this,e)}return hl(e,null,[{key:"draw",value:function(e,t){var o=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];dc.transform(o,t),dc.drawPath(e,o)}}]),e}(),lc=function(){function e(){pl(this,e)}return hl(e,null,[{key:"draw",value:function(e,t){var o={x:-.4,y:0};dc.transform(o,t),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";var n=Oo,i=t.angle-n/2,a=t.angle+n/2;e.beginPath(),e.arc(o.x,o.y,.4*t.length,i,a,!1),e.stroke()}}]),e}(),cc=function(){function e(){pl(this,e)}return hl(e,null,[{key:"draw",value:function(e,t){var o={x:-.3,y:0};dc.transform(o,t),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";var n=Oo,i=t.angle+n/2,a=t.angle+3*n/2;e.beginPath(),e.arc(o.x,o.y,.4*t.length,i,a,!1),e.stroke()}}]),e}(),uc=function(){function e(){pl(this,e)}return hl(e,null,[{key:"draw",value:function(e,t){var o=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];dc.transform(o,t),dc.drawPath(e,o)}}]),e}(),pc=function(){function e(){pl(this,e)}return hl(e,null,[{key:"draw",value:function(e,t){var o=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];dc.transform(o,t),dc.drawPath(e,o)}}]),e}(),hc=function(){function e(){pl(this,e)}return hl(e,null,[{key:"draw",value:function(e,t){var o={x:-.4,y:0};dc.transform(o,t),e.circle(o.x,o.y,.4*t.length)}}]),e}(),gc=function(){function e(){pl(this,e)}return hl(e,null,[{key:"draw",value:function(e,t){var o=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];dc.transform(o,t),dc.drawPath(e,o)}}]),e}(),mc=function(){function e(){pl(this,e)}return hl(e,null,[{key:"draw",value:function(e,t){var o=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];dc.transform(o,t),dc.drawPath(e,o)}}]),e}(),yc=function(){function e(){pl(this,e)}return hl(e,null,[{key:"draw",value:function(e,t){var o=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];dc.transform(o,t),dc.drawPath(e,o)}}]),e}(),fc=function(){function e(){pl(this,e)}return hl(e,null,[{key:"draw",value:function(e,t){var o=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];dc.transform(o,t),dc.drawPath(e,o)}}]),e}(),bc=function(){function e(){pl(this,e)}return hl(e,null,[{key:"draw",value:function(e,t){var o;switch(t.type&&(o=t.type.toLowerCase()),o){case"circle":hc.draw(e,t);break;case"box":mc.draw(e,t);break;case"crow":rc.draw(e,t);break;case"curve":lc.draw(e,t);break;case"diamond":yc.draw(e,t);break;case"inv_curve":cc.draw(e,t);break;case"triangle":uc.draw(e,t);break;case"inv_triangle":pc.draw(e,t);break;case"bar":gc.draw(e,t);break;case"vee":fc.draw(e,t);break;case"arrow":default:sc.draw(e,t);}}}]),e}(),_c=function(){function e(t,o,n){pl(this,e),this._body=o,this._labelModule=n,this.color={},this.colorDirty=!0,this.hoverWidth=1.5,this.selectionWidth=2,this.setOptions(t),this.fromPoint=this.from,this.toPoint=this.to}return hl(e,[{key:"connect",value:function(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to]}},{key:"cleanup",value:function(){return!1}},{key:"setOptions",value:function(e){this.options=e,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.id=this.options.id}},{key:"drawLine",value:function(e,t){var o=4<arguments.length&&void 0!==arguments[4]?arguments[4]:this.getViaNode();e.strokeStyle=this.getColor(e,t),e.lineWidth=t.width,!1===t.dashes?this._drawLine(e,t,o):this._drawDashedLine(e,t,o)}},{key:"_drawLine",value:function(e,t,o,n,i){if(this.from!=this.to)this._line(e,t,o,n,i);else{var a=this._getCircleData(e),d=kl(a,3),s=d[0],r=d[1],l=d[2];this._circle(e,t,s,r,l)}}},{key:"_drawDashedLine",value:function(e,t,o){e.lineCap="round";var n=Array.isArray(t.dashes)?t.dashes:[5,5];if(void 0!==e.setLineDash){if(e.save(),e.setLineDash(n),e.lineDashOffset=0,this.from!=this.to)this._line(e,t,o);else{var i=this._getCircleData(e),a=kl(i,3),d=a[0],s=a[1],r=a[2];this._circle(e,t,d,s,r)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)e.dashedLine(this.from.x,this.from.y,this.to.x,this.to.y,n);else{var l=this._getCircleData(e),c=kl(l,3),u=c[0],p=c[1],h=c[2];this._circle(e,t,u,p,h)}this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}}},{key:"findBorderPosition",value:function(e,t,o){return this.from==this.to?this._findBorderPositionCircle(e,t,o):this._findBorderPosition(e,t,o)}},{key:"findBorderPositions",value:function(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};var t=this._getCircleData(e).slice(0,2),o=kl(t,2),n=o[0],i=o[1];return{from:this._findBorderPositionCircle(this.from,e,{x:n,y:i,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:n,y:i,low:.6,high:.8,direction:1})}}},{key:"_getCircleData",value:function(e){var t=this.from,o=this.options.selfReferenceSize,n,i;return void 0!==e&&void 0===t.shape.width&&t.shape.resize(e),t.shape.width>t.shape.height?(n=t.x+.5*t.shape.width,i=t.y-o):(n=t.x+o,i=t.y-.5*t.shape.height),[n,i,o]}},{key:"_pointOnCircle",value:function(e,t,o,n){var i=2*n*Oo;return{x:e+o*bo(i),y:t-o*_o(i)}}},{key:"_findBorderPositionCircle",value:function(e,t,o){var n=o.x,i=o.y,a=o.low,d=o.high,s=o.direction,r=this.options.selfReferenceSize,l=.5*(a+d),c=0,u;do{l=.5*(a+d),u=this._pointOnCircle(n,i,r,l);var p=Do(e.y-u.y,e.x-u.x),h=e.distanceToBorder(t,p),g=To(ko(u.x-e.x,2)+ko(u.y-e.y,2)),m=h-g;if(So(m)<.05)break;else 0<m?0<s?a=l:d=l:0<s?d=l:a=l;++c}while(a<=d&&c<10);return ho({},u,{t:l})}},{key:"getLineWidth",value:function(e,t){return!0===e?Co(this.selectionWidth,.3/this._body.view.scale):!0===t?Co(this.hoverWidth,.3/this._body.view.scale):Co(this.options.width,.3/this._body.view.scale)}},{key:"getColor",value:function(e,t){if(!1!==t.inheritsColor){if("both"===t.inheritsColor&&this.from.id!==this.to.id){var o=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),n=this.from.options.color.highlight.border,i=this.to.options.color.highlight.border;return!1===this.from.selected&&!1===this.to.selected?(n=Z(this.from.options.color.border,t.opacity),i=Z(this.to.options.color.border,t.opacity)):!0===this.from.selected&&!1===this.to.selected?i=this.to.options.color.border:!1===this.from.selected&&!0===this.to.selected&&(n=this.from.options.color.border),o.addColorStop(0,n),o.addColorStop(1,i),o}return"to"===t.inheritsColor?Z(this.to.options.color.border,t.opacity):Z(this.from.options.color.border,t.opacity)}return Z(t.color,t.opacity)}},{key:"_circle",value:function(e,t,o,n,i){this.enableShadow(e,t),e.beginPath(),e.arc(o,n,i,0,2*Oo,!1),e.stroke(),this.disableShadow(e,t)}},{key:"getDistanceToEdge",value:function(e,t,o,n,i,a){if(this.from!=this.to)return this._getDistanceToEdge(e,t,o,n,i,a);var d=this._getCircleData(void 0),s=kl(d,3),r=s[0],l=s[1],c=s[2],u=r-i,p=l-a;return So(To(u*u+p*p)-c)}},{key:"_getDistanceToLine",value:function(e,t,o,n,i,a){var d=o-e,s=n-t,r=((i-e)*d+(a-t)*s)/(d*d+s*s);1<r?r=1:0>r&&(r=0);var l=e+r*d,c=t+r*s,p=l-i,h=c-a;return To(p*p+h*h)}},{key:"getArrowData",value:function(e,t,o,n,i,a){var d=Math.hypot,s=a.width,r,l,c,u,p,h,g;"from"===t?(c=this.from,u=this.to,p=0>a.fromArrowScale,h=So(a.fromArrowScale),g=a.fromArrowType):"to"===t?(c=this.to,u=this.from,p=0>a.toArrowScale,h=So(a.toArrowScale),g=a.toArrowType):(c=this.to,u=this.from,p=0>a.middleArrowScale,h=So(a.middleArrowScale),g=a.middleArrowType);var m=15*h+3*s;if(c!=u){var f=d(c.x-u.x,c.y-u.y),b=m/f;if("middle"===t){var _=(p?-b:b)/2,v=this.getPoint(.5+_,o),k=this.getPoint(.5-_,o);r=Do(v.y-k.y,v.x-k.x),l=this.getPoint(.5,o)}else if(!0===this.options.smooth.enabled){var w=this._findBorderPosition(c,e,{via:o}),S=this.getPoint(w.t+b*("from"===t?1:-1),o);r=Do(w.y-S.y,w.x-S.x),l=w}else r=Do(c.y-u.y,c.x-u.x),l=this._findBorderPosition(c,e)}else{var O=this._getCircleData(e),D=kl(O,3),T=D[0],x=D[1],y=D[2];if("from"===t){var E=this._findBorderPositionCircle(this.from,e,{x:T,y:x,low:.25,high:.6,direction:-1});r=-2*E.t*Oo+1.5*Oo+.1*Oo,l=E}else if("to"===t){var C=this._findBorderPositionCircle(this.from,e,{x:T,y:x,low:.6,high:1,direction:1});r=-2*C.t*Oo+1.5*Oo-1.1*Oo,l=C}else l=this._pointOnCircle(T,x,y,.175),r=3.9269908169872414}var M=l.x-.9*m*bo(r),I=l.y-.9*m*_o(r);return{point:l,core:{x:M,y:I},angle:r,length:m,type:g}}},{key:"drawArrowHead",value:function(e,t,o,n,i){e.strokeStyle=this.getColor(e,t),e.fillStyle=e.strokeStyle,e.lineWidth=t.width,bc.draw(e,i),this.enableShadow(e,t),e.fill(),this.disableShadow(e,t)}},{key:"enableShadow",value:function(e,t){!0===t.shadow&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}},{key:"disableShadow",value:function(e,t){!0===t.shadow&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}},{key:"drawBackground",value:function(e,t){if(!1!==t.background){var o={strokeStyle:e.strokeStyle,lineWidth:e.lineWidth,dashes:e.dashes};e.strokeStyle=t.backgroundColor,e.lineWidth=t.backgroundSize,this.setStrokeDashed(e,t.backgroundDashes),e.stroke(),e.strokeStyle=o.strokeStyle,e.lineWidth=o.lineWidth,e.dashes=o.dashes,this.setStrokeDashed(e,t.dashes)}}},{key:"setStrokeDashed",value:function(e,t){if(!1===t)void 0===e.setLineDash?console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used."):e.setLineDash([]);else if(void 0!==e.setLineDash){var o=Array.isArray(t)?t:[5,5];e.setLineDash(o)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}}]),e}(),vc=function(e){function t(e,o,n){return pl(this,t),Il(this,Pl(t).call(this,e,o,n))}return Nl(t,e),hl(t,[{key:"_findBorderPositionBezier",value:function(e,t){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this._getViaCoordinates(),n=!1,i=1,a=0,d=this.to,s,r;e.id===this.from.id&&(d=this.from,n=!0);var l=0;do{r=.5*(a+i),s=this.getPoint(r,o);var c=Do(d.y-s.y,d.x-s.x),u=d.distanceToBorder(t,c),p=To(ko(s.x-d.x,2)+ko(s.y-d.y,2)),h=u-p;if(So(h)<.2)break;else 0>h?!1===n?a=r:i=r:!1===n?i=r:a=r;++l}while(a<=i&&l<10);return mo({},s,{t:r})}},{key:"_getDistanceToBezierEdge",value:function(e,o,n,a,d,s,r){var l=1e9,c=e,u=o,p,h,g,m,f;for(h=1;10>h;h++)g=.1*h,m=ko(1-g,2)*e+2*g*(1-g)*r.x+ko(g,2)*n,f=ko(1-g,2)*o+2*g*(1-g)*r.y+ko(g,2)*a,0<h&&(p=this._getDistanceToLine(c,u,m,f,d,s),l=p<l?p:l),c=m,u=f;return l}},{key:"_bezierCurve",value:function(e,t,o,n){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),null!=o&&null!=o.x?null!=n&&null!=n.x?e.bezierCurveTo(o.x,o.y,n.x,n.y,this.toPoint.x,this.toPoint.y):e.quadraticCurveTo(o.x,o.y,this.toPoint.x,this.toPoint.y):e.lineTo(this.toPoint.x,this.toPoint.y),this.drawBackground(e,t),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}}]),t}(_c),kc=function(e){function t(e,o,n){var i;return pl(this,t),i=Il(this,Pl(t).call(this,e,o,n)),i.via=i.via,i._boundFunction=function(){i.positionBezierNode()},i._body.emitter.on("_repositionBezierNodes",i._boundFunction),i}return Nl(t,e),hl(t,[{key:"setOptions",value:function(e){ac(Pl(t.prototype),"setOptions",this).call(this,e);var o=!1;this.options.physics!==e.physics&&(o=!0),this.options=e,this.id=this.options.id,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.setupSupportNode(),this.connect(),!0==o&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}},{key:"connect",value:function(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],void 0===this.from||void 0===this.to||!1===this.options.physics?this.via.setOptions({physics:!1}):this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}},{key:"cleanup",value:function(){return this._body.emitter.off("_repositionBezierNodes",this._boundFunction),void 0!==this.via&&(delete this._body.nodes[this.via.id],this.via=void 0,!0)}},{key:"setupSupportNode",value:function(){if(void 0===this.via){var e="edgeId:"+this.id,t=this._body.functions.createNode({id:e,shape:"circle",physics:!0,hidden:!0});this._body.nodes[e]=t,this.via=t,this.via.parentEdgeId=this.id,this.positionBezierNode()}}},{key:"positionBezierNode",value:function(){void 0!==this.via&&void 0!==this.from&&void 0!==this.to?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):void 0!==this.via&&(this.via.x=0,this.via.y=0)}},{key:"_line",value:function(e,t,o){this._bezierCurve(e,t,o)}},{key:"_getViaCoordinates",value:function(){return this.via}},{key:"getViaNode",value:function(){return this.via}},{key:"getPoint",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.via;if(this.from===this.to){var o=this._getCircleData(),n=kl(o,3),i=n[0],d=n[1],s=n[2],r=2*Oo*(1-e);return{x:i+s*_o(r),y:d+s-s*(1-bo(r))}}return{x:ko(1-e,2)*this.fromPoint.x+2*e*(1-e)*t.x+ko(e,2)*this.toPoint.x,y:ko(1-e,2)*this.fromPoint.y+2*e*(1-e)*t.y+ko(e,2)*this.toPoint.y}}},{key:"_findBorderPosition",value:function(e,t){return this._findBorderPositionBezier(e,t,this.via)}},{key:"_getDistanceToEdge",value:function(e,t,o,n,i,a){return this._getDistanceToBezierEdge(e,t,o,n,i,a,this.via)}}]),t}(vc),wc=function(e){function t(e,o,n){return pl(this,t),Il(this,Pl(t).call(this,e,o,n))}return Nl(t,e),hl(t,[{key:"_line",value:function(e,t,o){this._bezierCurve(e,t,o)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_getViaCoordinates",value:function(){var e=this.options.smooth.roundness,t=this.options.smooth.type,o=So(this.from.x-this.to.x),n=So(this.from.y-this.to.y);if("discrete"===t||"diagonalCross"===t){var i,a;i=o<=n?a=e*n:a=e*o,this.from.x>this.to.x&&(i=-i),this.from.y>=this.to.y&&(a=-a);var d=this.from.x+i,s=this.from.y+a;return"discrete"===t&&(o<=n?d=o<e*n?this.from.x:d:s=n<e*o?this.from.y:s),{x:d,y:s}}if("straightCross"===t){var r=(1-e)*o,l=(1-e)*n;return o<=n?(r=0,this.from.y<this.to.y&&(l=-l)):(this.from.x<this.to.x&&(r=-r),l=0),{x:this.to.x+r,y:this.to.y+l}}if("horizontal"===t){var c=(1-e)*o;return this.from.x<this.to.x&&(c=-c),{x:this.to.x+c,y:this.from.y}}if("vertical"===t){var u=(1-e)*n;return this.from.y<this.to.y&&(u=-u),{x:this.from.x,y:this.to.y+u}}if("curvedCW"===t){o=this.to.x-this.from.x,n=this.from.y-this.to.y;var p=To(o*o+n*n),h=Oo,g=Do(n,o),m=(g+(.5*e+.5)*h)%(2*h);return{x:this.from.x+(.5*e+.5)*p*_o(m),y:this.from.y+(.5*e+.5)*p*bo(m)}}if("curvedCCW"===t){o=this.to.x-this.from.x,n=this.from.y-this.to.y;var y=To(o*o+n*n),f=Oo,b=Do(n,o),_=(b+(.5*-e+.5)*f)%(2*f);return{x:this.from.x+(.5*e+.5)*y*_o(_),y:this.from.y+(.5*e+.5)*y*bo(_)}}var v,k;v=o<=n?k=e*n:k=e*o,this.from.x>this.to.x&&(v=-v),this.from.y>=this.to.y&&(k=-k);var w=this.from.x+v,x=this.from.y+k;return o<=n?this.from.x<=this.to.x?w=this.to.x<w?this.to.x:w:w=this.to.x>w?this.to.x:w:this.from.y>=this.to.y?x=this.to.y>x?this.to.y:x:x=this.to.y<x?this.to.y:x,{x:w,y:x}}},{key:"_findBorderPosition",value:function(e,t){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return this._findBorderPositionBezier(e,t,o.via)}},{key:"_getDistanceToEdge",value:function(e,t,o,n,i,a){var d=6<arguments.length&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,t,o,n,i,a,d)}},{key:"getPoint",value:function(e){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),n=e,t=ko(1-n,2)*this.fromPoint.x+2*n*(1-n)*o.x+ko(n,2)*this.toPoint.x,i=ko(1-n,2)*this.fromPoint.y+2*n*(1-n)*o.y+ko(n,2)*this.toPoint.y;return{x:t,y:i}}}]),t}(vc),xc=function(e){function t(e,o,n){return pl(this,t),Il(this,Pl(t).call(this,e,o,n))}return Nl(t,e),hl(t,[{key:"_getDistanceToBezierEdge2",value:function(e,o,n,a,d,s,r,l){for(var c=1e9,u=e,p=o,h=[0,0,0,0],g=1,m;10>g;g++){m=.1*g,h[0]=ko(1-m,3),h[1]=3*m*ko(1-m,2),h[2]=3*ko(m,2)*(1-m),h[3]=ko(m,3);var f=h[0]*e+h[1]*r.x+h[2]*l.x+h[3]*n,b=h[0]*o+h[1]*r.y+h[2]*l.y+h[3]*a;if(0<g){var y=this._getDistanceToLine(u,p,f,b,d,s);c=y<c?y:c}u=f,p=b}return c}}]),t}(vc),Sc=function(e){function t(e,o,n){return pl(this,t),Il(this,Pl(t).call(this,e,o,n))}return Nl(t,e),hl(t,[{key:"_line",value:function(e,t,o){var n=o[0],i=o[1];this._bezierCurve(e,t,n,i)}},{key:"_getViaCoordinates",value:function(){var e=this.from.x-this.to.x,t=this.from.y-this.to.y,o=this.options.smooth.roundness,n,i,a,d;return(So(e)>So(t)||!0===this.options.smooth.forceDirection||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(i=this.from.y,d=this.to.y,n=this.from.x-o*e,a=this.to.x+o*e):(i=this.from.y-o*t,d=this.to.y+o*t,n=this.from.x,a=this.to.x),[{x:n,y:i},{x:a,y:d}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(e,t){return this._findBorderPositionBezier(e,t)}},{key:"_getDistanceToEdge",value:function(e,t,o,n,i,a){var d=6<arguments.length&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates(),s=kl(d,2),r=s[0],l=s[1];return this._getDistanceToBezierEdge2(e,t,o,n,i,a,r,l)}},{key:"getPoint",value:function(e){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),n=kl(o,2),i=n[0],a=n[1],d=e,t=[ko(1-d,3),3*d*ko(1-d,2),3*ko(d,2)*(1-d),ko(d,3)],s=t[0]*this.fromPoint.x+t[1]*i.x+t[2]*a.x+t[3]*this.toPoint.x,r=t[0]*this.fromPoint.y+t[1]*i.y+t[2]*a.y+t[3]*this.toPoint.y;return{x:s,y:r}}}]),t}(xc),Oc=function(e){function t(e,o,n){return pl(this,t),Il(this,Pl(t).call(this,e,o,n))}return Nl(t,e),hl(t,[{key:"_line",value:function(e,t){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),e.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}},{key:"getViaNode",value:function(){}},{key:"getPoint",value:function(e){return{x:(1-e)*this.fromPoint.x+e*this.toPoint.x,y:(1-e)*this.fromPoint.y+e*this.toPoint.y}}},{key:"_findBorderPosition",value:function(e,t){var o=this.to,n=this.from;e.id===this.from.id&&(o=this.from,n=this.to);var i=Do(o.y-n.y,o.x-n.x),a=o.x-n.x,d=o.y-n.y,s=To(a*a+d*d),r=e.distanceToBorder(t,i),l=(s-r)/s;return{x:(1-l)*n.x+l*o.x,y:(1-l)*n.y+l*o.y,t:0}}},{key:"_getDistanceToEdge",value:function(e,t,o,n,i,a){return this._getDistanceToLine(e,t,o,n,i,a)}}]),t}(_c),Dc=function(){function e(t,o,n,i){if(pl(this,e),void 0===o)throw new Error("No body provided");this.options=Wd.bridgeObject(n),this.globalOptions=n,this.defaultOptions=i,this.body=o,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new Cl(this.body,this.options,!0),this.setOptions(t)}return hl(e,[{key:"setOptions",value:function(t){if(t){var o=this.options.hidden;(void 0===o||null===o)&&(o=!1),e.parseOptions(this.options,t,!0,this.globalOptions),void 0!==t.id&&(this.id=t.id),void 0!==t.from&&(this.fromId=t.from),void 0!==t.to&&(this.toId=t.to),void 0!==t.title&&(this.title=t.title),void 0!==t.value&&(t.value=parseFloat(t.value));var n=[t,this.options,this.defaultOptions];this.chooser=xl.choosify("edge",n),this.updateLabelModule(t);var i=this.updateEdgeType();this._setInteractionWidths(),this.connect();var a=this.options.hidden;return(void 0===a||null===a)&&(a=!1),(a!=o||void 0!==t.physics)&&(i=!0),void 0!==t.physics&&(i=!0),i}}},{key:"getFormattingValues",value:function(){var e=!0===this.options.arrows.to||!0===this.options.arrows.to.enabled,t=!0===this.options.arrows.from||!0===this.options.arrows.from.enabled,o=!0===this.options.arrows.middle||!0===this.options.arrows.middle.enabled,n=this.options.color.inherit,i={toArrow:e,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,middleArrow:o,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,fromArrow:t,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,arrowStrikethrough:this.options.arrowStrikethrough,color:n?void 0:this.options.color.color,inheritsColor:n,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};if(!(this.selected||this.hover))i.shadow=this.options.shadow.enabled,i.width=Co(i.width,.3/this.body.view.scale);else if(!0!==this.chooser)"function"==typeof this.chooser&&(this.chooser(i,this.options.id,this.selected,this.hover),void 0!==i.color&&(i.inheritsColor=!1),!1===i.shadow&&(i.shadowColor!==this.options.shadow.color||i.shadowSize!==this.options.shadow.size||i.shadowX!==this.options.shadow.x||i.shadowY!==this.options.shadow.y)&&(i.shadow=!0));else if(this.selected){var a=this.options.selectionWidth;"function"==typeof a?i.width=a(i.width):"number"==typeof a&&(i.width+=a),i.width=Co(i.width,.3/this.body.view.scale),i.color=this.options.color.highlight,i.shadow=this.options.shadow.enabled}else if(this.hover){var d=this.options.hoverWidth;"function"==typeof d?i.width=d(i.width):"number"==typeof d&&(i.width+=d),i.width=Co(i.width,.3/this.body.view.scale),i.color=this.options.color.hover,i.shadow=this.options.shadow.enabled}return i}},{key:"updateLabelModule",value:function(e){var t=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateEdgeType",value:function(){var e=this.options.smooth,t=!1,o=!0;return void 0!==this.edgeType&&((this.edgeType instanceof kc&&!0===e.enabled&&"dynamic"===e.type||this.edgeType instanceof Sc&&!0===e.enabled&&"cubicBezier"===e.type||this.edgeType instanceof wc&&!0===e.enabled&&"dynamic"!==e.type&&"cubicBezier"!==e.type||this.edgeType instanceof Oc&&!1===e.type.enabled)&&(o=!1),!0===o&&(t=this.cleanup())),!0===o?!0===e.enabled?"dynamic"===e.type?(t=!0,this.edgeType=new kc(this.options,this.body,this.labelModule)):"cubicBezier"===e.type?this.edgeType=new Sc(this.options,this.body,this.labelModule):this.edgeType=new wc(this.options,this.body,this.labelModule):this.edgeType=new Oc(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}},{key:"connect",value:function(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=void 0!==this.from&&void 0!==this.to,!0===this.connected?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}},{key:"disconnect",value:function(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}},{key:"getTitle",value:function(){return this.title}},{key:"isSelected",value:function(){return this.selected}},{key:"getValue",value:function(){return this.options.value}},{key:"setValueRange",value:function(e,t,o){if(void 0!==this.options.value){var n=this.options.scaling.customScalingFunction(e,t,o,this.options.value),i=this.options.scaling.max-this.options.scaling.min;if(!0===this.options.scaling.label.enabled){var a=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+n*a}this.options.width=this.options.scaling.min+n*i}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}},{key:"_setInteractionWidths",value:function(){this.edgeType.hoverWidth="function"==typeof this.options.hoverWidth?this.options.hoverWidth(this.options.width):this.options.hoverWidth+this.options.width,this.edgeType.selectionWidth="function"==typeof this.options.selectionWidth?this.options.selectionWidth(this.options.width):this.options.selectionWidth+this.options.width}},{key:"draw",value:function(e){var t=this.getFormattingValues();if(!t.hidden){var o=this.edgeType.getViaNode(),n={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,t.fromArrow&&(n.from=this.edgeType.getArrowData(e,"from",o,this.selected,this.hover,t),!1===t.arrowStrikethrough&&(this.edgeType.fromPoint=n.from.core)),t.toArrow&&(n.to=this.edgeType.getArrowData(e,"to",o,this.selected,this.hover,t),!1===t.arrowStrikethrough&&(this.edgeType.toPoint=n.to.core)),t.middleArrow&&(n.middle=this.edgeType.getArrowData(e,"middle",o,this.selected,this.hover,t)),this.edgeType.drawLine(e,t,this.selected,this.hover,o),this.drawArrows(e,n,t),this.drawLabel(e,o)}}},{key:"drawArrows",value:function(e,t,o){o.fromArrow&&this.edgeType.drawArrowHead(e,o,this.selected,this.hover,t.from),o.middleArrow&&this.edgeType.drawArrowHead(e,o,this.selected,this.hover,t.middle),o.toArrow&&this.edgeType.drawArrowHead(e,o,this.selected,this.hover,t.to)}},{key:"drawLabel",value:function(e,t){if(void 0!==this.options.label){var o=this.from,n=this.to;if(this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover),o.id!=n.id){this.labelModule.pointToSelf=!1;var i=this.edgeType.getPoint(.5,t);e.save();var a=this._getRotation(e);0!=a.angle&&(e.translate(a.x,a.y),e.rotate(a.angle)),this.labelModule.draw(e,i.x,i.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;var d=this.options.selfReferenceSize,s,r;o.shape.width>o.shape.height?(s=o.x+.5*o.shape.width,r=o.y-d):(s=o.x+d,r=o.y-.5*o.shape.height),i=this._pointOnCircle(s,r,d,.125),this.labelModule.draw(e,i.x,i.y,this.selected,this.hover)}}}},{key:"getItemsOnPoint",value:function(e){var t=[];if(this.labelModule.visible()){var o=this._getRotation();xl.pointInRect(this.labelModule.getSize(),e,o)&&t.push({edgeId:this.id,labelId:0})}var n={left:e.x,top:e.y};return this.isOverlappingWith(n)&&t.push({edgeId:this.id}),t}},{key:"isOverlappingWith",value:function(e){if(this.connected){var t=this.from.x,o=this.from.y,n=this.to.x,i=this.to.y,a=e.left,d=e.top,s=this.edgeType.getDistanceToEdge(t,o,n,i,a,d);return 10>s}return!1}},{key:"_getRotation",value:function(e){var t=this.edgeType.getViaNode(),o=this.edgeType.getPoint(.5,t);void 0!==e&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,o.x,o.y);var n={x:o.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible())return n;if("horizontal"===this.options.font.align)return n;var i=this.from.y-this.to.y,a=this.from.x-this.to.x,d=Do(i,a);return(-1>d&&0>a||0<d&&0>a)&&(d+=Oo),n.angle=d,n}},{key:"_pointOnCircle",value:function(e,t,o,n){var i=2*n*Oo;return{x:e+o*bo(i),y:t-o*_o(i)}}},{key:"select",value:function(){this.selected=!0}},{key:"unselect",value:function(){this.selected=!1}},{key:"cleanup",value:function(){return this.edgeType.cleanup()}},{key:"remove",value:function(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}},{key:"endPointsValid",value:function(){return void 0!==this.body.nodes[this.fromId]&&void 0!==this.body.nodes[this.toId]}}],[{key:"parseOptions",value:function(e,t){var o=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2],n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},a=!!(4<arguments.length&&void 0!==arguments[4])&&arguments[4];if(Wd.selectiveDeepExtend(["arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","to","title","value","width","font","chosen","widthConstraint"],e,t,o),xl.isValidLabel(t.label)?e.label=t.label:!xl.isValidLabel(e.label)&&(e.label=void 0),Wd.mergeOptions(e,t,"smooth",n),Wd.mergeOptions(e,t,"shadow",n),Wd.mergeOptions(e,t,"background",n),void 0!==t.dashes&&null!==t.dashes?e.dashes=t.dashes:!0===o&&null===t.dashes&&(e.dashes=Object.create(n.dashes)),void 0!==t.scaling&&null!==t.scaling?(void 0!==t.scaling.min&&(e.scaling.min=t.scaling.min),void 0!==t.scaling.max&&(e.scaling.max=t.scaling.max),Wd.mergeOptions(e.scaling,t.scaling,"label",n.scaling)):!0===o&&null===t.scaling&&(e.scaling=Object.create(n.scaling)),void 0===t.arrows||null===t.arrows)!0===o&&null===t.arrows&&(e.arrows=Object.create(n.arrows));else if("string"==typeof t.arrows){var d=t.arrows.toLowerCase();e.arrows.to.enabled=-1!=d.indexOf("to"),e.arrows.middle.enabled=-1!=d.indexOf("middle"),e.arrows.from.enabled=-1!=d.indexOf("from")}else if("object"===wl(t.arrows))Wd.mergeOptions(e.arrows,t.arrows,"to",n.arrows),Wd.mergeOptions(e.arrows,t.arrows,"middle",n.arrows),Wd.mergeOptions(e.arrows,t.arrows,"from",n.arrows);else throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+JSON.stringify(t.arrows));if(void 0!==t.color&&null!==t.color){var s=Wd.isString(t.color)?{color:t.color,highlight:t.color,hover:t.color,inherit:!1,opacity:1}:t.color,r=e.color;if(a)Wd.deepExtend(r,n.color,!1,o);else for(var l in r)r.hasOwnProperty(l)&&delete r[l];if(Wd.isString(r))r.color=r,r.highlight=r,r.hover=r,r.inherit=!1,void 0===s.opacity&&(r.opacity=1);else{var i=!1;void 0!==s.color&&(r.color=s.color,i=!0),void 0!==s.highlight&&(r.highlight=s.highlight,i=!0),void 0!==s.hover&&(r.hover=s.hover,i=!0),void 0!==s.inherit&&(r.inherit=s.inherit),void 0!==s.opacity&&(r.opacity=Mo(1,Co(0,s.opacity))),!0==i?r.inherit=!1:void 0===r.inherit&&(r.inherit="from")}}else!0===o&&null===t.color&&(e.color=Wd.bridgeObject(n.color));!0===o&&null===t.font&&(e.font=Wd.bridgeObject(n.font))}}]),e}(),Tc=function(){function e(t,o,n){var i=this;pl(this,e),this.body=t,this.images=o,this.groups=n,this.body.functions.createEdge=this.create.bind(this),this.edgesListeners={add:function(e,t){i.add(t.items)},update:function(e,t){i.update(t.items)},remove:function(e,t){i.remove(t.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1,type:"arrow"},middle:{enabled:!1,scaleFactor:1,type:"arrow"},from:{enabled:!1,scaleFactor:1,type:"arrow"}},arrowStrikethrough:!0,color:{color:"#848484",highlight:"#848484",hover:"#848484",inherit:"from",opacity:1},dashes:!1,font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:2,strokeColor:"#ffffff",align:"horizontal",multi:!1,vadjust:0,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"courier new",vadjust:2}},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(e,t,o,n){if(t===e)return .5;return Co(0,(n-e)*(1/(t-e)))}},selectionWidth:1.5,selfReferenceSize:20,shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},background:{enabled:!1,color:"rgba(111,111,111,1)",size:10,dashes:!1},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},Wd.deepExtend(this.options,this.defaultOptions),this.bindEventListeners()}return hl(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("_forceDisableDynamicCurves",function(t){var o=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];"dynamic"===t&&(t="continuous");var n=!1;for(var i in e.body.edges)if(e.body.edges.hasOwnProperty(i)){var a=e.body.edges[i],d=e.body.data.edges._data[i];if(void 0!==d){var s=d.smooth;void 0!==s&&!0===s.enabled&&"dynamic"===s.type&&(void 0===t?a.setOptions({smooth:!1}):a.setOptions({smooth:{type:t}}),n=!0)}}!0===o&&!0==n&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",function(){e.reconnectEdges()}),this.body.emitter.on("refreshEdges",this.refresh.bind(this)),this.body.emitter.on("refresh",this.refresh.bind(this)),this.body.emitter.on("destroy",function(){Wd.forEach(e.edgesListeners,function(t,o){e.body.data.edges&&e.body.data.edges.off(o,t)}),delete e.body.functions.createEdge,delete e.edgesListeners.add,delete e.edgesListeners.update,delete e.edgesListeners.remove,delete e.edgesListeners})}},{key:"setOptions",value:function(e){if(void 0!==e){Dc.parseOptions(this.options,e,!0,this.defaultOptions,!0);var t=!1;if(void 0!==e.smooth)for(var o in this.body.edges)this.body.edges.hasOwnProperty(o)&&(t=this.body.edges[o].updateEdgeType()||t);if(void 0!==e.font)for(var n in this.body.edges)this.body.edges.hasOwnProperty(n)&&this.body.edges[n].updateLabelModule();(void 0!==e.hidden||void 0!==e.physics||!0===t)&&this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(e){var t=this,o=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1],n=this.body.data.edges;if(e instanceof xs||e instanceof Ss)this.body.data.edges=e;else if(Array.isArray(e))this.body.data.edges=new xs,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new xs;else throw new TypeError("Array or DataSet expected");if(n&&Wd.forEach(this.edgesListeners,function(e,t){n.off(t,e)}),this.body.edges={},this.body.data.edges){Wd.forEach(this.edgesListeners,function(e,o){t.body.data.edges.on(o,e)});var i=this.body.data.edges.getIds();this.add(i,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),!1===o&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var t=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1],o=this.body.edges,n=this.body.data.edges,a=0;a<e.length;a++){var d=e[a],s=o[d];s&&s.disconnect();var r=n.get(d,{showInternalIds:!0});o[d]=this.create(r)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),!1===t&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(e){for(var t=this.body.edges,o=this.body.data.edges,n=!1,a=0;a<e.length;a++){var d=e[a],s=o.get(d),r=t[d];void 0===r?(this.body.edges[d]=this.create(s),n=!0):(r.disconnect(),n=r.setOptions(s)||n,r.connect())}!0===n?(this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),this.body.emitter.emit("_dataChanged")):this.body.emitter.emit("_dataUpdated")}},{key:"remove",value:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];if(0!==e.length){var o=this.body.edges;Wd.forEach(e,function(e){var t=o[e];void 0!==t&&t.remove()}),t&&this.body.emitter.emit("_dataChanged")}}},{key:"refresh",value:function(){var e=this;Wd.forEach(this.body.edges,function(t,o){var n=e.body.data.edges._data[o];void 0!==n&&t.setOptions(n)})}},{key:"create",value:function(e){return new Dc(e,this.body,this.options,this.defaultOptions)}},{key:"reconnectEdges",value:function(){var e=this.body.nodes,t=this.body.edges,o;for(o in e)e.hasOwnProperty(o)&&(e[o].edges=[]);for(o in t)if(t.hasOwnProperty(o)){var n=t[o];n.from=null,n.to=null,n.connect()}}},{key:"getConnectedNodes",value:function(e){var t=[];if(void 0!==this.body.edges[e]){var o=this.body.edges[e];void 0!==o.fromId&&t.push(o.fromId),void 0!==o.toId&&t.push(o.toId)}return t}},{key:"_updateState",value:function(){this._addMissingEdges(),this._removeInvalidEdges()}},{key:"_removeInvalidEdges",value:function(){var e=this,t=[];Wd.forEach(this.body.edges,function(o,n){var i=e.body.nodes[o.toId],a=e.body.nodes[o.fromId];void 0!==i&&!0===i.isCluster||void 0!==a&&!0===a.isCluster||(void 0===i||void 0===a)&&t.push(n)}),this.remove(t,!1)}},{key:"_addMissingEdges",value:function(){var e=this.body.data.edges;if(void 0!==e&&null!==e){var t=this.body.edges,o=[];e.forEach(function(e,n){var i=t[n];void 0===i&&o.push(n)}),this.add(o,!0)}}}]),e}(),Ec=function(){function e(t,o,n){pl(this,e),this.body=t,this.physicsBody=o,this.barnesHutTree,this.setOptions(n),this.randomSeed=5}return hl(e,[{key:"setOptions",value:function(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Co(0,Mo(1,this.options.avoidOverlap))}},{key:"seededRandom",value:function(){var e=1e4*_o(this.randomSeed++);return e-Eo(e)}},{key:"solve",value:function(){if(0!==this.options.gravitationalConstant&&0<this.physicsBody.physicsNodeIndices.length){var e=this.body.nodes,t=this.physicsBody.physicsNodeIndices,o=t.length,n=this._formBarnesHutTree(e,t),a;this.barnesHutTree=n;for(var d=0;d<o;d++)a=e[t[d]],0<a.options.mass&&this._getForceContributions(n.root,a)}}},{key:"_getForceContributions",value:function(e,t){this._getForceContribution(e.children.NW,t),this._getForceContribution(e.children.NE,t),this._getForceContribution(e.children.SW,t),this._getForceContribution(e.children.SE,t)}},{key:"_getForceContribution",value:function(e,t){if(0<e.childrenCount){var o,n,i;o=e.centerOfMass.x-t.x,n=e.centerOfMass.y-t.y,i=To(o*o+n*n),i*e.calcSize>this.thetaInversed?this._calculateForces(i,o,n,t,e):4===e.childrenCount?this._getForceContributions(e,t):e.children.data.id!=t.id&&this._calculateForces(i,o,n,t,e)}}},{key:"_calculateForces",value:function(e,t,o,n,i){0===e&&(e=.1,t=e),1>this.overlapAvoidanceFactor&&n.shape.radius&&(e=Co(.1+this.overlapAvoidanceFactor*n.shape.radius,e-n.shape.radius));var a=this.options.gravitationalConstant*i.mass*n.options.mass/ko(e,3),d=t*a;this.physicsBody.forces[n.id].x+=d,this.physicsBody.forces[n.id].y+=o*a}},{key:"_formBarnesHutTree",value:function(e,t){for(var o=t.length,n=e[t[0]].x,a=e[t[0]].y,d=e[t[0]].x,s=e[t[0]].y,r=1,l;r<o;r++){var c=e[t[r]],u=c.x,p=c.y;0<c.options.mass&&(u<n&&(n=u),u>d&&(d=u),p<a&&(a=p),p>s&&(s=p))}var h=So(d-n)-So(s-a);0<h?(a-=.5*h,s+=.5*h):(n+=.5*h,d-=.5*h);var g=Co(1e-5,So(d-n)),m=.5*g,y=.5*(n+d),f=.5*(a+s),b={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:y-m,maxX:y+m,minY:f-m,maxY:f+m},size:g,calcSize:1/g,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(b.root);for(var _=0;_<o;_++)l=e[t[_]],0<l.options.mass&&this._placeInTree(b.root,l);return b}},{key:"_updateBranchMass",value:function(e,t){var o=e.centerOfMass,n=e.mass+t.options.mass,i=1/n;o.x=o.x*e.mass+t.x*t.options.mass,o.x*=i,o.y=o.y*e.mass+t.y*t.options.mass,o.y*=i,e.mass=n;var a=Co(Co(t.height,t.radius),t.width);e.maxWidth=e.maxWidth<a?a:e.maxWidth}},{key:"_placeInTree",value:function(e,t,o){(!0!=o||void 0===o)&&this._updateBranchMass(e,t);var n=e.children.NW.range,i;i=n.maxX>t.x?n.maxY>t.y?"NW":"SW":n.maxY>t.y?"NE":"SE",this._placeInRegion(e,t,i)}},{key:"_placeInRegion",value:function(e,t,o){var n=e.children[o];switch(n.childrenCount){case 0:n.children.data=t,n.childrenCount=1,this._updateBranchMass(n,t);break;case 1:n.children.data.x===t.x&&n.children.data.y===t.y?(t.x+=this.seededRandom(),t.y+=this.seededRandom()):(this._splitBranch(n),this._placeInTree(n,t));break;case 4:this._placeInTree(n,t);}}},{key:"_splitBranch",value:function(e){var t=null;1===e.childrenCount&&(t=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),null!=t&&this._placeInTree(e,t)}},{key:"_insertRegion",value:function(e,t){var o=.5*e.size,n,i,a,d;"NW"===t?(n=e.range.minX,i=e.range.minX+o,a=e.range.minY,d=e.range.minY+o):"NE"===t?(n=e.range.minX+o,i=e.range.maxX,a=e.range.minY,d=e.range.minY+o):"SW"===t?(n=e.range.minX,i=e.range.minX+o,a=e.range.minY+o,d=e.range.maxY):"SE"===t?(n=e.range.minX+o,i=e.range.maxX,a=e.range.minY+o,d=e.range.maxY):void 0,e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:n,maxX:i,minY:a,maxY:d},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}},{key:"_debug",value:function(e,t){void 0!==this.barnesHutTree&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}},{key:"_drawBranch",value:function(e,t,o){void 0===o&&(o="#FF0000"),4===e.childrenCount&&(this._drawBranch(e.children.NW,t),this._drawBranch(e.children.NE,t),this._drawBranch(e.children.SE,t),this._drawBranch(e.children.SW,t)),t.strokeStyle=o,t.beginPath(),t.moveTo(e.range.minX,e.range.minY),t.lineTo(e.range.maxX,e.range.minY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.minY),t.lineTo(e.range.maxX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.maxY),t.lineTo(e.range.minX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.minX,e.range.maxY),t.lineTo(e.range.minX,e.range.minY),t.stroke()}}]),e}(),Cc=function(){function e(t,o,n){pl(this,e),this.body=t,this.physicsBody=o,this.setOptions(n)}return hl(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e=this.body.nodes,t=this.physicsBody.physicsNodeIndices,o=this.physicsBody.forces,n=this.options.nodeDistance,a=0,d,s,r,l,c,u,p,h;a<t.length-1;a++){p=e[t[a]];for(var g=a+1;g<t.length;g++)h=e[t[g]],d=h.x-p.x,s=h.y-p.y,r=To(d*d+s*s),0===r&&(r=.1*Math.random(),d=r),r<2*n&&(u=r<.5*n?1:-2/3/n*r+4/3,u/=r,l=d*u,c=s*u,o[p.id].x-=l,o[p.id].y-=c,o[h.id].x+=l,o[h.id].y+=c)}}}]),e}(),Mc=function(){function e(t,o,n){pl(this,e),this.body=t,this.physicsBody=o,this.setOptions(n)}return hl(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){var e=this.body.nodes,t=this.physicsBody.physicsNodeIndices,o=this.physicsBody.forces,n=this.options.nodeDistance,a,d,s,r,l,c,u,p,h,g;for(h=0;h<t.length-1;h++)for(u=e[t[h]],g=h+1;g<t.length;g++)if(p=e[t[g]],u.level===p.level){a=p.x-u.x,d=p.y-u.y,s=To(a*a+d*d);var m=.05;c=s<n?-ko(m*s,2)+ko(m*n,2):0,0===s?s=.01:c/=s,r=a*c,l=d*c,o[u.id].x-=r,o[u.id].y-=l,o[p.id].x+=r,o[p.id].y+=l}}}]),e}(),Ic=function(){function e(t,o,n){pl(this,e),this.body=t,this.physicsBody=o,this.setOptions(n)}return hl(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e=this.physicsBody.physicsEdgeIndices,t=this.body.edges,o=0,n,a,d,s,r;o<e.length;o++)a=t[e[o]],!0===a.connected&&a.toId!==a.fromId&&void 0!==this.body.nodes[a.toId]&&void 0!==this.body.nodes[a.fromId]&&(void 0===a.edgeType.via?(n=void 0===a.options.length?1.5*this.options.springLength:a.options.length,this._calculateSpringForce(a.from,a.to,n)):(n=void 0===a.options.length?this.options.springLength:a.options.length,d=a.to,s=a.edgeType.via,r=a.from,this._calculateSpringForce(d,s,.5*n),this._calculateSpringForce(s,r,.5*n)))}},{key:"_calculateSpringForce",value:function(e,t,o){var n=e.x-t.x,i=e.y-t.y,a=Co(To(n*n+i*i),.01),d=this.options.springConstant*(o-a)/a,s=n*d,r=i*d;void 0!==this.physicsBody.forces[e.id]&&(this.physicsBody.forces[e.id].x+=s,this.physicsBody.forces[e.id].y+=r),void 0!==this.physicsBody.forces[t.id]&&(this.physicsBody.forces[t.id].x-=s,this.physicsBody.forces[t.id].y-=r)}}]),e}(),Pc=function(){function e(t,o,n){pl(this,e),this.body=t,this.physicsBody=o,this.setOptions(n)}return hl(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e=this.body.edges,t=.5,o=this.physicsBody.physicsEdgeIndices,n=this.physicsBody.physicsNodeIndices,a=this.physicsBody.forces,d=0,s,r,l,c,u,p,h,g,m;d<n.length;d++)m=n[d],a[m].springFx=0,a[m].springFy=0;for(var y=0;y<o.length;y++)r=e[o[y]],!0===r.connected&&(s=void 0===r.options.length?this.options.springLength:r.options.length,l=r.from.x-r.to.x,c=r.from.y-r.to.y,g=To(l*l+c*c),g=0===g?.01:g,h=this.options.springConstant*(s-g)/g,u=l*h,p=c*h,r.to.level==r.from.level?(void 0!==a[r.toId]&&(a[r.toId].x-=t*u,a[r.toId].y-=t*p),void 0!==a[r.fromId]&&(a[r.fromId].x+=t*u,a[r.fromId].y+=t*p)):(void 0!==a[r.toId]&&(a[r.toId].springFx-=u,a[r.toId].springFy-=p),void 0!==a[r.fromId]&&(a[r.fromId].springFx+=u,a[r.fromId].springFy+=p)));h=1;for(var f=0,b,_,v;f<n.length;f++)v=n[f],b=Mo(h,Co(-h,a[v].springFx)),_=Mo(h,Co(-h,a[v].springFy)),a[v].x+=b,a[v].y+=_;for(var k=0,w=0,x=0,S;x<n.length;x++)S=n[x],k+=a[S].x,w+=a[S].y;for(var O=k/n.length,D=w/n.length,T=0,E;T<n.length;T++)E=n[T],a[E].x-=O,a[E].y-=D}}]),e}(),Fc=function(){function e(t,o,n){pl(this,e),this.body=t,this.physicsBody=o,this.setOptions(n)}return hl(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e=this.body.nodes,t=this.physicsBody.physicsNodeIndices,o=this.physicsBody.forces,n=0,a,d,s,r,l;n<t.length;n++)l=t[n],r=e[l],a=-r.x,d=-r.y,s=To(a*a+d*d),this._calculateForces(s,a,d,o,r)}},{key:"_calculateForces",value:function(e,t,o,n,i){var a=0===e?0:this.options.centralGravity/e;n[i.id].x=t*a,n[i.id].y=o*a}}]),e}(),Nc=function(e){function t(e,o,n){return pl(this,t),Il(this,Pl(t).call(this,e,o,n))}return Nl(t,e),hl(t,[{key:"_calculateForces",value:function(e,t,o,n,i){0===e&&(e=.1*Math.random(),t=e),1>this.overlapAvoidanceFactor&&n.shape.radius&&(e=Co(.1+this.overlapAvoidanceFactor*n.shape.radius,e-n.shape.radius));var a=n.edges.length+1,d=this.options.gravitationalConstant*i.mass*n.options.mass*a/ko(e,2),s=t*d;this.physicsBody.forces[n.id].x+=s,this.physicsBody.forces[n.id].y+=o*d}}]),t}(Ec),Yc=function(e){function t(e,o,n){return pl(this,t),Il(this,Pl(t).call(this,e,o,n))}return Nl(t,e),hl(t,[{key:"_calculateForces",value:function(e,t,o,n,i){if(0<e){var a=i.edges.length+1,d=this.options.centralGravity*a*i.options.mass;n[i.id].x=t*d,n[i.id].y=o*d}}}]),t}(Fc),Rc=function(){function e(t){pl(this,e),this.body=t,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0},Wd.extend(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return hl(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("initPhysics",function(){e.initPhysics()}),this.body.emitter.on("_layoutFailed",function(){e.layoutFailed=!0}),this.body.emitter.on("resetPhysics",function(){e.stopSimulation(),e.ready=!1}),this.body.emitter.on("disablePhysics",function(){e.physicsEnabled=!1,e.stopSimulation()}),this.body.emitter.on("restorePhysics",function(){e.setOptions(e.options),!0===e.ready&&e.startSimulation()}),this.body.emitter.on("startSimulation",function(){!0===e.ready&&e.startSimulation()}),this.body.emitter.on("stopSimulation",function(){e.stopSimulation()}),this.body.emitter.on("destroy",function(){e.stopSimulation(!1),e.body.emitter.off()}),this.body.emitter.on("_dataChanged",function(){e.updatePhysicsData()})}},{key:"setOptions",value:function(e){void 0!==e&&(!1===e?(this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation()):!0===e?(this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation()):(this.physicsEnabled=!0,Wd.selectiveNotDeepExtend(["stabilization"],this.options,e),Wd.mergeOptions(this.options,e,"stabilization"),void 0===e.enabled&&(this.options.enabled=!0),!1===this.options.enabled&&(this.physicsEnabled=!1,this.stopSimulation()),this.timestep=this.options.timestep)),this.init()}},{key:"init",value:function(){var e;"forceAtlas2Based"===this.options.solver?(e=this.options.forceAtlas2Based,this.nodesSolver=new Nc(this.body,this.physicsBody,e),this.edgesSolver=new Ic(this.body,this.physicsBody,e),this.gravitySolver=new Yc(this.body,this.physicsBody,e)):"repulsion"===this.options.solver?(e=this.options.repulsion,this.nodesSolver=new Cc(this.body,this.physicsBody,e),this.edgesSolver=new Ic(this.body,this.physicsBody,e),this.gravitySolver=new Fc(this.body,this.physicsBody,e)):"hierarchicalRepulsion"===this.options.solver?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new Mc(this.body,this.physicsBody,e),this.edgesSolver=new Pc(this.body,this.physicsBody,e),this.gravitySolver=new Fc(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new Ec(this.body,this.physicsBody,e),this.edgesSolver=new Ic(this.body,this.physicsBody,e),this.gravitySolver=new Fc(this.body,this.physicsBody,e)),this.modelOptions=e}},{key:"initPhysics",value:function(){!0===this.physicsEnabled&&!0===this.options.enabled?!0===this.options.stabilization.enabled?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}},{key:"startSimulation",value:function(){!0===this.physicsEnabled&&!0===this.options.enabled?(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),void 0===this.viewFunction&&(this.viewFunction=this.simulationStep.bind(this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))):this.body.emitter.emit("_redraw")}},{key:"stopSimulation",value:function(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];this.stabilized=!0,!0===e&&this._emitStabilized(),void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,!0===e&&this.body.emitter.emit("_stopRendering"))}},{key:"simulationStep",value:function(){var e=Date.now();this.physicsTick();var t=Date.now()-e;(t<.4*this.simulationInterval||!0===this.runDoubleSpeed)&&!1===this.stabilized&&(this.physicsTick(),this.runDoubleSpeed=!0),!0===this.stabilized&&this.stopSimulation()}},{key:"_emitStabilized",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.stabilizationIterations;(1<this.stabilizationIterations||!0===this.startedStabilization)&&setTimeout(function(){e.body.emitter.emit("stabilized",{iterations:t}),e.startedStabilization=!1,e.stabilizationIterations=0},0)}},{key:"physicsStep",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}},{key:"adjustTimeStep",value:function(){var e=1.2;!0===this._evaluateStepQuality()?this.timestep=e*this.timestep:this.timestep/e<this.options.timestep?this.timestep=this.options.timestep:(this.adaptiveCounter=-1,this.timestep=Co(this.options.timestep,this.timestep/e))}},{key:"physicsTick",value:function(){if(this._startStabilizing(),!0!==this.stabilized){if(!0===this.adaptiveTimestep&&!0===this.adaptiveTimestepEnabled){var e=0==this.adaptiveCounter%this.adaptiveInterval;e?(this.timestep=2*this.timestep,this.physicsStep(),this.revert(),this.timestep=.5*this.timestep,this.physicsStep(),this.physicsStep(),this.adjustTimeStep()):this.physicsStep(),this.adaptiveCounter+=1}else this.timestep=this.options.timestep,this.physicsStep();!0===this.stabilized&&this.revert(),this.stabilizationIterations++}}},{key:"updatePhysicsData",value:function(){this.physicsBody.forces={},this.physicsBody.physicsNodeIndices=[],this.physicsBody.physicsEdgeIndices=[];var e=this.body.nodes,t=this.body.edges;for(var o in e)e.hasOwnProperty(o)&&!0===e[o].options.physics&&this.physicsBody.physicsNodeIndices.push(e[o].id);for(var n in t)t.hasOwnProperty(n)&&!0===t[n].options.physics&&this.physicsBody.physicsEdgeIndices.push(t[n].id);for(var a=0,d;a<this.physicsBody.physicsNodeIndices.length;a++)d=this.physicsBody.physicsNodeIndices[a],this.physicsBody.forces[d]={x:0,y:0},void 0===this.physicsBody.velocities[d]&&(this.physicsBody.velocities[d]={x:0,y:0});for(var s in this.physicsBody.velocities)void 0===e[s]&&delete this.physicsBody.velocities[s]}},{key:"revert",value:function(){var e=Object.keys(this.previousStates),t=this.body.nodes,o=this.physicsBody.velocities;this.referenceState={};for(var n=0,a;n<e.length;n++)a=e[n],void 0===t[a]?delete this.previousStates[a]:!0===t[a].options.physics&&(this.referenceState[a]={positions:{x:t[a].x,y:t[a].y}},o[a].x=this.previousStates[a].vx,o[a].y=this.previousStates[a].vy,t[a].x=this.previousStates[a].x,t[a].y=this.previousStates[a].y)}},{key:"_evaluateStepQuality",value:function(){var e=this.body.nodes,t=this.referenceState,o,n,i;for(var a in this.referenceState)if(this.referenceState.hasOwnProperty(a)&&void 0!==e[a]&&(o=e[a].x-t[a].positions.x,n=e[a].y-t[a].positions.y,i=To(ko(o,2)+ko(n,2)),i>.3))return!1;return!0}},{key:"moveNodes",value:function(){for(var e=this.physicsBody.physicsNodeIndices,t=0,o=0,n=5,a=0;a<e.length;a++){var d=e[a],s=this._performStep(d);t=Co(t,s),o+=s}this.adaptiveTimestepEnabled=o/e.length<n,this.stabilized=t<this.options.minVelocity}},{key:"calculateComponentVelocity",value:function(e,t,o){var n=this.modelOptions.damping*e;e+=(t-n)/o*this.timestep;var i=this.options.maxVelocity||1e9;return So(e)>i&&(e=0<e?i:-i),e}},{key:"_performStep",value:function(e){var t=this.body.nodes[e],o=this.physicsBody.forces[e],n=this.physicsBody.velocities[e];this.previousStates[e]={x:t.x,y:t.y,vx:n.x,vy:n.y},!1===t.options.fixed.x?(n.x=this.calculateComponentVelocity(n.x,o.x,t.options.mass),t.x+=n.x*this.timestep):(o.x=0,n.x=0),!1===t.options.fixed.y?(n.y=this.calculateComponentVelocity(n.y,o.y,t.options.mass),t.y+=n.y*this.timestep):(o.y=0,n.y=0);var i=To(ko(n.x,2)+ko(n.y,2));return i}},{key:"_freezeNodes",value:function(){var e=this.body.nodes;for(var t in e)if(e.hasOwnProperty(t)&&e[t].x&&e[t].y){var o=e[t].options.fixed;this.freezeCache[t]={x:o.x,y:o.y},o.x=!0,o.y=!0}}},{key:"_restoreFrozenNodes",value:function(){var e=this.body.nodes;for(var t in e)e.hasOwnProperty(t)&&void 0!==this.freezeCache[t]&&(e[t].options.fixed.x=this.freezeCache[t].x,e[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}},{key:"stabilize",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.options.stabilization.iterations;return"number"!=typeof t&&(t=this.options.stabilization.iterations,console.log("The stabilize method needs a numeric amount of iterations. Switching to default: ",t)),0===this.physicsBody.physicsNodeIndices.length?void(this.ready=!0):void(this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=t,!0===this.options.stabilization.onlyDynamicEdges&&this._freezeNodes(),this.stabilizationIterations=0,setTimeout(function(){return e._stabilizationBatch()},0))}},{key:"_startStabilizing",value:function(){return!0!==this.startedStabilization&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}},{key:"_stabilizationBatch",value:function(){var e=this,t=function(){return!1===e.stabilized&&e.stabilizationIterations<e.targetIterations},o=function(){e.body.emitter.emit("stabilizationProgress",{iterations:e.stabilizationIterations,total:e.targetIterations})};this._startStabilizing()&&o();for(var n=0;t()&&n<this.options.stabilization.updateInterval;)this.physicsTick(),n++;o(),t()?setTimeout(this._stabilizationBatch.bind(this),0):this._finalizeStabilization()}},{key:"_finalizeStabilization",value:function(){this.body.emitter.emit("_allowRedraw"),!0===this.options.stabilization.fit&&this.body.emitter.emit("fit"),!0===this.options.stabilization.onlyDynamicEdges&&this._restoreFrozenNodes(),this.body.emitter.emit("stabilizationIterationsDone"),this.body.emitter.emit("_requestRedraw"),!0===this.stabilized?this._emitStabilized():this.startSimulation(),this.ready=!0}},{key:"_drawForces",value:function(e){for(var t=0;t<this.physicsBody.physicsNodeIndices.length;t++){var o=this.physicsBody.physicsNodeIndices[t],n=this.body.nodes[o],a=this.physicsBody.forces[o],d=20,s=To(ko(a.x,2)+ko(a.x,2)),r=Mo(Co(5,s),15),l=Wd.HSVToHex((180-180*Mo(1,Co(0,.03*s)))/360,1,1),c={x:n.x+d*a.x,y:n.y+d*a.y};e.lineWidth=r,e.strokeStyle=l,e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(c.x,c.y),e.stroke();var u=Do(a.y,a.x);e.fillStyle=l,bc.draw(e,{type:"arrow",point:c,angle:u,length:3*r}),e.fill()}}}]),e}(),zc=function(){function e(){pl(this,e)}return hl(e,null,[{key:"getRange",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],o=1e9,n=-1e9,a=1e9,d=-1e9,s;if(0<t.length)for(var r=0;r<t.length;r++)s=e[t[r]],a>s.shape.boundingBox.left&&(a=s.shape.boundingBox.left),d<s.shape.boundingBox.right&&(d=s.shape.boundingBox.right),o>s.shape.boundingBox.top&&(o=s.shape.boundingBox.top),n<s.shape.boundingBox.bottom&&(n=s.shape.boundingBox.bottom);return 1e9===a&&-1e9===d&&1e9===o&&-1e9===n&&(o=0,n=0,a=0,d=0),{minX:a,maxX:d,minY:o,maxY:n}}},{key:"getRangeCore",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],o=1e9,n=-1e9,a=1e9,d=-1e9,s;if(0<t.length)for(var r=0;r<t.length;r++)s=e[t[r]],a>s.x&&(a=s.x),d<s.x&&(d=s.x),o>s.y&&(o=s.y),n<s.y&&(n=s.y);return 1e9===a&&-1e9===d&&1e9===o&&-1e9===n&&(o=0,n=0,a=0,d=0),{minX:a,maxX:d,minY:o,maxY:n}}},{key:"findCenter",value:function(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}},{key:"cloneOptions",value:function(e,t){var o={};return void 0===t||"node"===t?(Wd.deepExtend(o,e.options,!0),o.x=e.x,o.y=e.y,o.amountOfConnections=e.edges.length):Wd.deepExtend(o,e.options,!0),o}}]),e}(),Bc=function(e){function t(e,o,n,i,a,d){var s;return pl(this,t),s=Il(this,Pl(t).call(this,e,o,n,i,a,d)),s.isCluster=!0,s.containedNodes={},s.containedEdges={},s}return Nl(t,e),hl(t,[{key:"_openChildCluster",value:function(e){var t=this,o=this.body.nodes[e];if(void 0===this.containedNodes[e])throw new Error("node with id: "+e+" not in current cluster");if(!o.isCluster)throw new Error("node with id: "+e+" is not a cluster");delete this.containedNodes[e],Wd.forEach(o.edges,function(e){delete t.containedEdges[e.id]}),Wd.forEach(o.containedNodes,function(e,o){t.containedNodes[o]=e}),o.containedNodes={},Wd.forEach(o.containedEdges,function(e,o){t.containedEdges[o]=e}),o.containedEdges={},Wd.forEach(o.edges,function(e){Wd.forEach(t.edges,function(o){var n=o.clusteringEdgeReplacingIds.indexOf(e.id);-1===n||(Wd.forEach(e.clusteringEdgeReplacingIds,function(e){o.clusteringEdgeReplacingIds.push(e),t.body.edges[e].edgeReplacedById=o.id}),o.clusteringEdgeReplacingIds.splice(n,1))})}),o.edges=[]}}]),t}(oc),Lc=function(){function e(t){var o=this;pl(this,e),this.body=t,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},Wd.extend(this.options,this.defaultOptions),this.body.emitter.on("_resetData",function(){o.clusteredNodes={},o.clusteredEdges={}})}return hl(e,[{key:"clusterByHubsize",value:function(e,t){void 0===e?e=this._getHubSize():"object"===wl(e)&&(t=this._checkOptions(e),e=this._getHubSize());for(var o=[],n=0,a;n<this.body.nodeIndices.length;n++)a=this.body.nodes[this.body.nodeIndices[n]],a.edges.length>=e&&o.push(a.id);for(var d=0;d<o.length;d++)this.clusterByConnection(o[d],t,!0);this.body.emitter.emit("_dataChanged")}},{key:"cluster",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},o=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];if(void 0===t.joinCondition)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");t=this._checkOptions(t);var n={},i={};Wd.forEach(this.body.nodes,function(o,a){o.options&&!0===t.joinCondition(o.options)&&(n[a]=o,Wd.forEach(o.edges,function(t){void 0===e.clusteredEdges[t.id]&&(i[t.id]=t)}))}),this._cluster(n,i,t,o)}},{key:"clusterByEdgeCount",value:function(e,t){var o=this,n=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];t=this._checkOptions(t);for(var a=[],d={},s=function(n){var i={},s={},r=o.body.nodeIndices[n],y=o.body.nodes[r];if(void 0===d[r]){u=0,c=[];for(var f=0;f<y.edges.length;f++)l=y.edges[f],void 0===o.clusteredEdges[l.id]&&(l.toId!==l.fromId&&u++,c.push(l));if(u===e){p=function(e){if(void 0===t.joinCondition||null===t.joinCondition)return!0;var o=zc.cloneOptions(e);return t.joinCondition(o)};for(var b=!0,_=0;_<c.length;_++){l=c[_];var v=o._getConnectedId(l,r);if(p(y))s[l.id]=l,i[r]=y,i[v]=o.body.nodes[v],d[r]=!0;else{b=!1;break}}if(0<Object.keys(i).length&&0<Object.keys(s).length&&!0===b)if(h=function(){for(var e=0;e<a.length;++e)for(var t in i)if(void 0!==a[e].nodes[t])return a[e]},g=h(),void 0!==g){for(var k in i)void 0===g.nodes[k]&&(g.nodes[k]=i[k]);for(var m in s)void 0===g.edges[m]&&(g.edges[m]=s[m])}else a.push({nodes:i,edges:s})}}},r=0,l,c,u;r<this.body.nodeIndices.length;r++){var p,h,g;s(r)}for(var r=0;r<a.length;r++)this._cluster(a[r].nodes,a[r].edges,t,!1);!0===n&&this.body.emitter.emit("_dataChanged")}},{key:"clusterOutliers",value:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(1,e,t)}},{key:"clusterBridges",value:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(2,e,t)}},{key:"clusterByConnection",value:function(e,t){var o=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];if(void 0===e)throw new Error("No nodeId supplied to clusterByConnection!");if(void 0===this.body.nodes[e])throw new Error("The nodeId given to clusterByConnection does not exist!");var n=this.body.nodes[e];t=this._checkOptions(t,n),void 0===t.clusterNodeProperties.x&&(t.clusterNodeProperties.x=n.x),void 0===t.clusterNodeProperties.y&&(t.clusterNodeProperties.y=n.y),void 0===t.clusterNodeProperties.fixed&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=n.options.fixed.x,t.clusterNodeProperties.fixed.y=n.options.fixed.y);var a={},d={},s=n.id,r=zc.cloneOptions(n);a[s]=n;for(var l=0,c;l<n.edges.length;l++)if(c=n.edges[l],void 0===this.clusteredEdges[c.id]){var u=this._getConnectedId(c,s);if(void 0===this.clusteredNodes[u])if(u===s)d[c.id]=c;else if(void 0===t.joinCondition)d[c.id]=c,a[u]=this.body.nodes[u];else{var p=zc.cloneOptions(this.body.nodes[u]);!0===t.joinCondition(r,p)&&(d[c.id]=c,a[u]=this.body.nodes[u])}}var h=Object.keys(a).map(function(e){return a[e].id});for(g in a)if(a.hasOwnProperty(g))for(var g=a[g],m=0,f;m<g.edges.length;m++)f=g.edges[m],-1<h.indexOf(this._getConnectedId(f,g.id))&&(d[f.id]=f);this._cluster(a,d,t,o)}},{key:"_createClusterEdges",value:function(e,t,o,n){for(var a=Object.keys(e),d=[],s=0,r,l,c,u,p,h;s<a.length;s++){l=a[s],c=e[l];for(var g=0;g<c.edges.length;g++)r=c.edges[g],void 0===this.clusteredEdges[r.id]&&(r.toId==r.fromId?t[r.id]=r:r.toId==l?(u=o.id,p=r.fromId,h=p):(u=r.toId,p=o.id,h=u),void 0===e[h]&&d.push({edge:r,fromId:p,toId:u}))}for(var m=[],y=function(e){for(var t=0;t<m.length;t++){var o=m[t],n=e.fromId===o.fromId&&e.toId===o.toId,i=e.fromId===o.toId&&e.toId===o.fromId;if(n||i)return o}return null},f=0;f<d.length;f++){var b=d[f],_=b.edge,v=y(b);null===v?(v=this._createClusteredEdge(b.fromId,b.toId,_,n),m.push(v)):v.clusteringEdgeReplacingIds.push(_.id),this.body.edges[_.id].edgeReplacedById=v.id,this._backupEdgeOptions(_),_.setOptions({physics:!1})}}},{key:"_checkOptions",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return void 0===e.clusterEdgeProperties&&(e.clusterEdgeProperties={}),void 0===e.clusterNodeProperties&&(e.clusterNodeProperties={}),e}},{key:"_cluster",value:function(e,t,o){var i=!(3<arguments.length&&void 0!==arguments[3])||arguments[3],a=[];for(var d in e)e.hasOwnProperty(d)&&void 0!==this.clusteredNodes[d]&&a.push(d);for(var s=0;s<a.length;++s)delete e[a[s]];if(0!=Object.keys(e).length&&(1!=Object.keys(e).length||!0==o.clusterNodeProperties.allowSingleNodeCluster)){var r=Wd.deepExtend({},o.clusterNodeProperties);if(void 0!==o.processProperties){var l=[];for(var c in e)if(e.hasOwnProperty(c)){var u=zc.cloneOptions(e[c]);l.push(u)}var p=[];for(var h in t)if(t.hasOwnProperty(h)&&"clusterEdge:"!==h.substr(0,12)){var g=zc.cloneOptions(t[h],"edge");p.push(g)}if(r=o.processProperties(r,l,p),!r)throw new Error("The processProperties function does not return properties!")}void 0===r.id&&(r.id="cluster:"+Wd.randomUUID());var m=r.id;void 0===r.label&&(r.label="cluster");var y;void 0===r.x&&(y=this._getClusterPosition(e),r.x=y.x),void 0===r.y&&(void 0===y&&(y=this._getClusterPosition(e)),r.y=y.y),r.id=m;var f=this.body.functions.createNode(r,Bc);f.containedNodes=e,f.containedEdges=t,f.clusterEdgeProperties=o.clusterEdgeProperties,this.body.nodes[r.id]=f,this._clusterEdges(e,t,r,o.clusterEdgeProperties),r.id=void 0,!0===i&&this.body.emitter.emit("_dataChanged")}}},{key:"_backupEdgeOptions",value:function(e){void 0===this.clusteredEdges[e.id]&&(this.clusteredEdges[e.id]={physics:e.options.physics})}},{key:"_restoreEdge",value:function(e){var t=this.clusteredEdges[e.id];void 0!==t&&(e.setOptions({physics:t.physics}),delete this.clusteredEdges[e.id])}},{key:"isCluster",value:function(e){return void 0===this.body.nodes[e]?(console.log("Node does not exist."),!1):!0===this.body.nodes[e].isCluster}},{key:"_getClusterPosition",value:function(e){for(var t=Object.keys(e),o=e[t[0]].x,n=e[t[0]].x,a=e[t[0]].y,d=e[t[0]].y,s=1,r;s<t.length;s++)r=e[t[s]],o=r.x<o?r.x:o,n=r.x>n?r.x:n,a=r.y<a?r.y:a,d=r.y>d?r.y:d;return{x:.5*(o+n),y:.5*(a+d)}}},{key:"openCluster",value:function(e,t){var o=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];if(void 0===e)throw new Error("No clusterNodeId supplied to openCluster.");var n=this.body.nodes[e];if(void 0===n)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(!0!==n.isCluster||void 0===n.containedNodes||void 0===n.containedEdges)throw new Error("The node:"+e+" is not a valid cluster.");var a=this.findNode(e),d=a.indexOf(e)-1;if(0<=d){var s=a[d],r=this.body.nodes[s];return r._openChildCluster(e),delete this.body.nodes[e],void(!0===o&&this.body.emitter.emit("_dataChanged"))}var l=n.containedNodes,c=n.containedEdges;if(void 0!==t&&void 0!==t.releaseFunction&&"function"==typeof t.releaseFunction){var u={},p={x:n.x,y:n.y};for(var h in l)if(l.hasOwnProperty(h)){var g=this.body.nodes[h];u[h]={x:g.x,y:g.y}}var m=t.releaseFunction(p,u);for(var y in l)if(l.hasOwnProperty(y)){var f=this.body.nodes[y];void 0!==m[y]&&(f.x=void 0===m[y].x?n.x:m[y].x,f.y=void 0===m[y].y?n.y:m[y].y)}}else Wd.forEach(l,function(e){!1===e.options.fixed.x&&(e.x=n.x),!1===e.options.fixed.y&&(e.y=n.y)});for(var b in l)if(l.hasOwnProperty(b)){var _=this.body.nodes[b];_.vx=n.vx,_.vy=n.vy,_.setOptions({physics:!0}),delete this.clusteredNodes[b]}for(var v=[],k=0;k<n.edges.length;k++)v.push(n.edges[k]);for(var w=0;w<v.length;w++){for(var x=v[w],S=this._getConnectedId(x,e),O=this.clusteredNodes[S],D=0;D<x.clusteringEdgeReplacingIds.length;D++){var T=x.clusteringEdgeReplacingIds[D],E=this.body.edges[T];if(void 0!==E)if(void 0!==O){var C=this.body.nodes[O.clusterId];C.containedEdges[E.id]=E,delete c[E.id];var M=E.fromId,I=E.toId;E.toId==S?I=O.clusterId:M=O.clusterId,this._createClusteredEdge(M,I,E,C.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(E)}x.remove()}for(var P in c)c.hasOwnProperty(P)&&this._restoreEdge(c[P]);delete this.body.nodes[e],!0===o&&this.body.emitter.emit("_dataChanged")}},{key:"getNodesInCluster",value:function(e){var t=[];if(!0===this.isCluster(e)){var o=this.body.nodes[e].containedNodes;for(var n in o)o.hasOwnProperty(n)&&t.push(this.body.nodes[n].id)}return t}},{key:"findNode",value:function(e){for(var t=[],o=0,n;void 0!==this.clusteredNodes[e]&&o<100;){if(n=this.body.nodes[e],void 0===n)return[];t.push(n.id),e=this.clusteredNodes[e].clusterId,o++}return(n=this.body.nodes[e],void 0===n)?[]:(t.push(n.id),t.reverse(),t)}},{key:"updateClusteredNode",value:function(e,t){if(void 0===e)throw new Error("No clusteredNodeId supplied to updateClusteredNode.");if(void 0===t)throw new Error("No newOptions supplied to updateClusteredNode.");if(void 0===this.body.nodes[e])throw new Error("The clusteredNodeId supplied to updateClusteredNode does not exist.");this.body.nodes[e].setOptions(t),this.body.emitter.emit("_dataChanged")}},{key:"updateEdge",value:function(e,t){if(void 0===e)throw new Error("No startEdgeId supplied to updateEdge.");if(void 0===t)throw new Error("No newOptions supplied to updateEdge.");if(void 0===this.body.edges[e])throw new Error("The startEdgeId supplied to updateEdge does not exist.");for(var o=this.getClusteredEdges(e),n=0,a;n<o.length;n++)a=this.body.edges[o[n]],a.setOptions(t);this.body.emitter.emit("_dataChanged")}},{key:"getClusteredEdges",value:function(e){for(var t=[],o=0;void 0!==e&&void 0!==this.body.edges[e]&&o<100;)t.push(this.body.edges[e].id),e=this.body.edges[e].edgeReplacedById,o++;return t.reverse(),t}},{key:"getBaseEdge",value:function(e){return this.getBaseEdges(e)[0]}},{key:"getBaseEdges",value:function(e){for(var t=[e],o=[],n=[],a=0,d;0<t.length&&a<100;)if(d=t.pop(),void 0!==d){var s=this.body.edges[d];if(void 0!==s){a++;var r=s.clusteringEdgeReplacingIds;if(void 0===r)n.push(d);else for(var l=0,c;l<r.length;++l)(c=r[l],-1===t.indexOf(r)&&-1===o.indexOf(r))&&t.push(c);o.push(d)}}return n}},{key:"_getConnectedId",value:function(e,t){return e.toId==t?e.fromId==t?e.fromId:e.fromId:e.toId}},{key:"_getHubSize",value:function(){for(var e=0,t=0,o=0,n=0,a=0,d;a<this.body.nodeIndices.length;a++)d=this.body.nodes[this.body.nodeIndices[a]],d.edges.length>n&&(n=d.edges.length),e+=d.edges.length,t+=ko(d.edges.length,2),o+=1;e/=o,t/=o;var s=t-ko(e,2),r=To(s),l=Eo(e+2*r);return l>n&&(l=n),l}},{key:"_createClusteredEdge",value:function(e,t,o,n,i){var a=zc.cloneOptions(o,"edge");Wd.deepExtend(a,n),a.from=e,a.to=t,a.id="clusterEdge:"+Wd.randomUUID(),void 0!==i&&Wd.deepExtend(a,i);var d=this.body.functions.createEdge(a);return d.clusteringEdgeReplacingIds=[o.id],d.connect(),this.body.edges[d.id]=d,d}},{key:"_clusterEdges",value:function(e,t,o,n){if(t instanceof Dc){var i=t,a={};a[i.id]=i,t=a}if(e instanceof oc){var d=e,s={};s[d.id]=d,e=s}if(void 0===o||null===o)throw new Error("_clusterEdges: parameter clusterNode required");for(var r in void 0===n&&(n=o.clusterEdgeProperties),this._createClusterEdges(e,t,o,n),t)if(t.hasOwnProperty(r)&&void 0!==this.body.edges[r]){var l=this.body.edges[r];this._backupEdgeOptions(l),l.setOptions({physics:!1})}for(var c in e)e.hasOwnProperty(c)&&(this.clusteredNodes[c]={clusterId:o.id,node:this.body.nodes[c]},this.body.nodes[c].setOptions({physics:!1}))}},{key:"_getClusterNodeForNode",value:function(e){if(void 0!==e){var t=this.clusteredNodes[e];if(void 0!==t){var o=t.clusterId;return void 0===o?void 0:this.body.nodes[o]}}}},{key:"_filter",value:function(e,t){var o=[];return Wd.forEach(e,function(e){t(e)&&o.push(e)}),o}},{key:"_updateState",value:function(){var e=this,t=[],o={},i=function(t){Wd.forEach(e.body.nodes,function(e){!0===e.isCluster&&t(e)})},a;for(a in this.clusteredNodes)if(this.clusteredNodes.hasOwnProperty(a)){var d=this.body.nodes[a];void 0===d&&t.push(a)}i(function(e){for(var o=0;o<t.length;o++)delete e.containedNodes[t[o]]});for(var s=0;s<t.length;s++)delete this.clusteredNodes[t[s]];Wd.forEach(this.clusteredEdges,function(t){var n=e.body.edges[t];void 0!==n&&n.endPointsValid()||(o[t]=t)}),i(function(e){Wd.forEach(e.containedEdges,function(e,t){e.endPointsValid()||o[t]||(o[t]=t)})}),Wd.forEach(this.body.edges,function(t,n){var i=!0,a=t.clusteringEdgeReplacingIds;if(void 0!==a){var d=0;Wd.forEach(a,function(t){var o=e.body.edges[t];void 0!==o&&o.endPointsValid()&&(d+=1)}),i=0<d}t.endPointsValid()&&i||(o[n]=n)}),i(function(t){Wd.forEach(o,function(n){delete t.containedEdges[n],Wd.forEach(t.edges,function(i,a){return i.id===n?void(t.edges[a]=null):void(i.clusteringEdgeReplacingIds=e._filter(i.clusteringEdgeReplacingIds,function(e){return!o[e]}))}),t.edges=e._filter(t.edges,function(e){return null!==e})})}),Wd.forEach(o,function(t){delete e.clusteredEdges[t]}),Wd.forEach(o,function(t){delete e.body.edges[t]});var r=Object.keys(this.body.edges);Wd.forEach(r,function(t){var o=e.body.edges[t],n=e._isClusteredNode(o.fromId)||e._isClusteredNode(o.toId);if(n!==e._isClusteredEdge(o.id))if(n){var i=e._getClusterNodeForNode(o.fromId);void 0!==i&&e._clusterEdges(e.body.nodes[o.fromId],o,i);var a=e._getClusterNodeForNode(o.toId);void 0!==a&&e._clusterEdges(e.body.nodes[o.toId],o,a)}else delete e._clusterEdges[t],e._restoreEdge(o)});for(var l=!1,c=!0,u=function(){var t=[];i(function(e){var o=Object.keys(e.containedNodes).length,n=!0===e.options.allowSingleNodeCluster;(n&&1>o||!n&&2>o)&&t.push(e.id)});for(var o=0;o<t.length;++o)e.openCluster(t[o],{},!1);c=0<t.length,l=l||c};c;)u();l&&this._updateState()}},{key:"_isClusteredNode",value:function(e){return void 0!==this.clusteredNodes[e]}},{key:"_isClusteredEdge",value:function(e){return void 0!==this.clusteredEdges[e]}}]),e}(),Ac=function(){function e(t,o){pl(this,e),yo(),this.body=t,this.canvas=o,this.redrawRequested=!1,this.renderTimer=void 0,this.requiresTimeout=!0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.zooming=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1},Wd.extend(this.options,this.defaultOptions),this._determineBrowserMethod(),this.bindEventListeners()}return hl(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("dragStart",function(){e.dragging=!0}),this.body.emitter.on("dragEnd",function(){e.dragging=!1}),this.body.emitter.on("zoom",function(){e.zooming=!0,window.clearTimeout(e.zoomTimeoutId),e.zoomTimeoutId=window.setTimeout(function(){e.zooming=!1,e._requestRedraw.bind(e)()},250)}),this.body.emitter.on("_resizeNodes",function(){e._resizeNodes()}),this.body.emitter.on("_redraw",function(){!1===e.renderingActive&&e._redraw()}),this.body.emitter.on("_blockRedraw",function(){e.allowRedraw=!1}),this.body.emitter.on("_allowRedraw",function(){e.allowRedraw=!0,e.redrawRequested=!1}),this.body.emitter.on("_requestRedraw",this._requestRedraw.bind(this)),this.body.emitter.on("_startRendering",function(){e.renderRequests+=1,e.renderingActive=!0,e._startRendering()}),this.body.emitter.on("_stopRendering",function(){e.renderRequests-=1,e.renderingActive=0<e.renderRequests,e.renderTimer=void 0}),this.body.emitter.on("destroy",function(){e.renderRequests=0,e.allowRedraw=!1,e.renderingActive=!1,!0===e.requiresTimeout?clearTimeout(e.renderTimer):window.cancelAnimationFrame(e.renderTimer),e.body.emitter.off()})}},{key:"setOptions",value:function(e){if(void 0!==e){Wd.selectiveDeepExtend(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,e)}}},{key:"_requestNextFrame",value:function(e,t){if("undefined"!=typeof window){var o=window,n;return!0===this.requiresTimeout?n=o.setTimeout(e,t):o.requestAnimationFrame&&(n=o.requestAnimationFrame(e)),n}}},{key:"_startRendering",value:function(){!0===this.renderingActive&&void 0===this.renderTimer&&(this.renderTimer=this._requestNextFrame(this._renderStep.bind(this),this.simulationInterval))}},{key:"_renderStep",value:function(){!0===this.renderingActive&&(this.renderTimer=void 0,!0===this.requiresTimeout&&this._startRendering(),this._redraw(),!1===this.requiresTimeout&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var e=this;!0!==this.redrawRequested&&!1===this.renderingActive&&!0===this.allowRedraw&&(this.redrawRequested=!0,this._requestNextFrame(function(){e._redraw(!1)},0))}},{key:"_redraw",value:function(){var e=!!(0<arguments.length&&void 0!==arguments[0])&&arguments[0];if(!0===this.allowRedraw){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1,(0===this.canvas.frame.canvas.width||0===this.canvas.frame.canvas.height)&&this.canvas.setSize(),this.canvas.setTransform();var t=this.canvas.getContext(),o=this.canvas.frame.canvas.clientWidth,n=this.canvas.frame.canvas.clientHeight;if(t.clearRect(0,0,o,n),0===this.canvas.frame.clientWidth)return;t.save(),t.translate(this.body.view.translation.x,this.body.view.translation.y),t.scale(this.body.view.scale,this.body.view.scale),t.beginPath(),this.body.emitter.emit("beforeDrawing",t),t.closePath(),!1===e&&(!1===this.dragging||!0===this.dragging&&!1===this.options.hideEdgesOnDrag)&&(!1===this.zooming||!0===this.zooming&&!1===this.options.hideEdgesOnZoom)&&this._drawEdges(t),(!1===this.dragging||!0===this.dragging&&!1===this.options.hideNodesOnDrag)&&this._drawNodes(t,e),t.beginPath(),this.body.emitter.emit("afterDrawing",t),t.closePath(),t.restore(),!0===e&&t.clearRect(0,0,o,n)}}},{key:"_resizeNodes",value:function(){this.canvas.setTransform();var e=this.canvas.getContext();e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);var t=this.body.nodes,o;for(var n in t)t.hasOwnProperty(n)&&(o=t[n],o.resize(e),o.updateBoundingBox(e,o.selected));e.restore()}},{key:"_drawNodes",value:function(e){for(var t=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1],o=this.body.nodes,n=this.body.nodeIndices,a=[],d=20,s=this.canvas.DOMtoCanvas({x:-d,y:-d}),r=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+d,y:this.canvas.frame.canvas.clientHeight+d}),l={top:s.y,left:s.x,bottom:r.y,right:r.x},c=0,u;c<n.length;c++)u=o[n[c]],u.isSelected()?a.push(n[c]):!0===t?u.draw(e):!0===u.isBoundingBoxOverlappingWith(l)?u.draw(e):u.updateBoundingBox(e,u.selected);for(var p=0;p<a.length;p++)u=o[a[p]],u.draw(e)}},{key:"_drawEdges",value:function(e){for(var t=this.body.edges,o=this.body.edgeIndices,n=0,a;n<o.length;n++)a=t[o[n]],!0===a.connected&&a.draw(e)}},{key:"_determineBrowserMethod",value:function(){if("undefined"!=typeof window){var e=navigator.userAgent.toLowerCase();this.requiresTimeout=!1,-1==e.indexOf("msie 9.0")?-1!=e.indexOf("safari")&&-1>=e.indexOf("chrome")&&(this.requiresTimeout=!0):this.requiresTimeout=!0}else this.requiresTimeout=!0}}]),e}(),Hc=Le(function(e,t){t.onTouch=function(e,t){t.inputHandler=function(e){e.isFirst&&t(e)},e.on("hammer.input",t.inputHandler)},t.onRelease=function(e,t){return t.inputHandler=function(e){e.isFinal&&t(e)},e.on("hammer.input",t.inputHandler)},t.offTouch=function(e,t){e.off("hammer.input",t.inputHandler)},t.offRelease=t.offTouch,t.disablePreventDefaultVertically=function(e){return e.getTouchAction=function(){return["pan-y"]},e}}),jc=Hc.onTouch,Wc=Hc.onRelease,Uc=Hc.offTouch,Vc=Hc.offRelease,Gc=Hc.disablePreventDefaultVertically,qc=function(){function e(t){pl(this,e),this.body=t,this.pixelRatio=1,this.resizeTimer=void 0,this.resizeFunction=this._onResize.bind(this),this.cameraState={},this.initialized=!1,this.canvasViewCenter={},this.options={},this.defaultOptions={autoResize:!0,height:"100%",width:"100%"},Wd.extend(this.options,this.defaultOptions),this.bindEventListeners()}return hl(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.once("resize",function(t){0!==t.width&&(e.body.view.translation.x=.5*t.width),0!==t.height&&(e.body.view.translation.y=.5*t.height)}),this.body.emitter.on("setSize",this.setSize.bind(this)),this.body.emitter.on("destroy",function(){e.hammerFrame.destroy(),e.hammer.destroy(),e._cleanUp()})}},{key:"setOptions",value:function(e){var t=this;if(void 0!==e){Wd.selectiveDeepExtend(["width","height","autoResize"],this.options,e)}!0===this.options.autoResize&&(this._cleanUp(),this.resizeTimer=setInterval(function(){var e=t.setSize();!0===e&&t.body.emitter.emit("_requestRedraw")},1e3),this.resizeFunction=this._onResize.bind(this),Wd.addEventListener(window,"resize",this.resizeFunction))}},{key:"_cleanUp",value:function(){void 0!==this.resizeTimer&&clearInterval(this.resizeTimer),Wd.removeEventListener(window,"resize",this.resizeFunction),this.resizeFunction=void 0}},{key:"_onResize",value:function(){this.setSize(),this.body.emitter.emit("_redraw")}},{key:"_getCameraState",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.pixelRatio;!0===this.initialized&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}},{key:"_setCameraState",value:function(){if(void 0!==this.cameraState.scale&&0!==this.frame.canvas.clientWidth&&0!==this.frame.canvas.clientHeight&&0!==this.pixelRatio&&0<this.cameraState.previousWidth){var e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,o=this.cameraState.scale;1!=e&&1!=t?o=.5*this.cameraState.scale*(e+t):1==e?1!=t&&(o=this.cameraState.scale*t):o=this.cameraState.scale*e,this.body.view.scale=o;var n=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),i={x:n.x-this.cameraState.position.x,y:n.y-this.cameraState.position.y};this.body.view.translation.x+=i.x*this.body.view.scale,this.body.view.translation.y+=i.y*this.body.view.scale}}},{key:"_prepareValue",value:function(e){if("number"==typeof e)return e+"px";if("string"==typeof e){if(-1!==e.indexOf("%")||-1!==e.indexOf("px"))return e;if(-1===e.indexOf("%"))return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}},{key:"_create",value:function(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=900,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),!this.frame.canvas.getContext){var e=document.createElement("DIV");e.style.color="red",e.style.fontWeight="bold",e.style.padding="10px",e.innerHTML="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(e)}else this._setPixelRatio(),this.setTransform();this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}},{key:"_bindHammer",value:function(){var e=this;void 0!==this.hammer&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new ll(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:ll.DIRECTION_ALL}),Hc.onTouch(this.hammer,function(t){e.body.eventListeners.onTouch(t)}),this.hammer.on("tap",function(t){e.body.eventListeners.onTap(t)}),this.hammer.on("doubletap",function(t){e.body.eventListeners.onDoubleTap(t)}),this.hammer.on("press",function(t){e.body.eventListeners.onHold(t)}),this.hammer.on("panstart",function(t){e.body.eventListeners.onDragStart(t)}),this.hammer.on("panmove",function(t){e.body.eventListeners.onDrag(t)}),this.hammer.on("panend",function(t){e.body.eventListeners.onDragEnd(t)}),this.hammer.on("pinch",function(t){e.body.eventListeners.onPinch(t)}),this.frame.canvas.addEventListener("mousewheel",function(t){e.body.eventListeners.onMouseWheel(t)}),this.frame.canvas.addEventListener("DOMMouseScroll",function(t){e.body.eventListeners.onMouseWheel(t)}),this.frame.canvas.addEventListener("mousemove",function(t){e.body.eventListeners.onMouseMove(t)}),this.frame.canvas.addEventListener("contextmenu",function(t){e.body.eventListeners.onContext(t)}),this.hammerFrame=new ll(this.frame),Hc.onRelease(this.hammerFrame,function(t){e.body.eventListeners.onRelease(t)})}},{key:"setSize",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.options.width,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.options.height;e=this._prepareValue(e),t=this._prepareValue(t);var o=!1,n=this.frame.canvas.width,i=this.frame.canvas.height,a=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||t!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=t)this._getCameraState(a),this.frame.style.width=e,this.frame.style.height=t,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=vo(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=vo(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=t,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},o=!0;else{var d=vo(this.frame.canvas.clientWidth*this.pixelRatio),s=vo(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==d||this.frame.canvas.height!==s)&&this._getCameraState(a),this.frame.canvas.width!==d&&(this.frame.canvas.width=d,o=!0),this.frame.canvas.height!==s&&(this.frame.canvas.height=s,o=!0)}return!0==o&&(this.body.emitter.emit("resize",{width:vo(this.frame.canvas.width/this.pixelRatio),height:vo(this.frame.canvas.height/this.pixelRatio),oldWidth:vo(n/this.pixelRatio),oldHeight:vo(i/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,o}},{key:"getContext",value:function(){return this.frame.canvas.getContext("2d")}},{key:"_determinePixelRatio",value:function(){var e=this.getContext();if(void 0===e)throw new Error("Could not get canvax context");var t=1;"undefined"!=typeof window&&(t=window.devicePixelRatio||1);var o=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/o}},{key:"_setPixelRatio",value:function(){this.pixelRatio=this._determinePixelRatio()}},{key:"setTransform",value:function(){var e=this.getContext();if(void 0===e)throw new Error("Could not get canvax context");e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}},{key:"_XconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.x)/this.body.view.scale}},{key:"_XconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.x}},{key:"_YconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.y)/this.body.view.scale}},{key:"_YconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.y}},{key:"canvasToDOM",value:function(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}},{key:"DOMtoCanvas",value:function(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}}]),e}(),Xc=function(){function e(t,o){var n=this;pl(this,e),this.body=t,this.canvas=o,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction="easeInOutQuint",this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on("fit",this.fit.bind(this)),this.body.emitter.on("animationFinished",function(){n.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",this.releaseNode.bind(this))}return hl(e,[{key:"setOptions",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.options=e}},{key:"fit",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{nodes:[]},t=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1],o,n;if(e=Object.assign({},e),(void 0===e.nodes||0===e.nodes.length)&&(e.nodes=this.body.nodeIndices),!0===t){var i=0;for(var a in this.body.nodes)if(this.body.nodes.hasOwnProperty(a)){var d=this.body.nodes[a];!0===d.predefinedPosition&&(i+=1)}if(i>.5*this.body.nodeIndices.length)return void this.fit(e,!1);o=zc.getRange(this.body.nodes,e.nodes);var s=this.body.nodeIndices.length;n=12.662/(s+7.4147)+.0964822;var r=Mo(this.canvas.frame.canvas.clientWidth/600,this.canvas.frame.canvas.clientHeight/600);n*=r}else{this.body.emitter.emit("_resizeNodes"),o=zc.getRange(this.body.nodes,e.nodes);var l=1.1*So(o.maxX-o.minX),c=1.1*So(o.maxY-o.minY),u=this.canvas.frame.canvas.clientWidth/l,p=this.canvas.frame.canvas.clientHeight/c;n=u<=p?u:p}1<n?n=1:0===n&&(n=1);var h=zc.findCenter(o),g={position:h,scale:n,animation:e.animation};this.moveTo(g)}},{key:"focus",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(void 0!==this.body.nodes[e]){var o={x:this.body.nodes[e].x,y:this.body.nodes[e].y};t.position=o,t.lockedOnNode=e,this.moveTo(t)}else console.log("Node: "+e+" cannot be found.")}},{key:"moveTo",value:function(e){var t=Number.isFinite;if(void 0===e)return void(e={});if(null!=e.offset){if(null==e.offset.x)e.offset.x=0;else if(e.offset.x=+e.offset.x,!t(e.offset.x))throw new TypeError("The option \"offset.x\" has to be a finite number.");if(null==e.offset.y)e.offset.x=0;else if(e.offset.y=+e.offset.y,!t(e.offset.y))throw new TypeError("The option \"offset.y\" has to be a finite number.")}else e.offset={x:0,y:0};if(null!=e.position){if(null==e.position.x)e.position.x=0;else if(e.position.x=+e.position.x,!t(e.position.x))throw new TypeError("The option \"position.x\" has to be a finite number.");if(null==e.position.y)e.position.x=0;else if(e.position.y=+e.position.y,!t(e.position.y))throw new TypeError("The option \"position.y\" has to be a finite number.")}else e.position=this.getViewPosition();if(null==e.scale)e.scale=this.body.view.scale;else if(e.scale=+e.scale,!(0<e.scale))throw new TypeError("The option \"scale\" has to be a number greater than zero.");void 0===e.animation&&(e.animation={duration:0}),!1===e.animation&&(e.animation={duration:0}),!0===e.animation&&(e.animation={}),void 0===e.animation.duration&&(e.animation.duration=1e3),void 0===e.animation.easingFunction&&(e.animation.easingFunction="easeInOutQuad"),this.animateView(e)}},{key:"animateView",value:function(e){if(void 0!==e){this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),!0===e.locked&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),0!=this.easingTime&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;var t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),o={x:t.x-e.position.x,y:t.y-e.position.y};this.targetTranslation={x:this.sourceTranslation.x+o.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+o.y*this.targetScale+e.offset.y},0===e.animation.duration?null==this.lockedOnNodeId?(this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw")):(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)):(this.animationSpeed=1/(.001*(60*e.animation.duration))||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=this._transitionRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))}}},{key:"_lockedRedraw",value:function(){var e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),o={x:t.x-e.x,y:t.y-e.y},n=this.body.view.translation,i={x:n.x+o.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:n.y+o.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=i}},{key:"releaseNode",value:function(){void 0!==this.lockedOnNodeId&&void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}},{key:"_transitionRedraw",value:function(){var e=!!(0<arguments.length&&void 0!==arguments[0])&&arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=!0===e?1:this.easingTime;var t=Wd.easingFunctions[this.animationEasingFunction](this.easingTime);this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},1<=this.easingTime&&(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,null!=this.lockedOnNodeId&&(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)),this.body.emitter.emit("animationFinished"))}},{key:"getScale",value:function(){return this.body.view.scale}},{key:"getViewPosition",value:function(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}]),e}(),Zc=function(){function e(t,o){var n=this;pl(this,e),this.body=t,this.canvas=o,this.iconsCreated=!1,this.navigationHammers=[],this.boundFunctions={},this.touchTime=0,this.activated=!1,this.body.emitter.on("activate",function(){n.activated=!0,n.configureKeyboardBindings()}),this.body.emitter.on("deactivate",function(){n.activated=!1,n.configureKeyboardBindings()}),this.body.emitter.on("destroy",function(){void 0!==n.keycharm&&n.keycharm.destroy()}),this.options={}}return hl(e,[{key:"setOptions",value:function(e){void 0!==e&&(this.options=e,this.create())}},{key:"create",value:function(){!0===this.options.navigationButtons?!1===this.iconsCreated&&this.loadNavigationElements():!0===this.iconsCreated&&this.cleanNavigation(),this.configureKeyboardBindings()}},{key:"cleanNavigation",value:function(){if(0!=this.navigationHammers.length){for(var e=0;e<this.navigationHammers.length;e++)this.navigationHammers[e].destroy();this.navigationHammers=[]}this.navigationDOM&&this.navigationDOM.wrapper&&this.navigationDOM.wrapper.parentNode&&this.navigationDOM.wrapper.parentNode.removeChild(this.navigationDOM.wrapper),this.iconsCreated=!1}},{key:"loadNavigationElements",value:function(){var e=this;this.cleanNavigation(),this.navigationDOM={};var t=["up","down","left","right","zoomIn","zoomOut","zoomExtends"],o=["_moveUp","_moveDown","_moveLeft","_moveRight","_zoomIn","_zoomOut","_fit"];this.navigationDOM.wrapper=document.createElement("div"),this.navigationDOM.wrapper.className="vis-navigation",this.canvas.frame.appendChild(this.navigationDOM.wrapper);for(var n=0;n<t.length;n++){this.navigationDOM[t[n]]=document.createElement("div"),this.navigationDOM[t[n]].className="vis-button vis-"+t[n],this.navigationDOM.wrapper.appendChild(this.navigationDOM[t[n]]);var a=new ll(this.navigationDOM[t[n]]);"_fit"===o[n]?Hc.onTouch(a,this._fit.bind(this)):Hc.onTouch(a,this.bindToRedraw.bind(this,o[n])),this.navigationHammers.push(a)}var d=new ll(this.canvas.frame);Hc.onRelease(d,function(){e._stopMovement()}),this.navigationHammers.push(d),this.iconsCreated=!0}},{key:"bindToRedraw",value:function(e){void 0===this.boundFunctions[e]&&(this.boundFunctions[e]=this[e].bind(this),this.body.emitter.on("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_startRendering"))}},{key:"unbindFromRedraw",value:function(e){void 0!==this.boundFunctions[e]&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[e])}},{key:"_fit",value:function(){700<new Date().valueOf()-this.touchTime&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=new Date().valueOf())}},{key:"_stopMovement",value:function(){for(var e in this.boundFunctions)this.boundFunctions.hasOwnProperty(e)&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}},{key:"_moveUp",value:function(){this.body.view.translation.y+=this.options.keyboard.speed.y}},{key:"_moveDown",value:function(){this.body.view.translation.y-=this.options.keyboard.speed.y}},{key:"_moveLeft",value:function(){this.body.view.translation.x+=this.options.keyboard.speed.x}},{key:"_moveRight",value:function(){this.body.view.translation.x-=this.options.keyboard.speed.x}},{key:"_zoomIn",value:function(){var e=this.body.view.scale,t=this.body.view.scale*(1+this.options.keyboard.speed.zoom),o=this.body.view.translation,n=t/e,i=(1-n)*this.canvas.canvasViewCenter.x+o.x*n,a=(1-n)*this.canvas.canvasViewCenter.y+o.y*n;this.body.view.scale=t,this.body.view.translation={x:i,y:a},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}},{key:"_zoomOut",value:function(){var e=this.body.view.scale,t=this.body.view.scale/(1+this.options.keyboard.speed.zoom),o=this.body.view.translation,n=t/e,i=(1-n)*this.canvas.canvasViewCenter.x+o.x*n,a=(1-n)*this.canvas.canvasViewCenter.y+o.y*n;this.body.view.scale=t,this.body.view.translation={x:i,y:a},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}},{key:"configureKeyboardBindings",value:function(){var e=this;void 0!==this.keycharm&&this.keycharm.destroy(),!0===this.options.keyboard.enabled&&(this.keycharm=!0===this.options.keyboard.bindToWindow?Us({container:window,preventDefault:!0}):Us({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),!0===this.activated&&(this.keycharm.bind("up",function(){e.bindToRedraw("_moveUp")},"keydown"),this.keycharm.bind("down",function(){e.bindToRedraw("_moveDown")},"keydown"),this.keycharm.bind("left",function(){e.bindToRedraw("_moveLeft")},"keydown"),this.keycharm.bind("right",function(){e.bindToRedraw("_moveRight")},"keydown"),this.keycharm.bind("=",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num+",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num-",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("-",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("[",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("]",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pageup",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pagedown",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("up",function(){e.unbindFromRedraw("_moveUp")},"keyup"),this.keycharm.bind("down",function(){e.unbindFromRedraw("_moveDown")},"keyup"),this.keycharm.bind("left",function(){e.unbindFromRedraw("_moveLeft")},"keyup"),this.keycharm.bind("right",function(){e.unbindFromRedraw("_moveRight")},"keyup"),this.keycharm.bind("=",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num+",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("[",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("]",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pageup",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pagedown",function(){e.unbindFromRedraw("_zoomOut")},"keyup")))}}]),e}(),$c=function(){function e(t,o){pl(this,e),this.container=t,this.overflowMethod=o||"cap",this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-tooltip",this.container.appendChild(this.frame)}return hl(e,[{key:"setPosition",value:function(e,t){this.x=parseInt(e),this.y=parseInt(t)}},{key:"setText",value:function(e){e instanceof Element?(this.frame.innerHTML="",this.frame.appendChild(e)):this.frame.innerHTML=e}},{key:"show",value:function(e){if(void 0===e&&(e=!0),!0===e){var t=this.frame.clientHeight,o=this.frame.clientWidth,n=this.frame.parentNode.clientHeight,i=this.frame.parentNode.clientWidth,a=0,d=0;if("flip"==this.overflowMethod){var s=!1,r=!0;this.y-t<this.padding&&(r=!1),this.x+o>i-this.padding&&(s=!0),a=s?this.x-o:this.x,d=r?this.y-t:this.y}else d=this.y-t,d+t+this.padding>n&&(d=n-t-this.padding),d<this.padding&&(d=this.padding),a=this.x,a+o+this.padding>i&&(a=i-o-this.padding),a<this.padding&&(a=this.padding);this.frame.style.left=a+"px",this.frame.style.top=d+"px",this.frame.style.visibility="visible",this.hidden=!1}else this.hide()}},{key:"hide",value:function(){this.hidden=!0,this.frame.style.left="0",this.frame.style.top="0",this.frame.style.visibility="hidden"}},{key:"destroy",value:function(){this.frame.parentNode.removeChild(this.frame)}}]),e}(),Kc=function(){function e(t,o,n){pl(this,e),this.body=t,this.canvas=o,this.selectionHandler=n,this.navigationHandler=new Zc(t,o),this.body.eventListeners.onTap=this.onTap.bind(this),this.body.eventListeners.onTouch=this.onTouch.bind(this),this.body.eventListeners.onDoubleTap=this.onDoubleTap.bind(this),this.body.eventListeners.onHold=this.onHold.bind(this),this.body.eventListeners.onDragStart=this.onDragStart.bind(this),this.body.eventListeners.onDrag=this.onDrag.bind(this),this.body.eventListeners.onDragEnd=this.onDragEnd.bind(this),this.body.eventListeners.onMouseWheel=this.onMouseWheel.bind(this),this.body.eventListeners.onPinch=this.onPinch.bind(this),this.body.eventListeners.onMouseMove=this.onMouseMove.bind(this),this.body.eventListeners.onRelease=this.onRelease.bind(this),this.body.eventListeners.onContext=this.onContext.bind(this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=this.getPointer.bind(this),this.options={},this.defaultOptions={dragNodes:!0,dragView:!0,hover:!1,keyboard:{enabled:!1,speed:{x:10,y:10,zoom:.02},bindToWindow:!0},navigationButtons:!1,tooltipDelay:300,zoomView:!0,zoomSpeed:1},Wd.extend(this.options,this.defaultOptions),this.bindEventListeners()}return hl(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("destroy",function(){clearTimeout(e.popupTimer),delete e.body.functions.getPointer})}},{key:"setOptions",value:function(e){if(void 0!==e){Wd.selectiveNotDeepExtend(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,e),Wd.mergeOptions(this.options,e,"keyboard"),e.tooltip&&(Wd.extend(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=Wd.parseColor(e.tooltip.color)))}this.navigationHandler.setOptions(this.options)}},{key:"getPointer",value:function(e){return{x:e.x-Wd.getAbsoluteLeft(this.canvas.frame.canvas),y:e.y-Wd.getAbsoluteTop(this.canvas.frame.canvas)}}},{key:"onTouch",value:function(e){50<new Date().valueOf()-this.touchTime&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=new Date().valueOf())}},{key:"onTap",value:function(e){var t=this.getPointer(e.center),o=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,e,o),this.selectionHandler._generateClickEvent("click",e,t)}},{key:"onDoubleTap",value:function(e){var t=this.getPointer(e.center);this.selectionHandler._generateClickEvent("doubleClick",e,t)}},{key:"onHold",value:function(e){var t=this.getPointer(e.center),o=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,e,o),this.selectionHandler._generateClickEvent("click",e,t),this.selectionHandler._generateClickEvent("hold",e,t)}},{key:"onRelease",value:function(e){if(10<new Date().valueOf()-this.touchTime){var t=this.getPointer(e.center);this.selectionHandler._generateClickEvent("release",e,t),this.touchTime=new Date().valueOf()}}},{key:"onContext",value:function(e){var t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler._generateClickEvent("oncontext",e,t)}},{key:"checkSelectionChanges",value:function(e,t){var o=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2],n=this.selectionHandler.getSelection(),i=!1;i=!0===o?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e);var a=this.selectionHandler.getSelection(),d=this._determineDifference(n,a),s=this._determineDifference(a,n);0<d.edges.length&&(this.selectionHandler._generateClickEvent("deselectEdge",t,e,n),i=!0),0<d.nodes.length&&(this.selectionHandler._generateClickEvent("deselectNode",t,e,n),i=!0),0<s.nodes.length&&(this.selectionHandler._generateClickEvent("selectNode",t,e),i=!0),0<s.edges.length&&(this.selectionHandler._generateClickEvent("selectEdge",t,e),i=!0),!0===i&&this.selectionHandler._generateClickEvent("select",t,e)}},{key:"_determineDifference",value:function(e,t){var o=function(e,t){for(var o=[],n=0,a;n<e.length;n++)a=e[n],-1===t.indexOf(a)&&o.push(a);return o};return{nodes:o(e.nodes,t.nodes),edges:o(e.edges,t.edges)}}},{key:"onDragStart",value:function(e){void 0===this.drag.pointer&&this.onTouch(e);var t=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=Wd.extend({},this.body.view.translation),this.drag.nodeId=void 0,void 0!==t&&!0===this.options.dragNodes){this.drag.nodeId=t.id,!1===t.isSelected()&&(this.selectionHandler.unselectAll(),this.selectionHandler.selectObject(t)),this.selectionHandler._generateClickEvent("dragStart",e,this.drag.pointer);var o=this.selectionHandler.selectionObj.nodes;for(var n in o)if(o.hasOwnProperty(n)){var i=o[n],a={id:i.id,node:i,x:i.x,y:i.y,xFixed:i.options.fixed.x,yFixed:i.options.fixed.y};i.options.fixed.x=!0,i.options.fixed.y=!0,this.drag.selection.push(a)}}else this.selectionHandler._generateClickEvent("dragStart",e,this.drag.pointer,void 0,!0)}},{key:"onDrag",value:function(e){var t=this;if(!0!==this.drag.pinched){this.body.emitter.emit("unlockNode");var o=this.getPointer(e.center),n=this.drag.selection;if(n&&n.length&&!0===this.options.dragNodes){this.selectionHandler._generateClickEvent("dragging",e,o);var i=o.x-this.drag.pointer.x,a=o.y-this.drag.pointer.y;n.forEach(function(e){var o=e.node;!1===e.xFixed&&(o.x=t.canvas._XconvertDOMtoCanvas(t.canvas._XconvertCanvasToDOM(e.x)+i)),!1===e.yFixed&&(o.y=t.canvas._YconvertDOMtoCanvas(t.canvas._YconvertCanvasToDOM(e.y)+a))}),this.body.emitter.emit("startSimulation")}else if(!0===this.options.dragView){if(this.selectionHandler._generateClickEvent("dragging",e,o,void 0,!0),void 0===this.drag.pointer)return void this.onDragStart(e);var d=o.x-this.drag.pointer.x,s=o.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+d,y:this.drag.translation.y+s},this.body.emitter.emit("_requestRedraw")}}}},{key:"onDragEnd",value:function(e){this.drag.dragging=!1;var t=this.drag.selection;t&&t.length?(t.forEach(function(e){e.node.options.fixed.x=e.xFixed,e.node.options.fixed.y=e.yFixed}),this.selectionHandler._generateClickEvent("dragEnd",e,this.getPointer(e.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler._generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}},{key:"onPinch",value:function(e){var t=this.getPointer(e.center);this.drag.pinched=!0,void 0===this.pinch.scale&&(this.pinch.scale=1);var o=this.pinch.scale*e.scale;this.zoom(o,t)}},{key:"zoom",value:function(e,t){if(!0===this.options.zoomView){var o=this.body.view.scale;1e-5>e&&(e=1e-5),10<e&&(e=10);var n;void 0!==this.drag&&!0===this.drag.dragging&&(n=this.canvas.DOMtoCanvas(this.drag.pointer));var i=this.body.view.translation,a=e/o,d=(1-a)*t.x+i.x*a,s=(1-a)*t.y+i.y*a;if(this.body.view.scale=e,this.body.view.translation={x:d,y:s},null!=n){var r=this.canvas.canvasToDOM(n);this.drag.pointer.x=r.x,this.drag.pointer.y=r.y}this.body.emitter.emit("_requestRedraw"),o<e?this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:t}):this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:t})}}},{key:"onMouseWheel",value:function(e){if(!0===this.options.zoomView){var t=0;if(e.wheelDelta?t=e.wheelDelta/120:e.detail&&(t=-e.detail/3),0!=t){var o=this.body.view.scale,n=t*(this.options.zoomSpeed/10);0>t&&(n/=1-n),o*=1+n;var i=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(o,i)}e.preventDefault()}}},{key:"onMouseMove",value:function(e){var t=this,o=this.getPointer({x:e.clientX,y:e.clientY}),n=!1;void 0!==this.popup&&(!1===this.popup.hidden&&this._checkHidePopup(o),!1===this.popup.hidden&&(n=!0,this.popup.setPosition(o.x+3,o.y-5),this.popup.show())),!1===this.options.keyboard.bindToWindow&&!0===this.options.keyboard.enabled&&this.canvas.frame.focus(),!1===n&&(void 0!==this.popupTimer&&(clearInterval(this.popupTimer),this.popupTimer=void 0),!this.drag.dragging&&(this.popupTimer=setTimeout(function(){return t._checkShowPopup(o)},this.options.tooltipDelay))),!0===this.options.hover&&this.selectionHandler.hoverObject(e,o)}},{key:"_checkShowPopup",value:function(e){var t=this.canvas._XconvertDOMtoCanvas(e.x),o=this.canvas._YconvertDOMtoCanvas(e.y),n={left:t,top:o,right:t,bottom:o},a=void 0===this.popupObj?void 0:this.popupObj.id,d=!1,s="node";if(void 0===this.popupObj){for(var r=this.body.nodeIndices,l=this.body.nodes,c=[],u=0,p;u<r.length;u++)p=l[r[u]],!0===p.isOverlappingWith(n)&&(d=!0,void 0!==p.getTitle()&&c.push(r[u]));0<c.length&&(this.popupObj=l[c[c.length-1]],d=!0)}if(void 0===this.popupObj&&!1===d){for(var h=this.body.edgeIndices,g=this.body.edges,m=[],y=0,f;y<h.length;y++)f=g[h[y]],!0===f.isOverlappingWith(n)&&!0===f.connected&&void 0!==f.getTitle()&&m.push(h[y]);0<m.length&&(this.popupObj=g[m[m.length-1]],s="edge")}void 0===this.popupObj?void 0!==this.popup&&(this.popup.hide(),this.body.emitter.emit("hidePopup")):this.popupObj.id!==a&&(void 0===this.popup&&(this.popup=new $c(this.canvas.frame)),this.popup.popupTargetType=s,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id))}},{key:"_checkHidePopup",value:function(e){var t=this.selectionHandler._pointerToPositionObject(e),o=!1;if("node"!==this.popup.popupTargetType)void 0===this.selectionHandler.getNodeAt(e)&&void 0!==this.body.edges[this.popup.popupTargetId]&&(o=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));else if(void 0!==this.body.nodes[this.popup.popupTargetId]&&(o=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t),!0===o)){var n=this.selectionHandler.getNodeAt(e);o=void 0!==n&&n.id===this.popup.popupTargetId}!1===o&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}]),e}(),Qc=function(){function e(t,o){var n=this;pl(this,e),this.body=t,this.canvas=o,this.selectionObj={nodes:[],edges:[]},this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},Wd.extend(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",function(){n.updateSelection()})}return hl(e,[{key:"setOptions",value:function(e){if(void 0!==e){Wd.selectiveDeepExtend(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],this.options,e)}}},{key:"selectOnPoint",value:function(e){var t=!1;if(!0===this.options.selectable){var o=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),void 0!==o&&(t=this.selectObject(o)),this.body.emitter.emit("_requestRedraw")}return t}},{key:"selectAdditionalOnPoint",value:function(e){var t=!1;if(!0===this.options.selectable){var o=this.getNodeAt(e)||this.getEdgeAt(e);void 0!==o&&(t=!0,!0===o.isSelected()?this.deselectObject(o):this.selectObject(o),this.body.emitter.emit("_requestRedraw"))}return t}},{key:"_initBaseEvent",value:function(e,t){var o={pointer:{DOM:{x:t.x,y:t.y},canvas:this.canvas.DOMtoCanvas(t)},event:e};return o}},{key:"_generateClickEvent",value:function(e,t,o,n){var i=!!(4<arguments.length&&void 0!==arguments[4])&&arguments[4],a=this._initBaseEvent(t,o);if(!0===i)a.nodes=[],a.edges=[];else{var d=this.getSelection();a.nodes=d.nodes,a.edges=d.edges}void 0!==n&&(a.previousSelection=n),"click"==e&&(a.items=this.getClickedItems(o)),void 0!==t.controlEdge&&(a.controlEdge=t.controlEdge),this.body.emitter.emit(e,a)}},{key:"selectObject",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.options.selectConnectedEdges;return void 0!==e&&(e instanceof oc&&!0===t&&this._selectConnectedEdges(e),e.select(),this._addToSelection(e),!0)}},{key:"deselectObject",value:function(e){!0===e.isSelected()&&(e.selected=!1,this._removeFromSelection(e))}},{key:"_getAllNodesOverlappingWith",value:function(e){for(var t=[],o=this.body.nodes,n=0,a;n<this.body.nodeIndices.length;n++)a=this.body.nodeIndices[n],o[a].isOverlappingWith(e)&&t.push(a);return t}},{key:"_pointerToPositionObject",value:function(e){var t=this.canvas.DOMtoCanvas(e);return{left:t.x-1,top:t.y+1,right:t.x+1,bottom:t.y-1}}},{key:"getNodeAt",value:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],o=this._pointerToPositionObject(e),n=this._getAllNodesOverlappingWith(o);return 0<n.length?!0===t?this.body.nodes[n[n.length-1]]:n[n.length-1]:void 0}},{key:"_getEdgesOverlappingWith",value:function(e,t){for(var o=this.body.edges,n=0,a;n<this.body.edgeIndices.length;n++)a=this.body.edgeIndices[n],o[a].isOverlappingWith(e)&&t.push(a)}},{key:"_getAllEdgesOverlappingWith",value:function(e){var t=[];return this._getEdgesOverlappingWith(e,t),t}},{key:"getEdgeAt",value:function(e){for(var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],o=this.canvas.DOMtoCanvas(e),n=10,a=null,d=this.body.edges,s=0;s<this.body.edgeIndices.length;s++){var r=this.body.edgeIndices[s],l=d[r];if(l.connected){var c=l.from.x,u=l.from.y,p=l.to.x,h=l.to.y,g=l.edgeType.getDistanceToEdge(c,u,p,h,o.x,o.y);g<n&&(a=r,n=g)}}return null===a?void 0:!0===t?this.body.edges[a]:a}},{key:"_addToSelection",value:function(e){e instanceof oc?this.selectionObj.nodes[e.id]=e:this.selectionObj.edges[e.id]=e}},{key:"_addToHover",value:function(e){e instanceof oc?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}},{key:"_removeFromSelection",value:function(e){e instanceof oc?(delete this.selectionObj.nodes[e.id],this._unselectConnectedEdges(e)):delete this.selectionObj.edges[e.id]}},{key:"unselectAll",value:function(){for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&this.selectionObj.nodes[e].unselect();for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&this.selectionObj.edges[t].unselect();this.selectionObj={nodes:{},edges:{}}}},{key:"_getSelectedNodeCount",value:function(){var e=0;for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&(e+=1);return e}},{key:"_getSelectedNode",value:function(){for(var e in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(e))return this.selectionObj.nodes[e]}},{key:"_getSelectedEdge",value:function(){for(var e in this.selectionObj.edges)if(this.selectionObj.edges.hasOwnProperty(e))return this.selectionObj.edges[e]}},{key:"_getSelectedEdgeCount",value:function(){var e=0;for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&(e+=1);return e}},{key:"_getSelectedObjectCount",value:function(){var e=0;for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&(e+=1);for(var o in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(o)&&(e+=1);return e}},{key:"_selectionIsEmpty",value:function(){for(var e in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(e))return!1;for(var t in this.selectionObj.edges)if(this.selectionObj.edges.hasOwnProperty(t))return!1;return!0}},{key:"_clusterInSelection",value:function(){for(var e in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(e)&&1<this.selectionObj.nodes[e].clusterSize)return!0;return!1}},{key:"_selectConnectedEdges",value:function(e){for(var t=0,o;t<e.edges.length;t++)o=e.edges[t],o.select(),this._addToSelection(o)}},{key:"_hoverConnectedEdges",value:function(e){for(var t=0,o;t<e.edges.length;t++)o=e.edges[t],o.hover=!0,this._addToHover(o)}},{key:"_unselectConnectedEdges",value:function(e){for(var t=0,o;t<e.edges.length;t++)o=e.edges[t],o.unselect(),this._removeFromSelection(o)}},{key:"emitBlurEvent",value:function(e,t,o){var n=this._initBaseEvent(e,t);!0===o.hover&&(o.hover=!1,o instanceof oc?(n.node=o.id,this.body.emitter.emit("blurNode",n)):(n.edge=o.id,this.body.emitter.emit("blurEdge",n)))}},{key:"emitHoverEvent",value:function(e,t,o){var n=this._initBaseEvent(e,t),i=!1;return!1===o.hover&&(o.hover=!0,this._addToHover(o),i=!0,o instanceof oc?(n.node=o.id,this.body.emitter.emit("hoverNode",n)):(n.edge=o.id,this.body.emitter.emit("hoverEdge",n))),i}},{key:"hoverObject",value:function(e,t){var o=this.getNodeAt(t);void 0===o&&(o=this.getEdgeAt(t));var n=!1;for(var i in this.hoverObj.nodes)this.hoverObj.nodes.hasOwnProperty(i)&&(void 0===o||o instanceof oc&&o.id!=i||o instanceof Dc)&&(this.emitBlurEvent(e,t,this.hoverObj.nodes[i]),delete this.hoverObj.nodes[i],n=!0);for(var a in this.hoverObj.edges)this.hoverObj.edges.hasOwnProperty(a)&&(!0===n?(this.hoverObj.edges[a].hover=!1,delete this.hoverObj.edges[a]):(void 0===o||o instanceof Dc&&o.id!=a||o instanceof oc&&!o.hover)&&(this.emitBlurEvent(e,t,this.hoverObj.edges[a]),delete this.hoverObj.edges[a],n=!0));if(void 0!==o){var d=Object.keys(this.hoverObj.edges).length,s=Object.keys(this.hoverObj.nodes).length,r=o instanceof Dc&&0===d&&0===s,l=o instanceof oc&&0===d&&0===s;(n||r||l)&&(n=this.emitHoverEvent(e,t,o)),o instanceof oc&&!0===this.options.hoverConnectedEdges&&this._hoverConnectedEdges(o)}!0===n&&this.body.emitter.emit("_requestRedraw")}},{key:"getSelection",value:function(){var e=this.getSelectedNodes(),t=this.getSelectedEdges();return{nodes:e,edges:t}}},{key:"getSelectedNodes",value:function(){var e=[];if(!0===this.options.selectable)for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&e.push(this.selectionObj.nodes[t].id);return e}},{key:"getSelectedEdges",value:function(){var e=[];if(!0===this.options.selectable)for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&e.push(this.selectionObj.edges[t].id);return e}},{key:"setSelection",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},o,n;if(!e||!e.nodes&&!e.edges)throw"Selection must be an object with nodes and/or edges properties";if((t.unselectAll||void 0===t.unselectAll)&&this.unselectAll(),e.nodes)for(o=0;o<e.nodes.length;o++){n=e.nodes[o];var a=this.body.nodes[n];if(!a)throw new RangeError("Node with id \""+n+"\" not found");this.selectObject(a,t.highlightEdges)}if(e.edges)for(o=0;o<e.edges.length;o++){n=e.edges[o];var d=this.body.edges[n];if(!d)throw new RangeError("Edge with id \""+n+"\" not found");this.selectObject(d)}this.body.emitter.emit("_requestRedraw")}},{key:"selectNodes",value:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];if(!e||void 0===e.length)throw"Selection must be an array with ids";this.setSelection({nodes:e},{highlightEdges:t})}},{key:"selectEdges",value:function(e){if(!e||void 0===e.length)throw"Selection must be an array with ids";this.setSelection({edges:e})}},{key:"updateSelection",value:function(){for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&(this.body.nodes.hasOwnProperty(e)||delete this.selectionObj.nodes[e]);for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&(this.body.edges.hasOwnProperty(t)||delete this.selectionObj.edges[t])}},{key:"getClickedItems",value:function(e){for(var t=this.canvas.DOMtoCanvas(e),o=[],n=this.body.nodeIndices,a=this.body.nodes,d=n.length-1;0<=d;d--){var s=a[n[d]],r=s.getItemsOnPoint(t);o.push.apply(o,r)}for(var l=this.body.edgeIndices,c=this.body.edges,u=l.length-1;0<=u;u--){var p=c[l[u]],h=p.getItemsOnPoint(t);o.push.apply(o,h)}return o}}]),e}(),Jc=Le(function(e,t){(function(e,o){o(t)})(Ds,function(e){function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return 1e5>e?100>e?10>e?0:1:1e4>e?1e3>e?2:3:4:1e7>e?1e6>e?5:6:1e9>e?1e8>e?7:8:9}function n(e,n){if(e===n)return 0;if(~~e===e&&~~n===n){if(0===e||0===n)return e<n?-1:1;if(0>e||0>n){if(0<=n)return-1;if(0<=e)return 1;e=-e,n=-n}var i=o(e),d=o(n),s=0;return i<d?(e*=p[d-i-1],n/=10,s=-1):i>d&&(n*=p[i-d-1],e/=10,s=1),e===n?s:e<n?-1:1}var r=e+"",l=n+"";return r===l?0:r<l?-1:1}function i(e){for(var t=0;e>=32;)t|=1&e,e>>=1;return e+t}function a(e,t,o,n){var i=t+1;if(i===o)return 1;if(0>n(e[i++],e[t])){for(;i<o&&0>n(e[i],e[i-1]);)i++;d(e,t,i)}else for(;i<o&&0<=n(e[i],e[i-1]);)i++;return i-t}function d(e,o,n){for(n--;o<n;){var i=e[o];e[o++]=e[n],e[n--]=i}}function s(e,t,o,i,a){for(i===t&&i++;i<o;i++){for(var d=e[i],s=t,r=i;s<r;){var l=s+r>>>1;0>a(d,e[l])?r=l:s=l+1}var c=i-s;switch(c){case 3:e[s+3]=e[s+2];case 2:e[s+2]=e[s+1];case 1:e[s+1]=e[s];break;default:for(;0<c;)e[s+c]=e[s+c-1],c--;}e[s]=d}}function r(e,t,o,n,i,a){var d=0,s=0,r=1;if(0<a(e,t[o+i])){for(s=n-i;r<s&&0<a(e,t[o+i+r]);)d=r,r=(r<<1)+1,0>=r&&(r=s);r>s&&(r=s),d+=i,r+=i}else{for(s=i+1;r<s&&0>=a(e,t[o+i-r]);)d=r,r=(r<<1)+1,0>=r&&(r=s);r>s&&(r=s);var l=d;d=i-r,r=i-l}for(d++;d<r;){var c=d+(r-d>>>1);0<a(e,t[o+c])?d=c+1:r=c}return r}function l(e,t,o,n,i,a){var d=0,s=0,r=1;if(0>a(e,t[o+i])){for(s=i+1;r<s&&0>a(e,t[o+i-r]);)d=r,r=(r<<1)+1,0>=r&&(r=s);r>s&&(r=s);var l=d;d=i-r,r=i-l}else{for(s=n-i;r<s&&0<=a(e,t[o+i+r]);)d=r,r=(r<<1)+1,0>=r&&(r=s);r>s&&(r=s),d+=i,r+=i}for(d++;d<r;){var c=d+(r-d>>>1);0>a(e,t[o+c])?r=c:d=c+1}return r}e.__esModule=!0,e.sort=function(e,t,o,d){if(!Array.isArray(e))throw new TypeError("Can only sort arrays");t?"function"!=typeof t&&(d=o,o=t,t=n):t=n,o||(o=0),d||(d=e.length);var r=d-o;if(!(2>r)){var l=0;if(32>r)return l=a(e,o,d,t),void s(e,o,d,o+l,t);var c=new h(e,t),u=i(r);do{if(l=a(e,o,d,t),l<u){var p=r;p>u&&(p=u),s(e,o,o+p,o+l,t),l=p}c.pushRun(o,l),c.mergeRuns(),r-=l,o+=l}while(0!==r);c.forceMergeRuns()}};var c=7,u=256,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9],h=function(){function e(o,n){t(this,e),this.array=null,this.compare=null,this.minGallop=c,this.length=0,this.tmpStorageLength=u,this.stackLength=0,this.runStart=null,this.runLength=null,this.stackSize=0,this.array=o,this.compare=n,this.length=o.length,this.length<2*u&&(this.tmpStorageLength=this.length>>>1),this.tmp=Array(this.tmpStorageLength),this.stackLength=120>this.length?5:1542>this.length?10:119151>this.length?19:40,this.runStart=Array(this.stackLength),this.runLength=Array(this.stackLength)}return e.prototype.pushRun=function(e,t){this.runStart[this.stackSize]=e,this.runLength[this.stackSize]=t,this.stackSize+=1},e.prototype.mergeRuns=function(){for(;1<this.stackSize;){var e=this.stackSize-2;if(1<=e&&this.runLength[e-1]<=this.runLength[e]+this.runLength[e+1]||2<=e&&this.runLength[e-2]<=this.runLength[e]+this.runLength[e-1])this.runLength[e-1]<this.runLength[e+1]&&e--;else if(this.runLength[e]>this.runLength[e+1])break;this.mergeAt(e)}},e.prototype.forceMergeRuns=function(){for(;1<this.stackSize;){var e=this.stackSize-2;0<e&&this.runLength[e-1]<this.runLength[e+1]&&e--,this.mergeAt(e)}},e.prototype.mergeAt=function(e){var t=this.compare,o=this.array,n=this.runStart[e],i=this.runLength[e],a=this.runStart[e+1],d=this.runLength[e+1];this.runLength[e]=i+d,e===this.stackSize-3&&(this.runStart[e+1]=this.runStart[e+2],this.runLength[e+1]=this.runLength[e+2]),this.stackSize--;var s=l(o[a],o,n,i,0,t);(n+=s,i-=s,0!==i)&&(d=r(o[n+i-1],o,a,d,d-1,t),0===d||(i<=d?this.mergeLow(n,i,a,d):this.mergeHigh(n,i,a,d)))},e.prototype.mergeLow=function(e,t,o,n){var a=this.compare,d=this.array,s=this.tmp,u=0;for(u=0;u<t;u++)s[u]=d[e+u];var p=0,h=o,g=e;if(d[g++]=d[h++],0==--n){for(u=0;u<t;u++)d[g+u]=s[p+u];return}if(1===t){for(u=0;u<n;u++)d[g+u]=d[h+u];return void(d[g+n]=s[p])}for(var m=this.minGallop;;){var y=0,f=0,b=!1;do if(0>a(d[h],s[p])){if(d[g++]=d[h++],f++,y=0,0==--n){b=!0;break}}else if(d[g++]=s[p++],y++,f=0,1==--t){b=!0;break}while((y|f)<m);if(b)break;do{if(y=l(d[h],s,p,t,0,a),0!==y){for(u=0;u<y;u++)d[g+u]=s[p+u];if(g+=y,p+=y,t-=y,1>=t){b=!0;break}}if(d[g++]=d[h++],0==--n){b=!0;break}if(f=r(s[p],d,h,n,0,a),0!==f){for(u=0;u<f;u++)d[g+u]=d[h+u];if(g+=f,h+=f,n-=f,0===n){b=!0;break}}if(d[g++]=s[p++],1==--t){b=!0;break}m--}while(y>=c||f>=c);if(b)break;0>m&&(m=0),m+=2}if(this.minGallop=m,1>m&&(this.minGallop=1),1===t){for(u=0;u<n;u++)d[g+u]=d[h+u];d[g+n]=s[p]}else if(0===t)throw new Error("mergeLow preconditions were not respected");else for(u=0;u<t;u++)d[g+u]=s[p+u]},e.prototype.mergeHigh=function(e,t,o,n){var a=this.compare,d=this.array,s=this.tmp,u=0;for(u=0;u<n;u++)s[u]=d[o+u];var p=e+t-1,h=n-1,g=o+n-1,m=0,y=0;if(d[g--]=d[p--],0==--t){for(m=g-(n-1),u=0;u<n;u++)d[m+u]=s[u];return}if(1===n){for(g-=t,p-=t,y=g+1,m=p+1,u=t-1;0<=u;u--)d[y+u]=d[m+u];return void(d[g]=s[h])}for(var f=this.minGallop;;){var b=0,_=0,v=!1;do if(0>a(s[h],d[p])){if(d[g--]=d[p--],b++,_=0,0==--t){v=!0;break}}else if(d[g--]=s[h--],_++,b=0,1==--n){v=!0;break}while((b|_)<f);if(v)break;do{if(b=t-l(s[h],d,e,t,t-1,a),0!=b){for(g-=b,p-=b,t-=b,y=g+1,m=p+1,u=b-1;0<=u;u--)d[y+u]=d[m+u];if(0===t){v=!0;break}}if(d[g--]=s[h--],1==--n){v=!0;break}if(_=n-r(d[p],s,0,n,n-1,a),0!==_){for(g-=_,h-=_,n-=_,y=g+1,m=h+1,u=0;u<_;u++)d[y+u]=s[m+u];if(1>=n){v=!0;break}}if(d[g--]=d[p--],0==--t){v=!0;break}f--}while(b>=c||_>=c);if(v)break;0>f&&(f=0),f+=2}if(this.minGallop=f,1>f&&(this.minGallop=1),1===n){for(g-=t,p-=t,y=g+1,m=p+1,u=t-1;0<=u;u--)d[y+u]=d[m+u];d[g]=s[h]}else if(0===n)throw new Error("mergeHigh preconditions were not respected");else for(m=g-(n-1),u=0;u<n;u++)d[m+u]=s[u]},e}()})}),eu;(function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e})(Jc);var tu=Jc,ou=function(){function e(){pl(this,e)}return hl(e,[{key:"abstract",value:function(){throw new Error("Can't instantiate abstract class!")}},{key:"fake_use",value:function(){}},{key:"curveType",value:function(){return this.abstract()}},{key:"getPosition",value:function(e){return this.fake_use(e),this.abstract()}},{key:"setPosition",value:function(e,t){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:void 0;this.fake_use(e,t,o),this.abstract()}},{key:"getTreeSize",value:function(e){return this.fake_use(e),this.abstract()}},{key:"sort",value:function(e){this.fake_use(e),this.abstract()}},{key:"fix",value:function(e,t){this.fake_use(e,t),this.abstract()}},{key:"shift",value:function(e,t){this.fake_use(e,t),this.abstract()}}]),e}(),nu=function(e){function t(e){var o;return pl(this,t),o=Il(this,Pl(t).call(this)),o.layout=e,o}return Nl(t,e),hl(t,[{key:"curveType",value:function(){return"horizontal"}},{key:"getPosition",value:function(e){return e.x}},{key:"setPosition",value:function(e,t){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==o&&this.layout.hierarchical.addToOrdering(e,o),e.x=t}},{key:"getTreeSize",value:function(e){var t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_x,max:t.max_x}}},{key:"sort",value:function(e){tu.sort(e,function(e,t){return e.x-t.x})}},{key:"fix",value:function(e,t){e.y=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.y=!0}},{key:"shift",value:function(e,t){this.layout.body.nodes[e].x+=t}}]),t}(ou),iu=function(e){function t(e){var o;return pl(this,t),o=Il(this,Pl(t).call(this)),o.layout=e,o}return Nl(t,e),hl(t,[{key:"curveType",value:function(){return"vertical"}},{key:"getPosition",value:function(e){return e.y}},{key:"setPosition",value:function(e,t){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==o&&this.layout.hierarchical.addToOrdering(e,o),e.y=t}},{key:"getTreeSize",value:function(e){var t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_y,max:t.max_y}}},{key:"sort",value:function(e){tu.sort(e,function(e,t){return e.y-t.y})}},{key:"fix",value:function(e,t){e.x=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.x=!0}},{key:"shift",value:function(e,t){this.layout.body.nodes[e].y+=t}}]),t}(ou),au=function(){function e(){pl(this,e),this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}return hl(e,[{key:"addRelation",value:function(e,t){void 0===this.childrenReference[e]&&(this.childrenReference[e]=[]),this.childrenReference[e].push(t),void 0===this.parentReference[t]&&(this.parentReference[t]=[]),this.parentReference[t].push(e)}},{key:"checkIfTree",value:function(){for(var e in this.parentReference)if(1<this.parentReference[e].length)return void(this.isTree=!1);this.isTree=!0}},{key:"numTrees",value:function(){return this.treeIndex+1}},{key:"setTreeIndex",value:function(e,t){void 0===t||void 0===this.trees[e.id]&&(this.trees[e.id]=t,this.treeIndex=Co(t,this.treeIndex))}},{key:"ensureLevel",value:function(e){void 0===this.levels[e]&&(this.levels[e]=0)}},{key:"getMaxLevel",value:function(e){var t=this,o={},n=function e(n){if(void 0!==o[n])return o[n];var a=t.levels[n];if(t.childrenReference[n]){var d=t.childrenReference[n];if(0<d.length)for(var s=0;s<d.length;s++)a=Co(a,e(d[s]))}return o[n]=a,a};return n(e)}},{key:"levelDownstream",value:function(e,t){void 0===this.levels[t.id]&&(void 0===this.levels[e.id]&&(this.levels[e.id]=0),this.levels[t.id]=this.levels[e.id]+1)}},{key:"setMinLevelToZero",value:function(e){var t=1e9;for(var o in e)e.hasOwnProperty(o)&&void 0!==this.levels[o]&&(t=Mo(this.levels[o],t));for(var n in e)e.hasOwnProperty(n)&&void 0!==this.levels[n]&&(this.levels[n]-=t)}},{key:"getTreeSize",value:function(e,t){var o=1e9,n=-1e9,i=1e9,a=-1e9;for(var d in this.trees)if(this.trees.hasOwnProperty(d)&&this.trees[d]===t){var s=e[d];o=Mo(s.x,o),n=Co(s.x,n),i=Mo(s.y,i),a=Co(s.y,a)}return{min_x:o,max_x:n,min_y:i,max_y:a}}},{key:"hasSameParent",value:function(e,t){var o=this.parentReference[e.id],n=this.parentReference[t.id];if(void 0===o||void 0===n)return!1;for(var a=0;a<o.length;a++)for(var d=0;d<n.length;d++)if(o[a]==n[d])return!0;return!1}},{key:"inSameSubNetwork",value:function(e,t){return this.trees[e.id]===this.trees[t.id]}},{key:"getLevels",value:function(){return Object.keys(this.distributionOrdering)}},{key:"addToOrdering",value:function(e,t){void 0===this.distributionOrdering[t]&&(this.distributionOrdering[t]=[]);var o=!1,i=this.distributionOrdering[t];for(var a in i)if(i[a]===e){o=!0;break}o||(this.distributionOrdering[t].push(e),this.distributionIndex[e.id]=this.distributionOrdering[t].length-1)}}]),e}(),du=function(){function e(t){pl(this,e),this.body=t,this.initialRandomSeed=vo(1e6*Math.random()),this.randomSeed=this.initialRandomSeed,this.setPhysics=!1,this.options={},this.optionsBackup={physics:{}},this.defaultOptions={randomSeed:void 0,improvedLayout:!0,clusterThreshold:150,hierarchical:{enabled:!1,levelSeparation:150,nodeSpacing:100,treeSpacing:200,blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:"UD",sortMethod:"hubsize"}},Wd.extend(this.options,this.defaultOptions),this.bindEventListeners()}return hl(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("_dataChanged",function(){e.setupHierarchicalLayout()}),this.body.emitter.on("_dataLoaded",function(){e.layoutNetwork()}),this.body.emitter.on("_resetHierarchicalLayout",function(){e.setupHierarchicalLayout()}),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",function(){if(!0===e.options.hierarchical.enabled){var t=e.direction.curveType();e.body.emitter.emit("_forceDisableDynamicCurves",t,!1)}})}},{key:"setOptions",value:function(e,t){if(void 0!==e){var o=this.options.hierarchical,n=o.enabled;if(Wd.selectiveDeepExtend(["randomSeed","improvedLayout","clusterThreshold"],this.options,e),Wd.mergeOptions(this.options,e,"hierarchical"),void 0!==e.randomSeed&&(this.initialRandomSeed=e.randomSeed),!0===o.enabled)return!0===n&&this.body.emitter.emit("refresh",!0),"RL"===o.direction||"DU"===o.direction?0<o.levelSeparation&&(o.levelSeparation*=-1):0>o.levelSeparation&&(o.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(!0===n)return this.body.emitter.emit("refresh"),Wd.deepExtend(t,this.optionsBackup)}return t}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(e){if(!0===this.options.hierarchical.enabled){var t=this.optionsBackup.physics;void 0===e.physics||!0===e.physics?(e.physics={enabled:void 0===t.enabled||t.enabled,solver:"hierarchicalRepulsion"},t.enabled=void 0===t.enabled||t.enabled,t.solver=t.solver||"barnesHut"):"object"===wl(e.physics)?(t.enabled=void 0===e.physics.enabled||e.physics.enabled,t.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):!1!==e.physics&&(t.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});var o=this.direction.curveType();if(void 0===e.edges)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges={smooth:!1};else if(void 0===e.edges.smooth)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges.smooth=!1;else if("boolean"==typeof e.edges.smooth)this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:o};else{var n=e.edges.smooth;void 0!==n.type&&"dynamic"!==n.type&&(o=n.type),this.optionsBackup.edges={smooth:void 0===n.enabled||n.enabled,type:void 0===n.type?"dynamic":n.type,roundness:void 0===n.roundness?.5:n.roundness,forceDirection:void 0!==n.forceDirection&&n.forceDirection},e.edges.smooth={enabled:void 0===n.enabled||n.enabled,type:o,roundness:void 0===n.roundness?.5:n.roundness,forceDirection:void 0!==n.forceDirection&&n.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",o)}return e}},{key:"seededRandom",value:function(){var e=1e4*_o(this.randomSeed++);return e-Eo(e)}},{key:"positionInitially",value:function(e){if(!0!==this.options.hierarchical.enabled){this.randomSeed=this.initialRandomSeed;for(var t=e.length+50,o=0;o<e.length;o++){var n=e[o],a=2*Oo*this.seededRandom();void 0===n.x&&(n.x=t*bo(a)),void 0===n.y&&(n.y=t*_o(a))}}}},{key:"layoutNetwork",value:function(){if(!0!==this.options.hierarchical.enabled&&!0===this.options.improvedLayout){for(var e=this.body.nodeIndices,t=0,o=0,n;o<e.length;o++)n=this.body.nodes[e[o]],!0===n.predefinedPosition&&(t+=1);if(t<.5*e.length){var a=0,d=this.options.clusterThreshold,s={clusterNodeProperties:{shape:"ellipse",label:"",group:"",font:{multi:!1}},clusterEdgeProperties:{label:"",font:{multi:!1},smooth:{enabled:!1}}};if(e.length>d){for(var r=e.length;e.length>d&&10>=a;){a+=1;var l=e.length;0==a%3?this.body.modules.clustering.clusterBridges(s):this.body.modules.clustering.clusterOutliers(s);var c=e.length;if(l==c&&0!=a%3)return this._declusterAll(),this.body.emitter.emit("_layoutFailed"),void console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.")}this.body.modules.kamadaKawai.setOptions({springLength:Co(150,2*r)})}10<a&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(e,this.body.edgeIndices,!0),this._shiftToCenter();for(var u=70,p=0,h;p<e.length;p++)h=this.body.nodes[e[p]],!1===h.predefinedPosition&&(h.x+=(.5-this.seededRandom())*u,h.y+=(.5-this.seededRandom())*u);this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}},{key:"_shiftToCenter",value:function(){for(var e=zc.getRangeCore(this.body.nodes,this.body.nodeIndices),t=zc.findCenter(e),o=0,n;o<this.body.nodeIndices.length;o++)n=this.body.nodes[this.body.nodeIndices[o]],n.x-=t.x,n.y-=t.y}},{key:"_declusterAll",value:function(){for(var e=!0;!0===e;){e=!1;for(var t=0;t<this.body.nodeIndices.length;t++)!0===this.body.nodes[this.body.nodeIndices[t]].isCluster&&(e=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[t],{},!1));!0===e&&this.body.emitter.emit("_dataChanged")}}},{key:"getSeed",value:function(){return this.initialRandomSeed}},{key:"setupHierarchicalLayout",value:function(){if(!0===this.options.hierarchical.enabled&&0<this.body.nodeIndices.length){var e=!1,t=!1,o,n;for(n in this.lastNodeOnLevel={},this.hierarchical=new au,this.body.nodes)this.body.nodes.hasOwnProperty(n)&&(o=this.body.nodes[n],void 0===o.options.level?t=!0:(e=!0,this.hierarchical.levels[n]=o.options.level));if(!0===t&&!0===e)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");else{if(!0===t){var i=this.options.hierarchical.sortMethod;"hubsize"===i?this._determineLevelsByHubsize():"directed"===i?this._determineLevelsDirected():"custom"===i&&this._determineLevelsCustomCallback()}for(var a in this.body.nodes)this.body.nodes.hasOwnProperty(a)&&this.hierarchical.ensureLevel(a);var d=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(d),this._condenseHierarchy(),this._shiftToCenter()}}}},{key:"_condenseHierarchy",value:function(){var e=this,t=!1,o={},n=function(){for(var t=d(),o=0,n=0,s;n<t.length-1;n++)s=t[n].max-t[n+1].min,o+=s+e.options.hierarchical.treeSpacing,a(n+1,o)},a=function(t,o){var n=e.hierarchical.trees;for(var i in n)n.hasOwnProperty(i)&&n[i]===t&&e.direction.shift(i,o)},d=function(){for(var t=[],o=0;o<e.hierarchical.numTrees();o++)t.push(e.direction.getTreeSize(o));return t},s=function t(o,n){if(!n[o.id]&&(n[o.id]=!0,e.hierarchical.childrenReference[o.id])){var a=e.hierarchical.childrenReference[o.id];if(0<a.length)for(var d=0;d<a.length;d++)t(e.body.nodes[a[d]],n)}},r=function(t){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1e9,n=1e9,i=1e9,a=1e9,d=-1e9;for(var s in t)if(t.hasOwnProperty(s)){var r=e.body.nodes[s],l=e.hierarchical.levels[r.id],c=e.direction.getPosition(r),u=e._getSpaceAroundNode(r,t),p=kl(u,2),h=p[0],g=p[1];n=Mo(h,n),i=Mo(g,i),l<=o&&(a=Mo(c,a),d=Co(c,d))}return[a,d,n,i]},l=function(t,o){var n=e.hierarchical.getMaxLevel(t.id),i=e.hierarchical.getMaxLevel(o.id);return Mo(n,i)},c=function(t,o,n){for(var a=e.hierarchical,d=0;d<o.length;d++){var s=o[d],r=a.distributionOrdering[s];if(1<r.length)for(var l=0;l<r.length-1;l++){var c=r[l],u=r[l+1];a.hasSameParent(c,u)&&a.inSameSubNetwork(c,u)&&t(c,u,n)}}},u=function(o,n){var i=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2],a=e.direction.getPosition(o),d=e.direction.getPosition(n),c=So(d-a),u=e.options.hierarchical.nodeSpacing;if(c>u){var p={},h={};s(o,p),s(n,h);var g=l(o,n),m=r(p,g),y=r(h,g),f=m[1],b=y[0],_=y[2],v=So(f-b);if(v>u){var k=f-b+u;k<-_+u&&(k=-_+u),0>k&&(e._shiftBlock(n.id,k),t=!0,!0===i&&e._centerParent(n))}}},p=function(n,a){for(var d=a.id,l=a.edges,c=e.hierarchical.levels[a.id],u=e.options.hierarchical.levelSeparation*e.options.hierarchical.levelSeparation,p={},h=[],g=0,m;g<l.length;g++)if(m=l[g],m.toId!=m.fromId){var y=m.toId==d?m.from:m.to;p[l[g].id]=y,e.hierarchical.levels[y.id]<c&&h.push(m)}var f=function(t,o){for(var n=0,i=0;i<o.length;i++)if(void 0!==p[o[i].id]){var d=e.direction.getPosition(p[o[i].id])-t;n+=d/To(d*d+u)}return n},b=function(t,o){for(var n=0,i=0;i<o.length;i++)if(void 0!==p[o[i].id]){var d=e.direction.getPosition(p[o[i].id])-t;n-=u*ko(d*d+u,-1.5)}return n},_=function(t,o){for(var n=e.direction.getPosition(a),i={},d=0;d<t;d++){var s=f(n,o),r=b(n,o),l=40,c=Co(-l,Mo(l,vo(s/r)));if(n-=c,void 0!==i[n])break;i[n]=d}return n},v=function(n){var i=e.direction.getPosition(a);if(void 0===o[a.id]){var d={};s(a,d),o[a.id]=d}var l=r(o[a.id]),c=l[2],u=l[3],p=n-i,h=0;0<p?h=Mo(p,u-e.options.hierarchical.nodeSpacing):0>p&&(h=-Mo(-p,c-e.options.hierarchical.nodeSpacing)),0!=h&&(e._shiftBlock(a.id,h),t=!0)},k=function(o){var n=e.direction.getPosition(a),i=e._getSpaceAroundNode(a),d=kl(i,2),s=d[0],r=d[1],l=o-n,c=n;0<l?c=Mo(n+(r-e.options.hierarchical.nodeSpacing),o):0>l&&(c=Co(n-(s-e.options.hierarchical.nodeSpacing),o)),c!==n&&(e.direction.setPosition(a,c),t=!0)},w=_(n,h);v(w),w=_(n,l),k(w)},h=function(o){var n=e.hierarchical.getLevels();n=n.reverse();for(var a=0;a<o;a++){t=!1;for(var d=0;d<n.length;d++)for(var s=n[d],r=e.hierarchical.distributionOrdering[s],l=0;l<r.length;l++)p(1e3,r[l]);if(!0!==t)break}},g=function(o){var n=e.hierarchical.getLevels();n=n.reverse();for(var a=0;a<o&&(t=!1,c(u,n,!0),!0===t);a++);},m=function(){var t=e.hierarchical.getLevels();t=t.reverse();for(var o=0;o<t.length;o++)for(var n=t[o],a=e.hierarchical.distributionOrdering[n],d=0;d<a.length;d++)e._centerParent(a[d])};!0===this.options.hierarchical.blockShifting&&(g(5),function(){for(var t in e.body.nodes)e.body.nodes.hasOwnProperty(t)&&e._centerParent(e.body.nodes[t])}()),!0===this.options.hierarchical.edgeMinimization&&h(20),!0===this.options.hierarchical.parentCentralization&&m(),n()}},{key:"_getSpaceAroundNode",value:function(e,t){var o=!0;void 0===t&&(o=!1);var n=this.hierarchical.levels[e.id];if(void 0!==n){var i=this.hierarchical.distributionIndex[e.id],a=this.direction.getPosition(e),d=this.hierarchical.distributionOrdering[n],s=1e9,r=1e9;if(0!==i){var l=d[i-1];if(!0==o&&void 0===t[l.id]||!1==o){var c=this.direction.getPosition(l);s=a-c}}if(i!=d.length-1){var u=d[i+1];if(!0==o&&void 0===t[u.id]||!1==o){var p=this.direction.getPosition(u);r=Mo(r,p-a)}}return[s,r]}return[0,0]}},{key:"_centerParent",value:function(e){if(this.hierarchical.parentReference[e.id])for(var t=this.hierarchical.parentReference[e.id],o=0;o<t.length;o++){var n=t[o],a=this.body.nodes[n],d=this.hierarchical.childrenReference[n];if(void 0!==d){var s=this._getCenterPosition(d),r=this.direction.getPosition(a),l=this._getSpaceAroundNode(a),c=kl(l,2),u=c[0],p=c[1],h=r-s;(0>h&&So(h)<p-this.options.hierarchical.nodeSpacing||0<h&&So(h)<u-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(a,s)}}}},{key:"_placeNodesByHierarchy",value:function(e){for(var t in this.positionedNodes={},e)if(e.hasOwnProperty(t)){var o=Object.keys(e[t]);o=this._indexArrayToNodes(o),this.direction.sort(o);for(var n=0,a=0,d;a<o.length;a++)if(d=o[a],void 0===this.positionedNodes[d.id]){var s=this.options.hierarchical.nodeSpacing,r=s*n;0<n&&(r=this.direction.getPosition(o[a-1])+s),this.direction.setPosition(d,r,t),this._validatePositionAndContinue(d,t,r),n++}}}},{key:"_placeBranchNodes",value:function(e,t){var o=this.hierarchical.childrenReference[e];if(void 0!==o){for(var n=[],a=0;a<o.length;a++)n.push(this.body.nodes[o[a]]);this.direction.sort(n);for(var d=0;d<n.length;d++){var s=n[d],r=this.hierarchical.levels[s.id];if(r>t&&void 0===this.positionedNodes[s.id]){var l=this.options.hierarchical.nodeSpacing,c=void 0;c=0==d?this.direction.getPosition(this.body.nodes[e]):this.direction.getPosition(n[d-1])+l,this.direction.setPosition(s,c,r),this._validatePositionAndContinue(s,r,c)}else return}var u=this._getCenterPosition(n);this.direction.setPosition(this.body.nodes[e],u,t)}}},{key:"_validatePositionAndContinue",value:function(e,t,o){if(this.hierarchical.isTree){if(void 0!==this.lastNodeOnLevel[t]){var n=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(o-n<this.options.hierarchical.nodeSpacing){var i=n+this.options.hierarchical.nodeSpacing-o,a=this._findCommonParent(this.lastNodeOnLevel[t],e.id);this._shiftBlock(a.withChild,i)}}this.lastNodeOnLevel[t]=e.id,this.positionedNodes[e.id]=!0,this._placeBranchNodes(e.id,t)}}},{key:"_indexArrayToNodes",value:function(e){for(var t=[],o=0;o<e.length;o++)t.push(this.body.nodes[e[o]]);return t}},{key:"_getDistribution",value:function(){var e={},t,o;for(t in this.body.nodes)if(this.body.nodes.hasOwnProperty(t)){o=this.body.nodes[t];var n=void 0===this.hierarchical.levels[t]?0:this.hierarchical.levels[t];this.direction.fix(o,n),void 0===e[n]&&(e[n]={}),e[n][t]=o}return e}},{key:"_getActiveEdges",value:function(e){var t=this,o=[];return Wd.forEach(e.edges,function(e){-1!==t.body.edgeIndices.indexOf(e.id)&&o.push(e)}),o}},{key:"_getHubSizes",value:function(){var e=this,t={},o=this.body.nodeIndices;Wd.forEach(o,function(o){var n=e.body.nodes[o],i=e._getActiveEdges(n).length;t[i]=!0});var n=[];return Wd.forEach(t,function(e){n.push(+e)}),tu.sort(n,function(e,t){return t-e}),n}},{key:"_determineLevelsByHubsize",value:function(){for(var e=this,t=function(t,o){e.hierarchical.levelDownstream(t,o)},o=this._getHubSizes(),n=function(n){var i=o[n];return 0===i?"break":void Wd.forEach(e.body.nodeIndices,function(o){var n=e.body.nodes[o];i===e._getActiveEdges(n).length&&e._crawlNetwork(t,o)})},a=0,d;a<o.length&&(d=n(a),"break"!==d);++a);}},{key:"_determineLevelsCustomCallback",value:function(){var e=this,t=function(){};this._crawlNetwork(function(o,n,i){var a=e.hierarchical.levels[o.id];void 0===a&&(a=e.hierarchical.levels[o.id]=1e5);var d=t(zc.cloneOptions(o,"node"),zc.cloneOptions(n,"node"),zc.cloneOptions(i,"edge"));e.hierarchical.levels[n.id]=a+d}),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:"_determineLevelsDirected",value:function(){var e=this,t=function(t){return Wd.forEach(e.body.edges,function(e){if(e.toId===t.fromId&&e.fromId===t.toId)return!0}),!1};this._crawlNetwork(function(o,n,i){var a=e.hierarchical.levels[o.id],d=e.hierarchical.levels[n.id];if(t(i));void 0===a&&(a=e.hierarchical.levels[o.id]=1e4),e.hierarchical.levels[n.id]=i.toId==n.id?a+1:a-1}),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:"_generateMap",value:function(){var e=this;this._crawlNetwork(function(t,o){e.hierarchical.levels[o.id]>e.hierarchical.levels[t.id]&&e.hierarchical.addRelation(t.id,o.id)}),this.hierarchical.checkIfTree()}},{key:"_crawlNetwork",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:function(){},o=1<arguments.length?arguments[1]:void 0,n={},a=function o(a,d){if(void 0===n[a.id]){e.hierarchical.setTreeIndex(a,d),n[a.id]=!0;for(var s=e._getActiveEdges(a),r=0,l,c;r<s.length;r++)c=s[r],!0===c.connected&&(l=c.toId==a.id?c.from:c.to,a.id!=l.id&&(t(a,l,c),o(l,d)))}};if(void 0===o){for(var d=0,s=0,r;s<this.body.nodeIndices.length;s++)if(r=this.body.nodeIndices[s],void 0===n[r]){var l=this.body.nodes[r];a(l,d),d+=1}}else{var c=this.body.nodes[o];if(void 0===c)return void console.error("Node not found:",o);a(c)}}},{key:"_shiftBlock",value:function(e,t){var o=this,n={},i=function e(a){if(!n[a]){n[a]=!0,o.direction.shift(a,t);var d=o.hierarchical.childrenReference[a];if(void 0!==d)for(var s=0;s<d.length;s++)e(d[s])}};i(e)}},{key:"_findCommonParent",value:function(e,t){var o=this,n={},i=function e(t,n){var a=o.hierarchical.parentReference[n];if(void 0!==a)for(var d=0,s;d<a.length;d++)s=a[d],t[s]=!0,e(t,s)},a=function e(t,n){var a=o.hierarchical.parentReference[n];if(void 0!==a)for(var d=0,s;d<a.length;d++){if(s=a[d],void 0!==t[s])return{foundParent:s,withChild:n};var r=e(t,s);if(null!==r.foundParent)return r}return{foundParent:null,withChild:n}};return i(n,e),a(n,t)}},{key:"setDirectionStrategy",value:function(){var e="UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction;this.direction=e?new nu(this):new iu(this)}},{key:"_getCenterPosition",value:function(e){for(var t=1e9,o=-1e9,n=0,a;n<e.length;n++){if(a=void 0,void 0!==e[n].id)a=e[n];else{var d=e[n];a=this.body.nodes[d]}var s=this.direction.getPosition(a);t=Mo(t,s),o=Co(o,s)}return .5*(t+o)}}]),e}(),su=function(){function e(t,o,n){var i=this;pl(this,e),this.body=t,this.canvas=o,this.selectionHandler=n,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this.manipulationHammers=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:"dot",size:6,color:{background:"#ff0000",border:"#3c3c3c",highlight:{background:"#07f968",border:"#3c3c3c"}},borderWidth:2,borderWidthSelected:2}},Wd.extend(this.options,this.defaultOptions),this.body.emitter.on("destroy",function(){i._clean()}),this.body.emitter.on("_dataChanged",this._restore.bind(this)),this.body.emitter.on("_resetData",this._restore.bind(this))}return hl(e,[{key:"_restore",value:function(){!1!==this.inMode&&(!0===this.options.initiallyActive?this.enableEditMode():this.disableEditMode())}},{key:"setOptions",value:function(e,t,o){void 0!==t&&(this.options.locale=void 0===t.locale?o.locale:t.locale,this.options.locales=void 0===t.locales?o.locales:t.locales),void 0!==e&&("boolean"==typeof e?this.options.enabled=e:(this.options.enabled=!0,Wd.deepExtend(this.options,e)),!0===this.options.initiallyActive&&(this.editMode=!0),this._setup())}},{key:"toggleEditMode",value:function(){!0===this.editMode?this.disableEditMode():this.enableEditMode()}},{key:"enableEditMode",value:function(){this.editMode=!0,this._clean(),!0===this.guiEnabled&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}},{key:"disableEditMode",value:function(){this.editMode=!1,this._clean(),!0===this.guiEnabled&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}},{key:"showManipulatorToolbar",value:function(){if(this._clean(),this.manipulationDOM={},!0===this.guiEnabled){this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";var e=this.selectionHandler._getSelectedNodeCount(),t=this.selectionHandler._getSelectedEdgeCount(),o=this.options.locales[this.options.locale],n=!1;!1!==this.options.addNode&&(this._createAddNodeButton(o),n=!0),!1!==this.options.addEdge&&(!0===n?this._createSeperator(1):n=!0,this._createAddEdgeButton(o)),1===e&&"function"==typeof this.options.editNode?(!0===n?this._createSeperator(2):n=!0,this._createEditNodeButton(o)):1===t&&0===e&&!1!==this.options.editEdge&&(!0===n?this._createSeperator(3):n=!0,this._createEditEdgeButton(o)),0!==e+t&&(0<e&&!1!==this.options.deleteNode?(!0===n&&this._createSeperator(4),this._createDeleteButton(o)):0===e&&!1!==this.options.deleteEdge&&(!0===n&&this._createSeperator(4),this._createDeleteButton(o))),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this)),this._temporaryBindEvent("select",this.showManipulatorToolbar.bind(this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addNode",!0===this.guiEnabled){var e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.addDescription||this.options.locales.en.addDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this._temporaryBindEvent("click",this._performAddNode.bind(this))}},{key:"editNode",value:function(){var e=this;!0!==this.editMode&&this.enableEditMode(),this._clean();var t=this.selectionHandler._getSelectedNode();if(void 0===t)this.showManipulatorToolbar();else if(this.inMode="editNode","function"!=typeof this.options.editNode)throw new Error("No function has been configured to handle the editing of nodes.");else if(!0!==t.isCluster){var o=Wd.deepExtend({},t.options,!1);if(o.x=t.x,o.y=t.y,2===this.options.editNode.length)this.options.editNode(o,function(t){null!==t&&void 0!==t&&"editNode"===e.inMode&&e.body.data.nodes.getDataSet().update(t),e.showManipulatorToolbar()});else throw new Error("The function for edit does not support two arguments (data, callback)")}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError)}},{key:"addEdgeMode",value:function(){if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addEdge",!0===this.guiEnabled){var e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.edgeDescription||this.options.locales.en.edgeDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this._temporaryBindUI("onTouch",this._handleConnect.bind(this)),this._temporaryBindUI("onDragEnd",this._finishConnect.bind(this)),this._temporaryBindUI("onDrag",this._dragControlNode.bind(this)),this._temporaryBindUI("onRelease",this._finishConnect.bind(this)),this._temporaryBindUI("onDragStart",this._dragStartEdge.bind(this)),this._temporaryBindUI("onHold",function(){})}},{key:"editEdgeMode",value:function(){if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="editEdge","object"===wl(this.options.editEdge)&&"function"==typeof this.options.editEdge.editWithoutDrag&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdges()[0],void 0!==this.edgeBeingEditedId)){var e=this.body.edges[this.edgeBeingEditedId];return void this._performEditEdge(e.from.id,e.to.id)}if(!0===this.guiEnabled){var t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdges()[0],void 0!==this.edgeBeingEditedId){var o=this.body.edges[this.edgeBeingEditedId],n=this._getNewTargetNode(o.from.x,o.from.y),i=this._getNewTargetNode(o.to.x,o.to.y);this.temporaryIds.nodes.push(n.id),this.temporaryIds.nodes.push(i.id),this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id),this.body.nodes[i.id]=i,this.body.nodeIndices.push(i.id),this._temporaryBindUI("onTouch",this._controlNodeTouch.bind(this)),this._temporaryBindUI("onTap",function(){}),this._temporaryBindUI("onHold",function(){}),this._temporaryBindUI("onDragStart",this._controlNodeDragStart.bind(this)),this._temporaryBindUI("onDrag",this._controlNodeDrag.bind(this)),this._temporaryBindUI("onDragEnd",this._controlNodeDragEnd.bind(this)),this._temporaryBindUI("onMouseMove",function(){}),this._temporaryBindEvent("beforeDrawing",function(e){var t=o.edgeType.findBorderPositions(e);!1===n.selected&&(n.x=t.from.x,n.y=t.from.y),!1===i.selected&&(i.x=t.to.x,i.y=t.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}},{key:"deleteSelected",value:function(){var e=this;!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="delete";var t=this.selectionHandler.getSelectedNodes(),o=this.selectionHandler.getSelectedEdges(),n=void 0;if(0<t.length){for(var a=0;a<t.length;a++)if(!0===this.body.nodes[t[a]].isCluster)return void alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);"function"==typeof this.options.deleteNode&&(n=this.options.deleteNode)}else 0<o.length&&"function"==typeof this.options.deleteEdge&&(n=this.options.deleteEdge);if("function"==typeof n){if(2===n.length)n({nodes:t,edges:o},function(t){null!==t&&void 0!==t&&"delete"===e.inMode?(e.body.data.edges.getDataSet().remove(t.edges),e.body.data.nodes.getDataSet().remove(t.nodes),e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar()):(e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar())});else throw new Error("The function for delete does not support two arguments (data, callback)")}else this.body.data.edges.getDataSet().remove(o),this.body.data.nodes.getDataSet().remove(t),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}},{key:"_setup",value:function(){!0===this.options.enabled?(this.guiEnabled=!0,this._createWrappers(),!1===this.editMode?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){void 0===this.manipulationDiv&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.manipulationDiv.style.display=!0===this.editMode?"block":"none",this.canvas.frame.appendChild(this.manipulationDiv)),void 0===this.editModeDiv&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editModeDiv.style.display=!0===this.editMode?"none":"block",this.canvas.frame.appendChild(this.editModeDiv)),void 0===this.closeDiv&&(this.closeDiv=document.createElement("div"),this.closeDiv.className="vis-close",this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv))}},{key:"_getNewTargetNode",value:function(e,t){var o=Wd.deepExtend({},this.options.controlNodeStyle);o.id="targetNode"+Wd.randomUUID(),o.hidden=!1,o.physics=!1,o.x=e,o.y=t;var n=this.body.functions.createNode(o);return n.shape.boundingBox={left:e,right:e,top:t,bottom:t},n}},{key:"_createEditButton",value:function(){this._clean(),this.manipulationDOM={},Wd.recursiveDOMDelete(this.editModeDiv);var e=this.options.locales[this.options.locale],t=this._createButton("editMode","vis-button vis-edit vis-edit-mode",e.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(t),this._bindHammerToDiv(t,this.toggleEditMode.bind(this))}},{key:"_clean",value:function(){this.inMode=!1,!0===this.guiEnabled&&(Wd.recursiveDOMDelete(this.editModeDiv),Wd.recursiveDOMDelete(this.manipulationDiv),this._cleanManipulatorHammers()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}},{key:"_cleanManipulatorHammers",value:function(){if(0!=this.manipulationHammers.length){for(var e=0;e<this.manipulationHammers.length;e++)this.manipulationHammers[e].destroy();this.manipulationHammers=[]}}},{key:"_removeManipulationDOM",value:function(){this._clean(),Wd.recursiveDOMDelete(this.manipulationDiv),Wd.recursiveDOMDelete(this.editModeDiv),Wd.recursiveDOMDelete(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}},{key:"_createSeperator",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+e]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+e].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+e])}},{key:"_createAddNodeButton",value:function(e){var t=this._createButton("addNode","vis-button vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.addNodeMode.bind(this))}},{key:"_createAddEdgeButton",value:function(e){var t=this._createButton("addEdge","vis-button vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.addEdgeMode.bind(this))}},{key:"_createEditNodeButton",value:function(e){var t=this._createButton("editNode","vis-button vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.editNode.bind(this))}},{key:"_createEditEdgeButton",value:function(e){var t=this._createButton("editEdge","vis-button vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.editEdgeMode.bind(this))}},{key:"_createDeleteButton",value:function(e){var t=this.options.rtl?"vis-button vis-delete-rtl":"vis-button vis-delete";var o=this._createButton("delete",t,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(o),this._bindHammerToDiv(o,this.deleteSelected.bind(this))}},{key:"_createBackButton",value:function(e){var t=this._createButton("back","vis-button vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.showManipulatorToolbar.bind(this))}},{key:"_createButton",value:function(e,t,o){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:"vis-label";return this.manipulationDOM[e+"Div"]=document.createElement("div"),this.manipulationDOM[e+"Div"].className=t,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=n,this.manipulationDOM[e+"Label"].innerHTML=o,this.manipulationDOM[e+"Div"].appendChild(this.manipulationDOM[e+"Label"]),this.manipulationDOM[e+"Div"]}},{key:"_createDescription",value:function(e){this.manipulationDiv.appendChild(this._createButton("description","vis-button vis-none",e))}},{key:"_temporaryBindEvent",value:function(e,t){this.temporaryEventFunctions.push({event:e,boundFunction:t}),this.body.emitter.on(e,t)}},{key:"_temporaryBindUI",value:function(e,t){if(void 0!==this.body.eventListeners[e])this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=t;else throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+JSON.stringify(Object.keys(this.body.eventListeners)))}},{key:"_unbindTemporaryUIs",value:function(){for(var e in this.temporaryUIFunctions)this.temporaryUIFunctions.hasOwnProperty(e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}},{key:"_unbindTemporaryEvents",value:function(){for(var e=0;e<this.temporaryEventFunctions.length;e++){var t=this.temporaryEventFunctions[e].event,o=this.temporaryEventFunctions[e].boundFunction;this.body.emitter.off(t,o)}this.temporaryEventFunctions=[]}},{key:"_bindHammerToDiv",value:function(e,t){var o=new ll(e,{});Hc.onTouch(o,t),this.manipulationHammers.push(o)}},{key:"_cleanupTemporaryNodesAndEdges",value:function(){for(var e=0;e<this.temporaryIds.edges.length;e++){this.body.edges[this.temporaryIds.edges[e]].disconnect(),delete this.body.edges[this.temporaryIds.edges[e]];var t=this.body.edgeIndices.indexOf(this.temporaryIds.edges[e]);-1!==t&&this.body.edgeIndices.splice(t,1)}for(var o=0;o<this.temporaryIds.nodes.length;o++){delete this.body.nodes[this.temporaryIds.nodes[o]];var n=this.body.nodeIndices.indexOf(this.temporaryIds.nodes[o]);-1!==n&&this.body.nodeIndices.splice(n,1)}this.temporaryIds={nodes:[],edges:[]}}},{key:"_controlNodeTouch",value:function(e){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=Wd.extend({},this.body.view.translation)}},{key:"_controlNodeDragStart",value:function(){var e=this.lastTouch,t=this.selectionHandler._pointerToPositionObject(e),o=this.body.nodes[this.temporaryIds.nodes[0]],n=this.body.nodes[this.temporaryIds.nodes[1]],i=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;var a=o.isOverlappingWith(t),d=n.isOverlappingWith(t);!0===a?(this.selectedControlNode=o,i.edgeType.from=o):!0===d&&(this.selectedControlNode=n,i.edgeType.to=n),void 0!==this.selectedControlNode&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}},{key:"_controlNodeDrag",value:function(e){this.body.emitter.emit("disablePhysics");var t=this.body.functions.getPointer(e.center),o=this.canvas.DOMtoCanvas(t);if(void 0!==this.selectedControlNode)this.selectedControlNode.x=o.x,this.selectedControlNode.y=o.y;else{var n=t.x-this.lastTouch.x,i=t.y-this.lastTouch.y;this.body.view.translation={x:this.lastTouch.translation.x+n,y:this.lastTouch.translation.y+i}}this.body.emitter.emit("_redraw")}},{key:"_controlNodeDragEnd",value:function(e){var t=this.body.functions.getPointer(e.center),o=this.selectionHandler._pointerToPositionObject(t),n=this.body.edges[this.edgeBeingEditedId];if(void 0!==this.selectedControlNode){this.selectionHandler.unselectAll();for(var a=this.selectionHandler._getAllNodesOverlappingWith(o),d=void 0,s=a.length-1;0<=s;s--)if(a[s]!==this.selectedControlNode.id){d=this.body.nodes[a[s]];break}if(void 0===d||void 0===this.selectedControlNode)n.updateEdgeType(),this.body.emitter.emit("restorePhysics");else if(!0===d.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var r=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===r.id?this._performEditEdge(d.id,n.to.id):this._performEditEdge(n.from.id,d.id)}this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(e){if(100<new Date().valueOf()-this.touchTime){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=Wd.extend({},this.body.view.translation);var t=this.lastTouch,o=this.selectionHandler.getNodeAt(t);if(void 0!==o)if(!0===o.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var n=this._getNewTargetNode(o.x,o.y);this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id);var i=this.body.functions.createEdge({id:"connectionEdge"+Wd.randomUUID(),from:o.id,to:n.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[i.id]=i,this.body.edgeIndices.push(i.id),this.temporaryIds.nodes.push(n.id),this.temporaryIds.edges.push(i.id)}this.touchTime=new Date().valueOf()}}},{key:"_dragControlNode",value:function(e){var t=this.body.functions.getPointer(e.center),o=this.selectionHandler._pointerToPositionObject(t),n=void 0;void 0!==this.temporaryIds.edges[0]&&(n=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var a=this.selectionHandler._getAllNodesOverlappingWith(o),d=void 0,s=a.length-1;0<=s;s--)if(-1===this.temporaryIds.nodes.indexOf(a[s])){d=this.body.nodes[a[s]];break}if(e.controlEdge={from:n,to:d?d.id:void 0},this.selectionHandler._generateClickEvent("controlNodeDragging",e,t),void 0!==this.temporaryIds.nodes[0]){var r=this.body.nodes[this.temporaryIds.nodes[0]];r.x=this.canvas._XconvertDOMtoCanvas(t.x),r.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else{var l=t.x-this.lastTouch.x,c=t.y-this.lastTouch.y;this.body.view.translation={x:this.lastTouch.translation.x+l,y:this.lastTouch.translation.y+c}}}},{key:"_finishConnect",value:function(e){var t=this.body.functions.getPointer(e.center),o=this.selectionHandler._pointerToPositionObject(t),n=void 0;void 0!==this.temporaryIds.edges[0]&&(n=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var a=this.selectionHandler._getAllNodesOverlappingWith(o),d=void 0,s=a.length-1;0<=s;s--)if(-1===this.temporaryIds.nodes.indexOf(a[s])){d=this.body.nodes[a[s]];break}this._cleanupTemporaryNodesAndEdges(),void 0!==d&&(!0===d.isCluster?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):void 0!==this.body.nodes[n]&&void 0!==this.body.nodes[d.id]&&this._performAddEdge(n,d.id)),e.controlEdge={from:n,to:d?d.id:void 0},this.selectionHandler._generateClickEvent("controlNodeDragEnd",e,t),this.body.emitter.emit("_redraw")}},{key:"_dragStartEdge",value:function(e){var t=this.lastTouch;this.selectionHandler._generateClickEvent("dragStart",e,t,void 0,!0)}},{key:"_performAddNode",value:function(e){var t=this,o={id:Wd.randomUUID(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if("function"!=typeof this.options.addNode)this.body.data.nodes.getDataSet().add(o),this.showManipulatorToolbar();else if(2===this.options.addNode.length)this.options.addNode(o,function(e){null!==e&&void 0!==e&&"addNode"===t.inMode&&t.body.data.nodes.getDataSet().add(e),t.showManipulatorToolbar()});else throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)")}},{key:"_performAddEdge",value:function(e,t){var o=this,n={from:e,to:t};if("function"!=typeof this.options.addEdge)this.body.data.edges.getDataSet().add(n),this.selectionHandler.unselectAll(),this.showManipulatorToolbar();else if(2===this.options.addEdge.length)this.options.addEdge(n,function(e){null!==e&&void 0!==e&&"addEdge"===o.inMode&&(o.body.data.edges.getDataSet().add(e),o.selectionHandler.unselectAll(),o.showManipulatorToolbar())});else throw new Error("The function for connect does not support two arguments (data,callback)")}},{key:"_performEditEdge",value:function(e,t){var o=this,n={id:this.edgeBeingEditedId,from:e,to:t,label:this.body.data.edges._data[this.edgeBeingEditedId].label},i=this.options.editEdge;if("object"===wl(i)&&(i=i.editWithoutDrag),"function"!=typeof i)this.body.data.edges.getDataSet().update(n),this.selectionHandler.unselectAll(),this.showManipulatorToolbar();else if(2===i.length)i(n,function(e){null===e||void 0===e||"editEdge"!==o.inMode?(o.body.edges[n.id].updateEdgeType(),o.body.emitter.emit("_redraw"),o.showManipulatorToolbar()):(o.body.data.edges.getDataSet().update(e),o.selectionHandler.unselectAll(),o.showManipulatorToolbar())});else throw new Error("The function for edit does not support two arguments (data, callback)")}}]),e}(),ru={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"},lu=function(){function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1;pl(this,e),this.pixelRatio=t,this.generated=!1,this.centerCoordinates={x:289/2,y:289/2},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=function(){},this.closeCallback=function(){},this._create()}return hl(e,[{key:"insertTo",value:function(e){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(e){if("function"==typeof e)this.updateCallback=e;else throw new Error("Function attempted to set as colorPicker update callback is not a function.")}},{key:"setCloseCallback",value:function(e){if("function"==typeof e)this.closeCallback=e;else throw new Error("Function attempted to set as colorPicker closing callback is not a function.")}},{key:"_isColorString",value:function(e){if("string"==typeof e)return ru[e]}},{key:"setColor",value:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];if("none"!==e){var o=this._isColorString(e),n;if(void 0!==o&&(e=o),!0===Wd.isString(e)){if(!0===Wd.isValidRGB(e)){var i=e.substr(4).substr(0,e.length-5).split(",");n={r:i[0],g:i[1],b:i[2],a:1}}else if(!0===Wd.isValidRGBA(e)){var a=e.substr(5).substr(0,e.length-6).split(",");n={r:a[0],g:a[1],b:a[2],a:a[3]}}else if(!0===Wd.isValidHex(e)){var d=Wd.hexToRGB(e);n={r:d.r,g:d.g,b:d.b,a:1}}}else if(e instanceof Object&&void 0!==e.r&&void 0!==e.g&&void 0!==e.b){var s=void 0===e.a?"1.0":e.a;n={r:e.r,g:e.g,b:e.b,a:s}}if(void 0===n)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+JSON.stringify(e));else this._setColor(n,t)}}},{key:"show",value:function(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var e=this,t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];!0===t&&(this.previousColor=Wd.extend({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display="none",setTimeout(function(){void 0!==e.closeCallback&&(e.closeCallback(),e.closeCallback=void 0)},0)}},{key:"_save",value:function(){this.updateCallback(this.color),this.applied=!1,this._hide()}},{key:"_apply",value:function(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}},{key:"_loadLast",value:function(){void 0===this.previousColor?alert("There is no last color to load..."):this.setColor(this.previousColor,!1)}},{key:"_setColor",value:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];!0===t&&(this.initialColor=Wd.extend({},e)),this.color=e;var o=Wd.RGBToHSV(e.r,e.g,e.b),n=2*Oo,i=this.r*o.s,a=this.centerCoordinates.x+i*_o(n*o.h),d=this.centerCoordinates.y+i*bo(n*o.h);this.colorPickerSelector.style.left=a-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=d-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}},{key:"_setOpacity",value:function(e){this.color.a=e/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(e){var t=Wd.RGBToHSV(this.color.r,this.color.g,this.color.b);t.v=e/100;var o=Wd.HSVToRGB(t.h,t.s,t.v);o.a=this.color.a,this.color=o,this._updatePicker()}},{key:"_updatePicker",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.color,t=Wd.RGBToHSV(e.r,e.g,e.b),o=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(o.webkitBackingStorePixelRatio||o.mozBackingStorePixelRatio||o.msBackingStorePixelRatio||o.oBackingStorePixelRatio||o.backingStorePixelRatio||1)),o.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var n=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;o.clearRect(0,0,n,i),o.putImageData(this.hueCircle,0,0),o.fillStyle="rgba(0,0,0,"+(1-t.v)+")",o.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),o.fill(),this.brightnessRange.value=100*t.v,this.opacityRange.value=100*e.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}},{key:"_setSize",value:function(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}},{key:"_create",value:function(){if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),!this.colorPickerCanvas.getContext){var e=document.createElement("DIV");e.style.color="red",e.style.fontWeight="bold",e.style.padding="10px",e.innerHTML="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(e)}else{var t=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch(e){}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch(e){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var o=this;this.opacityRange.onchange=function(){o._setOpacity(this.value)},this.opacityRange.oninput=function(){o._setOpacity(this.value)},this.brightnessRange.onchange=function(){o._setBrightness(this.value)},this.brightnessRange.oninput=function(){o._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerHTML="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerHTML="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerHTML="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerHTML="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerHTML="cancel",this.cancelButton.onclick=this._hide.bind(this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerHTML="apply",this.applyButton.onclick=this._apply.bind(this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerHTML="save",this.saveButton.onclick=this._save.bind(this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerHTML="load last",this.loadButton.onclick=this._loadLast.bind(this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}},{key:"_bindHammer",value:function(){var e=this;this.drag={},this.pinch={},this.hammer=new ll(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),Hc.onTouch(this.hammer,function(t){e._moveSelector(t)}),this.hammer.on("tap",function(t){e._moveSelector(t)}),this.hammer.on("panstart",function(t){e._moveSelector(t)}),this.hammer.on("panmove",function(t){e._moveSelector(t)}),this.hammer.on("panend",function(t){e._moveSelector(t)})}},{key:"_generateHueCircle",value:function(){if(!1===this.generated){var e=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var t=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,t,o);var n,i,a,d;this.centerCoordinates={x:.5*t,y:.5*o},this.r=.49*t;var s=2*Oo/360,r=1/this.r,l;for(a=0;360>a;a++)for(d=0;d<this.r;d++)n=this.centerCoordinates.x+d*_o(s*a),i=this.centerCoordinates.y+d*bo(s*a),l=Wd.HSVToRGB(a*(1/360),d*r,1),e.fillStyle="rgb("+l.r+","+l.g+","+l.b+")",e.fillRect(n-.5,i-.5,2,2);e.strokeStyle="rgba(0,0,0,1)",e.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),e.stroke(),this.hueCircle=e.getImageData(0,0,t,o)}this.generated=!0}},{key:"_moveSelector",value:function(e){var t=this.colorPickerDiv.getBoundingClientRect(),o=e.center.x-t.left,n=e.center.y-t.top,i=.5*this.colorPickerDiv.clientHeight,a=.5*this.colorPickerDiv.clientWidth,d=o-a,r=n-i,l=Do(d,r),c=.98*Mo(To(d*d+r*r),a),u=bo(l)*c+i,p=_o(l)*c+a;this.colorPickerSelector.style.top=u-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=p-.5*this.colorPickerSelector.clientWidth+"px";var g=l/(2*Oo);g=0>g?g+1:g;var m=c/this.r,s=Wd.RGBToHSV(this.color.r,this.color.g,this.color.b);s.h=g,s.s=m;var y=Wd.HSVToRGB(s.h,s.s,s.v);y.a=this.color.a,this.color=y,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}}]),e}(),cu=function(){function e(t,o,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:1;pl(this,e),this.parent=t,this.changedOptions=[],this.container=o,this.allowCreation=!1,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},Wd.extend(this.options,this.defaultOptions),this.configureOptions=n,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new lu(i),this.wrapper=void 0}return hl(e,[{key:"setOptions",value:function(e){if(void 0!==e){this.popupHistory={},this._removePopup();var t=!0;if("string"==typeof e)this.options.filter=e;else if(e instanceof Array)this.options.filter=e.join();else if("object"===wl(e)){if(null==e)throw new TypeError("options cannot be null");void 0!==e.container&&(this.options.container=e.container),void 0!==e.filter&&(this.options.filter=e.filter),void 0!==e.showButton&&(this.options.showButton=e.showButton),void 0!==e.enabled&&(t=e.enabled)}else"boolean"==typeof e?(this.options.filter=!0,t=e):"function"==typeof e&&(this.options.filter=e,t=!0);!1===this.options.filter&&(t=!1),this.options.enabled=t}this._clean()}},{key:"setModuleOptions",value:function(e){this.moduleOptions=e,!0===this.options.enabled&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){this._clean(),this.changedOptions=[];var e=this.options.filter,t=0,o=!1;for(var n in this.configureOptions)this.configureOptions.hasOwnProperty(n)&&(this.allowCreation=!1,o=!1,"function"==typeof e?(o=e(n,[]),o=o||this._handleObject(this.configureOptions[n],[n],!0)):(!0===e||-1!==e.indexOf(n))&&(o=!0),!1!==o&&(this.allowCreation=!0,0<t&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),t++);this._makeButton(),this._push()}},{key:"_push",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var e=0;e<this.domElements.length;e++)this.wrapper.appendChild(this.domElements[e]);this._showPopupIfNeeded()}},{key:"_clean",value:function(){for(var e=0;e<this.domElements.length;e++)this.wrapper.removeChild(this.domElements[e]);void 0!==this.wrapper&&(this.container.removeChild(this.wrapper),this.wrapper=void 0),this.domElements=[],this._removePopup()}},{key:"_getValue",value:function(e){for(var t=this.moduleOptions,o=0;o<e.length;o++)if(void 0!==t[e[o]])t=t[e[o]];else{t=void 0;break}return t}},{key:"_makeItem",value:function(e){if(!0===this.allowCreation){var t=document.createElement("div");t.className="vis-configuration vis-config-item vis-config-s"+e.length;for(var o=arguments.length,n=Array(1<o?o-1:0),i=1;i<o;i++)n[i-1]=arguments[i];return n.forEach(function(e){t.appendChild(e)}),this.domElements.push(t),this.domElements.length}return 0}},{key:"_makeHeader",value:function(e){var t=document.createElement("div");t.className="vis-configuration vis-config-header",t.innerHTML=e,this._makeItem([],t)}},{key:"_makeLabel",value:function(e,t){var o=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2],n=document.createElement("div");return n.className="vis-configuration vis-config-label vis-config-s"+t.length,n.innerHTML=!0===o?"<i><b>"+e+":</b></i>":e+":",n}},{key:"_makeDropdown",value:function(e,t,o){var n=document.createElement("select");n.className="vis-configuration vis-config-select";var a=0;void 0!==t&&-1!==e.indexOf(t)&&(a=e.indexOf(t));for(var d=0,s;d<e.length;d++)s=document.createElement("option"),s.value=e[d],d==a&&(s.selected="selected"),s.innerHTML=e[d],n.appendChild(s);var r=this;n.onchange=function(){r._update(this.value,o)};var l=this._makeLabel(o[o.length-1],o);this._makeItem(o,l,n)}},{key:"_makeRange",value:function(e,t,o){var n=e[0],i=e[1],a=e[2],d=e[3],s=document.createElement("input");s.className="vis-configuration vis-config-range";try{s.type="range",s.min=i,s.max=a}catch(e){}s.step=d;var r="",l=0;if(void 0!==t){var c=1.2;0>t&&t*c<i?(s.min=xo(t*c),l=s.min,r="range increased"):t/c<i&&(s.min=xo(t/c),l=s.min,r="range increased"),t*c>a&&1!==a&&(s.max=xo(t*c),l=s.max,r="range increased"),s.value=t}else s.value=n;var u=document.createElement("input");u.className="vis-configuration vis-config-rangeinput",u.value=s.value;var p=this;s.onchange=function(){u.value=this.value,p._update(+this.value,o)},s.oninput=function(){u.value=this.value};var h=this._makeLabel(o[o.length-1],o),g=this._makeItem(o,h,s,u);""!=r&&this.popupHistory[g]!==l&&(this.popupHistory[g]=l,this._setupPopup(r,g))}},{key:"_makeButton",value:function(){var e=this;if(!0===this.options.showButton){var t=document.createElement("div");t.className="vis-configuration vis-config-button",t.innerHTML="generate options",t.onclick=function(){e._printOptions()},t.onmouseover=function(){t.className="vis-configuration vis-config-button hover"},t.onmouseout=function(){t.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(t)}}},{key:"_setupPopup",value:function(e,t){var o=this;if(!0===this.initialized&&!0===this.allowCreation&&this.popupCounter<this.popupLimit){var n=document.createElement("div");n.id="vis-configuration-popup",n.className="vis-configuration-popup",n.innerHTML=e,n.onclick=function(){o._removePopup()},this.popupCounter+=1,this.popupDiv={html:n,index:t}}}},{key:"_removePopup",value:function(){void 0!==this.popupDiv.html&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}},{key:"_showPopupIfNeeded",value:function(){var e=this;if(void 0!==this.popupDiv.html){var t=this.domElements[this.popupDiv.index],o=t.getBoundingClientRect();this.popupDiv.html.style.left=o.left+"px",this.popupDiv.html.style.top=o.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=setTimeout(function(){e.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=setTimeout(function(){e._removePopup()},1800)}}},{key:"_makeCheckbox",value:function(e,t,o){var n=document.createElement("input");n.type="checkbox",n.className="vis-configuration vis-config-checkbox",n.checked=e,void 0!==t&&(n.checked=t,t!==e&&("object"===wl(e)?t!==e.enabled&&this.changedOptions.push({path:o,value:t}):this.changedOptions.push({path:o,value:t})));var i=this;n.onchange=function(){i._update(this.checked,o)};var a=this._makeLabel(o[o.length-1],o);this._makeItem(o,a,n)}},{key:"_makeTextInput",value:function(e,t,o){var n=document.createElement("input");n.type="text",n.className="vis-configuration vis-config-text",n.value=t,t!==e&&this.changedOptions.push({path:o,value:t});var i=this;n.onchange=function(){i._update(this.value,o)};var a=this._makeLabel(o[o.length-1],o);this._makeItem(o,a,n)}},{key:"_makeColorField",value:function(e,t,o){var n=this,i=e[1],a=document.createElement("div");t=void 0===t?i:t,"none"===t?a.className="vis-configuration vis-config-colorBlock none":(a.className="vis-configuration vis-config-colorBlock",a.style.backgroundColor=t),t=void 0===t?i:t,a.onclick=function(){n._showColorPicker(t,a,o)};var d=this._makeLabel(o[o.length-1],o);this._makeItem(o,d,a)}},{key:"_showColorPicker",value:function(e,t,o){var n=this;t.onclick=function(){},this.colorPicker.insertTo(t),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(function(e){var i="rgba("+e.r+","+e.g+","+e.b+","+e.a+")";t.style.backgroundColor=i,n._update(i,o)}),this.colorPicker.setCloseCallback(function(){t.onclick=function(){n._showColorPicker(e,t,o)}})}},{key:"_handleObject",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],o=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2],n=!1,i=this.options.filter,a=!1;for(var d in e)if(e.hasOwnProperty(d)){n=!0;var s=e[d],r=Wd.copyAndExtendArray(t,d);if("function"==typeof i&&(n=i(d,t),!1===n&&!(s instanceof Array)&&"string"!=typeof s&&"boolean"!=typeof s&&s instanceof Object&&(this.allowCreation=!1,n=this._handleObject(s,r,!0),this.allowCreation=!1===o)),!1!==n){a=!0;var l=this._getValue(r);if(s instanceof Array)this._handleArray(s,l,r);else if("string"==typeof s)this._makeTextInput(s,l,r);else if("boolean"==typeof s)this._makeCheckbox(s,l,r);else if(s instanceof Object){var c=!0;if(-1!==t.indexOf("physics")&&this.moduleOptions.physics.solver!==d&&(c=!1),!0==c)if(void 0!==s.enabled){var u=Wd.copyAndExtendArray(r,"enabled"),p=this._getValue(u);if(!0===p){var h=this._makeLabel(d,r,!0);this._makeItem(r,h),a=this._handleObject(s,r)||a}else this._makeCheckbox(s,p,r)}else{var g=this._makeLabel(d,r,!0);this._makeItem(r,g),a=this._handleObject(s,r)||a}}else console.error("dont know how to handle",s,d,r)}}return a}},{key:"_handleArray",value:function(e,t,o){"string"==typeof e[0]&&"color"===e[0]?(this._makeColorField(e,t,o),e[1]!==t&&this.changedOptions.push({path:o,value:t})):"string"==typeof e[0]?(this._makeDropdown(e,t,o),e[0]!==t&&this.changedOptions.push({path:o,value:t})):"number"==typeof e[0]&&(this._makeRange(e,t,o),e[0]!==t&&this.changedOptions.push({path:o,value:+t}))}},{key:"_update",value:function(e,t){var o=this._constructOptions(e,t);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",o),this.initialized=!0,this.parent.setOptions(o)}},{key:"_constructOptions",value:function(e,t){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},n=o;e="true"===e||e,e="false"!==e&&e;for(var a=0;a<t.length;a++)"global"!==t[a]&&(void 0===n[t[a]]&&(n[t[a]]={}),a==t.length-1?n[t[a]]=e:n=n[t[a]]);return o}},{key:"_printOptions",value:function(){var e=this.getOptions();this.optionsContainer.innerHTML="<pre>var options = "+JSON.stringify(e,null,2)+"</pre>"}},{key:"getOptions",value:function(){for(var e={},t=0;t<this.changedOptions.length;t++)this._constructOptions(this.changedOptions[t].value,this.changedOptions[t].path,e);return e}}]),e}(),uu="string",pu="boolean",hu="number",gu="array",mu="object",yu="dom",fu=["arrow","circle","bar"],bu={configure:{enabled:{boolean:pu},filter:{boolean:pu,string:uu,array:gu,function:"function"},container:{dom:yu},showButton:{boolean:pu},__type__:{object:mu,boolean:pu,string:uu,array:gu,function:"function"}},edges:{arrows:{to:{enabled:{boolean:pu},scaleFactor:{number:hu},type:{string:fu},__type__:{object:mu,boolean:pu}},middle:{enabled:{boolean:pu},scaleFactor:{number:hu},type:{string:fu},__type__:{object:mu,boolean:pu}},from:{enabled:{boolean:pu},scaleFactor:{number:hu},type:{string:fu},__type__:{object:mu,boolean:pu}},__type__:{string:["from","to","middle"],object:mu}},arrowStrikethrough:{boolean:pu},background:{enabled:{boolean:pu},color:{string:uu},size:{number:hu},dashes:{boolean:pu,array:gu},__type__:{object:mu,boolean:pu}},chosen:{label:{boolean:pu,function:"function"},edge:{boolean:pu,function:"function"},__type__:{object:mu,boolean:pu}},color:{color:{string:uu},highlight:{string:uu},hover:{string:uu},inherit:{string:["from","to","both"],boolean:pu},opacity:{number:hu},__type__:{object:mu,string:uu}},dashes:{boolean:pu,array:gu},font:{color:{string:uu},size:{number:hu},face:{string:uu},background:{string:uu},strokeWidth:{number:hu},strokeColor:{string:uu},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:hu},multi:{boolean:pu,string:uu},bold:{color:{string:uu},size:{number:hu},face:{string:uu},mod:{string:uu},vadjust:{number:hu},__type__:{object:mu,string:uu}},boldital:{color:{string:uu},size:{number:hu},face:{string:uu},mod:{string:uu},vadjust:{number:hu},__type__:{object:mu,string:uu}},ital:{color:{string:uu},size:{number:hu},face:{string:uu},mod:{string:uu},vadjust:{number:hu},__type__:{object:mu,string:uu}},mono:{color:{string:uu},size:{number:hu},face:{string:uu},mod:{string:uu},vadjust:{number:hu},__type__:{object:mu,string:uu}},__type__:{object:mu,string:uu}},hidden:{boolean:pu},hoverWidth:{function:"function",number:hu},label:{string:uu,undefined:"undefined"},labelHighlightBold:{boolean:pu},length:{number:hu,undefined:"undefined"},physics:{boolean:pu},scaling:{min:{number:hu},max:{number:hu},label:{enabled:{boolean:pu},min:{number:hu},max:{number:hu},maxVisible:{number:hu},drawThreshold:{number:hu},__type__:{object:mu,boolean:pu}},customScalingFunction:{function:"function"},__type__:{object:mu}},selectionWidth:{function:"function",number:hu},selfReferenceSize:{number:hu},shadow:{enabled:{boolean:pu},color:{string:uu},size:{number:hu},x:{number:hu},y:{number:hu},__type__:{object:mu,boolean:pu}},smooth:{enabled:{boolean:pu},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:hu},forceDirection:{string:["horizontal","vertical","none"],boolean:pu},__type__:{object:mu,boolean:pu}},title:{string:uu,undefined:"undefined"},width:{number:hu},widthConstraint:{maximum:{number:hu},__type__:{object:mu,boolean:pu,number:hu}},value:{number:hu,undefined:"undefined"},__type__:{object:mu}},groups:{useDefaultGroups:{boolean:pu},__any__:"get from nodes, will be overwritten below",__type__:{object:mu}},interaction:{dragNodes:{boolean:pu},dragView:{boolean:pu},hideEdgesOnDrag:{boolean:pu},hideEdgesOnZoom:{boolean:pu},hideNodesOnDrag:{boolean:pu},hover:{boolean:pu},keyboard:{enabled:{boolean:pu},speed:{x:{number:hu},y:{number:hu},zoom:{number:hu},__type__:{object:mu}},bindToWindow:{boolean:pu},__type__:{object:mu,boolean:pu}},multiselect:{boolean:pu},navigationButtons:{boolean:pu},selectable:{boolean:pu},selectConnectedEdges:{boolean:pu},hoverConnectedEdges:{boolean:pu},tooltipDelay:{number:hu},zoomView:{boolean:pu},zoomSpeed:{number:hu},__type__:{object:mu}},layout:{randomSeed:{undefined:"undefined",number:hu},improvedLayout:{boolean:pu},clusterThreshold:{number:hu},hierarchical:{enabled:{boolean:pu},levelSeparation:{number:hu},nodeSpacing:{number:hu},treeSpacing:{number:hu},blockShifting:{boolean:pu},edgeMinimization:{boolean:pu},parentCentralization:{boolean:pu},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},__type__:{object:mu,boolean:pu}},__type__:{object:mu}},manipulation:{enabled:{boolean:pu},initiallyActive:{boolean:pu},addNode:{boolean:pu,function:"function"},addEdge:{boolean:pu,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:mu,boolean:pu,function:"function"}},deleteNode:{boolean:pu,function:"function"},deleteEdge:{boolean:pu,function:"function"},controlNodeStyle:"get from nodes, will be overwritten below",__type__:{object:mu,boolean:pu}},nodes:{borderWidth:{number:hu},borderWidthSelected:{number:hu,undefined:"undefined"},brokenImage:{string:uu,undefined:"undefined"},chosen:{label:{boolean:pu,function:"function"},node:{boolean:pu,function:"function"},__type__:{object:mu,boolean:pu}},color:{border:{string:uu},background:{string:uu},highlight:{border:{string:uu},background:{string:uu},__type__:{object:mu,string:uu}},hover:{border:{string:uu},background:{string:uu},__type__:{object:mu,string:uu}},__type__:{object:mu,string:uu}},fixed:{x:{boolean:pu},y:{boolean:pu},__type__:{object:mu,boolean:pu}},font:{align:{string:uu},color:{string:uu},size:{number:hu},face:{string:uu},background:{string:uu},strokeWidth:{number:hu},strokeColor:{string:uu},vadjust:{number:hu},multi:{boolean:pu,string:uu},bold:{color:{string:uu},size:{number:hu},face:{string:uu},mod:{string:uu},vadjust:{number:hu},__type__:{object:mu,string:uu}},boldital:{color:{string:uu},size:{number:hu},face:{string:uu},mod:{string:uu},vadjust:{number:hu},__type__:{object:mu,string:uu}},ital:{color:{string:uu},size:{number:hu},face:{string:uu},mod:{string:uu},vadjust:{number:hu},__type__:{object:mu,string:uu}},mono:{color:{string:uu},size:{number:hu},face:{string:uu},mod:{string:uu},vadjust:{number:hu},__type__:{object:mu,string:uu}},__type__:{object:mu,string:uu}},group:{string:uu,number:hu,undefined:"undefined"},heightConstraint:{minimum:{number:hu},valign:{string:uu},__type__:{object:mu,boolean:pu,number:hu}},hidden:{boolean:pu},icon:{face:{string:uu},code:{string:uu},size:{number:hu},color:{string:uu},__type__:{object:mu}},id:{string:uu,number:hu},image:{selected:{string:uu,undefined:"undefined"},unselected:{string:uu,undefined:"undefined"},__type__:{object:mu,string:uu}},imagePadding:{top:{number:hu},right:{number:hu},bottom:{number:hu},left:{number:hu},__type__:{object:mu,number:hu}},label:{string:uu,undefined:"undefined"},labelHighlightBold:{boolean:pu},level:{number:hu,undefined:"undefined"},margin:{top:{number:hu},right:{number:hu},bottom:{number:hu},left:{number:hu},__type__:{object:mu,number:hu}},mass:{number:hu},physics:{boolean:pu},scaling:{min:{number:hu},max:{number:hu},label:{enabled:{boolean:pu},min:{number:hu},max:{number:hu},maxVisible:{number:hu},drawThreshold:{number:hu},__type__:{object:mu,boolean:pu}},customScalingFunction:{function:"function"},__type__:{object:mu}},shadow:{enabled:{boolean:pu},color:{string:uu},size:{number:hu},x:{number:hu},y:{number:hu},__type__:{object:mu,boolean:pu}},shape:{string:["ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},shapeProperties:{borderDashes:{boolean:pu,array:gu},borderRadius:{number:hu},interpolation:{boolean:pu},useImageSize:{boolean:pu},useBorderWithImage:{boolean:pu},__type__:{object:mu}},size:{number:hu},title:{string:uu,dom:yu,undefined:"undefined"},value:{number:hu,undefined:"undefined"},widthConstraint:{minimum:{number:hu},maximum:{number:hu},__type__:{object:mu,boolean:pu,number:hu}},x:{number:hu},y:{number:hu},__type__:{object:mu}},physics:{enabled:{boolean:pu},barnesHut:{gravitationalConstant:{number:hu},centralGravity:{number:hu},springLength:{number:hu},springConstant:{number:hu},damping:{number:hu},avoidOverlap:{number:hu},__type__:{object:mu}},forceAtlas2Based:{gravitationalConstant:{number:hu},centralGravity:{number:hu},springLength:{number:hu},springConstant:{number:hu},damping:{number:hu},avoidOverlap:{number:hu},__type__:{object:mu}},repulsion:{centralGravity:{number:hu},springLength:{number:hu},springConstant:{number:hu},nodeDistance:{number:hu},damping:{number:hu},__type__:{object:mu}},hierarchicalRepulsion:{centralGravity:{number:hu},springLength:{number:hu},springConstant:{number:hu},nodeDistance:{number:hu},damping:{number:hu},__type__:{object:mu}},maxVelocity:{number:hu},minVelocity:{number:hu},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:pu},iterations:{number:hu},updateInterval:{number:hu},onlyDynamicEdges:{boolean:pu},fit:{boolean:pu},__type__:{object:mu,boolean:pu}},timestep:{number:hu},adaptiveTimestep:{boolean:pu},__type__:{object:mu,boolean:pu}},autoResize:{boolean:pu},clickToUse:{boolean:pu},locale:{string:uu},locales:{__any__:{any:"any"},__type__:{object:mu}},height:{string:uu},width:{string:uu},__type__:{object:mu}};bu.groups.__any__=bu.nodes,bu.manipulation.controlNodeStyle=bu.nodes;var _u={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown","hexagon"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"}},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0,zoomSpeed:[1,1,1,1]},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01]}},vu=Object.freeze({allOptions:bu,configureOptions:_u}),ku=function(){function e(){pl(this,e)}return hl(e,[{key:"getDistances",value:function(e,t,o){for(var n={},a=e.edges,d=0;d<t.length;d++){var s=t[d],r={};n[s]=r;for(var l=0;l<t.length;l++)r[t[l]]=d==l?0:1e9}for(var c=0,u;c<o.length;c++)u=a[o[c]],!0===u.connected&&void 0!==n[u.fromId]&&void 0!==n[u.toId]&&(n[u.fromId][u.toId]=1,n[u.toId][u.fromId]=1);for(var p=t.length,h=0;h<p;h++)for(var g=t[h],m=n[g],y=0;y<p-1;y++)for(var f=t[y],b=n[f],_=y+1;_<p;_++){var v=t[_],w=n[v],x=Mo(b[v],b[g]+m[v]);b[v]=x,w[f]=x}return n}}]),e}(),wu=function(){function e(t,o,n){pl(this,e),this.body=t,this.springLength=o,this.springConstant=n,this.distanceSolver=new ku}return hl(e,[{key:"setOptions",value:function(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}},{key:"solve",value:function(e,t){var o=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2],n=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(n),this._createK_matrix(n),this._createE_matrix();for(var i=0,a=Co(1e3,Mo(10*this.body.nodeIndices.length,6e3)),d=1e9,s=0,r=0,l=0,c=0,u=0;d>.01&&i<a;){i+=1;var p=this._getHighestEnergyNode(o),h=kl(p,4);for(s=h[0],d=h[1],r=h[2],l=h[3],c=d,u=0;c>1&&u<5;){u+=1,this._moveNode(s,r,l);var g=this._getEnergy(s),m=kl(g,3);c=m[0],r=m[1],l=m[2]}}}},{key:"_getHighestEnergyNode",value:function(e){for(var t=this.body.nodeIndices,o=this.body.nodes,n=0,i=t[0],a=0,d=0,s=0,r;s<t.length;s++)if(r=t[s],!1===o[r].predefinedPosition||!0===o[r].isCluster&&!0===e||!0===o[r].options.fixed.x||!0===o[r].options.fixed.y){var l=this._getEnergy(r),c=kl(l,3),u=c[0],p=c[1],h=c[2];n<u&&(n=u,i=r,a=p,d=h)}return[i,n,a,d]}},{key:"_getEnergy",value:function(e){var t=kl(this.E_sums[e],2),o=t[0],n=t[1],i=To(ko(o,2)+ko(n,2));return[i,o,n]}},{key:"_moveNode",value:function(e,t,o){for(var n=this.body.nodeIndices,a=this.body.nodes,d=0,s=0,r=0,l=a[e].x,c=a[e].y,u=this.K_matrix[e],p=this.L_matrix[e],h=0,g;h<n.length;h++)if(g=n[h],g!==e){var m=a[g].x,y=a[g].y,f=u[g],b=p[g],_=1/ko(ko(l-m,2)+ko(c-y,2),1.5);d+=f*(1-b*ko(c-y,2)*_),s+=f*(b*(l-m)*(c-y)*_),r+=f*(1-b*ko(l-m,2)*_)}var v=d,k=s,w=t,x=r,S=(w/v+o/k)/(k/v-x/k);a[e].x+=-(k*S+w)/v,a[e].y+=S,this._updateE_matrix(e)}},{key:"_createL_matrix",value:function(e){var t=this.body.nodeIndices,o=this.springLength;this.L_matrix=[];for(var n=0;n<t.length;n++){this.L_matrix[t[n]]={};for(var a=0;a<t.length;a++)this.L_matrix[t[n]][t[a]]=o*e[t[n]][t[a]]}}},{key:"_createK_matrix",value:function(e){var t=this.body.nodeIndices,o=this.springConstant;this.K_matrix=[];for(var n=0;n<t.length;n++){this.K_matrix[t[n]]={};for(var a=0;a<t.length;a++)this.K_matrix[t[n]][t[a]]=o*ko(e[t[n]][t[a]],-2)}}},{key:"_createE_matrix",value:function(){var e=this.body.nodeIndices,t=this.body.nodes;this.E_matrix={},this.E_sums={};for(var o=0;o<e.length;o++)this.E_matrix[e[o]]=[];for(var n=0;n<e.length;n++){for(var a=e[n],d=t[a].x,s=t[a].y,r=0,l=0,c=n,u;c<e.length;c++)if(u=e[c],u!==a){var p=t[u].x,h=t[u].y,g=1/To(ko(d-p,2)+ko(s-h,2));this.E_matrix[a][c]=[this.K_matrix[a][u]*(d-p-this.L_matrix[a][u]*(d-p)*g),this.K_matrix[a][u]*(s-h-this.L_matrix[a][u]*(s-h)*g)],this.E_matrix[u][n]=this.E_matrix[a][c],r+=this.E_matrix[a][c][0],l+=this.E_matrix[a][c][1]}this.E_sums[a]=[r,l]}}},{key:"_updateE_matrix",value:function(e){for(var t=this.body.nodeIndices,o=this.body.nodes,n=this.E_matrix[e],a=this.K_matrix[e],d=this.L_matrix[e],s=o[e].x,r=o[e].y,l=0,c=0,u=0,p;u<t.length;u++)if(p=t[u],p!==e){var h=n[u],g=h[0],m=h[1],y=o[p].x,f=o[p].y,b=1/To(ko(s-y,2)+ko(r-f,2)),_=a[p]*(s-y-d[p]*(s-y)*b),v=a[p]*(r-f-d[p]*(r-f)*b);n[u]=[_,v],l+=_,c+=v;var k=this.E_sums[p];k[0]+=_-g,k[1]+=v-m}this.E_sums[e]=[l,c]}}]),e}();Ts(fo.prototype),fo.prototype.setOptions=function(e){var t=this;if(null===e&&(e=void 0),void 0!==e){var o=tc.validate(e,bu);!0===o&&console.log("%cErrors have been found in the supplied options object.",ec);if(Wd.selectiveDeepExtend(["locale","locales","clickToUse"],this.options,e),e=this.layoutEngine.setOptions(e.layout,e),this.canvas.setOptions(e),this.groups.setOptions(e.groups),this.nodesHandler.setOptions(e.nodes),this.edgesHandler.setOptions(e.edges),this.physics.setOptions(e.physics),this.manipulation.setOptions(e.manipulation,e,this.options),this.interactionHandler.setOptions(e.interaction),this.renderer.setOptions(e.interaction),this.selectionHandler.setOptions(e.interaction),void 0!==e.groups&&this.body.emitter.emit("refreshNodes"),"configure"in e&&(!this.configurator&&(this.configurator=new cu(this,this.body.container,_u,this.canvas.pixelRatio)),this.configurator.setOptions(e.configure)),this.configurator&&!0===this.configurator.options.enabled){var n={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};Wd.deepExtend(n.nodes,this.nodesHandler.options),Wd.deepExtend(n.edges,this.edgesHandler.options),Wd.deepExtend(n.layout,this.layoutEngine.options),Wd.deepExtend(n.interaction,this.selectionHandler.options),Wd.deepExtend(n.interaction,this.renderer.options),Wd.deepExtend(n.interaction,this.interactionHandler.options),Wd.deepExtend(n.manipulation,this.manipulation.options),Wd.deepExtend(n.physics,this.physics.options),Wd.deepExtend(n.global,this.canvas.options),Wd.deepExtend(n.global,this.options),this.configurator.setModuleOptions(n)}void 0===e.clickToUse?this.body.emitter.emit("activate"):!0===e.clickToUse?void 0===this.activator&&(this.activator=new no(this.canvas.frame),this.activator.on("change",function(){t.body.emitter.emit("activate")})):(void 0!==this.activator&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}},fo.prototype._updateVisibleIndices=function(){var e=this.body.nodes,t=this.body.edges;for(var o in this.body.nodeIndices=[],this.body.edgeIndices=[],e)e.hasOwnProperty(o)&&(this.clustering._isClusteredNode(o)||!1!==e[o].options.hidden||this.body.nodeIndices.push(e[o].id));for(var n in t)if(t.hasOwnProperty(n)){var i=t[n],a=e[i.fromId],d=e[i.toId],s=!this.clustering._isClusteredEdge(n)&&!1===i.options.hidden&&void 0!==a&&void 0!==d&&!1===a.options.hidden&&!1===d.options.hidden;s&&this.body.edgeIndices.push(i.id)}},fo.prototype.bindEventListeners=function(){var e=this;this.body.emitter.on("_dataChanged",function(){e.edgesHandler._updateState(),e.body.emitter.emit("_dataUpdated")}),this.body.emitter.on("_dataUpdated",function(){e.clustering._updateState(),e._updateVisibleIndices(),e._updateValueRange(e.body.nodes),e._updateValueRange(e.body.edges),e.body.emitter.emit("startSimulation"),e.body.emitter.emit("_requestRedraw")})},fo.prototype.setData=function(e){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),e&&e.dot&&(e.nodes||e.edges))throw new SyntaxError("Data must contain either parameter \"dot\" or parameter pair \"nodes\" and \"edges\", but not both.");if(this.setOptions(e&&e.options),e&&e.dot){console.log("The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);");var t=As.DOTToGraph(e.dot);return void this.setData(t)}if(e&&e.gephi){console.log("The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);");var o=ut(e.gephi);return void this.setData(o)}this.nodesHandler.setData(e&&e.nodes,!0),this.edgesHandler.setData(e&&e.edges,!0),this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")},fo.prototype.destroy=function(){for(var e in this.body.emitter.emit("destroy"),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images,this.body.nodes)this.body.nodes.hasOwnProperty(e)&&delete this.body.nodes[e];for(var t in this.body.edges)this.body.edges.hasOwnProperty(t)&&delete this.body.edges[t];Wd.recursiveDOMDelete(this.body.container)},fo.prototype._updateValueRange=function(e){var t=void 0,o=void 0,n=0,i;for(i in e)if(e.hasOwnProperty(i)){var a=e[i].getValue();a!==void 0&&(t=t===void 0?a:Mo(a,t),o=o===void 0?a:Co(a,o),n+=a)}if(t!==void 0&&o!==void 0)for(i in e)e.hasOwnProperty(i)&&e[i].setValueRange(t,o,n)},fo.prototype.isActive=function(){return!this.activator||this.activator.active},fo.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)},fo.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)},fo.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)},fo.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)},fo.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)},fo.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)},fo.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)},fo.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)},fo.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)},fo.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)},fo.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)},fo.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)},fo.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)},fo.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)},fo.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)},fo.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)},fo.prototype.editNodeMode=function(){return console.log("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)},fo.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)},fo.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)},fo.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)},fo.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)},fo.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)},fo.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)},fo.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)},fo.prototype.getConnectedNodes=function(e){return void 0===this.body.nodes[e]?this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments):this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments)},fo.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)},fo.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)},fo.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)},fo.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)},fo.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)},fo.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)},fo.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodes.apply(this.selectionHandler,arguments)},fo.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdges.apply(this.selectionHandler,arguments)},fo.prototype.getNodeAt=function(){var e=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return void 0!==e&&void 0!==e.id?e.id:e},fo.prototype.getEdgeAt=function(){var e=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return void 0!==e&&void 0!==e.id?e.id:e},fo.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)},fo.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)},fo.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.redraw()},fo.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)},fo.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)},fo.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)},fo.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)},fo.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)},fo.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)},fo.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)},fo.prototype.getOptionsFromConfigurator=function(){var e={};return this.configurator&&(e=this.configurator.getOptions.apply(this.configurator)),e};var xu=Le(function(e,t){t.prepareElements=function(e){for(var t in e)e.hasOwnProperty(t)&&(e[t].redundant=e[t].used,e[t].used=[])},t.cleanupElements=function(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t].redundant){for(var o=0;o<e[t].redundant.length;o++)e[t].redundant[o].parentNode.removeChild(e[t].redundant[o]);e[t].redundant=[]}},t.resetElements=function(e){t.prepareElements(e),t.cleanupElements(e),t.prepareElements(e)},t.getSVGElement=function(e,t,o){var n;return t.hasOwnProperty(e)?0<t[e].redundant.length?(n=t[e].redundant[0],t[e].redundant.shift()):(n=document.createElementNS("http://www.w3.org/2000/svg",e),o.appendChild(n)):(n=document.createElementNS("http://www.w3.org/2000/svg",e),t[e]={used:[],redundant:[]},o.appendChild(n)),t[e].used.push(n),n},t.getDOMElement=function(e,t,o,n){var i;return t.hasOwnProperty(e)?0<t[e].redundant.length?(i=t[e].redundant[0],t[e].redundant.shift()):(i=document.createElement(e),void 0===n?o.appendChild(i):o.insertBefore(i,n)):(i=document.createElement(e),t[e]={used:[],redundant:[]},void 0===n?o.appendChild(i):o.insertBefore(i,n)),t[e].used.push(i),i},t.drawPoint=function(e,o,n,i,a,d){var s;if("circle"==n.style?(s=t.getSVGElement("circle",i,a),s.setAttributeNS(null,"cx",e),s.setAttributeNS(null,"cy",o),s.setAttributeNS(null,"r",.5*n.size)):(s=t.getSVGElement("rect",i,a),s.setAttributeNS(null,"x",e-.5*n.size),s.setAttributeNS(null,"y",o-.5*n.size),s.setAttributeNS(null,"width",n.size),s.setAttributeNS(null,"height",n.size)),void 0!==n.styles&&s.setAttributeNS(null,"style",n.styles),s.setAttributeNS(null,"class",n.className+" vis-point"),d){var r=t.getSVGElement("text",i,a);d.xOffset&&(e+=d.xOffset),d.yOffset&&(o+=d.yOffset),d.content&&(r.textContent=d.content),d.className&&r.setAttributeNS(null,"class",d.className+" vis-label"),r.setAttributeNS(null,"x",e),r.setAttributeNS(null,"y",o)}return s},t.drawBar=function(e,o,n,i,a,d,s,r){if(0!=i){0>i&&(i*=-1,o-=i);var l=t.getSVGElement("rect",d,s);l.setAttributeNS(null,"x",e-.5*n),l.setAttributeNS(null,"y",o),l.setAttributeNS(null,"width",n),l.setAttributeNS(null,"height",i),l.setAttributeNS(null,"class",a),r&&l.setAttributeNS(null,"style",r)}}}),Su=xu.prepareElements,Ou=xu.cleanupElements,Du=xu.resetElements,Tu=xu.getSVGElement,Eu=xu.getDOMElement,Cu=xu.drawPoint,Mu=xu.drawBar,Iu=Object.freeze({default:xu,__moduleExports:xu,prepareElements:Su,cleanupElements:Ou,resetElements:Du,getSVGElement:Tu,getDOMElement:Eu,drawPoint:Cu,drawBar:Mu}),Pu=Le(function(e){(function(t,o){e.exports=o()})(Ds,function(){function t(){return Ht.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function n(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function i(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function a(e){return void 0===e}function d(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function s(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function r(e,t){var o=[],n;for(n=0;n<e.length;++n)o.push(t(e[n],n));return o}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){for(var o in t)l(t,o)&&(e[o]=t[o]);return l(t,"toString")&&(e.toString=t.toString),l(t,"valueOf")&&(e.valueOf=t.valueOf),e}function u(e,t,o,n){return Ke(e,t,o,n,!0).utc()}function p(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function h(e){return null==e._pf&&(e._pf=p()),e._pf}function g(e){if(null==e._isValid){var t=h(e),o=jt.call(t.parsedDateParts,function(e){return null!=e}),n=!isNaN(e._d.getTime())&&0>t.overflow&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&o);if(e._strict&&(n=n&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null==Object.isFrozen||!Object.isFrozen(e))e._isValid=n;else return n}return e._isValid}function m(e){var t=u(NaN);return null==e?h(t).userInvalidated=!0:c(h(t),e),t}function y(e,t){var o,n,d;if(a(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),a(t._i)||(e._i=t._i),a(t._f)||(e._f=t._f),a(t._l)||(e._l=t._l),a(t._strict)||(e._strict=t._strict),a(t._tzm)||(e._tzm=t._tzm),a(t._isUTC)||(e._isUTC=t._isUTC),a(t._offset)||(e._offset=t._offset),a(t._pf)||(e._pf=h(t)),a(t._locale)||(e._locale=t._locale),0<Wt.length)for(o=0;o<Wt.length;o++)n=Wt[o],d=t[n],a(d)||(e[n]=d);return e}function f(e){y(this,e),this._d=new Date(null==e._d?NaN:e._d.getTime()),this.isValid()||(this._d=new Date(NaN)),!1===Ut&&(Ut=!0,t.updateOffset(this),Ut=!1)}function b(e){return e instanceof f||null!=e&&null!=e._isAMomentObject}function _(e){return 0>e?xo(e)||0:Eo(e)}function v(e){var t=+e,o=0;return 0!=t&&isFinite(t)&&(o=_(t)),o}function k(e,t,o){var n=Mo(e.length,t.length),a=So(e.length-t.length),d=0,s;for(s=0;s<n;s++)(o&&e[s]!==t[s]||!o&&v(e[s])!==v(t[s]))&&d++;return d+a}function w(e){!1===t.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function x(e,o){var n=!0;return c(function(){if(null!=t.deprecationHandler&&t.deprecationHandler(null,e),n){for(var a=[],d=0,s;d<arguments.length;d++){if(s="","object"==typeof arguments[d]){for(var r in s+="\n["+d+"] ",arguments[0])s+=r+": "+arguments[0][r]+", ";s=s.slice(0,-2)}else s=arguments[d];a.push(s)}w(e+"\nArguments: "+Array.prototype.slice.call(a).join("")+"\n"+new Error().stack),n=!1}return o.apply(this,arguments)},o)}function S(e,o){null!=t.deprecationHandler&&t.deprecationHandler(e,o),Vt[e]||(w(o),Vt[e]=!0)}function O(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function D(e){var t,o;for(o in e)t=e[o],O(t)?this[o]=t:this["_"+o]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function T(e,t){var o=c({},e),i;for(i in t)l(t,i)&&(n(e[i])&&n(t[i])?(o[i]={},c(o[i],e[i]),c(o[i],t[i])):null==t[i]?delete o[i]:o[i]=t[i]);for(i in e)l(e,i)&&!l(t,i)&&n(e[i])&&(o[i]=c({},o[i]));return o}function E(e){null!=e&&this.set(e)}function C(e,t,o){var n=this._calendar[e]||this._calendar.sameElse;return O(n)?n.call(t,o):n}function M(e){var t=this._longDateFormat[e],o=this._longDateFormat[e.toUpperCase()];return t||!o?t:(this._longDateFormat[e]=o.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])}function I(e,t){var o=e.toLowerCase();Xt[o]=Xt[o+"s"]=Xt[t]=e}function P(e){return"string"==typeof e?Xt[e]||Xt[e.toLowerCase()]:void 0}function F(e){var t={},o,n;for(n in e)l(e,n)&&(o=P(n),o&&(t[o]=e[n]));return t}function N(e,t){Zt[e]=t}function Y(e){var t=[];for(var o in e)t.push({unit:o,priority:Zt[o]});return t.sort(function(e,t){return e.priority-t.priority}),t}function R(e,t,o){var n=""+So(e),i=t-n.length;return(0<=e?o?"+":"":"-")+ko(10,Co(0,i)).toString().substr(1)+n}function z(e,t,o,n){var i=n;"string"==typeof n&&(i=function(){return this[n]()}),e&&(Jt[e]=i),t&&(Jt[t[0]]=function(){return R(i.apply(this,arguments),t[1],t[2])}),o&&(Jt[o]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function B(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function L(e){var t=e.match($t),o,n;for(o=0,n=t.length;o<n;o++)t[o]=Jt[t[o]]?Jt[t[o]]:B(t[o]);return function(o){var a="",d;for(d=0;d<n;d++)a+=O(t[d])?t[d].call(o,e):t[d];return a}}function A(e,t){return e.isValid()?(t=H(t,e.localeData()),Qt[t]=Qt[t]||L(t),Qt[t](e)):e.localeData().invalidDate()}function H(e,t){function o(e){return t.longDateFormat(e)||e}var n=5;for(Kt.lastIndex=0;0<=n&&Kt.test(e);)e=e.replace(Kt,o),Kt.lastIndex=0,n-=1;return e}function j(e,t,o){bo[e]=O(t)?t:function(e){return e&&o?o:t}}function W(e,t){return l(bo,e)?bo[e](t._strict,t._locale):new RegExp(U(e))}function U(e){return V(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,o,n,i){return t||o||n||i}))}function V(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function G(e,t){var o=t,n;for("string"==typeof e&&(e=[e]),d(t)&&(o=function(e,o){o[t]=v(e)}),n=0;n<e.length;n++)_o[e[n]]=o}function q(e,t){G(e,function(e,o,n,i){n._w=n._w||{},t(e,n._w,n,i)})}function X(e,t,o){null!=t&&l(_o,e)&&_o[e](t,o._a,o,e)}function Z(e){return $(e)?366:365}function $(e){return 0==e%4&&0!=e%100||0==e%400}function K(e,o){return function(n){return null==n?Q(this,e):(J(this,e,n),t.updateOffset(this,o),this)}}function Q(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function J(e,t,o){e.isValid()&&!isNaN(o)&&("FullYear"===t&&$(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](o,e.month(),oe(o,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](o))}function ee(e,t){if("object"==typeof e){e=F(e);for(var o=Y(e),n=0;n<o.length;n++)this[o[n].unit](e[o[n].unit])}else if(e=P(e),O(this[e]))return this[e](t);return this}function te(e,t){return(e%t+t)%t}function oe(e,t){if(isNaN(e)||isNaN(t))return NaN;var o=te(t,12);return e+=(t-o)/12,1===o?$(e)?29:28:31-o%7%2}function ne(e,t,o){var n=e.toLocaleLowerCase(),a,d,s;if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],a=0;12>a;++a)s=u([2e3,a]),this._shortMonthsParse[a]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[a]=this.months(s,"").toLocaleLowerCase();return o?"MMM"===t?(d=No.call(this._shortMonthsParse,n),-1===d?null:d):(d=No.call(this._longMonthsParse,n),-1===d?null:d):"MMM"===t?(d=No.call(this._shortMonthsParse,n),-1!==d)?d:(d=No.call(this._longMonthsParse,n),-1===d?null:d):(d=No.call(this._longMonthsParse,n),-1!==d)?d:(d=No.call(this._shortMonthsParse,n),-1===d?null:d)}function ie(e,t,o){var n,a,d;if(this._monthsParseExact)return ne.call(this,e,t,o);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;12>n;n++){if(a=u([2e3,n]),o&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),o||this._monthsParse[n]||(d="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[n]=new RegExp(d.replace(".",""),"i")),o&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(o&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!o&&this._monthsParse[n].test(e))return n}}function ae(e,t){var o;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=v(t);else if(t=e.localeData().monthsParse(t),!d(t))return e;return o=Mo(e.date(),oe(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,o),e}function de(e){return null==e?Q(this,"Month"):(ae(this,e),t.updateOffset(this,!0),this)}function se(){function e(e,t){return t.length-e.length}var t=[],o=[],n=[],a,d;for(a=0;12>a;a++)d=u([2e3,a]),t.push(this.monthsShort(d,"")),o.push(this.months(d,"")),n.push(this.months(d,"")),n.push(this.monthsShort(d,""));for(t.sort(e),o.sort(e),n.sort(e),a=0;12>a;a++)t[a]=V(t[a]),o[a]=V(o[a]);for(a=0;24>a;a++)n[a]=V(n[a]);this._monthsRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function re(e,t,o,n,i,a,d){var s;return 100>e&&0<=e?(s=new Date(e+400,t,o,n,i,a,d),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,o,n,i,a,d),s}function le(e){var t;if(100>e&&0<=e){var o=Array.prototype.slice.call(arguments);o[0]=e+400,t=new Date(Date.UTC.apply(null,o)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)}else t=new Date(Date.UTC.apply(null,arguments));return t}function ce(e,t,o){var n=7+t-o,i=(7+le(e,0,n).getUTCDay()-t)%7;return-i+n-1}function ue(e,t,o,n,i){var a=ce(e,n,i),d=1+7*(t-1)+(7+o-n)%7+a,s,r;return 0>=d?(s=e-1,r=Z(s)+d):d>Z(e)?(s=e+1,r=d-Z(e)):(s=e,r=d),{year:s,dayOfYear:r}}function pe(e,t,o){var n=ce(e.year(),t,o),i=Eo((e.dayOfYear()-n-1)/7)+1,a,d;return 1>i?(d=e.year()-1,a=i+he(d,t,o)):i>he(e.year(),t,o)?(a=i-he(e.year(),t,o),d=e.year()+1):(d=e.year(),a=i),{week:a,year:d}}function he(e,t,o){var n=ce(e,t,o),i=ce(e+1,t,o);return(Z(e)-n+i)/7}function ge(e,t){return"string"==typeof e?isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10):e}function me(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function ye(e,t){return e.slice(t,7).concat(e.slice(0,t))}function fe(e,t,o){var n=e.toLocaleLowerCase(),a,d,s;if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],a=0;7>a;++a)s=u([2e3,1]).day(a),this._minWeekdaysParse[a]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[a]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[a]=this.weekdays(s,"").toLocaleLowerCase();return o?"dddd"===t?(d=No.call(this._weekdaysParse,n),-1===d?null:d):"ddd"===t?(d=No.call(this._shortWeekdaysParse,n),-1===d?null:d):(d=No.call(this._minWeekdaysParse,n),-1===d?null:d):"dddd"===t?(d=No.call(this._weekdaysParse,n),-1!==d)?d:(d=No.call(this._shortWeekdaysParse,n),-1!==d)?d:(d=No.call(this._minWeekdaysParse,n),-1===d?null:d):"ddd"===t?(d=No.call(this._shortWeekdaysParse,n),-1!==d)?d:(d=No.call(this._weekdaysParse,n),-1!==d)?d:(d=No.call(this._minWeekdaysParse,n),-1===d?null:d):(d=No.call(this._minWeekdaysParse,n),-1!==d)?d:(d=No.call(this._weekdaysParse,n),-1!==d)?d:(d=No.call(this._shortWeekdaysParse,n),-1===d?null:d)}function be(e,t,o){var n,a,d;if(this._weekdaysParseExact)return fe.call(this,e,t,o);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;7>n;n++){if(a=u([2e3,1]).day(n),o&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(d="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[n]=new RegExp(d.replace(".",""),"i")),o&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(o&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(o&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;if(!o&&this._weekdaysParse[n].test(e))return n}}function _e(){function e(e,t){return t.length-e.length}var t=[],o=[],n=[],a=[],d,s,r,l,c;for(d=0;7>d;d++)s=u([2e3,1]).day(d),r=this.weekdaysMin(s,""),l=this.weekdaysShort(s,""),c=this.weekdays(s,""),t.push(r),o.push(l),n.push(c),a.push(r),a.push(l),a.push(c);for(t.sort(e),o.sort(e),n.sort(e),a.sort(e),d=0;7>d;d++)o[d]=V(o[d]),n[d]=V(n[d]),a[d]=V(a[d]);this._weekdaysRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function ve(){return this.hours()%12||12}function ke(e,t){z(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function we(e,t){return t._meridiemParse}function xe(e){return e?e.toLowerCase().replace("_","-"):e}function Se(e){for(var t=0,o,n,a,d;t<e.length;){for(d=xe(e[t]).split("-"),o=d.length,n=xe(e[t+1]),n=n?n.split("-"):null;0<o;){if(a=Oe(d.slice(0,o).join("-")),a)return a;if(n&&n.length>=o&&k(d,n,!0)>=o-1)break;o--}t++}return Ko}function Oe(t){var o=null;if(!Ho[t]&&!0&&e&&e.exports)try{o=Ko._abbr;Be("./locale/"+t),De(o)}catch(t){}return Ho[t]}function De(e,t){var o;return e&&(o=a(t)?Ee(e):Te(e,t),o?Ko=o:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Ko._abbr}function Te(e,t){if(null!==t){var o=Ao,n;if(t.abbr=e,null!=Ho[e])S("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),o=Ho[e]._config;else if(null!=t.parentLocale)if(null!=Ho[t.parentLocale])o=Ho[t.parentLocale]._config;else if(n=Oe(t.parentLocale),null!=n)o=n._config;else return jo[t.parentLocale]||(jo[t.parentLocale]=[]),jo[t.parentLocale].push({name:e,config:t}),null;return Ho[e]=new E(T(o,t)),jo[e]&&jo[e].forEach(function(e){Te(e.name,e.config)}),De(e),Ho[e]}return delete Ho[e],null}function Ee(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Ko;if(!o(e)){if(t=Oe(e),t)return t;e=[e]}return Se(e)}function Ce(){return Gt(Ho)}function Me(e){var t=e._a,o;return t&&-2===h(e).overflow&&(o=0>t[1]||11<t[1]?1:1>t[2]||t[2]>oe(t[0],t[1])?2:0>t[3]||24<t[3]||24===t[3]&&(0!==t[4]||0!==t[5]||0!==t[6])?3:0>t[4]||59<t[4]?4:0>t[5]||59<t[5]?5:0>t[6]||999<t[6]?6:-1,h(e)._overflowDayOfYear&&(0>o||2<o)&&(o=2),h(e)._overflowWeeks&&-1===o&&(o=7),h(e)._overflowWeekday&&-1===o&&(o=8),h(e).overflow=o),e}function Ie(e,t,o){return null==e?null==t?o:t:e}function Pe(e){var o=new Date(t.now());return e._useUTC?[o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()]:[o.getFullYear(),o.getMonth(),o.getDate()]}function Fe(e){var t=[],o,n,a,d,s;if(!e._d){for(a=Pe(e),e._w&&null==e._a[2]&&null==e._a[1]&&Ne(e),null!=e._dayOfYear&&(s=Ie(e._a[0],a[0]),(e._dayOfYear>Z(s)||0===e._dayOfYear)&&(h(e)._overflowDayOfYear=!0),n=le(s,0,e._dayOfYear),e._a[1]=n.getUTCMonth(),e._a[2]=n.getUTCDate()),o=0;3>o&&null==e._a[o];++o)e._a[o]=t[o]=a[o];for(;7>o;o++)e._a[o]=t[o]=null==e._a[o]?2===o?1:0:e._a[o];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?le:re).apply(null,t),d=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&"undefined"!=typeof e._w.d&&e._w.d!==d&&(h(e).weekdayMismatch=!0)}}function Ne(e){var t,o,n,i,a,d,s,r;if(t=e._w,null!=t.GG||null!=t.W||null!=t.E)a=1,d=4,o=Ie(t.GG,e._a[0],pe(Qe(),1,4).year),n=Ie(t.W,1),i=Ie(t.E,1),(1>i||7<i)&&(r=!0);else{a=e._locale._week.dow,d=e._locale._week.doy;var l=pe(Qe(),a,d);o=Ie(t.gg,e._a[0],l.year),n=Ie(t.w,l.week),null==t.d?null==t.e?i=a:(i=t.e+a,(0>t.e||6<t.e)&&(r=!0)):(i=t.d,(0>i||6<i)&&(r=!0))}1>n||n>he(o,a,d)?h(e)._overflowWeeks=!0:null==r?(s=ue(o,n,i,a,d),e._a[0]=s.year,e._dayOfYear=s.dayOfYear):h(e)._overflowWeekday=!0}function Ye(e){var t=e._i,o=Wo.exec(t)||Uo.exec(t),n,a,d,s,r,c;if(o){for(h(e).iso=!0,n=0,a=Go.length;n<a;n++)if(Go[n][1].exec(o[1])){s=Go[n][0],d=!1!==Go[n][2];break}if(null==s)return void(e._isValid=!1);if(o[3]){for(n=0,a=qo.length;n<a;n++)if(qo[n][1].exec(o[3])){r=(o[2]||" ")+qo[n][0];break}if(null==r)return void(e._isValid=!1)}if(!d&&null!=r)return void(e._isValid=!1);if(o[4])if(Vo.exec(o[4]))c="Z";else return void(e._isValid=!1);e._f=s+(r||"")+(c||""),Ue(e)}else e._isValid=!1}function Re(e,t,o,n,i,a){var d=[ze(e),Ro.indexOf(t),parseInt(o,10),parseInt(n,10),parseInt(i,10)];return a&&d.push(parseInt(a,10)),d}function ze(e){var t=parseInt(e,10);return 49>=t?2e3+t:999>=t?1900+t:t}function Le(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Ae(e,t,o){if(e){var n=zo.indexOf(e),i=new Date(t[0],t[1],t[2]).getDay();if(n!==i)return h(o).weekdayMismatch=!0,o._isValid=!1,!1}return!0}function He(e,t,o){if(e)return $o[e];if(t)return 0;var n=parseInt(o,10),i=n%100;return 60*((n-i)/100)+i}function je(e){var t=Zo.exec(Le(e._i));if(t){var o=Re(t[4],t[3],t[2],t[5],t[6],t[7]);if(!Ae(t[1],o,e))return;e._a=o,e._tzm=He(t[8],t[9],t[10]),e._d=le.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),h(e).rfc2822=!0}else e._isValid=!1}function We(e){var o=Xo.exec(e._i);if(null!==o)return void(e._d=new Date(+o[1]));if(Ye(e),!1===e._isValid)delete e._isValid;else return;if(je(e),!1===e._isValid)delete e._isValid;else return;t.createFromInputFallback(e)}function Ue(e){if(e._f===t.ISO_8601)return void Ye(e);if(e._f===t.RFC_2822)return void je(e);e._a=[],h(e).empty=!0;var o=""+e._i,n=o.length,a=0,d,s,r,l,c;for(r=H(e._f,e._locale).match($t)||[],d=0;d<r.length;d++)l=r[d],s=(o.match(W(l,e))||[])[0],s&&(c=o.substr(0,o.indexOf(s)),0<c.length&&h(e).unusedInput.push(c),o=o.slice(o.indexOf(s)+s.length),a+=s.length),Jt[l]?(s?h(e).empty=!1:h(e).unusedTokens.push(l),X(l,s,e)):e._strict&&!s&&h(e).unusedTokens.push(l);h(e).charsLeftOver=n-a,0<o.length&&h(e).unusedInput.push(o),12>=e._a[3]&&!0===h(e).bigHour&&0<e._a[3]&&(h(e).bigHour=void 0),h(e).parsedDateParts=e._a.slice(0),h(e).meridiem=e._meridiem,e._a[3]=Ve(e._locale,e._a[3],e._meridiem),Fe(e),Me(e)}function Ve(e,t,o){var n;return null==o?t:null==e.meridiemHour?null==e.isPM?t:(n=e.isPM(o),n&&12>t&&(t+=12),n||12!==t||(t=0),t):e.meridiemHour(t,o)}function Ge(e){var t,o,n,a,d;if(0===e._f.length)return h(e).invalidFormat=!0,void(e._d=new Date(NaN));for(a=0;a<e._f.length;a++)(d=0,t=y({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[a],Ue(t),!!g(t))&&(d+=h(t).charsLeftOver,d+=10*h(t).unusedTokens.length,h(t).score=d,(null==n||d<n)&&(n=d,o=t));c(e,o||t)}function qe(e){if(!e._d){var t=F(e._i);e._a=r([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Fe(e)}}function Xe(e){var t=new f(Me(Ze(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Ze(e){var t=e._i,n=e._f;return(e._locale=e._locale||Ee(e._l),null===t||void 0===n&&""===t)?m({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),b(t))?new f(Me(t)):(s(t)?e._d=t:o(n)?Ge(e):n?Ue(e):$e(e),g(e)||(e._d=null),e)}function $e(e){var i=e._i;a(i)?e._d=new Date(t.now()):s(i)?e._d=new Date(i.valueOf()):"string"==typeof i?We(e):o(i)?(e._a=r(i.slice(0),function(e){return parseInt(e,10)}),Fe(e)):n(i)?qe(e):d(i)?e._d=new Date(i):t.createFromInputFallback(e)}function Ke(e,t,a,d,s){var r={};return(!0===a||!1===a)&&(d=a,a=void 0),(n(e)&&i(e)||o(e)&&0===e.length)&&(e=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=s,r._l=a,r._i=e,r._f=t,r._strict=d,Xe(r)}function Qe(e,t,o,n){return Ke(e,t,o,n,!1)}function Je(e,t){var n,a;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Qe();for(n=t[0],a=1;a<t.length;++a)(!t[a].isValid()||t[a][e](n))&&(n=t[a]);return n}function et(e){for(var t in e)if(-1===No.call(en,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var o=!1,n=0;n<en.length;++n)if(e[en[n]]){if(o)return!1;parseFloat(e[en[n]])!==v(e[en[n]])&&(o=!0)}return!0}function tt(e){var t=F(e),o=t.year||0,n=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,d=t.day||0,s=t.hour||0,r=t.minute||0,l=t.second||0,c=t.millisecond||0;this._isValid=et(t),this._milliseconds=+c+1e3*l+6e4*r+60*(60*(1e3*s)),this._days=+d+7*a,this._months=+i+3*n+12*o,this._data={},this._locale=Ee(),this._bubble()}function ot(e){return e instanceof tt}function nt(e){return 0>e?-1*vo(-1*e):vo(e)}function it(e,t){z(e,0,0,function(){var e=this.utcOffset(),o="+";return 0>e&&(e=-e,o="-"),o+R(~~(e/60),2)+t+R(~~e%60,2)})}function at(e,t){var o=(t||"").match(e);if(null===o)return null;var n=o[o.length-1]||[],i=(n+"").match(tn)||["-",0,0],a=+(60*i[1])+v(i[2]);return 0===a?0:"+"===i[0]?a:-a}function dt(e,o){var n,i;return o._isUTC?(n=o.clone(),i=(b(e)||s(e)?e.valueOf():Qe(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+i),t.updateOffset(n,!1),n):Qe(e).local()}function st(e){return 15*-vo(e._d.getTimezoneOffset()/15)}function rt(){if(!a(this._isDSTShifted))return this._isDSTShifted;var e={};if(y(e,this),e=Ze(e),e._a){var t=e._isUTC?u(e._a):Qe(e._a);this._isDSTShifted=this.isValid()&&0<k(e._a,t.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted}function lt(){return!!this.isValid()&&this._isUTC&&0===this._offset}function ct(e,t){var o=e,n=null,i,a,s;return ot(e)?o={ms:e._milliseconds,d:e._days,M:e._months}:d(e)?(o={},t?o[t]=e:o.milliseconds=e):(n=on.exec(e))?(i="-"===n[1]?-1:1,o={y:0,d:v(n[2])*i,h:v(n[3])*i,m:v(n[4])*i,s:v(n[5])*i,ms:v(nt(1e3*n[6]))*i}):(n=nn.exec(e))?(i="-"===n[1]?-1:1,o={y:ut(n[2],i),M:ut(n[3],i),w:ut(n[4],i),d:ut(n[5],i),h:ut(n[6],i),m:ut(n[7],i),s:ut(n[8],i)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(s=ht(Qe(o.from),Qe(o.to)),o={},o.ms=s.milliseconds,o.M=s.months),a=new tt(o),ot(e)&&l(e,"_locale")&&(a._locale=e._locale),a}function ut(e,t){var o=e&&parseFloat(e.replace(",","."));return(isNaN(o)?0:o)*t}function pt(e,t){var o={};return o.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(o.months,"M").isAfter(t)&&--o.months,o.milliseconds=+t-+e.clone().add(o.months,"M"),o}function ht(e,t){var o;return e.isValid()&&t.isValid()?(t=dt(t,e),e.isBefore(t)?o=pt(e,t):(o=pt(t,e),o.milliseconds=-o.milliseconds,o.months=-o.months),o):{milliseconds:0,months:0}}function gt(e,t){return function(o,n){var i,a;return null===n||isNaN(+n)||(S(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=o,o=n,n=a),o="string"==typeof o?+o:o,i=ct(o,n),mt(this,i,e),this}}function mt(e,o,n,i){var a=o._milliseconds,d=nt(o._days),s=nt(o._months);e.isValid()&&(i=null==i||i,s&&ae(e,Q(e,"Month")+s*n),d&&J(e,"Date",Q(e,"Date")+d*n),a&&e._d.setTime(e._d.valueOf()+a*n),i&&t.updateOffset(e,d||s))}function yt(e,t){var o=12*(t.year()-e.year())+(t.month()-e.month()),n=e.clone().add(o,"months"),i,a;return 0>t-n?(i=e.clone().add(o-1,"months"),a=(t-n)/(n-i)):(i=e.clone().add(o+1,"months"),a=(t-n)/(i-n)),-(o+a)||0}function ft(e){var t;return void 0===e?this._locale._abbr:(t=Ee(e),null!=t&&(this._locale=t),this)}function bt(){return this._locale}function _t(e,t){return(e%t+t)%t}function vt(e,t,o){return 100>e&&0<=e?new Date(e+400,t,o)-12622780800000:new Date(e,t,o).valueOf()}function kt(e,t,o){return 100>e&&0<=e?Date.UTC(e+400,t,o)-12622780800000:Date.UTC(e,t,o)}function wt(e,t){z(0,[e,e.length],0,t)}function xt(e,t,o,n,i){var a;return null==e?pe(this,n,i).year:(a=he(e,n,i),t>a&&(t=a),St.call(this,e,t,o,n,i))}function St(e,t,o,n,i){var a=ue(e,t,o,n,i),d=le(a.year,0,a.dayOfYear);return this.year(d.getUTCFullYear()),this.month(d.getUTCMonth()),this.date(d.getUTCDate()),this}function Ot(e,t){t[6]=v(1e3*("0."+e))}function Dt(e){return e}function Tt(e,t,o,n){var i=Ee(),a=u().set(n,t);return i[o](a,e)}function Et(e,t,o){if(d(e)&&(t=e,e=void 0),e=e||"",null!=t)return Tt(e,t,o,"month");var n=[],a;for(a=0;12>a;a++)n[a]=Tt(e,a,o,"month");return n}function Ct(e,t,o,n){"boolean"==typeof e?(d(t)&&(o=t,t=void 0),t=t||""):(t=e,o=t,e=!1,d(t)&&(o=t,t=void 0),t=t||"");var a=Ee(),s=e?a._week.dow:0;if(null!=o)return Tt(t,(o+s)%7,n,"day");var r=[],l;for(l=0;7>l;l++)r[l]=Tt(t,(l+s)%7,n,"day");return r}function Mt(e,t,o,n){var i=ct(t,o);return e._milliseconds+=n*i._milliseconds,e._days+=n*i._days,e._months+=n*i._months,e._bubble()}function It(e){return 0>e?Eo(e):xo(e)}function Pt(e){return 4800*e/146097}function Ft(e){return 146097*e/4800}function Nt(e){return function(){return this.as(e)}}function Yt(e){return function(){return this.isValid()?this._data[e]:NaN}}function Rt(e,t,o,n,i){return i.relativeTime(t||1,!!o,e,n)}function zt(e,t,o){var n=ct(e).abs(),i=Pn(n.as("s")),d=Pn(n.as("m")),s=Pn(n.as("h")),r=Pn(n.as("d")),l=Pn(n.as("M")),c=Pn(n.as("y")),u=i<=Fn.ss&&["s",i]||i<Fn.s&&["ss",i]||1>=d&&["m"]||d<Fn.m&&["mm",d]||1>=s&&["h"]||s<Fn.h&&["hh",s]||1>=r&&["d"]||r<Fn.d&&["dd",r]||1>=l&&["M"]||l<Fn.M&&["MM",l]||1>=c&&["y"]||["yy",c];return u[2]=t,u[3]=0<+e,u[4]=o,Rt.apply(null,u)}function Bt(e){return void 0===e?Pn:"function"==typeof e&&(Pn=e,!0)}function Lt(e){return(0<e)-(0>e)||+e}function At(){if(!this.isValid())return this.localeData().invalidDate();var e=Nn(this._milliseconds)/1e3,t=Nn(this._days),o=Nn(this._months),n,i,a;n=_(e/60),i=_(n/60),e%=60,n%=60,a=_(o/12),o%=12;var d=a,r=o,l=t,c=i,u=n,p=e?e.toFixed(3).replace(/\.?0+$/,""):"",s=this.asSeconds();if(!s)return"P0D";var h=0>s?"-":"",g=Lt(this._months)===Lt(s)?"":"-",m=Lt(this._days)===Lt(s)?"":"-",y=Lt(this._milliseconds)===Lt(s)?"":"-";return h+"P"+(d?g+d+"Y":"")+(r?g+r+"M":"")+(l?m+l+"D":"")+(c||u||p?"T":"")+(c?y+c+"H":"")+(u?y+u+"M":"")+(p?y+p+"S":"")}var Ht,jt;jt=Array.prototype.some?Array.prototype.some:function(e){for(var o=Object(this),t=o.length>>>0,n=0;n<t;n++)if(n in o&&e.call(this,o[n],n,o))return!0;return!1};var Wt=t.momentProperties=[],Ut=!1,Vt={};t.suppressDeprecationWarnings=!1,t.deprecationHandler=null;var Gt=Object.keys?Object.keys:function(e){var t=[],o;for(o in e)l(e,o)&&t.push(o);return t};var qt=/\d{1,2}/,Xt={},Zt={},$t=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Kt=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Qt={},Jt={},eo=/\d/,to=/\d\d/,oo=/\d{3}/,no=/\d{4}/,io=/[+-]?\d{6}/,ao=/\d\d?/,so=/\d\d\d\d?/,ro=/\d\d\d\d\d\d?/,lo=/\d{1,3}/,co=/\d{1,4}/,uo=/[+-]?\d{1,6}/,po=/\d+/,ho=/[+-]?\d+/,go=/Z|[+-]\d\d:?\d\d/gi,mo=/Z|[+-]\d\d(?::?\d\d)?/gi,yo=/[+-]?\d+(\.\d{1,3})?/,fo=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,bo={},_o={},wo=0,Oo=1,Do=2,To=3,Io=4,Po=5;z("Y",0,0,function(){var e=this.year();return 9999>=e?""+e:"+"+e}),z(0,["YY",2],0,function(){return this.year()%100}),z(0,["YYYY",4],0,"year"),z(0,["YYYYY",5],0,"year"),z(0,["YYYYYY",6,!0],0,"year"),I("year","y"),N("year",1),j("Y",ho),j("YY",ao,to),j("YYYY",co,no),j("YYYYY",uo,io),j("YYYYYY",uo,io),G(["YYYYY","YYYYYY"],wo),G("YYYY",function(e,o){o[wo]=2===e.length?t.parseTwoDigitYear(e):v(e)}),G("YY",function(e,o){o[wo]=t.parseTwoDigitYear(e)}),G("Y",function(e,t){t[wo]=parseInt(e,10)}),t.parseTwoDigitYear=function(e){return v(e)+(68<v(e)?1900:2e3)};var Fo=K("FullYear",!0),No;No=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},z("M",["MM",2],"Mo",function(){return this.month()+1}),z("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),z("MMMM",0,0,function(e){return this.localeData().months(this,e)}),I("month","M"),N("month",8),j("M",ao),j("MM",ao,to),j("MMM",function(e,t){return t.monthsShortRegex(e)}),j("MMMM",function(e,t){return t.monthsRegex(e)}),G(["M","MM"],function(e,t){t[Oo]=v(e)-1}),G(["MMM","MMMM"],function(e,t,o,n){var i=o._locale.monthsParse(e,n,o._strict);null==i?h(o).invalidMonth=e:t[Oo]=i});var Yo=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ro=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];z("w",["ww",2],"wo","week"),z("W",["WW",2],"Wo","isoWeek"),I("week","w"),I("isoWeek","W"),N("week",5),N("isoWeek",5),j("w",ao),j("ww",ao,to),j("W",ao),j("WW",ao,to),q(["w","ww","W","WW"],function(e,t,o,n){t[n.substr(0,1)]=v(e)});z("d",0,"do","day"),z("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),z("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),z("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),z("e",0,0,"weekday"),z("E",0,0,"isoWeekday"),I("day","d"),I("weekday","e"),I("isoWeekday","E"),N("day",11),N("weekday",11),N("isoWeekday",11),j("d",ao),j("e",ao),j("E",ao),j("dd",function(e,t){return t.weekdaysMinRegex(e)}),j("ddd",function(e,t){return t.weekdaysShortRegex(e)}),j("dddd",function(e,t){return t.weekdaysRegex(e)}),q(["dd","ddd","dddd"],function(e,t,o,n){var i=o._locale.weekdaysParse(e,n,o._strict);null==i?h(o).invalidWeekday=e:t.d=i}),q(["d","e","E"],function(e,t,o,n){t[n]=v(e)});var zo=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];z("H",["HH",2],0,"hour"),z("h",["hh",2],0,ve),z("k",["kk",2],0,function(){return this.hours()||24}),z("hmm",0,0,function(){return""+ve.apply(this)+R(this.minutes(),2)}),z("hmmss",0,0,function(){return""+ve.apply(this)+R(this.minutes(),2)+R(this.seconds(),2)}),z("Hmm",0,0,function(){return""+this.hours()+R(this.minutes(),2)}),z("Hmmss",0,0,function(){return""+this.hours()+R(this.minutes(),2)+R(this.seconds(),2)}),ke("a",!0),ke("A",!1),I("hour","h"),N("hour",13),j("a",we),j("A",we),j("H",ao),j("h",ao),j("k",ao),j("HH",ao,to),j("hh",ao,to),j("kk",ao,to),j("hmm",so),j("hmmss",ro),j("Hmm",so),j("Hmmss",ro),G(["H","HH"],To),G(["k","kk"],function(e,t){var o=v(e);t[To]=24===o?0:o}),G(["a","A"],function(e,t,o){o._isPm=o._locale.isPM(e),o._meridiem=e}),G(["h","hh"],function(e,t,o){t[To]=v(e),h(o).bigHour=!0}),G("hmm",function(e,t,o){var n=e.length-2;t[To]=v(e.substr(0,n)),t[Io]=v(e.substr(n)),h(o).bigHour=!0}),G("hmmss",function(e,t,o){var n=e.length-4,i=e.length-2;t[To]=v(e.substr(0,n)),t[Io]=v(e.substr(n,2)),t[Po]=v(e.substr(i)),h(o).bigHour=!0}),G("Hmm",function(e,t){var o=e.length-2;t[To]=v(e.substr(0,o)),t[Io]=v(e.substr(o))}),G("Hmmss",function(e,t){var o=e.length-4,n=e.length-2;t[To]=v(e.substr(0,o)),t[Io]=v(e.substr(o,2)),t[Po]=v(e.substr(n))});var Bo=/[ap]\.?m?\.?/i,Lo=K("Hours",!0),Ao={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:qt,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:Ro,week:{dow:0,doy:6},weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekdaysShort:zo,meridiemParse:Bo},Ho={},jo={},Wo=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Uo=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Vo=/Z|[+-]\d\d(?::?\d\d)?/,Go=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],qo=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Xo=/^\/?Date\((\-?\d+)/i,Zo=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,$o={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480},Ko;t.createFromInputFallback=x("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),t.ISO_8601=function(){},t.RFC_2822=function(){};var Qo=x("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Qe.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:m()}),Jo=x("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Qe.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:m()}),en=["year","quarter","month","week","day","hour","minute","second","millisecond"];it("Z",":"),it("ZZ",""),j("Z",mo),j("ZZ",mo),G(["Z","ZZ"],function(e,t,o){o._useUTC=!0,o._tzm=at(mo,e)});var tn=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var on=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,nn=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;ct.fn=tt.prototype,ct.invalid=function(){return ct(NaN)};var an=gt(1,"add"),dn=gt(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var sn=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});z(0,["gg",2],0,function(){return this.weekYear()%100}),z(0,["GG",2],0,function(){return this.isoWeekYear()%100}),wt("gggg","weekYear"),wt("ggggg","weekYear"),wt("GGGG","isoWeekYear"),wt("GGGGG","isoWeekYear"),I("weekYear","gg"),I("isoWeekYear","GG"),N("weekYear",1),N("isoWeekYear",1),j("G",ho),j("g",ho),j("GG",ao,to),j("gg",ao,to),j("GGGG",co,no),j("gggg",co,no),j("GGGGG",uo,io),j("ggggg",uo,io),q(["gggg","ggggg","GGGG","GGGGG"],function(e,t,o,n){t[n.substr(0,2)]=v(e)}),q(["gg","GG"],function(e,o,n,i){o[i]=t.parseTwoDigitYear(e)}),z("Q",0,"Qo","quarter"),I("quarter","Q"),N("quarter",7),j("Q",eo),G("Q",function(e,t){t[Oo]=3*(v(e)-1)}),z("D",["DD",2],"Do","date"),I("date","D"),N("date",9),j("D",ao),j("DD",ao,to),j("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),G(["D","DD"],Do),G("Do",function(e,t){t[Do]=v(e.match(ao)[0])});var rn=K("Date",!0);z("DDD",["DDDD",3],"DDDo","dayOfYear"),I("dayOfYear","DDD"),N("dayOfYear",4),j("DDD",lo),j("DDDD",oo),G(["DDD","DDDD"],function(e,t,o){o._dayOfYear=v(e)}),z("m",["mm",2],0,"minute"),I("minute","m"),N("minute",14),j("m",ao),j("mm",ao,to),G(["m","mm"],Io);var ln=K("Minutes",!1);z("s",["ss",2],0,"second"),I("second","s"),N("second",15),j("s",ao),j("ss",ao,to),G(["s","ss"],Po);var cn=K("Seconds",!1);z("S",0,0,function(){return~~(this.millisecond()/100)}),z(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),z(0,["SSS",3],0,"millisecond"),z(0,["SSSS",4],0,function(){return 10*this.millisecond()}),z(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),z(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),z(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),z(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),z(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),I("millisecond","ms"),N("millisecond",16),j("S",lo,eo),j("SS",lo,to),j("SSS",lo,oo);var un;for(un="SSSS";9>=un.length;un+="S")j(un,po);for(un="S";9>=un.length;un+="S")G(un,Ot);var pn=K("Milliseconds",!1);z("z",0,0,"zoneAbbr"),z("zz",0,0,"zoneName");var hn=f.prototype;hn.add=an,hn.calendar=function(e,o){var n=e||Qe(),i=dt(n,this).startOf("day"),a=t.calendarFormat(this,i)||"sameElse",d=o&&(O(o[a])?o[a].call(this,n):o[a]);return this.format(d||this.localeData().calendar(a,this,Qe(n)))},hn.clone=function(){return new f(this)},hn.diff=function(e,t,o){var n,i,a;return this.isValid()?(n=dt(e,this),!n.isValid())?NaN:(i=6e4*(n.utcOffset()-this.utcOffset()),t=P(t),(a="year"===t?yt(this,n)/12:"month"===t?yt(this,n):"quarter"===t?yt(this,n)/3:"second"===t?(this-n)/1e3:"minute"===t?(this-n)/6e4:"hour"===t?(this-n)/36e5:"day"===t?(this-n-i)/864e5:"week"===t?(this-n-i)/6048e5:this-n,o?a:_(a))):NaN},hn.endOf=function(e){var o;if(e=P(e),void 0===e||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?kt:vt;return"year"===e?o=n(this.year()+1,0,1)-1:"quarter"===e?o=n(this.year(),this.month()-this.month()%3+3,1)-1:"month"===e?o=n(this.year(),this.month()+1,1)-1:"week"===e?o=n(this.year(),this.month(),this.date()-this.weekday()+7)-1:"isoWeek"===e?o=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1:"day"===e||"date"===e?o=n(this.year(),this.month(),this.date()+1)-1:"hour"===e?(o=this._d.valueOf(),o+=3600000-_t(o+(this._isUTC?0:60000*this.utcOffset()),3600000)-1):"minute"===e?(o=this._d.valueOf(),o+=60000-_t(o,60000)-1):"second"===e?(o=this._d.valueOf(),o+=1000-_t(o,1000)-1):void 0,this._d.setTime(o),t.updateOffset(this,!0),this},hn.format=function(e){e||(e=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var o=A(this,e);return this.localeData().postformat(o)},hn.from=function(e,t){return this.isValid()&&(b(e)&&e.isValid()||Qe(e).isValid())?ct({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},hn.fromNow=function(e){return this.from(Qe(),e)},hn.to=function(e,t){return this.isValid()&&(b(e)&&e.isValid()||Qe(e).isValid())?ct({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},hn.toNow=function(e){return this.to(Qe(),e)},hn.get=function(e){return e=P(e),O(this[e])?this[e]():this},hn.invalidAt=function(){return h(this).overflow},hn.isAfter=function(e,t){var o=b(e)?e:Qe(e);return!!(this.isValid()&&o.isValid())&&(t=P(t)||"millisecond","millisecond"===t?this.valueOf()>o.valueOf():o.valueOf()<this.clone().startOf(t).valueOf())},hn.isBefore=function(e,t){var o=b(e)?e:Qe(e);return!!(this.isValid()&&o.isValid())&&(t=P(t)||"millisecond","millisecond"===t?this.valueOf()<o.valueOf():this.clone().endOf(t).valueOf()<o.valueOf())},hn.isBetween=function(e,t,o,n){var i=b(e)?e:Qe(e),a=b(t)?t:Qe(t);return!!(this.isValid()&&i.isValid()&&a.isValid())&&(n=n||"()",("("===n[0]?this.isAfter(i,o):!this.isBefore(i,o))&&(")"===n[1]?this.isBefore(a,o):!this.isAfter(a,o)))},hn.isSame=function(e,t){var o=b(e)?e:Qe(e),n;return!!(this.isValid()&&o.isValid())&&(t=P(t)||"millisecond","millisecond"===t?this.valueOf()===o.valueOf():(n=o.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},hn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},hn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},hn.isValid=function(){return g(this)},hn.lang=sn,hn.locale=ft,hn.localeData=bt,hn.max=Jo,hn.min=Qo,hn.parsingFlags=function(){return c({},h(this))},hn.set=ee,hn.startOf=function(e){var o;if(e=P(e),void 0===e||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?kt:vt;return"year"===e?o=n(this.year(),0,1):"quarter"===e?o=n(this.year(),this.month()-this.month()%3,1):"month"===e?o=n(this.year(),this.month(),1):"week"===e?o=n(this.year(),this.month(),this.date()-this.weekday()):"isoWeek"===e?o=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)):"day"===e||"date"===e?o=n(this.year(),this.month(),this.date()):"hour"===e?(o=this._d.valueOf(),o-=_t(o+(this._isUTC?0:60000*this.utcOffset()),3600000)):"minute"===e?(o=this._d.valueOf(),o-=_t(o,60000)):"second"===e?(o=this._d.valueOf(),o-=_t(o,1000)):void 0,this._d.setTime(o),t.updateOffset(this,!0),this},hn.subtract=dn,hn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},hn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},hn.toDate=function(){return new Date(this.valueOf())},hn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,o=t?this.clone().utc():this;return 0>o.year()||9999<o.year()?A(o,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):O(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+1e3*(60*this.utcOffset())).toISOString().replace("Z",A(o,"Z")):A(o,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},hn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var o="["+e+"(\"]",n=0<=this.year()&&9999>=this.year()?"YYYY":"YYYYYY",i=t+"[\")]";return this.format(o+n+"-MM-DD[T]HH:mm:ss.SSS"+i)},hn.toJSON=function(){return this.isValid()?this.toISOString():null},hn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},hn.unix=function(){return Eo(this.valueOf()/1e3)},hn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},hn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},hn.year=Fo,hn.isLeapYear=function(){return $(this.year())},hn.weekYear=function(e){return xt.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},hn.isoWeekYear=function(e){return xt.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},hn.quarter=hn.quarters=function(e){return null==e?xo((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},hn.month=de,hn.daysInMonth=function(){return oe(this.year(),this.month())},hn.week=hn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},hn.isoWeek=hn.isoWeeks=function(e){var t=pe(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},hn.weeksInYear=function(){var e=this.localeData()._week;return he(this.year(),e.dow,e.doy)},hn.isoWeeksInYear=function(){return he(this.year(),1,4)},hn.date=rn,hn.day=hn.days=function(e){if(!this.isValid())return null==e?NaN:this;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null==e?t:(e=ge(e,this.localeData()),this.add(e-t,"d"))},hn.weekday=function(e){if(!this.isValid())return null==e?NaN:this;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},hn.isoWeekday=function(e){if(!this.isValid())return null==e?NaN:this;if(null!=e){var t=me(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},hn.dayOfYear=function(e){var t=vo((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},hn.hour=hn.hours=Lo,hn.minute=hn.minutes=ln,hn.second=hn.seconds=cn,hn.millisecond=hn.milliseconds=pn,hn.utcOffset=function(e,o,n){var i=this._offset||0,a;if(!this.isValid())return null==e?NaN:this;if(null!=e){if("string"!=typeof e)16>So(e)&&!n&&(e*=60);else if(e=at(mo,e),null===e)return this;return!this._isUTC&&o&&(a=st(this)),this._offset=e,this._isUTC=!0,null!=a&&this.add(a,"m"),i!==e&&(!o||this._changeInProgress?mt(this,ct(e-i,"m"),1,!1):!this._changeInProgress&&(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:st(this)},hn.utc=function(e){return this.utcOffset(0,e)},hn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(st(this),"m")),this},hn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=at(go,this._i);null==e?this.utcOffset(0,!0):this.utcOffset(e)}return this},hn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Qe(e).utcOffset():0,0==(this.utcOffset()-e)%60)},hn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},hn.isLocal=function(){return!!this.isValid()&&!this._isUTC},hn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},hn.isUtc=lt,hn.isUTC=lt,hn.zoneAbbr=function(){return this._isUTC?"UTC":""},hn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},hn.dates=x("dates accessor is deprecated. Use date instead.",rn),hn.months=x("months accessor is deprecated. Use month instead",de),hn.years=x("years accessor is deprecated. Use year instead",Fo),hn.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null==e?-this.utcOffset():("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this)}),hn.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",rt);var gn=E.prototype;gn.calendar=C,gn.longDateFormat=M,gn.invalidDate=function(){return this._invalidDate},gn.ordinal=function(e){return this._ordinal.replace("%d",e)},gn.preparse=Dt,gn.postformat=Dt,gn.relativeTime=function(e,t,o,n){var i=this._relativeTime[o];return O(i)?i(e,t,o,n):i.replace(/%d/i,e)},gn.pastFuture=function(e,t){var o=this._relativeTime[0<e?"future":"past"];return O(o)?o(t):o.replace(/%s/i,t)},gn.set=D,gn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Yo).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},gn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Yo.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},gn.monthsParse=ie,gn.monthsRegex=function(e){return this._monthsParseExact?(l(this,"_monthsRegex")||se.call(this),e?this._monthsStrictRegex:this._monthsRegex):(l(this,"_monthsRegex")||(this._monthsRegex=fo),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},gn.monthsShortRegex=function(e){return this._monthsParseExact?(l(this,"_monthsRegex")||se.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(l(this,"_monthsShortRegex")||(this._monthsShortRegex=fo),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},gn.week=function(e){return pe(e,this._week.dow,this._week.doy).week},gn.firstDayOfYear=function(){return this._week.doy},gn.firstDayOfWeek=function(){return this._week.dow},gn.weekdays=function(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?ye(n,this._week.dow):e?n[e.day()]:n},gn.weekdaysMin=function(e){return!0===e?ye(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},gn.weekdaysShort=function(e){return!0===e?ye(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},gn.weekdaysParse=be,gn.weekdaysRegex=function(e){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||_e.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(l(this,"_weekdaysRegex")||(this._weekdaysRegex=fo),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},gn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||_e.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(l(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=fo),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},gn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||_e.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(l(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=fo),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},gn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},gn.meridiem=function(e,t,o){return 11<e?o?"pm":"PM":o?"am":"AM"},De("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,o=1===v(e%100/10)?"th":1==t?"st":2==t?"nd":3==t?"rd":"th";return e+o}}),t.lang=x("moment.lang is deprecated. Use moment.locale instead.",De),t.langData=x("moment.langData is deprecated. Use moment.localeData instead.",Ee);var mn=So,yn=Nt("ms"),fn=Nt("s"),bn=Nt("m"),_n=Nt("h"),vn=Nt("d"),kn=Nt("w"),wn=Nt("M"),xn=Nt("Q"),Sn=Nt("y"),On=Yt("milliseconds"),Dn=Yt("seconds"),Tn=Yt("minutes"),En=Yt("hours"),Cn=Yt("days"),Mn=Yt("months"),In=Yt("years"),Pn=vo,Fn={ss:44,s:45,m:45,h:22,d:26,M:11},Nn=So,Yn=tt.prototype;return Yn.isValid=function(){return this._isValid},Yn.abs=function(){var e=this._data;return this._milliseconds=mn(this._milliseconds),this._days=mn(this._days),this._months=mn(this._months),e.milliseconds=mn(e.milliseconds),e.seconds=mn(e.seconds),e.minutes=mn(e.minutes),e.hours=mn(e.hours),e.months=mn(e.months),e.years=mn(e.years),this},Yn.add=function(e,t){return Mt(this,e,t,1)},Yn.subtract=function(e,t){return Mt(this,e,t,-1)},Yn.as=function(e){if(!this.isValid())return NaN;var t=this._milliseconds,o,n;if(e=P(e),"month"===e||"quarter"===e||"year"===e)switch(o=this._days+t/864e5,n=this._months+Pt(o),e){case"month":return n;case"quarter":return n/3;case"year":return n/12;}else switch(o=this._days+vo(Ft(this._months)),e){case"week":return o/7+t/6048e5;case"day":return o+t/864e5;case"hour":return 24*o+t/36e5;case"minute":return 1440*o+t/6e4;case"second":return 86400*o+t/1e3;case"millisecond":return Eo(864e5*o)+t;default:throw new Error("Unknown unit "+e);}},Yn.asMilliseconds=yn,Yn.asSeconds=fn,Yn.asMinutes=bn,Yn.asHours=_n,Yn.asDays=vn,Yn.asWeeks=kn,Yn.asMonths=wn,Yn.asQuarters=xn,Yn.asYears=Sn,Yn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+2592e6*(this._months%12)+31536e6*v(this._months/12):NaN},Yn._bubble=function(){var e=this._milliseconds,t=this._days,o=this._months,n=this._data,i,a,d,s,r;return 0<=e&&0<=t&&0<=o||0>=e&&0>=t&&0>=o||(e+=864e5*It(Ft(o)+t),t=0,o=0),n.milliseconds=e%1e3,i=_(e/1e3),n.seconds=i%60,a=_(i/60),n.minutes=a%60,d=_(a/60),n.hours=d%24,t+=_(d/24),r=_(Pt(t)),o+=r,t-=It(Ft(r)),s=_(o/12),o%=12,n.days=t,n.months=o,n.years=s,this},Yn.clone=function(){return ct(this)},Yn.get=function(e){return e=P(e),this.isValid()?this[e+"s"]():NaN},Yn.milliseconds=On,Yn.seconds=Dn,Yn.minutes=Tn,Yn.hours=En,Yn.days=Cn,Yn.weeks=function(){return _(this.days()/7)},Yn.months=Mn,Yn.years=In,Yn.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),o=zt(this,!e,t);return e&&(o=t.pastFuture(+this,o)),t.postformat(o)},Yn.toISOString=At,Yn.toString=At,Yn.toJSON=At,Yn.locale=ft,Yn.localeData=bt,Yn.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",At),Yn.lang=sn,z("X",0,0,"unix"),z("x",0,0,"valueOf"),j("x",ho),j("X",yo),G("X",function(e,t,o){o._d=new Date(1e3*parseFloat(e,10))}),G("x",function(e,t,o){o._d=new Date(v(e))}),t.version="2.24.0",function(e){Ht=e}(Qe),t.fn=hn,t.min=function(){var e=[].slice.call(arguments,0);return Je("isBefore",e)},t.max=function(){var e=[].slice.call(arguments,0);return Je("isAfter",e)},t.now=function(){return Date.now?Date.now():+new Date},t.utc=u,t.unix=function(e){return Qe(1e3*e)},t.months=function(e,t){return Et(e,t,"months")},t.isDate=s,t.locale=De,t.invalid=m,t.duration=ct,t.isMoment=b,t.weekdays=function(e,t,o){return Ct(e,t,o,"weekdays")},t.parseZone=function(){return Qe.apply(null,arguments).parseZone()},t.localeData=Ee,t.isDuration=ot,t.monthsShort=function(e,t){return Et(e,t,"monthsShort")},t.weekdaysMin=function(e,t,o){return Ct(e,t,o,"weekdaysMin")},t.defineLocale=Te,t.updateLocale=function(e,t){if(null!=t){var o=Ao,n,i;i=Oe(e),null!=i&&(o=i._config),t=T(o,t),n=new E(t),n.parentLocale=Ho[e],Ho[e]=n,De(e)}else null!=Ho[e]&&(null==Ho[e].parentLocale?null!=Ho[e]&&delete Ho[e]:Ho[e]=Ho[e].parentLocale);return Ho[e]},t.locales=Ce,t.weekdaysShort=function(e,t,o){return Ct(e,t,o,"weekdaysShort")},t.normalizeUnits=P,t.relativeTimeRounding=Bt,t.relativeTimeThreshold=function(e,t){return void 0!==Fn[e]&&(void 0===t?Fn[e]:(Fn[e]=t,"s"===e&&(Fn.ss=t-1),!0))},t.calendarFormat=function(e,t){var o=e.diff(t,"days",!0);return-6>o?"sameElse":-1>o?"lastWeek":0>o?"lastDay":1>o?"sameDay":2>o?"nextDay":7>o?"nextWeek":"sameElse"},t.prototype=hn,t.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},t})}),Fu="undefined"!=typeof window&&window.moment||Pu,Nu=Object.freeze({default:Fu,__moduleExports:Fu}),Yu={Images:ml,dotparser:Hs,gephiParser:js,allOptions:vu,convertDot:Ls,convertGephi:ut},Ru=Object.freeze({util:Ud,data:Os,network:Yu,DOMutil:Iu,moment:Nu,Hammer:cl,keycharm:Vs,DataSet:xs,DataView:Ss,Queue:_s,Network:fo});e.DOMutil=Iu,e.DataSet=xs,e.DataView=Ss,e.Hammer=cl,e.Network=fo,e.Queue=_s,e.data=Os,e.default=Ru,e.keycharm=Vs,e.moment=Nu,e.network=Yu,e.util=Ud,Object.defineProperty(e,"__esModule",{value:!0})});
26//# sourceMappingURL=vis-network.min.js.map